diff options
author | Guangbin Huang <huangguangbin2@huawei.com> | 2021-02-05 16:32:45 +0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-02-06 14:36:05 -0800 |
commit | 87ce161e8c67aca9e64a77355f748e212122ace4 (patch) | |
tree | b445b402778bf303cc6f7ccb51c2d48089a00edd /drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | |
parent | net: hns3: add api capability bits for firmware (diff) | |
download | linux-dev-87ce161e8c67aca9e64a77355f748e212122ace4.tar.xz linux-dev-87ce161e8c67aca9e64a77355f748e212122ace4.zip |
net: hns3: RSS indirection table use device specification
As RSS indirection table size may be different in different
hardware. Instead of using macro, this value is better to use
device specification which querying from firmware.
BTW, RSS indirection table should be allocated by the queried
size instead the static array.
.get_rss_indir_size in struct hnae3_ae_ops is not used now,
so remove it as well.
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index e2fc443fe92c..79e0a9b14b68 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -859,11 +859,9 @@ static u32 hns3_get_rss_key_size(struct net_device *netdev) static u32 hns3_get_rss_indir_size(struct net_device *netdev) { struct hnae3_handle *h = hns3_get_handle(netdev); + struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev); - if (!h->ae_algo->ops->get_rss_indir_size) - return 0; - - return h->ae_algo->ops->get_rss_indir_size(h); + return ae_dev->dev_specs.rss_ind_tbl_size; } static int hns3_get_rss(struct net_device *netdev, u32 *indir, u8 *key, |