* [PATCH net-next] net: gve: convert to use .get_rx_ring_count
@ 2025-12-22 17:16 Breno Leitao
2025-12-23 4:21 ` Subbaraya Sundeep
2025-12-23 5:22 ` Harshitha Ramamurthy
0 siblings, 2 replies; 3+ messages in thread
From: Breno Leitao @ 2025-12-22 17:16 UTC (permalink / raw)
To: Joshua Washington, Harshitha Ramamurthy, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Breno Leitao
Convert the Google Virtual Ethernet (GVE) driver to use the new
.get_rx_ring_count ethtool operation instead of handling
ETHTOOL_GRXRINGS in .get_rxnfc. This simplifies the code by moving the
ring count query to a dedicated callback.
The new callback provides the same functionality in a more direct way,
following the ongoing ethtool API modernization.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
PS: This was compile-tested only.
---
drivers/net/ethernet/google/gve/gve_ethtool.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c
index 52500ae8348e..9ed1d4529427 100644
--- a/drivers/net/ethernet/google/gve/gve_ethtool.c
+++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
@@ -815,15 +815,19 @@ static int gve_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)
return err;
}
+static u32 gve_get_rx_ring_count(struct net_device *netdev)
+{
+ struct gve_priv *priv = netdev_priv(netdev);
+
+ return priv->rx_cfg.num_queues;
+}
+
static int gve_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd, u32 *rule_locs)
{
struct gve_priv *priv = netdev_priv(netdev);
int err = 0;
switch (cmd->cmd) {
- case ETHTOOL_GRXRINGS:
- cmd->data = priv->rx_cfg.num_queues;
- break;
case ETHTOOL_GRXCLSRLCNT:
if (!priv->max_flow_rules)
return -EOPNOTSUPP;
@@ -966,6 +970,7 @@ const struct ethtool_ops gve_ethtool_ops = {
.get_channels = gve_get_channels,
.set_rxnfc = gve_set_rxnfc,
.get_rxnfc = gve_get_rxnfc,
+ .get_rx_ring_count = gve_get_rx_ring_count,
.get_rxfh_indir_size = gve_get_rxfh_indir_size,
.get_rxfh_key_size = gve_get_rxfh_key_size,
.get_rxfh = gve_get_rxfh,
---
base-commit: 7b8e9264f55a9c320f398e337d215e68cca50131
change-id: 20251222-gxring_google-d6c76c372f76
Best regards,
--
Breno Leitao <leitao@debian.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net-next] net: gve: convert to use .get_rx_ring_count
2025-12-22 17:16 [PATCH net-next] net: gve: convert to use .get_rx_ring_count Breno Leitao
@ 2025-12-23 4:21 ` Subbaraya Sundeep
2025-12-23 5:22 ` Harshitha Ramamurthy
1 sibling, 0 replies; 3+ messages in thread
From: Subbaraya Sundeep @ 2025-12-23 4:21 UTC (permalink / raw)
To: Breno Leitao
Cc: Joshua Washington, Harshitha Ramamurthy, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev, linux-kernel
On 2025-12-22 at 22:46:27, Breno Leitao (leitao@debian.org) wrote:
> Convert the Google Virtual Ethernet (GVE) driver to use the new
> .get_rx_ring_count ethtool operation instead of handling
> ETHTOOL_GRXRINGS in .get_rxnfc. This simplifies the code by moving the
> ring count query to a dedicated callback.
>
> The new callback provides the same functionality in a more direct way,
> following the ongoing ethtool API modernization.
>
> Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>
Please repost after net-next is open.
Thanks,
Sundeep
> ---
> PS: This was compile-tested only.
> ---
> drivers/net/ethernet/google/gve/gve_ethtool.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c
> index 52500ae8348e..9ed1d4529427 100644
> --- a/drivers/net/ethernet/google/gve/gve_ethtool.c
> +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
> @@ -815,15 +815,19 @@ static int gve_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)
> return err;
> }
>
> +static u32 gve_get_rx_ring_count(struct net_device *netdev)
> +{
> + struct gve_priv *priv = netdev_priv(netdev);
> +
> + return priv->rx_cfg.num_queues;
> +}
> +
> static int gve_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd, u32 *rule_locs)
> {
> struct gve_priv *priv = netdev_priv(netdev);
> int err = 0;
>
> switch (cmd->cmd) {
> - case ETHTOOL_GRXRINGS:
> - cmd->data = priv->rx_cfg.num_queues;
> - break;
> case ETHTOOL_GRXCLSRLCNT:
> if (!priv->max_flow_rules)
> return -EOPNOTSUPP;
> @@ -966,6 +970,7 @@ const struct ethtool_ops gve_ethtool_ops = {
> .get_channels = gve_get_channels,
> .set_rxnfc = gve_set_rxnfc,
> .get_rxnfc = gve_get_rxnfc,
> + .get_rx_ring_count = gve_get_rx_ring_count,
> .get_rxfh_indir_size = gve_get_rxfh_indir_size,
> .get_rxfh_key_size = gve_get_rxfh_key_size,
> .get_rxfh = gve_get_rxfh,
>
> ---
> base-commit: 7b8e9264f55a9c320f398e337d215e68cca50131
> change-id: 20251222-gxring_google-d6c76c372f76
>
> Best regards,
> --
> Breno Leitao <leitao@debian.org>
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net-next] net: gve: convert to use .get_rx_ring_count
2025-12-22 17:16 [PATCH net-next] net: gve: convert to use .get_rx_ring_count Breno Leitao
2025-12-23 4:21 ` Subbaraya Sundeep
@ 2025-12-23 5:22 ` Harshitha Ramamurthy
1 sibling, 0 replies; 3+ messages in thread
From: Harshitha Ramamurthy @ 2025-12-23 5:22 UTC (permalink / raw)
To: Breno Leitao
Cc: Joshua Washington, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
On Mon, Dec 22, 2025 at 9:19 AM Breno Leitao <leitao@debian.org> wrote:
>
> Convert the Google Virtual Ethernet (GVE) driver to use the new
> .get_rx_ring_count ethtool operation instead of handling
> ETHTOOL_GRXRINGS in .get_rxnfc. This simplifies the code by moving the
> ring count query to a dedicated callback.
>
> The new callback provides the same functionality in a more direct way,
> following the ongoing ethtool API modernization.
>
> Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
Thanks!
> ---
> PS: This was compile-tested only.
> ---
> drivers/net/ethernet/google/gve/gve_ethtool.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c
> index 52500ae8348e..9ed1d4529427 100644
> --- a/drivers/net/ethernet/google/gve/gve_ethtool.c
> +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
> @@ -815,15 +815,19 @@ static int gve_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)
> return err;
> }
>
> +static u32 gve_get_rx_ring_count(struct net_device *netdev)
> +{
> + struct gve_priv *priv = netdev_priv(netdev);
> +
> + return priv->rx_cfg.num_queues;
> +}
> +
> static int gve_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd, u32 *rule_locs)
> {
> struct gve_priv *priv = netdev_priv(netdev);
> int err = 0;
>
> switch (cmd->cmd) {
> - case ETHTOOL_GRXRINGS:
> - cmd->data = priv->rx_cfg.num_queues;
> - break;
> case ETHTOOL_GRXCLSRLCNT:
> if (!priv->max_flow_rules)
> return -EOPNOTSUPP;
> @@ -966,6 +970,7 @@ const struct ethtool_ops gve_ethtool_ops = {
> .get_channels = gve_get_channels,
> .set_rxnfc = gve_set_rxnfc,
> .get_rxnfc = gve_get_rxnfc,
> + .get_rx_ring_count = gve_get_rx_ring_count,
> .get_rxfh_indir_size = gve_get_rxfh_indir_size,
> .get_rxfh_key_size = gve_get_rxfh_key_size,
> .get_rxfh = gve_get_rxfh,
>
> ---
> base-commit: 7b8e9264f55a9c320f398e337d215e68cca50131
> change-id: 20251222-gxring_google-d6c76c372f76
>
> Best regards,
> --
> Breno Leitao <leitao@debian.org>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-23 5:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22 17:16 [PATCH net-next] net: gve: convert to use .get_rx_ring_count Breno Leitao
2025-12-23 4:21 ` Subbaraya Sundeep
2025-12-23 5:22 ` Harshitha Ramamurthy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).