public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Harshitha Ramamurthy <hramamurthy@google.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	 pabeni@redhat.com, jeroendb@google.com, hramamurthy@google.com,
	 andrew+netdev@lunn.ch, willemb@google.com, ziweixiao@google.com,
	 pkaligineedi@google.com, yyd@google.com, joshwash@google.com,
	 shailend@google.com, linux@treblig.org, thostet@google.com,
	 jfraker@google.com, horms@kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH net-next 6/6] gve: Advertise support for rx hardware timestamping
Date: Fri, 18 Apr 2025 22:12:54 +0000	[thread overview]
Message-ID: <20250418221254.112433-7-hramamurthy@google.com> (raw)
In-Reply-To: <20250418221254.112433-1-hramamurthy@google.com>

From: John Fraker <jfraker@google.com>

This patch expands our get_ts_info ethtool handler with the new
gve_get_ts_info which advertises support for rx hardware timestamping.

With this patch, the driver now fully supports rx hardware timestamping.

Co-developed-by: Ziwei Xiao <ziweixiao@google.com>
Signed-off-by: Ziwei Xiao <ziweixiao@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: John Fraker <jfraker@google.com>
Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
---
 drivers/net/ethernet/google/gve/gve_ethtool.c | 20 ++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c
index 76f759309196..ba838e5b7d53 100644
--- a/drivers/net/ethernet/google/gve/gve_ethtool.c
+++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
@@ -929,6 +929,24 @@ static int gve_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rx
 	return 0;
 }
 
+static int gve_get_ts_info(struct net_device *netdev,
+			   struct kernel_ethtool_ts_info *info)
+{
+	struct gve_priv *priv = netdev_priv(netdev);
+
+	ethtool_op_get_ts_info(netdev, info);
+
+	if (priv->nic_timestamp_supported) {
+		info->so_timestamping |= SOF_TIMESTAMPING_RX_HARDWARE |
+					 SOF_TIMESTAMPING_RAW_HARDWARE;
+
+		info->rx_filters |= BIT(HWTSTAMP_FILTER_NONE) |
+				    BIT(HWTSTAMP_FILTER_ALL);
+	}
+
+	return 0;
+}
+
 const struct ethtool_ops gve_ethtool_ops = {
 	.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
 	.supported_ring_params = ETHTOOL_RING_USE_TCP_DATA_SPLIT,
@@ -957,5 +975,5 @@ const struct ethtool_ops gve_ethtool_ops = {
 	.get_priv_flags = gve_get_priv_flags,
 	.set_priv_flags = gve_set_priv_flags,
 	.get_link_ksettings = gve_get_link_ksettings,
-	.get_ts_info = ethtool_op_get_ts_info,
+	.get_ts_info = gve_get_ts_info,
 };
-- 
2.49.0.805.g082f7c87e0-goog


  parent reply	other threads:[~2025-04-18 22:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-18 22:12 [PATCH net-next 0/6] gve: Add Rx HW timestamping support Harshitha Ramamurthy
2025-04-18 22:12 ` [PATCH net-next 1/6] gve: Add device option for nic clock synchronization Harshitha Ramamurthy
2025-04-23  1:42   ` Joe Damato
2025-04-18 22:12 ` [PATCH net-next 2/6] gve: Add adminq command to report nic timestamp Harshitha Ramamurthy
2025-04-23  1:44   ` Joe Damato
2025-04-18 22:12 ` [PATCH net-next 3/6] gve: Add initial gve_clock Harshitha Ramamurthy
2025-04-23  1:49   ` Joe Damato
2025-04-18 22:12 ` [PATCH net-next 4/6] gve: Add rx hardware timestamp expansion Harshitha Ramamurthy
2025-04-23  1:21   ` Joe Damato
2025-04-24 18:40     ` Ziwei Xiao
2025-04-18 22:12 ` [PATCH net-next 5/6] gve: Add support for SIOC[GS]HWTSTAMP IOCTLs Harshitha Ramamurthy
2025-04-23  1:52   ` Joe Damato
2025-04-18 22:12 ` Harshitha Ramamurthy [this message]
2025-04-23  1:53   ` [PATCH net-next 6/6] gve: Advertise support for rx hardware timestamping Joe Damato
2025-04-23 10:13 ` [PATCH net-next 0/6] gve: Add Rx HW timestamping support Vadim Fedorenko
2025-04-23 20:46   ` Ziwei Xiao
2025-04-23 21:06     ` Vadim Fedorenko
2025-04-23 22:56       ` Jakub Kicinski
2025-04-24 18:39         ` Ziwei Xiao

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=20250418221254.112433-7-hramamurthy@google.com \
    --to=hramamurthy@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jeroendb@google.com \
    --cc=jfraker@google.com \
    --cc=joshwash@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@treblig.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pkaligineedi@google.com \
    --cc=shailend@google.com \
    --cc=thostet@google.com \
    --cc=willemb@google.com \
    --cc=yyd@google.com \
    --cc=ziweixiao@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox