netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] gve: Correctly report software timestamping capabilities
@ 2024-04-08 18:09 John Fraker
  2024-04-09 14:29 ` Willem de Bruijn
  2024-04-10  0:26 ` Jakub Kicinski
  0 siblings, 2 replies; 11+ messages in thread
From: John Fraker @ 2024-04-08 18:09 UTC (permalink / raw)
  To: netdev
  Cc: John Fraker, Praveen Kaligineedi, Harshitha Ramamurthy,
	Shailend Chand, Willem de Bruijn, David S. Miller, Jakub Kicinski,
	Junfeng Guo, Ziwei Xiao, Jeroen de Borst, linux-kernel

gve has supported software timestamp generation since its inception,
but has not advertised that support via ethtool. This patch correctly
advertises that support.

Reviewed-by: Praveen Kaligineedi <pkaligineedi@google.com>
Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
Signed-off-by: John Fraker <jfraker@google.com>

---
 drivers/net/ethernet/google/gve/gve_ethtool.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c
index 815dead..99f5aeb 100644
--- a/drivers/net/ethernet/google/gve/gve_ethtool.c
+++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
@@ -4,6 +4,8 @@
  * Copyright (C) 2015-2021 Google, Inc.
  */
 
+#include <linux/ethtool.h>
+#include <linux/net_tstamp.h>
 #include <linux/rtnetlink.h>
 #include "gve.h"
 #include "gve_adminq.h"
@@ -763,6 +765,15 @@ static int gve_set_coalesce(struct net_device *netdev,
 	return 0;
 }
 
+static int gve_get_ts_info(struct net_device *netdev, struct ethtool_ts_info *info)
+{
+	info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
+				SOF_TIMESTAMPING_TX_SOFTWARE |
+				SOF_TIMESTAMPING_SOFTWARE;
+
+	return 0;
+}
+
 const struct ethtool_ops gve_ethtool_ops = {
 	.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
 	.supported_ring_params = ETHTOOL_RING_USE_TCP_DATA_SPLIT,
@@ -784,5 +795,6 @@ const struct ethtool_ops gve_ethtool_ops = {
 	.set_tunable = gve_set_tunable,
 	.get_priv_flags = gve_get_priv_flags,
 	.set_priv_flags = gve_set_priv_flags,
-	.get_link_ksettings = gve_get_link_ksettings
+	.get_link_ksettings = gve_get_link_ksettings,
+	.get_ts_info = gve_get_ts_info
 };
-- 
2.44.0.478.gd926399ef9-goog


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

end of thread, other threads:[~2024-04-11 19:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-08 18:09 [PATCH net-next] gve: Correctly report software timestamping capabilities John Fraker
2024-04-09 14:29 ` Willem de Bruijn
2024-04-10  0:28   ` Jakub Kicinski
2024-04-10  4:40     ` Rahul Rameshbabu
2024-04-10 13:19       ` Jakub Kicinski
2024-04-10 19:31         ` Willem de Bruijn
2024-04-11  0:40           ` Rahul Rameshbabu
2024-04-11  1:36             ` Willem de Bruijn
2024-04-10  0:26 ` Jakub Kicinski
2024-04-11  3:22   ` Willem de Bruijn
2024-04-11 19:37     ` John Fraker

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