diff options
author | lipeng <lipeng321@huawei.com> | 2017-04-01 12:03:39 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-03 14:48:43 -0700 |
commit | 64ec10dc2ab8ef5bc6e76b1d4bc8203c08a6da1e (patch) | |
tree | dbd83f5a3b7e7826f4fa4c8b1f071b9e7b37d4e5 /drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | |
parent | f2aaed557ecff57f7523f889acf1981fb23c4047 (diff) | |
download | linux-stable-64ec10dc2ab8ef5bc6e76b1d4bc8203c08a6da1e.tar.gz linux-stable-64ec10dc2ab8ef5bc6e76b1d4bc8203c08a6da1e.tar.bz2 linux-stable-64ec10dc2ab8ef5bc6e76b1d4bc8203c08a6da1e.zip |
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_ae_adapt.c')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c index cd7e88e433b6..f0142e50048e 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c @@ -826,8 +826,9 @@ static int hns_ae_get_rss(struct hnae_handle *handle, u32 *indir, u8 *key, memcpy(key, ppe_cb->rss_key, HNS_PPEV2_RSS_KEY_SIZE); /* update the current hash->queue mappings from the shadow RSS table */ - memcpy(indir, ppe_cb->rss_indir_table, - HNS_PPEV2_RSS_IND_TBL_SIZE * sizeof(*indir)); + if (indir) + memcpy(indir, ppe_cb->rss_indir_table, + HNS_PPEV2_RSS_IND_TBL_SIZE * sizeof(*indir)); return 0; } @@ -838,15 +839,19 @@ static int hns_ae_set_rss(struct hnae_handle *handle, const u32 *indir, struct hns_ppe_cb *ppe_cb = hns_get_ppe_cb(handle); /* set the RSS Hash Key if specififed by the user */ - if (key) - hns_ppe_set_rss_key(ppe_cb, (u32 *)key); + if (key) { + memcpy(ppe_cb->rss_key, key, HNS_PPEV2_RSS_KEY_SIZE); + hns_ppe_set_rss_key(ppe_cb, ppe_cb->rss_key); + } - /* update the shadow RSS table with user specified qids */ - memcpy(ppe_cb->rss_indir_table, indir, - HNS_PPEV2_RSS_IND_TBL_SIZE * sizeof(*indir)); + if (indir) { + /* update the shadow RSS table with user specified qids */ + memcpy(ppe_cb->rss_indir_table, indir, + HNS_PPEV2_RSS_IND_TBL_SIZE * sizeof(*indir)); - /* now update the hardware */ - hns_ppe_set_indir_table(ppe_cb, ppe_cb->rss_indir_table); + /* now update the hardware */ + hns_ppe_set_indir_table(ppe_cb, ppe_cb->rss_indir_table); + } return 0; } |