1 Star 0 Fork 76

chenjiji09/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0103-test-dma-check-index-when-no-DMA-completed.patch 1.76 KB
一键复制 编辑 原始数据 按行查看 历史
liudongdong3 提交于 2022-06-16 16:03 . sync patches from 22.07
From 33e515de3d5d00094f934e10b2d15af8e52511b5 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 27 May 2022 11:40:53 +0800
Subject: [PATCH 103/122] test/dma: check index when no DMA completed
If no DMA request is completed, the ring_idx of the last completed
operation need returned by last_idx parameter. This patch adds
testcase for it.
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Tested-by: Kevin Laatz <kevin.laatz@intel.com>
---
app/test/test_dmadev.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c
index b206db27ae..d9e8f6d8c3 100644
--- a/app/test/test_dmadev.c
+++ b/app/test/test_dmadev.c
@@ -177,6 +177,7 @@ do_multi_copies(int16_t dev_id, uint16_t vchan,
static int
test_enqueue_copies(int16_t dev_id, uint16_t vchan)
{
+ enum rte_dma_status_code status;
unsigned int i;
uint16_t id;
@@ -215,6 +216,20 @@ test_enqueue_copies(int16_t dev_id, uint16_t vchan)
ERR_RETURN("Error:incorrect job id received, %u [expected %u]\n",
id, id_count);
+ /* check for completed and id when no job done */
+ if (rte_dma_completed(dev_id, vchan, 1, &id, NULL) != 0)
+ ERR_RETURN("Error with rte_dma_completed when no job done\n");
+ if (id != id_count)
+ ERR_RETURN("Error:incorrect job id received when no job done, %u [expected %u]\n",
+ id, id_count);
+
+ /* check for completed_status and id when no job done */
+ if (rte_dma_completed_status(dev_id, vchan, 1, &id, &status) != 0)
+ ERR_RETURN("Error with rte_dma_completed_status when no job done\n");
+ if (id != id_count)
+ ERR_RETURN("Error:incorrect job id received when no job done, %u [expected %u]\n",
+ id, id_count);
+
rte_pktmbuf_free(src);
rte_pktmbuf_free(dst);
--
2.22.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chenjiji09/dpdk.git
git@gitee.com:chenjiji09/dpdk.git
chenjiji09
dpdk
dpdk
master

搜索帮助