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 5B4F8A034F for ; Thu, 1 Apr 2021 07:08:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4E6BD4013F; Thu, 1 Apr 2021 07:08:52 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 551B84013F; Thu, 1 Apr 2021 07:08:51 +0200 (CEST) IronPort-SDR: fBzNJ3UPVoxwB6uACYPUyHSjThvcCkW1g/jAIgyYx6ZzjFGrEnGfM75C66hF4OANhADViDF2H2 xADIHjKv8qdw== X-IronPort-AV: E=McAfee;i="6000,8403,9940"; a="192253970" X-IronPort-AV: E=Sophos;i="5.81,295,1610438400"; d="scan'208";a="192253970" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2021 22:08:50 -0700 IronPort-SDR: pwSP7YXBTYaWdGLBsQD7syTn2oO0s8jVptxf+GZJM/cqfNum91hx9bHS+B4BzxKxXvRLevqSdc jNaXE3sS31fg== X-IronPort-AV: E=Sophos;i="5.81,295,1610438400"; d="scan'208";a="446065571" 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:08:28 -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:08:21 +0800 Message-Id: <20210401050821.13640-1-alvinx.zhang@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20210401011710.17952-1-alvinx.zhang@intel.com> References: <20210401011710.17952-1-alvinx.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v2] net/e1000: 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 fixed the issue of counting a length error packet twice when counting the total number of received error packets. Fixes: 70bdb18657da ("ethdev: add Rx error counters for missed, badcrc and badlen packets") Cc: stable@dpdk.org Signed-off-by: Alvin Zhang --- V2: Refine commit log --- drivers/net/e1000/em_ethdev.c | 3 +-- drivers/net/e1000/igb_ethdev.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 3c6f643..4d96d96 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -975,8 +975,7 @@ static int eth_em_pci_remove(struct rte_pci_device *pci_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 + stats->cexterr; /* Tx Errors */ diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 1716d6b..2927cd7 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -1827,8 +1827,7 @@ static int eth_igbvf_pci_remove(struct rte_pci_device *pci_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 + stats->cexterr; /* Tx Errors */ -- 1.8.3.1