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 100ADA0542; Fri, 7 Oct 2022 21:31:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D433E42684; Fri, 7 Oct 2022 21:31:02 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 7475542684 for ; Fri, 7 Oct 2022 21:31:01 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 297Bq4Gu023318; Fri, 7 Oct 2022 12:30:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=6iWrd3Fm5M7FFbnER4bOGgCY9kLoJ0Ci2ys1J2KNHNQ=; b=XGQYDlFtwD+TBKP3c6VpDDOHa320VyyR9f5qVfnl2TWM/b8XZPfYf0PWdixpX/Q6tYsn qsWb5THidzrgVrnKY5Hhkinpey6kAHOoWX0nnmHeSCER/tTDIw0JUZP51GDEAUf3cwPR fXdi3K1U5PPmo9XWo4aSxNbE3iINHW8fvYMJ4AVsgbrUP4UFQkV9hxkVmncs8TD5rJKM mcGRy7uNhK5yTCvAxGARWXiDKx921Pe8taECIZdG5l761fIzH8BEI+2xPyhaPIX9e+Jx iycHJCM986CUiGjXKhUsVz4EzIBfpWqVlyWR4JzvwzobIJZX3moCiYsfiXCTVpOOT+n2 PQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3k1d7gsjj6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 07 Oct 2022 12:30:56 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 Oct 2022 12:30:54 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Fri, 7 Oct 2022 12:30:53 -0700 Received: from localhost.localdomain (unknown [10.28.34.29]) by maili.marvell.com (Postfix) with ESMTP id 091933F704E; Fri, 7 Oct 2022 12:30:48 -0700 (PDT) From: Shijith Thotton To: CC: Shijith Thotton , , , , , , , , , , Chengwen Feng , "Kevin Laatz" Subject: [PATCH v4 2/7] test/dma: use API to get mbuf data physical address Date: Sat, 8 Oct 2022 01:00:24 +0530 Message-ID: <79cf69f1f413923dc4ea28bbb378b340f19778c2.1665170500.git.sthotton@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: OgqeehNo5LeaR9i6fdJbpOyUMayly81p X-Proofpoint-ORIG-GUID: OgqeehNo5LeaR9i6fdJbpOyUMayly81p X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-07_04,2022-10-07_01,2022-06-22_01 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 Used rte_mbuf_data_iova API to get the physical address of mbuf data. Signed-off-by: Shijith Thotton --- app/test/test_dmadev.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c index 9e8e101f40..fe62e98af8 100644 --- a/app/test/test_dmadev.c +++ b/app/test/test_dmadev.c @@ -110,8 +110,8 @@ do_multi_copies(int16_t dev_id, uint16_t vchan, for (j = 0; j < COPY_LEN/sizeof(uint64_t); j++) src_data[j] = rte_rand(); - if (rte_dma_copy(dev_id, vchan, srcs[i]->buf_iova + srcs[i]->data_off, - dsts[i]->buf_iova + dsts[i]->data_off, COPY_LEN, 0) != id_count++) + if (rte_dma_copy(dev_id, vchan, rte_mbuf_data_iova(srcs[i]), + rte_mbuf_data_iova(dsts[i]), COPY_LEN, 0) != id_count++) ERR_RETURN("Error with rte_dma_copy for buffer %u\n", i); } rte_dma_submit(dev_id, vchan); @@ -317,9 +317,8 @@ test_failure_in_full_burst(int16_t dev_id, uint16_t vchan, bool fence, rte_dma_stats_get(dev_id, vchan, &baseline); /* get a baseline set of stats */ for (i = 0; i < COMP_BURST_SZ; i++) { int id = rte_dma_copy(dev_id, vchan, - (i == fail_idx ? 0 : (srcs[i]->buf_iova + srcs[i]->data_off)), - dsts[i]->buf_iova + dsts[i]->data_off, - COPY_LEN, OPT_FENCE(i)); + (i == fail_idx ? 0 : rte_mbuf_data_iova(srcs[i])), + rte_mbuf_data_iova(dsts[i]), COPY_LEN, OPT_FENCE(i)); if (id < 0) ERR_RETURN("Error with rte_dma_copy for buffer %u\n", i); if (i == fail_idx) @@ -407,9 +406,8 @@ test_individual_status_query_with_failure(int16_t dev_id, uint16_t vchan, bool f for (j = 0; j < COMP_BURST_SZ; j++) { int id = rte_dma_copy(dev_id, vchan, - (j == fail_idx ? 0 : (srcs[j]->buf_iova + srcs[j]->data_off)), - dsts[j]->buf_iova + dsts[j]->data_off, - COPY_LEN, OPT_FENCE(j)); + (j == fail_idx ? 0 : rte_mbuf_data_iova(srcs[j])), + rte_mbuf_data_iova(dsts[j]), COPY_LEN, OPT_FENCE(j)); if (id < 0) ERR_RETURN("Error with rte_dma_copy for buffer %u\n", j); if (j == fail_idx) @@ -470,9 +468,8 @@ test_single_item_status_query_with_failure(int16_t dev_id, uint16_t vchan, for (j = 0; j < COMP_BURST_SZ; j++) { int id = rte_dma_copy(dev_id, vchan, - (j == fail_idx ? 0 : (srcs[j]->buf_iova + srcs[j]->data_off)), - dsts[j]->buf_iova + dsts[j]->data_off, - COPY_LEN, 0); + (j == fail_idx ? 0 : rte_mbuf_data_iova(srcs[j])), + rte_mbuf_data_iova(dsts[j]), COPY_LEN, 0); if (id < 0) ERR_RETURN("Error with rte_dma_copy for buffer %u\n", j); if (j == fail_idx) @@ -529,15 +526,14 @@ test_multi_failure(int16_t dev_id, uint16_t vchan, struct rte_mbuf **srcs, struc /* enqueue and gather completions in one go */ for (j = 0; j < COMP_BURST_SZ; j++) { - uintptr_t src = srcs[j]->buf_iova + srcs[j]->data_off; + uintptr_t src = rte_mbuf_data_iova(srcs[j]); /* set up for failure if the current index is anywhere is the fails array */ for (i = 0; i < num_fail; i++) if (j == fail[i]) src = 0; - int id = rte_dma_copy(dev_id, vchan, - src, dsts[j]->buf_iova + dsts[j]->data_off, - COPY_LEN, 0); + int id = rte_dma_copy(dev_id, vchan, src, rte_mbuf_data_iova(dsts[j]), + COPY_LEN, 0); if (id < 0) ERR_RETURN("Error with rte_dma_copy for buffer %u\n", j); } @@ -565,15 +561,14 @@ test_multi_failure(int16_t dev_id, uint16_t vchan, struct rte_mbuf **srcs, struc /* enqueue and gather completions in bursts, but getting errors one at a time */ for (j = 0; j < COMP_BURST_SZ; j++) { - uintptr_t src = srcs[j]->buf_iova + srcs[j]->data_off; + uintptr_t src = rte_mbuf_data_iova(srcs[j]); /* set up for failure if the current index is anywhere is the fails array */ for (i = 0; i < num_fail; i++) if (j == fail[i]) src = 0; - int id = rte_dma_copy(dev_id, vchan, - src, dsts[j]->buf_iova + dsts[j]->data_off, - COPY_LEN, 0); + int id = rte_dma_copy(dev_id, vchan, src, rte_mbuf_data_iova(dsts[j]), + COPY_LEN, 0); if (id < 0) ERR_RETURN("Error with rte_dma_copy for buffer %u\n", j); } -- 2.25.1