Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d706f00f authored by Daniel Hellstrom's avatar Daniel Hellstrom Committed by David S. Miller
Browse files

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: default avatarDaniel Hellstrom <daniel@gaisler.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6af29a96
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -491,6 +491,7 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev)
	if (nr_frags != 0)
	if (nr_frags != 0)
		status = GRETH_TXBD_MORE;
		status = GRETH_TXBD_MORE;


	if (skb->ip_summed == CHECKSUM_PARTIAL)
		status |= GRETH_TXBD_CSALL;
		status |= GRETH_TXBD_CSALL;
	status |= skb_headlen(skb) & GRETH_BD_LEN;
	status |= skb_headlen(skb) & GRETH_BD_LEN;
	if (greth->tx_next == GRETH_TXBD_NUM_MASK)
	if (greth->tx_next == GRETH_TXBD_NUM_MASK)
@@ -514,7 +515,9 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev)
		greth->tx_skbuff[curr_tx] = NULL;
		greth->tx_skbuff[curr_tx] = NULL;
		bdp = greth->tx_bd_base + curr_tx;
		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;
		status |= frag->size & GRETH_BD_LEN;


		/* Wrap around descriptor ring */
		/* Wrap around descriptor ring */