From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org, shayagr@amazon.com,
akiyano@amazon.com, darinzon@amazon.com, skalluru@marvell.com,
manishc@marvell.com, michael.chan@broadcom.com,
pavan.chebbi@broadcom.com, sgoutham@marvell.com,
gakula@marvell.com, sbhatta@marvell.com, hkelam@marvell.com,
bbhushan2@marvell.com, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 4/5] eth: thunder: migrate to new RXFH callbacks
Date: Mon, 16 Jun 2025 18:45:54 -0700 [thread overview]
Message-ID: <20250617014555.434790-5-kuba@kernel.org> (raw)
In-Reply-To: <20250617014555.434790-1-kuba@kernel.org>
Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
The driver as no other RXNFC functionality so the SET callback can
be now removed.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
.../ethernet/cavium/thunder/nicvf_ethtool.c | 37 +++++++------------
1 file changed, 14 insertions(+), 23 deletions(-)
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c b/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
index d0ff0c170b1a..fc6053414b7d 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
@@ -516,8 +516,8 @@ static int nicvf_set_ringparam(struct net_device *netdev,
return 0;
}
-static int nicvf_get_rss_hash_opts(struct nicvf *nic,
- struct ethtool_rxnfc *info)
+static int nicvf_get_rxfh_fields(struct net_device *dev,
+ struct ethtool_rxfh_fields *info)
{
info->data = 0;
@@ -552,25 +552,28 @@ static int nicvf_get_rxnfc(struct net_device *dev,
info->data = nic->rx_queues;
ret = 0;
break;
- case ETHTOOL_GRXFH:
- return nicvf_get_rss_hash_opts(nic, info);
default:
break;
}
return ret;
}
-static int nicvf_set_rss_hash_opts(struct nicvf *nic,
- struct ethtool_rxnfc *info)
+static int nicvf_set_rxfh_fields(struct net_device *dev,
+ const struct ethtool_rxfh_fields *info,
+ struct netlink_ext_ack *extack)
{
- struct nicvf_rss_info *rss = &nic->rss_info;
- u64 rss_cfg = nicvf_reg_read(nic, NIC_VNIC_RSS_CFG);
+ struct nicvf *nic = netdev_priv(dev);
+ struct nicvf_rss_info *rss;
+ u64 rss_cfg;
+
+ rss = &nic->rss_info;
+ rss_cfg = nicvf_reg_read(nic, NIC_VNIC_RSS_CFG);
if (!rss->enable)
netdev_err(nic->netdev,
"RSS is disabled, hash cannot be set\n");
- netdev_info(nic->netdev, "Set RSS flow type = %d, data = %lld\n",
+ netdev_info(nic->netdev, "Set RSS flow type = %d, data = %u\n",
info->flow_type, info->data);
if (!(info->data & RXH_IP_SRC) || !(info->data & RXH_IP_DST))
@@ -628,19 +631,6 @@ static int nicvf_set_rss_hash_opts(struct nicvf *nic,
return 0;
}
-static int nicvf_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info)
-{
- struct nicvf *nic = netdev_priv(dev);
-
- switch (info->cmd) {
- case ETHTOOL_SRXFH:
- return nicvf_set_rss_hash_opts(nic, info);
- default:
- break;
- }
- return -EOPNOTSUPP;
-}
-
static u32 nicvf_get_rxfh_key_size(struct net_device *netdev)
{
return RSS_HASH_KEY_SIZE * sizeof(u64);
@@ -872,11 +862,12 @@ static const struct ethtool_ops nicvf_ethtool_ops = {
.get_ringparam = nicvf_get_ringparam,
.set_ringparam = nicvf_set_ringparam,
.get_rxnfc = nicvf_get_rxnfc,
- .set_rxnfc = nicvf_set_rxnfc,
.get_rxfh_key_size = nicvf_get_rxfh_key_size,
.get_rxfh_indir_size = nicvf_get_rxfh_indir_size,
.get_rxfh = nicvf_get_rxfh,
.set_rxfh = nicvf_set_rxfh,
+ .get_rxfh_fields = nicvf_get_rxfh_fields,
+ .set_rxfh_fields = nicvf_set_rxfh_fields,
.get_channels = nicvf_get_channels,
.set_channels = nicvf_set_channels,
.get_pauseparam = nicvf_get_pauseparam,
--
2.49.0
next prev parent reply other threads:[~2025-06-17 1:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-17 1:45 [PATCH net-next 0/5] eth: migrate some drivers to new RXFH callbacks Jakub Kicinski
2025-06-17 1:45 ` [PATCH net-next 1/5] eth: bnx2x: migrate " Jakub Kicinski
2025-06-17 6:40 ` Subbaraya Sundeep
2025-06-17 22:14 ` Jakub Kicinski
2025-06-18 10:03 ` Subbaraya Sundeep
2025-06-17 1:45 ` [PATCH net-next 2/5] eth: bnxt: " Jakub Kicinski
2025-06-17 21:39 ` Michael Chan
2025-06-17 1:45 ` [PATCH net-next 3/5] eth: ena: " Jakub Kicinski
2025-06-17 6:50 ` Subbaraya Sundeep
2025-06-17 7:35 ` Arinzon, David
2025-06-17 1:45 ` Jakub Kicinski [this message]
2025-06-17 6:43 ` [PATCH net-next 4/5] eth: thunder: " Subbaraya Sundeep
2025-06-17 1:45 ` [PATCH net-next 5/5] eth: otx2: " Jakub Kicinski
2025-06-18 20:30 ` [PATCH net-next 0/5] eth: migrate some drivers " patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250617014555.434790-5-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=akiyano@amazon.com \
--cc=andrew+netdev@lunn.ch \
--cc=bbhushan2@marvell.com \
--cc=darinzon@amazon.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=horms@kernel.org \
--cc=manishc@marvell.com \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
--cc=shayagr@amazon.com \
--cc=skalluru@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.