diff options
-rw-r--r-- | drivers/net/e1000/e1000.h | 2 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 2a567df3ea71..e8932db7ee77 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h | |||
@@ -326,6 +326,8 @@ struct e1000_adapter { | |||
326 | /* for ioport free */ | 326 | /* for ioport free */ |
327 | int bars; | 327 | int bars; |
328 | int need_ioport; | 328 | int need_ioport; |
329 | |||
330 | bool discarding; | ||
329 | }; | 331 | }; |
330 | 332 | ||
331 | enum e1000_state_t { | 333 | enum e1000_state_t { |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index b3f67b41627f..a53a2017c537 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -3850,13 +3850,22 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
3850 | 3850 | ||
3851 | length = le16_to_cpu(rx_desc->length); | 3851 | length = le16_to_cpu(rx_desc->length); |
3852 | /* !EOP means multiple descriptors were used to store a single | 3852 | /* !EOP means multiple descriptors were used to store a single |
3853 | * packet, also make sure the frame isn't just CRC only */ | 3853 | * packet, if thats the case we need to toss it. In fact, we |
3854 | if (unlikely(!(status & E1000_RXD_STAT_EOP) || (length <= 4))) { | 3854 | * to toss every packet with the EOP bit clear and the next |
3855 | * frame that _does_ have the EOP bit set, as it is by | ||
3856 | * definition only a frame fragment | ||
3857 | */ | ||
3858 | if (unlikely(!(status & E1000_RXD_STAT_EOP))) | ||
3859 | adapter->discarding = true; | ||
3860 | |||
3861 | if (adapter->discarding) { | ||
3855 | /* All receives must fit into a single buffer */ | 3862 | /* All receives must fit into a single buffer */ |
3856 | E1000_DBG("%s: Receive packet consumed multiple" | 3863 | E1000_DBG("%s: Receive packet consumed multiple" |
3857 | " buffers\n", netdev->name); | 3864 | " buffers\n", netdev->name); |
3858 | /* recycle */ | 3865 | /* recycle */ |
3859 | buffer_info->skb = skb; | 3866 | buffer_info->skb = skb; |
3867 | if (status & E1000_RXD_STAT_EOP) | ||
3868 | adapter->discarding = false; | ||
3860 | goto next_desc; | 3869 | goto next_desc; |
3861 | } | 3870 | } |
3862 | 3871 | ||