From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 33F7442AD0; Thu, 11 May 2023 04:17:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEB0140C35; Thu, 11 May 2023 04:17:26 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 688F7406B3; Thu, 11 May 2023 04:17:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683771445; x=1715307445; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ON5KW3T9/YtTKbx8ADbCogkMlrsUrM9h8lUxwb6oCB0=; b=CRrcCZ7w+Du+pDX2B8HVc5gCc3jCusoOYGIkwf4xNL5HOdhct78FxOzC le9AVVTTF+7PAQPtvkDXfolj9TQUiV20nk2LhQPrhcMKbCuOlYYbDIIC5 /EbDhzZKu+SoZGcKRM1x2SUcHhFg7Y760wdk5dCc6UoK4hrgbyaxye3om mhWcFNr8f4ggbda7bJyb3/GKNtGDTjcROwfYPlNl6K2y5q0dQavApPrBy 5tfDfSKXM3Fbb6SUM3qcL4SHX65lqsjr/X2smCVpHPGvXHnj3KCXg3DlC F/fDfE6gPvodvNbsziU863qEfpyMkXvSupxgoukaHLGHN6V+ojoJuO6Jz Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10706"; a="413691876" X-IronPort-AV: E=Sophos;i="5.99,265,1677571200"; d="scan'208";a="413691876" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2023 19:17:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10706"; a="789181438" X-IronPort-AV: E=Sophos;i="5.99,266,1677571200"; d="scan'208";a="789181438" Received: from unknown (HELO localhost.localdomain) ([10.239.252.253]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2023 19:17:22 -0700 From: Mingjin Ye To: dev@dpdk.org Cc: qiming.yang@intel.com, stable@dpdk.org, yidingx.zhou@intel.com, Mingjin Ye , Qi Zhang Subject: [PATCH] net/ice: fix statistics Date: Thu, 11 May 2023 02:10:55 +0000 Message-Id: <20230511021055.328986-1-mingjinx.ye@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When the stats_get api is called for the first time in pmd, the offset of the stats register is not recorded. That results in all the obtained count values being 0. This patch adds reset statistics before dev_init returning. That avoids some noise being counted. Fixes: 12443386a0b0 ("net/ice: support flex Rx descriptor RxDID22") Cc: stable@dpdk.org Signed-off-by: Mingjin Ye --- drivers/net/ice/ice_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 9a88cf9796..1116880485 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2440,6 +2440,9 @@ ice_dev_init(struct rte_eth_dev *dev) pf->supported_rxdid = ice_get_supported_rxdid(hw); + /* reset all stats of the device, including pf and main vsi */ + ice_stats_reset(dev); + return 0; err_flow_init: -- 2.25.1