[v2,3/9] app/testpmd: rework ieee1588 engine fwd configuration
Checks
Commit Message
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@redhat.com>
---
app/test-pmd/ieee1588fwd.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
Comments
On 2/20/2023 10:10 PM, David Marchand wrote:
> 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@redhat.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
> ---
<snip>
@@ -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 ==