netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2 v2] GRETH: avoid overwrite IP-stack's IP-frags checksum
@ 2011-09-09 15:17 Daniel Hellstrom
  2011-09-20 19:16 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Hellstrom @ 2011-09-09 15:17 UTC (permalink / raw)
  To: davem; +Cc: netdev, kristoffer, eric.dumazet

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>
---
 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 22e24a3..6775c24 100644
--- a/drivers/net/greth.c
+++ b/drivers/net/greth.c
@@ -489,7 +489,8 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev)
 	if (nr_frags != 0)
 		status = GRETH_TXBD_MORE;
 
-	status |= GRETH_TXBD_CSALL;
+	if (skb->ip_summed == CHECKSUM_PARTIAL)
+		status |= GRETH_TXBD_CSALL;
 	status |= skb_headlen(skb) & GRETH_BD_LEN;
 	if (greth->tx_next == GRETH_TXBD_NUM_MASK)
 		status |= GRETH_BD_WR;
@@ -512,7 +513,9 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev)
 		greth->tx_skbuff[curr_tx] = NULL;
 		bdp = greth->tx_bd_base + curr_tx;
 
-		status = GRETH_TXBD_CSALL | GRETH_BD_EN;
+		status = GRETH_BD_EN;
+		if (skb->ip_summed == CHECKSUM_PARTIAL)
+			status |= GRETH_TXBD_CSALL;
 		status |= frag->size & GRETH_BD_LEN;
 
 		/* Wrap around descriptor ring */
-- 
1.5.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2 v2] GRETH: avoid overwrite IP-stack's IP-frags checksum
  2011-09-09 15:17 [PATCH 2/2 v2] GRETH: avoid overwrite IP-stack's IP-frags checksum Daniel Hellstrom
@ 2011-09-20 19:16 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-09-20 19:16 UTC (permalink / raw)
  To: daniel; +Cc: netdev, kristoffer, eric.dumazet

From: Daniel Hellstrom <daniel@gaisler.com>
Date: Fri,  9 Sep 2011 17:17:54 +0200

> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-20 19:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-09 15:17 [PATCH 2/2 v2] GRETH: avoid overwrite IP-stack's IP-frags checksum Daniel Hellstrom
2011-09-20 19:16 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).