* [dpdk-dev] [PATCH 0/5] display testpmd forwarding engine stats on the fly
@ 2019-02-14 15:42 David Marchand
2019-02-14 15:42 ` [dpdk-dev] [PATCH 1/5] app/testpmd: remove unused fwd_ctx field David Marchand
` (5 more replies)
0 siblings, 6 replies; 109+ messages in thread
From: David Marchand @ 2019-02-14 15:42 UTC (permalink / raw)
To: dev; +Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger
Here is a little series that makes it possible to display and clear
testpmd fwd engines while they run without having to stop them.
This is mostly handy when running stress tests and you look for packets
drops without having to stop/start testpmd forwarding.
Example:
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 261977064 TX-packets: 261977064 TX-dropped: 0
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 261985142 TX-packets: 261985142 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 261977096 RX-dropped: 0 RX-total: 261977096
TX-packets: 261985155 TX-dropped: 0 TX-total: 261985155
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 261985188 RX-dropped: 0 RX-total: 261985188
TX-packets: 261977128 TX-dropped: 0 TX-total: 261977128
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 523962284 RX-dropped: 0 RX-total: 523962284
TX-packets: 523962283 TX-dropped: 0 TX-total: 523962283
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
David Marchand (5):
app/testpmd: remove unused fwd_ctx field
app/testpmd: add missing newline when showing statistics
app/testpmd: add missing transmit errors stats
app/testpmd: remove useless casts on statistics
app/testpmd: display/clear forwarding stats on demand
app/test-pmd/cmdline.c | 44 +++
app/test-pmd/testpmd.c | 451 ++++++++++++++--------------
app/test-pmd/testpmd.h | 22 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 316 insertions(+), 237 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH 1/5] app/testpmd: remove unused fwd_ctx field
2019-02-14 15:42 [dpdk-dev] [PATCH 0/5] display testpmd forwarding engine stats on the fly David Marchand
@ 2019-02-14 15:42 ` David Marchand
2019-02-18 19:55 ` Rami Rosen
2019-02-14 15:42 ` [dpdk-dev] [PATCH 2/5] app/testpmd: add missing newline when showing statistics David Marchand
` (4 subsequent siblings)
5 siblings, 1 reply; 109+ messages in thread
From: David Marchand @ 2019-02-14 15:42 UTC (permalink / raw)
To: dev; +Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger
Remove some leftover from a previous rework.
Fixes: c4bcc342c8ee ("app/testpmd: refactor ieee1588 forwarding")
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
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] 109+ messages in thread
* [dpdk-dev] [PATCH 2/5] app/testpmd: add missing newline when showing statistics
2019-02-14 15:42 [dpdk-dev] [PATCH 0/5] display testpmd forwarding engine stats on the fly David Marchand
2019-02-14 15:42 ` [dpdk-dev] [PATCH 1/5] app/testpmd: remove unused fwd_ctx field David Marchand
@ 2019-02-14 15:42 ` David Marchand
2019-02-19 5:48 ` Rami Rosen
2019-02-14 15:42 ` [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats David Marchand
` (3 subsequent siblings)
5 siblings, 1 reply; 109+ messages in thread
From: David Marchand @ 2019-02-14 15:42 UTC (permalink / raw)
To: dev; +Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger
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]
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
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 98c1baa..984155a 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] 109+ messages in thread
* [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-14 15:42 [dpdk-dev] [PATCH 0/5] display testpmd forwarding engine stats on the fly David Marchand
2019-02-14 15:42 ` [dpdk-dev] [PATCH 1/5] app/testpmd: remove unused fwd_ctx field David Marchand
2019-02-14 15:42 ` [dpdk-dev] [PATCH 2/5] app/testpmd: add missing newline when showing statistics David Marchand
@ 2019-02-14 15:42 ` David Marchand
2019-02-14 16:30 ` Bruce Richardson
2019-02-14 15:42 ` [dpdk-dev] [PATCH 4/5] app/testpmd: remove useless casts on statistics David Marchand
` (2 subsequent siblings)
5 siblings, 1 reply; 109+ messages in thread
From: David Marchand @ 2019-02-14 15:42 UTC (permalink / raw)
To: dev; +Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger
pmd can report transmit errors but those stats are not accounted here.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
app/test-pmd/testpmd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 984155a..3acd97b 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1838,6 +1838,7 @@ struct extmem_param {
total_recv += stats.ipackets;
total_xmit += stats.opackets;
total_rx_dropped += stats.imissed;
+ port->tx_dropped += stats.oerrors;
total_tx_dropped += port->tx_dropped;
total_rx_nombuf += stats.rx_nombuf;
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH 4/5] app/testpmd: remove useless casts on statistics
2019-02-14 15:42 [dpdk-dev] [PATCH 0/5] display testpmd forwarding engine stats on the fly David Marchand
` (2 preceding siblings ...)
2019-02-14 15:42 ` [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats David Marchand
@ 2019-02-14 15:42 ` David Marchand
2019-02-14 15:42 ` [dpdk-dev] [PATCH 5/5] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 0/4] display testpmd forwarding engine stats on the fly David Marchand
5 siblings, 0 replies; 109+ messages in thread
From: David Marchand @ 2019-02-14 15:42 UTC (permalink / raw)
To: dev; +Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger
Caught by code review while investigating the stats display code.
Switching all port and fwd engine statistics to uint64_t makes it
possible to drop all casts.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
app/test-pmd/testpmd.c | 62 ++++++++++++++++++--------------------------------
app/test-pmd/testpmd.h | 12 +++++-----
2 files changed, 28 insertions(+), 46 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 3acd97b..ab110b0 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
@@ -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,42 +1771,25 @@ 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 +
- fwd_streams[sm_id]->core_cycles);
+ fwd_cycles += fs->core_cycles;
#endif
}
total_recv = 0;
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] 109+ messages in thread
* [dpdk-dev] [PATCH 5/5] app/testpmd: display/clear forwarding stats on demand
2019-02-14 15:42 [dpdk-dev] [PATCH 0/5] display testpmd forwarding engine stats on the fly David Marchand
` (3 preceding siblings ...)
2019-02-14 15:42 ` [dpdk-dev] [PATCH 4/5] app/testpmd: remove useless casts on statistics David Marchand
@ 2019-02-14 15:42 ` David Marchand
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 0/4] display testpmd forwarding engine stats on the fly David Marchand
5 siblings, 0 replies; 109+ messages in thread
From: David Marchand @ 2019-02-14 15:42 UTC (permalink / raw)
To: dev; +Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger
Add a new "show/clear fwd stats all" command to display fwd and port
statistics on the fly.
To be able to do so, rte_port can't be used to maintain any statistics.
Moved the stats dump parts from stop_packet_forwarding() and merge with
fwd_port_stats_display() into fwd_stats_display().
fwd engine statistics are then aggregated into a local per port array.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
app/test-pmd/cmdline.c | 44 +++
app/test-pmd/testpmd.c | 426 +++++++++++++++-------------
app/test-pmd/testpmd.h | 9 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 306 insertions(+), 209 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index db53cc0..58b11b7 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -7386,6 +7386,49 @@ struct cmd_showqueue_result {
},
};
+/* show/clear fwd engine statistics */
+struct fwd_result {
+ cmdline_fixed_string_t action;
+ cmdline_fixed_string_t fwd;
+ cmdline_fixed_string_t stats;
+ cmdline_fixed_string_t all;
+};
+
+cmdline_parse_token_string_t cmd_fwd_action =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, action, "show#clear");
+cmdline_parse_token_string_t cmd_fwd_fwd =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, fwd, "fwd");
+cmdline_parse_token_string_t cmd_fwd_stats =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, stats, "stats");
+cmdline_parse_token_string_t cmd_fwd_all =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, all, "all");
+
+static void
+cmd_fwd_parsed(void *parsed_result,
+ __rte_unused struct cmdline *cl,
+ __rte_unused void *data)
+{
+ struct fwd_result *res = parsed_result;
+
+ if (!strcmp(res->action, "show"))
+ fwd_stats_display();
+ else
+ fwd_stats_reset();
+}
+
+static cmdline_parse_inst_t cmd_fwdall = {
+ .f = cmd_fwd_parsed,
+ .data = NULL,
+ .help_str = "show|clear fwd stats all",
+ .tokens = {
+ (void *)&cmd_fwd_action,
+ (void *)&cmd_fwd_fwd,
+ (void *)&cmd_fwd_stats,
+ (void *)&cmd_fwd_all,
+ NULL,
+ },
+};
+
/* *** READ PORT REGISTER *** */
struct cmd_read_reg_result {
cmdline_fixed_string_t read;
@@ -18559,6 +18602,7 @@ struct cmd_show_tx_metadata_result {
(cmdline_parse_inst_t *)&cmd_showqueue,
(cmdline_parse_inst_t *)&cmd_showportall,
(cmdline_parse_inst_t *)&cmd_showcfg,
+ (cmdline_parse_inst_t *)&cmd_fwdall,
(cmdline_parse_inst_t *)&cmd_start,
(cmdline_parse_inst_t *)&cmd_start_tx_first,
(cmdline_parse_inst_t *)&cmd_start_tx_first_n,
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index ab110b0..e70ad20 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1361,91 +1361,6 @@ struct extmem_param {
#endif /* RTE_TEST_PMD_RECORD_BURST_STATS */
static void
-fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
-{
- struct rte_port *port;
- uint8_t i;
-
- static const char *fwd_stats_border = "----------------------";
-
- port = &ports[port_id];
- printf("\n %s Forward statistics for port %-2d %s\n",
- fwd_stats_border, port_id, fwd_stats_border);
-
- if ((!port->rx_queue_stats_mapping_enabled) && (!port->tx_queue_stats_mapping_enabled)) {
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n",
- 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",
- 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);
- }
-
- printf(" TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- 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,
- 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",
- 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);
- }
-
- printf(" TX-packets: %14"PRIu64" TX-dropped:%14"PRIu64" TX-total:"
- "%14"PRIu64"\n",
- stats->opackets, port->tx_dropped,
- stats->opackets + port->tx_dropped);
- }
-
-#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
- if (port->rx_stream)
- pkt_burst_stats_display("RX",
- &port->rx_stream->rx_burst_stats);
- if (port->tx_stream)
- pkt_burst_stats_display("TX",
- &port->tx_stream->tx_burst_stats);
-#endif
-
- if (port->rx_queue_stats_mapping_enabled) {
- printf("\n");
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d RX-packets:%14"PRIu64
- " RX-errors:%14"PRIu64
- " RX-bytes:%14"PRIu64"\n",
- i, stats->q_ipackets[i], stats->q_errors[i], stats->q_ibytes[i]);
- }
- printf("\n");
- }
- if (port->tx_queue_stats_mapping_enabled) {
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d TX-packets:%14"PRIu64
- " TX-bytes:%14"PRIu64"\n",
- i, stats->q_opackets[i], stats->q_obytes[i]);
- }
- }
-
- printf(" %s--------------------------------%s\n",
- fwd_stats_border, fwd_stats_border);
-}
-
-static void
fwd_stream_stats_display(streamid_t stream_id)
{
struct fwd_stream *fs;
@@ -1478,6 +1393,225 @@ struct extmem_param {
#endif
}
+void
+fwd_stats_display(void)
+{
+ static const char *fwd_stats_border = "----------------------";
+ static const char *acc_stats_border = "+++++++++++++++";
+ struct {
+ struct fwd_stream *rx_stream;
+ struct fwd_stream *tx_stream;
+ uint64_t tx_dropped;
+ uint64_t rx_bad_ip_csum;
+ uint64_t rx_bad_l4_csum;
+ uint64_t rx_bad_outer_l4_csum;
+ } ports_stats[RTE_MAX_ETHPORTS];
+ uint64_t total_rx_dropped = 0;
+ uint64_t total_tx_dropped = 0;
+ uint64_t total_rx_nombuf = 0;
+ struct rte_eth_stats stats;
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ uint64_t fwd_cycles = 0;
+#endif
+ uint64_t total_recv = 0;
+ uint64_t total_xmit = 0;
+ struct rte_port *port;
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ memset(ports_stats, 0, sizeof(ports_stats));
+
+ 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);
+ } else {
+ ports_stats[fs->tx_port].tx_stream = fs;
+ ports_stats[fs->rx_port].rx_stream = fs;
+ }
+
+ ports_stats[fs->tx_port].tx_dropped += fs->fwd_dropped;
+
+ ports_stats[fs->rx_port].rx_bad_ip_csum += fs->rx_bad_ip_csum;
+ ports_stats[fs->rx_port].rx_bad_l4_csum += fs->rx_bad_l4_csum;
+ ports_stats[fs->rx_port].rx_bad_outer_l4_csum +=
+ fs->rx_bad_outer_l4_csum;
+
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fwd_cycles += fs->core_cycles;
+#endif
+ }
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ uint8_t j;
+
+ pt_id = fwd_ports_ids[i];
+ port = &ports[pt_id];
+
+ rte_eth_stats_get(pt_id, &stats);
+ stats.ipackets -= port->stats.ipackets;
+ stats.opackets -= port->stats.opackets;
+ stats.ibytes -= port->stats.ibytes;
+ stats.obytes -= port->stats.obytes;
+ stats.imissed -= port->stats.imissed;
+ stats.oerrors -= port->stats.oerrors;
+ stats.rx_nombuf -= port->stats.rx_nombuf;
+
+ total_recv += stats.ipackets;
+ total_xmit += stats.opackets;
+ total_rx_dropped += stats.imissed;
+ ports_stats[pt_id].tx_dropped += stats.oerrors;
+ total_tx_dropped += ports_stats[pt_id].tx_dropped;
+ total_tx_dropped += stats.oerrors;
+ total_rx_nombuf += stats.rx_nombuf;
+
+ printf("\n %s Forward statistics for port %-2d %s\n",
+ fwd_stats_border, pt_id, fwd_stats_border);
+
+ if (!port->rx_queue_stats_mapping_enabled &&
+ !port->tx_queue_stats_mapping_enabled) {
+ printf(" RX-packets: %-14"PRIu64
+ " RX-dropped: %-14"PRIu64
+ "RX-total: %-"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %-14"PRIu64
+ " TX-dropped: %-14"PRIu64
+ "TX-total: %-"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ } else {
+ printf(" RX-packets: %14"PRIu64
+ " RX-dropped:%14"PRIu64
+ " RX-total:%14"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %14"PRIu64
+ " TX-dropped:%14"PRIu64
+ " TX-total:%14"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ }
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ if (ports_stats[pt_id].rx_stream)
+ pkt_burst_stats_display("RX",
+ &ports_stats[pt_id].rx_stream->rx_burst_stats);
+ if (ports_stats[pt_id].tx_stream)
+ pkt_burst_stats_display("TX",
+ &ports_stats[pt_id].tx_stream->tx_burst_stats);
+#endif
+
+ if (port->rx_queue_stats_mapping_enabled) {
+ printf("\n");
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d RX-packets:%14"PRIu64
+ " RX-errors:%14"PRIu64
+ " RX-bytes:%14"PRIu64"\n",
+ j, stats.q_ipackets[j],
+ stats.q_errors[j], stats.q_ibytes[j]);
+ }
+ printf("\n");
+ }
+ if (port->tx_queue_stats_mapping_enabled) {
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d TX-packets:%14"PRIu64
+ " TX-bytes:%14"
+ PRIu64"\n",
+ j, stats.q_opackets[j],
+ stats.q_obytes[j]);
+ }
+ }
+
+ printf(" %s--------------------------------%s\n",
+ fwd_stats_border, fwd_stats_border);
+ }
+
+ printf("\n %s Accumulated forward statistics for all ports"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+ printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
+ "%-"PRIu64"\n"
+ " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
+ "%-"PRIu64"\n",
+ total_recv, total_rx_dropped, total_recv + total_rx_dropped,
+ total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
+ if (total_rx_nombuf > 0)
+ printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
+ printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ if (total_recv > 0)
+ printf("\n CPU cycles/packet=%u (total cycles="
+ "%"PRIu64" / total RX packets=%"PRIu64")\n",
+ (unsigned int)(fwd_cycles / total_recv),
+ fwd_cycles, total_recv);
+#endif
+}
+
+void
+fwd_stats_reset(void)
+{
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ pt_id = fwd_ports_ids[i];
+ rte_eth_stats_get(pt_id, &ports[pt_id].stats);
+ }
+ for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
+ struct fwd_stream *fs = fwd_streams[sm_id];
+
+ fs->rx_packets = 0;
+ fs->tx_packets = 0;
+ fs->fwd_dropped = 0;
+ fs->rx_bad_ip_csum = 0;
+ fs->rx_bad_l4_csum = 0;
+ fs->rx_bad_outer_l4_csum = 0;
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ memset(&fs->rx_burst_stats, 0, sizeof(fs->rx_burst_stats));
+ memset(&fs->tx_burst_stats, 0, sizeof(fs->tx_burst_stats));
+#endif
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fs->core_cycles = 0;
+#endif
+ }
+}
+
static void
flush_fwd_rx_queues(void)
{
@@ -1633,7 +1767,6 @@ struct extmem_param {
struct rte_port *port;
unsigned int i;
portid_t pt_id;
- streamid_t sm_id;
if (strcmp(cur_fwd_eng->fwd_mode_name, "rxonly") == 0 && !nb_rxq)
rte_exit(EXIT_FAILURE, "rxq are 0, cannot use rxonly fwd mode\n");
@@ -1684,32 +1817,12 @@ struct extmem_param {
pkt_fwd_config_display(&cur_fwd_config);
rxtx_config_display();
+ fwd_stats_reset();
for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
pt_id = fwd_ports_ids[i];
port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &port->stats);
- port->tx_dropped = 0;
-
map_port_queue_stats_mapping_registers(pt_id, port);
}
- for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
- fwd_streams[sm_id]->rx_packets = 0;
- fwd_streams[sm_id]->tx_packets = 0;
- 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,
- sizeof(fwd_streams[sm_id]->rx_burst_stats));
- memset(&fwd_streams[sm_id]->tx_burst_stats, 0,
- sizeof(fwd_streams[sm_id]->tx_burst_stats));
-#endif
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- fwd_streams[sm_id]->core_cycles = 0;
-#endif
- }
if (with_tx_first) {
port_fwd_begin = tx_only_engine.port_fwd_begin;
if (port_fwd_begin != NULL) {
@@ -1733,23 +1846,10 @@ struct extmem_param {
void
stop_packet_forwarding(void)
{
- struct rte_eth_stats stats;
- struct rte_port *port;
- port_fwd_end_t port_fwd_end;
+ port_fwd_end_t port_fwd_end;
+ lcoreid_t lc_id;
+ portid_t pt_id;
int i;
- portid_t pt_id;
- streamid_t sm_id;
- lcoreid_t lc_id;
- uint64_t total_recv;
- uint64_t total_xmit;
- uint64_t total_rx_dropped;
- uint64_t total_tx_dropped;
- uint64_t total_rx_nombuf;
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- uint64_t fwd_cycles;
-#endif
-
- static const char *acc_stats_border = "+++++++++++++++";
if (test_done) {
printf("Packet forwarding not started\n");
@@ -1767,87 +1867,9 @@ struct extmem_param {
(*port_fwd_end)(pt_id);
}
}
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- 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[fs->tx_port].tx_stream = NULL;
- ports[fs->rx_port].rx_stream = NULL;
- } else {
- 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 += fs->core_cycles;
-#endif
- }
- total_recv = 0;
- total_xmit = 0;
- total_rx_dropped = 0;
- total_tx_dropped = 0;
- total_rx_nombuf = 0;
- for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
- pt_id = fwd_ports_ids[i];
-
- port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &stats);
- stats.ipackets -= port->stats.ipackets;
- port->stats.ipackets = 0;
- stats.opackets -= port->stats.opackets;
- port->stats.opackets = 0;
- stats.ibytes -= port->stats.ibytes;
- port->stats.ibytes = 0;
- stats.obytes -= port->stats.obytes;
- port->stats.obytes = 0;
- stats.imissed -= port->stats.imissed;
- port->stats.imissed = 0;
- stats.oerrors -= port->stats.oerrors;
- port->stats.oerrors = 0;
- stats.rx_nombuf -= port->stats.rx_nombuf;
- port->stats.rx_nombuf = 0;
-
- total_recv += stats.ipackets;
- total_xmit += stats.opackets;
- total_rx_dropped += stats.imissed;
- port->tx_dropped += stats.oerrors;
- total_tx_dropped += port->tx_dropped;
- total_rx_nombuf += stats.rx_nombuf;
- fwd_port_stats_display(pt_id, &stats);
- }
+ fwd_stats_display();
- printf("\n %s Accumulated forward statistics for all ports"
- "%s\n",
- acc_stats_border, acc_stats_border);
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n"
- " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- total_recv, total_rx_dropped, total_recv + total_rx_dropped,
- total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
- if (total_rx_nombuf > 0)
- printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
- printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
- "%s\n",
- acc_stats_border, acc_stats_border);
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- if (total_recv > 0)
- printf("\n CPU cycles/packet=%u (total cycles="
- "%"PRIu64" / total RX packets=%"PRIu64")\n",
- (unsigned int)(fwd_cycles / total_recv),
- fwd_cycles, total_recv);
-#endif
printf("\nDone.\n");
test_done = 1;
}
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 4f4a48f..f43b1a7 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -164,19 +164,12 @@ struct rte_port {
struct rte_eth_conf dev_conf; /**< Port configuration. */
struct ether_addr eth_addr; /**< Port ethernet address */
struct rte_eth_stats stats; /**< Last port statistics */
- uint64_t tx_dropped; /**< If no descriptor in TX ring */
- struct fwd_stream *rx_stream; /**< Port RX stream, if unique */
- struct fwd_stream *tx_stream; /**< Port TX stream, if unique */
unsigned int socket_id; /**< For NUMA support */
uint16_t parse_tunnel:1; /**< Parse internal headers */
uint16_t tso_segsz; /**< Segmentation offload MSS for non-tunneled packets. */
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 */
- 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 */
@@ -767,6 +760,8 @@ void vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type,
char *list_pkt_forwarding_retry_modes(void);
void set_pkt_forwarding_mode(const char *fwd_mode);
void start_packet_forwarding(int with_tx_first);
+void fwd_stats_display(void);
+void fwd_stats_reset(void);
void stop_packet_forwarding(void);
void dev_set_link_up(portid_t pid);
void dev_set_link_down(portid_t pid);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 0291480..a20c2c9 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -336,6 +336,42 @@ Example::
Set rxonly packet forwarding mode
+show fwd
+~~~~~~~~
+
+When running, forwarding engines maintain statistics from the time they have been started.
+Example for the io forwarding engine, with some packet drops on the tx side::
+
+ testpmd> show fwd stats all
+
+ ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
+ RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
+
+ ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
+ RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
+
+ ---------------------- Forward statistics for port 0 ----------------------
+ RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
+ TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
+ ----------------------------------------------------------------------------
+
+ ---------------------- Forward statistics for port 1 ----------------------
+ RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
+ TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
+ ----------------------------------------------------------------------------
+
+ +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
+ RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
+ TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+clear fwd
+~~~~~~~~~
+
+Clear the forwarding engines statistics::
+
+ testpmd> clear fwd stats all
+
read rxd
~~~~~~~~
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-14 15:42 ` [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats David Marchand
@ 2019-02-14 16:30 ` Bruce Richardson
2019-02-14 17:39 ` David Marchand
0 siblings, 1 reply; 109+ messages in thread
From: Bruce Richardson @ 2019-02-14 16:30 UTC (permalink / raw)
To: David Marchand; +Cc: dev, wenzhuo.lu, jingjing.wu, bernard.iremonger
On Thu, Feb 14, 2019 at 04:42:50PM +0100, David Marchand wrote:
> pmd can report transmit errors but those stats are not accounted here.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> app/test-pmd/testpmd.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 984155a..3acd97b 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -1838,6 +1838,7 @@ struct extmem_param {
> total_recv += stats.ipackets;
> total_xmit += stats.opackets;
> total_rx_dropped += stats.imissed;
> + port->tx_dropped += stats.oerrors;
> total_tx_dropped += port->tx_dropped;
> total_rx_nombuf += stats.rx_nombuf;
>
>
Without knowing as to whether the line is needed or not, the line itself
looks out of place. All other lines are assignments to local variables,
apart from this. Should a local variable be defined for consistency?
/Bruce
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-14 16:30 ` Bruce Richardson
@ 2019-02-14 17:39 ` David Marchand
2019-02-14 18:51 ` David Marchand
0 siblings, 1 reply; 109+ messages in thread
From: David Marchand @ 2019-02-14 17:39 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, Wenzhuo Lu, Jingjing Wu, bernard.iremonger
On Thu, Feb 14, 2019 at 5:30 PM Bruce Richardson <bruce.richardson@intel.com>
wrote:
> On Thu, Feb 14, 2019 at 04:42:50PM +0100, David Marchand wrote:
> > pmd can report transmit errors but those stats are not accounted here.
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> > app/test-pmd/testpmd.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> > index 984155a..3acd97b 100644
> > --- a/app/test-pmd/testpmd.c
> > +++ b/app/test-pmd/testpmd.c
> > @@ -1838,6 +1838,7 @@ struct extmem_param {
> > total_recv += stats.ipackets;
> > total_xmit += stats.opackets;
> > total_rx_dropped += stats.imissed;
> > + port->tx_dropped += stats.oerrors;
> > total_tx_dropped += port->tx_dropped;
> > total_rx_nombuf += stats.rx_nombuf;
> >
> >
> Without knowing as to whether the line is needed or not, the line itself
> looks out of place. All other lines are assignments to local variables,
> apart from this. Should a local variable be defined for consistency?
>
Indeed this looks wrong to add it to port->tx_dropped.
It actually "works" since this part is called when stopping forwarding and
port->tx_dropped gets reset later when starting forwarding again.
I suppose I should move this to total_tx_dropped instead.
Thanks Bruce.
--
David Marchand
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-14 17:39 ` David Marchand
@ 2019-02-14 18:51 ` David Marchand
2019-02-15 8:57 ` Thomas Monjalon
0 siblings, 1 reply; 109+ messages in thread
From: David Marchand @ 2019-02-14 18:51 UTC (permalink / raw)
To: Bruce Richardson
Cc: dev, Wenzhuo Lu, Jingjing Wu, bernard.iremonger, Maxime Coquelin
On Thu, Feb 14, 2019 at 6:39 PM David Marchand <david.marchand@redhat.com>
wrote:
> On Thu, Feb 14, 2019 at 5:30 PM Bruce Richardson <
> bruce.richardson@intel.com> wrote:
>
>> On Thu, Feb 14, 2019 at 04:42:50PM +0100, David Marchand wrote:
>> > pmd can report transmit errors but those stats are not accounted here.
>> >
>> > Signed-off-by: David Marchand <david.marchand@redhat.com>
>> > ---
>> > app/test-pmd/testpmd.c | 1 +
>> > 1 file changed, 1 insertion(+)
>> >
>> > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
>> > index 984155a..3acd97b 100644
>> > --- a/app/test-pmd/testpmd.c
>> > +++ b/app/test-pmd/testpmd.c
>> > @@ -1838,6 +1838,7 @@ struct extmem_param {
>> > total_recv += stats.ipackets;
>> > total_xmit += stats.opackets;
>> > total_rx_dropped += stats.imissed;
>> > + port->tx_dropped += stats.oerrors;
>> > total_tx_dropped += port->tx_dropped;
>> > total_rx_nombuf += stats.rx_nombuf;
>> >
>> >
>> Without knowing as to whether the line is needed or not, the line itself
>> looks out of place. All other lines are assignments to local variables,
>> apart from this. Should a local variable be defined for consistency?
>>
>
>
Thinking again about this oerrors stats...
We had a discussion with Maxime, last week.
So I want to make sure that what we both agreed makes sense :-)
What is the purpose of oerrors ?
Since the drivers (via rte_eth_tx_burst return value) report the numbers of
packets successfully transmitted, the application can try to retransmit the
packets that did not make it and counts this.
If the driver counts such "missed" packets, then it does the job the
application will do anyway (wasting some cycles).
But what is more a problem is that the application does not know if the
packets in oerrors are its own retries or problems that the driver can not
detect (hw problems) but the hw can.
So the best option is that oerrors does not report the packets the driver
refuses (and I can see some drivers that do not comply to this) but only
"external" errors from the driver pov.
Back to my patch here, if we agree on this definition of oerrors, I can not
add it to total_tx_dropped, but I suppose I can add some "TX HW errors: "
and "Total TX HW errors: " logs so that we are aware that something went
bad "further" than the driver.
Let's sleep on it :-)
--
David Marchand
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-14 18:51 ` David Marchand
@ 2019-02-15 8:57 ` Thomas Monjalon
2019-02-15 9:33 ` David Marchand
0 siblings, 1 reply; 109+ messages in thread
From: Thomas Monjalon @ 2019-02-15 8:57 UTC (permalink / raw)
To: David Marchand
Cc: dev, Bruce Richardson, Wenzhuo Lu, Jingjing Wu,
bernard.iremonger, Maxime Coquelin, ferruh.yigit, arybchenko
14/02/2019 19:51, David Marchand:
> What is the purpose of oerrors ?
>
> Since the drivers (via rte_eth_tx_burst return value) report the numbers of
> packets successfully transmitted, the application can try to retransmit the
> packets that did not make it and counts this.
> If the driver counts such "missed" packets, then it does the job the
> application will do anyway (wasting some cycles).
> But what is more a problem is that the application does not know if the
> packets in oerrors are its own retries or problems that the driver can not
> detect (hw problems) but the hw can.
>
> So the best option is that oerrors does not report the packets the driver
> refuses (and I can see some drivers that do not comply to this) but only
> "external" errors from the driver pov.
I can see the benefit of having driver errors in the stats,
so it is generically stored for later analysis or print.
It could be managed at ethdev level instead of the application
doing the computation.
What about splitting the Tx errors in 2 fields? oerrors / ofull ?
Who said it's awful? sorry Bruce for anticipating ;)
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-15 8:57 ` Thomas Monjalon
@ 2019-02-15 9:33 ` David Marchand
2019-02-15 14:05 ` Bruce Richardson
0 siblings, 1 reply; 109+ messages in thread
From: David Marchand @ 2019-02-15 9:33 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, Bruce Richardson, Wenzhuo Lu, Jingjing Wu,
bernard.iremonger, Maxime Coquelin, Yigit, Ferruh,
Andrew Rybchenko
On Fri, Feb 15, 2019 at 9:58 AM Thomas Monjalon <thomas@monjalon.net> wrote:
> 14/02/2019 19:51, David Marchand:
> > What is the purpose of oerrors ?
> >
> > Since the drivers (via rte_eth_tx_burst return value) report the numbers
> of
> > packets successfully transmitted, the application can try to retransmit
> the
> > packets that did not make it and counts this.
> > If the driver counts such "missed" packets, then it does the job the
> > application will do anyway (wasting some cycles).
> > But what is more a problem is that the application does not know if the
> > packets in oerrors are its own retries or problems that the driver can
> not
> > detect (hw problems) but the hw can.
> >
> > So the best option is that oerrors does not report the packets the driver
> > refuses (and I can see some drivers that do not comply to this) but only
> > "external" errors from the driver pov.
>
> I can see the benefit of having driver errors in the stats,
> so it is generically stored for later analysis or print.
> It could be managed at ethdev level instead of the application
> doing the computation.
>
> What about splitting the Tx errors in 2 fields? oerrors / ofull ?
> Who said it's awful? sorry Bruce for anticipating ;)
>
Summary, correct me if we are not aligned :-)
- ofull (maybe ofifoerrors?) is actually a count of SW failed transmits
- it would be handled in rte_eth_tx_burst() itself in a generic way
- the drivers do not need to track such SW failed transmits
- oerrors only counts packets HW failed transmits, dropped out of the
driver tx_pkt_burst() knowledge
- the application does not have to track SW failed transmits since the
stats is in ethdev
It sounds good to me, this means an ethdev abi breakage.
I will drop my current patch anyway.
Touching oerrors would be a separate effort.
--
David Marchand
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-15 9:33 ` David Marchand
@ 2019-02-15 14:05 ` Bruce Richardson
2019-02-15 14:13 ` Wiles, Keith
2019-02-15 15:04 ` David Marchand
0 siblings, 2 replies; 109+ messages in thread
From: Bruce Richardson @ 2019-02-15 14:05 UTC (permalink / raw)
To: David Marchand
Cc: Thomas Monjalon, dev, Wenzhuo Lu, Jingjing Wu, bernard.iremonger,
Maxime Coquelin, Yigit, Ferruh, Andrew Rybchenko
On Fri, Feb 15, 2019 at 10:33:47AM +0100, David Marchand wrote:
> On Fri, Feb 15, 2019 at 9:58 AM Thomas Monjalon
> <[1]thomas@monjalon.net> wrote:
>
> 14/02/2019 19:51, David Marchand:
> > What is the purpose of oerrors ?
> >
> > Since the drivers (via rte_eth_tx_burst return value) report the
> numbers of
> > packets successfully transmitted, the application can try to
> retransmit the
> > packets that did not make it and counts this.
> > If the driver counts such "missed" packets, then it does the job
> the
> > application will do anyway (wasting some cycles).
> > But what is more a problem is that the application does not know
> if the
> > packets in oerrors are its own retries or problems that the driver
> can not
> > detect (hw problems) but the hw can.
> >
> > So the best option is that oerrors does not report the packets the
> driver
> > refuses (and I can see some drivers that do not comply to this)
> but only
> > "external" errors from the driver pov.
> I can see the benefit of having driver errors in the stats,
> so it is generically stored for later analysis or print.
> It could be managed at ethdev level instead of the application
> doing the computation.
> What about splitting the Tx errors in 2 fields? oerrors / ofull ?
> Who said it's awful? sorry Bruce for anticipating ;)
>
> Summary, correct me if we are not aligned :-)
> - ofull (maybe ofifoerrors?) is actually a count of SW failed transmits
> - it would be handled in rte_eth_tx_burst() itself in a generic way
> - the drivers do not need to track such SW failed transmits
> - oerrors only counts packets HW failed transmits, dropped out of the
> driver tx_pkt_burst() knowledge
> - the application does not have to track SW failed transmits since the
> stats is in ethdev
> It sounds good to me, this means an ethdev abi breakage.
Hang on, why do we need ethdev to track this at all, given that it's
trivial for apps to track this themselves. Would we not be better just to
add this tracking into testpmd and leave ethdev and drivers alone? Perhaps
I'm missing something?
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-15 14:05 ` Bruce Richardson
@ 2019-02-15 14:13 ` Wiles, Keith
2019-02-15 15:04 ` David Marchand
1 sibling, 0 replies; 109+ messages in thread
From: Wiles, Keith @ 2019-02-15 14:13 UTC (permalink / raw)
To: Richardson, Bruce
Cc: David Marchand, Thomas Monjalon, dpdk-dev, Lu, Wenzhuo, Wu,
Jingjing, Iremonger, Bernard, Maxime Coquelin, Yigit, Ferruh,
Andrew Rybchenko
> On Feb 15, 2019, at 8:05 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
>
> On Fri, Feb 15, 2019 at 10:33:47AM +0100, David Marchand wrote:
>> On Fri, Feb 15, 2019 at 9:58 AM Thomas Monjalon
>> <[1]thomas@monjalon.net> wrote:
>>
>> 14/02/2019 19:51, David Marchand:
>>> What is the purpose of oerrors ?
>>>
>>> Since the drivers (via rte_eth_tx_burst return value) report the
>> numbers of
>>> packets successfully transmitted, the application can try to
>> retransmit the
>>> packets that did not make it and counts this.
>>> If the driver counts such "missed" packets, then it does the job
>> the
>>> application will do anyway (wasting some cycles).
>>> But what is more a problem is that the application does not know
>> if the
>>> packets in oerrors are its own retries or problems that the driver
>> can not
>>> detect (hw problems) but the hw can.
>>>
>>> So the best option is that oerrors does not report the packets the
>> driver
>>> refuses (and I can see some drivers that do not comply to this)
>> but only
>>> "external" errors from the driver pov.
>> I can see the benefit of having driver errors in the stats,
>> so it is generically stored for later analysis or print.
>> It could be managed at ethdev level instead of the application
>> doing the computation.
>> What about splitting the Tx errors in 2 fields? oerrors / ofull ?
>> Who said it's awful? sorry Bruce for anticipating ;)
>>
>> Summary, correct me if we are not aligned :-)
>> - ofull (maybe ofifoerrors?) is actually a count of SW failed transmits
>> - it would be handled in rte_eth_tx_burst() itself in a generic way
>> - the drivers do not need to track such SW failed transmits
>> - oerrors only counts packets HW failed transmits, dropped out of the
>> driver tx_pkt_burst() knowledge
>> - the application does not have to track SW failed transmits since the
>> stats is in ethdev
>> It sounds good to me, this means an ethdev abi breakage.
>
> Hang on, why do we need ethdev to track this at all, given that it's
> trivial for apps to track this themselves. Would we not be better just to
> add this tracking into testpmd and leave ethdev and drivers alone? Perhaps
> I'm missing something?
Adding the counters to ethdev stats is a good idea to me, the number of tx full failures is a great counter as it can tell you a lot about performance of the application. if the ofull counter is high then we have a lot of re-xmit attempts which can point to the problem quicker IMO. Adding it to the PMDs is the right place for this type of information as it is a very common needed counter.
>
Regards,
Keith
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-15 14:05 ` Bruce Richardson
2019-02-15 14:13 ` Wiles, Keith
@ 2019-02-15 15:04 ` David Marchand
2019-02-15 16:19 ` Thomas Monjalon
1 sibling, 1 reply; 109+ messages in thread
From: David Marchand @ 2019-02-15 15:04 UTC (permalink / raw)
To: Bruce Richardson
Cc: Thomas Monjalon, dev, Wenzhuo Lu, Jingjing Wu, bernard.iremonger,
Maxime Coquelin, Yigit, Ferruh, Andrew Rybchenko
On Fri, Feb 15, 2019 at 3:05 PM Bruce Richardson <bruce.richardson@intel.com>
wrote:
> On Fri, Feb 15, 2019 at 10:33:47AM +0100, David Marchand wrote:
> > On Fri, Feb 15, 2019 at 9:58 AM Thomas Monjalon
> > <[1]thomas@monjalon.net> wrote:
> >
> > 14/02/2019 19:51, David Marchand:
> > > What is the purpose of oerrors ?
> > >
> > > Since the drivers (via rte_eth_tx_burst return value) report the
> > numbers of
> > > packets successfully transmitted, the application can try to
> > retransmit the
> > > packets that did not make it and counts this.
> > > If the driver counts such "missed" packets, then it does the job
> > the
> > > application will do anyway (wasting some cycles).
> > > But what is more a problem is that the application does not know
> > if the
> > > packets in oerrors are its own retries or problems that the driver
> > can not
> > > detect (hw problems) but the hw can.
> > >
> > > So the best option is that oerrors does not report the packets the
> > driver
> > > refuses (and I can see some drivers that do not comply to this)
> > but only
> > > "external" errors from the driver pov.
> > I can see the benefit of having driver errors in the stats,
> > so it is generically stored for later analysis or print.
> > It could be managed at ethdev level instead of the application
> > doing the computation.
> > What about splitting the Tx errors in 2 fields? oerrors / ofull ?
> > Who said it's awful? sorry Bruce for anticipating ;)
> >
> > Summary, correct me if we are not aligned :-)
> > - ofull (maybe ofifoerrors?) is actually a count of SW failed
> transmits
> > - it would be handled in rte_eth_tx_burst() itself in a generic way
> > - the drivers do not need to track such SW failed transmits
> > - oerrors only counts packets HW failed transmits, dropped out of the
> > driver tx_pkt_burst() knowledge
> > - the application does not have to track SW failed transmits since the
> > stats is in ethdev
> > It sounds good to me, this means an ethdev abi breakage.
>
> Hang on, why do we need ethdev to track this at all, given that it's
> trivial for apps to track this themselves. Would we not be better just to
> add this tracking into testpmd and leave ethdev and drivers alone? Perhaps
> I'm missing something?
>
This was my first intention but Thomas hopped in ;-)
testpmd does it already via the fs->fwd_dropped stats and ovs has its
tx_dropped stat.
The problem is that all drivers have different approach about this.
Some drivers only count real hw errors in oerrors.
But others count the packets it can't send in oerrors (+ there are some
cases that seem buggy to me where the driver will always refuse the mbufs
for reason X and the application can retry indefinitely to send...).
--
David Marchand
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-15 15:04 ` David Marchand
@ 2019-02-15 16:19 ` Thomas Monjalon
2019-02-15 17:32 ` David Marchand
0 siblings, 1 reply; 109+ messages in thread
From: Thomas Monjalon @ 2019-02-15 16:19 UTC (permalink / raw)
To: David Marchand
Cc: Bruce Richardson, dev, Wenzhuo Lu, Jingjing Wu,
bernard.iremonger, Maxime Coquelin, Yigit, Ferruh,
Andrew Rybchenko, keith.wiles
15/02/2019 16:04, David Marchand:
> On Fri, Feb 15, 2019 at 3:05 PM Bruce Richardson <bruce.richardson@intel.com>
> wrote:
>
> > On Fri, Feb 15, 2019 at 10:33:47AM +0100, David Marchand wrote:
> > > On Fri, Feb 15, 2019 at 9:58 AM Thomas Monjalon
> > > <[1]thomas@monjalon.net> wrote:
> > >
> > > 14/02/2019 19:51, David Marchand:
> > > > What is the purpose of oerrors ?
> > > >
> > > > Since the drivers (via rte_eth_tx_burst return value) report the
> > > numbers of
> > > > packets successfully transmitted, the application can try to
> > > retransmit the
> > > > packets that did not make it and counts this.
> > > > If the driver counts such "missed" packets, then it does the job
> > > the
> > > > application will do anyway (wasting some cycles).
> > > > But what is more a problem is that the application does not know
> > > if the
> > > > packets in oerrors are its own retries or problems that the driver
> > > can not
> > > > detect (hw problems) but the hw can.
> > > >
> > > > So the best option is that oerrors does not report the packets the
> > > driver
> > > > refuses (and I can see some drivers that do not comply to this)
> > > but only
> > > > "external" errors from the driver pov.
> > > I can see the benefit of having driver errors in the stats,
> > > so it is generically stored for later analysis or print.
> > > It could be managed at ethdev level instead of the application
> > > doing the computation.
> > > What about splitting the Tx errors in 2 fields? oerrors / ofull ?
> > > Who said it's awful? sorry Bruce for anticipating ;)
> > >
> > > Summary, correct me if we are not aligned :-)
> > > - ofull (maybe ofifoerrors?) is actually a count of SW failed
> > transmits
> > > - it would be handled in rte_eth_tx_burst() itself in a generic way
> > > - the drivers do not need to track such SW failed transmits
> > > - oerrors only counts packets HW failed transmits, dropped out of the
> > > driver tx_pkt_burst() knowledge
> > > - the application does not have to track SW failed transmits since the
> > > stats is in ethdev
> > > It sounds good to me, this means an ethdev abi breakage.
> >
> > Hang on, why do we need ethdev to track this at all, given that it's
> > trivial for apps to track this themselves. Would we not be better just to
> > add this tracking into testpmd and leave ethdev and drivers alone? Perhaps
> > I'm missing something?
> >
>
> This was my first intention but Thomas hopped in ;-)
I was just opening the discussion :)
> testpmd does it already via the fs->fwd_dropped stats and ovs has its
> tx_dropped stat.
>
> The problem is that all drivers have different approach about this.
> Some drivers only count real hw errors in oerrors.
> But others count the packets it can't send in oerrors (+ there are some
> cases that seem buggy to me where the driver will always refuse the mbufs
> for reason X and the application can retry indefinitely to send...).
We have 3 options:
1/ status quo = oerrors is inconsistent across drivers
2/ API break = oerrors stop being incremented for temporary
unavailability (i.e. queue full, kind of ERETRY),
report only packets which will be never sent,
may be a small performance gain for some drivers
3/ API + ABI break = same as 2/ +
report ERETRY errors in ofull (same as tx_burst() delta)
Note that the option 2 is a light API break which does not require
any deprecation notice because the original definition of oerrors
is really vague: "failed transmitted packets"
By changing the definition of errors to "packets lost", we can count
HW errors + packets not matching requirements.
As David suggests, the packets not matching requirements can be freed
as it is done for packets successfully transmitted to the HW.
We need also to update the definition of the return value of
rte_eth_tx_burst(): "packets actually stored in transmit descriptors".
We should also count the bad packets rejected by the driver.
Then the number of bad packets would be the difference between
the return value of rte_eth_tx_burst() and opackets counter.
This solution is fixing some bugs and enforce a consistent behaviour.
The option 3 is breaking the ABI and may degrade the performances.
The only benefit is convenience or semantic: ofull would be the
equivalent of imissed.
The application can count the same by making the difference between
the burst size and the return of rte_eth_tx_burst.
My vote is for the option 2.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-15 16:19 ` Thomas Monjalon
@ 2019-02-15 17:32 ` David Marchand
2019-02-15 18:15 ` Ananyev, Konstantin
0 siblings, 1 reply; 109+ messages in thread
From: David Marchand @ 2019-02-15 17:32 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Bruce Richardson, dev, Wenzhuo Lu, Jingjing Wu,
bernard.iremonger, Maxime Coquelin, Yigit, Ferruh,
Andrew Rybchenko, keith.wiles
On Fri, Feb 15, 2019 at 5:19 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> 15/02/2019 16:04, David Marchand:
> > On Fri, Feb 15, 2019 at 3:05 PM Bruce Richardson <
> bruce.richardson@intel.com>
> > wrote:
> >
> > > On Fri, Feb 15, 2019 at 10:33:47AM +0100, David Marchand wrote:
> > > > On Fri, Feb 15, 2019 at 9:58 AM Thomas Monjalon
> > > > <[1]thomas@monjalon.net> wrote:
> > > >
> > > > 14/02/2019 19:51, David Marchand:
> > > > > What is the purpose of oerrors ?
> > > > >
> > > > > Since the drivers (via rte_eth_tx_burst return value) report
> the
> > > > numbers of
> > > > > packets successfully transmitted, the application can try to
> > > > retransmit the
> > > > > packets that did not make it and counts this.
> > > > > If the driver counts such "missed" packets, then it does the
> job
> > > > the
> > > > > application will do anyway (wasting some cycles).
> > > > > But what is more a problem is that the application does not
> know
> > > > if the
> > > > > packets in oerrors are its own retries or problems that the
> driver
> > > > can not
> > > > > detect (hw problems) but the hw can.
> > > > >
> > > > > So the best option is that oerrors does not report the
> packets the
> > > > driver
> > > > > refuses (and I can see some drivers that do not comply to
> this)
> > > > but only
> > > > > "external" errors from the driver pov.
> > > > I can see the benefit of having driver errors in the stats,
> > > > so it is generically stored for later analysis or print.
> > > > It could be managed at ethdev level instead of the application
> > > > doing the computation.
> > > > What about splitting the Tx errors in 2 fields? oerrors / ofull
> ?
> > > > Who said it's awful? sorry Bruce for anticipating ;)
> > > >
> > > > Summary, correct me if we are not aligned :-)
> > > > - ofull (maybe ofifoerrors?) is actually a count of SW failed
> > > transmits
> > > > - it would be handled in rte_eth_tx_burst() itself in a generic
> way
> > > > - the drivers do not need to track such SW failed transmits
> > > > - oerrors only counts packets HW failed transmits, dropped out of
> the
> > > > driver tx_pkt_burst() knowledge
> > > > - the application does not have to track SW failed transmits
> since the
> > > > stats is in ethdev
> > > > It sounds good to me, this means an ethdev abi breakage.
> > >
> > > Hang on, why do we need ethdev to track this at all, given that it's
> > > trivial for apps to track this themselves. Would we not be better just
> to
> > > add this tracking into testpmd and leave ethdev and drivers alone?
> Perhaps
> > > I'm missing something?
> > >
> >
> > This was my first intention but Thomas hopped in ;-)
>
> I was just opening the discussion :)
>
> > testpmd does it already via the fs->fwd_dropped stats and ovs has its
> > tx_dropped stat.
> >
> > The problem is that all drivers have different approach about this.
> > Some drivers only count real hw errors in oerrors.
> > But others count the packets it can't send in oerrors (+ there are some
> > cases that seem buggy to me where the driver will always refuse the mbufs
> > for reason X and the application can retry indefinitely to send...).
>
> We have 3 options:
> 1/ status quo = oerrors is inconsistent across drivers
> 2/ API break = oerrors stop being incremented for temporary
> unavailability (i.e. queue full, kind of ERETRY),
> report only packets which will be never sent,
> may be a small performance gain for some drivers
> 3/ API + ABI break = same as 2/ +
> report ERETRY errors in ofull (same as tx_burst() delta)
>
> Note that the option 2 is a light API break which does not require
> any deprecation notice because the original definition of oerrors
> is really vague: "failed transmitted packets"
> By changing the definition of errors to "packets lost", we can count
> HW errors + packets not matching requirements.
> As David suggests, the packets not matching requirements can be freed
> as it is done for packets successfully transmitted to the HW.
> We need also to update the definition of the return value of
> rte_eth_tx_burst(): "packets actually stored in transmit descriptors".
> We should also count the bad packets rejected by the driver.
> Then the number of bad packets would be the difference between
> the return value of rte_eth_tx_burst() and opackets counter.
> This solution is fixing some bugs and enforce a consistent behaviour.
>
I am also for option 2 especially because of this.
A driver that refuses a packet for reason X (which is a limitation, or an
incorrect config or whatever that is not a transient condition) but gives
it back to the application is a bad driver.
> The option 3 is breaking the ABI and may degrade the performances.
> The only benefit is convenience or semantic: ofull would be the
> equivalent of imissed.
> The application can count the same by making the difference between
> the burst size and the return of rte_eth_tx_burst.
>
> My vote is for the option 2.
>
--
David Marchand
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-15 17:32 ` David Marchand
@ 2019-02-15 18:15 ` Ananyev, Konstantin
2019-02-15 18:31 ` David Marchand
0 siblings, 1 reply; 109+ messages in thread
From: Ananyev, Konstantin @ 2019-02-15 18:15 UTC (permalink / raw)
To: David Marchand, Thomas Monjalon
Cc: Richardson, Bruce, dev, Lu, Wenzhuo, Wu, Jingjing, Iremonger,
Bernard, Maxime Coquelin, Yigit, Ferruh, Andrew Rybchenko, Wiles,
Keith
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Marchand
> Sent: Friday, February 15, 2019 5:32 PM
> To: Thomas Monjalon <thomas@monjalon.net>
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>; Maxime Coquelin <mcoqueli@redhat.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>; Wiles, Keith <keith.wiles@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
>
> On Fri, Feb 15, 2019 at 5:19 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> > 15/02/2019 16:04, David Marchand:
> > > On Fri, Feb 15, 2019 at 3:05 PM Bruce Richardson <
> > bruce.richardson@intel.com>
> > > wrote:
> > >
> > > > On Fri, Feb 15, 2019 at 10:33:47AM +0100, David Marchand wrote:
> > > > > On Fri, Feb 15, 2019 at 9:58 AM Thomas Monjalon
> > > > > <[1]thomas@monjalon.net> wrote:
> > > > >
> > > > > 14/02/2019 19:51, David Marchand:
> > > > > > What is the purpose of oerrors ?
> > > > > >
> > > > > > Since the drivers (via rte_eth_tx_burst return value) report
> > the
> > > > > numbers of
> > > > > > packets successfully transmitted, the application can try to
> > > > > retransmit the
> > > > > > packets that did not make it and counts this.
> > > > > > If the driver counts such "missed" packets, then it does the
> > job
> > > > > the
> > > > > > application will do anyway (wasting some cycles).
> > > > > > But what is more a problem is that the application does not
> > know
> > > > > if the
> > > > > > packets in oerrors are its own retries or problems that the
> > driver
> > > > > can not
> > > > > > detect (hw problems) but the hw can.
> > > > > >
> > > > > > So the best option is that oerrors does not report the
> > packets the
> > > > > driver
> > > > > > refuses (and I can see some drivers that do not comply to
> > this)
> > > > > but only
> > > > > > "external" errors from the driver pov.
> > > > > I can see the benefit of having driver errors in the stats,
> > > > > so it is generically stored for later analysis or print.
> > > > > It could be managed at ethdev level instead of the application
> > > > > doing the computation.
> > > > > What about splitting the Tx errors in 2 fields? oerrors / ofull
> > ?
> > > > > Who said it's awful? sorry Bruce for anticipating ;)
> > > > >
> > > > > Summary, correct me if we are not aligned :-)
> > > > > - ofull (maybe ofifoerrors?) is actually a count of SW failed
> > > > transmits
> > > > > - it would be handled in rte_eth_tx_burst() itself in a generic
> > way
> > > > > - the drivers do not need to track such SW failed transmits
> > > > > - oerrors only counts packets HW failed transmits, dropped out of
> > the
> > > > > driver tx_pkt_burst() knowledge
> > > > > - the application does not have to track SW failed transmits
> > since the
> > > > > stats is in ethdev
> > > > > It sounds good to me, this means an ethdev abi breakage.
> > > >
> > > > Hang on, why do we need ethdev to track this at all, given that it's
> > > > trivial for apps to track this themselves. Would we not be better just
> > to
> > > > add this tracking into testpmd and leave ethdev and drivers alone?
> > Perhaps
> > > > I'm missing something?
> > > >
> > >
> > > This was my first intention but Thomas hopped in ;-)
> >
> > I was just opening the discussion :)
> >
> > > testpmd does it already via the fs->fwd_dropped stats and ovs has its
> > > tx_dropped stat.
> > >
> > > The problem is that all drivers have different approach about this.
> > > Some drivers only count real hw errors in oerrors.
> > > But others count the packets it can't send in oerrors (+ there are some
> > > cases that seem buggy to me where the driver will always refuse the mbufs
> > > for reason X and the application can retry indefinitely to send...).
> >
> > We have 3 options:
> > 1/ status quo = oerrors is inconsistent across drivers
> > 2/ API break = oerrors stop being incremented for temporary
> > unavailability (i.e. queue full, kind of ERETRY),
> > report only packets which will be never sent,
> > may be a small performance gain for some drivers
> > 3/ API + ABI break = same as 2/ +
> > report ERETRY errors in ofull (same as tx_burst() delta)
> >
> > Note that the option 2 is a light API break which does not require
> > any deprecation notice because the original definition of oerrors
> > is really vague: "failed transmitted packets"
> > By changing the definition of errors to "packets lost", we can count
> > HW errors + packets not matching requirements.
> > As David suggests, the packets not matching requirements can be freed
> > as it is done for packets successfully transmitted to the HW.
> > We need also to update the definition of the return value of
> > rte_eth_tx_burst(): "packets actually stored in transmit descriptors".
> > We should also count the bad packets rejected by the driver.
> > Then the number of bad packets would be the difference between
> > the return value of rte_eth_tx_burst() and opackets counter.
> > This solution is fixing some bugs and enforce a consistent behaviour.
> >
>
> I am also for option 2 especially because of this.
> A driver that refuses a packet for reason X (which is a limitation, or an
> incorrect config or whatever that is not a transient condition) but gives
> it back to the application is a bad driver.
Why? What.s wrong to leave it to the upper layer to decide what to
do with the packets that can't be sent (by one reason or another)?
>
>
> > The option 3 is breaking the ABI and may degrade the performances.
> > The only benefit is convenience or semantic: ofull would be the
> > equivalent of imissed.
> > The application can count the same by making the difference between
> > the burst size and the return of rte_eth_tx_burst.
> >
> > My vote is for the option 2.
> >
>
>
>
> --
> David Marchand
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-15 18:15 ` Ananyev, Konstantin
@ 2019-02-15 18:31 ` David Marchand
2019-02-15 18:42 ` Ananyev, Konstantin
0 siblings, 1 reply; 109+ messages in thread
From: David Marchand @ 2019-02-15 18:31 UTC (permalink / raw)
To: Ananyev, Konstantin
Cc: Thomas Monjalon, Richardson, Bruce, dev, Lu, Wenzhuo, Wu,
Jingjing, Iremonger, Bernard, Maxime Coquelin, Yigit, Ferruh,
Andrew Rybchenko, Wiles, Keith
On Fri, Feb 15, 2019 at 7:15 PM Ananyev, Konstantin <
konstantin.ananyev@intel.com> wrote:
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Marchand
> > I am also for option 2 especially because of this.
> > A driver that refuses a packet for reason X (which is a limitation, or an
> > incorrect config or whatever that is not a transient condition) but gives
> > it back to the application is a bad driver.
>
> Why? What.s wrong to leave it to the upper layer to decide what to
> do with the packets that can't be sent (by one reason or another)?
>
How does the upper layer know if this is a transient state or something
that can't be resolved?
--
David Marchand
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-15 18:31 ` David Marchand
@ 2019-02-15 18:42 ` Ananyev, Konstantin
2019-02-15 19:38 ` Thomas Monjalon
0 siblings, 1 reply; 109+ messages in thread
From: Ananyev, Konstantin @ 2019-02-15 18:42 UTC (permalink / raw)
To: David Marchand
Cc: Thomas Monjalon, Richardson, Bruce, dev, Lu, Wenzhuo, Wu,
Jingjing, Iremonger, Bernard, Maxime Coquelin, Yigit, Ferruh,
Andrew Rybchenko, Wiles, Keith
>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Marchand
>>> I am also for option 2 especially because of this.
>>> A driver that refuses a packet for reason X (which is a limitation, or an
>>> incorrect config or whatever that is not a transient condition) but gives
>>> it back to the application is a bad driver.
>>Why? What.s wrong to leave it to the upper layer to decide what to
>>do with the packets that can't be sent (by one reason or another)?
>How does the upper layer know if this is a transient state or something that can't be resolved?
Via rte_errno, for example.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-15 18:42 ` Ananyev, Konstantin
@ 2019-02-15 19:38 ` Thomas Monjalon
2019-02-16 0:37 ` Stephen Hemminger
2019-02-16 12:50 ` Ananyev, Konstantin
0 siblings, 2 replies; 109+ messages in thread
From: Thomas Monjalon @ 2019-02-15 19:38 UTC (permalink / raw)
To: Ananyev, Konstantin
Cc: David Marchand, Richardson, Bruce, dev, Lu, Wenzhuo, Wu,
Jingjing, Iremonger, Bernard, Maxime Coquelin, Yigit, Ferruh,
Andrew Rybchenko, Wiles, Keith
15/02/2019 19:42, Ananyev, Konstantin:
> >>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Marchand
> >>> I am also for option 2 especially because of this.
> >>> A driver that refuses a packet for reason X (which is a limitation, or an
> >>> incorrect config or whatever that is not a transient condition) but gives
> >>> it back to the application is a bad driver.
>
> >>Why? What.s wrong to leave it to the upper layer to decide what to
> >>do with the packets that can't be sent (by one reason or another)?
>
> >How does the upper layer know if this is a transient state or something that can't be resolved?
>
> Via rte_errno, for example.
rte_errno is not a result per packet.
I think it is better to "eat" the packet
as it is done for those transmitted to the HW.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-15 19:38 ` Thomas Monjalon
@ 2019-02-16 0:37 ` Stephen Hemminger
2019-02-16 13:23 ` Ananyev, Konstantin
2019-02-16 12:50 ` Ananyev, Konstantin
1 sibling, 1 reply; 109+ messages in thread
From: Stephen Hemminger @ 2019-02-16 0:37 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Ananyev, Konstantin, David Marchand, Richardson, Bruce, dev, Lu,
Wenzhuo, Wu, Jingjing, Iremonger, Bernard, Maxime Coquelin,
Yigit, Ferruh, Andrew Rybchenko, Wiles, Keith
On Fri, 15 Feb 2019 20:38:59 +0100
Thomas Monjalon <thomas@monjalon.net> wrote:
> 15/02/2019 19:42, Ananyev, Konstantin:
> > >>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Marchand
> > >>> I am also for option 2 especially because of this.
> > >>> A driver that refuses a packet for reason X (which is a limitation, or an
> > >>> incorrect config or whatever that is not a transient condition) but gives
> > >>> it back to the application is a bad driver.
> >
> > >>Why? What.s wrong to leave it to the upper layer to decide what to
> > >>do with the packets that can't be sent (by one reason or another)?
> >
> > >How does the upper layer know if this is a transient state or something that can't be resolved?
> >
> > Via rte_errno, for example.
>
> rte_errno is not a result per packet.
> I think it is better to "eat" the packet
> as it is done for those transmitted to the HW.
>
>
First off rte_errno doesn't work for a burst API.
IMHO (which matches /2) all drivers should only increment oerrors for something for
a packet which it could not transmit because of hardware condition (link down etc)
or mbuf which has parameters which can not be handled. In either case, the packet
must be dropped by driver and oerrors incremented. The driver should also maintain
internal stats (available by xstats) for any conditions like this.
When no tx descriptors are available, the driver must not increment any counter
and return partial success to the application. If application then wants to do
back pressure or drop it should keep its own statistics.
This is close to the original model in the Intel drivers, and matches what BSD and
Linux do on the OS level for drivers. Like many driver assumptions the corner
cases were not explicitly documented and new drivers probably don't follow
the same pattern.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-15 19:38 ` Thomas Monjalon
2019-02-16 0:37 ` Stephen Hemminger
@ 2019-02-16 12:50 ` Ananyev, Konstantin
2019-02-20 8:33 ` David Marchand
1 sibling, 1 reply; 109+ messages in thread
From: Ananyev, Konstantin @ 2019-02-16 12:50 UTC (permalink / raw)
To: Thomas Monjalon
Cc: David Marchand, Richardson, Bruce, dev, Lu, Wenzhuo, Wu,
Jingjing, Iremonger, Bernard, Maxime Coquelin, Yigit, Ferruh,
Andrew Rybchenko, Wiles, Keith
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Friday, February 15, 2019 7:39 PM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Cc: David Marchand <david.marchand@redhat.com>; Richardson, Bruce <bruce.richardson@intel.com>; dev@dpdk.org; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>; Maxime Coquelin
> <mcoqueli@redhat.com>; Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>; Wiles, Keith
> <keith.wiles@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
>
> 15/02/2019 19:42, Ananyev, Konstantin:
> > >>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Marchand
> > >>> I am also for option 2 especially because of this.
> > >>> A driver that refuses a packet for reason X (which is a limitation, or an
> > >>> incorrect config or whatever that is not a transient condition) but gives
> > >>> it back to the application is a bad driver.
> >
> > >>Why? What.s wrong to leave it to the upper layer to decide what to
> > >>do with the packets that can't be sent (by one reason or another)?
> >
> > >How does the upper layer know if this is a transient state or something that can't be resolved?
> >
> > Via rte_errno, for example.
>
> rte_errno is not a result per packet.
Surely it is not.
But tx_burst() can return after first failure.
> I think it is better to "eat" the packet
> as it is done for those transmitted to the HW.
Probably extra clarification is needed here.
Right now tx_burst (at least for PMDs I am aware about) doesn't
do any checking that:
- packet is correct and can be handled
(this is responsibility of tx_prepare)
- HW/PMD SW state is in valid and properly configured
(link is up, queue is configured, HW initialized properly).
All that really tx_burst() care about -there is enough free TX
descriptors to fill. When that happens - tx_burst() returns
straightway.
So what particular error conditions are you talking about,
and when you think we have to 'eat' the packets?
Konstantin
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-16 0:37 ` Stephen Hemminger
@ 2019-02-16 13:23 ` Ananyev, Konstantin
0 siblings, 0 replies; 109+ messages in thread
From: Ananyev, Konstantin @ 2019-02-16 13:23 UTC (permalink / raw)
To: Stephen Hemminger, Thomas Monjalon
Cc: David Marchand, Richardson, Bruce, dev, Lu, Wenzhuo, Wu,
Jingjing, Iremonger, Bernard, Maxime Coquelin, Yigit, Ferruh,
Andrew Rybchenko, Wiles, Keith
>
> On Fri, 15 Feb 2019 20:38:59 +0100
> Thomas Monjalon <thomas@monjalon.net> wrote:
>
> > 15/02/2019 19:42, Ananyev, Konstantin:
> > > >>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Marchand
> > > >>> I am also for option 2 especially because of this.
> > > >>> A driver that refuses a packet for reason X (which is a limitation, or an
> > > >>> incorrect config or whatever that is not a transient condition) but gives
> > > >>> it back to the application is a bad driver.
> > >
> > > >>Why? What.s wrong to leave it to the upper layer to decide what to
> > > >>do with the packets that can't be sent (by one reason or another)?
> > >
> > > >How does the upper layer know if this is a transient state or something that can't be resolved?
> > >
> > > Via rte_errno, for example.
> >
> > rte_errno is not a result per packet.
> > I think it is better to "eat" the packet
> > as it is done for those transmitted to the HW.
> >
> >
>
> First off rte_errno doesn't work for a burst API.
It doesn't allow to return individual error value for each packet.
Though if we stop after first error happens - it is sufficient.
>
> IMHO (which matches /2) all drivers should only increment oerrors for something for
> a packet which it could not transmit because of hardware condition (link down etc)
It sounds too expensive to check that HW is in healthy state and link is up for every tx_burst
operation.
> or mbuf which has parameters which can not be handled.
Right now it is responsibility of different function - tx_prepare().
> In either case, the packet
> must be dropped by driver and oerrors incremented.
Right now tx_burst() only cares - is there enough free TX descriptors to submit packet or not.
>From my perspective - it is better to keep it that way.
If the user would like to drop packets if the link is down,
or if the packet is malformed - there should be no problem to create a wrapper on
top of tx_burst() that would do all these extra checking and packet freeing.
>The driver should also maintain
> internal stats (available by xstats) for any conditions like this.
>
> When no tx descriptors are available, the driver must not increment any counter
> and return partial success to the application. If application then wants to do
> back pressure or drop it should keep its own statistics.
>
> This is close to the original model in the Intel drivers, and matches what BSD and
> Linux do on the OS level for drivers. Like many driver assumptions the corner
> cases were not explicitly documented and new drivers probably don't follow
> the same pattern.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 1/5] app/testpmd: remove unused fwd_ctx field
2019-02-14 15:42 ` [dpdk-dev] [PATCH 1/5] app/testpmd: remove unused fwd_ctx field David Marchand
@ 2019-02-18 19:55 ` Rami Rosen
0 siblings, 0 replies; 109+ messages in thread
From: Rami Rosen @ 2019-02-18 19:55 UTC (permalink / raw)
To: David Marchand; +Cc: dev, wenzhuo.lu, jingjing.wu, Iremonger, Bernard
I believe this patch should be cc'ed/sent to stable@dpdk.org
Reviewed-by: Rami Rosen <ramirose@gmail.com>
On Thu, Feb 14, 2019 at 5:43 PM David Marchand <david.marchand@redhat.com>
wrote:
> Remove some leftover from a previous rework.
>
> Fixes: c4bcc342c8ee ("app/testpmd: refactor ieee1588 forwarding")
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> 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
>
>
--
regards,
Rami Rosen
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 2/5] app/testpmd: add missing newline when showing statistics
2019-02-14 15:42 ` [dpdk-dev] [PATCH 2/5] app/testpmd: add missing newline when showing statistics David Marchand
@ 2019-02-19 5:48 ` Rami Rosen
0 siblings, 0 replies; 109+ messages in thread
From: Rami Rosen @ 2019-02-19 5:48 UTC (permalink / raw)
To: David Marchand; +Cc: dev, wenzhuo.lu, jingjing.wu, Iremonger, Bernard
+1
Reviewed-by: Rami Rosen <ramirose at gmail.com>
On Thu, Feb 14, 2019 at 5:43 PM David Marchand <david.marchand@redhat.com>
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]
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> 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 98c1baa..984155a 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
>
>
--
regards,
Rami Rosen
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-16 12:50 ` Ananyev, Konstantin
@ 2019-02-20 8:33 ` David Marchand
2019-02-24 11:55 ` Ananyev, Konstantin
0 siblings, 1 reply; 109+ messages in thread
From: David Marchand @ 2019-02-20 8:33 UTC (permalink / raw)
To: Ananyev, Konstantin
Cc: Thomas Monjalon, Richardson, Bruce, dev, Lu, Wenzhuo, Wu,
Jingjing, Iremonger, Bernard, Maxime Coquelin, Yigit, Ferruh,
Andrew Rybchenko, Wiles, Keith
Hello Konstantin,
On Sat, Feb 16, 2019 at 1:50 PM Ananyev, Konstantin <
konstantin.ananyev@intel.com> wrote:
>
>
> > -----Original Message-----
> > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > Sent: Friday, February 15, 2019 7:39 PM
> > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> > Cc: David Marchand <david.marchand@redhat.com>; Richardson, Bruce <
> bruce.richardson@intel.com>; dev@dpdk.org; Lu, Wenzhuo
> > <wenzhuo.lu@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>; Maxime Coquelin
> > <mcoqueli@redhat.com>; Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew
> Rybchenko <arybchenko@solarflare.com>; Wiles, Keith
> > <keith.wiles@intel.com>
> > Subject: Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit
> errors stats
> >
> > 15/02/2019 19:42, Ananyev, Konstantin:
> > > >>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David
> Marchand
> > > >>> I am also for option 2 especially because of this.
> > > >>> A driver that refuses a packet for reason X (which is a
> limitation, or an
> > > >>> incorrect config or whatever that is not a transient condition)
> but gives
> > > >>> it back to the application is a bad driver.
> > >
> > > >>Why? What.s wrong to leave it to the upper layer to decide what to
> > > >>do with the packets that can't be sent (by one reason or another)?
> > >
> > > >How does the upper layer know if this is a transient state or
> something that can't be resolved?
> > >
> > > Via rte_errno, for example.
> >
> > rte_errno is not a result per packet.
>
> Surely it is not.
> But tx_burst() can return after first failure.
>
> > I think it is better to "eat" the packet
> > as it is done for those transmitted to the HW.
>
> Probably extra clarification is needed here.
> Right now tx_burst (at least for PMDs I am aware about) doesn't
> do any checking that:
> - packet is correct and can be handled
> (this is responsibility of tx_prepare)
> - HW/PMD SW state is in valid and properly configured
> (link is up, queue is configured, HW initialized properly).
>
> All that really tx_burst() care about -there is enough free TX
> descriptors to fill. When that happens - tx_burst() returns
> straightway.
>
> So what particular error conditions are you talking about,
> and when you think we have to 'eat' the packets?
>
- This is how Intel drivers are written yes.
But some drivers try to do more and have (useless ?) checks on mbufs or
internal states.
Found the following ones last week.
There are more but it takes time to investigate.
https://git.dpdk.org/dpdk/tree/drivers/net/atlantic/atl_rxtx.c?id=b13baac8d5ffb6b0b7a6ca0def884d3f1a82babb#n1346
https://git.dpdk.org/dpdk/tree/drivers/net/fm10k/fm10k_rxtx.c?id=b13baac8d5ffb6b0b7a6ca0def884d3f1a82babb#n646
https://git.dpdk.org/dpdk/tree/drivers/net/cxgbe/sge.c?id=b13baac8d5ffb6b0b7a6ca0def884d3f1a82babb#n1123
I would say first, we can have a cleanup to get rid of the unneeded checks,
and see what the different maintainers think about this.
Then look again at the situation.
- I will drop this patch on testpmd which was wrong.
But I intend to send an update on the doc to describe oerrors as solution 2:
2/ API break = oerrors stop being incremented for temporary
unavailability (i.e. queue full, kind of ERETRY),
report only packets which will be never sent,
may be a small performance gain for some drivers
There is some cleanup to do as well in quite a few drivers.
--
David Marchand
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
2019-02-20 8:33 ` David Marchand
@ 2019-02-24 11:55 ` Ananyev, Konstantin
0 siblings, 0 replies; 109+ messages in thread
From: Ananyev, Konstantin @ 2019-02-24 11:55 UTC (permalink / raw)
To: David Marchand
Cc: Thomas Monjalon, Richardson, Bruce, dev, Lu, Wenzhuo, Wu,
Jingjing, Iremonger, Bernard, Maxime Coquelin, Yigit, Ferruh,
Andrew Rybchenko, Wiles, Keith
Hi David,
Hello Konstantin,
On Sat, Feb 16, 2019 at 1:50 PM Ananyev, Konstantin <konstantin.ananyev@intel.com<mailto:konstantin.ananyev@intel.com>> wrote:
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net<mailto:thomas@monjalon.net>]
> Sent: Friday, February 15, 2019 7:39 PM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com<mailto:konstantin.ananyev@intel.com>>
> Cc: David Marchand <david.marchand@redhat.com<mailto:david.marchand@redhat.com>>; Richardson, Bruce <bruce.richardson@intel.com<mailto:bruce.richardson@intel.com>>; dev@dpdk.org<mailto:dev@dpdk.org>; Lu, Wenzhuo
> <wenzhuo.lu@intel.com<mailto:wenzhuo.lu@intel.com>>; Wu, Jingjing <jingjing.wu@intel.com<mailto:jingjing.wu@intel.com>>; Iremonger, Bernard <bernard.iremonger@intel.com<mailto:bernard.iremonger@intel.com>>; Maxime Coquelin
> <mcoqueli@redhat.com<mailto:mcoqueli@redhat.com>>; Yigit, Ferruh <ferruh.yigit@intel.com<mailto:ferruh.yigit@intel.com>>; Andrew Rybchenko <arybchenko@solarflare.com<mailto:arybchenko@solarflare.com>>; Wiles, Keith
> <keith.wiles@intel.com<mailto:keith.wiles@intel.com>>
> Subject: Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
>
> 15/02/2019 19:42, Ananyev, Konstantin:
> > >>> From: dev [mailto:dev-bounces@dpdk.org<mailto:dev-bounces@dpdk.org>] On Behalf Of David Marchand
> > >>> I am also for option 2 especially because of this.
> > >>> A driver that refuses a packet for reason X (which is a limitation, or an
> > >>> incorrect config or whatever that is not a transient condition) but gives
> > >>> it back to the application is a bad driver.
> >
> > >>Why? What.s wrong to leave it to the upper layer to decide what to
> > >>do with the packets that can't be sent (by one reason or another)?
> >
> > >How does the upper layer know if this is a transient state or something that can't be resolved?
> >
> > Via rte_errno, for example.
>
> rte_errno is not a result per packet.
Surely it is not.
But tx_burst() can return after first failure.
> I think it is better to "eat" the packet
> as it is done for those transmitted to the HW.
Probably extra clarification is needed here.
Right now tx_burst (at least for PMDs I am aware about) doesn't
do any checking that:
- packet is correct and can be handled
(this is responsibility of tx_prepare)
- HW/PMD SW state is in valid and properly configured
(link is up, queue is configured, HW initialized properly).
All that really tx_burst() care about -there is enough free TX
descriptors to fill. When that happens - tx_burst() returns
straightway.
So what particular error conditions are you talking about,
and when you think we have to 'eat' the packets?
- This is how Intel drivers are written yes.
But some drivers try to do more and have (useless ?) checks on mbufs or internal states.
Found the following ones last week.
There are more but it takes time to investigate.
https://git.dpdk.org/dpdk/tree/drivers/net/atlantic/atl_rxtx.c?id=b13baac8d5ffb6b0b7a6ca0def884d3f1a82babb#n1346
https://git.dpdk.org/dpdk/tree/drivers/net/fm10k/fm10k_rxtx.c?id=b13baac8d5ffb6b0b7a6ca0def884d3f1a82babb#n646
https://git.dpdk.org/dpdk/tree/drivers/net/cxgbe/sge.c?id=b13baac8d5ffb6b0b7a6ca0def884d3f1a82babb#n1123
I would say first, we can have a cleanup to get rid of the unneeded checks, and see what the different maintainers think about this.
Then look again at the situation.
- I will drop this patch on testpmd which was wrong.
But I intend to send an update on the doc to describe oerrors as solution 2:
2/ API break = oerrors stop being incremented for temporary
unavailability (i.e. queue full, kind of ERETRY),
report only packets which will be never sent,
may be a small performance gain for some drivers
There is some cleanup to do as well in quite a few drivers.
I didn’t look at all your links above, but fm10k checks definitely seems redundant.
Cleanup of such things sounds like a good thing.
Thanks
Konstantin
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH v2 0/4] display testpmd forwarding engine stats on the fly
2019-02-14 15:42 [dpdk-dev] [PATCH 0/5] display testpmd forwarding engine stats on the fly David Marchand
` (4 preceding siblings ...)
2019-02-14 15:42 ` [dpdk-dev] [PATCH 5/5] app/testpmd: display/clear forwarding stats on demand David Marchand
@ 2019-03-11 15:35 ` David Marchand
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 1/4] app/testpmd: remove unused fwd_ctx field David Marchand
` (4 more replies)
5 siblings, 5 replies; 109+ messages in thread
From: David Marchand @ 2019-03-11 15:35 UTC (permalink / raw)
To: dev; +Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose
Here is a little series that makes it possible to display and clear
testpmd fwd engines while they run without having to stop them.
This is mostly handy when running stress tests and you look for packets
drops without having to stop/start testpmd forwarding.
Example:
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 261977064 TX-packets: 261977064 TX-dropped: 0
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 261985142 TX-packets: 261985142 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 261977096 RX-dropped: 0 RX-total: 261977096
TX-packets: 261985155 TX-dropped: 0 TX-total: 261985155
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 261985188 RX-dropped: 0 RX-total: 261985188
TX-packets: 261977128 TX-dropped: 0 TX-total: 261977128
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 523962284 RX-dropped: 0 RX-total: 523962284
TX-packets: 523962283 TX-dropped: 0 TX-total: 523962283
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
David Marchand
---
Changelog since v1:
- Cc: stable for patch 1
- removed buggy patch 3
---
David Marchand (4):
app/testpmd: remove unused fwd_ctx field
app/testpmd: add missing newline when showing statistics
app/testpmd: remove useless casts on statistics
app/testpmd: display/clear forwarding stats on demand
app/test-pmd/cmdline.c | 44 +++
app/test-pmd/testpmd.c | 450 ++++++++++++++--------------
app/test-pmd/testpmd.h | 22 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 315 insertions(+), 237 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH v2 1/4] app/testpmd: remove unused fwd_ctx field
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 0/4] display testpmd forwarding engine stats on the fly David Marchand
@ 2019-03-11 15:35 ` David Marchand
2019-03-19 18:29 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 2/4] app/testpmd: add missing newline when showing statistics David Marchand
` (3 subsequent siblings)
4 siblings, 1 reply; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v2 2/4] app/testpmd: add missing newline when showing statistics
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 1/4] app/testpmd: remove unused fwd_ctx field David Marchand
@ 2019-03-11 15:35 ` David Marchand
2019-03-11 15:53 ` Andrew Rybchenko
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 3/4] app/testpmd: remove useless casts on statistics David Marchand
` (2 subsequent siblings)
4 siblings, 1 reply; 109+ messages in thread
From: David Marchand @ 2019-03-11 15:35 UTC (permalink / raw)
To: dev; +Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose
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]
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
---
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 98c1baa..984155a 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] 109+ messages in thread
* [dpdk-dev] [PATCH v2 3/4] app/testpmd: remove useless casts on statistics
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 1/4] app/testpmd: remove unused fwd_ctx field David Marchand
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 2/4] app/testpmd: add missing newline when showing statistics David Marchand
@ 2019-03-11 15:35 ` David Marchand
2019-03-11 15:57 ` Andrew Rybchenko
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 0/4] display testpmd forwarding engine stats on the fly David Marchand
4 siblings, 1 reply; 109+ messages in thread
From: David Marchand @ 2019-03-11 15:35 UTC (permalink / raw)
To: dev; +Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose
Caught by code review while investigating the stats display code.
Switching all port and fwd engine statistics to uint64_t makes it
possible to drop all casts.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
app/test-pmd/testpmd.c | 62 ++++++++++++++++++--------------------------------
app/test-pmd/testpmd.h | 12 +++++-----
2 files changed, 28 insertions(+), 46 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 984155a..3651a13 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
@@ -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,42 +1771,25 @@ 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 +
- fwd_streams[sm_id]->core_cycles);
+ fwd_cycles += fs->core_cycles;
#endif
}
total_recv = 0;
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] 109+ messages in thread
* [dpdk-dev] [PATCH v2 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 0/4] display testpmd forwarding engine stats on the fly David Marchand
` (2 preceding siblings ...)
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 3/4] app/testpmd: remove useless casts on statistics David Marchand
@ 2019-03-11 15:35 ` David Marchand
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 0/4] display testpmd forwarding engine stats on the fly David Marchand
4 siblings, 0 replies; 109+ messages in thread
From: David Marchand @ 2019-03-11 15:35 UTC (permalink / raw)
To: dev; +Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose
Add a new "show/clear fwd stats all" command to display fwd and port
statistics on the fly.
To be able to do so, rte_port can't be used to maintain any statistics.
Moved the stats dump parts from stop_packet_forwarding() and merge with
fwd_port_stats_display() into fwd_stats_display().
fwd engine statistics are then aggregated into a local per port array.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changelog since v1:
- removed hunk from now deleted patch 3
---
app/test-pmd/cmdline.c | 44 +++
app/test-pmd/testpmd.c | 424 +++++++++++++++-------------
app/test-pmd/testpmd.h | 9 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 305 insertions(+), 208 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index db53cc0..58b11b7 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -7386,6 +7386,49 @@ struct cmd_showqueue_result {
},
};
+/* show/clear fwd engine statistics */
+struct fwd_result {
+ cmdline_fixed_string_t action;
+ cmdline_fixed_string_t fwd;
+ cmdline_fixed_string_t stats;
+ cmdline_fixed_string_t all;
+};
+
+cmdline_parse_token_string_t cmd_fwd_action =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, action, "show#clear");
+cmdline_parse_token_string_t cmd_fwd_fwd =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, fwd, "fwd");
+cmdline_parse_token_string_t cmd_fwd_stats =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, stats, "stats");
+cmdline_parse_token_string_t cmd_fwd_all =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, all, "all");
+
+static void
+cmd_fwd_parsed(void *parsed_result,
+ __rte_unused struct cmdline *cl,
+ __rte_unused void *data)
+{
+ struct fwd_result *res = parsed_result;
+
+ if (!strcmp(res->action, "show"))
+ fwd_stats_display();
+ else
+ fwd_stats_reset();
+}
+
+static cmdline_parse_inst_t cmd_fwdall = {
+ .f = cmd_fwd_parsed,
+ .data = NULL,
+ .help_str = "show|clear fwd stats all",
+ .tokens = {
+ (void *)&cmd_fwd_action,
+ (void *)&cmd_fwd_fwd,
+ (void *)&cmd_fwd_stats,
+ (void *)&cmd_fwd_all,
+ NULL,
+ },
+};
+
/* *** READ PORT REGISTER *** */
struct cmd_read_reg_result {
cmdline_fixed_string_t read;
@@ -18559,6 +18602,7 @@ struct cmd_show_tx_metadata_result {
(cmdline_parse_inst_t *)&cmd_showqueue,
(cmdline_parse_inst_t *)&cmd_showportall,
(cmdline_parse_inst_t *)&cmd_showcfg,
+ (cmdline_parse_inst_t *)&cmd_fwdall,
(cmdline_parse_inst_t *)&cmd_start,
(cmdline_parse_inst_t *)&cmd_start_tx_first,
(cmdline_parse_inst_t *)&cmd_start_tx_first_n,
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 3651a13..02895e5 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1361,91 +1361,6 @@ struct extmem_param {
#endif /* RTE_TEST_PMD_RECORD_BURST_STATS */
static void
-fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
-{
- struct rte_port *port;
- uint8_t i;
-
- static const char *fwd_stats_border = "----------------------";
-
- port = &ports[port_id];
- printf("\n %s Forward statistics for port %-2d %s\n",
- fwd_stats_border, port_id, fwd_stats_border);
-
- if ((!port->rx_queue_stats_mapping_enabled) && (!port->tx_queue_stats_mapping_enabled)) {
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n",
- 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",
- 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);
- }
-
- printf(" TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- 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,
- 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",
- 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);
- }
-
- printf(" TX-packets: %14"PRIu64" TX-dropped:%14"PRIu64" TX-total:"
- "%14"PRIu64"\n",
- stats->opackets, port->tx_dropped,
- stats->opackets + port->tx_dropped);
- }
-
-#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
- if (port->rx_stream)
- pkt_burst_stats_display("RX",
- &port->rx_stream->rx_burst_stats);
- if (port->tx_stream)
- pkt_burst_stats_display("TX",
- &port->tx_stream->tx_burst_stats);
-#endif
-
- if (port->rx_queue_stats_mapping_enabled) {
- printf("\n");
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d RX-packets:%14"PRIu64
- " RX-errors:%14"PRIu64
- " RX-bytes:%14"PRIu64"\n",
- i, stats->q_ipackets[i], stats->q_errors[i], stats->q_ibytes[i]);
- }
- printf("\n");
- }
- if (port->tx_queue_stats_mapping_enabled) {
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d TX-packets:%14"PRIu64
- " TX-bytes:%14"PRIu64"\n",
- i, stats->q_opackets[i], stats->q_obytes[i]);
- }
- }
-
- printf(" %s--------------------------------%s\n",
- fwd_stats_border, fwd_stats_border);
-}
-
-static void
fwd_stream_stats_display(streamid_t stream_id)
{
struct fwd_stream *fs;
@@ -1478,6 +1393,224 @@ struct extmem_param {
#endif
}
+void
+fwd_stats_display(void)
+{
+ static const char *fwd_stats_border = "----------------------";
+ static const char *acc_stats_border = "+++++++++++++++";
+ struct {
+ struct fwd_stream *rx_stream;
+ struct fwd_stream *tx_stream;
+ uint64_t tx_dropped;
+ uint64_t rx_bad_ip_csum;
+ uint64_t rx_bad_l4_csum;
+ uint64_t rx_bad_outer_l4_csum;
+ } ports_stats[RTE_MAX_ETHPORTS];
+ uint64_t total_rx_dropped = 0;
+ uint64_t total_tx_dropped = 0;
+ uint64_t total_rx_nombuf = 0;
+ struct rte_eth_stats stats;
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ uint64_t fwd_cycles = 0;
+#endif
+ uint64_t total_recv = 0;
+ uint64_t total_xmit = 0;
+ struct rte_port *port;
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ memset(ports_stats, 0, sizeof(ports_stats));
+
+ 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);
+ } else {
+ ports_stats[fs->tx_port].tx_stream = fs;
+ ports_stats[fs->rx_port].rx_stream = fs;
+ }
+
+ ports_stats[fs->tx_port].tx_dropped += fs->fwd_dropped;
+
+ ports_stats[fs->rx_port].rx_bad_ip_csum += fs->rx_bad_ip_csum;
+ ports_stats[fs->rx_port].rx_bad_l4_csum += fs->rx_bad_l4_csum;
+ ports_stats[fs->rx_port].rx_bad_outer_l4_csum +=
+ fs->rx_bad_outer_l4_csum;
+
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fwd_cycles += fs->core_cycles;
+#endif
+ }
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ uint8_t j;
+
+ pt_id = fwd_ports_ids[i];
+ port = &ports[pt_id];
+
+ rte_eth_stats_get(pt_id, &stats);
+ stats.ipackets -= port->stats.ipackets;
+ stats.opackets -= port->stats.opackets;
+ stats.ibytes -= port->stats.ibytes;
+ stats.obytes -= port->stats.obytes;
+ stats.imissed -= port->stats.imissed;
+ stats.oerrors -= port->stats.oerrors;
+ stats.rx_nombuf -= port->stats.rx_nombuf;
+
+ total_recv += stats.ipackets;
+ total_xmit += stats.opackets;
+ total_rx_dropped += stats.imissed;
+ total_tx_dropped += ports_stats[pt_id].tx_dropped;
+ total_tx_dropped += stats.oerrors;
+ total_rx_nombuf += stats.rx_nombuf;
+
+ printf("\n %s Forward statistics for port %-2d %s\n",
+ fwd_stats_border, pt_id, fwd_stats_border);
+
+ if (!port->rx_queue_stats_mapping_enabled &&
+ !port->tx_queue_stats_mapping_enabled) {
+ printf(" RX-packets: %-14"PRIu64
+ " RX-dropped: %-14"PRIu64
+ "RX-total: %-"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %-14"PRIu64
+ " TX-dropped: %-14"PRIu64
+ "TX-total: %-"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ } else {
+ printf(" RX-packets: %14"PRIu64
+ " RX-dropped:%14"PRIu64
+ " RX-total:%14"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %14"PRIu64
+ " TX-dropped:%14"PRIu64
+ " TX-total:%14"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ }
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ if (ports_stats[pt_id].rx_stream)
+ pkt_burst_stats_display("RX",
+ &ports_stats[pt_id].rx_stream->rx_burst_stats);
+ if (ports_stats[pt_id].tx_stream)
+ pkt_burst_stats_display("TX",
+ &ports_stats[pt_id].tx_stream->tx_burst_stats);
+#endif
+
+ if (port->rx_queue_stats_mapping_enabled) {
+ printf("\n");
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d RX-packets:%14"PRIu64
+ " RX-errors:%14"PRIu64
+ " RX-bytes:%14"PRIu64"\n",
+ j, stats.q_ipackets[j],
+ stats.q_errors[j], stats.q_ibytes[j]);
+ }
+ printf("\n");
+ }
+ if (port->tx_queue_stats_mapping_enabled) {
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d TX-packets:%14"PRIu64
+ " TX-bytes:%14"
+ PRIu64"\n",
+ j, stats.q_opackets[j],
+ stats.q_obytes[j]);
+ }
+ }
+
+ printf(" %s--------------------------------%s\n",
+ fwd_stats_border, fwd_stats_border);
+ }
+
+ printf("\n %s Accumulated forward statistics for all ports"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+ printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
+ "%-"PRIu64"\n"
+ " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
+ "%-"PRIu64"\n",
+ total_recv, total_rx_dropped, total_recv + total_rx_dropped,
+ total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
+ if (total_rx_nombuf > 0)
+ printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
+ printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ if (total_recv > 0)
+ printf("\n CPU cycles/packet=%u (total cycles="
+ "%"PRIu64" / total RX packets=%"PRIu64")\n",
+ (unsigned int)(fwd_cycles / total_recv),
+ fwd_cycles, total_recv);
+#endif
+}
+
+void
+fwd_stats_reset(void)
+{
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ pt_id = fwd_ports_ids[i];
+ rte_eth_stats_get(pt_id, &ports[pt_id].stats);
+ }
+ for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
+ struct fwd_stream *fs = fwd_streams[sm_id];
+
+ fs->rx_packets = 0;
+ fs->tx_packets = 0;
+ fs->fwd_dropped = 0;
+ fs->rx_bad_ip_csum = 0;
+ fs->rx_bad_l4_csum = 0;
+ fs->rx_bad_outer_l4_csum = 0;
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ memset(&fs->rx_burst_stats, 0, sizeof(fs->rx_burst_stats));
+ memset(&fs->tx_burst_stats, 0, sizeof(fs->tx_burst_stats));
+#endif
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fs->core_cycles = 0;
+#endif
+ }
+}
+
static void
flush_fwd_rx_queues(void)
{
@@ -1633,7 +1766,6 @@ struct extmem_param {
struct rte_port *port;
unsigned int i;
portid_t pt_id;
- streamid_t sm_id;
if (strcmp(cur_fwd_eng->fwd_mode_name, "rxonly") == 0 && !nb_rxq)
rte_exit(EXIT_FAILURE, "rxq are 0, cannot use rxonly fwd mode\n");
@@ -1684,32 +1816,12 @@ struct extmem_param {
pkt_fwd_config_display(&cur_fwd_config);
rxtx_config_display();
+ fwd_stats_reset();
for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
pt_id = fwd_ports_ids[i];
port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &port->stats);
- port->tx_dropped = 0;
-
map_port_queue_stats_mapping_registers(pt_id, port);
}
- for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
- fwd_streams[sm_id]->rx_packets = 0;
- fwd_streams[sm_id]->tx_packets = 0;
- 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,
- sizeof(fwd_streams[sm_id]->rx_burst_stats));
- memset(&fwd_streams[sm_id]->tx_burst_stats, 0,
- sizeof(fwd_streams[sm_id]->tx_burst_stats));
-#endif
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- fwd_streams[sm_id]->core_cycles = 0;
-#endif
- }
if (with_tx_first) {
port_fwd_begin = tx_only_engine.port_fwd_begin;
if (port_fwd_begin != NULL) {
@@ -1733,23 +1845,10 @@ struct extmem_param {
void
stop_packet_forwarding(void)
{
- struct rte_eth_stats stats;
- struct rte_port *port;
- port_fwd_end_t port_fwd_end;
+ port_fwd_end_t port_fwd_end;
+ lcoreid_t lc_id;
+ portid_t pt_id;
int i;
- portid_t pt_id;
- streamid_t sm_id;
- lcoreid_t lc_id;
- uint64_t total_recv;
- uint64_t total_xmit;
- uint64_t total_rx_dropped;
- uint64_t total_tx_dropped;
- uint64_t total_rx_nombuf;
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- uint64_t fwd_cycles;
-#endif
-
- static const char *acc_stats_border = "+++++++++++++++";
if (test_done) {
printf("Packet forwarding not started\n");
@@ -1767,86 +1866,9 @@ struct extmem_param {
(*port_fwd_end)(pt_id);
}
}
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- 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[fs->tx_port].tx_stream = NULL;
- ports[fs->rx_port].rx_stream = NULL;
- } else {
- 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 += fs->core_cycles;
-#endif
- }
- total_recv = 0;
- total_xmit = 0;
- total_rx_dropped = 0;
- total_tx_dropped = 0;
- total_rx_nombuf = 0;
- for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
- pt_id = fwd_ports_ids[i];
-
- port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &stats);
- stats.ipackets -= port->stats.ipackets;
- port->stats.ipackets = 0;
- stats.opackets -= port->stats.opackets;
- port->stats.opackets = 0;
- stats.ibytes -= port->stats.ibytes;
- port->stats.ibytes = 0;
- stats.obytes -= port->stats.obytes;
- port->stats.obytes = 0;
- stats.imissed -= port->stats.imissed;
- port->stats.imissed = 0;
- stats.oerrors -= port->stats.oerrors;
- port->stats.oerrors = 0;
- stats.rx_nombuf -= port->stats.rx_nombuf;
- port->stats.rx_nombuf = 0;
-
- total_recv += stats.ipackets;
- total_xmit += stats.opackets;
- total_rx_dropped += stats.imissed;
- total_tx_dropped += port->tx_dropped;
- total_rx_nombuf += stats.rx_nombuf;
- fwd_port_stats_display(pt_id, &stats);
- }
+ fwd_stats_display();
- printf("\n %s Accumulated forward statistics for all ports"
- "%s\n",
- acc_stats_border, acc_stats_border);
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n"
- " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- total_recv, total_rx_dropped, total_recv + total_rx_dropped,
- total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
- if (total_rx_nombuf > 0)
- printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
- printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
- "%s\n",
- acc_stats_border, acc_stats_border);
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- if (total_recv > 0)
- printf("\n CPU cycles/packet=%u (total cycles="
- "%"PRIu64" / total RX packets=%"PRIu64")\n",
- (unsigned int)(fwd_cycles / total_recv),
- fwd_cycles, total_recv);
-#endif
printf("\nDone.\n");
test_done = 1;
}
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 4f4a48f..f43b1a7 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -164,19 +164,12 @@ struct rte_port {
struct rte_eth_conf dev_conf; /**< Port configuration. */
struct ether_addr eth_addr; /**< Port ethernet address */
struct rte_eth_stats stats; /**< Last port statistics */
- uint64_t tx_dropped; /**< If no descriptor in TX ring */
- struct fwd_stream *rx_stream; /**< Port RX stream, if unique */
- struct fwd_stream *tx_stream; /**< Port TX stream, if unique */
unsigned int socket_id; /**< For NUMA support */
uint16_t parse_tunnel:1; /**< Parse internal headers */
uint16_t tso_segsz; /**< Segmentation offload MSS for non-tunneled packets. */
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 */
- 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 */
@@ -767,6 +760,8 @@ void vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type,
char *list_pkt_forwarding_retry_modes(void);
void set_pkt_forwarding_mode(const char *fwd_mode);
void start_packet_forwarding(int with_tx_first);
+void fwd_stats_display(void);
+void fwd_stats_reset(void);
void stop_packet_forwarding(void);
void dev_set_link_up(portid_t pid);
void dev_set_link_down(portid_t pid);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 1a12da4..06c8b2a 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -336,6 +336,42 @@ Example::
Set rxonly packet forwarding mode
+show fwd
+~~~~~~~~
+
+When running, forwarding engines maintain statistics from the time they have been started.
+Example for the io forwarding engine, with some packet drops on the tx side::
+
+ testpmd> show fwd stats all
+
+ ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
+ RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
+
+ ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
+ RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
+
+ ---------------------- Forward statistics for port 0 ----------------------
+ RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
+ TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
+ ----------------------------------------------------------------------------
+
+ ---------------------- Forward statistics for port 1 ----------------------
+ RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
+ TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
+ ----------------------------------------------------------------------------
+
+ +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
+ RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
+ TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+clear fwd
+~~~~~~~~~
+
+Clear the forwarding engines statistics::
+
+ testpmd> clear fwd stats all
+
read rxd
~~~~~~~~
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/4] app/testpmd: add missing newline when showing statistics
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 2/4] app/testpmd: add missing newline when showing statistics David Marchand
@ 2019-03-11 15:53 ` Andrew Rybchenko
0 siblings, 0 replies; 109+ messages in thread
From: Andrew Rybchenko @ 2019-03-11 15:53 UTC (permalink / raw)
To: David Marchand, dev; +Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose
On 3/11/19 6:35 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]
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Reviewed-by: Rami Rosen <ramirose@gmail.com>
> ---
> 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 98c1baa..984155a 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 */
I'd suggest to add Fixes tag since it looks like a bug
Rx burst stats should be printed on its own line regardless
Rx checksum stats printed or skipped.
Fixes: af75078fece3 ("first public release")
Andrew.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/4] app/testpmd: remove useless casts on statistics
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 3/4] app/testpmd: remove useless casts on statistics David Marchand
@ 2019-03-11 15:57 ` Andrew Rybchenko
2019-03-11 16:03 ` David Marchand
0 siblings, 1 reply; 109+ messages in thread
From: Andrew Rybchenko @ 2019-03-11 15:57 UTC (permalink / raw)
To: David Marchand, dev; +Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose
On 3/11/19 6:35 PM, David Marchand wrote:
> Caught by code review while investigating the stats display code.
> Switching all port and fwd engine statistics to uint64_t makes it
> possible to drop all casts.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
Patch summary is misleading here. The main change here is changing
of counters bitwidth. 32-bit counters overflow pretty fast on 100G, so
it is a good idea to fix it.
Andrew.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/4] app/testpmd: remove useless casts on statistics
2019-03-11 15:57 ` Andrew Rybchenko
@ 2019-03-11 16:03 ` David Marchand
0 siblings, 0 replies; 109+ messages in thread
From: David Marchand @ 2019-03-11 16:03 UTC (permalink / raw)
To: Andrew Rybchenko
Cc: dev, Wenzhuo Lu, Jingjing Wu, Iremonger, Bernard, Rami Rosen
On Mon, Mar 11, 2019 at 4:57 PM Andrew Rybchenko <arybchenko@solarflare.com>
wrote:
> On 3/11/19 6:35 PM, David Marchand wrote:
>
> Caught by code review while investigating the stats display code.
> Switching all port and fwd engine statistics to uint64_t makes it
> possible to drop all casts.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com> <david.marchand@redhat.com>
>
>
> Patch summary is misleading here. The main change here is changing
> of counters bitwidth. 32-bit counters overflow pretty fast on 100G, so
> it is a good idea to fix it.
>
>
Oops, I was so focused on the casts and had in mind "unsigned int" was 64
bits wide...
Will reword and this will deserve a Fixes: tag.
Thanks for catching.
--
David Marchand
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v2 1/4] app/testpmd: remove unused fwd_ctx field
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 1/4] app/testpmd: remove unused fwd_ctx field David Marchand
@ 2019-03-19 18:29 ` Ferruh Yigit
2019-03-19 18:29 ` Ferruh Yigit
0 siblings, 1 reply; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v2 1/4] app/testpmd: remove unused fwd_ctx field
2019-03-19 18:29 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
@ 2019-03-19 18:29 ` Ferruh Yigit
0 siblings, 0 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v3 0/4] display testpmd forwarding engine stats on the fly
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 0/4] display testpmd forwarding engine stats on the fly David Marchand
` (3 preceding siblings ...)
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
@ 2019-03-20 10:02 ` David Marchand
2019-03-20 10:02 ` David Marchand
` (5 more replies)
4 siblings, 6 replies; 109+ 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
Here is a little series that makes it possible to display and clear
testpmd fwd engines while they run without having to stop them.
This is mostly handy when running stress tests and you look for packets
drops without having to stop/start testpmd forwarding.
Example:
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 261977064 TX-packets: 261977064 TX-dropped: 0
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 261985142 TX-packets: 261985142 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 261977096 RX-dropped: 0 RX-total: 261977096
TX-packets: 261985155 TX-dropped: 0 TX-total: 261985155
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 261985188 RX-dropped: 0 RX-total: 261985188
TX-packets: 261977128 TX-dropped: 0 TX-total: 261977128
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 523962284 RX-dropped: 0 RX-total: 523962284
TX-packets: 523962283 TX-dropped: 0 TX-total: 523962283
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
David Marchand
---
Changelog since v2:
- first patch has been merged in net-next, removed from the series
- split patch (numbered 3 in v2) in two following Andrew comment
Changelog since v1:
- Cc: stable for patch 1
- removed buggy patch 3
---
David Marchand (4):
app/testpmd: add missing newline when showing statistics
app/testpmd: extend fwd statistics to 64bits
app/testpmd: remove useless casts on statistics
app/testpmd: display/clear forwarding stats on demand
app/test-pmd/cmdline.c | 44 +++
app/test-pmd/testpmd.c | 450 ++++++++++++++--------------
app/test-pmd/testpmd.h | 21 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 315 insertions(+), 236 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH v3 0/4] display testpmd forwarding engine stats on the fly
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 0/4] display testpmd forwarding engine stats on the fly David Marchand
@ 2019-03-20 10:02 ` David Marchand
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 1/4] app/testpmd: add missing newline when showing statistics David Marchand
` (4 subsequent siblings)
5 siblings, 0 replies; 109+ 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
Here is a little series that makes it possible to display and clear
testpmd fwd engines while they run without having to stop them.
This is mostly handy when running stress tests and you look for packets
drops without having to stop/start testpmd forwarding.
Example:
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 261977064 TX-packets: 261977064 TX-dropped: 0
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 261985142 TX-packets: 261985142 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 261977096 RX-dropped: 0 RX-total: 261977096
TX-packets: 261985155 TX-dropped: 0 TX-total: 261985155
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 261985188 RX-dropped: 0 RX-total: 261985188
TX-packets: 261977128 TX-dropped: 0 TX-total: 261977128
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 523962284 RX-dropped: 0 RX-total: 523962284
TX-packets: 523962283 TX-dropped: 0 TX-total: 523962283
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
David Marchand
---
Changelog since v2:
- first patch has been merged in net-next, removed from the series
- split patch (numbered 3 in v2) in two following Andrew comment
Changelog since v1:
- Cc: stable for patch 1
- removed buggy patch 3
---
David Marchand (4):
app/testpmd: add missing newline when showing statistics
app/testpmd: extend fwd statistics to 64bits
app/testpmd: remove useless casts on statistics
app/testpmd: display/clear forwarding stats on demand
app/test-pmd/cmdline.c | 44 +++
app/test-pmd/testpmd.c | 450 ++++++++++++++--------------
app/test-pmd/testpmd.h | 21 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 315 insertions(+), 236 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH v3 1/4] app/testpmd: add missing newline when showing statistics
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-20 10:02 ` David Marchand
@ 2019-03-20 10:02 ` David Marchand
2019-03-20 10:02 ` David Marchand
2019-03-20 13:49 ` Andrew Rybchenko
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
` (3 subsequent siblings)
5 siblings, 2 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v3 1/4] app/testpmd: add missing newline when showing statistics
2019-03-20 10:02 ` [dpdk-dev] [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:49 ` Andrew Rybchenko
1 sibling, 0 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-20 10:02 ` David Marchand
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 1/4] app/testpmd: add missing newline when showing statistics David Marchand
@ 2019-03-20 10:02 ` David Marchand
2019-03-20 10:02 ` David Marchand
2019-03-20 13:55 ` Andrew Rybchenko
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics David Marchand
` (2 subsequent siblings)
5 siblings, 2 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
@ 2019-03-20 10:02 ` David Marchand
2019-03-20 13:55 ` Andrew Rybchenko
1 sibling, 0 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 0/4] display testpmd forwarding engine stats on the fly David Marchand
` (2 preceding siblings ...)
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
@ 2019-03-20 10:02 ` David Marchand
2019-03-20 10:02 ` David Marchand
2019-03-20 13:58 ` Andrew Rybchenko
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 0/4] display testpmd forwarding engine stats on the fly David Marchand
5 siblings, 2 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics David Marchand
@ 2019-03-20 10:02 ` David Marchand
2019-03-20 13:58 ` Andrew Rybchenko
1 sibling, 0 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 0/4] display testpmd forwarding engine stats on the fly David Marchand
` (3 preceding siblings ...)
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics David Marchand
@ 2019-03-20 10:02 ` David Marchand
2019-03-20 10:02 ` David Marchand
` (2 more replies)
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 0/4] display testpmd forwarding engine stats on the fly David Marchand
5 siblings, 3 replies; 109+ 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
Add a new "show/clear fwd stats all" command to display fwd and port
statistics on the fly.
To be able to do so, the (testpmd only) rte_port structure can't be used
to maintain any statistics.
Moved the stats dump parts from stop_packet_forwarding() and merge with
fwd_port_stats_display() into fwd_stats_display().
fwd engine statistics are then aggregated into a local per port array.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changelog since v1:
- removed hunk from now deleted patch 3
---
app/test-pmd/cmdline.c | 44 +++
app/test-pmd/testpmd.c | 425 +++++++++++++++-------------
app/test-pmd/testpmd.h | 9 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 305 insertions(+), 209 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index db53cc0..58b11b7 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -7386,6 +7386,49 @@ struct cmd_showqueue_result {
},
};
+/* show/clear fwd engine statistics */
+struct fwd_result {
+ cmdline_fixed_string_t action;
+ cmdline_fixed_string_t fwd;
+ cmdline_fixed_string_t stats;
+ cmdline_fixed_string_t all;
+};
+
+cmdline_parse_token_string_t cmd_fwd_action =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, action, "show#clear");
+cmdline_parse_token_string_t cmd_fwd_fwd =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, fwd, "fwd");
+cmdline_parse_token_string_t cmd_fwd_stats =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, stats, "stats");
+cmdline_parse_token_string_t cmd_fwd_all =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, all, "all");
+
+static void
+cmd_fwd_parsed(void *parsed_result,
+ __rte_unused struct cmdline *cl,
+ __rte_unused void *data)
+{
+ struct fwd_result *res = parsed_result;
+
+ if (!strcmp(res->action, "show"))
+ fwd_stats_display();
+ else
+ fwd_stats_reset();
+}
+
+static cmdline_parse_inst_t cmd_fwdall = {
+ .f = cmd_fwd_parsed,
+ .data = NULL,
+ .help_str = "show|clear fwd stats all",
+ .tokens = {
+ (void *)&cmd_fwd_action,
+ (void *)&cmd_fwd_fwd,
+ (void *)&cmd_fwd_stats,
+ (void *)&cmd_fwd_all,
+ NULL,
+ },
+};
+
/* *** READ PORT REGISTER *** */
struct cmd_read_reg_result {
cmdline_fixed_string_t read;
@@ -18559,6 +18602,7 @@ struct cmd_show_tx_metadata_result {
(cmdline_parse_inst_t *)&cmd_showqueue,
(cmdline_parse_inst_t *)&cmd_showportall,
(cmdline_parse_inst_t *)&cmd_showcfg,
+ (cmdline_parse_inst_t *)&cmd_fwdall,
(cmdline_parse_inst_t *)&cmd_start,
(cmdline_parse_inst_t *)&cmd_start_tx_first,
(cmdline_parse_inst_t *)&cmd_start_tx_first_n,
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 103319f..b466217 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1361,91 +1361,6 @@ struct extmem_param {
#endif /* RTE_TEST_PMD_RECORD_BURST_STATS */
static void
-fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
-{
- struct rte_port *port;
- uint8_t i;
-
- static const char *fwd_stats_border = "----------------------";
-
- port = &ports[port_id];
- printf("\n %s Forward statistics for port %-2d %s\n",
- fwd_stats_border, port_id, fwd_stats_border);
-
- if ((!port->rx_queue_stats_mapping_enabled) && (!port->tx_queue_stats_mapping_enabled)) {
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n",
- 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",
- 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);
- }
-
- printf(" TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- 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,
- 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",
- 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);
- }
-
- printf(" TX-packets: %14"PRIu64" TX-dropped:%14"PRIu64" TX-total:"
- "%14"PRIu64"\n",
- stats->opackets, port->tx_dropped,
- stats->opackets + port->tx_dropped);
- }
-
-#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
- if (port->rx_stream)
- pkt_burst_stats_display("RX",
- &port->rx_stream->rx_burst_stats);
- if (port->tx_stream)
- pkt_burst_stats_display("TX",
- &port->tx_stream->tx_burst_stats);
-#endif
-
- if (port->rx_queue_stats_mapping_enabled) {
- printf("\n");
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d RX-packets:%14"PRIu64
- " RX-errors:%14"PRIu64
- " RX-bytes:%14"PRIu64"\n",
- i, stats->q_ipackets[i], stats->q_errors[i], stats->q_ibytes[i]);
- }
- printf("\n");
- }
- if (port->tx_queue_stats_mapping_enabled) {
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d TX-packets:%14"PRIu64
- " TX-bytes:%14"PRIu64"\n",
- i, stats->q_opackets[i], stats->q_obytes[i]);
- }
- }
-
- printf(" %s--------------------------------%s\n",
- fwd_stats_border, fwd_stats_border);
-}
-
-static void
fwd_stream_stats_display(streamid_t stream_id)
{
struct fwd_stream *fs;
@@ -1478,6 +1393,224 @@ struct extmem_param {
#endif
}
+void
+fwd_stats_display(void)
+{
+ static const char *fwd_stats_border = "----------------------";
+ static const char *acc_stats_border = "+++++++++++++++";
+ struct {
+ struct fwd_stream *rx_stream;
+ struct fwd_stream *tx_stream;
+ uint64_t tx_dropped;
+ uint64_t rx_bad_ip_csum;
+ uint64_t rx_bad_l4_csum;
+ uint64_t rx_bad_outer_l4_csum;
+ } ports_stats[RTE_MAX_ETHPORTS];
+ uint64_t total_rx_dropped = 0;
+ uint64_t total_tx_dropped = 0;
+ uint64_t total_rx_nombuf = 0;
+ struct rte_eth_stats stats;
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ uint64_t fwd_cycles = 0;
+#endif
+ uint64_t total_recv = 0;
+ uint64_t total_xmit = 0;
+ struct rte_port *port;
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ memset(ports_stats, 0, sizeof(ports_stats));
+
+ 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);
+ } else {
+ ports_stats[fs->tx_port].tx_stream = fs;
+ ports_stats[fs->rx_port].rx_stream = fs;
+ }
+
+ ports_stats[fs->tx_port].tx_dropped += fs->fwd_dropped;
+
+ ports_stats[fs->rx_port].rx_bad_ip_csum += fs->rx_bad_ip_csum;
+ ports_stats[fs->rx_port].rx_bad_l4_csum += fs->rx_bad_l4_csum;
+ ports_stats[fs->rx_port].rx_bad_outer_l4_csum +=
+ fs->rx_bad_outer_l4_csum;
+
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fwd_cycles += fs->core_cycles;
+#endif
+ }
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ uint8_t j;
+
+ pt_id = fwd_ports_ids[i];
+ port = &ports[pt_id];
+
+ rte_eth_stats_get(pt_id, &stats);
+ stats.ipackets -= port->stats.ipackets;
+ stats.opackets -= port->stats.opackets;
+ stats.ibytes -= port->stats.ibytes;
+ stats.obytes -= port->stats.obytes;
+ stats.imissed -= port->stats.imissed;
+ stats.oerrors -= port->stats.oerrors;
+ stats.rx_nombuf -= port->stats.rx_nombuf;
+
+ total_recv += stats.ipackets;
+ total_xmit += stats.opackets;
+ total_rx_dropped += stats.imissed;
+ total_tx_dropped += ports_stats[pt_id].tx_dropped;
+ total_tx_dropped += stats.oerrors;
+ total_rx_nombuf += stats.rx_nombuf;
+
+ printf("\n %s Forward statistics for port %-2d %s\n",
+ fwd_stats_border, pt_id, fwd_stats_border);
+
+ if (!port->rx_queue_stats_mapping_enabled &&
+ !port->tx_queue_stats_mapping_enabled) {
+ printf(" RX-packets: %-14"PRIu64
+ " RX-dropped: %-14"PRIu64
+ "RX-total: %-"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %-14"PRIu64
+ " TX-dropped: %-14"PRIu64
+ "TX-total: %-"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ } else {
+ printf(" RX-packets: %14"PRIu64
+ " RX-dropped:%14"PRIu64
+ " RX-total:%14"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %14"PRIu64
+ " TX-dropped:%14"PRIu64
+ " TX-total:%14"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ }
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ if (ports_stats[pt_id].rx_stream)
+ pkt_burst_stats_display("RX",
+ &ports_stats[pt_id].rx_stream->rx_burst_stats);
+ if (ports_stats[pt_id].tx_stream)
+ pkt_burst_stats_display("TX",
+ &ports_stats[pt_id].tx_stream->tx_burst_stats);
+#endif
+
+ if (port->rx_queue_stats_mapping_enabled) {
+ printf("\n");
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d RX-packets:%14"PRIu64
+ " RX-errors:%14"PRIu64
+ " RX-bytes:%14"PRIu64"\n",
+ j, stats.q_ipackets[j],
+ stats.q_errors[j], stats.q_ibytes[j]);
+ }
+ printf("\n");
+ }
+ if (port->tx_queue_stats_mapping_enabled) {
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d TX-packets:%14"PRIu64
+ " TX-bytes:%14"
+ PRIu64"\n",
+ j, stats.q_opackets[j],
+ stats.q_obytes[j]);
+ }
+ }
+
+ printf(" %s--------------------------------%s\n",
+ fwd_stats_border, fwd_stats_border);
+ }
+
+ printf("\n %s Accumulated forward statistics for all ports"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+ printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
+ "%-"PRIu64"\n"
+ " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
+ "%-"PRIu64"\n",
+ total_recv, total_rx_dropped, total_recv + total_rx_dropped,
+ total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
+ if (total_rx_nombuf > 0)
+ printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
+ printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ if (total_recv > 0)
+ printf("\n CPU cycles/packet=%u (total cycles="
+ "%"PRIu64" / total RX packets=%"PRIu64")\n",
+ (unsigned int)(fwd_cycles / total_recv),
+ fwd_cycles, total_recv);
+#endif
+}
+
+void
+fwd_stats_reset(void)
+{
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ pt_id = fwd_ports_ids[i];
+ rte_eth_stats_get(pt_id, &ports[pt_id].stats);
+ }
+ for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
+ struct fwd_stream *fs = fwd_streams[sm_id];
+
+ fs->rx_packets = 0;
+ fs->tx_packets = 0;
+ fs->fwd_dropped = 0;
+ fs->rx_bad_ip_csum = 0;
+ fs->rx_bad_l4_csum = 0;
+ fs->rx_bad_outer_l4_csum = 0;
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ memset(&fs->rx_burst_stats, 0, sizeof(fs->rx_burst_stats));
+ memset(&fs->tx_burst_stats, 0, sizeof(fs->tx_burst_stats));
+#endif
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fs->core_cycles = 0;
+#endif
+ }
+}
+
static void
flush_fwd_rx_queues(void)
{
@@ -1633,7 +1766,6 @@ struct extmem_param {
struct rte_port *port;
unsigned int i;
portid_t pt_id;
- streamid_t sm_id;
if (strcmp(cur_fwd_eng->fwd_mode_name, "rxonly") == 0 && !nb_rxq)
rte_exit(EXIT_FAILURE, "rxq are 0, cannot use rxonly fwd mode\n");
@@ -1684,32 +1816,12 @@ struct extmem_param {
pkt_fwd_config_display(&cur_fwd_config);
rxtx_config_display();
+ fwd_stats_reset();
for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
pt_id = fwd_ports_ids[i];
port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &port->stats);
- port->tx_dropped = 0;
-
map_port_queue_stats_mapping_registers(pt_id, port);
}
- for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
- fwd_streams[sm_id]->rx_packets = 0;
- fwd_streams[sm_id]->tx_packets = 0;
- 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,
- sizeof(fwd_streams[sm_id]->rx_burst_stats));
- memset(&fwd_streams[sm_id]->tx_burst_stats, 0,
- sizeof(fwd_streams[sm_id]->tx_burst_stats));
-#endif
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- fwd_streams[sm_id]->core_cycles = 0;
-#endif
- }
if (with_tx_first) {
port_fwd_begin = tx_only_engine.port_fwd_begin;
if (port_fwd_begin != NULL) {
@@ -1733,23 +1845,10 @@ struct extmem_param {
void
stop_packet_forwarding(void)
{
- struct rte_eth_stats stats;
- struct rte_port *port;
- port_fwd_end_t port_fwd_end;
+ port_fwd_end_t port_fwd_end;
+ lcoreid_t lc_id;
+ portid_t pt_id;
int i;
- portid_t pt_id;
- streamid_t sm_id;
- lcoreid_t lc_id;
- uint64_t total_recv;
- uint64_t total_xmit;
- uint64_t total_rx_dropped;
- uint64_t total_tx_dropped;
- uint64_t total_rx_nombuf;
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- uint64_t fwd_cycles;
-#endif
-
- static const char *acc_stats_border = "+++++++++++++++";
if (test_done) {
printf("Packet forwarding not started\n");
@@ -1767,87 +1866,9 @@ struct extmem_param {
(*port_fwd_end)(pt_id);
}
}
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- 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[fs->tx_port].tx_stream = NULL;
- ports[fs->rx_port].rx_stream = NULL;
- } else {
- 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 +
- fwd_streams[sm_id]->core_cycles);
-#endif
- }
- total_recv = 0;
- total_xmit = 0;
- total_rx_dropped = 0;
- total_tx_dropped = 0;
- total_rx_nombuf = 0;
- for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
- pt_id = fwd_ports_ids[i];
-
- port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &stats);
- stats.ipackets -= port->stats.ipackets;
- port->stats.ipackets = 0;
- stats.opackets -= port->stats.opackets;
- port->stats.opackets = 0;
- stats.ibytes -= port->stats.ibytes;
- port->stats.ibytes = 0;
- stats.obytes -= port->stats.obytes;
- port->stats.obytes = 0;
- stats.imissed -= port->stats.imissed;
- port->stats.imissed = 0;
- stats.oerrors -= port->stats.oerrors;
- port->stats.oerrors = 0;
- stats.rx_nombuf -= port->stats.rx_nombuf;
- port->stats.rx_nombuf = 0;
-
- total_recv += stats.ipackets;
- total_xmit += stats.opackets;
- total_rx_dropped += stats.imissed;
- total_tx_dropped += port->tx_dropped;
- total_rx_nombuf += stats.rx_nombuf;
- fwd_port_stats_display(pt_id, &stats);
- }
+ fwd_stats_display();
- printf("\n %s Accumulated forward statistics for all ports"
- "%s\n",
- acc_stats_border, acc_stats_border);
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n"
- " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- total_recv, total_rx_dropped, total_recv + total_rx_dropped,
- total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
- if (total_rx_nombuf > 0)
- printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
- printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
- "%s\n",
- acc_stats_border, acc_stats_border);
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- if (total_recv > 0)
- printf("\n CPU cycles/packet=%u (total cycles="
- "%"PRIu64" / total RX packets=%"PRIu64")\n",
- (unsigned int)(fwd_cycles / total_recv),
- fwd_cycles, total_recv);
-#endif
printf("\nDone.\n");
test_done = 1;
}
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 4f4a48f..f43b1a7 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -164,19 +164,12 @@ struct rte_port {
struct rte_eth_conf dev_conf; /**< Port configuration. */
struct ether_addr eth_addr; /**< Port ethernet address */
struct rte_eth_stats stats; /**< Last port statistics */
- uint64_t tx_dropped; /**< If no descriptor in TX ring */
- struct fwd_stream *rx_stream; /**< Port RX stream, if unique */
- struct fwd_stream *tx_stream; /**< Port TX stream, if unique */
unsigned int socket_id; /**< For NUMA support */
uint16_t parse_tunnel:1; /**< Parse internal headers */
uint16_t tso_segsz; /**< Segmentation offload MSS for non-tunneled packets. */
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 */
- 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 */
@@ -767,6 +760,8 @@ void vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type,
char *list_pkt_forwarding_retry_modes(void);
void set_pkt_forwarding_mode(const char *fwd_mode);
void start_packet_forwarding(int with_tx_first);
+void fwd_stats_display(void);
+void fwd_stats_reset(void);
void stop_packet_forwarding(void);
void dev_set_link_up(portid_t pid);
void dev_set_link_down(portid_t pid);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 1a12da4..06c8b2a 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -336,6 +336,42 @@ Example::
Set rxonly packet forwarding mode
+show fwd
+~~~~~~~~
+
+When running, forwarding engines maintain statistics from the time they have been started.
+Example for the io forwarding engine, with some packet drops on the tx side::
+
+ testpmd> show fwd stats all
+
+ ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
+ RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
+
+ ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
+ RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
+
+ ---------------------- Forward statistics for port 0 ----------------------
+ RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
+ TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
+ ----------------------------------------------------------------------------
+
+ ---------------------- Forward statistics for port 1 ----------------------
+ RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
+ TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
+ ----------------------------------------------------------------------------
+
+ +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
+ RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
+ TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+clear fwd
+~~~~~~~~~
+
+Clear the forwarding engines statistics::
+
+ testpmd> clear fwd stats all
+
read rxd
~~~~~~~~
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
@ 2019-03-20 10:02 ` David Marchand
2019-03-20 12:25 ` Ferruh Yigit
2019-03-21 18:50 ` Ferruh Yigit
2 siblings, 0 replies; 109+ 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
Add a new "show/clear fwd stats all" command to display fwd and port
statistics on the fly.
To be able to do so, the (testpmd only) rte_port structure can't be used
to maintain any statistics.
Moved the stats dump parts from stop_packet_forwarding() and merge with
fwd_port_stats_display() into fwd_stats_display().
fwd engine statistics are then aggregated into a local per port array.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changelog since v1:
- removed hunk from now deleted patch 3
---
app/test-pmd/cmdline.c | 44 +++
app/test-pmd/testpmd.c | 425 +++++++++++++++-------------
app/test-pmd/testpmd.h | 9 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 305 insertions(+), 209 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index db53cc0..58b11b7 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -7386,6 +7386,49 @@ struct cmd_showqueue_result {
},
};
+/* show/clear fwd engine statistics */
+struct fwd_result {
+ cmdline_fixed_string_t action;
+ cmdline_fixed_string_t fwd;
+ cmdline_fixed_string_t stats;
+ cmdline_fixed_string_t all;
+};
+
+cmdline_parse_token_string_t cmd_fwd_action =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, action, "show#clear");
+cmdline_parse_token_string_t cmd_fwd_fwd =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, fwd, "fwd");
+cmdline_parse_token_string_t cmd_fwd_stats =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, stats, "stats");
+cmdline_parse_token_string_t cmd_fwd_all =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, all, "all");
+
+static void
+cmd_fwd_parsed(void *parsed_result,
+ __rte_unused struct cmdline *cl,
+ __rte_unused void *data)
+{
+ struct fwd_result *res = parsed_result;
+
+ if (!strcmp(res->action, "show"))
+ fwd_stats_display();
+ else
+ fwd_stats_reset();
+}
+
+static cmdline_parse_inst_t cmd_fwdall = {
+ .f = cmd_fwd_parsed,
+ .data = NULL,
+ .help_str = "show|clear fwd stats all",
+ .tokens = {
+ (void *)&cmd_fwd_action,
+ (void *)&cmd_fwd_fwd,
+ (void *)&cmd_fwd_stats,
+ (void *)&cmd_fwd_all,
+ NULL,
+ },
+};
+
/* *** READ PORT REGISTER *** */
struct cmd_read_reg_result {
cmdline_fixed_string_t read;
@@ -18559,6 +18602,7 @@ struct cmd_show_tx_metadata_result {
(cmdline_parse_inst_t *)&cmd_showqueue,
(cmdline_parse_inst_t *)&cmd_showportall,
(cmdline_parse_inst_t *)&cmd_showcfg,
+ (cmdline_parse_inst_t *)&cmd_fwdall,
(cmdline_parse_inst_t *)&cmd_start,
(cmdline_parse_inst_t *)&cmd_start_tx_first,
(cmdline_parse_inst_t *)&cmd_start_tx_first_n,
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 103319f..b466217 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1361,91 +1361,6 @@ struct extmem_param {
#endif /* RTE_TEST_PMD_RECORD_BURST_STATS */
static void
-fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
-{
- struct rte_port *port;
- uint8_t i;
-
- static const char *fwd_stats_border = "----------------------";
-
- port = &ports[port_id];
- printf("\n %s Forward statistics for port %-2d %s\n",
- fwd_stats_border, port_id, fwd_stats_border);
-
- if ((!port->rx_queue_stats_mapping_enabled) && (!port->tx_queue_stats_mapping_enabled)) {
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n",
- 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",
- 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);
- }
-
- printf(" TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- 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,
- 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",
- 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);
- }
-
- printf(" TX-packets: %14"PRIu64" TX-dropped:%14"PRIu64" TX-total:"
- "%14"PRIu64"\n",
- stats->opackets, port->tx_dropped,
- stats->opackets + port->tx_dropped);
- }
-
-#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
- if (port->rx_stream)
- pkt_burst_stats_display("RX",
- &port->rx_stream->rx_burst_stats);
- if (port->tx_stream)
- pkt_burst_stats_display("TX",
- &port->tx_stream->tx_burst_stats);
-#endif
-
- if (port->rx_queue_stats_mapping_enabled) {
- printf("\n");
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d RX-packets:%14"PRIu64
- " RX-errors:%14"PRIu64
- " RX-bytes:%14"PRIu64"\n",
- i, stats->q_ipackets[i], stats->q_errors[i], stats->q_ibytes[i]);
- }
- printf("\n");
- }
- if (port->tx_queue_stats_mapping_enabled) {
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d TX-packets:%14"PRIu64
- " TX-bytes:%14"PRIu64"\n",
- i, stats->q_opackets[i], stats->q_obytes[i]);
- }
- }
-
- printf(" %s--------------------------------%s\n",
- fwd_stats_border, fwd_stats_border);
-}
-
-static void
fwd_stream_stats_display(streamid_t stream_id)
{
struct fwd_stream *fs;
@@ -1478,6 +1393,224 @@ struct extmem_param {
#endif
}
+void
+fwd_stats_display(void)
+{
+ static const char *fwd_stats_border = "----------------------";
+ static const char *acc_stats_border = "+++++++++++++++";
+ struct {
+ struct fwd_stream *rx_stream;
+ struct fwd_stream *tx_stream;
+ uint64_t tx_dropped;
+ uint64_t rx_bad_ip_csum;
+ uint64_t rx_bad_l4_csum;
+ uint64_t rx_bad_outer_l4_csum;
+ } ports_stats[RTE_MAX_ETHPORTS];
+ uint64_t total_rx_dropped = 0;
+ uint64_t total_tx_dropped = 0;
+ uint64_t total_rx_nombuf = 0;
+ struct rte_eth_stats stats;
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ uint64_t fwd_cycles = 0;
+#endif
+ uint64_t total_recv = 0;
+ uint64_t total_xmit = 0;
+ struct rte_port *port;
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ memset(ports_stats, 0, sizeof(ports_stats));
+
+ 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);
+ } else {
+ ports_stats[fs->tx_port].tx_stream = fs;
+ ports_stats[fs->rx_port].rx_stream = fs;
+ }
+
+ ports_stats[fs->tx_port].tx_dropped += fs->fwd_dropped;
+
+ ports_stats[fs->rx_port].rx_bad_ip_csum += fs->rx_bad_ip_csum;
+ ports_stats[fs->rx_port].rx_bad_l4_csum += fs->rx_bad_l4_csum;
+ ports_stats[fs->rx_port].rx_bad_outer_l4_csum +=
+ fs->rx_bad_outer_l4_csum;
+
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fwd_cycles += fs->core_cycles;
+#endif
+ }
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ uint8_t j;
+
+ pt_id = fwd_ports_ids[i];
+ port = &ports[pt_id];
+
+ rte_eth_stats_get(pt_id, &stats);
+ stats.ipackets -= port->stats.ipackets;
+ stats.opackets -= port->stats.opackets;
+ stats.ibytes -= port->stats.ibytes;
+ stats.obytes -= port->stats.obytes;
+ stats.imissed -= port->stats.imissed;
+ stats.oerrors -= port->stats.oerrors;
+ stats.rx_nombuf -= port->stats.rx_nombuf;
+
+ total_recv += stats.ipackets;
+ total_xmit += stats.opackets;
+ total_rx_dropped += stats.imissed;
+ total_tx_dropped += ports_stats[pt_id].tx_dropped;
+ total_tx_dropped += stats.oerrors;
+ total_rx_nombuf += stats.rx_nombuf;
+
+ printf("\n %s Forward statistics for port %-2d %s\n",
+ fwd_stats_border, pt_id, fwd_stats_border);
+
+ if (!port->rx_queue_stats_mapping_enabled &&
+ !port->tx_queue_stats_mapping_enabled) {
+ printf(" RX-packets: %-14"PRIu64
+ " RX-dropped: %-14"PRIu64
+ "RX-total: %-"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %-14"PRIu64
+ " TX-dropped: %-14"PRIu64
+ "TX-total: %-"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ } else {
+ printf(" RX-packets: %14"PRIu64
+ " RX-dropped:%14"PRIu64
+ " RX-total:%14"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %14"PRIu64
+ " TX-dropped:%14"PRIu64
+ " TX-total:%14"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ }
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ if (ports_stats[pt_id].rx_stream)
+ pkt_burst_stats_display("RX",
+ &ports_stats[pt_id].rx_stream->rx_burst_stats);
+ if (ports_stats[pt_id].tx_stream)
+ pkt_burst_stats_display("TX",
+ &ports_stats[pt_id].tx_stream->tx_burst_stats);
+#endif
+
+ if (port->rx_queue_stats_mapping_enabled) {
+ printf("\n");
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d RX-packets:%14"PRIu64
+ " RX-errors:%14"PRIu64
+ " RX-bytes:%14"PRIu64"\n",
+ j, stats.q_ipackets[j],
+ stats.q_errors[j], stats.q_ibytes[j]);
+ }
+ printf("\n");
+ }
+ if (port->tx_queue_stats_mapping_enabled) {
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d TX-packets:%14"PRIu64
+ " TX-bytes:%14"
+ PRIu64"\n",
+ j, stats.q_opackets[j],
+ stats.q_obytes[j]);
+ }
+ }
+
+ printf(" %s--------------------------------%s\n",
+ fwd_stats_border, fwd_stats_border);
+ }
+
+ printf("\n %s Accumulated forward statistics for all ports"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+ printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
+ "%-"PRIu64"\n"
+ " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
+ "%-"PRIu64"\n",
+ total_recv, total_rx_dropped, total_recv + total_rx_dropped,
+ total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
+ if (total_rx_nombuf > 0)
+ printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
+ printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ if (total_recv > 0)
+ printf("\n CPU cycles/packet=%u (total cycles="
+ "%"PRIu64" / total RX packets=%"PRIu64")\n",
+ (unsigned int)(fwd_cycles / total_recv),
+ fwd_cycles, total_recv);
+#endif
+}
+
+void
+fwd_stats_reset(void)
+{
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ pt_id = fwd_ports_ids[i];
+ rte_eth_stats_get(pt_id, &ports[pt_id].stats);
+ }
+ for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
+ struct fwd_stream *fs = fwd_streams[sm_id];
+
+ fs->rx_packets = 0;
+ fs->tx_packets = 0;
+ fs->fwd_dropped = 0;
+ fs->rx_bad_ip_csum = 0;
+ fs->rx_bad_l4_csum = 0;
+ fs->rx_bad_outer_l4_csum = 0;
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ memset(&fs->rx_burst_stats, 0, sizeof(fs->rx_burst_stats));
+ memset(&fs->tx_burst_stats, 0, sizeof(fs->tx_burst_stats));
+#endif
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fs->core_cycles = 0;
+#endif
+ }
+}
+
static void
flush_fwd_rx_queues(void)
{
@@ -1633,7 +1766,6 @@ struct extmem_param {
struct rte_port *port;
unsigned int i;
portid_t pt_id;
- streamid_t sm_id;
if (strcmp(cur_fwd_eng->fwd_mode_name, "rxonly") == 0 && !nb_rxq)
rte_exit(EXIT_FAILURE, "rxq are 0, cannot use rxonly fwd mode\n");
@@ -1684,32 +1816,12 @@ struct extmem_param {
pkt_fwd_config_display(&cur_fwd_config);
rxtx_config_display();
+ fwd_stats_reset();
for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
pt_id = fwd_ports_ids[i];
port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &port->stats);
- port->tx_dropped = 0;
-
map_port_queue_stats_mapping_registers(pt_id, port);
}
- for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
- fwd_streams[sm_id]->rx_packets = 0;
- fwd_streams[sm_id]->tx_packets = 0;
- 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,
- sizeof(fwd_streams[sm_id]->rx_burst_stats));
- memset(&fwd_streams[sm_id]->tx_burst_stats, 0,
- sizeof(fwd_streams[sm_id]->tx_burst_stats));
-#endif
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- fwd_streams[sm_id]->core_cycles = 0;
-#endif
- }
if (with_tx_first) {
port_fwd_begin = tx_only_engine.port_fwd_begin;
if (port_fwd_begin != NULL) {
@@ -1733,23 +1845,10 @@ struct extmem_param {
void
stop_packet_forwarding(void)
{
- struct rte_eth_stats stats;
- struct rte_port *port;
- port_fwd_end_t port_fwd_end;
+ port_fwd_end_t port_fwd_end;
+ lcoreid_t lc_id;
+ portid_t pt_id;
int i;
- portid_t pt_id;
- streamid_t sm_id;
- lcoreid_t lc_id;
- uint64_t total_recv;
- uint64_t total_xmit;
- uint64_t total_rx_dropped;
- uint64_t total_tx_dropped;
- uint64_t total_rx_nombuf;
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- uint64_t fwd_cycles;
-#endif
-
- static const char *acc_stats_border = "+++++++++++++++";
if (test_done) {
printf("Packet forwarding not started\n");
@@ -1767,87 +1866,9 @@ struct extmem_param {
(*port_fwd_end)(pt_id);
}
}
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- 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[fs->tx_port].tx_stream = NULL;
- ports[fs->rx_port].rx_stream = NULL;
- } else {
- 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 +
- fwd_streams[sm_id]->core_cycles);
-#endif
- }
- total_recv = 0;
- total_xmit = 0;
- total_rx_dropped = 0;
- total_tx_dropped = 0;
- total_rx_nombuf = 0;
- for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
- pt_id = fwd_ports_ids[i];
-
- port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &stats);
- stats.ipackets -= port->stats.ipackets;
- port->stats.ipackets = 0;
- stats.opackets -= port->stats.opackets;
- port->stats.opackets = 0;
- stats.ibytes -= port->stats.ibytes;
- port->stats.ibytes = 0;
- stats.obytes -= port->stats.obytes;
- port->stats.obytes = 0;
- stats.imissed -= port->stats.imissed;
- port->stats.imissed = 0;
- stats.oerrors -= port->stats.oerrors;
- port->stats.oerrors = 0;
- stats.rx_nombuf -= port->stats.rx_nombuf;
- port->stats.rx_nombuf = 0;
-
- total_recv += stats.ipackets;
- total_xmit += stats.opackets;
- total_rx_dropped += stats.imissed;
- total_tx_dropped += port->tx_dropped;
- total_rx_nombuf += stats.rx_nombuf;
- fwd_port_stats_display(pt_id, &stats);
- }
+ fwd_stats_display();
- printf("\n %s Accumulated forward statistics for all ports"
- "%s\n",
- acc_stats_border, acc_stats_border);
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n"
- " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- total_recv, total_rx_dropped, total_recv + total_rx_dropped,
- total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
- if (total_rx_nombuf > 0)
- printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
- printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
- "%s\n",
- acc_stats_border, acc_stats_border);
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- if (total_recv > 0)
- printf("\n CPU cycles/packet=%u (total cycles="
- "%"PRIu64" / total RX packets=%"PRIu64")\n",
- (unsigned int)(fwd_cycles / total_recv),
- fwd_cycles, total_recv);
-#endif
printf("\nDone.\n");
test_done = 1;
}
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 4f4a48f..f43b1a7 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -164,19 +164,12 @@ struct rte_port {
struct rte_eth_conf dev_conf; /**< Port configuration. */
struct ether_addr eth_addr; /**< Port ethernet address */
struct rte_eth_stats stats; /**< Last port statistics */
- uint64_t tx_dropped; /**< If no descriptor in TX ring */
- struct fwd_stream *rx_stream; /**< Port RX stream, if unique */
- struct fwd_stream *tx_stream; /**< Port TX stream, if unique */
unsigned int socket_id; /**< For NUMA support */
uint16_t parse_tunnel:1; /**< Parse internal headers */
uint16_t tso_segsz; /**< Segmentation offload MSS for non-tunneled packets. */
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 */
- 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 */
@@ -767,6 +760,8 @@ void vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type,
char *list_pkt_forwarding_retry_modes(void);
void set_pkt_forwarding_mode(const char *fwd_mode);
void start_packet_forwarding(int with_tx_first);
+void fwd_stats_display(void);
+void fwd_stats_reset(void);
void stop_packet_forwarding(void);
void dev_set_link_up(portid_t pid);
void dev_set_link_down(portid_t pid);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 1a12da4..06c8b2a 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -336,6 +336,42 @@ Example::
Set rxonly packet forwarding mode
+show fwd
+~~~~~~~~
+
+When running, forwarding engines maintain statistics from the time they have been started.
+Example for the io forwarding engine, with some packet drops on the tx side::
+
+ testpmd> show fwd stats all
+
+ ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
+ RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
+
+ ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
+ RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
+
+ ---------------------- Forward statistics for port 0 ----------------------
+ RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
+ TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
+ ----------------------------------------------------------------------------
+
+ ---------------------- Forward statistics for port 1 ----------------------
+ RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
+ TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
+ ----------------------------------------------------------------------------
+
+ +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
+ RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
+ TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+clear fwd
+~~~~~~~~~
+
+Clear the forwarding engines statistics::
+
+ testpmd> clear fwd stats all
+
read rxd
~~~~~~~~
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-20 10:02 ` David Marchand
@ 2019-03-20 12:25 ` Ferruh Yigit
2019-03-20 12:25 ` Ferruh Yigit
2019-03-20 12:44 ` David Marchand
2019-03-21 18:50 ` Ferruh Yigit
2 siblings, 2 replies; 109+ messages in thread
From: Ferruh Yigit @ 2019-03-20 12:25 UTC (permalink / raw)
To: David Marchand, dev
Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko
On 3/20/2019 10:02 AM, David Marchand wrote:
> Add a new "show/clear fwd stats all" command to display fwd and port
> statistics on the fly.
Won't this be duplicating existing commands:
"show port stats all|<port_id>"
"clear port stats all|<port_id>"
What benefit "show/clear fwd stats all" adds against existing ones?
testpmd> show port stats all
######################## NIC statistics for port 0 ########################
RX-packets: 133257152 RX-missed: 0 RX-bytes: 0
RX-errors: 0
RX-nombuf: 0
TX-packets: 131952064 TX-errors: 0 TX-bytes: 0
Throughput (since last show)
Rx-pps: 0
Tx-pps: 0
############################################################################
######################## NIC statistics for port 1 ########################
RX-packets: 133333440 RX-missed: 0 RX-bytes: 0
RX-errors: 0
RX-nombuf: 0
TX-packets: 131952064 TX-errors: 0 TX-bytes: 0
Throughput (since last show)
Rx-pps: 0
Tx-pps: 0
############################################################################
>
> To be able to do so, the (testpmd only) rte_port structure can't be used
> to maintain any statistics.
> Moved the stats dump parts from stop_packet_forwarding() and merge with
> fwd_port_stats_display() into fwd_stats_display().
> fwd engine statistics are then aggregated into a local per port array.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> Changelog since v1:
> - removed hunk from now deleted patch 3
>
<...>
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-20 12:25 ` Ferruh Yigit
@ 2019-03-20 12:25 ` Ferruh Yigit
2019-03-20 12:44 ` David Marchand
1 sibling, 0 replies; 109+ messages in thread
From: Ferruh Yigit @ 2019-03-20 12:25 UTC (permalink / raw)
To: David Marchand, dev
Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko
On 3/20/2019 10:02 AM, David Marchand wrote:
> Add a new "show/clear fwd stats all" command to display fwd and port
> statistics on the fly.
Won't this be duplicating existing commands:
"show port stats all|<port_id>"
"clear port stats all|<port_id>"
What benefit "show/clear fwd stats all" adds against existing ones?
testpmd> show port stats all
######################## NIC statistics for port 0 ########################
RX-packets: 133257152 RX-missed: 0 RX-bytes: 0
RX-errors: 0
RX-nombuf: 0
TX-packets: 131952064 TX-errors: 0 TX-bytes: 0
Throughput (since last show)
Rx-pps: 0
Tx-pps: 0
############################################################################
######################## NIC statistics for port 1 ########################
RX-packets: 133333440 RX-missed: 0 RX-bytes: 0
RX-errors: 0
RX-nombuf: 0
TX-packets: 131952064 TX-errors: 0 TX-bytes: 0
Throughput (since last show)
Rx-pps: 0
Tx-pps: 0
############################################################################
>
> To be able to do so, the (testpmd only) rte_port structure can't be used
> to maintain any statistics.
> Moved the stats dump parts from stop_packet_forwarding() and merge with
> fwd_port_stats_display() into fwd_stats_display().
> fwd engine statistics are then aggregated into a local per port array.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> Changelog since v1:
> - removed hunk from now deleted patch 3
>
<...>
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-20 12:25 ` Ferruh Yigit
2019-03-20 12:25 ` Ferruh Yigit
@ 2019-03-20 12:44 ` David Marchand
2019-03-20 12:44 ` David Marchand
2019-03-20 13:29 ` Ferruh Yigit
1 sibling, 2 replies; 109+ messages in thread
From: David Marchand @ 2019-03-20 12:44 UTC (permalink / raw)
To: Ferruh Yigit
Cc: dev, Wenzhuo Lu, Jingjing Wu, Iremonger, Bernard, Rami Rosen,
Andrew Rybchenko
On Wed, Mar 20, 2019 at 1:25 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> On 3/20/2019 10:02 AM, David Marchand wrote:
> > Add a new "show/clear fwd stats all" command to display fwd and port
> > statistics on the fly.
>
> Won't this be duplicating existing commands:
> "show port stats all|<port_id>"
> "clear port stats all|<port_id>"
>
> What benefit "show/clear fwd stats all" adds against existing ones?
>
Forwarding engines like "iofwd" maintain software statistics like
"fwd_dropped" which gives you how much of the packets to be transmitted
could not make it to the "wire".
"show port stats" won't give you those stats.
You could stop/start the forwarding to get them, but when debugging you
most likely do not want to stop the forwarding.
I have been using this while tracking drops in a PVP setup.
--
David Marchand
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-20 12:44 ` David Marchand
@ 2019-03-20 12:44 ` David Marchand
2019-03-20 13:29 ` Ferruh Yigit
1 sibling, 0 replies; 109+ messages in thread
From: David Marchand @ 2019-03-20 12:44 UTC (permalink / raw)
To: Ferruh Yigit
Cc: dev, Wenzhuo Lu, Jingjing Wu, Iremonger, Bernard, Rami Rosen,
Andrew Rybchenko
On Wed, Mar 20, 2019 at 1:25 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> On 3/20/2019 10:02 AM, David Marchand wrote:
> > Add a new "show/clear fwd stats all" command to display fwd and port
> > statistics on the fly.
>
> Won't this be duplicating existing commands:
> "show port stats all|<port_id>"
> "clear port stats all|<port_id>"
>
> What benefit "show/clear fwd stats all" adds against existing ones?
>
Forwarding engines like "iofwd" maintain software statistics like
"fwd_dropped" which gives you how much of the packets to be transmitted
could not make it to the "wire".
"show port stats" won't give you those stats.
You could stop/start the forwarding to get them, but when debugging you
most likely do not want to stop the forwarding.
I have been using this while tracking drops in a PVP setup.
--
David Marchand
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-20 12:44 ` David Marchand
2019-03-20 12:44 ` David Marchand
@ 2019-03-20 13:29 ` Ferruh Yigit
2019-03-20 13:29 ` Ferruh Yigit
1 sibling, 1 reply; 109+ messages in thread
From: Ferruh Yigit @ 2019-03-20 13:29 UTC (permalink / raw)
To: David Marchand
Cc: dev, Wenzhuo Lu, Jingjing Wu, Iremonger, Bernard, Rami Rosen,
Andrew Rybchenko
On 3/20/2019 12:44 PM, David Marchand wrote:
> On Wed, Mar 20, 2019 at 1:25 PM Ferruh Yigit <ferruh.yigit@intel.com
> <mailto:ferruh.yigit@intel.com>> wrote:
>
> On 3/20/2019 10:02 AM, David Marchand wrote:
> > Add a new "show/clear fwd stats all" command to display fwd and port
> > statistics on the fly.
>
> Won't this be duplicating existing commands:
> "show port stats all|<port_id>"
> "clear port stats all|<port_id>"
>
> What benefit "show/clear fwd stats all" adds against existing ones?
>
>
> Forwarding engines like "iofwd" maintain software statistics like "fwd_dropped"
> which gives you how much of the packets to be transmitted could not make it to
> the "wire".
> "show port stats" won't give you those stats.
>
> You could stop/start the forwarding to get them, but when debugging you most
> likely do not want to stop the forwarding.
> I have been using this while tracking drops in a PVP setup.
I see, they are slightly different, no objection from me.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-20 13:29 ` Ferruh Yigit
@ 2019-03-20 13:29 ` Ferruh Yigit
0 siblings, 0 replies; 109+ messages in thread
From: Ferruh Yigit @ 2019-03-20 13:29 UTC (permalink / raw)
To: David Marchand
Cc: dev, Wenzhuo Lu, Jingjing Wu, Iremonger, Bernard, Rami Rosen,
Andrew Rybchenko
On 3/20/2019 12:44 PM, David Marchand wrote:
> On Wed, Mar 20, 2019 at 1:25 PM Ferruh Yigit <ferruh.yigit@intel.com
> <mailto:ferruh.yigit@intel.com>> wrote:
>
> On 3/20/2019 10:02 AM, David Marchand wrote:
> > Add a new "show/clear fwd stats all" command to display fwd and port
> > statistics on the fly.
>
> Won't this be duplicating existing commands:
> "show port stats all|<port_id>"
> "clear port stats all|<port_id>"
>
> What benefit "show/clear fwd stats all" adds against existing ones?
>
>
> Forwarding engines like "iofwd" maintain software statistics like "fwd_dropped"
> which gives you how much of the packets to be transmitted could not make it to
> the "wire".
> "show port stats" won't give you those stats.
>
> You could stop/start the forwarding to get them, but when debugging you most
> likely do not want to stop the forwarding.
> I have been using this while tracking drops in a PVP setup.
I see, they are slightly different, no objection from me.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] app/testpmd: add missing newline when showing statistics
2019-03-20 10:02 ` [dpdk-dev] [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:49 ` Andrew Rybchenko
2019-03-20 13:49 ` Andrew Rybchenko
1 sibling, 1 reply; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] app/testpmd: add missing newline when showing statistics
2019-03-20 13:49 ` Andrew Rybchenko
@ 2019-03-20 13:49 ` Andrew Rybchenko
0 siblings, 0 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
2019-03-20 10:02 ` David Marchand
@ 2019-03-20 13:55 ` Andrew Rybchenko
2019-03-20 13:55 ` Andrew Rybchenko
1 sibling, 1 reply; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits
2019-03-20 13:55 ` Andrew Rybchenko
@ 2019-03-20 13:55 ` Andrew Rybchenko
0 siblings, 0 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics David Marchand
2019-03-20 10:02 ` David Marchand
@ 2019-03-20 13:58 ` Andrew Rybchenko
2019-03-20 13:58 ` Andrew Rybchenko
1 sibling, 1 reply; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics
2019-03-20 13:58 ` Andrew Rybchenko
@ 2019-03-20 13:58 ` Andrew Rybchenko
0 siblings, 0 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-20 10:02 ` David Marchand
2019-03-20 12:25 ` Ferruh Yigit
@ 2019-03-21 18:50 ` Ferruh Yigit
2019-03-21 18:50 ` Ferruh Yigit
2019-03-21 20:34 ` David Marchand
2 siblings, 2 replies; 109+ messages in thread
From: Ferruh Yigit @ 2019-03-21 18:50 UTC (permalink / raw)
To: David Marchand, dev
Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko
On 3/20/2019 10:02 AM, David Marchand wrote:
> Add a new "show/clear fwd stats all" command to display fwd and port
> statistics on the fly.
>
> To be able to do so, the (testpmd only) rte_port structure can't be used
> to maintain any statistics.
> Moved the stats dump parts from stop_packet_forwarding() and merge with
> fwd_port_stats_display() into fwd_stats_display().
> fwd engine statistics are then aggregated into a local per port array.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
<...>
> +/* show/clear fwd engine statistics */
> +struct fwd_result {
> + cmdline_fixed_string_t action;
> + cmdline_fixed_string_t fwd;
> + cmdline_fixed_string_t stats;
> + cmdline_fixed_string_t all;
> +};
> +
> +cmdline_parse_token_string_t cmd_fwd_action =
> + TOKEN_STRING_INITIALIZER(struct fwd_result, action, "show#clear");
> +cmdline_parse_token_string_t cmd_fwd_fwd =
> + TOKEN_STRING_INITIALIZER(struct fwd_result, fwd, "fwd");
> +cmdline_parse_token_string_t cmd_fwd_stats =
> + TOKEN_STRING_INITIALIZER(struct fwd_result, stats, "stats");
> +cmdline_parse_token_string_t cmd_fwd_all =
> + TOKEN_STRING_INITIALIZER(struct fwd_result, all, "all");
Do we need "all"?
Normally we have it when there is selection between specific <port_id> or all,
here only option is all.
> +
> +static void
> +cmd_fwd_parsed(void *parsed_result,
> + __rte_unused struct cmdline *cl,
> + __rte_unused void *data)
> +{
> + struct fwd_result *res = parsed_result;
> +
> + if (!strcmp(res->action, "show"))
> + fwd_stats_display();
> + else
> + fwd_stats_reset();
> +}
> +
> +static cmdline_parse_inst_t cmd_fwdall = {
> + .f = cmd_fwd_parsed,
> + .data = NULL,
> + .help_str = "show|clear fwd stats all",
> + .tokens = {
> + (void *)&cmd_fwd_action,
> + (void *)&cmd_fwd_fwd,
> + (void *)&cmd_fwd_stats,
> + (void *)&cmd_fwd_all,
> + NULL,
> + },
> +};
in 'app/test-pmd/cmdline.c', there is 'cmd_help_long_parsed()' function to
display the help output, can you please add new command information there too?
> +
> /* *** READ PORT REGISTER *** */
> struct cmd_read_reg_result {
> cmdline_fixed_string_t read;
> @@ -18559,6 +18602,7 @@ struct cmd_show_tx_metadata_result {
> (cmdline_parse_inst_t *)&cmd_showqueue,
> (cmdline_parse_inst_t *)&cmd_showportall,
> (cmdline_parse_inst_t *)&cmd_showcfg,
> + (cmdline_parse_inst_t *)&cmd_fwdall,
command name looks misleading 'fwdall', it feels like it is something doing
forwarding more than display, what about following same syntax with above
'cmd_showportall', so 'cmd_showfwdall' or 'cmd_showfwd' based on your answer to
drop "all"?
<...>
> +#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
> + fwd_cycles += fs->core_cycles;
> +#endif
Ahh, it seems I missed this config option, looks useful :)
I wonder if it is documented anywhere.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-21 18:50 ` Ferruh Yigit
@ 2019-03-21 18:50 ` Ferruh Yigit
2019-03-21 20:34 ` David Marchand
1 sibling, 0 replies; 109+ messages in thread
From: Ferruh Yigit @ 2019-03-21 18:50 UTC (permalink / raw)
To: David Marchand, dev
Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko
On 3/20/2019 10:02 AM, David Marchand wrote:
> Add a new "show/clear fwd stats all" command to display fwd and port
> statistics on the fly.
>
> To be able to do so, the (testpmd only) rte_port structure can't be used
> to maintain any statistics.
> Moved the stats dump parts from stop_packet_forwarding() and merge with
> fwd_port_stats_display() into fwd_stats_display().
> fwd engine statistics are then aggregated into a local per port array.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
<...>
> +/* show/clear fwd engine statistics */
> +struct fwd_result {
> + cmdline_fixed_string_t action;
> + cmdline_fixed_string_t fwd;
> + cmdline_fixed_string_t stats;
> + cmdline_fixed_string_t all;
> +};
> +
> +cmdline_parse_token_string_t cmd_fwd_action =
> + TOKEN_STRING_INITIALIZER(struct fwd_result, action, "show#clear");
> +cmdline_parse_token_string_t cmd_fwd_fwd =
> + TOKEN_STRING_INITIALIZER(struct fwd_result, fwd, "fwd");
> +cmdline_parse_token_string_t cmd_fwd_stats =
> + TOKEN_STRING_INITIALIZER(struct fwd_result, stats, "stats");
> +cmdline_parse_token_string_t cmd_fwd_all =
> + TOKEN_STRING_INITIALIZER(struct fwd_result, all, "all");
Do we need "all"?
Normally we have it when there is selection between specific <port_id> or all,
here only option is all.
> +
> +static void
> +cmd_fwd_parsed(void *parsed_result,
> + __rte_unused struct cmdline *cl,
> + __rte_unused void *data)
> +{
> + struct fwd_result *res = parsed_result;
> +
> + if (!strcmp(res->action, "show"))
> + fwd_stats_display();
> + else
> + fwd_stats_reset();
> +}
> +
> +static cmdline_parse_inst_t cmd_fwdall = {
> + .f = cmd_fwd_parsed,
> + .data = NULL,
> + .help_str = "show|clear fwd stats all",
> + .tokens = {
> + (void *)&cmd_fwd_action,
> + (void *)&cmd_fwd_fwd,
> + (void *)&cmd_fwd_stats,
> + (void *)&cmd_fwd_all,
> + NULL,
> + },
> +};
in 'app/test-pmd/cmdline.c', there is 'cmd_help_long_parsed()' function to
display the help output, can you please add new command information there too?
> +
> /* *** READ PORT REGISTER *** */
> struct cmd_read_reg_result {
> cmdline_fixed_string_t read;
> @@ -18559,6 +18602,7 @@ struct cmd_show_tx_metadata_result {
> (cmdline_parse_inst_t *)&cmd_showqueue,
> (cmdline_parse_inst_t *)&cmd_showportall,
> (cmdline_parse_inst_t *)&cmd_showcfg,
> + (cmdline_parse_inst_t *)&cmd_fwdall,
command name looks misleading 'fwdall', it feels like it is something doing
forwarding more than display, what about following same syntax with above
'cmd_showportall', so 'cmd_showfwdall' or 'cmd_showfwd' based on your answer to
drop "all"?
<...>
> +#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
> + fwd_cycles += fs->core_cycles;
> +#endif
Ahh, it seems I missed this config option, looks useful :)
I wonder if it is documented anywhere.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-21 18:50 ` Ferruh Yigit
2019-03-21 18:50 ` Ferruh Yigit
@ 2019-03-21 20:34 ` David Marchand
2019-03-21 20:34 ` David Marchand
1 sibling, 1 reply; 109+ messages in thread
From: David Marchand @ 2019-03-21 20:34 UTC (permalink / raw)
To: Ferruh Yigit
Cc: dev, Wenzhuo Lu, Jingjing Wu, Iremonger, Bernard, Rami Rosen,
Andrew Rybchenko
On Thu, Mar 21, 2019 at 7:50 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> On 3/20/2019 10:02 AM, David Marchand wrote:
> > Add a new "show/clear fwd stats all" command to display fwd and port
> > statistics on the fly.
> >
> > To be able to do so, the (testpmd only) rte_port structure can't be used
> > to maintain any statistics.
> > Moved the stats dump parts from stop_packet_forwarding() and merge with
> > fwd_port_stats_display() into fwd_stats_display().
> > fwd engine statistics are then aggregated into a local per port array.
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
>
> <...>
>
> > +/* show/clear fwd engine statistics */
> > +struct fwd_result {
> > + cmdline_fixed_string_t action;
> > + cmdline_fixed_string_t fwd;
> > + cmdline_fixed_string_t stats;
> > + cmdline_fixed_string_t all;
> > +};
> > +
> > +cmdline_parse_token_string_t cmd_fwd_action =
> > + TOKEN_STRING_INITIALIZER(struct fwd_result, action, "show#clear");
> > +cmdline_parse_token_string_t cmd_fwd_fwd =
> > + TOKEN_STRING_INITIALIZER(struct fwd_result, fwd, "fwd");
> > +cmdline_parse_token_string_t cmd_fwd_stats =
> > + TOKEN_STRING_INITIALIZER(struct fwd_result, stats, "stats");
> > +cmdline_parse_token_string_t cmd_fwd_all =
> > + TOKEN_STRING_INITIALIZER(struct fwd_result, all, "all");
>
> Do we need "all"?
> Normally we have it when there is selection between specific <port_id> or
> all,
> here only option is all.
>
Well, the thing is that if we add a specific <fwd_id> later, we would have
to introduce this "all".
And since a lot of people are going to use this command, this would break
their scripts ;-)
I find it consistent with "show port stats all" as well.
> > +
> > +static void
> > +cmd_fwd_parsed(void *parsed_result,
> > + __rte_unused struct cmdline *cl,
> > + __rte_unused void *data)
> > +{
> > + struct fwd_result *res = parsed_result;
> > +
> > + if (!strcmp(res->action, "show"))
> > + fwd_stats_display();
> > + else
> > + fwd_stats_reset();
> > +}
> > +
> > +static cmdline_parse_inst_t cmd_fwdall = {
> > + .f = cmd_fwd_parsed,
> > + .data = NULL,
> > + .help_str = "show|clear fwd stats all",
> > + .tokens = {
> > + (void *)&cmd_fwd_action,
> > + (void *)&cmd_fwd_fwd,
> > + (void *)&cmd_fwd_stats,
> > + (void *)&cmd_fwd_all,
> > + NULL,
> > + },
> > +};
>
> in 'app/test-pmd/cmdline.c', there is 'cmd_help_long_parsed()' function to
> display the help output, can you please add new command information there
> too?
>
Indeed, will do.
> > +
> > /* *** READ PORT REGISTER *** */
> > struct cmd_read_reg_result {
> > cmdline_fixed_string_t read;
> > @@ -18559,6 +18602,7 @@ struct cmd_show_tx_metadata_result {
> > (cmdline_parse_inst_t *)&cmd_showqueue,
> > (cmdline_parse_inst_t *)&cmd_showportall,
> > (cmdline_parse_inst_t *)&cmd_showcfg,
> > + (cmdline_parse_inst_t *)&cmd_fwdall,
>
> command name looks misleading 'fwdall', it feels like it is something doing
> forwarding more than display, what about following same syntax with above
> 'cmd_showportall', so 'cmd_showfwdall' or 'cmd_showfwd' based on your
> answer to
> drop "all"?
>
I would go with cmd_showfwdall.
> <...>
>
> > +#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
> > + fwd_cycles += fs->core_cycles;
> > +#endif
>
> Ahh, it seems I missed this config option, looks useful :)
> I wonder if it is documented anywhere.
>
Well, it does seem quite unknown.
I am not sure of the accuracy, just tried it to check if it was really
broken or not, seems to work.
--
David Marchand
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-21 20:34 ` David Marchand
@ 2019-03-21 20:34 ` David Marchand
0 siblings, 0 replies; 109+ messages in thread
From: David Marchand @ 2019-03-21 20:34 UTC (permalink / raw)
To: Ferruh Yigit
Cc: dev, Wenzhuo Lu, Jingjing Wu, Iremonger, Bernard, Rami Rosen,
Andrew Rybchenko
On Thu, Mar 21, 2019 at 7:50 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> On 3/20/2019 10:02 AM, David Marchand wrote:
> > Add a new "show/clear fwd stats all" command to display fwd and port
> > statistics on the fly.
> >
> > To be able to do so, the (testpmd only) rte_port structure can't be used
> > to maintain any statistics.
> > Moved the stats dump parts from stop_packet_forwarding() and merge with
> > fwd_port_stats_display() into fwd_stats_display().
> > fwd engine statistics are then aggregated into a local per port array.
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
>
> <...>
>
> > +/* show/clear fwd engine statistics */
> > +struct fwd_result {
> > + cmdline_fixed_string_t action;
> > + cmdline_fixed_string_t fwd;
> > + cmdline_fixed_string_t stats;
> > + cmdline_fixed_string_t all;
> > +};
> > +
> > +cmdline_parse_token_string_t cmd_fwd_action =
> > + TOKEN_STRING_INITIALIZER(struct fwd_result, action, "show#clear");
> > +cmdline_parse_token_string_t cmd_fwd_fwd =
> > + TOKEN_STRING_INITIALIZER(struct fwd_result, fwd, "fwd");
> > +cmdline_parse_token_string_t cmd_fwd_stats =
> > + TOKEN_STRING_INITIALIZER(struct fwd_result, stats, "stats");
> > +cmdline_parse_token_string_t cmd_fwd_all =
> > + TOKEN_STRING_INITIALIZER(struct fwd_result, all, "all");
>
> Do we need "all"?
> Normally we have it when there is selection between specific <port_id> or
> all,
> here only option is all.
>
Well, the thing is that if we add a specific <fwd_id> later, we would have
to introduce this "all".
And since a lot of people are going to use this command, this would break
their scripts ;-)
I find it consistent with "show port stats all" as well.
> > +
> > +static void
> > +cmd_fwd_parsed(void *parsed_result,
> > + __rte_unused struct cmdline *cl,
> > + __rte_unused void *data)
> > +{
> > + struct fwd_result *res = parsed_result;
> > +
> > + if (!strcmp(res->action, "show"))
> > + fwd_stats_display();
> > + else
> > + fwd_stats_reset();
> > +}
> > +
> > +static cmdline_parse_inst_t cmd_fwdall = {
> > + .f = cmd_fwd_parsed,
> > + .data = NULL,
> > + .help_str = "show|clear fwd stats all",
> > + .tokens = {
> > + (void *)&cmd_fwd_action,
> > + (void *)&cmd_fwd_fwd,
> > + (void *)&cmd_fwd_stats,
> > + (void *)&cmd_fwd_all,
> > + NULL,
> > + },
> > +};
>
> in 'app/test-pmd/cmdline.c', there is 'cmd_help_long_parsed()' function to
> display the help output, can you please add new command information there
> too?
>
Indeed, will do.
> > +
> > /* *** READ PORT REGISTER *** */
> > struct cmd_read_reg_result {
> > cmdline_fixed_string_t read;
> > @@ -18559,6 +18602,7 @@ struct cmd_show_tx_metadata_result {
> > (cmdline_parse_inst_t *)&cmd_showqueue,
> > (cmdline_parse_inst_t *)&cmd_showportall,
> > (cmdline_parse_inst_t *)&cmd_showcfg,
> > + (cmdline_parse_inst_t *)&cmd_fwdall,
>
> command name looks misleading 'fwdall', it feels like it is something doing
> forwarding more than display, what about following same syntax with above
> 'cmd_showportall', so 'cmd_showfwdall' or 'cmd_showfwd' based on your
> answer to
> drop "all"?
>
I would go with cmd_showfwdall.
> <...>
>
> > +#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
> > + fwd_cycles += fs->core_cycles;
> > +#endif
>
> Ahh, it seems I missed this config option, looks useful :)
> I wonder if it is documented anywhere.
>
Well, it does seem quite unknown.
I am not sure of the accuracy, just tried it to check if it was really
broken or not, seems to work.
--
David Marchand
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH v4 0/4] display testpmd forwarding engine stats on the fly
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 0/4] display testpmd forwarding engine stats on the fly David Marchand
` (4 preceding siblings ...)
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
@ 2019-03-22 13:37 ` David Marchand
2019-03-22 13:37 ` David Marchand
` (5 more replies)
5 siblings, 6 replies; 109+ 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
Here is a little series that makes it possible to display and clear
testpmd fwd engines while they run without having to stop them.
This is mostly handy when running stress tests and you look for packets
drops without having to stop/start testpmd forwarding.
Example:
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 261977064 TX-packets: 261977064 TX-dropped: 0
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 261985142 TX-packets: 261985142 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 261977096 RX-dropped: 0 RX-total: 261977096
TX-packets: 261985155 TX-dropped: 0 TX-total: 261985155
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 261985188 RX-dropped: 0 RX-total: 261985188
TX-packets: 261977128 TX-dropped: 0 TX-total: 261977128
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 523962284 RX-dropped: 0 RX-total: 523962284
TX-packets: 523962283 TX-dropped: 0 TX-total: 523962283
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
David Marchand
---
Changelog since v3:
- updated patch 4 following Ferruh comments
Changelog since v2:
- first patch has been merged in net-next, removed from the series
- split patch (numbered 3 in v2) in two following Andrew comment
Changelog since v1:
- Cc: stable for patch 1
- removed buggy patch 3
---
David Marchand (4):
app/testpmd: add missing newline when showing statistics
app/testpmd: extend fwd statistics to 64bits
app/testpmd: remove useless casts on statistics
app/testpmd: display/clear forwarding stats on demand
app/test-pmd/cmdline.c | 49 +++
app/test-pmd/testpmd.c | 450 ++++++++++++++--------------
app/test-pmd/testpmd.h | 21 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 320 insertions(+), 236 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH v4 0/4] display testpmd forwarding engine stats on the fly
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 0/4] display testpmd forwarding engine stats on the fly David Marchand
@ 2019-03-22 13:37 ` David Marchand
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics David Marchand
` (4 subsequent siblings)
5 siblings, 0 replies; 109+ 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
Here is a little series that makes it possible to display and clear
testpmd fwd engines while they run without having to stop them.
This is mostly handy when running stress tests and you look for packets
drops without having to stop/start testpmd forwarding.
Example:
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 261977064 TX-packets: 261977064 TX-dropped: 0
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 261985142 TX-packets: 261985142 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 261977096 RX-dropped: 0 RX-total: 261977096
TX-packets: 261985155 TX-dropped: 0 TX-total: 261985155
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 261985188 RX-dropped: 0 RX-total: 261985188
TX-packets: 261977128 TX-dropped: 0 TX-total: 261977128
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 523962284 RX-dropped: 0 RX-total: 523962284
TX-packets: 523962283 TX-dropped: 0 TX-total: 523962283
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
David Marchand
---
Changelog since v3:
- updated patch 4 following Ferruh comments
Changelog since v2:
- first patch has been merged in net-next, removed from the series
- split patch (numbered 3 in v2) in two following Andrew comment
Changelog since v1:
- Cc: stable for patch 1
- removed buggy patch 3
---
David Marchand (4):
app/testpmd: add missing newline when showing statistics
app/testpmd: extend fwd statistics to 64bits
app/testpmd: remove useless casts on statistics
app/testpmd: display/clear forwarding stats on demand
app/test-pmd/cmdline.c | 49 +++
app/test-pmd/testpmd.c | 450 ++++++++++++++--------------
app/test-pmd/testpmd.h | 21 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 320 insertions(+), 236 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-22 13:37 ` David Marchand
@ 2019-03-22 13:37 ` David Marchand
2019-03-22 13:37 ` David Marchand
` (3 more replies)
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
` (3 subsequent siblings)
5 siblings, 4 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-22 13:37 ` [dpdk-dev] [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:03 ` Maxime Coquelin
` (2 subsequent siblings)
3 siblings, 0 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-22 13:37 ` David Marchand
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics David Marchand
@ 2019-03-22 13:37 ` David Marchand
2019-03-22 13:37 ` David Marchand
2019-03-22 17:06 ` Maxime Coquelin
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics David Marchand
` (2 subsequent siblings)
5 siblings, 2 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
@ 2019-03-22 13:37 ` David Marchand
2019-03-22 17:06 ` Maxime Coquelin
1 sibling, 0 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 0/4] display testpmd forwarding engine stats on the fly David Marchand
` (2 preceding siblings ...)
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
@ 2019-03-22 13:37 ` David Marchand
2019-03-22 13:37 ` David Marchand
2019-03-22 17:11 ` Maxime Coquelin
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly David Marchand
5 siblings, 2 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics David Marchand
@ 2019-03-22 13:37 ` David Marchand
2019-03-22 17:11 ` Maxime Coquelin
1 sibling, 0 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v4 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 0/4] display testpmd forwarding engine stats on the fly David Marchand
` (3 preceding siblings ...)
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics David Marchand
@ 2019-03-22 13:37 ` David Marchand
2019-03-22 13:37 ` David Marchand
2019-03-22 17:22 ` Maxime Coquelin
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly David Marchand
5 siblings, 2 replies; 109+ 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
Add a new "show/clear fwd stats all" command to display fwd and port
statistics on the fly.
To be able to do so, the (testpmd only) rte_port structure can't be used
to maintain any statistics.
Moved the stats dump parts from stop_packet_forwarding() and merge with
fwd_port_stats_display() into fwd_stats_display().
fwd engine statistics are then aggregated into a local per port array.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changelog since v3:
- added description in testpmd usage
- renamed cmd_fwdall as cmd_showfwdall
Changelog since v1:
- removed hunk from now deleted patch 3
---
app/test-pmd/cmdline.c | 49 ++++
app/test-pmd/testpmd.c | 425 +++++++++++++++-------------
app/test-pmd/testpmd.h | 9 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 310 insertions(+), 209 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 815e5e8..ee50e45 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -225,6 +225,11 @@ static void cmd_help_long_parsed(void *parsed_result,
"show port tm node stats (port_id) (node_id) (clear)\n"
" Display the port TM node stats.\n\n"
+ "show fwd stats all\n"
+ " Display statistics for all fwd engines.\n\n"
+
+ "clear fwd stats all\n"
+ " Clear statistics for all fwd engines.\n\n"
);
}
@@ -7386,6 +7391,49 @@ struct cmd_showqueue_result {
},
};
+/* show/clear fwd engine statistics */
+struct fwd_result {
+ cmdline_fixed_string_t action;
+ cmdline_fixed_string_t fwd;
+ cmdline_fixed_string_t stats;
+ cmdline_fixed_string_t all;
+};
+
+cmdline_parse_token_string_t cmd_fwd_action =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, action, "show#clear");
+cmdline_parse_token_string_t cmd_fwd_fwd =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, fwd, "fwd");
+cmdline_parse_token_string_t cmd_fwd_stats =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, stats, "stats");
+cmdline_parse_token_string_t cmd_fwd_all =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, all, "all");
+
+static void
+cmd_showfwdall_parsed(void *parsed_result,
+ __rte_unused struct cmdline *cl,
+ __rte_unused void *data)
+{
+ struct fwd_result *res = parsed_result;
+
+ if (!strcmp(res->action, "show"))
+ fwd_stats_display();
+ else
+ fwd_stats_reset();
+}
+
+static cmdline_parse_inst_t cmd_showfwdall = {
+ .f = cmd_showfwdall_parsed,
+ .data = NULL,
+ .help_str = "show|clear fwd stats all",
+ .tokens = {
+ (void *)&cmd_fwd_action,
+ (void *)&cmd_fwd_fwd,
+ (void *)&cmd_fwd_stats,
+ (void *)&cmd_fwd_all,
+ NULL,
+ },
+};
+
/* *** READ PORT REGISTER *** */
struct cmd_read_reg_result {
cmdline_fixed_string_t read;
@@ -18559,6 +18607,7 @@ struct cmd_show_tx_metadata_result {
(cmdline_parse_inst_t *)&cmd_showqueue,
(cmdline_parse_inst_t *)&cmd_showportall,
(cmdline_parse_inst_t *)&cmd_showcfg,
+ (cmdline_parse_inst_t *)&cmd_showfwdall,
(cmdline_parse_inst_t *)&cmd_start,
(cmdline_parse_inst_t *)&cmd_start_tx_first,
(cmdline_parse_inst_t *)&cmd_start_tx_first_n,
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 8c3be14..6cb7675 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1361,91 +1361,6 @@ struct extmem_param {
#endif /* RTE_TEST_PMD_RECORD_BURST_STATS */
static void
-fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
-{
- struct rte_port *port;
- uint8_t i;
-
- static const char *fwd_stats_border = "----------------------";
-
- port = &ports[port_id];
- printf("\n %s Forward statistics for port %-2d %s\n",
- fwd_stats_border, port_id, fwd_stats_border);
-
- if ((!port->rx_queue_stats_mapping_enabled) && (!port->tx_queue_stats_mapping_enabled)) {
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n",
- 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",
- 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);
- }
-
- printf(" TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- 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,
- 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",
- 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);
- }
-
- printf(" TX-packets: %14"PRIu64" TX-dropped:%14"PRIu64" TX-total:"
- "%14"PRIu64"\n",
- stats->opackets, port->tx_dropped,
- stats->opackets + port->tx_dropped);
- }
-
-#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
- if (port->rx_stream)
- pkt_burst_stats_display("RX",
- &port->rx_stream->rx_burst_stats);
- if (port->tx_stream)
- pkt_burst_stats_display("TX",
- &port->tx_stream->tx_burst_stats);
-#endif
-
- if (port->rx_queue_stats_mapping_enabled) {
- printf("\n");
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d RX-packets:%14"PRIu64
- " RX-errors:%14"PRIu64
- " RX-bytes:%14"PRIu64"\n",
- i, stats->q_ipackets[i], stats->q_errors[i], stats->q_ibytes[i]);
- }
- printf("\n");
- }
- if (port->tx_queue_stats_mapping_enabled) {
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d TX-packets:%14"PRIu64
- " TX-bytes:%14"PRIu64"\n",
- i, stats->q_opackets[i], stats->q_obytes[i]);
- }
- }
-
- printf(" %s--------------------------------%s\n",
- fwd_stats_border, fwd_stats_border);
-}
-
-static void
fwd_stream_stats_display(streamid_t stream_id)
{
struct fwd_stream *fs;
@@ -1478,6 +1393,224 @@ struct extmem_param {
#endif
}
+void
+fwd_stats_display(void)
+{
+ static const char *fwd_stats_border = "----------------------";
+ static const char *acc_stats_border = "+++++++++++++++";
+ struct {
+ struct fwd_stream *rx_stream;
+ struct fwd_stream *tx_stream;
+ uint64_t tx_dropped;
+ uint64_t rx_bad_ip_csum;
+ uint64_t rx_bad_l4_csum;
+ uint64_t rx_bad_outer_l4_csum;
+ } ports_stats[RTE_MAX_ETHPORTS];
+ uint64_t total_rx_dropped = 0;
+ uint64_t total_tx_dropped = 0;
+ uint64_t total_rx_nombuf = 0;
+ struct rte_eth_stats stats;
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ uint64_t fwd_cycles = 0;
+#endif
+ uint64_t total_recv = 0;
+ uint64_t total_xmit = 0;
+ struct rte_port *port;
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ memset(ports_stats, 0, sizeof(ports_stats));
+
+ 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);
+ } else {
+ ports_stats[fs->tx_port].tx_stream = fs;
+ ports_stats[fs->rx_port].rx_stream = fs;
+ }
+
+ ports_stats[fs->tx_port].tx_dropped += fs->fwd_dropped;
+
+ ports_stats[fs->rx_port].rx_bad_ip_csum += fs->rx_bad_ip_csum;
+ ports_stats[fs->rx_port].rx_bad_l4_csum += fs->rx_bad_l4_csum;
+ ports_stats[fs->rx_port].rx_bad_outer_l4_csum +=
+ fs->rx_bad_outer_l4_csum;
+
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fwd_cycles += fs->core_cycles;
+#endif
+ }
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ uint8_t j;
+
+ pt_id = fwd_ports_ids[i];
+ port = &ports[pt_id];
+
+ rte_eth_stats_get(pt_id, &stats);
+ stats.ipackets -= port->stats.ipackets;
+ stats.opackets -= port->stats.opackets;
+ stats.ibytes -= port->stats.ibytes;
+ stats.obytes -= port->stats.obytes;
+ stats.imissed -= port->stats.imissed;
+ stats.oerrors -= port->stats.oerrors;
+ stats.rx_nombuf -= port->stats.rx_nombuf;
+
+ total_recv += stats.ipackets;
+ total_xmit += stats.opackets;
+ total_rx_dropped += stats.imissed;
+ total_tx_dropped += ports_stats[pt_id].tx_dropped;
+ total_tx_dropped += stats.oerrors;
+ total_rx_nombuf += stats.rx_nombuf;
+
+ printf("\n %s Forward statistics for port %-2d %s\n",
+ fwd_stats_border, pt_id, fwd_stats_border);
+
+ if (!port->rx_queue_stats_mapping_enabled &&
+ !port->tx_queue_stats_mapping_enabled) {
+ printf(" RX-packets: %-14"PRIu64
+ " RX-dropped: %-14"PRIu64
+ "RX-total: %-"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %-14"PRIu64
+ " TX-dropped: %-14"PRIu64
+ "TX-total: %-"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ } else {
+ printf(" RX-packets: %14"PRIu64
+ " RX-dropped:%14"PRIu64
+ " RX-total:%14"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %14"PRIu64
+ " TX-dropped:%14"PRIu64
+ " TX-total:%14"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ }
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ if (ports_stats[pt_id].rx_stream)
+ pkt_burst_stats_display("RX",
+ &ports_stats[pt_id].rx_stream->rx_burst_stats);
+ if (ports_stats[pt_id].tx_stream)
+ pkt_burst_stats_display("TX",
+ &ports_stats[pt_id].tx_stream->tx_burst_stats);
+#endif
+
+ if (port->rx_queue_stats_mapping_enabled) {
+ printf("\n");
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d RX-packets:%14"PRIu64
+ " RX-errors:%14"PRIu64
+ " RX-bytes:%14"PRIu64"\n",
+ j, stats.q_ipackets[j],
+ stats.q_errors[j], stats.q_ibytes[j]);
+ }
+ printf("\n");
+ }
+ if (port->tx_queue_stats_mapping_enabled) {
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d TX-packets:%14"PRIu64
+ " TX-bytes:%14"
+ PRIu64"\n",
+ j, stats.q_opackets[j],
+ stats.q_obytes[j]);
+ }
+ }
+
+ printf(" %s--------------------------------%s\n",
+ fwd_stats_border, fwd_stats_border);
+ }
+
+ printf("\n %s Accumulated forward statistics for all ports"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+ printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
+ "%-"PRIu64"\n"
+ " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
+ "%-"PRIu64"\n",
+ total_recv, total_rx_dropped, total_recv + total_rx_dropped,
+ total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
+ if (total_rx_nombuf > 0)
+ printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
+ printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ if (total_recv > 0)
+ printf("\n CPU cycles/packet=%u (total cycles="
+ "%"PRIu64" / total RX packets=%"PRIu64")\n",
+ (unsigned int)(fwd_cycles / total_recv),
+ fwd_cycles, total_recv);
+#endif
+}
+
+void
+fwd_stats_reset(void)
+{
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ pt_id = fwd_ports_ids[i];
+ rte_eth_stats_get(pt_id, &ports[pt_id].stats);
+ }
+ for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
+ struct fwd_stream *fs = fwd_streams[sm_id];
+
+ fs->rx_packets = 0;
+ fs->tx_packets = 0;
+ fs->fwd_dropped = 0;
+ fs->rx_bad_ip_csum = 0;
+ fs->rx_bad_l4_csum = 0;
+ fs->rx_bad_outer_l4_csum = 0;
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ memset(&fs->rx_burst_stats, 0, sizeof(fs->rx_burst_stats));
+ memset(&fs->tx_burst_stats, 0, sizeof(fs->tx_burst_stats));
+#endif
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fs->core_cycles = 0;
+#endif
+ }
+}
+
static void
flush_fwd_rx_queues(void)
{
@@ -1633,7 +1766,6 @@ struct extmem_param {
struct rte_port *port;
unsigned int i;
portid_t pt_id;
- streamid_t sm_id;
if (strcmp(cur_fwd_eng->fwd_mode_name, "rxonly") == 0 && !nb_rxq)
rte_exit(EXIT_FAILURE, "rxq are 0, cannot use rxonly fwd mode\n");
@@ -1684,32 +1816,12 @@ struct extmem_param {
pkt_fwd_config_display(&cur_fwd_config);
rxtx_config_display();
+ fwd_stats_reset();
for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
pt_id = fwd_ports_ids[i];
port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &port->stats);
- port->tx_dropped = 0;
-
map_port_queue_stats_mapping_registers(pt_id, port);
}
- for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
- fwd_streams[sm_id]->rx_packets = 0;
- fwd_streams[sm_id]->tx_packets = 0;
- 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,
- sizeof(fwd_streams[sm_id]->rx_burst_stats));
- memset(&fwd_streams[sm_id]->tx_burst_stats, 0,
- sizeof(fwd_streams[sm_id]->tx_burst_stats));
-#endif
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- fwd_streams[sm_id]->core_cycles = 0;
-#endif
- }
if (with_tx_first) {
port_fwd_begin = tx_only_engine.port_fwd_begin;
if (port_fwd_begin != NULL) {
@@ -1733,23 +1845,10 @@ struct extmem_param {
void
stop_packet_forwarding(void)
{
- struct rte_eth_stats stats;
- struct rte_port *port;
- port_fwd_end_t port_fwd_end;
+ port_fwd_end_t port_fwd_end;
+ lcoreid_t lc_id;
+ portid_t pt_id;
int i;
- portid_t pt_id;
- streamid_t sm_id;
- lcoreid_t lc_id;
- uint64_t total_recv;
- uint64_t total_xmit;
- uint64_t total_rx_dropped;
- uint64_t total_tx_dropped;
- uint64_t total_rx_nombuf;
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- uint64_t fwd_cycles;
-#endif
-
- static const char *acc_stats_border = "+++++++++++++++";
if (test_done) {
printf("Packet forwarding not started\n");
@@ -1767,87 +1866,9 @@ struct extmem_param {
(*port_fwd_end)(pt_id);
}
}
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- 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[fs->tx_port].tx_stream = NULL;
- ports[fs->rx_port].rx_stream = NULL;
- } else {
- 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 +
- fwd_streams[sm_id]->core_cycles);
-#endif
- }
- total_recv = 0;
- total_xmit = 0;
- total_rx_dropped = 0;
- total_tx_dropped = 0;
- total_rx_nombuf = 0;
- for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
- pt_id = fwd_ports_ids[i];
-
- port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &stats);
- stats.ipackets -= port->stats.ipackets;
- port->stats.ipackets = 0;
- stats.opackets -= port->stats.opackets;
- port->stats.opackets = 0;
- stats.ibytes -= port->stats.ibytes;
- port->stats.ibytes = 0;
- stats.obytes -= port->stats.obytes;
- port->stats.obytes = 0;
- stats.imissed -= port->stats.imissed;
- port->stats.imissed = 0;
- stats.oerrors -= port->stats.oerrors;
- port->stats.oerrors = 0;
- stats.rx_nombuf -= port->stats.rx_nombuf;
- port->stats.rx_nombuf = 0;
-
- total_recv += stats.ipackets;
- total_xmit += stats.opackets;
- total_rx_dropped += stats.imissed;
- total_tx_dropped += port->tx_dropped;
- total_rx_nombuf += stats.rx_nombuf;
- fwd_port_stats_display(pt_id, &stats);
- }
+ fwd_stats_display();
- printf("\n %s Accumulated forward statistics for all ports"
- "%s\n",
- acc_stats_border, acc_stats_border);
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n"
- " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- total_recv, total_rx_dropped, total_recv + total_rx_dropped,
- total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
- if (total_rx_nombuf > 0)
- printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
- printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
- "%s\n",
- acc_stats_border, acc_stats_border);
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- if (total_recv > 0)
- printf("\n CPU cycles/packet=%u (total cycles="
- "%"PRIu64" / total RX packets=%"PRIu64")\n",
- (unsigned int)(fwd_cycles / total_recv),
- fwd_cycles, total_recv);
-#endif
printf("\nDone.\n");
test_done = 1;
}
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 4f4a48f..f43b1a7 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -164,19 +164,12 @@ struct rte_port {
struct rte_eth_conf dev_conf; /**< Port configuration. */
struct ether_addr eth_addr; /**< Port ethernet address */
struct rte_eth_stats stats; /**< Last port statistics */
- uint64_t tx_dropped; /**< If no descriptor in TX ring */
- struct fwd_stream *rx_stream; /**< Port RX stream, if unique */
- struct fwd_stream *tx_stream; /**< Port TX stream, if unique */
unsigned int socket_id; /**< For NUMA support */
uint16_t parse_tunnel:1; /**< Parse internal headers */
uint16_t tso_segsz; /**< Segmentation offload MSS for non-tunneled packets. */
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 */
- 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 */
@@ -767,6 +760,8 @@ void vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type,
char *list_pkt_forwarding_retry_modes(void);
void set_pkt_forwarding_mode(const char *fwd_mode);
void start_packet_forwarding(int with_tx_first);
+void fwd_stats_display(void);
+void fwd_stats_reset(void);
void stop_packet_forwarding(void);
void dev_set_link_up(portid_t pid);
void dev_set_link_down(portid_t pid);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 1a12da4..06c8b2a 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -336,6 +336,42 @@ Example::
Set rxonly packet forwarding mode
+show fwd
+~~~~~~~~
+
+When running, forwarding engines maintain statistics from the time they have been started.
+Example for the io forwarding engine, with some packet drops on the tx side::
+
+ testpmd> show fwd stats all
+
+ ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
+ RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
+
+ ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
+ RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
+
+ ---------------------- Forward statistics for port 0 ----------------------
+ RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
+ TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
+ ----------------------------------------------------------------------------
+
+ ---------------------- Forward statistics for port 1 ----------------------
+ RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
+ TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
+ ----------------------------------------------------------------------------
+
+ +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
+ RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
+ TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+clear fwd
+~~~~~~~~~
+
+Clear the forwarding engines statistics::
+
+ testpmd> clear fwd stats all
+
read rxd
~~~~~~~~
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH v4 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
@ 2019-03-22 13:37 ` David Marchand
2019-03-22 17:22 ` Maxime Coquelin
1 sibling, 0 replies; 109+ 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
Add a new "show/clear fwd stats all" command to display fwd and port
statistics on the fly.
To be able to do so, the (testpmd only) rte_port structure can't be used
to maintain any statistics.
Moved the stats dump parts from stop_packet_forwarding() and merge with
fwd_port_stats_display() into fwd_stats_display().
fwd engine statistics are then aggregated into a local per port array.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changelog since v3:
- added description in testpmd usage
- renamed cmd_fwdall as cmd_showfwdall
Changelog since v1:
- removed hunk from now deleted patch 3
---
app/test-pmd/cmdline.c | 49 ++++
app/test-pmd/testpmd.c | 425 +++++++++++++++-------------
app/test-pmd/testpmd.h | 9 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 310 insertions(+), 209 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 815e5e8..ee50e45 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -225,6 +225,11 @@ static void cmd_help_long_parsed(void *parsed_result,
"show port tm node stats (port_id) (node_id) (clear)\n"
" Display the port TM node stats.\n\n"
+ "show fwd stats all\n"
+ " Display statistics for all fwd engines.\n\n"
+
+ "clear fwd stats all\n"
+ " Clear statistics for all fwd engines.\n\n"
);
}
@@ -7386,6 +7391,49 @@ struct cmd_showqueue_result {
},
};
+/* show/clear fwd engine statistics */
+struct fwd_result {
+ cmdline_fixed_string_t action;
+ cmdline_fixed_string_t fwd;
+ cmdline_fixed_string_t stats;
+ cmdline_fixed_string_t all;
+};
+
+cmdline_parse_token_string_t cmd_fwd_action =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, action, "show#clear");
+cmdline_parse_token_string_t cmd_fwd_fwd =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, fwd, "fwd");
+cmdline_parse_token_string_t cmd_fwd_stats =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, stats, "stats");
+cmdline_parse_token_string_t cmd_fwd_all =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, all, "all");
+
+static void
+cmd_showfwdall_parsed(void *parsed_result,
+ __rte_unused struct cmdline *cl,
+ __rte_unused void *data)
+{
+ struct fwd_result *res = parsed_result;
+
+ if (!strcmp(res->action, "show"))
+ fwd_stats_display();
+ else
+ fwd_stats_reset();
+}
+
+static cmdline_parse_inst_t cmd_showfwdall = {
+ .f = cmd_showfwdall_parsed,
+ .data = NULL,
+ .help_str = "show|clear fwd stats all",
+ .tokens = {
+ (void *)&cmd_fwd_action,
+ (void *)&cmd_fwd_fwd,
+ (void *)&cmd_fwd_stats,
+ (void *)&cmd_fwd_all,
+ NULL,
+ },
+};
+
/* *** READ PORT REGISTER *** */
struct cmd_read_reg_result {
cmdline_fixed_string_t read;
@@ -18559,6 +18607,7 @@ struct cmd_show_tx_metadata_result {
(cmdline_parse_inst_t *)&cmd_showqueue,
(cmdline_parse_inst_t *)&cmd_showportall,
(cmdline_parse_inst_t *)&cmd_showcfg,
+ (cmdline_parse_inst_t *)&cmd_showfwdall,
(cmdline_parse_inst_t *)&cmd_start,
(cmdline_parse_inst_t *)&cmd_start_tx_first,
(cmdline_parse_inst_t *)&cmd_start_tx_first_n,
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 8c3be14..6cb7675 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1361,91 +1361,6 @@ struct extmem_param {
#endif /* RTE_TEST_PMD_RECORD_BURST_STATS */
static void
-fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
-{
- struct rte_port *port;
- uint8_t i;
-
- static const char *fwd_stats_border = "----------------------";
-
- port = &ports[port_id];
- printf("\n %s Forward statistics for port %-2d %s\n",
- fwd_stats_border, port_id, fwd_stats_border);
-
- if ((!port->rx_queue_stats_mapping_enabled) && (!port->tx_queue_stats_mapping_enabled)) {
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n",
- 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",
- 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);
- }
-
- printf(" TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- 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,
- 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",
- 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);
- }
-
- printf(" TX-packets: %14"PRIu64" TX-dropped:%14"PRIu64" TX-total:"
- "%14"PRIu64"\n",
- stats->opackets, port->tx_dropped,
- stats->opackets + port->tx_dropped);
- }
-
-#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
- if (port->rx_stream)
- pkt_burst_stats_display("RX",
- &port->rx_stream->rx_burst_stats);
- if (port->tx_stream)
- pkt_burst_stats_display("TX",
- &port->tx_stream->tx_burst_stats);
-#endif
-
- if (port->rx_queue_stats_mapping_enabled) {
- printf("\n");
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d RX-packets:%14"PRIu64
- " RX-errors:%14"PRIu64
- " RX-bytes:%14"PRIu64"\n",
- i, stats->q_ipackets[i], stats->q_errors[i], stats->q_ibytes[i]);
- }
- printf("\n");
- }
- if (port->tx_queue_stats_mapping_enabled) {
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d TX-packets:%14"PRIu64
- " TX-bytes:%14"PRIu64"\n",
- i, stats->q_opackets[i], stats->q_obytes[i]);
- }
- }
-
- printf(" %s--------------------------------%s\n",
- fwd_stats_border, fwd_stats_border);
-}
-
-static void
fwd_stream_stats_display(streamid_t stream_id)
{
struct fwd_stream *fs;
@@ -1478,6 +1393,224 @@ struct extmem_param {
#endif
}
+void
+fwd_stats_display(void)
+{
+ static const char *fwd_stats_border = "----------------------";
+ static const char *acc_stats_border = "+++++++++++++++";
+ struct {
+ struct fwd_stream *rx_stream;
+ struct fwd_stream *tx_stream;
+ uint64_t tx_dropped;
+ uint64_t rx_bad_ip_csum;
+ uint64_t rx_bad_l4_csum;
+ uint64_t rx_bad_outer_l4_csum;
+ } ports_stats[RTE_MAX_ETHPORTS];
+ uint64_t total_rx_dropped = 0;
+ uint64_t total_tx_dropped = 0;
+ uint64_t total_rx_nombuf = 0;
+ struct rte_eth_stats stats;
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ uint64_t fwd_cycles = 0;
+#endif
+ uint64_t total_recv = 0;
+ uint64_t total_xmit = 0;
+ struct rte_port *port;
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ memset(ports_stats, 0, sizeof(ports_stats));
+
+ 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);
+ } else {
+ ports_stats[fs->tx_port].tx_stream = fs;
+ ports_stats[fs->rx_port].rx_stream = fs;
+ }
+
+ ports_stats[fs->tx_port].tx_dropped += fs->fwd_dropped;
+
+ ports_stats[fs->rx_port].rx_bad_ip_csum += fs->rx_bad_ip_csum;
+ ports_stats[fs->rx_port].rx_bad_l4_csum += fs->rx_bad_l4_csum;
+ ports_stats[fs->rx_port].rx_bad_outer_l4_csum +=
+ fs->rx_bad_outer_l4_csum;
+
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fwd_cycles += fs->core_cycles;
+#endif
+ }
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ uint8_t j;
+
+ pt_id = fwd_ports_ids[i];
+ port = &ports[pt_id];
+
+ rte_eth_stats_get(pt_id, &stats);
+ stats.ipackets -= port->stats.ipackets;
+ stats.opackets -= port->stats.opackets;
+ stats.ibytes -= port->stats.ibytes;
+ stats.obytes -= port->stats.obytes;
+ stats.imissed -= port->stats.imissed;
+ stats.oerrors -= port->stats.oerrors;
+ stats.rx_nombuf -= port->stats.rx_nombuf;
+
+ total_recv += stats.ipackets;
+ total_xmit += stats.opackets;
+ total_rx_dropped += stats.imissed;
+ total_tx_dropped += ports_stats[pt_id].tx_dropped;
+ total_tx_dropped += stats.oerrors;
+ total_rx_nombuf += stats.rx_nombuf;
+
+ printf("\n %s Forward statistics for port %-2d %s\n",
+ fwd_stats_border, pt_id, fwd_stats_border);
+
+ if (!port->rx_queue_stats_mapping_enabled &&
+ !port->tx_queue_stats_mapping_enabled) {
+ printf(" RX-packets: %-14"PRIu64
+ " RX-dropped: %-14"PRIu64
+ "RX-total: %-"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %-14"PRIu64
+ " TX-dropped: %-14"PRIu64
+ "TX-total: %-"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ } else {
+ printf(" RX-packets: %14"PRIu64
+ " RX-dropped:%14"PRIu64
+ " RX-total:%14"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %14"PRIu64
+ " TX-dropped:%14"PRIu64
+ " TX-total:%14"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ }
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ if (ports_stats[pt_id].rx_stream)
+ pkt_burst_stats_display("RX",
+ &ports_stats[pt_id].rx_stream->rx_burst_stats);
+ if (ports_stats[pt_id].tx_stream)
+ pkt_burst_stats_display("TX",
+ &ports_stats[pt_id].tx_stream->tx_burst_stats);
+#endif
+
+ if (port->rx_queue_stats_mapping_enabled) {
+ printf("\n");
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d RX-packets:%14"PRIu64
+ " RX-errors:%14"PRIu64
+ " RX-bytes:%14"PRIu64"\n",
+ j, stats.q_ipackets[j],
+ stats.q_errors[j], stats.q_ibytes[j]);
+ }
+ printf("\n");
+ }
+ if (port->tx_queue_stats_mapping_enabled) {
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d TX-packets:%14"PRIu64
+ " TX-bytes:%14"
+ PRIu64"\n",
+ j, stats.q_opackets[j],
+ stats.q_obytes[j]);
+ }
+ }
+
+ printf(" %s--------------------------------%s\n",
+ fwd_stats_border, fwd_stats_border);
+ }
+
+ printf("\n %s Accumulated forward statistics for all ports"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+ printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
+ "%-"PRIu64"\n"
+ " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
+ "%-"PRIu64"\n",
+ total_recv, total_rx_dropped, total_recv + total_rx_dropped,
+ total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
+ if (total_rx_nombuf > 0)
+ printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
+ printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ if (total_recv > 0)
+ printf("\n CPU cycles/packet=%u (total cycles="
+ "%"PRIu64" / total RX packets=%"PRIu64")\n",
+ (unsigned int)(fwd_cycles / total_recv),
+ fwd_cycles, total_recv);
+#endif
+}
+
+void
+fwd_stats_reset(void)
+{
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ pt_id = fwd_ports_ids[i];
+ rte_eth_stats_get(pt_id, &ports[pt_id].stats);
+ }
+ for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
+ struct fwd_stream *fs = fwd_streams[sm_id];
+
+ fs->rx_packets = 0;
+ fs->tx_packets = 0;
+ fs->fwd_dropped = 0;
+ fs->rx_bad_ip_csum = 0;
+ fs->rx_bad_l4_csum = 0;
+ fs->rx_bad_outer_l4_csum = 0;
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ memset(&fs->rx_burst_stats, 0, sizeof(fs->rx_burst_stats));
+ memset(&fs->tx_burst_stats, 0, sizeof(fs->tx_burst_stats));
+#endif
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fs->core_cycles = 0;
+#endif
+ }
+}
+
static void
flush_fwd_rx_queues(void)
{
@@ -1633,7 +1766,6 @@ struct extmem_param {
struct rte_port *port;
unsigned int i;
portid_t pt_id;
- streamid_t sm_id;
if (strcmp(cur_fwd_eng->fwd_mode_name, "rxonly") == 0 && !nb_rxq)
rte_exit(EXIT_FAILURE, "rxq are 0, cannot use rxonly fwd mode\n");
@@ -1684,32 +1816,12 @@ struct extmem_param {
pkt_fwd_config_display(&cur_fwd_config);
rxtx_config_display();
+ fwd_stats_reset();
for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
pt_id = fwd_ports_ids[i];
port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &port->stats);
- port->tx_dropped = 0;
-
map_port_queue_stats_mapping_registers(pt_id, port);
}
- for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
- fwd_streams[sm_id]->rx_packets = 0;
- fwd_streams[sm_id]->tx_packets = 0;
- 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,
- sizeof(fwd_streams[sm_id]->rx_burst_stats));
- memset(&fwd_streams[sm_id]->tx_burst_stats, 0,
- sizeof(fwd_streams[sm_id]->tx_burst_stats));
-#endif
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- fwd_streams[sm_id]->core_cycles = 0;
-#endif
- }
if (with_tx_first) {
port_fwd_begin = tx_only_engine.port_fwd_begin;
if (port_fwd_begin != NULL) {
@@ -1733,23 +1845,10 @@ struct extmem_param {
void
stop_packet_forwarding(void)
{
- struct rte_eth_stats stats;
- struct rte_port *port;
- port_fwd_end_t port_fwd_end;
+ port_fwd_end_t port_fwd_end;
+ lcoreid_t lc_id;
+ portid_t pt_id;
int i;
- portid_t pt_id;
- streamid_t sm_id;
- lcoreid_t lc_id;
- uint64_t total_recv;
- uint64_t total_xmit;
- uint64_t total_rx_dropped;
- uint64_t total_tx_dropped;
- uint64_t total_rx_nombuf;
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- uint64_t fwd_cycles;
-#endif
-
- static const char *acc_stats_border = "+++++++++++++++";
if (test_done) {
printf("Packet forwarding not started\n");
@@ -1767,87 +1866,9 @@ struct extmem_param {
(*port_fwd_end)(pt_id);
}
}
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- 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[fs->tx_port].tx_stream = NULL;
- ports[fs->rx_port].rx_stream = NULL;
- } else {
- 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 +
- fwd_streams[sm_id]->core_cycles);
-#endif
- }
- total_recv = 0;
- total_xmit = 0;
- total_rx_dropped = 0;
- total_tx_dropped = 0;
- total_rx_nombuf = 0;
- for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
- pt_id = fwd_ports_ids[i];
-
- port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &stats);
- stats.ipackets -= port->stats.ipackets;
- port->stats.ipackets = 0;
- stats.opackets -= port->stats.opackets;
- port->stats.opackets = 0;
- stats.ibytes -= port->stats.ibytes;
- port->stats.ibytes = 0;
- stats.obytes -= port->stats.obytes;
- port->stats.obytes = 0;
- stats.imissed -= port->stats.imissed;
- port->stats.imissed = 0;
- stats.oerrors -= port->stats.oerrors;
- port->stats.oerrors = 0;
- stats.rx_nombuf -= port->stats.rx_nombuf;
- port->stats.rx_nombuf = 0;
-
- total_recv += stats.ipackets;
- total_xmit += stats.opackets;
- total_rx_dropped += stats.imissed;
- total_tx_dropped += port->tx_dropped;
- total_rx_nombuf += stats.rx_nombuf;
- fwd_port_stats_display(pt_id, &stats);
- }
+ fwd_stats_display();
- printf("\n %s Accumulated forward statistics for all ports"
- "%s\n",
- acc_stats_border, acc_stats_border);
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n"
- " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- total_recv, total_rx_dropped, total_recv + total_rx_dropped,
- total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
- if (total_rx_nombuf > 0)
- printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
- printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
- "%s\n",
- acc_stats_border, acc_stats_border);
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- if (total_recv > 0)
- printf("\n CPU cycles/packet=%u (total cycles="
- "%"PRIu64" / total RX packets=%"PRIu64")\n",
- (unsigned int)(fwd_cycles / total_recv),
- fwd_cycles, total_recv);
-#endif
printf("\nDone.\n");
test_done = 1;
}
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 4f4a48f..f43b1a7 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -164,19 +164,12 @@ struct rte_port {
struct rte_eth_conf dev_conf; /**< Port configuration. */
struct ether_addr eth_addr; /**< Port ethernet address */
struct rte_eth_stats stats; /**< Last port statistics */
- uint64_t tx_dropped; /**< If no descriptor in TX ring */
- struct fwd_stream *rx_stream; /**< Port RX stream, if unique */
- struct fwd_stream *tx_stream; /**< Port TX stream, if unique */
unsigned int socket_id; /**< For NUMA support */
uint16_t parse_tunnel:1; /**< Parse internal headers */
uint16_t tso_segsz; /**< Segmentation offload MSS for non-tunneled packets. */
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 */
- 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 */
@@ -767,6 +760,8 @@ void vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type,
char *list_pkt_forwarding_retry_modes(void);
void set_pkt_forwarding_mode(const char *fwd_mode);
void start_packet_forwarding(int with_tx_first);
+void fwd_stats_display(void);
+void fwd_stats_reset(void);
void stop_packet_forwarding(void);
void dev_set_link_up(portid_t pid);
void dev_set_link_down(portid_t pid);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 1a12da4..06c8b2a 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -336,6 +336,42 @@ Example::
Set rxonly packet forwarding mode
+show fwd
+~~~~~~~~
+
+When running, forwarding engines maintain statistics from the time they have been started.
+Example for the io forwarding engine, with some packet drops on the tx side::
+
+ testpmd> show fwd stats all
+
+ ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
+ RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
+
+ ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
+ RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
+
+ ---------------------- Forward statistics for port 0 ----------------------
+ RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
+ TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
+ ----------------------------------------------------------------------------
+
+ ---------------------- Forward statistics for port 1 ----------------------
+ RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
+ TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
+ ----------------------------------------------------------------------------
+
+ +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
+ RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
+ TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+clear fwd
+~~~~~~~~~
+
+Clear the forwarding engines statistics::
+
+ testpmd> clear fwd stats all
+
read rxd
~~~~~~~~
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-22 13:37 ` [dpdk-dev] [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:03 ` Maxime Coquelin
2019-03-22 17:03 ` Maxime Coquelin
2019-03-22 17:17 ` Maxime Coquelin
2019-03-22 17:35 ` Andrew Rybchenko
3 siblings, 1 reply; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-22 17:03 ` Maxime Coquelin
@ 2019-03-22 17:03 ` Maxime Coquelin
0 siblings, 0 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
2019-03-22 13:37 ` David Marchand
@ 2019-03-22 17:06 ` Maxime Coquelin
2019-03-22 17:06 ` Maxime Coquelin
1 sibling, 1 reply; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits
2019-03-22 17:06 ` Maxime Coquelin
@ 2019-03-22 17:06 ` Maxime Coquelin
0 siblings, 0 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics David Marchand
2019-03-22 13:37 ` David Marchand
@ 2019-03-22 17:11 ` Maxime Coquelin
2019-03-22 17:11 ` Maxime Coquelin
1 sibling, 1 reply; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics
2019-03-22 17:11 ` Maxime Coquelin
@ 2019-03-22 17:11 ` Maxime Coquelin
0 siblings, 0 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-22 13:37 ` [dpdk-dev] [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:03 ` Maxime Coquelin
@ 2019-03-22 17:17 ` Maxime Coquelin
2019-03-22 17:17 ` Maxime Coquelin
2019-03-22 17:23 ` David Marchand
2019-03-22 17:35 ` Andrew Rybchenko
3 siblings, 2 replies; 109+ 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] 109+ messages in thread
* Re: [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:17 ` Maxime Coquelin
2019-03-22 17:23 ` David Marchand
1 sibling, 0 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-22 13:37 ` David Marchand
@ 2019-03-22 17:22 ` Maxime Coquelin
2019-03-22 17:22 ` Maxime Coquelin
1 sibling, 1 reply; 109+ messages in thread
From: Maxime Coquelin @ 2019-03-22 17:22 UTC (permalink / raw)
To: David Marchand, dev
Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
ferruh.yigit
On 3/22/19 2:37 PM, David Marchand wrote:
> Add a new "show/clear fwd stats all" command to display fwd and port
> statistics on the fly.
>
> To be able to do so, the (testpmd only) rte_port structure can't be used
> to maintain any statistics.
> Moved the stats dump parts from stop_packet_forwarding() and merge with
> fwd_port_stats_display() into fwd_stats_display().
> fwd engine statistics are then aggregated into a local per port array.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> Changelog since v3:
> - added description in testpmd usage
> - renamed cmd_fwdall as cmd_showfwdall
>
> Changelog since v1:
> - removed hunk from now deleted patch 3
>
> ---
> app/test-pmd/cmdline.c | 49 ++++
> app/test-pmd/testpmd.c | 425 +++++++++++++++-------------
> app/test-pmd/testpmd.h | 9 +-
> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
> 4 files changed, 310 insertions(+), 209 deletions(-)
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-22 17:22 ` Maxime Coquelin
@ 2019-03-22 17:22 ` Maxime Coquelin
0 siblings, 0 replies; 109+ messages in thread
From: Maxime Coquelin @ 2019-03-22 17:22 UTC (permalink / raw)
To: David Marchand, dev
Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
ferruh.yigit
On 3/22/19 2:37 PM, David Marchand wrote:
> Add a new "show/clear fwd stats all" command to display fwd and port
> statistics on the fly.
>
> To be able to do so, the (testpmd only) rte_port structure can't be used
> to maintain any statistics.
> Moved the stats dump parts from stop_packet_forwarding() and merge with
> fwd_port_stats_display() into fwd_stats_display().
> fwd engine statistics are then aggregated into a local per port array.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> Changelog since v3:
> - added description in testpmd usage
> - renamed cmd_fwdall as cmd_showfwdall
>
> Changelog since v1:
> - removed hunk from now deleted patch 3
>
> ---
> app/test-pmd/cmdline.c | 49 ++++
> app/test-pmd/testpmd.c | 425 +++++++++++++++-------------
> app/test-pmd/testpmd.h | 9 +-
> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
> 4 files changed, 310 insertions(+), 209 deletions(-)
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [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:17 ` Maxime Coquelin
@ 2019-03-22 17:23 ` David Marchand
2019-03-22 17:23 ` David Marchand
2019-03-22 17:31 ` Andrew Rybchenko
1 sibling, 2 replies; 109+ 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] 109+ messages in thread
* Re: [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:23 ` David Marchand
2019-03-22 17:31 ` Andrew Rybchenko
1 sibling, 0 replies; 109+ 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] 109+ messages in thread
* Re: [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:23 ` David Marchand
@ 2019-03-22 17:31 ` Andrew Rybchenko
2019-03-22 17:31 ` Andrew Rybchenko
1 sibling, 1 reply; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-22 17:31 ` Andrew Rybchenko
@ 2019-03-22 17:31 ` Andrew Rybchenko
0 siblings, 0 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics David Marchand
` (2 preceding siblings ...)
2019-03-22 17:17 ` Maxime Coquelin
@ 2019-03-22 17:35 ` Andrew Rybchenko
2019-03-22 17:35 ` Andrew Rybchenko
2019-03-22 17:43 ` David Marchand
3 siblings, 2 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-22 17:35 ` Andrew Rybchenko
@ 2019-03-22 17:35 ` Andrew Rybchenko
2019-03-22 17:43 ` David Marchand
1 sibling, 0 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-22 17:35 ` Andrew Rybchenko
2019-03-22 17:35 ` Andrew Rybchenko
@ 2019-03-22 17:43 ` David Marchand
2019-03-22 17:43 ` David Marchand
2019-03-23 19:12 ` David Marchand
1 sibling, 2 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-22 17:43 ` David Marchand
@ 2019-03-22 17:43 ` David Marchand
2019-03-23 19:12 ` David Marchand
1 sibling, 0 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-22 17:43 ` David Marchand
2019-03-22 17:43 ` David Marchand
@ 2019-03-23 19:12 ` David Marchand
2019-03-23 19:12 ` David Marchand
2019-03-25 6:34 ` Andrew Rybchenko
1 sibling, 2 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-23 19:12 ` David Marchand
@ 2019-03-23 19:12 ` David Marchand
2019-03-25 6:34 ` Andrew Rybchenko
1 sibling, 0 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-23 19:12 ` David Marchand
2019-03-23 19:12 ` David Marchand
@ 2019-03-25 6:34 ` Andrew Rybchenko
2019-03-25 6:34 ` Andrew Rybchenko
1 sibling, 1 reply; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics
2019-03-25 6:34 ` Andrew Rybchenko
@ 2019-03-25 6:34 ` Andrew Rybchenko
0 siblings, 0 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 0/4] display testpmd forwarding engine stats on the fly David Marchand
` (4 preceding siblings ...)
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
@ 2019-03-25 8:51 ` David Marchand
2019-03-25 8:51 ` David Marchand
` (5 more replies)
5 siblings, 6 replies; 109+ 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
Here is a little series that makes it possible to display and clear
testpmd fwd engines while they run without having to stop them.
This is mostly handy when running stress tests and you look for packets
drops without having to stop/start testpmd forwarding.
Example:
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 261977064 TX-packets: 261977064 TX-dropped: 0
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 261985142 TX-packets: 261985142 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 261977096 RX-dropped: 0 RX-total: 261977096
TX-packets: 261985155 TX-dropped: 0 TX-total: 261985155
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 261985188 RX-dropped: 0 RX-total: 261985188
TX-packets: 261977128 TX-dropped: 0 TX-total: 261977128
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 523962284 RX-dropped: 0 RX-total: 523962284
TX-packets: 523962283 TX-dropped: 0 TX-total: 523962283
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
David Marchand
---
Changelog since v4:
- take csum engine output into account in patch 1 (Andrew comment)
Changelog since v3:
- updated patch 4 following Ferruh comments
Changelog since v2:
- first patch has been merged in net-next, removed from the series
- split patch (numbered 3 in v2) in two following Andrew comment
Changelog since v1:
- Cc: stable for patch 1
- removed buggy patch 3
---
David Marchand (4):
app/testpmd: add missing newline when showing statistics
app/testpmd: extend fwd statistics to 64bits
app/testpmd: remove useless casts on statistics
app/testpmd: display/clear forwarding stats on demand
app/test-pmd/cmdline.c | 49 +++
app/test-pmd/testpmd.c | 452 ++++++++++++++--------------
app/test-pmd/testpmd.h | 21 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 322 insertions(+), 236 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly David Marchand
@ 2019-03-25 8:51 ` David Marchand
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 1/4] app/testpmd: add missing newline when showing statistics David Marchand
` (4 subsequent siblings)
5 siblings, 0 replies; 109+ 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
Here is a little series that makes it possible to display and clear
testpmd fwd engines while they run without having to stop them.
This is mostly handy when running stress tests and you look for packets
drops without having to stop/start testpmd forwarding.
Example:
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 261977064 TX-packets: 261977064 TX-dropped: 0
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 261985142 TX-packets: 261985142 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 261977096 RX-dropped: 0 RX-total: 261977096
TX-packets: 261985155 TX-dropped: 0 TX-total: 261985155
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 261985188 RX-dropped: 0 RX-total: 261985188
TX-packets: 261977128 TX-dropped: 0 TX-total: 261977128
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 523962284 RX-dropped: 0 RX-total: 523962284
TX-packets: 523962283 TX-dropped: 0 TX-total: 523962283
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
testpmd> show fwd stats all
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
David Marchand
---
Changelog since v4:
- take csum engine output into account in patch 1 (Andrew comment)
Changelog since v3:
- updated patch 4 following Ferruh comments
Changelog since v2:
- first patch has been merged in net-next, removed from the series
- split patch (numbered 3 in v2) in two following Andrew comment
Changelog since v1:
- Cc: stable for patch 1
- removed buggy patch 3
---
David Marchand (4):
app/testpmd: add missing newline when showing statistics
app/testpmd: extend fwd statistics to 64bits
app/testpmd: remove useless casts on statistics
app/testpmd: display/clear forwarding stats on demand
app/test-pmd/cmdline.c | 49 +++
app/test-pmd/testpmd.c | 452 ++++++++++++++--------------
app/test-pmd/testpmd.h | 21 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 322 insertions(+), 236 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH v5 1/4] app/testpmd: add missing newline when showing statistics
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-25 8:51 ` David Marchand
@ 2019-03-25 8:51 ` David Marchand
2019-03-25 8:51 ` David Marchand
2019-03-25 8:55 ` Andrew Rybchenko
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
` (3 subsequent siblings)
5 siblings, 2 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v5 1/4] app/testpmd: add missing newline when showing statistics
2019-03-25 8:51 ` [dpdk-dev] [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:55 ` Andrew Rybchenko
1 sibling, 0 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v5 2/4] app/testpmd: extend fwd statistics to 64bits
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-25 8:51 ` David Marchand
2019-03-25 8:51 ` [dpdk-dev] [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 ` David Marchand
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 3/4] app/testpmd: remove useless casts on statistics David Marchand
` (2 subsequent siblings)
5 siblings, 1 reply; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v5 2/4] app/testpmd: extend fwd statistics to 64bits
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
@ 2019-03-25 8:51 ` David Marchand
0 siblings, 0 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v5 3/4] app/testpmd: remove useless casts on statistics
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly David Marchand
` (2 preceding siblings ...)
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
@ 2019-03-25 8:51 ` David Marchand
2019-03-25 8:51 ` David Marchand
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-25 14:05 ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly Ferruh Yigit
5 siblings, 1 reply; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v5 3/4] app/testpmd: remove useless casts on statistics
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 3/4] app/testpmd: remove useless casts on statistics David Marchand
@ 2019-03-25 8:51 ` David Marchand
0 siblings, 0 replies; 109+ 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] 109+ messages in thread
* [dpdk-dev] [PATCH v5 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly David Marchand
` (3 preceding siblings ...)
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 3/4] app/testpmd: remove useless casts on statistics David Marchand
@ 2019-03-25 8:51 ` David Marchand
2019-03-25 8:51 ` David Marchand
2019-03-25 14:05 ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly Ferruh Yigit
5 siblings, 1 reply; 109+ 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
Add a new "show/clear fwd stats all" command to display fwd and port
statistics on the fly.
To be able to do so, the (testpmd only) rte_port structure can't be used
to maintain any statistics.
Moved the stats dump parts from stop_packet_forwarding() and merge with
fwd_port_stats_display() into fwd_stats_display().
fwd engine statistics are then aggregated into a local per port array.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
Changelog since v3:
- added description in testpmd usage
- renamed cmd_fwdall as cmd_showfwdall
Changelog since v1:
- removed hunk from now deleted patch 3
---
app/test-pmd/cmdline.c | 49 ++++
app/test-pmd/testpmd.c | 425 +++++++++++++++-------------
app/test-pmd/testpmd.h | 9 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 310 insertions(+), 209 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 815e5e8..ee50e45 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -225,6 +225,11 @@ static void cmd_help_long_parsed(void *parsed_result,
"show port tm node stats (port_id) (node_id) (clear)\n"
" Display the port TM node stats.\n\n"
+ "show fwd stats all\n"
+ " Display statistics for all fwd engines.\n\n"
+
+ "clear fwd stats all\n"
+ " Clear statistics for all fwd engines.\n\n"
);
}
@@ -7386,6 +7391,49 @@ struct cmd_showqueue_result {
},
};
+/* show/clear fwd engine statistics */
+struct fwd_result {
+ cmdline_fixed_string_t action;
+ cmdline_fixed_string_t fwd;
+ cmdline_fixed_string_t stats;
+ cmdline_fixed_string_t all;
+};
+
+cmdline_parse_token_string_t cmd_fwd_action =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, action, "show#clear");
+cmdline_parse_token_string_t cmd_fwd_fwd =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, fwd, "fwd");
+cmdline_parse_token_string_t cmd_fwd_stats =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, stats, "stats");
+cmdline_parse_token_string_t cmd_fwd_all =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, all, "all");
+
+static void
+cmd_showfwdall_parsed(void *parsed_result,
+ __rte_unused struct cmdline *cl,
+ __rte_unused void *data)
+{
+ struct fwd_result *res = parsed_result;
+
+ if (!strcmp(res->action, "show"))
+ fwd_stats_display();
+ else
+ fwd_stats_reset();
+}
+
+static cmdline_parse_inst_t cmd_showfwdall = {
+ .f = cmd_showfwdall_parsed,
+ .data = NULL,
+ .help_str = "show|clear fwd stats all",
+ .tokens = {
+ (void *)&cmd_fwd_action,
+ (void *)&cmd_fwd_fwd,
+ (void *)&cmd_fwd_stats,
+ (void *)&cmd_fwd_all,
+ NULL,
+ },
+};
+
/* *** READ PORT REGISTER *** */
struct cmd_read_reg_result {
cmdline_fixed_string_t read;
@@ -18559,6 +18607,7 @@ struct cmd_show_tx_metadata_result {
(cmdline_parse_inst_t *)&cmd_showqueue,
(cmdline_parse_inst_t *)&cmd_showportall,
(cmdline_parse_inst_t *)&cmd_showcfg,
+ (cmdline_parse_inst_t *)&cmd_showfwdall,
(cmdline_parse_inst_t *)&cmd_start,
(cmdline_parse_inst_t *)&cmd_start_tx_first,
(cmdline_parse_inst_t *)&cmd_start_tx_first_n,
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index c78d524..ee8aa23 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1361,91 +1361,6 @@ struct extmem_param {
#endif /* RTE_TEST_PMD_RECORD_BURST_STATS */
static void
-fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
-{
- struct rte_port *port;
- uint8_t i;
-
- static const char *fwd_stats_border = "----------------------";
-
- port = &ports[port_id];
- printf("\n %s Forward statistics for port %-2d %s\n",
- fwd_stats_border, port_id, fwd_stats_border);
-
- if ((!port->rx_queue_stats_mapping_enabled) && (!port->tx_queue_stats_mapping_enabled)) {
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n",
- 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",
- 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);
- }
-
- printf(" TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- 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,
- 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",
- 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);
- }
-
- printf(" TX-packets: %14"PRIu64" TX-dropped:%14"PRIu64" TX-total:"
- "%14"PRIu64"\n",
- stats->opackets, port->tx_dropped,
- stats->opackets + port->tx_dropped);
- }
-
-#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
- if (port->rx_stream)
- pkt_burst_stats_display("RX",
- &port->rx_stream->rx_burst_stats);
- if (port->tx_stream)
- pkt_burst_stats_display("TX",
- &port->tx_stream->tx_burst_stats);
-#endif
-
- if (port->rx_queue_stats_mapping_enabled) {
- printf("\n");
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d RX-packets:%14"PRIu64
- " RX-errors:%14"PRIu64
- " RX-bytes:%14"PRIu64"\n",
- i, stats->q_ipackets[i], stats->q_errors[i], stats->q_ibytes[i]);
- }
- printf("\n");
- }
- if (port->tx_queue_stats_mapping_enabled) {
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d TX-packets:%14"PRIu64
- " TX-bytes:%14"PRIu64"\n",
- i, stats->q_opackets[i], stats->q_obytes[i]);
- }
- }
-
- printf(" %s--------------------------------%s\n",
- fwd_stats_border, fwd_stats_border);
-}
-
-static void
fwd_stream_stats_display(streamid_t stream_id)
{
struct fwd_stream *fs;
@@ -1480,6 +1395,224 @@ struct extmem_param {
#endif
}
+void
+fwd_stats_display(void)
+{
+ static const char *fwd_stats_border = "----------------------";
+ static const char *acc_stats_border = "+++++++++++++++";
+ struct {
+ struct fwd_stream *rx_stream;
+ struct fwd_stream *tx_stream;
+ uint64_t tx_dropped;
+ uint64_t rx_bad_ip_csum;
+ uint64_t rx_bad_l4_csum;
+ uint64_t rx_bad_outer_l4_csum;
+ } ports_stats[RTE_MAX_ETHPORTS];
+ uint64_t total_rx_dropped = 0;
+ uint64_t total_tx_dropped = 0;
+ uint64_t total_rx_nombuf = 0;
+ struct rte_eth_stats stats;
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ uint64_t fwd_cycles = 0;
+#endif
+ uint64_t total_recv = 0;
+ uint64_t total_xmit = 0;
+ struct rte_port *port;
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ memset(ports_stats, 0, sizeof(ports_stats));
+
+ 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);
+ } else {
+ ports_stats[fs->tx_port].tx_stream = fs;
+ ports_stats[fs->rx_port].rx_stream = fs;
+ }
+
+ ports_stats[fs->tx_port].tx_dropped += fs->fwd_dropped;
+
+ ports_stats[fs->rx_port].rx_bad_ip_csum += fs->rx_bad_ip_csum;
+ ports_stats[fs->rx_port].rx_bad_l4_csum += fs->rx_bad_l4_csum;
+ ports_stats[fs->rx_port].rx_bad_outer_l4_csum +=
+ fs->rx_bad_outer_l4_csum;
+
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fwd_cycles += fs->core_cycles;
+#endif
+ }
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ uint8_t j;
+
+ pt_id = fwd_ports_ids[i];
+ port = &ports[pt_id];
+
+ rte_eth_stats_get(pt_id, &stats);
+ stats.ipackets -= port->stats.ipackets;
+ stats.opackets -= port->stats.opackets;
+ stats.ibytes -= port->stats.ibytes;
+ stats.obytes -= port->stats.obytes;
+ stats.imissed -= port->stats.imissed;
+ stats.oerrors -= port->stats.oerrors;
+ stats.rx_nombuf -= port->stats.rx_nombuf;
+
+ total_recv += stats.ipackets;
+ total_xmit += stats.opackets;
+ total_rx_dropped += stats.imissed;
+ total_tx_dropped += ports_stats[pt_id].tx_dropped;
+ total_tx_dropped += stats.oerrors;
+ total_rx_nombuf += stats.rx_nombuf;
+
+ printf("\n %s Forward statistics for port %-2d %s\n",
+ fwd_stats_border, pt_id, fwd_stats_border);
+
+ if (!port->rx_queue_stats_mapping_enabled &&
+ !port->tx_queue_stats_mapping_enabled) {
+ printf(" RX-packets: %-14"PRIu64
+ " RX-dropped: %-14"PRIu64
+ "RX-total: %-"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %-14"PRIu64
+ " TX-dropped: %-14"PRIu64
+ "TX-total: %-"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ } else {
+ printf(" RX-packets: %14"PRIu64
+ " RX-dropped:%14"PRIu64
+ " RX-total:%14"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %14"PRIu64
+ " TX-dropped:%14"PRIu64
+ " TX-total:%14"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ }
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ if (ports_stats[pt_id].rx_stream)
+ pkt_burst_stats_display("RX",
+ &ports_stats[pt_id].rx_stream->rx_burst_stats);
+ if (ports_stats[pt_id].tx_stream)
+ pkt_burst_stats_display("TX",
+ &ports_stats[pt_id].tx_stream->tx_burst_stats);
+#endif
+
+ if (port->rx_queue_stats_mapping_enabled) {
+ printf("\n");
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d RX-packets:%14"PRIu64
+ " RX-errors:%14"PRIu64
+ " RX-bytes:%14"PRIu64"\n",
+ j, stats.q_ipackets[j],
+ stats.q_errors[j], stats.q_ibytes[j]);
+ }
+ printf("\n");
+ }
+ if (port->tx_queue_stats_mapping_enabled) {
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d TX-packets:%14"PRIu64
+ " TX-bytes:%14"
+ PRIu64"\n",
+ j, stats.q_opackets[j],
+ stats.q_obytes[j]);
+ }
+ }
+
+ printf(" %s--------------------------------%s\n",
+ fwd_stats_border, fwd_stats_border);
+ }
+
+ printf("\n %s Accumulated forward statistics for all ports"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+ printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
+ "%-"PRIu64"\n"
+ " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
+ "%-"PRIu64"\n",
+ total_recv, total_rx_dropped, total_recv + total_rx_dropped,
+ total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
+ if (total_rx_nombuf > 0)
+ printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
+ printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ if (total_recv > 0)
+ printf("\n CPU cycles/packet=%u (total cycles="
+ "%"PRIu64" / total RX packets=%"PRIu64")\n",
+ (unsigned int)(fwd_cycles / total_recv),
+ fwd_cycles, total_recv);
+#endif
+}
+
+void
+fwd_stats_reset(void)
+{
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ pt_id = fwd_ports_ids[i];
+ rte_eth_stats_get(pt_id, &ports[pt_id].stats);
+ }
+ for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
+ struct fwd_stream *fs = fwd_streams[sm_id];
+
+ fs->rx_packets = 0;
+ fs->tx_packets = 0;
+ fs->fwd_dropped = 0;
+ fs->rx_bad_ip_csum = 0;
+ fs->rx_bad_l4_csum = 0;
+ fs->rx_bad_outer_l4_csum = 0;
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ memset(&fs->rx_burst_stats, 0, sizeof(fs->rx_burst_stats));
+ memset(&fs->tx_burst_stats, 0, sizeof(fs->tx_burst_stats));
+#endif
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fs->core_cycles = 0;
+#endif
+ }
+}
+
static void
flush_fwd_rx_queues(void)
{
@@ -1635,7 +1768,6 @@ struct extmem_param {
struct rte_port *port;
unsigned int i;
portid_t pt_id;
- streamid_t sm_id;
if (strcmp(cur_fwd_eng->fwd_mode_name, "rxonly") == 0 && !nb_rxq)
rte_exit(EXIT_FAILURE, "rxq are 0, cannot use rxonly fwd mode\n");
@@ -1686,32 +1818,12 @@ struct extmem_param {
pkt_fwd_config_display(&cur_fwd_config);
rxtx_config_display();
+ fwd_stats_reset();
for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
pt_id = fwd_ports_ids[i];
port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &port->stats);
- port->tx_dropped = 0;
-
map_port_queue_stats_mapping_registers(pt_id, port);
}
- for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
- fwd_streams[sm_id]->rx_packets = 0;
- fwd_streams[sm_id]->tx_packets = 0;
- 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,
- sizeof(fwd_streams[sm_id]->rx_burst_stats));
- memset(&fwd_streams[sm_id]->tx_burst_stats, 0,
- sizeof(fwd_streams[sm_id]->tx_burst_stats));
-#endif
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- fwd_streams[sm_id]->core_cycles = 0;
-#endif
- }
if (with_tx_first) {
port_fwd_begin = tx_only_engine.port_fwd_begin;
if (port_fwd_begin != NULL) {
@@ -1735,23 +1847,10 @@ struct extmem_param {
void
stop_packet_forwarding(void)
{
- struct rte_eth_stats stats;
- struct rte_port *port;
- port_fwd_end_t port_fwd_end;
+ port_fwd_end_t port_fwd_end;
+ lcoreid_t lc_id;
+ portid_t pt_id;
int i;
- portid_t pt_id;
- streamid_t sm_id;
- lcoreid_t lc_id;
- uint64_t total_recv;
- uint64_t total_xmit;
- uint64_t total_rx_dropped;
- uint64_t total_tx_dropped;
- uint64_t total_rx_nombuf;
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- uint64_t fwd_cycles;
-#endif
-
- static const char *acc_stats_border = "+++++++++++++++";
if (test_done) {
printf("Packet forwarding not started\n");
@@ -1769,87 +1868,9 @@ struct extmem_param {
(*port_fwd_end)(pt_id);
}
}
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- 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[fs->tx_port].tx_stream = NULL;
- ports[fs->rx_port].rx_stream = NULL;
- } else {
- 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 +
- fwd_streams[sm_id]->core_cycles);
-#endif
- }
- total_recv = 0;
- total_xmit = 0;
- total_rx_dropped = 0;
- total_tx_dropped = 0;
- total_rx_nombuf = 0;
- for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
- pt_id = fwd_ports_ids[i];
-
- port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &stats);
- stats.ipackets -= port->stats.ipackets;
- port->stats.ipackets = 0;
- stats.opackets -= port->stats.opackets;
- port->stats.opackets = 0;
- stats.ibytes -= port->stats.ibytes;
- port->stats.ibytes = 0;
- stats.obytes -= port->stats.obytes;
- port->stats.obytes = 0;
- stats.imissed -= port->stats.imissed;
- port->stats.imissed = 0;
- stats.oerrors -= port->stats.oerrors;
- port->stats.oerrors = 0;
- stats.rx_nombuf -= port->stats.rx_nombuf;
- port->stats.rx_nombuf = 0;
-
- total_recv += stats.ipackets;
- total_xmit += stats.opackets;
- total_rx_dropped += stats.imissed;
- total_tx_dropped += port->tx_dropped;
- total_rx_nombuf += stats.rx_nombuf;
- fwd_port_stats_display(pt_id, &stats);
- }
+ fwd_stats_display();
- printf("\n %s Accumulated forward statistics for all ports"
- "%s\n",
- acc_stats_border, acc_stats_border);
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n"
- " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- total_recv, total_rx_dropped, total_recv + total_rx_dropped,
- total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
- if (total_rx_nombuf > 0)
- printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
- printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
- "%s\n",
- acc_stats_border, acc_stats_border);
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- if (total_recv > 0)
- printf("\n CPU cycles/packet=%u (total cycles="
- "%"PRIu64" / total RX packets=%"PRIu64")\n",
- (unsigned int)(fwd_cycles / total_recv),
- fwd_cycles, total_recv);
-#endif
printf("\nDone.\n");
test_done = 1;
}
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 4f4a48f..f43b1a7 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -164,19 +164,12 @@ struct rte_port {
struct rte_eth_conf dev_conf; /**< Port configuration. */
struct ether_addr eth_addr; /**< Port ethernet address */
struct rte_eth_stats stats; /**< Last port statistics */
- uint64_t tx_dropped; /**< If no descriptor in TX ring */
- struct fwd_stream *rx_stream; /**< Port RX stream, if unique */
- struct fwd_stream *tx_stream; /**< Port TX stream, if unique */
unsigned int socket_id; /**< For NUMA support */
uint16_t parse_tunnel:1; /**< Parse internal headers */
uint16_t tso_segsz; /**< Segmentation offload MSS for non-tunneled packets. */
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 */
- 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 */
@@ -767,6 +760,8 @@ void vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type,
char *list_pkt_forwarding_retry_modes(void);
void set_pkt_forwarding_mode(const char *fwd_mode);
void start_packet_forwarding(int with_tx_first);
+void fwd_stats_display(void);
+void fwd_stats_reset(void);
void stop_packet_forwarding(void);
void dev_set_link_up(portid_t pid);
void dev_set_link_down(portid_t pid);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 1a12da4..06c8b2a 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -336,6 +336,42 @@ Example::
Set rxonly packet forwarding mode
+show fwd
+~~~~~~~~
+
+When running, forwarding engines maintain statistics from the time they have been started.
+Example for the io forwarding engine, with some packet drops on the tx side::
+
+ testpmd> show fwd stats all
+
+ ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
+ RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
+
+ ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
+ RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
+
+ ---------------------- Forward statistics for port 0 ----------------------
+ RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
+ TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
+ ----------------------------------------------------------------------------
+
+ ---------------------- Forward statistics for port 1 ----------------------
+ RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
+ TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
+ ----------------------------------------------------------------------------
+
+ +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
+ RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
+ TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+clear fwd
+~~~~~~~~~
+
+Clear the forwarding engines statistics::
+
+ testpmd> clear fwd stats all
+
read rxd
~~~~~~~~
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* [dpdk-dev] [PATCH v5 4/4] app/testpmd: display/clear forwarding stats on demand
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
@ 2019-03-25 8:51 ` David Marchand
0 siblings, 0 replies; 109+ 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
Add a new "show/clear fwd stats all" command to display fwd and port
statistics on the fly.
To be able to do so, the (testpmd only) rte_port structure can't be used
to maintain any statistics.
Moved the stats dump parts from stop_packet_forwarding() and merge with
fwd_port_stats_display() into fwd_stats_display().
fwd engine statistics are then aggregated into a local per port array.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
Changelog since v3:
- added description in testpmd usage
- renamed cmd_fwdall as cmd_showfwdall
Changelog since v1:
- removed hunk from now deleted patch 3
---
app/test-pmd/cmdline.c | 49 ++++
app/test-pmd/testpmd.c | 425 +++++++++++++++-------------
app/test-pmd/testpmd.h | 9 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 +++
4 files changed, 310 insertions(+), 209 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 815e5e8..ee50e45 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -225,6 +225,11 @@ static void cmd_help_long_parsed(void *parsed_result,
"show port tm node stats (port_id) (node_id) (clear)\n"
" Display the port TM node stats.\n\n"
+ "show fwd stats all\n"
+ " Display statistics for all fwd engines.\n\n"
+
+ "clear fwd stats all\n"
+ " Clear statistics for all fwd engines.\n\n"
);
}
@@ -7386,6 +7391,49 @@ struct cmd_showqueue_result {
},
};
+/* show/clear fwd engine statistics */
+struct fwd_result {
+ cmdline_fixed_string_t action;
+ cmdline_fixed_string_t fwd;
+ cmdline_fixed_string_t stats;
+ cmdline_fixed_string_t all;
+};
+
+cmdline_parse_token_string_t cmd_fwd_action =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, action, "show#clear");
+cmdline_parse_token_string_t cmd_fwd_fwd =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, fwd, "fwd");
+cmdline_parse_token_string_t cmd_fwd_stats =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, stats, "stats");
+cmdline_parse_token_string_t cmd_fwd_all =
+ TOKEN_STRING_INITIALIZER(struct fwd_result, all, "all");
+
+static void
+cmd_showfwdall_parsed(void *parsed_result,
+ __rte_unused struct cmdline *cl,
+ __rte_unused void *data)
+{
+ struct fwd_result *res = parsed_result;
+
+ if (!strcmp(res->action, "show"))
+ fwd_stats_display();
+ else
+ fwd_stats_reset();
+}
+
+static cmdline_parse_inst_t cmd_showfwdall = {
+ .f = cmd_showfwdall_parsed,
+ .data = NULL,
+ .help_str = "show|clear fwd stats all",
+ .tokens = {
+ (void *)&cmd_fwd_action,
+ (void *)&cmd_fwd_fwd,
+ (void *)&cmd_fwd_stats,
+ (void *)&cmd_fwd_all,
+ NULL,
+ },
+};
+
/* *** READ PORT REGISTER *** */
struct cmd_read_reg_result {
cmdline_fixed_string_t read;
@@ -18559,6 +18607,7 @@ struct cmd_show_tx_metadata_result {
(cmdline_parse_inst_t *)&cmd_showqueue,
(cmdline_parse_inst_t *)&cmd_showportall,
(cmdline_parse_inst_t *)&cmd_showcfg,
+ (cmdline_parse_inst_t *)&cmd_showfwdall,
(cmdline_parse_inst_t *)&cmd_start,
(cmdline_parse_inst_t *)&cmd_start_tx_first,
(cmdline_parse_inst_t *)&cmd_start_tx_first_n,
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index c78d524..ee8aa23 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1361,91 +1361,6 @@ struct extmem_param {
#endif /* RTE_TEST_PMD_RECORD_BURST_STATS */
static void
-fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
-{
- struct rte_port *port;
- uint8_t i;
-
- static const char *fwd_stats_border = "----------------------";
-
- port = &ports[port_id];
- printf("\n %s Forward statistics for port %-2d %s\n",
- fwd_stats_border, port_id, fwd_stats_border);
-
- if ((!port->rx_queue_stats_mapping_enabled) && (!port->tx_queue_stats_mapping_enabled)) {
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n",
- 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",
- 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);
- }
-
- printf(" TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- 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,
- 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",
- 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);
- }
-
- printf(" TX-packets: %14"PRIu64" TX-dropped:%14"PRIu64" TX-total:"
- "%14"PRIu64"\n",
- stats->opackets, port->tx_dropped,
- stats->opackets + port->tx_dropped);
- }
-
-#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
- if (port->rx_stream)
- pkt_burst_stats_display("RX",
- &port->rx_stream->rx_burst_stats);
- if (port->tx_stream)
- pkt_burst_stats_display("TX",
- &port->tx_stream->tx_burst_stats);
-#endif
-
- if (port->rx_queue_stats_mapping_enabled) {
- printf("\n");
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d RX-packets:%14"PRIu64
- " RX-errors:%14"PRIu64
- " RX-bytes:%14"PRIu64"\n",
- i, stats->q_ipackets[i], stats->q_errors[i], stats->q_ibytes[i]);
- }
- printf("\n");
- }
- if (port->tx_queue_stats_mapping_enabled) {
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d TX-packets:%14"PRIu64
- " TX-bytes:%14"PRIu64"\n",
- i, stats->q_opackets[i], stats->q_obytes[i]);
- }
- }
-
- printf(" %s--------------------------------%s\n",
- fwd_stats_border, fwd_stats_border);
-}
-
-static void
fwd_stream_stats_display(streamid_t stream_id)
{
struct fwd_stream *fs;
@@ -1480,6 +1395,224 @@ struct extmem_param {
#endif
}
+void
+fwd_stats_display(void)
+{
+ static const char *fwd_stats_border = "----------------------";
+ static const char *acc_stats_border = "+++++++++++++++";
+ struct {
+ struct fwd_stream *rx_stream;
+ struct fwd_stream *tx_stream;
+ uint64_t tx_dropped;
+ uint64_t rx_bad_ip_csum;
+ uint64_t rx_bad_l4_csum;
+ uint64_t rx_bad_outer_l4_csum;
+ } ports_stats[RTE_MAX_ETHPORTS];
+ uint64_t total_rx_dropped = 0;
+ uint64_t total_tx_dropped = 0;
+ uint64_t total_rx_nombuf = 0;
+ struct rte_eth_stats stats;
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ uint64_t fwd_cycles = 0;
+#endif
+ uint64_t total_recv = 0;
+ uint64_t total_xmit = 0;
+ struct rte_port *port;
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ memset(ports_stats, 0, sizeof(ports_stats));
+
+ 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);
+ } else {
+ ports_stats[fs->tx_port].tx_stream = fs;
+ ports_stats[fs->rx_port].rx_stream = fs;
+ }
+
+ ports_stats[fs->tx_port].tx_dropped += fs->fwd_dropped;
+
+ ports_stats[fs->rx_port].rx_bad_ip_csum += fs->rx_bad_ip_csum;
+ ports_stats[fs->rx_port].rx_bad_l4_csum += fs->rx_bad_l4_csum;
+ ports_stats[fs->rx_port].rx_bad_outer_l4_csum +=
+ fs->rx_bad_outer_l4_csum;
+
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fwd_cycles += fs->core_cycles;
+#endif
+ }
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ uint8_t j;
+
+ pt_id = fwd_ports_ids[i];
+ port = &ports[pt_id];
+
+ rte_eth_stats_get(pt_id, &stats);
+ stats.ipackets -= port->stats.ipackets;
+ stats.opackets -= port->stats.opackets;
+ stats.ibytes -= port->stats.ibytes;
+ stats.obytes -= port->stats.obytes;
+ stats.imissed -= port->stats.imissed;
+ stats.oerrors -= port->stats.oerrors;
+ stats.rx_nombuf -= port->stats.rx_nombuf;
+
+ total_recv += stats.ipackets;
+ total_xmit += stats.opackets;
+ total_rx_dropped += stats.imissed;
+ total_tx_dropped += ports_stats[pt_id].tx_dropped;
+ total_tx_dropped += stats.oerrors;
+ total_rx_nombuf += stats.rx_nombuf;
+
+ printf("\n %s Forward statistics for port %-2d %s\n",
+ fwd_stats_border, pt_id, fwd_stats_border);
+
+ if (!port->rx_queue_stats_mapping_enabled &&
+ !port->tx_queue_stats_mapping_enabled) {
+ printf(" RX-packets: %-14"PRIu64
+ " RX-dropped: %-14"PRIu64
+ "RX-total: %-"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %-14"PRIu64
+ " TX-dropped: %-14"PRIu64
+ "TX-total: %-"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ } else {
+ printf(" RX-packets: %14"PRIu64
+ " RX-dropped:%14"PRIu64
+ " RX-total:%14"PRIu64"\n",
+ 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",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].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);
+ }
+
+ printf(" TX-packets: %14"PRIu64
+ " TX-dropped:%14"PRIu64
+ " TX-total:%14"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+ }
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ if (ports_stats[pt_id].rx_stream)
+ pkt_burst_stats_display("RX",
+ &ports_stats[pt_id].rx_stream->rx_burst_stats);
+ if (ports_stats[pt_id].tx_stream)
+ pkt_burst_stats_display("TX",
+ &ports_stats[pt_id].tx_stream->tx_burst_stats);
+#endif
+
+ if (port->rx_queue_stats_mapping_enabled) {
+ printf("\n");
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d RX-packets:%14"PRIu64
+ " RX-errors:%14"PRIu64
+ " RX-bytes:%14"PRIu64"\n",
+ j, stats.q_ipackets[j],
+ stats.q_errors[j], stats.q_ibytes[j]);
+ }
+ printf("\n");
+ }
+ if (port->tx_queue_stats_mapping_enabled) {
+ for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
+ printf(" Stats reg %2d TX-packets:%14"PRIu64
+ " TX-bytes:%14"
+ PRIu64"\n",
+ j, stats.q_opackets[j],
+ stats.q_obytes[j]);
+ }
+ }
+
+ printf(" %s--------------------------------%s\n",
+ fwd_stats_border, fwd_stats_border);
+ }
+
+ printf("\n %s Accumulated forward statistics for all ports"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+ printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
+ "%-"PRIu64"\n"
+ " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
+ "%-"PRIu64"\n",
+ total_recv, total_rx_dropped, total_recv + total_rx_dropped,
+ total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
+ if (total_rx_nombuf > 0)
+ printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
+ printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
+ "%s\n",
+ acc_stats_border, acc_stats_border);
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ if (total_recv > 0)
+ printf("\n CPU cycles/packet=%u (total cycles="
+ "%"PRIu64" / total RX packets=%"PRIu64")\n",
+ (unsigned int)(fwd_cycles / total_recv),
+ fwd_cycles, total_recv);
+#endif
+}
+
+void
+fwd_stats_reset(void)
+{
+ streamid_t sm_id;
+ portid_t pt_id;
+ int i;
+
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+ pt_id = fwd_ports_ids[i];
+ rte_eth_stats_get(pt_id, &ports[pt_id].stats);
+ }
+ for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
+ struct fwd_stream *fs = fwd_streams[sm_id];
+
+ fs->rx_packets = 0;
+ fs->tx_packets = 0;
+ fs->fwd_dropped = 0;
+ fs->rx_bad_ip_csum = 0;
+ fs->rx_bad_l4_csum = 0;
+ fs->rx_bad_outer_l4_csum = 0;
+
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+ memset(&fs->rx_burst_stats, 0, sizeof(fs->rx_burst_stats));
+ memset(&fs->tx_burst_stats, 0, sizeof(fs->tx_burst_stats));
+#endif
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+ fs->core_cycles = 0;
+#endif
+ }
+}
+
static void
flush_fwd_rx_queues(void)
{
@@ -1635,7 +1768,6 @@ struct extmem_param {
struct rte_port *port;
unsigned int i;
portid_t pt_id;
- streamid_t sm_id;
if (strcmp(cur_fwd_eng->fwd_mode_name, "rxonly") == 0 && !nb_rxq)
rte_exit(EXIT_FAILURE, "rxq are 0, cannot use rxonly fwd mode\n");
@@ -1686,32 +1818,12 @@ struct extmem_param {
pkt_fwd_config_display(&cur_fwd_config);
rxtx_config_display();
+ fwd_stats_reset();
for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
pt_id = fwd_ports_ids[i];
port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &port->stats);
- port->tx_dropped = 0;
-
map_port_queue_stats_mapping_registers(pt_id, port);
}
- for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
- fwd_streams[sm_id]->rx_packets = 0;
- fwd_streams[sm_id]->tx_packets = 0;
- 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,
- sizeof(fwd_streams[sm_id]->rx_burst_stats));
- memset(&fwd_streams[sm_id]->tx_burst_stats, 0,
- sizeof(fwd_streams[sm_id]->tx_burst_stats));
-#endif
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- fwd_streams[sm_id]->core_cycles = 0;
-#endif
- }
if (with_tx_first) {
port_fwd_begin = tx_only_engine.port_fwd_begin;
if (port_fwd_begin != NULL) {
@@ -1735,23 +1847,10 @@ struct extmem_param {
void
stop_packet_forwarding(void)
{
- struct rte_eth_stats stats;
- struct rte_port *port;
- port_fwd_end_t port_fwd_end;
+ port_fwd_end_t port_fwd_end;
+ lcoreid_t lc_id;
+ portid_t pt_id;
int i;
- portid_t pt_id;
- streamid_t sm_id;
- lcoreid_t lc_id;
- uint64_t total_recv;
- uint64_t total_xmit;
- uint64_t total_rx_dropped;
- uint64_t total_tx_dropped;
- uint64_t total_rx_nombuf;
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- uint64_t fwd_cycles;
-#endif
-
- static const char *acc_stats_border = "+++++++++++++++";
if (test_done) {
printf("Packet forwarding not started\n");
@@ -1769,87 +1868,9 @@ struct extmem_param {
(*port_fwd_end)(pt_id);
}
}
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- 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[fs->tx_port].tx_stream = NULL;
- ports[fs->rx_port].rx_stream = NULL;
- } else {
- 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 +
- fwd_streams[sm_id]->core_cycles);
-#endif
- }
- total_recv = 0;
- total_xmit = 0;
- total_rx_dropped = 0;
- total_tx_dropped = 0;
- total_rx_nombuf = 0;
- for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
- pt_id = fwd_ports_ids[i];
-
- port = &ports[pt_id];
- rte_eth_stats_get(pt_id, &stats);
- stats.ipackets -= port->stats.ipackets;
- port->stats.ipackets = 0;
- stats.opackets -= port->stats.opackets;
- port->stats.opackets = 0;
- stats.ibytes -= port->stats.ibytes;
- port->stats.ibytes = 0;
- stats.obytes -= port->stats.obytes;
- port->stats.obytes = 0;
- stats.imissed -= port->stats.imissed;
- port->stats.imissed = 0;
- stats.oerrors -= port->stats.oerrors;
- port->stats.oerrors = 0;
- stats.rx_nombuf -= port->stats.rx_nombuf;
- port->stats.rx_nombuf = 0;
-
- total_recv += stats.ipackets;
- total_xmit += stats.opackets;
- total_rx_dropped += stats.imissed;
- total_tx_dropped += port->tx_dropped;
- total_rx_nombuf += stats.rx_nombuf;
- fwd_port_stats_display(pt_id, &stats);
- }
+ fwd_stats_display();
- printf("\n %s Accumulated forward statistics for all ports"
- "%s\n",
- acc_stats_border, acc_stats_border);
- printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64"RX-total: "
- "%-"PRIu64"\n"
- " TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64"TX-total: "
- "%-"PRIu64"\n",
- total_recv, total_rx_dropped, total_recv + total_rx_dropped,
- total_xmit, total_tx_dropped, total_xmit + total_tx_dropped);
- if (total_rx_nombuf > 0)
- printf(" RX-nombufs: %-14"PRIu64"\n", total_rx_nombuf);
- printf(" %s++++++++++++++++++++++++++++++++++++++++++++++"
- "%s\n",
- acc_stats_border, acc_stats_border);
-#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
- if (total_recv > 0)
- printf("\n CPU cycles/packet=%u (total cycles="
- "%"PRIu64" / total RX packets=%"PRIu64")\n",
- (unsigned int)(fwd_cycles / total_recv),
- fwd_cycles, total_recv);
-#endif
printf("\nDone.\n");
test_done = 1;
}
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 4f4a48f..f43b1a7 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -164,19 +164,12 @@ struct rte_port {
struct rte_eth_conf dev_conf; /**< Port configuration. */
struct ether_addr eth_addr; /**< Port ethernet address */
struct rte_eth_stats stats; /**< Last port statistics */
- uint64_t tx_dropped; /**< If no descriptor in TX ring */
- struct fwd_stream *rx_stream; /**< Port RX stream, if unique */
- struct fwd_stream *tx_stream; /**< Port TX stream, if unique */
unsigned int socket_id; /**< For NUMA support */
uint16_t parse_tunnel:1; /**< Parse internal headers */
uint16_t tso_segsz; /**< Segmentation offload MSS for non-tunneled packets. */
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 */
- 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 */
@@ -767,6 +760,8 @@ void vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type,
char *list_pkt_forwarding_retry_modes(void);
void set_pkt_forwarding_mode(const char *fwd_mode);
void start_packet_forwarding(int with_tx_first);
+void fwd_stats_display(void);
+void fwd_stats_reset(void);
void stop_packet_forwarding(void);
void dev_set_link_up(portid_t pid);
void dev_set_link_down(portid_t pid);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 1a12da4..06c8b2a 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -336,6 +336,42 @@ Example::
Set rxonly packet forwarding mode
+show fwd
+~~~~~~~~
+
+When running, forwarding engines maintain statistics from the time they have been started.
+Example for the io forwarding engine, with some packet drops on the tx side::
+
+ testpmd> show fwd stats all
+
+ ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
+ RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
+
+ ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
+ RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
+
+ ---------------------- Forward statistics for port 0 ----------------------
+ RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
+ TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
+ ----------------------------------------------------------------------------
+
+ ---------------------- Forward statistics for port 1 ----------------------
+ RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
+ TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
+ ----------------------------------------------------------------------------
+
+ +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
+ RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
+ TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+clear fwd
+~~~~~~~~~
+
+Clear the forwarding engines statistics::
+
+ testpmd> clear fwd stats all
+
read rxd
~~~~~~~~
--
1.8.3.1
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v5 1/4] app/testpmd: add missing newline when showing statistics
2019-03-25 8:51 ` [dpdk-dev] [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:55 ` Andrew Rybchenko
2019-03-25 8:55 ` Andrew Rybchenko
1 sibling, 1 reply; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v5 1/4] app/testpmd: add missing newline when showing statistics
2019-03-25 8:55 ` Andrew Rybchenko
@ 2019-03-25 8:55 ` Andrew Rybchenko
0 siblings, 0 replies; 109+ 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] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly David Marchand
` (4 preceding siblings ...)
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
@ 2019-03-25 14:05 ` Ferruh Yigit
2019-03-25 14:05 ` Ferruh Yigit
5 siblings, 1 reply; 109+ messages in thread
From: Ferruh Yigit @ 2019-03-25 14:05 UTC (permalink / raw)
To: David Marchand, dev
Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
maxime.coquelin
On 3/25/2019 8:51 AM, David Marchand wrote:
> Here is a little series that makes it possible to display and clear
> testpmd fwd engines while they run without having to stop them.
> This is mostly handy when running stress tests and you look for packets
> drops without having to stop/start testpmd forwarding.
>
> Example:
>
> testpmd> show fwd stats all
>
> ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
> RX-packets: 261977064 TX-packets: 261977064 TX-dropped: 0
>
> ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
> RX-packets: 261985142 TX-packets: 261985142 TX-dropped: 0
>
> ---------------------- Forward statistics for port 0 ----------------------
> RX-packets: 261977096 RX-dropped: 0 RX-total: 261977096
> TX-packets: 261985155 TX-dropped: 0 TX-total: 261985155
> ----------------------------------------------------------------------------
>
> ---------------------- Forward statistics for port 1 ----------------------
> RX-packets: 261985188 RX-dropped: 0 RX-total: 261985188
> TX-packets: 261977128 TX-dropped: 0 TX-total: 261977128
> ----------------------------------------------------------------------------
>
> +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
> RX-packets: 523962284 RX-dropped: 0 RX-total: 523962284
> TX-packets: 523962283 TX-dropped: 0 TX-total: 523962283
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> testpmd> show fwd stats all
>
> ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
> RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
>
> ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
> RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
>
> ---------------------- Forward statistics for port 0 ----------------------
> RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
> TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
> ----------------------------------------------------------------------------
>
> ---------------------- Forward statistics for port 1 ----------------------
> RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
> TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
> ----------------------------------------------------------------------------
>
> +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
> RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
> TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Series applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly
2019-03-25 14:05 ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly Ferruh Yigit
@ 2019-03-25 14:05 ` Ferruh Yigit
0 siblings, 0 replies; 109+ messages in thread
From: Ferruh Yigit @ 2019-03-25 14:05 UTC (permalink / raw)
To: David Marchand, dev
Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ramirose, arybchenko,
maxime.coquelin
On 3/25/2019 8:51 AM, David Marchand wrote:
> Here is a little series that makes it possible to display and clear
> testpmd fwd engines while they run without having to stop them.
> This is mostly handy when running stress tests and you look for packets
> drops without having to stop/start testpmd forwarding.
>
> Example:
>
> testpmd> show fwd stats all
>
> ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
> RX-packets: 261977064 TX-packets: 261977064 TX-dropped: 0
>
> ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
> RX-packets: 261985142 TX-packets: 261985142 TX-dropped: 0
>
> ---------------------- Forward statistics for port 0 ----------------------
> RX-packets: 261977096 RX-dropped: 0 RX-total: 261977096
> TX-packets: 261985155 TX-dropped: 0 TX-total: 261985155
> ----------------------------------------------------------------------------
>
> ---------------------- Forward statistics for port 1 ----------------------
> RX-packets: 261985188 RX-dropped: 0 RX-total: 261985188
> TX-packets: 261977128 TX-dropped: 0 TX-total: 261977128
> ----------------------------------------------------------------------------
>
> +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
> RX-packets: 523962284 RX-dropped: 0 RX-total: 523962284
> TX-packets: 523962283 TX-dropped: 0 TX-total: 523962283
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> testpmd> show fwd stats all
>
> ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
> RX-packets: 274293770 TX-packets: 274293642 TX-dropped: 128
>
> ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
> RX-packets: 274301850 TX-packets: 274301850 TX-dropped: 0
>
> ---------------------- Forward statistics for port 0 ----------------------
> RX-packets: 274293802 RX-dropped: 0 RX-total: 274293802
> TX-packets: 274301862 TX-dropped: 0 TX-total: 274301862
> ----------------------------------------------------------------------------
>
> ---------------------- Forward statistics for port 1 ----------------------
> RX-packets: 274301894 RX-dropped: 0 RX-total: 274301894
> TX-packets: 274293706 TX-dropped: 128 TX-total: 274293834
> ----------------------------------------------------------------------------
>
> +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
> RX-packets: 548595696 RX-dropped: 0 RX-total: 548595696
> TX-packets: 548595568 TX-dropped: 128 TX-total: 548595696
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Series applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 109+ messages in thread
end of thread, other threads:[~2019-03-25 14:05 UTC | newest]
Thread overview: 109+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-14 15:42 [dpdk-dev] [PATCH 0/5] display testpmd forwarding engine stats on the fly David Marchand
2019-02-14 15:42 ` [dpdk-dev] [PATCH 1/5] app/testpmd: remove unused fwd_ctx field David Marchand
2019-02-18 19:55 ` Rami Rosen
2019-02-14 15:42 ` [dpdk-dev] [PATCH 2/5] app/testpmd: add missing newline when showing statistics David Marchand
2019-02-19 5:48 ` Rami Rosen
2019-02-14 15:42 ` [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats David Marchand
2019-02-14 16:30 ` Bruce Richardson
2019-02-14 17:39 ` David Marchand
2019-02-14 18:51 ` David Marchand
2019-02-15 8:57 ` Thomas Monjalon
2019-02-15 9:33 ` David Marchand
2019-02-15 14:05 ` Bruce Richardson
2019-02-15 14:13 ` Wiles, Keith
2019-02-15 15:04 ` David Marchand
2019-02-15 16:19 ` Thomas Monjalon
2019-02-15 17:32 ` David Marchand
2019-02-15 18:15 ` Ananyev, Konstantin
2019-02-15 18:31 ` David Marchand
2019-02-15 18:42 ` Ananyev, Konstantin
2019-02-15 19:38 ` Thomas Monjalon
2019-02-16 0:37 ` Stephen Hemminger
2019-02-16 13:23 ` Ananyev, Konstantin
2019-02-16 12:50 ` Ananyev, Konstantin
2019-02-20 8:33 ` David Marchand
2019-02-24 11:55 ` Ananyev, Konstantin
2019-02-14 15:42 ` [dpdk-dev] [PATCH 4/5] app/testpmd: remove useless casts on statistics David Marchand
2019-02-14 15:42 ` [dpdk-dev] [PATCH 5/5] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 1/4] app/testpmd: remove unused fwd_ctx field David Marchand
2019-03-19 18:29 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2019-03-19 18:29 ` Ferruh Yigit
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 2/4] app/testpmd: add missing newline when showing statistics David Marchand
2019-03-11 15:53 ` Andrew Rybchenko
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 3/4] app/testpmd: remove useless casts on statistics David Marchand
2019-03-11 15:57 ` Andrew Rybchenko
2019-03-11 16:03 ` David Marchand
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-20 10:02 ` David Marchand
2019-03-20 10:02 ` [dpdk-dev] [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:49 ` Andrew Rybchenko
2019-03-20 13:49 ` Andrew Rybchenko
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
2019-03-20 10:02 ` David Marchand
2019-03-20 13:55 ` Andrew Rybchenko
2019-03-20 13:55 ` Andrew Rybchenko
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics David Marchand
2019-03-20 10:02 ` David Marchand
2019-03-20 13:58 ` Andrew Rybchenko
2019-03-20 13:58 ` Andrew Rybchenko
2019-03-20 10:02 ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-20 10:02 ` David Marchand
2019-03-20 12:25 ` Ferruh Yigit
2019-03-20 12:25 ` Ferruh Yigit
2019-03-20 12:44 ` David Marchand
2019-03-20 12:44 ` David Marchand
2019-03-20 13:29 ` Ferruh Yigit
2019-03-20 13:29 ` Ferruh Yigit
2019-03-21 18:50 ` Ferruh Yigit
2019-03-21 18:50 ` Ferruh Yigit
2019-03-21 20:34 ` David Marchand
2019-03-21 20:34 ` David Marchand
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-22 13:37 ` David Marchand
2019-03-22 13:37 ` [dpdk-dev] [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:03 ` Maxime Coquelin
2019-03-22 17:03 ` Maxime Coquelin
2019-03-22 17:17 ` Maxime Coquelin
2019-03-22 17:17 ` Maxime Coquelin
2019-03-22 17:23 ` David Marchand
2019-03-22 17:23 ` David Marchand
2019-03-22 17:31 ` Andrew Rybchenko
2019-03-22 17:31 ` Andrew Rybchenko
2019-03-22 17:35 ` Andrew Rybchenko
2019-03-22 17:35 ` Andrew Rybchenko
2019-03-22 17:43 ` David Marchand
2019-03-22 17:43 ` David Marchand
2019-03-23 19:12 ` David Marchand
2019-03-23 19:12 ` David Marchand
2019-03-25 6:34 ` Andrew Rybchenko
2019-03-25 6:34 ` Andrew Rybchenko
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
2019-03-22 13:37 ` David Marchand
2019-03-22 17:06 ` Maxime Coquelin
2019-03-22 17:06 ` Maxime Coquelin
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics David Marchand
2019-03-22 13:37 ` David Marchand
2019-03-22 17:11 ` Maxime Coquelin
2019-03-22 17:11 ` Maxime Coquelin
2019-03-22 13:37 ` [dpdk-dev] [PATCH v4 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-22 13:37 ` David Marchand
2019-03-22 17:22 ` Maxime Coquelin
2019-03-22 17:22 ` Maxime Coquelin
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-25 8:51 ` David Marchand
2019-03-25 8:51 ` [dpdk-dev] [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:55 ` Andrew Rybchenko
2019-03-25 8:55 ` Andrew Rybchenko
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
2019-03-25 8:51 ` David Marchand
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 3/4] app/testpmd: remove useless casts on statistics David Marchand
2019-03-25 8:51 ` David Marchand
2019-03-25 8:51 ` [dpdk-dev] [PATCH v5 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-25 8:51 ` David Marchand
2019-03-25 14:05 ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly Ferruh Yigit
2019-03-25 14:05 ` Ferruh Yigit
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).