* [PATCH net] gve: Cache link_speed value from device
@ 2023-03-15 17:40 joshwash
2023-03-17 0:42 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: joshwash @ 2023-03-15 17:40 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. Caching the
value will allow for better performance.
Fixes: 7e074d5a76ca ("gve: Enable Link Speed Reporting in the driver.")
Signed-off-by: Joshua Washington <joshwash@google.com>
---
google/gve/gve_ethtool.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/google/gve/gve_ethtool.c b/google/gve/gve_ethtool.c
index b18804e..cfd4b8d 100644
--- a/google/gve/gve_ethtool.c
+++ b/google/gve/gve_ethtool.c
@@ -584,7 +584,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] gve: Cache link_speed value from device
2023-03-15 17:40 [PATCH net] gve: Cache link_speed value from device joshwash
@ 2023-03-17 0:42 ` Jakub Kicinski
2023-03-17 0:43 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2023-03-17 0:42 UTC (permalink / raw)
To: joshwash; +Cc: netdev, davem
On Wed, 15 Mar 2023 10:40:16 -0700 joshwash@google.com wrote:
> From: Joshua Washington <joshwash@google.com>
>
> The link speed is never changed for the uptime of a VM. Caching the
> value will allow for better performance.
>
> Fixes: 7e074d5a76ca ("gve: Enable Link Speed Reporting in the driver.")
If it needs to go in as a fix / to stable we need a bit more info about
the nature of the problem. What user-visible (or hypervisor-visible)
impact will be? What entity needs link info so often that it becomes
a problem?
The code looks fine as an optimization, i.e. for net-next, but you say
"PATCH net" and there's a Fixes tag...
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] gve: Cache link_speed value from device
2023-03-17 0:42 ` Jakub Kicinski
@ 2023-03-17 0:43 ` Jakub Kicinski
0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2023-03-17 0:43 UTC (permalink / raw)
To: joshwash; +Cc: netdev, davem
On Thu, 16 Mar 2023 17:42:27 -0700 Jakub Kicinski wrote:
> If it needs to go in as a fix / to stable we need a bit more info about
> the nature of the problem. What user-visible (or hypervisor-visible)
> impact will be? What entity needs link info so often that it becomes
> a problem?
>
> The code looks fine as an optimization, i.e. for net-next, but you say
> "PATCH net" and there's a Fixes tag...
Hm, actually it doesn't apply to either tree..
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-17 0:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 17:40 [PATCH net] gve: Cache link_speed value from device joshwash
2023-03-17 0:42 ` Jakub Kicinski
2023-03-17 0:43 ` Jakub Kicinski
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.