Skip to contentSkip to conversation

igb/igbvf: cleanup exception handling in tx_map_adv

PATCH Applied Jeff Kirsher 2 participants 2 messages Jan 23, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igb/igbvf: cleanup exception handling in tx_map_adv

From: Alexander Duyck <[email protected]>

After removing the skb_dma_map/unmap calls the exception handling in igb_tx_map_adv is not correct. The issue is that the count value was not being correctly handled so as a result we were not rewinding the ring as back as we should have been.

---

 drivers/net/igb/igb_main.c |    2 +-
 drivers/net/igbvf/netdev.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/igb/igb_main.c +1 -1
index 933c64f..2ca1734 100644
@@ -3584,6 +3584,7 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
 	for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
 		struct skb_frag_struct *frag;
 
+		count++;
 		i++;
 		if (i == tx_ring->count)
 			i = 0;
@@ -3605,7 +3606,6 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
 		if (pci_dma_mapping_error(pdev, buffer_info->dma))
 			goto dma_error;
 
-		count++;
 	}
 
 	tx_ring->buffer_info[i].skb = skb;
drivers/net/igbvf/netdev.c +1 -1
index 10e038a..43c8375 100644
@@ -2126,6 +2126,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
 	for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
 		struct skb_frag_struct *frag;
 
+		count++;
 		i++;
 		if (i == tx_ring->count)
 			i = 0;
@@ -2146,7 +2147,6 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
 						PCI_DMA_TODEVICE);
 		if (pci_dma_mapping_error(pdev, buffer_info->dma))
 			goto dma_error;
-		count++;
 	}
 
 	tx_ring->buffer_info[i].skb = skb;
maintainer Applied
#1 lore raw

From: Jeff Kirsher <[email protected]>
Date: Sat, 23 Jan 2010 01:32:51 -0800

Quoted 9 lines

From: Alexander Duyck <[email protected]>

After removing the skb_dma_map/unmap calls the exception handling in igb_tx_map_adv is not correct. The issue is that the count value was not being correctly handled so as a result we were not rewinding the ring as back as we should have been.

Applied, thanks.