Skip to content

Commit

Permalink
igb/igbvf: cleanup exception handling in tx_map_adv
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Jan 23, 2010
1 parent de4fc07 commit 8581145
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/igbvf/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 8581145

Please sign in to comment.