ethdev: remove missed packets from error counter
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 10 Mar 2016 13:03:30 +0000 (16:03 +0300)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 22 Mar 2016 10:07:28 +0000 (11:07 +0100)
Comment for "ierrors" counter says that it counts erroneous received
packets. But for some reason "imissed" counter is added to "ierrors"
counter in most drivers.
It is a mistake, because missed packets are obviously not received.
This patch fixes it.

Fixes: 70bdb18657da ("ethdev: add Rx error counters for missed, badcrc and badlen packets")
Fixes: 6bfe648406b5 ("i40e: add Rx error statistics")
Fixes: 856505d303f4 ("cxgbe: add port statistics")

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
app/test-pmd/testpmd.c
drivers/net/cxgbe/cxgbe_ethdev.c
drivers/net/e1000/em_ethdev.c
drivers/net/e1000/igb_ethdev.c
drivers/net/i40e/i40e_ethdev.c
drivers/net/ixgbe/ixgbe_ethdev.c

index 38b9051..8605e62 100644 (file)
@@ -759,7 +759,7 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
                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) {
+               if ((stats->ierrors + stats->rx_nombuf) > 0) {
                        printf("  RX-error: %-"PRIu64"\n",  stats->ierrors);
                        printf("  RX-nombufs: %-14"PRIu64"\n", stats->rx_nombuf);
                }
@@ -778,7 +778,7 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
                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) {
+               if ((stats->ierrors + stats->rx_nombuf) > 0) {
                        printf("  RX-error:%"PRIu64"\n", stats->ierrors);
                        printf("  RX-nombufs:             %14"PRIu64"\n",
                               stats->rx_nombuf);
index 8c6dd59..ecd8dc3 100644 (file)
@@ -662,7 +662,7 @@ static void cxgbe_dev_stats_get(struct rte_eth_dev *eth_dev,
                              ps.rx_trunc2 + ps.rx_trunc3;
        eth_stats->ierrors  = ps.rx_symbol_err + ps.rx_fcs_err +
                              ps.rx_jabber + ps.rx_too_long + ps.rx_runt +
-                             ps.rx_len_err + eth_stats->imissed;
+                             ps.rx_len_err;
 
        /* TX Stats */
        eth_stats->opackets = ps.tx_frames;
index a8c26ed..1f0a7f4 100644 (file)
@@ -945,7 +945,6 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)
        rte_stats->imissed = stats->mpc;
        rte_stats->ierrors = stats->crcerrs +
                             stats->rlec + stats->ruc + stats->roc +
-                            rte_stats->imissed +
                             stats->rxerrc + stats->algnerrc + stats->cexterr;
 
        /* Tx Errors */
index 9a34d01..e899449 100644 (file)
@@ -1651,7 +1651,6 @@ eth_igb_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)
        rte_stats->imissed = stats->mpc;
        rte_stats->ierrors = stats->crcerrs +
                             stats->rlec + stats->ruc + stats->roc +
-                            rte_stats->imissed +
                             stats->rxerrc + stats->algnerrc + stats->cexterr;
 
        /* Tx Errors */
index 10e0d38..6fdae57 100644 (file)
@@ -2092,8 +2092,7 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
                        pf->main_vsi->eth_stats.rx_discards;
        stats->ierrors  = ns->crc_errors +
                        ns->rx_length_errors + ns->rx_undersize +
-                       ns->rx_oversize + ns->rx_fragments + ns->rx_jabber +
-                       stats->imissed;
+                       ns->rx_oversize + ns->rx_fragments + ns->rx_jabber;
 
        PMD_DRV_LOG(DEBUG, "***************** PF stats start *******************");
        PMD_DRV_LOG(DEBUG, "rx_bytes:            %"PRIu64"", ns->eth.rx_bytes);
index 5371720..d4d883a 100644 (file)
@@ -2646,7 +2646,6 @@ ixgbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
                          hw_stats->rlec +
                          hw_stats->ruc +
                          hw_stats->roc +
-                         total_missed_rx +
                          hw_stats->illerrc +
                          hw_stats->errbc +
                          hw_stats->rfc +