Commit 408cc699 authored by David S. Miller's avatar David S. Miller Committed by David S. Miller

[TG3]: Let chip do pseudo-header csum on rx.

parent 68668e4d
...@@ -1941,13 +1941,12 @@ static int tg3_rx(struct tg3 *tp, int budget) ...@@ -1941,13 +1941,12 @@ static int tg3_rx(struct tg3 *tp, int budget)
} }
if ((tp->tg3_flags & TG3_FLAG_RX_CHECKSUMS) && if ((tp->tg3_flags & TG3_FLAG_RX_CHECKSUMS) &&
(desc->type_flags & RXD_FLAG_TCPUDP_CSUM)) { (desc->type_flags & RXD_FLAG_TCPUDP_CSUM) &&
skb->csum = htons((desc->ip_tcp_csum & RXD_TCPCSUM_MASK) (((desc->ip_tcp_csum & RXD_TCPCSUM_MASK)
>> RXD_TCPCSUM_SHIFT); >> RXD_TCPCSUM_SHIFT) == 0xffff)) {
skb->ip_summed = CHECKSUM_HW; skb->ip_summed = CHECKSUM_UNNECESSARY;
} else { else
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
}
skb->protocol = eth_type_trans(skb, tp->dev); skb->protocol = eth_type_trans(skb, tp->dev);
#if TG3_VLAN_TAG_USED #if TG3_VLAN_TAG_USED
...@@ -6008,18 +6007,14 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) ...@@ -6008,18 +6007,14 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
if (tp->pci_chip_rev_id == CHIPREV_ID_5700_B0) if (tp->pci_chip_rev_id == CHIPREV_ID_5700_B0)
tp->tg3_flags |= TG3_FLAG_BROKEN_CHECKSUMS; tp->tg3_flags |= TG3_FLAG_BROKEN_CHECKSUMS;
/* Regardless of whether checksums work or not, we configure /* Pseudo-header checksum is done by hardware logic and not
* the StrongARM chips to not compute the pseudo header checksums * the offload processers, so make the chip do the pseudo-
* in either direction. Because of the way Linux checksum support * header checksums on receive. For transmit it is more
* works we do not need the chips to do this, and taking the load * convenient to do the pseudo-header checksum in software
* off of the TX/RX onboard StrongARM cpus means that they will not be * as Linux does that on transmit for us in all cases.
* the bottleneck. Whoever wrote Broadcom's driver did not
* understand the situation at all. He could have bothered
* to read Jes's Acenic driver because the logic (and this part of
* the Tigon2 hardware/firmware) is pretty much identical.
*/ */
tp->tg3_flags |= TG3_FLAG_NO_TX_PSEUDO_CSUM; tp->tg3_flags |= TG3_FLAG_NO_TX_PSEUDO_CSUM;
tp->tg3_flags |= TG3_FLAG_NO_RX_PSEUDO_CSUM; tp->tg3_flags &= ~TG3_FLAG_NO_RX_PSEUDO_CSUM;
/* Derive initial jumbo mode from MTU assigned in /* Derive initial jumbo mode from MTU assigned in
* ether_setup() via the alloc_etherdev() call * ether_setup() via the alloc_etherdev() call
......
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