diff options
author | Nimrod Andy <B38611@freescale.com> | 2014-06-11 20:16:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-12 14:01:57 -0400 |
commit | 96c50caa5148e0e0a077672574785700885c6764 (patch) | |
tree | 0fee259417371589404fa1732072f0df82e9753e /drivers/net/ethernet/freescale/fec_main.c | |
parent | 61a4427b955f79dfaa735788511ce558962c9d70 (diff) |
net: fec: Enable IP header hardware checksum
IP header checksum is calcalated by network layer in default.
To support software TSO, it is better to use HW calculate the
IP header checksum.
FEC hw checksum feature request the checksum field in frame
is zero, otherwise the calculative CRC is not correct.
For segmentated TCP packet, HW calculate the IP header checksum again,
it doesn't bring any impact. For SW TSO, HW calculated checksum bring
better performance.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/fec_main.c')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index ee8e5477c819..55b55d2f73bc 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -314,6 +314,7 @@ fec_enet_clear_csum(struct sk_buff *skb, struct net_device *ndev) | |||
314 | if (unlikely(skb_cow_head(skb, 0))) | 314 | if (unlikely(skb_cow_head(skb, 0))) |
315 | return -1; | 315 | return -1; |
316 | 316 | ||
317 | ip_hdr(skb)->check = 0; | ||
317 | *(__sum16 *)(skb->head + skb->csum_start + skb->csum_offset) = 0; | 318 | *(__sum16 *)(skb->head + skb->csum_start + skb->csum_offset) = 0; |
318 | 319 | ||
319 | return 0; | 320 | return 0; |
@@ -395,7 +396,7 @@ static int txq_submit_skb(struct sk_buff *skb, struct net_device *ndev) | |||
395 | * are done by the kernel | 396 | * are done by the kernel |
396 | */ | 397 | */ |
397 | if (skb->ip_summed == CHECKSUM_PARTIAL) | 398 | if (skb->ip_summed == CHECKSUM_PARTIAL) |
398 | ebdp->cbd_esc |= BD_ENET_TX_PINS; | 399 | ebdp->cbd_esc |= BD_ENET_TX_PINS | BD_ENET_TX_IINS; |
399 | } | 400 | } |
400 | } | 401 | } |
401 | 402 | ||