diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2011-09-09 01:17:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-09-20 15:16:16 -0400 |
commit | d706f00f65146822c0097b796b3557ea8980c305 (patch) | |
tree | 59766229bebcaaccfc0a4b8633ec4dee0dba0e5a /drivers | |
parent | 6af29a963cecf426966d56935d60a984bd5594ea (diff) |
GRETH: avoid overwrite IP-stack's IP-frags checksum
The GRETH GBIT core does not do checksum offloading for IP
segmentation. This patch adds a check in the xmit function to
determine if the stack has calculated the checksum for us.
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/greth.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/greth.c b/drivers/net/greth.c index 58ec74a73150..52a39000c42c 100644 --- a/drivers/net/greth.c +++ b/drivers/net/greth.c | |||
@@ -491,7 +491,8 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev) | |||
491 | if (nr_frags != 0) | 491 | if (nr_frags != 0) |
492 | status = GRETH_TXBD_MORE; | 492 | status = GRETH_TXBD_MORE; |
493 | 493 | ||
494 | status |= GRETH_TXBD_CSALL; | 494 | if (skb->ip_summed == CHECKSUM_PARTIAL) |
495 | status |= GRETH_TXBD_CSALL; | ||
495 | status |= skb_headlen(skb) & GRETH_BD_LEN; | 496 | status |= skb_headlen(skb) & GRETH_BD_LEN; |
496 | if (greth->tx_next == GRETH_TXBD_NUM_MASK) | 497 | if (greth->tx_next == GRETH_TXBD_NUM_MASK) |
497 | status |= GRETH_BD_WR; | 498 | status |= GRETH_BD_WR; |
@@ -514,7 +515,9 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev) | |||
514 | greth->tx_skbuff[curr_tx] = NULL; | 515 | greth->tx_skbuff[curr_tx] = NULL; |
515 | bdp = greth->tx_bd_base + curr_tx; | 516 | bdp = greth->tx_bd_base + curr_tx; |
516 | 517 | ||
517 | status = GRETH_TXBD_CSALL | GRETH_BD_EN; | 518 | status = GRETH_BD_EN; |
519 | if (skb->ip_summed == CHECKSUM_PARTIAL) | ||
520 | status |= GRETH_TXBD_CSALL; | ||
518 | status |= frag->size & GRETH_BD_LEN; | 521 | status |= frag->size & GRETH_BD_LEN; |
519 | 522 | ||
520 | /* Wrap around descriptor ring */ | 523 | /* Wrap around descriptor ring */ |