Skip to content

Commit 069db9c

Browse files
Alexander DuyckJeff Kirsher
authored andcommitted
ixgbe: Fix Tx map failure path
This patch is a partial revert of "ixgbe: Don't bother clearing buffer memory for descriptor rings". Specifically I messed up the exception handling path a bit and this resulted in us incorrectly adding the count back in when we didn't need to. In order to make this simpler I am reverting most of the exception handling path change and instead just replacing the bit that was handled by the unmap_and_free call. Fixes: ffed21b ("ixgbe: Don't bother clearing buffer memory for descriptor rings") Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent 104ba83 commit 069db9c

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8020,29 +8020,23 @@ static int ixgbe_tx_map(struct ixgbe_ring *tx_ring,
80208020
return 0;
80218021
dma_error:
80228022
dev_err(tx_ring->dev, "TX DMA map failed\n");
8023-
tx_buffer = &tx_ring->tx_buffer_info[i];
80248023

80258024
/* clear dma mappings for failed tx_buffer_info map */
8026-
while (tx_buffer != first) {
8025+
for (;;) {
8026+
tx_buffer = &tx_ring->tx_buffer_info[i];
80278027
if (dma_unmap_len(tx_buffer, len))
80288028
dma_unmap_page(tx_ring->dev,
80298029
dma_unmap_addr(tx_buffer, dma),
80308030
dma_unmap_len(tx_buffer, len),
80318031
DMA_TO_DEVICE);
80328032
dma_unmap_len_set(tx_buffer, len, 0);
8033-
8034-
if (i--)
8033+
if (tx_buffer == first)
8034+
break;
8035+
if (i == 0)
80358036
i += tx_ring->count;
8036-
tx_buffer = &tx_ring->tx_buffer_info[i];
8037+
i--;
80378038
}
80388039

8039-
if (dma_unmap_len(tx_buffer, len))
8040-
dma_unmap_single(tx_ring->dev,
8041-
dma_unmap_addr(tx_buffer, dma),
8042-
dma_unmap_len(tx_buffer, len),
8043-
DMA_TO_DEVICE);
8044-
dma_unmap_len_set(tx_buffer, len, 0);
8045-
80468040
dev_kfree_skb_any(first->skb);
80478041
first->skb = NULL;
80488042

0 commit comments

Comments
 (0)