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 0F960A0548; Wed, 8 Jun 2022 10:56:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ACD1941614; Wed, 8 Jun 2022 10:56:31 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id D756241132 for ; Wed, 8 Jun 2022 10:56:29 +0200 (CEST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LJ1GM35ZczRhjb; Wed, 8 Jun 2022 16:53:15 +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; Wed, 8 Jun 2022 16:56:27 +0800 From: Chengwen Feng To: , , CC: , , Subject: [PATCH 2/3] test/dma: reset last-idx before invoke DMA completed ops Date: Wed, 8 Jun 2022 16:50:06 +0800 Message-ID: <20220608085007.10679-3-fengchengwen@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220608085007.10679-1-fengchengwen@huawei.com> References: <20220608085007.10679-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: dggems701-chm.china.huawei.com (10.3.19.178) 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 Some DMA PMD may not update last-idx when no DMA completed, the previous patch [1] cannot detect this problem actually. This patch resets last-idx before invoking DMA completed ops to fix it. [1] test/dma: check index when no DMA completed Signed-off-by: Chengwen Feng --- app/test/test_dmadev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c index a7651a486f..9e8e101f40 100644 --- a/app/test/test_dmadev.c +++ b/app/test/test_dmadev.c @@ -209,6 +209,7 @@ test_enqueue_copies(int16_t dev_id, uint16_t vchan) dst_data[i], src_data[i]); /* now check completion works */ + id = ~id; if (rte_dma_completed(dev_id, vchan, 1, &id, NULL) != 1) ERR_RETURN("Error with rte_dma_completed\n"); @@ -217,6 +218,7 @@ test_enqueue_copies(int16_t dev_id, uint16_t vchan) id, id_count); /* check for completed and id when no job done */ + id = ~id; 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) @@ -224,6 +226,7 @@ test_enqueue_copies(int16_t dev_id, uint16_t vchan) id, id_count); /* check for completed_status and id when no job done */ + id = ~id; 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) -- 2.33.0