* [PATCH] app/test: fix DMA API tests in IOVA as PA mode
@ 2025-02-27 13:27 Bruce Richardson
2025-02-28 0:15 ` fengchengwen
0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2025-02-27 13:27 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, fengchengwen, stable, Kevin Laatz, Conor Walsh
When running without IOMMU for address translation, i.e. IOVAs are
physical rather than virtual addresses, we need to translate the
pointers to IOVAs for the completion API tests.
Fixes: 9942ebb9c698 ("test/dma: add dmadev API test")
Cc: fengchengwen@huawei.com
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
app/test/test_dmadev_api.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/app/test/test_dmadev_api.c b/app/test/test_dmadev_api.c
index d40c05cfbf..fb49fcb56b 100644
--- a/app/test/test_dmadev_api.c
+++ b/app/test/test_dmadev_api.c
@@ -515,7 +515,9 @@ test_dma_completed(void)
setup_memory();
/* Check enqueue without submit */
- ret = rte_dma_copy(test_dev_id, 0, (rte_iova_t)src, (rte_iova_t)dst,
+ ret = rte_dma_copy(test_dev_id, 0,
+ rte_malloc_virt2iova(src),
+ rte_malloc_virt2iova(dst),
TEST_MEMCPY_SIZE, 0);
RTE_TEST_ASSERT_EQUAL(ret, 0, "Failed to enqueue copy, %d", ret);
rte_delay_us_sleep(TEST_WAIT_US_VAL);
@@ -537,7 +539,9 @@ test_dma_completed(void)
setup_memory();
/* Check for enqueue with submit */
- ret = rte_dma_copy(test_dev_id, 0, (rte_iova_t)src, (rte_iova_t)dst,
+ ret = rte_dma_copy(test_dev_id, 0,
+ rte_malloc_virt2iova(src),
+ rte_malloc_virt2iova(dst),
TEST_MEMCPY_SIZE, RTE_DMA_OP_FLAG_SUBMIT);
RTE_TEST_ASSERT_EQUAL(ret, 1, "Failed to enqueue copy, %d", ret);
rte_delay_us_sleep(TEST_WAIT_US_VAL);
@@ -572,7 +576,9 @@ test_dma_completed_status(void)
RTE_TEST_ASSERT_SUCCESS(ret, "Failed to start, %d", ret);
/* Check for enqueue with submit */
- ret = rte_dma_copy(test_dev_id, 0, (rte_iova_t)src, (rte_iova_t)dst,
+ ret = rte_dma_copy(test_dev_id, 0,
+ rte_malloc_virt2iova(src),
+ rte_malloc_virt2iova(dst),
TEST_MEMCPY_SIZE, RTE_DMA_OP_FLAG_SUBMIT);
RTE_TEST_ASSERT_EQUAL(ret, 0, "Failed to enqueue copy, %d", ret);
rte_delay_us_sleep(TEST_WAIT_US_VAL);
@@ -591,7 +597,9 @@ test_dma_completed_status(void)
RTE_TEST_ASSERT_EQUAL(cpl_ret, 0, "Failed to completed status");
/* Check for enqueue with submit again */
- ret = rte_dma_copy(test_dev_id, 0, (rte_iova_t)src, (rte_iova_t)dst,
+ ret = rte_dma_copy(test_dev_id, 0,
+ rte_malloc_virt2iova(src),
+ rte_malloc_virt2iova(dst),
TEST_MEMCPY_SIZE, RTE_DMA_OP_FLAG_SUBMIT);
RTE_TEST_ASSERT_EQUAL(ret, 1, "Failed to enqueue copy, %d", ret);
rte_delay_us_sleep(TEST_WAIT_US_VAL);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] app/test: fix DMA API tests in IOVA as PA mode
2025-02-27 13:27 [PATCH] app/test: fix DMA API tests in IOVA as PA mode Bruce Richardson
@ 2025-02-28 0:15 ` fengchengwen
2025-03-06 16:30 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: fengchengwen @ 2025-02-28 0:15 UTC (permalink / raw)
To: Bruce Richardson, dev; +Cc: stable, Kevin Laatz, Conor Walsh
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
On 2025/2/27 21:27, Bruce Richardson wrote:
> When running without IOMMU for address translation, i.e. IOVAs are
> physical rather than virtual addresses, we need to translate the
> pointers to IOVAs for the completion API tests.
>
> Fixes: 9942ebb9c698 ("test/dma: add dmadev API test")
> Cc: fengchengwen@huawei.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] app/test: fix DMA API tests in IOVA as PA mode
2025-02-28 0:15 ` fengchengwen
@ 2025-03-06 16:30 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2025-03-06 16:30 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, stable, Kevin Laatz, Conor Walsh, fengchengwen
28/02/2025 01:15, fengchengwen:
> Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
>
> On 2025/2/27 21:27, Bruce Richardson wrote:
> > When running without IOMMU for address translation, i.e. IOVAs are
> > physical rather than virtual addresses, we need to translate the
> > pointers to IOVAs for the completion API tests.
> >
> > Fixes: 9942ebb9c698 ("test/dma: add dmadev API test")
> > Cc: fengchengwen@huawei.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-06 16:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-27 13:27 [PATCH] app/test: fix DMA API tests in IOVA as PA mode Bruce Richardson
2025-02-28 0:15 ` fengchengwen
2025-03-06 16:30 ` Thomas Monjalon
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.