diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2008-09-19 02:58:50 +0200 |
---|---|---|
committer | Lennert Buytenhek <buytenh@marvell.com> | 2008-09-19 04:47:59 +0200 |
commit | 170e7108a368c52df1ec466966fd1db6e45a7ad2 (patch) | |
tree | 8bfe62f00a3fda957ca22b8a561d4c977ea91719 /drivers/net/mv643xx_eth.c | |
parent | 457b1d5a4b7b8c2b3b6bd032098da600c50dd6b2 (diff) | |
download | op-kernel-dev-170e7108a368c52df1ec466966fd1db6e45a7ad2.zip op-kernel-dev-170e7108a368c52df1ec466966fd1db6e45a7ad2.tar.gz |
mv643xx_eth: fix receive checksumming
We have to explicitly tell the hardware to include the pseudo-header
when doing receive checksumming, otherwise hardware checksumming will
fail for every received packet and we'll end up setting CHECKSUM_NONE
on every received packet.
While we're at it, when skb->ip_summed is set to CHECKSUM_UNNECESSARY
on received packets, skb->csum is supposed to be undefined, and thus
there is no need to set it.
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Diffstat (limited to 'drivers/net/mv643xx_eth.c')
-rw-r--r-- | drivers/net/mv643xx_eth.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 408827d..94c13be 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -546,11 +546,8 @@ static int rxq_process(struct rx_queue *rxq, int budget) */ skb_put(skb, byte_cnt - 2 - 4); - if (cmd_sts & LAYER_4_CHECKSUM_OK) { + if (cmd_sts & LAYER_4_CHECKSUM_OK) skb->ip_summed = CHECKSUM_UNNECESSARY; - skb->csum = htons( - (cmd_sts & 0x0007fff8) >> 3); - } skb->protocol = eth_type_trans(skb, mp->dev); netif_receive_skb(skb); } @@ -1994,9 +1991,10 @@ static void port_start(struct mv643xx_eth_private *mp) /* * Receive all unmatched unicast, TCP, UDP, BPDU and broadcast - * frames to RX queue #0. + * frames to RX queue #0, and include the pseudo-header when + * calculating receive checksums. */ - wrl(mp, PORT_CONFIG(mp->port_num), 0x00000000); + wrl(mp, PORT_CONFIG(mp->port_num), 0x02000000); /* * Treat BPDUs as normal multicasts, and disable partition mode. |