On Tue, Mar 3, 2026 at 10:15 AM Björn Töpel <[email protected]> wrote: > > bnxt_set_channels() rejects channel changes that alter the RSS table > size when IFF_RXFH_CONFIGURED is set, because non-default context > sizes were locked at creation.
Thanks for the patch. I want to point out that when running newer FW,
the RSS table size will not change when the channel count changes. If
FW supports it, we'll always use the largest RSS table size for better
traffic balance. A few more comments below.
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> index 26fcd52c8a61..7608e5d95630 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> @@ -977,11 +977,24 @@ static int bnxt_set_channels(struct net_device *dev,
> tx_xdp = req_rx_rings;
> }
>
> - if (bnxt_get_nr_rss_ctxs(bp, req_rx_rings) !=
> - bnxt_get_nr_rss_ctxs(bp, bp->rx_nr_rings) &&
> - netif_is_rxfh_configured(dev)) {
> - netdev_warn(dev, "RSS table size change required, RSS table
> entries must be default to proceed\n");
> - return -EINVAL;
> + if (bnxt_get_nr_rss_ctxs(bp, req_rx_rings) !=
> bnxt_get_nr_rss_ctxs(bp, bp->rx_nr_rings)) {
> + u32 new_size = bnxt_get_nr_rss_ctxs(bp, req_rx_rings) *
> BNXT_RSS_TABLE_ENTRIES_P5;
If the table size changes, it must be a P5 chip (and running older
FW). Addng a comment for this will be useful.
Also, this if statement should be moved below the bnxt_check_rings()
call. We don't want to change the RSS table unless it is confirmed
that we have enough rings to satisfy the new channels count.
> + u32 old_size = bnxt_get_rxfh_indir_size(dev);
> +
> + /* Validate context 0 can be resized before mutating anything
> */
> + if (netif_is_rxfh_configured(dev) &&
> + ethtool_rxfh_indir_can_resize(bp->rss_indir_tbl,
> old_size, new_size)) {
> + netdev_warn(dev, "RSS table size change not supported
> with current indirection table\n");
> + return -EINVAL;
> + }
> +
> + rc = ethtool_rxfh_contexts_resize_all(dev, new_size);
> + if (rc)
> + return rc;
> +
> + /* All validated; apply context 0 resize */
> + if (netif_is_rxfh_configured(dev))
> + ethtool_rxfh_indir_resize(bp->rss_indir_tbl,
> old_size, new_size);
> }
>
> rc = bnxt_check_rings(bp, req_tx_rings, req_rx_rings, sh, tcs,
> tx_xdp);
> --
> 2.53.0
>
smime.p7s
Description: S/MIME Cryptographic Signature

