diff options
| author | Breno Leitao <leitao@debian.org> | 2026-01-09 20:40:58 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-01-10 23:21:06 +0300 |
| commit | 2103a5ed1b5b83f708da3dd9c2e5c8ddbd3ea7ce (patch) | |
| tree | a8d930edc6b06db59800956a1258bbd054430ad3 | |
| parent | a64f302022ba2f7e7b1cc185cbc95b454ae4ae8f (diff) | |
| download | linux-2103a5ed1b5b83f708da3dd9c2e5c8ddbd3ea7ce.tar.xz | |
net: hns: convert to use .get_rx_ring_count
Use the newly introduced .get_rx_ring_count ethtool ops callback instead
of handling ETHTOOL_GRXRINGS directly in .get_rxnfc().
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20260109-grxring_big_v1-v1-7-a0f77f732006@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
| -rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c index 60a586a951a0..23b295dedaef 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c @@ -1230,21 +1230,11 @@ hns_set_rss(struct net_device *netdev, struct ethtool_rxfh_param *rxfh, rxfh->indir, rxfh->key, rxfh->hfunc); } -static int hns_get_rxnfc(struct net_device *netdev, - struct ethtool_rxnfc *cmd, - u32 *rule_locs) +static u32 hns_get_rx_ring_count(struct net_device *netdev) { struct hns_nic_priv *priv = netdev_priv(netdev); - switch (cmd->cmd) { - case ETHTOOL_GRXRINGS: - cmd->data = priv->ae_handle->q_num; - break; - default: - return -EOPNOTSUPP; - } - - return 0; + return priv->ae_handle->q_num; } static const struct ethtool_ops hns_ethtool_ops = { @@ -1273,7 +1263,7 @@ static const struct ethtool_ops hns_ethtool_ops = { .get_rxfh_indir_size = hns_get_rss_indir_size, .get_rxfh = hns_get_rss, .set_rxfh = hns_set_rss, - .get_rxnfc = hns_get_rxnfc, + .get_rx_ring_count = hns_get_rx_ring_count, .get_link_ksettings = hns_nic_get_link_ksettings, .set_link_ksettings = hns_nic_set_link_ksettings, }; |
