DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Helin" <helin.zhang@intel.com>
To: "Tao, Zhe" <zhe.tao@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] i40e: Fix the issue when resetting the stats for	i40e, the stats information will be lost before next time getting the stats
Date: Mon, 3 Aug 2015 17:35:15 +0000	[thread overview]
Message-ID: <F35DEAC7BCE34641BA9FAC6BCA4A12E70A8B933C@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1436422141-29024-1-git-send-email-zhe.tao@intel.com>



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhe Tao
> Sent: Wednesday, July 8, 2015 11:09 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] i40e: Fix the issue when resetting the stats for i40e,
> the stats information will be lost before next time getting the stats
Please refer to other for a brief title! Basically the title should be brief enough.

> 
> Issue: When calling the reset API to reset all the stats for i40e, all the stats will be
> untracked before the next time calling get stats API.
> Once calling the get stats API it will show all the stats equal zero.
> 
> Changes: Calling the get stats API in the reset API will force the stats_offset
> update immediately
> 
> Signed-off-by: Zhe Tao <zhe.tao@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 5fb6b4c..c9cc317 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -1517,9 +1517,17 @@ static void
>  i40e_dev_stats_reset(struct rte_eth_dev *dev)  {
>  	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
> +	struct rte_eth_stats stat = {0};
> 
>  	/* It results in reloading the start point of each counter */
>  	pf->offset_loaded = false;
> +
> +	/*
> +	* need to read the status one time right after reset the offset_loaded field
> +	* prevent the stats data loss between the i40e_dev_stats_reset and
> i40e_dev_stats_get
> +	*/
> +
> +	i40e_dev_stats_get(dev, &stat);
I'd prefer to call "memset(hw_stats, 0, sizeof(*hw_stats));" as igb/ixgbe does.
Please also think of implement the similar reset function for i40evf.

Thank you!
Helin


>  }
> 
>  static int
> --
> 1.9.3

      parent reply	other threads:[~2015-08-03 17:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09  6:09 Zhe Tao
2015-08-03 16:48 ` Thomas Monjalon
2015-08-03 17:35 ` Zhang, Helin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F35DEAC7BCE34641BA9FAC6BCA4A12E70A8B933C@SHSMSX104.ccr.corp.intel.com \
    --to=helin.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=zhe.tao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).