Subject: Re: [PATCH net-next 2/5] bnxt_en: Resize RSS contexts on channel count change

From: Jakub Kicinski <[email-masked]>
Date: Tue, 3 Mar 2026 16:05:24 -0800

On Tue,  3 Mar 2026 19:15:30 +0100 Björn Töpel wrote:
> -	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;
> +		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);

You resize the tables even if something else fails later on.
I think either this if () should only contain the validation checks,
and the actual resizing has to happen later.
Or you need to "un-resize" (which should never fail so it's fine).