From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot0-f196.google.com (mail-ot0-f196.google.com [74.125.82.196]) by dpdk.org (Postfix) with ESMTP id 036D61B7E3 for ; Thu, 8 Feb 2018 19:31:28 +0100 (CET) Received: by mail-ot0-f196.google.com with SMTP id s4so5238169oth.7 for ; Thu, 08 Feb 2018 10:31:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=AM7M67HOi9re9shVsL6ehel4jCFFnz3AMgg+lovkzHw=; b=lrpepGmocB8CSuLW6w8cUXKvRscSgb0daGdwECmp+r8fKw63AddJKNqoPs7C9qNId3 TSOPTsZmtlZtM6uRDC9+fmK6OMOjilX+M5FksV1/NWdchFomzXRyM/BWT+ye2+7ZP0JQ vJ0Z0yaDB2DFPY5sWIpDBapGK/StX/ZECtlsbDjLD8e8YMAgU89IZKUiO4njSZ9bENUa /pL5ZD0lZ5YXr1CR56nf97JvvyC+F/qt3oPoDD8HoeoZgVBtYbx9dTEAtiNiSy3hXrlk 4+0FRQTRaPNalt0uE2GuA5tQhW1eDFYB2I8kveejGbfXhlPNb8ebV+d1jHY4gsJAQAZx YLvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=AM7M67HOi9re9shVsL6ehel4jCFFnz3AMgg+lovkzHw=; b=SB5O7dwMzmMRYG1HTXFVUoxbOJidx1HMjVXYiMfMm7RIfG/pNy+8fkIPJ/GfEKHz4i rjYeLATIg9OHkxsiGCwSJo6qWIF4VYyg3/VXDbd5VfmP091DaEDbDnkFZ8KyaYqjSHmP X3u2EuCsd85KYxtOoV2h75LbgCI6UwC1dtaWPxIldetOYUZjFwSsfet6ZHMnO0i4+1Aj C7bf5vDXD8RYFQCZ7Mb9D6JvZxKb1qk8otXISogYQuon6WxQq2zc4xNf5EWyuTJBTn4v zsOUxyRz79niZ5Ta+c8WThbf1XUpNC+NMTZ4pRMJMZ7Cv36gkKSlWiiOhUq7hOIEjoiH 55Vw== X-Gm-Message-State: APf1xPCA7aP4VH+dCLanRSjPhIWzgfLDRByjHaZHvct2HsWu6UmONZZv ua6k9v5iOcXzpfuuUcqVAzc7UktLhCWhywdxt130kQ== X-Google-Smtp-Source: AH8x224x9IojUnf8ZP8di7YHEfQGYXc+F1V2YsNpKMSX3XZZSPmNYuxkQ24M3qLH9sBDhLU3MEYroEvc1anV4ppYIYg= X-Received: by 10.157.1.182 with SMTP id e51mr88021ote.299.1518114687205; Thu, 08 Feb 2018 10:31:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.72.228 with HTTP; Thu, 8 Feb 2018 10:31:26 -0800 (PST) In-Reply-To: <20180208093226.20f2159d@xeon-e3> References: <20180208093226.20f2159d@xeon-e3> From: Matthew Coppola Date: Thu, 8 Feb 2018 13:31:26 -0500 Message-ID: To: Stephen Hemminger , dev@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Tue, 13 Feb 2018 16:13:30 +0100 Subject: Re: [dpdk-users] i40e VF Rx/Tx CRC Bytes Discrepancy X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Feb 2018 18:31:28 -0000 Thank you for your prompt reply. BCC'd Users and added dev as I believe it is the more relevant channel. I apologize for using the wrong channel initially. I am happy to submit a patch if we would like to resolve the issue. I am confused why the hardware would have a different behavior for Rx/Tx Counters. The Tx counters do not contain the CRC bytes but the Rx counters erroneously(as you pointed out) do. I am having trouble understanding why the driver makes this discrepancy? Thank you for your time, Matt On Thu, Feb 8, 2018 at 12:32 PM, Stephen Hemminger wrote: > On Thu, 8 Feb 2018 11:52:55 -0500 > Matthew Coppola wrote: > >> Hi, >> >> I am noticing a discrepancy in the Rx/Tx Byte counters when using the >> i40e driver as a virtual function. Specifically I am observing that >> the Rx bytes are 4 bytes per packet larger than the Tx Bytes. >> >> My application is transmitting a packet and then receiving the same >> packet back (in a service function chaining application). I verified >> that the packets being transmitted and received were the same by >> capturing on the interfaces using pdump and analyzing the output in >> Wireshark. >> >> I believe the discrepancy comes from correcting for the Ethernet FCS. >> I see that in i40e_ethdev.c the CRC bytes are corrected for in the >> i40e_update_vsi_stats() and i40e_read_stats_registers() functions by >> using the following correction (see below). Note the left-hand side >> changes slightly depending on the specific function. >> >> pf->internal_stats.rx_bytes -= (pf->internal_stats.rx_unicast + >> pf->internal_stats.rx_multicast + pf->internal_stats.rx_broadcast) * >> ETHER_CRC_LEN; >> >> However I did not see this correction being used in the vf driver >> (i40e_ethdev_vf.c). By adding a correction to i40evf_update_stats() as >> follows I can reconcile the counters (and make them consistent with >> the PF behavior). >> >> nes->rx_bytes -= (nes->rx_unicast + nes->rx_multicast + >> nes->rx_broadcast) * ETHER_CRC_LEN; >> >> I would like to know if this is the expected behavior or if this is a >> bug in the driver? If this is the expected behavior can you please >> explain why I should expect a discrepancy between the Rx and Tx Byte >> counters? >> >> >> Some additional information: >> >> The application I am observing this behaviour in is using DPDK 17.08. >> (However I don't see any fixes for this in version 17.11). >> >> The NIC is an Intel Corporation XL710/X710 Virtual Function (rev 02) >> (output from lspci). >> >> >> Thank you for your time, and please let me know if you require further >> information. > > It is an Intel driver bug. > All drivers must NOT include CRC bytes in counters. > The DPDK (and Linux, BSD) convention is that byte counters do not include > the CRC bytes. Note: Cisco routers include the CRC bytes; but everyone > else does not. > >