From: David Miller <davem@davemloft.net>
To: claudiu.manoil@freescale.com
Cc: netdev@vger.kernel.org, kotnes@cisco.com
Subject: Re: [net] gianfar: Add FCS to rx buffer size (fix)
Date: Wed, 15 Oct 2014 16:54:21 -0400 (EDT) [thread overview]
Message-ID: <20141015.165421.2180002967619380071.davem@davemloft.net> (raw)
In-Reply-To: <1413389506-19172-1-git-send-email-claudiu.manoil@freescale.com>
From: Claudiu Manoil <claudiu.manoil@freescale.com>
Date: Wed, 15 Oct 2014 19:11:46 +0300
> For each Rx frame the eTSEC writes its FCS (Frame Check Sequence)
> to the Rx buffer.
>
> The eTSEC h/w manual states in the "Receive Buffer Descriptor Field
> Descriptions" table:
> "Data length is the number of octets written by the eTSEC into this BD's
> data buffer if L is cleared (the value is equal to MRBLR), or, if L is
> set, the length of the frame including *CRC*, FCB (if RCTRL[PRSDEP > 00),
> preamble (if MACCFG2[PreAmRxEn]=1), time stamp (if RCTRL[TS] = 1) and
> any padding (RCTRL[PAL])."
>
> Though the FCS bytes are removed by the driver before passing the skb
> to the net stack, the Rx buffer size computation does not currently
> take into account the FCS bytes (4 bytes).
> Because the Rx buffer size is multiple of 512 bytes, leaving out the
> FCS is not a problem for the default MTU of 1500, as the Rx buffer size
> is 1536 in this case. However, for custom MTUs, where the difference
> between the MTU size and the Rx buffer size is less, this can be a
> problem as the computed Rx buffer size won't be enough to accomodate
> the FCS for a received frame that is big enough (close to MTU size).
> In such case the received frame is considered to be incomplete (L flag
> not set in the RxBD status) and silently dropped.
>
> Note that the driver does not currently support S/G on Rx, so it has to
> compute its Rx buffer size based on the MTU of the device.
>
> Reported-by: Kristian Otnes <kotnes@cisco.com>
> Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Applied, thanks!
prev parent reply other threads:[~2014-10-15 20:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-15 16:11 [net] gianfar: Add FCS to rx buffer size (fix) Claudiu Manoil
2014-10-15 20:54 ` David Miller [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=20141015.165421.2180002967619380071.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=claudiu.manoil@freescale.com \
--cc=kotnes@cisco.com \
--cc=netdev@vger.kernel.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).