From patchwork Tue Apr 19 06:11:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingjing Wu X-Patchwork-Id: 12105 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 09E0A2E81; Tue, 19 Apr 2016 08:11:25 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 4CDFF2C5A for ; Tue, 19 Apr 2016 08:11:23 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 18 Apr 2016 23:11:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,505,1455004800"; d="scan'208";a="688565604" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 18 Apr 2016 23:11:21 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u3J6BJe8024765; Tue, 19 Apr 2016 14:11:19 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u3J6BGLf016789; Tue, 19 Apr 2016 14:11:18 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u3J6BGOT016785; Tue, 19 Apr 2016 14:11:16 +0800 From: Jingjing Wu To: bruce.richardson@intel.com Cc: dev@dpdk.org, jingjing.wu@intel.com, helin.zhang@intel.com Date: Tue, 19 Apr 2016 14:11:13 +0800 Message-Id: <1461046273-16755-1-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] i40e: fix packet stats getting X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The statistics queried by calling rte_eth_stats_get are zero when the API is first called on the port. The root cause is because of offset_loaded flag is not set correctly after device started. This patch fixes this issue by resetting statistics at initialization time, at the meanwhile the resetting process will set offset_loaded flag. Fixes: 4861cde46116 ("i40e: new poll mode driver") Signed-off-by: Jingjing Wu Acked-by: Helin Zhang --- drivers/net/i40e/i40e_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index bc28d3c..3aaef07 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -934,6 +934,9 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) goto err_setup_pf_switch; } + /* reset all stats of the device, including pf and main vsi */ + i40e_dev_stats_reset(dev); + vsi = pf->main_vsi; /* Disable double vlan by default */