From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 29454A055C; Fri, 27 May 2022 05:47:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87261427FF; Fri, 27 May 2022 05:47:12 +0200 (CEST) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 6055640E50 for ; Fri, 27 May 2022 05:47:09 +0200 (CEST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L8W0t3lncz1JC5Q; Fri, 27 May 2022 11:45:34 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 27 May 2022 11:47:07 +0800 From: Chengwen Feng To: CC: , , Subject: [PATCH 2/4] app/test: support test last-idx when no DMA completed Date: Fri, 27 May 2022 11:40:53 +0800 Message-ID: <20220527034055.33271-3-fengchengwen@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220527034055.33271-1-fengchengwen@huawei.com> References: <20220527034055.33271-1-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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 2b097e0f47..a7651a486f 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.33.0