From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-000f0801.pphosted.com (mx0b-000f0801.pphosted.com [67.231.152.113]) by dpdk.org (Postfix) with ESMTP id 5A06F58C3 for ; Mon, 16 Nov 2015 17:54:54 +0100 (CET) Received: from pps.filterd (m0048192.ppops.net [127.0.0.1]) by mx0b-000f0801.pphosted.com (8.15.0.59/8.15.0.59) with SMTP id tAGGp3Wt028987; Mon, 16 Nov 2015 08:54:49 -0800 Received: from hq1wp-exmb11.corp.brocade.com ([144.49.131.13]) by mx0b-000f0801.pphosted.com with ESMTP id 1y7dshh05g-1 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 16 Nov 2015 08:54:48 -0800 Received: from samsung9 (172.16.181.50) by Hq1wp-exmb11.corp.brocade.com (10.70.20.185) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Mon, 16 Nov 2015 08:54:46 -0800 Date: Mon, 16 Nov 2015 08:54:40 -0800 From: Stephen Hemminger To: Harry van Haaren Message-ID: <20151116085440.3dca3ce0@samsung9> In-Reply-To: <1447670117-17723-2-git-send-email-harry.van.haaren@intel.com> References: <1447670117-17723-1-git-send-email-harry.van.haaren@intel.com> <1447670117-17723-2-git-send-email-harry.van.haaren@intel.com> Organization: Brocade Communication Systems X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [172.16.181.50] X-ClientProxiedBy: hq1wp-excas14.corp.brocade.com (10.70.38.103) To Hq1wp-exmb11.corp.brocade.com (10.70.20.185) X-Proofpoint-Spam-Reason: safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.15.21, 1.0.33, 0.0.0000 definitions=2015-11-16_12:2015-11-16,2015-11-16,1970-01-01 signatures=0 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 1/4] e1000: remove crc size from all byte counters 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: , X-List-Received-Date: Mon, 16 Nov 2015 16:54:54 -0000 On Mon, 16 Nov 2015 10:35:14 +0000 Harry van Haaren wrote: > This patch removes the crc bytes from byte counter statistics. > > Signed-off-by: Harry van Haaren > --- > drivers/net/e1000/igb_ethdev.c | 19 +++++++++++++++++-- > 1 file changed, 17 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c > index 88995b0..0ad7341 100644 > --- a/drivers/net/e1000/igb_ethdev.c > +++ b/drivers/net/e1000/igb_ethdev.c > @@ -1480,6 +1480,13 @@ igb_read_stats_registers(struct e1000_hw *hw, struct e1000_hw_stats *stats) > { > int pause_frames; > > + uint64_t old_gprc = stats->gprc; > + uint64_t old_gptc = stats->gptc; > + uint64_t old_tpr = stats->tpr; > + uint64_t old_tpt = stats->tpt; > + uint64_t old_rpthc = stats->rpthc; > + uint64_t old_hgptc = stats->hgptc; > + > if(hw->phy.media_type == e1000_media_type_copper || > (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) { > stats->symerrs += > @@ -1521,10 +1528,13 @@ igb_read_stats_registers(struct e1000_hw *hw, struct e1000_hw_stats *stats) > /* For the 64-bit byte counters the low dword must be read first. */ > /* Both registers clear on the read of the high dword */ > > + /* Workaround CRC bytes included in size, take away 4 bytes/packet */ > stats->gorc += E1000_READ_REG(hw, E1000_GORCL); > stats->gorc += ((uint64_t)E1000_READ_REG(hw, E1000_GORCH) << 32); > + stats->gorc -= (stats->gprc - old_gprc) * 4; > stats->gotc += E1000_READ_REG(hw, E1000_GOTCL); > stats->gotc += ((uint64_t)E1000_READ_REG(hw, E1000_GOTCH) << 32); > + stats->gotc -= (stats->gptc - old_gptc) * 4; > > stats->rnbc += E1000_READ_REG(hw, E1000_RNBC); > stats->ruc += E1000_READ_REG(hw, E1000_RUC); > @@ -1532,13 +1542,16 @@ igb_read_stats_registers(struct e1000_hw *hw, struct e1000_hw_stats *stats) > stats->roc += E1000_READ_REG(hw, E1000_ROC); > stats->rjc += E1000_READ_REG(hw, E1000_RJC); > > + stats->tpr += E1000_READ_REG(hw, E1000_TPR); > + stats->tpt += E1000_READ_REG(hw, E1000_TPT); > + > stats->tor += E1000_READ_REG(hw, E1000_TORL); > stats->tor += ((uint64_t)E1000_READ_REG(hw, E1000_TORH) << 32); > + stats->tor -= (stats->tpr - old_tpr) * 4; Why not use ETHER_CRC_LEN rather than magic # 4?