Explorar o código

igb: update tx DMA mapping error handling

This updates the tx DMA mapping error handling code to
resemble e1000e/ixgbe.

Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Nick Nunley %!s(int64=15) %!d(string=hai) anos
pai
achega
a77ff709dd
Modificáronse 1 ficheiros con 3 adicións e 5 borrados
  1. 3 5
      drivers/net/igb/igb_main.c

+ 3 - 5
drivers/net/igb/igb_main.c

@@ -3647,14 +3647,12 @@ dma_error:
 	buffer_info->length = 0;
 	buffer_info->length = 0;
 	buffer_info->next_to_watch = 0;
 	buffer_info->next_to_watch = 0;
 	buffer_info->mapped_as_page = false;
 	buffer_info->mapped_as_page = false;
-	count--;
 
 
 	/* clear timestamp and dma mappings for remaining portion of packet */
 	/* clear timestamp and dma mappings for remaining portion of packet */
-	while (count >= 0) {
-		count--;
+	while (count--) {
+		if (i == 0)
+			i = tx_ring->count;
 		i--;
 		i--;
-		if (i < 0)
-			i += tx_ring->count;
 		buffer_info = &tx_ring->buffer_info[i];
 		buffer_info = &tx_ring->buffer_info[i];
 		igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
 		igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
 	}
 	}