From: Chengwen Feng <fengchengwen@huawei.com>
To: <thomas@monjalon.net>, <ferruh.yigit@amd.com>,
Ruifeng Wang <ruifeng.wang@arm.com>,
Dongdong Liu <liudongdong3@huawei.com>,
Yisen Zhuang <yisen.zhuang@huawei.com>
Cc: <dev@dpdk.org>, Chengwen Feng <fengchengwen@huawei.com>
Subject: [PATCH v2] net/hns3: support IOVA as VA
Date: Mon, 20 Feb 2023 09:00:49 +0000 [thread overview]
Message-ID: <20230220090049.54088-1-fengchengwen@huawei.com> (raw)
In-Reply-To: <20230214071141.50155-1-fengchengwen@huawei.com>
Claim PMD supports pmd_supports_disable_iova_as_pa.
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Dongdong Liu <liudongdong3@huawei.com>
---
v2: modify commit head which address Thomas's comment
add reviewed and acked by of v1.
---
drivers/net/hns3/hns3_rxtx_vec_neon.h | 2 +-
drivers/net/hns3/hns3_rxtx_vec_sve.c | 13 +++++++++----
drivers/net/hns3/meson.build | 7 +------
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/net/hns3/hns3_rxtx_vec_neon.h b/drivers/net/hns3/hns3_rxtx_vec_neon.h
index 55d9bf817d..6c49c70fc7 100644
--- a/drivers/net/hns3/hns3_rxtx_vec_neon.h
+++ b/drivers/net/hns3/hns3_rxtx_vec_neon.h
@@ -13,7 +13,7 @@ static inline void
hns3_vec_tx(volatile struct hns3_desc *desc, struct rte_mbuf *pkt)
{
uint64x2_t val1 = {
- pkt->buf_iova + pkt->data_off,
+ rte_pktmbuf_iova(pkt),
((uint64_t)pkt->data_len) << HNS3_TXD_SEND_SIZE_SHIFT
};
uint64x2_t val2 = {
diff --git a/drivers/net/hns3/hns3_rxtx_vec_sve.c b/drivers/net/hns3/hns3_rxtx_vec_sve.c
index 6f23ba674d..4bf933882a 100644
--- a/drivers/net/hns3/hns3_rxtx_vec_sve.c
+++ b/drivers/net/hns3/hns3_rxtx_vec_sve.c
@@ -261,10 +261,10 @@ hns3_rxq_rearm_mbuf_sve(struct hns3_rx_queue *rxq)
for (i = 0; i < HNS3_DEFAULT_RXQ_REARM_THRESH; i += REARM_LOOP_STEP_NUM,
rxep += REARM_LOOP_STEP_NUM, rxdp += REARM_LOOP_STEP_NUM) {
uint64_t iova[REARM_LOOP_STEP_NUM];
- iova[0] = rxep[0].mbuf->buf_iova;
- iova[1] = rxep[1].mbuf->buf_iova;
- iova[2] = rxep[2].mbuf->buf_iova;
- iova[3] = rxep[3].mbuf->buf_iova;
+ iova[0] = rte_mbuf_iova_get(rxep[0].mbuf);
+ iova[1] = rte_mbuf_iova_get(rxep[1].mbuf);
+ iova[2] = rte_mbuf_iova_get(rxep[2].mbuf);
+ iova[3] = rte_mbuf_iova_get(rxep[3].mbuf);
svuint64_t siova = svld1_u64(PG64_256BIT, iova);
siova = svadd_n_u64_z(PG64_256BIT, siova, RTE_PKTMBUF_HEADROOM);
svuint64_t ol_base = svdup_n_u64(0);
@@ -397,8 +397,13 @@ hns3_tx_fill_hw_ring_sve(struct hns3_tx_queue *txq,
pg = svwhilelt_b64_u32(i, nb_pkts);
base_addr = svld1_u64(pg, (uint64_t *)pkts);
/* calc mbuf's field buf_iova address */
+#if RTE_IOVA_AS_PA
buf_iova = svadd_n_u64_z(pg, base_addr,
offsetof(struct rte_mbuf, buf_iova));
+#else
+ buf_iova = svadd_n_u64_z(pg, base_addr,
+ offsetof(struct rte_mbuf, buf_addr));
+#endif
/* calc mbuf's field data_off address */
data_off = svadd_n_u64_z(pg, base_addr,
offsetof(struct rte_mbuf, data_off));
diff --git a/drivers/net/hns3/meson.build b/drivers/net/hns3/meson.build
index e1a5afa2ec..b8c0f80a20 100644
--- a/drivers/net/hns3/meson.build
+++ b/drivers/net/hns3/meson.build
@@ -13,12 +13,6 @@ if arch_subdir != 'x86' and arch_subdir != 'arm' or not dpdk_conf.get('RTE_ARCH_
subdir_done()
endif
-if dpdk_conf.get('RTE_IOVA_AS_PA') == 0
- build = false
- reason = 'driver does not support disabling IOVA as PA mode'
- subdir_done()
-endif
-
sources = files(
'hns3_cmd.c',
'hns3_dcb.c',
@@ -38,6 +32,7 @@ sources = files(
'hns3_common.c',
'hns3_dump.c',
)
+pmd_supports_disable_iova_as_pa = true
deps += ['hash']
--
2.17.1
prev parent reply other threads:[~2023-02-20 9:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-14 7:11 [PATCH] net/hns3: support disable IOVA as PA mode Chengwen Feng
2023-02-14 11:09 ` Dongdong Liu
2023-02-16 8:36 ` Ruifeng Wang
2023-02-20 7:44 ` Thomas Monjalon
2023-02-20 9:11 ` fengchengwen
2023-02-20 9:43 ` Morten Brørup
2023-02-20 10:16 ` Thomas Monjalon
2023-02-20 11:12 ` Morten Brørup
2023-02-20 11:52 ` Bruce Richardson
2023-02-20 12:04 ` Morten Brørup
2023-02-20 12:23 ` Bruce Richardson
2023-02-20 12:47 ` Morten Brørup
2023-02-20 14:12 ` Bruce Richardson
2023-02-20 15:07 ` Morten Brørup
2023-02-20 15:30 ` Thomas Monjalon
2023-02-20 15:35 ` Bruce Richardson
2023-02-20 15:40 ` Thomas Monjalon
2023-02-21 7:53 ` Morten Brørup
2023-02-20 9:00 ` Chengwen Feng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230220090049.54088-1-fengchengwen@huawei.com \
--to=fengchengwen@huawei.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=liudongdong3@huawei.com \
--cc=ruifeng.wang@arm.com \
--cc=thomas@monjalon.net \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).