devices/e1000/e1000_main-2.6.27-orig.c
branchstable-1.5
changeset 2378 ca345abf0565
parent 2252 6001f50617a7
--- a/devices/e1000/e1000_main-2.6.27-orig.c	Tue Apr 10 19:09:51 2012 +0200
+++ b/devices/e1000/e1000_main-2.6.27-orig.c	Tue Apr 10 19:10:56 2012 +0200
@@ -4134,22 +4134,13 @@
 
 		length = le16_to_cpu(rx_desc->length);
 		/* !EOP means multiple descriptors were used to store a single
-		 * packet, if thats the case we need to toss it.  In fact, we
-		 * to toss every packet with the EOP bit clear and the next
-		 * frame that _does_ have the EOP bit set, as it is by
-		 * definition only a frame fragment
-		 */
-		if (unlikely(!(status & E1000_RXD_STAT_EOP)))
-			set_bit(__E1000_DISCARDING, &adapter->flags);
-
-		if (test_bit(__E1000_DISCARDING, &adapter->flags)) {
+		 * packet, also make sure the frame isn't just CRC only */
+		if (unlikely(!(status & E1000_RXD_STAT_EOP) || (length <= 4))) {
 			/* All receives must fit into a single buffer */
 			E1000_DBG("%s: Receive packet consumed multiple"
 				  " buffers\n", netdev->name);
 			/* recycle */
 			buffer_info->skb = skb;
-			if (status & E1000_RXD_STAT_EOP)
-				clear_bit(__E1000_DISCARDING, &adapter->flags);
 			goto next_desc;
 		}
 
@@ -4358,8 +4349,12 @@
 			pci_unmap_page(pdev, ps_page_dma->ps_page_dma[j],
 					PAGE_SIZE, PCI_DMA_FROMDEVICE);
 			ps_page_dma->ps_page_dma[j] = 0;
-			skb_add_rx_frag(skb, j, ps_page->ps_page[j], 0, length);
+			skb_fill_page_desc(skb, j, ps_page->ps_page[j], 0,
+			                   length);
 			ps_page->ps_page[j] = NULL;
+			skb->len += length;
+			skb->data_len += length;
+			skb->truesize += length;
 		}
 
 		/* strip the ethernet crc, problem is we're using pages now so
@@ -4558,7 +4553,7 @@
 			if (j < adapter->rx_ps_pages) {
 				if (likely(!ps_page->ps_page[j])) {
 					ps_page->ps_page[j] =
-						netdev_alloc_page(netdev);
+						alloc_page(GFP_ATOMIC);
 					if (unlikely(!ps_page->ps_page[j])) {
 						adapter->alloc_rx_buff_failed++;
 						goto no_buffers;
@@ -5175,9 +5170,6 @@
 
 	netif_device_detach(netdev);
 
-	if (state == pci_channel_io_perm_failure)
-		return PCI_ERS_RESULT_DISCONNECT;
-
 	if (netif_running(netdev))
 		e1000_down(adapter);
 	pci_disable_device(pdev);