Skip to content

Commit 09ec8e7

Browse files
Manish Chopradavem330
authored andcommitted
qede: Fix DMA address APIs usage
Driver incorrectly uses dma_unmap_addr_set() to set a variable which is in truth a dma_addr_t [i.e not defined using DEFINE_DMA_UNMAP_ADDR()] and is being used by the driver flows other than unmapping physical addresses. This patch fixes driver fastpath where CONFIG_NEED_DMA_MAP_STATE is not set. Signed-off-by: Manish Chopra <[email protected]> Signed-off-by: Yuval Mintz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1968a0b commit 09ec8e7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/net/ethernet/qlogic/qede/qede_main.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,8 +1076,7 @@ static void qede_tpa_start(struct qede_dev *edev,
10761076
* start until its over and we don't want to risk allocation failing
10771077
* here, so re-allocate when aggregation will be over.
10781078
*/
1079-
dma_unmap_addr_set(sw_rx_data_prod, mapping,
1080-
dma_unmap_addr(replace_buf, mapping));
1079+
sw_rx_data_prod->mapping = replace_buf->mapping;
10811080

10821081
sw_rx_data_prod->data = replace_buf->data;
10831082
rx_bd_prod->addr.hi = cpu_to_le32(upper_32_bits(mapping));
@@ -2655,7 +2654,7 @@ static void qede_free_sge_mem(struct qede_dev *edev,
26552654

26562655
if (replace_buf->data) {
26572656
dma_unmap_page(&edev->pdev->dev,
2658-
dma_unmap_addr(replace_buf, mapping),
2657+
replace_buf->mapping,
26592658
PAGE_SIZE, DMA_FROM_DEVICE);
26602659
__free_page(replace_buf->data);
26612660
}
@@ -2755,7 +2754,7 @@ static int qede_alloc_sge_mem(struct qede_dev *edev,
27552754
goto err;
27562755
}
27572756

2758-
dma_unmap_addr_set(replace_buf, mapping, mapping);
2757+
replace_buf->mapping = mapping;
27592758
tpa_info->replace_buf.page_offset = 0;
27602759

27612760
tpa_info->replace_buf_mapping = mapping;

0 commit comments

Comments
 (0)