DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: "David Marchand" <david.marchand@redhat.com>,
	"Bruce Richardson" <bruce.richardson@intel.com>,
	"Qi Zhang" <qi.z.zhang@intel.com>,
	"Morten Brørup" <mb@smartsharesystems.com>,
	"Shijith Thotton" <sthotton@marvell.com>,
	"Chengwen Feng" <fengchengwen@huawei.com>,
	"Ruifeng Wang" <ruifeng.wang@arm.com>,
	"Dongdong Liu" <liudongdong3@huawei.com>,
	"Yisen Zhuang" <yisen.zhuang@huawei.com>
Subject: [PATCH v3 2/5] net/hns3: support IOVA forced as VA
Date: Tue, 14 Mar 2023 15:29:55 +0100	[thread overview]
Message-ID: <20230314142958.3479004-3-thomas@monjalon.net> (raw)
In-Reply-To: <20230314142958.3479004-1-thomas@monjalon.net>

From: Chengwen Feng <fengchengwen@huawei.com>

Claim PMD does not require IOVA mbuf field,
so it can build when disabling enable_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>
---
 drivers/net/hns3/hns3_rxtx_vec_neon.h |  2 +-
 drivers/net/hns3/hns3_rxtx_vec_sve.c  | 13 +++++++++----
 drivers/net/hns3/meson.build          |  6 ++----
 3 files changed, 12 insertions(+), 9 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..8bfc3de049 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_IN_MBUF
 		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 2c71105275..97cb85dcc8 100644
--- a/drivers/net/hns3/meson.build
+++ b/drivers/net/hns3/meson.build
@@ -13,10 +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_IN_MBUF') == 0
-    subdir_done()
-endif
-
 sources = files(
         'hns3_cmd.c',
         'hns3_dcb.c',
@@ -37,6 +33,8 @@ sources = files(
         'hns3_dump.c',
 )
 
+require_iova_in_mbuf = false
+
 deps += ['hash']
 
 if arch_subdir == 'arm' and dpdk_conf.get('RTE_ARCH_64')
-- 
2.39.1


  parent reply	other threads:[~2023-03-14 14:30 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-19 11:55 [PATCH] drivers: skip build of sub-libs not supporting IOVA mode Thomas Monjalon
2023-03-02 13:52 ` Zhang, Qi Z
2023-03-02 13:57   ` Thomas Monjalon
2023-03-02 14:16     ` Zhang, Qi Z
2023-03-03 14:23       ` Thomas Monjalon
2023-03-02 14:26 ` Morten Brørup
2023-03-02 16:01 ` [EXT] " Shijith Thotton
2023-03-06 16:13 ` [PATCH v2 0/2] refactor diasbling IOVA as PA Thomas Monjalon
2023-03-06 16:13   ` [PATCH v2 1/2] build: clarify configuration without IOVA field in mbuf Thomas Monjalon
2023-03-06 16:35     ` Morten Brørup
2023-03-06 16:39     ` Bruce Richardson
2023-03-06 19:49       ` Thomas Monjalon
2023-03-09  1:43     ` fengchengwen
2023-03-09  7:29       ` Thomas Monjalon
2023-03-09 11:23         ` fengchengwen
2023-03-09 12:12           ` Thomas Monjalon
2023-03-09 13:10             ` Bruce Richardson
2023-03-13 15:51               ` Thomas Monjalon
2023-03-06 16:13   ` [PATCH v2 2/2] drivers: skip build of sub-libs not supporting IOVA mode Thomas Monjalon
2023-03-14 14:29 ` [PATCH v3 0/5] refactor disabling IOVA as PA Thomas Monjalon
2023-03-14 14:29   ` [PATCH v3 1/5] build: clarify configuration without IOVA field in mbuf Thomas Monjalon
2023-03-15  1:56     ` fengchengwen
2023-03-16 11:00       ` Thomas Monjalon
2023-03-14 14:29   ` Thomas Monjalon [this message]
2023-03-14 14:29   ` [PATCH v3 3/5] dma/hisilicon: support IOVA forced as VA Thomas Monjalon
2023-03-14 14:29   ` [PATCH v3 4/5] compress/octeontx: " Thomas Monjalon
2023-03-14 14:29   ` [PATCH v3 5/5] drivers: skip build of sub-libs not supporting IOVA mode Thomas Monjalon

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=20230314142958.3479004-3-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=liudongdong3@huawei.com \
    --cc=mb@smartsharesystems.com \
    --cc=qi.z.zhang@intel.com \
    --cc=ruifeng.wang@arm.com \
    --cc=sthotton@marvell.com \
    --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).