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 175CA41E90; Tue, 14 Mar 2023 15:30:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CAA3842BFE; Tue, 14 Mar 2023 15:30:30 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id EF3D842BB1 for ; Tue, 14 Mar 2023 15:30:29 +0100 (CET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 489D5320094E; Tue, 14 Mar 2023 10:30:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 14 Mar 2023 10:30:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1678804227; x= 1678890627; bh=0J8LGN2KtqIHejnsAA/yRjKvr2xIcKLLYZaNXzn1Tdg=; b=j XXWYfzuuEMrQ4mpJKYvRpTHDDHxL9S4O6Y2jbOY3qK8Q+oWiQKYgmZzXWvzQNS4L kTcwjLjZVabE6aCAnTP3p36961JUZ8k23KcFChCT2+GBhs6CPqzzo5Voz6iUgE9f lacFeA4iEeahpn2hYXZBUHu7nTmG316YxBQ716w9s0XZM+CKWPc2wdBta307TXOT HcXEgANmx/2YebKGNiF9QdjeDUTXV9A7MMVJcQ4B1K4Ks2QObJPYlHu+fHTOb0/R wkQUPzaIDs7Pa1FaTslmHwUCNIZXTYJMPE3X1wp5S1+EmNTiNXsPW5yt8i1wZLRr LmheTuuDJFDflVcCf1e2g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1678804227; x= 1678890627; bh=0J8LGN2KtqIHejnsAA/yRjKvr2xIcKLLYZaNXzn1Tdg=; b=S fzarZ9Z/6rT8mta9/PvcHeyoX3z8abdfARrIDIwn/h4RVM9F5E5WUwqQPkl7HT6+ sO48qBCyuXB7qyIKWXdoChe/Omb9UURn7vXz3kWyH4BxaDk3mk3ISKXSxeBufUaP 83R8DyWxtqbR0ROHDliNbhnKeIIw0EwOlTZkiDfnx/AG/gQe+oKE7CFAMtSTgIX8 mYNzfaysQ805wYah8rpOY9p64QlxRKlADDk7J4ZLlrV64eOxBSyNom+Hb9lXsTMj tM+5t51u9JcNQtufgclUElZgrTizEzGwhzFtNYCFQM1B0o6VvVhm6dQhAUG8rGGJ nAt9uTQ0BM/rR+31L025w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddviedgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedvjefhudeghedvtdeijeeigeetuedugfejueekieeltdfhteev keehhfeilefhtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Mar 2023 10:30:26 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: David Marchand , Bruce Richardson , Qi Zhang , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Shijith Thotton , Chengwen Feng , Ruifeng Wang , Dongdong Liu , Yisen Zhuang Subject: [PATCH v3 2/5] net/hns3: support IOVA forced as VA Date: Tue, 14 Mar 2023 15:29:55 +0100 Message-Id: <20230314142958.3479004-3-thomas@monjalon.net> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230314142958.3479004-1-thomas@monjalon.net> References: <20230219115529.3260580-1-thomas@monjalon.net> <20230314142958.3479004-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Chengwen Feng Claim PMD does not require IOVA mbuf field, so it can build when disabling enable_iova_as_pa. Signed-off-by: Chengwen Feng Reviewed-by: Ruifeng Wang Acked-by: Dongdong Liu --- 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