mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: vikas.gupta@broadcom.com
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	bhargava.marreddy@broadcom.com, rahul-rg.gupta@broadcom.com,
	vsrama-krishna.nemani@broadcom.com,
	rajashekar.hudumula@broadcom.com, dharmender.garg@broadcom.com,
	ajit.khaparde@broadcom.com
Subject: Re: [PATCH net-next v11 04/10] bnge: add RXFH ethtool support
Date: Tue, 01 Dec 2026 06:39:39 +0000	[thread overview]
Message-ID: <179610717939.3146.6640777046198275654@kernel.org> (raw)
In-Reply-To: <20261130055736.2306367-5-vikas.gupta@broadcom.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] In bnge_get_rxfh_fields()
  (drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c), the…
- [Low] bnge_reserve_rings()
  (drivers/net/ethernet/broadcom/bnge/bnge_resc.c) treats any change in…

--

bnge: add RXFH ethtool support

This adds ethtool get/set_rxfh and get/set_rxfh_fields support to bnge.
Configuration changes are only allowed while the device is down. It also
moves the default RSS key to netdev_rss_key_fill(), and makes
bnge_reserve_rings() keep a user-configured indirection table when it
still fits, reporting a reset table with ethtool_rxfh_indir_lost().

> diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c b/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
> index 2467e44de291a..878fe4888160f 100644
> --- a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
> +++ b/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c

[ ... ]

> +static u64 bnge_get_ethtool_ipv6_rss(struct bnge_dev *bd)
> +{
> +	if (bd->rss_hash_cfg & VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6)
> +		return RXH_IP_SRC | RXH_IP_DST;
> +	if (bd->rss_hash_cfg & VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6_FLOW_LABEL)
> +		return RXH_IP_SRC | RXH_IP_DST | RXH_IP6_FL;
> +	return 0;
> +}

[ ... ]

> +	case TCP_V6_FLOW:
> +		if (bd->rss_hash_cfg & VNIC_RSS_CFG_REQ_HASH_TYPE_TCP_IPV6)
> +			cmd->data |= RXH_IP_SRC | RXH_IP_DST |
> +				     RXH_L4_B_0_1 | RXH_L4_B_2_3;
> +		cmd->data |= bnge_get_ethtool_ipv6_rss(bd);
> +		break;

[ ... ]

> +static int bnge_set_rxfh_fields(struct net_device *dev,
> +				const struct ethtool_rxfh_fields *cmd,
> +				struct netlink_ext_ack *extack)
> +{

[ ... ]

> +	if (cmd->data == RXH_4TUPLE ||
> +	    cmd->data == (RXH_4TUPLE | RXH_IP6_FL))
> +		tuple = 4;

[ ... ]

> +	case IPV6_FLOW:
> +		if (cmd->data & RXH_IP6_FL) {
> +			rss_hash_cfg |= VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6_FLOW_LABEL;
> +			rss_hash_cfg &= ~VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6;
> +		} else if (tuple == 2 ||
> +			   (tuple == 4 &&
> +			    (rss_hash_cfg &
> +			     VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6_FLOW_LABEL))) {
> +			rss_hash_cfg |= VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6;
> +			rss_hash_cfg &= ~VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6_FLOW_LABEL;

[Severity: Medium]

Can the hardware hash on the L4 ports and the IPv6 flow label at the same
time?

bnge_set_rxfh_fields() accepts RXH_4TUPLE | RXH_IP6_FL as tuple 4. For
tcp6 this sets TCP_IPV6 and IPV6_FLOW_LABEL and clears IPV6. After that,
bnge_get_rxfh_fields() reports tcp6 as RXH_4TUPLE | RXH_IP6_FL, because
the TCP_V6_FLOW case ORs in bnge_get_ethtool_ipv6_rss().

The RX completion hash types decoded by bnge_rss_ext_op() in
bnge_hw_def.h appear to cover only the 4-tuple or the flow-label 3-tuple:

#define EXT_OP_INNER_4		0x0
#define EXT_OP_OUTER_4		0x2
#define EXT_OP_INNFL_3		0x8
#define EXT_OP_OUTFL_3		0xa

None of these is a ports-plus-flow-label type. That would mean TCP over
IPv6 is still hashed on the 4-tuple only.

If so, "ethtool -N <dev> rx-flow-hash tcp6 sdfnl" doesn't change tcp6
hashing. What it does change is all other IPv6 traffic, which moves from
the 2-tuple hash to the flow-label 3-tuple hash.

The reverse also happens. Setting plain RXH_4TUPLE on tcp6 while the
flow label is enabled takes the "tuple == 4 && IPV6_FLOW_LABEL" branch
above. That turns off flow-label hashing for every IPv6 flow type.

For comparison, bnxt_set_rxfh_fields() only accepts RXH_IP6_FL with the
2-tuple. Should bnge reject RXH_4TUPLE | RXH_IP6_FL in the same way?
And should bnge_get_rxfh_fields() stop reporting RXH_IP6_FL for an L4
flow type when that type's 4-tuple hash is enabled?

This code is unchanged at the end of the series.

[ ... ]

> diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
> index 5207091a72901..c1064e53cfbf8 100644
> --- a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
> +++ b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c

[ ... ]

> @@ -372,16 +386,31 @@ int bnge_reserve_rings(struct bnge_dev *bd)
>  	if (!bd->num_tc)
>  		bd->tx_nr_rings_per_tc = bd->tx_nr_rings;
>  
> -	if (rx_rings != bd->rx_nr_rings)
> +	rx_changed = rx_rings != bd->rx_nr_rings;
> +	if (rx_changed) {
>  		dev_warn(bd->dev, "RX rings resv reduced to %d than earlier %d requested\n",
>  			 rx_rings, bd->rx_nr_rings);
> +		indir_lost = bd->netdev &&
> +			     netif_is_rxfh_configured(bd->netdev) &&
> +			     (bnge_cal_nr_rss_ctxs(bd->rx_nr_rings) !=
> +			      bnge_cal_nr_rss_ctxs(rx_rings) ||
> +			      bnge_get_max_rss_ring(bd) >= rx_rings);
> +	}

[Severity: Low]

Is a change in bnge_cal_nr_rss_ctxs() enough by itself to treat the
user's table as lost?

bnge_get_rxfh_indir_size() is nr_rss_ctxs * BNGE_RSS_TABLE_ENTRIES, so a
change in the context count means the table shrinks. The ethtool core
already provides ethtool_rxfh_indir_can_resize() and
ethtool_rxfh_indir_resize() for this case. ethtool_rxfh_can_resize()
allows a shrink when the table is periodic:

	if (new_size < old_size) {
		if (new_size < user_size)
			return false;
		if (old_size % new_size)
			return false;
		if (!ethtool_rxfh_is_periodic(tbl, old_size, new_size))
			return false;
		return true;
	}

A short table set over netlink is replicated across the device table, so
it meets these conditions. One example is a 64-entry user table whose
entries all point at rings below the new rx count.

In bnge_reserve_rings() such a table is still reset by
bnge_set_dflt_rss_indir_tbl(). ethtool_rxfh_indir_lost() is then called,
which does three things:

- logs "device error, RSS indirection table lost"
- clears rss_indir_user_size
- sends ETHTOOL_MSG_RSS_NTF

The ethtool_rxfh_indir_lost() kernel-doc says to call it when the device
can no longer maintain the user-configured indirection table.

bnxt_reserve_rings() uses the same conservative condition. The commit
message also says the table is reset when it no longer "fits", so this
looks intentional.

Would it make sense to check with the core helpers whether the table can
be folded into the smaller size before dropping it?

This code is unchanged at the end of the series.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130055736.2306367-1-vikas.gupta%40broadcom.com

  reply	other threads:[~2026-12-01  6:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  5:57 [PATCH net-next v11 00/10] add features to bnge Vikas Gupta
2026-11-30  5:57 ` [PATCH net-next v11 01/10] bnge: restructure VNIC and filter code Vikas Gupta
2026-11-30  5:57 ` [PATCH net-next v11 02/10] bnge: add NTUPLE/ARFS VNIC Vikas Gupta
2026-12-01  6:39   ` netdev-bot+sashiko
2026-11-30  5:57 ` [PATCH net-next v11 03/10] bnge: add helper functions for multi RSS contexts Vikas Gupta
2026-12-01  6:39   ` netdev-bot+sashiko
2026-11-30  5:57 ` [PATCH net-next v11 04/10] bnge: add RXFH ethtool support Vikas Gupta
2026-12-01  6:39   ` netdev-bot+sashiko [this message]
2026-11-30  5:57 ` [PATCH net-next v11 05/10] bnge: add ethtool support to manage RSS contexts Vikas Gupta
2026-12-01  6:39   ` netdev-bot+sashiko
2026-11-30  5:57 ` [PATCH net-next v11 06/10] bnge: remove refcount from L2 filter Vikas Gupta
2026-11-30  5:57 ` [PATCH net-next v11 07/10] bnge: add NTUPLE filter infrastructure Vikas Gupta
2026-12-01  6:39   ` netdev-bot+sashiko
2026-11-30  5:57 ` [PATCH net-next v11 08/10] bnge: add NTUPLE filter support in ethtool Vikas Gupta
2026-12-01  6:39   ` netdev-bot+sashiko
2026-11-30  5:57 ` [PATCH net-next v11 09/10] bnge: add aRFS flow steering ndo support Vikas Gupta
2026-12-01  6:39   ` netdev-bot+sashiko
2026-11-30  5:57 ` [PATCH net-next v11 10/10] bnge: add cpu_rmap support for IRQ affinity Vikas Gupta
2026-12-01  6:39   ` netdev-bot+sashiko
2026-12-01 10:12     ` Vikas Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179610717939.3146.6640777046198275654@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=ajit.khaparde@broadcom.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bhargava.marreddy@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=dharmender.garg@broadcom.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rahul-rg.gupta@broadcom.com \
    --cc=rajashekar.hudumula@broadcom.com \
    --cc=vikas.gupta@broadcom.com \
    --cc=vsrama-krishna.nemani@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®