* [PATCH] app/test-pmd: use burst IO for IEEE1588 forwarding
@ 2026-11-18 15:11 Bruce Richardson
2026-11-22 17:44 ` Stephen Hemminger
2026-11-23 12:26 ` [PATCH v2] app/testpmd: " Bruce Richardson
0 siblings, 2 replies; 6+ messages in thread
From: Bruce Richardson @ 2026-11-18 15:11 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, stable, Aman Singh
The IEEE1588 forwarder in test-pmd read a single packet at a time rather
than using the burst size configuration parameter. This meant that it
cannot be used with vector driver paths which require a minimum burst
size for calling the Rx function.
Make the forwarding function respect the configured burst size and only
process packets one at a time, not Rx them one-at-a-time.
Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
app/test-pmd/ieee1588fwd.c | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c
index afea7735c7..5b97ddc41b 100644
--- a/app/test-pmd/ieee1588fwd.c
+++ b/app/test-pmd/ieee1588fwd.c
@@ -34,10 +34,10 @@ struct ptpv2_msg {
/*
* Forwarding of IEEE1588 Precise Time Protocol (PTP) packets.
*
- * In this mode, packets are received one by one and are expected to be
- * PTP V2 L2 Ethernet frames (with the specific Ethernet type "0x88F7")
- * containing PTP "sync" messages (version 2 at offset 1, and message ID
- * 0 at offset 0).
+ * In this mode, packets are received in bursts and processed one by one.
+ * They are expected to be PTP V2 L2 Ethernet frames (with the specific
+ * Ethernet type "0x88F7") containing PTP "sync" messages (version 2 at
+ * offset 1, and message ID 0 at offset 0).
*
* Check that each received packet is a IEEE1588 PTP V2 packet of type
* PTP_SYNC_MESSAGE, and that it has been identified and timestamped
@@ -90,21 +90,14 @@ port_ieee1588_tx_timestamp_check(portid_t pi)
}
static bool
-ieee1588_packet_fwd(struct fwd_stream *fs)
+ieee1588_process_packet(struct fwd_stream *fs, struct rte_mbuf *mb)
{
- struct rte_mbuf *mb;
struct rte_ether_hdr *eth_hdr;
struct rte_ether_addr addr;
struct ptpv2_msg *ptp_hdr;
uint16_t eth_type;
uint32_t timesync_index;
- /*
- * Receive 1 packet at a time.
- */
- if (common_fwd_stream_receive(fs, &mb, 1) == 0)
- return false;
-
/*
* Check that the received packet is a PTP packet that was detected
* by the hardware.
@@ -194,6 +187,20 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
return true;
}
+static bool
+ieee1588_packet_fwd(struct fwd_stream *fs)
+{
+ struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
+ bool fwd = false;
+
+ const uint16_t nb_rx = common_fwd_stream_receive(fs, pkts_burst, nb_pkt_per_burst);
+ for (uint16_t i = 0; i < nb_rx; i++)
+ if (ieee1588_process_packet(fs, pkts_burst[i]))
+ fwd = true;
+
+ return fwd;
+}
+
static int
port_ieee1588_fwd_begin(portid_t pi)
{
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] app/test-pmd: use burst IO for IEEE1588 forwarding
2026-11-18 15:11 [PATCH] app/test-pmd: use burst IO for IEEE1588 forwarding Bruce Richardson
@ 2026-11-22 17:44 ` Stephen Hemminger
2026-11-23 12:26 ` [PATCH v2] app/testpmd: " Bruce Richardson
1 sibling, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2026-11-22 17:44 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, stable, Aman Singh
On Wed, 18 Nov 2026 15:11:55 +0000
Bruce Richardson <bruce.richardson@intel.com> wrote:
> The IEEE1588 forwarder in test-pmd read a single packet at a time rather
> than using the burst size configuration parameter. This meant that it
> cannot be used with vector driver paths which require a minimum burst
> size for calling the Rx function.
>
> Make the forwarding function respect the configured burst size and only
> process packets one at a time, not Rx them one-at-a-time.
>
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
More detailed AI review had pre-existing observation.
Subject: Re: [PATCH] app/test-pmd: use burst IO for IEEE1588 forwarding
Applies cleanly to main. Rx path change is correct; Tx drop path still
frees the mbuf via common_fwd_stream_transmit().
Info
ieee1588_packet_fwd() returns true only if at least one packet was
forwarded. Other engines (macfwd, iofwd) return true whenever
nb_rx > 0, so busy-cycle accounting counts a burst of rejected
packets as idle here. This matches the old single-packet behaviour,
but with bursts it is simpler to follow the other engines:
nb_rx = common_fwd_stream_receive(fs, pkts_burst,
nb_pkt_per_burst);
for (i = 0; i < nb_rx; i++)
ieee1588_process_packet(fs, pkts_burst[i]);
return nb_rx > 0;
ieee1588_process_packet() could then return void.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] app/testpmd: use burst IO for IEEE1588 forwarding
2026-11-18 15:11 [PATCH] app/test-pmd: use burst IO for IEEE1588 forwarding Bruce Richardson
2026-11-22 17:44 ` Stephen Hemminger
@ 2026-11-23 12:26 ` Bruce Richardson
2026-11-23 16:50 ` Stephen Hemminger
1 sibling, 1 reply; 6+ messages in thread
From: Bruce Richardson @ 2026-11-23 12:26 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, stable
The IEEE1588 forwarder in test-pmd read a single packet at a time rather
than using the burst size configuration parameter. This meant that it
cannot be used with vector driver paths which require a minimum burst
size for calling the Rx function.
Make the forwarding function respect the configured burst size and only
process packets one at a time, not Rx them one-at-a-time.
Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
V2: align return value from ieee_packet_fwd() with other fwd fns.
---
app/test-pmd/ieee1588fwd.c | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c
index afea7735c7..57c426e819 100644
--- a/app/test-pmd/ieee1588fwd.c
+++ b/app/test-pmd/ieee1588fwd.c
@@ -34,10 +34,10 @@ struct ptpv2_msg {
/*
* Forwarding of IEEE1588 Precise Time Protocol (PTP) packets.
*
- * In this mode, packets are received one by one and are expected to be
- * PTP V2 L2 Ethernet frames (with the specific Ethernet type "0x88F7")
- * containing PTP "sync" messages (version 2 at offset 1, and message ID
- * 0 at offset 0).
+ * In this mode, packets are received in bursts and processed one by one.
+ * They are expected to be PTP V2 L2 Ethernet frames (with the specific
+ * Ethernet type "0x88F7") containing PTP "sync" messages (version 2 at
+ * offset 1, and message ID 0 at offset 0).
*
* Check that each received packet is a IEEE1588 PTP V2 packet of type
* PTP_SYNC_MESSAGE, and that it has been identified and timestamped
@@ -90,21 +90,14 @@ port_ieee1588_tx_timestamp_check(portid_t pi)
}
static bool
-ieee1588_packet_fwd(struct fwd_stream *fs)
+ieee1588_process_packet(struct fwd_stream *fs, struct rte_mbuf *mb)
{
- struct rte_mbuf *mb;
struct rte_ether_hdr *eth_hdr;
struct rte_ether_addr addr;
struct ptpv2_msg *ptp_hdr;
uint16_t eth_type;
uint32_t timesync_index;
- /*
- * Receive 1 packet at a time.
- */
- if (common_fwd_stream_receive(fs, &mb, 1) == 0)
- return false;
-
/*
* Check that the received packet is a PTP packet that was detected
* by the hardware.
@@ -194,6 +187,18 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
return true;
}
+static bool
+ieee1588_packet_fwd(struct fwd_stream *fs)
+{
+ struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
+
+ const uint16_t nb_rx = common_fwd_stream_receive(fs, pkts_burst, nb_pkt_per_burst);
+ for (uint16_t i = 0; i < nb_rx; i++)
+ (void)ieee1588_process_packet(fs, pkts_burst[i]);
+
+ return nb_rx > 0;
+}
+
static int
port_ieee1588_fwd_begin(portid_t pi)
{
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] app/testpmd: use burst IO for IEEE1588 forwarding
2026-11-23 12:26 ` [PATCH v2] app/testpmd: " Bruce Richardson
@ 2026-11-23 16:50 ` Stephen Hemminger
2026-11-23 16:53 ` Bruce Richardson
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2026-11-23 16:50 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, stable
On Mon, 23 Nov 2026 12:26:26 +0000
Bruce Richardson <bruce.richardson@intel.com> wrote:
Since only called here:
> static bool
> -ieee1588_packet_fwd(struct fwd_stream *fs)
> +ieee1588_process_packet(struct fwd_stream *fs, struct rte_mbuf *mb)
> {
Make it void not bool
and drop the cast.
> +static bool
> +ieee1588_packet_fwd(struct fwd_stream *fs)
> +{
> + struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
> +
> + const uint16_t nb_rx = common_fwd_stream_receive(fs, pkts_burst, nb_pkt_per_burst);
> + for (uint16_t i = 0; i < nb_rx; i++)
> + (void)ieee1588_process_packet(fs, pkts_burst[i]);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] app/testpmd: use burst IO for IEEE1588 forwarding
2026-11-23 16:50 ` Stephen Hemminger
@ 2026-11-23 16:53 ` Bruce Richardson
2026-11-23 18:38 ` Stephen Hemminger
0 siblings, 1 reply; 6+ messages in thread
From: Bruce Richardson @ 2026-11-23 16:53 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev, stable
On Mon, Nov 23, 2026 at 08:50:50AM -0800, Stephen Hemminger wrote:
> On Mon, 23 Nov 2026 12:26:26 +0000
> Bruce Richardson <bruce.richardson@intel.com> wrote:
>
> Since only called here:
> > static bool
> > -ieee1588_packet_fwd(struct fwd_stream *fs)
> > +ieee1588_process_packet(struct fwd_stream *fs, struct rte_mbuf *mb)
> > {
>
> Make it void not bool
>
> and drop the cast.
>
I thought about that, and thought it best to leave it as bool to allow for
any future error checking we might need. The cast can be safely dropped,
but I think some form of return value might be useful from this.
> > +static bool
> > +ieee1588_packet_fwd(struct fwd_stream *fs)
> > +{
> > + struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
> > +
> > + const uint16_t nb_rx = common_fwd_stream_receive(fs, pkts_burst, nb_pkt_per_burst);
> > + for (uint16_t i = 0; i < nb_rx; i++)
> > + (void)ieee1588_process_packet(fs, pkts_burst[i]);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] app/testpmd: use burst IO for IEEE1588 forwarding
2026-11-23 16:53 ` Bruce Richardson
@ 2026-11-23 18:38 ` Stephen Hemminger
0 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2026-11-23 18:38 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, stable
On Mon, 23 Nov 2026 16:53:38 +0000
Bruce Richardson <bruce.richardson@intel.com> wrote:
> > Since only called here:
> > > static bool
> > > -ieee1588_packet_fwd(struct fwd_stream *fs)
> > > +ieee1588_process_packet(struct fwd_stream *fs, struct rte_mbuf *mb)
> > > {
> >
> > Make it void not bool
> >
> > and drop the cast.
> >
>
> I thought about that, and thought it best to leave it as bool to allow for
> any future error checking we might need. The cast can be safely dropped,
> but I think some form of return value might be useful from this.
YAGNI
Since it is internal to the file, you can change API at will later
to return an int or whatever suits.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-23 18:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 15:11 [PATCH] app/test-pmd: use burst IO for IEEE1588 forwarding Bruce Richardson
2026-11-22 17:44 ` Stephen Hemminger
2026-11-23 12:26 ` [PATCH v2] app/testpmd: " Bruce Richardson
2026-11-23 16:50 ` Stephen Hemminger
2026-11-23 16:53 ` Bruce Richardson
2026-11-23 18:38 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox