patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v2 1/4] app/testpmd: remove unused fwd_ctx field
       [not found] ` <1552318522-18777-1-git-send-email-david.marchand@redhat.com>
@ 2019-03-11 15:35   ` David Marchand
  2019-03-19 18:29     ` Ferruh Yigit
       [not found]   ` <1553076154-3907-1-git-send-email-david.marchand@redhat.com>
  1 sibling, 1 reply; 25+ messages in thread
From: David Marchand @ 2019-03-11 15:35 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, stable

Remove some leftover from a previous rework.

Fixes: c4bcc342c8ee ("app/testpmd: refactor ieee1588 forwarding")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
---
Changelog since v1:
- added Cc: stable

---
 app/test-pmd/testpmd.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index fa48878..85b791b 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -173,7 +173,6 @@ struct rte_port {
 	uint16_t                tunnel_tso_segsz; /**< Segmentation offload MSS for tunneled pkts. */
 	uint16_t                tx_vlan_id;/**< The tag ID */
 	uint16_t                tx_vlan_id_outer;/**< The outer tag ID */
-	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;
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [PATCH v2 1/4] app/testpmd: remove unused fwd_ctx field
  2019-03-11 15:35   ` [dpdk-stable] [PATCH v2 1/4] app/testpmd: remove unused fwd_ctx field David Marchand
@ 2019-03-19 18:29     ` Ferruh Yigit
  0 siblings, 0 replies; 25+ messages in thread
From: Ferruh Yigit @ 2019-03-19 18:29 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, stable

On 3/11/2019 3:35 PM, David Marchand wrote:
> Remove some leftover from a previous rework.
> 
> Fixes: c4bcc342c8ee ("app/testpmd: refactor ieee1588 forwarding")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Reviewed-by: Rami Rosen <ramirose@gmail.com>

This patch looks independent from rest the patchset, and simple enough, so
merging it individually.

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-stable] [PATCH v3 1/4] app/testpmd: add missing newline when showing statistics
       [not found]   ` <1553076154-3907-1-git-send-email-david.marchand@redhat.com>
@ 2019-03-20 10:02     ` David Marchand
  2019-03-20 13:49       ` Andrew Rybchenko
  2019-03-20 10:02     ` [dpdk-stable] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 25+ messages in thread
From: David Marchand @ 2019-03-20 10:02 UTC (permalink / raw)
  To: dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko, stable

Having the standard stats and the rx burst stats on the same line gives a
really long line and is not consistent with the rest.

Before:
  RX-packets: 3542977        TX-packets: 3542971        TX-dropped: 6               RX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]
  TX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]

After:
  RX-packets: 4629969        TX-packets: 4629969        TX-dropped: 0
  RX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
  TX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
---
Changelog since v2:
- Cc'd stable

---
 app/test-pmd/testpmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index d9d0c16..78206f6 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1459,7 +1459,7 @@ struct extmem_param {
 	       "TX Port=%2d/Queue=%2d %s\n",
 	       fwd_top_stats_border, fs->rx_port, fs->rx_queue,
 	       fs->tx_port, fs->tx_queue, fwd_top_stats_border);
-	printf("  RX-packets: %-14u TX-packets: %-14u TX-dropped: %-14u",
+	printf("  RX-packets: %-14u TX-packets: %-14u TX-dropped: %-14u\n",
 	       fs->rx_packets, fs->tx_packets, fs->fwd_dropped);
 
 	/* if checksum mode */
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-stable] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits
       [not found]   ` <1553076154-3907-1-git-send-email-david.marchand@redhat.com>
  2019-03-20 10:02     ` [dpdk-stable] [PATCH v3 1/4] app/testpmd: add missing newline when showing statistics David Marchand
@ 2019-03-20 10:02     ` David Marchand
  2019-03-20 13:55       ` Andrew Rybchenko
  2019-03-20 10:02     ` [dpdk-stable] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics David Marchand
       [not found]     ` <1553261824-1881-1-git-send-email-david.marchand@redhat.com>
  3 siblings, 1 reply; 25+ messages in thread
From: David Marchand @ 2019-03-20 10:02 UTC (permalink / raw)
  To: dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko, stable

fwd engine statistics are stored as unsigned int (32bits) and can wrap
quite quickly.
Example: sending 7mpps for 614s gives us 4298000000 packets =>
0x1002e4680 larger than 32bits.

testpmd reports forwarding stats as:
RX-packets: 3500381        TX-packets: 3500010        TX-dropped: 371

While the port and accumulated stats are reported as 64bits:
RX-packets: 4298467677     RX-dropped: 0             RX-total: 4298467677
TX-packets: 4298467306     TX-dropped: 371           TX-total: 4298467677

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changelog since v2:
- split out of the previous patch with a dedicated commitlog
- Cc'd stable

---
 app/test-pmd/testpmd.c | 51 +++++++++++++++++---------------------------------
 app/test-pmd/testpmd.h | 12 ++++++------
 2 files changed, 23 insertions(+), 40 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 78206f6..af9a765 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1459,13 +1459,15 @@ struct extmem_param {
 	       "TX Port=%2d/Queue=%2d %s\n",
 	       fwd_top_stats_border, fs->rx_port, fs->rx_queue,
 	       fs->tx_port, fs->tx_queue, fwd_top_stats_border);
-	printf("  RX-packets: %-14u TX-packets: %-14u TX-dropped: %-14u\n",
+	printf("  RX-packets: %-14"PRIu64" TX-packets: %-14"PRIu64
+	       " TX-dropped: %-14"PRIu64"\n",
 	       fs->rx_packets, fs->tx_packets, fs->fwd_dropped);
 
 	/* if checksum mode */
 	if (cur_fwd_eng == &csum_fwd_engine) {
-	       printf("  RX- bad IP checksum: %-14u  Rx- bad L4 checksum: "
-			"%-14u Rx- bad outer L4 checksum: %-14u\n",
+		printf("  RX- bad IP checksum: %-14"PRIu64
+		       "  Rx- bad L4 checksum: %-14"PRIu64
+		       " Rx- bad outer L4 checksum: %-14"PRIu64"\n",
 			fs->rx_bad_ip_csum, fs->rx_bad_l4_csum,
 			fs->rx_bad_outer_l4_csum);
 	}
@@ -1743,9 +1745,6 @@ struct extmem_param {
 	uint64_t total_rx_dropped;
 	uint64_t total_tx_dropped;
 	uint64_t total_rx_nombuf;
-	uint64_t tx_dropped;
-	uint64_t rx_bad_ip_csum;
-	uint64_t rx_bad_l4_csum;
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 	uint64_t fwd_cycles;
 #endif
@@ -1772,38 +1771,22 @@ struct extmem_param {
 	fwd_cycles = 0;
 #endif
 	for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
+		struct fwd_stream *fs = fwd_streams[sm_id];
+
 		if (cur_fwd_config.nb_fwd_streams >
 		    cur_fwd_config.nb_fwd_ports) {
 			fwd_stream_stats_display(sm_id);
-			ports[fwd_streams[sm_id]->tx_port].tx_stream = NULL;
-			ports[fwd_streams[sm_id]->rx_port].rx_stream = NULL;
+			ports[fs->tx_port].tx_stream = NULL;
+			ports[fs->rx_port].rx_stream = NULL;
 		} else {
-			ports[fwd_streams[sm_id]->tx_port].tx_stream =
-				fwd_streams[sm_id];
-			ports[fwd_streams[sm_id]->rx_port].rx_stream =
-				fwd_streams[sm_id];
-		}
-		tx_dropped = ports[fwd_streams[sm_id]->tx_port].tx_dropped;
-		tx_dropped = (uint64_t) (tx_dropped +
-					 fwd_streams[sm_id]->fwd_dropped);
-		ports[fwd_streams[sm_id]->tx_port].tx_dropped = tx_dropped;
-
-		rx_bad_ip_csum =
-			ports[fwd_streams[sm_id]->rx_port].rx_bad_ip_csum;
-		rx_bad_ip_csum = (uint64_t) (rx_bad_ip_csum +
-					 fwd_streams[sm_id]->rx_bad_ip_csum);
-		ports[fwd_streams[sm_id]->rx_port].rx_bad_ip_csum =
-							rx_bad_ip_csum;
-
-		rx_bad_l4_csum =
-			ports[fwd_streams[sm_id]->rx_port].rx_bad_l4_csum;
-		rx_bad_l4_csum = (uint64_t) (rx_bad_l4_csum +
-					 fwd_streams[sm_id]->rx_bad_l4_csum);
-		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;
+			ports[fs->tx_port].tx_stream = fs;
+			ports[fs->rx_port].rx_stream = fs;
+		}
+		ports[fs->tx_port].tx_dropped += fs->fwd_dropped;
+		ports[fs->rx_port].rx_bad_ip_csum += fs->rx_bad_ip_csum;
+		ports[fs->rx_port].rx_bad_l4_csum += fs->rx_bad_l4_csum;
+		ports[fs->rx_port].rx_bad_outer_l4_csum +=
+				fs->rx_bad_outer_l4_csum;
 
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 		fwd_cycles = (uint64_t) (fwd_cycles +
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 85b791b..4f4a48f 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -119,12 +119,12 @@ struct fwd_stream {
 	unsigned int retry_enabled;
 
 	/* "read-write" results */
-	unsigned int rx_packets;  /**< received packets */
-	unsigned int tx_packets;  /**< received packets transmitted */
-	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;
+	uint64_t rx_packets;  /**< received packets */
+	uint64_t tx_packets;  /**< received packets transmitted */
+	uint64_t fwd_dropped; /**< received packets not forwarded */
+	uint64_t rx_bad_ip_csum ; /**< received packets has bad ip checksum */
+	uint64_t rx_bad_l4_csum ; /**< received packets has bad l4 checksum */
+	uint64_t 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
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-stable] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics
       [not found]   ` <1553076154-3907-1-git-send-email-david.marchand@redhat.com>
  2019-03-20 10:02     ` [dpdk-stable] [PATCH v3 1/4] app/testpmd: add missing newline when showing statistics David Marchand
  2019-03-20 10:02     ` [dpdk-stable] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
@ 2019-03-20 10:02     ` David Marchand
  2019-03-20 13:58       ` Andrew Rybchenko
       [not found]     ` <1553261824-1881-1-git-send-email-david.marchand@redhat.com>
  3 siblings, 1 reply; 25+ messages in thread
From: David Marchand @ 2019-03-20 10:02 UTC (permalink / raw)
  To: dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko, stable

Caught by code review while investigating the fwd stats display code.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changelog since v2:
- focused on useless casts only
- Cc'd stable

---
 app/test-pmd/testpmd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index af9a765..103319f 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1376,7 +1376,7 @@ struct extmem_param {
 		printf("  RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
 		       "%-"PRIu64"\n",
 		       stats->ipackets, stats->imissed,
-		       (uint64_t) (stats->ipackets + stats->imissed));
+		       stats->ipackets + stats->imissed);
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",
@@ -1390,13 +1390,13 @@ struct extmem_param {
 		printf("  TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
 		       "%-"PRIu64"\n",
 		       stats->opackets, port->tx_dropped,
-		       (uint64_t) (stats->opackets + port->tx_dropped));
+		       stats->opackets + port->tx_dropped);
 	}
 	else {
 		printf("  RX-packets:             %14"PRIu64"    RX-dropped:%14"PRIu64"    RX-total:"
 		       "%14"PRIu64"\n",
 		       stats->ipackets, stats->imissed,
-		       (uint64_t) (stats->ipackets + stats->imissed));
+		       stats->ipackets + stats->imissed);
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"    Bad-outer-l4csum: %-14"PRIu64"\n",
@@ -1411,7 +1411,7 @@ struct extmem_param {
 		printf("  TX-packets:             %14"PRIu64"    TX-dropped:%14"PRIu64"    TX-total:"
 		       "%14"PRIu64"\n",
 		       stats->opackets, port->tx_dropped,
-		       (uint64_t) (stats->opackets + port->tx_dropped));
+		       stats->opackets + port->tx_dropped);
 	}
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [PATCH v3 1/4] app/testpmd: add missing newline when showing statistics
  2019-03-20 10:02     ` [dpdk-stable] [PATCH v3 1/4] app/testpmd: add missing newline when showing statistics David Marchand
@ 2019-03-20 13:49       ` Andrew Rybchenko
  0 siblings, 0 replies; 25+ messages in thread
From: Andrew Rybchenko @ 2019-03-20 13:49 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, stable

On 3/20/19 1:02 PM, David Marchand wrote:
> Having the standard stats and the rx burst stats on the same line gives a
> really long line and is not consistent with the rest.
>
> Before:
>    RX-packets: 3542977        TX-packets: 3542971        TX-dropped: 6               RX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]
>    TX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]
>
> After:
>    RX-packets: 4629969        TX-packets: 4629969        TX-dropped: 0
>    RX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
>    TX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
>
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Reviewed-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits
  2019-03-20 10:02     ` [dpdk-stable] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
@ 2019-03-20 13:55       ` Andrew Rybchenko
  0 siblings, 0 replies; 25+ messages in thread
From: Andrew Rybchenko @ 2019-03-20 13:55 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, stable

On 3/20/19 1:02 PM, David Marchand wrote:
> fwd engine statistics are stored as unsigned int (32bits) and can wrap
> quite quickly.
> Example: sending 7mpps for 614s gives us 4298000000 packets =>
> 0x1002e4680 larger than 32bits.
>
> testpmd reports forwarding stats as:
> RX-packets: 3500381        TX-packets: 3500010        TX-dropped: 371
>
> While the port and accumulated stats are reported as 64bits:
> RX-packets: 4298467677     RX-dropped: 0             RX-total: 4298467677
> TX-packets: 4298467306     TX-dropped: 371           TX-total: 4298467677
>
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

RX and Rx are used for error stats. Don't know why. But the patch simply 
preserves it,
so not a problem of the patch.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics
  2019-03-20 10:02     ` [dpdk-stable] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics David Marchand
@ 2019-03-20 13:58       ` Andrew Rybchenko
  0 siblings, 0 replies; 25+ messages in thread
From: Andrew Rybchenko @ 2019-03-20 13:58 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, stable

On 3/20/19 1:02 PM, David Marchand wrote:
> Caught by code review while investigating the fwd stats display code.
>
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-stable] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
       [not found]     ` <1553261824-1881-1-git-send-email-david.marchand@redhat.com>
@ 2019-03-22 13:37       ` David Marchand
  2019-03-22 17:03         ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
                           ` (2 more replies)
  2019-03-22 13:37       ` [dpdk-stable] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
                         ` (2 subsequent siblings)
  3 siblings, 3 replies; 25+ messages in thread
From: David Marchand @ 2019-03-22 13:37 UTC (permalink / raw)
  To: dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
	ferruh.yigit, stable

Having the standard stats and the rx burst stats on the same line gives a
really long line and is not consistent with the rest.

Before:
  RX-packets: 3542977        TX-packets: 3542971        TX-dropped: 6               RX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]
  TX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]

After:
  RX-packets: 4629969        TX-packets: 4629969        TX-dropped: 0
  RX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
  TX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
Changelog since v2:
- Cc'd stable

---
 app/test-pmd/testpmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 216be47..40199c1 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1459,7 +1459,7 @@ struct extmem_param {
 	       "TX Port=%2d/Queue=%2d %s\n",
 	       fwd_top_stats_border, fs->rx_port, fs->rx_queue,
 	       fs->tx_port, fs->tx_queue, fwd_top_stats_border);
-	printf("  RX-packets: %-14u TX-packets: %-14u TX-dropped: %-14u",
+	printf("  RX-packets: %-14u TX-packets: %-14u TX-dropped: %-14u\n",
 	       fs->rx_packets, fs->tx_packets, fs->fwd_dropped);
 
 	/* if checksum mode */
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-stable] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits
       [not found]     ` <1553261824-1881-1-git-send-email-david.marchand@redhat.com>
  2019-03-22 13:37       ` [dpdk-stable] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics David Marchand
@ 2019-03-22 13:37       ` David Marchand
  2019-03-22 17:06         ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
  2019-03-22 13:37       ` [dpdk-stable] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics David Marchand
       [not found]       ` <1553503906-1508-1-git-send-email-david.marchand@redhat.com>
  3 siblings, 1 reply; 25+ messages in thread
From: David Marchand @ 2019-03-22 13:37 UTC (permalink / raw)
  To: dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
	ferruh.yigit, stable

fwd engine statistics are stored as unsigned int (32bits) and can wrap
quite quickly.
Example: sending 7mpps for 614s gives us 4298000000 packets =>
0x1002e4680 larger than 32bits.

testpmd reports forwarding stats as:
RX-packets: 3500381        TX-packets: 3500010        TX-dropped: 371

While the port and accumulated stats are reported as 64bits:
RX-packets: 4298467677     RX-dropped: 0             RX-total: 4298467677
TX-packets: 4298467306     TX-dropped: 371           TX-total: 4298467677

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
Changelog since v2:
- split out of the previous patch with a dedicated commitlog
- Cc'd stable

---
 app/test-pmd/testpmd.c | 51 +++++++++++++++++---------------------------------
 app/test-pmd/testpmd.h | 12 ++++++------
 2 files changed, 23 insertions(+), 40 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 40199c1..d2ba770 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1459,13 +1459,15 @@ struct extmem_param {
 	       "TX Port=%2d/Queue=%2d %s\n",
 	       fwd_top_stats_border, fs->rx_port, fs->rx_queue,
 	       fs->tx_port, fs->tx_queue, fwd_top_stats_border);
-	printf("  RX-packets: %-14u TX-packets: %-14u TX-dropped: %-14u\n",
+	printf("  RX-packets: %-14"PRIu64" TX-packets: %-14"PRIu64
+	       " TX-dropped: %-14"PRIu64"\n",
 	       fs->rx_packets, fs->tx_packets, fs->fwd_dropped);
 
 	/* if checksum mode */
 	if (cur_fwd_eng == &csum_fwd_engine) {
-	       printf("  RX- bad IP checksum: %-14u  Rx- bad L4 checksum: "
-			"%-14u Rx- bad outer L4 checksum: %-14u\n",
+		printf("  RX- bad IP checksum: %-14"PRIu64
+		       "  Rx- bad L4 checksum: %-14"PRIu64
+		       " Rx- bad outer L4 checksum: %-14"PRIu64"\n",
 			fs->rx_bad_ip_csum, fs->rx_bad_l4_csum,
 			fs->rx_bad_outer_l4_csum);
 	}
@@ -1743,9 +1745,6 @@ struct extmem_param {
 	uint64_t total_rx_dropped;
 	uint64_t total_tx_dropped;
 	uint64_t total_rx_nombuf;
-	uint64_t tx_dropped;
-	uint64_t rx_bad_ip_csum;
-	uint64_t rx_bad_l4_csum;
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 	uint64_t fwd_cycles;
 #endif
@@ -1772,38 +1771,22 @@ struct extmem_param {
 	fwd_cycles = 0;
 #endif
 	for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
+		struct fwd_stream *fs = fwd_streams[sm_id];
+
 		if (cur_fwd_config.nb_fwd_streams >
 		    cur_fwd_config.nb_fwd_ports) {
 			fwd_stream_stats_display(sm_id);
-			ports[fwd_streams[sm_id]->tx_port].tx_stream = NULL;
-			ports[fwd_streams[sm_id]->rx_port].rx_stream = NULL;
+			ports[fs->tx_port].tx_stream = NULL;
+			ports[fs->rx_port].rx_stream = NULL;
 		} else {
-			ports[fwd_streams[sm_id]->tx_port].tx_stream =
-				fwd_streams[sm_id];
-			ports[fwd_streams[sm_id]->rx_port].rx_stream =
-				fwd_streams[sm_id];
-		}
-		tx_dropped = ports[fwd_streams[sm_id]->tx_port].tx_dropped;
-		tx_dropped = (uint64_t) (tx_dropped +
-					 fwd_streams[sm_id]->fwd_dropped);
-		ports[fwd_streams[sm_id]->tx_port].tx_dropped = tx_dropped;
-
-		rx_bad_ip_csum =
-			ports[fwd_streams[sm_id]->rx_port].rx_bad_ip_csum;
-		rx_bad_ip_csum = (uint64_t) (rx_bad_ip_csum +
-					 fwd_streams[sm_id]->rx_bad_ip_csum);
-		ports[fwd_streams[sm_id]->rx_port].rx_bad_ip_csum =
-							rx_bad_ip_csum;
-
-		rx_bad_l4_csum =
-			ports[fwd_streams[sm_id]->rx_port].rx_bad_l4_csum;
-		rx_bad_l4_csum = (uint64_t) (rx_bad_l4_csum +
-					 fwd_streams[sm_id]->rx_bad_l4_csum);
-		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;
+			ports[fs->tx_port].tx_stream = fs;
+			ports[fs->rx_port].rx_stream = fs;
+		}
+		ports[fs->tx_port].tx_dropped += fs->fwd_dropped;
+		ports[fs->rx_port].rx_bad_ip_csum += fs->rx_bad_ip_csum;
+		ports[fs->rx_port].rx_bad_l4_csum += fs->rx_bad_l4_csum;
+		ports[fs->rx_port].rx_bad_outer_l4_csum +=
+				fs->rx_bad_outer_l4_csum;
 
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 		fwd_cycles = (uint64_t) (fwd_cycles +
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 85b791b..4f4a48f 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -119,12 +119,12 @@ struct fwd_stream {
 	unsigned int retry_enabled;
 
 	/* "read-write" results */
-	unsigned int rx_packets;  /**< received packets */
-	unsigned int tx_packets;  /**< received packets transmitted */
-	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;
+	uint64_t rx_packets;  /**< received packets */
+	uint64_t tx_packets;  /**< received packets transmitted */
+	uint64_t fwd_dropped; /**< received packets not forwarded */
+	uint64_t rx_bad_ip_csum ; /**< received packets has bad ip checksum */
+	uint64_t rx_bad_l4_csum ; /**< received packets has bad l4 checksum */
+	uint64_t 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
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-stable] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics
       [not found]     ` <1553261824-1881-1-git-send-email-david.marchand@redhat.com>
  2019-03-22 13:37       ` [dpdk-stable] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics David Marchand
  2019-03-22 13:37       ` [dpdk-stable] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
@ 2019-03-22 13:37       ` David Marchand
  2019-03-22 17:11         ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
       [not found]       ` <1553503906-1508-1-git-send-email-david.marchand@redhat.com>
  3 siblings, 1 reply; 25+ messages in thread
From: David Marchand @ 2019-03-22 13:37 UTC (permalink / raw)
  To: dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
	ferruh.yigit, stable

Caught by code review while investigating the fwd stats display code.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
Changelog since v2:
- focused on useless casts only
- Cc'd stable

---
 app/test-pmd/testpmd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index d2ba770..8c3be14 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1376,7 +1376,7 @@ struct extmem_param {
 		printf("  RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
 		       "%-"PRIu64"\n",
 		       stats->ipackets, stats->imissed,
-		       (uint64_t) (stats->ipackets + stats->imissed));
+		       stats->ipackets + stats->imissed);
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",
@@ -1390,13 +1390,13 @@ struct extmem_param {
 		printf("  TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
 		       "%-"PRIu64"\n",
 		       stats->opackets, port->tx_dropped,
-		       (uint64_t) (stats->opackets + port->tx_dropped));
+		       stats->opackets + port->tx_dropped);
 	}
 	else {
 		printf("  RX-packets:             %14"PRIu64"    RX-dropped:%14"PRIu64"    RX-total:"
 		       "%14"PRIu64"\n",
 		       stats->ipackets, stats->imissed,
-		       (uint64_t) (stats->ipackets + stats->imissed));
+		       stats->ipackets + stats->imissed);
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"    Bad-outer-l4csum: %-14"PRIu64"\n",
@@ -1411,7 +1411,7 @@ struct extmem_param {
 		printf("  TX-packets:             %14"PRIu64"    TX-dropped:%14"PRIu64"    TX-total:"
 		       "%14"PRIu64"\n",
 		       stats->opackets, port->tx_dropped,
-		       (uint64_t) (stats->opackets + port->tx_dropped));
+		       stats->opackets + port->tx_dropped);
 	}
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
  2019-03-22 13:37       ` [dpdk-stable] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics David Marchand
@ 2019-03-22 17:03         ` Maxime Coquelin
  2019-03-22 17:17         ` Maxime Coquelin
  2019-03-22 17:35         ` [dpdk-stable] " Andrew Rybchenko
  2 siblings, 0 replies; 25+ messages in thread
From: Maxime Coquelin @ 2019-03-22 17:03 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
	ferruh.yigit, stable



On 3/22/19 2:37 PM, David Marchand wrote:
> Having the standard stats and the rx burst stats on the same line gives a
> really long line and is not consistent with the rest.
> 
> Before:
>    RX-packets: 3542977        TX-packets: 3542971        TX-dropped: 6               RX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]
>    TX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]
> 
> After:
>    RX-packets: 4629969        TX-packets: 4629969        TX-dropped: 0
>    RX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
>    TX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Reviewed-by: Rami Rosen <ramirose@gmail.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
> Changelog since v2:
> - Cc'd stable
> 
> ---
>   app/test-pmd/testpmd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 216be47..40199c1 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -1459,7 +1459,7 @@ struct extmem_param {
>   	       "TX Port=%2d/Queue=%2d %s\n",
>   	       fwd_top_stats_border, fs->rx_port, fs->rx_queue,
>   	       fs->tx_port, fs->tx_queue, fwd_top_stats_border);
> -	printf("  RX-packets: %-14u TX-packets: %-14u TX-dropped: %-14u",
> +	printf("  RX-packets: %-14u TX-packets: %-14u TX-dropped: %-14u\n",
>   	       fs->rx_packets, fs->tx_packets, fs->fwd_dropped);
>   
>   	/* if checksum mode */
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits
  2019-03-22 13:37       ` [dpdk-stable] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
@ 2019-03-22 17:06         ` Maxime Coquelin
  0 siblings, 0 replies; 25+ messages in thread
From: Maxime Coquelin @ 2019-03-22 17:06 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
	ferruh.yigit, stable



On 3/22/19 2:37 PM, David Marchand wrote:
> fwd engine statistics are stored as unsigned int (32bits) and can wrap
> quite quickly.
> Example: sending 7mpps for 614s gives us 4298000000 packets =>
> 0x1002e4680 larger than 32bits.
> 
> testpmd reports forwarding stats as:
> RX-packets: 3500381        TX-packets: 3500010        TX-dropped: 371
> 
> While the port and accumulated stats are reported as 64bits:
> RX-packets: 4298467677     RX-dropped: 0             RX-total: 4298467677
> TX-packets: 4298467306     TX-dropped: 371           TX-total: 4298467677
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
> Changelog since v2:
> - split out of the previous patch with a dedicated commitlog
> - Cc'd stable
> 
> ---
>   app/test-pmd/testpmd.c | 51 +++++++++++++++++---------------------------------
>   app/test-pmd/testpmd.h | 12 ++++++------
>   2 files changed, 23 insertions(+), 40 deletions(-)
> 


Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics
  2019-03-22 13:37       ` [dpdk-stable] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics David Marchand
@ 2019-03-22 17:11         ` Maxime Coquelin
  0 siblings, 0 replies; 25+ messages in thread
From: Maxime Coquelin @ 2019-03-22 17:11 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
	ferruh.yigit, stable



On 3/22/19 2:37 PM, David Marchand wrote:
> Caught by code review while investigating the fwd stats display code.
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
> Changelog since v2:
> - focused on useless casts only
> - Cc'd stable
> 
> ---
>   app/test-pmd/testpmd.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
  2019-03-22 13:37       ` [dpdk-stable] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics David Marchand
  2019-03-22 17:03         ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
@ 2019-03-22 17:17         ` Maxime Coquelin
  2019-03-22 17:23           ` David Marchand
  2019-03-22 17:35         ` [dpdk-stable] " Andrew Rybchenko
  2 siblings, 1 reply; 25+ messages in thread
From: Maxime Coquelin @ 2019-03-22 17:17 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
	ferruh.yigit, stable



On 3/22/19 2:37 PM, David Marchand wrote:
> Having the standard stats and the rx burst stats on the same line gives a
> really long line and is not consistent with the rest.
> 
> Before:
>    RX-packets: 3542977        TX-packets: 3542971        TX-dropped: 6               RX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]
>    TX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]
> 
> After:
>    RX-packets: 4629969        TX-packets: 4629969        TX-dropped: 0
>    RX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
>    TX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
> 
> Fixes: af75078fece3 ("first public release")
> Cc:stable@dpdk.org

While the patch is good, I wonder whether we should backport it.
Indeed, it might break some scripts parsing testpmd output.

Any thoughts?

> Signed-off-by: David Marchand<david.marchand@redhat.com>
> Reviewed-by: Rami Rosen<ramirose@gmail.com>
> Reviewed-by: Andrew Rybchenko<arybchenko@solarflare.com>
> ---
> Changelog since v2:
> - Cc'd stable
> 
> ---

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
  2019-03-22 17:17         ` Maxime Coquelin
@ 2019-03-22 17:23           ` David Marchand
  2019-03-22 17:31             ` Andrew Rybchenko
  0 siblings, 1 reply; 25+ messages in thread
From: David Marchand @ 2019-03-22 17:23 UTC (permalink / raw)
  To: Maxime Coquelin
  Cc: dev, Wenzhuo Lu, Jingjing Wu, Iremonger, Bernard, Rami Rosen,
	Andrew Rybchenko, Yigit, Ferruh, dpdk stable

On Fri, Mar 22, 2019 at 6:17 PM Maxime Coquelin <maxime.coquelin@redhat.com>
wrote:

>
>
> On 3/22/19 2:37 PM, David Marchand wrote:
> > Having the standard stats and the rx burst stats on the same line gives a
> > really long line and is not consistent with the rest.
> >
> > Before:
> >    RX-packets: 3542977        TX-packets: 3542971        TX-dropped: 6
>              RX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of
> others]
> >    TX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]
> >
> > After:
> >    RX-packets: 4629969        TX-packets: 4629969        TX-dropped: 0
> >    RX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
> >    TX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
> >
> > Fixes: af75078fece3 ("first public release")
> > Cc:stable@dpdk.org
>
> While the patch is good, I wonder whether we should backport it.
> Indeed, it might break some scripts parsing testpmd output.
>
> Any thoughts?
>

It seems unlikely, this feature is disabled by default.
But yes, I would avoid backporting it.


-- 
David Marchand

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
  2019-03-22 17:23           ` David Marchand
@ 2019-03-22 17:31             ` Andrew Rybchenko
  0 siblings, 0 replies; 25+ messages in thread
From: Andrew Rybchenko @ 2019-03-22 17:31 UTC (permalink / raw)
  To: David Marchand, Maxime Coquelin
  Cc: dev, Wenzhuo Lu, Jingjing Wu, Iremonger, Bernard, Rami Rosen,
	Yigit, Ferruh, dpdk stable

On 22.03.2019 20:23, David Marchand wrote:
>
>
> On Fri, Mar 22, 2019 at 6:17 PM Maxime Coquelin 
> <maxime.coquelin@redhat.com <mailto:maxime.coquelin@redhat.com>> wrote:
>
>
>
>     On 3/22/19 2:37 PM, David Marchand wrote:
>     > Having the standard stats and the rx burst stats on the same
>     line gives a
>     > really long line and is not consistent with the rest.
>     >
>     > Before:
>     >    RX-packets: 3542977        TX-packets: 3542971   TX-dropped:
>     6               RX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts
>     + 61% of others]
>     >    TX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of
>     others]
>     >
>     > After:
>     >    RX-packets: 4629969        TX-packets: 4629969   TX-dropped: 0
>     >    RX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of
>     others]
>     >    TX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of
>     others]
>     >
>     > Fixes: af75078fece3 ("first public release")
>     > Cc:stable@dpdk.org <mailto:Cc%3Astable@dpdk.org>
>
>     While the patch is good, I wonder whether we should backport it.
>     Indeed, it might break some scripts parsing testpmd output.
>
>     Any thoughts?
>
>
> It seems unlikely, this feature is disabled by default.
> But yes, I would avoid backporting it.


For me it looks like a bug. That's why I think it should be backported, 
but the fix is not 100% correct in fact. I'll reply directly to the patch.



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
  2019-03-22 13:37       ` [dpdk-stable] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics David Marchand
  2019-03-22 17:03         ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
  2019-03-22 17:17         ` Maxime Coquelin
@ 2019-03-22 17:35         ` Andrew Rybchenko
  2019-03-22 17:43           ` David Marchand
  2 siblings, 1 reply; 25+ messages in thread
From: Andrew Rybchenko @ 2019-03-22 17:35 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose,
	ferruh.yigit, stable

On 22.03.2019 16:37, David Marchand wrote:
> Having the standard stats and the rx burst stats on the same line gives a
> really long line and is not consistent with the rest.
>
> Before:
>    RX-packets: 3542977        TX-packets: 3542971        TX-dropped: 6               RX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]
>    TX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]
>
> After:
>    RX-packets: 4629969        TX-packets: 4629969        TX-dropped: 0
>    RX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
>    TX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
>
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Reviewed-by: Rami Rosen <ramirose@gmail.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
> Changelog since v2:
> - Cc'd stable
>
> ---
>   app/test-pmd/testpmd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 216be47..40199c1 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -1459,7 +1459,7 @@ struct extmem_param {
>   	       "TX Port=%2d/Queue=%2d %s\n",
>   	       fwd_top_stats_border, fs->rx_port, fs->rx_queue,
>   	       fs->tx_port, fs->tx_queue, fwd_top_stats_border);
> -	printf("  RX-packets: %-14u TX-packets: %-14u TX-dropped: %-14u",
> +	printf("  RX-packets: %-14u TX-packets: %-14u TX-dropped: %-14u\n",
>   	       fs->rx_packets, fs->tx_packets, fs->fwd_dropped);
>   
>   	/* if checksum mode */


In fact bad Rx checksum counters follow and I think they should be in 
this line.

That's why there is no \n here from the very beginning.

My fix for the bug (local) just add \n in else branch below.


Andrew.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
  2019-03-22 17:35         ` [dpdk-stable] " Andrew Rybchenko
@ 2019-03-22 17:43           ` David Marchand
  2019-03-23 19:12             ` David Marchand
  0 siblings, 1 reply; 25+ messages in thread
From: David Marchand @ 2019-03-22 17:43 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: dev, Wenzhuo Lu, Jingjing Wu, Iremonger, Bernard, Rami Rosen,
	Yigit, Ferruh, dpdk stable

On Fri, Mar 22, 2019 at 6:35 PM Andrew Rybchenko <arybchenko@solarflare.com>
wrote:

> On 22.03.2019 16:37, David Marchand wrote:
> > Having the standard stats and the rx burst stats on the same line gives a
> > really long line and is not consistent with the rest.
> >
> > Before:
> >    RX-packets: 3542977        TX-packets: 3542971        TX-dropped: 6
>              RX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of
> others]
> >    TX-bursts : 499440 [24% of 2 pkts + 15% of 1 pkts + 61% of others]
> >
> > After:
> >    RX-packets: 4629969        TX-packets: 4629969        TX-dropped: 0
> >    RX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
> >    TX-bursts : 663328 [19% of 2 pkts + 17% of 3 pkts + 64% of others]
> >
> > Fixes: af75078fece3 ("first public release")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > Reviewed-by: Rami Rosen <ramirose@gmail.com>
> > Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > ---
> > Changelog since v2:
> > - Cc'd stable
> >
> > ---
> >   app/test-pmd/testpmd.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> > index 216be47..40199c1 100644
> > --- a/app/test-pmd/testpmd.c
> > +++ b/app/test-pmd/testpmd.c
> > @@ -1459,7 +1459,7 @@ struct extmem_param {
> >              "TX Port=%2d/Queue=%2d %s\n",
> >              fwd_top_stats_border, fs->rx_port, fs->rx_queue,
> >              fs->tx_port, fs->tx_queue, fwd_top_stats_border);
> > -     printf("  RX-packets: %-14u TX-packets: %-14u TX-dropped: %-14u",
> > +     printf("  RX-packets: %-14u TX-packets: %-14u TX-dropped: %-14u\n",
> >              fs->rx_packets, fs->tx_packets, fs->fwd_dropped);
> >
> >       /* if checksum mode */
>
>
> In fact bad Rx checksum counters follow and I think they should be in
> this line.
>
> That's why there is no \n here from the very beginning.
>
> My fix for the bug (local) just add \n in else branch below.
>


Mm, ok, I will look at this monday.
I might add the \n in pkt_burst_stats_display() and update other callers.


-- 
David Marchand

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
  2019-03-22 17:43           ` David Marchand
@ 2019-03-23 19:12             ` David Marchand
  2019-03-25  6:34               ` [dpdk-stable] [dpdk-dev] " Andrew Rybchenko
  0 siblings, 1 reply; 25+ messages in thread
From: David Marchand @ 2019-03-23 19:12 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: dev, Wenzhuo Lu, Jingjing Wu, Iremonger, Bernard, Rami Rosen,
	Yigit, Ferruh, dpdk stable

On Fri, Mar 22, 2019 at 6:43 PM David Marchand <david.marchand@redhat.com>
wrote:

> On Fri, Mar 22, 2019 at 6:35 PM Andrew Rybchenko <
> arybchenko@solarflare.com> wrote:
>
>>
>> In fact bad Rx checksum counters follow and I think they should be in
>> this line.
>>
>> That's why there is no \n here from the very beginning.
>>
>> My fix for the bug (local) just add \n in else branch below.
>>
>
Just to be clear.

origin/master:
- iofwd engine:
  ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0
-------
  RX-packets: 121811360      TX-packets: 121811392      TX-dropped:
0               RX-bursts : 3806605 [100% of 32 pkts]
  TX-bursts : 3806606 [100% of 32 pkts]

- csum engine:
  ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0
-------
  RX-packets: 5467488        TX-packets: 5467520        TX-dropped:
0               RX- bad IP checksum: 0               Rx- bad L4 checksum:
0              Rx- bad outer L4 checksum: 0
  RX-bursts : 170859 [100% of 32 pkts]
  TX-bursts : 170860 [100% of 32 pkts]


So, as suggested, I added a printf("\n") in the else for the csum engine
block:

- iofwd engine:
  ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0
-------
  RX-packets: 259770560      TX-packets: 259770592      TX-dropped:
0
  RX-bursts : 8117830 [100% of 32 pkts]
  TX-bursts : 8117831 [100% of 32 pkts]

- csum engine:
  ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0
-------
  RX-packets: 7834016        TX-packets: 7834048        TX-dropped:
0               RX- bad IP checksum: 0               Rx- bad L4 checksum:
0              Rx- bad outer L4 checksum: 0
  RX-bursts : 244813 [100% of 32 pkts]
  TX-bursts : 244814 [100% of 32 pkts]


deal ?

-- 
David Marchand

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
  2019-03-23 19:12             ` David Marchand
@ 2019-03-25  6:34               ` Andrew Rybchenko
  0 siblings, 0 replies; 25+ messages in thread
From: Andrew Rybchenko @ 2019-03-25  6:34 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, Wenzhuo Lu, Jingjing Wu, Iremonger, Bernard, Rami Rosen,
	Yigit, Ferruh, dpdk stable

On 3/23/19 10:12 PM, David Marchand wrote:
> On Fri, Mar 22, 2019 at 6:43 PM David Marchand <david.marchand@redhat.com>
> wrote:
>
>> On Fri, Mar 22, 2019 at 6:35 PM Andrew Rybchenko <
>> arybchenko@solarflare.com> wrote:
>>
>>> In fact bad Rx checksum counters follow and I think they should be in
>>> this line.
>>>
>>> That's why there is no \n here from the very beginning.
>>>
>>> My fix for the bug (local) just add \n in else branch below.
>>>
> Just to be clear.
>
> origin/master:
> - iofwd engine:
>    ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0
> -------
>    RX-packets: 121811360      TX-packets: 121811392      TX-dropped:
> 0               RX-bursts : 3806605 [100% of 32 pkts]
>    TX-bursts : 3806606 [100% of 32 pkts]
>
> - csum engine:
>    ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0
> -------
>    RX-packets: 5467488        TX-packets: 5467520        TX-dropped:
> 0               RX- bad IP checksum: 0               Rx- bad L4 checksum:
> 0              Rx- bad outer L4 checksum: 0
>    RX-bursts : 170859 [100% of 32 pkts]
>    TX-bursts : 170860 [100% of 32 pkts]
>
>
> So, as suggested, I added a printf("\n") in the else for the csum engine
> block:
>
> - iofwd engine:
>    ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0
> -------
>    RX-packets: 259770560      TX-packets: 259770592      TX-dropped:
> 0
>    RX-bursts : 8117830 [100% of 32 pkts]
>    TX-bursts : 8117831 [100% of 32 pkts]
>
> - csum engine:
>    ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0
> -------
>    RX-packets: 7834016        TX-packets: 7834048        TX-dropped:
> 0               RX- bad IP checksum: 0               Rx- bad L4 checksum:
> 0              Rx- bad outer L4 checksum: 0
>    RX-bursts : 244813 [100% of 32 pkts]
>    TX-bursts : 244814 [100% of 32 pkts]
>
>
> deal ?

Yes, thanks a lot.

Andrew.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-stable] [PATCH v5 1/4] app/testpmd: add missing newline when showing statistics
       [not found]       ` <1553503906-1508-1-git-send-email-david.marchand@redhat.com>
@ 2019-03-25  8:51         ` David Marchand
  2019-03-25  8:55           ` Andrew Rybchenko
  2019-03-25  8:51         ` [dpdk-stable] [PATCH v5 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
  2019-03-25  8:51         ` [dpdk-stable] [PATCH v5 3/4] app/testpmd: remove useless casts on statistics David Marchand
  2 siblings, 1 reply; 25+ messages in thread
From: David Marchand @ 2019-03-25  8:51 UTC (permalink / raw)
  To: dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
	maxime.coquelin, ferruh.yigit, stable

Having the standard stats and the rx burst stats on the same line gives a
really long line and is not consistent with the rest.

Before:
iofwd engine
  RX-packets: 121811360      TX-packets: 121811392      TX-dropped: 0               RX-bursts : 3806605 [100% of 32 pkts]
  TX-bursts : 3806606 [100% of 32 pkts]

csum engine
  RX-packets: 5467488        TX-packets: 5467520        TX-dropped: 0               RX- bad IP checksum: 0               Rx- bad L4 checksum: 0              Rx- bad outer L4 checksum: 0
  RX-bursts : 170859 [100% of 32 pkts]
  TX-bursts : 170860 [100% of 32 pkts]

After:
iofwd engine
  RX-packets: 259770560      TX-packets: 259770592      TX-dropped: 0
  RX-bursts : 8117830 [100% of 32 pkts]
  TX-bursts : 8117831 [100% of 32 pkts]

csum engine
  RX-packets: 7834016        TX-packets: 7834048        TX-dropped: 0               RX- bad IP checksum: 0               Rx- bad L4 checksum: 0              Rx- bad outer L4 checksum: 0
  RX-bursts : 244813 [100% of 32 pkts]
  TX-bursts : 244814 [100% of 32 pkts]

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changelog since v4:
- let the csum stats at the same place than before, updated commitlog

Changelog since v2:
- Cc'd stable

---
 app/test-pmd/testpmd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 216be47..7715844 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1468,6 +1468,8 @@ struct extmem_param {
 			"%-14u Rx- bad outer L4 checksum: %-14u\n",
 			fs->rx_bad_ip_csum, fs->rx_bad_l4_csum,
 			fs->rx_bad_outer_l4_csum);
+	} else {
+		printf("\n");
 	}
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-stable] [PATCH v5 2/4] app/testpmd: extend fwd statistics to 64bits
       [not found]       ` <1553503906-1508-1-git-send-email-david.marchand@redhat.com>
  2019-03-25  8:51         ` [dpdk-stable] [PATCH v5 1/4] app/testpmd: add missing newline when showing statistics David Marchand
@ 2019-03-25  8:51         ` David Marchand
  2019-03-25  8:51         ` [dpdk-stable] [PATCH v5 3/4] app/testpmd: remove useless casts on statistics David Marchand
  2 siblings, 0 replies; 25+ messages in thread
From: David Marchand @ 2019-03-25  8:51 UTC (permalink / raw)
  To: dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
	maxime.coquelin, ferruh.yigit, stable

fwd engine statistics are stored as unsigned int (32bits) and can wrap
quite quickly.
Example: sending 7mpps for 614s gives us 4298000000 packets =>
0x1002e4680 larger than 32bits.

testpmd reports forwarding stats as:
RX-packets: 3500381        TX-packets: 3500010        TX-dropped: 371

While the port and accumulated stats are reported as 64bits:
RX-packets: 4298467677     RX-dropped: 0             RX-total: 4298467677
TX-packets: 4298467306     TX-dropped: 371           TX-total: 4298467677

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
Changelog since v4:
- rebased following patch 1 update

Changelog since v2:
- split out of the previous patch with a dedicated commitlog
- Cc'd stable

---
 app/test-pmd/testpmd.c | 51 +++++++++++++++++---------------------------------
 app/test-pmd/testpmd.h | 12 ++++++------
 2 files changed, 23 insertions(+), 40 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 7715844..05a3dce 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1459,13 +1459,15 @@ struct extmem_param {
 	       "TX Port=%2d/Queue=%2d %s\n",
 	       fwd_top_stats_border, fs->rx_port, fs->rx_queue,
 	       fs->tx_port, fs->tx_queue, fwd_top_stats_border);
-	printf("  RX-packets: %-14u TX-packets: %-14u TX-dropped: %-14u",
+	printf("  RX-packets: %-14"PRIu64" TX-packets: %-14"PRIu64
+	       " TX-dropped: %-14"PRIu64,
 	       fs->rx_packets, fs->tx_packets, fs->fwd_dropped);
 
 	/* if checksum mode */
 	if (cur_fwd_eng == &csum_fwd_engine) {
-	       printf("  RX- bad IP checksum: %-14u  Rx- bad L4 checksum: "
-			"%-14u Rx- bad outer L4 checksum: %-14u\n",
+		printf("  RX- bad IP checksum: %-14"PRIu64
+		       "  Rx- bad L4 checksum: %-14"PRIu64
+		       " Rx- bad outer L4 checksum: %-14"PRIu64"\n",
 			fs->rx_bad_ip_csum, fs->rx_bad_l4_csum,
 			fs->rx_bad_outer_l4_csum);
 	} else {
@@ -1745,9 +1747,6 @@ struct extmem_param {
 	uint64_t total_rx_dropped;
 	uint64_t total_tx_dropped;
 	uint64_t total_rx_nombuf;
-	uint64_t tx_dropped;
-	uint64_t rx_bad_ip_csum;
-	uint64_t rx_bad_l4_csum;
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 	uint64_t fwd_cycles;
 #endif
@@ -1774,38 +1773,22 @@ struct extmem_param {
 	fwd_cycles = 0;
 #endif
 	for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
+		struct fwd_stream *fs = fwd_streams[sm_id];
+
 		if (cur_fwd_config.nb_fwd_streams >
 		    cur_fwd_config.nb_fwd_ports) {
 			fwd_stream_stats_display(sm_id);
-			ports[fwd_streams[sm_id]->tx_port].tx_stream = NULL;
-			ports[fwd_streams[sm_id]->rx_port].rx_stream = NULL;
+			ports[fs->tx_port].tx_stream = NULL;
+			ports[fs->rx_port].rx_stream = NULL;
 		} else {
-			ports[fwd_streams[sm_id]->tx_port].tx_stream =
-				fwd_streams[sm_id];
-			ports[fwd_streams[sm_id]->rx_port].rx_stream =
-				fwd_streams[sm_id];
-		}
-		tx_dropped = ports[fwd_streams[sm_id]->tx_port].tx_dropped;
-		tx_dropped = (uint64_t) (tx_dropped +
-					 fwd_streams[sm_id]->fwd_dropped);
-		ports[fwd_streams[sm_id]->tx_port].tx_dropped = tx_dropped;
-
-		rx_bad_ip_csum =
-			ports[fwd_streams[sm_id]->rx_port].rx_bad_ip_csum;
-		rx_bad_ip_csum = (uint64_t) (rx_bad_ip_csum +
-					 fwd_streams[sm_id]->rx_bad_ip_csum);
-		ports[fwd_streams[sm_id]->rx_port].rx_bad_ip_csum =
-							rx_bad_ip_csum;
-
-		rx_bad_l4_csum =
-			ports[fwd_streams[sm_id]->rx_port].rx_bad_l4_csum;
-		rx_bad_l4_csum = (uint64_t) (rx_bad_l4_csum +
-					 fwd_streams[sm_id]->rx_bad_l4_csum);
-		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;
+			ports[fs->tx_port].tx_stream = fs;
+			ports[fs->rx_port].rx_stream = fs;
+		}
+		ports[fs->tx_port].tx_dropped += fs->fwd_dropped;
+		ports[fs->rx_port].rx_bad_ip_csum += fs->rx_bad_ip_csum;
+		ports[fs->rx_port].rx_bad_l4_csum += fs->rx_bad_l4_csum;
+		ports[fs->rx_port].rx_bad_outer_l4_csum +=
+				fs->rx_bad_outer_l4_csum;
 
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 		fwd_cycles = (uint64_t) (fwd_cycles +
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 85b791b..4f4a48f 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -119,12 +119,12 @@ struct fwd_stream {
 	unsigned int retry_enabled;
 
 	/* "read-write" results */
-	unsigned int rx_packets;  /**< received packets */
-	unsigned int tx_packets;  /**< received packets transmitted */
-	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;
+	uint64_t rx_packets;  /**< received packets */
+	uint64_t tx_packets;  /**< received packets transmitted */
+	uint64_t fwd_dropped; /**< received packets not forwarded */
+	uint64_t rx_bad_ip_csum ; /**< received packets has bad ip checksum */
+	uint64_t rx_bad_l4_csum ; /**< received packets has bad l4 checksum */
+	uint64_t 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
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-stable] [PATCH v5 3/4] app/testpmd: remove useless casts on statistics
       [not found]       ` <1553503906-1508-1-git-send-email-david.marchand@redhat.com>
  2019-03-25  8:51         ` [dpdk-stable] [PATCH v5 1/4] app/testpmd: add missing newline when showing statistics David Marchand
  2019-03-25  8:51         ` [dpdk-stable] [PATCH v5 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
@ 2019-03-25  8:51         ` David Marchand
  2 siblings, 0 replies; 25+ messages in thread
From: David Marchand @ 2019-03-25  8:51 UTC (permalink / raw)
  To: dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
	maxime.coquelin, ferruh.yigit, stable

Caught by code review while investigating the fwd stats display code.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
Changelog since v2:
- focused on useless casts only
- Cc'd stable

---
 app/test-pmd/testpmd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 05a3dce..c78d524 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1376,7 +1376,7 @@ struct extmem_param {
 		printf("  RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
 		       "%-"PRIu64"\n",
 		       stats->ipackets, stats->imissed,
-		       (uint64_t) (stats->ipackets + stats->imissed));
+		       stats->ipackets + stats->imissed);
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",
@@ -1390,13 +1390,13 @@ struct extmem_param {
 		printf("  TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
 		       "%-"PRIu64"\n",
 		       stats->opackets, port->tx_dropped,
-		       (uint64_t) (stats->opackets + port->tx_dropped));
+		       stats->opackets + port->tx_dropped);
 	}
 	else {
 		printf("  RX-packets:             %14"PRIu64"    RX-dropped:%14"PRIu64"    RX-total:"
 		       "%14"PRIu64"\n",
 		       stats->ipackets, stats->imissed,
-		       (uint64_t) (stats->ipackets + stats->imissed));
+		       stats->ipackets + stats->imissed);
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"    Bad-outer-l4csum: %-14"PRIu64"\n",
@@ -1411,7 +1411,7 @@ struct extmem_param {
 		printf("  TX-packets:             %14"PRIu64"    TX-dropped:%14"PRIu64"    TX-total:"
 		       "%14"PRIu64"\n",
 		       stats->opackets, port->tx_dropped,
-		       (uint64_t) (stats->opackets + port->tx_dropped));
+		       stats->opackets + port->tx_dropped);
 	}
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-stable] [PATCH v5 1/4] app/testpmd: add missing newline when showing statistics
  2019-03-25  8:51         ` [dpdk-stable] [PATCH v5 1/4] app/testpmd: add missing newline when showing statistics David Marchand
@ 2019-03-25  8:55           ` Andrew Rybchenko
  0 siblings, 0 replies; 25+ messages in thread
From: Andrew Rybchenko @ 2019-03-25  8:55 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose,
	maxime.coquelin, ferruh.yigit, stable

On 3/25/19 11:51 AM, David Marchand wrote:
> Having the standard stats and the rx burst stats on the same line gives a
> really long line and is not consistent with the rest.
>
> Before:
> iofwd engine
>    RX-packets: 121811360      TX-packets: 121811392      TX-dropped: 0               RX-bursts : 3806605 [100% of 32 pkts]
>    TX-bursts : 3806606 [100% of 32 pkts]
>
> csum engine
>    RX-packets: 5467488        TX-packets: 5467520        TX-dropped: 0               RX- bad IP checksum: 0               Rx- bad L4 checksum: 0              Rx- bad outer L4 checksum: 0
>    RX-bursts : 170859 [100% of 32 pkts]
>    TX-bursts : 170860 [100% of 32 pkts]
>
> After:
> iofwd engine
>    RX-packets: 259770560      TX-packets: 259770592      TX-dropped: 0
>    RX-bursts : 8117830 [100% of 32 pkts]
>    TX-bursts : 8117831 [100% of 32 pkts]
>
> csum engine
>    RX-packets: 7834016        TX-packets: 7834048        TX-dropped: 0               RX- bad IP checksum: 0               Rx- bad L4 checksum: 0              Rx- bad outer L4 checksum: 0
>    RX-bursts : 244813 [100% of 32 pkts]
>    TX-bursts : 244814 [100% of 32 pkts]
>
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2019-03-25  8:55 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1550158972-21895-1-git-send-email-david.marchand@redhat.com>
     [not found] ` <1552318522-18777-1-git-send-email-david.marchand@redhat.com>
2019-03-11 15:35   ` [dpdk-stable] [PATCH v2 1/4] app/testpmd: remove unused fwd_ctx field David Marchand
2019-03-19 18:29     ` Ferruh Yigit
     [not found]   ` <1553076154-3907-1-git-send-email-david.marchand@redhat.com>
2019-03-20 10:02     ` [dpdk-stable] [PATCH v3 1/4] app/testpmd: add missing newline when showing statistics David Marchand
2019-03-20 13:49       ` Andrew Rybchenko
2019-03-20 10:02     ` [dpdk-stable] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
2019-03-20 13:55       ` Andrew Rybchenko
2019-03-20 10:02     ` [dpdk-stable] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics David Marchand
2019-03-20 13:58       ` Andrew Rybchenko
     [not found]     ` <1553261824-1881-1-git-send-email-david.marchand@redhat.com>
2019-03-22 13:37       ` [dpdk-stable] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics David Marchand
2019-03-22 17:03         ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
2019-03-22 17:17         ` Maxime Coquelin
2019-03-22 17:23           ` David Marchand
2019-03-22 17:31             ` Andrew Rybchenko
2019-03-22 17:35         ` [dpdk-stable] " Andrew Rybchenko
2019-03-22 17:43           ` David Marchand
2019-03-23 19:12             ` David Marchand
2019-03-25  6:34               ` [dpdk-stable] [dpdk-dev] " Andrew Rybchenko
2019-03-22 13:37       ` [dpdk-stable] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
2019-03-22 17:06         ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
2019-03-22 13:37       ` [dpdk-stable] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics David Marchand
2019-03-22 17:11         ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
     [not found]       ` <1553503906-1508-1-git-send-email-david.marchand@redhat.com>
2019-03-25  8:51         ` [dpdk-stable] [PATCH v5 1/4] app/testpmd: add missing newline when showing statistics David Marchand
2019-03-25  8:55           ` Andrew Rybchenko
2019-03-25  8:51         ` [dpdk-stable] [PATCH v5 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
2019-03-25  8:51         ` [dpdk-stable] [PATCH v5 3/4] app/testpmd: remove useless casts on statistics David Marchand

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).