DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Rajesh Kumar <rajesh3.kumar@intel.com>
Cc: dev@dpdk.org, bruce.richardson@intel.com, aman.deep.singh@intel.com
Subject: Re: [RFC v2 0/6] introduce PTP protocol library and software relay
Date: Wed, 29 Apr 2026 08:37:04 -0700	[thread overview]
Message-ID: <20260429083704.5ea3d78c@phoenix.local> (raw)
In-Reply-To: <cover.1777413123.git.rajesh3.kumar@intel.com>

On Wed, 29 Apr 2026 03:58:31 +0530
Rajesh Kumar <rajesh3.kumar@intel.com> wrote:

> This series introduces a new DPDK library (lib/ptp) for IEEE 1588-2019
> PTP protocol packet processing and a companion example application
> (ptp_tap_relay_sw) that demonstrates its usage.
> 
> Motivation
> ----------
> Several DPDK applications need to classify and manipulate PTP packets
> (e.g. ptpclient, ptp_tap_relay, custom Transparent Clocks). Today each
> application re-implements its own PTP header parsing and correctionField
> handling. A shared library avoids duplication and provides a tested,
> standards-compliant foundation.


It would be great to have this, though not sure who would use it now.

AI review spotted some things.

Reviewed v2 of the PTP library series. Findings below.
Patch 1/6 (lib/ptp):

RTE_PTP_ETHERTYPE 0x88F7 duplicates RTE_ETHER_TYPE_1588 already in lib/net/rte_ether.h. Use the existing constant or alias to it.
Comment on the version byte says "reserved (4) | versionPTP (4)"; IEEE 1588-2019 redefined the upper nibble as minorVersionPTP.

Patch 2/6 (prog guide):

The guide declares rte_ptp_hdr_get(const struct rte_mbuf *m) but the header has it non-const. Fix the doc, or split into const and non-const variants since the function returns a writable interior pointer.

Patch 3/6 (ptp_tap_relay_sw):

The standalone Makefile is missing CFLAGS += -DALLOW_EXPERIMENTAL_API. All three rte_ptp_* APIs the relay uses are __rte_experimental, so make-based builds will warn or fail under -Werror. meson is fine because meson.build sets allow_experimental_apis = true. Match examples/ptpclient/Makefile.
relay_burst() calls rte_ptp_classify() and then rte_ptp_hdr_get() on every event packet, parsing it twice. The prog guide added in 2/6 explicitly tells callers to use rte_ptp_hdr_get() once and then rte_ptp_msg_type(hdr). The reference example should follow its own guidance.
Minor: stats.corrections is updated via the global while the other counters are passed in by pointer. Inconsistent.

Patch 4/6 (sample app guide):

Limitations section claims L2-only and PTPv2-only, but the relay uses lib/ptp classification which handles VLAN/QinQ/UDPv4/UDPv6 with no version filter. Reword to "tested with L2 PTP" or drop the restriction.

Patch 5/6 (test_ptp.c):

Several correction tests dereference the rte_ptp_hdr_get() return without TEST_ASSERT_NOT_NULL: test_ptp_correction_zero, test_ptp_correction_known, and the four test_ptp_add_correction_* tests. test_ptp_two_step and test_ptp_seq_id get this right.
No coverage for IPv4 with options (IHL > 5). The library's offset += ihl path is exercised by no test.

Patch 6/6: no issues.

  parent reply	other threads:[~2026-04-29 15:37 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28  1:01 [RFC v1 0/4] introduce PTP protocol library and software relay example Rajesh Kumar
2026-04-27 23:42 ` Stephen Hemminger
2026-04-28 16:52   ` Kumar, Rajesh
2026-04-28  1:01 ` [RFC v1 1/4] ptp: introduce PTP protocol library Rajesh Kumar
2026-04-27 23:01   ` Stephen Hemminger
2026-04-28 16:50     ` Kumar, Rajesh
2026-04-28  1:01 ` [RFC v1 2/4] doc: add PTP library programmer's guide Rajesh Kumar
2026-04-28  1:01 ` [RFC v1 3/4] examples/ptp_tap_relay_sw: add software PTP relay example Rajesh Kumar
2026-04-28  1:01 ` [RFC v1 4/4] doc: add PTP software relay sample app guide Rajesh Kumar
2026-04-28 22:28 ` [RFC v2 0/6] introduce PTP protocol library and software relay Rajesh Kumar
2026-04-28 22:28   ` [RFC v2 1/6] ptp: introduce PTP protocol library Rajesh Kumar
2026-04-28 22:28   ` [RFC v2 2/6] doc: add PTP library programmer's guide Rajesh Kumar
2026-04-28 22:28   ` [RFC v2 3/6] examples/ptp_tap_relay_sw: add software PTP relay example Rajesh Kumar
2026-04-28 22:28   ` [RFC v2 4/6] doc: add PTP software relay sample app guide Rajesh Kumar
2026-04-28 22:28   ` [RFC v2 5/6] app/test: add PTP library unit tests Rajesh Kumar
2026-04-28 22:28   ` [RFC v2 6/6] examples/ptpclient: use shared PTP library definitions Rajesh Kumar
2026-04-29 15:37   ` Stephen Hemminger [this message]
2026-05-04  3:49     ` [RFC v2 0/6] introduce PTP protocol library and software relay Kumar, Rajesh3
2026-05-04  9:17 ` [RFC v3 " Rajesh Kumar
2026-05-04  9:17   ` [RFC v3 1/6] ptp: introduce PTP protocol library Rajesh Kumar
2026-05-04  9:17   ` [RFC v3 2/6] doc: add PTP library programmer's guide Rajesh Kumar
2026-05-04  9:17   ` [RFC v3 3/6] examples/ptp_tap_relay_sw: add software PTP relay example Rajesh Kumar
2026-05-04  9:17   ` [RFC v3 4/6] doc: add PTP software relay sample app guide Rajesh Kumar
2026-05-04  9:17   ` [RFC v3 5/6] app/test: add PTP library unit tests Rajesh Kumar
2026-05-04  9:17   ` [RFC v3 6/6] examples/ptpclient: use shared PTP library definitions Rajesh Kumar
2026-05-04 17:56   ` [RFC v3 0/6] introduce PTP protocol library and software relay Stephen Hemminger
2026-05-05 16:38 ` [RFC v4 " Rajesh Kumar
2026-05-05 16:38   ` [RFC v4 1/6] ptp: introduce PTP protocol library Rajesh Kumar
2026-05-05 16:38   ` [RFC v4 2/6] doc: add PTP library programmer's guide Rajesh Kumar
2026-05-05 16:38   ` [RFC v4 3/6] examples/ptp_tap_relay_sw: add software PTP relay example Rajesh Kumar
2026-05-05 16:38   ` [RFC v4 4/6] doc: add PTP software relay sample app guide Rajesh Kumar
2026-05-05 16:38   ` [RFC v4 5/6] app/test: add PTP library unit tests Rajesh Kumar
2026-05-05 16:38   ` [RFC v4 6/6] examples/ptpclient: use shared PTP library definitions Rajesh Kumar
2026-05-06 15:41 ` [RFC v5 0/6] introduce PTP protocol library and software relay Rajesh Kumar
2026-05-06 15:41   ` [RFC v5 1/6] ptp: introduce PTP protocol library Rajesh Kumar
2026-05-06 11:02     ` Morten Brørup
2026-05-07  4:45       ` Kumar, Rajesh
2026-05-06 15:41   ` [RFC v5 2/6] doc: add PTP library programmer's guide Rajesh Kumar
2026-05-06 15:41   ` [RFC v5 3/6] examples/ptp_tap_relay_sw: add software PTP relay example Rajesh Kumar
2026-05-06 15:41   ` [RFC v5 4/6] doc: add PTP software relay sample app guide Rajesh Kumar
2026-05-06 15:41   ` [RFC v5 5/6] app/test: add PTP library unit tests Rajesh Kumar
2026-05-06 15:41   ` [RFC v5 6/6] examples/ptpclient: use shared PTP library definitions Rajesh Kumar
2026-05-06 15:45   ` [RFC v5 0/6] introduce PTP protocol library and software relay Stephen Hemminger
2026-05-07 10:13 ` [PATCH v6 0/4] PTP protocol support in lib/net Rajesh Kumar
2026-05-07 10:13   ` [PATCH v6 1/4] lib/net: add IEEE 1588 PTP v2 protocol header definitions Rajesh Kumar
2026-05-07 10:13   ` [PATCH v6 2/4] examples/ptp_tap_relay_sw: add PTP software transparent clock relay Rajesh Kumar
2026-05-07 10:13   ` [PATCH v6 3/4] doc: update release notes for PTP protocol library Rajesh Kumar
2026-05-07 10:13   ` [PATCH v6 4/4] examples/ptpclient: use shared PTP library definitions Rajesh Kumar
2026-05-07 13:45 ` [PATCH v7 0/4] IEEE 1588 PTP v2 protocol support in lib/net Rajesh Kumar
2026-05-07 13:45   ` [PATCH v7 1/4] lib/net: add IEEE 1588 PTP v2 protocol header definitions Rajesh Kumar
2026-05-07 15:27     ` Morten Brørup
2026-05-09 17:57       ` Kumar, Rajesh
2026-05-07 13:45   ` [PATCH v7 2/4] examples/ptp_tap_relay_sw: add PTP software transparent clock relay Rajesh Kumar
2026-05-07 13:45   ` [PATCH v7 3/4] doc: update release notes for PTP protocol library Rajesh Kumar
2026-05-07 13:45   ` [PATCH v7 4/4] examples/ptpclient: use shared PTP library definitions Rajesh Kumar
2026-05-09 23:25 ` [PATCH v8 0/4] IEEE 1588 PTP v2 protocol support in lib/net Rajesh Kumar
2026-05-09 23:25   ` [PATCH v8 1/4] lib/net: add IEEE 1588 PTP v2 protocol header definitions Rajesh Kumar
2026-05-09 23:25   ` [PATCH v8 2/4] examples/ptp_tap_relay_sw: add PTP software transparent clock relay Rajesh Kumar
2026-05-09 23:25   ` [PATCH v8 3/4] doc: update release notes for PTP protocol library Rajesh Kumar
2026-05-09 23:25   ` [PATCH v8 4/4] examples/ptpclient: use shared PTP library definitions Rajesh Kumar

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=20260429083704.5ea3d78c@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=aman.deep.singh@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=rajesh3.kumar@intel.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