From patchwork Thu Apr 1 01:16:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alvin Zhang X-Patchwork-Id: 90247 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF142A034F; Thu, 1 Apr 2021 03:16:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6DECD140F4D; Thu, 1 Apr 2021 03:16:34 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id B3D8D140F57 for ; Thu, 1 Apr 2021 03:16:31 +0200 (CEST) IronPort-SDR: 5MQwN6BDU6T38/d4PCi8Qya9AVu85N3tuI3jtZiu5QaR7jM9qux51Eie71wppRUN5TQcFEYlgL +eS5TVBf3xrw== X-IronPort-AV: E=McAfee;i="6000,8403,9940"; a="256111080" X-IronPort-AV: E=Sophos;i="5.81,295,1610438400"; d="scan'208";a="256111080" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2021 18:16:30 -0700 IronPort-SDR: vP/MaxGnFdw1m51q7v2cIhSAIOKCIvYjuQtAbpfypPWdsQfNB1Adg1cBRBYoQGzMZVOLIfQuq6 XBCj+ZD8d7dw== X-IronPort-AV: E=Sophos;i="5.81,295,1610438400"; d="scan'208";a="445988967" 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 18:16:28 -0700 From: Alvin Zhang To: haiyue.wang@intel.com, jia.guo@intel.com Cc: dev@dpdk.org Date: Thu, 1 Apr 2021 09:16:26 +0800 Message-Id: <20210401011626.10500-1-alvinx.zhang@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] net/igc: fix Rx error counter for badlen packets 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 Sender: "dev" When the size of the packet is less than the minimum or greater than the maximum, the packet will be counted twice in the error packet counter. Fixes: e6defdfddc3b ("net/igc: enable statistics") Cc: stable@dpdk.org Signed-off-by: Alvin Zhang --- 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 */