[6/8] net/memif: do not count unsent packets as errors

Message ID 1564046068-21905-7-git-send-email-david.marchand@redhat.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers
Series oerrors stats fixes for virtual pmds |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

David Marchand July 25, 2019, 9:14 a.m. UTC
  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 <david.marchand@redhat.com>
---
 drivers/net/memif/rte_eth_memif.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Ferruh Yigit July 25, 2019, 4:18 p.m. UTC | #1
On 7/25/2019 10:14 AM, David Marchand wrote:
> 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 <david.marchand@redhat.com>
> ---
>  drivers/net/memif/rte_eth_memif.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
> index 00c9b39..080729a 100644
> --- a/drivers/net/memif/rte_eth_memif.c
> +++ b/drivers/net/memif/rte_eth_memif.c
> @@ -938,7 +938,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 +965,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;

Can we also delete 'n_err', it seems calculated wrong already?

>  	}
>  	return 0;
>  }
>
  

Patch

diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 00c9b39..080729a 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -938,7 +938,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 +965,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;
 }