From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: mdr@ashroe.eu, david.marchand@redhat.com,
Hemant Agrawal <hemant.agrawal@nxp.com>,
Sachin Saxena <sachin.saxena@nxp.com>,
Fiona Trahe <fiona.trahe@intel.com>,
Ashish Gupta <ashish.gupta@marvell.com>,
Somalapuram Amaranath <asomalap@amd.com>,
Anoob Joseph <anoobj@marvell.com>,
Jay Zhou <jianjay.zhou@huawei.com>,
Qiming Yang <qiming.yang@intel.com>,
Qi Zhang <qi.z.zhang@intel.com>,
Gagandeep Singh <g.singh@nxp.com>,
Akhil Goyal <akhil.goyal@nxp.com>,
Anatoly Burakov <anatoly.burakov@intel.com>,
Ferruh Yigit <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH 1/4] mem: remove physical address aliases
Date: Mon, 14 Sep 2020 18:17:57 +0200 [thread overview]
Message-ID: <20200914161801.572174-2-thomas@monjalon.net> (raw)
In-Reply-To: <20200914161801.572174-1-thomas@monjalon.net>
Remove the deprecated unioned fields phys_addr
from the structures rte_memseg and rte_memzone.
They are replaced with the fields iova which are at the same offsets.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 +-
drivers/common/dpaax/dpaax_iova_table.c | 2 +-
drivers/compress/qat/qat_comp.c | 2 +-
drivers/compress/qat/qat_comp_pmd.c | 2 +-
drivers/crypto/ccp/ccp_dev.c | 2 +-
drivers/crypto/octeontx/otx_cryptodev_hw_access.c | 2 +-
drivers/crypto/virtio/virtio_cryptodev.c | 6 +++---
drivers/net/ice/base/ice_osdep.h | 2 +-
drivers/net/pfe/base/pfe.h | 2 +-
lib/librte_eal/include/rte_memory.h | 6 +-----
lib/librte_eal/include/rte_memzone.h | 6 +-----
lib/librte_kni/rte_kni.c | 14 +++++++-------
12 files changed, 20 insertions(+), 28 deletions(-)
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 35423df12b..2dd53c63ba 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -368,7 +368,7 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
memseg = rte_mem_virt2memseg((void *)(uintptr_t)vaddr, NULL);
if (memseg)
- return memseg->phys_addr + RTE_PTR_DIFF(vaddr, memseg->addr);
+ return memseg->iova + RTE_PTR_DIFF(vaddr, memseg->addr);
return (size_t)NULL;
}
diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c
index 5ba8ed1933..91bee65e7b 100644
--- a/drivers/common/dpaax/dpaax_iova_table.c
+++ b/drivers/common/dpaax/dpaax_iova_table.c
@@ -440,7 +440,7 @@ dpaax_memevent_walk_memsegs(const struct rte_memseg_list *msl __rte_unused,
void *arg __rte_unused)
{
DPAAX_DEBUG("Walking for %p (pa=%"PRIu64") and len %zu",
- ms->addr, ms->phys_addr, len);
+ ms->addr, ms->iova, len);
dpaax_iova_table_update(rte_mem_virt2phy(ms->addr), ms->addr, len);
return 0;
}
diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
index 9e1fd2fe91..335fd63b98 100644
--- a/drivers/compress/qat/qat_comp.c
+++ b/drivers/compress/qat/qat_comp.c
@@ -957,7 +957,7 @@ static int qat_comp_create_templates(struct qat_comp_xform *qat_xform,
ICP_QAT_FW_SLICE_XLAT);
comp_req->u1.xlt_pars.inter_buff_ptr =
- interm_buff_mz->phys_addr;
+ interm_buff_mz->iova;
}
#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c
index 311e561685..18ecb34ba7 100644
--- a/drivers/compress/qat/qat_comp_pmd.c
+++ b/drivers/compress/qat/qat_comp_pmd.c
@@ -242,7 +242,7 @@ qat_comp_setup_inter_buffers(struct qat_comp_dev_private *comp_dev,
}
mz_start = (uint8_t *)memzone->addr;
- mz_start_phys = memzone->phys_addr;
+ mz_start_phys = memzone->iova;
QAT_LOG(DEBUG, "Memzone %s: addr = %p, phys = 0x%"PRIx64
", size required %d, size created %zu",
inter_buff_mz_name, mz_start, mz_start_phys,
diff --git a/drivers/crypto/ccp/ccp_dev.c b/drivers/crypto/ccp/ccp_dev.c
index 7d98b2eb25..664ddc1747 100644
--- a/drivers/crypto/ccp/ccp_dev.c
+++ b/drivers/crypto/ccp/ccp_dev.c
@@ -546,7 +546,7 @@ ccp_add_device(struct ccp_device *dev, int type)
cmd_q->qsize, SOCKET_ID_ANY);
cmd_q->qbase_addr = (void *)q_mz->addr;
cmd_q->qbase_desc = (void *)q_mz->addr;
- cmd_q->qbase_phys_addr = q_mz->phys_addr;
+ cmd_q->qbase_phys_addr = q_mz->iova;
cmd_q->qcontrol = 0;
/* init control reg to zero */
diff --git a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c
index ce546c2ffe..ee36b0183e 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c
@@ -556,7 +556,7 @@ otx_cpt_get_resource(const struct rte_cryptodev *dev, uint8_t group,
}
mem = rz->addr;
- dma_addr = rz->phys_addr;
+ dma_addr = rz->iova;
alloc_len = len;
memset(mem, 0, len);
diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c
index 31a5f1072a..1822f21744 100644
--- a/drivers/crypto/virtio/virtio_cryptodev.c
+++ b/drivers/crypto/virtio/virtio_cryptodev.c
@@ -411,7 +411,7 @@ virtio_crypto_queue_setup(struct rte_cryptodev *dev,
* and only accepts 32 bit page frame number.
* Check if the allocated physical memory exceeds 16TB.
*/
- if ((mz->phys_addr + vq->vq_ring_size - 1)
+ if ((mz->iova + vq->vq_ring_size - 1)
>> (VIRTIO_PCI_QUEUE_ADDR_SHIFT + 32)) {
VIRTIO_CRYPTO_INIT_LOG_ERR("vring address shouldn't be "
"above 16TB!");
@@ -420,10 +420,10 @@ virtio_crypto_queue_setup(struct rte_cryptodev *dev,
memset(mz->addr, 0, sizeof(mz->len));
vq->mz = mz;
- vq->vq_ring_mem = mz->phys_addr;
+ vq->vq_ring_mem = mz->iova;
vq->vq_ring_virt_mem = mz->addr;
VIRTIO_CRYPTO_INIT_LOG_DBG("vq->vq_ring_mem(physical): 0x%"PRIx64,
- (uint64_t)mz->phys_addr);
+ (uint64_t)mz->iova);
VIRTIO_CRYPTO_INIT_LOG_DBG("vq->vq_ring_virt_mem: 0x%"PRIx64,
(uint64_t)(uintptr_t)mz->addr);
diff --git a/drivers/net/ice/base/ice_osdep.h b/drivers/net/ice/base/ice_osdep.h
index 360e435b8d..9a170b5143 100644
--- a/drivers/net/ice/base/ice_osdep.h
+++ b/drivers/net/ice/base/ice_osdep.h
@@ -258,7 +258,7 @@ ice_alloc_dma_mem(__rte_unused struct ice_hw *hw,
mem->size = size;
mem->va = mz->addr;
- mem->pa = mz->phys_addr;
+ mem->pa = mz->iova;
mem->zone = (const void *)mz;
PMD_DRV_LOG(DEBUG, "memzone %s allocated with physical address: "
"%"PRIu64, mz->name, mem->pa);
diff --git a/drivers/net/pfe/base/pfe.h b/drivers/net/pfe/base/pfe.h
index 72741ba4a8..0a88e98c1b 100644
--- a/drivers/net/pfe/base/pfe.h
+++ b/drivers/net/pfe/base/pfe.h
@@ -414,7 +414,7 @@ static inline phys_addr_t pfe_mem_vtop(uint64_t vaddr)
memseg = rte_mem_virt2memseg((void *)(uintptr_t)vaddr, NULL);
if (memseg)
- return memseg->phys_addr + RTE_PTR_DIFF(vaddr, memseg->addr);
+ return memseg->iova + RTE_PTR_DIFF(vaddr, memseg->addr);
return (size_t)NULL;
}
diff --git a/lib/librte_eal/include/rte_memory.h b/lib/librte_eal/include/rte_memory.h
index 65374d53a3..bba9b5300a 100644
--- a/lib/librte_eal/include/rte_memory.h
+++ b/lib/librte_eal/include/rte_memory.h
@@ -43,11 +43,7 @@ extern "C" {
#define RTE_MEMSEG_FLAG_DO_NOT_FREE (1 << 0)
/**< Prevent this segment from being freed back to the OS. */
struct rte_memseg {
- RTE_STD_C11
- union {
- phys_addr_t phys_addr; /**< deprecated - Start physical address. */
- rte_iova_t iova; /**< Start IO address. */
- };
+ rte_iova_t iova; /**< Start IO address. */
RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
diff --git a/lib/librte_eal/include/rte_memzone.h b/lib/librte_eal/include/rte_memzone.h
index 091c9522f7..5db1210831 100644
--- a/lib/librte_eal/include/rte_memzone.h
+++ b/lib/librte_eal/include/rte_memzone.h
@@ -51,11 +51,7 @@ struct rte_memzone {
#define RTE_MEMZONE_NAMESIZE 32 /**< Maximum length of memory zone name.*/
char name[RTE_MEMZONE_NAMESIZE]; /**< Name of the memory zone. */
- RTE_STD_C11
- union {
- phys_addr_t phys_addr; /**< deprecated - Start physical address. */
- rte_iova_t iova; /**< Start IO address. */
- };
+ rte_iova_t iova; /**< Start IO address. */
RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index bcf82cc2d5..837d0217d2 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -276,37 +276,37 @@ rte_kni_alloc(struct rte_mempool *pktmbuf_pool,
/* TX RING */
kni->tx_q = kni->m_tx_q->addr;
kni_fifo_init(kni->tx_q, KNI_FIFO_COUNT_MAX);
- dev_info.tx_phys = kni->m_tx_q->phys_addr;
+ dev_info.tx_phys = kni->m_tx_q->iova;
/* RX RING */
kni->rx_q = kni->m_rx_q->addr;
kni_fifo_init(kni->rx_q, KNI_FIFO_COUNT_MAX);
- dev_info.rx_phys = kni->m_rx_q->phys_addr;
+ dev_info.rx_phys = kni->m_rx_q->iova;
/* ALLOC RING */
kni->alloc_q = kni->m_alloc_q->addr;
kni_fifo_init(kni->alloc_q, KNI_FIFO_COUNT_MAX);
- dev_info.alloc_phys = kni->m_alloc_q->phys_addr;
+ dev_info.alloc_phys = kni->m_alloc_q->iova;
/* FREE RING */
kni->free_q = kni->m_free_q->addr;
kni_fifo_init(kni->free_q, KNI_FIFO_COUNT_MAX);
- dev_info.free_phys = kni->m_free_q->phys_addr;
+ dev_info.free_phys = kni->m_free_q->iova;
/* Request RING */
kni->req_q = kni->m_req_q->addr;
kni_fifo_init(kni->req_q, KNI_FIFO_COUNT_MAX);
- dev_info.req_phys = kni->m_req_q->phys_addr;
+ dev_info.req_phys = kni->m_req_q->iova;
/* Response RING */
kni->resp_q = kni->m_resp_q->addr;
kni_fifo_init(kni->resp_q, KNI_FIFO_COUNT_MAX);
- dev_info.resp_phys = kni->m_resp_q->phys_addr;
+ dev_info.resp_phys = kni->m_resp_q->iova;
/* Req/Resp sync mem area */
kni->sync_addr = kni->m_sync_addr->addr;
dev_info.sync_va = kni->m_sync_addr->addr;
- dev_info.sync_phys = kni->m_sync_addr->phys_addr;
+ dev_info.sync_phys = kni->m_sync_addr->iova;
kni->pktmbuf_pool = pktmbuf_pool;
kni->group_id = conf->group_id;
--
2.28.0
next prev 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 ` Thomas Monjalon [this message]
2020-09-15 7:07 ` [dpdk-dev] [PATCH 1/4] mem: remove physical address aliases 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 ` [dpdk-dev] [PATCH 4/4] mbuf: remove physical address alias Thomas Monjalon
2020-09-15 7:10 ` 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-2-thomas@monjalon.net \
--to=thomas@monjalon.net \
--cc=akhil.goyal@nxp.com \
--cc=anatoly.burakov@intel.com \
--cc=anoobj@marvell.com \
--cc=ashish.gupta@marvell.com \
--cc=asomalap@amd.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=fiona.trahe@intel.com \
--cc=g.singh@nxp.com \
--cc=hemant.agrawal@nxp.com \
--cc=jianjay.zhou@huawei.com \
--cc=mdr@ashroe.eu \
--cc=qi.z.zhang@intel.com \
--cc=qiming.yang@intel.com \
--cc=sachin.saxena@nxp.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).