]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
eth: bnxt: reject unsupported hash functions
authorJakub Kicinski <kuba@kernel.org>
Thu, 25 Jul 2024 22:23:49 +0000 (15:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Jul 2024 09:59:07 +0000 (10:59 +0100)
In commit under Fixes I split the bnxt_set_rxfh_context() function,
and attached the appropriate chunks to new ops. I missed that
bnxt_set_rxfh_context() gets called after some initial checks
in bnxt_set_rxfh(), namely that the hash function is Toeplitz.

Fixes: 5c466b4d4e75 ("eth: bnxt: move from .set_rxfh to .create_rxfh_context and friends")
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 d00ef0063820d74483f2c088f014d1f499baf77c..0425a54eca98653df1a74058bbdd2a0ef58f3b17 100644 (file)
@@ -1863,8 +1863,14 @@ static void bnxt_modify_rss(struct bnxt *bp, struct ethtool_rxfh_context *ctx,
 }
 
 static int bnxt_rxfh_context_check(struct bnxt *bp,
+                                  const struct ethtool_rxfh_param *rxfh,
                                   struct netlink_ext_ack *extack)
 {
+       if (rxfh->hfunc && rxfh->hfunc != ETH_RSS_HASH_TOP) {
+               NL_SET_ERR_MSG_MOD(extack, "RSS hash function not supported");
+               return -EOPNOTSUPP;
+       }
+
        if (!BNXT_SUPPORTS_MULTI_RSS_CTX(bp)) {
                NL_SET_ERR_MSG_MOD(extack, "RSS contexts not supported");
                return -EOPNOTSUPP;
@@ -1888,7 +1894,7 @@ static int bnxt_create_rxfh_context(struct net_device *dev,
        struct bnxt_vnic_info *vnic;
        int rc;
 
-       rc = bnxt_rxfh_context_check(bp, extack);
+       rc = bnxt_rxfh_context_check(bp, rxfh, extack);
        if (rc)
                return rc;
 
@@ -1953,7 +1959,7 @@ static int bnxt_modify_rxfh_context(struct net_device *dev,
        struct bnxt_rss_ctx *rss_ctx;
        int rc;
 
-       rc = bnxt_rxfh_context_check(bp, extack);
+       rc = bnxt_rxfh_context_check(bp, rxfh, extack);
        if (rc)
                return rc;