diff options
author | lipeng <lipeng321@huawei.com> | 2017-04-01 14:03:39 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-04 00:48:43 +0300 |
commit | 64ec10dc2ab8ef5bc6e76b1d4bc8203c08a6da1e (patch) | |
tree | dbd83f5a3b7e7826f4fa4c8b1f071b9e7b37d4e5 /drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | |
parent | f2aaed557ecff57f7523f889acf1981fb23c4047 (diff) | |
download | linux-64ec10dc2ab8ef5bc6e76b1d4bc8203c08a6da1e.tar.xz |
net: hns: Correct HNS RSS key set function
This patch fixes below ethtool configuration error:
localhost:~ # ethtool -X eth0 hkey XX:XX:XX...
Cannot set Rx flow hash configuration: Operation not supported
Signed-off-by: lipeng <lipeng321@huawei.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns/hns_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c index 3404eacaed7f..3a2a34250cc0 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c @@ -1244,6 +1244,7 @@ hns_set_rss(struct net_device *netdev, const u32 *indir, const u8 *key, { struct hns_nic_priv *priv = netdev_priv(netdev); struct hnae_ae_ops *ops; + int ret; if (AE_IS_VER1(priv->enet_ver)) { netdev_err(netdev, @@ -1253,12 +1254,10 @@ hns_set_rss(struct net_device *netdev, const u32 *indir, const u8 *key, ops = priv->ae_handle->dev->ops; - /* currently hfunc can only be Toeplitz hash */ - if (key || - (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)) + if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP) { + netdev_err(netdev, "Invalid hfunc!\n"); return -EOPNOTSUPP; - if (!indir) - return 0; + } return ops->set_rss(priv->ae_handle, indir, key, hfunc); } |