From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
stable@dpdk.org, Aman Singh <aman.deep.singh@intel.com>
Subject: [PATCH] app/test-pmd: use burst IO for IEEE1588 forwarding
Date: Wed, 18 Nov 2026 15:11:55 +0000 [thread overview]
Message-ID: <20261118151155.2740034-1-bruce.richardson@intel.com> (raw)
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
reply other threads:[~2026-11-18 15:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261118151155.2740034-1-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=aman.deep.singh@intel.com \
--cc=dev@dpdk.org \
--cc=stable@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