Skip to content

Commit 7e4d1c2

Browse files
committed
Merge branch 'dpaa2-swtso-fixes'
Ioana Ciornei says: ==================== dpaa2-eth: software TSO fixes This patch fixes the software TSO feature in dpaa2-eth. There are multiple errors that I made in the initial submission of the code, which I didn't caught since I was always running with passthough IOMMU. The bug report came in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215886 The bugs are in the Tx confirmation path, where I was trying to retrieve a virtual address after DMA unmapping the area. Besides that, another dma_unmap call was made with the wrong size. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 15d221d + 0a09c5b commit 7e4d1c2

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,7 @@ static void dpaa2_eth_free_tx_fd(struct dpaa2_eth_priv *priv,
10971097
u32 fd_len = dpaa2_fd_get_len(fd);
10981098
struct dpaa2_sg_entry *sgt;
10991099
int should_free_skb = 1;
1100+
void *tso_hdr;
11001101
int i;
11011102

11021103
fd_addr = dpaa2_fd_get_addr(fd);
@@ -1135,20 +1136,21 @@ static void dpaa2_eth_free_tx_fd(struct dpaa2_eth_priv *priv,
11351136
sgt = (struct dpaa2_sg_entry *)(buffer_start +
11361137
priv->tx_data_offset);
11371138

1139+
/* Unmap the SGT buffer */
1140+
dma_unmap_single(dev, fd_addr, swa->tso.sgt_size,
1141+
DMA_BIDIRECTIONAL);
1142+
11381143
/* Unmap and free the header */
1144+
tso_hdr = dpaa2_iova_to_virt(priv->iommu_domain, dpaa2_sg_get_addr(sgt));
11391145
dma_unmap_single(dev, dpaa2_sg_get_addr(sgt), TSO_HEADER_SIZE,
11401146
DMA_TO_DEVICE);
1141-
kfree(dpaa2_iova_to_virt(priv->iommu_domain, dpaa2_sg_get_addr(sgt)));
1147+
kfree(tso_hdr);
11421148

11431149
/* Unmap the other SG entries for the data */
11441150
for (i = 1; i < swa->tso.num_sg; i++)
11451151
dma_unmap_single(dev, dpaa2_sg_get_addr(&sgt[i]),
11461152
dpaa2_sg_get_len(&sgt[i]), DMA_TO_DEVICE);
11471153

1148-
/* Unmap the SGT buffer */
1149-
dma_unmap_single(dev, fd_addr, swa->sg.sgt_size,
1150-
DMA_BIDIRECTIONAL);
1151-
11521154
if (!swa->tso.is_last_fd)
11531155
should_free_skb = 0;
11541156
} else {

0 commit comments

Comments
 (0)