Hello!
On 01/10/2019 05:02 PM, Simon Horman wrote:
> EtherAVB may provide a checksum of packet data appended to packet data. In
> order to allow this checksum to be received by the host descriptor data
> needs to be enlarged by 2 bytes to accommodate the checksum.
>
> In the case of MTU-sized packets without a VLAN tag the
> checksum were already accommodated by virtue of the space reserved for the
> VLAN tag. However, a packet of MTU-size with a VLAN tag consumed all
> packet data space provided by a descriptor leaving no space for the
> trailing checksum.
Wait! The gen3 manual is rather clear about the auto-checksumming not working
right in the presence of the VLAN tag. Where do you check for that case?
> This was not detected by the driver which incorrectly used the last two
> bytes of packet data as the checksum and truncate the packet by two bytes.
> This resulted all such packets being dropped.
>
> A work around is to disable rx checksum offload
> # ethtool -K eth0 rx off
>
> This patch resolves this problem by increasing the size available for
> packet data in rx descriptors by two bytes. It also introduces
> RAVB_CSUM_LEN to make things a little clearer than "2" sprinkled lightly
> over the driver.
What about using sizeof(__sum16) instead? That type is declared in
<linux/types.h> and used in 'struct iphdr'...
>
> Tested on R-Car E3 (r8a77990) ES1.0 based Ebisu-4D board
>
> Fixes: 4d86d3818627 ("ravb: RX checksum offload")
> Signed-off-by: Simon Horman <[email protected]>
[...]
MBR, Sergei