From: David Marchand Date: Fri, 26 Jul 2019 10:21:26 +0000 (+0200) Subject: net/memif: do not count unsent packets as errors X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2e56e7885db01421886cf745a8212210f58960f4;p=dpdk.git net/memif: do not count unsent packets as errors n_err reflects the number of packets that the driver did not manage to send. This is a temporary situation, those packets are not freed and the application can still retry to send them later. Hence, we can't count them as transmit failed. Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD") Signed-off-by: David Marchand Reviewed-by: Ferruh Yigit --- diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c index 00c9b396ab..bcda426f2b 100644 --- a/drivers/net/memif/rte_eth_memif.c +++ b/drivers/net/memif/rte_eth_memif.c @@ -479,7 +479,6 @@ no_free_slots: } } - mq->n_err += nb_pkts - n_tx_pkts; mq->n_pkts += n_tx_pkts; return n_tx_pkts; } @@ -857,7 +856,6 @@ memif_tx_queue_setup(struct rte_eth_dev *dev, (pmd->role == MEMIF_ROLE_SLAVE) ? MEMIF_RING_S2M : MEMIF_RING_M2S; mq->n_pkts = 0; mq->n_bytes = 0; - mq->n_err = 0; mq->intr_handle.fd = -1; mq->intr_handle.type = RTE_INTR_HANDLE_EXT; dev->data->tx_queues[qid] = mq; @@ -886,7 +884,6 @@ memif_rx_queue_setup(struct rte_eth_dev *dev, mq->type = (pmd->role == MEMIF_ROLE_SLAVE) ? MEMIF_RING_M2S : MEMIF_RING_S2M; mq->n_pkts = 0; mq->n_bytes = 0; - mq->n_err = 0; mq->intr_handle.fd = -1; mq->intr_handle.type = RTE_INTR_HANDLE_EXT; mq->mempool = mb_pool; @@ -938,7 +935,6 @@ memif_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->ibytes = 0; stats->opackets = 0; stats->obytes = 0; - stats->oerrors = 0; tmp = (pmd->role == MEMIF_ROLE_SLAVE) ? pmd->run.num_s2m_rings : pmd->run.num_m2s_rings; @@ -966,7 +962,6 @@ memif_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->q_obytes[i] = mq->n_bytes; stats->opackets += mq->n_pkts; stats->obytes += mq->n_bytes; - stats->oerrors += mq->n_err; } return 0; } @@ -983,14 +978,12 @@ memif_stats_reset(struct rte_eth_dev *dev) dev->data->rx_queues[i]; mq->n_pkts = 0; mq->n_bytes = 0; - mq->n_err = 0; } for (i = 0; i < pmd->run.num_m2s_rings; i++) { mq = (pmd->role == MEMIF_ROLE_SLAVE) ? dev->data->rx_queues[i] : dev->data->tx_queues[i]; mq->n_pkts = 0; mq->n_bytes = 0; - mq->n_err = 0; } } diff --git a/drivers/net/memif/rte_eth_memif.h b/drivers/net/memif/rte_eth_memif.h index 24e8a09141..8269212cb8 100644 --- a/drivers/net/memif/rte_eth_memif.h +++ b/drivers/net/memif/rte_eth_memif.h @@ -66,7 +66,6 @@ struct memif_queue { /* rx/tx info */ uint64_t n_pkts; /**< number of rx/tx packets */ uint64_t n_bytes; /**< number of rx/tx bytes */ - uint64_t n_err; /**< number of tx errors */ memif_ring_t *ring; /**< pointer to ring */