From: Jakub Kicinski <kuba@kernel.org>
To: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: Alexander Duyck <alexanderduyck@fb.com>, <netdev@vger.kernel.org>,
<edumazet@google.com>, <davem@davemloft.net>, <pabeni@redhat.com>
Subject: Re: [PATCH net-next 02/10] eth: fbnic: support querying RSS config
Date: Fri, 20 Dec 2024 06:08:07 -0800 [thread overview]
Message-ID: <20241220060807.6b5103a2@kernel.org> (raw)
In-Reply-To: <aa36e48f-a54d-43df-979c-bb81a90257f0@intel.com>
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;
next prev parent reply other threads:[~2024-12-20 14:08 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-20 2:52 [PATCH net-next 00/10] eth: fbnic: support basic RSS config and setting channel count Jakub Kicinski
2024-12-20 2:52 ` [PATCH net-next 01/10] eth: fbnic: reorder ethtool code Jakub Kicinski
2024-12-20 14:53 ` Larysa Zaremba
2024-12-20 17:38 ` Jakub Kicinski
2024-12-20 2:52 ` [PATCH net-next 02/10] eth: fbnic: support querying RSS config Jakub Kicinski
2024-12-20 11:42 ` Przemek Kitszel
2024-12-20 14:08 ` Jakub Kicinski [this message]
2024-12-20 14:23 ` Przemek Kitszel
2024-12-20 2:52 ` [PATCH net-next 03/10] eth: fbnic: don't reset the secondary RSS indir table Jakub Kicinski
2024-12-20 2:52 ` [PATCH net-next 04/10] eth: fbnic: support setting RSS configuration Jakub Kicinski
2024-12-20 2:52 ` [PATCH net-next 05/10] eth: fbnic: let user control the RSS hash fields Jakub Kicinski
2024-12-20 2:52 ` [PATCH net-next 06/10] eth: fbnic: store NAPIs in an array instead of the list Jakub Kicinski
2024-12-20 2:52 ` [PATCH net-next 07/10] eth: fbnic: add IRQ reuse support Jakub Kicinski
2024-12-20 2:52 ` [PATCH net-next 08/10] eth: fbnic: centralize the queue count and NAPI<>queue setting Jakub Kicinski
2024-12-20 2:52 ` [PATCH net-next 09/10] eth: fbnic: support ring channel get and set while down Jakub Kicinski
2024-12-20 2:52 ` [PATCH net-next 10/10] eth: fbnic: support ring channel set while up Jakub Kicinski
2024-12-20 13:49 ` Przemek Kitszel
2024-12-20 14:10 ` Jakub Kicinski
2024-12-20 15:02 ` Przemek Kitszel
2024-12-23 18:50 ` [PATCH net-next 00/10] eth: fbnic: support basic RSS config and setting channel count patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241220060807.6b5103a2@kernel.org \
--to=kuba@kernel.org \
--cc=alexanderduyck@fb.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).