DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/iavf: fix Rx bytes stats
@ 2019-07-17  4:31 Qi Zhang
  2019-07-17  4:55 ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Qi Zhang @ 2019-07-17  4:31 UTC (permalink / raw)
  To: jingjing.wu, wenzhuo.lu; +Cc: dev, Qi Zhang, stable

Exclude 4 bytes CRC for rx bytes stats.
This also aligned Rx stats calculation with PF.

Fixes: f4a41a6953af ("net/avf: support stats")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 53dc05c78..fe75e86ab 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1047,6 +1047,7 @@ iavf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		stats->imissed = pstats->rx_discards;
 		stats->oerrors = pstats->tx_errors + pstats->tx_discards;
 		stats->ibytes = pstats->rx_bytes;
+		stats->ibytes -= stats->ipackets * RTE_ETHER_CRC_LEN;
 		stats->obytes = pstats->tx_bytes;
 	} else {
 		PMD_DRV_LOG(ERR, "Get statistics failed");
-- 
2.13.6


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/iavf: fix Rx bytes stats
  2019-07-17  4:31 [dpdk-dev] [PATCH] net/iavf: fix Rx bytes stats Qi Zhang
@ 2019-07-17  4:55 ` Stephen Hemminger
  2019-07-19  0:17   ` Zhang, Qi Z
  2019-08-05 10:52   ` Andrew Rybchenko
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Hemminger @ 2019-07-17  4:55 UTC (permalink / raw)
  To: Qi Zhang; +Cc: jingjing.wu, wenzhuo.lu, dev, stable

On Wed, 17 Jul 2019 12:31:00 +0800
Qi Zhang <qi.z.zhang@intel.com> wrote:

> Exclude 4 bytes CRC for rx bytes stats.
> This also aligned Rx stats calculation with PF.
> 
> Fixes: f4a41a6953af ("net/avf: support stats")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
>  drivers/net/iavf/iavf_ethdev.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
> index 53dc05c78..fe75e86ab 100644
> --- a/drivers/net/iavf/iavf_ethdev.c
> +++ b/drivers/net/iavf/iavf_ethdev.c
> @@ -1047,6 +1047,7 @@ iavf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
>  		stats->imissed = pstats->rx_discards;
>  		stats->oerrors = pstats->tx_errors + pstats->tx_discards;
>  		stats->ibytes = pstats->rx_bytes;
> +		stats->ibytes -= stats->ipackets * RTE_ETHER_CRC_LEN;
>  		stats->obytes = pstats->tx_bytes;
>  	} else {
>  		PMD_DRV_LOG(ERR, "Get statistics failed");

Correct, DPDK statistics should not include CRC.

Acked-by: Stephen Hemminger <stephen@networkplumber.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/iavf: fix Rx bytes stats
  2019-07-17  4:55 ` Stephen Hemminger
@ 2019-07-19  0:17   ` Zhang, Qi Z
  2019-08-05 10:52   ` Andrew Rybchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2019-07-19  0:17 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Wu, Jingjing, Lu, Wenzhuo, dev, stable



> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Wednesday, July 17, 2019 12:56 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>; dev@dpdk.org; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/iavf: fix Rx bytes stats
> 
> On Wed, 17 Jul 2019 12:31:00 +0800
> Qi Zhang <qi.z.zhang@intel.com> wrote:
> 
> > Exclude 4 bytes CRC for rx bytes stats.
> > This also aligned Rx stats calculation with PF.
> >
> > Fixes: f4a41a6953af ("net/avf: support stats")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> > ---
> >  drivers/net/iavf/iavf_ethdev.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/iavf/iavf_ethdev.c
> > b/drivers/net/iavf/iavf_ethdev.c index 53dc05c78..fe75e86ab 100644
> > --- a/drivers/net/iavf/iavf_ethdev.c
> > +++ b/drivers/net/iavf/iavf_ethdev.c
> > @@ -1047,6 +1047,7 @@ iavf_dev_stats_get(struct rte_eth_dev *dev,
> struct rte_eth_stats *stats)
> >  		stats->imissed = pstats->rx_discards;
> >  		stats->oerrors = pstats->tx_errors + pstats->tx_discards;
> >  		stats->ibytes = pstats->rx_bytes;
> > +		stats->ibytes -= stats->ipackets * RTE_ETHER_CRC_LEN;
> >  		stats->obytes = pstats->tx_bytes;
> >  	} else {
> >  		PMD_DRV_LOG(ERR, "Get statistics failed");
> 
> Correct, DPDK statistics should not include CRC.
> 
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/iavf: fix Rx bytes stats
  2019-07-17  4:55 ` Stephen Hemminger
  2019-07-19  0:17   ` Zhang, Qi Z
@ 2019-08-05 10:52   ` Andrew Rybchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Rybchenko @ 2019-08-05 10:52 UTC (permalink / raw)
  To: Stephen Hemminger, Qi Zhang, Thomas Monjalon, Ferruh Yigit
  Cc: jingjing.wu, wenzhuo.lu, dev, stable

On 7/17/19 7:55 AM, Stephen Hemminger wrote:
> On Wed, 17 Jul 2019 12:31:00 +0800
> Qi Zhang <qi.z.zhang@intel.com> wrote:
>
>> Exclude 4 bytes CRC for rx bytes stats.
>> This also aligned Rx stats calculation with PF.
>>
>> Fixes: f4a41a6953af ("net/avf: support stats")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>> ---
>>   drivers/net/iavf/iavf_ethdev.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
>> index 53dc05c78..fe75e86ab 100644
>> --- a/drivers/net/iavf/iavf_ethdev.c
>> +++ b/drivers/net/iavf/iavf_ethdev.c
>> @@ -1047,6 +1047,7 @@ iavf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
>>   		stats->imissed = pstats->rx_discards;
>>   		stats->oerrors = pstats->tx_errors + pstats->tx_discards;
>>   		stats->ibytes = pstats->rx_bytes;
>> +		stats->ibytes -= stats->ipackets * RTE_ETHER_CRC_LEN;
>>   		stats->obytes = pstats->tx_bytes;
>>   	} else {
>>   		PMD_DRV_LOG(ERR, "Get statistics failed");
> Correct, DPDK statistics should not include CRC.

Stephen, Thomas, Ferruh,

is it documented somewhere? May be we should update fields
description and rte_eth_stats_get() which mentions these fields
as well to highlight it?

Thanks,
Andrew.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-05 10:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17  4:31 [dpdk-dev] [PATCH] net/iavf: fix Rx bytes stats Qi Zhang
2019-07-17  4:55 ` Stephen Hemminger
2019-07-19  0:17   ` Zhang, Qi Z
2019-08-05 10:52   ` Andrew Rybchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).