DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug
@ 2014-11-21  8:07 zhida zang
  2014-11-21 10:46 ` Thomas Monjalon
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: zhida zang @ 2014-11-21  8:07 UTC (permalink / raw)
  To: dev

v3 changes:
-updated commit log
-fixed the bug that stats data can't be cleared

Signed-off-by: Zhida Zang <zhida.zang@intel.com>
---
 lib/librte_pmd_i40e/i40e_ethdev.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c
index 4b7a827..c1ea37e 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev.c
@@ -1102,6 +1102,7 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct i40e_hw_port_stats *ns = &pf->stats; /* new stats */
 	struct i40e_hw_port_stats *os = &pf->stats_offset; /* old stats */
+	struct i40e_eth_stats *ves = &pf->main_vsi->eth_stats; /* vsi stats */
 
 	/* Get statistics of struct i40e_eth_stats */
 	i40e_stat_update_48(hw, I40E_GLPRT_GORCH(hw->port),
@@ -1277,15 +1278,18 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	/* GLPRT_MSPDC not supported */
 	/* GLPRT_XEC not supported */
 
-	pf->offset_loaded = true;
-
 	if (pf->main_vsi)
 		i40e_update_vsi_stats(pf->main_vsi);
 
 	stats->ipackets = ns->eth.rx_unicast + ns->eth.rx_multicast +
 						ns->eth.rx_broadcast;
-	stats->opackets = ns->eth.tx_unicast + ns->eth.tx_multicast +
+	if (pf->offset_loaded)
+		stats->opackets = ves->tx_unicast + ves->tx_multicast +
+						ves->tx_broadcast;
+	else
+		stats->opackets = ns->eth.tx_unicast + ns->eth.tx_multicast +
 						ns->eth.tx_broadcast;
+	pf->offset_loaded = true;
 	stats->ibytes   = ns->eth.rx_bytes;
 	stats->obytes   = ns->eth.tx_bytes;
 	stats->oerrors  = ns->eth.tx_errors;
-- 
1.9.3

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

* Re: [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug
  2014-11-21  8:07 [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug zhida zang
@ 2014-11-21 10:46 ` Thomas Monjalon
  2014-11-21 12:28 ` Liu, Jijiang
  2014-11-24  4:00 ` Zhang, Helin
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2014-11-21 10:46 UTC (permalink / raw)
  To: zhida zang; +Cc: dev

Hi Zhida,

I guess you are not familiar with git, because you removed the
commit log in this version.
Other strange thing, there is no uppercase in your name in the
>From field, which will be converted in author name. French people
cares about uppercases in names ;)
Last thing: new versions should be sent with --in-reply-to option:
	http://dpdk.org/dev#send

-- 
Thomas


2014-11-21 16:07, zhida zang:
> v3 changes:
> -updated commit log
> -fixed the bug that stats data can't be cleared
> 
> Signed-off-by: Zhida Zang <zhida.zang@intel.com>
> ---
>  lib/librte_pmd_i40e/i40e_ethdev.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)

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

* Re: [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug
  2014-11-21  8:07 [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug zhida zang
  2014-11-21 10:46 ` Thomas Monjalon
@ 2014-11-21 12:28 ` Liu, Jijiang
  2014-11-24  4:00 ` Zhang, Helin
  2 siblings, 0 replies; 4+ messages in thread
From: Liu, Jijiang @ 2014-11-21 12:28 UTC (permalink / raw)
  To: Zang, Zhida, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of zhida zang
> Sent: Friday, November 21, 2014 4:07 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug
> 
> v3 changes:
> -updated commit log
> -fixed the bug that stats data can't be cleared
> 
> Signed-off-by: Zhida Zang <zhida.zang@intel.com>
> ---
>  lib/librte_pmd_i40e/i40e_ethdev.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c
> b/lib/librte_pmd_i40e/i40e_ethdev.c
> index 4b7a827..c1ea37e 100644
> --- a/lib/librte_pmd_i40e/i40e_ethdev.c
> +++ b/lib/librte_pmd_i40e/i40e_ethdev.c
> @@ -1102,6 +1102,7 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct
> rte_eth_stats *stats)
>  	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
>  	struct i40e_hw_port_stats *ns = &pf->stats; /* new stats */
>  	struct i40e_hw_port_stats *os = &pf->stats_offset; /* old stats */
> +	struct i40e_eth_stats *ves = &pf->main_vsi->eth_stats; /* vsi stats */
> 
>  	/* Get statistics of struct i40e_eth_stats */
>  	i40e_stat_update_48(hw, I40E_GLPRT_GORCH(hw->port), @@ -1277,15
> +1278,18 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats
> *stats)
>  	/* GLPRT_MSPDC not supported */
>  	/* GLPRT_XEC not supported */
> 
> -	pf->offset_loaded = true;
> -
>  	if (pf->main_vsi)
>  		i40e_update_vsi_stats(pf->main_vsi);
> 
>  	stats->ipackets = ns->eth.rx_unicast + ns->eth.rx_multicast +
>  						ns->eth.rx_broadcast;
> -	stats->opackets = ns->eth.tx_unicast + ns->eth.tx_multicast +
> +	if (pf->offset_loaded)
> +		stats->opackets = ves->tx_unicast + ves->tx_multicast +
> +						ves->tx_broadcast;
> +	else
> +		stats->opackets = ns->eth.tx_unicast + ns->eth.tx_multicast +
>  						ns->eth.tx_broadcast;
> +	pf->offset_loaded = true;
>  	stats->ibytes   = ns->eth.rx_bytes;
>  	stats->obytes   = ns->eth.tx_bytes;
>  	stats->oerrors  = ns->eth.tx_errors;
> --
> 1.9.3

Acked-by: Jijiang Liu <Jijiang.liu@intel.com>

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

* Re: [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug
  2014-11-21  8:07 [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug zhida zang
  2014-11-21 10:46 ` Thomas Monjalon
  2014-11-21 12:28 ` Liu, Jijiang
@ 2014-11-24  4:00 ` Zhang, Helin
  2 siblings, 0 replies; 4+ messages in thread
From: Zhang, Helin @ 2014-11-24  4:00 UTC (permalink / raw)
  To: Zang, Zhida, Liu, Jijiang; +Cc: dev

Hi Zhida

Please rework your patch and send a new version according to the comments from Thomas! Commit log was missed in your patch.

Regards,
Helin

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of zhida zang
> Sent: Friday, November 21, 2014 4:07 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug
> 
> v3 changes:
> -updated commit log
> -fixed the bug that stats data can't be cleared
> 
> Signed-off-by: Zhida Zang <zhida.zang@intel.com>
> ---
>  lib/librte_pmd_i40e/i40e_ethdev.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c
> b/lib/librte_pmd_i40e/i40e_ethdev.c
> index 4b7a827..c1ea37e 100644
> --- a/lib/librte_pmd_i40e/i40e_ethdev.c
> +++ b/lib/librte_pmd_i40e/i40e_ethdev.c
> @@ -1102,6 +1102,7 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct
> rte_eth_stats *stats)
>  	struct i40e_hw *hw =
> I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>  	struct i40e_hw_port_stats *ns = &pf->stats; /* new stats */
>  	struct i40e_hw_port_stats *os = &pf->stats_offset; /* old stats */
> +	struct i40e_eth_stats *ves = &pf->main_vsi->eth_stats; /* vsi stats */
> 
>  	/* Get statistics of struct i40e_eth_stats */
>  	i40e_stat_update_48(hw, I40E_GLPRT_GORCH(hw->port), @@ -1277,15
> +1278,18 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats
> *stats)
>  	/* GLPRT_MSPDC not supported */
>  	/* GLPRT_XEC not supported */
> 
> -	pf->offset_loaded = true;
> -
>  	if (pf->main_vsi)
>  		i40e_update_vsi_stats(pf->main_vsi);
> 
>  	stats->ipackets = ns->eth.rx_unicast + ns->eth.rx_multicast +
>  						ns->eth.rx_broadcast;
> -	stats->opackets = ns->eth.tx_unicast + ns->eth.tx_multicast +
> +	if (pf->offset_loaded)
> +		stats->opackets = ves->tx_unicast + ves->tx_multicast +
> +						ves->tx_broadcast;
> +	else
> +		stats->opackets = ns->eth.tx_unicast + ns->eth.tx_multicast +
>  						ns->eth.tx_broadcast;
> +	pf->offset_loaded = true;
>  	stats->ibytes   = ns->eth.rx_bytes;
>  	stats->obytes   = ns->eth.tx_bytes;
>  	stats->oerrors  = ns->eth.tx_errors;
> --
> 1.9.3

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

end of thread, other threads:[~2014-11-24  3:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-21  8:07 [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug zhida zang
2014-11-21 10:46 ` Thomas Monjalon
2014-11-21 12:28 ` Liu, Jijiang
2014-11-24  4:00 ` Zhang, Helin

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).