[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aa36e48f-a54d-43df-979c-bb81a90257f0@intel.com>
Date: Fri, 20 Dec 2024 12:42:42 +0100
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: Jakub Kicinski <kuba@...nel.org>, Alexander Duyck <alexanderduyck@...com>
CC: <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 12/20/24 03:52, Jakub Kicinski wrote:
> From: Alexander Duyck <alexanderduyck@...com>
>
> The initial driver submission already added all the RSS state,
> as part of multi-queue support. Expose the configuration via
> the ethtool APIs.
>
> Signed-off-by: Alexander Duyck <alexanderduyck@...com>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
> .../net/ethernet/meta/fbnic/fbnic_ethtool.c | 103 ++++++++++++++++++
> 1 file changed, 103 insertions(+)
>
> +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
And will be best declared in the first clause of the for()
> +
> + 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?
> +
> + 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;
> +}
> +
> static int
> fbnic_get_ts_info(struct net_device *netdev,
> struct kernel_ethtool_ts_info *tsinfo)
> @@ -209,6 +308,10 @@ static const struct ethtool_ops fbnic_ethtool_ops = {
> .get_strings = fbnic_get_strings,
> .get_ethtool_stats = fbnic_get_ethtool_stats,
> .get_sset_count = fbnic_get_sset_count,
> + .get_rxnfc = fbnic_get_rxnfc,
> + .get_rxfh_key_size = fbnic_get_rxfh_key_size,
> + .get_rxfh_indir_size = fbnic_get_rxfh_indir_size,
> + .get_rxfh = fbnic_get_rxfh,
> .get_ts_info = fbnic_get_ts_info,
> .get_ts_stats = fbnic_get_ts_stats,
> .get_eth_mac_stats = fbnic_get_eth_mac_stats,
Powered by blists - more mailing lists