diff options
author | Claudiu Manoil <claudiu.manoil@freescale.com> | 2014-10-15 16:11:46 (GMT) |
---|---|---|
committer | Honghua Yin <Hong-Hua.Yin@freescale.com> | 2015-03-17 06:46:45 (GMT) |
commit | 823cfcee25bae110f42c9f92c937338db64d5e05 (patch) | |
tree | 0fd6d67c0fa46a8e099e4b399be3752b2bad8313 /drivers/oprofile/oprofile_stats.h | |
parent | d61e341cd19b6234170fd435366100f47a871e79 (diff) | |
download | linux-fsl-qoriq-823cfcee25bae110f42c9f92c937338db64d5e05.tar.xz |
gianfar: Add FCS to rx buffer size (fix)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Change-Id: I75eab6badeb8cd57afffee4e88a2e47fc1685a2f
Reviewed-on: http://git.am.freescale.net:8181/32698
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
Diffstat (limited to 'drivers/oprofile/oprofile_stats.h')
0 files changed, 0 insertions, 0 deletions