Skip to contentSkip to conversation

ethdev: add RX errors counter for missed, badcrc and badlen packets

PATCH In review David Marchand 3 participants 5 messages May 22, 2014 – Jun 17, 2014 4 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethdev: add RX errors counter for missed, badcrc and badlen packets

From: Ivan Boule <[email protected]>

Split input error stats to have a better understanding of why packets have been dropped.
Keep ierrors field untouched for backward compatibility.

---
 app/test-pmd/config.c               |   24 +++++++++++++++++-------
 app/test-pmd/testpmd.c              |   32 ++++++++++++++++++++------------
 examples/load_balancer/runtime.c    |    2 +-
 lib/librte_ether/rte_ethdev.h       |    3 +++
 lib/librte_pmd_e1000/em_ethdev.c    |    9 +++++++--
 lib/librte_pmd_e1000/igb_ethdev.c   |    9 +++++++--
 lib/librte_pmd_ixgbe/ixgbe_ethdev.c |   12 +++++++++---
 7 files changed, 64 insertions(+), 27 deletions(-)
app/test-pmd/config.c +17 -7
index 89aa8b2..d3934e5 100644
@@ -126,19 +126,29 @@ nic_stats_display(portid_t port_id)
 	       nic_stats_border, port_id, nic_stats_border);
 
 	if ((!port->rx_queue_stats_mapping_enabled) && (!port->tx_queue_stats_mapping_enabled)) {
-		printf("  RX-packets: %-10"PRIu64" RX-errors: %-10"PRIu64"RX-bytes: "
-		       "%-"PRIu64"\n"
-		       "  TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64"TX-bytes: "
+		printf("  RX-packets: %-10"PRIu64" RX-missed: %-10"PRIu64" RX-bytes: "
+		       "%-"PRIu64"\n",
+		       stats.ipackets, stats.imissed, stats.ibytes);
+		printf("  RX-badcrc:  %-10"PRIu64" RX-badlen: %-10"PRIu64" RX-errors: "
+		       "%-"PRIu64"\n",
+		       stats.ibadcrc, stats.ibadlen, stats.ierrors);
+		printf("  RX-nombuf:  %-10"PRIu64"\n",
+		       stats.rx_nombuf);
+		printf("  TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64" TX-bytes: "
 		       "%-"PRIu64"\n",
-		       stats.ipackets, stats.ierrors, stats.ibytes,
 		       stats.opackets, stats.oerrors, stats.obytes);
 	}
 	else {
 		printf("  RX-packets:              %10"PRIu64"    RX-errors: %10"PRIu64
-		       "    RX-bytes: %10"PRIu64"\n"
-		       "  TX-packets:              %10"PRIu64"    TX-errors: %10"PRIu64
+		       "    RX-bytes: %10"PRIu64"\n",
+		       stats.ipackets, stats.ierrors, stats.ibytes);
+		printf("  RX-badcrc:               %10"PRIu64"    RX-badlen: %10"PRIu64
+		       "  RX-errors:  %10"PRIu64"\n",
+		       stats.ibadcrc, stats.ibadlen, stats.ierrors);
+		printf("  RX-nombuf:               %10"PRIu64"\n",
+		       stats.rx_nombuf);
+		printf("  TX-packets:              %10"PRIu64"    TX-errors: %10"PRIu64
 		       "    TX-bytes: %10"PRIu64"\n",
-		       stats.ipackets, stats.ierrors, stats.ibytes,
 		       stats.opackets, stats.oerrors, stats.obytes);
 	}
 
app/test-pmd/testpmd.c +20 -12
index bc38305..ac8c9f3 100644
@@ -770,8 +770,8 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 	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->ierrors,
-		       (uint64_t) (stats->ipackets + stats->ierrors));
+		       stats->ipackets, stats->imissed,
+		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64" \n",
@@ -782,15 +782,19 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 		       stats->opackets, port->tx_dropped,
 		       (uint64_t) (stats->opackets + port->tx_dropped));
 
-		if (stats->rx_nombuf > 0)
-			printf("  RX-nombufs: %-14"PRIu64"\n", stats->rx_nombuf);
+		if (((stats->ierrors - stats->imissed) + stats->rx_nombuf) > 0) {
+			printf("  RX-badcrc: %-14"PRIu64" RX-badlen: %-14"PRIu64"RX-errors: %-"PRIu64"\n",
+		           stats->ibadcrc, stats->ibadlen, stats->ierrors);
+			printf("  RX-nombufs: %-14"PRIu64"\n",
+			       stats->rx_nombuf);
+		}
 
 	}
 	else {
 		printf("  RX-packets:             %14"PRIu64"    RX-dropped:%14"PRIu64"    RX-total:"
 		       "%14"PRIu64"\n",
-		       stats->ipackets, stats->ierrors,
-		       (uint64_t) (stats->ipackets + stats->ierrors));
+		       stats->ipackets, stats->imissed,
+		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"\n",
@@ -800,9 +804,13 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 		       "%14"PRIu64"\n",
 		       stats->opackets, port->tx_dropped,
 		       (uint64_t) (stats->opackets + port->tx_dropped));
-
-		if (stats->rx_nombuf > 0)
-			printf("  RX-nombufs:%14"PRIu64"\n", stats->rx_nombuf);
+		if (((stats->ierrors - stats->imissed) + stats->rx_nombuf) > 0) {
+			printf("  RX-badcrc:              %14"PRIu64"    RX-badlen: %14"PRIu64"    RX-errors:"
+			       "%"PRIu64"\n",
+			       stats->ibadcrc, stats->ibadlen, stats->ierrors);
+			printf("  RX-nombufs:             %14"PRIu64"\n",
+			       stats->rx_nombuf);
+		}
 	}
 
 	/* Display statistics of XON/XOFF pause frames, if any. */
@@ -1164,8 +1172,8 @@ stop_packet_forwarding(void)
 		port->stats.ibytes = 0;
 		stats.obytes   -= port->stats.obytes;
 		port->stats.obytes = 0;
-		stats.ierrors  -= port->stats.ierrors;
-		port->stats.ierrors = 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;
@@ -1177,7 +1185,7 @@ stop_packet_forwarding(void)
 
 		total_recv += stats.ipackets;
 		total_xmit += stats.opackets;
-		total_rx_dropped += stats.ierrors;
+		total_rx_dropped += stats.imissed;
 		total_tx_dropped += port->tx_dropped;
 		total_rx_nombuf  += stats.rx_nombuf;
 
examples/load_balancer/runtime.c +1 -1
index e85abdb..6c63c26 100644
@@ -215,7 +215,7 @@ app_lcore_io_rx(
 			printf("I/O RX %u in (NIC port %u): NIC drop ratio = %.2f avg burst size = %.2f\n",
 				lcore,
 				(unsigned) port,
-				(double) stats.ierrors / (double) (stats.ierrors + stats.ipackets),
+				(double) stats.imissed / (double) (stats.imissed + stats.ipackets),
 				((double) lp->rx.nic_queues_count[i]) / ((double) lp->rx.nic_queues_iters[i]));
 			lp->rx.nic_queues_iters[i] = 0;
 			lp->rx.nic_queues_count[i] = 0;
lib/librte_ether/rte_ethdev.h +3 -0
index 4bf2383..d839b8c 100644
@@ -186,6 +186,9 @@ struct rte_eth_stats {
 	uint64_t opackets;  /**< Total number of successfully transmitted packets.*/
 	uint64_t ibytes;    /**< Total number of successfully received bytes. */
 	uint64_t obytes;    /**< Total number of successfully transmitted bytes. */
+	uint64_t imissed;   /**< Total of RX missed packets (e.g full FIFO). */
+	uint64_t ibadcrc;   /**< Total of RX packets with CRC error. */
+	uint64_t ibadlen;   /**< Total of RX packets with bad length. */
 	uint64_t ierrors;   /**< Total number of erroneous received packets. */
 	uint64_t oerrors;   /**< Total number of failed transmitted packets. */
 	uint64_t imcasts;   /**< Total number of multicast received packets. */
lib/librte_pmd_e1000/em_ethdev.c +7 -2
index 493806c..2f0e1a0 100644
@@ -793,8 +793,13 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)
 		return;
 
 	/* Rx Errors */
-	rte_stats->ierrors = stats->rxerrc + stats->crcerrs + stats->algnerrc +
-		stats->ruc + stats->roc + stats->mpc + stats->cexterr;
+	rte_stats->ibadcrc = stats->crcerrs;
+	rte_stats->ibadlen = stats->rlec + stats->ruc + stats->roc;
+	rte_stats->imissed = stats->mpc;
+	rte_stats->ierrors = rte_stats->ibadcrc +
+	                     rte_stats->ibadlen +
+	                     rte_stats->imissed +
+	                     stats->rxerrc + stats->algnerrc + stats->cexterr;
 
 	/* Tx Errors */
 	rte_stats->oerrors = stats->ecol + stats->latecol;
lib/librte_pmd_e1000/igb_ethdev.c +7 -2
index 5f93bcf..777413e 100644
@@ -1087,8 +1087,13 @@ eth_igb_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)
 		return;
 
 	/* Rx Errors */
-	rte_stats->ierrors = stats->rxerrc + stats->crcerrs + stats->algnerrc +
-	    stats->ruc + stats->roc + stats->mpc + stats->cexterr;
+	rte_stats->ibadcrc = stats->crcerrs;
+	rte_stats->ibadlen = stats->rlec + stats->ruc + stats->roc;
+	rte_stats->imissed = stats->mpc;
+	rte_stats->ierrors = rte_stats->ibadcrc +
+	                     rte_stats->ibadlen +
+	                     rte_stats->imissed +
+	                     stats->rxerrc + stats->algnerrc + stats->cexterr;
 
 	/* Tx Errors */
 	rte_stats->oerrors = stats->ecol + stats->latecol;
lib/librte_pmd_ixgbe/ixgbe_ethdev.c +9 -3
index 327da0b..d1718e1 100644
@@ -1702,9 +1702,15 @@ ixgbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	}
 
 	/* Rx Errors */
-	stats->ierrors = total_missed_rx + hw_stats->crcerrs +
-		hw_stats->rlec;
-
+	stats->ibadcrc  = hw_stats->crcerrs;
+	stats->ibadlen  = hw_stats->rlec + hw_stats->ruc + hw_stats->roc;
+	stats->imissed  = total_missed_rx;
+	stats->ierrors  = stats->ibadcrc +
+	                  stats->ibadlen +
+	                  stats->imissed +
+	                  hw_stats->illerrc + hw_stats->errbc;
+
+	/* Tx Errors */
 	stats->oerrors  = 0;
 
 	/* XON/XOFF pause frames */
Signature · 1 line
1.7.10.4

A message that is not in the archive (sent off-list or not yet received): 1400783309-14666-1-git-send-email-david.marchand-pdR9zngts4EAvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 271 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of David Marchand
Sent: Thursday, May 22, 2014 7:28 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH] ethdev: add RX errors counter for missed, badcrc and badlen packets

From: Ivan Boule <[email protected]>

Split input error stats to have a better understanding of why packets have been
dropped.
Keep ierrors field untouched for backward compatibility.

---
 app/test-pmd/config.c               |   24 +++++++++++++++++-------
 app/test-pmd/testpmd.c              |   32 ++++++++++++++++++++------------
 examples/load_balancer/runtime.c    |    2 +-
 lib/librte_ether/rte_ethdev.h       |    3 +++
 lib/librte_pmd_e1000/em_ethdev.c    |    9 +++++++--
 lib/librte_pmd_e1000/igb_ethdev.c   |    9 +++++++--
 lib/librte_pmd_ixgbe/ixgbe_ethdev.c |   12 +++++++++---
 7 files changed, 64 insertions(+), 27 deletions(-)
app/test-pmd/config.c +0 -1
index 89aa8b2..d3934e5 100644
@@ -126,19 +126,29 @@ nic_stats_display(portid_t port_id)
 	       nic_stats_border, port_id, nic_stats_border);
 
 	if ((!port->rx_queue_stats_mapping_enabled) && (!port-
 >tx_queue_stats_mapping_enabled)) {
-		printf("  RX-packets: %-10"PRIu64" RX-errors: %-

10"PRIu64"RX-bytes: "

app/test-pmd/config.c +0 -2
-		       "%-"PRIu64"\n"
-		       "  TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64"TX-

bytes: "

app/test-pmd/config.c +1 -0
+		printf("  RX-packets: %-10"PRIu64" RX-missed: %-10"PRIu64"

RX-bytes: "

app/test-pmd/config.c +3 -0
+		       "%-"PRIu64"\n",
+		       stats.ipackets, stats.imissed, stats.ibytes);
+		printf("  RX-badcrc:  %-10"PRIu64" RX-badlen: %-10"PRIu64"

RX-errors: "

app/test-pmd/config.c +5 -0
+		       "%-"PRIu64"\n",
+		       stats.ibadcrc, stats.ibadlen, stats.ierrors);
+		printf("  RX-nombuf:  %-10"PRIu64"\n",
+		       stats.rx_nombuf);
+		printf("  TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64"

TX-bytes: "

app/test-pmd/config.c +0 -1
 		       "%-"PRIu64"\n",
-		       stats.ipackets, stats.ierrors, stats.ibytes,
 		       stats.opackets, stats.oerrors, stats.obytes);
 	}
 	else {
 		printf("  RX-packets:              %10"PRIu64"    RX-errors:

%10"PRIu64

app/test-pmd/config.c +0 -2
-		       "    RX-bytes: %10"PRIu64"\n"
-		       "  TX-packets:              %10"PRIu64"    TX-errors:

%10"PRIu64

app/test-pmd/config.c +3 -0
+		       "    RX-bytes: %10"PRIu64"\n",
+		       stats.ipackets, stats.ierrors, stats.ibytes);
+		printf("  RX-badcrc:               %10"PRIu64"    RX-badlen:

%10"PRIu64

app/test-pmd/config.c +5 -0
+		       "  RX-errors:  %10"PRIu64"\n",
+		       stats.ibadcrc, stats.ibadlen, stats.ierrors);
+		printf("  RX-nombuf:               %10"PRIu64"\n",
+		       stats.rx_nombuf);
+		printf("  TX-packets:              %10"PRIu64"    TX-errors:

%10"PRIu64

app/test-pmd/config.c +0 -1
 		       "    TX-bytes: %10"PRIu64"\n",
-		       stats.ipackets, stats.ierrors, stats.ibytes,
 		       stats.opackets, stats.oerrors, stats.obytes);
 	}
app/test-pmd/testpmd.c +0 -0
index bc38305..ac8c9f3 100644
@@ -770,8 +770,8 @@ fwd_port_stats_display(portid_t port_id, struct
 rte_eth_stats *stats)
 	if ((!port->rx_queue_stats_mapping_enabled) && (!port-
 >tx_queue_stats_mapping_enabled)) {
 		printf("  RX-packets: %-14"PRIu64" RX-dropped: %-

14"PRIu64"RX-total: "

app/test-pmd/testpmd.c +2 -2
 		       "%-"PRIu64"\n",
-		       stats->ipackets, stats->ierrors,
-		       (uint64_t) (stats->ipackets + stats->ierrors));
+		       stats->ipackets, stats->imissed,
+		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-

14"PRIu64" \n",

app/test-pmd/testpmd.c +6 -2
@@ -782,15 +782,19 @@ fwd_port_stats_display(portid_t port_id, struct
 rte_eth_stats *stats)
 		       stats->opackets, port->tx_dropped,
 		       (uint64_t) (stats->opackets + port->tx_dropped));
 
-		if (stats->rx_nombuf > 0)
-			printf("  RX-nombufs: %-14"PRIu64"\n", stats-
 >rx_nombuf);
+		if (((stats->ierrors - stats->imissed) + stats->rx_nombuf) > 0) {
+			printf("  RX-badcrc: %-14"PRIu64" RX-badlen: %-
 14"PRIu64"RX-errors: %-"PRIu64"\n",
+		           stats->ibadcrc, stats->ibadlen, stats->ierrors);
+			printf("  RX-nombufs: %-14"PRIu64"\n",
+			       stats->rx_nombuf);
+		}
 
 	}
 	else {
 		printf("  RX-packets:             %14"PRIu64"    RX-

dropped:%14"PRIu64" RX-total:"

app/test-pmd/testpmd.c +2 -2
 		       "%14"PRIu64"\n",
-		       stats->ipackets, stats->ierrors,
-		       (uint64_t) (stats->ipackets + stats->ierrors));
+		       stats->ipackets, stats->imissed,
+		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum:%14"PRIu64"    Bad-

l4csum:%14"PRIu64"\n",

app/test-pmd/testpmd.c +2 -3
@@ -800,9 +804,13 @@ fwd_port_stats_display(portid_t port_id, struct
 rte_eth_stats *stats)
 		       "%14"PRIu64"\n",
 		       stats->opackets, port->tx_dropped,
 		       (uint64_t) (stats->opackets + port->tx_dropped));
-
-		if (stats->rx_nombuf > 0)
-			printf("  RX-nombufs:%14"PRIu64"\n", stats-
 >rx_nombuf);
+		if (((stats->ierrors - stats->imissed) + stats->rx_nombuf) > 0) {
+			printf("  RX-badcrc:              %14"PRIu64"    RX-badlen:

%14"PRIu64" RX-errors:"

app/test-pmd/testpmd.c +8 -3
+			       "%"PRIu64"\n",
+			       stats->ibadcrc, stats->ibadlen, stats->ierrors);
+			printf("  RX-nombufs:             %14"PRIu64"\n",
+			       stats->rx_nombuf);
+		}
 	}
 
 	/* Display statistics of XON/XOFF pause frames, if any. */
@@ -1164,8 +1172,8 @@ stop_packet_forwarding(void)
 		port->stats.ibytes = 0;
 		stats.obytes   -= port->stats.obytes;
 		port->stats.obytes = 0;
-		stats.ierrors  -= port->stats.ierrors;
-		port->stats.ierrors = 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;
@@ -1177,7 +1185,7 @@ stop_packet_forwarding(void)
 
 		total_recv += stats.ipackets;
 		total_xmit += stats.opackets;
-		total_rx_dropped += stats.ierrors;
+		total_rx_dropped += stats.imissed;
 		total_tx_dropped += port->tx_dropped;
 		total_rx_nombuf  += stats.rx_nombuf;
 
examples/load_balancer/runtime.c +2 -1
index e85abdb..6c63c26 100644
@@ -215,7 +215,7 @@ app_lcore_io_rx(
 			printf("I/O RX %u in (NIC port %u): NIC drop ratio =
 %.2f avg burst size = %.2f\n",
 				lcore,
 				(unsigned) port,
-				(double) stats.ierrors / (double) (stats.ierrors
+ stats.ipackets),
+				(double) stats.imissed / (double)
 (stats.imissed + stats.ipackets),
 				((double) lp->rx.nic_queues_count[i]) /

((double) lp->rx.nic_queues_iters[i]));

examples/load_balancer/runtime.c +0 -0
 			lp->rx.nic_queues_iters[i] = 0;
 			lp->rx.nic_queues_count[i] = 0;
lib/librte_ether/rte_ethdev.h +0 -0
index 4bf2383..d839b8c 100644
@@ -186,6 +186,9 @@ struct rte_eth_stats {
 	uint64_t opackets;  /**< Total number of successfully transmitted

packets.*/
uint64_t ibytes; /**< Total number of successfully received bytes.
*/
uint64_t obytes; /**< Total number of successfully transmitted
bytes. */

lib/librte_ether/rte_ethdev.h +3 -0
+	uint64_t imissed;   /**< Total of RX missed packets (e.g full FIFO). */
+	uint64_t ibadcrc;   /**< Total of RX packets with CRC error. */
+	uint64_t ibadlen;   /**< Total of RX packets with bad length. */
 	uint64_t ierrors;   /**< Total number of erroneous received packets.

*/
uint64_t oerrors; /**< Total number of failed transmitted packets.
*/
uint64_t imcasts; /**< Total number of multicast received packets.
*/

lib/librte_pmd_e1000/em_ethdev.c +7 -2
index 493806c..2f0e1a0 100644
@@ -793,8 +793,13 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct
 rte_eth_stats *rte_stats)
 		return;
 
 	/* Rx Errors */
-	rte_stats->ierrors = stats->rxerrc + stats->crcerrs + stats->algnerrc +
-		stats->ruc + stats->roc + stats->mpc + stats->cexterr;
+	rte_stats->ibadcrc = stats->crcerrs;
+	rte_stats->ibadlen = stats->rlec + stats->ruc + stats->roc;
+	rte_stats->imissed = stats->mpc;
+	rte_stats->ierrors = rte_stats->ibadcrc +
+	                     rte_stats->ibadlen +
+	                     rte_stats->imissed +
+	                     stats->rxerrc + stats->algnerrc + stats->cexterr;
 
 	/* Tx Errors */
lib/librte_pmd_e1000/em_ethdev.c +0 -0
 	rte_stats->oerrors = stats->ecol + stats->latecol;
lib/librte_pmd_e1000/igb_ethdev.c +7 -2
index 5f93bcf..777413e 100644
@@ -1087,8 +1087,13 @@ eth_igb_stats_get(struct rte_eth_dev *dev, struct
 rte_eth_stats *rte_stats)
 		return;
 
 	/* Rx Errors */
-	rte_stats->ierrors = stats->rxerrc + stats->crcerrs + stats->algnerrc +
-	    stats->ruc + stats->roc + stats->mpc + stats->cexterr;
+	rte_stats->ibadcrc = stats->crcerrs;
+	rte_stats->ibadlen = stats->rlec + stats->ruc + stats->roc;
+	rte_stats->imissed = stats->mpc;
+	rte_stats->ierrors = rte_stats->ibadcrc +
+	                     rte_stats->ibadlen +
+	                     rte_stats->imissed +
+	                     stats->rxerrc + stats->algnerrc + stats->cexterr;
 
 	/* Tx Errors */
lib/librte_pmd_e1000/igb_ethdev.c +0 -0
 	rte_stats->oerrors = stats->ecol + stats->latecol;
lib/librte_pmd_ixgbe/ixgbe_ethdev.c +9 -3
index 327da0b..d1718e1 100644
@@ -1702,9 +1702,15 @@ ixgbe_dev_stats_get(struct rte_eth_dev *dev,
 struct rte_eth_stats *stats)
 	}
 
 	/* Rx Errors */
-	stats->ierrors = total_missed_rx + hw_stats->crcerrs +
-		hw_stats->rlec;
-
+	stats->ibadcrc  = hw_stats->crcerrs;
+	stats->ibadlen  = hw_stats->rlec + hw_stats->ruc + hw_stats->roc;
+	stats->imissed  = total_missed_rx;
+	stats->ierrors  = stats->ibadcrc +
+	                  stats->ibadlen +
+	                  stats->imissed +
+	                  hw_stats->illerrc + hw_stats->errbc;
+
+	/* Tx Errors */
 	stats->oerrors  = 0;
 
Quoted 3 lines

/* XON/XOFF pause frames */
--
1.7.10.4

In function fwd_port_stats_display(), for aligning purposes, the following change should be made:

	if (((stats->ierrors - stats->imissed) + stats->rx_nombuf) > 0) {
-                        printf("  RX-badcrc: %-14"PRIu64" RX-badlen: %-14"PRIu64"RX-errors: %-"PRIu64"\n",
+                       printf("  RX-badcrc: %-15"PRIu64" RX-badlen: %-15"PRIu64"RX-errors: %-"PRIu64"\n",
                           stats->ibadcrc, stats->ibadlen, stats->ierrors);

So, Rx-badlen will be aligned to TX-dropped in the line above and RX-errors will be aligned to TX-total.

Thanks,
Pablo

A message that is not in the archive (sent off-list or not yet received): E115CCD9D858EF4F90C690B0DCB4D897082C9DD7-kPTMFJFq+rELt2AQoY/[email protected]

#4 lore raw

PATCH v2 1/1 ethdev: add Rx error counters for missed, badcrc and badlen packets

From: Ivan Boule <[email protected]>

Split input error stats to have a better understanding of why packets have been dropped.
Keep ierrors field untouched for backward compatibility.

---
 app/test-pmd/config.c               | 24 +++++++++++++++++-------
 app/test-pmd/testpmd.c              | 34 ++++++++++++++++++++--------------
 examples/load_balancer/runtime.c    |  2 +-
 lib/librte_ether/rte_ethdev.h       |  3 +++
 lib/librte_pmd_e1000/em_ethdev.c    |  9 +++++++--
 lib/librte_pmd_e1000/igb_ethdev.c   |  9 +++++++--
 lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 12 +++++++++---
 7 files changed, 64 insertions(+), 29 deletions(-)

changes in v2:
- fix alignments when displaying fwd and nic statistics in testpmd

app/test-pmd/config.c +17 -7
index e0298c6..2137fd3 100644
@@ -126,19 +126,29 @@ nic_stats_display(portid_t port_id)
 	       nic_stats_border, port_id, nic_stats_border);
 
 	if ((!port->rx_queue_stats_mapping_enabled) && (!port->tx_queue_stats_mapping_enabled)) {
-		printf("  RX-packets: %-10"PRIu64" RX-errors: %-10"PRIu64"RX-bytes: "
-		       "%-"PRIu64"\n"
-		       "  TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64"TX-bytes: "
+		printf("  RX-packets: %-10"PRIu64" RX-missed: %-10"PRIu64" RX-bytes:  "
+		       "%-"PRIu64"\n",
+		       stats.ipackets, stats.imissed, stats.ibytes);
+		printf("  RX-badcrc:  %-10"PRIu64" RX-badlen: %-10"PRIu64" RX-errors: "
+		       "%-"PRIu64"\n",
+		       stats.ibadcrc, stats.ibadlen, stats.ierrors);
+		printf("  RX-nombuf:  %-10"PRIu64"\n",
+		       stats.rx_nombuf);
+		printf("  TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64" TX-bytes:  "
 		       "%-"PRIu64"\n",
-		       stats.ipackets, stats.ierrors, stats.ibytes,
 		       stats.opackets, stats.oerrors, stats.obytes);
 	}
 	else {
 		printf("  RX-packets:              %10"PRIu64"    RX-errors: %10"PRIu64
-		       "    RX-bytes: %10"PRIu64"\n"
-		       "  TX-packets:              %10"PRIu64"    TX-errors: %10"PRIu64
+		       "    RX-bytes: %10"PRIu64"\n",
+		       stats.ipackets, stats.ierrors, stats.ibytes);
+		printf("  RX-badcrc:               %10"PRIu64"    RX-badlen: %10"PRIu64
+		       "  RX-errors:  %10"PRIu64"\n",
+		       stats.ibadcrc, stats.ibadlen, stats.ierrors);
+		printf("  RX-nombuf:               %10"PRIu64"\n",
+		       stats.rx_nombuf);
+		printf("  TX-packets:              %10"PRIu64"    TX-errors: %10"PRIu64
 		       "    TX-bytes: %10"PRIu64"\n",
-		       stats.ipackets, stats.ierrors, stats.ibytes,
 		       stats.opackets, stats.oerrors, stats.obytes);
 	}
 
app/test-pmd/testpmd.c +20 -14
index 2529dc3..0727fb3 100644
@@ -770,39 +770,45 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 	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->ierrors,
-		       (uint64_t) (stats->ipackets + stats->ierrors));
+		       stats->ipackets, stats->imissed,
+		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64" \n",
 			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+		if (((stats->ierrors - stats->imissed) + stats->rx_nombuf) > 0) {
+			printf("  RX-badcrc:  %-14"PRIu64" RX-badlen:  %-14"PRIu64
+			       "RX-error: %-"PRIu64"\n",
+			       stats->ibadcrc, stats->ibadlen, 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,
 		       (uint64_t) (stats->opackets + port->tx_dropped));
-
-		if (stats->rx_nombuf > 0)
-			printf("  RX-nombufs: %-14"PRIu64"\n", stats->rx_nombuf);
-
 	}
 	else {
 		printf("  RX-packets:             %14"PRIu64"    RX-dropped:%14"PRIu64"    RX-total:"
 		       "%14"PRIu64"\n",
-		       stats->ipackets, stats->ierrors,
-		       (uint64_t) (stats->ipackets + stats->ierrors));
+		       stats->ipackets, stats->imissed,
+		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"\n",
 			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+		if (((stats->ierrors - stats->imissed) + stats->rx_nombuf) > 0) {
+			printf("  RX-badcrc:              %14"PRIu64"    RX-badlen: %14"PRIu64
+			       "    RX-error:%"PRIu64"\n",
+			       stats->ibadcrc, stats->ibadlen, 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,
 		       (uint64_t) (stats->opackets + port->tx_dropped));
-
-		if (stats->rx_nombuf > 0)
-			printf("  RX-nombufs:%14"PRIu64"\n", stats->rx_nombuf);
 	}
 
 	/* Display statistics of XON/XOFF pause frames, if any. */
@@ -1164,8 +1170,8 @@ stop_packet_forwarding(void)
 		port->stats.ibytes = 0;
 		stats.obytes   -= port->stats.obytes;
 		port->stats.obytes = 0;
-		stats.ierrors  -= port->stats.ierrors;
-		port->stats.ierrors = 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;
@@ -1177,7 +1183,7 @@ stop_packet_forwarding(void)
 
 		total_recv += stats.ipackets;
 		total_xmit += stats.opackets;
-		total_rx_dropped += stats.ierrors;
+		total_rx_dropped += stats.imissed;
 		total_tx_dropped += port->tx_dropped;
 		total_rx_nombuf  += stats.rx_nombuf;
 
examples/load_balancer/runtime.c +1 -1
index 438224a..9612392 100644
@@ -215,7 +215,7 @@ app_lcore_io_rx(
 			printf("I/O RX %u in (NIC port %u): NIC drop ratio = %.2f avg burst size = %.2f\n",
 				lcore,
 				(unsigned) port,
-				(double) stats.ierrors / (double) (stats.ierrors + stats.ipackets),
+				(double) stats.imissed / (double) (stats.imissed + stats.ipackets),
 				((double) lp->rx.nic_queues_count[i]) / ((double) lp->rx.nic_queues_iters[i]));
 			lp->rx.nic_queues_iters[i] = 0;
 			lp->rx.nic_queues_count[i] = 0;
lib/librte_ether/rte_ethdev.h +3 -0
index 202c899..807aa42 100644
@@ -186,6 +186,9 @@ struct rte_eth_stats {
 	uint64_t opackets;  /**< Total number of successfully transmitted packets.*/
 	uint64_t ibytes;    /**< Total number of successfully received bytes. */
 	uint64_t obytes;    /**< Total number of successfully transmitted bytes. */
+	uint64_t imissed;   /**< Total of RX missed packets (e.g full FIFO). */
+	uint64_t ibadcrc;   /**< Total of RX packets with CRC error. */
+	uint64_t ibadlen;   /**< Total of RX packets with bad length. */
 	uint64_t ierrors;   /**< Total number of erroneous received packets. */
 	uint64_t oerrors;   /**< Total number of failed transmitted packets. */
 	uint64_t imcasts;   /**< Total number of multicast received packets. */
lib/librte_pmd_e1000/em_ethdev.c +7 -2
index 398838f..ef2408c 100644
@@ -793,8 +793,13 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)
 		return;
 
 	/* Rx Errors */
-	rte_stats->ierrors = stats->rxerrc + stats->crcerrs + stats->algnerrc +
-		stats->ruc + stats->roc + stats->mpc + stats->cexterr;
+	rte_stats->ibadcrc = stats->crcerrs;
+	rte_stats->ibadlen = stats->rlec + stats->ruc + stats->roc;
+	rte_stats->imissed = stats->mpc;
+	rte_stats->ierrors = rte_stats->ibadcrc +
+	                     rte_stats->ibadlen +
+	                     rte_stats->imissed +
+	                     stats->rxerrc + stats->algnerrc + stats->cexterr;
 
 	/* Tx Errors */
 	rte_stats->oerrors = stats->ecol + stats->latecol;
lib/librte_pmd_e1000/igb_ethdev.c +7 -2
index f043c28..b24bf0a 100644
@@ -1138,8 +1138,13 @@ eth_igb_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)
 		return;
 
 	/* Rx Errors */
-	rte_stats->ierrors = stats->rxerrc + stats->crcerrs + stats->algnerrc +
-	    stats->ruc + stats->roc + stats->mpc + stats->cexterr;
+	rte_stats->ibadcrc = stats->crcerrs;
+	rte_stats->ibadlen = stats->rlec + stats->ruc + stats->roc;
+	rte_stats->imissed = stats->mpc;
+	rte_stats->ierrors = rte_stats->ibadcrc +
+	                     rte_stats->ibadlen +
+	                     rte_stats->imissed +
+	                     stats->rxerrc + stats->algnerrc + stats->cexterr;
 
 	/* Tx Errors */
 	rte_stats->oerrors = stats->ecol + stats->latecol;
lib/librte_pmd_ixgbe/ixgbe_ethdev.c +9 -3
index 5f6a0f7..e2988e5 100644
@@ -1816,9 +1816,15 @@ ixgbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	}
 
 	/* Rx Errors */
-	stats->ierrors = total_missed_rx + hw_stats->crcerrs +
-		hw_stats->rlec;
-
+	stats->ibadcrc  = hw_stats->crcerrs;
+	stats->ibadlen  = hw_stats->rlec + hw_stats->ruc + hw_stats->roc;
+	stats->imissed  = total_missed_rx;
+	stats->ierrors  = stats->ibadcrc +
+	                  stats->ibadlen +
+	                  stats->imissed +
+	                  hw_stats->illerrc + hw_stats->errbc;
+
+	/* Tx Errors */
 	stats->oerrors  = 0;
 
 	/* XON/XOFF pause frames */
Signature · 1 line
2.0.0

A message that is not in the archive (sent off-list or not yet received): 1402610141-27148-1-git-send-email-thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org

#6 lore raw

Re: [PATCH v2] ethdev: add Rx error counters for missed, badcrc and badlen packets

Quoted 281 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, June 12, 2014 10:56 PM
To: [email protected]
Cc: [email protected]; De Lara Guarch, Pablo; Ivan Boule
Subject: [PATCH v2] ethdev: add Rx error counters for missed, badcrc and badlen packets

From: Ivan Boule <[email protected]>

Split input error stats to have a better understanding of why packets have been dropped.
Keep ierrors field untouched for backward compatibility.

---
 app/test-pmd/config.c               | 24 +++++++++++++++++-------
 app/test-pmd/testpmd.c              | 34 ++++++++++++++++++++--------------
 examples/load_balancer/runtime.c    |  2 +-
 lib/librte_ether/rte_ethdev.h       |  3 +++
 lib/librte_pmd_e1000/em_ethdev.c    |  9 +++++++--
 lib/librte_pmd_e1000/igb_ethdev.c   |  9 +++++++--
 lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 12 +++++++++---
 7 files changed, 64 insertions(+), 29 deletions(-)

changes in v2:
- fix alignments when displaying fwd and nic statistics in testpmd

app/test-pmd/config.c +0 -1
index e0298c6..2137fd3 100644
@@ -126,19 +126,29 @@ nic_stats_display(portid_t port_id)
 	       nic_stats_border, port_id, nic_stats_border);
 
 	if ((!port->rx_queue_stats_mapping_enabled) && (!port-
 >tx_queue_stats_mapping_enabled)) {
-		printf("  RX-packets: %-10"PRIu64" RX-errors: %-

10"PRIu64"RX-bytes: "

app/test-pmd/config.c +0 -2
-		       "%-"PRIu64"\n"
-		       "  TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64"TX-

bytes: "

app/test-pmd/config.c +1 -0
+		printf("  RX-packets: %-10"PRIu64" RX-missed: %-10"PRIu64"

RX-bytes: "

app/test-pmd/config.c +3 -0
+		       "%-"PRIu64"\n",
+		       stats.ipackets, stats.imissed, stats.ibytes);
+		printf("  RX-badcrc:  %-10"PRIu64" RX-badlen: %-10"PRIu64"

RX-errors: "

app/test-pmd/config.c +5 -0
+		       "%-"PRIu64"\n",
+		       stats.ibadcrc, stats.ibadlen, stats.ierrors);
+		printf("  RX-nombuf:  %-10"PRIu64"\n",
+		       stats.rx_nombuf);
+		printf("  TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64"

TX-bytes: "

app/test-pmd/config.c +0 -1
 		       "%-"PRIu64"\n",
-		       stats.ipackets, stats.ierrors, stats.ibytes,
 		       stats.opackets, stats.oerrors, stats.obytes);
 	}
 	else {
 		printf("  RX-packets:              %10"PRIu64"    RX-errors:

%10"PRIu64

app/test-pmd/config.c +0 -2
-		       "    RX-bytes: %10"PRIu64"\n"
-		       "  TX-packets:              %10"PRIu64"    TX-errors:

%10"PRIu64

app/test-pmd/config.c +3 -0
+		       "    RX-bytes: %10"PRIu64"\n",
+		       stats.ipackets, stats.ierrors, stats.ibytes);
+		printf("  RX-badcrc:               %10"PRIu64"    RX-badlen:

%10"PRIu64

app/test-pmd/config.c +5 -0
+		       "  RX-errors:  %10"PRIu64"\n",
+		       stats.ibadcrc, stats.ibadlen, stats.ierrors);
+		printf("  RX-nombuf:               %10"PRIu64"\n",
+		       stats.rx_nombuf);
+		printf("  TX-packets:              %10"PRIu64"    TX-errors:

%10"PRIu64

app/test-pmd/config.c +0 -1
 		       "    TX-bytes: %10"PRIu64"\n",
-		       stats.ipackets, stats.ierrors, stats.ibytes,
 		       stats.opackets, stats.oerrors, stats.obytes);
 	}
app/test-pmd/testpmd.c +0 -0
index 2529dc3..0727fb3 100644
@@ -770,39 +770,45 @@ fwd_port_stats_display(portid_t port_id, struct
 rte_eth_stats *stats)
 	if ((!port->rx_queue_stats_mapping_enabled) && (!port-
 >tx_queue_stats_mapping_enabled)) {
 		printf("  RX-packets: %-14"PRIu64" RX-dropped: %-

14"PRIu64"RX-total: "

app/test-pmd/testpmd.c +2 -2
 		       "%-"PRIu64"\n",
-		       stats->ipackets, stats->ierrors,
-		       (uint64_t) (stats->ipackets + stats->ierrors));
+		       stats->ipackets, stats->imissed,
+		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-

14"PRIu64" \n",

app/test-pmd/testpmd.c +2 -0
 			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+		if (((stats->ierrors - stats->imissed) + stats->rx_nombuf) > 0) {
+			printf("  RX-badcrc:  %-14"PRIu64" RX-badlen:  %-

14"PRIu64

app/test-pmd/testpmd.c +3 -0
+			       "RX-error: %-"PRIu64"\n",
+			       stats->ibadcrc, stats->ibadlen, stats->ierrors);
+			printf("  RX-nombufs: %-14"PRIu64"\n", stats-
Quoted 1 line

rx_nombuf);

app/test-pmd/testpmd.c +1 -0
+		}
 
 		printf("  TX-packets: %-14"PRIu64" TX-dropped: %-

14"PRIu64"TX-total: "

app/test-pmd/testpmd.c +0 -3
 		       "%-"PRIu64"\n",
 		       stats->opackets, port->tx_dropped,
 		       (uint64_t) (stats->opackets + port->tx_dropped));
-
-		if (stats->rx_nombuf > 0)
-			printf("  RX-nombufs: %-14"PRIu64"\n", stats-
Quoted 1 line

rx_nombuf);

app/test-pmd/testpmd.c +0 -1
-
 	}
 	else {
 		printf("  RX-packets:             %14"PRIu64"    RX-

dropped:%14"PRIu64" RX-total:"

app/test-pmd/testpmd.c +2 -2
 		       "%14"PRIu64"\n",
-		       stats->ipackets, stats->ierrors,
-		       (uint64_t) (stats->ipackets + stats->ierrors));
+		       stats->ipackets, stats->imissed,
+		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
 			printf("  Bad-ipcsum:%14"PRIu64"    Bad-

l4csum:%14"PRIu64"\n",

app/test-pmd/testpmd.c +2 -0
 			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+		if (((stats->ierrors - stats->imissed) + stats->rx_nombuf) > 0) {
+			printf("  RX-badcrc:              %14"PRIu64"    RX-badlen:

%14"PRIu64

app/test-pmd/testpmd.c +5 -0
+			       "    RX-error:%"PRIu64"\n",
+			       stats->ibadcrc, stats->ibadlen, stats->ierrors);
+			printf("  RX-nombufs:             %14"PRIu64"\n",
+			       stats->rx_nombuf);
+		}
 
 		printf("  TX-packets:             %14"PRIu64"    TX-

dropped:%14"PRIu64" TX-total:"

app/test-pmd/testpmd.c +0 -3
 		       "%14"PRIu64"\n",
 		       stats->opackets, port->tx_dropped,
 		       (uint64_t) (stats->opackets + port->tx_dropped));
-
-		if (stats->rx_nombuf > 0)
-			printf("  RX-nombufs:%14"PRIu64"\n", stats-
Quoted 1 line

rx_nombuf);

app/test-pmd/testpmd.c +3 -3
 	}
 
 	/* Display statistics of XON/XOFF pause frames, if any. */
@@ -1164,8 +1170,8 @@ stop_packet_forwarding(void)
 		port->stats.ibytes = 0;
 		stats.obytes   -= port->stats.obytes;
 		port->stats.obytes = 0;
-		stats.ierrors  -= port->stats.ierrors;
-		port->stats.ierrors = 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;
@@ -1177,7 +1183,7 @@ stop_packet_forwarding(void)
 
 		total_recv += stats.ipackets;
 		total_xmit += stats.opackets;
-		total_rx_dropped += stats.ierrors;
+		total_rx_dropped += stats.imissed;
 		total_tx_dropped += port->tx_dropped;
 		total_rx_nombuf  += stats.rx_nombuf;
 
examples/load_balancer/runtime.c +2 -1
index 438224a..9612392 100644
@@ -215,7 +215,7 @@ app_lcore_io_rx(
 			printf("I/O RX %u in (NIC port %u): NIC drop ratio =
 %.2f avg burst size = %.2f\n",
 				lcore,
 				(unsigned) port,
-				(double) stats.ierrors / (double) (stats.ierrors
+ stats.ipackets),
+				(double) stats.imissed / (double)
 (stats.imissed + stats.ipackets),
 				((double) lp->rx.nic_queues_count[i]) /

((double) lp->rx.nic_queues_iters[i]));

examples/load_balancer/runtime.c +0 -0
 			lp->rx.nic_queues_iters[i] = 0;
 			lp->rx.nic_queues_count[i] = 0;
lib/librte_ether/rte_ethdev.h +0 -0
index 202c899..807aa42 100644
@@ -186,6 +186,9 @@ struct rte_eth_stats {
 	uint64_t opackets;  /**< Total number of successfully transmitted

packets.*/
uint64_t ibytes; /**< Total number of successfully received bytes.
*/
uint64_t obytes; /**< Total number of successfully transmitted
bytes. */

lib/librte_ether/rte_ethdev.h +3 -0
+	uint64_t imissed;   /**< Total of RX missed packets (e.g full FIFO). */
+	uint64_t ibadcrc;   /**< Total of RX packets with CRC error. */
+	uint64_t ibadlen;   /**< Total of RX packets with bad length. */
 	uint64_t ierrors;   /**< Total number of erroneous received packets.

*/
uint64_t oerrors; /**< Total number of failed transmitted packets.
*/
uint64_t imcasts; /**< Total number of multicast received packets.
*/

lib/librte_pmd_e1000/em_ethdev.c +7 -2
index 398838f..ef2408c 100644
@@ -793,8 +793,13 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct
 rte_eth_stats *rte_stats)
 		return;
 
 	/* Rx Errors */
-	rte_stats->ierrors = stats->rxerrc + stats->crcerrs + stats->algnerrc +
-		stats->ruc + stats->roc + stats->mpc + stats->cexterr;
+	rte_stats->ibadcrc = stats->crcerrs;
+	rte_stats->ibadlen = stats->rlec + stats->ruc + stats->roc;
+	rte_stats->imissed = stats->mpc;
+	rte_stats->ierrors = rte_stats->ibadcrc +
+	                     rte_stats->ibadlen +
+	                     rte_stats->imissed +
+	                     stats->rxerrc + stats->algnerrc + stats->cexterr;
 
 	/* Tx Errors */
lib/librte_pmd_e1000/em_ethdev.c +0 -0
 	rte_stats->oerrors = stats->ecol + stats->latecol;
lib/librte_pmd_e1000/igb_ethdev.c +7 -2
index f043c28..b24bf0a 100644
@@ -1138,8 +1138,13 @@ eth_igb_stats_get(struct rte_eth_dev *dev, struct
 rte_eth_stats *rte_stats)
 		return;
 
 	/* Rx Errors */
-	rte_stats->ierrors = stats->rxerrc + stats->crcerrs + stats->algnerrc +
-	    stats->ruc + stats->roc + stats->mpc + stats->cexterr;
+	rte_stats->ibadcrc = stats->crcerrs;
+	rte_stats->ibadlen = stats->rlec + stats->ruc + stats->roc;
+	rte_stats->imissed = stats->mpc;
+	rte_stats->ierrors = rte_stats->ibadcrc +
+	                     rte_stats->ibadlen +
+	                     rte_stats->imissed +
+	                     stats->rxerrc + stats->algnerrc + stats->cexterr;
 
 	/* Tx Errors */
lib/librte_pmd_e1000/igb_ethdev.c +0 -0
 	rte_stats->oerrors = stats->ecol + stats->latecol;
lib/librte_pmd_ixgbe/ixgbe_ethdev.c +9 -3
index 5f6a0f7..e2988e5 100644
@@ -1816,9 +1816,15 @@ ixgbe_dev_stats_get(struct rte_eth_dev *dev,
 struct rte_eth_stats *stats)
 	}
 
 	/* Rx Errors */
-	stats->ierrors = total_missed_rx + hw_stats->crcerrs +
-		hw_stats->rlec;
-
+	stats->ibadcrc  = hw_stats->crcerrs;
+	stats->ibadlen  = hw_stats->rlec + hw_stats->ruc + hw_stats->roc;
+	stats->imissed  = total_missed_rx;
+	stats->ierrors  = stats->ibadcrc +
+	                  stats->ibadlen +
+	                  stats->imissed +
+	                  hw_stats->illerrc + hw_stats->errbc;
+
+	/* Tx Errors */
 	stats->oerrors  = 0;
 
Quoted 3 lines

/* XON/XOFF pause frames */
--
2.0.0

A message that is not in the archive (sent off-list or not yet received): E115CCD9D858EF4F90C690B0DCB4D897082CB85B-kPTMFJFq+rELt2AQoY/[email protected]

#8 lore raw

Re: [PATCH v2] ethdev: add Rx error counters for missed, badcrc and badlen packets

Quoted 11 lines
Quoted 9 lines

From: Ivan Boule <[email protected]>

Split input error stats to have a better understanding of why packets have been dropped.
Keep ierrors field untouched for backward compatibility.

Applied for version 1.7.0.

Thanks

Signature · 1 line
Thomas