DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix io fwd mode to forward VLAN packets
@ 2017-06-29  3:06 Ajit Khaparde
  2017-06-29  5:36 ` Wu, Jingjing
  0 siblings, 1 reply; 2+ messages in thread
From: Ajit Khaparde @ 2017-06-29  3:06 UTC (permalink / raw)
  To: dev

In io fwd mode, while the received VLAN packets are forwarded
for transmit, the ol_flags are not updated appropriately to
indicate presence of VLAN tags in the Tx path. This patch fixes that.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 app/test-pmd/iofwd.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/app/test-pmd/iofwd.c b/app/test-pmd/iofwd.c
index 15cb4a2..997d3c3 100644
--- a/app/test-pmd/iofwd.c
+++ b/app/test-pmd/iofwd.c
@@ -91,6 +91,7 @@ pkt_burst_io_forward(struct fwd_stream *fs)
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 	start_tsc = rte_rdtsc();
 #endif
+	int i;
 
 	/*
 	 * Receive a burst of packets and forward them.
@@ -104,6 +105,20 @@ pkt_burst_io_forward(struct fwd_stream *fs)
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
 	fs->rx_burst_stats.pkt_burst_spread[nb_rx]++;
 #endif
+
+	for (i = 0; i < nb_rx; i++) {
+		uint64_t tx_ol_flags = 0, rx_ol_flags = pkts_burst[i]->ol_flags;
+
+		if (rx_ol_flags & PKT_RX_VLAN_PKT)
+			tx_ol_flags |= PKT_TX_VLAN_PKT;
+		else if (rx_ol_flags & PKT_RX_QINQ_PKT)
+			tx_ol_flags |= PKT_TX_QINQ_PKT;
+
+		pkts_burst[i]->ol_flags = 0;
+		pkts_burst[i]->ol_flags = tx_ol_flags;
+
+	}
+
 	nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
 			pkts_burst, nb_rx);
 	/*
-- 
2.10.1 (Apple Git-78)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-29  5:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29  3:06 [dpdk-dev] [PATCH] app/testpmd: fix io fwd mode to forward VLAN packets Ajit Khaparde
2017-06-29  5:36 ` Wu, Jingjing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).