[v1] net/idpf: fix incorrect status calculation

Message ID 20230928050520.2327245-1-yuying.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v1] net/idpf: fix incorrect status calculation |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing fail Testing issues
ci/iol-compile-arm64-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Zhang, Yuying Sept. 28, 2023, 5:05 a.m. UTC
  From: Yuying Zhang <yuying.zhang@intel.com>

Fix the incorrect ingress packet number calculation.

Fixes: 7514d76d407b ("net/idpf: add basic statistics")
Cc: stable@dpdk.org

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
---
 drivers/net/idpf/idpf_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Xing, Beilei Oct. 10, 2023, 1:42 a.m. UTC | #1
> -----Original Message-----
> From: Zhang, Yuying <yuying.zhang@intel.com>
> Sent: Thursday, September 28, 2023 1:05 PM
> To: Zhang, Yuying <yuying.zhang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>
> Cc: stable@dpdk.org
> Subject: [PATCH v1] net/idpf: fix incorrect status calculation
> 
> From: Yuying Zhang <yuying.zhang@intel.com>
> 
> Fix the incorrect ingress packet number calculation.
> 
> Fixes: 7514d76d407b ("net/idpf: add basic statistics")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
> ---
>  drivers/net/idpf/idpf_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
> index 3af7cf0bb7..6ae2ac2681 100644
> --- a/drivers/net/idpf/idpf_ethdev.c
> +++ b/drivers/net/idpf/idpf_ethdev.c
> @@ -281,7 +281,7 @@ idpf_dev_stats_get(struct rte_eth_dev *dev, struct
> rte_eth_stats *stats)
> 
>  		idpf_vport_stats_update(&vport->eth_stats_offset, pstats);
>  		stats->ipackets = pstats->rx_unicast + pstats->rx_multicast +
> -				pstats->rx_broadcast - pstats->rx_discards;
> +				pstats->rx_broadcast;

Seems rx_error is also considered in ingress packets.
Same for cpfl.

>  		stats->opackets = pstats->tx_broadcast + pstats->tx_multicast
> +
>  						pstats->tx_unicast;
>  		stats->ierrors = pstats->rx_errors;
> --
> 2.34.1
  
Xing, Beilei Oct. 23, 2023, 9 a.m. UTC | #2
> -----Original Message-----
> From: Zhang, Yuying <yuying.zhang@intel.com>
> Sent: Thursday, September 28, 2023 1:05 PM
> To: Zhang, Yuying <yuying.zhang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>
> Cc: stable@dpdk.org
> Subject: [PATCH v1] net/idpf: fix incorrect status calculation
> 
> From: Yuying Zhang <yuying.zhang@intel.com>
> 
> Fix the incorrect ingress packet number calculation.
> 
> Fixes: 7514d76d407b ("net/idpf: add basic statistics")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
> ---
>  drivers/net/idpf/idpf_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
> index 3af7cf0bb7..6ae2ac2681 100644
> --- a/drivers/net/idpf/idpf_ethdev.c
> +++ b/drivers/net/idpf/idpf_ethdev.c
> @@ -281,7 +281,7 @@ idpf_dev_stats_get(struct rte_eth_dev *dev, struct
> rte_eth_stats *stats)
> 
>  		idpf_vport_stats_update(&vport->eth_stats_offset, pstats);
>  		stats->ipackets = pstats->rx_unicast + pstats->rx_multicast +
> -				pstats->rx_broadcast - pstats->rx_discards;
> +				pstats->rx_broadcast;
>  		stats->opackets = pstats->tx_broadcast + pstats->tx_multicast
> +
>  						pstats->tx_unicast;
>  		stats->ierrors = pstats->rx_errors;
> --
> 2.34.1

Acked-by: Beilei Xing <beilei.xing@intel.com>
  
Qi Zhang Oct. 24, 2023, 5:26 a.m. UTC | #3
> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Monday, October 23, 2023 5:01 PM
> To: Zhang, Yuying <yuying.zhang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
> Cc: stable@dpdk.org
> Subject: RE: [PATCH v1] net/idpf: fix incorrect status calculation
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Yuying <yuying.zhang@intel.com>
> > Sent: Thursday, September 28, 2023 1:05 PM
> > To: Zhang, Yuying <yuying.zhang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Xing,
> > Beilei <beilei.xing@intel.com>
> > Cc: stable@dpdk.org
> > Subject: [PATCH v1] net/idpf: fix incorrect status calculation
> >
> > From: Yuying Zhang <yuying.zhang@intel.com>
> >
> > Fix the incorrect ingress packet number calculation.
> >
> > Fixes: 7514d76d407b ("net/idpf: add basic statistics")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
> > ---
> >  drivers/net/idpf/idpf_ethdev.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/idpf/idpf_ethdev.c
> > b/drivers/net/idpf/idpf_ethdev.c index 3af7cf0bb7..6ae2ac2681 100644
> > --- a/drivers/net/idpf/idpf_ethdev.c
> > +++ b/drivers/net/idpf/idpf_ethdev.c
> > @@ -281,7 +281,7 @@ idpf_dev_stats_get(struct rte_eth_dev *dev, struct
> > rte_eth_stats *stats)
> >
> >  		idpf_vport_stats_update(&vport->eth_stats_offset, pstats);
> >  		stats->ipackets = pstats->rx_unicast + pstats->rx_multicast +
> > -				pstats->rx_broadcast - pstats->rx_discards;
> > +				pstats->rx_broadcast;
> >  		stats->opackets = pstats->tx_broadcast + pstats->tx_multicast
> > +
> >  						pstats->tx_unicast;
> >  		stats->ierrors = pstats->rx_errors;
> > --
> > 2.34.1
> 
> Acked-by: Beilei Xing <beilei.xing@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index 3af7cf0bb7..6ae2ac2681 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -281,7 +281,7 @@  idpf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 
 		idpf_vport_stats_update(&vport->eth_stats_offset, pstats);
 		stats->ipackets = pstats->rx_unicast + pstats->rx_multicast +
-				pstats->rx_broadcast - pstats->rx_discards;
+				pstats->rx_broadcast;
 		stats->opackets = pstats->tx_broadcast + pstats->tx_multicast +
 						pstats->tx_unicast;
 		stats->ierrors = pstats->rx_errors;