From patchwork Thu Jun 29 03:06:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 25911 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 71B752B96; Thu, 29 Jun 2017 05:06:22 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (lpdvrndsmtp01.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 487F729CA for ; Thu, 29 Jun 2017 05:06:20 +0200 (CEST) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.224.233]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 6DEA330C027 for ; Wed, 28 Jun 2017 20:06:19 -0700 (PDT) Received: from C02PT1RBG8WP.vpn.broadcom.net (unknown [10.85.248.156]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id B650181EA7 for ; Wed, 28 Jun 2017 20:06:18 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Date: Wed, 28 Jun 2017 22:06:15 -0500 Message-Id: <20170629030615.20098-1-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) Subject: [dpdk-dev] [PATCH] app/testpmd: fix io fwd mode to forward VLAN packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "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 --- 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); /*