]> www.infradead.org Git - users/hch/configfs.git/commitdiff
eth: bnxt: populate defaults in the RSS context struct
authorJakub Kicinski <kuba@kernel.org>
Thu, 25 Jul 2024 22:23:50 +0000 (15:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Jul 2024 09:59:07 +0000 (10:59 +0100)
As described in the kdoc for .create_rxfh_context we are responsible
for populating the defaults. The core will not call .get_rxfh
for non-0 context.

The problem can be easily observed since Netlink doesn't currently
use the cache. Using netlink ethtool:

  $ ethtool -x eth0 context 1
  [...]
  RSS hash key:
  13:60:cd:60:14:d3:55:36:86:df:90:f2:96:14:e2:21:05:57:a8:8f:a5:12:5e:54:62:7f:fd:3c:15:7e:76:05:71:42:a2:9a:73:80:09:9c
  RSS hash function:
      toeplitz: on
      xor: off
      crc32: off

But using IOCTL ethtool shows:

  $ ./ethtool-old -x eth0 context 1
  [...]
  RSS hash key:
  00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
  RSS hash function:
      Operation not supported

Fixes: 7964e7884643 ("net: ethtool: use the tracking array for get_rxfh on custom RSS contexts")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

index 0425a54eca98653df1a74058bbdd2a0ef58f3b17..ab8e3f197e7b12f4c7271db879c30a363015fd26 100644 (file)
@@ -1921,8 +1921,12 @@ static int bnxt_create_rxfh_context(struct net_device *dev,
        if (rc)
                goto out;
 
+       /* Populate defaults in the context */
        bnxt_set_dflt_rss_indir_tbl(bp, ctx);
+       ctx->hfunc = ETH_RSS_HASH_TOP;
        memcpy(vnic->rss_hash_key, bp->rss_hash_key, HW_HASH_KEY_SIZE);
+       memcpy(ethtool_rxfh_context_key(ctx),
+              bp->rss_hash_key, HW_HASH_KEY_SIZE);
 
        rc = bnxt_hwrm_vnic_alloc(bp, vnic, 0, bp->rx_nr_rings);
        if (rc) {