[v3,4/4] app/testpmd: collect bad outer L4 checksum for csum engine
diff mbox series

Message ID 20181003181657.32236-4-jerin.jacob@caviumnetworks.com
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • [v3,1/4] ethdev: add Rx offload outer UDP checksum definition
Related show

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail Compilation issues

Commit Message

Jerin Jacob Oct. 3, 2018, 6:16 p.m. UTC
Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD
errors.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
v3:
- Added Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
- Removed unnecessary extra empty line(Andrew Rybchenko)
- Simplify calculation rx_bad_outer_l4_csum logic(Andrew Rybchenko)

v2:
- Added PKT_RX_EL4_CKSUM_BAD statistics

---
 app/test-pmd/csumonly.c |  5 +++++
 app/test-pmd/testpmd.c  | 18 +++++++++++++-----
 app/test-pmd/testpmd.h  |  4 ++++
 3 files changed, 22 insertions(+), 5 deletions(-)

Comments

Iremonger, Bernard Oct. 4, 2018, 1:45 p.m. UTC | #1
Hi Jerin,

> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Wednesday, October 3, 2018 7:17 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org; shahafs@mellanox.com; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4
> checksum for csum engine
> 
> Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD errors.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---

<snip>

The following checkpatch warnings should probably be fixed

WARNING:LONG_LINE: line over 80 characters
#86: FILE: app/test-pmd/testpmd.c:1043:
+                       printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",

WARNING:LONG_LINE: line over 80 characters
#98: FILE: app/test-pmd/testpmd.c:1063:
+                       printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"    Bad-outer-l4csum: %-14"PRIu64"\n",

Regards,

Bernard.
Jerin Jacob Oct. 4, 2018, 2:16 p.m. UTC | #2
-----Original Message-----
> Date: Thu, 4 Oct 2018 13:45:42 +0000
> From: "Iremonger, Bernard" <bernard.iremonger@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, "Lu, Wenzhuo"
>  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>
> CC: "dev@dpdk.org" <dev@dpdk.org>, "shahafs@mellanox.com"
>  <shahafs@mellanox.com>
> Subject: RE: [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4
>  checksum for csum engine
> 
> Hi Jerin,

Hi Iremonger,

> 
> > -----Original Message-----
> > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > Sent: Wednesday, October 3, 2018 7:17 PM
> > To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Iremonger, Bernard
> > <bernard.iremonger@intel.com>
> > Cc: dev@dpdk.org; shahafs@mellanox.com; Jerin Jacob
> > <jerin.jacob@caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4
> > checksum for csum engine
> >
> > Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD errors.
> >
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > ---
> 
> <snip>
> 
> The following checkpatch warnings should probably be fixed
> 
> WARNING:LONG_LINE: line over 80 characters
> #86: FILE: app/test-pmd/testpmd.c:1043:
> +                       printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",
> 
> WARNING:LONG_LINE: line over 80 characters
> #98: FILE: app/test-pmd/testpmd.c:1063:
> +                       printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"    Bad-outer-l4csum: %-14"PRIu64"\n",
>

AFAIK, printf's string can be >80 to allow string strip
Iremonger, Bernard Oct. 4, 2018, 3:06 p.m. UTC | #3
Hi Jerin,

<snip>

> > > Subject: [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4
> > > checksum for csum engine
> > >
> > > Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD errors.
> > >
> > > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > > Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > > ---
> >
> > <snip>
> >
> > The following checkpatch warnings should probably be fixed
> >
> > WARNING:LONG_LINE: line over 80 characters
> > #86: FILE: app/test-pmd/testpmd.c:1043:
> > +                       printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum:
> > + %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",
> >
> > WARNING:LONG_LINE: line over 80 characters
> > #98: FILE: app/test-pmd/testpmd.c:1063:
> > +                       printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"
> Bad-outer-l4csum: %-14"PRIu64"\n",
> >
> 
> AFAIK, printf's string can be >80 to allow string strip

Yes, there is flexibility, not sure how much, the above lines are > 100 chars.

Otherwise

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

Patch
diff mbox series

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index ea5b112d6..312b7e1e3 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -701,6 +701,7 @@  pkt_burst_checksum_forward(struct fwd_stream *fs)
 	uint32_t retry;
 	uint32_t rx_bad_ip_csum;
 	uint32_t rx_bad_l4_csum;
+	uint32_t rx_bad_outer_l4_csum;
 	struct testpmd_offload_info info;
 	uint16_t nb_segments = 0;
 	int ret;
@@ -726,6 +727,7 @@  pkt_burst_checksum_forward(struct fwd_stream *fs)
 	fs->rx_packets += nb_rx;
 	rx_bad_ip_csum = 0;
 	rx_bad_l4_csum = 0;
+	rx_bad_outer_l4_csum = 0;
 	gro_enable = gro_ports[fs->rx_port].enable;
 
 	txp = &ports[fs->tx_port];
@@ -753,6 +755,8 @@  pkt_burst_checksum_forward(struct fwd_stream *fs)
 			rx_bad_ip_csum += 1;
 		if ((rx_ol_flags & PKT_RX_L4_CKSUM_MASK) == PKT_RX_L4_CKSUM_BAD)
 			rx_bad_l4_csum += 1;
+		if (rx_ol_flags & PKT_RX_EL4_CKSUM_BAD)
+			rx_bad_outer_l4_csum += 1;
 
 		/* step 1: dissect packet, parsing optional vlan, ip4/ip6, vxlan
 		 * and inner headers */
@@ -991,6 +995,7 @@  pkt_burst_checksum_forward(struct fwd_stream *fs)
 	fs->tx_packets += nb_tx;
 	fs->rx_bad_ip_csum += rx_bad_ip_csum;
 	fs->rx_bad_l4_csum += rx_bad_l4_csum;
+	fs->rx_bad_outer_l4_csum += rx_bad_outer_l4_csum;
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
 	fs->tx_burst_stats.pkt_burst_spread[nb_tx]++;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 001f0e552..2a641fcfe 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1040,8 +1040,9 @@  fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
-			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64" \n",
-			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",
+			       port->rx_bad_ip_csum, port->rx_bad_l4_csum,
+			       port->rx_bad_outer_l4_csum);
 		if ((stats->ierrors + stats->rx_nombuf) > 0) {
 			printf("  RX-error: %-"PRIu64"\n",  stats->ierrors);
 			printf("  RX-nombufs: %-14"PRIu64"\n", stats->rx_nombuf);
@@ -1059,8 +1060,9 @@  fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
-			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"\n",
-			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"    Bad-outer-l4csum: %-14"PRIu64"\n",
+			       port->rx_bad_ip_csum, port->rx_bad_l4_csum,
+			       port->rx_bad_outer_l4_csum);
 		if ((stats->ierrors + stats->rx_nombuf) > 0) {
 			printf("  RX-error:%"PRIu64"\n", stats->ierrors);
 			printf("  RX-nombufs:             %14"PRIu64"\n",
@@ -1124,7 +1126,9 @@  fwd_stream_stats_display(streamid_t stream_id)
 	/* if checksum mode */
 	if (cur_fwd_eng == &csum_fwd_engine) {
 	       printf("  RX- bad IP checksum: %-14u  Rx- bad L4 checksum: "
-			"%-14u\n", fs->rx_bad_ip_csum, fs->rx_bad_l4_csum);
+			"%-14u Rx- bad outer L4 checksum: %-14u\n",
+			fs->rx_bad_ip_csum, fs->rx_bad_l4_csum,
+			fs->rx_bad_outer_l4_csum);
 	}
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
@@ -1378,6 +1382,7 @@  start_packet_forwarding(int with_tx_first)
 		fwd_streams[sm_id]->fwd_dropped = 0;
 		fwd_streams[sm_id]->rx_bad_ip_csum = 0;
 		fwd_streams[sm_id]->rx_bad_l4_csum = 0;
+		fwd_streams[sm_id]->rx_bad_outer_l4_csum = 0;
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
 		memset(&fwd_streams[sm_id]->rx_burst_stats, 0,
@@ -1483,6 +1488,9 @@  stop_packet_forwarding(void)
 		ports[fwd_streams[sm_id]->rx_port].rx_bad_l4_csum =
 							rx_bad_l4_csum;
 
+		ports[fwd_streams[sm_id]->rx_port].rx_bad_outer_l4_csum +=
+				fwd_streams[sm_id]->rx_bad_outer_l4_csum;
+
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 		fwd_cycles = (uint64_t) (fwd_cycles +
 					 fwd_streams[sm_id]->core_cycles);
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index a1f661472..106aeefc2 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -112,6 +112,8 @@  struct fwd_stream {
 	unsigned int fwd_dropped; /**< received packets not forwarded */
 	unsigned int rx_bad_ip_csum ; /**< received packets has bad ip checksum */
 	unsigned int rx_bad_l4_csum ; /**< received packets has bad l4 checksum */
+	unsigned int rx_bad_outer_l4_csum;
+	/**< received packets has bad outer l4 checksum */
 	unsigned int gro_times;	/**< GRO operation times */
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 	uint64_t     core_cycles; /**< used for RX and TX processing */
@@ -165,6 +167,8 @@  struct rte_port {
 	void                    *fwd_ctx;   /**< Forwarding mode context */
 	uint64_t                rx_bad_ip_csum; /**< rx pkts with bad ip checksum  */
 	uint64_t                rx_bad_l4_csum; /**< rx pkts with bad l4 checksum */
+	uint64_t                rx_bad_outer_l4_csum;
+	/**< rx pkts with bad outer l4 checksum */
 	uint8_t                 tx_queue_stats_mapping_enabled;
 	uint8_t                 rx_queue_stats_mapping_enabled;
 	volatile uint16_t        port_status;    /**< port started or not */