netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2] gve: Cache link_speed value from device
@ 2023-03-21 17:23 joshwash
  2023-03-22 16:03 ` Simon Horman
  2023-03-23  5:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: joshwash @ 2023-03-21 17:23 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, Joshua Washington

From: Joshua Washington <joshwash@google.com>

The link speed is never changed for the uptime of a VM, and the current
implementation sends an admin queue command for each call. Admin queue
command invocations have nontrivial overhead (e.g., VM exits), which can
be disruptive to users if triggered frequently. Our telemetry data shows
that there are VMs that make frequent calls to this admin queue command.
Caching the result of the original admin queue command would eliminate
the need to send multiple admin queue commands on subsequent calls to
retrieve link speed.

Fixes: 7e074d5a76ca ("gve: Enable Link Speed Reporting in the driver.")
Signed-off-by: Joshua Washington <joshwash@google.com>
---
 drivers/net/ethernet/google/gve/gve_ethtool.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c
index ce574d097e28..5f81470843b4 100644
--- a/drivers/net/ethernet/google/gve/gve_ethtool.c
+++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
@@ -537,7 +537,10 @@ static int gve_get_link_ksettings(struct net_device *netdev,
 				  struct ethtool_link_ksettings *cmd)
 {
 	struct gve_priv *priv = netdev_priv(netdev);
-	int err = gve_adminq_report_link_speed(priv);
+	int err = 0;
+
+	if (priv->link_speed == 0)
+		err = gve_adminq_report_link_speed(priv);
 
 	cmd->base.speed = priv->link_speed;
 	return err;
-- 
2.40.0.rc1.284.g88254d51c5-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net v2] gve: Cache link_speed value from device
  2023-03-21 17:23 [PATCH net v2] gve: Cache link_speed value from device joshwash
@ 2023-03-22 16:03 ` Simon Horman
  2023-03-23  5:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-03-22 16:03 UTC (permalink / raw)
  To: joshwash; +Cc: netdev, davem, kuba

On Tue, Mar 21, 2023 at 10:23:32AM -0700, joshwash@google.com wrote:
> From: Joshua Washington <joshwash@google.com>
> 
> The link speed is never changed for the uptime of a VM, and the current
> implementation sends an admin queue command for each call. Admin queue
> command invocations have nontrivial overhead (e.g., VM exits), which can
> be disruptive to users if triggered frequently. Our telemetry data shows
> that there are VMs that make frequent calls to this admin queue command.
> Caching the result of the original admin queue command would eliminate
> the need to send multiple admin queue commands on subsequent calls to
> retrieve link speed.
> 
> Fixes: 7e074d5a76ca ("gve: Enable Link Speed Reporting in the driver.")
> Signed-off-by: Joshua Washington <joshwash@google.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net v2] gve: Cache link_speed value from device
  2023-03-21 17:23 [PATCH net v2] gve: Cache link_speed value from device joshwash
  2023-03-22 16:03 ` Simon Horman
@ 2023-03-23  5:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-23  5:10 UTC (permalink / raw)
  To: None; +Cc: netdev, davem, kuba

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 21 Mar 2023 10:23:32 -0700 you wrote:
> From: Joshua Washington <joshwash@google.com>
> 
> The link speed is never changed for the uptime of a VM, and the current
> implementation sends an admin queue command for each call. Admin queue
> command invocations have nontrivial overhead (e.g., VM exits), which can
> be disruptive to users if triggered frequently. Our telemetry data shows
> that there are VMs that make frequent calls to this admin queue command.
> Caching the result of the original admin queue command would eliminate
> the need to send multiple admin queue commands on subsequent calls to
> retrieve link speed.
> 
> [...]

Here is the summary with links:
  - [net,v2] gve: Cache link_speed value from device
    https://git.kernel.org/netdev/net/c/68c3e4fc8628

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-23  5:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-21 17:23 [PATCH net v2] gve: Cache link_speed value from device joshwash
2023-03-22 16:03 ` Simon Horman
2023-03-23  5:10 ` patchwork-bot+netdevbpf

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).