Both ENETC v1 and ENETC v4 only support the toeplitz algorithm for RSS,
so add a check for RSS hfunc.

Signed-off-by: Wei Fang <wei.f...@nxp.com>
---
 drivers/net/ethernet/freescale/enetc/enetc_ethtool.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c 
b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
index bc65135925b8..6a47e2bd1d4f 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
@@ -753,6 +753,13 @@ static int enetc_set_rxfh(struct net_device *ndev,
        struct enetc_si *si = priv->si;
        int err = 0;
 
+       if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE &&
+           rxfh->hfunc != ETH_RSS_HASH_TOP) {
+               netdev_err(ndev, "Only toeplitz hash function is supported\n");
+
+               return -EOPNOTSUPP;
+       }
+
        /* set hash key, if PF */
        if (rxfh->key && enetc_si_is_pf(si))
                enetc_set_rss_key(si, rxfh->key);
-- 
2.34.1


Reply via email to