Skip to content

Commit daefd34

Browse files
kuba-moodavem330
authored andcommitted
eth: bnxt: reject unsupported hash functions
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: 5c466b4 ("eth: bnxt: move from .set_rxfh to .create_rxfh_context and friends") Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: Pavan Chebbi <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9da49aa commit daefd34

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,8 +1863,14 @@ static void bnxt_modify_rss(struct bnxt *bp, struct ethtool_rxfh_context *ctx,
18631863
}
18641864

18651865
static int bnxt_rxfh_context_check(struct bnxt *bp,
1866+
const struct ethtool_rxfh_param *rxfh,
18661867
struct netlink_ext_ack *extack)
18671868
{
1869+
if (rxfh->hfunc && rxfh->hfunc != ETH_RSS_HASH_TOP) {
1870+
NL_SET_ERR_MSG_MOD(extack, "RSS hash function not supported");
1871+
return -EOPNOTSUPP;
1872+
}
1873+
18681874
if (!BNXT_SUPPORTS_MULTI_RSS_CTX(bp)) {
18691875
NL_SET_ERR_MSG_MOD(extack, "RSS contexts not supported");
18701876
return -EOPNOTSUPP;
@@ -1888,7 +1894,7 @@ static int bnxt_create_rxfh_context(struct net_device *dev,
18881894
struct bnxt_vnic_info *vnic;
18891895
int rc;
18901896

1891-
rc = bnxt_rxfh_context_check(bp, extack);
1897+
rc = bnxt_rxfh_context_check(bp, rxfh, extack);
18921898
if (rc)
18931899
return rc;
18941900

@@ -1953,7 +1959,7 @@ static int bnxt_modify_rxfh_context(struct net_device *dev,
19531959
struct bnxt_rss_ctx *rss_ctx;
19541960
int rc;
19551961

1956-
rc = bnxt_rxfh_context_check(bp, extack);
1962+
rc = bnxt_rxfh_context_check(bp, rxfh, extack);
19571963
if (rc)
19581964
return rc;
19591965

0 commit comments

Comments
 (0)