[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200706115228.317e9915@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Mon, 6 Jul 2020 11:52:28 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Michael Chan <michael.chan@...adcom.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v3 6/8] bnxt_en: Implement ethtool -X to set
indirection table.
On Sun, 5 Jul 2020 18:22:10 -0400 Michael Chan wrote:
> + /* Reset the RSS indir table if we cannot reserve all the RX rings */
> + if (rx_rings != bp->rx_nr_rings) {
> + netdev_warn(bp->dev, "Able to reserve only %d out of %d requested RX rings\n",
> + rx_rings, bp->rx_nr_rings);
> + if (bp->dev->priv_flags & IFF_RXFH_CONFIGURED) {
> + netdev_warn(bp->dev, "RSS table entries reverting to default\n");
> + bp->dev->priv_flags &= ~IFF_RXFH_CONFIGURED;
> + }
> + }
Maybe let me just type out what I had in mind:
unsigned int bnxt_max_rss_ring(bp)
{
int i, tbl_size, max_ring;
if (!bp->rss_indir_tbl)
return 0;
max_ring = 0;
tbl_size = bnxt_get_rxfh_indir_size(dev);
for (i = 0; i < tbl_size; i++)
max_ring = max(max_ring, bp->rss_indir_tbl[i]);
return max_ring;
}
Then:
if (rx_rings != bp->rx_nr_rings) {
netdev_warn(bp->dev, "Able to reserve only %d out of %d requested RX rings\n",
rx_rings, bp->rx_nr_rings);
if (netif_is_rxfh_configured(bp->dev) &&
rx_rings < bnxt_max_rss_ring(bp)) {
netdev_err(bp->dev, "RSS table entries reverting to default\n");
bp->dev->priv_flags &= ~IFF_RXFH_CONFIGURED;
}
}
Powered by blists - more mailing lists