diff options
author | Auke Kok <auke\-jan.h.kok@intel.com> | 2006-07-14 19:14:34 -0400 |
---|---|---|
committer | Auke Kok <juke-jan.h.kok@intel.com> | 2006-07-14 19:14:34 -0400 |
commit | f235a2abb27b9396d2108dd2987fb8262cb508a3 (patch) | |
tree | a4ac7f791627169a9087916a5a42e867f136a456 /drivers/net | |
parent | d3d9e484b2ca502c87156b69fa6b8f8fd5fa18a0 (diff) |
e1000: remove CRC bytes from measured packet length
After removing the hardware CRC stripping which causes problems with
SOL and related issues, we need to compensate for this changed size.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 1c6bcad5b910..0074a3a506a5 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -3673,6 +3673,9 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
3673 | 3673 | ||
3674 | length = le16_to_cpu(rx_desc->length); | 3674 | length = le16_to_cpu(rx_desc->length); |
3675 | 3675 | ||
3676 | /* adjust length to remove Ethernet CRC */ | ||
3677 | length -= 4; | ||
3678 | |||
3676 | if (unlikely(!(status & E1000_RXD_STAT_EOP))) { | 3679 | if (unlikely(!(status & E1000_RXD_STAT_EOP))) { |
3677 | /* All receives must fit into a single buffer */ | 3680 | /* All receives must fit into a single buffer */ |
3678 | E1000_DBG("%s: Receive packet consumed multiple" | 3681 | E1000_DBG("%s: Receive packet consumed multiple" |
@@ -3877,8 +3880,9 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
3877 | pci_dma_sync_single_for_device(pdev, | 3880 | pci_dma_sync_single_for_device(pdev, |
3878 | ps_page_dma->ps_page_dma[0], | 3881 | ps_page_dma->ps_page_dma[0], |
3879 | PAGE_SIZE, PCI_DMA_FROMDEVICE); | 3882 | PAGE_SIZE, PCI_DMA_FROMDEVICE); |
3883 | /* remove the CRC */ | ||
3884 | l1 -= 4; | ||
3880 | skb_put(skb, l1); | 3885 | skb_put(skb, l1); |
3881 | length += l1; | ||
3882 | goto copydone; | 3886 | goto copydone; |
3883 | } /* if */ | 3887 | } /* if */ |
3884 | } | 3888 | } |
@@ -3897,6 +3901,10 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
3897 | skb->truesize += length; | 3901 | skb->truesize += length; |
3898 | } | 3902 | } |
3899 | 3903 | ||
3904 | /* strip the ethernet crc, problem is we're using pages now so | ||
3905 | * this whole operation can get a little cpu intensive */ | ||
3906 | pskb_trim(skb, skb->len - 4); | ||
3907 | |||
3900 | copydone: | 3908 | copydone: |
3901 | e1000_rx_checksum(adapter, staterr, | 3909 | e1000_rx_checksum(adapter, staterr, |
3902 | le16_to_cpu(rx_desc->wb.lower.hi_dword.csum_ip.csum), skb); | 3910 | le16_to_cpu(rx_desc->wb.lower.hi_dword.csum_ip.csum), skb); |