[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241220060807.6b5103a2@kernel.org>
Date: Fri, 20 Dec 2024 06:08:07 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Przemek Kitszel <przemyslaw.kitszel@...el.com>
Cc: Alexander Duyck <alexanderduyck@...com>, <netdev@...r.kernel.org>,
<edumazet@...gle.com>, <davem@...emloft.net>, <pabeni@...hat.com>
Subject: Re: [PATCH net-next 02/10] eth: fbnic: support querying RSS config
On Fri, 20 Dec 2024 12:42:42 +0100 Przemek Kitszel wrote:
> > +static int
> > +fbnic_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
> > +{
> > + struct fbnic_net *fbn = netdev_priv(netdev);
> > + unsigned int i;
>
> AFAIK index type should be spelled as u32
Does it matter? I have a weak preference for not using explicitly sized
types unless the bit width is itself meaningful.
> And will be best declared in the first clause of the for()
I don't see woohaii.
> > +
> > + rxfh->hfunc = ETH_RSS_HASH_TOP;
> > +
> > + if (rxfh->key) {
> > + for (i = 0; i < FBNIC_RPC_RSS_KEY_BYTE_LEN; i++) {
> > + u32 rss_key = fbn->rss_key[i / 4] << ((i % 4) * 8);
>
> are you dropping 75% of entropy provided in fbn->rss_key?
Nope, it's shifting out the unused bits. And below we shift back
down to the lowest byte.
We store the key as u32 (register width) while the uAPI is in u8.
> > +
> > + rxfh->key[i] = rss_key >> 24;
> > + }
> > + }
> > +
> > + if (rxfh->indir) {
> > + for (i = 0; i < FBNIC_RPC_RSS_TBL_SIZE; i++)
> > + rxfh->indir[i] = fbn->indir_tbl[0][i];
> > + }
> > +
> > + return 0;
Powered by blists - more mailing lists