DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: mdr@ashroe.eu, david.marchand@redhat.com,
	Neil Horman <nhorman@tuxdriver.com>,
	John McNamara <john.mcnamara@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>,
	Anoob Joseph <anoobj@marvell.com>,
	Beilei Xing <beilei.xing@intel.com>, Jeff Guo <jia.guo@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Qiming Yang <qiming.yang@intel.com>,
	Qi Zhang <qi.z.zhang@intel.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Olivier Matz <olivier.matz@6wind.com>
Subject: [dpdk-dev] [PATCH 4/4] mbuf: remove physical address alias
Date: Mon, 14 Sep 2020 18:18:00 +0200
Message-ID: <20200914161801.572174-5-thomas@monjalon.net> (raw)
In-Reply-To: <20200914161801.572174-1-thomas@monjalon.net>

Remove the deprecated buf_physaddr union field from rte_mbuf.
It is replaced with buf_iova which is at the same offset.

The single field buf_physaddr in rte_kni_mbuf is also renamed.

This concludes a 3-year process of semantic change.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 doc/guides/rel_notes/deprecation.rst          |  2 --
 doc/guides/rel_notes/release_20_11.rst        |  3 +++
 drivers/common/cpt/cpt_ucode.h                |  2 +-
 drivers/net/i40e/i40e_rxtx_vec_avx2.c         | 18 +++++++++---------
 drivers/net/iavf/iavf_rxtx_vec_avx2.c         | 18 +++++++++---------
 drivers/net/ice/ice_rxtx_vec_avx2.c           | 18 +++++++++---------
 kernel/linux/kni/kni_net.c                    |  6 +++---
 lib/librte_eal/linux/include/rte_kni_common.h |  2 +-
 lib/librte_mbuf/rte_mbuf_core.h               |  6 +-----
 9 files changed, 36 insertions(+), 39 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 52168f7751..143b7694a5 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -148,8 +148,6 @@ Deprecation Notices
   avoiding impact on vectorized implementation of the driver datapaths,
   while evaluating performance gains of a better use of the first cache line.
 
-  The deprecated unioned field ``buf_physaddr`` will be removed in DPDK 20.11.
-
 * ethdev: Split the ``struct eth_dev_ops`` struct to hide it as much as possible
   will be done in 20.11.
   Currently the ``struct eth_dev_ops`` struct is accessible by the application
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index b729bdf200..64348ad2c8 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -88,6 +88,9 @@ API Changes
   the structures ``rte_mbuf`` and ``rte_mbuf_ext_shared_info``.
   The field ``refcnt`` is remaining from the old unions.
 
+* mbuf: Removed the unioned field ``buf_physaddr`` from ``rte_mbuf``.
+  The field ``buf_iova`` is remaining from the old union.
+
 * rawdev: Added a structure size parameter to the functions
   ``rte_rawdev_queue_setup()``, ``rte_rawdev_queue_conf_get()``,
   ``rte_rawdev_info_get()`` and ``rte_rawdev_configure()``,
diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h
index 4e79fbf7a5..763355fb1f 100644
--- a/drivers/common/cpt/cpt_ucode.h
+++ b/drivers/common/cpt/cpt_ucode.h
@@ -2862,7 +2862,7 @@ alloc_op_meta(struct rte_mbuf *m_src,
 		tailroom = rte_pktmbuf_tailroom(m_src);
 		if (likely(tailroom > len + 8)) {
 			mdata = (uint8_t *)m_src->buf_addr + m_src->buf_len;
-			mphys = m_src->buf_physaddr + m_src->buf_len;
+			mphys = m_src->buf_iova + m_src->buf_len;
 			mdata -= len;
 			mphys -= len;
 			buf->vaddr = mdata;
diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
index 3bcef13638..37e7db5d7e 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
@@ -59,8 +59,8 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq)
 		mb0 = rxep[0].mbuf;
 		mb1 = rxep[1].mbuf;
 
-		/* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */
-		RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_physaddr) !=
+		/* load buf_addr(lo 64bit) and buf_iova(hi 64bit) */
+		RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iova) !=
 				offsetof(struct rte_mbuf, buf_addr) + 8);
 		vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr);
 		vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr);
@@ -92,8 +92,8 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq)
 		mb2 = rxep[2].mbuf;
 		mb3 = rxep[3].mbuf;
 
-		/* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */
-		RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_physaddr) !=
+		/* load buf_addr(lo 64bit) and buf_iova(hi 64bit) */
+		RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iova) !=
 				offsetof(struct rte_mbuf, buf_addr) + 8);
 		vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr);
 		vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr);
@@ -814,7 +814,7 @@ vtx1(volatile struct i40e_tx_desc *txdp,
 			((uint64_t)pkt->data_len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT));
 
 	__m128i descriptor = _mm_set_epi64x(high_qw,
-				pkt->buf_physaddr + pkt->data_off);
+				pkt->buf_iova + pkt->data_off);
 	_mm_store_si128((__m128i *)txdp, descriptor);
 }
 
@@ -843,11 +843,11 @@ vtx(volatile struct i40e_tx_desc *txdp,
 				((uint64_t)pkt[0]->data_len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT);
 
 		__m256i desc2_3 = _mm256_set_epi64x(
-				hi_qw3, pkt[3]->buf_physaddr + pkt[3]->data_off,
-				hi_qw2, pkt[2]->buf_physaddr + pkt[2]->data_off);
+				hi_qw3, pkt[3]->buf_iova + pkt[3]->data_off,
+				hi_qw2, pkt[2]->buf_iova + pkt[2]->data_off);
 		__m256i desc0_1 = _mm256_set_epi64x(
-				hi_qw1, pkt[1]->buf_physaddr + pkt[1]->data_off,
-				hi_qw0, pkt[0]->buf_physaddr + pkt[0]->data_off);
+				hi_qw1, pkt[1]->buf_iova + pkt[1]->data_off,
+				hi_qw0, pkt[0]->buf_iova + pkt[0]->data_off);
 		_mm256_store_si256((void *)(txdp + 2), desc2_3);
 		_mm256_store_si256((void *)txdp, desc0_1);
 	}
diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx2.c b/drivers/net/iavf/iavf_rxtx_vec_avx2.c
index e5e0fd3095..8f28afc8c5 100644
--- a/drivers/net/iavf/iavf_rxtx_vec_avx2.c
+++ b/drivers/net/iavf/iavf_rxtx_vec_avx2.c
@@ -52,8 +52,8 @@ iavf_rxq_rearm(struct iavf_rx_queue *rxq)
 		mb0 = rxp[0];
 		mb1 = rxp[1];
 
-		/* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */
-		RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_physaddr) !=
+		/* load buf_addr(lo 64bit) and buf_iova(hi 64bit) */
+		RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iova) !=
 				offsetof(struct rte_mbuf, buf_addr) + 8);
 		vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr);
 		vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr);
@@ -85,8 +85,8 @@ iavf_rxq_rearm(struct iavf_rx_queue *rxq)
 		mb2 = rxp[2];
 		mb3 = rxp[3];
 
-		/* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */
-		RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_physaddr) !=
+		/* load buf_addr(lo 64bit) and buf_iova(hi 64bit) */
+		RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iova) !=
 				offsetof(struct rte_mbuf, buf_addr) + 8);
 		vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr);
 		vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr);
@@ -1391,7 +1391,7 @@ iavf_vtx1(volatile struct iavf_tx_desc *txdp,
 		 ((uint64_t)pkt->data_len << IAVF_TXD_QW1_TX_BUF_SZ_SHIFT));
 
 	__m128i descriptor = _mm_set_epi64x(high_qw,
-				pkt->buf_physaddr + pkt->data_off);
+				pkt->buf_iova + pkt->data_off);
 	_mm_store_si128((__m128i *)txdp, descriptor);
 }
 
@@ -1430,15 +1430,15 @@ iavf_vtx(volatile struct iavf_tx_desc *txdp,
 		__m256i desc2_3 =
 			_mm256_set_epi64x
 				(hi_qw3,
-				 pkt[3]->buf_physaddr + pkt[3]->data_off,
+				 pkt[3]->buf_iova + pkt[3]->data_off,
 				 hi_qw2,
-				 pkt[2]->buf_physaddr + pkt[2]->data_off);
+				 pkt[2]->buf_iova + pkt[2]->data_off);
 		__m256i desc0_1 =
 			_mm256_set_epi64x
 				(hi_qw1,
-				 pkt[1]->buf_physaddr + pkt[1]->data_off,
+				 pkt[1]->buf_iova + pkt[1]->data_off,
 				 hi_qw0,
-				 pkt[0]->buf_physaddr + pkt[0]->data_off);
+				 pkt[0]->buf_iova + pkt[0]->data_off);
 		_mm256_store_si256((void *)(txdp + 2), desc2_3);
 		_mm256_store_si256((void *)txdp, desc0_1);
 	}
diff --git a/drivers/net/ice/ice_rxtx_vec_avx2.c b/drivers/net/ice/ice_rxtx_vec_avx2.c
index be50677c2f..b653805160 100644
--- a/drivers/net/ice/ice_rxtx_vec_avx2.c
+++ b/drivers/net/ice/ice_rxtx_vec_avx2.c
@@ -52,8 +52,8 @@ ice_rxq_rearm(struct ice_rx_queue *rxq)
 		mb0 = rxep[0].mbuf;
 		mb1 = rxep[1].mbuf;
 
-		/* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */
-		RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_physaddr) !=
+		/* load buf_addr(lo 64bit) and buf_iova(hi 64bit) */
+		RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iova) !=
 				offsetof(struct rte_mbuf, buf_addr) + 8);
 		vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr);
 		vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr);
@@ -85,8 +85,8 @@ ice_rxq_rearm(struct ice_rx_queue *rxq)
 		mb2 = rxep[2].mbuf;
 		mb3 = rxep[3].mbuf;
 
-		/* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */
-		RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_physaddr) !=
+		/* load buf_addr(lo 64bit) and buf_iova(hi 64bit) */
+		RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iova) !=
 				offsetof(struct rte_mbuf, buf_addr) + 8);
 		vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr);
 		vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr);
@@ -689,7 +689,7 @@ ice_vtx1(volatile struct ice_tx_desc *txdp,
 		 ((uint64_t)pkt->data_len << ICE_TXD_QW1_TX_BUF_SZ_S));
 
 	__m128i descriptor = _mm_set_epi64x(high_qw,
-				pkt->buf_physaddr + pkt->data_off);
+				pkt->buf_iova + pkt->data_off);
 	_mm_store_si128((__m128i *)txdp, descriptor);
 }
 
@@ -728,15 +728,15 @@ ice_vtx(volatile struct ice_tx_desc *txdp,
 		__m256i desc2_3 =
 			_mm256_set_epi64x
 				(hi_qw3,
-				 pkt[3]->buf_physaddr + pkt[3]->data_off,
+				 pkt[3]->buf_iova + pkt[3]->data_off,
 				 hi_qw2,
-				 pkt[2]->buf_physaddr + pkt[2]->data_off);
+				 pkt[2]->buf_iova + pkt[2]->data_off);
 		__m256i desc0_1 =
 			_mm256_set_epi64x
 				(hi_qw1,
-				 pkt[1]->buf_physaddr + pkt[1]->data_off,
+				 pkt[1]->buf_iova + pkt[1]->data_off,
 				 hi_qw0,
-				 pkt[0]->buf_physaddr + pkt[0]->data_off);
+				 pkt[0]->buf_iova + pkt[0]->data_off);
 		_mm256_store_si256((void *)(txdp + 2), desc2_3);
 		_mm256_store_si256((void *)txdp, desc0_1);
 	}
diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
index c82c881a2c..4b752083da 100644
--- a/kernel/linux/kni/kni_net.c
+++ b/kernel/linux/kni/kni_net.c
@@ -47,7 +47,7 @@ iova2kva(struct kni_dev *kni, void *iova)
 static inline void *
 iova2data_kva(struct kni_dev *kni, struct rte_kni_mbuf *m)
 {
-	return phys_to_virt(iova_to_phys(kni->usr_tsk, m->buf_physaddr) +
+	return phys_to_virt(iova_to_phys(kni->usr_tsk, m->buf_iova) +
 			    m->data_off);
 }
 #endif
@@ -67,7 +67,7 @@ pa2va(void *pa, struct rte_kni_mbuf *m)
 
 	va = (void *)((unsigned long)pa +
 			(unsigned long)m->buf_addr -
-			(unsigned long)m->buf_physaddr);
+			(unsigned long)m->buf_iova);
 	return va;
 }
 
@@ -75,7 +75,7 @@ pa2va(void *pa, struct rte_kni_mbuf *m)
 static void *
 kva2data_kva(struct rte_kni_mbuf *m)
 {
-	return phys_to_virt(m->buf_physaddr + m->data_off);
+	return phys_to_virt(m->buf_iova + m->data_off);
 }
 
 static inline void *
diff --git a/lib/librte_eal/linux/include/rte_kni_common.h b/lib/librte_eal/linux/include/rte_kni_common.h
index 7313ef504e..21b477f0aa 100644
--- a/lib/librte_eal/linux/include/rte_kni_common.h
+++ b/lib/librte_eal/linux/include/rte_kni_common.h
@@ -75,7 +75,7 @@ struct rte_kni_fifo {
  */
 struct rte_kni_mbuf {
 	void *buf_addr __attribute__((__aligned__(RTE_CACHE_LINE_SIZE)));
-	uint64_t buf_physaddr;
+	uint64_t buf_iova;
 	uint16_t data_off;      /**< Start address of data in segment buffer. */
 	char pad1[2];
 	uint16_t nb_segs;       /**< Number of segments. */
diff --git a/lib/librte_mbuf/rte_mbuf_core.h b/lib/librte_mbuf/rte_mbuf_core.h
index cee3d5aff5..8c2c20644d 100644
--- a/lib/librte_mbuf/rte_mbuf_core.h
+++ b/lib/librte_mbuf/rte_mbuf_core.h
@@ -476,11 +476,7 @@ struct rte_mbuf {
 	 * same mbuf cacheline0 layout for 32-bit and 64-bit. This makes
 	 * working on vector drivers easier.
 	 */
-	RTE_STD_C11
-	union {
-		rte_iova_t buf_iova;
-		rte_iova_t buf_physaddr; /**< deprecated */
-	} __rte_aligned(sizeof(rte_iova_t));
+	rte_iova_t buf_iova __rte_aligned(sizeof(rte_iova_t));
 
 	/* next 8 bytes are initialised on RX descriptor rearm */
 	RTE_MARKER64 rearm_data;
-- 
2.28.0


  parent reply	other threads:[~2020-09-14 16:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14 16:17 [dpdk-dev] [PATCH 0/4] remove aliases replaced with IOVA Thomas Monjalon
2020-09-14 16:17 ` [dpdk-dev] [PATCH 1/4] mem: remove physical address aliases Thomas Monjalon
2020-09-15  7:07   ` Andrew Rybchenko
2020-09-15 11:46   ` Burakov, Anatoly
2020-09-14 16:17 ` [dpdk-dev] [PATCH 2/4] mempool: " Thomas Monjalon
2020-09-15  7:08   ` Andrew Rybchenko
2020-09-14 16:17 ` [dpdk-dev] [PATCH 3/4] mbuf: remove deprecated function and macro aliases Thomas Monjalon
2020-09-15  7:09   ` Andrew Rybchenko
2020-09-15  8:38     ` Thomas Monjalon
2020-09-14 16:18 ` Thomas Monjalon [this message]
2020-09-15  7:10   ` [dpdk-dev] [PATCH 4/4] mbuf: remove physical address alias Andrew Rybchenko
2020-09-17 10:41 ` [dpdk-dev] [PATCH v2 0/4] remove aliases replaced with IOVA Thomas Monjalon
2020-09-17 10:41   ` [dpdk-dev] [PATCH v2 1/4] mem: remove physical address aliases Thomas Monjalon
2020-09-17 10:53     ` Hemant Agrawal
2020-09-18 14:38     ` Kinsella, Ray
2020-09-17 10:41   ` [dpdk-dev] [PATCH v2 2/4] mempool: " Thomas Monjalon
2020-09-18 14:39     ` Kinsella, Ray
2020-09-17 10:41   ` [dpdk-dev] [PATCH v2 3/4] mbuf: remove deprecated function and macro aliases Thomas Monjalon
2020-09-17 10:55     ` Hemant Agrawal
2020-09-18 14:42     ` Kinsella, Ray
2020-09-17 10:41   ` [dpdk-dev] [PATCH v2 4/4] mbuf: remove physical address alias Thomas Monjalon
2020-09-18 14:43     ` Kinsella, Ray
2020-09-18 22:32       ` 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=20200914161801.572174-5-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=anoobj@marvell.com \
    --cc=beilei.xing@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jia.guo@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=mdr@ashroe.eu \
    --cc=nhorman@tuxdriver.com \
    --cc=olivier.matz@6wind.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git