DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] net/iavf: handle PF not enabling Rx timestamps properly
@ 2025-11-13 21:33 Jacob Keller
  2025-11-13 21:33 ` [PATCH 1/2] net/iavf: check if PF actually indicates Rx timestamps Jacob Keller
  2025-11-13 21:33 ` [PATCH 2/2] net/iavf: check Rx timestamp validity bit Jacob Keller
  0 siblings, 2 replies; 3+ messages in thread
From: Jacob Keller @ 2025-11-13 21:33 UTC (permalink / raw)
  To: dev; +Cc: Paul Greenwalt, Vladimir Medvedkin, Jacob Keller

In certain cases, the PF for the iavf driver may support
VIRTCHNL_VF_CAP_PTP but will not enable Rx timestamps. If this occurs, the
iavf driver will attempt to continue anyways. When that happens, the
resulting timestamps will appear to function initially. Upon closer
inspection it becomes clear that the timestamps are invalid and bogus.

First, when reporting a timestamp, always check the validity bit instead of
blindly reporting it. This avoids extending an invalid (likely zero'd)
timestamp value from the Rx descriptor.

Second, don't enable the RTE_ETH_RX_OFFLOAD_TIMESTAMP capability if the PF
doesn't indicate we have support. This will prevent applications from
trying to timestamp when it is not properly enabled.

Typically, this should not happen, as the PFs which support
VIRTCHNL_VF_CAP_PTP should support Rx timestamping. However, we recently
discovered a flaw in some implementations of the
VIRTCHNL_OP_1588_PTP_GET_CAPS command. The layout of the capabilities
structure is incorrect, with the caps member placed at a different byte
offset than the expected structure layout. This is the case with the
upstream Linux ice PF driver.

This results in the PF rejecting the request for Rx timestamping, and
leaving timestamping disabled. A proper fix for this situation is
difficult. If we merely changed the structure layout in DPDK, then it would
stop being compatible with other host OSes and with other implementations
of the Linux ice PF. If we changed the layout upstream, it would break
compatibility with the upstream iAVF VF driver.

A proper fix to resolve this will take some time, as we will likely have to
introduce a new flag or ops capability across many drivers. In the mean
time, we should at least make sure the DPDK driver stops reporting bogus
timestamps in such a setup.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
Jacob Keller (2):
      net/iavf: check if PF actually indicates Rx timestamps
      net/iavf: check Rx timestamp validity bit

 drivers/net/intel/iavf/iavf_rxtx.h   | 3 +++
 drivers/net/intel/iavf/iavf_ethdev.c | 3 ++-
 drivers/net/intel/iavf/iavf_rxtx.c   | 9 ++++++---
 3 files changed, 11 insertions(+), 4 deletions(-)
---
base-commit: be0112878b4fc3a1b918370ed2fe615c52039d77
change-id: 20251113-jk-dpdk-iavf-rx-timestamping-improvements-a06d21385371

Best regards,
--  
Jacob Keller <jacob.e.keller@intel.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-13 21:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-13 21:33 [PATCH 0/2] net/iavf: handle PF not enabling Rx timestamps properly Jacob Keller
2025-11-13 21:33 ` [PATCH 1/2] net/iavf: check if PF actually indicates Rx timestamps Jacob Keller
2025-11-13 21:33 ` [PATCH 2/2] net/iavf: check Rx timestamp validity bit Jacob Keller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).