]> asedeno.scripts.mit.edu Git - linux.git/commit
staging: octeon-ethernet: fix TCP/UDP checksum calc
authorHamish Martin <hamish.martin@alliedtelesis.co.nz>
Mon, 21 Dec 2015 21:23:58 +0000 (10:23 +1300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2016 03:35:16 +0000 (19:35 -0800)
commit5a89a875c96a9d038715c42f5f712002ce5124d0
tree4c2a0941ba3d2e0b0bec7724feb352ed460da8bd
parent660a24bf60821ce9f5799b0772a0a82c922c72c1
staging: octeon-ethernet: fix TCP/UDP checksum calc

If the network portion of a frame is preceded by more than 14 bytes of
data, the checksum calculated in the HW is done over the wrong data and
is put in the wrong place.
In our use case an Octeon ethernet controller is connected to a Broadcom
switch chip. Extra data is included in the frame prior to egressing the
Octeon ethernet (i.e. 4 bytes of an 802.1Q tag, 4 bytes of a proprietary
BCM tag later stripped by the switch chip). This extra data causes the
checksum calculation to be incorrect.
The fix in this patch is to make use of the network header offset of the
skb. This enables the checksum to be calculated correctly.
This has been tested in both the configuration with the switch chip in
the egress path (as described above) and in a simple connection direct
to the wire.

Reviewed-by: Richard Laing <richard.laing@alliedtelesis.co.nz>
Reviewed-by: Tim Beale <tim.beale@alliedtelesis.co.nz>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/octeon/ethernet-tx.c