Skip to content

Commit a471e7f

Browse files
jfrakerkuba-moo
authored andcommitted
gve: Advertise support for rx hardware timestamping
Expand the 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. Signed-off-by: John Fraker <[email protected]> Signed-off-by: Ziwei Xiao <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Signed-off-by: Harshitha Ramamurthy <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b2c7aeb commit a471e7f

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

drivers/net/ethernet/google/gve/gve_ethtool.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,27 @@ static int gve_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rx
923923
return 0;
924924
}
925925

926+
static int gve_get_ts_info(struct net_device *netdev,
927+
struct kernel_ethtool_ts_info *info)
928+
{
929+
struct gve_priv *priv = netdev_priv(netdev);
930+
931+
ethtool_op_get_ts_info(netdev, info);
932+
933+
if (priv->nic_timestamp_supported) {
934+
info->so_timestamping |= SOF_TIMESTAMPING_RX_HARDWARE |
935+
SOF_TIMESTAMPING_RAW_HARDWARE;
936+
937+
info->rx_filters |= BIT(HWTSTAMP_FILTER_NONE) |
938+
BIT(HWTSTAMP_FILTER_ALL);
939+
940+
if (priv->ptp)
941+
info->phc_index = ptp_clock_index(priv->ptp->clock);
942+
}
943+
944+
return 0;
945+
}
946+
926947
const struct ethtool_ops gve_ethtool_ops = {
927948
.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
928949
.supported_ring_params = ETHTOOL_RING_USE_TCP_DATA_SPLIT,
@@ -951,5 +972,5 @@ const struct ethtool_ops gve_ethtool_ops = {
951972
.get_priv_flags = gve_get_priv_flags,
952973
.set_priv_flags = gve_set_priv_flags,
953974
.get_link_ksettings = gve_get_link_ksettings,
954-
.get_ts_info = ethtool_op_get_ts_info,
975+
.get_ts_info = gve_get_ts_info,
955976
};

0 commit comments

Comments
 (0)