From: Stephen Hemminger <stephen@networkplumber.org>
To: Mark Blasko <blasko@google.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH 0/6] net/gve: add hardware timestamping support
Date: Wed, 13 May 2026 16:41:14 +0200 [thread overview]
Message-ID: <20260513164114.25de780b@stephen-xps.local> (raw)
In-Reply-To: <20260512005404.946979-1-blasko@google.com>
On Tue, 12 May 2026 00:53:47 +0000
Mark Blasko <blasko@google.com> wrote:
> This patch series introduces support for GVE hardware timestamping on DQO
> queues. To support concurrent access, a mutex lock is introduced to protect
> admin queue operations. A mechanism is then added to periodically synchronize
> the NIC clock via AdminQ, and support is introduced for the read_clock ethdev
> operation. Finally, the RX datapath is updated to reconstruct full 64-bit
> timestamps from the 32-bit values in DQO descriptors.
>
> Mark Blasko (6):
> net/gve: add thread safety to admin queue
> net/gve: add device option support for HW timestamps
> net/gve: add AdminQ command for NIC timestamps
> net/gve: add periodic NIC clock synchronization
> net/gve: support read clock ethdev op
> net/gve: reconstruct HW timestamps from DQO
>
> .mailmap | 1 +
> doc/guides/nics/features/gve.ini | 1 +
> doc/guides/nics/gve.rst | 18 +++
> doc/guides/rel_notes/release_26_07.rst | 3 +
> drivers/net/gve/base/gve_adminq.c | 127 +++++++++++++++++----
> drivers/net/gve/base/gve_adminq.h | 29 +++++
> drivers/net/gve/base/gve_desc_dqo.h | 8 +-
> drivers/net/gve/gve_ethdev.c | 148 ++++++++++++++++++++++++-
> drivers/net/gve/gve_ethdev.h | 39 +++++++
> drivers/net/gve/gve_rx_dqo.c | 26 +++++
> 10 files changed, 378 insertions(+), 22 deletions(-)
>
Please use version when sending updated patches. See contribution docs.
I.e use -v2 --in-reply-to <mail message id>
AI review spotted some issues:
Patch 1: net/gve: add thread safety to admin queue
Info: The new adminq_lock is initialized with PTHREAD_MUTEX_ROBUST,
but pthread_mutex_lock() return values are not checked anywhere in
the patch. With robust attribute set, lock can return EOWNERDEAD if
a previous owner terminated while holding the mutex; the caller is
required to call pthread_mutex_consistent() in that case, otherwise
the mutex transitions to ENOTRECOVERABLE on subsequent locks. In a
single-process DPDK PMD a thread crash brings down the whole
process, so EOWNERDEAD is unreachable in practice and the robust
attribute is unnecessary. The existing flow_rule_lock in this
driver uses PROCESS_SHARED but not ROBUST. Drop
pthread_mutexattr_setrobust() to match.
Patch 5: net/gve: support read clock ethdev op
Warning: gve_read_clock and the periodic alarm callback
gve_read_nic_clock share a single DMA buffer (priv->nic_ts_report)
for the GVE_ADMINQ_REPORT_NIC_TIMESTAMP response. The adminq_lock
introduced in patch 1 serializes the adminq command exchange, but
is released inside gve_adminq_execute_cmd before either caller
reads the buffer:
err = gve_adminq_report_nic_timestamp(priv,
priv->nic_ts_report_mz->iova);
/* lock has already been released here */
if (err != 0)
return err;
ts = be64_to_cpu(priv->nic_ts_report->nic_timestamp);
If the user thread (gve_read_clock) is preempted between returning
from gve_adminq_report_nic_timestamp and the be64_to_cpu read, the
alarm callback can run, memset() the buffer to zero, take the
adminq lock, issue its own command, and either leave its own
response in the buffer or be mid-DMA when the user thread reads.
The user thread will then read zero or a different command's
response.
The simplest fix is to return the cached
priv->last_read_nic_timestamp from gve_read_clock rather than
issuing a fresh adminq command. The periodic sync runs every
250ms, so the cached value is recent; the .read_clock semantics
do not require a brand new device read. Alternatively, use a
separate per-caller DMA buffer or extend the critical section
to cover the buffer read.
Patch 6: net/gve: reconstruct HW timestamps from DQO
Warning: RTE_ETH_RX_OFFLOAD_TIMESTAMP is added to
dev_info->rx_offload_capa whenever priv->nic_timestamp_supported
is true, but per-packet timestamp delivery is only implemented in
the DQO RX path (gve_rx_burst_dqo). For GQI devices,
rxq->timestamp_enabled is never set (gve_rx_queue_setup_dqo is
the only setup path that consults the offload flag), and the GQI
burst function does not touch the timestamp fields. A GQI user
that enables RX_OFFLOAD_TIMESTAMP will see the configure call
succeed and no timestamps appear in any mbuf - the offload is
silently a no-op.
The release notes for this series ("Added hardware timestamping
support on DQO queues") already scope the feature to DQO. The
capability advertisement should match:
if (!gve_is_gqi(priv) && priv->nic_timestamp_supported)
dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TIMESTAMP;
Info: doc/guides/nics/gve.rst's new "Timestamp Offload" section
should mention that the per-packet RX timestamp requires DQO
queue format. The .read_clock op works regardless of queue
format; only the per-packet path is DQO-only.
next prev parent reply other threads:[~2026-05-13 14:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 0:53 [PATCH 0/6] net/gve: add hardware timestamping support Mark Blasko
2026-05-12 0:53 ` [PATCH 1/6] net/gve: add thread safety to admin queue Mark Blasko
2026-05-12 0:53 ` [PATCH 2/6] net/gve: add device option support for HW timestamps Mark Blasko
2026-05-12 0:53 ` [PATCH 3/6] net/gve: add AdminQ command for NIC timestamps Mark Blasko
2026-05-12 0:53 ` [PATCH 4/6] net/gve: add periodic NIC clock synchronization Mark Blasko
2026-05-12 0:53 ` [PATCH 5/6] net/gve: support read clock ethdev op Mark Blasko
2026-05-12 0:53 ` [PATCH 6/6] net/gve: reconstruct HW timestamps from DQO Mark Blasko
2026-05-12 8:26 ` [PATCH 0/6] net/gve: add hardware timestamping support Stephen Hemminger
2026-05-13 14:41 ` Stephen Hemminger [this message]
2026-05-15 23:18 ` Mark Blasko
-- strict thread matches above, loose matches on Subject: below --
2026-05-12 0:50 mark-blasko
2026-05-11 22:43 mark-blasko
2026-05-12 7:14 ` Stephen Hemminger
2026-05-11 22:22 mark-blasko
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=20260513164114.25de780b@stephen-xps.local \
--to=stephen@networkplumber.org \
--cc=blasko@google.com \
--cc=dev@dpdk.org \
/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