[dpdk-dev] enic: fix 'imissed' to count drops due to no RX buffers

Message ID 1461725415-3899-1-git-send-email-johndale@cisco.com (mailing list archive)
State Superseded, archived
Delegated to: Bruce Richardson
Headers

Commit Message

John Daley (johndale) April 27, 2016, 2:50 a.m. UTC
Fixes: 7182d3e7d177 ("enic: expose Rx missed packets counter")
Signed-off-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Bruce Richardson May 6, 2016, 2:29 p.m. UTC | #1
On Tue, Apr 26, 2016 at 07:50:15PM -0700, John Daley wrote:
> Fixes: 7182d3e7d177 ("enic: expose Rx missed packets counter")
> Signed-off-by: John Daley <johndale@cisco.com>
> ---
>  drivers/net/enic/enic_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
> index 60fe765..be4e9e5 100644
> --- a/drivers/net/enic/enic_main.c
> +++ b/drivers/net/enic/enic_main.c
> @@ -243,10 +243,10 @@ void enic_dev_stats_get(struct enic *enic, struct rte_eth_stats *r_stats)
>  	r_stats->ibytes = stats->rx.rx_bytes_ok;
>  	r_stats->obytes = stats->tx.tx_bytes_ok;
>  
> -	r_stats->ierrors = stats->rx.rx_errors;
> +	r_stats->ierrors = stats->rx.rx_errors + stats->rx.rx_drop;
>  	r_stats->oerrors = stats->tx.tx_errors;
>  
> -	r_stats->imissed = stats->rx.rx_drop;
> +	r_stats->imissed = stats->rx.rx_no_bufs;
>  
>  	r_stats->rx_nombuf = stats->rx.rx_no_bufs;
>  }
> -- 
> 2.7.0
> 

I think this patch just needs a little more detail in the commit message to
help explain it. Can you explain what stats->rx.rx_drop is and why it should
be added to ierrors rather than being part of imissed.

Regards,
/Bruce
  

Patch

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 60fe765..be4e9e5 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -243,10 +243,10 @@  void enic_dev_stats_get(struct enic *enic, struct rte_eth_stats *r_stats)
 	r_stats->ibytes = stats->rx.rx_bytes_ok;
 	r_stats->obytes = stats->tx.tx_bytes_ok;
 
-	r_stats->ierrors = stats->rx.rx_errors;
+	r_stats->ierrors = stats->rx.rx_errors + stats->rx.rx_drop;
 	r_stats->oerrors = stats->tx.tx_errors;
 
-	r_stats->imissed = stats->rx.rx_drop;
+	r_stats->imissed = stats->rx.rx_no_bufs;
 
 	r_stats->rx_nombuf = stats->rx.rx_no_bufs;
 }