[7/8] net/ring: do not count unsent packets as errors
Checks
Commit Message
err_pkts 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: e1e4017751f1 ("ring: add new driver")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/net/ring/rte_eth_ring.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
Comments
On 7/25/2019 10:14 AM, David Marchand wrote:
> err_pkts 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: e1e4017751f1 ("ring: add new driver")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> drivers/net/ring/rte_eth_ring.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
> index eb347bc..eef7606 100644
> --- a/drivers/net/ring/rte_eth_ring.c
> +++ b/drivers/net/ring/rte_eth_ring.c
> @@ -172,7 +172,7 @@ static int
> eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
> {
> unsigned int i;
> - unsigned long rx_total = 0, tx_total = 0, tx_err_total = 0;
> + unsigned long rx_total = 0, tx_total = 0;
> const struct pmd_internals *internal = dev->data->dev_private;
>
> for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS &&
> @@ -185,12 +185,10 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
> i < dev->data->nb_tx_queues; i++) {
> stats->q_opackets[i] = internal->tx_ring_queues[i].tx_pkts.cnt;
> tx_total += stats->q_opackets[i];
> - tx_err_total += internal->tx_ring_queues[i].err_pkts.cnt;
Can we remove 'err_pkts' completely, it seems already calculated wrong?
> }
>
> stats->ipackets = rx_total;
> stats->opackets = tx_total;
> - stats->oerrors = tx_err_total;
>
> return 0;
> }
>
@@ -172,7 +172,7 @@ static int
eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
{
unsigned int i;
- unsigned long rx_total = 0, tx_total = 0, tx_err_total = 0;
+ unsigned long rx_total = 0, tx_total = 0;
const struct pmd_internals *internal = dev->data->dev_private;
for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS &&
@@ -185,12 +185,10 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
i < dev->data->nb_tx_queues; i++) {
stats->q_opackets[i] = internal->tx_ring_queues[i].tx_pkts.cnt;
tx_total += stats->q_opackets[i];
- tx_err_total += internal->tx_ring_queues[i].err_pkts.cnt;
}
stats->ipackets = rx_total;
stats->opackets = tx_total;
- stats->oerrors = tx_err_total;
return 0;
}