patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Shahaf Shuler <shahafs@mellanox.com>
To: ferruh.yigit@intel.com, jingjing.wu@intel.com
Cc: dev@dpdk.org, cchemparathy@tilera.com, stable@dpdk.org
Subject: [dpdk-stable] [PATCH v2 05/10] app/testpmd: fix flowgen forwarding ol flags
Date: Tue, 12 Dec 2017 14:52:49 +0200	[thread overview]
Message-ID: <c46f9a9231cfea65ba8347d21af7b4f5aa6aa800.1513082773.git.shahafs@mellanox.com> (raw)
In-Reply-To: <cover.1513082773.git.shahafs@mellanox.com>

The mbuf ol_flags were taken directly from testpmd internal enumeration
leading to incorrect values.

addressing only insertion offload flags as the checksum flags by
the application design are only with csum forwarding.

Fixes: e9e23a617eb8 ("app/testpmd: add flowgen forwarding engine")
Cc: cchemparathy@tilera.com
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 app/test-pmd/flowgen.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c
index acf9af9..46478fc 100644
--- a/app/test-pmd/flowgen.c
+++ b/app/test-pmd/flowgen.c
@@ -123,7 +123,7 @@
 	struct ipv4_hdr *ip_hdr;
 	struct udp_hdr *udp_hdr;
 	uint16_t vlan_tci, vlan_tci_outer;
-	uint16_t ol_flags;
+	uint64_t ol_flags;
 	uint16_t nb_rx;
 	uint16_t nb_tx;
 	uint16_t nb_pkt;
@@ -151,7 +151,13 @@
 	mbp = current_fwd_lcore()->mbp;
 	vlan_tci = ports[fs->tx_port].tx_vlan_id;
 	vlan_tci_outer = ports[fs->tx_port].tx_vlan_id_outer;
-	ol_flags = ports[fs->tx_port].tx_ol_flags;
+
+	if (ports[fs->tx_port].tx_ol_flags & TESTPMD_TX_OFFLOAD_INSERT_VLAN)
+		ol_flags = PKT_TX_VLAN_PKT;
+	if (ports[fs->tx_port].tx_ol_flags & TESTPMD_TX_OFFLOAD_INSERT_QINQ)
+		ol_flags |= PKT_TX_QINQ_PKT;
+	if (ports[fs->tx_port].tx_ol_flags & TESTPMD_TX_OFFLOAD_MACSEC)
+		ol_flags |= PKT_TX_MACSEC;
 
 	for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) {
 		pkt = rte_mbuf_raw_alloc(mbp);
-- 
1.8.3.1

  parent reply	other threads:[~2017-12-12 12:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20171123120804.143897-1-shahafs@mellanox.com>
     [not found] ` <cover.1513082773.git.shahafs@mellanox.com>
2017-12-12 12:52   ` [dpdk-stable] [PATCH v2 01/10] app/testpmd: fix port configuration print Shahaf Shuler
2017-12-12 12:52   ` Shahaf Shuler [this message]
2018-01-09  5:32     ` [dpdk-stable] [dpdk-dev] [PATCH v2 05/10] app/testpmd: fix flowgen forwarding ol flags Lu, Wenzhuo
     [not found]   ` <cover.1514281259.git.shahafs@mellanox.com>
2017-12-26  9:44     ` [dpdk-stable] [PATCH v3 01/10] app/testpmd: fix port configuration print Shahaf Shuler
2018-01-05  3:33       ` [dpdk-stable] [dpdk-dev] " Lu, Wenzhuo
2017-12-26  9:44     ` [dpdk-stable] [PATCH v3 05/10] app/testpmd: fix flowgen forwarding ol flags Shahaf Shuler
2018-01-09  5:35       ` [dpdk-stable] [dpdk-dev] " Lu, Wenzhuo
     [not found] ` <cover.1515575134.git.shahafs@mellanox.com>
2018-01-10  9:09   ` [dpdk-stable] [PATCH v4 01/11] app/testpmd: fix port configuration print Shahaf Shuler
2018-01-10  9:09   ` [dpdk-stable] [PATCH v4 05/11] app/testpmd: fix flowgen forwarding ol flags Shahaf Shuler

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=c46f9a9231cfea65ba8347d21af7b4f5aa6aa800.1513082773.git.shahafs@mellanox.com \
    --to=shahafs@mellanox.com \
    --cc=cchemparathy@tilera.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jingjing.wu@intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).