Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by netdev-bot+sashiko
Tue, 01 Dec 2026 06:39
Re: [PATCH net-next v11 04/10] bnge: add RXFH ethtool support
Author: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 06:39
Date: Tue, 01 Dec 2026 06:39
188 lines
14678 bytes
14678 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads