DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org, pablo.de.lara.guarch@intel.com
Cc: thomas.monjalon@6wind.com
Subject: [dpdk-dev] [PATCH v6 3/8] app/testpmd: dump Rx flags in csum engine
Date: Wed, 12 Oct 2016 17:39:45 +0200	[thread overview]
Message-ID: <1476286790-26271-4-git-send-email-olivier.matz@6wind.com> (raw)
In-Reply-To: <1476286790-26271-1-git-send-email-olivier.matz@6wind.com>

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 app/test-pmd/csumonly.c | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 2ecd6b8..42974d5 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -652,7 +652,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	uint16_t nb_rx;
 	uint16_t nb_tx;
 	uint16_t i;
-	uint64_t ol_flags;
+	uint64_t rx_ol_flags, tx_ol_flags;
 	uint16_t testpmd_ol_flags;
 	uint32_t retry;
 	uint32_t rx_bad_ip_csum;
@@ -693,13 +693,14 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1],
 						       void *));
 
-		ol_flags = 0;
-		info.is_tunnel = 0;
 		m = pkts_burst[i];
+		info.is_tunnel = 0;
+		tx_ol_flags = 0;
+		rx_ol_flags = m->ol_flags;
 
 		/* Update the L3/L4 checksum error packet statistics */
-		rx_bad_ip_csum += ((m->ol_flags & PKT_RX_IP_CKSUM_BAD) != 0);
-		rx_bad_l4_csum += ((m->ol_flags & PKT_RX_L4_CKSUM_BAD) != 0);
+		rx_bad_ip_csum += ((rx_ol_flags & PKT_RX_IP_CKSUM_BAD) != 0);
+		rx_bad_l4_csum += ((rx_ol_flags & PKT_RX_L4_CKSUM_BAD) != 0);
 
 		/* step 1: dissect packet, parsing optional vlan, ip4/ip6, vxlan
 		 * and inner headers */
@@ -721,7 +722,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 					info.l3_len);
 				parse_vxlan(udp_hdr, &info, m->packet_type);
 				if (info.is_tunnel)
-					ol_flags |= PKT_TX_TUNNEL_VXLAN;
+					tx_ol_flags |= PKT_TX_TUNNEL_VXLAN;
 			} else if (info.l4_proto == IPPROTO_GRE) {
 				struct simple_gre_hdr *gre_hdr;
 
@@ -729,14 +730,14 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 					((char *)l3_hdr + info.l3_len);
 				parse_gre(gre_hdr, &info);
 				if (info.is_tunnel)
-					ol_flags |= PKT_TX_TUNNEL_GRE;
+					tx_ol_flags |= PKT_TX_TUNNEL_GRE;
 			} else if (info.l4_proto == IPPROTO_IPIP) {
 				void *encap_ip_hdr;
 
 				encap_ip_hdr = (char *)l3_hdr + info.l3_len;
 				parse_encap_ip(encap_ip_hdr, &info);
 				if (info.is_tunnel)
-					ol_flags |= PKT_TX_TUNNEL_IPIP;
+					tx_ol_flags |= PKT_TX_TUNNEL_IPIP;
 			}
 		}
 
@@ -759,15 +760,16 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 		 * is configured, prepare the mbuf for TCP segmentation. */
 
 		/* process checksums of inner headers first */
-		ol_flags |= process_inner_cksums(l3_hdr, &info, testpmd_ol_flags);
+		tx_ol_flags |= process_inner_cksums(l3_hdr, &info,
+			testpmd_ol_flags);
 
 		/* Then process outer headers if any. Note that the software
 		 * checksum will be wrong if one of the inner checksums is
 		 * processed in hardware. */
 		if (info.is_tunnel == 1) {
-			ol_flags |= process_outer_cksums(outer_l3_hdr, &info,
+			tx_ol_flags |= process_outer_cksums(outer_l3_hdr, &info,
 					testpmd_ol_flags,
-					!!(ol_flags & PKT_TX_TCP_SEG));
+					!!(tx_ol_flags & PKT_TX_TCP_SEG));
 		}
 
 		/* step 4: fill the mbuf meta data (flags and header lengths) */
@@ -802,7 +804,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			m->l4_len = info.l4_len;
 			m->tso_segsz = info.tso_segsz;
 		}
-		m->ol_flags = ol_flags;
+		m->ol_flags = tx_ol_flags;
 
 		/* Do split & copy for the packet. */
 		if (tx_pkt_split != TX_PKT_SPLIT_OFF) {
@@ -822,10 +824,11 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			printf("mbuf=%p, pkt_len=%u, nb_segs=%hhu:\n",
 				m, m->pkt_len, m->nb_segs);
 			/* dump rx parsed packet info */
+			rte_get_rx_ol_flag_list(rx_ol_flags, buf, sizeof(buf));
 			printf("rx: l2_len=%d ethertype=%x l3_len=%d "
-				"l4_proto=%d l4_len=%d\n",
+				"l4_proto=%d l4_len=%d flags=%s\n",
 				info.l2_len, rte_be_to_cpu_16(info.ethertype),
-				info.l3_len, info.l4_proto, info.l4_len);
+				info.l3_len, info.l4_proto, info.l4_len, buf);
 			if (info.is_tunnel == 1)
 				printf("rx: outer_l2_len=%d outer_ethertype=%x "
 					"outer_l3_len=%d\n", info.outer_l2_len,
-- 
2.8.1

  parent reply	other threads:[~2016-10-12 15:40 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09  7:55 [dpdk-dev] [PATCH v2 0/8] Misc enhancements in testpmd Olivier Matz
2016-09-09  7:55 ` [dpdk-dev] [PATCH v2 1/8] mbuf: add function to dump ol flag list Olivier Matz
2016-10-05  6:45   ` De Lara Guarch, Pablo
2016-10-05 14:19     ` Olivier Matz
2016-10-06  8:42   ` [dpdk-dev] [PATCH v3] " Olivier Matz
2016-10-07  3:51     ` De Lara Guarch, Pablo
2016-10-07 15:39       ` Olivier Matz
2016-09-09  7:55 ` [dpdk-dev] [PATCH v2 2/8] app/testpmd: use new function to dump offload flags Olivier Matz
2016-09-09  7:55 ` [dpdk-dev] [PATCH v2 3/8] app/testpmd: dump rx flags in csum engine Olivier Matz
2016-09-09  7:55 ` [dpdk-dev] [PATCH v2 4/8] app/testpmd: add option to enable lro Olivier Matz
2016-10-05  6:26   ` De Lara Guarch, Pablo
2016-10-05 14:18     ` Olivier Matz
2016-10-06  8:44   ` [dpdk-dev] [PATCH v3] " Olivier Matz
2016-10-06  8:47     ` [dpdk-dev] [PATCH v4] " Olivier Matz
2016-09-09  7:55 ` [dpdk-dev] [PATCH v2 5/8] app/testpmd: do not change ip addrs in csum engine Olivier Matz
2016-09-09  7:55 ` [dpdk-dev] [PATCH v2 6/8] app/testpmd: display rx port " Olivier Matz
2016-09-09  7:55 ` [dpdk-dev] [PATCH v2 7/8] app/testpmd: don't use tso if packet is too small Olivier Matz
2016-09-09  7:55 ` [dpdk-dev] [PATCH v2 8/8] app/testpmd: hide segsize when unrelevant in csum engine Olivier Matz
2016-10-03  9:02 ` [dpdk-dev] [PATCH v2 0/8] Misc enhancements in testpmd Olivier Matz
2016-10-07 16:05 ` [dpdk-dev] [PATCH v5 " Olivier Matz
2016-10-07 16:05   ` [dpdk-dev] [PATCH v5 1/8] mbuf: add function to dump ol flag list Olivier Matz
2016-10-11 20:42     ` Thomas Monjalon
2016-10-07 16:05   ` [dpdk-dev] [PATCH v5 2/8] app/testpmd: use new function to dump offload flags Olivier Matz
2016-10-07 16:05   ` [dpdk-dev] [PATCH v5 3/8] app/testpmd: dump Rx flags in csum engine Olivier Matz
2016-10-07 16:05   ` [dpdk-dev] [PATCH v5 4/8] app/testpmd: add option to enable lro Olivier Matz
2016-10-07 16:05   ` [dpdk-dev] [PATCH v5 5/8] app/testpmd: do not change ip addrs in csum engine Olivier Matz
2016-10-07 16:05   ` [dpdk-dev] [PATCH v5 6/8] app/testpmd: display Rx port " Olivier Matz
2016-10-07 16:05   ` [dpdk-dev] [PATCH v5 7/8] app/testpmd: don't use tso if packet is too small Olivier Matz
2016-10-07 16:05   ` [dpdk-dev] [PATCH v5 8/8] app/testpmd: hide segsize when unrelevant in csum engine Olivier Matz
2016-10-11 18:13   ` [dpdk-dev] [PATCH v5 0/8] Misc enhancements in testpmd De Lara Guarch, Pablo
2016-10-12 15:39   ` [dpdk-dev] [PATCH v6 " Olivier Matz
2016-10-12 15:39     ` [dpdk-dev] [PATCH v6 1/8] mbuf: add function to dump ol flag list Olivier Matz
2016-10-12 15:39     ` [dpdk-dev] [PATCH v6 2/8] app/testpmd: use new function to dump offload flags Olivier Matz
2016-10-12 15:39     ` Olivier Matz [this message]
2016-10-12 15:39     ` [dpdk-dev] [PATCH v6 4/8] app/testpmd: add option to enable lro Olivier Matz
2016-10-12 15:39     ` [dpdk-dev] [PATCH v6 5/8] app/testpmd: do not change ip addrs in csum engine Olivier Matz
2016-10-12 15:39     ` [dpdk-dev] [PATCH v6 6/8] app/testpmd: display Rx port " Olivier Matz
2016-10-12 15:39     ` [dpdk-dev] [PATCH v6 7/8] app/testpmd: don't use tso if packet is too small Olivier Matz
2016-10-12 15:39     ` [dpdk-dev] [PATCH v6 8/8] app/testpmd: hide segsize when unrelevant in csum engine Olivier Matz
2016-10-12 16:41     ` [dpdk-dev] [PATCH v6 0/8] Misc enhancements in testpmd Thomas Monjalon

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=1476286790-26271-4-git-send-email-olivier.matz@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=thomas.monjalon@6wind.com \
    /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).