Commit 8dff19a6 authored by Thomas Bogendoerfer's avatar Thomas Bogendoerfer Committed by David S. Miller

net: sgi: ioc3-eth: use csum_fold

replace open coded checksum folding by csum_fold.
Signed-off-by: default avatarThomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ed870f6a
...@@ -1391,16 +1391,12 @@ static netdev_tx_t ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1391,16 +1391,12 @@ static netdev_tx_t ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Sum up dest addr, src addr and protocol */ /* Sum up dest addr, src addr and protocol */
ehsum = eh[0] + eh[1] + eh[2] + eh[3] + eh[4] + eh[5] + eh[6]; ehsum = eh[0] + eh[1] + eh[2] + eh[3] + eh[4] + eh[5] + eh[6];
/* Fold ehsum. can't use csum_fold which negates also ... */
ehsum = (ehsum & 0xffff) + (ehsum >> 16);
ehsum = (ehsum & 0xffff) + (ehsum >> 16);
/* Skip IP header; it's sum is always zero and was /* Skip IP header; it's sum is always zero and was
* already filled in by ip_output.c * already filled in by ip_output.c
*/ */
csum = csum_tcpudp_nofold(ih->saddr, ih->daddr, csum = csum_tcpudp_nofold(ih->saddr, ih->daddr,
ih->tot_len - (ih->ihl << 2), ih->tot_len - (ih->ihl << 2),
proto, 0xffff ^ ehsum); proto, csum_fold(ehsum));
csum = (csum & 0xffff) + (csum >> 16); /* Fold again */ csum = (csum & 0xffff) + (csum >> 16); /* Fold again */
csum = (csum & 0xffff) + (csum >> 16); csum = (csum & 0xffff) + (csum >> 16);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment