Patchwork [net-next,2/2] drivers/net/oki-semi: Donot recompute IP header checksum

login
register
mail settings
Submitter roy.qing.li@gmail.com
Date April 27, 2012, 7:01 a.m.
Message ID <1335510073-14018-2-git-send-email-roy.qing.li@gmail.com>
Download mbox | patch
Permalink /patch/155390/
State Accepted
Delegated to: David Miller
Headers show

Comments

roy.qing.li@gmail.com - April 27, 2012, 7:01 a.m.
From: RongQing.Li <roy.qing.li@gmail.com>

If I understand correct, NETIF_F_IP_CSUM only means the hardware 
will compute the TCP/UDP checksum, IP checksum is always computed 
in software

So as a workround of hardware unable to compute small packages 
checksum, do not need to compute IP header checksum.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
---
 .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
David Miller - April 29, 2012, 2 a.m.
From: roy.qing.li@gmail.com
Date: Fri, 27 Apr 2012 15:01:13 +0800

> From: RongQing.Li <roy.qing.li@gmail.com>
> 
> If I understand correct, NETIF_F_IP_CSUM only means the hardware 
> will compute the TCP/UDP checksum, IP checksum is always computed 
> in software
> 
> So as a workround of hardware unable to compute small packages 
> checksum, do not need to compute IP header checksum.
> 
> Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 835e3bb..107f41a 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -1240,8 +1240,6 @@  static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
 		if (skb->protocol == htons(ETH_P_IP)) {
 			struct iphdr *iph = ip_hdr(skb);
 			unsigned int offset;
-			iph->check = 0;
-			iph->check = ip_fast_csum((u8 *) iph, iph->ihl);
 			offset = skb_transport_offset(skb);
 			if (iph->protocol == IPPROTO_TCP) {
 				skb->csum = 0;