[PATCH v2 3/9] app/testpmd: rework ieee1588 engine fwd configuration
David Marchand
david.marchand at redhat.com
Mon Feb 20 17:40:57 CET 2023
This fwd engine currently ignores the forwarding configuration.
Force it explicitly when initialising the stream.
The code is then more consistent with other fwd engines (i.e. receiving
on fs->rx_port, transmitting on fs->tx_port).
Signed-off-by: David Marchand <david.marchand at redhat.com>
---
app/test-pmd/ieee1588fwd.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c
index 896d5ef26a..242d272948 100644
--- a/app/test-pmd/ieee1588fwd.c
+++ b/app/test-pmd/ieee1588fwd.c
@@ -184,8 +184,8 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
/* Forward PTP packet with hardware TX timestamp */
mb->ol_flags |= RTE_MBUF_F_TX_IEEE1588_TMST;
- if (rte_eth_tx_burst(fs->rx_port, fs->tx_queue, &mb, 1) == 0) {
- printf("Port %u sent PTP packet dropped\n", fs->rx_port);
+ if (rte_eth_tx_burst(fs->tx_port, fs->tx_queue, &mb, 1) == 0) {
+ printf("Port %u sent PTP packet dropped\n", fs->tx_port);
fs->fwd_dropped += 1;
rte_pktmbuf_free(mb);
return;
@@ -195,7 +195,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
/*
* Check the TX timestamp.
*/
- port_ieee1588_tx_timestamp_check(fs->rx_port);
+ port_ieee1588_tx_timestamp_check(fs->tx_port);
}
static int
@@ -216,6 +216,9 @@ port_ieee1588_stream_init(struct fwd_stream *fs)
{
bool rx_stopped, tx_stopped;
+ /* Force transmission on reception port */
+ fs->tx_port = fs->rx_port;
+
rx_stopped = ports[fs->rx_port].rxq[fs->rx_queue].state ==
RTE_ETH_QUEUE_STATE_STOPPED;
tx_stopped = ports[fs->tx_port].txq[fs->tx_queue].state ==
--
2.39.2
More information about the dev
mailing list