From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 2EE8F58D8 for ; Fri, 7 Oct 2016 18:05:38 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 15281293C4; Fri, 7 Oct 2016 18:05:38 +0200 (CEST) From: Olivier Matz To: dev@dpdk.org, pablo.de.lara.guarch@intel.com Date: Fri, 7 Oct 2016 18:05:13 +0200 Message-Id: <1475856318-24616-4-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1475856318-24616-1-git-send-email-olivier.matz@6wind.com> References: <1473407734-11253-1-git-send-email-olivier.matz@6wind.com> <1475856318-24616-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [PATCH v5 3/8] app/testpmd: dump Rx flags in csum engine X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Oct 2016 16:05:38 -0000 Signed-off-by: Olivier Matz --- app/test-pmd/csumonly.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 5ca5702..e7ee0b3 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -640,7 +640,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; @@ -680,13 +680,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 */ @@ -737,13 +738,13 @@ 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); } @@ -777,7 +778,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) { @@ -797,10 +798,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