[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250418221254.112433-7-hramamurthy@google.com>
Date: Fri, 18 Apr 2025 22:12:54 +0000
From: Harshitha Ramamurthy <hramamurthy@...gle.com>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, jeroendb@...gle.com, hramamurthy@...gle.com,
andrew+netdev@...n.ch, willemb@...gle.com, ziweixiao@...gle.com,
pkaligineedi@...gle.com, yyd@...gle.com, joshwash@...gle.com,
shailend@...gle.com, linux@...blig.org, thostet@...gle.com,
jfraker@...gle.com, horms@...nel.org, linux-kernel@...r.kernel.org
Subject: [PATCH net-next 6/6] gve: Advertise support for rx hardware timestamping
From: John Fraker <jfraker@...gle.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@...gle.com>
Signed-off-by: Ziwei Xiao <ziweixiao@...gle.com>
Reviewed-by: Willem de Bruijn <willemb@...gle.com>
Signed-off-by: John Fraker <jfraker@...gle.com>
Signed-off-by: Harshitha Ramamurthy <hramamurthy@...gle.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
Powered by blists - more mailing lists