From: Matthew Coppola <matthew.coppola4@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>, dev@dpdk.org
Subject: Re: [dpdk-users] i40e VF Rx/Tx CRC Bytes Discrepancy
Date: Thu, 8 Feb 2018 13:31:26 -0500 [thread overview]
Message-ID: <CAOjDhJ38U96oRv-eM_aY2CqRmd=-3zndo9Thp6jPzJFv+f6Oog@mail.gmail.com> (raw)
In-Reply-To: <20180208093226.20f2159d@xeon-e3>
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
<stephen@networkplumber.org> wrote:
> On Thu, 8 Feb 2018 11:52:55 -0500
> Matthew Coppola <matthew.coppola4@gmail.com> 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.
>
>
prev parent reply other threads:[~2018-02-08 18:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAOjDhJ32hkVw=nzMk7vy0EXpsKMUReegDE=1iGABdBLSzKNHug@mail.gmail.com>
2018-02-08 17:32 ` Stephen Hemminger
2018-02-08 18:31 ` Matthew Coppola [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOjDhJ38U96oRv-eM_aY2CqRmd=-3zndo9Thp6jPzJFv+f6Oog@mail.gmail.com' \
--to=matthew.coppola4@gmail.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).