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 91584A0547 for ; Thu, 1 Apr 2021 07:20:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8386A141005; Thu, 1 Apr 2021 07:20:53 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 3BAC14013F; Thu, 1 Apr 2021 07:20:51 +0200 (CEST) IronPort-SDR: tc4ec80GqvnWwAkQVd5H29QCeMkM9JGuuj5Dt0hOyDuDMrc2/SDkoi5Orgt+hzUcOHW375r9CB gOqH04U/YKeQ== X-IronPort-AV: E=McAfee;i="6000,8403,9940"; a="192179703" X-IronPort-AV: E=Sophos;i="5.81,295,1610438400"; d="scan'208";a="192179703" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2021 22:20:49 -0700 IronPort-SDR: RVNHqTOW8VRB8kIXGrkPXdA6zNGWyvG/Tw+xhNyXtWiEoFcHPj2scBhZmdNLzLcROAkp+UwnlQ kMb+hmHH4lbQ== X-IronPort-AV: E=Sophos;i="5.81,295,1610438400"; d="scan'208";a="446069367" Received: from shwdenpg235.ccr.corp.intel.com ([10.240.182.60]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2021 22:20:47 -0700 From: Alvin Zhang To: haiyue.wang@intel.com, jia.guo@intel.com Cc: dev@dpdk.org, Alvin Zhang , stable@dpdk.org Date: Thu, 1 Apr 2021 13:20:43 +0800 Message-Id: <20210401052043.15800-1-alvinx.zhang@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20210401050711.18228-1-alvinx.zhang@intel.com> References: <20210401050711.18228-1-alvinx.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v2] net/igc: fix Rx error counter for badlen packets X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" When the size of a packet in Rx channel is less than the minimum or greater than the maximum, the packet will be simultaneously counted by RLEC(Receive Length Error Count) and RUC(Receive Under Size Count)/ROC(Receive Oversize Count) registers. This patch fixes the issue of counting a length error packet twice when counting the total number of received error packets. Fixes: e6defdfddc3b ("net/igc: enable statistics") Cc: stable@dpdk.org Signed-off-by: Alvin Zhang --- V2: Refine commit log --- drivers/net/igc/igc_ethdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c index 0ea6e2a..c398701 100644 --- a/drivers/net/igc/igc_ethdev.c +++ b/drivers/net/igc/igc_ethdev.c @@ -1901,8 +1901,7 @@ static int eth_igc_vlan_tpid_set(struct rte_eth_dev *dev, /* Rx Errors */ rte_stats->imissed = stats->mpc; - rte_stats->ierrors = stats->crcerrs + - stats->rlec + stats->ruc + stats->roc + + rte_stats->ierrors = stats->crcerrs + stats->rlec + stats->rxerrc + stats->algnerrc; /* Tx Errors */ -- 1.8.3.1