From: Joshua Washington <joshwash@google.com>
To: Joshua Washington <joshwash@google.com>
Cc: dev@dpdk.org, blasko@google.com, jtranoleary@google.com
Subject: [PATCH v3 8/8] net/gve: refactor timestamp support to clock read type
Date: Fri, 9 Oct 2026 17:59:40 -0700 [thread overview]
Message-ID: <20261010005942.560881-9-joshwash@google.com> (raw)
In-Reply-To: <20261010005942.560881-1-joshwash@google.com>
From: Mark Blasko <blasko@google.com>
Replace the boolean nic_timestamp_supported field with enum
gve_dev_clk_type to represent the device clock read mode
(unsupported, Cmd). Update AdminQ capability negotiation
and ethdev operations to check clk_read_type.
Only enable the NIC timestamp device option for DQO queue formats.
GQI has no Rx timestamp support, so it no longer reserves the timestamp
report memzone or starts the clock sync thread.
Signed-off-by: Mark Blasko <blasko@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
---
v3:
- Keep the nic_ts_report_mz check before advertising
RTE_ETH_RX_OFFLOAD_TIMESTAMP, so the offload is not advertised when
timestamp setup failed.
- Drop the redundant GVE_DEV_CLK_UNSUPPORTED check from
gve_alloc_nic_ts_report().
- Note in the commit message that GQI no longer sets up NIC
timestamping.
---
drivers/net/gve/base/gve_adminq.c | 5 +++--
drivers/net/gve/gve_ethdev.c | 7 ++++---
drivers/net/gve/gve_ethdev.h | 7 ++++++-
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/net/gve/base/gve_adminq.c b/drivers/net/gve/base/gve_adminq.c
index db3e43c6b0..65e865939f 100644
--- a/drivers/net/gve/base/gve_adminq.c
+++ b/drivers/net/gve/base/gve_adminq.c
@@ -994,9 +994,10 @@ static void gve_enable_supported_features(struct gve_priv *priv,
priv->max_mtu = be16_to_cpu(dev_op_jumbo_frames->max_mtu);
}
if (dev_op_nic_timestamp &&
- (supported_features_mask & GVE_SUP_NIC_TIMESTAMP_MASK)) {
+ (supported_features_mask & GVE_SUP_NIC_TIMESTAMP_MASK) &&
+ !gve_is_gqi(priv)) {
PMD_DRV_LOG(INFO, "NIC TIMESTAMP device option enabled.");
- priv->nic_timestamp_supported = true;
+ priv->clk_read_type = GVE_DEV_CLK_CMD;
}
}
diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index 31698bc38a..3c8d1a76e4 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -897,7 +897,8 @@ gve_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
dev_info->min_mtu = RTE_ETHER_MIN_MTU;
dev_info->rx_offload_capa = RTE_ETH_RX_OFFLOAD_RSS_HASH;
- if (!gve_is_gqi(priv) && priv->nic_ts_report_mz)
+ if (priv->clk_read_type != GVE_DEV_CLK_UNSUPPORTED &&
+ priv->nic_ts_report_mz != NULL)
dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TIMESTAMP;
dev_info->tx_offload_capa =
RTE_ETH_TX_OFFLOAD_MULTI_SEGS |
@@ -1377,7 +1378,7 @@ gve_read_clock(struct rte_eth_dev *dev, uint64_t *clock)
uint64_t ts;
int err;
- if (!priv->nic_timestamp_supported)
+ if (priv->clk_read_type == GVE_DEV_CLK_UNSUPPORTED)
return -EOPNOTSUPP;
if (!priv->nic_ts_report_mz)
@@ -1477,7 +1478,7 @@ gve_setup_nic_timestamp(struct gve_priv *priv)
{
int err;
- if (!priv->nic_timestamp_supported)
+ if (priv->clk_read_type == GVE_DEV_CLK_UNSUPPORTED)
return;
rte_atomic_store_explicit(&priv->nic_ts_read_fails, 0, rte_memory_order_relaxed);
diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h
index b6c06cd82d..19eac9ec0b 100644
--- a/drivers/net/gve/gve_ethdev.h
+++ b/drivers/net/gve/gve_ethdev.h
@@ -274,6 +274,11 @@ extern const struct rte_flow_ops gve_flow_ops;
struct gve_priv;
struct gve_flow_rule_params;
+enum gve_dev_clk_type {
+ GVE_DEV_CLK_UNSUPPORTED = 0,
+ GVE_DEV_CLK_CMD,
+};
+
struct gve_ctrl_ops {
int (*init_ctrl_plane)(struct gve_priv *priv);
void (*free_ctrl_plane)(struct gve_priv *priv);
@@ -407,7 +412,7 @@ struct gve_priv {
TAILQ_HEAD(, gve_flow) active_flows;
/* HW Timestamping Fields */
- bool nic_timestamp_supported;
+ enum gve_dev_clk_type clk_read_type;
const struct rte_memzone *nic_ts_report_mz;
struct gve_nic_ts_report *nic_ts_report;
pthread_mutex_t nic_ts_lock;
--
2.56.0.170.g584c36229d-goog
next prev parent reply other threads:[~2026-10-10 1:00 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-03 2:51 [PATCH 0/8] gve: precursor control plane changes before bare-metal support Joshua Washington
2026-10-03 2:51 ` [PATCH 1/8] net/gve: refactor ethdev for control ops interface Joshua Washington
2026-10-03 2:51 ` [PATCH 2/8] net/gve: rename doorbell BAR variable to be more generic Joshua Washington
2026-10-03 2:51 ` [PATCH 3/8] net/gve: split default queue counts into Tx and Rx Joshua Washington
2026-10-03 2:51 ` [PATCH 4/8] net/gve: clean Tx queue directly in dqo Joshua Washington
2026-10-03 2:51 ` [PATCH 5/8] net/gve: update RSS config just after successful programming Joshua Washington
2026-10-03 2:51 ` [PATCH 6/8] net/gve: add RSS cache boolean flag Joshua Washington
2026-10-03 2:51 ` [PATCH 7/8] net/gve: fix RSS config memory leak on close Joshua Washington
2026-10-03 2:51 ` [PATCH 8/8] net/gve: refactor timestamp support to clock read type Joshua Washington
2026-10-03 16:29 ` [PATCH 0/8] gve: precursor control plane changes before bare-metal support Stephen Hemminger
2026-10-05 19:39 ` [PATCH v2 " Joshua Washington
2026-10-05 19:39 ` [PATCH v2 1/8] net/gve: refactor ethdev for control ops interface Joshua Washington
2026-10-05 19:39 ` [PATCH v2 2/8] net/gve: rename doorbell BAR variable to be more generic Joshua Washington
2026-10-05 19:39 ` [PATCH v2 3/8] net/gve: split default queue counts into Tx and Rx Joshua Washington
2026-10-05 19:39 ` [PATCH v2 4/8] net/gve: clean Tx queue directly in dqo Joshua Washington
2026-10-05 19:39 ` [PATCH v2 5/8] net/gve: update RSS config just after successful programming Joshua Washington
2026-10-05 19:39 ` [PATCH v2 6/8] net/gve: add RSS cache boolean flag Joshua Washington
2026-10-05 19:39 ` [PATCH v2 7/8] net/gve: fix RSS config memory leak on close Joshua Washington
2026-10-05 19:39 ` [PATCH v2 8/8] net/gve: refactor timestamp support to clock read type Joshua Washington
2026-10-06 14:19 ` [PATCH v2 0/8] gve: precursor control plane changes before bare-metal support Stephen Hemminger
2026-10-06 15:10 ` Stephen Hemminger
2026-10-07 20:11 ` Joshua Washington
2026-10-10 0:59 ` [PATCH v3 " Joshua Washington
2026-10-10 0:59 ` [PATCH v3 1/8] net/gve: fix RSS config memory leak on close Joshua Washington
2026-10-10 0:59 ` [PATCH v3 2/8] net/gve: refactor ethdev for control ops interface Joshua Washington
2026-10-10 0:59 ` [PATCH v3 3/8] net/gve: rename doorbell BAR variable to be more generic Joshua Washington
2026-10-10 0:59 ` [PATCH v3 4/8] net/gve: split default queue counts into Tx and Rx Joshua Washington
2026-10-10 0:59 ` [PATCH v3 5/8] net/gve: clean Tx queue directly in dqo Joshua Washington
2026-10-10 0:59 ` [PATCH v3 6/8] net/gve: update RSS config just after successful programming Joshua Washington
2026-10-10 0:59 ` [PATCH v3 7/8] net/gve: add RSS cache boolean flag Joshua Washington
2026-10-10 0:59 ` Joshua Washington [this message]
2026-10-10 18:24 ` [PATCH v3 0/8] gve: precursor control plane changes before bare-metal support Stephen Hemminger
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=20261010005942.560881-9-joshwash@google.com \
--to=joshwash@google.com \
--cc=blasko@google.com \
--cc=dev@dpdk.org \
--cc=jtranoleary@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