Commit c2ac3ef3 authored by Jay Cliburn's avatar Jay Cliburn Committed by Jeff Garzik

atl1: deal with hardware rx checksum bug

The L1 hardware contains a bug that flags a fragmented IP packet
as having an incorrect TCP/UDP checksum, even though the packet
is perfectly valid and its checksum is correct.  There's no way to
distinguish between one of these good packets and a packet that
actually contains a TCP/UDP checksum error, so all we can do is
allow the packet to be handed up to the higher layers and let it
be sorted out there.

Add a comment describing this condition and remove the code that
currently fails to handle what may or may not be a checksum error.
Signed-off-by: default avatarJay Cliburn <jacliburn@bellsouth.net>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent f0f422e5
...@@ -1790,6 +1790,17 @@ static void atl1_rx_checksum(struct atl1_adapter *adapter, ...@@ -1790,6 +1790,17 @@ static void atl1_rx_checksum(struct atl1_adapter *adapter,
{ {
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
/*
* The L1 hardware contains a bug that erroneously sets the
* PACKET_FLAG_ERR and ERR_FLAG_L4_CHKSUM bits whenever a
* fragmented IP packet is received, even though the packet
* is perfectly valid and its checksum is correct. There's
* no way to distinguish between one of these good packets
* and a packet that actually contains a TCP/UDP checksum
* error, so all we can do is allow it to be handed up to
* the higher layers and let it be sorted out there.
*/
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
if (unlikely(rrd->pkt_flg & PACKET_FLAG_ERR)) { if (unlikely(rrd->pkt_flg & PACKET_FLAG_ERR)) {
...@@ -1816,14 +1827,6 @@ static void atl1_rx_checksum(struct atl1_adapter *adapter, ...@@ -1816,14 +1827,6 @@ static void atl1_rx_checksum(struct atl1_adapter *adapter,
return; return;
} }
/* IPv4, but hardware thinks its checksum is wrong */
if (netif_msg_rx_err(adapter))
dev_printk(KERN_DEBUG, &pdev->dev,
"hw csum wrong, pkt_flag:%x, err_flag:%x\n",
rrd->pkt_flg, rrd->err_flg);
skb->ip_summed = CHECKSUM_COMPLETE;
skb->csum = htons(rrd->xsz.xsum_sz.rx_chksum);
adapter->hw_csum_err++;
return; return;
} }
......
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