* [dpdk-dev] [PATCH v1 0/4] make dpdk iova aware
@ 2017-08-14 15:15 Santosh Shukla
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 1/4] eal: rename phys_addr_t to iova_addr_t Santosh Shukla
` (5 more replies)
0 siblings, 6 replies; 91+ messages in thread
From: Santosh Shukla @ 2017-08-14 15:15 UTC (permalink / raw)
To: dev; +Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal, Santosh Shukla
Changeset based on deprecation notice[1], planned for v17.11 release.
Patches are based on version: 17.11-rc0.
Summary:
Renaming memory address translation api/ datatypes
and memory struct members to iova types.
Includes:
1st patch : rename phys_addr_t to iova_addr_t
2nd patch : rename dma var mainly buf_physaddr to buf_iovaaddr
3rd patch : rename memory translation api to _iova types.
4th patch : remove deprecation notice for dpdk iova aware.
Checkpatch warning:
- Noticed warning in changeset comining from legacy code. unreleated
with iova changes.
Thanks.
[1]
http://dpdk.org/browse/dpdk/commit/doc/guides/rel_notes?id=caa570db61307e07efc461cf558ec291a3e71b29
Santosh Shukla (4):
eal: rename phys_addr_t to iova_addr_t
eal/memory: rename buf_physaddr to buf_iovaaddr
eal/memory: rename memory translational api to _iova types
doc: remove dpdk iova aware notice
app/proc_info/main.c | 2 +-
app/test-crypto-perf/cperf_test_vector_parsing.c | 4 +--
app/test-crypto-perf/cperf_test_vectors.c | 6 ++--
app/test-crypto-perf/cperf_test_vectors.h | 4 +--
app/test-pmd/cmdline.c | 2 +-
doc/guides/contributing/documentation.rst | 4 +--
doc/guides/prog_guide/cryptodev_lib.rst | 6 ++--
doc/guides/prog_guide/img/mbuf1.svg | 2 +-
doc/guides/rel_notes/deprecation.rst | 7 ----
doc/guides/rel_notes/release_17_11.rst | 27 ++++++++++++++
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 20 +++++------
drivers/crypto/qat/qat_adf/qat_algs.h | 6 ++--
drivers/crypto/qat/qat_crypto.h | 2 +-
drivers/crypto/qat/qat_qp.c | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 +-
drivers/net/ark/ark_ddm.c | 2 +-
drivers/net/ark/ark_ddm.h | 4 +--
drivers/net/ark/ark_ethdev_rx.c | 24 ++++++-------
drivers/net/ark/ark_ethdev_tx.c | 6 ++--
drivers/net/ark/ark_mpu.c | 2 +-
drivers/net/ark/ark_mpu.h | 4 +--
drivers/net/ark/ark_udm.c | 2 +-
drivers/net/ark/ark_udm.h | 4 +--
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/avp/rte_avp_common.h | 20 +++++------
drivers/net/bnx2x/bnx2x.c | 40 ++++++++++-----------
drivers/net/bnx2x/bnx2x.h | 22 ++++++------
drivers/net/bnx2x/bnx2x_rxtx.c | 8 ++---
drivers/net/bnx2x/bnx2x_stats.c | 2 +-
drivers/net/bnx2x/bnx2x_vfpf.c | 2 +-
drivers/net/bnx2x/ecore_sp.h | 2 +-
drivers/net/bnxt/bnxt.h | 10 +++---
drivers/net/bnxt/bnxt_cpr.h | 4 +--
drivers/net/bnxt/bnxt_ethdev.c | 10 +++---
drivers/net/bnxt/bnxt_hwrm.c | 14 ++++----
drivers/net/bnxt/bnxt_ring.c | 6 ++--
drivers/net/bnxt/bnxt_ring.h | 4 +--
drivers/net/bnxt/bnxt_rxr.h | 4 +--
drivers/net/bnxt/bnxt_txr.h | 2 +-
drivers/net/bnxt/bnxt_vnic.c | 6 ++--
drivers/net/bnxt/bnxt_vnic.h | 6 ++--
drivers/net/cxgbe/sge.c | 4 +--
drivers/net/e1000/em_rxtx.c | 4 +--
drivers/net/e1000/igb_rxtx.c | 4 +--
drivers/net/ena/ena_ethdev.c | 6 ++--
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_rxtx.c | 6 ++--
drivers/net/fm10k/fm10k.h | 4 +--
drivers/net/fm10k/fm10k_ethdev.c | 4 +--
drivers/net/fm10k/fm10k_rxtx_vec.c | 4 +--
drivers/net/i40e/i40e_ethdev.c | 2 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 8 ++---
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 4 +--
drivers/net/i40e/i40e_rxtx_vec_neon.c | 6 ++--
drivers/net/i40e/i40e_rxtx_vec_sse.c | 6 ++--
drivers/net/ixgbe/ixgbe_rxtx.c | 4 +--
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 6 ++--
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 6 ++--
drivers/net/liquidio/lio_rxtx.c | 4 +--
drivers/net/liquidio/lio_rxtx.h | 4 +--
drivers/net/mlx4/mlx4.c | 2 +-
drivers/net/mlx5/mlx5_mr.c | 2 +-
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/qede/base/bcm_osal.h | 2 +-
drivers/net/sfc/efsys.h | 2 +-
drivers/net/sfc/sfc.c | 2 +-
drivers/net/sfc/sfc_ef10_rx.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 4 +--
drivers/net/sfc/sfc_tso.c | 2 +-
drivers/net/thunderx/base/nicvf_hw.c | 2 +-
drivers/net/thunderx/base/nicvf_hw.h | 2 +-
drivers/net/thunderx/base/nicvf_hw_defs.h | 6 ++--
drivers/net/thunderx/nicvf_ethdev.c | 4 +--
drivers/net/thunderx/nicvf_ethdev.h | 4 +--
drivers/net/thunderx/nicvf_struct.h | 6 ++--
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtio_rxtx.h | 4 +--
drivers/net/virtio/virtqueue.h | 4 +--
drivers/net/xenvirt/rte_eth_xenvirt.c | 2 +-
drivers/net/xenvirt/rte_mempool_gntalloc.c | 6 ++--
drivers/net/xenvirt/rte_xen_lib.c | 6 ++--
drivers/net/xenvirt/rte_xen_lib.h | 8 ++---
examples/l2fwd-crypto/main.c | 4 +--
lib/librte_cryptodev/rte_crypto.h | 2 +-
lib/librte_cryptodev/rte_crypto_sym.h | 6 ++--
lib/librte_cryptodev/rte_cryptodev.c | 2 +-
lib/librte_cryptodev/rte_cryptodev.h | 2 +-
lib/librte_eal/bsdapp/eal/eal.c | 2 +-
lib/librte_eal/bsdapp/eal/eal_memory.c | 6 ++--
lib/librte_eal/bsdapp/eal/rte_eal_version.map | 12 +++----
lib/librte_eal/common/eal_common_memory.c | 8 ++---
lib/librte_eal/common/eal_common_memzone.c | 4 +--
lib/librte_eal/common/eal_private.h | 2 +-
lib/librte_eal/common/include/rte_malloc.h | 4 +--
lib/librte_eal/common/include/rte_memory.h | 24 ++++++-------
lib/librte_eal/common/include/rte_memzone.h | 2 +-
lib/librte_eal/common/rte_malloc.c | 8 ++---
lib/librte_eal/linuxapp/eal/eal.c | 2 +-
lib/librte_eal/linuxapp/eal/eal_memory.c | 24 ++++++-------
lib/librte_eal/linuxapp/eal/eal_pci.c | 4 +--
lib/librte_eal/linuxapp/eal/eal_vfio.c | 10 +++---
lib/librte_eal/linuxapp/eal/eal_xen_memory.c | 4 +--
.../linuxapp/eal/include/exec-env/rte_kni_common.h | 21 +++++------
lib/librte_eal/linuxapp/eal/rte_eal_version.map | 12 +++----
lib/librte_eal/linuxapp/kni/kni_net.c | 6 ++--
lib/librte_kni/rte_kni.c | 2 +-
lib/librte_mbuf/rte_mbuf.c | 6 ++--
lib/librte_mbuf/rte_mbuf.h | 18 +++++-----
lib/librte_mempool/rte_mempool.c | 42 +++++++++++-----------
lib/librte_mempool/rte_mempool.h | 18 +++++-----
lib/librte_mempool/rte_mempool_version.map | 4 +--
lib/librte_vhost/vhost.h | 2 +-
lib/librte_vhost/vhost_user.c | 4 +--
lib/librte_vhost/virtio_net.c | 2 +-
test/test/commands.c | 2 +-
test/test/test_cryptodev.h | 2 +-
test/test/test_malloc.c | 4 +--
test/test/test_mbuf.c | 2 +-
test/test/test_memory.c | 6 ++--
test/test/test_mempool.c | 4 +--
test/test/test_memzone.c | 18 +++++-----
123 files changed, 402 insertions(+), 381 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v1 1/4] eal: rename phys_addr_t to iova_addr_t
2017-08-14 15:15 [dpdk-dev] [PATCH v1 0/4] make dpdk iova aware Santosh Shukla
@ 2017-08-14 15:15 ` Santosh Shukla
2017-09-18 14:06 ` Burakov, Anatoly
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 2/4] eal/memory: rename buf_physaddr to buf_iovaaddr Santosh Shukla
` (4 subsequent siblings)
5 siblings, 1 reply; 91+ messages in thread
From: Santosh Shukla @ 2017-08-14 15:15 UTC (permalink / raw)
To: dev; +Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal, Santosh Shukla
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
v1 note:
- As changes percolate to all possible dpdk subsystem..
so its difficult to tag subject with one common title,
but since, core of changeset is at eal layer so keeping 'eal:'
as title.
app/test-crypto-perf/cperf_test_vectors.h | 4 +--
doc/guides/contributing/documentation.rst | 4 +--
doc/guides/prog_guide/cryptodev_lib.rst | 6 ++--
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 14 ++++----
drivers/crypto/qat/qat_adf/qat_algs.h | 6 ++--
drivers/crypto/qat/qat_crypto.h | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 +-
drivers/net/ark/ark_ddm.c | 2 +-
drivers/net/ark/ark_ddm.h | 4 +--
drivers/net/ark/ark_ethdev_rx.c | 12 +++----
drivers/net/ark/ark_ethdev_tx.c | 2 +-
drivers/net/ark/ark_mpu.c | 2 +-
drivers/net/ark/ark_mpu.h | 4 +--
drivers/net/ark/ark_udm.c | 2 +-
drivers/net/ark/ark_udm.h | 4 +--
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/avp/rte_avp_common.h | 20 +++++------
drivers/net/bnx2x/bnx2x.c | 40 +++++++++++-----------
drivers/net/bnx2x/bnx2x.h | 22 ++++++------
drivers/net/bnx2x/bnx2x_rxtx.c | 4 +--
drivers/net/bnx2x/bnx2x_stats.c | 2 +-
drivers/net/bnx2x/bnx2x_vfpf.c | 2 +-
drivers/net/bnx2x/ecore_sp.h | 2 +-
drivers/net/bnxt/bnxt.h | 10 +++---
drivers/net/bnxt/bnxt_cpr.h | 4 +--
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/bnxt_ring.c | 2 +-
drivers/net/bnxt/bnxt_ring.h | 2 +-
drivers/net/bnxt/bnxt_rxr.h | 4 +--
drivers/net/bnxt/bnxt_txr.h | 2 +-
drivers/net/bnxt/bnxt_vnic.c | 2 +-
drivers/net/bnxt/bnxt_vnic.h | 6 ++--
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/liquidio/lio_rxtx.h | 4 +--
drivers/net/qede/base/bcm_osal.h | 2 +-
drivers/net/sfc/efsys.h | 2 +-
drivers/net/sfc/sfc_ef10_rx.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 4 +--
drivers/net/thunderx/base/nicvf_hw.c | 2 +-
drivers/net/thunderx/base/nicvf_hw.h | 2 +-
drivers/net/thunderx/base/nicvf_hw_defs.h | 6 ++--
drivers/net/thunderx/nicvf_ethdev.c | 4 +--
drivers/net/thunderx/nicvf_ethdev.h | 4 +--
drivers/net/thunderx/nicvf_struct.h | 6 ++--
drivers/net/virtio/virtio_rxtx.h | 4 +--
drivers/net/virtio/virtqueue.h | 2 +-
drivers/net/xenvirt/rte_eth_xenvirt.c | 2 +-
drivers/net/xenvirt/rte_mempool_gntalloc.c | 6 ++--
drivers/net/xenvirt/rte_xen_lib.c | 6 ++--
drivers/net/xenvirt/rte_xen_lib.h | 8 ++---
examples/l2fwd-crypto/main.c | 2 +-
lib/librte_cryptodev/rte_crypto.h | 2 +-
lib/librte_cryptodev/rte_crypto_sym.h | 6 ++--
lib/librte_cryptodev/rte_cryptodev.h | 2 +-
lib/librte_eal/bsdapp/eal/eal_memory.c | 4 +--
lib/librte_eal/common/include/rte_malloc.h | 2 +-
lib/librte_eal/common/include/rte_memory.h | 18 +++++-----
lib/librte_eal/common/include/rte_memzone.h | 2 +-
lib/librte_eal/common/rte_malloc.c | 2 +-
lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++---
lib/librte_eal/linuxapp/eal/eal_xen_memory.c | 4 +--
.../linuxapp/eal/include/exec-env/rte_kni_common.h | 19 +++++-----
lib/librte_mbuf/rte_mbuf.h | 8 ++---
lib/librte_mempool/rte_mempool.c | 18 +++++-----
lib/librte_mempool/rte_mempool.h | 14 ++++----
lib/librte_vhost/vhost.h | 2 +-
test/test/test_cryptodev.h | 2 +-
test/test/test_memzone.c | 8 ++---
68 files changed, 195 insertions(+), 194 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_vectors.h b/app/test-crypto-perf/cperf_test_vectors.h
index 85955703c..a203272cf 100644
--- a/app/test-crypto-perf/cperf_test_vectors.h
+++ b/app/test-crypto-perf/cperf_test_vectors.h
@@ -78,13 +78,13 @@ struct cperf_test_vector {
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
uint16_t length;
} aad;
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
uint16_t length;
} digest;
diff --git a/doc/guides/contributing/documentation.rst b/doc/guides/contributing/documentation.rst
index cddbd7bb8..719007b9f 100644
--- a/doc/guides/contributing/documentation.rst
+++ b/doc/guides/contributing/documentation.rst
@@ -712,7 +712,7 @@ The following are some guidelines for use of Doxygen in the DPDK API documentati
/**< Virtual address of the first mempool object. */
uintptr_t elt_va_end;
/**< Virtual address of the <size + 1> mempool object. */
- phys_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
+ iova_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
/**< Array of physical page addresses for the mempool buffer. */
This doesn't have an effect on the rendered documentation but it is confusing for the developer reading the code.
@@ -731,7 +731,7 @@ The following are some guidelines for use of Doxygen in the DPDK API documentati
/** Virtual address of the <size + 1> mempool object. */
uintptr_t elt_va_end;
/** Array of physical page addresses for the mempool buffer. */
- phys_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
+ iova_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
* Check for Doxygen warnings in new code by checking the API documentation build::
diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 75ae085f6..248038f64 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -539,12 +539,12 @@ chain.
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
} digest; /**< Digest parameters */
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
} aad;
/**< Additional authentication parameters */
} aead;
@@ -566,7 +566,7 @@ chain.
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
} digest; /**< Digest parameters */
} auth;
};
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 5d7a82823..184c7069d 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -271,9 +271,9 @@ enum qbman_fd_format {
#define DPAA2_EQ_RESP_ALWAYS 1
#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA
-static void *dpaa2_mem_ptov(phys_addr_t paddr) __attribute__((unused));
+static void *dpaa2_mem_ptov(iova_addr_t paddr) __attribute__((unused));
/* todo - this is costly, need to write a fast coversion routine */
-static void *dpaa2_mem_ptov(phys_addr_t paddr)
+static void *dpaa2_mem_ptov(iova_addr_t paddr)
{
const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
int i;
@@ -287,8 +287,8 @@ static void *dpaa2_mem_ptov(phys_addr_t paddr)
return NULL;
}
-static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr) __attribute__((unused));
-static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
+static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr) __attribute__((unused));
+static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr)
{
const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
int i;
@@ -299,7 +299,7 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
return memseg[i].phys_addr
+ (vaddr - memseg[i].addr_64);
}
- return (phys_addr_t)(NULL);
+ return (iova_addr_t)(NULL);
}
/**
@@ -320,13 +320,13 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
/**
* macro to convert IOVA to Virtual address
*/
-#define DPAA2_IOVA_TO_VADDR(_iova) dpaa2_mem_ptov((phys_addr_t)(_iova))
+#define DPAA2_IOVA_TO_VADDR(_iova) dpaa2_mem_ptov((iova_addr_t)(_iova))
/**
* macro to convert modify the memory containing IOVA to Virtual address
*/
#define DPAA2_MODIFY_IOVA_TO_VADDR(_mem, _type) \
- {_mem = (_type)(dpaa2_mem_ptov((phys_addr_t)(_mem))); }
+ {_mem = (_type)(dpaa2_mem_ptov((iova_addr_t)(_mem))); }
#else /* RTE_LIBRTE_DPAA2_USE_PHYS_IOVA */
diff --git a/drivers/crypto/qat/qat_adf/qat_algs.h b/drivers/crypto/qat/qat_adf/qat_algs.h
index 2c8e03c0a..c53ebd7ed 100644
--- a/drivers/crypto/qat/qat_adf/qat_algs.h
+++ b/drivers/crypto/qat/qat_adf/qat_algs.h
@@ -104,8 +104,8 @@ struct qat_alg_buf_list {
struct qat_crypto_op_cookie {
struct qat_alg_buf_list qat_sgl_list_src;
struct qat_alg_buf_list qat_sgl_list_dst;
- phys_addr_t qat_sgl_src_phys_addr;
- phys_addr_t qat_sgl_dst_phys_addr;
+ iova_addr_t qat_sgl_src_phys_addr;
+ iova_addr_t qat_sgl_dst_phys_addr;
};
/* Common content descriptor */
@@ -124,7 +124,7 @@ struct qat_session {
void *bpi_ctx;
struct qat_alg_cd cd;
uint8_t *cd_cur_ptr;
- phys_addr_t cd_paddr;
+ iova_addr_t cd_paddr;
struct icp_qat_fw_la_bulk_req fw_req;
uint8_t aad_len;
struct qat_crypto_instance *inst;
diff --git a/drivers/crypto/qat/qat_crypto.h b/drivers/crypto/qat/qat_crypto.h
index 3f35a00e7..037805633 100644
--- a/drivers/crypto/qat/qat_crypto.h
+++ b/drivers/crypto/qat/qat_crypto.h
@@ -63,7 +63,7 @@ enum qat_device_gen {
struct qat_queue {
char memz_name[RTE_MEMZONE_NAMESIZE];
void *base_addr; /* Base address */
- phys_addr_t base_phys_addr; /* Queue physical address */
+ iova_addr_t base_phys_addr; /* Queue physical address */
uint32_t head; /* Shadow copy of the head */
uint32_t tail; /* Shadow copy of the tail */
uint32_t modulo;
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
index 56b71bede..835fe9ef7 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
@@ -39,7 +39,7 @@
struct buf_pool_cfg {
void *addr;
/**< The address from where DPAA2 will carve out the buffers */
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
/**< Physical address of the memory provided in addr */
uint32_t num;
/**< Number of buffers */
diff --git a/drivers/net/ark/ark_ddm.c b/drivers/net/ark/ark_ddm.c
index 221460c78..7c78ab75c 100644
--- a/drivers/net/ark/ark_ddm.c
+++ b/drivers/net/ark/ark_ddm.c
@@ -93,7 +93,7 @@ ark_ddm_reset(struct ark_ddm_t *ddm)
}
void
-ark_ddm_setup(struct ark_ddm_t *ddm, phys_addr_t cons_addr, uint32_t interval)
+ark_ddm_setup(struct ark_ddm_t *ddm, iova_addr_t cons_addr, uint32_t interval)
{
ddm->setup.cons_write_index_addr = cons_addr;
ddm->setup.write_index_interval = interval / 4; /* 4 ns period */
diff --git a/drivers/net/ark/ark_ddm.h b/drivers/net/ark/ark_ddm.h
index de61926c3..3381cb9e2 100644
--- a/drivers/net/ark/ark_ddm.h
+++ b/drivers/net/ark/ark_ddm.h
@@ -127,7 +127,7 @@ struct ark_ddm_cpld_ps_t {
#define ARK_DDM_SETUP 0x00e0
struct ark_ddm_setup_t {
- phys_addr_t cons_write_index_addr;
+ iova_addr_t cons_write_index_addr;
uint32_t write_index_interval; /* 4ns each */
volatile uint32_t cons_index;
};
@@ -165,7 +165,7 @@ void ark_ddm_start(struct ark_ddm_t *ddm);
int ark_ddm_stop(struct ark_ddm_t *ddm, const int wait);
void ark_ddm_reset(struct ark_ddm_t *ddm);
void ark_ddm_stats_reset(struct ark_ddm_t *ddm);
-void ark_ddm_setup(struct ark_ddm_t *ddm, phys_addr_t cons_addr,
+void ark_ddm_setup(struct ark_ddm_t *ddm, iova_addr_t cons_addr,
uint32_t interval);
void ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg);
void ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg);
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index f39e6f68a..1cbda01a7 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -62,7 +62,7 @@ struct ark_rx_queue {
struct rte_mbuf **reserve_q;
/* array of physical addresses of the mbuf data pointer */
/* This point is a virtual address */
- phys_addr_t *paddress_q;
+ iova_addr_t *paddress_q;
struct rte_mempool *mb_pool;
struct ark_udm_t *udm;
@@ -96,9 +96,9 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
struct ark_rx_queue *queue,
uint16_t rx_queue_id __rte_unused, uint16_t rx_queue_idx)
{
- phys_addr_t queue_base;
- phys_addr_t phys_addr_q_base;
- phys_addr_t phys_addr_prod_index;
+ iova_addr_t queue_base;
+ iova_addr_t phys_addr_q_base;
+ iova_addr_t phys_addr_prod_index;
queue_base = rte_malloc_virt2phy(queue);
phys_addr_prod_index = queue_base +
@@ -107,7 +107,7 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
phys_addr_q_base = rte_malloc_virt2phy(queue->paddress_q);
/* Verify HW */
- if (ark_mpu_verify(queue->mpu, sizeof(phys_addr_t))) {
+ if (ark_mpu_verify(queue->mpu, sizeof(iova_addr_t))) {
PMD_DRV_LOG(ERR, "Illegal configuration rx queue\n");
return -1;
}
@@ -205,7 +205,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
socket_id);
queue->paddress_q =
rte_zmalloc_socket("Ark_rx_queue paddr",
- nb_desc * sizeof(phys_addr_t),
+ nb_desc * sizeof(iova_addr_t),
64,
socket_id);
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 9ae7ae0e6..578cb09b8 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -311,7 +311,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
static int
eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
{
- phys_addr_t queue_base, ring_base, cons_index_addr;
+ iova_addr_t queue_base, ring_base, cons_index_addr;
uint32_t write_interval_ns;
/* Verify HW -- MPU */
diff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c
index cd2c0788f..23575c8e3 100644
--- a/drivers/net/ark/ark_mpu.c
+++ b/drivers/net/ark/ark_mpu.c
@@ -118,7 +118,7 @@ ark_mpu_reset_stats(struct ark_mpu_t *mpu)
}
int
-ark_mpu_configure(struct ark_mpu_t *mpu, phys_addr_t ring, uint32_t ring_size,
+ark_mpu_configure(struct ark_mpu_t *mpu, iova_addr_t ring, uint32_t ring_size,
int is_tx)
{
ark_mpu_reset(mpu);
diff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h
index a0171dbd6..a42e242b7 100644
--- a/drivers/net/ark/ark_mpu.h
+++ b/drivers/net/ark/ark_mpu.h
@@ -75,7 +75,7 @@ struct ark_mpu_hw_t {
#define ARK_MPU_CFG 0x040
struct ark_mpu_cfg_t {
- phys_addr_t ring_base; /* phys_addr_t is a uint64_t */
+ iova_addr_t ring_base; /* iova_addr_t is a uint64_t */
uint32_t ring_size;
uint32_t ring_mask;
uint32_t min_host_move;
@@ -137,7 +137,7 @@ int ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size);
void ark_mpu_stop(struct ark_mpu_t *mpu);
void ark_mpu_start(struct ark_mpu_t *mpu);
int ark_mpu_reset(struct ark_mpu_t *mpu);
-int ark_mpu_configure(struct ark_mpu_t *mpu, phys_addr_t ring,
+int ark_mpu_configure(struct ark_mpu_t *mpu, iova_addr_t ring,
uint32_t ring_size, int is_tx);
void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx);
diff --git a/drivers/net/ark/ark_udm.c b/drivers/net/ark/ark_udm.c
index 1ba7d26d4..1c04d92d9 100644
--- a/drivers/net/ark/ark_udm.c
+++ b/drivers/net/ark/ark_udm.c
@@ -122,7 +122,7 @@ ark_udm_configure(struct ark_udm_t *udm,
}
void
-ark_udm_write_addr(struct ark_udm_t *udm, phys_addr_t addr)
+ark_udm_write_addr(struct ark_udm_t *udm, iova_addr_t addr)
{
udm->rt_cfg.hw_prod_addr = addr;
}
diff --git a/drivers/net/ark/ark_udm.h b/drivers/net/ark/ark_udm.h
index 29bf1e8f7..1be45e2d9 100644
--- a/drivers/net/ark/ark_udm.h
+++ b/drivers/net/ark/ark_udm.h
@@ -137,7 +137,7 @@ struct ark_udm_tlp_ps_t {
#define ARK_UDM_RT_CFG 0x00e0
struct ark_udm_rt_cfg_t {
- phys_addr_t hw_prod_addr;
+ iova_addr_t hw_prod_addr;
uint32_t write_interval; /* 4ns cycles */
volatile uint32_t prod_idx; /* RO */
};
@@ -171,7 +171,7 @@ void ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
uint32_t dataroom,
uint32_t write_interval_ns);
-void ark_udm_write_addr(struct ark_udm_t *udm, phys_addr_t addr);
+void ark_udm_write_addr(struct ark_udm_t *udm, iova_addr_t addr);
void ark_udm_stats_reset(struct ark_udm_t *udm);
void ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg,
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index c746a0e2c..76f5acae4 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -387,7 +387,7 @@ avp_dev_translate_buffer(struct avp_dev *avp, void *host_mbuf_address)
/* translate from host physical address to guest virtual address */
static void *
avp_dev_translate_address(struct rte_eth_dev *eth_dev,
- phys_addr_t host_phys_addr)
+ iova_addr_t host_phys_addr)
{
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
struct rte_mem_resource *resource;
diff --git a/drivers/net/avp/rte_avp_common.h b/drivers/net/avp/rte_avp_common.h
index 488d72168..791d2f1b6 100644
--- a/drivers/net/avp/rte_avp_common.h
+++ b/drivers/net/avp/rte_avp_common.h
@@ -243,7 +243,7 @@ struct rte_avp_desc {
*/
struct rte_avp_memmap {
void *addr;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
uint64_t length;
};
@@ -345,7 +345,7 @@ RTE_AVP_MAKE_VERSION(RTE_AVP_RELEASE_VERSION_1, \
*/
struct rte_avp_mempool_info {
void *addr;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
uint64_t length;
};
@@ -359,10 +359,10 @@ struct rte_avp_device_info {
char ifname[RTE_AVP_NAMESIZE]; /**< Network device name for AVP */
- phys_addr_t tx_phys;
- phys_addr_t rx_phys;
- phys_addr_t alloc_phys;
- phys_addr_t free_phys;
+ iova_addr_t tx_phys;
+ iova_addr_t rx_phys;
+ iova_addr_t alloc_phys;
+ iova_addr_t free_phys;
uint32_t features; /**< Supported feature bitmap */
uint8_t min_rx_queues; /**< Minimum supported receive/free queues */
@@ -379,14 +379,14 @@ struct rte_avp_device_info {
uint32_t free_size; /**< Size of each free queue */
/* Used by Ethtool */
- phys_addr_t req_phys;
- phys_addr_t resp_phys;
- phys_addr_t sync_phys;
+ iova_addr_t req_phys;
+ iova_addr_t resp_phys;
+ iova_addr_t sync_phys;
void *sync_va;
/* mbuf mempool (used when a single memory area is supported) */
void *mbuf_va;
- phys_addr_t mbuf_phys;
+ iova_addr_t mbuf_phys;
/* mbuf mempools */
struct rte_avp_mempool_info pool[RTE_AVP_MAX_MEMPOOLS];
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 06733d153..70ccbf642 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -419,7 +419,7 @@ void bnx2x_read_dmae(struct bnx2x_softc *sc, uint32_t src_addr, uint32_t len32)
}
void
-bnx2x_write_dmae(struct bnx2x_softc *sc, phys_addr_t dma_addr, uint32_t dst_addr,
+bnx2x_write_dmae(struct bnx2x_softc *sc, iova_addr_t dma_addr, uint32_t dst_addr,
uint32_t len32)
{
struct dmae_command dmae;
@@ -447,7 +447,7 @@ bnx2x_write_dmae(struct bnx2x_softc *sc, phys_addr_t dma_addr, uint32_t dst_addr
}
static void
-bnx2x_write_dmae_phys_len(struct bnx2x_softc *sc, phys_addr_t phys_addr,
+bnx2x_write_dmae_phys_len(struct bnx2x_softc *sc, iova_addr_t phys_addr,
uint32_t addr, uint32_t len)
{
uint32_t dmae_wr_max = DMAE_LEN32_WR_MAX(sc);
@@ -823,14 +823,14 @@ bnx2x_fw_command(struct bnx2x_softc *sc, uint32_t command, uint32_t param)
static void
__storm_memset_dma_mapping(struct bnx2x_softc *sc, uint32_t addr,
- phys_addr_t mapping)
+ iova_addr_t mapping)
{
REG_WR(sc, addr, U64_LO(mapping));
REG_WR(sc, (addr + 4), U64_HI(mapping));
}
static void
-storm_memset_spq_addr(struct bnx2x_softc *sc, phys_addr_t mapping,
+storm_memset_spq_addr(struct bnx2x_softc *sc, iova_addr_t mapping,
uint16_t abs_fid)
{
uint32_t addr = (XSEM_REG_FAST_MEMORY +
@@ -1498,7 +1498,7 @@ bnx2x_set_q_rx_mode(struct bnx2x_softc *sc, uint8_t cl_id,
ramrod_param.rdata = BNX2X_SP(sc, rx_mode_rdata);
ramrod_param.rdata_mapping =
- (phys_addr_t)BNX2X_SP_MAPPING(sc, rx_mode_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, rx_mode_rdata),
bnx2x_set_bit(ECORE_FILTER_RX_MODE_PENDING, &sc->sp_state);
ramrod_param.ramrod_flags = ramrod_flags;
@@ -4599,9 +4599,9 @@ static void bnx2x_init_func_obj(struct bnx2x_softc *sc)
ecore_init_func_obj(sc,
&sc->func_obj,
BNX2X_SP(sc, func_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, func_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, func_rdata),
BNX2X_SP(sc, func_afex_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, func_afex_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, func_afex_rdata),
&bnx2x_func_sp_drv);
}
@@ -4772,7 +4772,7 @@ static void bnx2x_map_sb_state_machines(struct hc_index_data *index_data)
}
static void
-bnx2x_init_sb(struct bnx2x_softc *sc, phys_addr_t busaddr, int vfid,
+bnx2x_init_sb(struct bnx2x_softc *sc, iova_addr_t busaddr, int vfid,
uint8_t vf_valid, int fw_sb_id, int igu_sb_id)
{
struct hc_status_block_data_e2 sb_data_e2;
@@ -4918,7 +4918,7 @@ static void bnx2x_init_eth_fp(struct bnx2x_softc *sc, int idx)
sc->max_cos,
SC_FUNC(sc),
BNX2X_SP(sc, q_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, q_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, q_rdata),
q_type);
/* configure classification DBs */
@@ -4928,7 +4928,7 @@ static void bnx2x_init_eth_fp(struct bnx2x_softc *sc, int idx)
idx,
SC_FUNC(sc),
BNX2X_SP(sc, mac_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, mac_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, mac_rdata),
ECORE_FILTER_MAC_PENDING, &sc->sp_state,
ECORE_OBJ_TYPE_RX_TX, &sc->macs_pool);
}
@@ -5028,7 +5028,7 @@ static void bnx2x_init_tx_rings(struct bnx2x_softc *sc)
static void bnx2x_init_def_sb(struct bnx2x_softc *sc)
{
struct host_sp_status_block *def_sb = sc->def_sb;
- phys_addr_t mapping = sc->def_sb_dma.paddr;
+ iova_addr_t mapping = sc->def_sb_dma.paddr;
int igu_sp_sb_index;
int igu_seg_id;
int port = SC_PORT(sc);
@@ -5700,7 +5700,7 @@ static void bnx2x_init_objs(struct bnx2x_softc *sc)
SC_FUNC(sc),
SC_FUNC(sc),
BNX2X_SP(sc, mcast_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, mcast_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, mcast_rdata),
ECORE_FILTER_MCAST_PENDING,
&sc->sp_state, o_type);
@@ -5724,7 +5724,7 @@ static void bnx2x_init_objs(struct bnx2x_softc *sc)
SC_FUNC(sc),
SC_FUNC(sc),
BNX2X_SP(sc, rss_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, rss_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, rss_rdata),
ECORE_FILTER_RSS_CONF_PENDING,
&sc->sp_state, ECORE_OBJ_TYPE_RX);
}
@@ -6445,9 +6445,9 @@ bnx2x_pf_rx_q_prep(struct bnx2x_softc *sc, struct bnx2x_fastpath *fp,
pause->pri_map = 1;
/* rxq setup */
- rxq_init->dscr_map = (phys_addr_t)rxq->rx_ring_phys_addr;
- rxq_init->rcq_map = (phys_addr_t)rxq->cq_ring_phys_addr;
- rxq_init->rcq_np_map = (phys_addr_t)(rxq->cq_ring_phys_addr +
+ rxq_init->dscr_map = (iova_addr_t)rxq->rx_ring_phys_addr;
+ rxq_init->rcq_map = (iova_addr_t)rxq->cq_ring_phys_addr;
+ rxq_init->rcq_np_map = (iova_addr_t)(rxq->cq_ring_phys_addr +
BNX2X_PAGE_SIZE);
/*
@@ -6486,7 +6486,7 @@ bnx2x_pf_tx_q_prep(struct bnx2x_softc *sc, struct bnx2x_fastpath *fp,
PMD_TX_LOG(ERR, "ERROR: TX queue is NULL");
return;
}
- txq_init->dscr_map = (phys_addr_t)txq->tx_ring_phys_addr;
+ txq_init->dscr_map = (iova_addr_t)txq->tx_ring_phys_addr;
txq_init->sb_cq_index = HC_INDEX_ETH_FIRST_TX_CQ_CONS + cos;
txq_init->traffic_type = LLFC_TRAFFIC_TYPE_NW;
txq_init->fw_sb_id = fp->fw_sb_id;
@@ -11059,7 +11059,7 @@ static int bnx2x_init_hw_func(struct bnx2x_softc *sc)
for (i = 0; i < L2_ILT_LINES(sc); i++) {
ilt->lines[cdu_ilt_start + i].page = sc->context[i].vcxt;
ilt->lines[cdu_ilt_start + i].page_mapping =
- (phys_addr_t)sc->context[i].vcxt_dma.paddr;
+ (iova_addr_t)sc->context[i].vcxt_dma.paddr;
ilt->lines[cdu_ilt_start + i].size = sc->context[i].size;
}
ecore_ilt_init_op(sc, INITOP_SET);
@@ -11357,7 +11357,7 @@ static void bnx2x_reset_port(struct bnx2x_softc *sc)
}
}
-static void bnx2x_ilt_wr(struct bnx2x_softc *sc, uint32_t index, phys_addr_t addr)
+static void bnx2x_ilt_wr(struct bnx2x_softc *sc, uint32_t index, iova_addr_t addr)
{
int reg;
uint32_t wb_write[2];
@@ -11587,7 +11587,7 @@ static int ecore_gunzip(struct bnx2x_softc *sc, const uint8_t * zbuf, int len)
}
static void
-ecore_write_dmae_phys_len(struct bnx2x_softc *sc, phys_addr_t phys_addr,
+ecore_write_dmae_phys_len(struct bnx2x_softc *sc, iova_addr_t phys_addr,
uint32_t addr, uint32_t len)
{
bnx2x_write_dmae_phys_len(sc, phys_addr, addr, len);
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 91c5aec21..b81327a66 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -317,7 +317,7 @@ struct bnx2x_bar {
/* Used to manage DMA allocations. */
struct bnx2x_dma {
struct bnx2x_softc *sc;
- phys_addr_t paddr;
+ iova_addr_t paddr;
void *vaddr;
int nseg;
char msg[RTE_MEMZONE_NAMESIZE - 6];
@@ -370,10 +370,10 @@ struct bnx2x_fastpath {
struct bnx2x_dma sb_dma;
union bnx2x_host_hc_status_block status_block;
- phys_addr_t tx_desc_mapping;
+ iova_addr_t tx_desc_mapping;
- phys_addr_t rx_desc_mapping;
- phys_addr_t rx_comp_mapping;
+ iova_addr_t rx_desc_mapping;
+ iova_addr_t rx_comp_mapping;
uint16_t *sb_index_values;
uint16_t *sb_running_index;
@@ -468,7 +468,7 @@ union cdu_context {
struct hw_context {
struct bnx2x_dma vcxt_dma;
union cdu_context *vcxt;
- //phys_addr_t cxt_mapping;
+ //iova_addr_t cxt_mapping;
size_t size;
};
@@ -1242,7 +1242,7 @@ struct bnx2x_softc {
uint32_t gz_outlen;
#define GUNZIP_BUF(sc) (sc->gz_buf)
#define GUNZIP_OUTLEN(sc) (sc->gz_outlen)
-#define GUNZIP_PHYS(sc) (phys_addr_t)(sc->gz_buf_dma.paddr)
+#define GUNZIP_PHYS(sc) (iova_addr_t)(sc->gz_buf_dma.paddr)
#define FW_BUF_SIZE 0x40000
struct raw_op *init_ops;
@@ -1310,14 +1310,14 @@ struct bnx2x_softc {
*/
int fw_stats_req_size;
struct bnx2x_fw_stats_req *fw_stats_req;
- phys_addr_t fw_stats_req_mapping;
+ iova_addr_t fw_stats_req_mapping;
/*
* FW statistics data shortcut (points at the beginning of fw_stats
* buffer + fw_stats_req_size).
*/
int fw_stats_data_size;
struct bnx2x_fw_stats_data *fw_stats_data;
- phys_addr_t fw_stats_data_mapping;
+ iova_addr_t fw_stats_data_mapping;
/* tracking a pending STAT_QUERY ramrod */
uint16_t stats_pending;
@@ -1402,8 +1402,8 @@ union bnx2x_stats_show_data {
#define FUNC_FLG_LEADING 0x0020 /* PF only */
struct bnx2x_func_init_params {
- phys_addr_t fw_stat_map; /* (dma) valid if FUNC_FLG_STATS */
- phys_addr_t spq_map; /* (dma) valid if FUNC_FLG_SPQ */
+ iova_addr_t fw_stat_map; /* (dma) valid if FUNC_FLG_STATS */
+ iova_addr_t spq_map; /* (dma) valid if FUNC_FLG_SPQ */
uint16_t func_flgs;
uint16_t func_id; /* abs function id */
uint16_t pf_id;
@@ -1748,7 +1748,7 @@ uint32_t bnx2x_dmae_opcode(struct bnx2x_softc *sc, uint8_t src_type,
uint8_t comp_type);
void bnx2x_post_dmae(struct bnx2x_softc *sc, struct dmae_command *dmae, int idx);
void bnx2x_read_dmae(struct bnx2x_softc *sc, uint32_t src_addr, uint32_t len32);
-void bnx2x_write_dmae(struct bnx2x_softc *sc, phys_addr_t dma_addr,
+void bnx2x_write_dmae(struct bnx2x_softc *sc, iova_addr_t dma_addr,
uint32_t dst_addr, uint32_t len32);
void bnx2x_set_ctx_validation(struct bnx2x_softc *sc, struct eth_context *cxt,
uint32_t cid);
diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c
index 5dd4aee7f..7336124fc 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.c
+++ b/drivers/net/bnx2x/bnx2x_rxtx.c
@@ -71,8 +71,8 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
struct bnx2x_softc *sc = dev->data->dev_private;
struct bnx2x_fastpath *fp = &sc->fp[queue_idx];
struct eth_rx_cqe_next_page *nextpg;
- phys_addr_t *rx_bd;
- phys_addr_t busaddr;
+ iova_addr_t *rx_bd;
+ iova_addr_t busaddr;
/* First allocate the rx queue data structure */
rxq = rte_zmalloc_socket("ethdev RX queue", sizeof(struct bnx2x_rx_queue),
diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c
index 6223cfef1..03625810e 100644
--- a/drivers/net/bnx2x/bnx2x_stats.c
+++ b/drivers/net/bnx2x/bnx2x_stats.c
@@ -1338,7 +1338,7 @@ bnx2x_prep_fw_stats_req(struct bnx2x_softc *sc)
int i;
int first_queue_query_index;
struct stats_query_header *stats_hdr = &sc->fw_stats_req->hdr;
- phys_addr_t cur_data_offset;
+ iova_addr_t cur_data_offset;
struct stats_query_entry *cur_query_entry;
stats_hdr->cmd_num = sc->fw_stats_num;
diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c
index 0ca0df876..855dafaa6 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/bnx2x/bnx2x_vfpf.c
@@ -113,7 +113,7 @@ bnx2x_vf_finalize(struct bnx2x_softc *sc,
#define BNX2X_VF_CHANNEL_TRIES 100
static int
-bnx2x_do_req4pf(struct bnx2x_softc *sc, phys_addr_t phys_addr)
+bnx2x_do_req4pf(struct bnx2x_softc *sc, iova_addr_t phys_addr)
{
uint8_t *status = &sc->vf2pf_mbox->resp.common_reply.status;
uint8_t i;
diff --git a/drivers/net/bnx2x/ecore_sp.h b/drivers/net/bnx2x/ecore_sp.h
index e7ec96e94..cd7c5e41e 100644
--- a/drivers/net/bnx2x/ecore_sp.h
+++ b/drivers/net/bnx2x/ecore_sp.h
@@ -36,7 +36,7 @@
#include "ecore_reg.h"
struct bnx2x_softc;
-typedef phys_addr_t ecore_dma_addr_t; /* expected to be 64 bit wide */
+typedef iova_addr_t ecore_dma_addr_t; /* expected to be 64 bit wide */
typedef volatile int ecore_atomic_t;
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 405d94deb..0c42d99ed 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -132,7 +132,7 @@ struct bnxt_pf_info {
uint16_t max_vfs;
uint32_t func_cfg_flags;
void *vf_req_buf;
- phys_addr_t vf_req_buf_dma_addr;
+ iova_addr_t vf_req_buf_dma_addr;
uint32_t vf_req_fwd[8];
uint16_t total_vnics;
struct bnxt_child_vf_info *vf_info;
@@ -194,14 +194,14 @@ struct bnxt {
struct bnxt_rx_queue **rx_queues;
const void *rx_mem_zone;
struct rx_port_stats *hw_rx_port_stats;
- phys_addr_t hw_rx_port_stats_map;
+ iova_addr_t hw_rx_port_stats_map;
unsigned int tx_nr_rings;
unsigned int tx_cp_nr_rings;
struct bnxt_tx_queue **tx_queues;
const void *tx_mem_zone;
struct tx_port_stats *hw_tx_port_stats;
- phys_addr_t hw_tx_port_stats_map;
+ iova_addr_t hw_tx_port_stats_map;
/* Default completion ring */
struct bnxt_cp_ring_info *def_cp_ring;
@@ -227,9 +227,9 @@ struct bnxt {
uint16_t hwrm_cmd_seq;
void *hwrm_cmd_resp_addr;
- phys_addr_t hwrm_cmd_resp_dma_addr;
+ iova_addr_t hwrm_cmd_resp_dma_addr;
void *hwrm_short_cmd_req_addr;
- phys_addr_t hwrm_short_cmd_req_dma_addr;
+ iova_addr_t hwrm_short_cmd_req_dma_addr;
rte_spinlock_t hwrm_lock;
uint16_t max_req_len;
uint16_t max_resp_len;
diff --git a/drivers/net/bnxt/bnxt_cpr.h b/drivers/net/bnxt/bnxt_cpr.h
index a6e87858a..1f95c85f2 100644
--- a/drivers/net/bnxt/bnxt_cpr.h
+++ b/drivers/net/bnxt/bnxt_cpr.h
@@ -82,10 +82,10 @@ struct bnxt_cp_ring_info {
struct cmpl_base *cp_desc_ring;
- phys_addr_t cp_desc_mapping;
+ iova_addr_t cp_desc_mapping;
struct ctx_hw_stats *hw_stats;
- phys_addr_t hw_stats_map;
+ iova_addr_t hw_stats_map;
uint32_t hw_stats_ctx_id;
struct bnxt_ring *cp_ring_struct;
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index c9d11228b..cb2ce334b 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1628,7 +1628,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
const struct rte_memzone *mz = NULL;
static int version_printed;
uint32_t total_alloc_len;
- phys_addr_t mz_phys_addr;
+ iova_addr_t mz_phys_addr;
struct bnxt *bp;
int rc;
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 9d0ae277e..8e83e4704 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -98,7 +98,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
struct rte_pci_device *pdev = bp->pdev;
const struct rte_memzone *mz = NULL;
char mz_name[RTE_MEMZONE_NAMESIZE];
- phys_addr_t mz_phys_addr;
+ iova_addr_t mz_phys_addr;
int sz;
int stats_len = (tx_ring_info || rx_ring_info) ?
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index 6d1eb5888..09042cb80 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -70,7 +70,7 @@
struct bnxt_ring {
void *bd;
- phys_addr_t bd_dma;
+ iova_addr_t bd_dma;
uint32_t ring_size;
uint32_t ring_mask;
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index f8d6dc80a..7f97e7af7 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -85,8 +85,8 @@ struct bnxt_rx_ring_info {
struct bnxt_sw_rx_bd *rx_buf_ring; /* sw ring */
struct bnxt_sw_rx_bd *ag_buf_ring; /* sw ring */
- phys_addr_t rx_desc_mapping;
- phys_addr_t ag_desc_mapping;
+ iova_addr_t rx_desc_mapping;
+ iova_addr_t ag_desc_mapping;
struct bnxt_ring *rx_ring_struct;
struct bnxt_ring *ag_ring_struct;
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index 5b0971141..8d23b3386 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -49,7 +49,7 @@ struct bnxt_tx_ring_info {
struct tx_bd_long *tx_desc_ring;
struct bnxt_sw_tx_bd *tx_buf_ring;
- phys_addr_t tx_desc_mapping;
+ iova_addr_t tx_desc_mapping;
#define BNXT_DEV_STATE_CLOSING 0x1
uint32_t dev_state;
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index db9fb0796..90809f0f5 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -174,7 +174,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
BNXT_MAX_MC_ADDRS * ETHER_ADDR_LEN);
uint16_t max_vnics;
int i;
- phys_addr_t mz_phys_addr;
+ iova_addr_t mz_phys_addr;
max_vnics = bp->max_vnics;
snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
diff --git a/drivers/net/bnxt/bnxt_vnic.h b/drivers/net/bnxt/bnxt_vnic.h
index 993f22127..9d3dccea0 100644
--- a/drivers/net/bnxt/bnxt_vnic.h
+++ b/drivers/net/bnxt/bnxt_vnic.h
@@ -53,11 +53,11 @@ struct bnxt_vnic_info {
uint16_t dflt_ring_grp;
uint16_t mru;
uint16_t hash_type;
- phys_addr_t rss_table_dma_addr;
+ iova_addr_t rss_table_dma_addr;
uint16_t *rss_table;
- phys_addr_t rss_hash_key_dma_addr;
+ iova_addr_t rss_hash_key_dma_addr;
void *rss_hash_key;
- phys_addr_t mc_list_dma_addr;
+ iova_addr_t mc_list_dma_addr;
char *mc_list;
uint32_t mc_addr_cnt;
#define BNXT_MAX_MC_ADDRS 16
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 2bbb893c2..5156ac08d 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -1744,7 +1744,7 @@ lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
} else {
struct lio_buf_free_info *finfo;
struct lio_gather *g;
- phys_addr_t phyaddr;
+ iova_addr_t phyaddr;
int i, frags;
finfo = (struct lio_buf_free_info *)rte_malloc(NULL,
diff --git a/drivers/net/liquidio/lio_rxtx.h b/drivers/net/liquidio/lio_rxtx.h
index 85685dc7d..b0977f17b 100644
--- a/drivers/net/liquidio/lio_rxtx.h
+++ b/drivers/net/liquidio/lio_rxtx.h
@@ -686,7 +686,7 @@ lio_swap_8B_data(uint64_t *data, uint32_t blocks)
static inline uint64_t
lio_map_ring(void *buf)
{
- phys_addr_t dma_addr;
+ iova_addr_t dma_addr;
dma_addr = rte_mbuf_data_dma_addr_default(((struct rte_mbuf *)buf));
@@ -696,7 +696,7 @@ lio_map_ring(void *buf)
static inline uint64_t
lio_map_ring_info(struct lio_droq *droq, uint32_t i)
{
- phys_addr_t dma_addr;
+ iova_addr_t dma_addr;
dma_addr = droq->info_list_dma + (i * LIO_DROQ_INFO_SIZE);
diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index 3acf8f7c4..b45cec282 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -60,7 +60,7 @@ typedef u32 OSAL_BE32;
#define osal_uintptr_t uintptr_t
-typedef phys_addr_t dma_addr_t;
+typedef iova_addr_t dma_addr_t;
typedef rte_spinlock_t osal_spinlock_t;
diff --git a/drivers/net/sfc/efsys.h b/drivers/net/sfc/efsys.h
index 0405d02bb..5a6625008 100644
--- a/drivers/net/sfc/efsys.h
+++ b/drivers/net/sfc/efsys.h
@@ -253,7 +253,7 @@ typedef struct __efsys_identifier_s efsys_identifier_t;
/* DMA */
-typedef phys_addr_t efsys_dma_addr_t;
+typedef iova_addr_t efsys_dma_addr_t;
typedef struct efsys_mem_s {
const struct rte_memzone *esm_mz;
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index 60812cbe0..007af1f35 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -177,7 +177,7 @@ sfc_ef10_rx_qrefill(struct sfc_ef10_rxq *rxq)
++i, ++id) {
struct rte_mbuf *m = objs[i];
struct sfc_ef10_rx_sw_desc *rxd;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
SFC_ASSERT((id & ~ptr_mask) == 0);
rxd = &rxq->sw_ring[id];
diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c
index da2b5edbc..0e26a1d7f 100644
--- a/drivers/net/sfc/sfc_ef10_tx.c
+++ b/drivers/net/sfc/sfc_ef10_tx.c
@@ -177,7 +177,7 @@ sfc_ef10_tx_reap(struct sfc_ef10_txq *txq)
}
static void
-sfc_ef10_tx_qdesc_dma_create(phys_addr_t addr, uint16_t size, bool eop,
+sfc_ef10_tx_qdesc_dma_create(iova_addr_t addr, uint16_t size, bool eop,
efx_qword_t *edp)
{
EFX_POPULATE_QWORD_4(*edp,
@@ -323,7 +323,7 @@ sfc_ef10_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
pkt_len = m_seg->pkt_len;
do {
- phys_addr_t seg_addr = rte_mbuf_data_dma_addr(m_seg);
+ iova_addr_t seg_addr = rte_mbuf_data_dma_addr(m_seg);
unsigned int seg_len = rte_pktmbuf_data_len(m_seg);
SFC_ASSERT(seg_len <= SFC_EF10_TX_DMA_DESC_LEN_MAX);
diff --git a/drivers/net/thunderx/base/nicvf_hw.c b/drivers/net/thunderx/base/nicvf_hw.c
index 2634285eb..dc0af1ca0 100644
--- a/drivers/net/thunderx/base/nicvf_hw.c
+++ b/drivers/net/thunderx/base/nicvf_hw.c
@@ -509,7 +509,7 @@ nicvf_qset_rbdr_precharge(void *dev, struct nicvf *nic,
struct rbdr_entry_t *desc, *desc0;
struct nicvf_rbdr *rbdr = nic->rbdr;
uint32_t count;
- nicvf_phys_addr_t phy;
+ nicvf_iova_addr_t phy;
assert(rbdr != NULL);
desc = rbdr->desc;
diff --git a/drivers/net/thunderx/base/nicvf_hw.h b/drivers/net/thunderx/base/nicvf_hw.h
index b7d0a3dc5..698aa4878 100644
--- a/drivers/net/thunderx/base/nicvf_hw.h
+++ b/drivers/net/thunderx/base/nicvf_hw.h
@@ -88,7 +88,7 @@ enum nicvf_err_e {
NICVF_ERR_RSS_GET_SZ, /* -8171 */
};
-typedef nicvf_phys_addr_t (*rbdr_pool_get_handler)(void *dev, void *opaque);
+typedef nicvf_iova_addr_t (*rbdr_pool_get_handler)(void *dev, void *opaque);
struct nicvf_hw_rx_qstats {
uint64_t q_rx_bytes;
diff --git a/drivers/net/thunderx/base/nicvf_hw_defs.h b/drivers/net/thunderx/base/nicvf_hw_defs.h
index 0fe673e6d..e7e092b61 100644
--- a/drivers/net/thunderx/base/nicvf_hw_defs.h
+++ b/drivers/net/thunderx/base/nicvf_hw_defs.h
@@ -213,7 +213,7 @@
#define NICVF_STATIC_ASSERT(s) _Static_assert(s, #s)
#define assert_primary(nic) assert((nic)->sqs_mode == 0)
-typedef uint64_t nicvf_phys_addr_t;
+typedef uint64_t nicvf_iova_addr_t;
/* vNIC HW Enumerations */
@@ -840,7 +840,7 @@ struct rbdr_entry_t {
uint64_t buf_addr:42;
uint64_t cache_align:7;
};
- nicvf_phys_addr_t full_addr;
+ nicvf_iova_addr_t full_addr;
};
#else
union {
@@ -849,7 +849,7 @@ struct rbdr_entry_t {
uint64_t buf_addr:42;
uint64_t rsvd0:15;
};
- nicvf_phys_addr_t full_addr;
+ nicvf_iova_addr_t full_addr;
};
#endif
};
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index edc17f1d4..11259808a 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -677,7 +677,7 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic,
static void
nicvf_rbdr_release_mbuf(struct rte_eth_dev *dev, struct nicvf *nic,
- nicvf_phys_addr_t phy)
+ nicvf_iova_addr_t phy)
{
uint16_t qidx;
void *obj;
@@ -1419,7 +1419,7 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
};
}
-static nicvf_phys_addr_t
+static nicvf_iova_addr_t
rbdr_rte_mempool_get(void *dev, void *opaque)
{
uint16_t qidx;
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index 3734430f5..6909082f5 100644
--- a/drivers/net/thunderx/nicvf_ethdev.h
+++ b/drivers/net/thunderx/nicvf_ethdev.h
@@ -104,7 +104,7 @@ nicvf_netdev_qidx(struct nicvf *nic, uint8_t local_qidx)
* P = V - offset
*/
static inline uintptr_t
-nicvf_mbuff_phy2virt(phys_addr_t phy, uint64_t mbuf_phys_off)
+nicvf_mbuff_phy2virt(iova_addr_t phy, uint64_t mbuf_phys_off)
{
return (uintptr_t)(phy + mbuf_phys_off);
}
@@ -112,7 +112,7 @@ nicvf_mbuff_phy2virt(phys_addr_t phy, uint64_t mbuf_phys_off)
static inline uintptr_t
nicvf_mbuff_virt2phy(uintptr_t virt, uint64_t mbuf_phys_off)
{
- return (phys_addr_t)(virt - mbuf_phys_off);
+ return (iova_addr_t)(virt - mbuf_phys_off);
}
static inline void
diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h
index 4ee6c3bb0..edd2587d9 100644
--- a/drivers/net/thunderx/nicvf_struct.h
+++ b/drivers/net/thunderx/nicvf_struct.h
@@ -46,7 +46,7 @@ struct nicvf_rbdr {
uintptr_t rbdr_status;
uintptr_t rbdr_door;
struct rbdr_entry_t *desc;
- nicvf_phys_addr_t phys;
+ nicvf_iova_addr_t phys;
uint32_t buffsz;
uint32_t tail;
uint32_t next_tail;
@@ -56,7 +56,7 @@ struct nicvf_rbdr {
struct nicvf_txq {
union sq_entry_t *desc;
- nicvf_phys_addr_t phys;
+ nicvf_iova_addr_t phys;
struct rte_mbuf **txbuffs;
uintptr_t sq_head;
uintptr_t sq_door;
@@ -87,7 +87,7 @@ struct nicvf_rxq {
uintptr_t cq_status;
uintptr_t cq_door;
union mbuf_initializer mbuf_initializer;
- nicvf_phys_addr_t phys;
+ nicvf_iova_addr_t phys;
union cq_entry_t *desc;
struct nicvf_rbdr *shared_rbdr;
struct nicvf *nic;
diff --git a/drivers/net/virtio/virtio_rxtx.h b/drivers/net/virtio/virtio_rxtx.h
index 28f82d6a8..b072a8c39 100644
--- a/drivers/net/virtio/virtio_rxtx.h
+++ b/drivers/net/virtio/virtio_rxtx.h
@@ -66,7 +66,7 @@ struct virtnet_tx {
struct virtqueue *vq;
/**< memzone to populate hdr. */
const struct rte_memzone *virtio_net_hdr_mz;
- phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
+ iova_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
uint16_t queue_id; /**< DPDK queue index. */
uint8_t port_id; /**< Device port identifier. */
@@ -81,7 +81,7 @@ struct virtnet_ctl {
struct virtqueue *vq;
/**< memzone to populate hdr. */
const struct rte_memzone *virtio_net_hdr_mz;
- phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
+ iova_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
uint8_t port_id; /**< Device port identifier. */
const struct rte_memzone *mz; /**< mem zone to populate RX ring. */
};
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 2e1208615..cb1b2a6e9 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -204,7 +204,7 @@ struct virtqueue {
struct virtnet_ctl cq;
};
- phys_addr_t vq_ring_mem; /**< physical address of vring,
+ iova_addr_t vq_ring_mem; /**< physical address of vring,
* or virtual address for virtio_user. */
/**
diff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c
index e404b7755..8818e39ef 100644
--- a/drivers/net/xenvirt/rte_eth_xenvirt.c
+++ b/drivers/net/xenvirt/rte_eth_xenvirt.c
@@ -378,7 +378,7 @@ gntalloc_vring_create(int queue_type, uint32_t size, int vtidx)
int pg_size;
uint32_t pg_num;
uint32_t *gref_arr = NULL;
- phys_addr_t *pa_arr = NULL;
+ iova_addr_t *pa_arr = NULL;
uint64_t start_index;
int rv;
diff --git a/drivers/net/xenvirt/rte_mempool_gntalloc.c b/drivers/net/xenvirt/rte_mempool_gntalloc.c
index 73e82f808..80aebd564 100644
--- a/drivers/net/xenvirt/rte_mempool_gntalloc.c
+++ b/drivers/net/xenvirt/rte_mempool_gntalloc.c
@@ -49,7 +49,7 @@
struct _gntarr {
uint32_t gref;
- phys_addr_t pa;
+ iova_addr_t pa;
uint64_t index;
void *va;
};
@@ -58,7 +58,7 @@ struct _mempool_gntalloc_info {
struct rte_mempool *mp;
uint32_t pg_num;
uint32_t *gref_arr;
- phys_addr_t *pa_arr;
+ iova_addr_t *pa_arr;
void *va;
uint32_t mempool_idx;
uint64_t start_index;
@@ -94,7 +94,7 @@ _create_mempool(const char *name, unsigned elt_num, unsigned elt_size,
* gnt_arr: stores all meta dat
*/
uint32_t *gref_arr = NULL;
- phys_addr_t *pa_arr = NULL;
+ iova_addr_t *pa_arr = NULL;
struct _gntarr *gnt_arr = NULL;
/* start index of the grant referances, used for dealloc*/
uint64_t start_index;
diff --git a/drivers/net/xenvirt/rte_xen_lib.c b/drivers/net/xenvirt/rte_xen_lib.c
index 6c9a1d49e..0e330a8e4 100644
--- a/drivers/net/xenvirt/rte_xen_lib.c
+++ b/drivers/net/xenvirt/rte_xen_lib.c
@@ -102,7 +102,7 @@ get_xen_virtual(size_t size, size_t page_sz)
* Get the physical address for virtual memory starting at va.
*/
int
-get_phys_map(void *va, phys_addr_t pa[], uint32_t pg_num, uint32_t pg_sz)
+get_phys_map(void *va, iova_addr_t pa[], uint32_t pg_num, uint32_t pg_sz)
{
int32_t fd, rc = 0;
uint32_t i, nb;
@@ -355,7 +355,7 @@ xenstore_write(const char *key_str, const char *val_str)
}
int
-grant_node_create(uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, char *val_str, size_t str_size)
+grant_node_create(uint32_t pg_num, uint32_t *gref_arr, iova_addr_t *pa_arr, char *val_str, size_t str_size)
{
uint64_t start_index;
int pg_size;
@@ -419,7 +419,7 @@ grant_node_create(uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, char
int
-grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, int mempool_idx)
+grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *gref_arr, iova_addr_t *pa_arr, int mempool_idx)
{
char key_str[PATH_MAX] = {0};
char val_str[PATH_MAX] = {0};
diff --git a/drivers/net/xenvirt/rte_xen_lib.h b/drivers/net/xenvirt/rte_xen_lib.h
index d973eacbb..3b487c305 100644
--- a/drivers/net/xenvirt/rte_xen_lib.h
+++ b/drivers/net/xenvirt/rte_xen_lib.h
@@ -62,7 +62,7 @@
* Documentation).
*/
#define PAGEMAP_PFN_BITS 54
-#define PAGEMAP_PFN_MASK RTE_LEN2MASK(PAGEMAP_PFN_BITS, phys_addr_t)
+#define PAGEMAP_PFN_MASK RTE_LEN2MASK(PAGEMAP_PFN_BITS, iova_addr_t)
#define MAP_FLAG 0xA5
@@ -99,7 +99,7 @@ int
xenstore_write(const char *key_str, const char *val_str);
int
-get_phys_map(void *va, phys_addr_t pa[], uint32_t pg_num, uint32_t pg_sz);
+get_phys_map(void *va, iova_addr_t pa[], uint32_t pg_num, uint32_t pg_sz);
void *
get_xen_virtual(size_t size, size_t page_sz);
@@ -108,9 +108,9 @@ int
grefwatch_from_alloc(uint32_t *gref, void **pptr);
-int grant_node_create(uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, char *val_str, size_t str_size);
+int grant_node_create(uint32_t pg_num, uint32_t *gref_arr, iova_addr_t *pa_arr, char *val_str, size_t str_size);
int
-grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, int mempool_idx);
+grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *gref_arr, iova_addr_t *pa_arr, int mempool_idx);
#endif
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index f020be32d..985baaf51 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -139,7 +139,7 @@ enum l2fwd_crypto_xform_chain {
struct l2fwd_key {
uint8_t *data;
uint32_t length;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
};
struct l2fwd_iv {
diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte_crypto.h
index 10fe0804b..363d1a7e5 100644
--- a/lib/librte_cryptodev/rte_crypto.h
+++ b/lib/librte_cryptodev/rte_crypto.h
@@ -117,7 +117,7 @@ struct rte_crypto_op {
struct rte_mempool *mempool;
/**< crypto operation mempool which operation is allocated from */
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
/**< physical address of crypto operation */
RTE_STD_C11
diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h
index 0ceaa9176..ddb68246c 100644
--- a/lib/librte_cryptodev/rte_crypto_sym.h
+++ b/lib/librte_cryptodev/rte_crypto_sym.h
@@ -543,7 +543,7 @@ struct rte_crypto_sym_op {
* For GCM (@ref RTE_CRYPTO_AEAD_AES_GCM), for
* "digest result" read "authentication tag T".
*/
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
/**< Physical address of digest */
} digest; /**< Digest parameters */
struct {
@@ -579,7 +579,7 @@ struct rte_crypto_sym_op {
* of the block size (16 bytes).
*
*/
- phys_addr_t phys_addr; /**< physical address */
+ iova_addr_t phys_addr; /**< physical address */
} aad;
/**< Additional authentication parameters */
} aead;
@@ -676,7 +676,7 @@ struct rte_crypto_sym_op {
* will overwrite any data at this location.
*
*/
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
/**< Physical address of digest */
} digest; /**< Digest parameters */
} auth;
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index 7ec9c4bc4..cfa32cbbc 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -111,7 +111,7 @@ extern const char **rte_cyptodev_names;
* to calculate address from.
*/
#define rte_crypto_op_ctophys_offset(c, o) \
- (phys_addr_t)((c)->phys_addr + (o))
+ (iova_addr_t)((c)->phys_addr + (o))
/**
* Crypto parameters range description
diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index 3614da8db..10c2e121f 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -50,7 +50,7 @@
/*
* Get physical address of any mapped virtual address in the current process.
*/
-phys_addr_t
+iova_addr_t
rte_mem_virt2phy(const void *virtaddr)
{
/* XXX not implemented. This function is only used by
@@ -73,7 +73,7 @@ rte_eal_hugepage_init(void)
/* for debug purposes, hugetlbfs can be disabled */
if (internal_config.no_hugetlbfs) {
addr = malloc(internal_config.memory);
- mcfg->memseg[0].phys_addr = (phys_addr_t)(uintptr_t)addr;
+ mcfg->memseg[0].phys_addr = (iova_addr_t)(uintptr_t)addr;
mcfg->memseg[0].addr = addr;
mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
mcfg->memseg[0].len = internal_config.memory;
diff --git a/lib/librte_eal/common/include/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h
index 3d37f79b8..491b479b1 100644
--- a/lib/librte_eal/common/include/rte_malloc.h
+++ b/lib/librte_eal/common/include/rte_malloc.h
@@ -332,7 +332,7 @@ rte_malloc_set_limit(const char *type, size_t max);
* RTE_BAD_PHYS_ADDR on error
* otherwise return physical address of the buffer
*/
-phys_addr_t
+iova_addr_t
rte_malloc_virt2phy(const void *addr);
#ifdef __cplusplus
diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index 4aa5d1f77..5face8c86 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -98,14 +98,14 @@ enum rte_page_sizes {
*/
#define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)
-typedef uint64_t phys_addr_t; /**< Physical address definition. */
-#define RTE_BAD_PHYS_ADDR ((phys_addr_t)-1)
+typedef uint64_t iova_addr_t; /**< Physical address definition. */
+#define RTE_BAD_PHYS_ADDR ((iova_addr_t)-1)
/**
* Physical memory segment descriptor.
*/
struct rte_memseg {
- phys_addr_t phys_addr; /**< Start physical address. */
+ iova_addr_t phys_addr; /**< Start physical address. */
RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
@@ -142,7 +142,7 @@ int rte_mem_lock_page(const void *virt);
* @return
* The physical address or RTE_BAD_PHYS_ADDR on error.
*/
-phys_addr_t rte_mem_virt2phy(const void *virt);
+iova_addr_t rte_mem_virt2phy(const void *virt);
/**
* Get the layout of the available physical memory.
@@ -201,7 +201,7 @@ unsigned rte_memory_get_nrank(void);
int rte_xen_dom0_supported(void);
/**< Internal use only - phys to virt mapping for xen */
-phys_addr_t rte_xen_mem_phy2mch(int32_t, const phys_addr_t);
+iova_addr_t rte_xen_mem_phy2mch(int32_t, const iova_addr_t);
/**
* Return the physical address of elt, which is an element of the pool mp.
@@ -215,8 +215,8 @@ phys_addr_t rte_xen_mem_phy2mch(int32_t, const phys_addr_t);
* @return
* The physical address or RTE_BAD_PHYS_ADDR on error.
*/
-static inline phys_addr_t
-rte_mem_phy2mch(int32_t memseg_id, const phys_addr_t phy_addr)
+static inline iova_addr_t
+rte_mem_phy2mch(int32_t memseg_id, const iova_addr_t phy_addr)
{
if (rte_xen_dom0_supported())
return rte_xen_mem_phy2mch(memseg_id, phy_addr);
@@ -251,8 +251,8 @@ static inline int rte_xen_dom0_supported(void)
return 0;
}
-static inline phys_addr_t
-rte_mem_phy2mch(int32_t memseg_id __rte_unused, const phys_addr_t phy_addr)
+static inline iova_addr_t
+rte_mem_phy2mch(int32_t memseg_id __rte_unused, const iova_addr_t phy_addr)
{
return phy_addr;
}
diff --git a/lib/librte_eal/common/include/rte_memzone.h b/lib/librte_eal/common/include/rte_memzone.h
index 1d0827f46..89b2adb6e 100644
--- a/lib/librte_eal/common/include/rte_memzone.h
+++ b/lib/librte_eal/common/include/rte_memzone.h
@@ -78,7 +78,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. */
- phys_addr_t phys_addr; /**< Start physical address. */
+ iova_addr_t phys_addr; /**< Start physical address. */
RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index 5c0627bf4..3ce6034bf 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -248,7 +248,7 @@ rte_malloc_set_limit(__rte_unused const char *type,
/*
* Return the physical address of a virtual address obtained through rte_malloc
*/
-phys_addr_t
+iova_addr_t
rte_malloc_virt2phy(const void *addr)
{
const struct malloc_elem *elem = malloc_elem_from_data(addr);
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 52791282f..405c15bcd 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -104,7 +104,7 @@ static void
test_phys_addrs_available(void)
{
uint64_t tmp;
- phys_addr_t physaddr;
+ iova_addr_t physaddr;
/* For dom0, phys addresses can always be available */
if (rte_xen_dom0_supported())
@@ -130,7 +130,7 @@ test_phys_addrs_available(void)
/*
* Get physical address of any mapped virtual address in the current process.
*/
-phys_addr_t
+iova_addr_t
rte_mem_virt2phy(const void *virtaddr)
{
int fd, retval;
@@ -219,7 +219,7 @@ static int
find_physaddrs(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
{
unsigned int i;
- phys_addr_t addr;
+ iova_addr_t addr;
for (i = 0; i < hpi->num_pages[0]; i++) {
addr = rte_mem_virt2phy(hugepg_tbl[i].orig_va);
@@ -237,7 +237,7 @@ static int
set_physaddrs(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
{
unsigned int i;
- static phys_addr_t addr;
+ static iova_addr_t addr;
for (i = 0; i < hpi->num_pages[0]; i++) {
hugepg_tbl[i].physaddr = addr;
diff --git a/lib/librte_eal/linuxapp/eal/eal_xen_memory.c b/lib/librte_eal/linuxapp/eal/eal_xen_memory.c
index 19db1cb5f..b2edd3ee1 100644
--- a/lib/librte_eal/linuxapp/eal/eal_xen_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_xen_memory.c
@@ -153,8 +153,8 @@ get_xen_memory_size(void)
/**
* Based on physical address to caculate MFN in Xen Dom0.
*/
-phys_addr_t
-rte_xen_mem_phy2mch(int32_t memseg_id, const phys_addr_t phy_addr)
+iova_addr_t
+rte_xen_mem_phy2mch(int32_t memseg_id, const iova_addr_t phy_addr)
{
int mfn_id, i;
uint64_t mfn, mfn_offset;
diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
index 2ac879fdd..7960afee2 100644
--- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
+++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
@@ -58,7 +58,6 @@
#ifndef _RTE_KNI_COMMON_H_
#define _RTE_KNI_COMMON_H_
-
#ifdef __KERNEL__
#include <linux/if.h>
#define RTE_STD_C11
@@ -66,6 +65,8 @@
#include <rte_common.h>
#endif
+typedef uint64_t iova_addr_t;
+
/**
* KNI name is part of memzone name.
*/
@@ -138,20 +139,20 @@ struct rte_kni_mbuf {
struct rte_kni_device_info {
char name[RTE_KNI_NAMESIZE]; /**< Network device name for KNI */
- phys_addr_t tx_phys;
- phys_addr_t rx_phys;
- phys_addr_t alloc_phys;
- phys_addr_t free_phys;
+ iova_addr_t tx_phys;
+ iova_addr_t rx_phys;
+ iova_addr_t alloc_phys;
+ iova_addr_t free_phys;
/* Used by Ethtool */
- phys_addr_t req_phys;
- phys_addr_t resp_phys;
- phys_addr_t sync_phys;
+ iova_addr_t req_phys;
+ iova_addr_t resp_phys;
+ iova_addr_t sync_phys;
void * sync_va;
/* mbuf mempool */
void * mbuf_va;
- phys_addr_t mbuf_phys;
+ iova_addr_t mbuf_phys;
/* PCI info */
uint16_t vendor_id; /**< Vendor ID or PCI_ANY_ID. */
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index eaed7eee0..4563b5dc3 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -411,7 +411,7 @@ struct rte_mbuf {
* same mbuf cacheline0 layout for 32-bit and 64-bit. This makes
* working on vector drivers easier.
*/
- phys_addr_t buf_physaddr __rte_aligned(sizeof(phys_addr_t));
+ iova_addr_t buf_physaddr __rte_aligned(sizeof(iova_addr_t));
/* next 8 bytes are initialised on RX descriptor rearm */
MARKER64 rearm_data;
@@ -594,7 +594,7 @@ static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp);
* @return
* The physical address of the beginning of the mbuf data
*/
-static inline phys_addr_t
+static inline iova_addr_t
rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
{
return mb->buf_physaddr + mb->data_off;
@@ -612,7 +612,7 @@ rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
* @return
* The physical address of the beginning of the mbuf data
*/
-static inline phys_addr_t
+static inline iova_addr_t
rte_mbuf_data_dma_addr_default(const struct rte_mbuf *mb)
{
return mb->buf_physaddr + RTE_PKTMBUF_HEADROOM;
@@ -1533,7 +1533,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)
* The offset into the data to calculate address from.
*/
#define rte_pktmbuf_mtophys_offset(m, o) \
- (phys_addr_t)((m)->buf_physaddr + (m)->data_off + (o))
+ (iova_addr_t)((m)->buf_physaddr + (m)->data_off + (o))
/**
* A macro that returns the physical address that points to the start of the
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 6fc3c9c7c..b4f14cf61 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -128,7 +128,7 @@ static unsigned optimize_object_size(unsigned obj_size)
}
static void
-mempool_add_elem(struct rte_mempool *mp, void *obj, phys_addr_t physaddr)
+mempool_add_elem(struct rte_mempool *mp, void *obj, iova_addr_t physaddr)
{
struct rte_mempool_objhdr *hdr;
struct rte_mempool_objtlr *tlr __rte_unused;
@@ -263,11 +263,11 @@ rte_mempool_xmem_size(uint32_t elt_num, size_t total_elt_sz, uint32_t pg_shift)
*/
ssize_t
rte_mempool_xmem_usage(__rte_unused void *vaddr, uint32_t elt_num,
- size_t total_elt_sz, const phys_addr_t paddr[], uint32_t pg_num,
+ size_t total_elt_sz, const iova_addr_t paddr[], uint32_t pg_num,
uint32_t pg_shift)
{
uint32_t elt_cnt = 0;
- phys_addr_t start, end;
+ iova_addr_t start, end;
uint32_t paddr_idx;
size_t pg_sz = (size_t)1 << pg_shift;
@@ -345,7 +345,7 @@ rte_mempool_free_memchunks(struct rte_mempool *mp)
*/
int
rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
- phys_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
+ iova_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque)
{
unsigned total_elt_sz;
@@ -409,7 +409,7 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
*/
int
rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
+ const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque)
{
uint32_t i, n;
@@ -452,7 +452,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
size_t len, size_t pg_sz, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque)
{
- phys_addr_t paddr;
+ iova_addr_t paddr;
size_t off, phys_len;
int ret, cnt = 0;
@@ -483,7 +483,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
/* populate with the largest group of contiguous pages */
for (phys_len = pg_sz; off + phys_len < len; phys_len += pg_sz) {
- phys_addr_t paddr_tmp;
+ iova_addr_t paddr_tmp;
paddr_tmp = rte_mem_virt2phy(addr + off + phys_len);
paddr_tmp = rte_mem_phy2mch(-1, paddr_tmp);
@@ -519,7 +519,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)
char mz_name[RTE_MEMZONE_NAMESIZE];
const struct rte_memzone *mz;
size_t size, total_elt_sz, align, pg_sz, pg_shift;
- phys_addr_t paddr;
+ iova_addr_t paddr;
unsigned mz_id, n;
int ret;
@@ -922,7 +922,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
rte_mempool_ctor_t *mp_init, void *mp_init_arg,
rte_mempool_obj_cb_t *obj_init, void *obj_init_arg,
int socket_id, unsigned flags, void *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift)
+ const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift)
{
struct rte_mempool *mp = NULL;
int ret;
diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index 76b5b3b15..1bcb6ebd7 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -157,7 +157,7 @@ struct rte_mempool_objsz {
struct rte_mempool_objhdr {
STAILQ_ENTRY(rte_mempool_objhdr) next; /**< Next in list. */
struct rte_mempool *mp; /**< The mempool owning the object. */
- phys_addr_t physaddr; /**< Physical address of the object. */
+ iova_addr_t physaddr; /**< Physical address of the object. */
#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
uint64_t cookie; /**< Debug cookie. */
#endif
@@ -203,7 +203,7 @@ struct rte_mempool_memhdr {
STAILQ_ENTRY(rte_mempool_memhdr) next; /**< Next in list. */
struct rte_mempool *mp; /**< The mempool owning the chunk */
void *addr; /**< Virtual address of the chunk */
- phys_addr_t phys_addr; /**< Physical address of the chunk */
+ iova_addr_t phys_addr; /**< Physical address of the chunk */
size_t len; /**< length of the chunk */
rte_mempool_memchunk_free_cb_t *free_cb; /**< Free callback */
void *opaque; /**< Argument passed to the free callback */
@@ -739,7 +739,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
rte_mempool_ctor_t *mp_init, void *mp_init_arg,
rte_mempool_obj_cb_t *obj_init, void *obj_init_arg,
int socket_id, unsigned flags, void *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift);
+ const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift);
/**
* Create an empty mempool
@@ -820,7 +820,7 @@ rte_mempool_free(struct rte_mempool *mp);
* mempool and a negative errno is returned.
*/
int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
- phys_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
+ iova_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque);
/**
@@ -851,7 +851,7 @@ int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
* mempool and a negative errno is returned.
*/
int rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
+ const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque);
/**
@@ -1394,7 +1394,7 @@ rte_mempool_empty(const struct rte_mempool *mp)
* If the mempool was created with MEMPOOL_F_NO_PHYS_CONTIG, the
* returned value is RTE_BAD_PHYS_ADDR.
*/
-static inline phys_addr_t
+static inline iova_addr_t
rte_mempool_virt2phy(__rte_unused const struct rte_mempool *mp, const void *elt)
{
const struct rte_mempool_objhdr *hdr;
@@ -1523,7 +1523,7 @@ size_t rte_mempool_xmem_size(uint32_t elt_num, size_t total_elt_sz,
* is the actual number of elements that can be stored in that buffer.
*/
ssize_t rte_mempool_xmem_usage(void *vaddr, uint32_t elt_num,
- size_t total_elt_sz, const phys_addr_t paddr[], uint32_t pg_num,
+ size_t total_elt_sz, const iova_addr_t paddr[], uint32_t pg_num,
uint32_t pg_shift);
/**
diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index 6fe72aeb6..2481599ba 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -281,7 +281,7 @@ extern uint64_t VHOST_FEATURES;
extern struct virtio_net *vhost_devices[MAX_VHOST_DEVICE];
/* Convert guest physical address to host physical address */
-static __rte_always_inline phys_addr_t
+static __rte_always_inline iova_addr_t
gpa_to_hpa(struct virtio_net *dev, uint64_t gpa, uint64_t size)
{
uint32_t i;
diff --git a/test/test/test_cryptodev.h b/test/test/test_cryptodev.h
index 4509a09ad..7a6175740 100644
--- a/test/test/test_cryptodev.h
+++ b/test/test/test_cryptodev.h
@@ -152,7 +152,7 @@ pktmbuf_mtod_offset(struct rte_mbuf *mbuf, int offset) {
return rte_pktmbuf_mtod_offset(m, uint8_t *, offset);
}
-static inline phys_addr_t
+static inline iova_addr_t
pktmbuf_mtophys_offset(struct rte_mbuf *mbuf, int offset) {
struct rte_mbuf *m;
diff --git a/test/test/test_memzone.c b/test/test/test_memzone.c
index 7ae31cf74..0afb159e9 100644
--- a/test/test/test_memzone.c
+++ b/test/test/test_memzone.c
@@ -78,7 +78,7 @@
/* Test if memory overlaps: return 1 if true, or 0 if false. */
static int
-is_memory_overlap(phys_addr_t ptr1, size_t len1, phys_addr_t ptr2, size_t len2)
+is_memory_overlap(iova_addr_t ptr1, size_t len1, iova_addr_t ptr2, size_t len2)
{
if (ptr2 >= ptr1 && (ptr2 - ptr1) < len1)
return 1;
@@ -601,9 +601,9 @@ check_memzone_bounded(const char *name, uint32_t len, uint32_t align,
uint32_t bound)
{
const struct rte_memzone *mz;
- phys_addr_t bmask;
+ iova_addr_t bmask;
- bmask = ~((phys_addr_t)bound - 1);
+ bmask = ~((iova_addr_t)bound - 1);
if ((mz = rte_memzone_reserve_bounded(name, len, SOCKET_ID_ANY, 0,
align, bound)) == NULL) {
@@ -612,7 +612,7 @@ check_memzone_bounded(const char *name, uint32_t len, uint32_t align,
return -1;
}
- if ((mz->phys_addr & ((phys_addr_t)align - 1)) != 0) {
+ if ((mz->phys_addr & ((iova_addr_t)align - 1)) != 0) {
printf("%s(%s): invalid phys addr alignment\n",
__func__, mz->name);
return -1;
--
2.11.0
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v1 2/4] eal/memory: rename buf_physaddr to buf_iovaaddr
2017-08-14 15:15 [dpdk-dev] [PATCH v1 0/4] make dpdk iova aware Santosh Shukla
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 1/4] eal: rename phys_addr_t to iova_addr_t Santosh Shukla
@ 2017-08-14 15:15 ` Santosh Shukla
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 3/4] eal/memory: rename memory translational api to _iova types Santosh Shukla
` (3 subsequent siblings)
5 siblings, 0 replies; 91+ messages in thread
From: Santosh Shukla @ 2017-08-14 15:15 UTC (permalink / raw)
To: dev; +Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal, Santosh Shukla
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
v1 notes:
Since crux of change is at eal/memory area so using that as
title.
doc/guides/prog_guide/img/mbuf1.svg | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 +-
drivers/net/ark/ark_ethdev_rx.c | 8 ++++----
drivers/net/bnx2x/bnx2x_rxtx.c | 4 ++--
drivers/net/bnxt/bnxt_ring.h | 2 +-
drivers/net/cxgbe/sge.c | 4 ++--
drivers/net/ena/ena_ethdev.c | 6 +++---
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_rxtx.c | 6 +++---
drivers/net/fm10k/fm10k.h | 4 ++--
drivers/net/fm10k/fm10k_rxtx_vec.c | 4 ++--
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 4 ++--
drivers/net/i40e/i40e_rxtx_vec_neon.c | 6 +++---
drivers/net/i40e/i40e_rxtx_vec_sse.c | 6 +++---
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 6 +++---
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 6 +++---
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtqueue.h | 2 +-
lib/librte_eal/common/eal_common_memory.c | 2 +-
lib/librte_eal/common/include/rte_memory.h | 2 +-
lib/librte_eal/common/rte_malloc.c | 4 ++--
lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 ++--
.../linuxapp/eal/include/exec-env/rte_kni_common.h | 2 +-
lib/librte_eal/linuxapp/kni/kni_net.c | 6 +++---
lib/librte_kni/rte_kni.c | 2 +-
lib/librte_mbuf/rte_mbuf.c | 6 +++---
lib/librte_mbuf/rte_mbuf.h | 14 +++++++-------
lib/librte_vhost/virtio_net.c | 2 +-
test/test/test_mbuf.c | 2 +-
31 files changed, 66 insertions(+), 66 deletions(-)
diff --git a/doc/guides/prog_guide/img/mbuf1.svg b/doc/guides/prog_guide/img/mbuf1.svg
index 5bd84d1bf..2f856bfd9 100644
--- a/doc/guides/prog_guide/img/mbuf1.svg
+++ b/doc/guides/prog_guide/img/mbuf1.svg
@@ -482,7 +482,7 @@
sodipodi:role="line"
x="187.85715"
y="347.7193"
- id="tspan5240">(m->buf_physaddr is the</tspan><tspan
+ id="tspan5240">(m->buf_iovaaddr is the</tspan><tspan
sodipodi:role="line"
x="187.85715"
y="360.2193"
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 184c7069d..15e3878eb 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -309,7 +309,7 @@ static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr)
* These routines are called with help of below MACRO's
*/
-#define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_physaddr)
+#define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_iovaaddr)
#define DPAA2_OP_VADDR_TO_IOVA(op) (op->phys_addr)
/**
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 1cbda01a7..90cf304c0 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -500,22 +500,22 @@ eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue)
case 0:
while (count != nb) {
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iovaaddr;
count++;
/* FALLTHROUGH */
case 3:
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iovaaddr;
count++;
/* FALLTHROUGH */
case 2:
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iovaaddr;
count++;
/* FALLTHROUGH */
case 1:
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iovaaddr;
count++;
/* FALLTHROUGH */
diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c
index 7336124fc..e558bb12c 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.c
+++ b/drivers/net/bnx2x/bnx2x_rxtx.c
@@ -140,7 +140,7 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
return -ENOMEM;
}
rxq->sw_ring[idx] = mbuf;
- rxq->rx_ring[idx] = mbuf->buf_physaddr;
+ rxq->rx_ring[idx] = mbuf->buf_iovaaddr;
}
rxq->pkt_first_seg = NULL;
rxq->pkt_last_seg = NULL;
@@ -400,7 +400,7 @@ bnx2x_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
rx_mb = rxq->sw_ring[bd_cons];
rxq->sw_ring[bd_cons] = new_mb;
- rxq->rx_ring[bd_prod] = new_mb->buf_physaddr;
+ rxq->rx_ring[bd_prod] = new_mb->buf_iovaaddr;
rx_pref = NEXT_RX_BD(bd_cons) & MAX_RX_BD(rxq);
rte_prefetch0(rxq->sw_ring[rx_pref]);
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index 09042cb80..79504af24 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -41,7 +41,7 @@
#define RING_NEXT(ring, idx) (((idx) + 1) & (ring)->ring_mask)
#define RTE_MBUF_DATA_DMA_ADDR(mb) \
- ((uint64_t)((mb)->buf_physaddr + (mb)->data_off))
+ ((uint64_t)((mb)->buf_iovaaddr + (mb)->data_off))
#define DB_IDX_MASK 0xffffff
#define DB_IDX_VALID (0x1 << 26)
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index 5376fc500..d867914ab 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -149,7 +149,7 @@ static int map_mbuf(struct rte_mbuf *mbuf, dma_addr_t *addr)
struct rte_mbuf *m = mbuf;
for (; m; m = m->next, addr++) {
- *addr = m->buf_physaddr + rte_pktmbuf_headroom(m);
+ *addr = m->buf_iovaaddr + rte_pktmbuf_headroom(m);
if (*addr == 0)
goto out_err;
}
@@ -423,7 +423,7 @@ static unsigned int refill_fl_usembufs(struct adapter *adap, struct sge_fl *q,
mbuf->nb_segs = 1;
mbuf->port = rxq->rspq.port_id;
- mapping = (dma_addr_t)RTE_ALIGN(mbuf->buf_physaddr +
+ mapping = (dma_addr_t)RTE_ALIGN(mbuf->buf_iovaaddr +
mbuf->data_off,
adap->sge.fl_align);
mapping |= buf_size_idx;
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 80ce1f353..12450f300 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1166,7 +1166,7 @@ static int ena_populate_rx_queue(struct ena_ring *rxq, unsigned int count)
rte_prefetch0(mbufs[((next_to_use + 4) & ring_mask)]);
/* prepare physical address for DMA transaction */
- ebuf.paddr = mbuf->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ ebuf.paddr = mbuf->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
ebuf.len = mbuf->buf_len - RTE_PKTMBUF_HEADROOM;
/* pass resource to device */
rc = ena_com_add_single_rx_desc(rxq->ena_com_io_sq,
@@ -1725,7 +1725,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
* consideration pushed header
*/
if (mbuf->data_len > ena_tx_ctx.header_len) {
- ebuf->paddr = mbuf->buf_physaddr +
+ ebuf->paddr = mbuf->buf_iovaaddr +
mbuf->data_off +
ena_tx_ctx.header_len;
ebuf->len = mbuf->data_len - ena_tx_ctx.header_len;
@@ -1734,7 +1734,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
}
while ((mbuf = mbuf->next) != NULL) {
- ebuf->paddr = mbuf->buf_physaddr + mbuf->data_off;
+ ebuf->paddr = mbuf->buf_iovaaddr + mbuf->data_off;
ebuf->len = mbuf->data_len;
ebuf++;
tx_info->num_of_bufs++;
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 40dbec7fa..7801a8b31 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -313,7 +313,7 @@ enic_alloc_rx_queue_mbufs(struct enic *enic, struct vnic_rq *rq)
}
mb->data_off = RTE_PKTMBUF_HEADROOM;
- dma_addr = (dma_addr_t)(mb->buf_physaddr
+ dma_addr = (dma_addr_t)(mb->buf_iovaaddr
+ RTE_PKTMBUF_HEADROOM);
rq_enet_desc_enc(rqd, dma_addr,
(rq->is_sop ? RQ_ENET_TYPE_ONLY_SOP
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index a39172f14..95b1db1f9 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -386,7 +386,7 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
/* Push descriptor for newly allocated mbuf */
nmb->data_off = RTE_PKTMBUF_HEADROOM;
- dma_addr = (dma_addr_t)(nmb->buf_physaddr +
+ dma_addr = (dma_addr_t)(nmb->buf_iovaaddr +
RTE_PKTMBUF_HEADROOM);
rq_enet_desc_enc(rqd_ptr, dma_addr,
(rq->is_sop ? RQ_ENET_TYPE_ONLY_SOP
@@ -578,7 +578,7 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
vlan_id = 0;
vlan_tag_insert = 0;
bus_addr = (dma_addr_t)
- (tx_pkt->buf_physaddr + tx_pkt->data_off);
+ (tx_pkt->buf_iovaaddr + tx_pkt->data_off);
descs = (struct wq_enet_desc *)wq->ring.descs;
desc_p = descs + head_idx;
@@ -630,7 +630,7 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
if (tx_pkt->next == NULL)
eop = 1;
desc_p = descs + head_idx;
- bus_addr = (dma_addr_t)(tx_pkt->buf_physaddr
+ bus_addr = (dma_addr_t)(tx_pkt->buf_iovaaddr
+ tx_pkt->data_off);
wq_enet_desc_enc((struct wq_enet_desc *)
&desc_tmp, bus_addr, data_len,
diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h
index 8e1a95062..d3859fd61 100644
--- a/drivers/net/fm10k/fm10k.h
+++ b/drivers/net/fm10k/fm10k.h
@@ -252,11 +252,11 @@ struct fm10k_txq_ops {
};
#define MBUF_DMA_ADDR(mb) \
- ((uint64_t) ((mb)->buf_physaddr + (mb)->data_off))
+ ((uint64_t) ((mb)->buf_iovaaddr + (mb)->data_off))
/* enforce 512B alignment on default Rx DMA addresses */
#define MBUF_DMA_ADDR_DEFAULT(mb) \
- ((uint64_t) RTE_ALIGN(((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM),\
+ ((uint64_t) RTE_ALIGN(((mb)->buf_iovaaddr + RTE_PKTMBUF_HEADROOM),\
FM10K_RX_DATABUF_ALIGN))
static inline void fifo_reset(struct fifo *fifo, uint32_t len)
diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
index d23bfe9b7..5d40479da 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -330,8 +330,8 @@ fm10k_rxq_rearm(struct fm10k_rx_queue *rxq)
p1 = (uintptr_t)&mb1->rearm_data;
*(uint64_t *)p1 = rxq->mbuf_initializer;
- /* 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_iovaaddr(hi 64bit) */
+ RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iovaaddr) !=
offsetof(struct rte_mbuf, buf_addr) + 8);
vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr);
vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr);
diff --git a/drivers/net/i40e/i40e_rxtx_vec_altivec.c b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
index f4036ea28..242a479f0 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_altivec.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
@@ -100,7 +100,7 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq)
p1 = (uintptr_t)&mb1->rearm_data;
*(uint64_t *)p1 = rxq->mbuf_initializer;
- /* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */
+ /* load buf_addr(lo 64bit) and buf_iovaaddr(hi 64bit) */
vaddr0 = vec_ld(0, (vector unsigned long *)&mb0->buf_addr);
vaddr1 = vec_ld(0, (vector unsigned long *)&mb1->buf_addr);
@@ -538,7 +538,7 @@ vtx1(volatile struct i40e_tx_desc *txdp,
((uint64_t)pkt->data_len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT));
vector unsigned long descriptor = (vector unsigned long){
- pkt->buf_physaddr + pkt->data_off, high_qw};
+ pkt->buf_iovaaddr + pkt->data_off, high_qw};
*(vector unsigned long *)txdp = descriptor;
}
diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index 694e91f33..b858d9f1d 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -81,13 +81,13 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq)
mb0 = rxep[0].mbuf;
mb1 = rxep[1].mbuf;
- paddr = mb0->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb0->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
dma_addr0 = vdupq_n_u64(paddr);
/* flush desc with pa dma_addr */
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr0);
- paddr = mb1->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb1->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
dma_addr1 = vdupq_n_u64(paddr);
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr1);
}
@@ -515,7 +515,7 @@ vtx1(volatile struct i40e_tx_desc *txdp,
((uint64_t)flags << I40E_TXD_QW1_CMD_SHIFT) |
((uint64_t)pkt->data_len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT));
- uint64x2_t descriptor = {pkt->buf_physaddr + pkt->data_off, high_qw};
+ uint64x2_t descriptor = {pkt->buf_iovaaddr + pkt->data_off, high_qw};
vst1q_u64((uint64_t *)txdp, descriptor);
}
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 779f14e53..35928ad79 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -86,8 +86,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_iovaaddr(hi 64bit) */
+ RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iovaaddr) !=
offsetof(struct rte_mbuf, buf_addr) + 8);
vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr);
vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr);
@@ -549,7 +549,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_iovaaddr + pkt->data_off);
_mm_store_si128((__m128i *)txdp, descriptor);
}
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
index 44de1caac..571f578ce 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
@@ -87,13 +87,13 @@ ixgbe_rxq_rearm(struct ixgbe_rx_queue *rxq)
* Data to be rearmed is 6 bytes long.
*/
vst1_u8((uint8_t *)&mb0->rearm_data, p);
- paddr = mb0->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb0->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
dma_addr0 = vsetq_lane_u64(paddr, zero, 0);
/* flush desc with pa dma_addr */
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr0);
vst1_u8((uint8_t *)&mb1->rearm_data, p);
- paddr = mb1->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb1->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
dma_addr1 = vsetq_lane_u64(paddr, zero, 0);
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr1);
}
@@ -414,7 +414,7 @@ vtx1(volatile union ixgbe_adv_tx_desc *txdp,
struct rte_mbuf *pkt, uint64_t flags)
{
uint64x2_t descriptor = {
- pkt->buf_physaddr + pkt->data_off,
+ pkt->buf_iovaaddr + pkt->data_off,
(uint64_t)pkt->pkt_len << 46 | flags | pkt->data_len};
vst1q_u64((uint64_t *)&txdp->read, descriptor);
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index e704a7f35..345010f4d 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -86,8 +86,8 @@ ixgbe_rxq_rearm(struct ixgbe_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_iovaaddr(hi 64bit) */
+ RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iovaaddr) !=
offsetof(struct rte_mbuf, buf_addr) + 8);
vaddr0 = _mm_loadu_si128((__m128i *)&(mb0->buf_addr));
vaddr1 = _mm_loadu_si128((__m128i *)&(mb1->buf_addr));
@@ -604,7 +604,7 @@ vtx1(volatile union ixgbe_adv_tx_desc *txdp,
{
__m128i descriptor = _mm_set_epi64x((uint64_t)pkt->pkt_len << 46 |
flags | pkt->data_len,
- pkt->buf_physaddr + pkt->data_off);
+ pkt->buf_iovaaddr + pkt->data_off);
_mm_store_si128((__m128i *)&txdp->read, descriptor);
}
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 92b03c4cb..fcd472eb4 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -105,7 +105,7 @@ static uint16_t nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
#define NFP_QCP_MAX_ADD 0x7f
#define RTE_MBUF_DMA_ADDR_DEFAULT(mb) \
- (uint64_t)((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM)
+ (uint64_t)((mb)->buf_iovaaddr + RTE_PKTMBUF_HEADROOM)
/* nfp_qcp_ptr - Read or Write Pointer of a queue */
enum nfp_qcp_ptr {
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index e320811ed..0beb8a387 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -491,7 +491,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
* VIRTIO_MBUF_DATA_DMA_ADDR in virtqueue.h for more information.
*/
if (!hw->virtio_user_dev)
- vq->offset = offsetof(struct rte_mbuf, buf_physaddr);
+ vq->offset = offsetof(struct rte_mbuf, buf_iovaaddr);
else {
vq->vq_ring_mem = (uintptr_t)mz->addr;
vq->offset = offsetof(struct rte_mbuf, buf_addr);
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index cb1b2a6e9..21733c0e2 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -80,7 +80,7 @@ struct rte_mbuf;
#define VIRTIO_MBUF_ADDR(mb, vq) \
((uint64_t)(*(uintptr_t *)((uintptr_t)(mb) + (vq)->offset)))
#else
-#define VIRTIO_MBUF_ADDR(mb, vq) ((mb)->buf_physaddr)
+#define VIRTIO_MBUF_ADDR(mb, vq) ((mb)->buf_iovaaddr)
#endif
/**
diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 996877ef5..5ed83d20a 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -100,7 +100,7 @@ rte_dump_physmem_layout(FILE *f)
"virt:%p, socket_id:%"PRId32", "
"hugepage_sz:%"PRIu64", nchannel:%"PRIx32", "
"nrank:%"PRIx32"\n", i,
- mcfg->memseg[i].phys_addr,
+ mcfg->memseg[i].iova_addr,
mcfg->memseg[i].len,
mcfg->memseg[i].addr,
mcfg->memseg[i].socket_id,
diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index 5face8c86..fc0fdf740 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -105,7 +105,7 @@ typedef uint64_t iova_addr_t; /**< Physical address definition. */
* Physical memory segment descriptor.
*/
struct rte_memseg {
- iova_addr_t phys_addr; /**< Start physical address. */
+ iova_addr_t iova_addr; /**< Start iova(_pa/_va) address. */
RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index 3ce6034bf..d03a5348a 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -254,7 +254,7 @@ rte_malloc_virt2phy(const void *addr)
const struct malloc_elem *elem = malloc_elem_from_data(addr);
if (elem == NULL)
return RTE_BAD_PHYS_ADDR;
- if (elem->ms->phys_addr == RTE_BAD_PHYS_ADDR)
+ if (elem->ms->iova_addr == RTE_BAD_PHYS_ADDR)
return RTE_BAD_PHYS_ADDR;
- return elem->ms->phys_addr + ((uintptr_t)addr - (uintptr_t)elem->ms->addr);
+ return elem->ms->iova_addr + ((uintptr_t)addr - (uintptr_t)elem->ms->addr);
}
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 405c15bcd..5d9702c72 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -154,7 +154,7 @@ rte_mem_virt2phy(const void *virtaddr)
if (virtaddr > memseg->addr &&
virtaddr < RTE_PTR_ADD(memseg->addr,
memseg->len)) {
- return memseg->phys_addr +
+ return memseg->iova_addr +
RTE_PTR_DIFF(virtaddr, memseg->addr);
}
}
@@ -1059,7 +1059,7 @@ rte_eal_hugepage_init(void)
strerror(errno));
return -1;
}
- mcfg->memseg[0].phys_addr = RTE_BAD_PHYS_ADDR;
+ mcfg->memseg[0].iova_addr = RTE_BAD_PHYS_ADDR;
mcfg->memseg[0].addr = addr;
mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
mcfg->memseg[0].len = internal_config.memory;
@@ -1319,7 +1319,7 @@ rte_eal_hugepage_init(void)
if (j == RTE_MAX_MEMSEG)
break;
- mcfg->memseg[j].phys_addr = hugepage[i].physaddr;
+ mcfg->memseg[j].iova_addr = hugepage[i].physaddr;
mcfg->memseg[j].addr = hugepage[i].final_va;
mcfg->memseg[j].len = hugepage[i].size;
mcfg->memseg[j].socket_id = hugepage[i].socket_id;
@@ -1330,7 +1330,7 @@ rte_eal_hugepage_init(void)
#ifdef RTE_ARCH_PPC_64
/* Use the phy and virt address of the last page as segment
* address for IBM Power architecture */
- mcfg->memseg[j].phys_addr = hugepage[i].physaddr;
+ mcfg->memseg[j].iova_addr = hugepage[i].physaddr;
mcfg->memseg[j].addr = hugepage[i].final_va;
#endif
mcfg->memseg[j].len += mcfg->memseg[j].hugepage_sz;
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 946df7e31..c03fd713c 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -706,7 +706,7 @@ vfio_type1_dma_map(int vfio_container_fd)
dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map);
dma_map.vaddr = ms[i].addr_64;
dma_map.size = ms[i].len;
- dma_map.iova = ms[i].phys_addr;
+ dma_map.iova = ms[i].iova_addr;
dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE;
ret = ioctl(vfio_container_fd, VFIO_IOMMU_MAP_DMA, &dma_map);
@@ -792,7 +792,7 @@ vfio_spapr_dma_map(int vfio_container_fd)
dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map);
dma_map.vaddr = ms[i].addr_64;
dma_map.size = ms[i].len;
- dma_map.iova = ms[i].phys_addr;
+ dma_map.iova = ms[i].iova_addr;
dma_map.flags = VFIO_DMA_MAP_FLAG_READ |
VFIO_DMA_MAP_FLAG_WRITE;
diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
index 7960afee2..4985b3079 100644
--- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
+++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
@@ -116,7 +116,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_iovaaddr;
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_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c
index db9f48989..7f986f482 100644
--- a/lib/librte_eal/linuxapp/kni/kni_net.c
+++ b/lib/librte_eal/linuxapp/kni/kni_net.c
@@ -69,7 +69,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_iovaaddr);
return va;
}
@@ -77,7 +77,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_iovaaddr + m->data_off);
}
/* virtual address to physical address */
@@ -88,7 +88,7 @@ va2pa(void *va, struct rte_kni_mbuf *m)
pa = (void *)((unsigned long)va -
((unsigned long)m->buf_addr -
- (unsigned long)m->buf_physaddr));
+ (unsigned long)m->buf_iovaaddr));
return pa;
}
diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index 8c483c1f4..d12dde77d 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -456,7 +456,7 @@ va2pa(struct rte_mbuf *m)
{
return (void *)((unsigned long)m -
((unsigned long)m->buf_addr -
- (unsigned long)m->buf_physaddr));
+ (unsigned long)m->buf_iovaaddr));
}
static void
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 26a62b8e1..0ff3acaba 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -135,7 +135,7 @@ rte_pktmbuf_init(struct rte_mempool *mp,
/* start of buffer is after mbuf structure and priv data */
m->priv_size = priv_size;
m->buf_addr = (char *)m + mbuf_size;
- m->buf_physaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
+ m->buf_iovaaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
m->buf_len = (uint16_t)buf_len;
/* keep some headroom between start of buffer and data */
@@ -211,7 +211,7 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)
/* generic checks */
if (m->pool == NULL)
rte_panic("bad mbuf pool\n");
- if (m->buf_physaddr == 0)
+ if (m->buf_iovaaddr == 0)
rte_panic("bad phys addr\n");
if (m->buf_addr == NULL)
rte_panic("bad virt addr\n");
@@ -244,7 +244,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)
__rte_mbuf_sanity_check(m, 1);
fprintf(f, "dump mbuf at %p, phys=%"PRIx64", buf_len=%u\n",
- m, (uint64_t)m->buf_physaddr, (unsigned)m->buf_len);
+ m, (uint64_t)m->buf_iovaaddr, (unsigned)m->buf_len);
fprintf(f, " pkt_len=%"PRIu32", ol_flags=%"PRIx64", nb_segs=%u, "
"in_port=%u\n", m->pkt_len, m->ol_flags,
(unsigned)m->nb_segs, (unsigned)m->port);
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 4563b5dc3..995b86ced 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -411,7 +411,7 @@ struct rte_mbuf {
* same mbuf cacheline0 layout for 32-bit and 64-bit. This makes
* working on vector drivers easier.
*/
- iova_addr_t buf_physaddr __rte_aligned(sizeof(iova_addr_t));
+ iova_addr_t buf_iovaaddr __rte_aligned(sizeof(iova_addr_t));
/* next 8 bytes are initialised on RX descriptor rearm */
MARKER64 rearm_data;
@@ -597,7 +597,7 @@ static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp);
static inline iova_addr_t
rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
{
- return mb->buf_physaddr + mb->data_off;
+ return mb->buf_iovaaddr + mb->data_off;
}
/**
@@ -615,7 +615,7 @@ rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
static inline iova_addr_t
rte_mbuf_data_dma_addr_default(const struct rte_mbuf *mb)
{
- return mb->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ return mb->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
}
/**
@@ -806,7 +806,7 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header);
* For standard needs, prefer rte_pktmbuf_alloc().
*
* The caller can expect that the following fields of the mbuf structure
- * are initialized: buf_addr, buf_physaddr, buf_len, refcnt=1, nb_segs=1,
+ * are initialized: buf_addr, buf_iovaaddr, buf_len, refcnt=1, nb_segs=1,
* next=NULL, pool, priv_size. The other fields must be initialized
* by the caller.
*
@@ -1214,7 +1214,7 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *m)
rte_mbuf_refcnt_update(md, 1);
mi->priv_size = m->priv_size;
- mi->buf_physaddr = m->buf_physaddr;
+ mi->buf_iovaaddr = m->buf_iovaaddr;
mi->buf_addr = m->buf_addr;
mi->buf_len = m->buf_len;
@@ -1262,7 +1262,7 @@ static inline void rte_pktmbuf_detach(struct rte_mbuf *m)
m->priv_size = priv_size;
m->buf_addr = (char *)m + mbuf_size;
- m->buf_physaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
+ m->buf_iovaaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
m->buf_len = (uint16_t)buf_len;
rte_pktmbuf_reset_headroom(m);
m->data_len = 0;
@@ -1533,7 +1533,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)
* The offset into the data to calculate address from.
*/
#define rte_pktmbuf_mtophys_offset(m, o) \
- (iova_addr_t)((m)->buf_physaddr + (m)->data_off + (o))
+ (iova_addr_t)((m)->buf_iovaaddr + (m)->data_off + (o))
/**
* A macro that returns the physical address that points to the start of the
diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index a5f0eebaa..73b92b378 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -838,7 +838,7 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vring_desc *descs,
cur->data_len = cpy_len;
cur->data_off = 0;
cur->buf_addr = (void *)(uintptr_t)desc_addr;
- cur->buf_physaddr = hpa;
+ cur->buf_iovaaddr = hpa;
/*
* In zero copy mode, one mbuf can only reference data
diff --git a/test/test/test_mbuf.c b/test/test/test_mbuf.c
index 3396b4a93..326b75dca 100644
--- a/test/test/test_mbuf.c
+++ b/test/test/test_mbuf.c
@@ -907,7 +907,7 @@ test_failing_mbuf_sanity_check(struct rte_mempool *pktmbuf_pool)
}
badbuf = *buf;
- badbuf.buf_physaddr = 0;
+ badbuf.buf_iovaaddr = 0;
if (verify_mbuf_check_panics(&badbuf)) {
printf("Error with bad-physaddr mbuf test\n");
return -1;
--
2.11.0
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v1 3/4] eal/memory: rename memory translational api to _iova types
2017-08-14 15:15 [dpdk-dev] [PATCH v1 0/4] make dpdk iova aware Santosh Shukla
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 1/4] eal: rename phys_addr_t to iova_addr_t Santosh Shukla
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 2/4] eal/memory: rename buf_physaddr to buf_iovaaddr Santosh Shukla
@ 2017-08-14 15:15 ` Santosh Shukla
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 4/4] doc: remove dpdk iova aware notice Santosh Shukla
` (2 subsequent siblings)
5 siblings, 0 replies; 91+ messages in thread
From: Santosh Shukla @ 2017-08-14 15:15 UTC (permalink / raw)
To: dev; +Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal, Santosh Shukla
The following api renamed from:
rte_mempool_populate_phys()
rte_mempool_populate_phys_tab()
rte_eal_using_phys_addrs()
rte_mem_virt2phy()
rte_dump_physmem_layout()
rte_eal_get_physmem_layout()
rte_eal_get_physmem_size()
rte_malloc_virt2phy()
rte_mem_phy2mch()
To the following iova types api:
rte_mempool_populate_iova()
rte_mempool_populate_iova_tab()
rte_eal_using_iova_addrs()
rte_mem_virt2iova()
rte_dump_iovamem_layout()
rte_eal_get_iovamem_layout()
rte_eal_get_iovamem_size()
rte_malloc_virt2iova()
rte_mem_phy2iova()
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
app/proc_info/main.c | 2 +-
app/test-crypto-perf/cperf_test_vector_parsing.c | 4 ++--
app/test-crypto-perf/cperf_test_vectors.c | 6 +++---
app/test-pmd/cmdline.c | 2 +-
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 4 ++--
drivers/crypto/qat/qat_qp.c | 2 +-
drivers/net/ark/ark_ethdev_rx.c | 4 ++--
drivers/net/ark/ark_ethdev_tx.c | 4 ++--
drivers/net/bnxt/bnxt_ethdev.c | 8 ++++----
drivers/net/bnxt/bnxt_hwrm.c | 14 +++++++-------
drivers/net/bnxt/bnxt_ring.c | 4 ++--
drivers/net/bnxt/bnxt_vnic.c | 4 ++--
drivers/net/e1000/em_rxtx.c | 4 ++--
drivers/net/e1000/igb_rxtx.c | 4 ++--
drivers/net/fm10k/fm10k_ethdev.c | 4 ++--
drivers/net/i40e/i40e_ethdev.c | 2 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 8 ++++----
drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++--
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/mlx4/mlx4.c | 2 +-
drivers/net/mlx5/mlx5_mr.c | 2 +-
drivers/net/sfc/sfc.c | 2 +-
drivers/net/sfc/sfc_tso.c | 2 +-
examples/l2fwd-crypto/main.c | 2 +-
lib/librte_cryptodev/rte_cryptodev.c | 2 +-
lib/librte_eal/bsdapp/eal/eal.c | 2 +-
lib/librte_eal/bsdapp/eal/eal_memory.c | 2 +-
lib/librte_eal/bsdapp/eal/rte_eal_version.map | 12 ++++++------
lib/librte_eal/common/eal_common_memory.c | 6 +++---
lib/librte_eal/common/eal_common_memzone.c | 4 ++--
lib/librte_eal/common/eal_private.h | 2 +-
lib/librte_eal/common/include/rte_malloc.h | 2 +-
lib/librte_eal/common/include/rte_memory.h | 12 ++++++------
lib/librte_eal/common/rte_malloc.c | 2 +-
lib/librte_eal/linuxapp/eal/eal.c | 2 +-
lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
lib/librte_eal/linuxapp/eal/eal_pci.c | 4 ++--
lib/librte_eal/linuxapp/eal/eal_vfio.c | 6 +++---
lib/librte_eal/linuxapp/eal/rte_eal_version.map | 12 ++++++------
lib/librte_mempool/rte_mempool.c | 24 ++++++++++++------------
lib/librte_mempool/rte_mempool.h | 4 ++--
lib/librte_mempool/rte_mempool_version.map | 4 ++--
lib/librte_vhost/vhost_user.c | 4 ++--
test/test/commands.c | 2 +-
test/test/test_malloc.c | 4 ++--
test/test/test_memory.c | 6 +++---
test/test/test_mempool.c | 4 ++--
test/test/test_memzone.c | 10 +++++-----
50 files changed, 120 insertions(+), 120 deletions(-)
diff --git a/app/proc_info/main.c b/app/proc_info/main.c
index 8b753a2ee..16df6d4b1 100644
--- a/app/proc_info/main.c
+++ b/app/proc_info/main.c
@@ -297,7 +297,7 @@ static void
meminfo_display(void)
{
printf("----------- MEMORY_SEGMENTS -----------\n");
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
printf("--------- END_MEMORY_SEGMENTS ---------\n");
printf("------------ MEMORY_ZONES -------------\n");
diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c
index 148a60414..2e4e10a85 100644
--- a/app/test-crypto-perf/cperf_test_vector_parsing.c
+++ b/app/test-crypto-perf/cperf_test_vector_parsing.c
@@ -390,7 +390,7 @@ parse_entry(char *entry, struct cperf_test_vector *vector,
} else if (strstr(key_token, "aad")) {
rte_free(vector->aad.data);
vector->aad.data = data;
- vector->aad.phys_addr = rte_malloc_virt2phy(vector->aad.data);
+ vector->aad.phys_addr = rte_malloc_virt2iova(vector->aad.data);
if (tc_found)
vector->aad.length = data_length;
else {
@@ -405,7 +405,7 @@ parse_entry(char *entry, struct cperf_test_vector *vector,
} else if (strstr(key_token, "digest")) {
rte_free(vector->digest.data);
vector->digest.data = data;
- vector->digest.phys_addr = rte_malloc_virt2phy(
+ vector->digest.phys_addr = rte_malloc_virt2iova(
vector->digest.data);
if (tc_found)
vector->digest.length = data_length;
diff --git a/app/test-crypto-perf/cperf_test_vectors.c b/app/test-crypto-perf/cperf_test_vectors.c
index e51dcc3f1..fa911ff69 100644
--- a/app/test-crypto-perf/cperf_test_vectors.c
+++ b/app/test-crypto-perf/cperf_test_vectors.c
@@ -498,7 +498,7 @@ cperf_test_vector_get_dummy(struct cperf_options *options)
return NULL;
}
t_vec->digest.phys_addr =
- rte_malloc_virt2phy(t_vec->digest.data);
+ rte_malloc_virt2iova(t_vec->digest.data);
t_vec->digest.length = options->digest_sz;
memcpy(t_vec->digest.data, digest,
options->digest_sz);
@@ -531,7 +531,7 @@ cperf_test_vector_get_dummy(struct cperf_options *options)
return NULL;
}
memcpy(t_vec->aad.data, aad, options->aead_aad_sz);
- t_vec->aad.phys_addr = rte_malloc_virt2phy(t_vec->aad.data);
+ t_vec->aad.phys_addr = rte_malloc_virt2iova(t_vec->aad.data);
t_vec->aad.length = options->aead_aad_sz;
} else {
t_vec->aad.data = NULL;
@@ -546,7 +546,7 @@ cperf_test_vector_get_dummy(struct cperf_options *options)
return NULL;
}
t_vec->digest.phys_addr =
- rte_malloc_virt2phy(t_vec->digest.data);
+ rte_malloc_virt2iova(t_vec->digest.data);
t_vec->digest.length = options->digest_sz;
memcpy(t_vec->digest.data, digest, options->digest_sz);
t_vec->data.aead_offset = 0;
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index cd8c35850..114d5cdb6 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -8039,7 +8039,7 @@ static void cmd_dump_parsed(void *parsed_result,
struct cmd_dump_result *res = parsed_result;
if (!strcmp(res->dump, "dump_physmem"))
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
else if (!strcmp(res->dump, "dump_memzone"))
rte_memzone_dump(stdout);
else if (!strcmp(res->dump, "dump_struct_sizes"))
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 45e592770..fc4f967c4 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -201,7 +201,7 @@ int rte_fslmc_vfio_dmamap(void)
if (is_dma_done)
return 0;
- memseg = rte_eal_get_physmem_layout();
+ memseg = rte_eal_get_iovamem_layout();
if (memseg == NULL) {
FSLMC_VFIO_LOG(ERR, "Cannot get physical layout.");
return -ENODEV;
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 15e3878eb..84189c0f4 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -275,7 +275,7 @@ static void *dpaa2_mem_ptov(iova_addr_t paddr) __attribute__((unused));
/* todo - this is costly, need to write a fast coversion routine */
static void *dpaa2_mem_ptov(iova_addr_t paddr)
{
- const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
+ const struct rte_memseg *memseg = rte_eal_get_iovamem_layout();
int i;
for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
@@ -290,7 +290,7 @@ static void *dpaa2_mem_ptov(iova_addr_t paddr)
static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr) __attribute__((unused));
static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr)
{
- const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
+ const struct rte_memseg *memseg = rte_eal_get_iovamem_layout();
int i;
for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
index 5048d2144..b25419f30 100644
--- a/drivers/crypto/qat/qat_qp.c
+++ b/drivers/crypto/qat/qat_qp.c
@@ -106,7 +106,7 @@ queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size,
PMD_DRV_LOG(DEBUG, "Allocate memzone for %s, size %u on socket %u",
queue_name, queue_size, socket_id);
- ms = rte_eal_get_physmem_layout();
+ ms = rte_eal_get_iovamem_layout();
switch (ms[0].hugepage_sz) {
case(RTE_PGSIZE_2M):
memzone_flags = RTE_MEMZONE_2MB;
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 90cf304c0..eb583915b 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -100,11 +100,11 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
iova_addr_t phys_addr_q_base;
iova_addr_t phys_addr_prod_index;
- queue_base = rte_malloc_virt2phy(queue);
+ queue_base = rte_malloc_virt2iova(queue);
phys_addr_prod_index = queue_base +
offsetof(struct ark_rx_queue, prod_index);
- phys_addr_q_base = rte_malloc_virt2phy(queue->paddress_q);
+ phys_addr_q_base = rte_malloc_virt2iova(queue->paddress_q);
/* Verify HW */
if (ark_mpu_verify(queue->mpu, sizeof(iova_addr_t))) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 578cb09b8..e798e4786 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -318,8 +318,8 @@ eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
if (ark_mpu_verify(queue->mpu, sizeof(struct ark_tx_meta)))
return -1;
- queue_base = rte_malloc_virt2phy(queue);
- ring_base = rte_malloc_virt2phy(queue->meta_q);
+ queue_base = rte_malloc_virt2iova(queue);
+ ring_base = rte_malloc_virt2iova(queue->meta_q);
cons_index_addr =
queue_base + offsetof(struct ark_tx_queue, cons_index);
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index cb2ce334b..acc3236c2 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1679,8 +1679,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ "Using rte_mem_virt2iova()\n");
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map address to physical memory\n");
@@ -1714,8 +1714,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ "Using rte_mem_virt2iova()\n");
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map address to physical memory\n");
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index e710e6367..3f420802c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -270,7 +270,7 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp,
if (!(mask & HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN))
mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY;
req.vlan_tag_tbl_addr = rte_cpu_to_le_16(
- rte_mem_virt2phy(vlan_table));
+ rte_mem_virt2iova(vlan_table));
req.num_vlan_tags = rte_cpu_to_le_32((uint32_t)vlan_count);
}
req.mask = rte_cpu_to_le_32(HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST |
@@ -311,7 +311,7 @@ int bnxt_hwrm_cfa_vlan_antispoof_cfg(struct bnxt *bp, uint16_t fid,
req.fid = rte_cpu_to_le_16(fid);
req.vlan_tag_mask_tbl_addr =
- rte_cpu_to_le_64(rte_mem_virt2phy(vlan_table));
+ rte_cpu_to_le_64(rte_mem_virt2iova(vlan_table));
req.num_vlan_entries = rte_cpu_to_le_32((uint32_t)vlan_count);
rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
@@ -612,7 +612,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
}
rte_mem_lock_page(bp->hwrm_cmd_resp_addr);
bp->hwrm_cmd_resp_dma_addr =
- rte_mem_virt2phy(bp->hwrm_cmd_resp_addr);
+ rte_mem_virt2iova(bp->hwrm_cmd_resp_addr);
if (bp->hwrm_cmd_resp_dma_addr == 0) {
RTE_LOG(ERR, PMD,
"Unable to map response buffer to physical memory.\n");
@@ -638,7 +638,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
}
rte_mem_lock_page(bp->hwrm_short_cmd_req_addr);
bp->hwrm_short_cmd_req_dma_addr =
- rte_mem_virt2phy(bp->hwrm_short_cmd_req_addr);
+ rte_mem_virt2iova(bp->hwrm_short_cmd_req_addr);
if (bp->hwrm_short_cmd_req_dma_addr == 0) {
rte_free(bp->hwrm_short_cmd_req_addr);
RTE_LOG(ERR, PMD,
@@ -1683,7 +1683,7 @@ int bnxt_alloc_hwrm_resources(struct bnxt *bp)
if (bp->hwrm_cmd_resp_addr == NULL)
return -ENOMEM;
bp->hwrm_cmd_resp_dma_addr =
- rte_mem_virt2phy(bp->hwrm_cmd_resp_addr);
+ rte_mem_virt2iova(bp->hwrm_cmd_resp_addr);
if (bp->hwrm_cmd_resp_dma_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map response address to physical memory\n");
@@ -2489,7 +2489,7 @@ int bnxt_hwrm_func_buf_rgtr(struct bnxt *bp)
page_getenum(bp->pf.active_vfs * HWRM_MAX_REQ_LEN));
req.req_buf_len = rte_cpu_to_le_16(HWRM_MAX_REQ_LEN);
req.req_buf_page_addr[0] =
- rte_cpu_to_le_64(rte_mem_virt2phy(bp->pf.vf_req_buf));
+ rte_cpu_to_le_64(rte_mem_virt2iova(bp->pf.vf_req_buf));
if (req.req_buf_page_addr[0] == 0) {
RTE_LOG(ERR, PMD,
"unable to map buffer address to physical memory\n");
@@ -2861,7 +2861,7 @@ static int bnxt_hwrm_func_vf_vnic_query(struct bnxt *bp, uint16_t vf,
req.vf_id = rte_cpu_to_le_16(bp->pf.first_vf_id + vf);
req.max_vnic_id_cnt = rte_cpu_to_le_32(bp->pf.total_vnics);
- req.vnic_id_tbl_addr = rte_cpu_to_le_64(rte_mem_virt2phy(vnic_ids));
+ req.vnic_id_tbl_addr = rte_cpu_to_le_64(rte_mem_virt2iova(vnic_ids));
if (req.vnic_id_tbl_addr == 0) {
RTE_LOG(ERR, PMD,
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 8e83e4704..1e6db4495 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -177,10 +177,10 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
+ "Using rte_mem_virt2iova()\n");
for (sz = 0; sz < total_alloc_len; sz += getpagesize())
rte_mem_lock_page(((char *)mz->addr) + sz);
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map ring address to physical memory\n");
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 90809f0f5..9002f6b30 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -196,8 +196,8 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ "Using rte_mem_virt2iova()\n");
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map vnic address to physical memory\n");
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index 31819c5bd..e8316bf97 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -1289,7 +1289,7 @@ eth_em_tx_queue_setup(struct rte_eth_dev *dev,
txq->port_id = dev->data->port_id;
txq->tdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_TDT(queue_idx));
- txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+ txq->tx_ring_phys_addr = rte_mem_phy2iova(tz->memseg_id, tz->phys_addr);
txq->tx_ring = (struct e1000_data_desc *) tz->addr;
PMD_INIT_LOG(DEBUG, "sw_ring=%p hw_ring=%p dma_addr=0x%"PRIx64,
@@ -1416,7 +1416,7 @@ eth_em_rx_queue_setup(struct rte_eth_dev *dev,
rxq->rdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDT(queue_idx));
rxq->rdh_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDH(queue_idx));
- rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+ rxq->rx_ring_phys_addr = rte_mem_phy2iova(rz->memseg_id, rz->phys_addr);
rxq->rx_ring = (struct e1000_rx_desc *) rz->addr;
PMD_INIT_LOG(DEBUG, "sw_ring=%p hw_ring=%p dma_addr=0x%"PRIx64,
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 1c80a2a1b..02cc0a505 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -1530,7 +1530,7 @@ eth_igb_tx_queue_setup(struct rte_eth_dev *dev,
txq->port_id = dev->data->port_id;
txq->tdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_TDT(txq->reg_idx));
- txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+ txq->tx_ring_phys_addr = rte_mem_phy2iova(tz->memseg_id, tz->phys_addr);
txq->tx_ring = (union e1000_adv_tx_desc *) tz->addr;
/* Allocate software ring */
@@ -1667,7 +1667,7 @@ eth_igb_rx_queue_setup(struct rte_eth_dev *dev,
}
rxq->rdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDT(rxq->reg_idx));
rxq->rdh_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDH(rxq->reg_idx));
- rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+ rxq->rx_ring_phys_addr = rte_mem_phy2iova(rz->memseg_id, rz->phys_addr);
rxq->rx_ring = (union e1000_adv_rx_desc *) rz->addr;
/* Allocate software ring. */
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index e60d3a365..f5a0247ec 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1887,7 +1887,7 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
return -ENOMEM;
}
q->hw_ring = mz->addr;
- q->hw_ring_phys_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+ q->hw_ring_phys_addr = rte_mem_phy2iova(mz->memseg_id, mz->phys_addr);
/* Check if number of descs satisfied Vector requirement */
if (!rte_is_power_of_2(nb_desc)) {
@@ -2047,7 +2047,7 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
return -ENOMEM;
}
q->hw_ring = mz->addr;
- q->hw_ring_phys_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+ q->hw_ring_phys_addr = rte_mem_phy2iova(mz->memseg_id, mz->phys_addr);
/*
* allocate memory for the RS bit tracker. Enough slots to hold the
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5f26e24a3..96339fdc6 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3741,7 +3741,7 @@ i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw,
mem->size = size;
mem->va = mz->addr;
- mem->pa = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+ mem->pa = rte_mem_phy2iova(mz->memseg_id, mz->phys_addr);
mem->zone = (const void *)mz;
PMD_DRV_LOG(DEBUG,
"memzone %s allocated with physical address: %"PRIu64,
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 8013add43..9fd728dfa 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -249,7 +249,7 @@ i40e_fdir_setup(struct i40e_pf *pf)
goto fail_mem;
}
pf->fdir.prg_pkt = mz->addr;
- pf->fdir.dma_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+ pf->fdir.dma_addr = rte_mem_phy2iova(mz->memseg_id, mz->phys_addr);
pf->fdir.match_counter_index = I40E_COUNTER_INDEX_FDIR(hw->pf_id);
PMD_DRV_LOG(INFO, "FDIR setup successfully, with programming queue %u.",
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index d42c23c05..f3269f981 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -1822,7 +1822,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
/* Zero all the descriptors in the ring. */
memset(rz->addr, 0, ring_size);
- rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+ rxq->rx_ring_phys_addr = rte_mem_phy2iova(rz->memseg_id, rz->phys_addr);
rxq->rx_ring = (union i40e_rx_desc *)rz->addr;
len = (uint16_t)(nb_desc + RTE_PMD_I40E_RX_MAX_BURST);
@@ -2159,7 +2159,7 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
txq->vsi = vsi;
txq->tx_deferred_start = tx_conf->tx_deferred_start;
- txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+ txq->tx_ring_phys_addr = rte_mem_phy2iova(tz->memseg_id, tz->phys_addr);
txq->tx_ring = (struct i40e_tx_desc *)tz->addr;
/* Allocate software ring */
@@ -2675,7 +2675,7 @@ i40e_fdir_setup_tx_resources(struct i40e_pf *pf)
txq->reg_idx = pf->fdir.fdir_vsi->base_queue;
txq->vsi = pf->fdir.fdir_vsi;
- txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+ txq->tx_ring_phys_addr = rte_mem_phy2iova(tz->memseg_id, tz->phys_addr);
txq->tx_ring = (struct i40e_tx_desc *)tz->addr;
/*
* don't need to allocate software ring and reset for the fdir
@@ -2731,7 +2731,7 @@ i40e_fdir_setup_rx_resources(struct i40e_pf *pf)
rxq->reg_idx = pf->fdir.fdir_vsi->base_queue;
rxq->vsi = pf->fdir.fdir_vsi;
- rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+ rxq->rx_ring_phys_addr = rte_mem_phy2iova(rz->memseg_id, rz->phys_addr);
rxq->rx_ring = (union i40e_rx_desc *)rz->addr;
/*
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 64bff2584..ac6907b8e 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2548,7 +2548,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
else
txq->tdt_reg_addr = IXGBE_PCI_REG_ADDR(hw, IXGBE_TDT(txq->reg_idx));
- txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+ txq->tx_ring_phys_addr = rte_mem_phy2iova(tz->memseg_id, tz->phys_addr);
txq->tx_ring = (union ixgbe_adv_tx_desc *) tz->addr;
/* Allocate software ring */
@@ -2850,7 +2850,7 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
IXGBE_PCI_REG_ADDR(hw, IXGBE_RDH(rxq->reg_idx));
}
- rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+ rxq->rx_ring_phys_addr = rte_mem_phy2iova(rz->memseg_id, rz->phys_addr);
rxq->rx_ring = (union ixgbe_adv_rx_desc *) rz->addr;
/*
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 5156ac08d..67179eaf5 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -1790,7 +1790,7 @@ lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
m = m->next;
}
- phyaddr = rte_mem_virt2phy(g->sg);
+ phyaddr = rte_mem_virt2iova(g->sg);
if (phyaddr == RTE_BAD_PHYS_ADDR) {
PMD_TX_LOG(lio_dev, ERR, "bad phys addr\n");
goto xmit_failed;
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 055de49a3..8b8216bb3 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -1206,7 +1206,7 @@ static struct ibv_mr *mlx4_mp2mr(struct ibv_pd *, struct rte_mempool *)
static struct ibv_mr *
mlx4_mp2mr(struct ibv_pd *pd, struct rte_mempool *mp)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
uintptr_t start;
uintptr_t end;
unsigned int i;
diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c
index 287335179..530aa4911 100644
--- a/drivers/net/mlx5/mlx5_mr.c
+++ b/drivers/net/mlx5/mlx5_mr.c
@@ -131,7 +131,7 @@ static int mlx5_check_mempool(struct rte_mempool *mp, uintptr_t *start,
struct ibv_mr *
mlx5_mp2mr(struct ibv_pd *pd, struct rte_mempool *mp)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
uintptr_t start;
uintptr_t end;
unsigned int i;
diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index 6cecfc00a..f75f1eb45 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -61,7 +61,7 @@ sfc_dma_alloc(const struct sfc_adapter *sa, const char *name, uint16_t id,
return ENOMEM;
}
- esmp->esm_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+ esmp->esm_addr = rte_mem_phy2iova(mz->memseg_id, mz->phys_addr);
if (esmp->esm_addr == RTE_BAD_PHYS_ADDR) {
(void)rte_memzone_free(mz);
return EFAULT;
diff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c
index fb79d7491..ad100676e 100644
--- a/drivers/net/sfc/sfc_tso.c
+++ b/drivers/net/sfc/sfc_tso.c
@@ -155,7 +155,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
header_len);
tsoh = txq->sw_ring[idx & txq->ptr_mask].tsoh;
- header_paddr = rte_malloc_virt2phy((void *)tsoh);
+ header_paddr = rte_malloc_virt2iova((void *)tsoh);
} else {
if (m->data_len == header_len) {
*in_off = 0;
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 985baaf51..49db9c3c0 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2461,7 +2461,7 @@ reserve_key_memory(struct l2fwd_crypto_options *options)
options->aad.data = rte_malloc("aad", MAX_KEY_SIZE, 0);
if (options->aad.data == NULL)
rte_exit(EXIT_FAILURE, "Failed to allocate memory for AAD");
- options->aad.phys_addr = rte_malloc_virt2phy(options->aad.data);
+ options->aad.phys_addr = rte_malloc_virt2iova(options->aad.data);
}
int
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 327d7e846..a1ffc8c8c 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -1271,7 +1271,7 @@ rte_crypto_op_init(struct rte_mempool *mempool,
__rte_crypto_op_reset(op, type);
- op->phys_addr = rte_mem_virt2phy(_op_data);
+ op->phys_addr = rte_mem_virt2iova(_op_data);
op->mempool = mempool;
}
diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index 5fa598842..1068995f2 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -441,7 +441,7 @@ eal_check_mem_on_local_socket(void)
socket_id = rte_lcore_to_socket_id(rte_config.master_lcore);
- ms = rte_eal_get_physmem_layout();
+ ms = rte_eal_get_iovamem_layout();
for (i = 0; i < RTE_MAX_MEMSEG; i++)
if (ms[i].socket_id == socket_id &&
diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index 10c2e121f..b16f4fc66 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -51,7 +51,7 @@
* Get physical address of any mapped virtual address in the current process.
*/
iova_addr_t
-rte_mem_virt2phy(const void *virtaddr)
+rte_mem_virt2iova(const void *virtaddr)
{
/* XXX not implemented. This function is only used by
* rte_mempool_virt2phy() when hugepages are disabled. */
diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
index aac6fd776..6df11dd3f 100644
--- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map
+++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
@@ -14,7 +14,7 @@ DPDK_2.0 {
rte_cpu_get_flag_enabled;
rte_cycles_vmware_tsc_map;
rte_delay_us;
- rte_dump_physmem_layout;
+ rte_dump_iovamem_layout;
rte_dump_registers;
rte_dump_stack;
rte_dump_tailq;
@@ -25,8 +25,8 @@ DPDK_2.0 {
rte_eal_devargs_type_count;
rte_eal_get_configuration;
rte_eal_get_lcore_state;
- rte_eal_get_physmem_layout;
- rte_eal_get_physmem_size;
+ rte_eal_get_iovamem_layout;
+ rte_eal_get_iovamem_size;
rte_eal_has_hugepages;
rte_eal_hpet_init;
rte_eal_init;
@@ -62,10 +62,10 @@ DPDK_2.0 {
rte_malloc_set_limit;
rte_malloc_socket;
rte_malloc_validate;
- rte_malloc_virt2phy;
+ rte_malloc_virt2iova;
rte_mem_lock_page;
- rte_mem_phy2mch;
- rte_mem_virt2phy;
+ rte_mem_phy2iova;
+ rte_mem_virt2iova;
rte_memdump;
rte_memory_get_nchannel;
rte_memory_get_nrank;
diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 5ed83d20a..44bc072bf 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -55,7 +55,7 @@
* memory. The last element of the table contains a NULL address.
*/
const struct rte_memseg *
-rte_eal_get_physmem_layout(void)
+rte_eal_get_iovamem_layout(void)
{
return rte_eal_get_configuration()->mem_config->memseg;
}
@@ -63,7 +63,7 @@ rte_eal_get_physmem_layout(void)
/* get the total size of memory */
uint64_t
-rte_eal_get_physmem_size(void)
+rte_eal_get_iovamem_size(void)
{
const struct rte_mem_config *mcfg;
unsigned i = 0;
@@ -84,7 +84,7 @@ rte_eal_get_physmem_size(void)
/* Dump the physical memory layout on console */
void
-rte_dump_physmem_layout(FILE *f)
+rte_dump_iovamem_layout(FILE *f)
{
const struct rte_mem_config *mcfg;
unsigned i = 0;
diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c
index 3026e36b8..86457eaf0 100644
--- a/lib/librte_eal/common/eal_common_memzone.c
+++ b/lib/librte_eal/common/eal_common_memzone.c
@@ -251,7 +251,7 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,
mcfg->memzone_cnt++;
snprintf(mz->name, sizeof(mz->name), "%s", name);
- mz->phys_addr = rte_malloc_virt2phy(mz_addr);
+ mz->phys_addr = rte_malloc_virt2iova(mz_addr);
mz->addr = mz_addr;
mz->len = (requested_len == 0 ? elem->size : requested_len);
mz->hugepage_sz = elem->ms->hugepage_sz;
@@ -419,7 +419,7 @@ rte_eal_memzone_init(void)
if (rte_eal_process_type() == RTE_PROC_SECONDARY)
return 0;
- memseg = rte_eal_get_physmem_layout();
+ memseg = rte_eal_get_iovamem_layout();
if (memseg == NULL) {
RTE_LOG(ERR, EAL, "%s(): Cannot get physical layout\n", __func__);
return -1;
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index 597d82e44..a98dd69d3 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -341,7 +341,7 @@ int rte_eal_hugepage_attach(void);
* addresses are obtainable. It is only possible to get
* physical addresses when running as a privileged user.
*/
-bool rte_eal_using_phys_addrs(void);
+bool rte_eal_using_iova_addrs(void);
/**
* Find a bus capable of identifying a device.
diff --git a/lib/librte_eal/common/include/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h
index 491b479b1..b1a214c9d 100644
--- a/lib/librte_eal/common/include/rte_malloc.h
+++ b/lib/librte_eal/common/include/rte_malloc.h
@@ -333,7 +333,7 @@ rte_malloc_set_limit(const char *type, size_t max);
* otherwise return physical address of the buffer
*/
iova_addr_t
-rte_malloc_virt2phy(const void *addr);
+rte_malloc_virt2iova(const void *addr);
#ifdef __cplusplus
}
diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index fc0fdf740..c5f1f40dc 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -142,7 +142,7 @@ int rte_mem_lock_page(const void *virt);
* @return
* The physical address or RTE_BAD_PHYS_ADDR on error.
*/
-iova_addr_t rte_mem_virt2phy(const void *virt);
+iova_addr_t rte_mem_virt2iova(const void *virt);
/**
* Get the layout of the available physical memory.
@@ -159,7 +159,7 @@ iova_addr_t rte_mem_virt2phy(const void *virt);
* - On error, return NULL. This should not happen since it is a fatal
* error that will probably cause the entire system to panic.
*/
-const struct rte_memseg *rte_eal_get_physmem_layout(void);
+const struct rte_memseg *rte_eal_get_iovamem_layout(void);
/**
* Dump the physical memory layout to a file.
@@ -167,7 +167,7 @@ const struct rte_memseg *rte_eal_get_physmem_layout(void);
* @param f
* A pointer to a file for output
*/
-void rte_dump_physmem_layout(FILE *f);
+void rte_dump_iovamem_layout(FILE *f);
/**
* Get the total amount of available physical memory.
@@ -175,7 +175,7 @@ void rte_dump_physmem_layout(FILE *f);
* @return
* The total amount of available physical memory in bytes.
*/
-uint64_t rte_eal_get_physmem_size(void);
+uint64_t rte_eal_get_iovamem_size(void);
/**
* Get the number of memory channels.
@@ -216,7 +216,7 @@ iova_addr_t rte_xen_mem_phy2mch(int32_t, const iova_addr_t);
* The physical address or RTE_BAD_PHYS_ADDR on error.
*/
static inline iova_addr_t
-rte_mem_phy2mch(int32_t memseg_id, const iova_addr_t phy_addr)
+rte_mem_phy2iova(int32_t memseg_id, const iova_addr_t phy_addr)
{
if (rte_xen_dom0_supported())
return rte_xen_mem_phy2mch(memseg_id, phy_addr);
@@ -252,7 +252,7 @@ static inline int rte_xen_dom0_supported(void)
}
static inline iova_addr_t
-rte_mem_phy2mch(int32_t memseg_id __rte_unused, const iova_addr_t phy_addr)
+rte_mem_phy2iova(int32_t memseg_id __rte_unused, const iova_addr_t phy_addr)
{
return phy_addr;
}
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index d03a5348a..cc0c6c935 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -249,7 +249,7 @@ rte_malloc_set_limit(__rte_unused const char *type,
* Return the physical address of a virtual address obtained through rte_malloc
*/
iova_addr_t
-rte_malloc_virt2phy(const void *addr)
+rte_malloc_virt2iova(const void *addr)
{
const struct malloc_elem *elem = malloc_elem_from_data(addr);
if (elem == NULL)
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 48f12f44c..0b7419442 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -671,7 +671,7 @@ eal_check_mem_on_local_socket(void)
socket_id = rte_lcore_to_socket_id(rte_config.master_lcore);
- ms = rte_eal_get_physmem_layout();
+ ms = rte_eal_get_iovamem_layout();
for (i = 0; i < RTE_MAX_MEMSEG; i++)
if (ms[i].socket_id == socket_id &&
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 5d9702c72..30d55d79f 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -117,7 +117,7 @@ test_phys_addrs_available(void)
return;
}
- physaddr = rte_mem_virt2phy(&tmp);
+ physaddr = rte_mem_virt2iova(&tmp);
if (physaddr == RTE_BAD_PHYS_ADDR) {
RTE_LOG(ERR, EAL,
"Cannot obtain physical addresses: %s. "
@@ -131,7 +131,7 @@ test_phys_addrs_available(void)
* Get physical address of any mapped virtual address in the current process.
*/
iova_addr_t
-rte_mem_virt2phy(const void *virtaddr)
+rte_mem_virt2iova(const void *virtaddr)
{
int fd, retval;
uint64_t page, physaddr;
@@ -222,7 +222,7 @@ find_physaddrs(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
iova_addr_t addr;
for (i = 0; i < hpi->num_pages[0]; i++) {
- addr = rte_mem_virt2phy(hugepg_tbl[i].orig_va);
+ addr = rte_mem_virt2iova(hugepg_tbl[i].orig_va);
if (addr == RTE_BAD_PHYS_ADDR)
return -1;
hugepg_tbl[i].physaddr = addr;
@@ -1543,7 +1543,7 @@ rte_eal_hugepage_attach(void)
}
bool
-rte_eal_using_phys_addrs(void)
+rte_eal_using_iova_addrs(void)
{
return phys_addrs_available;
}
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 8951ce742..ee4a60bca 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -102,7 +102,7 @@ rte_pci_map_device(struct rte_pci_device *dev)
break;
case RTE_KDRV_IGB_UIO:
case RTE_KDRV_UIO_GENERIC:
- if (rte_eal_using_phys_addrs()) {
+ if (rte_eal_using_iova_addrs()) {
/* map resources for devices that use uio */
ret = pci_uio_map_resource(dev);
}
@@ -144,7 +144,7 @@ rte_pci_unmap_device(struct rte_pci_device *dev)
void *
pci_find_max_end_va(void)
{
- const struct rte_memseg *seg = rte_eal_get_physmem_layout();
+ const struct rte_memseg *seg = rte_eal_get_iovamem_layout();
const struct rte_memseg *last = seg;
unsigned i = 0;
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index c03fd713c..e2a6d3006 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -692,7 +692,7 @@ vfio_get_group_no(const char *sysfs_base,
static int
vfio_type1_dma_map(int vfio_container_fd)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
int i, ret;
/* map all DPDK segments for DMA. use 1:1 PA to IOVA mapping */
@@ -725,7 +725,7 @@ vfio_type1_dma_map(int vfio_container_fd)
static int
vfio_spapr_dma_map(int vfio_container_fd)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
int i, ret;
struct vfio_iommu_spapr_register_memory reg = {
@@ -760,7 +760,7 @@ vfio_spapr_dma_map(int vfio_container_fd)
}
/* calculate window size based on number of hugepages configured */
- create.window_size = rte_eal_get_physmem_size();
+ create.window_size = rte_eal_get_iovamem_size();
create.page_shift = __builtin_ctzll(ms->hugepage_sz);
create.levels = 2;
diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
index 3a8f15406..e2f50e5b1 100644
--- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map
+++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
@@ -14,7 +14,7 @@ DPDK_2.0 {
rte_cpu_get_flag_enabled;
rte_cycles_vmware_tsc_map;
rte_delay_us;
- rte_dump_physmem_layout;
+ rte_dump_iovamem_layout;
rte_dump_registers;
rte_dump_stack;
rte_dump_tailq;
@@ -25,8 +25,8 @@ DPDK_2.0 {
rte_eal_devargs_type_count;
rte_eal_get_configuration;
rte_eal_get_lcore_state;
- rte_eal_get_physmem_layout;
- rte_eal_get_physmem_size;
+ rte_eal_get_iovamem_layout;
+ rte_eal_get_iovamem_size;
rte_eal_has_hugepages;
rte_eal_hpet_init;
rte_eal_init;
@@ -62,10 +62,10 @@ DPDK_2.0 {
rte_malloc_set_limit;
rte_malloc_socket;
rte_malloc_validate;
- rte_malloc_virt2phy;
+ rte_malloc_virt2iova;
rte_mem_lock_page;
- rte_mem_phy2mch;
- rte_mem_virt2phy;
+ rte_mem_phy2iova;
+ rte_mem_virt2iova;
rte_memdump;
rte_memory_get_nchannel;
rte_memory_get_nrank;
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index b4f14cf61..39335e286 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -344,7 +344,7 @@ rte_mempool_free_memchunks(struct rte_mempool *mp)
* on error.
*/
int
-rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
+rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,
iova_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque)
{
@@ -408,7 +408,7 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
* number of objects added, or a negative value on error.
*/
int
-rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
+rte_mempool_populate_iova_tab(struct rte_mempool *mp, char *vaddr,
const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque)
{
@@ -421,7 +421,7 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
return -EEXIST;
if (mp->flags & MEMPOOL_F_NO_PHYS_CONTIG)
- return rte_mempool_populate_phys(mp, vaddr, RTE_BAD_PHYS_ADDR,
+ return rte_mempool_populate_iova(mp, vaddr, RTE_BAD_PHYS_ADDR,
pg_num * pg_sz, free_cb, opaque);
for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {
@@ -431,7 +431,7 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
paddr[i + n - 1] + pg_sz == paddr[i + n]; n++)
;
- ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,
+ ret = rte_mempool_populate_iova(mp, vaddr + i * pg_sz,
paddr[i], n * pg_sz, free_cb, opaque);
if (ret < 0) {
rte_mempool_free_memchunks(mp);
@@ -466,15 +466,15 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
return -EINVAL;
if (mp->flags & MEMPOOL_F_NO_PHYS_CONTIG)
- return rte_mempool_populate_phys(mp, addr, RTE_BAD_PHYS_ADDR,
+ return rte_mempool_populate_iova(mp, addr, RTE_BAD_PHYS_ADDR,
len, free_cb, opaque);
for (off = 0; off + pg_sz <= len &&
mp->populated_size < mp->size; off += phys_len) {
- paddr = rte_mem_virt2phy(addr + off);
+ paddr = rte_mem_virt2iova(addr + off);
/* required for xen_dom0 to get the machine address */
- paddr = rte_mem_phy2mch(-1, paddr);
+ paddr = rte_mem_phy2iova(-1, paddr);
if (paddr == RTE_BAD_PHYS_ADDR && rte_eal_has_hugepages()) {
ret = -EINVAL;
@@ -485,14 +485,14 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
for (phys_len = pg_sz; off + phys_len < len; phys_len += pg_sz) {
iova_addr_t paddr_tmp;
- paddr_tmp = rte_mem_virt2phy(addr + off + phys_len);
- paddr_tmp = rte_mem_phy2mch(-1, paddr_tmp);
+ paddr_tmp = rte_mem_virt2iova(addr + off + phys_len);
+ paddr_tmp = rte_mem_phy2iova(-1, paddr_tmp);
if (paddr_tmp != paddr + phys_len)
break;
}
- ret = rte_mempool_populate_phys(mp, addr + off, paddr,
+ ret = rte_mempool_populate_iova(mp, addr + off, paddr,
phys_len, free_cb, opaque);
if (ret < 0)
goto fail;
@@ -569,7 +569,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)
paddr = mz->phys_addr;
if (rte_eal_has_hugepages() && !rte_xen_dom0_supported())
- ret = rte_mempool_populate_phys(mp, mz->addr,
+ ret = rte_mempool_populate_iova(mp, mz->addr,
paddr, mz->len,
rte_mempool_memchunk_mz_free,
(void *)(uintptr_t)mz);
@@ -954,7 +954,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
if (mp_init)
mp_init(mp, mp_init_arg);
- ret = rte_mempool_populate_phys_tab(mp, vaddr, paddr, pg_num, pg_shift,
+ ret = rte_mempool_populate_iova_tab(mp, vaddr, paddr, pg_num, pg_shift,
NULL, NULL);
if (ret < 0 || ret != (int)mp->size)
goto fail;
diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index 1bcb6ebd7..13c16eee0 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -819,7 +819,7 @@ rte_mempool_free(struct rte_mempool *mp);
* On error, the chunk is not added in the memory list of the
* mempool and a negative errno is returned.
*/
-int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
+int rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,
iova_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque);
@@ -850,7 +850,7 @@ int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
* On error, the chunks are not added in the memory list of the
* mempool and a negative errno is returned.
*/
-int rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
+int rte_mempool_populate_iova_tab(struct rte_mempool *mp, char *vaddr,
const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque);
diff --git a/lib/librte_mempool/rte_mempool_version.map b/lib/librte_mempool/rte_mempool_version.map
index f9c079447..2904c299f 100644
--- a/lib/librte_mempool/rte_mempool_version.map
+++ b/lib/librte_mempool/rte_mempool_version.map
@@ -34,8 +34,8 @@ DPDK_16.07 {
rte_mempool_ops_table;
rte_mempool_populate_anon;
rte_mempool_populate_default;
- rte_mempool_populate_phys;
- rte_mempool_populate_phys_tab;
+ rte_mempool_populate_iova;
+ rte_mempool_populate_iova_tab;
rte_mempool_populate_virt;
rte_mempool_register_ops;
rte_mempool_set_ops_byname;
diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index ad2e8d380..5c546ba33 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -453,7 +453,7 @@ add_guest_pages(struct virtio_net *dev, struct rte_vhost_mem_region *reg,
uint64_t host_phys_addr;
uint64_t size;
- host_phys_addr = rte_mem_virt2phy((void *)(uintptr_t)host_user_addr);
+ host_phys_addr = rte_mem_virt2iova((void *)(uintptr_t)host_user_addr);
size = page_size - (guest_phys_addr & (page_size - 1));
size = RTE_MIN(size, reg_size);
@@ -464,7 +464,7 @@ add_guest_pages(struct virtio_net *dev, struct rte_vhost_mem_region *reg,
while (reg_size > 0) {
size = RTE_MIN(reg_size, page_size);
- host_phys_addr = rte_mem_virt2phy((void *)(uintptr_t)
+ host_phys_addr = rte_mem_virt2iova((void *)(uintptr_t)
host_user_addr);
add_one_guest_page(dev, guest_phys_addr, host_phys_addr, size);
diff --git a/test/test/commands.c b/test/test/commands.c
index 4097a3310..9f5028d41 100644
--- a/test/test/commands.c
+++ b/test/test/commands.c
@@ -147,7 +147,7 @@ static void cmd_dump_parsed(void *parsed_result,
struct cmd_dump_result *res = parsed_result;
if (!strcmp(res->dump, "dump_physmem"))
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
else if (!strcmp(res->dump, "dump_memzone"))
rte_memzone_dump(stdout);
else if (!strcmp(res->dump, "dump_struct_sizes"))
diff --git a/test/test/test_malloc.c b/test/test/test_malloc.c
index 013fd4407..fc995596e 100644
--- a/test/test/test_malloc.c
+++ b/test/test/test_malloc.c
@@ -741,7 +741,7 @@ test_malloc_bad_params(void)
static int
is_mem_on_socket(int32_t socket)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
unsigned i;
for (i = 0; i < RTE_MAX_MEMSEG; i++) {
@@ -758,7 +758,7 @@ is_mem_on_socket(int32_t socket)
static int32_t
addr_to_socket(void * addr)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
unsigned i;
for (i = 0; i < RTE_MAX_MEMSEG; i++) {
diff --git a/test/test/test_memory.c b/test/test/test_memory.c
index 921bdc883..9ab0f52fd 100644
--- a/test/test/test_memory.c
+++ b/test/test/test_memory.c
@@ -64,17 +64,17 @@ test_memory(void)
* that at least one line is dumped
*/
printf("Dump memory layout\n");
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
/* check that memory size is != 0 */
- s = rte_eal_get_physmem_size();
+ s = rte_eal_get_iovamem_size();
if (s == 0) {
printf("No memory detected\n");
return -1;
}
/* try to read memory (should not segfault) */
- mem = rte_eal_get_physmem_layout();
+ mem = rte_eal_get_iovamem_layout();
for (i = 0; i < RTE_MAX_MEMSEG && mem[i].addr != NULL ; i++) {
/* check memory */
diff --git a/test/test/test_mempool.c b/test/test/test_mempool.c
index 0a4423954..b4c46131c 100644
--- a/test/test/test_mempool.c
+++ b/test/test/test_mempool.c
@@ -145,9 +145,9 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache)
MEMPOOL_HEADER_SIZE(mp, mp->cache_size))
GOTO_ERR(ret, out);
-#ifndef RTE_EXEC_ENV_BSDAPP /* rte_mem_virt2phy() not supported on bsd */
+#ifndef RTE_EXEC_ENV_BSDAPP /* rte_mem_virt2iova() not supported on bsd */
printf("get physical address of an object\n");
- if (rte_mempool_virt2phy(mp, obj) != rte_mem_virt2phy(obj))
+ if (rte_mempool_virt2phy(mp, obj) != rte_mem_virt2iova(obj))
GOTO_ERR(ret, out);
#endif
diff --git a/test/test/test_memzone.c b/test/test/test_memzone.c
index 0afb159e9..177bcb73e 100644
--- a/test/test/test_memzone.c
+++ b/test/test/test_memzone.c
@@ -139,7 +139,7 @@ test_memzone_reserve_flags(void)
int hugepage_16GB_avail = 0;
const size_t size = 100;
int i = 0;
- ms = rte_eal_get_physmem_layout();
+ ms = rte_eal_get_iovamem_layout();
for (i = 0; i < RTE_MAX_MEMSEG; i++) {
if (ms[i].hugepage_sz == RTE_PGSIZE_2M)
hugepage_2MB_avail = 1;
@@ -422,7 +422,7 @@ test_memzone_reserve_max(void)
if (mz == NULL){
printf("Failed to reserve a big chunk of memory - %s\n",
rte_strerror(rte_errno));
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
rte_memzone_dump(stdout);
return -1;
}
@@ -430,7 +430,7 @@ test_memzone_reserve_max(void)
if (mz->len != maxlen) {
printf("Memzone reserve with 0 size did not return bigest block\n");
printf("Expected size = %zu, actual size = %zu\n", maxlen, mz->len);
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
rte_memzone_dump(stdout);
return -1;
}
@@ -459,7 +459,7 @@ test_memzone_reserve_max_aligned(void)
if (mz == NULL){
printf("Failed to reserve a big chunk of memory - %s\n",
rte_strerror(rte_errno));
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
rte_memzone_dump(stdout);
return -1;
}
@@ -469,7 +469,7 @@ test_memzone_reserve_max_aligned(void)
" bigest block\n", align);
printf("Expected size = %zu, actual size = %zu\n",
maxlen, mz->len);
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
rte_memzone_dump(stdout);
return -1;
}
--
2.11.0
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v1 4/4] doc: remove dpdk iova aware notice
2017-08-14 15:15 [dpdk-dev] [PATCH v1 0/4] make dpdk iova aware Santosh Shukla
` (2 preceding siblings ...)
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 3/4] eal/memory: rename memory translational api to _iova types Santosh Shukla
@ 2017-08-14 15:15 ` Santosh Shukla
2017-09-18 18:44 ` Mcnamara, John
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Santosh Shukla
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
5 siblings, 1 reply; 91+ messages in thread
From: Santosh Shukla @ 2017-08-14 15:15 UTC (permalink / raw)
To: dev; +Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal, Santosh Shukla
Removed dpdk iova aware ABI deprecation notice,
and updated ABI change details in release_17.11.rst.
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
doc/guides/rel_notes/deprecation.rst | 7 -------
doc/guides/rel_notes/release_17_11.rst | 27 +++++++++++++++++++++++++++
2 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 3362f3350..6482363bf 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -32,13 +32,6 @@ Deprecation Notices
* eal: the support of Xen dom0 will be removed from EAL in 17.11; and with
that, drivers/net/xenvirt and examples/vhost_xen will also be removed.
-* eal: An ABI change is planned for 17.11 to make DPDK aware of IOVA address
- translation scheme.
- Reference to phys address in EAL data-structure or functions may change to
- IOVA address or more appropriate name.
- The change will be only for the name.
- Functional aspects of the API or data-structure will remain same.
-
* The mbuf flags PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated and
are respectively replaced by PKT_RX_VLAN_STRIPPED and
PKT_RX_QINQ_STRIPPED, that are better described. The old flags and
diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
index 170f4f916..30d0c0229 100644
--- a/doc/guides/rel_notes/release_17_11.rst
+++ b/doc/guides/rel_notes/release_17_11.rst
@@ -124,7 +124,34 @@ ABI Changes
Also, make sure to start the actual text at the margin.
=========================================================
+* **Following datatypes, structure member and function renamed to iova type.**
+ * Renamed ``phys_addr_t`` to ``iova_addr_t``.
+ * Renamed ``buf_physaddr`` to ``buf_iovaaddr`` for struct rte_mbuf.
+ * Renamed ``phys_addr`` to ``iova_addr`` for struct rte_memseg.
+ * The Following memory translation api renamed from:
+
+ * ``rte_mempool_populate_phys()``
+ * ``rte_mempool_populate_phys_tab()``
+ * ``rte_eal_using_phys_addrs()``
+ * ``rte_mem_virt2phy()``
+ * ``rte_dump_physmem_layout()``
+ * ``rte_eal_get_physmem_layout()``
+ * ``rte_eal_get_physmem_size()``
+ * ``rte_malloc_virt2phy()``
+ * ``rte_mem_phy2mch()``
+
+ * To the following iova types api:
+
+ * ``rte_mempool_populate_iova()``
+ * ``rte_mempool_populate_iova_tab()``
+ * ``rte_eal_using_iova_addrs()``
+ * ``rte_mem_virt2iova()``
+ * ``rte_dump_iovamem_layout()``
+ * ``rte_eal_get_iovamem_layout()``
+ * ``rte_eal_get_iovamem_size()``
+ * ``rte_malloc_virt2iova()``
+ * ``rte_mem_phy2iova()``
Shared Library Versions
-----------------------
--
2.11.0
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware
2017-08-14 15:15 [dpdk-dev] [PATCH v1 0/4] make dpdk iova aware Santosh Shukla
` (3 preceding siblings ...)
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 4/4] doc: remove dpdk iova aware notice Santosh Shukla
@ 2017-09-05 10:31 ` Santosh Shukla
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 1/5] eal: rename phys_addr_t to iova_addr_t Santosh Shukla
` (6 more replies)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
5 siblings, 7 replies; 91+ messages in thread
From: Santosh Shukla @ 2017-09-05 10:31 UTC (permalink / raw)
To: dev; +Cc: thomas, jerin.jacob, hemant.agrawal, olivier.matz, Santosh Shukla
v2:
Include build fixes reported in patchworks.
Changeset based on deprecation notice[1], planned for v17.11 release.
Patches are based commit:
(c42021fe56 : ethdev: rename map file to match library name)
Summary:
Renaming memory address translation api/ datatypes
and memory struct members to iova types.
1st patch : rename phys_addr_t to iova_addr_t
2nd patch : rename dma var mainly buf_physaddr to buf_iovaaddr
3rd patch : rename rte_memseg {.phys_addr} to {.iova_addr}.
4rd patch : rename memory translation api to _iova types.
5th patch : remove deprecation notice for dpdk iova aware.
v1 --> v2:
- Includes build fixes reported in v1 [2]
- aded separate patch for rte_memseg's phys_addr to iova_addr renaming.
Checkpatch warning:
- Noticed warning in changeset comining from legacy code. unreleated
with iova changes.
Thanks.
[1]
http://dpdk.org/browse/dpdk/commit/doc/guides/rel_notes?id=caa570db61307e07efc461cf558ec291a3e71b29
[2] http://dpdk.org/ml/archives/test-report/2017-August/027020.html
Santosh Shukla (5):
eal: rename phys_addr_t to iova_addr_t
eal/memory: rename buf_physaddr to buf_iovaaddr
eal/memory: rename memseg member phys to iova addr
eal/memory: rename memory api to iova types
doc: remove dpdk iova aware notice
app/proc_info/main.c | 2 +-
app/test-crypto-perf/cperf_test_vector_parsing.c | 4 +--
app/test-crypto-perf/cperf_test_vectors.c | 6 ++--
app/test-crypto-perf/cperf_test_vectors.h | 4 +--
app/test-pmd/cmdline.c | 2 +-
doc/guides/contributing/documentation.rst | 4 +--
doc/guides/prog_guide/cryptodev_lib.rst | 6 ++--
doc/guides/prog_guide/img/mbuf1.svg | 2 +-
doc/guides/rel_notes/deprecation.rst | 7 ----
doc/guides/rel_notes/release_17_11.rst | 27 ++++++++++++++
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 20 +++++------
drivers/crypto/qat/qat_adf/qat_algs.h | 6 ++--
drivers/crypto/qat/qat_crypto.h | 2 +-
drivers/crypto/qat/qat_qp.c | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 +-
drivers/net/ark/ark_ddm.c | 2 +-
drivers/net/ark/ark_ddm.h | 4 +--
drivers/net/ark/ark_ethdev_rx.c | 24 ++++++-------
drivers/net/ark/ark_ethdev_tx.c | 6 ++--
drivers/net/ark/ark_mpu.c | 2 +-
drivers/net/ark/ark_mpu.h | 4 +--
drivers/net/ark/ark_udm.c | 2 +-
drivers/net/ark/ark_udm.h | 4 +--
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/avp/rte_avp_common.h | 20 +++++------
drivers/net/bnx2x/bnx2x.c | 40 ++++++++++-----------
drivers/net/bnx2x/bnx2x.h | 22 ++++++------
drivers/net/bnx2x/bnx2x_rxtx.c | 8 ++---
drivers/net/bnx2x/bnx2x_stats.c | 2 +-
drivers/net/bnx2x/bnx2x_vfpf.c | 2 +-
drivers/net/bnx2x/ecore_sp.h | 2 +-
drivers/net/bnxt/bnxt.h | 10 +++---
drivers/net/bnxt/bnxt_cpr.h | 4 +--
drivers/net/bnxt/bnxt_ethdev.c | 10 +++---
drivers/net/bnxt/bnxt_hwrm.c | 14 ++++----
drivers/net/bnxt/bnxt_ring.c | 6 ++--
drivers/net/bnxt/bnxt_ring.h | 4 +--
drivers/net/bnxt/bnxt_rxr.h | 4 +--
drivers/net/bnxt/bnxt_txr.h | 2 +-
drivers/net/bnxt/bnxt_vnic.c | 6 ++--
drivers/net/bnxt/bnxt_vnic.h | 6 ++--
drivers/net/cxgbe/sge.c | 4 +--
drivers/net/e1000/em_rxtx.c | 4 +--
drivers/net/e1000/igb_rxtx.c | 4 +--
drivers/net/ena/ena_ethdev.c | 6 ++--
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_rxtx.c | 6 ++--
drivers/net/fm10k/fm10k.h | 4 +--
drivers/net/fm10k/fm10k_ethdev.c | 4 +--
drivers/net/fm10k/fm10k_rxtx_vec.c | 4 +--
drivers/net/i40e/i40e_ethdev.c | 2 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 8 ++---
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 4 +--
drivers/net/i40e/i40e_rxtx_vec_neon.c | 6 ++--
drivers/net/i40e/i40e_rxtx_vec_sse.c | 6 ++--
drivers/net/ixgbe/ixgbe_rxtx.c | 4 +--
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 6 ++--
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 6 ++--
drivers/net/liquidio/lio_rxtx.c | 4 +--
drivers/net/liquidio/lio_rxtx.h | 4 +--
drivers/net/mlx4/mlx4.c | 2 +-
drivers/net/mlx5/mlx5_mr.c | 2 +-
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/qede/base/bcm_osal.h | 2 +-
drivers/net/sfc/efsys.h | 2 +-
drivers/net/sfc/sfc.c | 2 +-
drivers/net/sfc/sfc_ef10_rx.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 4 +--
drivers/net/sfc/sfc_tso.c | 2 +-
drivers/net/thunderx/base/nicvf_hw.c | 2 +-
drivers/net/thunderx/base/nicvf_hw.h | 2 +-
drivers/net/thunderx/base/nicvf_hw_defs.h | 6 ++--
drivers/net/thunderx/nicvf_ethdev.c | 4 +--
drivers/net/thunderx/nicvf_ethdev.h | 4 +--
drivers/net/thunderx/nicvf_struct.h | 6 ++--
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtio_rxtx.h | 4 +--
drivers/net/virtio/virtqueue.h | 4 +--
drivers/net/xenvirt/rte_eth_xenvirt.c | 2 +-
drivers/net/xenvirt/rte_mempool_gntalloc.c | 6 ++--
drivers/net/xenvirt/rte_xen_lib.c | 6 ++--
drivers/net/xenvirt/rte_xen_lib.h | 8 ++---
examples/l2fwd-crypto/main.c | 4 +--
lib/librte_cryptodev/rte_crypto.h | 2 +-
lib/librte_cryptodev/rte_crypto_sym.h | 6 ++--
lib/librte_cryptodev/rte_cryptodev.c | 2 +-
lib/librte_cryptodev/rte_cryptodev.h | 2 +-
lib/librte_eal/bsdapp/eal/eal.c | 2 +-
lib/librte_eal/bsdapp/eal/eal_memory.c | 8 ++---
lib/librte_eal/bsdapp/eal/rte_eal_version.map | 12 +++----
lib/librte_eal/common/eal_common_memory.c | 8 ++---
lib/librte_eal/common/eal_common_memzone.c | 4 +--
lib/librte_eal/common/eal_private.h | 2 +-
lib/librte_eal/common/include/rte_malloc.h | 4 +--
lib/librte_eal/common/include/rte_memory.h | 24 ++++++-------
lib/librte_eal/common/include/rte_memzone.h | 2 +-
lib/librte_eal/common/rte_malloc.c | 9 ++---
lib/librte_eal/linuxapp/eal/eal.c | 2 +-
lib/librte_eal/linuxapp/eal/eal_memory.c | 24 ++++++-------
lib/librte_eal/linuxapp/eal/eal_pci.c | 4 +--
lib/librte_eal/linuxapp/eal/eal_vfio.c | 10 +++---
lib/librte_eal/linuxapp/eal/eal_xen_memory.c | 4 +--
.../linuxapp/eal/include/exec-env/rte_kni_common.h | 22 +++++++-----
lib/librte_eal/linuxapp/eal/rte_eal_version.map | 12 +++----
lib/librte_eal/linuxapp/kni/kni_net.c | 6 ++--
lib/librte_kni/rte_kni.c | 2 +-
lib/librte_mbuf/rte_mbuf.c | 6 ++--
lib/librte_mbuf/rte_mbuf.h | 18 +++++-----
lib/librte_mempool/rte_mempool.c | 42 +++++++++++-----------
lib/librte_mempool/rte_mempool.h | 18 +++++-----
lib/librte_mempool/rte_mempool_version.map | 4 +--
lib/librte_vhost/vhost.h | 2 +-
lib/librte_vhost/vhost_user.c | 4 +--
lib/librte_vhost/virtio_net.c | 2 +-
test/test/commands.c | 2 +-
test/test/test_cryptodev.h | 2 +-
test/test/test_malloc.c | 4 +--
test/test/test_mbuf.c | 2 +-
test/test/test_memory.c | 6 ++--
test/test/test_mempool.c | 4 +--
test/test/test_memzone.c | 18 +++++-----
123 files changed, 406 insertions(+), 381 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v2 1/5] eal: rename phys_addr_t to iova_addr_t
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Santosh Shukla
@ 2017-09-05 10:31 ` Santosh Shukla
2017-09-18 15:19 ` Burakov, Anatoly
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 2/5] eal/memory: rename buf_physaddr to buf_iovaaddr Santosh Shukla
` (5 subsequent siblings)
6 siblings, 1 reply; 91+ messages in thread
From: Santosh Shukla @ 2017-09-05 10:31 UTC (permalink / raw)
To: dev; +Cc: thomas, jerin.jacob, hemant.agrawal, olivier.matz, Santosh Shukla
Renamed data type from phys_addr_t to iova_addr_t.
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
v1 --> v2:
- clang build fix for v1 for linuxapp.
v1 note:
- As changes percolate to all possible dpdk subsystem..
so its difficult to tag subject with one common title,
but since, core of changeset is at eal layer so keeping 'eal:'
as title.
app/test-crypto-perf/cperf_test_vectors.h | 4 +--
doc/guides/contributing/documentation.rst | 4 +--
doc/guides/prog_guide/cryptodev_lib.rst | 6 ++--
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 14 ++++----
drivers/crypto/qat/qat_adf/qat_algs.h | 6 ++--
drivers/crypto/qat/qat_crypto.h | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 +-
drivers/net/ark/ark_ddm.c | 2 +-
drivers/net/ark/ark_ddm.h | 4 +--
drivers/net/ark/ark_ethdev_rx.c | 12 +++----
drivers/net/ark/ark_ethdev_tx.c | 2 +-
drivers/net/ark/ark_mpu.c | 2 +-
drivers/net/ark/ark_mpu.h | 4 +--
drivers/net/ark/ark_udm.c | 2 +-
drivers/net/ark/ark_udm.h | 4 +--
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/avp/rte_avp_common.h | 20 +++++------
drivers/net/bnx2x/bnx2x.c | 40 +++++++++++-----------
drivers/net/bnx2x/bnx2x.h | 22 ++++++------
drivers/net/bnx2x/bnx2x_rxtx.c | 4 +--
drivers/net/bnx2x/bnx2x_stats.c | 2 +-
drivers/net/bnx2x/bnx2x_vfpf.c | 2 +-
drivers/net/bnx2x/ecore_sp.h | 2 +-
drivers/net/bnxt/bnxt.h | 10 +++---
drivers/net/bnxt/bnxt_cpr.h | 4 +--
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/bnxt_ring.c | 2 +-
drivers/net/bnxt/bnxt_ring.h | 2 +-
drivers/net/bnxt/bnxt_rxr.h | 4 +--
drivers/net/bnxt/bnxt_txr.h | 2 +-
drivers/net/bnxt/bnxt_vnic.c | 2 +-
drivers/net/bnxt/bnxt_vnic.h | 6 ++--
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/liquidio/lio_rxtx.h | 4 +--
drivers/net/qede/base/bcm_osal.h | 2 +-
drivers/net/sfc/efsys.h | 2 +-
drivers/net/sfc/sfc_ef10_rx.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 4 +--
drivers/net/thunderx/base/nicvf_hw.c | 2 +-
drivers/net/thunderx/base/nicvf_hw.h | 2 +-
drivers/net/thunderx/base/nicvf_hw_defs.h | 6 ++--
drivers/net/thunderx/nicvf_ethdev.c | 4 +--
drivers/net/thunderx/nicvf_ethdev.h | 4 +--
drivers/net/thunderx/nicvf_struct.h | 6 ++--
drivers/net/virtio/virtio_rxtx.h | 4 +--
drivers/net/virtio/virtqueue.h | 2 +-
drivers/net/xenvirt/rte_eth_xenvirt.c | 2 +-
drivers/net/xenvirt/rte_mempool_gntalloc.c | 6 ++--
drivers/net/xenvirt/rte_xen_lib.c | 6 ++--
drivers/net/xenvirt/rte_xen_lib.h | 8 ++---
examples/l2fwd-crypto/main.c | 2 +-
lib/librte_cryptodev/rte_crypto.h | 2 +-
lib/librte_cryptodev/rte_crypto_sym.h | 6 ++--
lib/librte_cryptodev/rte_cryptodev.h | 2 +-
lib/librte_eal/bsdapp/eal/eal_memory.c | 4 +--
lib/librte_eal/common/include/rte_malloc.h | 2 +-
lib/librte_eal/common/include/rte_memory.h | 18 +++++-----
lib/librte_eal/common/include/rte_memzone.h | 2 +-
lib/librte_eal/common/rte_malloc.c | 2 +-
lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++---
lib/librte_eal/linuxapp/eal/eal_xen_memory.c | 4 +--
.../linuxapp/eal/include/exec-env/rte_kni_common.h | 20 ++++++-----
lib/librte_mbuf/rte_mbuf.h | 8 ++---
lib/librte_mempool/rte_mempool.c | 18 +++++-----
lib/librte_mempool/rte_mempool.h | 14 ++++----
lib/librte_vhost/vhost.h | 2 +-
test/test/test_cryptodev.h | 2 +-
test/test/test_memzone.c | 8 ++---
68 files changed, 197 insertions(+), 193 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_vectors.h b/app/test-crypto-perf/cperf_test_vectors.h
index 85955703c..a203272cf 100644
--- a/app/test-crypto-perf/cperf_test_vectors.h
+++ b/app/test-crypto-perf/cperf_test_vectors.h
@@ -78,13 +78,13 @@ struct cperf_test_vector {
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
uint16_t length;
} aad;
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
uint16_t length;
} digest;
diff --git a/doc/guides/contributing/documentation.rst b/doc/guides/contributing/documentation.rst
index cddbd7bb8..719007b9f 100644
--- a/doc/guides/contributing/documentation.rst
+++ b/doc/guides/contributing/documentation.rst
@@ -712,7 +712,7 @@ The following are some guidelines for use of Doxygen in the DPDK API documentati
/**< Virtual address of the first mempool object. */
uintptr_t elt_va_end;
/**< Virtual address of the <size + 1> mempool object. */
- phys_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
+ iova_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
/**< Array of physical page addresses for the mempool buffer. */
This doesn't have an effect on the rendered documentation but it is confusing for the developer reading the code.
@@ -731,7 +731,7 @@ The following are some guidelines for use of Doxygen in the DPDK API documentati
/** Virtual address of the <size + 1> mempool object. */
uintptr_t elt_va_end;
/** Array of physical page addresses for the mempool buffer. */
- phys_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
+ iova_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
* Check for Doxygen warnings in new code by checking the API documentation build::
diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 75ae085f6..248038f64 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -539,12 +539,12 @@ chain.
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
} digest; /**< Digest parameters */
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
} aad;
/**< Additional authentication parameters */
} aead;
@@ -566,7 +566,7 @@ chain.
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
} digest; /**< Digest parameters */
} auth;
};
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 5d7a82823..184c7069d 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -271,9 +271,9 @@ enum qbman_fd_format {
#define DPAA2_EQ_RESP_ALWAYS 1
#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA
-static void *dpaa2_mem_ptov(phys_addr_t paddr) __attribute__((unused));
+static void *dpaa2_mem_ptov(iova_addr_t paddr) __attribute__((unused));
/* todo - this is costly, need to write a fast coversion routine */
-static void *dpaa2_mem_ptov(phys_addr_t paddr)
+static void *dpaa2_mem_ptov(iova_addr_t paddr)
{
const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
int i;
@@ -287,8 +287,8 @@ static void *dpaa2_mem_ptov(phys_addr_t paddr)
return NULL;
}
-static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr) __attribute__((unused));
-static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
+static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr) __attribute__((unused));
+static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr)
{
const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
int i;
@@ -299,7 +299,7 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
return memseg[i].phys_addr
+ (vaddr - memseg[i].addr_64);
}
- return (phys_addr_t)(NULL);
+ return (iova_addr_t)(NULL);
}
/**
@@ -320,13 +320,13 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
/**
* macro to convert IOVA to Virtual address
*/
-#define DPAA2_IOVA_TO_VADDR(_iova) dpaa2_mem_ptov((phys_addr_t)(_iova))
+#define DPAA2_IOVA_TO_VADDR(_iova) dpaa2_mem_ptov((iova_addr_t)(_iova))
/**
* macro to convert modify the memory containing IOVA to Virtual address
*/
#define DPAA2_MODIFY_IOVA_TO_VADDR(_mem, _type) \
- {_mem = (_type)(dpaa2_mem_ptov((phys_addr_t)(_mem))); }
+ {_mem = (_type)(dpaa2_mem_ptov((iova_addr_t)(_mem))); }
#else /* RTE_LIBRTE_DPAA2_USE_PHYS_IOVA */
diff --git a/drivers/crypto/qat/qat_adf/qat_algs.h b/drivers/crypto/qat/qat_adf/qat_algs.h
index 2c8e03c0a..c53ebd7ed 100644
--- a/drivers/crypto/qat/qat_adf/qat_algs.h
+++ b/drivers/crypto/qat/qat_adf/qat_algs.h
@@ -104,8 +104,8 @@ struct qat_alg_buf_list {
struct qat_crypto_op_cookie {
struct qat_alg_buf_list qat_sgl_list_src;
struct qat_alg_buf_list qat_sgl_list_dst;
- phys_addr_t qat_sgl_src_phys_addr;
- phys_addr_t qat_sgl_dst_phys_addr;
+ iova_addr_t qat_sgl_src_phys_addr;
+ iova_addr_t qat_sgl_dst_phys_addr;
};
/* Common content descriptor */
@@ -124,7 +124,7 @@ struct qat_session {
void *bpi_ctx;
struct qat_alg_cd cd;
uint8_t *cd_cur_ptr;
- phys_addr_t cd_paddr;
+ iova_addr_t cd_paddr;
struct icp_qat_fw_la_bulk_req fw_req;
uint8_t aad_len;
struct qat_crypto_instance *inst;
diff --git a/drivers/crypto/qat/qat_crypto.h b/drivers/crypto/qat/qat_crypto.h
index 3f35a00e7..037805633 100644
--- a/drivers/crypto/qat/qat_crypto.h
+++ b/drivers/crypto/qat/qat_crypto.h
@@ -63,7 +63,7 @@ enum qat_device_gen {
struct qat_queue {
char memz_name[RTE_MEMZONE_NAMESIZE];
void *base_addr; /* Base address */
- phys_addr_t base_phys_addr; /* Queue physical address */
+ iova_addr_t base_phys_addr; /* Queue physical address */
uint32_t head; /* Shadow copy of the head */
uint32_t tail; /* Shadow copy of the tail */
uint32_t modulo;
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
index 56b71bede..835fe9ef7 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
@@ -39,7 +39,7 @@
struct buf_pool_cfg {
void *addr;
/**< The address from where DPAA2 will carve out the buffers */
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
/**< Physical address of the memory provided in addr */
uint32_t num;
/**< Number of buffers */
diff --git a/drivers/net/ark/ark_ddm.c b/drivers/net/ark/ark_ddm.c
index 221460c78..7c78ab75c 100644
--- a/drivers/net/ark/ark_ddm.c
+++ b/drivers/net/ark/ark_ddm.c
@@ -93,7 +93,7 @@ ark_ddm_reset(struct ark_ddm_t *ddm)
}
void
-ark_ddm_setup(struct ark_ddm_t *ddm, phys_addr_t cons_addr, uint32_t interval)
+ark_ddm_setup(struct ark_ddm_t *ddm, iova_addr_t cons_addr, uint32_t interval)
{
ddm->setup.cons_write_index_addr = cons_addr;
ddm->setup.write_index_interval = interval / 4; /* 4 ns period */
diff --git a/drivers/net/ark/ark_ddm.h b/drivers/net/ark/ark_ddm.h
index de61926c3..3381cb9e2 100644
--- a/drivers/net/ark/ark_ddm.h
+++ b/drivers/net/ark/ark_ddm.h
@@ -127,7 +127,7 @@ struct ark_ddm_cpld_ps_t {
#define ARK_DDM_SETUP 0x00e0
struct ark_ddm_setup_t {
- phys_addr_t cons_write_index_addr;
+ iova_addr_t cons_write_index_addr;
uint32_t write_index_interval; /* 4ns each */
volatile uint32_t cons_index;
};
@@ -165,7 +165,7 @@ void ark_ddm_start(struct ark_ddm_t *ddm);
int ark_ddm_stop(struct ark_ddm_t *ddm, const int wait);
void ark_ddm_reset(struct ark_ddm_t *ddm);
void ark_ddm_stats_reset(struct ark_ddm_t *ddm);
-void ark_ddm_setup(struct ark_ddm_t *ddm, phys_addr_t cons_addr,
+void ark_ddm_setup(struct ark_ddm_t *ddm, iova_addr_t cons_addr,
uint32_t interval);
void ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg);
void ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg);
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index f39e6f68a..1cbda01a7 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -62,7 +62,7 @@ struct ark_rx_queue {
struct rte_mbuf **reserve_q;
/* array of physical addresses of the mbuf data pointer */
/* This point is a virtual address */
- phys_addr_t *paddress_q;
+ iova_addr_t *paddress_q;
struct rte_mempool *mb_pool;
struct ark_udm_t *udm;
@@ -96,9 +96,9 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
struct ark_rx_queue *queue,
uint16_t rx_queue_id __rte_unused, uint16_t rx_queue_idx)
{
- phys_addr_t queue_base;
- phys_addr_t phys_addr_q_base;
- phys_addr_t phys_addr_prod_index;
+ iova_addr_t queue_base;
+ iova_addr_t phys_addr_q_base;
+ iova_addr_t phys_addr_prod_index;
queue_base = rte_malloc_virt2phy(queue);
phys_addr_prod_index = queue_base +
@@ -107,7 +107,7 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
phys_addr_q_base = rte_malloc_virt2phy(queue->paddress_q);
/* Verify HW */
- if (ark_mpu_verify(queue->mpu, sizeof(phys_addr_t))) {
+ if (ark_mpu_verify(queue->mpu, sizeof(iova_addr_t))) {
PMD_DRV_LOG(ERR, "Illegal configuration rx queue\n");
return -1;
}
@@ -205,7 +205,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
socket_id);
queue->paddress_q =
rte_zmalloc_socket("Ark_rx_queue paddr",
- nb_desc * sizeof(phys_addr_t),
+ nb_desc * sizeof(iova_addr_t),
64,
socket_id);
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 9ae7ae0e6..578cb09b8 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -311,7 +311,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
static int
eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
{
- phys_addr_t queue_base, ring_base, cons_index_addr;
+ iova_addr_t queue_base, ring_base, cons_index_addr;
uint32_t write_interval_ns;
/* Verify HW -- MPU */
diff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c
index cd2c0788f..23575c8e3 100644
--- a/drivers/net/ark/ark_mpu.c
+++ b/drivers/net/ark/ark_mpu.c
@@ -118,7 +118,7 @@ ark_mpu_reset_stats(struct ark_mpu_t *mpu)
}
int
-ark_mpu_configure(struct ark_mpu_t *mpu, phys_addr_t ring, uint32_t ring_size,
+ark_mpu_configure(struct ark_mpu_t *mpu, iova_addr_t ring, uint32_t ring_size,
int is_tx)
{
ark_mpu_reset(mpu);
diff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h
index a0171dbd6..a42e242b7 100644
--- a/drivers/net/ark/ark_mpu.h
+++ b/drivers/net/ark/ark_mpu.h
@@ -75,7 +75,7 @@ struct ark_mpu_hw_t {
#define ARK_MPU_CFG 0x040
struct ark_mpu_cfg_t {
- phys_addr_t ring_base; /* phys_addr_t is a uint64_t */
+ iova_addr_t ring_base; /* iova_addr_t is a uint64_t */
uint32_t ring_size;
uint32_t ring_mask;
uint32_t min_host_move;
@@ -137,7 +137,7 @@ int ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size);
void ark_mpu_stop(struct ark_mpu_t *mpu);
void ark_mpu_start(struct ark_mpu_t *mpu);
int ark_mpu_reset(struct ark_mpu_t *mpu);
-int ark_mpu_configure(struct ark_mpu_t *mpu, phys_addr_t ring,
+int ark_mpu_configure(struct ark_mpu_t *mpu, iova_addr_t ring,
uint32_t ring_size, int is_tx);
void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx);
diff --git a/drivers/net/ark/ark_udm.c b/drivers/net/ark/ark_udm.c
index 1ba7d26d4..1c04d92d9 100644
--- a/drivers/net/ark/ark_udm.c
+++ b/drivers/net/ark/ark_udm.c
@@ -122,7 +122,7 @@ ark_udm_configure(struct ark_udm_t *udm,
}
void
-ark_udm_write_addr(struct ark_udm_t *udm, phys_addr_t addr)
+ark_udm_write_addr(struct ark_udm_t *udm, iova_addr_t addr)
{
udm->rt_cfg.hw_prod_addr = addr;
}
diff --git a/drivers/net/ark/ark_udm.h b/drivers/net/ark/ark_udm.h
index 29bf1e8f7..1be45e2d9 100644
--- a/drivers/net/ark/ark_udm.h
+++ b/drivers/net/ark/ark_udm.h
@@ -137,7 +137,7 @@ struct ark_udm_tlp_ps_t {
#define ARK_UDM_RT_CFG 0x00e0
struct ark_udm_rt_cfg_t {
- phys_addr_t hw_prod_addr;
+ iova_addr_t hw_prod_addr;
uint32_t write_interval; /* 4ns cycles */
volatile uint32_t prod_idx; /* RO */
};
@@ -171,7 +171,7 @@ void ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
uint32_t dataroom,
uint32_t write_interval_ns);
-void ark_udm_write_addr(struct ark_udm_t *udm, phys_addr_t addr);
+void ark_udm_write_addr(struct ark_udm_t *udm, iova_addr_t addr);
void ark_udm_stats_reset(struct ark_udm_t *udm);
void ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg,
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index c746a0e2c..76f5acae4 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -387,7 +387,7 @@ avp_dev_translate_buffer(struct avp_dev *avp, void *host_mbuf_address)
/* translate from host physical address to guest virtual address */
static void *
avp_dev_translate_address(struct rte_eth_dev *eth_dev,
- phys_addr_t host_phys_addr)
+ iova_addr_t host_phys_addr)
{
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
struct rte_mem_resource *resource;
diff --git a/drivers/net/avp/rte_avp_common.h b/drivers/net/avp/rte_avp_common.h
index 488d72168..791d2f1b6 100644
--- a/drivers/net/avp/rte_avp_common.h
+++ b/drivers/net/avp/rte_avp_common.h
@@ -243,7 +243,7 @@ struct rte_avp_desc {
*/
struct rte_avp_memmap {
void *addr;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
uint64_t length;
};
@@ -345,7 +345,7 @@ RTE_AVP_MAKE_VERSION(RTE_AVP_RELEASE_VERSION_1, \
*/
struct rte_avp_mempool_info {
void *addr;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
uint64_t length;
};
@@ -359,10 +359,10 @@ struct rte_avp_device_info {
char ifname[RTE_AVP_NAMESIZE]; /**< Network device name for AVP */
- phys_addr_t tx_phys;
- phys_addr_t rx_phys;
- phys_addr_t alloc_phys;
- phys_addr_t free_phys;
+ iova_addr_t tx_phys;
+ iova_addr_t rx_phys;
+ iova_addr_t alloc_phys;
+ iova_addr_t free_phys;
uint32_t features; /**< Supported feature bitmap */
uint8_t min_rx_queues; /**< Minimum supported receive/free queues */
@@ -379,14 +379,14 @@ struct rte_avp_device_info {
uint32_t free_size; /**< Size of each free queue */
/* Used by Ethtool */
- phys_addr_t req_phys;
- phys_addr_t resp_phys;
- phys_addr_t sync_phys;
+ iova_addr_t req_phys;
+ iova_addr_t resp_phys;
+ iova_addr_t sync_phys;
void *sync_va;
/* mbuf mempool (used when a single memory area is supported) */
void *mbuf_va;
- phys_addr_t mbuf_phys;
+ iova_addr_t mbuf_phys;
/* mbuf mempools */
struct rte_avp_mempool_info pool[RTE_AVP_MAX_MEMPOOLS];
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 06733d153..70ccbf642 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -419,7 +419,7 @@ void bnx2x_read_dmae(struct bnx2x_softc *sc, uint32_t src_addr, uint32_t len32)
}
void
-bnx2x_write_dmae(struct bnx2x_softc *sc, phys_addr_t dma_addr, uint32_t dst_addr,
+bnx2x_write_dmae(struct bnx2x_softc *sc, iova_addr_t dma_addr, uint32_t dst_addr,
uint32_t len32)
{
struct dmae_command dmae;
@@ -447,7 +447,7 @@ bnx2x_write_dmae(struct bnx2x_softc *sc, phys_addr_t dma_addr, uint32_t dst_addr
}
static void
-bnx2x_write_dmae_phys_len(struct bnx2x_softc *sc, phys_addr_t phys_addr,
+bnx2x_write_dmae_phys_len(struct bnx2x_softc *sc, iova_addr_t phys_addr,
uint32_t addr, uint32_t len)
{
uint32_t dmae_wr_max = DMAE_LEN32_WR_MAX(sc);
@@ -823,14 +823,14 @@ bnx2x_fw_command(struct bnx2x_softc *sc, uint32_t command, uint32_t param)
static void
__storm_memset_dma_mapping(struct bnx2x_softc *sc, uint32_t addr,
- phys_addr_t mapping)
+ iova_addr_t mapping)
{
REG_WR(sc, addr, U64_LO(mapping));
REG_WR(sc, (addr + 4), U64_HI(mapping));
}
static void
-storm_memset_spq_addr(struct bnx2x_softc *sc, phys_addr_t mapping,
+storm_memset_spq_addr(struct bnx2x_softc *sc, iova_addr_t mapping,
uint16_t abs_fid)
{
uint32_t addr = (XSEM_REG_FAST_MEMORY +
@@ -1498,7 +1498,7 @@ bnx2x_set_q_rx_mode(struct bnx2x_softc *sc, uint8_t cl_id,
ramrod_param.rdata = BNX2X_SP(sc, rx_mode_rdata);
ramrod_param.rdata_mapping =
- (phys_addr_t)BNX2X_SP_MAPPING(sc, rx_mode_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, rx_mode_rdata),
bnx2x_set_bit(ECORE_FILTER_RX_MODE_PENDING, &sc->sp_state);
ramrod_param.ramrod_flags = ramrod_flags;
@@ -4599,9 +4599,9 @@ static void bnx2x_init_func_obj(struct bnx2x_softc *sc)
ecore_init_func_obj(sc,
&sc->func_obj,
BNX2X_SP(sc, func_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, func_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, func_rdata),
BNX2X_SP(sc, func_afex_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, func_afex_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, func_afex_rdata),
&bnx2x_func_sp_drv);
}
@@ -4772,7 +4772,7 @@ static void bnx2x_map_sb_state_machines(struct hc_index_data *index_data)
}
static void
-bnx2x_init_sb(struct bnx2x_softc *sc, phys_addr_t busaddr, int vfid,
+bnx2x_init_sb(struct bnx2x_softc *sc, iova_addr_t busaddr, int vfid,
uint8_t vf_valid, int fw_sb_id, int igu_sb_id)
{
struct hc_status_block_data_e2 sb_data_e2;
@@ -4918,7 +4918,7 @@ static void bnx2x_init_eth_fp(struct bnx2x_softc *sc, int idx)
sc->max_cos,
SC_FUNC(sc),
BNX2X_SP(sc, q_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, q_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, q_rdata),
q_type);
/* configure classification DBs */
@@ -4928,7 +4928,7 @@ static void bnx2x_init_eth_fp(struct bnx2x_softc *sc, int idx)
idx,
SC_FUNC(sc),
BNX2X_SP(sc, mac_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, mac_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, mac_rdata),
ECORE_FILTER_MAC_PENDING, &sc->sp_state,
ECORE_OBJ_TYPE_RX_TX, &sc->macs_pool);
}
@@ -5028,7 +5028,7 @@ static void bnx2x_init_tx_rings(struct bnx2x_softc *sc)
static void bnx2x_init_def_sb(struct bnx2x_softc *sc)
{
struct host_sp_status_block *def_sb = sc->def_sb;
- phys_addr_t mapping = sc->def_sb_dma.paddr;
+ iova_addr_t mapping = sc->def_sb_dma.paddr;
int igu_sp_sb_index;
int igu_seg_id;
int port = SC_PORT(sc);
@@ -5700,7 +5700,7 @@ static void bnx2x_init_objs(struct bnx2x_softc *sc)
SC_FUNC(sc),
SC_FUNC(sc),
BNX2X_SP(sc, mcast_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, mcast_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, mcast_rdata),
ECORE_FILTER_MCAST_PENDING,
&sc->sp_state, o_type);
@@ -5724,7 +5724,7 @@ static void bnx2x_init_objs(struct bnx2x_softc *sc)
SC_FUNC(sc),
SC_FUNC(sc),
BNX2X_SP(sc, rss_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, rss_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, rss_rdata),
ECORE_FILTER_RSS_CONF_PENDING,
&sc->sp_state, ECORE_OBJ_TYPE_RX);
}
@@ -6445,9 +6445,9 @@ bnx2x_pf_rx_q_prep(struct bnx2x_softc *sc, struct bnx2x_fastpath *fp,
pause->pri_map = 1;
/* rxq setup */
- rxq_init->dscr_map = (phys_addr_t)rxq->rx_ring_phys_addr;
- rxq_init->rcq_map = (phys_addr_t)rxq->cq_ring_phys_addr;
- rxq_init->rcq_np_map = (phys_addr_t)(rxq->cq_ring_phys_addr +
+ rxq_init->dscr_map = (iova_addr_t)rxq->rx_ring_phys_addr;
+ rxq_init->rcq_map = (iova_addr_t)rxq->cq_ring_phys_addr;
+ rxq_init->rcq_np_map = (iova_addr_t)(rxq->cq_ring_phys_addr +
BNX2X_PAGE_SIZE);
/*
@@ -6486,7 +6486,7 @@ bnx2x_pf_tx_q_prep(struct bnx2x_softc *sc, struct bnx2x_fastpath *fp,
PMD_TX_LOG(ERR, "ERROR: TX queue is NULL");
return;
}
- txq_init->dscr_map = (phys_addr_t)txq->tx_ring_phys_addr;
+ txq_init->dscr_map = (iova_addr_t)txq->tx_ring_phys_addr;
txq_init->sb_cq_index = HC_INDEX_ETH_FIRST_TX_CQ_CONS + cos;
txq_init->traffic_type = LLFC_TRAFFIC_TYPE_NW;
txq_init->fw_sb_id = fp->fw_sb_id;
@@ -11059,7 +11059,7 @@ static int bnx2x_init_hw_func(struct bnx2x_softc *sc)
for (i = 0; i < L2_ILT_LINES(sc); i++) {
ilt->lines[cdu_ilt_start + i].page = sc->context[i].vcxt;
ilt->lines[cdu_ilt_start + i].page_mapping =
- (phys_addr_t)sc->context[i].vcxt_dma.paddr;
+ (iova_addr_t)sc->context[i].vcxt_dma.paddr;
ilt->lines[cdu_ilt_start + i].size = sc->context[i].size;
}
ecore_ilt_init_op(sc, INITOP_SET);
@@ -11357,7 +11357,7 @@ static void bnx2x_reset_port(struct bnx2x_softc *sc)
}
}
-static void bnx2x_ilt_wr(struct bnx2x_softc *sc, uint32_t index, phys_addr_t addr)
+static void bnx2x_ilt_wr(struct bnx2x_softc *sc, uint32_t index, iova_addr_t addr)
{
int reg;
uint32_t wb_write[2];
@@ -11587,7 +11587,7 @@ static int ecore_gunzip(struct bnx2x_softc *sc, const uint8_t * zbuf, int len)
}
static void
-ecore_write_dmae_phys_len(struct bnx2x_softc *sc, phys_addr_t phys_addr,
+ecore_write_dmae_phys_len(struct bnx2x_softc *sc, iova_addr_t phys_addr,
uint32_t addr, uint32_t len)
{
bnx2x_write_dmae_phys_len(sc, phys_addr, addr, len);
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 91c5aec21..b81327a66 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -317,7 +317,7 @@ struct bnx2x_bar {
/* Used to manage DMA allocations. */
struct bnx2x_dma {
struct bnx2x_softc *sc;
- phys_addr_t paddr;
+ iova_addr_t paddr;
void *vaddr;
int nseg;
char msg[RTE_MEMZONE_NAMESIZE - 6];
@@ -370,10 +370,10 @@ struct bnx2x_fastpath {
struct bnx2x_dma sb_dma;
union bnx2x_host_hc_status_block status_block;
- phys_addr_t tx_desc_mapping;
+ iova_addr_t tx_desc_mapping;
- phys_addr_t rx_desc_mapping;
- phys_addr_t rx_comp_mapping;
+ iova_addr_t rx_desc_mapping;
+ iova_addr_t rx_comp_mapping;
uint16_t *sb_index_values;
uint16_t *sb_running_index;
@@ -468,7 +468,7 @@ union cdu_context {
struct hw_context {
struct bnx2x_dma vcxt_dma;
union cdu_context *vcxt;
- //phys_addr_t cxt_mapping;
+ //iova_addr_t cxt_mapping;
size_t size;
};
@@ -1242,7 +1242,7 @@ struct bnx2x_softc {
uint32_t gz_outlen;
#define GUNZIP_BUF(sc) (sc->gz_buf)
#define GUNZIP_OUTLEN(sc) (sc->gz_outlen)
-#define GUNZIP_PHYS(sc) (phys_addr_t)(sc->gz_buf_dma.paddr)
+#define GUNZIP_PHYS(sc) (iova_addr_t)(sc->gz_buf_dma.paddr)
#define FW_BUF_SIZE 0x40000
struct raw_op *init_ops;
@@ -1310,14 +1310,14 @@ struct bnx2x_softc {
*/
int fw_stats_req_size;
struct bnx2x_fw_stats_req *fw_stats_req;
- phys_addr_t fw_stats_req_mapping;
+ iova_addr_t fw_stats_req_mapping;
/*
* FW statistics data shortcut (points at the beginning of fw_stats
* buffer + fw_stats_req_size).
*/
int fw_stats_data_size;
struct bnx2x_fw_stats_data *fw_stats_data;
- phys_addr_t fw_stats_data_mapping;
+ iova_addr_t fw_stats_data_mapping;
/* tracking a pending STAT_QUERY ramrod */
uint16_t stats_pending;
@@ -1402,8 +1402,8 @@ union bnx2x_stats_show_data {
#define FUNC_FLG_LEADING 0x0020 /* PF only */
struct bnx2x_func_init_params {
- phys_addr_t fw_stat_map; /* (dma) valid if FUNC_FLG_STATS */
- phys_addr_t spq_map; /* (dma) valid if FUNC_FLG_SPQ */
+ iova_addr_t fw_stat_map; /* (dma) valid if FUNC_FLG_STATS */
+ iova_addr_t spq_map; /* (dma) valid if FUNC_FLG_SPQ */
uint16_t func_flgs;
uint16_t func_id; /* abs function id */
uint16_t pf_id;
@@ -1748,7 +1748,7 @@ uint32_t bnx2x_dmae_opcode(struct bnx2x_softc *sc, uint8_t src_type,
uint8_t comp_type);
void bnx2x_post_dmae(struct bnx2x_softc *sc, struct dmae_command *dmae, int idx);
void bnx2x_read_dmae(struct bnx2x_softc *sc, uint32_t src_addr, uint32_t len32);
-void bnx2x_write_dmae(struct bnx2x_softc *sc, phys_addr_t dma_addr,
+void bnx2x_write_dmae(struct bnx2x_softc *sc, iova_addr_t dma_addr,
uint32_t dst_addr, uint32_t len32);
void bnx2x_set_ctx_validation(struct bnx2x_softc *sc, struct eth_context *cxt,
uint32_t cid);
diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c
index 5dd4aee7f..7336124fc 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.c
+++ b/drivers/net/bnx2x/bnx2x_rxtx.c
@@ -71,8 +71,8 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
struct bnx2x_softc *sc = dev->data->dev_private;
struct bnx2x_fastpath *fp = &sc->fp[queue_idx];
struct eth_rx_cqe_next_page *nextpg;
- phys_addr_t *rx_bd;
- phys_addr_t busaddr;
+ iova_addr_t *rx_bd;
+ iova_addr_t busaddr;
/* First allocate the rx queue data structure */
rxq = rte_zmalloc_socket("ethdev RX queue", sizeof(struct bnx2x_rx_queue),
diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c
index 6223cfef1..03625810e 100644
--- a/drivers/net/bnx2x/bnx2x_stats.c
+++ b/drivers/net/bnx2x/bnx2x_stats.c
@@ -1338,7 +1338,7 @@ bnx2x_prep_fw_stats_req(struct bnx2x_softc *sc)
int i;
int first_queue_query_index;
struct stats_query_header *stats_hdr = &sc->fw_stats_req->hdr;
- phys_addr_t cur_data_offset;
+ iova_addr_t cur_data_offset;
struct stats_query_entry *cur_query_entry;
stats_hdr->cmd_num = sc->fw_stats_num;
diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c
index 0ca0df876..855dafaa6 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/bnx2x/bnx2x_vfpf.c
@@ -113,7 +113,7 @@ bnx2x_vf_finalize(struct bnx2x_softc *sc,
#define BNX2X_VF_CHANNEL_TRIES 100
static int
-bnx2x_do_req4pf(struct bnx2x_softc *sc, phys_addr_t phys_addr)
+bnx2x_do_req4pf(struct bnx2x_softc *sc, iova_addr_t phys_addr)
{
uint8_t *status = &sc->vf2pf_mbox->resp.common_reply.status;
uint8_t i;
diff --git a/drivers/net/bnx2x/ecore_sp.h b/drivers/net/bnx2x/ecore_sp.h
index e7ec96e94..cd7c5e41e 100644
--- a/drivers/net/bnx2x/ecore_sp.h
+++ b/drivers/net/bnx2x/ecore_sp.h
@@ -36,7 +36,7 @@
#include "ecore_reg.h"
struct bnx2x_softc;
-typedef phys_addr_t ecore_dma_addr_t; /* expected to be 64 bit wide */
+typedef iova_addr_t ecore_dma_addr_t; /* expected to be 64 bit wide */
typedef volatile int ecore_atomic_t;
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 405d94deb..0c42d99ed 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -132,7 +132,7 @@ struct bnxt_pf_info {
uint16_t max_vfs;
uint32_t func_cfg_flags;
void *vf_req_buf;
- phys_addr_t vf_req_buf_dma_addr;
+ iova_addr_t vf_req_buf_dma_addr;
uint32_t vf_req_fwd[8];
uint16_t total_vnics;
struct bnxt_child_vf_info *vf_info;
@@ -194,14 +194,14 @@ struct bnxt {
struct bnxt_rx_queue **rx_queues;
const void *rx_mem_zone;
struct rx_port_stats *hw_rx_port_stats;
- phys_addr_t hw_rx_port_stats_map;
+ iova_addr_t hw_rx_port_stats_map;
unsigned int tx_nr_rings;
unsigned int tx_cp_nr_rings;
struct bnxt_tx_queue **tx_queues;
const void *tx_mem_zone;
struct tx_port_stats *hw_tx_port_stats;
- phys_addr_t hw_tx_port_stats_map;
+ iova_addr_t hw_tx_port_stats_map;
/* Default completion ring */
struct bnxt_cp_ring_info *def_cp_ring;
@@ -227,9 +227,9 @@ struct bnxt {
uint16_t hwrm_cmd_seq;
void *hwrm_cmd_resp_addr;
- phys_addr_t hwrm_cmd_resp_dma_addr;
+ iova_addr_t hwrm_cmd_resp_dma_addr;
void *hwrm_short_cmd_req_addr;
- phys_addr_t hwrm_short_cmd_req_dma_addr;
+ iova_addr_t hwrm_short_cmd_req_dma_addr;
rte_spinlock_t hwrm_lock;
uint16_t max_req_len;
uint16_t max_resp_len;
diff --git a/drivers/net/bnxt/bnxt_cpr.h b/drivers/net/bnxt/bnxt_cpr.h
index a6e87858a..1f95c85f2 100644
--- a/drivers/net/bnxt/bnxt_cpr.h
+++ b/drivers/net/bnxt/bnxt_cpr.h
@@ -82,10 +82,10 @@ struct bnxt_cp_ring_info {
struct cmpl_base *cp_desc_ring;
- phys_addr_t cp_desc_mapping;
+ iova_addr_t cp_desc_mapping;
struct ctx_hw_stats *hw_stats;
- phys_addr_t hw_stats_map;
+ iova_addr_t hw_stats_map;
uint32_t hw_stats_ctx_id;
struct bnxt_ring *cp_ring_struct;
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index c9d11228b..cb2ce334b 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1628,7 +1628,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
const struct rte_memzone *mz = NULL;
static int version_printed;
uint32_t total_alloc_len;
- phys_addr_t mz_phys_addr;
+ iova_addr_t mz_phys_addr;
struct bnxt *bp;
int rc;
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 9d0ae277e..8e83e4704 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -98,7 +98,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
struct rte_pci_device *pdev = bp->pdev;
const struct rte_memzone *mz = NULL;
char mz_name[RTE_MEMZONE_NAMESIZE];
- phys_addr_t mz_phys_addr;
+ iova_addr_t mz_phys_addr;
int sz;
int stats_len = (tx_ring_info || rx_ring_info) ?
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index 6d1eb5888..09042cb80 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -70,7 +70,7 @@
struct bnxt_ring {
void *bd;
- phys_addr_t bd_dma;
+ iova_addr_t bd_dma;
uint32_t ring_size;
uint32_t ring_mask;
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index f8d6dc80a..7f97e7af7 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -85,8 +85,8 @@ struct bnxt_rx_ring_info {
struct bnxt_sw_rx_bd *rx_buf_ring; /* sw ring */
struct bnxt_sw_rx_bd *ag_buf_ring; /* sw ring */
- phys_addr_t rx_desc_mapping;
- phys_addr_t ag_desc_mapping;
+ iova_addr_t rx_desc_mapping;
+ iova_addr_t ag_desc_mapping;
struct bnxt_ring *rx_ring_struct;
struct bnxt_ring *ag_ring_struct;
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index 5b0971141..8d23b3386 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -49,7 +49,7 @@ struct bnxt_tx_ring_info {
struct tx_bd_long *tx_desc_ring;
struct bnxt_sw_tx_bd *tx_buf_ring;
- phys_addr_t tx_desc_mapping;
+ iova_addr_t tx_desc_mapping;
#define BNXT_DEV_STATE_CLOSING 0x1
uint32_t dev_state;
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index db9fb0796..90809f0f5 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -174,7 +174,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
BNXT_MAX_MC_ADDRS * ETHER_ADDR_LEN);
uint16_t max_vnics;
int i;
- phys_addr_t mz_phys_addr;
+ iova_addr_t mz_phys_addr;
max_vnics = bp->max_vnics;
snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
diff --git a/drivers/net/bnxt/bnxt_vnic.h b/drivers/net/bnxt/bnxt_vnic.h
index 993f22127..9d3dccea0 100644
--- a/drivers/net/bnxt/bnxt_vnic.h
+++ b/drivers/net/bnxt/bnxt_vnic.h
@@ -53,11 +53,11 @@ struct bnxt_vnic_info {
uint16_t dflt_ring_grp;
uint16_t mru;
uint16_t hash_type;
- phys_addr_t rss_table_dma_addr;
+ iova_addr_t rss_table_dma_addr;
uint16_t *rss_table;
- phys_addr_t rss_hash_key_dma_addr;
+ iova_addr_t rss_hash_key_dma_addr;
void *rss_hash_key;
- phys_addr_t mc_list_dma_addr;
+ iova_addr_t mc_list_dma_addr;
char *mc_list;
uint32_t mc_addr_cnt;
#define BNXT_MAX_MC_ADDRS 16
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 2bbb893c2..5156ac08d 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -1744,7 +1744,7 @@ lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
} else {
struct lio_buf_free_info *finfo;
struct lio_gather *g;
- phys_addr_t phyaddr;
+ iova_addr_t phyaddr;
int i, frags;
finfo = (struct lio_buf_free_info *)rte_malloc(NULL,
diff --git a/drivers/net/liquidio/lio_rxtx.h b/drivers/net/liquidio/lio_rxtx.h
index 85685dc7d..b0977f17b 100644
--- a/drivers/net/liquidio/lio_rxtx.h
+++ b/drivers/net/liquidio/lio_rxtx.h
@@ -686,7 +686,7 @@ lio_swap_8B_data(uint64_t *data, uint32_t blocks)
static inline uint64_t
lio_map_ring(void *buf)
{
- phys_addr_t dma_addr;
+ iova_addr_t dma_addr;
dma_addr = rte_mbuf_data_dma_addr_default(((struct rte_mbuf *)buf));
@@ -696,7 +696,7 @@ lio_map_ring(void *buf)
static inline uint64_t
lio_map_ring_info(struct lio_droq *droq, uint32_t i)
{
- phys_addr_t dma_addr;
+ iova_addr_t dma_addr;
dma_addr = droq->info_list_dma + (i * LIO_DROQ_INFO_SIZE);
diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index 3acf8f7c4..b45cec282 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -60,7 +60,7 @@ typedef u32 OSAL_BE32;
#define osal_uintptr_t uintptr_t
-typedef phys_addr_t dma_addr_t;
+typedef iova_addr_t dma_addr_t;
typedef rte_spinlock_t osal_spinlock_t;
diff --git a/drivers/net/sfc/efsys.h b/drivers/net/sfc/efsys.h
index 0405d02bb..5a6625008 100644
--- a/drivers/net/sfc/efsys.h
+++ b/drivers/net/sfc/efsys.h
@@ -253,7 +253,7 @@ typedef struct __efsys_identifier_s efsys_identifier_t;
/* DMA */
-typedef phys_addr_t efsys_dma_addr_t;
+typedef iova_addr_t efsys_dma_addr_t;
typedef struct efsys_mem_s {
const struct rte_memzone *esm_mz;
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index 60812cbe0..007af1f35 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -177,7 +177,7 @@ sfc_ef10_rx_qrefill(struct sfc_ef10_rxq *rxq)
++i, ++id) {
struct rte_mbuf *m = objs[i];
struct sfc_ef10_rx_sw_desc *rxd;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
SFC_ASSERT((id & ~ptr_mask) == 0);
rxd = &rxq->sw_ring[id];
diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c
index da2b5edbc..0e26a1d7f 100644
--- a/drivers/net/sfc/sfc_ef10_tx.c
+++ b/drivers/net/sfc/sfc_ef10_tx.c
@@ -177,7 +177,7 @@ sfc_ef10_tx_reap(struct sfc_ef10_txq *txq)
}
static void
-sfc_ef10_tx_qdesc_dma_create(phys_addr_t addr, uint16_t size, bool eop,
+sfc_ef10_tx_qdesc_dma_create(iova_addr_t addr, uint16_t size, bool eop,
efx_qword_t *edp)
{
EFX_POPULATE_QWORD_4(*edp,
@@ -323,7 +323,7 @@ sfc_ef10_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
pkt_len = m_seg->pkt_len;
do {
- phys_addr_t seg_addr = rte_mbuf_data_dma_addr(m_seg);
+ iova_addr_t seg_addr = rte_mbuf_data_dma_addr(m_seg);
unsigned int seg_len = rte_pktmbuf_data_len(m_seg);
SFC_ASSERT(seg_len <= SFC_EF10_TX_DMA_DESC_LEN_MAX);
diff --git a/drivers/net/thunderx/base/nicvf_hw.c b/drivers/net/thunderx/base/nicvf_hw.c
index 2634285eb..dc0af1ca0 100644
--- a/drivers/net/thunderx/base/nicvf_hw.c
+++ b/drivers/net/thunderx/base/nicvf_hw.c
@@ -509,7 +509,7 @@ nicvf_qset_rbdr_precharge(void *dev, struct nicvf *nic,
struct rbdr_entry_t *desc, *desc0;
struct nicvf_rbdr *rbdr = nic->rbdr;
uint32_t count;
- nicvf_phys_addr_t phy;
+ nicvf_iova_addr_t phy;
assert(rbdr != NULL);
desc = rbdr->desc;
diff --git a/drivers/net/thunderx/base/nicvf_hw.h b/drivers/net/thunderx/base/nicvf_hw.h
index b7d0a3dc5..698aa4878 100644
--- a/drivers/net/thunderx/base/nicvf_hw.h
+++ b/drivers/net/thunderx/base/nicvf_hw.h
@@ -88,7 +88,7 @@ enum nicvf_err_e {
NICVF_ERR_RSS_GET_SZ, /* -8171 */
};
-typedef nicvf_phys_addr_t (*rbdr_pool_get_handler)(void *dev, void *opaque);
+typedef nicvf_iova_addr_t (*rbdr_pool_get_handler)(void *dev, void *opaque);
struct nicvf_hw_rx_qstats {
uint64_t q_rx_bytes;
diff --git a/drivers/net/thunderx/base/nicvf_hw_defs.h b/drivers/net/thunderx/base/nicvf_hw_defs.h
index 0fe673e6d..e7e092b61 100644
--- a/drivers/net/thunderx/base/nicvf_hw_defs.h
+++ b/drivers/net/thunderx/base/nicvf_hw_defs.h
@@ -213,7 +213,7 @@
#define NICVF_STATIC_ASSERT(s) _Static_assert(s, #s)
#define assert_primary(nic) assert((nic)->sqs_mode == 0)
-typedef uint64_t nicvf_phys_addr_t;
+typedef uint64_t nicvf_iova_addr_t;
/* vNIC HW Enumerations */
@@ -840,7 +840,7 @@ struct rbdr_entry_t {
uint64_t buf_addr:42;
uint64_t cache_align:7;
};
- nicvf_phys_addr_t full_addr;
+ nicvf_iova_addr_t full_addr;
};
#else
union {
@@ -849,7 +849,7 @@ struct rbdr_entry_t {
uint64_t buf_addr:42;
uint64_t rsvd0:15;
};
- nicvf_phys_addr_t full_addr;
+ nicvf_iova_addr_t full_addr;
};
#endif
};
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index edc17f1d4..11259808a 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -677,7 +677,7 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic,
static void
nicvf_rbdr_release_mbuf(struct rte_eth_dev *dev, struct nicvf *nic,
- nicvf_phys_addr_t phy)
+ nicvf_iova_addr_t phy)
{
uint16_t qidx;
void *obj;
@@ -1419,7 +1419,7 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
};
}
-static nicvf_phys_addr_t
+static nicvf_iova_addr_t
rbdr_rte_mempool_get(void *dev, void *opaque)
{
uint16_t qidx;
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index 3734430f5..6909082f5 100644
--- a/drivers/net/thunderx/nicvf_ethdev.h
+++ b/drivers/net/thunderx/nicvf_ethdev.h
@@ -104,7 +104,7 @@ nicvf_netdev_qidx(struct nicvf *nic, uint8_t local_qidx)
* P = V - offset
*/
static inline uintptr_t
-nicvf_mbuff_phy2virt(phys_addr_t phy, uint64_t mbuf_phys_off)
+nicvf_mbuff_phy2virt(iova_addr_t phy, uint64_t mbuf_phys_off)
{
return (uintptr_t)(phy + mbuf_phys_off);
}
@@ -112,7 +112,7 @@ nicvf_mbuff_phy2virt(phys_addr_t phy, uint64_t mbuf_phys_off)
static inline uintptr_t
nicvf_mbuff_virt2phy(uintptr_t virt, uint64_t mbuf_phys_off)
{
- return (phys_addr_t)(virt - mbuf_phys_off);
+ return (iova_addr_t)(virt - mbuf_phys_off);
}
static inline void
diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h
index 4ee6c3bb0..edd2587d9 100644
--- a/drivers/net/thunderx/nicvf_struct.h
+++ b/drivers/net/thunderx/nicvf_struct.h
@@ -46,7 +46,7 @@ struct nicvf_rbdr {
uintptr_t rbdr_status;
uintptr_t rbdr_door;
struct rbdr_entry_t *desc;
- nicvf_phys_addr_t phys;
+ nicvf_iova_addr_t phys;
uint32_t buffsz;
uint32_t tail;
uint32_t next_tail;
@@ -56,7 +56,7 @@ struct nicvf_rbdr {
struct nicvf_txq {
union sq_entry_t *desc;
- nicvf_phys_addr_t phys;
+ nicvf_iova_addr_t phys;
struct rte_mbuf **txbuffs;
uintptr_t sq_head;
uintptr_t sq_door;
@@ -87,7 +87,7 @@ struct nicvf_rxq {
uintptr_t cq_status;
uintptr_t cq_door;
union mbuf_initializer mbuf_initializer;
- nicvf_phys_addr_t phys;
+ nicvf_iova_addr_t phys;
union cq_entry_t *desc;
struct nicvf_rbdr *shared_rbdr;
struct nicvf *nic;
diff --git a/drivers/net/virtio/virtio_rxtx.h b/drivers/net/virtio/virtio_rxtx.h
index 28f82d6a8..b072a8c39 100644
--- a/drivers/net/virtio/virtio_rxtx.h
+++ b/drivers/net/virtio/virtio_rxtx.h
@@ -66,7 +66,7 @@ struct virtnet_tx {
struct virtqueue *vq;
/**< memzone to populate hdr. */
const struct rte_memzone *virtio_net_hdr_mz;
- phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
+ iova_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
uint16_t queue_id; /**< DPDK queue index. */
uint8_t port_id; /**< Device port identifier. */
@@ -81,7 +81,7 @@ struct virtnet_ctl {
struct virtqueue *vq;
/**< memzone to populate hdr. */
const struct rte_memzone *virtio_net_hdr_mz;
- phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
+ iova_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
uint8_t port_id; /**< Device port identifier. */
const struct rte_memzone *mz; /**< mem zone to populate RX ring. */
};
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 2e1208615..cb1b2a6e9 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -204,7 +204,7 @@ struct virtqueue {
struct virtnet_ctl cq;
};
- phys_addr_t vq_ring_mem; /**< physical address of vring,
+ iova_addr_t vq_ring_mem; /**< physical address of vring,
* or virtual address for virtio_user. */
/**
diff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c
index e404b7755..8818e39ef 100644
--- a/drivers/net/xenvirt/rte_eth_xenvirt.c
+++ b/drivers/net/xenvirt/rte_eth_xenvirt.c
@@ -378,7 +378,7 @@ gntalloc_vring_create(int queue_type, uint32_t size, int vtidx)
int pg_size;
uint32_t pg_num;
uint32_t *gref_arr = NULL;
- phys_addr_t *pa_arr = NULL;
+ iova_addr_t *pa_arr = NULL;
uint64_t start_index;
int rv;
diff --git a/drivers/net/xenvirt/rte_mempool_gntalloc.c b/drivers/net/xenvirt/rte_mempool_gntalloc.c
index 73e82f808..80aebd564 100644
--- a/drivers/net/xenvirt/rte_mempool_gntalloc.c
+++ b/drivers/net/xenvirt/rte_mempool_gntalloc.c
@@ -49,7 +49,7 @@
struct _gntarr {
uint32_t gref;
- phys_addr_t pa;
+ iova_addr_t pa;
uint64_t index;
void *va;
};
@@ -58,7 +58,7 @@ struct _mempool_gntalloc_info {
struct rte_mempool *mp;
uint32_t pg_num;
uint32_t *gref_arr;
- phys_addr_t *pa_arr;
+ iova_addr_t *pa_arr;
void *va;
uint32_t mempool_idx;
uint64_t start_index;
@@ -94,7 +94,7 @@ _create_mempool(const char *name, unsigned elt_num, unsigned elt_size,
* gnt_arr: stores all meta dat
*/
uint32_t *gref_arr = NULL;
- phys_addr_t *pa_arr = NULL;
+ iova_addr_t *pa_arr = NULL;
struct _gntarr *gnt_arr = NULL;
/* start index of the grant referances, used for dealloc*/
uint64_t start_index;
diff --git a/drivers/net/xenvirt/rte_xen_lib.c b/drivers/net/xenvirt/rte_xen_lib.c
index 6c9a1d49e..0e330a8e4 100644
--- a/drivers/net/xenvirt/rte_xen_lib.c
+++ b/drivers/net/xenvirt/rte_xen_lib.c
@@ -102,7 +102,7 @@ get_xen_virtual(size_t size, size_t page_sz)
* Get the physical address for virtual memory starting at va.
*/
int
-get_phys_map(void *va, phys_addr_t pa[], uint32_t pg_num, uint32_t pg_sz)
+get_phys_map(void *va, iova_addr_t pa[], uint32_t pg_num, uint32_t pg_sz)
{
int32_t fd, rc = 0;
uint32_t i, nb;
@@ -355,7 +355,7 @@ xenstore_write(const char *key_str, const char *val_str)
}
int
-grant_node_create(uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, char *val_str, size_t str_size)
+grant_node_create(uint32_t pg_num, uint32_t *gref_arr, iova_addr_t *pa_arr, char *val_str, size_t str_size)
{
uint64_t start_index;
int pg_size;
@@ -419,7 +419,7 @@ grant_node_create(uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, char
int
-grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, int mempool_idx)
+grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *gref_arr, iova_addr_t *pa_arr, int mempool_idx)
{
char key_str[PATH_MAX] = {0};
char val_str[PATH_MAX] = {0};
diff --git a/drivers/net/xenvirt/rte_xen_lib.h b/drivers/net/xenvirt/rte_xen_lib.h
index d973eacbb..3b487c305 100644
--- a/drivers/net/xenvirt/rte_xen_lib.h
+++ b/drivers/net/xenvirt/rte_xen_lib.h
@@ -62,7 +62,7 @@
* Documentation).
*/
#define PAGEMAP_PFN_BITS 54
-#define PAGEMAP_PFN_MASK RTE_LEN2MASK(PAGEMAP_PFN_BITS, phys_addr_t)
+#define PAGEMAP_PFN_MASK RTE_LEN2MASK(PAGEMAP_PFN_BITS, iova_addr_t)
#define MAP_FLAG 0xA5
@@ -99,7 +99,7 @@ int
xenstore_write(const char *key_str, const char *val_str);
int
-get_phys_map(void *va, phys_addr_t pa[], uint32_t pg_num, uint32_t pg_sz);
+get_phys_map(void *va, iova_addr_t pa[], uint32_t pg_num, uint32_t pg_sz);
void *
get_xen_virtual(size_t size, size_t page_sz);
@@ -108,9 +108,9 @@ int
grefwatch_from_alloc(uint32_t *gref, void **pptr);
-int grant_node_create(uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, char *val_str, size_t str_size);
+int grant_node_create(uint32_t pg_num, uint32_t *gref_arr, iova_addr_t *pa_arr, char *val_str, size_t str_size);
int
-grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, int mempool_idx);
+grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *gref_arr, iova_addr_t *pa_arr, int mempool_idx);
#endif
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index f020be32d..985baaf51 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -139,7 +139,7 @@ enum l2fwd_crypto_xform_chain {
struct l2fwd_key {
uint8_t *data;
uint32_t length;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
};
struct l2fwd_iv {
diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte_crypto.h
index 10fe0804b..363d1a7e5 100644
--- a/lib/librte_cryptodev/rte_crypto.h
+++ b/lib/librte_cryptodev/rte_crypto.h
@@ -117,7 +117,7 @@ struct rte_crypto_op {
struct rte_mempool *mempool;
/**< crypto operation mempool which operation is allocated from */
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
/**< physical address of crypto operation */
RTE_STD_C11
diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h
index 0ceaa9176..ddb68246c 100644
--- a/lib/librte_cryptodev/rte_crypto_sym.h
+++ b/lib/librte_cryptodev/rte_crypto_sym.h
@@ -543,7 +543,7 @@ struct rte_crypto_sym_op {
* For GCM (@ref RTE_CRYPTO_AEAD_AES_GCM), for
* "digest result" read "authentication tag T".
*/
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
/**< Physical address of digest */
} digest; /**< Digest parameters */
struct {
@@ -579,7 +579,7 @@ struct rte_crypto_sym_op {
* of the block size (16 bytes).
*
*/
- phys_addr_t phys_addr; /**< physical address */
+ iova_addr_t phys_addr; /**< physical address */
} aad;
/**< Additional authentication parameters */
} aead;
@@ -676,7 +676,7 @@ struct rte_crypto_sym_op {
* will overwrite any data at this location.
*
*/
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
/**< Physical address of digest */
} digest; /**< Digest parameters */
} auth;
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index 7ec9c4bc4..cfa32cbbc 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -111,7 +111,7 @@ extern const char **rte_cyptodev_names;
* to calculate address from.
*/
#define rte_crypto_op_ctophys_offset(c, o) \
- (phys_addr_t)((c)->phys_addr + (o))
+ (iova_addr_t)((c)->phys_addr + (o))
/**
* Crypto parameters range description
diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index 3614da8db..10c2e121f 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -50,7 +50,7 @@
/*
* Get physical address of any mapped virtual address in the current process.
*/
-phys_addr_t
+iova_addr_t
rte_mem_virt2phy(const void *virtaddr)
{
/* XXX not implemented. This function is only used by
@@ -73,7 +73,7 @@ rte_eal_hugepage_init(void)
/* for debug purposes, hugetlbfs can be disabled */
if (internal_config.no_hugetlbfs) {
addr = malloc(internal_config.memory);
- mcfg->memseg[0].phys_addr = (phys_addr_t)(uintptr_t)addr;
+ mcfg->memseg[0].phys_addr = (iova_addr_t)(uintptr_t)addr;
mcfg->memseg[0].addr = addr;
mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
mcfg->memseg[0].len = internal_config.memory;
diff --git a/lib/librte_eal/common/include/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h
index 3d37f79b8..491b479b1 100644
--- a/lib/librte_eal/common/include/rte_malloc.h
+++ b/lib/librte_eal/common/include/rte_malloc.h
@@ -332,7 +332,7 @@ rte_malloc_set_limit(const char *type, size_t max);
* RTE_BAD_PHYS_ADDR on error
* otherwise return physical address of the buffer
*/
-phys_addr_t
+iova_addr_t
rte_malloc_virt2phy(const void *addr);
#ifdef __cplusplus
diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index 4aa5d1f77..5face8c86 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -98,14 +98,14 @@ enum rte_page_sizes {
*/
#define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)
-typedef uint64_t phys_addr_t; /**< Physical address definition. */
-#define RTE_BAD_PHYS_ADDR ((phys_addr_t)-1)
+typedef uint64_t iova_addr_t; /**< Physical address definition. */
+#define RTE_BAD_PHYS_ADDR ((iova_addr_t)-1)
/**
* Physical memory segment descriptor.
*/
struct rte_memseg {
- phys_addr_t phys_addr; /**< Start physical address. */
+ iova_addr_t phys_addr; /**< Start physical address. */
RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
@@ -142,7 +142,7 @@ int rte_mem_lock_page(const void *virt);
* @return
* The physical address or RTE_BAD_PHYS_ADDR on error.
*/
-phys_addr_t rte_mem_virt2phy(const void *virt);
+iova_addr_t rte_mem_virt2phy(const void *virt);
/**
* Get the layout of the available physical memory.
@@ -201,7 +201,7 @@ unsigned rte_memory_get_nrank(void);
int rte_xen_dom0_supported(void);
/**< Internal use only - phys to virt mapping for xen */
-phys_addr_t rte_xen_mem_phy2mch(int32_t, const phys_addr_t);
+iova_addr_t rte_xen_mem_phy2mch(int32_t, const iova_addr_t);
/**
* Return the physical address of elt, which is an element of the pool mp.
@@ -215,8 +215,8 @@ phys_addr_t rte_xen_mem_phy2mch(int32_t, const phys_addr_t);
* @return
* The physical address or RTE_BAD_PHYS_ADDR on error.
*/
-static inline phys_addr_t
-rte_mem_phy2mch(int32_t memseg_id, const phys_addr_t phy_addr)
+static inline iova_addr_t
+rte_mem_phy2mch(int32_t memseg_id, const iova_addr_t phy_addr)
{
if (rte_xen_dom0_supported())
return rte_xen_mem_phy2mch(memseg_id, phy_addr);
@@ -251,8 +251,8 @@ static inline int rte_xen_dom0_supported(void)
return 0;
}
-static inline phys_addr_t
-rte_mem_phy2mch(int32_t memseg_id __rte_unused, const phys_addr_t phy_addr)
+static inline iova_addr_t
+rte_mem_phy2mch(int32_t memseg_id __rte_unused, const iova_addr_t phy_addr)
{
return phy_addr;
}
diff --git a/lib/librte_eal/common/include/rte_memzone.h b/lib/librte_eal/common/include/rte_memzone.h
index 1d0827f46..89b2adb6e 100644
--- a/lib/librte_eal/common/include/rte_memzone.h
+++ b/lib/librte_eal/common/include/rte_memzone.h
@@ -78,7 +78,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. */
- phys_addr_t phys_addr; /**< Start physical address. */
+ iova_addr_t phys_addr; /**< Start physical address. */
RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index 5c0627bf4..3ce6034bf 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -248,7 +248,7 @@ rte_malloc_set_limit(__rte_unused const char *type,
/*
* Return the physical address of a virtual address obtained through rte_malloc
*/
-phys_addr_t
+iova_addr_t
rte_malloc_virt2phy(const void *addr)
{
const struct malloc_elem *elem = malloc_elem_from_data(addr);
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 52791282f..405c15bcd 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -104,7 +104,7 @@ static void
test_phys_addrs_available(void)
{
uint64_t tmp;
- phys_addr_t physaddr;
+ iova_addr_t physaddr;
/* For dom0, phys addresses can always be available */
if (rte_xen_dom0_supported())
@@ -130,7 +130,7 @@ test_phys_addrs_available(void)
/*
* Get physical address of any mapped virtual address in the current process.
*/
-phys_addr_t
+iova_addr_t
rte_mem_virt2phy(const void *virtaddr)
{
int fd, retval;
@@ -219,7 +219,7 @@ static int
find_physaddrs(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
{
unsigned int i;
- phys_addr_t addr;
+ iova_addr_t addr;
for (i = 0; i < hpi->num_pages[0]; i++) {
addr = rte_mem_virt2phy(hugepg_tbl[i].orig_va);
@@ -237,7 +237,7 @@ static int
set_physaddrs(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
{
unsigned int i;
- static phys_addr_t addr;
+ static iova_addr_t addr;
for (i = 0; i < hpi->num_pages[0]; i++) {
hugepg_tbl[i].physaddr = addr;
diff --git a/lib/librte_eal/linuxapp/eal/eal_xen_memory.c b/lib/librte_eal/linuxapp/eal/eal_xen_memory.c
index 19db1cb5f..b2edd3ee1 100644
--- a/lib/librte_eal/linuxapp/eal/eal_xen_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_xen_memory.c
@@ -153,8 +153,8 @@ get_xen_memory_size(void)
/**
* Based on physical address to caculate MFN in Xen Dom0.
*/
-phys_addr_t
-rte_xen_mem_phy2mch(int32_t memseg_id, const phys_addr_t phy_addr)
+iova_addr_t
+rte_xen_mem_phy2mch(int32_t memseg_id, const iova_addr_t phy_addr)
{
int mfn_id, i;
uint64_t mfn, mfn_offset;
diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
index 2ac879fdd..efd9ac9a5 100644
--- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
+++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
@@ -73,6 +73,10 @@
#define RTE_CACHE_LINE_MIN_SIZE 64
+#ifdef __KERNEL__
+typedef uint64_t iova_addr_t;
+#endif
+
/*
* Request id.
*/
@@ -138,20 +142,20 @@ struct rte_kni_mbuf {
struct rte_kni_device_info {
char name[RTE_KNI_NAMESIZE]; /**< Network device name for KNI */
- phys_addr_t tx_phys;
- phys_addr_t rx_phys;
- phys_addr_t alloc_phys;
- phys_addr_t free_phys;
+ iova_addr_t tx_phys;
+ iova_addr_t rx_phys;
+ iova_addr_t alloc_phys;
+ iova_addr_t free_phys;
/* Used by Ethtool */
- phys_addr_t req_phys;
- phys_addr_t resp_phys;
- phys_addr_t sync_phys;
+ iova_addr_t req_phys;
+ iova_addr_t resp_phys;
+ iova_addr_t sync_phys;
void * sync_va;
/* mbuf mempool */
void * mbuf_va;
- phys_addr_t mbuf_phys;
+ iova_addr_t mbuf_phys;
/* PCI info */
uint16_t vendor_id; /**< Vendor ID or PCI_ANY_ID. */
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index eaed7eee0..4563b5dc3 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -411,7 +411,7 @@ struct rte_mbuf {
* same mbuf cacheline0 layout for 32-bit and 64-bit. This makes
* working on vector drivers easier.
*/
- phys_addr_t buf_physaddr __rte_aligned(sizeof(phys_addr_t));
+ iova_addr_t buf_physaddr __rte_aligned(sizeof(iova_addr_t));
/* next 8 bytes are initialised on RX descriptor rearm */
MARKER64 rearm_data;
@@ -594,7 +594,7 @@ static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp);
* @return
* The physical address of the beginning of the mbuf data
*/
-static inline phys_addr_t
+static inline iova_addr_t
rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
{
return mb->buf_physaddr + mb->data_off;
@@ -612,7 +612,7 @@ rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
* @return
* The physical address of the beginning of the mbuf data
*/
-static inline phys_addr_t
+static inline iova_addr_t
rte_mbuf_data_dma_addr_default(const struct rte_mbuf *mb)
{
return mb->buf_physaddr + RTE_PKTMBUF_HEADROOM;
@@ -1533,7 +1533,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)
* The offset into the data to calculate address from.
*/
#define rte_pktmbuf_mtophys_offset(m, o) \
- (phys_addr_t)((m)->buf_physaddr + (m)->data_off + (o))
+ (iova_addr_t)((m)->buf_physaddr + (m)->data_off + (o))
/**
* A macro that returns the physical address that points to the start of the
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 6fc3c9c7c..b4f14cf61 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -128,7 +128,7 @@ static unsigned optimize_object_size(unsigned obj_size)
}
static void
-mempool_add_elem(struct rte_mempool *mp, void *obj, phys_addr_t physaddr)
+mempool_add_elem(struct rte_mempool *mp, void *obj, iova_addr_t physaddr)
{
struct rte_mempool_objhdr *hdr;
struct rte_mempool_objtlr *tlr __rte_unused;
@@ -263,11 +263,11 @@ rte_mempool_xmem_size(uint32_t elt_num, size_t total_elt_sz, uint32_t pg_shift)
*/
ssize_t
rte_mempool_xmem_usage(__rte_unused void *vaddr, uint32_t elt_num,
- size_t total_elt_sz, const phys_addr_t paddr[], uint32_t pg_num,
+ size_t total_elt_sz, const iova_addr_t paddr[], uint32_t pg_num,
uint32_t pg_shift)
{
uint32_t elt_cnt = 0;
- phys_addr_t start, end;
+ iova_addr_t start, end;
uint32_t paddr_idx;
size_t pg_sz = (size_t)1 << pg_shift;
@@ -345,7 +345,7 @@ rte_mempool_free_memchunks(struct rte_mempool *mp)
*/
int
rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
- phys_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
+ iova_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque)
{
unsigned total_elt_sz;
@@ -409,7 +409,7 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
*/
int
rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
+ const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque)
{
uint32_t i, n;
@@ -452,7 +452,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
size_t len, size_t pg_sz, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque)
{
- phys_addr_t paddr;
+ iova_addr_t paddr;
size_t off, phys_len;
int ret, cnt = 0;
@@ -483,7 +483,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
/* populate with the largest group of contiguous pages */
for (phys_len = pg_sz; off + phys_len < len; phys_len += pg_sz) {
- phys_addr_t paddr_tmp;
+ iova_addr_t paddr_tmp;
paddr_tmp = rte_mem_virt2phy(addr + off + phys_len);
paddr_tmp = rte_mem_phy2mch(-1, paddr_tmp);
@@ -519,7 +519,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)
char mz_name[RTE_MEMZONE_NAMESIZE];
const struct rte_memzone *mz;
size_t size, total_elt_sz, align, pg_sz, pg_shift;
- phys_addr_t paddr;
+ iova_addr_t paddr;
unsigned mz_id, n;
int ret;
@@ -922,7 +922,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
rte_mempool_ctor_t *mp_init, void *mp_init_arg,
rte_mempool_obj_cb_t *obj_init, void *obj_init_arg,
int socket_id, unsigned flags, void *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift)
+ const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift)
{
struct rte_mempool *mp = NULL;
int ret;
diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index 76b5b3b15..1bcb6ebd7 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -157,7 +157,7 @@ struct rte_mempool_objsz {
struct rte_mempool_objhdr {
STAILQ_ENTRY(rte_mempool_objhdr) next; /**< Next in list. */
struct rte_mempool *mp; /**< The mempool owning the object. */
- phys_addr_t physaddr; /**< Physical address of the object. */
+ iova_addr_t physaddr; /**< Physical address of the object. */
#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
uint64_t cookie; /**< Debug cookie. */
#endif
@@ -203,7 +203,7 @@ struct rte_mempool_memhdr {
STAILQ_ENTRY(rte_mempool_memhdr) next; /**< Next in list. */
struct rte_mempool *mp; /**< The mempool owning the chunk */
void *addr; /**< Virtual address of the chunk */
- phys_addr_t phys_addr; /**< Physical address of the chunk */
+ iova_addr_t phys_addr; /**< Physical address of the chunk */
size_t len; /**< length of the chunk */
rte_mempool_memchunk_free_cb_t *free_cb; /**< Free callback */
void *opaque; /**< Argument passed to the free callback */
@@ -739,7 +739,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
rte_mempool_ctor_t *mp_init, void *mp_init_arg,
rte_mempool_obj_cb_t *obj_init, void *obj_init_arg,
int socket_id, unsigned flags, void *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift);
+ const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift);
/**
* Create an empty mempool
@@ -820,7 +820,7 @@ rte_mempool_free(struct rte_mempool *mp);
* mempool and a negative errno is returned.
*/
int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
- phys_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
+ iova_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque);
/**
@@ -851,7 +851,7 @@ int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
* mempool and a negative errno is returned.
*/
int rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
+ const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque);
/**
@@ -1394,7 +1394,7 @@ rte_mempool_empty(const struct rte_mempool *mp)
* If the mempool was created with MEMPOOL_F_NO_PHYS_CONTIG, the
* returned value is RTE_BAD_PHYS_ADDR.
*/
-static inline phys_addr_t
+static inline iova_addr_t
rte_mempool_virt2phy(__rte_unused const struct rte_mempool *mp, const void *elt)
{
const struct rte_mempool_objhdr *hdr;
@@ -1523,7 +1523,7 @@ size_t rte_mempool_xmem_size(uint32_t elt_num, size_t total_elt_sz,
* is the actual number of elements that can be stored in that buffer.
*/
ssize_t rte_mempool_xmem_usage(void *vaddr, uint32_t elt_num,
- size_t total_elt_sz, const phys_addr_t paddr[], uint32_t pg_num,
+ size_t total_elt_sz, const iova_addr_t paddr[], uint32_t pg_num,
uint32_t pg_shift);
/**
diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index 6fe72aeb6..2481599ba 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -281,7 +281,7 @@ extern uint64_t VHOST_FEATURES;
extern struct virtio_net *vhost_devices[MAX_VHOST_DEVICE];
/* Convert guest physical address to host physical address */
-static __rte_always_inline phys_addr_t
+static __rte_always_inline iova_addr_t
gpa_to_hpa(struct virtio_net *dev, uint64_t gpa, uint64_t size)
{
uint32_t i;
diff --git a/test/test/test_cryptodev.h b/test/test/test_cryptodev.h
index 4509a09ad..7a6175740 100644
--- a/test/test/test_cryptodev.h
+++ b/test/test/test_cryptodev.h
@@ -152,7 +152,7 @@ pktmbuf_mtod_offset(struct rte_mbuf *mbuf, int offset) {
return rte_pktmbuf_mtod_offset(m, uint8_t *, offset);
}
-static inline phys_addr_t
+static inline iova_addr_t
pktmbuf_mtophys_offset(struct rte_mbuf *mbuf, int offset) {
struct rte_mbuf *m;
diff --git a/test/test/test_memzone.c b/test/test/test_memzone.c
index 7ae31cf74..0afb159e9 100644
--- a/test/test/test_memzone.c
+++ b/test/test/test_memzone.c
@@ -78,7 +78,7 @@
/* Test if memory overlaps: return 1 if true, or 0 if false. */
static int
-is_memory_overlap(phys_addr_t ptr1, size_t len1, phys_addr_t ptr2, size_t len2)
+is_memory_overlap(iova_addr_t ptr1, size_t len1, iova_addr_t ptr2, size_t len2)
{
if (ptr2 >= ptr1 && (ptr2 - ptr1) < len1)
return 1;
@@ -601,9 +601,9 @@ check_memzone_bounded(const char *name, uint32_t len, uint32_t align,
uint32_t bound)
{
const struct rte_memzone *mz;
- phys_addr_t bmask;
+ iova_addr_t bmask;
- bmask = ~((phys_addr_t)bound - 1);
+ bmask = ~((iova_addr_t)bound - 1);
if ((mz = rte_memzone_reserve_bounded(name, len, SOCKET_ID_ANY, 0,
align, bound)) == NULL) {
@@ -612,7 +612,7 @@ check_memzone_bounded(const char *name, uint32_t len, uint32_t align,
return -1;
}
- if ((mz->phys_addr & ((phys_addr_t)align - 1)) != 0) {
+ if ((mz->phys_addr & ((iova_addr_t)align - 1)) != 0) {
printf("%s(%s): invalid phys addr alignment\n",
__func__, mz->name);
return -1;
--
2.11.0
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v2 2/5] eal/memory: rename buf_physaddr to buf_iovaaddr
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Santosh Shukla
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 1/5] eal: rename phys_addr_t to iova_addr_t Santosh Shukla
@ 2017-09-05 10:31 ` Santosh Shukla
2017-09-18 15:20 ` Burakov, Anatoly
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 3/5] eal/memory: rename memseg member phys to iova addr Santosh Shukla
` (4 subsequent siblings)
6 siblings, 1 reply; 91+ messages in thread
From: Santosh Shukla @ 2017-09-05 10:31 UTC (permalink / raw)
To: dev; +Cc: thomas, jerin.jacob, hemant.agrawal, olivier.matz, Santosh Shukla
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
v1 notes:
Since crux of change is at eal/memory area so using that as
title.
doc/guides/prog_guide/img/mbuf1.svg | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 +-
drivers/net/ark/ark_ethdev_rx.c | 8 ++++----
drivers/net/bnx2x/bnx2x_rxtx.c | 4 ++--
drivers/net/bnxt/bnxt_ring.h | 2 +-
drivers/net/cxgbe/sge.c | 4 ++--
drivers/net/ena/ena_ethdev.c | 6 +++---
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_rxtx.c | 6 +++---
drivers/net/fm10k/fm10k.h | 4 ++--
drivers/net/fm10k/fm10k_rxtx_vec.c | 4 ++--
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 4 ++--
drivers/net/i40e/i40e_rxtx_vec_neon.c | 6 +++---
drivers/net/i40e/i40e_rxtx_vec_sse.c | 6 +++---
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 6 +++---
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 6 +++---
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtqueue.h | 2 +-
.../linuxapp/eal/include/exec-env/rte_kni_common.h | 2 +-
lib/librte_eal/linuxapp/kni/kni_net.c | 6 +++---
lib/librte_kni/rte_kni.c | 2 +-
lib/librte_mbuf/rte_mbuf.c | 6 +++---
lib/librte_mbuf/rte_mbuf.h | 14 +++++++-------
lib/librte_vhost/virtio_net.c | 2 +-
test/test/test_mbuf.c | 2 +-
26 files changed, 56 insertions(+), 56 deletions(-)
diff --git a/doc/guides/prog_guide/img/mbuf1.svg b/doc/guides/prog_guide/img/mbuf1.svg
index 5bd84d1bf..2f856bfd9 100644
--- a/doc/guides/prog_guide/img/mbuf1.svg
+++ b/doc/guides/prog_guide/img/mbuf1.svg
@@ -482,7 +482,7 @@
sodipodi:role="line"
x="187.85715"
y="347.7193"
- id="tspan5240">(m->buf_physaddr is the</tspan><tspan
+ id="tspan5240">(m->buf_iovaaddr is the</tspan><tspan
sodipodi:role="line"
x="187.85715"
y="360.2193"
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 184c7069d..15e3878eb 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -309,7 +309,7 @@ static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr)
* These routines are called with help of below MACRO's
*/
-#define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_physaddr)
+#define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_iovaaddr)
#define DPAA2_OP_VADDR_TO_IOVA(op) (op->phys_addr)
/**
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 1cbda01a7..90cf304c0 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -500,22 +500,22 @@ eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue)
case 0:
while (count != nb) {
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iovaaddr;
count++;
/* FALLTHROUGH */
case 3:
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iovaaddr;
count++;
/* FALLTHROUGH */
case 2:
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iovaaddr;
count++;
/* FALLTHROUGH */
case 1:
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iovaaddr;
count++;
/* FALLTHROUGH */
diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c
index 7336124fc..e558bb12c 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.c
+++ b/drivers/net/bnx2x/bnx2x_rxtx.c
@@ -140,7 +140,7 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
return -ENOMEM;
}
rxq->sw_ring[idx] = mbuf;
- rxq->rx_ring[idx] = mbuf->buf_physaddr;
+ rxq->rx_ring[idx] = mbuf->buf_iovaaddr;
}
rxq->pkt_first_seg = NULL;
rxq->pkt_last_seg = NULL;
@@ -400,7 +400,7 @@ bnx2x_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
rx_mb = rxq->sw_ring[bd_cons];
rxq->sw_ring[bd_cons] = new_mb;
- rxq->rx_ring[bd_prod] = new_mb->buf_physaddr;
+ rxq->rx_ring[bd_prod] = new_mb->buf_iovaaddr;
rx_pref = NEXT_RX_BD(bd_cons) & MAX_RX_BD(rxq);
rte_prefetch0(rxq->sw_ring[rx_pref]);
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index 09042cb80..79504af24 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -41,7 +41,7 @@
#define RING_NEXT(ring, idx) (((idx) + 1) & (ring)->ring_mask)
#define RTE_MBUF_DATA_DMA_ADDR(mb) \
- ((uint64_t)((mb)->buf_physaddr + (mb)->data_off))
+ ((uint64_t)((mb)->buf_iovaaddr + (mb)->data_off))
#define DB_IDX_MASK 0xffffff
#define DB_IDX_VALID (0x1 << 26)
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index 5376fc500..d867914ab 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -149,7 +149,7 @@ static int map_mbuf(struct rte_mbuf *mbuf, dma_addr_t *addr)
struct rte_mbuf *m = mbuf;
for (; m; m = m->next, addr++) {
- *addr = m->buf_physaddr + rte_pktmbuf_headroom(m);
+ *addr = m->buf_iovaaddr + rte_pktmbuf_headroom(m);
if (*addr == 0)
goto out_err;
}
@@ -423,7 +423,7 @@ static unsigned int refill_fl_usembufs(struct adapter *adap, struct sge_fl *q,
mbuf->nb_segs = 1;
mbuf->port = rxq->rspq.port_id;
- mapping = (dma_addr_t)RTE_ALIGN(mbuf->buf_physaddr +
+ mapping = (dma_addr_t)RTE_ALIGN(mbuf->buf_iovaaddr +
mbuf->data_off,
adap->sge.fl_align);
mapping |= buf_size_idx;
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 80ce1f353..12450f300 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1166,7 +1166,7 @@ static int ena_populate_rx_queue(struct ena_ring *rxq, unsigned int count)
rte_prefetch0(mbufs[((next_to_use + 4) & ring_mask)]);
/* prepare physical address for DMA transaction */
- ebuf.paddr = mbuf->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ ebuf.paddr = mbuf->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
ebuf.len = mbuf->buf_len - RTE_PKTMBUF_HEADROOM;
/* pass resource to device */
rc = ena_com_add_single_rx_desc(rxq->ena_com_io_sq,
@@ -1725,7 +1725,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
* consideration pushed header
*/
if (mbuf->data_len > ena_tx_ctx.header_len) {
- ebuf->paddr = mbuf->buf_physaddr +
+ ebuf->paddr = mbuf->buf_iovaaddr +
mbuf->data_off +
ena_tx_ctx.header_len;
ebuf->len = mbuf->data_len - ena_tx_ctx.header_len;
@@ -1734,7 +1734,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
}
while ((mbuf = mbuf->next) != NULL) {
- ebuf->paddr = mbuf->buf_physaddr + mbuf->data_off;
+ ebuf->paddr = mbuf->buf_iovaaddr + mbuf->data_off;
ebuf->len = mbuf->data_len;
ebuf++;
tx_info->num_of_bufs++;
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 40dbec7fa..7801a8b31 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -313,7 +313,7 @@ enic_alloc_rx_queue_mbufs(struct enic *enic, struct vnic_rq *rq)
}
mb->data_off = RTE_PKTMBUF_HEADROOM;
- dma_addr = (dma_addr_t)(mb->buf_physaddr
+ dma_addr = (dma_addr_t)(mb->buf_iovaaddr
+ RTE_PKTMBUF_HEADROOM);
rq_enet_desc_enc(rqd, dma_addr,
(rq->is_sop ? RQ_ENET_TYPE_ONLY_SOP
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index a39172f14..95b1db1f9 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -386,7 +386,7 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
/* Push descriptor for newly allocated mbuf */
nmb->data_off = RTE_PKTMBUF_HEADROOM;
- dma_addr = (dma_addr_t)(nmb->buf_physaddr +
+ dma_addr = (dma_addr_t)(nmb->buf_iovaaddr +
RTE_PKTMBUF_HEADROOM);
rq_enet_desc_enc(rqd_ptr, dma_addr,
(rq->is_sop ? RQ_ENET_TYPE_ONLY_SOP
@@ -578,7 +578,7 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
vlan_id = 0;
vlan_tag_insert = 0;
bus_addr = (dma_addr_t)
- (tx_pkt->buf_physaddr + tx_pkt->data_off);
+ (tx_pkt->buf_iovaaddr + tx_pkt->data_off);
descs = (struct wq_enet_desc *)wq->ring.descs;
desc_p = descs + head_idx;
@@ -630,7 +630,7 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
if (tx_pkt->next == NULL)
eop = 1;
desc_p = descs + head_idx;
- bus_addr = (dma_addr_t)(tx_pkt->buf_physaddr
+ bus_addr = (dma_addr_t)(tx_pkt->buf_iovaaddr
+ tx_pkt->data_off);
wq_enet_desc_enc((struct wq_enet_desc *)
&desc_tmp, bus_addr, data_len,
diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h
index 8e1a95062..d3859fd61 100644
--- a/drivers/net/fm10k/fm10k.h
+++ b/drivers/net/fm10k/fm10k.h
@@ -252,11 +252,11 @@ struct fm10k_txq_ops {
};
#define MBUF_DMA_ADDR(mb) \
- ((uint64_t) ((mb)->buf_physaddr + (mb)->data_off))
+ ((uint64_t) ((mb)->buf_iovaaddr + (mb)->data_off))
/* enforce 512B alignment on default Rx DMA addresses */
#define MBUF_DMA_ADDR_DEFAULT(mb) \
- ((uint64_t) RTE_ALIGN(((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM),\
+ ((uint64_t) RTE_ALIGN(((mb)->buf_iovaaddr + RTE_PKTMBUF_HEADROOM),\
FM10K_RX_DATABUF_ALIGN))
static inline void fifo_reset(struct fifo *fifo, uint32_t len)
diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
index d23bfe9b7..5d40479da 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -330,8 +330,8 @@ fm10k_rxq_rearm(struct fm10k_rx_queue *rxq)
p1 = (uintptr_t)&mb1->rearm_data;
*(uint64_t *)p1 = rxq->mbuf_initializer;
- /* 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_iovaaddr(hi 64bit) */
+ RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iovaaddr) !=
offsetof(struct rte_mbuf, buf_addr) + 8);
vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr);
vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr);
diff --git a/drivers/net/i40e/i40e_rxtx_vec_altivec.c b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
index f4036ea28..242a479f0 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_altivec.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
@@ -100,7 +100,7 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq)
p1 = (uintptr_t)&mb1->rearm_data;
*(uint64_t *)p1 = rxq->mbuf_initializer;
- /* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */
+ /* load buf_addr(lo 64bit) and buf_iovaaddr(hi 64bit) */
vaddr0 = vec_ld(0, (vector unsigned long *)&mb0->buf_addr);
vaddr1 = vec_ld(0, (vector unsigned long *)&mb1->buf_addr);
@@ -538,7 +538,7 @@ vtx1(volatile struct i40e_tx_desc *txdp,
((uint64_t)pkt->data_len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT));
vector unsigned long descriptor = (vector unsigned long){
- pkt->buf_physaddr + pkt->data_off, high_qw};
+ pkt->buf_iovaaddr + pkt->data_off, high_qw};
*(vector unsigned long *)txdp = descriptor;
}
diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index 694e91f33..b858d9f1d 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -81,13 +81,13 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq)
mb0 = rxep[0].mbuf;
mb1 = rxep[1].mbuf;
- paddr = mb0->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb0->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
dma_addr0 = vdupq_n_u64(paddr);
/* flush desc with pa dma_addr */
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr0);
- paddr = mb1->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb1->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
dma_addr1 = vdupq_n_u64(paddr);
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr1);
}
@@ -515,7 +515,7 @@ vtx1(volatile struct i40e_tx_desc *txdp,
((uint64_t)flags << I40E_TXD_QW1_CMD_SHIFT) |
((uint64_t)pkt->data_len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT));
- uint64x2_t descriptor = {pkt->buf_physaddr + pkt->data_off, high_qw};
+ uint64x2_t descriptor = {pkt->buf_iovaaddr + pkt->data_off, high_qw};
vst1q_u64((uint64_t *)txdp, descriptor);
}
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 779f14e53..35928ad79 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -86,8 +86,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_iovaaddr(hi 64bit) */
+ RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iovaaddr) !=
offsetof(struct rte_mbuf, buf_addr) + 8);
vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr);
vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr);
@@ -549,7 +549,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_iovaaddr + pkt->data_off);
_mm_store_si128((__m128i *)txdp, descriptor);
}
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
index 44de1caac..571f578ce 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
@@ -87,13 +87,13 @@ ixgbe_rxq_rearm(struct ixgbe_rx_queue *rxq)
* Data to be rearmed is 6 bytes long.
*/
vst1_u8((uint8_t *)&mb0->rearm_data, p);
- paddr = mb0->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb0->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
dma_addr0 = vsetq_lane_u64(paddr, zero, 0);
/* flush desc with pa dma_addr */
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr0);
vst1_u8((uint8_t *)&mb1->rearm_data, p);
- paddr = mb1->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb1->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
dma_addr1 = vsetq_lane_u64(paddr, zero, 0);
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr1);
}
@@ -414,7 +414,7 @@ vtx1(volatile union ixgbe_adv_tx_desc *txdp,
struct rte_mbuf *pkt, uint64_t flags)
{
uint64x2_t descriptor = {
- pkt->buf_physaddr + pkt->data_off,
+ pkt->buf_iovaaddr + pkt->data_off,
(uint64_t)pkt->pkt_len << 46 | flags | pkt->data_len};
vst1q_u64((uint64_t *)&txdp->read, descriptor);
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index e704a7f35..345010f4d 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -86,8 +86,8 @@ ixgbe_rxq_rearm(struct ixgbe_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_iovaaddr(hi 64bit) */
+ RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iovaaddr) !=
offsetof(struct rte_mbuf, buf_addr) + 8);
vaddr0 = _mm_loadu_si128((__m128i *)&(mb0->buf_addr));
vaddr1 = _mm_loadu_si128((__m128i *)&(mb1->buf_addr));
@@ -604,7 +604,7 @@ vtx1(volatile union ixgbe_adv_tx_desc *txdp,
{
__m128i descriptor = _mm_set_epi64x((uint64_t)pkt->pkt_len << 46 |
flags | pkt->data_len,
- pkt->buf_physaddr + pkt->data_off);
+ pkt->buf_iovaaddr + pkt->data_off);
_mm_store_si128((__m128i *)&txdp->read, descriptor);
}
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 92b03c4cb..fcd472eb4 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -105,7 +105,7 @@ static uint16_t nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
#define NFP_QCP_MAX_ADD 0x7f
#define RTE_MBUF_DMA_ADDR_DEFAULT(mb) \
- (uint64_t)((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM)
+ (uint64_t)((mb)->buf_iovaaddr + RTE_PKTMBUF_HEADROOM)
/* nfp_qcp_ptr - Read or Write Pointer of a queue */
enum nfp_qcp_ptr {
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index e320811ed..0beb8a387 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -491,7 +491,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
* VIRTIO_MBUF_DATA_DMA_ADDR in virtqueue.h for more information.
*/
if (!hw->virtio_user_dev)
- vq->offset = offsetof(struct rte_mbuf, buf_physaddr);
+ vq->offset = offsetof(struct rte_mbuf, buf_iovaaddr);
else {
vq->vq_ring_mem = (uintptr_t)mz->addr;
vq->offset = offsetof(struct rte_mbuf, buf_addr);
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index cb1b2a6e9..21733c0e2 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -80,7 +80,7 @@ struct rte_mbuf;
#define VIRTIO_MBUF_ADDR(mb, vq) \
((uint64_t)(*(uintptr_t *)((uintptr_t)(mb) + (vq)->offset)))
#else
-#define VIRTIO_MBUF_ADDR(mb, vq) ((mb)->buf_physaddr)
+#define VIRTIO_MBUF_ADDR(mb, vq) ((mb)->buf_iovaaddr)
#endif
/**
diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
index efd9ac9a5..981d96576 100644
--- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
+++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
@@ -119,7 +119,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_iovaaddr;
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_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c
index db9f48989..7f986f482 100644
--- a/lib/librte_eal/linuxapp/kni/kni_net.c
+++ b/lib/librte_eal/linuxapp/kni/kni_net.c
@@ -69,7 +69,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_iovaaddr);
return va;
}
@@ -77,7 +77,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_iovaaddr + m->data_off);
}
/* virtual address to physical address */
@@ -88,7 +88,7 @@ va2pa(void *va, struct rte_kni_mbuf *m)
pa = (void *)((unsigned long)va -
((unsigned long)m->buf_addr -
- (unsigned long)m->buf_physaddr));
+ (unsigned long)m->buf_iovaaddr));
return pa;
}
diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index 8c483c1f4..d12dde77d 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -456,7 +456,7 @@ va2pa(struct rte_mbuf *m)
{
return (void *)((unsigned long)m -
((unsigned long)m->buf_addr -
- (unsigned long)m->buf_physaddr));
+ (unsigned long)m->buf_iovaaddr));
}
static void
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 26a62b8e1..0ff3acaba 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -135,7 +135,7 @@ rte_pktmbuf_init(struct rte_mempool *mp,
/* start of buffer is after mbuf structure and priv data */
m->priv_size = priv_size;
m->buf_addr = (char *)m + mbuf_size;
- m->buf_physaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
+ m->buf_iovaaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
m->buf_len = (uint16_t)buf_len;
/* keep some headroom between start of buffer and data */
@@ -211,7 +211,7 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)
/* generic checks */
if (m->pool == NULL)
rte_panic("bad mbuf pool\n");
- if (m->buf_physaddr == 0)
+ if (m->buf_iovaaddr == 0)
rte_panic("bad phys addr\n");
if (m->buf_addr == NULL)
rte_panic("bad virt addr\n");
@@ -244,7 +244,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)
__rte_mbuf_sanity_check(m, 1);
fprintf(f, "dump mbuf at %p, phys=%"PRIx64", buf_len=%u\n",
- m, (uint64_t)m->buf_physaddr, (unsigned)m->buf_len);
+ m, (uint64_t)m->buf_iovaaddr, (unsigned)m->buf_len);
fprintf(f, " pkt_len=%"PRIu32", ol_flags=%"PRIx64", nb_segs=%u, "
"in_port=%u\n", m->pkt_len, m->ol_flags,
(unsigned)m->nb_segs, (unsigned)m->port);
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 4563b5dc3..995b86ced 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -411,7 +411,7 @@ struct rte_mbuf {
* same mbuf cacheline0 layout for 32-bit and 64-bit. This makes
* working on vector drivers easier.
*/
- iova_addr_t buf_physaddr __rte_aligned(sizeof(iova_addr_t));
+ iova_addr_t buf_iovaaddr __rte_aligned(sizeof(iova_addr_t));
/* next 8 bytes are initialised on RX descriptor rearm */
MARKER64 rearm_data;
@@ -597,7 +597,7 @@ static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp);
static inline iova_addr_t
rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
{
- return mb->buf_physaddr + mb->data_off;
+ return mb->buf_iovaaddr + mb->data_off;
}
/**
@@ -615,7 +615,7 @@ rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
static inline iova_addr_t
rte_mbuf_data_dma_addr_default(const struct rte_mbuf *mb)
{
- return mb->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ return mb->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
}
/**
@@ -806,7 +806,7 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header);
* For standard needs, prefer rte_pktmbuf_alloc().
*
* The caller can expect that the following fields of the mbuf structure
- * are initialized: buf_addr, buf_physaddr, buf_len, refcnt=1, nb_segs=1,
+ * are initialized: buf_addr, buf_iovaaddr, buf_len, refcnt=1, nb_segs=1,
* next=NULL, pool, priv_size. The other fields must be initialized
* by the caller.
*
@@ -1214,7 +1214,7 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *m)
rte_mbuf_refcnt_update(md, 1);
mi->priv_size = m->priv_size;
- mi->buf_physaddr = m->buf_physaddr;
+ mi->buf_iovaaddr = m->buf_iovaaddr;
mi->buf_addr = m->buf_addr;
mi->buf_len = m->buf_len;
@@ -1262,7 +1262,7 @@ static inline void rte_pktmbuf_detach(struct rte_mbuf *m)
m->priv_size = priv_size;
m->buf_addr = (char *)m + mbuf_size;
- m->buf_physaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
+ m->buf_iovaaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
m->buf_len = (uint16_t)buf_len;
rte_pktmbuf_reset_headroom(m);
m->data_len = 0;
@@ -1533,7 +1533,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)
* The offset into the data to calculate address from.
*/
#define rte_pktmbuf_mtophys_offset(m, o) \
- (iova_addr_t)((m)->buf_physaddr + (m)->data_off + (o))
+ (iova_addr_t)((m)->buf_iovaaddr + (m)->data_off + (o))
/**
* A macro that returns the physical address that points to the start of the
diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index a5f0eebaa..73b92b378 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -838,7 +838,7 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vring_desc *descs,
cur->data_len = cpy_len;
cur->data_off = 0;
cur->buf_addr = (void *)(uintptr_t)desc_addr;
- cur->buf_physaddr = hpa;
+ cur->buf_iovaaddr = hpa;
/*
* In zero copy mode, one mbuf can only reference data
diff --git a/test/test/test_mbuf.c b/test/test/test_mbuf.c
index 3396b4a93..326b75dca 100644
--- a/test/test/test_mbuf.c
+++ b/test/test/test_mbuf.c
@@ -907,7 +907,7 @@ test_failing_mbuf_sanity_check(struct rte_mempool *pktmbuf_pool)
}
badbuf = *buf;
- badbuf.buf_physaddr = 0;
+ badbuf.buf_iovaaddr = 0;
if (verify_mbuf_check_panics(&badbuf)) {
printf("Error with bad-physaddr mbuf test\n");
return -1;
--
2.11.0
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v2 3/5] eal/memory: rename memseg member phys to iova addr
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Santosh Shukla
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 1/5] eal: rename phys_addr_t to iova_addr_t Santosh Shukla
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 2/5] eal/memory: rename buf_physaddr to buf_iovaaddr Santosh Shukla
@ 2017-09-05 10:31 ` Santosh Shukla
2017-09-18 15:04 ` Burakov, Anatoly
2017-09-18 15:21 ` Burakov, Anatoly
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 4/5] eal/memory: rename memory api to iova types Santosh Shukla
` (3 subsequent siblings)
6 siblings, 2 replies; 91+ messages in thread
From: Santosh Shukla @ 2017-09-05 10:31 UTC (permalink / raw)
To: dev; +Cc: thomas, jerin.jacob, hemant.agrawal, olivier.matz, Santosh Shukla
Renaming rte_memseg {.phys_addr} to {.iova_addr}
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
v1 --> v2:
- includes freebsdp v1 build fixes.
lib/librte_eal/bsdapp/eal/eal_memory.c | 4 ++--
lib/librte_eal/common/eal_common_memory.c | 2 +-
lib/librte_eal/common/include/rte_memory.h | 4 ++--
lib/librte_eal/common/rte_malloc.c | 5 +++--
lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 ++--
6 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index 10c2e121f..d8882dcef 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -73,7 +73,7 @@ rte_eal_hugepage_init(void)
/* for debug purposes, hugetlbfs can be disabled */
if (internal_config.no_hugetlbfs) {
addr = malloc(internal_config.memory);
- mcfg->memseg[0].phys_addr = (iova_addr_t)(uintptr_t)addr;
+ mcfg->memseg[0].iova_addr = (iova_addr_t)(uintptr_t)addr;
mcfg->memseg[0].addr = addr;
mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
mcfg->memseg[0].len = internal_config.memory;
@@ -114,7 +114,7 @@ rte_eal_hugepage_init(void)
seg = &mcfg->memseg[seg_idx++];
seg->addr = addr;
- seg->phys_addr = physaddr;
+ seg->iova_addr = (iova_addr_t)physaddr;
seg->hugepage_sz = hpi->hugepage_sz;
seg->len = hpi->hugepage_sz;
seg->nchannel = mcfg->nchannel;
diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 996877ef5..5ed83d20a 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -100,7 +100,7 @@ rte_dump_physmem_layout(FILE *f)
"virt:%p, socket_id:%"PRId32", "
"hugepage_sz:%"PRIu64", nchannel:%"PRIx32", "
"nrank:%"PRIx32"\n", i,
- mcfg->memseg[i].phys_addr,
+ mcfg->memseg[i].iova_addr,
mcfg->memseg[i].len,
mcfg->memseg[i].addr,
mcfg->memseg[i].socket_id,
diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index 5face8c86..6b148ba8e 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -98,14 +98,14 @@ enum rte_page_sizes {
*/
#define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)
-typedef uint64_t iova_addr_t; /**< Physical address definition. */
+typedef uint64_t iova_addr_t; /**< Iova address definition. */
#define RTE_BAD_PHYS_ADDR ((iova_addr_t)-1)
/**
* Physical memory segment descriptor.
*/
struct rte_memseg {
- iova_addr_t phys_addr; /**< Start physical address. */
+ iova_addr_t iova_addr; /**< Start iova(_pa or _va) address. */
RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index 3ce6034bf..b65a06f9d 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -254,7 +254,8 @@ rte_malloc_virt2phy(const void *addr)
const struct malloc_elem *elem = malloc_elem_from_data(addr);
if (elem == NULL)
return RTE_BAD_PHYS_ADDR;
- if (elem->ms->phys_addr == RTE_BAD_PHYS_ADDR)
+ if (elem->ms->iova_addr == RTE_BAD_PHYS_ADDR)
return RTE_BAD_PHYS_ADDR;
- return elem->ms->phys_addr + ((uintptr_t)addr - (uintptr_t)elem->ms->addr);
+ return elem->ms->iova_addr +
+ ((uintptr_t)addr - (uintptr_t)elem->ms->addr);
}
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 405c15bcd..5d9702c72 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -154,7 +154,7 @@ rte_mem_virt2phy(const void *virtaddr)
if (virtaddr > memseg->addr &&
virtaddr < RTE_PTR_ADD(memseg->addr,
memseg->len)) {
- return memseg->phys_addr +
+ return memseg->iova_addr +
RTE_PTR_DIFF(virtaddr, memseg->addr);
}
}
@@ -1059,7 +1059,7 @@ rte_eal_hugepage_init(void)
strerror(errno));
return -1;
}
- mcfg->memseg[0].phys_addr = RTE_BAD_PHYS_ADDR;
+ mcfg->memseg[0].iova_addr = RTE_BAD_PHYS_ADDR;
mcfg->memseg[0].addr = addr;
mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
mcfg->memseg[0].len = internal_config.memory;
@@ -1319,7 +1319,7 @@ rte_eal_hugepage_init(void)
if (j == RTE_MAX_MEMSEG)
break;
- mcfg->memseg[j].phys_addr = hugepage[i].physaddr;
+ mcfg->memseg[j].iova_addr = hugepage[i].physaddr;
mcfg->memseg[j].addr = hugepage[i].final_va;
mcfg->memseg[j].len = hugepage[i].size;
mcfg->memseg[j].socket_id = hugepage[i].socket_id;
@@ -1330,7 +1330,7 @@ rte_eal_hugepage_init(void)
#ifdef RTE_ARCH_PPC_64
/* Use the phy and virt address of the last page as segment
* address for IBM Power architecture */
- mcfg->memseg[j].phys_addr = hugepage[i].physaddr;
+ mcfg->memseg[j].iova_addr = hugepage[i].physaddr;
mcfg->memseg[j].addr = hugepage[i].final_va;
#endif
mcfg->memseg[j].len += mcfg->memseg[j].hugepage_sz;
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 946df7e31..c03fd713c 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -706,7 +706,7 @@ vfio_type1_dma_map(int vfio_container_fd)
dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map);
dma_map.vaddr = ms[i].addr_64;
dma_map.size = ms[i].len;
- dma_map.iova = ms[i].phys_addr;
+ dma_map.iova = ms[i].iova_addr;
dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE;
ret = ioctl(vfio_container_fd, VFIO_IOMMU_MAP_DMA, &dma_map);
@@ -792,7 +792,7 @@ vfio_spapr_dma_map(int vfio_container_fd)
dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map);
dma_map.vaddr = ms[i].addr_64;
dma_map.size = ms[i].len;
- dma_map.iova = ms[i].phys_addr;
+ dma_map.iova = ms[i].iova_addr;
dma_map.flags = VFIO_DMA_MAP_FLAG_READ |
VFIO_DMA_MAP_FLAG_WRITE;
--
2.11.0
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v2 4/5] eal/memory: rename memory api to iova types
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Santosh Shukla
` (2 preceding siblings ...)
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 3/5] eal/memory: rename memseg member phys to iova addr Santosh Shukla
@ 2017-09-05 10:31 ` Santosh Shukla
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 5/5] doc: remove dpdk iova aware notice Santosh Shukla
` (2 subsequent siblings)
6 siblings, 0 replies; 91+ messages in thread
From: Santosh Shukla @ 2017-09-05 10:31 UTC (permalink / raw)
To: dev; +Cc: thomas, jerin.jacob, hemant.agrawal, olivier.matz, Santosh Shukla
Renamed memory translational api to _iova types.
The following api renamed from:
rte_mempool_populate_phys()
rte_mempool_populate_phys_tab()
rte_eal_using_phys_addrs()
rte_mem_virt2phy()
rte_dump_physmem_layout()
rte_eal_get_physmem_layout()
rte_eal_get_physmem_size()
rte_malloc_virt2phy()
rte_mem_phy2mch()
To the following iova types api:
rte_mempool_populate_iova()
rte_mempool_populate_iova_tab()
rte_eal_using_iova_addrs()
rte_mem_virt2iova()
rte_dump_iovamem_layout()
rte_eal_get_iovamem_layout()
rte_eal_get_iovamem_size()
rte_malloc_virt2iova()
rte_mem_phy2iova()
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
app/proc_info/main.c | 2 +-
app/test-crypto-perf/cperf_test_vector_parsing.c | 4 ++--
app/test-crypto-perf/cperf_test_vectors.c | 6 +++---
app/test-pmd/cmdline.c | 2 +-
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 4 ++--
drivers/crypto/qat/qat_qp.c | 2 +-
drivers/net/ark/ark_ethdev_rx.c | 4 ++--
drivers/net/ark/ark_ethdev_tx.c | 4 ++--
drivers/net/bnxt/bnxt_ethdev.c | 8 ++++----
drivers/net/bnxt/bnxt_hwrm.c | 14 +++++++-------
drivers/net/bnxt/bnxt_ring.c | 4 ++--
drivers/net/bnxt/bnxt_vnic.c | 4 ++--
drivers/net/e1000/em_rxtx.c | 4 ++--
drivers/net/e1000/igb_rxtx.c | 4 ++--
drivers/net/fm10k/fm10k_ethdev.c | 4 ++--
drivers/net/i40e/i40e_ethdev.c | 2 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 8 ++++----
drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++--
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/mlx4/mlx4.c | 2 +-
drivers/net/mlx5/mlx5_mr.c | 2 +-
drivers/net/sfc/sfc.c | 2 +-
drivers/net/sfc/sfc_tso.c | 2 +-
examples/l2fwd-crypto/main.c | 2 +-
lib/librte_cryptodev/rte_cryptodev.c | 2 +-
lib/librte_eal/bsdapp/eal/eal.c | 2 +-
lib/librte_eal/bsdapp/eal/eal_memory.c | 2 +-
lib/librte_eal/bsdapp/eal/rte_eal_version.map | 12 ++++++------
lib/librte_eal/common/eal_common_memory.c | 6 +++---
lib/librte_eal/common/eal_common_memzone.c | 4 ++--
lib/librte_eal/common/eal_private.h | 2 +-
lib/librte_eal/common/include/rte_malloc.h | 2 +-
lib/librte_eal/common/include/rte_memory.h | 12 ++++++------
lib/librte_eal/common/rte_malloc.c | 2 +-
lib/librte_eal/linuxapp/eal/eal.c | 2 +-
lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
lib/librte_eal/linuxapp/eal/eal_pci.c | 4 ++--
lib/librte_eal/linuxapp/eal/eal_vfio.c | 6 +++---
lib/librte_eal/linuxapp/eal/rte_eal_version.map | 12 ++++++------
lib/librte_mempool/rte_mempool.c | 24 ++++++++++++------------
lib/librte_mempool/rte_mempool.h | 4 ++--
lib/librte_mempool/rte_mempool_version.map | 4 ++--
lib/librte_vhost/vhost_user.c | 4 ++--
test/test/commands.c | 2 +-
test/test/test_malloc.c | 4 ++--
test/test/test_memory.c | 6 +++---
test/test/test_mempool.c | 4 ++--
test/test/test_memzone.c | 10 +++++-----
50 files changed, 120 insertions(+), 120 deletions(-)
diff --git a/app/proc_info/main.c b/app/proc_info/main.c
index 8b753a2ee..16df6d4b1 100644
--- a/app/proc_info/main.c
+++ b/app/proc_info/main.c
@@ -297,7 +297,7 @@ static void
meminfo_display(void)
{
printf("----------- MEMORY_SEGMENTS -----------\n");
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
printf("--------- END_MEMORY_SEGMENTS ---------\n");
printf("------------ MEMORY_ZONES -------------\n");
diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c
index 148a60414..2e4e10a85 100644
--- a/app/test-crypto-perf/cperf_test_vector_parsing.c
+++ b/app/test-crypto-perf/cperf_test_vector_parsing.c
@@ -390,7 +390,7 @@ parse_entry(char *entry, struct cperf_test_vector *vector,
} else if (strstr(key_token, "aad")) {
rte_free(vector->aad.data);
vector->aad.data = data;
- vector->aad.phys_addr = rte_malloc_virt2phy(vector->aad.data);
+ vector->aad.phys_addr = rte_malloc_virt2iova(vector->aad.data);
if (tc_found)
vector->aad.length = data_length;
else {
@@ -405,7 +405,7 @@ parse_entry(char *entry, struct cperf_test_vector *vector,
} else if (strstr(key_token, "digest")) {
rte_free(vector->digest.data);
vector->digest.data = data;
- vector->digest.phys_addr = rte_malloc_virt2phy(
+ vector->digest.phys_addr = rte_malloc_virt2iova(
vector->digest.data);
if (tc_found)
vector->digest.length = data_length;
diff --git a/app/test-crypto-perf/cperf_test_vectors.c b/app/test-crypto-perf/cperf_test_vectors.c
index e51dcc3f1..fa911ff69 100644
--- a/app/test-crypto-perf/cperf_test_vectors.c
+++ b/app/test-crypto-perf/cperf_test_vectors.c
@@ -498,7 +498,7 @@ cperf_test_vector_get_dummy(struct cperf_options *options)
return NULL;
}
t_vec->digest.phys_addr =
- rte_malloc_virt2phy(t_vec->digest.data);
+ rte_malloc_virt2iova(t_vec->digest.data);
t_vec->digest.length = options->digest_sz;
memcpy(t_vec->digest.data, digest,
options->digest_sz);
@@ -531,7 +531,7 @@ cperf_test_vector_get_dummy(struct cperf_options *options)
return NULL;
}
memcpy(t_vec->aad.data, aad, options->aead_aad_sz);
- t_vec->aad.phys_addr = rte_malloc_virt2phy(t_vec->aad.data);
+ t_vec->aad.phys_addr = rte_malloc_virt2iova(t_vec->aad.data);
t_vec->aad.length = options->aead_aad_sz;
} else {
t_vec->aad.data = NULL;
@@ -546,7 +546,7 @@ cperf_test_vector_get_dummy(struct cperf_options *options)
return NULL;
}
t_vec->digest.phys_addr =
- rte_malloc_virt2phy(t_vec->digest.data);
+ rte_malloc_virt2iova(t_vec->digest.data);
t_vec->digest.length = options->digest_sz;
memcpy(t_vec->digest.data, digest, options->digest_sz);
t_vec->data.aead_offset = 0;
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index cd8c35850..114d5cdb6 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -8039,7 +8039,7 @@ static void cmd_dump_parsed(void *parsed_result,
struct cmd_dump_result *res = parsed_result;
if (!strcmp(res->dump, "dump_physmem"))
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
else if (!strcmp(res->dump, "dump_memzone"))
rte_memzone_dump(stdout);
else if (!strcmp(res->dump, "dump_struct_sizes"))
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 45e592770..fc4f967c4 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -201,7 +201,7 @@ int rte_fslmc_vfio_dmamap(void)
if (is_dma_done)
return 0;
- memseg = rte_eal_get_physmem_layout();
+ memseg = rte_eal_get_iovamem_layout();
if (memseg == NULL) {
FSLMC_VFIO_LOG(ERR, "Cannot get physical layout.");
return -ENODEV;
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 15e3878eb..84189c0f4 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -275,7 +275,7 @@ static void *dpaa2_mem_ptov(iova_addr_t paddr) __attribute__((unused));
/* todo - this is costly, need to write a fast coversion routine */
static void *dpaa2_mem_ptov(iova_addr_t paddr)
{
- const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
+ const struct rte_memseg *memseg = rte_eal_get_iovamem_layout();
int i;
for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
@@ -290,7 +290,7 @@ static void *dpaa2_mem_ptov(iova_addr_t paddr)
static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr) __attribute__((unused));
static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr)
{
- const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
+ const struct rte_memseg *memseg = rte_eal_get_iovamem_layout();
int i;
for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
index 5048d2144..b25419f30 100644
--- a/drivers/crypto/qat/qat_qp.c
+++ b/drivers/crypto/qat/qat_qp.c
@@ -106,7 +106,7 @@ queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size,
PMD_DRV_LOG(DEBUG, "Allocate memzone for %s, size %u on socket %u",
queue_name, queue_size, socket_id);
- ms = rte_eal_get_physmem_layout();
+ ms = rte_eal_get_iovamem_layout();
switch (ms[0].hugepage_sz) {
case(RTE_PGSIZE_2M):
memzone_flags = RTE_MEMZONE_2MB;
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 90cf304c0..eb583915b 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -100,11 +100,11 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
iova_addr_t phys_addr_q_base;
iova_addr_t phys_addr_prod_index;
- queue_base = rte_malloc_virt2phy(queue);
+ queue_base = rte_malloc_virt2iova(queue);
phys_addr_prod_index = queue_base +
offsetof(struct ark_rx_queue, prod_index);
- phys_addr_q_base = rte_malloc_virt2phy(queue->paddress_q);
+ phys_addr_q_base = rte_malloc_virt2iova(queue->paddress_q);
/* Verify HW */
if (ark_mpu_verify(queue->mpu, sizeof(iova_addr_t))) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 578cb09b8..e798e4786 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -318,8 +318,8 @@ eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
if (ark_mpu_verify(queue->mpu, sizeof(struct ark_tx_meta)))
return -1;
- queue_base = rte_malloc_virt2phy(queue);
- ring_base = rte_malloc_virt2phy(queue->meta_q);
+ queue_base = rte_malloc_virt2iova(queue);
+ ring_base = rte_malloc_virt2iova(queue->meta_q);
cons_index_addr =
queue_base + offsetof(struct ark_tx_queue, cons_index);
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index cb2ce334b..acc3236c2 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1679,8 +1679,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ "Using rte_mem_virt2iova()\n");
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map address to physical memory\n");
@@ -1714,8 +1714,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ "Using rte_mem_virt2iova()\n");
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map address to physical memory\n");
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index e710e6367..3f420802c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -270,7 +270,7 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp,
if (!(mask & HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN))
mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY;
req.vlan_tag_tbl_addr = rte_cpu_to_le_16(
- rte_mem_virt2phy(vlan_table));
+ rte_mem_virt2iova(vlan_table));
req.num_vlan_tags = rte_cpu_to_le_32((uint32_t)vlan_count);
}
req.mask = rte_cpu_to_le_32(HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST |
@@ -311,7 +311,7 @@ int bnxt_hwrm_cfa_vlan_antispoof_cfg(struct bnxt *bp, uint16_t fid,
req.fid = rte_cpu_to_le_16(fid);
req.vlan_tag_mask_tbl_addr =
- rte_cpu_to_le_64(rte_mem_virt2phy(vlan_table));
+ rte_cpu_to_le_64(rte_mem_virt2iova(vlan_table));
req.num_vlan_entries = rte_cpu_to_le_32((uint32_t)vlan_count);
rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
@@ -612,7 +612,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
}
rte_mem_lock_page(bp->hwrm_cmd_resp_addr);
bp->hwrm_cmd_resp_dma_addr =
- rte_mem_virt2phy(bp->hwrm_cmd_resp_addr);
+ rte_mem_virt2iova(bp->hwrm_cmd_resp_addr);
if (bp->hwrm_cmd_resp_dma_addr == 0) {
RTE_LOG(ERR, PMD,
"Unable to map response buffer to physical memory.\n");
@@ -638,7 +638,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
}
rte_mem_lock_page(bp->hwrm_short_cmd_req_addr);
bp->hwrm_short_cmd_req_dma_addr =
- rte_mem_virt2phy(bp->hwrm_short_cmd_req_addr);
+ rte_mem_virt2iova(bp->hwrm_short_cmd_req_addr);
if (bp->hwrm_short_cmd_req_dma_addr == 0) {
rte_free(bp->hwrm_short_cmd_req_addr);
RTE_LOG(ERR, PMD,
@@ -1683,7 +1683,7 @@ int bnxt_alloc_hwrm_resources(struct bnxt *bp)
if (bp->hwrm_cmd_resp_addr == NULL)
return -ENOMEM;
bp->hwrm_cmd_resp_dma_addr =
- rte_mem_virt2phy(bp->hwrm_cmd_resp_addr);
+ rte_mem_virt2iova(bp->hwrm_cmd_resp_addr);
if (bp->hwrm_cmd_resp_dma_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map response address to physical memory\n");
@@ -2489,7 +2489,7 @@ int bnxt_hwrm_func_buf_rgtr(struct bnxt *bp)
page_getenum(bp->pf.active_vfs * HWRM_MAX_REQ_LEN));
req.req_buf_len = rte_cpu_to_le_16(HWRM_MAX_REQ_LEN);
req.req_buf_page_addr[0] =
- rte_cpu_to_le_64(rte_mem_virt2phy(bp->pf.vf_req_buf));
+ rte_cpu_to_le_64(rte_mem_virt2iova(bp->pf.vf_req_buf));
if (req.req_buf_page_addr[0] == 0) {
RTE_LOG(ERR, PMD,
"unable to map buffer address to physical memory\n");
@@ -2861,7 +2861,7 @@ static int bnxt_hwrm_func_vf_vnic_query(struct bnxt *bp, uint16_t vf,
req.vf_id = rte_cpu_to_le_16(bp->pf.first_vf_id + vf);
req.max_vnic_id_cnt = rte_cpu_to_le_32(bp->pf.total_vnics);
- req.vnic_id_tbl_addr = rte_cpu_to_le_64(rte_mem_virt2phy(vnic_ids));
+ req.vnic_id_tbl_addr = rte_cpu_to_le_64(rte_mem_virt2iova(vnic_ids));
if (req.vnic_id_tbl_addr == 0) {
RTE_LOG(ERR, PMD,
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 8e83e4704..1e6db4495 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -177,10 +177,10 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
+ "Using rte_mem_virt2iova()\n");
for (sz = 0; sz < total_alloc_len; sz += getpagesize())
rte_mem_lock_page(((char *)mz->addr) + sz);
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map ring address to physical memory\n");
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 90809f0f5..9002f6b30 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -196,8 +196,8 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ "Using rte_mem_virt2iova()\n");
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map vnic address to physical memory\n");
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index 31819c5bd..e8316bf97 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -1289,7 +1289,7 @@ eth_em_tx_queue_setup(struct rte_eth_dev *dev,
txq->port_id = dev->data->port_id;
txq->tdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_TDT(queue_idx));
- txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+ txq->tx_ring_phys_addr = rte_mem_phy2iova(tz->memseg_id, tz->phys_addr);
txq->tx_ring = (struct e1000_data_desc *) tz->addr;
PMD_INIT_LOG(DEBUG, "sw_ring=%p hw_ring=%p dma_addr=0x%"PRIx64,
@@ -1416,7 +1416,7 @@ eth_em_rx_queue_setup(struct rte_eth_dev *dev,
rxq->rdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDT(queue_idx));
rxq->rdh_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDH(queue_idx));
- rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+ rxq->rx_ring_phys_addr = rte_mem_phy2iova(rz->memseg_id, rz->phys_addr);
rxq->rx_ring = (struct e1000_rx_desc *) rz->addr;
PMD_INIT_LOG(DEBUG, "sw_ring=%p hw_ring=%p dma_addr=0x%"PRIx64,
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 1c80a2a1b..02cc0a505 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -1530,7 +1530,7 @@ eth_igb_tx_queue_setup(struct rte_eth_dev *dev,
txq->port_id = dev->data->port_id;
txq->tdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_TDT(txq->reg_idx));
- txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+ txq->tx_ring_phys_addr = rte_mem_phy2iova(tz->memseg_id, tz->phys_addr);
txq->tx_ring = (union e1000_adv_tx_desc *) tz->addr;
/* Allocate software ring */
@@ -1667,7 +1667,7 @@ eth_igb_rx_queue_setup(struct rte_eth_dev *dev,
}
rxq->rdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDT(rxq->reg_idx));
rxq->rdh_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDH(rxq->reg_idx));
- rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+ rxq->rx_ring_phys_addr = rte_mem_phy2iova(rz->memseg_id, rz->phys_addr);
rxq->rx_ring = (union e1000_adv_rx_desc *) rz->addr;
/* Allocate software ring. */
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index e60d3a365..f5a0247ec 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1887,7 +1887,7 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
return -ENOMEM;
}
q->hw_ring = mz->addr;
- q->hw_ring_phys_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+ q->hw_ring_phys_addr = rte_mem_phy2iova(mz->memseg_id, mz->phys_addr);
/* Check if number of descs satisfied Vector requirement */
if (!rte_is_power_of_2(nb_desc)) {
@@ -2047,7 +2047,7 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
return -ENOMEM;
}
q->hw_ring = mz->addr;
- q->hw_ring_phys_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+ q->hw_ring_phys_addr = rte_mem_phy2iova(mz->memseg_id, mz->phys_addr);
/*
* allocate memory for the RS bit tracker. Enough slots to hold the
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5f26e24a3..96339fdc6 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3741,7 +3741,7 @@ i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw,
mem->size = size;
mem->va = mz->addr;
- mem->pa = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+ mem->pa = rte_mem_phy2iova(mz->memseg_id, mz->phys_addr);
mem->zone = (const void *)mz;
PMD_DRV_LOG(DEBUG,
"memzone %s allocated with physical address: %"PRIu64,
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 8013add43..9fd728dfa 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -249,7 +249,7 @@ i40e_fdir_setup(struct i40e_pf *pf)
goto fail_mem;
}
pf->fdir.prg_pkt = mz->addr;
- pf->fdir.dma_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+ pf->fdir.dma_addr = rte_mem_phy2iova(mz->memseg_id, mz->phys_addr);
pf->fdir.match_counter_index = I40E_COUNTER_INDEX_FDIR(hw->pf_id);
PMD_DRV_LOG(INFO, "FDIR setup successfully, with programming queue %u.",
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index d42c23c05..f3269f981 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -1822,7 +1822,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
/* Zero all the descriptors in the ring. */
memset(rz->addr, 0, ring_size);
- rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+ rxq->rx_ring_phys_addr = rte_mem_phy2iova(rz->memseg_id, rz->phys_addr);
rxq->rx_ring = (union i40e_rx_desc *)rz->addr;
len = (uint16_t)(nb_desc + RTE_PMD_I40E_RX_MAX_BURST);
@@ -2159,7 +2159,7 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
txq->vsi = vsi;
txq->tx_deferred_start = tx_conf->tx_deferred_start;
- txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+ txq->tx_ring_phys_addr = rte_mem_phy2iova(tz->memseg_id, tz->phys_addr);
txq->tx_ring = (struct i40e_tx_desc *)tz->addr;
/* Allocate software ring */
@@ -2675,7 +2675,7 @@ i40e_fdir_setup_tx_resources(struct i40e_pf *pf)
txq->reg_idx = pf->fdir.fdir_vsi->base_queue;
txq->vsi = pf->fdir.fdir_vsi;
- txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+ txq->tx_ring_phys_addr = rte_mem_phy2iova(tz->memseg_id, tz->phys_addr);
txq->tx_ring = (struct i40e_tx_desc *)tz->addr;
/*
* don't need to allocate software ring and reset for the fdir
@@ -2731,7 +2731,7 @@ i40e_fdir_setup_rx_resources(struct i40e_pf *pf)
rxq->reg_idx = pf->fdir.fdir_vsi->base_queue;
rxq->vsi = pf->fdir.fdir_vsi;
- rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+ rxq->rx_ring_phys_addr = rte_mem_phy2iova(rz->memseg_id, rz->phys_addr);
rxq->rx_ring = (union i40e_rx_desc *)rz->addr;
/*
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 64bff2584..ac6907b8e 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2548,7 +2548,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
else
txq->tdt_reg_addr = IXGBE_PCI_REG_ADDR(hw, IXGBE_TDT(txq->reg_idx));
- txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+ txq->tx_ring_phys_addr = rte_mem_phy2iova(tz->memseg_id, tz->phys_addr);
txq->tx_ring = (union ixgbe_adv_tx_desc *) tz->addr;
/* Allocate software ring */
@@ -2850,7 +2850,7 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
IXGBE_PCI_REG_ADDR(hw, IXGBE_RDH(rxq->reg_idx));
}
- rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+ rxq->rx_ring_phys_addr = rte_mem_phy2iova(rz->memseg_id, rz->phys_addr);
rxq->rx_ring = (union ixgbe_adv_rx_desc *) rz->addr;
/*
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 5156ac08d..67179eaf5 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -1790,7 +1790,7 @@ lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
m = m->next;
}
- phyaddr = rte_mem_virt2phy(g->sg);
+ phyaddr = rte_mem_virt2iova(g->sg);
if (phyaddr == RTE_BAD_PHYS_ADDR) {
PMD_TX_LOG(lio_dev, ERR, "bad phys addr\n");
goto xmit_failed;
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 055de49a3..8b8216bb3 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -1206,7 +1206,7 @@ static struct ibv_mr *mlx4_mp2mr(struct ibv_pd *, struct rte_mempool *)
static struct ibv_mr *
mlx4_mp2mr(struct ibv_pd *pd, struct rte_mempool *mp)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
uintptr_t start;
uintptr_t end;
unsigned int i;
diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c
index 287335179..530aa4911 100644
--- a/drivers/net/mlx5/mlx5_mr.c
+++ b/drivers/net/mlx5/mlx5_mr.c
@@ -131,7 +131,7 @@ static int mlx5_check_mempool(struct rte_mempool *mp, uintptr_t *start,
struct ibv_mr *
mlx5_mp2mr(struct ibv_pd *pd, struct rte_mempool *mp)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
uintptr_t start;
uintptr_t end;
unsigned int i;
diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index 6cecfc00a..f75f1eb45 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -61,7 +61,7 @@ sfc_dma_alloc(const struct sfc_adapter *sa, const char *name, uint16_t id,
return ENOMEM;
}
- esmp->esm_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+ esmp->esm_addr = rte_mem_phy2iova(mz->memseg_id, mz->phys_addr);
if (esmp->esm_addr == RTE_BAD_PHYS_ADDR) {
(void)rte_memzone_free(mz);
return EFAULT;
diff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c
index fb79d7491..ad100676e 100644
--- a/drivers/net/sfc/sfc_tso.c
+++ b/drivers/net/sfc/sfc_tso.c
@@ -155,7 +155,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
header_len);
tsoh = txq->sw_ring[idx & txq->ptr_mask].tsoh;
- header_paddr = rte_malloc_virt2phy((void *)tsoh);
+ header_paddr = rte_malloc_virt2iova((void *)tsoh);
} else {
if (m->data_len == header_len) {
*in_off = 0;
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 985baaf51..49db9c3c0 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2461,7 +2461,7 @@ reserve_key_memory(struct l2fwd_crypto_options *options)
options->aad.data = rte_malloc("aad", MAX_KEY_SIZE, 0);
if (options->aad.data == NULL)
rte_exit(EXIT_FAILURE, "Failed to allocate memory for AAD");
- options->aad.phys_addr = rte_malloc_virt2phy(options->aad.data);
+ options->aad.phys_addr = rte_malloc_virt2iova(options->aad.data);
}
int
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 327d7e846..a1ffc8c8c 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -1271,7 +1271,7 @@ rte_crypto_op_init(struct rte_mempool *mempool,
__rte_crypto_op_reset(op, type);
- op->phys_addr = rte_mem_virt2phy(_op_data);
+ op->phys_addr = rte_mem_virt2iova(_op_data);
op->mempool = mempool;
}
diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index 5fa598842..1068995f2 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -441,7 +441,7 @@ eal_check_mem_on_local_socket(void)
socket_id = rte_lcore_to_socket_id(rte_config.master_lcore);
- ms = rte_eal_get_physmem_layout();
+ ms = rte_eal_get_iovamem_layout();
for (i = 0; i < RTE_MAX_MEMSEG; i++)
if (ms[i].socket_id == socket_id &&
diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index d8882dcef..839befe59 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -51,7 +51,7 @@
* Get physical address of any mapped virtual address in the current process.
*/
iova_addr_t
-rte_mem_virt2phy(const void *virtaddr)
+rte_mem_virt2iova(const void *virtaddr)
{
/* XXX not implemented. This function is only used by
* rte_mempool_virt2phy() when hugepages are disabled. */
diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
index aac6fd776..6df11dd3f 100644
--- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map
+++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
@@ -14,7 +14,7 @@ DPDK_2.0 {
rte_cpu_get_flag_enabled;
rte_cycles_vmware_tsc_map;
rte_delay_us;
- rte_dump_physmem_layout;
+ rte_dump_iovamem_layout;
rte_dump_registers;
rte_dump_stack;
rte_dump_tailq;
@@ -25,8 +25,8 @@ DPDK_2.0 {
rte_eal_devargs_type_count;
rte_eal_get_configuration;
rte_eal_get_lcore_state;
- rte_eal_get_physmem_layout;
- rte_eal_get_physmem_size;
+ rte_eal_get_iovamem_layout;
+ rte_eal_get_iovamem_size;
rte_eal_has_hugepages;
rte_eal_hpet_init;
rte_eal_init;
@@ -62,10 +62,10 @@ DPDK_2.0 {
rte_malloc_set_limit;
rte_malloc_socket;
rte_malloc_validate;
- rte_malloc_virt2phy;
+ rte_malloc_virt2iova;
rte_mem_lock_page;
- rte_mem_phy2mch;
- rte_mem_virt2phy;
+ rte_mem_phy2iova;
+ rte_mem_virt2iova;
rte_memdump;
rte_memory_get_nchannel;
rte_memory_get_nrank;
diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 5ed83d20a..44bc072bf 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -55,7 +55,7 @@
* memory. The last element of the table contains a NULL address.
*/
const struct rte_memseg *
-rte_eal_get_physmem_layout(void)
+rte_eal_get_iovamem_layout(void)
{
return rte_eal_get_configuration()->mem_config->memseg;
}
@@ -63,7 +63,7 @@ rte_eal_get_physmem_layout(void)
/* get the total size of memory */
uint64_t
-rte_eal_get_physmem_size(void)
+rte_eal_get_iovamem_size(void)
{
const struct rte_mem_config *mcfg;
unsigned i = 0;
@@ -84,7 +84,7 @@ rte_eal_get_physmem_size(void)
/* Dump the physical memory layout on console */
void
-rte_dump_physmem_layout(FILE *f)
+rte_dump_iovamem_layout(FILE *f)
{
const struct rte_mem_config *mcfg;
unsigned i = 0;
diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c
index 3026e36b8..86457eaf0 100644
--- a/lib/librte_eal/common/eal_common_memzone.c
+++ b/lib/librte_eal/common/eal_common_memzone.c
@@ -251,7 +251,7 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,
mcfg->memzone_cnt++;
snprintf(mz->name, sizeof(mz->name), "%s", name);
- mz->phys_addr = rte_malloc_virt2phy(mz_addr);
+ mz->phys_addr = rte_malloc_virt2iova(mz_addr);
mz->addr = mz_addr;
mz->len = (requested_len == 0 ? elem->size : requested_len);
mz->hugepage_sz = elem->ms->hugepage_sz;
@@ -419,7 +419,7 @@ rte_eal_memzone_init(void)
if (rte_eal_process_type() == RTE_PROC_SECONDARY)
return 0;
- memseg = rte_eal_get_physmem_layout();
+ memseg = rte_eal_get_iovamem_layout();
if (memseg == NULL) {
RTE_LOG(ERR, EAL, "%s(): Cannot get physical layout\n", __func__);
return -1;
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index 597d82e44..a98dd69d3 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -341,7 +341,7 @@ int rte_eal_hugepage_attach(void);
* addresses are obtainable. It is only possible to get
* physical addresses when running as a privileged user.
*/
-bool rte_eal_using_phys_addrs(void);
+bool rte_eal_using_iova_addrs(void);
/**
* Find a bus capable of identifying a device.
diff --git a/lib/librte_eal/common/include/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h
index 491b479b1..b1a214c9d 100644
--- a/lib/librte_eal/common/include/rte_malloc.h
+++ b/lib/librte_eal/common/include/rte_malloc.h
@@ -333,7 +333,7 @@ rte_malloc_set_limit(const char *type, size_t max);
* otherwise return physical address of the buffer
*/
iova_addr_t
-rte_malloc_virt2phy(const void *addr);
+rte_malloc_virt2iova(const void *addr);
#ifdef __cplusplus
}
diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index 6b148ba8e..e5c0fdfe0 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -142,7 +142,7 @@ int rte_mem_lock_page(const void *virt);
* @return
* The physical address or RTE_BAD_PHYS_ADDR on error.
*/
-iova_addr_t rte_mem_virt2phy(const void *virt);
+iova_addr_t rte_mem_virt2iova(const void *virt);
/**
* Get the layout of the available physical memory.
@@ -159,7 +159,7 @@ iova_addr_t rte_mem_virt2phy(const void *virt);
* - On error, return NULL. This should not happen since it is a fatal
* error that will probably cause the entire system to panic.
*/
-const struct rte_memseg *rte_eal_get_physmem_layout(void);
+const struct rte_memseg *rte_eal_get_iovamem_layout(void);
/**
* Dump the physical memory layout to a file.
@@ -167,7 +167,7 @@ const struct rte_memseg *rte_eal_get_physmem_layout(void);
* @param f
* A pointer to a file for output
*/
-void rte_dump_physmem_layout(FILE *f);
+void rte_dump_iovamem_layout(FILE *f);
/**
* Get the total amount of available physical memory.
@@ -175,7 +175,7 @@ void rte_dump_physmem_layout(FILE *f);
* @return
* The total amount of available physical memory in bytes.
*/
-uint64_t rte_eal_get_physmem_size(void);
+uint64_t rte_eal_get_iovamem_size(void);
/**
* Get the number of memory channels.
@@ -216,7 +216,7 @@ iova_addr_t rte_xen_mem_phy2mch(int32_t, const iova_addr_t);
* The physical address or RTE_BAD_PHYS_ADDR on error.
*/
static inline iova_addr_t
-rte_mem_phy2mch(int32_t memseg_id, const iova_addr_t phy_addr)
+rte_mem_phy2iova(int32_t memseg_id, const iova_addr_t phy_addr)
{
if (rte_xen_dom0_supported())
return rte_xen_mem_phy2mch(memseg_id, phy_addr);
@@ -252,7 +252,7 @@ static inline int rte_xen_dom0_supported(void)
}
static inline iova_addr_t
-rte_mem_phy2mch(int32_t memseg_id __rte_unused, const iova_addr_t phy_addr)
+rte_mem_phy2iova(int32_t memseg_id __rte_unused, const iova_addr_t phy_addr)
{
return phy_addr;
}
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index b65a06f9d..29b90a2d0 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -249,7 +249,7 @@ rte_malloc_set_limit(__rte_unused const char *type,
* Return the physical address of a virtual address obtained through rte_malloc
*/
iova_addr_t
-rte_malloc_virt2phy(const void *addr)
+rte_malloc_virt2iova(const void *addr)
{
const struct malloc_elem *elem = malloc_elem_from_data(addr);
if (elem == NULL)
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 48f12f44c..0b7419442 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -671,7 +671,7 @@ eal_check_mem_on_local_socket(void)
socket_id = rte_lcore_to_socket_id(rte_config.master_lcore);
- ms = rte_eal_get_physmem_layout();
+ ms = rte_eal_get_iovamem_layout();
for (i = 0; i < RTE_MAX_MEMSEG; i++)
if (ms[i].socket_id == socket_id &&
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 5d9702c72..30d55d79f 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -117,7 +117,7 @@ test_phys_addrs_available(void)
return;
}
- physaddr = rte_mem_virt2phy(&tmp);
+ physaddr = rte_mem_virt2iova(&tmp);
if (physaddr == RTE_BAD_PHYS_ADDR) {
RTE_LOG(ERR, EAL,
"Cannot obtain physical addresses: %s. "
@@ -131,7 +131,7 @@ test_phys_addrs_available(void)
* Get physical address of any mapped virtual address in the current process.
*/
iova_addr_t
-rte_mem_virt2phy(const void *virtaddr)
+rte_mem_virt2iova(const void *virtaddr)
{
int fd, retval;
uint64_t page, physaddr;
@@ -222,7 +222,7 @@ find_physaddrs(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
iova_addr_t addr;
for (i = 0; i < hpi->num_pages[0]; i++) {
- addr = rte_mem_virt2phy(hugepg_tbl[i].orig_va);
+ addr = rte_mem_virt2iova(hugepg_tbl[i].orig_va);
if (addr == RTE_BAD_PHYS_ADDR)
return -1;
hugepg_tbl[i].physaddr = addr;
@@ -1543,7 +1543,7 @@ rte_eal_hugepage_attach(void)
}
bool
-rte_eal_using_phys_addrs(void)
+rte_eal_using_iova_addrs(void)
{
return phys_addrs_available;
}
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 8951ce742..ee4a60bca 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -102,7 +102,7 @@ rte_pci_map_device(struct rte_pci_device *dev)
break;
case RTE_KDRV_IGB_UIO:
case RTE_KDRV_UIO_GENERIC:
- if (rte_eal_using_phys_addrs()) {
+ if (rte_eal_using_iova_addrs()) {
/* map resources for devices that use uio */
ret = pci_uio_map_resource(dev);
}
@@ -144,7 +144,7 @@ rte_pci_unmap_device(struct rte_pci_device *dev)
void *
pci_find_max_end_va(void)
{
- const struct rte_memseg *seg = rte_eal_get_physmem_layout();
+ const struct rte_memseg *seg = rte_eal_get_iovamem_layout();
const struct rte_memseg *last = seg;
unsigned i = 0;
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index c03fd713c..e2a6d3006 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -692,7 +692,7 @@ vfio_get_group_no(const char *sysfs_base,
static int
vfio_type1_dma_map(int vfio_container_fd)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
int i, ret;
/* map all DPDK segments for DMA. use 1:1 PA to IOVA mapping */
@@ -725,7 +725,7 @@ vfio_type1_dma_map(int vfio_container_fd)
static int
vfio_spapr_dma_map(int vfio_container_fd)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
int i, ret;
struct vfio_iommu_spapr_register_memory reg = {
@@ -760,7 +760,7 @@ vfio_spapr_dma_map(int vfio_container_fd)
}
/* calculate window size based on number of hugepages configured */
- create.window_size = rte_eal_get_physmem_size();
+ create.window_size = rte_eal_get_iovamem_size();
create.page_shift = __builtin_ctzll(ms->hugepage_sz);
create.levels = 2;
diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
index 3a8f15406..e2f50e5b1 100644
--- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map
+++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
@@ -14,7 +14,7 @@ DPDK_2.0 {
rte_cpu_get_flag_enabled;
rte_cycles_vmware_tsc_map;
rte_delay_us;
- rte_dump_physmem_layout;
+ rte_dump_iovamem_layout;
rte_dump_registers;
rte_dump_stack;
rte_dump_tailq;
@@ -25,8 +25,8 @@ DPDK_2.0 {
rte_eal_devargs_type_count;
rte_eal_get_configuration;
rte_eal_get_lcore_state;
- rte_eal_get_physmem_layout;
- rte_eal_get_physmem_size;
+ rte_eal_get_iovamem_layout;
+ rte_eal_get_iovamem_size;
rte_eal_has_hugepages;
rte_eal_hpet_init;
rte_eal_init;
@@ -62,10 +62,10 @@ DPDK_2.0 {
rte_malloc_set_limit;
rte_malloc_socket;
rte_malloc_validate;
- rte_malloc_virt2phy;
+ rte_malloc_virt2iova;
rte_mem_lock_page;
- rte_mem_phy2mch;
- rte_mem_virt2phy;
+ rte_mem_phy2iova;
+ rte_mem_virt2iova;
rte_memdump;
rte_memory_get_nchannel;
rte_memory_get_nrank;
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index b4f14cf61..39335e286 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -344,7 +344,7 @@ rte_mempool_free_memchunks(struct rte_mempool *mp)
* on error.
*/
int
-rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
+rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,
iova_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque)
{
@@ -408,7 +408,7 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
* number of objects added, or a negative value on error.
*/
int
-rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
+rte_mempool_populate_iova_tab(struct rte_mempool *mp, char *vaddr,
const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque)
{
@@ -421,7 +421,7 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
return -EEXIST;
if (mp->flags & MEMPOOL_F_NO_PHYS_CONTIG)
- return rte_mempool_populate_phys(mp, vaddr, RTE_BAD_PHYS_ADDR,
+ return rte_mempool_populate_iova(mp, vaddr, RTE_BAD_PHYS_ADDR,
pg_num * pg_sz, free_cb, opaque);
for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {
@@ -431,7 +431,7 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
paddr[i + n - 1] + pg_sz == paddr[i + n]; n++)
;
- ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,
+ ret = rte_mempool_populate_iova(mp, vaddr + i * pg_sz,
paddr[i], n * pg_sz, free_cb, opaque);
if (ret < 0) {
rte_mempool_free_memchunks(mp);
@@ -466,15 +466,15 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
return -EINVAL;
if (mp->flags & MEMPOOL_F_NO_PHYS_CONTIG)
- return rte_mempool_populate_phys(mp, addr, RTE_BAD_PHYS_ADDR,
+ return rte_mempool_populate_iova(mp, addr, RTE_BAD_PHYS_ADDR,
len, free_cb, opaque);
for (off = 0; off + pg_sz <= len &&
mp->populated_size < mp->size; off += phys_len) {
- paddr = rte_mem_virt2phy(addr + off);
+ paddr = rte_mem_virt2iova(addr + off);
/* required for xen_dom0 to get the machine address */
- paddr = rte_mem_phy2mch(-1, paddr);
+ paddr = rte_mem_phy2iova(-1, paddr);
if (paddr == RTE_BAD_PHYS_ADDR && rte_eal_has_hugepages()) {
ret = -EINVAL;
@@ -485,14 +485,14 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
for (phys_len = pg_sz; off + phys_len < len; phys_len += pg_sz) {
iova_addr_t paddr_tmp;
- paddr_tmp = rte_mem_virt2phy(addr + off + phys_len);
- paddr_tmp = rte_mem_phy2mch(-1, paddr_tmp);
+ paddr_tmp = rte_mem_virt2iova(addr + off + phys_len);
+ paddr_tmp = rte_mem_phy2iova(-1, paddr_tmp);
if (paddr_tmp != paddr + phys_len)
break;
}
- ret = rte_mempool_populate_phys(mp, addr + off, paddr,
+ ret = rte_mempool_populate_iova(mp, addr + off, paddr,
phys_len, free_cb, opaque);
if (ret < 0)
goto fail;
@@ -569,7 +569,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)
paddr = mz->phys_addr;
if (rte_eal_has_hugepages() && !rte_xen_dom0_supported())
- ret = rte_mempool_populate_phys(mp, mz->addr,
+ ret = rte_mempool_populate_iova(mp, mz->addr,
paddr, mz->len,
rte_mempool_memchunk_mz_free,
(void *)(uintptr_t)mz);
@@ -954,7 +954,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
if (mp_init)
mp_init(mp, mp_init_arg);
- ret = rte_mempool_populate_phys_tab(mp, vaddr, paddr, pg_num, pg_shift,
+ ret = rte_mempool_populate_iova_tab(mp, vaddr, paddr, pg_num, pg_shift,
NULL, NULL);
if (ret < 0 || ret != (int)mp->size)
goto fail;
diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index 1bcb6ebd7..13c16eee0 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -819,7 +819,7 @@ rte_mempool_free(struct rte_mempool *mp);
* On error, the chunk is not added in the memory list of the
* mempool and a negative errno is returned.
*/
-int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
+int rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,
iova_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque);
@@ -850,7 +850,7 @@ int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
* On error, the chunks are not added in the memory list of the
* mempool and a negative errno is returned.
*/
-int rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
+int rte_mempool_populate_iova_tab(struct rte_mempool *mp, char *vaddr,
const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque);
diff --git a/lib/librte_mempool/rte_mempool_version.map b/lib/librte_mempool/rte_mempool_version.map
index f9c079447..2904c299f 100644
--- a/lib/librte_mempool/rte_mempool_version.map
+++ b/lib/librte_mempool/rte_mempool_version.map
@@ -34,8 +34,8 @@ DPDK_16.07 {
rte_mempool_ops_table;
rte_mempool_populate_anon;
rte_mempool_populate_default;
- rte_mempool_populate_phys;
- rte_mempool_populate_phys_tab;
+ rte_mempool_populate_iova;
+ rte_mempool_populate_iova_tab;
rte_mempool_populate_virt;
rte_mempool_register_ops;
rte_mempool_set_ops_byname;
diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index ad2e8d380..5c546ba33 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -453,7 +453,7 @@ add_guest_pages(struct virtio_net *dev, struct rte_vhost_mem_region *reg,
uint64_t host_phys_addr;
uint64_t size;
- host_phys_addr = rte_mem_virt2phy((void *)(uintptr_t)host_user_addr);
+ host_phys_addr = rte_mem_virt2iova((void *)(uintptr_t)host_user_addr);
size = page_size - (guest_phys_addr & (page_size - 1));
size = RTE_MIN(size, reg_size);
@@ -464,7 +464,7 @@ add_guest_pages(struct virtio_net *dev, struct rte_vhost_mem_region *reg,
while (reg_size > 0) {
size = RTE_MIN(reg_size, page_size);
- host_phys_addr = rte_mem_virt2phy((void *)(uintptr_t)
+ host_phys_addr = rte_mem_virt2iova((void *)(uintptr_t)
host_user_addr);
add_one_guest_page(dev, guest_phys_addr, host_phys_addr, size);
diff --git a/test/test/commands.c b/test/test/commands.c
index 4097a3310..9f5028d41 100644
--- a/test/test/commands.c
+++ b/test/test/commands.c
@@ -147,7 +147,7 @@ static void cmd_dump_parsed(void *parsed_result,
struct cmd_dump_result *res = parsed_result;
if (!strcmp(res->dump, "dump_physmem"))
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
else if (!strcmp(res->dump, "dump_memzone"))
rte_memzone_dump(stdout);
else if (!strcmp(res->dump, "dump_struct_sizes"))
diff --git a/test/test/test_malloc.c b/test/test/test_malloc.c
index 013fd4407..fc995596e 100644
--- a/test/test/test_malloc.c
+++ b/test/test/test_malloc.c
@@ -741,7 +741,7 @@ test_malloc_bad_params(void)
static int
is_mem_on_socket(int32_t socket)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
unsigned i;
for (i = 0; i < RTE_MAX_MEMSEG; i++) {
@@ -758,7 +758,7 @@ is_mem_on_socket(int32_t socket)
static int32_t
addr_to_socket(void * addr)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
unsigned i;
for (i = 0; i < RTE_MAX_MEMSEG; i++) {
diff --git a/test/test/test_memory.c b/test/test/test_memory.c
index 921bdc883..9ab0f52fd 100644
--- a/test/test/test_memory.c
+++ b/test/test/test_memory.c
@@ -64,17 +64,17 @@ test_memory(void)
* that at least one line is dumped
*/
printf("Dump memory layout\n");
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
/* check that memory size is != 0 */
- s = rte_eal_get_physmem_size();
+ s = rte_eal_get_iovamem_size();
if (s == 0) {
printf("No memory detected\n");
return -1;
}
/* try to read memory (should not segfault) */
- mem = rte_eal_get_physmem_layout();
+ mem = rte_eal_get_iovamem_layout();
for (i = 0; i < RTE_MAX_MEMSEG && mem[i].addr != NULL ; i++) {
/* check memory */
diff --git a/test/test/test_mempool.c b/test/test/test_mempool.c
index 0a4423954..b4c46131c 100644
--- a/test/test/test_mempool.c
+++ b/test/test/test_mempool.c
@@ -145,9 +145,9 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache)
MEMPOOL_HEADER_SIZE(mp, mp->cache_size))
GOTO_ERR(ret, out);
-#ifndef RTE_EXEC_ENV_BSDAPP /* rte_mem_virt2phy() not supported on bsd */
+#ifndef RTE_EXEC_ENV_BSDAPP /* rte_mem_virt2iova() not supported on bsd */
printf("get physical address of an object\n");
- if (rte_mempool_virt2phy(mp, obj) != rte_mem_virt2phy(obj))
+ if (rte_mempool_virt2phy(mp, obj) != rte_mem_virt2iova(obj))
GOTO_ERR(ret, out);
#endif
diff --git a/test/test/test_memzone.c b/test/test/test_memzone.c
index 0afb159e9..177bcb73e 100644
--- a/test/test/test_memzone.c
+++ b/test/test/test_memzone.c
@@ -139,7 +139,7 @@ test_memzone_reserve_flags(void)
int hugepage_16GB_avail = 0;
const size_t size = 100;
int i = 0;
- ms = rte_eal_get_physmem_layout();
+ ms = rte_eal_get_iovamem_layout();
for (i = 0; i < RTE_MAX_MEMSEG; i++) {
if (ms[i].hugepage_sz == RTE_PGSIZE_2M)
hugepage_2MB_avail = 1;
@@ -422,7 +422,7 @@ test_memzone_reserve_max(void)
if (mz == NULL){
printf("Failed to reserve a big chunk of memory - %s\n",
rte_strerror(rte_errno));
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
rte_memzone_dump(stdout);
return -1;
}
@@ -430,7 +430,7 @@ test_memzone_reserve_max(void)
if (mz->len != maxlen) {
printf("Memzone reserve with 0 size did not return bigest block\n");
printf("Expected size = %zu, actual size = %zu\n", maxlen, mz->len);
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
rte_memzone_dump(stdout);
return -1;
}
@@ -459,7 +459,7 @@ test_memzone_reserve_max_aligned(void)
if (mz == NULL){
printf("Failed to reserve a big chunk of memory - %s\n",
rte_strerror(rte_errno));
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
rte_memzone_dump(stdout);
return -1;
}
@@ -469,7 +469,7 @@ test_memzone_reserve_max_aligned(void)
" bigest block\n", align);
printf("Expected size = %zu, actual size = %zu\n",
maxlen, mz->len);
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
rte_memzone_dump(stdout);
return -1;
}
--
2.11.0
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v2 5/5] doc: remove dpdk iova aware notice
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Santosh Shukla
` (3 preceding siblings ...)
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 4/5] eal/memory: rename memory api to iova types Santosh Shukla
@ 2017-09-05 10:31 ` Santosh Shukla
2017-09-19 13:38 ` Mcnamara, John
2017-10-17 13:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Thomas Monjalon
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 0/6] " Santosh Shukla
6 siblings, 1 reply; 91+ messages in thread
From: Santosh Shukla @ 2017-09-05 10:31 UTC (permalink / raw)
To: dev; +Cc: thomas, jerin.jacob, hemant.agrawal, olivier.matz, Santosh Shukla
Removed dpdk iova aware ABI deprecation notice,
and updated ABI change details in release_17.11.rst.
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
doc/guides/rel_notes/deprecation.rst | 7 -------
doc/guides/rel_notes/release_17_11.rst | 27 +++++++++++++++++++++++++++
2 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 3362f3350..6482363bf 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -32,13 +32,6 @@ Deprecation Notices
* eal: the support of Xen dom0 will be removed from EAL in 17.11; and with
that, drivers/net/xenvirt and examples/vhost_xen will also be removed.
-* eal: An ABI change is planned for 17.11 to make DPDK aware of IOVA address
- translation scheme.
- Reference to phys address in EAL data-structure or functions may change to
- IOVA address or more appropriate name.
- The change will be only for the name.
- Functional aspects of the API or data-structure will remain same.
-
* The mbuf flags PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated and
are respectively replaced by PKT_RX_VLAN_STRIPPED and
PKT_RX_QINQ_STRIPPED, that are better described. The old flags and
diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
index 170f4f916..30d0c0229 100644
--- a/doc/guides/rel_notes/release_17_11.rst
+++ b/doc/guides/rel_notes/release_17_11.rst
@@ -124,7 +124,34 @@ ABI Changes
Also, make sure to start the actual text at the margin.
=========================================================
+* **Following datatypes, structure member and function renamed to iova type.**
+ * Renamed ``phys_addr_t`` to ``iova_addr_t``.
+ * Renamed ``buf_physaddr`` to ``buf_iovaaddr`` for struct rte_mbuf.
+ * Renamed ``phys_addr`` to ``iova_addr`` for struct rte_memseg.
+ * The Following memory translation api renamed from:
+
+ * ``rte_mempool_populate_phys()``
+ * ``rte_mempool_populate_phys_tab()``
+ * ``rte_eal_using_phys_addrs()``
+ * ``rte_mem_virt2phy()``
+ * ``rte_dump_physmem_layout()``
+ * ``rte_eal_get_physmem_layout()``
+ * ``rte_eal_get_physmem_size()``
+ * ``rte_malloc_virt2phy()``
+ * ``rte_mem_phy2mch()``
+
+ * To the following iova types api:
+
+ * ``rte_mempool_populate_iova()``
+ * ``rte_mempool_populate_iova_tab()``
+ * ``rte_eal_using_iova_addrs()``
+ * ``rte_mem_virt2iova()``
+ * ``rte_dump_iovamem_layout()``
+ * ``rte_eal_get_iovamem_layout()``
+ * ``rte_eal_get_iovamem_size()``
+ * ``rte_malloc_virt2iova()``
+ * ``rte_mem_phy2iova()``
Shared Library Versions
-----------------------
--
2.11.0
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v1 1/4] eal: rename phys_addr_t to iova_addr_t
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 1/4] eal: rename phys_addr_t to iova_addr_t Santosh Shukla
@ 2017-09-18 14:06 ` Burakov, Anatoly
2017-09-18 14:31 ` santosh
2017-09-18 14:32 ` Burakov, Anatoly
0 siblings, 2 replies; 91+ messages in thread
From: Burakov, Anatoly @ 2017-09-18 14:06 UTC (permalink / raw)
To: Santosh Shukla, dev
Hi Santosh,
On 14-Aug-17 4:15 PM, Santosh Shukla wrote:
> Signed-off-by: Santosh Shukla <santosh.shukla at caviumnetworks.com>
> ---
> v1 note:
> - As changes percolate to all possible dpdk subsystem..
> so its difficult to tag subject with one common title,
> but since, core of changeset is at eal layer so keeping 'eal:'
> as title.
>
> app/test-crypto-perf/cperf_test_vectors.h | 4 +--
> doc/guides/contributing/documentation.rst | 4 +--
> doc/guides/prog_guide/cryptodev_lib.rst | 6 ++--
> drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 14 ++++----
> drivers/crypto/qat/qat_adf/qat_algs.h | 6 ++--
> drivers/crypto/qat/qat_crypto.h | 2 +-
> drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 +-
> drivers/net/ark/ark_ddm.c | 2 +-
> drivers/net/ark/ark_ddm.h | 4 +--
> drivers/net/ark/ark_ethdev_rx.c | 12 +++----
> drivers/net/ark/ark_ethdev_tx.c | 2 +-
> drivers/net/ark/ark_mpu.c | 2 +-
> drivers/net/ark/ark_mpu.h | 4 +--
> drivers/net/ark/ark_udm.c | 2 +-
> drivers/net/ark/ark_udm.h | 4 +--
> drivers/net/avp/avp_ethdev.c | 2 +-
> drivers/net/avp/rte_avp_common.h | 20 +++++------
> drivers/net/bnx2x/bnx2x.c | 40 +++++++++++-----------
> drivers/net/bnx2x/bnx2x.h | 22 ++++++------
> drivers/net/bnx2x/bnx2x_rxtx.c | 4 +--
> drivers/net/bnx2x/bnx2x_stats.c | 2 +-
> drivers/net/bnx2x/bnx2x_vfpf.c | 2 +-
> drivers/net/bnx2x/ecore_sp.h | 2 +-
> drivers/net/bnxt/bnxt.h | 10 +++---
> drivers/net/bnxt/bnxt_cpr.h | 4 +--
> drivers/net/bnxt/bnxt_ethdev.c | 2 +-
> drivers/net/bnxt/bnxt_ring.c | 2 +-
> drivers/net/bnxt/bnxt_ring.h | 2 +-
> drivers/net/bnxt/bnxt_rxr.h | 4 +--
> drivers/net/bnxt/bnxt_txr.h | 2 +-
> drivers/net/bnxt/bnxt_vnic.c | 2 +-
> drivers/net/bnxt/bnxt_vnic.h | 6 ++--
> drivers/net/liquidio/lio_rxtx.c | 2 +-
> drivers/net/liquidio/lio_rxtx.h | 4 +--
> drivers/net/qede/base/bcm_osal.h | 2 +-
> drivers/net/sfc/efsys.h | 2 +-
> drivers/net/sfc/sfc_ef10_rx.c | 2 +-
> drivers/net/sfc/sfc_ef10_tx.c | 4 +--
> drivers/net/thunderx/base/nicvf_hw.c | 2 +-
> drivers/net/thunderx/base/nicvf_hw.h | 2 +-
> drivers/net/thunderx/base/nicvf_hw_defs.h | 6 ++--
> drivers/net/thunderx/nicvf_ethdev.c | 4 +--
> drivers/net/thunderx/nicvf_ethdev.h | 4 +--
> drivers/net/thunderx/nicvf_struct.h | 6 ++--
> drivers/net/virtio/virtio_rxtx.h | 4 +--
> drivers/net/virtio/virtqueue.h | 2 +-
> drivers/net/xenvirt/rte_eth_xenvirt.c | 2 +-
> drivers/net/xenvirt/rte_mempool_gntalloc.c | 6 ++--
> drivers/net/xenvirt/rte_xen_lib.c | 6 ++--
> drivers/net/xenvirt/rte_xen_lib.h | 8 ++---
> examples/l2fwd-crypto/main.c | 2 +-
> lib/librte_cryptodev/rte_crypto.h | 2 +-
> lib/librte_cryptodev/rte_crypto_sym.h | 6 ++--
> lib/librte_cryptodev/rte_cryptodev.h | 2 +-
> lib/librte_eal/bsdapp/eal/eal_memory.c | 4 +--
> lib/librte_eal/common/include/rte_malloc.h | 2 +-
> lib/librte_eal/common/include/rte_memory.h | 18 +++++-----
> lib/librte_eal/common/include/rte_memzone.h | 2 +-
> lib/librte_eal/common/rte_malloc.c | 2 +-
> lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++---
> lib/librte_eal/linuxapp/eal/eal_xen_memory.c | 4 +--
> .../linuxapp/eal/include/exec-env/rte_kni_common.h | 19 +++++-----
> lib/librte_mbuf/rte_mbuf.h | 8 ++---
> lib/librte_mempool/rte_mempool.c | 18 +++++-----
> lib/librte_mempool/rte_mempool.h | 14 ++++----
> lib/librte_vhost/vhost.h | 2 +-
> test/test/test_cryptodev.h | 2 +-
> test/test/test_memzone.c | 8 ++---
> 68 files changed, 195 insertions(+), 194 deletions(-)
>
> diff --git a/app/test-crypto-perf/cperf_test_vectors.h b/app/test-crypto-perf/cperf_test_vectors.h
> index 85955703c..a203272cf 100644
> --- a/app/test-crypto-perf/cperf_test_vectors.h
> +++ b/app/test-crypto-perf/cperf_test_vectors.h
> @@ -78,13 +78,13 @@ struct cperf_test_vector {
>
> struct {
> uint8_t *data;
> - phys_addr_t phys_addr;
> + iova_addr_t phys_addr;
> uint16_t length;
> } aad;
>
> struct {
> uint8_t *data;
> - phys_addr_t phys_addr;
> + iova_addr_t phys_addr;
> uint16_t length;
> } digest;
>
> diff --git a/doc/guides/contributing/documentation.rst b/doc/guides/contributing/documentation.rst
> index cddbd7bb8..719007b9f 100644
> --- a/doc/guides/contributing/documentation.rst
> +++ b/doc/guides/contributing/documentation.rst
> @@ -712,7 +712,7 @@ The following are some guidelines for use of Doxygen in the DPDK API documentati
> /**< Virtual address of the first mempool object. */
> uintptr_t elt_va_end;
> /**< Virtual address of the <size + 1> mempool object. */
> - phys_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
> + iova_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
> /**< Array of physical page addresses for the mempool buffer. */
Here and perhaps in other places - worth it to fix comments as well?
>
> This doesn't have an effect on the rendered documentation but it is confusing for the developer reading the code.
> @@ -731,7 +731,7 @@ The following are some guidelines for use of Doxygen in the DPDK API documentati
> /** Virtual address of the <size + 1> mempool object. */
> uintptr_t elt_va_end;
> /** Array of physical page addresses for the mempool buffer. */
> - phys_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
> + iova_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
>
> * Check for Doxygen warnings in new code by checking the API documentation build::
>
...
> --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
> +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
> @@ -58,7 +58,6 @@
>
> #ifndef _RTE_KNI_COMMON_H_
> #define _RTE_KNI_COMMON_H_
> -
> #ifdef __KERNEL__
> #include <linux/if.h>
> #define RTE_STD_C11
> @@ -66,6 +65,8 @@
> #include <rte_common.h>
> #endif
>
> +typedef uint64_t iova_addr_t;
> +
Why was this added? (This also causes a compile issue according to build
automation)
Thanks,
Anatoly
> /**
> * KNI name is part of memzone name.
> */
> @@ -138,20 +139,20 @@ struct rte_kni_mbuf {
> struct rte_kni_device_info {
> char name[RTE_KNI_NAMESIZE]; /**< Network device name for KNI */
>
> - phys_addr_t tx_phys;
> - phys_addr_t rx_phys;
> - phys_addr_t alloc_phys;
> - phys_addr_t free_phys;
> + iova_addr_t tx_phys;
> + iova_addr_t rx_phys;
> + iova_addr_t alloc_phys;
> + iova_addr_t free_phys;
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v1 1/4] eal: rename phys_addr_t to iova_addr_t
2017-09-18 14:06 ` Burakov, Anatoly
@ 2017-09-18 14:31 ` santosh
2017-09-18 14:32 ` Burakov, Anatoly
1 sibling, 0 replies; 91+ messages in thread
From: santosh @ 2017-09-18 14:31 UTC (permalink / raw)
To: Burakov, Anatoly, dev
On Monday 18 September 2017 07:36 PM, Burakov, Anatoly wrote:
> Hi Santosh,
>
> On 14-Aug-17 4:15 PM, Santosh Shukla wrote:
>> Signed-off-by: Santosh Shukla <santosh.shukla at caviumnetworks.com>
>> ---
>> v1 note:
>> - As changes percolate to all possible dpdk subsystem..
>> so its difficult to tag subject with one common title,
>> but since, core of changeset is at eal layer so keeping 'eal:'
>> as title.
>>
>> app/test-crypto-perf/cperf_test_vectors.h | 4 +--
>> doc/guides/contributing/documentation.rst | 4 +--
>> doc/guides/prog_guide/cryptodev_lib.rst | 6 ++--
>> drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 14 ++++----
>> drivers/crypto/qat/qat_adf/qat_algs.h | 6 ++--
>> drivers/crypto/qat/qat_crypto.h | 2 +-
>> drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 +-
>> drivers/net/ark/ark_ddm.c | 2 +-
>> drivers/net/ark/ark_ddm.h | 4 +--
>> drivers/net/ark/ark_ethdev_rx.c | 12 +++----
>> drivers/net/ark/ark_ethdev_tx.c | 2 +-
>> drivers/net/ark/ark_mpu.c | 2 +-
>> drivers/net/ark/ark_mpu.h | 4 +--
>> drivers/net/ark/ark_udm.c | 2 +-
>> drivers/net/ark/ark_udm.h | 4 +--
>> drivers/net/avp/avp_ethdev.c | 2 +-
>> drivers/net/avp/rte_avp_common.h | 20 +++++------
>> drivers/net/bnx2x/bnx2x.c | 40 +++++++++++-----------
>> drivers/net/bnx2x/bnx2x.h | 22 ++++++------
>> drivers/net/bnx2x/bnx2x_rxtx.c | 4 +--
>> drivers/net/bnx2x/bnx2x_stats.c | 2 +-
>> drivers/net/bnx2x/bnx2x_vfpf.c | 2 +-
>> drivers/net/bnx2x/ecore_sp.h | 2 +-
>> drivers/net/bnxt/bnxt.h | 10 +++---
>> drivers/net/bnxt/bnxt_cpr.h | 4 +--
>> drivers/net/bnxt/bnxt_ethdev.c | 2 +-
>> drivers/net/bnxt/bnxt_ring.c | 2 +-
>> drivers/net/bnxt/bnxt_ring.h | 2 +-
>> drivers/net/bnxt/bnxt_rxr.h | 4 +--
>> drivers/net/bnxt/bnxt_txr.h | 2 +-
>> drivers/net/bnxt/bnxt_vnic.c | 2 +-
>> drivers/net/bnxt/bnxt_vnic.h | 6 ++--
>> drivers/net/liquidio/lio_rxtx.c | 2 +-
>> drivers/net/liquidio/lio_rxtx.h | 4 +--
>> drivers/net/qede/base/bcm_osal.h | 2 +-
>> drivers/net/sfc/efsys.h | 2 +-
>> drivers/net/sfc/sfc_ef10_rx.c | 2 +-
>> drivers/net/sfc/sfc_ef10_tx.c | 4 +--
>> drivers/net/thunderx/base/nicvf_hw.c | 2 +-
>> drivers/net/thunderx/base/nicvf_hw.h | 2 +-
>> drivers/net/thunderx/base/nicvf_hw_defs.h | 6 ++--
>> drivers/net/thunderx/nicvf_ethdev.c | 4 +--
>> drivers/net/thunderx/nicvf_ethdev.h | 4 +--
>> drivers/net/thunderx/nicvf_struct.h | 6 ++--
>> drivers/net/virtio/virtio_rxtx.h | 4 +--
>> drivers/net/virtio/virtqueue.h | 2 +-
>> drivers/net/xenvirt/rte_eth_xenvirt.c | 2 +-
>> drivers/net/xenvirt/rte_mempool_gntalloc.c | 6 ++--
>> drivers/net/xenvirt/rte_xen_lib.c | 6 ++--
>> drivers/net/xenvirt/rte_xen_lib.h | 8 ++---
>> examples/l2fwd-crypto/main.c | 2 +-
>> lib/librte_cryptodev/rte_crypto.h | 2 +-
>> lib/librte_cryptodev/rte_crypto_sym.h | 6 ++--
>> lib/librte_cryptodev/rte_cryptodev.h | 2 +-
>> lib/librte_eal/bsdapp/eal/eal_memory.c | 4 +--
>> lib/librte_eal/common/include/rte_malloc.h | 2 +-
>> lib/librte_eal/common/include/rte_memory.h | 18 +++++-----
>> lib/librte_eal/common/include/rte_memzone.h | 2 +-
>> lib/librte_eal/common/rte_malloc.c | 2 +-
>> lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++---
>> lib/librte_eal/linuxapp/eal/eal_xen_memory.c | 4 +--
>> .../linuxapp/eal/include/exec-env/rte_kni_common.h | 19 +++++-----
>> lib/librte_mbuf/rte_mbuf.h | 8 ++---
>> lib/librte_mempool/rte_mempool.c | 18 +++++-----
>> lib/librte_mempool/rte_mempool.h | 14 ++++----
>> lib/librte_vhost/vhost.h | 2 +-
>> test/test/test_cryptodev.h | 2 +-
>> test/test/test_memzone.c | 8 ++---
>> 68 files changed, 195 insertions(+), 194 deletions(-)
>>
>> diff --git a/app/test-crypto-perf/cperf_test_vectors.h b/app/test-crypto-perf/cperf_test_vectors.h
>> index 85955703c..a203272cf 100644
>> --- a/app/test-crypto-perf/cperf_test_vectors.h
>> +++ b/app/test-crypto-perf/cperf_test_vectors.h
>> @@ -78,13 +78,13 @@ struct cperf_test_vector {
>> struct {
>> uint8_t *data;
>> - phys_addr_t phys_addr;
>> + iova_addr_t phys_addr;
>> uint16_t length;
>> } aad;
>> struct {
>> uint8_t *data;
>> - phys_addr_t phys_addr;
>> + iova_addr_t phys_addr;
>> uint16_t length;
>> } digest;
>> diff --git a/doc/guides/contributing/documentation.rst b/doc/guides/contributing/documentation.rst
>> index cddbd7bb8..719007b9f 100644
>> --- a/doc/guides/contributing/documentation.rst
>> +++ b/doc/guides/contributing/documentation.rst
>> @@ -712,7 +712,7 @@ The following are some guidelines for use of Doxygen in the DPDK API documentati
>> /**< Virtual address of the first mempool object. */
>> uintptr_t elt_va_end;
>> /**< Virtual address of the <size + 1> mempool object. */
>> - phys_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
>> + iova_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
>> /**< Array of physical page addresses for the mempool buffer. */
>
> Here and perhaps in other places - worth it to fix comments as well?
>
ok,
>> This doesn't have an effect on the rendered documentation but it is confusing for the developer reading the code.
>> @@ -731,7 +731,7 @@ The following are some guidelines for use of Doxygen in the DPDK API documentati
>> /** Virtual address of the <size + 1> mempool object. */
>> uintptr_t elt_va_end;
>> /** Array of physical page addresses for the mempool buffer. */
>> - phys_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
>> + iova_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
>> * Check for Doxygen warnings in new code by checking the API documentation build::
>>
>
> ...
>
>> --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
>> +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
>> @@ -58,7 +58,6 @@
>> #ifndef _RTE_KNI_COMMON_H_
>> #define _RTE_KNI_COMMON_H_
>> -
>> #ifdef __KERNEL__
>> #include <linux/if.h>
>> #define RTE_STD_C11
>> @@ -66,6 +65,8 @@
>> #include <rte_common.h>
>> #endif
>> +typedef uint64_t iova_addr_t;
>> +
>
> Why was this added? (This also causes a compile issue according to build automation)
>
sent v2 [1] which fixes build issue for clang.
[1] http://dpdk.org/ml/archives/dev/2017-September/074524.html
> Thanks,
> Anatoly
>
>> /**
>> * KNI name is part of memzone name.
>> */
>> @@ -138,20 +139,20 @@ struct rte_kni_mbuf {
>> struct rte_kni_device_info {
>> char name[RTE_KNI_NAMESIZE]; /**< Network device name for KNI */
>> - phys_addr_t tx_phys;
>> - phys_addr_t rx_phys;
>> - phys_addr_t alloc_phys;
>> - phys_addr_t free_phys;
>> + iova_addr_t tx_phys;
>> + iova_addr_t rx_phys;
>> + iova_addr_t alloc_phys;
>> + iova_addr_t free_phys;
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v1 1/4] eal: rename phys_addr_t to iova_addr_t
2017-09-18 14:06 ` Burakov, Anatoly
2017-09-18 14:31 ` santosh
@ 2017-09-18 14:32 ` Burakov, Anatoly
1 sibling, 0 replies; 91+ messages in thread
From: Burakov, Anatoly @ 2017-09-18 14:32 UTC (permalink / raw)
To: Santosh Shukla, dev
> Why was this added? (This also causes a compile issue according to build
> automation)
>
> Thanks,
> Anatoly
Never mind, didn't notice v2 was out :/
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/5] eal/memory: rename memseg member phys to iova addr
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 3/5] eal/memory: rename memseg member phys to iova addr Santosh Shukla
@ 2017-09-18 15:04 ` Burakov, Anatoly
2017-09-18 15:08 ` santosh
2017-09-18 15:21 ` Burakov, Anatoly
1 sibling, 1 reply; 91+ messages in thread
From: Burakov, Anatoly @ 2017-09-18 15:04 UTC (permalink / raw)
To: Santosh Shukla, dev
On 05-Sep-17 11:31 AM, Santosh Shukla wrote:
> Renaming rte_memseg {.phys_addr} to {.iova_addr}
>
> Signed-off-by: Santosh Shukla <santosh.shukla at caviumnetworks.com>
> ---
> v1 --> v2:
> - includes freebsdp v1 build fixes.
>
> lib/librte_eal/bsdapp/eal/eal_memory.c | 4 ++--
> lib/librte_eal/common/eal_common_memory.c | 2 +-
> lib/librte_eal/common/include/rte_memory.h | 4 ++--
> lib/librte_eal/common/rte_malloc.c | 5 +++--
> lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
> lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 ++--
> 6 files changed, 14 insertions(+), 13 deletions(-)
>
> diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
> index 10c2e121f..d8882dcef 100644
> --- a/lib/librte_eal/bsdapp/eal/eal_memory.c
> +++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
> @@ -73,7 +73,7 @@ rte_eal_hugepage_init(void)
> /* for debug purposes, hugetlbfs can be disabled */
> if (internal_config.no_hugetlbfs) {
> addr = malloc(internal_config.memory);
> - mcfg->memseg[0].phys_addr = (iova_addr_t)(uintptr_t)addr;
> + mcfg->memseg[0].iova_addr = (iova_addr_t)(uintptr_t)addr;
> mcfg->memseg[0].addr = addr;
> mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
> mcfg->memseg[0].len = internal_config.memory;
> @@ -114,7 +114,7 @@ rte_eal_hugepage_init(void)
>
> seg = &mcfg->memseg[seg_idx++];
> seg->addr = addr;
> - seg->phys_addr = physaddr;
> + seg->iova_addr = (iova_addr_t)physaddr;
> seg->hugepage_sz = hpi->hugepage_sz;
> seg->len = hpi->hugepage_sz;
> seg->nchannel = mcfg->nchannel;
> diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
> index 996877ef5..5ed83d20a 100644
> --- a/lib/librte_eal/common/eal_common_memory.c
> +++ b/lib/librte_eal/common/eal_common_memory.c
> @@ -100,7 +100,7 @@ rte_dump_physmem_layout(FILE *f)
> "virt:%p, socket_id:%"PRId32", "
> "hugepage_sz:%"PRIu64", nchannel:%"PRIx32", "
> "nrank:%"PRIx32"\n", i,
> - mcfg->memseg[i].phys_addr,
> + mcfg->memseg[i].iova_addr,
> mcfg->memseg[i].len,
> mcfg->memseg[i].addr,
> mcfg->memseg[i].socket_id,
> diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
> index 5face8c86..6b148ba8e 100644
> --- a/lib/librte_eal/common/include/rte_memory.h
> +++ b/lib/librte_eal/common/include/rte_memory.h
> @@ -98,14 +98,14 @@ enum rte_page_sizes {
> */
> #define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)
>
> -typedef uint64_t iova_addr_t; /**< Physical address definition. */
> +typedef uint64_t iova_addr_t; /**< Iova address definition. */
> #define RTE_BAD_PHYS_ADDR ((iova_addr_t)-1)
>
> /**
> * Physical memory segment descriptor.
> */
> struct rte_memseg {
> - iova_addr_t phys_addr; /**< Start physical address. */
> + iova_addr_t iova_addr; /**< Start iova(_pa or _va) address. */
> RTE_STD_C11
> union {
> void *addr; /**< Start virtual address. */
> diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
> index 3ce6034bf..b65a06f9d 100644
> --- a/lib/librte_eal/common/rte_malloc.c
> +++ b/lib/librte_eal/common/rte_malloc.c
> @@ -254,7 +254,8 @@ rte_malloc_virt2phy(const void *addr)
> const struct malloc_elem *elem = malloc_elem_from_data(addr);
> if (elem == NULL)
> return RTE_BAD_PHYS_ADDR;
> - if (elem->ms->phys_addr == RTE_BAD_PHYS_ADDR)
> + if (elem->ms->iova_addr == RTE_BAD_PHYS_ADDR)
> return RTE_BAD_PHYS_ADDR;
> - return elem->ms->phys_addr + ((uintptr_t)addr - (uintptr_t)elem->ms->addr);
> + return elem->ms->iova_addr +
> + ((uintptr_t)addr - (uintptr_t)elem->ms->addr);
Hi Santosh,
I understand that this is a simple search-replace patch, but maybe you
could go ahead and fix this to be RTE_PTR_DIFF, like in below case.
> }
> diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
> index 405c15bcd..5d9702c72 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_memory.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
> @@ -154,7 +154,7 @@ rte_mem_virt2phy(const void *virtaddr)
> if (virtaddr > memseg->addr &&
> virtaddr < RTE_PTR_ADD(memseg->addr,
> memseg->len)) {
> - return memseg->phys_addr +
> + return memseg->iova_addr +
> RTE_PTR_DIFF(virtaddr, memseg->addr);
> }
> }
> @@ -1059,7 +1059,7 @@ rte_eal_hugepage_init(void)
> strerror(errno));
> return -1;
> }
> - mcfg->memseg[0].phys_addr = RTE_BAD_PHYS_ADDR;
> + mcfg->memseg[0].iova_addr = RTE_BAD_PHYS_ADDR;
> mcfg->memseg[0].addr = addr;
> mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
> mcfg->memseg[0].len = internal_config.memory;
> @@ -1319,7 +1319,7 @@ rte_eal_hugepage_init(void)
> if (j == RTE_MAX_MEMSEG)
> break;
>
> - mcfg->memseg[j].phys_addr = hugepage[i].physaddr;
> + mcfg->memseg[j].iova_addr = hugepage[i].physaddr;
> mcfg->memseg[j].addr = hugepage[i].final_va;
> mcfg->memseg[j].len = hugepage[i].size;
> mcfg->memseg[j].socket_id = hugepage[i].socket_id;
> @@ -1330,7 +1330,7 @@ rte_eal_hugepage_init(void)
> #ifdef RTE_ARCH_PPC_64
> /* Use the phy and virt address of the last page as segment
> * address for IBM Power architecture */
> - mcfg->memseg[j].phys_addr = hugepage[i].physaddr;
> + mcfg->memseg[j].iova_addr = hugepage[i].physaddr;
> mcfg->memseg[j].addr = hugepage[i].final_va;
> #endif
> mcfg->memseg[j].len += mcfg->memseg[j].hugepage_sz;
> diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
> index 946df7e31..c03fd713c 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
> @@ -706,7 +706,7 @@ vfio_type1_dma_map(int vfio_container_fd)
> dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map);
> dma_map.vaddr = ms[i].addr_64;
> dma_map.size = ms[i].len;
> - dma_map.iova = ms[i].phys_addr;
> + dma_map.iova = ms[i].iova_addr;
> dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE;
>
> ret = ioctl(vfio_container_fd, VFIO_IOMMU_MAP_DMA, &dma_map);
> @@ -792,7 +792,7 @@ vfio_spapr_dma_map(int vfio_container_fd)
> dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map);
> dma_map.vaddr = ms[i].addr_64;
> dma_map.size = ms[i].len;
> - dma_map.iova = ms[i].phys_addr;
> + dma_map.iova = ms[i].iova_addr;
> dma_map.flags = VFIO_DMA_MAP_FLAG_READ |
> VFIO_DMA_MAP_FLAG_WRITE;
>
>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/5] eal/memory: rename memseg member phys to iova addr
2017-09-18 15:04 ` Burakov, Anatoly
@ 2017-09-18 15:08 ` santosh
2017-09-18 15:11 ` Burakov, Anatoly
0 siblings, 1 reply; 91+ messages in thread
From: santosh @ 2017-09-18 15:08 UTC (permalink / raw)
To: Burakov, Anatoly, dev
Hi Anatoly,
On Monday 18 September 2017 08:34 PM, Burakov, Anatoly wrote:
> On 05-Sep-17 11:31 AM, Santosh Shukla wrote:
>> Renaming rte_memseg {.phys_addr} to {.iova_addr}
>>
>> Signed-off-by: Santosh Shukla <santosh.shukla at caviumnetworks.com>
>> ---
>> v1 --> v2:
>> - includes freebsdp v1 build fixes.
>>
>> lib/librte_eal/bsdapp/eal/eal_memory.c | 4 ++--
>> lib/librte_eal/common/eal_common_memory.c | 2 +-
>> lib/librte_eal/common/include/rte_memory.h | 4 ++--
>> lib/librte_eal/common/rte_malloc.c | 5 +++--
>> lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
>> lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 ++--
>> 6 files changed, 14 insertions(+), 13 deletions(-)
>>
>> diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
>> index 10c2e121f..d8882dcef 100644
>> --- a/lib/librte_eal/bsdapp/eal/eal_memory.c
>> +++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
>> @@ -73,7 +73,7 @@ rte_eal_hugepage_init(void)
>> /* for debug purposes, hugetlbfs can be disabled */
>> if (internal_config.no_hugetlbfs) {
>> addr = malloc(internal_config.memory);
>> - mcfg->memseg[0].phys_addr = (iova_addr_t)(uintptr_t)addr;
>> + mcfg->memseg[0].iova_addr = (iova_addr_t)(uintptr_t)addr;
>> mcfg->memseg[0].addr = addr;
>> mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
>> mcfg->memseg[0].len = internal_config.memory;
>> @@ -114,7 +114,7 @@ rte_eal_hugepage_init(void)
>> seg = &mcfg->memseg[seg_idx++];
>> seg->addr = addr;
>> - seg->phys_addr = physaddr;
>> + seg->iova_addr = (iova_addr_t)physaddr;
>> seg->hugepage_sz = hpi->hugepage_sz;
>> seg->len = hpi->hugepage_sz;
>> seg->nchannel = mcfg->nchannel;
>> diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
>> index 996877ef5..5ed83d20a 100644
>> --- a/lib/librte_eal/common/eal_common_memory.c
>> +++ b/lib/librte_eal/common/eal_common_memory.c
>> @@ -100,7 +100,7 @@ rte_dump_physmem_layout(FILE *f)
>> "virt:%p, socket_id:%"PRId32", "
>> "hugepage_sz:%"PRIu64", nchannel:%"PRIx32", "
>> "nrank:%"PRIx32"\n", i,
>> - mcfg->memseg[i].phys_addr,
>> + mcfg->memseg[i].iova_addr,
>> mcfg->memseg[i].len,
>> mcfg->memseg[i].addr,
>> mcfg->memseg[i].socket_id,
>> diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
>> index 5face8c86..6b148ba8e 100644
>> --- a/lib/librte_eal/common/include/rte_memory.h
>> +++ b/lib/librte_eal/common/include/rte_memory.h
>> @@ -98,14 +98,14 @@ enum rte_page_sizes {
>> */
>> #define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)
>> -typedef uint64_t iova_addr_t; /**< Physical address definition. */
>> +typedef uint64_t iova_addr_t; /**< Iova address definition. */
>> #define RTE_BAD_PHYS_ADDR ((iova_addr_t)-1)
>> /**
>> * Physical memory segment descriptor.
>> */
>> struct rte_memseg {
>> - iova_addr_t phys_addr; /**< Start physical address. */
>> + iova_addr_t iova_addr; /**< Start iova(_pa or _va) address. */
>> RTE_STD_C11
>> union {
>> void *addr; /**< Start virtual address. */
>> diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
>> index 3ce6034bf..b65a06f9d 100644
>> --- a/lib/librte_eal/common/rte_malloc.c
>> +++ b/lib/librte_eal/common/rte_malloc.c
>> @@ -254,7 +254,8 @@ rte_malloc_virt2phy(const void *addr)
>> const struct malloc_elem *elem = malloc_elem_from_data(addr);
>> if (elem == NULL)
>> return RTE_BAD_PHYS_ADDR;
>> - if (elem->ms->phys_addr == RTE_BAD_PHYS_ADDR)
>> + if (elem->ms->iova_addr == RTE_BAD_PHYS_ADDR)
>> return RTE_BAD_PHYS_ADDR;
>> - return elem->ms->phys_addr + ((uintptr_t)addr - (uintptr_t)elem->ms->addr);
>> + return elem->ms->iova_addr +
>> + ((uintptr_t)addr - (uintptr_t)elem->ms->addr);
>
> Hi Santosh,
>
> I understand that this is a simple search-replace patch, but maybe you could go ahead and fix this to be RTE_PTR_DIFF, like in below case.
>
Agree, Little scared to do more than one change in patch series ;).
Will do. It as separate patch, if that makes sense.
Thanks.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/5] eal/memory: rename memseg member phys to iova addr
2017-09-18 15:08 ` santosh
@ 2017-09-18 15:11 ` Burakov, Anatoly
0 siblings, 0 replies; 91+ messages in thread
From: Burakov, Anatoly @ 2017-09-18 15:11 UTC (permalink / raw)
To: santosh, dev
On 18-Sep-17 4:08 PM, santosh wrote:
> Hi Anatoly,
>
>
> On Monday 18 September 2017 08:34 PM, Burakov, Anatoly wrote:
>> On 05-Sep-17 11:31 AM, Santosh Shukla wrote:
>>> Renaming rte_memseg {.phys_addr} to {.iova_addr}
>>>
>>> Signed-off-by: Santosh Shukla <santosh.shukla at caviumnetworks.com>
>>> ---
>>> v1 --> v2:
>>> - includes freebsdp v1 build fixes.
>>>
>>> lib/librte_eal/bsdapp/eal/eal_memory.c | 4 ++--
>>> lib/librte_eal/common/eal_common_memory.c | 2 +-
>>> lib/librte_eal/common/include/rte_memory.h | 4 ++--
>>> lib/librte_eal/common/rte_malloc.c | 5 +++--
>>> lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
>>> lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 ++--
>>> 6 files changed, 14 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
>>> index 10c2e121f..d8882dcef 100644
>>> --- a/lib/librte_eal/bsdapp/eal/eal_memory.c
>>> +++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
>>> @@ -73,7 +73,7 @@ rte_eal_hugepage_init(void)
>>> /* for debug purposes, hugetlbfs can be disabled */
>>> if (internal_config.no_hugetlbfs) {
>>> addr = malloc(internal_config.memory);
>>> - mcfg->memseg[0].phys_addr = (iova_addr_t)(uintptr_t)addr;
>>> + mcfg->memseg[0].iova_addr = (iova_addr_t)(uintptr_t)addr;
>>> mcfg->memseg[0].addr = addr;
>>> mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
>>> mcfg->memseg[0].len = internal_config.memory;
>>> @@ -114,7 +114,7 @@ rte_eal_hugepage_init(void)
>>> seg = &mcfg->memseg[seg_idx++];
>>> seg->addr = addr;
>>> - seg->phys_addr = physaddr;
>>> + seg->iova_addr = (iova_addr_t)physaddr;
>>> seg->hugepage_sz = hpi->hugepage_sz;
>>> seg->len = hpi->hugepage_sz;
>>> seg->nchannel = mcfg->nchannel;
>>> diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
>>> index 996877ef5..5ed83d20a 100644
>>> --- a/lib/librte_eal/common/eal_common_memory.c
>>> +++ b/lib/librte_eal/common/eal_common_memory.c
>>> @@ -100,7 +100,7 @@ rte_dump_physmem_layout(FILE *f)
>>> "virt:%p, socket_id:%"PRId32", "
>>> "hugepage_sz:%"PRIu64", nchannel:%"PRIx32", "
>>> "nrank:%"PRIx32"\n", i,
>>> - mcfg->memseg[i].phys_addr,
>>> + mcfg->memseg[i].iova_addr,
>>> mcfg->memseg[i].len,
>>> mcfg->memseg[i].addr,
>>> mcfg->memseg[i].socket_id,
>>> diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
>>> index 5face8c86..6b148ba8e 100644
>>> --- a/lib/librte_eal/common/include/rte_memory.h
>>> +++ b/lib/librte_eal/common/include/rte_memory.h
>>> @@ -98,14 +98,14 @@ enum rte_page_sizes {
>>> */
>>> #define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)
>>> -typedef uint64_t iova_addr_t; /**< Physical address definition. */
>>> +typedef uint64_t iova_addr_t; /**< Iova address definition. */
>>> #define RTE_BAD_PHYS_ADDR ((iova_addr_t)-1)
>>> /**
>>> * Physical memory segment descriptor.
>>> */
>>> struct rte_memseg {
>>> - iova_addr_t phys_addr; /**< Start physical address. */
>>> + iova_addr_t iova_addr; /**< Start iova(_pa or _va) address. */
>>> RTE_STD_C11
>>> union {
>>> void *addr; /**< Start virtual address. */
>>> diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
>>> index 3ce6034bf..b65a06f9d 100644
>>> --- a/lib/librte_eal/common/rte_malloc.c
>>> +++ b/lib/librte_eal/common/rte_malloc.c
>>> @@ -254,7 +254,8 @@ rte_malloc_virt2phy(const void *addr)
>>> const struct malloc_elem *elem = malloc_elem_from_data(addr);
>>> if (elem == NULL)
>>> return RTE_BAD_PHYS_ADDR;
>>> - if (elem->ms->phys_addr == RTE_BAD_PHYS_ADDR)
>>> + if (elem->ms->iova_addr == RTE_BAD_PHYS_ADDR)
>>> return RTE_BAD_PHYS_ADDR;
>>> - return elem->ms->phys_addr + ((uintptr_t)addr - (uintptr_t)elem->ms->addr);
>>> + return elem->ms->iova_addr +
>>> + ((uintptr_t)addr - (uintptr_t)elem->ms->addr);
>>
>> Hi Santosh,
>>
>> I understand that this is a simple search-replace patch, but maybe you could go ahead and fix this to be RTE_PTR_DIFF, like in below case.
>>
> Agree, Little scared to do more than one change in patch series ;).
> Will do. It as separate patch, if that makes sense.
> Thanks.
>
>
>
Fair enough.
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/5] eal: rename phys_addr_t to iova_addr_t
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 1/5] eal: rename phys_addr_t to iova_addr_t Santosh Shukla
@ 2017-09-18 15:19 ` Burakov, Anatoly
0 siblings, 0 replies; 91+ messages in thread
From: Burakov, Anatoly @ 2017-09-18 15:19 UTC (permalink / raw)
To: Santosh Shukla, dev
On 05-Sep-17 11:31 AM, Santosh Shukla wrote:
> Renamed data type from phys_addr_t to iova_addr_t.
>
> Signed-off-by: Santosh Shukla <santosh.shukla at caviumnetworks.com>
> ---
> v1 --> v2:
> - clang build fix for v1 for linuxapp.
>
> v1 note:
> - As changes percolate to all possible dpdk subsystem..
> so its difficult to tag subject with one common title,
> but since, core of changeset is at eal layer so keeping 'eal:'
> as title.
>
> app/test-crypto-perf/cperf_test_vectors.h | 4 +--
> doc/guides/contributing/documentation.rst | 4 +--
> doc/guides/prog_guide/cryptodev_lib.rst | 6 ++--
> drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 14 ++++----
> drivers/crypto/qat/qat_adf/qat_algs.h | 6 ++--
> drivers/crypto/qat/qat_crypto.h | 2 +-
> drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 +-
> drivers/net/ark/ark_ddm.c | 2 +-
> drivers/net/ark/ark_ddm.h | 4 +--
> drivers/net/ark/ark_ethdev_rx.c | 12 +++----
> drivers/net/ark/ark_ethdev_tx.c | 2 +-
> drivers/net/ark/ark_mpu.c | 2 +-
> drivers/net/ark/ark_mpu.h | 4 +--
> drivers/net/ark/ark_udm.c | 2 +-
> drivers/net/ark/ark_udm.h | 4 +--
> drivers/net/avp/avp_ethdev.c | 2 +-
> drivers/net/avp/rte_avp_common.h | 20 +++++------
> drivers/net/bnx2x/bnx2x.c | 40 +++++++++++-----------
> drivers/net/bnx2x/bnx2x.h | 22 ++++++------
> drivers/net/bnx2x/bnx2x_rxtx.c | 4 +--
> drivers/net/bnx2x/bnx2x_stats.c | 2 +-
> drivers/net/bnx2x/bnx2x_vfpf.c | 2 +-
> drivers/net/bnx2x/ecore_sp.h | 2 +-
> drivers/net/bnxt/bnxt.h | 10 +++---
> drivers/net/bnxt/bnxt_cpr.h | 4 +--
> drivers/net/bnxt/bnxt_ethdev.c | 2 +-
> drivers/net/bnxt/bnxt_ring.c | 2 +-
> drivers/net/bnxt/bnxt_ring.h | 2 +-
> drivers/net/bnxt/bnxt_rxr.h | 4 +--
> drivers/net/bnxt/bnxt_txr.h | 2 +-
> drivers/net/bnxt/bnxt_vnic.c | 2 +-
> drivers/net/bnxt/bnxt_vnic.h | 6 ++--
> drivers/net/liquidio/lio_rxtx.c | 2 +-
> drivers/net/liquidio/lio_rxtx.h | 4 +--
> drivers/net/qede/base/bcm_osal.h | 2 +-
> drivers/net/sfc/efsys.h | 2 +-
> drivers/net/sfc/sfc_ef10_rx.c | 2 +-
> drivers/net/sfc/sfc_ef10_tx.c | 4 +--
> drivers/net/thunderx/base/nicvf_hw.c | 2 +-
> drivers/net/thunderx/base/nicvf_hw.h | 2 +-
> drivers/net/thunderx/base/nicvf_hw_defs.h | 6 ++--
> drivers/net/thunderx/nicvf_ethdev.c | 4 +--
> drivers/net/thunderx/nicvf_ethdev.h | 4 +--
> drivers/net/thunderx/nicvf_struct.h | 6 ++--
> drivers/net/virtio/virtio_rxtx.h | 4 +--
> drivers/net/virtio/virtqueue.h | 2 +-
> drivers/net/xenvirt/rte_eth_xenvirt.c | 2 +-
> drivers/net/xenvirt/rte_mempool_gntalloc.c | 6 ++--
> drivers/net/xenvirt/rte_xen_lib.c | 6 ++--
> drivers/net/xenvirt/rte_xen_lib.h | 8 ++---
> examples/l2fwd-crypto/main.c | 2 +-
> lib/librte_cryptodev/rte_crypto.h | 2 +-
> lib/librte_cryptodev/rte_crypto_sym.h | 6 ++--
> lib/librte_cryptodev/rte_cryptodev.h | 2 +-
> lib/librte_eal/bsdapp/eal/eal_memory.c | 4 +--
> lib/librte_eal/common/include/rte_malloc.h | 2 +-
> lib/librte_eal/common/include/rte_memory.h | 18 +++++-----
> lib/librte_eal/common/include/rte_memzone.h | 2 +-
> lib/librte_eal/common/rte_malloc.c | 2 +-
> lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++---
> lib/librte_eal/linuxapp/eal/eal_xen_memory.c | 4 +--
> .../linuxapp/eal/include/exec-env/rte_kni_common.h | 20 ++++++-----
> lib/librte_mbuf/rte_mbuf.h | 8 ++---
> lib/librte_mempool/rte_mempool.c | 18 +++++-----
> lib/librte_mempool/rte_mempool.h | 14 ++++----
> lib/librte_vhost/vhost.h | 2 +-
> test/test/test_cryptodev.h | 2 +-
> test/test/test_memzone.c | 8 ++---
> 68 files changed, 197 insertions(+), 193 deletions(-)
>
> diff --git a/app/test-crypto-perf/cperf_test_vectors.h b/app/test-crypto-perf/cperf_test_vectors.h
> index 85955703c..a203272cf 100644
> --- a/app/test-crypto-perf/cperf_test_vectors.h
> +++ b/app/test-crypto-perf/cperf_test_vectors.h
> @@ -78,13 +78,13 @@ struct cperf_test_vector {
>
> struct {
> uint8_t *data;
> - phys_addr_t phys_addr;
> + iova_addr_t phys_addr;
> uint16_t length;
> } aad;
>
> struct {
> uint8_t *data;
> - phys_addr_t phys_addr;
> + iova_addr_t phys_addr;
> uint16_t length;
> } digest;
>
...
> diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
> index 2ac879fdd..efd9ac9a5 100644
> --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
> +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
> @@ -73,6 +73,10 @@
>
> #define RTE_CACHE_LINE_MIN_SIZE 64
>
> +#ifdef __KERNEL__
> +typedef uint64_t iova_addr_t;
> +#endif
As discussed earlier, please use a more informative macro (e.g. __GNUC__
or its clang equivalent).
Assuming this is fixed,
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/5] eal/memory: rename buf_physaddr to buf_iovaaddr
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 2/5] eal/memory: rename buf_physaddr to buf_iovaaddr Santosh Shukla
@ 2017-09-18 15:20 ` Burakov, Anatoly
0 siblings, 0 replies; 91+ messages in thread
From: Burakov, Anatoly @ 2017-09-18 15:20 UTC (permalink / raw)
To: Santosh Shukla, dev
On 05-Sep-17 11:31 AM, Santosh Shukla wrote:
> Signed-off-by: Santosh Shukla <santosh.shukla at caviumnetworks.com>
> ---
> v1 notes:
> Since crux of change is at eal/memory area so using that as
> title.
>
> doc/guides/prog_guide/img/mbuf1.svg | 2 +-
> drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 +-
> drivers/net/ark/ark_ethdev_rx.c | 8 ++++----
> drivers/net/bnx2x/bnx2x_rxtx.c | 4 ++--
> drivers/net/bnxt/bnxt_ring.h | 2 +-
> drivers/net/cxgbe/sge.c | 4 ++--
> drivers/net/ena/ena_ethdev.c | 6 +++---
> drivers/net/enic/enic_main.c | 2 +-
> drivers/net/enic/enic_rxtx.c | 6 +++---
> drivers/net/fm10k/fm10k.h | 4 ++--
> drivers/net/fm10k/fm10k_rxtx_vec.c | 4 ++--
> drivers/net/i40e/i40e_rxtx_vec_altivec.c | 4 ++--
> drivers/net/i40e/i40e_rxtx_vec_neon.c | 6 +++---
> drivers/net/i40e/i40e_rxtx_vec_sse.c | 6 +++---
> drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 6 +++---
> drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 6 +++---
> drivers/net/nfp/nfp_net.c | 2 +-
> drivers/net/virtio/virtio_ethdev.c | 2 +-
> drivers/net/virtio/virtqueue.h | 2 +-
> .../linuxapp/eal/include/exec-env/rte_kni_common.h | 2 +-
> lib/librte_eal/linuxapp/kni/kni_net.c | 6 +++---
> lib/librte_kni/rte_kni.c | 2 +-
> lib/librte_mbuf/rte_mbuf.c | 6 +++---
> lib/librte_mbuf/rte_mbuf.h | 14 +++++++-------
> lib/librte_vhost/virtio_net.c | 2 +-
> test/test/test_mbuf.c | 2 +-
> 26 files changed, 56 insertions(+), 56 deletions(-)
>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/5] eal/memory: rename memseg member phys to iova addr
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 3/5] eal/memory: rename memseg member phys to iova addr Santosh Shukla
2017-09-18 15:04 ` Burakov, Anatoly
@ 2017-09-18 15:21 ` Burakov, Anatoly
1 sibling, 0 replies; 91+ messages in thread
From: Burakov, Anatoly @ 2017-09-18 15:21 UTC (permalink / raw)
To: Santosh Shukla, dev
On 05-Sep-17 11:31 AM, Santosh Shukla wrote:
> Renaming rte_memseg {.phys_addr} to {.iova_addr}
>
> Signed-off-by: Santosh Shukla <santosh.shukla at caviumnetworks.com>
> ---
> v1 --> v2:
> - includes freebsdp v1 build fixes.
>
> lib/librte_eal/bsdapp/eal/eal_memory.c | 4 ++--
> lib/librte_eal/common/eal_common_memory.c | 2 +-
> lib/librte_eal/common/include/rte_memory.h | 4 ++--
> lib/librte_eal/common/rte_malloc.c | 5 +++--
> lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
> lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 ++--
> 6 files changed, 14 insertions(+), 13 deletions(-)
>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v1 4/4] doc: remove dpdk iova aware notice
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 4/4] doc: remove dpdk iova aware notice Santosh Shukla
@ 2017-09-18 18:44 ` Mcnamara, John
0 siblings, 0 replies; 91+ messages in thread
From: Mcnamara, John @ 2017-09-18 18:44 UTC (permalink / raw)
To: Santosh Shukla, dev; +Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Santosh Shukla
> Sent: Monday, August 14, 2017 4:16 PM
> To: dev@dpdk.org
> Cc: olivier.matz@6wind.com; thomas@monjalon.net;
> jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com; Santosh Shukla
> <santosh.shukla@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v1 4/4] doc: remove dpdk iova aware notice
>
> Removed dpdk iova aware ABI deprecation notice, and updated ABI change
> details in release_17.11.rst.
>
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v2 5/5] doc: remove dpdk iova aware notice
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 5/5] doc: remove dpdk iova aware notice Santosh Shukla
@ 2017-09-19 13:38 ` Mcnamara, John
0 siblings, 0 replies; 91+ messages in thread
From: Mcnamara, John @ 2017-09-19 13:38 UTC (permalink / raw)
To: Santosh Shukla, dev; +Cc: thomas, jerin.jacob, hemant.agrawal, olivier.matz
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Santosh Shukla
> Sent: Tuesday, September 5, 2017 11:31 AM
> To: dev@dpdk.org
> Cc: thomas@monjalon.net; jerin.jacob@caviumnetworks.com;
> hemant.agrawal@nxp.com; olivier.matz@6wind.com; Santosh Shukla
> <santosh.shukla@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v2 5/5] doc: remove dpdk iova aware notice
>
> Removed dpdk iova aware ABI deprecation notice, and updated ABI change
> details in release_17.11.rst.
>
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Santosh Shukla
` (4 preceding siblings ...)
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 5/5] doc: remove dpdk iova aware notice Santosh Shukla
@ 2017-10-17 13:31 ` Thomas Monjalon
2017-10-17 14:12 ` santosh
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 0/6] " Santosh Shukla
6 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-10-17 13:31 UTC (permalink / raw)
To: Santosh Shukla; +Cc: dev, jerin.jacob, hemant.agrawal, olivier.matz
Hi Santosh,
05/09/2017 12:31, Santosh Shukla:
> Summary:
> Renaming memory address translation api/ datatypes
> and memory struct members to iova types.
What is the status of this series?
Do you plan send a new version soon?
Thanks
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware
2017-10-17 13:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Thomas Monjalon
@ 2017-10-17 14:12 ` santosh
0 siblings, 0 replies; 91+ messages in thread
From: santosh @ 2017-10-17 14:12 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, jerin.jacob, hemant.agrawal, olivier.matz
Hi Thomas,
On Tuesday 17 October 2017 07:01 PM, Thomas Monjalon wrote:
> Hi Santosh,
>
> 05/09/2017 12:31, Santosh Shukla:
>> Summary:
>> Renaming memory address translation api/ datatypes
>> and memory struct members to iova types.
> What is the status of this series?
[4/5] needs review i/p from Olivier, has mempool api renaming to _iova.
> Do you plan send a new version soon?
Yes. Will send out v3 by this week. This series was planned to go into rc2 window.
Thanks.
> Thanks
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v3 0/6] make dpdk iova aware
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Santosh Shukla
` (5 preceding siblings ...)
2017-10-17 13:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Thomas Monjalon
@ 2017-10-20 12:31 ` Santosh Shukla
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 1/6] eal: rename phys addr to iova addr Santosh Shukla
` (6 more replies)
6 siblings, 7 replies; 91+ messages in thread
From: Santosh Shukla @ 2017-10-20 12:31 UTC (permalink / raw)
To: dev
Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal,
anatoly.burakov, Santosh Shukla
v3:
Include v2 review comment and rebased on
top of upstream tip commit:6b9ed026a8704
v2:
Include build fixes reported in patchworks.
Changeset based on deprecation notice[1], planned for v17.11 release.
Patches are based commit:
(c42021fe56 : ethdev: rename map file to match library name)
Summary:
Renaming memory address translation api/ datatypes
and memory struct members to iova types.
1st patch : rename phys_addr_t to iova_addr_t
2nd patch : rename dma var mainly buf_physaddr to buf_iovaaddr
3rd patch : rename rte_memseg {.phys_addr} to {.iova_addr}.
4rd patch : rename memory translation api to _iova types.
5th patch : remove deprecation notice for dpdk iova aware.
6th patch : Misc patch (Use RTE_PTR_DIFF in virt2iova())
Change History:
v2 --> v3:
- Replaced __KERNEL__ with __clang__ in kni header (by Anatoly)
- Added RTE_PTR_DIFF() change in rte_malloc_virt2iova() (Suggested by Anatolgy)
v1 --> v2:
- Includes build fixes reported in v1 [2]
- aded separate patch for rte_memseg's phys_addr to iova_addr renaming.
Checkpatch warning:
- Noticed warning in changeset comining from legacy code. unreleated
with iova changes.
Thanks.
[1]
http://dpdk.org/browse/dpdk/commit/doc/guides/rel_notes?id=caa570db61307e07efc461cf558ec291a3e71b29
[2] http://dpdk.org/ml/archives/test-report/2017-August/027020.html
Santosh Shukla (6):
eal: rename phys addr to iova addr
eal/memory: rename buf physaddr to buf iovaaddr
eal/memory: rename memseg member phys to iova addr
eal/memory: rename memory API to iova types
doc: remove dpdk iova aware notice
eal/common/rte_malloc: use pointer diff in virt2iova
app/proc_info/main.c | 2 +-
app/test-crypto-perf/cperf_test_common.c | 6 ++--
app/test-crypto-perf/cperf_test_vector_parsing.c | 4 +--
app/test-crypto-perf/cperf_test_vectors.c | 6 ++--
app/test-crypto-perf/cperf_test_vectors.h | 4 +--
app/test-pmd/cmdline.c | 2 +-
doc/guides/contributing/documentation.rst | 4 +--
doc/guides/prog_guide/cryptodev_lib.rst | 6 ++--
doc/guides/prog_guide/img/mbuf1.svg | 2 +-
doc/guides/rel_notes/deprecation.rst | 7 ----
doc/guides/rel_notes/release_17_11.rst | 30 +++++++++++++++-
drivers/bus/dpaa/base/qbman/qman.c | 2 +-
drivers/bus/dpaa/base/qbman/qman.h | 2 +-
drivers/bus/dpaa/rte_dpaa_bus.h | 4 +--
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/mc/fsl_mc_cmd.h | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 20 +++++------
drivers/crypto/dpaa_sec/dpaa_sec.c | 26 +++++++-------
drivers/crypto/qat/qat_adf/qat_algs.h | 6 ++--
drivers/crypto/qat/qat_crypto.c | 2 +-
drivers/crypto/qat/qat_crypto.h | 2 +-
drivers/crypto/qat/qat_qp.c | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 +-
drivers/mempool/octeontx/octeontx_fpavf.c | 4 +--
drivers/mempool/octeontx/rte_mempool_octeontx.c | 2 +-
drivers/net/ark/ark_ddm.c | 2 +-
drivers/net/ark/ark_ddm.h | 4 +--
drivers/net/ark/ark_ethdev_rx.c | 24 ++++++-------
drivers/net/ark/ark_ethdev_tx.c | 6 ++--
drivers/net/ark/ark_mpu.c | 2 +-
drivers/net/ark/ark_mpu.h | 4 +--
drivers/net/ark/ark_udm.c | 2 +-
drivers/net/ark/ark_udm.h | 4 +--
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/avp/rte_avp_common.h | 20 +++++------
drivers/net/bnx2x/bnx2x.c | 40 +++++++++++-----------
drivers/net/bnx2x/bnx2x.h | 22 ++++++------
drivers/net/bnx2x/bnx2x_rxtx.c | 8 ++---
drivers/net/bnx2x/bnx2x_stats.c | 2 +-
drivers/net/bnx2x/bnx2x_vfpf.c | 2 +-
drivers/net/bnx2x/ecore_sp.h | 2 +-
drivers/net/bnxt/bnxt.h | 10 +++---
drivers/net/bnxt/bnxt_cpr.h | 4 +--
drivers/net/bnxt/bnxt_ethdev.c | 10 +++---
drivers/net/bnxt/bnxt_hwrm.c | 26 +++++++-------
drivers/net/bnxt/bnxt_ring.c | 6 ++--
drivers/net/bnxt/bnxt_ring.h | 4 +--
drivers/net/bnxt/bnxt_rxr.h | 4 +--
drivers/net/bnxt/bnxt_txr.h | 2 +-
drivers/net/bnxt/bnxt_vnic.c | 6 ++--
drivers/net/bnxt/bnxt_vnic.h | 6 ++--
drivers/net/cxgbe/sge.c | 4 +--
drivers/net/dpaa/dpaa_rxtx.c | 6 ++--
drivers/net/ena/ena_ethdev.c | 6 ++--
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_rxtx.c | 6 ++--
drivers/net/fm10k/fm10k.h | 4 +--
drivers/net/fm10k/fm10k_rxtx_vec.c | 4 +--
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 4 +--
drivers/net/i40e/i40e_rxtx_vec_neon.c | 6 ++--
drivers/net/i40e/i40e_rxtx_vec_sse.c | 6 ++--
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 6 ++--
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 6 ++--
drivers/net/liquidio/lio_rxtx.c | 4 +--
drivers/net/liquidio/lio_rxtx.h | 4 +--
drivers/net/mlx4/mlx4_mr.c | 2 +-
drivers/net/mlx5/mlx5_mr.c | 2 +-
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/octeontx/base/octeontx_pkovf.c | 4 +--
drivers/net/qede/base/bcm_osal.h | 2 +-
drivers/net/sfc/efsys.h | 2 +-
drivers/net/sfc/sfc_ef10_rx.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 4 +--
drivers/net/sfc/sfc_tso.c | 2 +-
drivers/net/thunderx/base/nicvf_hw.c | 2 +-
drivers/net/thunderx/base/nicvf_hw.h | 2 +-
drivers/net/thunderx/base/nicvf_hw_defs.h | 6 ++--
drivers/net/thunderx/nicvf_ethdev.c | 4 +--
drivers/net/thunderx/nicvf_ethdev.h | 4 +--
drivers/net/thunderx/nicvf_struct.h | 6 ++--
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtio_rxtx.h | 4 +--
drivers/net/virtio/virtqueue.h | 4 +--
examples/l2fwd-crypto/main.c | 4 +--
lib/librte_cryptodev/rte_crypto.h | 2 +-
lib/librte_cryptodev/rte_crypto_sym.h | 6 ++--
lib/librte_cryptodev/rte_cryptodev.c | 2 +-
lib/librte_cryptodev/rte_cryptodev.h | 2 +-
lib/librte_eal/bsdapp/eal/eal.c | 2 +-
lib/librte_eal/bsdapp/eal/eal_memory.c | 8 ++---
lib/librte_eal/bsdapp/eal/rte_eal_version.map | 12 +++----
lib/librte_eal/common/eal_common_memory.c | 8 ++---
lib/librte_eal/common/eal_common_memzone.c | 4 +--
lib/librte_eal/common/eal_private.h | 2 +-
lib/librte_eal/common/include/rte_malloc.h | 4 +--
lib/librte_eal/common/include/rte_memory.h | 14 ++++----
lib/librte_eal/common/include/rte_memzone.h | 2 +-
lib/librte_eal/common/rte_malloc.c | 12 +++----
lib/librte_eal/linuxapp/eal/eal.c | 2 +-
lib/librte_eal/linuxapp/eal/eal_memory.c | 24 ++++++-------
lib/librte_eal/linuxapp/eal/eal_pci.c | 4 +--
lib/librte_eal/linuxapp/eal/eal_vfio.c | 10 +++---
.../linuxapp/eal/include/exec-env/rte_kni_common.h | 23 ++++++++-----
lib/librte_eal/linuxapp/eal/rte_eal_version.map | 12 +++----
lib/librte_eal/linuxapp/kni/kni_net.c | 6 ++--
lib/librte_kni/rte_kni.c | 2 +-
lib/librte_mbuf/rte_mbuf.c | 6 ++--
lib/librte_mbuf/rte_mbuf.h | 18 +++++-----
lib/librte_mempool/rte_mempool.c | 38 ++++++++++----------
lib/librte_mempool/rte_mempool.h | 24 ++++++-------
lib/librte_mempool/rte_mempool_ops.c | 2 +-
lib/librte_mempool/rte_mempool_version.map | 4 +--
lib/librte_vhost/vhost.h | 2 +-
lib/librte_vhost/vhost_user.c | 4 +--
lib/librte_vhost/virtio_net.c | 2 +-
test/test/commands.c | 2 +-
test/test/test_cryptodev.h | 2 +-
test/test/test_malloc.c | 4 +--
test/test/test_mbuf.c | 2 +-
test/test/test_memory.c | 6 ++--
test/test/test_mempool.c | 4 +--
test/test/test_memzone.c | 18 +++++-----
122 files changed, 415 insertions(+), 389 deletions(-)
--
2.14.1
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v3 1/6] eal: rename phys addr to iova addr
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 0/6] " Santosh Shukla
@ 2017-10-20 12:31 ` Santosh Shukla
2017-10-23 20:32 ` Thomas Monjalon
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 2/6] eal/memory: rename buf physaddr to buf iovaaddr Santosh Shukla
` (5 subsequent siblings)
6 siblings, 1 reply; 91+ messages in thread
From: Santosh Shukla @ 2017-10-20 12:31 UTC (permalink / raw)
To: dev
Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal,
anatoly.burakov, Santosh Shukla
Renamed data type from phys_addr_t to iova_addr_t.
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
v2 --> v3:
- Replaced __KERNEL__ with __clang__ in kni header (By Anatoly)
Refer v2:
http://dpdk.org/dev/patchwork/patch/28358/
app/test-crypto-perf/cperf_test_common.c | 2 +-
app/test-crypto-perf/cperf_test_vectors.h | 4 +--
doc/guides/contributing/documentation.rst | 4 +--
doc/guides/prog_guide/cryptodev_lib.rst | 6 ++--
drivers/bus/dpaa/rte_dpaa_bus.h | 2 +-
drivers/bus/fslmc/mc/fsl_mc_cmd.h | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 14 ++++----
drivers/crypto/dpaa_sec/dpaa_sec.c | 18 +++++-----
drivers/crypto/qat/qat_adf/qat_algs.h | 6 ++--
drivers/crypto/qat/qat_crypto.c | 2 +-
drivers/crypto/qat/qat_crypto.h | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 +-
drivers/mempool/octeontx/octeontx_fpavf.c | 2 +-
drivers/mempool/octeontx/rte_mempool_octeontx.c | 2 +-
drivers/net/ark/ark_ddm.c | 2 +-
drivers/net/ark/ark_ddm.h | 4 +--
drivers/net/ark/ark_ethdev_rx.c | 12 +++----
drivers/net/ark/ark_ethdev_tx.c | 2 +-
drivers/net/ark/ark_mpu.c | 2 +-
drivers/net/ark/ark_mpu.h | 4 +--
drivers/net/ark/ark_udm.c | 2 +-
drivers/net/ark/ark_udm.h | 4 +--
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/avp/rte_avp_common.h | 20 +++++------
drivers/net/bnx2x/bnx2x.c | 40 +++++++++++-----------
drivers/net/bnx2x/bnx2x.h | 22 ++++++------
drivers/net/bnx2x/bnx2x_rxtx.c | 4 +--
drivers/net/bnx2x/bnx2x_stats.c | 2 +-
drivers/net/bnx2x/bnx2x_vfpf.c | 2 +-
drivers/net/bnx2x/ecore_sp.h | 2 +-
drivers/net/bnxt/bnxt.h | 10 +++---
drivers/net/bnxt/bnxt_cpr.h | 4 +--
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/bnxt_hwrm.c | 6 ++--
drivers/net/bnxt/bnxt_ring.c | 2 +-
drivers/net/bnxt/bnxt_ring.h | 2 +-
drivers/net/bnxt/bnxt_rxr.h | 4 +--
drivers/net/bnxt/bnxt_txr.h | 2 +-
drivers/net/bnxt/bnxt_vnic.c | 2 +-
drivers/net/bnxt/bnxt_vnic.h | 6 ++--
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/liquidio/lio_rxtx.h | 4 +--
drivers/net/octeontx/base/octeontx_pkovf.c | 2 +-
drivers/net/qede/base/bcm_osal.h | 2 +-
drivers/net/sfc/efsys.h | 2 +-
drivers/net/sfc/sfc_ef10_rx.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 4 +--
drivers/net/thunderx/base/nicvf_hw.c | 2 +-
drivers/net/thunderx/base/nicvf_hw.h | 2 +-
drivers/net/thunderx/base/nicvf_hw_defs.h | 6 ++--
drivers/net/thunderx/nicvf_ethdev.c | 4 +--
drivers/net/thunderx/nicvf_ethdev.h | 4 +--
drivers/net/thunderx/nicvf_struct.h | 6 ++--
drivers/net/virtio/virtio_rxtx.h | 4 +--
drivers/net/virtio/virtqueue.h | 2 +-
examples/l2fwd-crypto/main.c | 2 +-
lib/librte_cryptodev/rte_crypto.h | 2 +-
lib/librte_cryptodev/rte_crypto_sym.h | 6 ++--
lib/librte_cryptodev/rte_cryptodev.h | 2 +-
lib/librte_eal/bsdapp/eal/eal_memory.c | 4 +--
lib/librte_eal/common/include/rte_malloc.h | 2 +-
lib/librte_eal/common/include/rte_memory.h | 8 ++---
lib/librte_eal/common/include/rte_memzone.h | 2 +-
lib/librte_eal/common/rte_malloc.c | 4 +--
lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++---
.../linuxapp/eal/include/exec-env/rte_kni_common.h | 21 +++++++-----
lib/librte_mbuf/rte_mbuf.h | 8 ++---
lib/librte_mempool/rte_mempool.c | 18 +++++-----
lib/librte_mempool/rte_mempool.h | 18 +++++-----
lib/librte_mempool/rte_mempool_ops.c | 2 +-
lib/librte_vhost/vhost.h | 2 +-
test/test/test_cryptodev.h | 2 +-
test/test/test_memzone.c | 8 ++---
73 files changed, 203 insertions(+), 198 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 46e4a46ec..3f116da6e 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -74,7 +74,7 @@ fill_multi_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp,
uint16_t mbuf_hdr_size = sizeof(struct rte_mbuf);
uint16_t remaining_segments = segments_nb;
struct rte_mbuf *next_mbuf;
- phys_addr_t next_seg_phys_addr = rte_mempool_virt2phy(mp, obj) +
+ iova_addr_t next_seg_phys_addr = rte_mempool_virt2phy(mp, obj) +
mbuf_offset + mbuf_hdr_size;
do {
diff --git a/app/test-crypto-perf/cperf_test_vectors.h b/app/test-crypto-perf/cperf_test_vectors.h
index 85955703c..a203272cf 100644
--- a/app/test-crypto-perf/cperf_test_vectors.h
+++ b/app/test-crypto-perf/cperf_test_vectors.h
@@ -78,13 +78,13 @@ struct cperf_test_vector {
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
uint16_t length;
} aad;
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
uint16_t length;
} digest;
diff --git a/doc/guides/contributing/documentation.rst b/doc/guides/contributing/documentation.rst
index 170dacdb7..274ab9888 100644
--- a/doc/guides/contributing/documentation.rst
+++ b/doc/guides/contributing/documentation.rst
@@ -711,7 +711,7 @@ The following are some guidelines for use of Doxygen in the DPDK API documentati
/**< Virtual address of the first mempool object. */
uintptr_t elt_va_end;
/**< Virtual address of the <size + 1> mempool object. */
- phys_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
+ iova_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
/**< Array of physical page addresses for the mempool buffer. */
This doesn't have an effect on the rendered documentation but it is confusing for the developer reading the code.
@@ -730,7 +730,7 @@ The following are some guidelines for use of Doxygen in the DPDK API documentati
/** Virtual address of the <size + 1> mempool object. */
uintptr_t elt_va_end;
/** Array of physical page addresses for the mempool buffer. */
- phys_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
+ iova_addr_t elt_pa[MEMPOOL_PG_NUM_DEFAULT];
* Check for Doxygen warnings in new code by checking the API documentation build::
diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 75ae085f6..248038f64 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -539,12 +539,12 @@ chain.
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
} digest; /**< Digest parameters */
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
} aad;
/**< Additional authentication parameters */
} aead;
@@ -566,7 +566,7 @@ chain.
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
} digest; /**< Digest parameters */
} auth;
};
diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h
index eafc944d0..dff13016d 100644
--- a/drivers/bus/dpaa/rte_dpaa_bus.h
+++ b/drivers/bus/dpaa/rte_dpaa_bus.h
@@ -107,7 +107,7 @@ struct dpaa_portal {
};
/* TODO - this is costly, need to write a fast coversion routine */
-static inline void *rte_dpaa_mem_ptov(phys_addr_t paddr)
+static inline void *rte_dpaa_mem_ptov(iova_addr_t paddr)
{
const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
int i;
diff --git a/drivers/bus/fslmc/mc/fsl_mc_cmd.h b/drivers/bus/fslmc/mc/fsl_mc_cmd.h
index 2cec29ea8..6c29b638b 100644
--- a/drivers/bus/fslmc/mc/fsl_mc_cmd.h
+++ b/drivers/bus/fslmc/mc/fsl_mc_cmd.h
@@ -45,7 +45,7 @@
#define MC_CMD_NUM_OF_PARAMS 7
-#define phys_addr_t uint64_t
+#define iova_addr_t uint64_t
#define u64 uint64_t
#define u32 uint32_t
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 8f39cfbbb..f69af88b5 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -272,9 +272,9 @@ enum qbman_fd_format {
#define DPAA2_EQ_RESP_ALWAYS 1
#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA
-static void *dpaa2_mem_ptov(phys_addr_t paddr) __attribute__((unused));
+static void *dpaa2_mem_ptov(iova_addr_t paddr) __attribute__((unused));
/* todo - this is costly, need to write a fast coversion routine */
-static void *dpaa2_mem_ptov(phys_addr_t paddr)
+static void *dpaa2_mem_ptov(iova_addr_t paddr)
{
const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
int i;
@@ -288,8 +288,8 @@ static void *dpaa2_mem_ptov(phys_addr_t paddr)
return NULL;
}
-static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr) __attribute__((unused));
-static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
+static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr) __attribute__((unused));
+static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr)
{
const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
int i;
@@ -300,7 +300,7 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
return memseg[i].phys_addr
+ (vaddr - memseg[i].addr_64);
}
- return (phys_addr_t)(NULL);
+ return (iova_addr_t)(NULL);
}
/**
@@ -321,13 +321,13 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
/**
* macro to convert IOVA to Virtual address
*/
-#define DPAA2_IOVA_TO_VADDR(_iova) dpaa2_mem_ptov((phys_addr_t)(_iova))
+#define DPAA2_IOVA_TO_VADDR(_iova) dpaa2_mem_ptov((iova_addr_t)(_iova))
/**
* macro to convert modify the memory containing IOVA to Virtual address
*/
#define DPAA2_MODIFY_IOVA_TO_VADDR(_mem, _type) \
- {_mem = (_type)(dpaa2_mem_ptov((phys_addr_t)(_mem))); }
+ {_mem = (_type)(dpaa2_mem_ptov((iova_addr_t)(_mem))); }
#else /* RTE_LIBRTE_DPAA2_USE_PHYS_IOVA */
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 7b9a68356..b944b94e3 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -110,7 +110,7 @@ dpaa_sec_alloc_ctx(dpaa_sec_session *ses)
return ctx;
}
-static inline phys_addr_t
+static inline iova_addr_t
dpaa_mem_vtop(void *vaddr)
{
const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
@@ -124,14 +124,14 @@ dpaa_mem_vtop(void *vaddr)
paddr = memseg[i].phys_addr +
(vaddr_64 - memseg[i].addr_64);
- return (phys_addr_t)paddr;
+ return (iova_addr_t)paddr;
}
}
- return (phys_addr_t)(NULL);
+ return (iova_addr_t)(NULL);
}
static inline void *
-dpaa_mem_ptov(phys_addr_t paddr)
+dpaa_mem_ptov(iova_addr_t paddr)
{
const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
int i;
@@ -158,7 +158,7 @@ ern_sec_fq_handler(struct qman_portal *qm __rte_unused,
* all the packets in this queue could be dispatched into caam
*/
static int
-dpaa_sec_init_rx(struct qman_fq *fq_in, phys_addr_t hwdesc,
+dpaa_sec_init_rx(struct qman_fq *fq_in, iova_addr_t hwdesc,
uint32_t fqid_out)
{
struct qm_mcc_initfq fq_opts;
@@ -566,7 +566,7 @@ build_auth_only(struct rte_crypto_op *op, dpaa_sec_session *ses)
struct dpaa_sec_job *cf;
struct dpaa_sec_op_ctx *ctx;
struct qm_sg_entry *sg;
- phys_addr_t start_addr;
+ iova_addr_t start_addr;
uint8_t *old_digest;
ctx = dpaa_sec_alloc_ctx(ses);
@@ -628,7 +628,7 @@ build_cipher_only(struct rte_crypto_op *op, dpaa_sec_session *ses)
struct dpaa_sec_job *cf;
struct dpaa_sec_op_ctx *ctx;
struct qm_sg_entry *sg;
- phys_addr_t start_addr;
+ iova_addr_t start_addr;
uint8_t *IV_ptr = rte_crypto_op_ctod_offset(op, uint8_t *,
ses->iv.offset);
@@ -678,7 +678,7 @@ build_cipher_auth_gcm(struct rte_crypto_op *op, dpaa_sec_session *ses)
struct dpaa_sec_job *cf;
struct dpaa_sec_op_ctx *ctx;
struct qm_sg_entry *sg;
- phys_addr_t start_addr;
+ iova_addr_t start_addr;
uint32_t length = 0;
uint8_t *IV_ptr = rte_crypto_op_ctod_offset(op, uint8_t *,
ses->iv.offset);
@@ -787,7 +787,7 @@ build_cipher_auth(struct rte_crypto_op *op, dpaa_sec_session *ses)
struct dpaa_sec_job *cf;
struct dpaa_sec_op_ctx *ctx;
struct qm_sg_entry *sg;
- phys_addr_t start_addr;
+ iova_addr_t start_addr;
uint32_t length = 0;
uint8_t *IV_ptr = rte_crypto_op_ctod_offset(op, uint8_t *,
ses->iv.offset);
diff --git a/drivers/crypto/qat/qat_adf/qat_algs.h b/drivers/crypto/qat/qat_adf/qat_algs.h
index 2c8e03c0a..c53ebd7ed 100644
--- a/drivers/crypto/qat/qat_adf/qat_algs.h
+++ b/drivers/crypto/qat/qat_adf/qat_algs.h
@@ -104,8 +104,8 @@ struct qat_alg_buf_list {
struct qat_crypto_op_cookie {
struct qat_alg_buf_list qat_sgl_list_src;
struct qat_alg_buf_list qat_sgl_list_dst;
- phys_addr_t qat_sgl_src_phys_addr;
- phys_addr_t qat_sgl_dst_phys_addr;
+ iova_addr_t qat_sgl_src_phys_addr;
+ iova_addr_t qat_sgl_dst_phys_addr;
};
/* Common content descriptor */
@@ -124,7 +124,7 @@ struct qat_session {
void *bpi_ctx;
struct qat_alg_cd cd;
uint8_t *cd_cur_ptr;
- phys_addr_t cd_paddr;
+ iova_addr_t cd_paddr;
struct icp_qat_fw_la_bulk_req fw_req;
uint8_t aad_len;
struct qat_crypto_instance *inst;
diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index ae73c78b5..afcce22c8 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -1375,7 +1375,7 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
* This address may used for setting AAD physical pointer
* into IV offset from op
*/
- phys_addr_t aad_phys_addr_aead = op->sym->aead.aad.phys_addr;
+ iova_addr_t aad_phys_addr_aead = op->sym->aead.aad.phys_addr;
if (ctx->qat_hash_alg ==
ICP_QAT_HW_AUTH_ALGO_GALOIS_128 ||
ctx->qat_hash_alg ==
diff --git a/drivers/crypto/qat/qat_crypto.h b/drivers/crypto/qat/qat_crypto.h
index 0ebb08349..d9d3a5c87 100644
--- a/drivers/crypto/qat/qat_crypto.h
+++ b/drivers/crypto/qat/qat_crypto.h
@@ -70,7 +70,7 @@ enum qat_device_gen {
struct qat_queue {
char memz_name[RTE_MEMZONE_NAMESIZE];
void *base_addr; /* Base address */
- phys_addr_t base_phys_addr; /* Queue physical address */
+ iova_addr_t base_phys_addr; /* Queue physical address */
uint32_t head; /* Shadow copy of the head */
uint32_t tail; /* Shadow copy of the tail */
uint32_t modulo;
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
index 56b71bede..835fe9ef7 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
@@ -39,7 +39,7 @@
struct buf_pool_cfg {
void *addr;
/**< The address from where DPAA2 will carve out the buffers */
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
/**< Physical address of the memory provided in addr */
uint32_t num;
/**< Number of buffers */
diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c
index 8d5c2a689..4947f2dd5 100644
--- a/drivers/mempool/octeontx/octeontx_fpavf.c
+++ b/drivers/mempool/octeontx/octeontx_fpavf.c
@@ -224,7 +224,7 @@ octeontx_fpapf_pool_setup(unsigned int gpool, unsigned int buf_size,
signed short buf_offset, unsigned int max_buf_count)
{
void *memptr = NULL;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
unsigned int memsz;
struct fpavf_res *fpa = NULL;
uint64_t reg;
diff --git a/drivers/mempool/octeontx/rte_mempool_octeontx.c b/drivers/mempool/octeontx/rte_mempool_octeontx.c
index 9f1c07f9d..c7bc6873c 100644
--- a/drivers/mempool/octeontx/rte_mempool_octeontx.c
+++ b/drivers/mempool/octeontx/rte_mempool_octeontx.c
@@ -220,7 +220,7 @@ octeontx_fpavf_get_capabilities(const struct rte_mempool *mp,
static int
octeontx_fpavf_register_memory_area(const struct rte_mempool *mp,
- char *vaddr, phys_addr_t paddr, size_t len)
+ char *vaddr, iova_addr_t paddr, size_t len)
{
struct octeontx_pool_info *pool_info;
diff --git a/drivers/net/ark/ark_ddm.c b/drivers/net/ark/ark_ddm.c
index 221460c78..7c78ab75c 100644
--- a/drivers/net/ark/ark_ddm.c
+++ b/drivers/net/ark/ark_ddm.c
@@ -93,7 +93,7 @@ ark_ddm_reset(struct ark_ddm_t *ddm)
}
void
-ark_ddm_setup(struct ark_ddm_t *ddm, phys_addr_t cons_addr, uint32_t interval)
+ark_ddm_setup(struct ark_ddm_t *ddm, iova_addr_t cons_addr, uint32_t interval)
{
ddm->setup.cons_write_index_addr = cons_addr;
ddm->setup.write_index_interval = interval / 4; /* 4 ns period */
diff --git a/drivers/net/ark/ark_ddm.h b/drivers/net/ark/ark_ddm.h
index de61926c3..3381cb9e2 100644
--- a/drivers/net/ark/ark_ddm.h
+++ b/drivers/net/ark/ark_ddm.h
@@ -127,7 +127,7 @@ struct ark_ddm_cpld_ps_t {
#define ARK_DDM_SETUP 0x00e0
struct ark_ddm_setup_t {
- phys_addr_t cons_write_index_addr;
+ iova_addr_t cons_write_index_addr;
uint32_t write_index_interval; /* 4ns each */
volatile uint32_t cons_index;
};
@@ -165,7 +165,7 @@ void ark_ddm_start(struct ark_ddm_t *ddm);
int ark_ddm_stop(struct ark_ddm_t *ddm, const int wait);
void ark_ddm_reset(struct ark_ddm_t *ddm);
void ark_ddm_stats_reset(struct ark_ddm_t *ddm);
-void ark_ddm_setup(struct ark_ddm_t *ddm, phys_addr_t cons_addr,
+void ark_ddm_setup(struct ark_ddm_t *ddm, iova_addr_t cons_addr,
uint32_t interval);
void ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg);
void ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg);
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index f5d812a55..53e5d9b5c 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -61,7 +61,7 @@ struct ark_rx_queue {
struct rte_mbuf **reserve_q;
/* array of physical addresses of the mbuf data pointer */
/* This point is a virtual address */
- phys_addr_t *paddress_q;
+ iova_addr_t *paddress_q;
struct rte_mempool *mb_pool;
struct ark_udm_t *udm;
@@ -95,9 +95,9 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
struct ark_rx_queue *queue,
uint16_t rx_queue_id __rte_unused, uint16_t rx_queue_idx)
{
- phys_addr_t queue_base;
- phys_addr_t phys_addr_q_base;
- phys_addr_t phys_addr_prod_index;
+ iova_addr_t queue_base;
+ iova_addr_t phys_addr_q_base;
+ iova_addr_t phys_addr_prod_index;
queue_base = rte_malloc_virt2phy(queue);
phys_addr_prod_index = queue_base +
@@ -106,7 +106,7 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
phys_addr_q_base = rte_malloc_virt2phy(queue->paddress_q);
/* Verify HW */
- if (ark_mpu_verify(queue->mpu, sizeof(phys_addr_t))) {
+ if (ark_mpu_verify(queue->mpu, sizeof(iova_addr_t))) {
PMD_DRV_LOG(ERR, "Illegal configuration rx queue\n");
return -1;
}
@@ -204,7 +204,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
socket_id);
queue->paddress_q =
rte_zmalloc_socket("Ark_rx_queue paddr",
- nb_desc * sizeof(phys_addr_t),
+ nb_desc * sizeof(iova_addr_t),
64,
socket_id);
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 0e2d60deb..8c4b50ea7 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -310,7 +310,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
static int
eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
{
- phys_addr_t queue_base, ring_base, cons_index_addr;
+ iova_addr_t queue_base, ring_base, cons_index_addr;
uint32_t write_interval_ns;
/* Verify HW -- MPU */
diff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c
index cd2c0788f..23575c8e3 100644
--- a/drivers/net/ark/ark_mpu.c
+++ b/drivers/net/ark/ark_mpu.c
@@ -118,7 +118,7 @@ ark_mpu_reset_stats(struct ark_mpu_t *mpu)
}
int
-ark_mpu_configure(struct ark_mpu_t *mpu, phys_addr_t ring, uint32_t ring_size,
+ark_mpu_configure(struct ark_mpu_t *mpu, iova_addr_t ring, uint32_t ring_size,
int is_tx)
{
ark_mpu_reset(mpu);
diff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h
index a0171dbd6..a42e242b7 100644
--- a/drivers/net/ark/ark_mpu.h
+++ b/drivers/net/ark/ark_mpu.h
@@ -75,7 +75,7 @@ struct ark_mpu_hw_t {
#define ARK_MPU_CFG 0x040
struct ark_mpu_cfg_t {
- phys_addr_t ring_base; /* phys_addr_t is a uint64_t */
+ iova_addr_t ring_base; /* iova_addr_t is a uint64_t */
uint32_t ring_size;
uint32_t ring_mask;
uint32_t min_host_move;
@@ -137,7 +137,7 @@ int ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size);
void ark_mpu_stop(struct ark_mpu_t *mpu);
void ark_mpu_start(struct ark_mpu_t *mpu);
int ark_mpu_reset(struct ark_mpu_t *mpu);
-int ark_mpu_configure(struct ark_mpu_t *mpu, phys_addr_t ring,
+int ark_mpu_configure(struct ark_mpu_t *mpu, iova_addr_t ring,
uint32_t ring_size, int is_tx);
void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx);
diff --git a/drivers/net/ark/ark_udm.c b/drivers/net/ark/ark_udm.c
index 1ba7d26d4..1c04d92d9 100644
--- a/drivers/net/ark/ark_udm.c
+++ b/drivers/net/ark/ark_udm.c
@@ -122,7 +122,7 @@ ark_udm_configure(struct ark_udm_t *udm,
}
void
-ark_udm_write_addr(struct ark_udm_t *udm, phys_addr_t addr)
+ark_udm_write_addr(struct ark_udm_t *udm, iova_addr_t addr)
{
udm->rt_cfg.hw_prod_addr = addr;
}
diff --git a/drivers/net/ark/ark_udm.h b/drivers/net/ark/ark_udm.h
index 29bf1e8f7..1be45e2d9 100644
--- a/drivers/net/ark/ark_udm.h
+++ b/drivers/net/ark/ark_udm.h
@@ -137,7 +137,7 @@ struct ark_udm_tlp_ps_t {
#define ARK_UDM_RT_CFG 0x00e0
struct ark_udm_rt_cfg_t {
- phys_addr_t hw_prod_addr;
+ iova_addr_t hw_prod_addr;
uint32_t write_interval; /* 4ns cycles */
volatile uint32_t prod_idx; /* RO */
};
@@ -171,7 +171,7 @@ void ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
uint32_t dataroom,
uint32_t write_interval_ns);
-void ark_udm_write_addr(struct ark_udm_t *udm, phys_addr_t addr);
+void ark_udm_write_addr(struct ark_udm_t *udm, iova_addr_t addr);
void ark_udm_stats_reset(struct ark_udm_t *udm);
void ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg,
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index b97a90cea..f946e6834 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -387,7 +387,7 @@ avp_dev_translate_buffer(struct avp_dev *avp, void *host_mbuf_address)
/* translate from host physical address to guest virtual address */
static void *
avp_dev_translate_address(struct rte_eth_dev *eth_dev,
- phys_addr_t host_phys_addr)
+ iova_addr_t host_phys_addr)
{
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
struct rte_mem_resource *resource;
diff --git a/drivers/net/avp/rte_avp_common.h b/drivers/net/avp/rte_avp_common.h
index 488d72168..791d2f1b6 100644
--- a/drivers/net/avp/rte_avp_common.h
+++ b/drivers/net/avp/rte_avp_common.h
@@ -243,7 +243,7 @@ struct rte_avp_desc {
*/
struct rte_avp_memmap {
void *addr;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
uint64_t length;
};
@@ -345,7 +345,7 @@ RTE_AVP_MAKE_VERSION(RTE_AVP_RELEASE_VERSION_1, \
*/
struct rte_avp_mempool_info {
void *addr;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
uint64_t length;
};
@@ -359,10 +359,10 @@ struct rte_avp_device_info {
char ifname[RTE_AVP_NAMESIZE]; /**< Network device name for AVP */
- phys_addr_t tx_phys;
- phys_addr_t rx_phys;
- phys_addr_t alloc_phys;
- phys_addr_t free_phys;
+ iova_addr_t tx_phys;
+ iova_addr_t rx_phys;
+ iova_addr_t alloc_phys;
+ iova_addr_t free_phys;
uint32_t features; /**< Supported feature bitmap */
uint8_t min_rx_queues; /**< Minimum supported receive/free queues */
@@ -379,14 +379,14 @@ struct rte_avp_device_info {
uint32_t free_size; /**< Size of each free queue */
/* Used by Ethtool */
- phys_addr_t req_phys;
- phys_addr_t resp_phys;
- phys_addr_t sync_phys;
+ iova_addr_t req_phys;
+ iova_addr_t resp_phys;
+ iova_addr_t sync_phys;
void *sync_va;
/* mbuf mempool (used when a single memory area is supported) */
void *mbuf_va;
- phys_addr_t mbuf_phys;
+ iova_addr_t mbuf_phys;
/* mbuf mempools */
struct rte_avp_mempool_info pool[RTE_AVP_MAX_MEMPOOLS];
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 44222af2f..0fc6f6510 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -419,7 +419,7 @@ void bnx2x_read_dmae(struct bnx2x_softc *sc, uint32_t src_addr, uint32_t len32)
}
void
-bnx2x_write_dmae(struct bnx2x_softc *sc, phys_addr_t dma_addr, uint32_t dst_addr,
+bnx2x_write_dmae(struct bnx2x_softc *sc, iova_addr_t dma_addr, uint32_t dst_addr,
uint32_t len32)
{
struct dmae_command dmae;
@@ -447,7 +447,7 @@ bnx2x_write_dmae(struct bnx2x_softc *sc, phys_addr_t dma_addr, uint32_t dst_addr
}
static void
-bnx2x_write_dmae_phys_len(struct bnx2x_softc *sc, phys_addr_t phys_addr,
+bnx2x_write_dmae_phys_len(struct bnx2x_softc *sc, iova_addr_t phys_addr,
uint32_t addr, uint32_t len)
{
uint32_t dmae_wr_max = DMAE_LEN32_WR_MAX(sc);
@@ -823,14 +823,14 @@ bnx2x_fw_command(struct bnx2x_softc *sc, uint32_t command, uint32_t param)
static void
__storm_memset_dma_mapping(struct bnx2x_softc *sc, uint32_t addr,
- phys_addr_t mapping)
+ iova_addr_t mapping)
{
REG_WR(sc, addr, U64_LO(mapping));
REG_WR(sc, (addr + 4), U64_HI(mapping));
}
static void
-storm_memset_spq_addr(struct bnx2x_softc *sc, phys_addr_t mapping,
+storm_memset_spq_addr(struct bnx2x_softc *sc, iova_addr_t mapping,
uint16_t abs_fid)
{
uint32_t addr = (XSEM_REG_FAST_MEMORY +
@@ -1498,7 +1498,7 @@ bnx2x_set_q_rx_mode(struct bnx2x_softc *sc, uint8_t cl_id,
ramrod_param.rdata = BNX2X_SP(sc, rx_mode_rdata);
ramrod_param.rdata_mapping =
- (phys_addr_t)BNX2X_SP_MAPPING(sc, rx_mode_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, rx_mode_rdata),
bnx2x_set_bit(ECORE_FILTER_RX_MODE_PENDING, &sc->sp_state);
ramrod_param.ramrod_flags = ramrod_flags;
@@ -4599,9 +4599,9 @@ static void bnx2x_init_func_obj(struct bnx2x_softc *sc)
ecore_init_func_obj(sc,
&sc->func_obj,
BNX2X_SP(sc, func_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, func_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, func_rdata),
BNX2X_SP(sc, func_afex_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, func_afex_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, func_afex_rdata),
&bnx2x_func_sp_drv);
}
@@ -4772,7 +4772,7 @@ static void bnx2x_map_sb_state_machines(struct hc_index_data *index_data)
}
static void
-bnx2x_init_sb(struct bnx2x_softc *sc, phys_addr_t busaddr, int vfid,
+bnx2x_init_sb(struct bnx2x_softc *sc, iova_addr_t busaddr, int vfid,
uint8_t vf_valid, int fw_sb_id, int igu_sb_id)
{
struct hc_status_block_data_e2 sb_data_e2;
@@ -4918,7 +4918,7 @@ static void bnx2x_init_eth_fp(struct bnx2x_softc *sc, int idx)
sc->max_cos,
SC_FUNC(sc),
BNX2X_SP(sc, q_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, q_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, q_rdata),
q_type);
/* configure classification DBs */
@@ -4928,7 +4928,7 @@ static void bnx2x_init_eth_fp(struct bnx2x_softc *sc, int idx)
idx,
SC_FUNC(sc),
BNX2X_SP(sc, mac_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, mac_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, mac_rdata),
ECORE_FILTER_MAC_PENDING, &sc->sp_state,
ECORE_OBJ_TYPE_RX_TX, &sc->macs_pool);
}
@@ -5028,7 +5028,7 @@ static void bnx2x_init_tx_rings(struct bnx2x_softc *sc)
static void bnx2x_init_def_sb(struct bnx2x_softc *sc)
{
struct host_sp_status_block *def_sb = sc->def_sb;
- phys_addr_t mapping = sc->def_sb_dma.paddr;
+ iova_addr_t mapping = sc->def_sb_dma.paddr;
int igu_sp_sb_index;
int igu_seg_id;
int port = SC_PORT(sc);
@@ -5700,7 +5700,7 @@ static void bnx2x_init_objs(struct bnx2x_softc *sc)
SC_FUNC(sc),
SC_FUNC(sc),
BNX2X_SP(sc, mcast_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, mcast_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, mcast_rdata),
ECORE_FILTER_MCAST_PENDING,
&sc->sp_state, o_type);
@@ -5724,7 +5724,7 @@ static void bnx2x_init_objs(struct bnx2x_softc *sc)
SC_FUNC(sc),
SC_FUNC(sc),
BNX2X_SP(sc, rss_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, rss_rdata),
+ (iova_addr_t)BNX2X_SP_MAPPING(sc, rss_rdata),
ECORE_FILTER_RSS_CONF_PENDING,
&sc->sp_state, ECORE_OBJ_TYPE_RX);
}
@@ -6445,9 +6445,9 @@ bnx2x_pf_rx_q_prep(struct bnx2x_softc *sc, struct bnx2x_fastpath *fp,
pause->pri_map = 1;
/* rxq setup */
- rxq_init->dscr_map = (phys_addr_t)rxq->rx_ring_phys_addr;
- rxq_init->rcq_map = (phys_addr_t)rxq->cq_ring_phys_addr;
- rxq_init->rcq_np_map = (phys_addr_t)(rxq->cq_ring_phys_addr +
+ rxq_init->dscr_map = (iova_addr_t)rxq->rx_ring_phys_addr;
+ rxq_init->rcq_map = (iova_addr_t)rxq->cq_ring_phys_addr;
+ rxq_init->rcq_np_map = (iova_addr_t)(rxq->cq_ring_phys_addr +
BNX2X_PAGE_SIZE);
/*
@@ -6486,7 +6486,7 @@ bnx2x_pf_tx_q_prep(struct bnx2x_softc *sc, struct bnx2x_fastpath *fp,
PMD_TX_LOG(ERR, "ERROR: TX queue is NULL");
return;
}
- txq_init->dscr_map = (phys_addr_t)txq->tx_ring_phys_addr;
+ txq_init->dscr_map = (iova_addr_t)txq->tx_ring_phys_addr;
txq_init->sb_cq_index = HC_INDEX_ETH_FIRST_TX_CQ_CONS + cos;
txq_init->traffic_type = LLFC_TRAFFIC_TYPE_NW;
txq_init->fw_sb_id = fp->fw_sb_id;
@@ -11059,7 +11059,7 @@ static int bnx2x_init_hw_func(struct bnx2x_softc *sc)
for (i = 0; i < L2_ILT_LINES(sc); i++) {
ilt->lines[cdu_ilt_start + i].page = sc->context[i].vcxt;
ilt->lines[cdu_ilt_start + i].page_mapping =
- (phys_addr_t)sc->context[i].vcxt_dma.paddr;
+ (iova_addr_t)sc->context[i].vcxt_dma.paddr;
ilt->lines[cdu_ilt_start + i].size = sc->context[i].size;
}
ecore_ilt_init_op(sc, INITOP_SET);
@@ -11357,7 +11357,7 @@ static void bnx2x_reset_port(struct bnx2x_softc *sc)
}
}
-static void bnx2x_ilt_wr(struct bnx2x_softc *sc, uint32_t index, phys_addr_t addr)
+static void bnx2x_ilt_wr(struct bnx2x_softc *sc, uint32_t index, iova_addr_t addr)
{
int reg;
uint32_t wb_write[2];
@@ -11587,7 +11587,7 @@ static int ecore_gunzip(struct bnx2x_softc *sc, const uint8_t * zbuf, int len)
}
static void
-ecore_write_dmae_phys_len(struct bnx2x_softc *sc, phys_addr_t phys_addr,
+ecore_write_dmae_phys_len(struct bnx2x_softc *sc, iova_addr_t phys_addr,
uint32_t addr, uint32_t len)
{
bnx2x_write_dmae_phys_len(sc, phys_addr, addr, len);
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 14e892c0e..440856335 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -317,7 +317,7 @@ struct bnx2x_bar {
/* Used to manage DMA allocations. */
struct bnx2x_dma {
struct bnx2x_softc *sc;
- phys_addr_t paddr;
+ iova_addr_t paddr;
void *vaddr;
int nseg;
char msg[RTE_MEMZONE_NAMESIZE - 6];
@@ -370,10 +370,10 @@ struct bnx2x_fastpath {
struct bnx2x_dma sb_dma;
union bnx2x_host_hc_status_block status_block;
- phys_addr_t tx_desc_mapping;
+ iova_addr_t tx_desc_mapping;
- phys_addr_t rx_desc_mapping;
- phys_addr_t rx_comp_mapping;
+ iova_addr_t rx_desc_mapping;
+ iova_addr_t rx_comp_mapping;
uint16_t *sb_index_values;
uint16_t *sb_running_index;
@@ -468,7 +468,7 @@ union cdu_context {
struct hw_context {
struct bnx2x_dma vcxt_dma;
union cdu_context *vcxt;
- //phys_addr_t cxt_mapping;
+ //iova_addr_t cxt_mapping;
size_t size;
};
@@ -1242,7 +1242,7 @@ struct bnx2x_softc {
uint32_t gz_outlen;
#define GUNZIP_BUF(sc) (sc->gz_buf)
#define GUNZIP_OUTLEN(sc) (sc->gz_outlen)
-#define GUNZIP_PHYS(sc) (phys_addr_t)(sc->gz_buf_dma.paddr)
+#define GUNZIP_PHYS(sc) (iova_addr_t)(sc->gz_buf_dma.paddr)
#define FW_BUF_SIZE 0x40000
struct raw_op *init_ops;
@@ -1310,14 +1310,14 @@ struct bnx2x_softc {
*/
int fw_stats_req_size;
struct bnx2x_fw_stats_req *fw_stats_req;
- phys_addr_t fw_stats_req_mapping;
+ iova_addr_t fw_stats_req_mapping;
/*
* FW statistics data shortcut (points at the beginning of fw_stats
* buffer + fw_stats_req_size).
*/
int fw_stats_data_size;
struct bnx2x_fw_stats_data *fw_stats_data;
- phys_addr_t fw_stats_data_mapping;
+ iova_addr_t fw_stats_data_mapping;
/* tracking a pending STAT_QUERY ramrod */
uint16_t stats_pending;
@@ -1402,8 +1402,8 @@ union bnx2x_stats_show_data {
#define FUNC_FLG_LEADING 0x0020 /* PF only */
struct bnx2x_func_init_params {
- phys_addr_t fw_stat_map; /* (dma) valid if FUNC_FLG_STATS */
- phys_addr_t spq_map; /* (dma) valid if FUNC_FLG_SPQ */
+ iova_addr_t fw_stat_map; /* (dma) valid if FUNC_FLG_STATS */
+ iova_addr_t spq_map; /* (dma) valid if FUNC_FLG_SPQ */
uint16_t func_flgs;
uint16_t func_id; /* abs function id */
uint16_t pf_id;
@@ -1748,7 +1748,7 @@ uint32_t bnx2x_dmae_opcode(struct bnx2x_softc *sc, uint8_t src_type,
uint8_t comp_type);
void bnx2x_post_dmae(struct bnx2x_softc *sc, struct dmae_command *dmae, int idx);
void bnx2x_read_dmae(struct bnx2x_softc *sc, uint32_t src_addr, uint32_t len32);
-void bnx2x_write_dmae(struct bnx2x_softc *sc, phys_addr_t dma_addr,
+void bnx2x_write_dmae(struct bnx2x_softc *sc, iova_addr_t dma_addr,
uint32_t dst_addr, uint32_t len32);
void bnx2x_set_ctx_validation(struct bnx2x_softc *sc, struct eth_context *cxt,
uint32_t cid);
diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c
index 5dd4aee7f..7336124fc 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.c
+++ b/drivers/net/bnx2x/bnx2x_rxtx.c
@@ -71,8 +71,8 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
struct bnx2x_softc *sc = dev->data->dev_private;
struct bnx2x_fastpath *fp = &sc->fp[queue_idx];
struct eth_rx_cqe_next_page *nextpg;
- phys_addr_t *rx_bd;
- phys_addr_t busaddr;
+ iova_addr_t *rx_bd;
+ iova_addr_t busaddr;
/* First allocate the rx queue data structure */
rxq = rte_zmalloc_socket("ethdev RX queue", sizeof(struct bnx2x_rx_queue),
diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c
index 6223cfef1..03625810e 100644
--- a/drivers/net/bnx2x/bnx2x_stats.c
+++ b/drivers/net/bnx2x/bnx2x_stats.c
@@ -1338,7 +1338,7 @@ bnx2x_prep_fw_stats_req(struct bnx2x_softc *sc)
int i;
int first_queue_query_index;
struct stats_query_header *stats_hdr = &sc->fw_stats_req->hdr;
- phys_addr_t cur_data_offset;
+ iova_addr_t cur_data_offset;
struct stats_query_entry *cur_query_entry;
stats_hdr->cmd_num = sc->fw_stats_num;
diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c
index 0ca0df876..855dafaa6 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/bnx2x/bnx2x_vfpf.c
@@ -113,7 +113,7 @@ bnx2x_vf_finalize(struct bnx2x_softc *sc,
#define BNX2X_VF_CHANNEL_TRIES 100
static int
-bnx2x_do_req4pf(struct bnx2x_softc *sc, phys_addr_t phys_addr)
+bnx2x_do_req4pf(struct bnx2x_softc *sc, iova_addr_t phys_addr)
{
uint8_t *status = &sc->vf2pf_mbox->resp.common_reply.status;
uint8_t i;
diff --git a/drivers/net/bnx2x/ecore_sp.h b/drivers/net/bnx2x/ecore_sp.h
index 85ab4c28f..fed6f04a1 100644
--- a/drivers/net/bnx2x/ecore_sp.h
+++ b/drivers/net/bnx2x/ecore_sp.h
@@ -36,7 +36,7 @@
#include "ecore_reg.h"
struct bnx2x_softc;
-typedef phys_addr_t ecore_dma_addr_t; /* expected to be 64 bit wide */
+typedef iova_addr_t ecore_dma_addr_t; /* expected to be 64 bit wide */
typedef volatile int ecore_atomic_t;
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 294a17466..42b0b1da0 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -132,7 +132,7 @@ struct bnxt_pf_info {
uint16_t max_vfs;
uint32_t func_cfg_flags;
void *vf_req_buf;
- phys_addr_t vf_req_buf_dma_addr;
+ iova_addr_t vf_req_buf_dma_addr;
uint32_t vf_req_fwd[8];
uint16_t total_vnics;
struct bnxt_child_vf_info *vf_info;
@@ -202,14 +202,14 @@ struct bnxt {
struct bnxt_rx_queue **rx_queues;
const void *rx_mem_zone;
struct rx_port_stats *hw_rx_port_stats;
- phys_addr_t hw_rx_port_stats_map;
+ iova_addr_t hw_rx_port_stats_map;
unsigned int tx_nr_rings;
unsigned int tx_cp_nr_rings;
struct bnxt_tx_queue **tx_queues;
const void *tx_mem_zone;
struct tx_port_stats *hw_tx_port_stats;
- phys_addr_t hw_tx_port_stats_map;
+ iova_addr_t hw_tx_port_stats_map;
/* Default completion ring */
struct bnxt_cp_ring_info *def_cp_ring;
@@ -235,9 +235,9 @@ struct bnxt {
uint16_t hwrm_cmd_seq;
void *hwrm_cmd_resp_addr;
- phys_addr_t hwrm_cmd_resp_dma_addr;
+ iova_addr_t hwrm_cmd_resp_dma_addr;
void *hwrm_short_cmd_req_addr;
- phys_addr_t hwrm_short_cmd_req_dma_addr;
+ iova_addr_t hwrm_short_cmd_req_dma_addr;
rte_spinlock_t hwrm_lock;
uint16_t max_req_len;
uint16_t max_resp_len;
diff --git a/drivers/net/bnxt/bnxt_cpr.h b/drivers/net/bnxt/bnxt_cpr.h
index e8f048a3b..4e7f123ce 100644
--- a/drivers/net/bnxt/bnxt_cpr.h
+++ b/drivers/net/bnxt/bnxt_cpr.h
@@ -86,10 +86,10 @@ struct bnxt_cp_ring_info {
struct cmpl_base *cp_desc_ring;
- phys_addr_t cp_desc_mapping;
+ iova_addr_t cp_desc_mapping;
struct ctx_hw_stats *hw_stats;
- phys_addr_t hw_stats_map;
+ iova_addr_t hw_stats_map;
uint32_t hw_stats_ctx_id;
struct bnxt_ring *cp_ring_struct;
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index d3da30189..845bb03d9 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2772,7 +2772,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
const struct rte_memzone *mz = NULL;
static int version_printed;
uint32_t total_alloc_len;
- phys_addr_t mz_phys_addr;
+ iova_addr_t mz_phys_addr;
struct bnxt *bp;
int rc;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 0e96d3c4d..10898e19a 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -3025,7 +3025,7 @@ int bnxt_get_nvram_directory(struct bnxt *bp, uint32_t len, uint8_t *data)
uint32_t entry_length;
uint8_t *buf;
size_t buflen;
- phys_addr_t dma_handle;
+ iova_addr_t dma_handle;
struct hwrm_nvm_get_dir_entries_input req = {0};
struct hwrm_nvm_get_dir_entries_output *resp = bp->hwrm_cmd_resp_addr;
@@ -3070,7 +3070,7 @@ int bnxt_hwrm_get_nvram_item(struct bnxt *bp, uint32_t index,
{
int rc;
uint8_t *buf;
- phys_addr_t dma_handle;
+ iova_addr_t dma_handle;
struct hwrm_nvm_read_input req = {0};
struct hwrm_nvm_read_output *resp = bp->hwrm_cmd_resp_addr;
@@ -3124,7 +3124,7 @@ int bnxt_hwrm_flash_nvram(struct bnxt *bp, uint16_t dir_type,
int rc;
struct hwrm_nvm_write_input req = {0};
struct hwrm_nvm_write_output *resp = bp->hwrm_cmd_resp_addr;
- phys_addr_t dma_handle;
+ iova_addr_t dma_handle;
uint8_t *buf;
HWRM_PREP(req, NVM_WRITE);
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 9d0ae277e..8e83e4704 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -98,7 +98,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
struct rte_pci_device *pdev = bp->pdev;
const struct rte_memzone *mz = NULL;
char mz_name[RTE_MEMZONE_NAMESIZE];
- phys_addr_t mz_phys_addr;
+ iova_addr_t mz_phys_addr;
int sz;
int stats_len = (tx_ring_info || rx_ring_info) ?
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index 6d1eb5888..09042cb80 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -70,7 +70,7 @@
struct bnxt_ring {
void *bd;
- phys_addr_t bd_dma;
+ iova_addr_t bd_dma;
uint32_t ring_size;
uint32_t ring_mask;
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index cb0cef303..6cb735b6b 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -101,8 +101,8 @@ struct bnxt_rx_ring_info {
struct bnxt_sw_rx_bd *rx_buf_ring; /* sw ring */
struct bnxt_sw_rx_bd *ag_buf_ring; /* sw ring */
- phys_addr_t rx_desc_mapping;
- phys_addr_t ag_desc_mapping;
+ iova_addr_t rx_desc_mapping;
+ iova_addr_t ag_desc_mapping;
struct bnxt_ring *rx_ring_struct;
struct bnxt_ring *ag_ring_struct;
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index 3f3eb312b..7548c599c 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -49,7 +49,7 @@ struct bnxt_tx_ring_info {
struct tx_bd_long *tx_desc_ring;
struct bnxt_sw_tx_bd *tx_buf_ring;
- phys_addr_t tx_desc_mapping;
+ iova_addr_t tx_desc_mapping;
#define BNXT_DEV_STATE_CLOSING 0x1
uint32_t dev_state;
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 6f7c05bdf..76c9a35d7 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -175,7 +175,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
BNXT_MAX_MC_ADDRS * ETHER_ADDR_LEN);
uint16_t max_vnics;
int i;
- phys_addr_t mz_phys_addr;
+ iova_addr_t mz_phys_addr;
max_vnics = bp->max_vnics;
snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
diff --git a/drivers/net/bnxt/bnxt_vnic.h b/drivers/net/bnxt/bnxt_vnic.h
index 544390453..def6b42a1 100644
--- a/drivers/net/bnxt/bnxt_vnic.h
+++ b/drivers/net/bnxt/bnxt_vnic.h
@@ -53,11 +53,11 @@ struct bnxt_vnic_info {
uint16_t dflt_ring_grp;
uint16_t mru;
uint16_t hash_type;
- phys_addr_t rss_table_dma_addr;
+ iova_addr_t rss_table_dma_addr;
uint16_t *rss_table;
- phys_addr_t rss_hash_key_dma_addr;
+ iova_addr_t rss_hash_key_dma_addr;
void *rss_hash_key;
- phys_addr_t mc_list_dma_addr;
+ iova_addr_t mc_list_dma_addr;
char *mc_list;
uint32_t mc_addr_cnt;
#define BNXT_MAX_MC_ADDRS 16
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 2bbb893c2..5156ac08d 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -1744,7 +1744,7 @@ lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
} else {
struct lio_buf_free_info *finfo;
struct lio_gather *g;
- phys_addr_t phyaddr;
+ iova_addr_t phyaddr;
int i, frags;
finfo = (struct lio_buf_free_info *)rte_malloc(NULL,
diff --git a/drivers/net/liquidio/lio_rxtx.h b/drivers/net/liquidio/lio_rxtx.h
index 85685dc7d..b0977f17b 100644
--- a/drivers/net/liquidio/lio_rxtx.h
+++ b/drivers/net/liquidio/lio_rxtx.h
@@ -686,7 +686,7 @@ lio_swap_8B_data(uint64_t *data, uint32_t blocks)
static inline uint64_t
lio_map_ring(void *buf)
{
- phys_addr_t dma_addr;
+ iova_addr_t dma_addr;
dma_addr = rte_mbuf_data_dma_addr_default(((struct rte_mbuf *)buf));
@@ -696,7 +696,7 @@ lio_map_ring(void *buf)
static inline uint64_t
lio_map_ring_info(struct lio_droq *droq, uint32_t i)
{
- phys_addr_t dma_addr;
+ iova_addr_t dma_addr;
dma_addr = droq->info_list_dma + (i * LIO_DROQ_INFO_SIZE);
diff --git a/drivers/net/octeontx/base/octeontx_pkovf.c b/drivers/net/octeontx/base/octeontx_pkovf.c
index a8f6e5d36..5fefdffe3 100644
--- a/drivers/net/octeontx/base/octeontx_pkovf.c
+++ b/drivers/net/octeontx/base/octeontx_pkovf.c
@@ -46,7 +46,7 @@
struct octeontx_pko_iomem {
uint8_t *va;
- phys_addr_t iova;
+ iova_addr_t iova;
size_t size;
};
diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index 74e518821..9d945d218 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -63,7 +63,7 @@ typedef u32 OSAL_BE32;
#define osal_uintptr_t uintptr_t
-typedef phys_addr_t dma_addr_t;
+typedef iova_addr_t dma_addr_t;
typedef rte_spinlock_t osal_spinlock_t;
diff --git a/drivers/net/sfc/efsys.h b/drivers/net/sfc/efsys.h
index 0405d02bb..5a6625008 100644
--- a/drivers/net/sfc/efsys.h
+++ b/drivers/net/sfc/efsys.h
@@ -253,7 +253,7 @@ typedef struct __efsys_identifier_s efsys_identifier_t;
/* DMA */
-typedef phys_addr_t efsys_dma_addr_t;
+typedef iova_addr_t efsys_dma_addr_t;
typedef struct efsys_mem_s {
const struct rte_memzone *esm_mz;
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index 500d652a9..2cdc90c42 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -177,7 +177,7 @@ sfc_ef10_rx_qrefill(struct sfc_ef10_rxq *rxq)
++i, ++id) {
struct rte_mbuf *m = objs[i];
struct sfc_ef10_rx_sw_desc *rxd;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
SFC_ASSERT((id & ~ptr_mask) == 0);
rxd = &rxq->sw_ring[id];
diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c
index 9047b3e46..7f2732aef 100644
--- a/drivers/net/sfc/sfc_ef10_tx.c
+++ b/drivers/net/sfc/sfc_ef10_tx.c
@@ -195,7 +195,7 @@ sfc_ef10_tx_reap(struct sfc_ef10_txq *txq)
}
static void
-sfc_ef10_tx_qdesc_dma_create(phys_addr_t addr, uint16_t size, bool eop,
+sfc_ef10_tx_qdesc_dma_create(iova_addr_t addr, uint16_t size, bool eop,
efx_qword_t *edp)
{
EFX_POPULATE_QWORD_4(*edp,
@@ -341,7 +341,7 @@ sfc_ef10_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
pkt_len = m_seg->pkt_len;
do {
- phys_addr_t seg_addr = rte_mbuf_data_dma_addr(m_seg);
+ iova_addr_t seg_addr = rte_mbuf_data_dma_addr(m_seg);
unsigned int seg_len = rte_pktmbuf_data_len(m_seg);
unsigned int id = added & ptr_mask;
diff --git a/drivers/net/thunderx/base/nicvf_hw.c b/drivers/net/thunderx/base/nicvf_hw.c
index 2634285eb..dc0af1ca0 100644
--- a/drivers/net/thunderx/base/nicvf_hw.c
+++ b/drivers/net/thunderx/base/nicvf_hw.c
@@ -509,7 +509,7 @@ nicvf_qset_rbdr_precharge(void *dev, struct nicvf *nic,
struct rbdr_entry_t *desc, *desc0;
struct nicvf_rbdr *rbdr = nic->rbdr;
uint32_t count;
- nicvf_phys_addr_t phy;
+ nicvf_iova_addr_t phy;
assert(rbdr != NULL);
desc = rbdr->desc;
diff --git a/drivers/net/thunderx/base/nicvf_hw.h b/drivers/net/thunderx/base/nicvf_hw.h
index b7d0a3dc5..698aa4878 100644
--- a/drivers/net/thunderx/base/nicvf_hw.h
+++ b/drivers/net/thunderx/base/nicvf_hw.h
@@ -88,7 +88,7 @@ enum nicvf_err_e {
NICVF_ERR_RSS_GET_SZ, /* -8171 */
};
-typedef nicvf_phys_addr_t (*rbdr_pool_get_handler)(void *dev, void *opaque);
+typedef nicvf_iova_addr_t (*rbdr_pool_get_handler)(void *dev, void *opaque);
struct nicvf_hw_rx_qstats {
uint64_t q_rx_bytes;
diff --git a/drivers/net/thunderx/base/nicvf_hw_defs.h b/drivers/net/thunderx/base/nicvf_hw_defs.h
index 0fe673e6d..e7e092b61 100644
--- a/drivers/net/thunderx/base/nicvf_hw_defs.h
+++ b/drivers/net/thunderx/base/nicvf_hw_defs.h
@@ -213,7 +213,7 @@
#define NICVF_STATIC_ASSERT(s) _Static_assert(s, #s)
#define assert_primary(nic) assert((nic)->sqs_mode == 0)
-typedef uint64_t nicvf_phys_addr_t;
+typedef uint64_t nicvf_iova_addr_t;
/* vNIC HW Enumerations */
@@ -840,7 +840,7 @@ struct rbdr_entry_t {
uint64_t buf_addr:42;
uint64_t cache_align:7;
};
- nicvf_phys_addr_t full_addr;
+ nicvf_iova_addr_t full_addr;
};
#else
union {
@@ -849,7 +849,7 @@ struct rbdr_entry_t {
uint64_t buf_addr:42;
uint64_t rsvd0:15;
};
- nicvf_phys_addr_t full_addr;
+ nicvf_iova_addr_t full_addr;
};
#endif
};
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 551b371c5..45d7d8be8 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -679,7 +679,7 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic,
static void
nicvf_rbdr_release_mbuf(struct rte_eth_dev *dev, struct nicvf *nic,
- nicvf_phys_addr_t phy)
+ nicvf_iova_addr_t phy)
{
uint16_t qidx;
void *obj;
@@ -1428,7 +1428,7 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
};
}
-static nicvf_phys_addr_t
+static nicvf_iova_addr_t
rbdr_rte_mempool_get(void *dev, void *opaque)
{
uint16_t qidx;
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index 3734430f5..6909082f5 100644
--- a/drivers/net/thunderx/nicvf_ethdev.h
+++ b/drivers/net/thunderx/nicvf_ethdev.h
@@ -104,7 +104,7 @@ nicvf_netdev_qidx(struct nicvf *nic, uint8_t local_qidx)
* P = V - offset
*/
static inline uintptr_t
-nicvf_mbuff_phy2virt(phys_addr_t phy, uint64_t mbuf_phys_off)
+nicvf_mbuff_phy2virt(iova_addr_t phy, uint64_t mbuf_phys_off)
{
return (uintptr_t)(phy + mbuf_phys_off);
}
@@ -112,7 +112,7 @@ nicvf_mbuff_phy2virt(phys_addr_t phy, uint64_t mbuf_phys_off)
static inline uintptr_t
nicvf_mbuff_virt2phy(uintptr_t virt, uint64_t mbuf_phys_off)
{
- return (phys_addr_t)(virt - mbuf_phys_off);
+ return (iova_addr_t)(virt - mbuf_phys_off);
}
static inline void
diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h
index e54a96f8e..0f8208ef1 100644
--- a/drivers/net/thunderx/nicvf_struct.h
+++ b/drivers/net/thunderx/nicvf_struct.h
@@ -46,7 +46,7 @@ struct nicvf_rbdr {
uintptr_t rbdr_status;
uintptr_t rbdr_door;
struct rbdr_entry_t *desc;
- nicvf_phys_addr_t phys;
+ nicvf_iova_addr_t phys;
uint32_t buffsz;
uint32_t tail;
uint32_t next_tail;
@@ -56,7 +56,7 @@ struct nicvf_rbdr {
struct nicvf_txq {
union sq_entry_t *desc;
- nicvf_phys_addr_t phys;
+ nicvf_iova_addr_t phys;
struct rte_mbuf **txbuffs;
uintptr_t sq_head;
uintptr_t sq_door;
@@ -87,7 +87,7 @@ struct nicvf_rxq {
uintptr_t cq_status;
uintptr_t cq_door;
union mbuf_initializer mbuf_initializer;
- nicvf_phys_addr_t phys;
+ nicvf_iova_addr_t phys;
union cq_entry_t *desc;
struct nicvf_rbdr *shared_rbdr;
struct nicvf *nic;
diff --git a/drivers/net/virtio/virtio_rxtx.h b/drivers/net/virtio/virtio_rxtx.h
index 2a7c3ad3a..bc674afc7 100644
--- a/drivers/net/virtio/virtio_rxtx.h
+++ b/drivers/net/virtio/virtio_rxtx.h
@@ -66,7 +66,7 @@ struct virtnet_tx {
struct virtqueue *vq;
/**< memzone to populate hdr. */
const struct rte_memzone *virtio_net_hdr_mz;
- phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
+ iova_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
uint16_t queue_id; /**< DPDK queue index. */
uint16_t port_id; /**< Device port identifier. */
@@ -81,7 +81,7 @@ struct virtnet_ctl {
struct virtqueue *vq;
/**< memzone to populate hdr. */
const struct rte_memzone *virtio_net_hdr_mz;
- phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
+ iova_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
uint16_t port_id; /**< Device port identifier. */
const struct rte_memzone *mz; /**< mem zone to populate CTL ring. */
};
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 9c4f96d2b..d8e4364f5 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -204,7 +204,7 @@ struct virtqueue {
struct virtnet_ctl cq;
};
- phys_addr_t vq_ring_mem; /**< physical address of vring,
+ iova_addr_t vq_ring_mem; /**< physical address of vring,
* or virtual address for virtio_user. */
/**
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 7dfcba421..96e5ed77f 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -141,7 +141,7 @@ enum l2fwd_crypto_xform_chain {
struct l2fwd_key {
uint8_t *data;
uint32_t length;
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
};
struct l2fwd_iv {
diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte_crypto.h
index 10fe0804b..363d1a7e5 100644
--- a/lib/librte_cryptodev/rte_crypto.h
+++ b/lib/librte_cryptodev/rte_crypto.h
@@ -117,7 +117,7 @@ struct rte_crypto_op {
struct rte_mempool *mempool;
/**< crypto operation mempool which operation is allocated from */
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
/**< physical address of crypto operation */
RTE_STD_C11
diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h
index 0a0ea59de..f4338d866 100644
--- a/lib/librte_cryptodev/rte_crypto_sym.h
+++ b/lib/librte_cryptodev/rte_crypto_sym.h
@@ -546,7 +546,7 @@ struct rte_crypto_sym_op {
* For GCM (@ref RTE_CRYPTO_AEAD_AES_GCM), for
* "digest result" read "authentication tag T".
*/
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
/**< Physical address of digest */
} digest; /**< Digest parameters */
struct {
@@ -581,7 +581,7 @@ struct rte_crypto_sym_op {
* of the block size (16 bytes).
*
*/
- phys_addr_t phys_addr; /**< physical address */
+ iova_addr_t phys_addr; /**< physical address */
} aad;
/**< Additional authentication parameters */
} aead;
@@ -678,7 +678,7 @@ struct rte_crypto_sym_op {
* will overwrite any data at this location.
*
*/
- phys_addr_t phys_addr;
+ iova_addr_t phys_addr;
/**< Physical address of digest */
} digest; /**< Digest parameters */
} auth;
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index fd0e3f197..ce41829fc 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -111,7 +111,7 @@ extern const char **rte_cyptodev_names;
* to calculate address from.
*/
#define rte_crypto_op_ctophys_offset(c, o) \
- (phys_addr_t)((c)->phys_addr + (o))
+ (iova_addr_t)((c)->phys_addr + (o))
/**
* Crypto parameters range description
diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index 3614da8db..10c2e121f 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -50,7 +50,7 @@
/*
* Get physical address of any mapped virtual address in the current process.
*/
-phys_addr_t
+iova_addr_t
rte_mem_virt2phy(const void *virtaddr)
{
/* XXX not implemented. This function is only used by
@@ -73,7 +73,7 @@ rte_eal_hugepage_init(void)
/* for debug purposes, hugetlbfs can be disabled */
if (internal_config.no_hugetlbfs) {
addr = malloc(internal_config.memory);
- mcfg->memseg[0].phys_addr = (phys_addr_t)(uintptr_t)addr;
+ mcfg->memseg[0].phys_addr = (iova_addr_t)(uintptr_t)addr;
mcfg->memseg[0].addr = addr;
mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
mcfg->memseg[0].len = internal_config.memory;
diff --git a/lib/librte_eal/common/include/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h
index 3d37f79b8..491b479b1 100644
--- a/lib/librte_eal/common/include/rte_malloc.h
+++ b/lib/librte_eal/common/include/rte_malloc.h
@@ -332,7 +332,7 @@ rte_malloc_set_limit(const char *type, size_t max);
* RTE_BAD_PHYS_ADDR on error
* otherwise return physical address of the buffer
*/
-phys_addr_t
+iova_addr_t
rte_malloc_virt2phy(const void *addr);
#ifdef __cplusplus
diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index c545963c8..d05f53ad7 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -94,14 +94,14 @@ enum rte_page_sizes {
*/
#define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)
-typedef uint64_t phys_addr_t; /**< Physical address definition. */
-#define RTE_BAD_PHYS_ADDR ((phys_addr_t)-1)
+typedef uint64_t iova_addr_t; /**< Physical address definition. */
+#define RTE_BAD_PHYS_ADDR ((iova_addr_t)-1)
/**
* Physical memory segment descriptor.
*/
struct rte_memseg {
- phys_addr_t phys_addr; /**< Start physical address. */
+ iova_addr_t phys_addr; /**< Start physical address. */
RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
@@ -134,7 +134,7 @@ int rte_mem_lock_page(const void *virt);
* @return
* The physical address or RTE_BAD_PHYS_ADDR on error.
*/
-phys_addr_t rte_mem_virt2phy(const void *virt);
+iova_addr_t rte_mem_virt2phy(const void *virt);
/**
* Get the layout of the available physical memory.
diff --git a/lib/librte_eal/common/include/rte_memzone.h b/lib/librte_eal/common/include/rte_memzone.h
index 1d0827f46..89b2adb6e 100644
--- a/lib/librte_eal/common/include/rte_memzone.h
+++ b/lib/librte_eal/common/include/rte_memzone.h
@@ -78,7 +78,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. */
- phys_addr_t phys_addr; /**< Start physical address. */
+ iova_addr_t phys_addr; /**< Start physical address. */
RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index d65c05a4d..e817d70ca 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -248,10 +248,10 @@ rte_malloc_set_limit(__rte_unused const char *type,
/*
* Return the physical address of a virtual address obtained through rte_malloc
*/
-phys_addr_t
+iova_addr_t
rte_malloc_virt2phy(const void *addr)
{
- phys_addr_t paddr;
+ iova_addr_t paddr;
const struct malloc_elem *elem = malloc_elem_from_data(addr);
if (elem == NULL)
return RTE_BAD_PHYS_ADDR;
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 187d3389e..9c94c4ca9 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -97,7 +97,7 @@ static void
test_phys_addrs_available(void)
{
uint64_t tmp;
- phys_addr_t physaddr;
+ iova_addr_t physaddr;
if (!rte_eal_has_hugepages()) {
RTE_LOG(ERR, EAL,
@@ -119,7 +119,7 @@ test_phys_addrs_available(void)
/*
* Get physical address of any mapped virtual address in the current process.
*/
-phys_addr_t
+iova_addr_t
rte_mem_virt2phy(const void *virtaddr)
{
int fd, retval;
@@ -188,7 +188,7 @@ static int
find_physaddrs(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
{
unsigned int i;
- phys_addr_t addr;
+ iova_addr_t addr;
for (i = 0; i < hpi->num_pages[0]; i++) {
addr = rte_mem_virt2phy(hugepg_tbl[i].orig_va);
@@ -206,7 +206,7 @@ static int
set_physaddrs(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
{
unsigned int i;
- static phys_addr_t addr;
+ static iova_addr_t addr;
for (i = 0; i < hpi->num_pages[0]; i++) {
hugepg_tbl[i].physaddr = addr;
diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
index 2ac879fdd..bf0ac31e7 100644
--- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
+++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
@@ -73,6 +73,11 @@
#define RTE_CACHE_LINE_MIN_SIZE 64
+#ifndef __clang__
+typedef uint64_t iova_addr_t;
+#endif
+
+
/*
* Request id.
*/
@@ -138,20 +143,20 @@ struct rte_kni_mbuf {
struct rte_kni_device_info {
char name[RTE_KNI_NAMESIZE]; /**< Network device name for KNI */
- phys_addr_t tx_phys;
- phys_addr_t rx_phys;
- phys_addr_t alloc_phys;
- phys_addr_t free_phys;
+ iova_addr_t tx_phys;
+ iova_addr_t rx_phys;
+ iova_addr_t alloc_phys;
+ iova_addr_t free_phys;
/* Used by Ethtool */
- phys_addr_t req_phys;
- phys_addr_t resp_phys;
- phys_addr_t sync_phys;
+ iova_addr_t req_phys;
+ iova_addr_t resp_phys;
+ iova_addr_t sync_phys;
void * sync_va;
/* mbuf mempool */
void * mbuf_va;
- phys_addr_t mbuf_phys;
+ iova_addr_t mbuf_phys;
/* PCI info */
uint16_t vendor_id; /**< Vendor ID or PCI_ANY_ID. */
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index cc380400d..85e1880bf 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -411,7 +411,7 @@ struct rte_mbuf {
* same mbuf cacheline0 layout for 32-bit and 64-bit. This makes
* working on vector drivers easier.
*/
- phys_addr_t buf_physaddr __rte_aligned(sizeof(phys_addr_t));
+ iova_addr_t buf_physaddr __rte_aligned(sizeof(iova_addr_t));
/* next 8 bytes are initialised on RX descriptor rearm */
MARKER64 rearm_data;
@@ -594,7 +594,7 @@ static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp);
* @return
* The physical address of the beginning of the mbuf data
*/
-static inline phys_addr_t
+static inline iova_addr_t
rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
{
return mb->buf_physaddr + mb->data_off;
@@ -612,7 +612,7 @@ rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
* @return
* The physical address of the beginning of the mbuf data
*/
-static inline phys_addr_t
+static inline iova_addr_t
rte_mbuf_data_dma_addr_default(const struct rte_mbuf *mb)
{
return mb->buf_physaddr + RTE_PKTMBUF_HEADROOM;
@@ -1535,7 +1535,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)
* The offset into the data to calculate address from.
*/
#define rte_pktmbuf_mtophys_offset(m, o) \
- (phys_addr_t)((m)->buf_physaddr + (m)->data_off + (o))
+ (iova_addr_t)((m)->buf_physaddr + (m)->data_off + (o))
/**
* A macro that returns the physical address that points to the start of the
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 6357fd48e..a9b64fffe 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -128,7 +128,7 @@ static unsigned optimize_object_size(unsigned obj_size)
}
static void
-mempool_add_elem(struct rte_mempool *mp, void *obj, phys_addr_t physaddr)
+mempool_add_elem(struct rte_mempool *mp, void *obj, iova_addr_t physaddr)
{
struct rte_mempool_objhdr *hdr;
struct rte_mempool_objtlr *tlr __rte_unused;
@@ -270,11 +270,11 @@ rte_mempool_xmem_size(uint32_t elt_num, size_t total_elt_sz, uint32_t pg_shift,
*/
ssize_t
rte_mempool_xmem_usage(__rte_unused void *vaddr, uint32_t elt_num,
- size_t total_elt_sz, const phys_addr_t paddr[], uint32_t pg_num,
+ size_t total_elt_sz, const iova_addr_t paddr[], uint32_t pg_num,
uint32_t pg_shift, unsigned int flags)
{
uint32_t elt_cnt = 0;
- phys_addr_t start, end;
+ iova_addr_t start, end;
uint32_t paddr_idx;
size_t pg_sz = (size_t)1 << pg_shift;
unsigned int mask;
@@ -358,7 +358,7 @@ rte_mempool_free_memchunks(struct rte_mempool *mp)
*/
int
rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
- phys_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
+ iova_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque)
{
unsigned total_elt_sz;
@@ -440,7 +440,7 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
*/
int
rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
+ const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque)
{
uint32_t i, n;
@@ -483,7 +483,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
size_t len, size_t pg_sz, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque)
{
- phys_addr_t paddr;
+ iova_addr_t paddr;
size_t off, phys_len;
int ret, cnt = 0;
@@ -512,7 +512,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
/* populate with the largest group of contiguous pages */
for (phys_len = pg_sz; off + phys_len < len; phys_len += pg_sz) {
- phys_addr_t paddr_tmp;
+ iova_addr_t paddr_tmp;
paddr_tmp = rte_mem_virt2phy(addr + off + phys_len);
@@ -547,7 +547,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)
char mz_name[RTE_MEMZONE_NAMESIZE];
const struct rte_memzone *mz;
size_t size, total_elt_sz, align, pg_sz, pg_shift;
- phys_addr_t paddr;
+ iova_addr_t paddr;
unsigned mz_id, n;
unsigned int mp_flags;
int ret;
@@ -958,7 +958,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
rte_mempool_ctor_t *mp_init, void *mp_init_arg,
rte_mempool_obj_cb_t *obj_init, void *obj_init_arg,
int socket_id, unsigned flags, void *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift)
+ const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift)
{
struct rte_mempool *mp = NULL;
int ret;
diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index c69841ec4..3139be4f5 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -157,7 +157,7 @@ struct rte_mempool_objsz {
struct rte_mempool_objhdr {
STAILQ_ENTRY(rte_mempool_objhdr) next; /**< Next in list. */
struct rte_mempool *mp; /**< The mempool owning the object. */
- phys_addr_t physaddr; /**< Physical address of the object. */
+ iova_addr_t physaddr; /**< Physical address of the object. */
#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
uint64_t cookie; /**< Debug cookie. */
#endif
@@ -203,7 +203,7 @@ struct rte_mempool_memhdr {
STAILQ_ENTRY(rte_mempool_memhdr) next; /**< Next in list. */
struct rte_mempool *mp; /**< The mempool owning the chunk */
void *addr; /**< Virtual address of the chunk */
- phys_addr_t phys_addr; /**< Physical address of the chunk */
+ iova_addr_t phys_addr; /**< Physical address of the chunk */
size_t len; /**< length of the chunk */
rte_mempool_memchunk_free_cb_t *free_cb; /**< Free callback */
void *opaque; /**< Argument passed to the free callback */
@@ -417,7 +417,7 @@ typedef int (*rte_mempool_get_capabilities_t)(const struct rte_mempool *mp,
* Notify new memory area to mempool.
*/
typedef int (*rte_mempool_ops_register_memory_area_t)
-(const struct rte_mempool *mp, char *vaddr, phys_addr_t paddr, size_t len);
+(const struct rte_mempool *mp, char *vaddr, iova_addr_t paddr, size_t len);
/** Structure defining mempool operations structure */
struct rte_mempool_ops {
@@ -581,7 +581,7 @@ rte_mempool_ops_get_capabilities(const struct rte_mempool *mp,
*/
int
rte_mempool_ops_register_memory_area(const struct rte_mempool *mp,
- char *vaddr, phys_addr_t paddr, size_t len);
+ char *vaddr, iova_addr_t paddr, size_t len);
/**
* @internal wrapper for mempool_ops free callback.
@@ -814,7 +814,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
rte_mempool_ctor_t *mp_init, void *mp_init_arg,
rte_mempool_obj_cb_t *obj_init, void *obj_init_arg,
int socket_id, unsigned flags, void *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift);
+ const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift);
/**
* Create an empty mempool
@@ -895,7 +895,7 @@ rte_mempool_free(struct rte_mempool *mp);
* mempool and a negative errno is returned.
*/
int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
- phys_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
+ iova_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque);
/**
@@ -926,7 +926,7 @@ int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
* mempool and a negative errno is returned.
*/
int rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
+ const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque);
/**
@@ -1456,7 +1456,7 @@ rte_mempool_empty(const struct rte_mempool *mp)
* If the mempool was created with MEMPOOL_F_NO_PHYS_CONTIG, the
* returned value is RTE_BAD_PHYS_ADDR.
*/
-static inline phys_addr_t
+static inline iova_addr_t
rte_mempool_virt2phy(__rte_unused const struct rte_mempool *mp, const void *elt)
{
const struct rte_mempool_objhdr *hdr;
@@ -1589,7 +1589,7 @@ size_t rte_mempool_xmem_size(uint32_t elt_num, size_t total_elt_sz,
* is the actual number of elements that can be stored in that buffer.
*/
ssize_t rte_mempool_xmem_usage(void *vaddr, uint32_t elt_num,
- size_t total_elt_sz, const phys_addr_t paddr[], uint32_t pg_num,
+ size_t total_elt_sz, const iova_addr_t paddr[], uint32_t pg_num,
uint32_t pg_shift, unsigned int flags);
/**
diff --git a/lib/librte_mempool/rte_mempool_ops.c b/lib/librte_mempool/rte_mempool_ops.c
index a6b5f2002..efa42ae97 100644
--- a/lib/librte_mempool/rte_mempool_ops.c
+++ b/lib/librte_mempool/rte_mempool_ops.c
@@ -142,7 +142,7 @@ rte_mempool_ops_get_capabilities(const struct rte_mempool *mp,
/* wrapper to notify new memory area to external mempool */
int
rte_mempool_ops_register_memory_area(const struct rte_mempool *mp, char *vaddr,
- phys_addr_t paddr, size_t len)
+ iova_addr_t paddr, size_t len)
{
struct rte_mempool_ops *ops;
diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index 01b17ca72..108376689 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -338,7 +338,7 @@ extern uint64_t VHOST_FEATURES;
extern struct virtio_net *vhost_devices[MAX_VHOST_DEVICE];
/* Convert guest physical address to host physical address */
-static __rte_always_inline phys_addr_t
+static __rte_always_inline iova_addr_t
gpa_to_hpa(struct virtio_net *dev, uint64_t gpa, uint64_t size)
{
uint32_t i;
diff --git a/test/test/test_cryptodev.h b/test/test/test_cryptodev.h
index 2e9eb0b1c..3214a43ac 100644
--- a/test/test/test_cryptodev.h
+++ b/test/test/test_cryptodev.h
@@ -153,7 +153,7 @@ pktmbuf_mtod_offset(struct rte_mbuf *mbuf, int offset) {
return rte_pktmbuf_mtod_offset(m, uint8_t *, offset);
}
-static inline phys_addr_t
+static inline iova_addr_t
pktmbuf_mtophys_offset(struct rte_mbuf *mbuf, int offset) {
struct rte_mbuf *m;
diff --git a/test/test/test_memzone.c b/test/test/test_memzone.c
index 7ae31cf74..0afb159e9 100644
--- a/test/test/test_memzone.c
+++ b/test/test/test_memzone.c
@@ -78,7 +78,7 @@
/* Test if memory overlaps: return 1 if true, or 0 if false. */
static int
-is_memory_overlap(phys_addr_t ptr1, size_t len1, phys_addr_t ptr2, size_t len2)
+is_memory_overlap(iova_addr_t ptr1, size_t len1, iova_addr_t ptr2, size_t len2)
{
if (ptr2 >= ptr1 && (ptr2 - ptr1) < len1)
return 1;
@@ -601,9 +601,9 @@ check_memzone_bounded(const char *name, uint32_t len, uint32_t align,
uint32_t bound)
{
const struct rte_memzone *mz;
- phys_addr_t bmask;
+ iova_addr_t bmask;
- bmask = ~((phys_addr_t)bound - 1);
+ bmask = ~((iova_addr_t)bound - 1);
if ((mz = rte_memzone_reserve_bounded(name, len, SOCKET_ID_ANY, 0,
align, bound)) == NULL) {
@@ -612,7 +612,7 @@ check_memzone_bounded(const char *name, uint32_t len, uint32_t align,
return -1;
}
- if ((mz->phys_addr & ((phys_addr_t)align - 1)) != 0) {
+ if ((mz->phys_addr & ((iova_addr_t)align - 1)) != 0) {
printf("%s(%s): invalid phys addr alignment\n",
__func__, mz->name);
return -1;
--
2.14.1
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v3 2/6] eal/memory: rename buf physaddr to buf iovaaddr
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 0/6] " Santosh Shukla
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 1/6] eal: rename phys addr to iova addr Santosh Shukla
@ 2017-10-20 12:31 ` Santosh Shukla
2017-10-23 20:15 ` Thomas Monjalon
` (2 more replies)
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 3/6] eal/memory: rename memseg member phys to iova addr Santosh Shukla
` (4 subsequent siblings)
6 siblings, 3 replies; 91+ messages in thread
From: Santosh Shukla @ 2017-10-20 12:31 UTC (permalink / raw)
To: dev
Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal,
anatoly.burakov, Santosh Shukla
Rename buf_physaddr to buf_iovaaddr
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
app/test-crypto-perf/cperf_test_common.c | 4 ++--
doc/guides/prog_guide/img/mbuf1.svg | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 +-
drivers/crypto/dpaa_sec/dpaa_sec.c | 4 ++--
drivers/net/ark/ark_ethdev_rx.c | 8 ++++----
drivers/net/bnx2x/bnx2x_rxtx.c | 4 ++--
drivers/net/bnxt/bnxt_ring.h | 2 +-
drivers/net/cxgbe/sge.c | 4 ++--
drivers/net/dpaa/dpaa_rxtx.c | 6 +++---
drivers/net/ena/ena_ethdev.c | 6 +++---
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_rxtx.c | 6 +++---
drivers/net/fm10k/fm10k.h | 4 ++--
drivers/net/fm10k/fm10k_rxtx_vec.c | 4 ++--
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 4 ++--
drivers/net/i40e/i40e_rxtx_vec_neon.c | 6 +++---
drivers/net/i40e/i40e_rxtx_vec_sse.c | 6 +++---
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 6 +++---
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 6 +++---
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtqueue.h | 2 +-
.../linuxapp/eal/include/exec-env/rte_kni_common.h | 2 +-
lib/librte_eal/linuxapp/kni/kni_net.c | 6 +++---
lib/librte_kni/rte_kni.c | 2 +-
lib/librte_mbuf/rte_mbuf.c | 6 +++---
lib/librte_mbuf/rte_mbuf.h | 14 +++++++-------
lib/librte_vhost/virtio_net.c | 2 +-
test/test/test_mbuf.c | 2 +-
29 files changed, 63 insertions(+), 63 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 3f116da6e..1c54b1551 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -50,7 +50,7 @@ fill_single_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp,
/* start of buffer is after mbuf structure and priv data */
m->priv_size = 0;
m->buf_addr = (char *)m + mbuf_hdr_size;
- m->buf_physaddr = rte_mempool_virt2phy(mp, obj) +
+ m->buf_iovaaddr = rte_mempool_virt2phy(mp, obj) +
mbuf_offset + mbuf_hdr_size;
m->buf_len = segment_sz;
m->data_len = segment_sz;
@@ -81,7 +81,7 @@ fill_multi_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp,
/* start of buffer is after mbuf structure and priv data */
m->priv_size = 0;
m->buf_addr = (char *)m + mbuf_hdr_size;
- m->buf_physaddr = next_seg_phys_addr;
+ m->buf_iovaaddr = next_seg_phys_addr;
next_seg_phys_addr += mbuf_hdr_size + segment_sz;
m->buf_len = segment_sz;
m->data_len = segment_sz;
diff --git a/doc/guides/prog_guide/img/mbuf1.svg b/doc/guides/prog_guide/img/mbuf1.svg
index 5bd84d1bf..2f856bfd9 100644
--- a/doc/guides/prog_guide/img/mbuf1.svg
+++ b/doc/guides/prog_guide/img/mbuf1.svg
@@ -482,7 +482,7 @@
sodipodi:role="line"
x="187.85715"
y="347.7193"
- id="tspan5240">(m->buf_physaddr is the</tspan><tspan
+ id="tspan5240">(m->buf_iovaaddr is the</tspan><tspan
sodipodi:role="line"
x="187.85715"
y="360.2193"
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index f69af88b5..9524eb624 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -310,7 +310,7 @@ static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr)
* These routines are called with help of below MACRO's
*/
-#define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_physaddr)
+#define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_iovaaddr)
#define DPAA2_OP_VADDR_TO_IOVA(op) (op->phys_addr)
/**
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index b944b94e3..94b9f6700 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -683,7 +683,7 @@ build_cipher_auth_gcm(struct rte_crypto_op *op, dpaa_sec_session *ses)
uint8_t *IV_ptr = rte_crypto_op_ctod_offset(op, uint8_t *,
ses->iv.offset);
- start_addr = mbuf->buf_physaddr + mbuf->data_off;
+ start_addr = mbuf->buf_iovaaddr + mbuf->data_off;
ctx = dpaa_sec_alloc_ctx(ses);
if (!ctx)
@@ -792,7 +792,7 @@ build_cipher_auth(struct rte_crypto_op *op, dpaa_sec_session *ses)
uint8_t *IV_ptr = rte_crypto_op_ctod_offset(op, uint8_t *,
ses->iv.offset);
- start_addr = mbuf->buf_physaddr + mbuf->data_off;
+ start_addr = mbuf->buf_iovaaddr + mbuf->data_off;
ctx = dpaa_sec_alloc_ctx(ses);
if (!ctx)
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 53e5d9b5c..23918f6d3 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -499,22 +499,22 @@ eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue)
case 0:
while (count != nb) {
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iovaaddr;
count++;
/* FALLTHROUGH */
case 3:
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iovaaddr;
count++;
/* FALLTHROUGH */
case 2:
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iovaaddr;
count++;
/* FALLTHROUGH */
case 1:
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iovaaddr;
count++;
/* FALLTHROUGH */
diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c
index 7336124fc..e558bb12c 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.c
+++ b/drivers/net/bnx2x/bnx2x_rxtx.c
@@ -140,7 +140,7 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
return -ENOMEM;
}
rxq->sw_ring[idx] = mbuf;
- rxq->rx_ring[idx] = mbuf->buf_physaddr;
+ rxq->rx_ring[idx] = mbuf->buf_iovaaddr;
}
rxq->pkt_first_seg = NULL;
rxq->pkt_last_seg = NULL;
@@ -400,7 +400,7 @@ bnx2x_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
rx_mb = rxq->sw_ring[bd_cons];
rxq->sw_ring[bd_cons] = new_mb;
- rxq->rx_ring[bd_prod] = new_mb->buf_physaddr;
+ rxq->rx_ring[bd_prod] = new_mb->buf_iovaaddr;
rx_pref = NEXT_RX_BD(bd_cons) & MAX_RX_BD(rxq);
rte_prefetch0(rxq->sw_ring[rx_pref]);
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index 09042cb80..79504af24 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -41,7 +41,7 @@
#define RING_NEXT(ring, idx) (((idx) + 1) & (ring)->ring_mask)
#define RTE_MBUF_DATA_DMA_ADDR(mb) \
- ((uint64_t)((mb)->buf_physaddr + (mb)->data_off))
+ ((uint64_t)((mb)->buf_iovaaddr + (mb)->data_off))
#define DB_IDX_MASK 0xffffff
#define DB_IDX_VALID (0x1 << 26)
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index 5376fc500..d867914ab 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -149,7 +149,7 @@ static int map_mbuf(struct rte_mbuf *mbuf, dma_addr_t *addr)
struct rte_mbuf *m = mbuf;
for (; m; m = m->next, addr++) {
- *addr = m->buf_physaddr + rte_pktmbuf_headroom(m);
+ *addr = m->buf_iovaaddr + rte_pktmbuf_headroom(m);
if (*addr == 0)
goto out_err;
}
@@ -423,7 +423,7 @@ static unsigned int refill_fl_usembufs(struct adapter *adap, struct sge_fl *q,
mbuf->nb_segs = 1;
mbuf->port = rxq->rspq.port_id;
- mapping = (dma_addr_t)RTE_ALIGN(mbuf->buf_physaddr +
+ mapping = (dma_addr_t)RTE_ALIGN(mbuf->buf_iovaaddr +
mbuf->data_off,
adap->sge.fl_align);
mapping |= buf_size_idx;
diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index 0433f3bb1..249b46e57 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -79,7 +79,7 @@
(_fd)->opaque = QM_FD_CONTIG << DPAA_FD_FORMAT_SHIFT; \
(_fd)->opaque |= ((_mbuf)->data_off) << DPAA_FD_OFFSET_SHIFT; \
(_fd)->opaque |= (_mbuf)->pkt_len; \
- (_fd)->addr = (_mbuf)->buf_physaddr; \
+ (_fd)->addr = (_mbuf)->buf_iovaaddr; \
(_fd)->bpid = _bpid; \
} while (0)
@@ -516,7 +516,7 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
sgt = temp->buf_addr + temp->data_off;
fd->format = QM_FD_SG;
- fd->addr = temp->buf_physaddr;
+ fd->addr = temp->buf_iovaaddr;
fd->offset = temp->data_off;
fd->bpid = bpid;
fd->length20 = mbuf->pkt_len;
@@ -525,7 +525,7 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
sg_temp = &sgt[i++];
sg_temp->opaque = 0;
sg_temp->val = 0;
- sg_temp->addr = cur_seg->buf_physaddr;
+ sg_temp->addr = cur_seg->buf_iovaaddr;
sg_temp->offset = cur_seg->data_off;
sg_temp->length = cur_seg->data_len;
if (RTE_MBUF_DIRECT(cur_seg)) {
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index a62c39875..6bf36611d 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1167,7 +1167,7 @@ static int ena_populate_rx_queue(struct ena_ring *rxq, unsigned int count)
rte_prefetch0(mbufs[((next_to_use + 4) & ring_mask)]);
/* prepare physical address for DMA transaction */
- ebuf.paddr = mbuf->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ ebuf.paddr = mbuf->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
ebuf.len = mbuf->buf_len - RTE_PKTMBUF_HEADROOM;
/* pass resource to device */
rc = ena_com_add_single_rx_desc(rxq->ena_com_io_sq,
@@ -1726,7 +1726,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
* consideration pushed header
*/
if (mbuf->data_len > ena_tx_ctx.header_len) {
- ebuf->paddr = mbuf->buf_physaddr +
+ ebuf->paddr = mbuf->buf_iovaaddr +
mbuf->data_off +
ena_tx_ctx.header_len;
ebuf->len = mbuf->data_len - ena_tx_ctx.header_len;
@@ -1735,7 +1735,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
}
while ((mbuf = mbuf->next) != NULL) {
- ebuf->paddr = mbuf->buf_physaddr + mbuf->data_off;
+ ebuf->paddr = mbuf->buf_iovaaddr + mbuf->data_off;
ebuf->len = mbuf->data_len;
ebuf++;
tx_info->num_of_bufs++;
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 521167063..8d74cce9b 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -315,7 +315,7 @@ enic_alloc_rx_queue_mbufs(struct enic *enic, struct vnic_rq *rq)
}
mb->data_off = RTE_PKTMBUF_HEADROOM;
- dma_addr = (dma_addr_t)(mb->buf_physaddr
+ dma_addr = (dma_addr_t)(mb->buf_iovaaddr
+ RTE_PKTMBUF_HEADROOM);
rq_enet_desc_enc(rqd, dma_addr,
(rq->is_sop ? RQ_ENET_TYPE_ONLY_SOP
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index a39172f14..95b1db1f9 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -386,7 +386,7 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
/* Push descriptor for newly allocated mbuf */
nmb->data_off = RTE_PKTMBUF_HEADROOM;
- dma_addr = (dma_addr_t)(nmb->buf_physaddr +
+ dma_addr = (dma_addr_t)(nmb->buf_iovaaddr +
RTE_PKTMBUF_HEADROOM);
rq_enet_desc_enc(rqd_ptr, dma_addr,
(rq->is_sop ? RQ_ENET_TYPE_ONLY_SOP
@@ -578,7 +578,7 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
vlan_id = 0;
vlan_tag_insert = 0;
bus_addr = (dma_addr_t)
- (tx_pkt->buf_physaddr + tx_pkt->data_off);
+ (tx_pkt->buf_iovaaddr + tx_pkt->data_off);
descs = (struct wq_enet_desc *)wq->ring.descs;
desc_p = descs + head_idx;
@@ -630,7 +630,7 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
if (tx_pkt->next == NULL)
eop = 1;
desc_p = descs + head_idx;
- bus_addr = (dma_addr_t)(tx_pkt->buf_physaddr
+ bus_addr = (dma_addr_t)(tx_pkt->buf_iovaaddr
+ tx_pkt->data_off);
wq_enet_desc_enc((struct wq_enet_desc *)
&desc_tmp, bus_addr, data_len,
diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h
index 060982b10..eee075357 100644
--- a/drivers/net/fm10k/fm10k.h
+++ b/drivers/net/fm10k/fm10k.h
@@ -252,11 +252,11 @@ struct fm10k_txq_ops {
};
#define MBUF_DMA_ADDR(mb) \
- ((uint64_t) ((mb)->buf_physaddr + (mb)->data_off))
+ ((uint64_t) ((mb)->buf_iovaaddr + (mb)->data_off))
/* enforce 512B alignment on default Rx DMA addresses */
#define MBUF_DMA_ADDR_DEFAULT(mb) \
- ((uint64_t) RTE_ALIGN(((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM),\
+ ((uint64_t) RTE_ALIGN(((mb)->buf_iovaaddr + RTE_PKTMBUF_HEADROOM),\
FM10K_RX_DATABUF_ALIGN))
static inline void fifo_reset(struct fifo *fifo, uint32_t len)
diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
index d23bfe9b7..5d40479da 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -330,8 +330,8 @@ fm10k_rxq_rearm(struct fm10k_rx_queue *rxq)
p1 = (uintptr_t)&mb1->rearm_data;
*(uint64_t *)p1 = rxq->mbuf_initializer;
- /* 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_iovaaddr(hi 64bit) */
+ RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iovaaddr) !=
offsetof(struct rte_mbuf, buf_addr) + 8);
vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr);
vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr);
diff --git a/drivers/net/i40e/i40e_rxtx_vec_altivec.c b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
index f4036ea28..242a479f0 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_altivec.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
@@ -100,7 +100,7 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq)
p1 = (uintptr_t)&mb1->rearm_data;
*(uint64_t *)p1 = rxq->mbuf_initializer;
- /* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */
+ /* load buf_addr(lo 64bit) and buf_iovaaddr(hi 64bit) */
vaddr0 = vec_ld(0, (vector unsigned long *)&mb0->buf_addr);
vaddr1 = vec_ld(0, (vector unsigned long *)&mb1->buf_addr);
@@ -538,7 +538,7 @@ vtx1(volatile struct i40e_tx_desc *txdp,
((uint64_t)pkt->data_len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT));
vector unsigned long descriptor = (vector unsigned long){
- pkt->buf_physaddr + pkt->data_off, high_qw};
+ pkt->buf_iovaaddr + pkt->data_off, high_qw};
*(vector unsigned long *)txdp = descriptor;
}
diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index 694e91f33..b858d9f1d 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -81,13 +81,13 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq)
mb0 = rxep[0].mbuf;
mb1 = rxep[1].mbuf;
- paddr = mb0->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb0->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
dma_addr0 = vdupq_n_u64(paddr);
/* flush desc with pa dma_addr */
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr0);
- paddr = mb1->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb1->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
dma_addr1 = vdupq_n_u64(paddr);
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr1);
}
@@ -515,7 +515,7 @@ vtx1(volatile struct i40e_tx_desc *txdp,
((uint64_t)flags << I40E_TXD_QW1_CMD_SHIFT) |
((uint64_t)pkt->data_len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT));
- uint64x2_t descriptor = {pkt->buf_physaddr + pkt->data_off, high_qw};
+ uint64x2_t descriptor = {pkt->buf_iovaaddr + pkt->data_off, high_qw};
vst1q_u64((uint64_t *)txdp, descriptor);
}
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 779f14e53..35928ad79 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -86,8 +86,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_iovaaddr(hi 64bit) */
+ RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iovaaddr) !=
offsetof(struct rte_mbuf, buf_addr) + 8);
vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr);
vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr);
@@ -549,7 +549,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_iovaaddr + pkt->data_off);
_mm_store_si128((__m128i *)txdp, descriptor);
}
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
index 44de1caac..571f578ce 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
@@ -87,13 +87,13 @@ ixgbe_rxq_rearm(struct ixgbe_rx_queue *rxq)
* Data to be rearmed is 6 bytes long.
*/
vst1_u8((uint8_t *)&mb0->rearm_data, p);
- paddr = mb0->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb0->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
dma_addr0 = vsetq_lane_u64(paddr, zero, 0);
/* flush desc with pa dma_addr */
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr0);
vst1_u8((uint8_t *)&mb1->rearm_data, p);
- paddr = mb1->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb1->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
dma_addr1 = vsetq_lane_u64(paddr, zero, 0);
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr1);
}
@@ -414,7 +414,7 @@ vtx1(volatile union ixgbe_adv_tx_desc *txdp,
struct rte_mbuf *pkt, uint64_t flags)
{
uint64x2_t descriptor = {
- pkt->buf_physaddr + pkt->data_off,
+ pkt->buf_iovaaddr + pkt->data_off,
(uint64_t)pkt->pkt_len << 46 | flags | pkt->data_len};
vst1q_u64((uint64_t *)&txdp->read, descriptor);
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index e704a7f35..345010f4d 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -86,8 +86,8 @@ ixgbe_rxq_rearm(struct ixgbe_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_iovaaddr(hi 64bit) */
+ RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iovaaddr) !=
offsetof(struct rte_mbuf, buf_addr) + 8);
vaddr0 = _mm_loadu_si128((__m128i *)&(mb0->buf_addr));
vaddr1 = _mm_loadu_si128((__m128i *)&(mb1->buf_addr));
@@ -604,7 +604,7 @@ vtx1(volatile union ixgbe_adv_tx_desc *txdp,
{
__m128i descriptor = _mm_set_epi64x((uint64_t)pkt->pkt_len << 46 |
flags | pkt->data_len,
- pkt->buf_physaddr + pkt->data_off);
+ pkt->buf_iovaaddr + pkt->data_off);
_mm_store_si128((__m128i *)&txdp->read, descriptor);
}
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 0917b9c49..b38396507 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -106,7 +106,7 @@ static uint16_t nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
#define NFP_QCP_MAX_ADD 0x7f
#define RTE_MBUF_DMA_ADDR_DEFAULT(mb) \
- (uint64_t)((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM)
+ (uint64_t)((mb)->buf_iovaaddr + RTE_PKTMBUF_HEADROOM)
/* nfp_qcp_ptr - Read or Write Pointer of a queue */
enum nfp_qcp_ptr {
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 0ec54a9e4..03bd162a4 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -491,7 +491,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
* VIRTIO_MBUF_DATA_DMA_ADDR in virtqueue.h for more information.
*/
if (!hw->virtio_user_dev)
- vq->offset = offsetof(struct rte_mbuf, buf_physaddr);
+ vq->offset = offsetof(struct rte_mbuf, buf_iovaaddr);
else {
vq->vq_ring_mem = (uintptr_t)mz->addr;
vq->offset = offsetof(struct rte_mbuf, buf_addr);
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index d8e4364f5..70f51709d 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -80,7 +80,7 @@ struct rte_mbuf;
#define VIRTIO_MBUF_ADDR(mb, vq) \
((uint64_t)(*(uintptr_t *)((uintptr_t)(mb) + (vq)->offset)))
#else
-#define VIRTIO_MBUF_ADDR(mb, vq) ((mb)->buf_physaddr)
+#define VIRTIO_MBUF_ADDR(mb, vq) ((mb)->buf_iovaaddr)
#endif
/**
diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
index bf0ac31e7..41b442546 100644
--- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
+++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
@@ -120,7 +120,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_iovaaddr;
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_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c
index db9f48989..7f986f482 100644
--- a/lib/librte_eal/linuxapp/kni/kni_net.c
+++ b/lib/librte_eal/linuxapp/kni/kni_net.c
@@ -69,7 +69,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_iovaaddr);
return va;
}
@@ -77,7 +77,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_iovaaddr + m->data_off);
}
/* virtual address to physical address */
@@ -88,7 +88,7 @@ va2pa(void *va, struct rte_kni_mbuf *m)
pa = (void *)((unsigned long)va -
((unsigned long)m->buf_addr -
- (unsigned long)m->buf_physaddr));
+ (unsigned long)m->buf_iovaaddr));
return pa;
}
diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index 8c483c1f4..d12dde77d 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -456,7 +456,7 @@ va2pa(struct rte_mbuf *m)
{
return (void *)((unsigned long)m -
((unsigned long)m->buf_addr -
- (unsigned long)m->buf_physaddr));
+ (unsigned long)m->buf_iovaaddr));
}
static void
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 0e18709d9..f9c7f0259 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -135,7 +135,7 @@ rte_pktmbuf_init(struct rte_mempool *mp,
/* start of buffer is after mbuf structure and priv data */
m->priv_size = priv_size;
m->buf_addr = (char *)m + mbuf_size;
- m->buf_physaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
+ m->buf_iovaaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
m->buf_len = (uint16_t)buf_len;
/* keep some headroom between start of buffer and data */
@@ -212,7 +212,7 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)
/* generic checks */
if (m->pool == NULL)
rte_panic("bad mbuf pool\n");
- if (m->buf_physaddr == 0)
+ if (m->buf_iovaaddr == 0)
rte_panic("bad phys addr\n");
if (m->buf_addr == NULL)
rte_panic("bad virt addr\n");
@@ -245,7 +245,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)
__rte_mbuf_sanity_check(m, 1);
fprintf(f, "dump mbuf at %p, phys=%"PRIx64", buf_len=%u\n",
- m, (uint64_t)m->buf_physaddr, (unsigned)m->buf_len);
+ m, (uint64_t)m->buf_iovaaddr, (unsigned)m->buf_len);
fprintf(f, " pkt_len=%"PRIu32", ol_flags=%"PRIx64", nb_segs=%u, "
"in_port=%u\n", m->pkt_len, m->ol_flags,
(unsigned)m->nb_segs, (unsigned)m->port);
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 85e1880bf..b361f2861 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -411,7 +411,7 @@ struct rte_mbuf {
* same mbuf cacheline0 layout for 32-bit and 64-bit. This makes
* working on vector drivers easier.
*/
- iova_addr_t buf_physaddr __rte_aligned(sizeof(iova_addr_t));
+ iova_addr_t buf_iovaaddr __rte_aligned(sizeof(iova_addr_t));
/* next 8 bytes are initialised on RX descriptor rearm */
MARKER64 rearm_data;
@@ -597,7 +597,7 @@ static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp);
static inline iova_addr_t
rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
{
- return mb->buf_physaddr + mb->data_off;
+ return mb->buf_iovaaddr + mb->data_off;
}
/**
@@ -615,7 +615,7 @@ rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
static inline iova_addr_t
rte_mbuf_data_dma_addr_default(const struct rte_mbuf *mb)
{
- return mb->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ return mb->buf_iovaaddr + RTE_PKTMBUF_HEADROOM;
}
/**
@@ -806,7 +806,7 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header);
* For standard needs, prefer rte_pktmbuf_alloc().
*
* The caller can expect that the following fields of the mbuf structure
- * are initialized: buf_addr, buf_physaddr, buf_len, refcnt=1, nb_segs=1,
+ * are initialized: buf_addr, buf_iovaaddr, buf_len, refcnt=1, nb_segs=1,
* next=NULL, pool, priv_size. The other fields must be initialized
* by the caller.
*
@@ -1216,7 +1216,7 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *m)
rte_mbuf_refcnt_update(md, 1);
mi->priv_size = m->priv_size;
- mi->buf_physaddr = m->buf_physaddr;
+ mi->buf_iovaaddr = m->buf_iovaaddr;
mi->buf_addr = m->buf_addr;
mi->buf_len = m->buf_len;
@@ -1264,7 +1264,7 @@ static inline void rte_pktmbuf_detach(struct rte_mbuf *m)
m->priv_size = priv_size;
m->buf_addr = (char *)m + mbuf_size;
- m->buf_physaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
+ m->buf_iovaaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
m->buf_len = (uint16_t)buf_len;
rte_pktmbuf_reset_headroom(m);
m->data_len = 0;
@@ -1535,7 +1535,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)
* The offset into the data to calculate address from.
*/
#define rte_pktmbuf_mtophys_offset(m, o) \
- (iova_addr_t)((m)->buf_physaddr + (m)->data_off + (o))
+ (iova_addr_t)((m)->buf_iovaaddr + (m)->data_off + (o))
/**
* A macro that returns the physical address that points to the start of the
diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index b75c93cf1..73007a757 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -978,7 +978,7 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,
cur->data_len = cpy_len;
cur->data_off = 0;
cur->buf_addr = (void *)(uintptr_t)desc_addr;
- cur->buf_physaddr = hpa;
+ cur->buf_iovaaddr = hpa;
/*
* In zero copy mode, one mbuf can only reference data
diff --git a/test/test/test_mbuf.c b/test/test/test_mbuf.c
index 3396b4a93..326b75dca 100644
--- a/test/test/test_mbuf.c
+++ b/test/test/test_mbuf.c
@@ -907,7 +907,7 @@ test_failing_mbuf_sanity_check(struct rte_mempool *pktmbuf_pool)
}
badbuf = *buf;
- badbuf.buf_physaddr = 0;
+ badbuf.buf_iovaaddr = 0;
if (verify_mbuf_check_panics(&badbuf)) {
printf("Error with bad-physaddr mbuf test\n");
return -1;
--
2.14.1
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v3 3/6] eal/memory: rename memseg member phys to iova addr
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 0/6] " Santosh Shukla
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 1/6] eal: rename phys addr to iova addr Santosh Shukla
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 2/6] eal/memory: rename buf physaddr to buf iovaaddr Santosh Shukla
@ 2017-10-20 12:31 ` Santosh Shukla
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 4/6] eal/memory: rename memory API to iova types Santosh Shukla
` (3 subsequent siblings)
6 siblings, 0 replies; 91+ messages in thread
From: Santosh Shukla @ 2017-10-20 12:31 UTC (permalink / raw)
To: dev
Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal,
anatoly.burakov, Santosh Shukla
Renaming rte_memseg {.phys_addr} to {.iova_addr}
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
lib/librte_eal/bsdapp/eal/eal_memory.c | 4 ++--
lib/librte_eal/common/eal_common_memory.c | 2 +-
lib/librte_eal/common/include/rte_memory.h | 4 ++--
lib/librte_eal/common/rte_malloc.c | 4 ++--
lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
lib/librte_eal/linuxapp/eal/eal_vfio.c | 6 +++---
6 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index 10c2e121f..d8882dcef 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -73,7 +73,7 @@ rte_eal_hugepage_init(void)
/* for debug purposes, hugetlbfs can be disabled */
if (internal_config.no_hugetlbfs) {
addr = malloc(internal_config.memory);
- mcfg->memseg[0].phys_addr = (iova_addr_t)(uintptr_t)addr;
+ mcfg->memseg[0].iova_addr = (iova_addr_t)(uintptr_t)addr;
mcfg->memseg[0].addr = addr;
mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
mcfg->memseg[0].len = internal_config.memory;
@@ -114,7 +114,7 @@ rte_eal_hugepage_init(void)
seg = &mcfg->memseg[seg_idx++];
seg->addr = addr;
- seg->phys_addr = physaddr;
+ seg->iova_addr = (iova_addr_t)physaddr;
seg->hugepage_sz = hpi->hugepage_sz;
seg->len = hpi->hugepage_sz;
seg->nchannel = mcfg->nchannel;
diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 996877ef5..5ed83d20a 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -100,7 +100,7 @@ rte_dump_physmem_layout(FILE *f)
"virt:%p, socket_id:%"PRId32", "
"hugepage_sz:%"PRIu64", nchannel:%"PRIx32", "
"nrank:%"PRIx32"\n", i,
- mcfg->memseg[i].phys_addr,
+ mcfg->memseg[i].iova_addr,
mcfg->memseg[i].len,
mcfg->memseg[i].addr,
mcfg->memseg[i].socket_id,
diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index d05f53ad7..93e7a819f 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -94,14 +94,14 @@ enum rte_page_sizes {
*/
#define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)
-typedef uint64_t iova_addr_t; /**< Physical address definition. */
+typedef uint64_t iova_addr_t; /**< Iova address definition. */
#define RTE_BAD_PHYS_ADDR ((iova_addr_t)-1)
/**
* Physical memory segment descriptor.
*/
struct rte_memseg {
- iova_addr_t phys_addr; /**< Start physical address. */
+ iova_addr_t iova_addr; /**< Start iova(_pa or _va) address. */
RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index e817d70ca..506d7a415 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -255,13 +255,13 @@ rte_malloc_virt2phy(const void *addr)
const struct malloc_elem *elem = malloc_elem_from_data(addr);
if (elem == NULL)
return RTE_BAD_PHYS_ADDR;
- if (elem->ms->phys_addr == RTE_BAD_PHYS_ADDR)
+ if (elem->ms->iova_addr == RTE_BAD_PHYS_ADDR)
return RTE_BAD_PHYS_ADDR;
if (rte_eal_iova_mode() == RTE_IOVA_VA)
paddr = (uintptr_t)addr;
else
- paddr = elem->ms->phys_addr +
+ paddr = elem->ms->iova_addr +
((uintptr_t)addr - (uintptr_t)elem->ms->addr);
return paddr;
}
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 9c94c4ca9..603164d77 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -1031,9 +1031,9 @@ rte_eal_hugepage_init(void)
return -1;
}
if (rte_eal_iova_mode() == RTE_IOVA_VA)
- mcfg->memseg[0].phys_addr = (uintptr_t)addr;
+ mcfg->memseg[0].iova_addr = (uintptr_t)addr;
else
- mcfg->memseg[0].phys_addr = RTE_BAD_PHYS_ADDR;
+ mcfg->memseg[0].iova_addr = RTE_BAD_PHYS_ADDR;
mcfg->memseg[0].addr = addr;
mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
mcfg->memseg[0].len = internal_config.memory;
@@ -1282,7 +1282,7 @@ rte_eal_hugepage_init(void)
if (j == RTE_MAX_MEMSEG)
break;
- mcfg->memseg[j].phys_addr = hugepage[i].physaddr;
+ mcfg->memseg[j].iova_addr = hugepage[i].physaddr;
mcfg->memseg[j].addr = hugepage[i].final_va;
mcfg->memseg[j].len = hugepage[i].size;
mcfg->memseg[j].socket_id = hugepage[i].socket_id;
@@ -1293,7 +1293,7 @@ rte_eal_hugepage_init(void)
#ifdef RTE_ARCH_PPC_64
/* Use the phy and virt address of the last page as segment
* address for IBM Power architecture */
- mcfg->memseg[j].phys_addr = hugepage[i].physaddr;
+ mcfg->memseg[j].iova_addr = hugepage[i].physaddr;
mcfg->memseg[j].addr = hugepage[i].final_va;
#endif
mcfg->memseg[j].len += mcfg->memseg[j].hugepage_sz;
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 9d66247bc..32b090325 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -709,7 +709,7 @@ vfio_type1_dma_map(int vfio_container_fd)
if (rte_eal_iova_mode() == RTE_IOVA_VA)
dma_map.iova = dma_map.vaddr;
else
- dma_map.iova = ms[i].phys_addr;
+ dma_map.iova = ms[i].iova_addr;
dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE;
ret = ioctl(vfio_container_fd, VFIO_IOMMU_MAP_DMA, &dma_map);
@@ -768,7 +768,7 @@ vfio_spapr_dma_map(int vfio_container_fd)
break;
create.window_size = RTE_MAX(create.window_size,
- ms[i].phys_addr + ms[i].len);
+ ms[i].iova_addr + ms[i].len);
}
/* sPAPR requires window size to be a power of 2 */
@@ -812,7 +812,7 @@ vfio_spapr_dma_map(int vfio_container_fd)
if (rte_eal_iova_mode() == RTE_IOVA_VA)
dma_map.iova = dma_map.vaddr;
else
- dma_map.iova = ms[i].phys_addr;
+ dma_map.iova = ms[i].iova_addr;
dma_map.flags = VFIO_DMA_MAP_FLAG_READ |
VFIO_DMA_MAP_FLAG_WRITE;
--
2.14.1
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v3 4/6] eal/memory: rename memory API to iova types
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 0/6] " Santosh Shukla
` (2 preceding siblings ...)
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 3/6] eal/memory: rename memseg member phys to iova addr Santosh Shukla
@ 2017-10-20 12:31 ` Santosh Shukla
2017-11-03 11:11 ` Thomas Monjalon
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice Santosh Shukla
` (2 subsequent siblings)
6 siblings, 1 reply; 91+ messages in thread
From: Santosh Shukla @ 2017-10-20 12:31 UTC (permalink / raw)
To: dev
Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal,
anatoly.burakov, Santosh Shukla
Renamed memory translational api to _iova types.
The following api renamed from:
rte_mempool_populate_phys()
rte_mempool_populate_phys_tab()
rte_eal_using_phys_addrs()
rte_mem_virt2phy()
rte_dump_physmem_layout()
rte_eal_get_physmem_layout()
rte_eal_get_physmem_size()
rte_malloc_virt2phy()
rte_mem_phy2mch()
To the following iova types api:
rte_mempool_populate_iova()
rte_mempool_populate_iova_tab()
rte_eal_using_iova_addrs()
rte_mem_virt2iova()
rte_dump_iovamem_layout()
rte_eal_get_iovamem_layout()
rte_eal_get_iovamem_size()
rte_malloc_virt2iova()
rte_mem_phy2iova()
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
app/proc_info/main.c | 2 +-
app/test-crypto-perf/cperf_test_vector_parsing.c | 4 ++--
app/test-crypto-perf/cperf_test_vectors.c | 6 +++---
app/test-pmd/cmdline.c | 2 +-
doc/guides/rel_notes/release_17_11.rst | 2 +-
drivers/bus/dpaa/base/qbman/qman.c | 2 +-
drivers/bus/dpaa/base/qbman/qman.h | 2 +-
drivers/bus/dpaa/rte_dpaa_bus.h | 2 +-
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 4 ++--
drivers/crypto/dpaa_sec/dpaa_sec.c | 4 ++--
drivers/crypto/qat/qat_qp.c | 2 +-
drivers/mempool/octeontx/octeontx_fpavf.c | 2 +-
drivers/net/ark/ark_ethdev_rx.c | 4 ++--
drivers/net/ark/ark_ethdev_tx.c | 4 ++--
drivers/net/bnxt/bnxt_ethdev.c | 8 ++++----
drivers/net/bnxt/bnxt_hwrm.c | 20 ++++++++++----------
drivers/net/bnxt/bnxt_ring.c | 4 ++--
drivers/net/bnxt/bnxt_vnic.c | 4 ++--
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/mlx4/mlx4_mr.c | 2 +-
drivers/net/mlx5/mlx5_mr.c | 2 +-
drivers/net/octeontx/base/octeontx_pkovf.c | 2 +-
drivers/net/sfc/sfc_tso.c | 2 +-
examples/l2fwd-crypto/main.c | 2 +-
lib/librte_cryptodev/rte_cryptodev.c | 2 +-
lib/librte_eal/bsdapp/eal/eal.c | 2 +-
lib/librte_eal/bsdapp/eal/eal_memory.c | 2 +-
lib/librte_eal/bsdapp/eal/rte_eal_version.map | 12 ++++++------
lib/librte_eal/common/eal_common_memory.c | 6 +++---
lib/librte_eal/common/eal_common_memzone.c | 4 ++--
lib/librte_eal/common/eal_private.h | 2 +-
lib/librte_eal/common/include/rte_malloc.h | 2 +-
lib/librte_eal/common/include/rte_memory.h | 8 ++++----
lib/librte_eal/common/rte_malloc.c | 2 +-
lib/librte_eal/linuxapp/eal/eal.c | 2 +-
lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
lib/librte_eal/linuxapp/eal/eal_pci.c | 4 ++--
lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 ++--
lib/librte_eal/linuxapp/eal/rte_eal_version.map | 12 ++++++------
lib/librte_mempool/rte_mempool.c | 20 ++++++++++----------
lib/librte_mempool/rte_mempool.h | 6 +++---
lib/librte_mempool/rte_mempool_version.map | 4 ++--
lib/librte_vhost/vhost_user.c | 4 ++--
test/test/commands.c | 2 +-
test/test/test_malloc.c | 4 ++--
test/test/test_memory.c | 6 +++---
test/test/test_mempool.c | 4 ++--
test/test/test_memzone.c | 10 +++++-----
49 files changed, 112 insertions(+), 112 deletions(-)
diff --git a/app/proc_info/main.c b/app/proc_info/main.c
index 64fbbd0f8..f30b1b29e 100644
--- a/app/proc_info/main.c
+++ b/app/proc_info/main.c
@@ -297,7 +297,7 @@ static void
meminfo_display(void)
{
printf("----------- MEMORY_SEGMENTS -----------\n");
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
printf("--------- END_MEMORY_SEGMENTS ---------\n");
printf("------------ MEMORY_ZONES -------------\n");
diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c
index 3952632c1..d4736f9ef 100644
--- a/app/test-crypto-perf/cperf_test_vector_parsing.c
+++ b/app/test-crypto-perf/cperf_test_vector_parsing.c
@@ -445,7 +445,7 @@ parse_entry(char *entry, struct cperf_test_vector *vector,
} else if (strstr(key_token, "aad")) {
rte_free(vector->aad.data);
vector->aad.data = data;
- vector->aad.phys_addr = rte_malloc_virt2phy(vector->aad.data);
+ vector->aad.phys_addr = rte_malloc_virt2iova(vector->aad.data);
if (tc_found)
vector->aad.length = data_length;
else {
@@ -460,7 +460,7 @@ parse_entry(char *entry, struct cperf_test_vector *vector,
} else if (strstr(key_token, "digest")) {
rte_free(vector->digest.data);
vector->digest.data = data;
- vector->digest.phys_addr = rte_malloc_virt2phy(
+ vector->digest.phys_addr = rte_malloc_virt2iova(
vector->digest.data);
if (tc_found)
vector->digest.length = data_length;
diff --git a/app/test-crypto-perf/cperf_test_vectors.c b/app/test-crypto-perf/cperf_test_vectors.c
index e51dcc3f1..fa911ff69 100644
--- a/app/test-crypto-perf/cperf_test_vectors.c
+++ b/app/test-crypto-perf/cperf_test_vectors.c
@@ -498,7 +498,7 @@ cperf_test_vector_get_dummy(struct cperf_options *options)
return NULL;
}
t_vec->digest.phys_addr =
- rte_malloc_virt2phy(t_vec->digest.data);
+ rte_malloc_virt2iova(t_vec->digest.data);
t_vec->digest.length = options->digest_sz;
memcpy(t_vec->digest.data, digest,
options->digest_sz);
@@ -531,7 +531,7 @@ cperf_test_vector_get_dummy(struct cperf_options *options)
return NULL;
}
memcpy(t_vec->aad.data, aad, options->aead_aad_sz);
- t_vec->aad.phys_addr = rte_malloc_virt2phy(t_vec->aad.data);
+ t_vec->aad.phys_addr = rte_malloc_virt2iova(t_vec->aad.data);
t_vec->aad.length = options->aead_aad_sz;
} else {
t_vec->aad.data = NULL;
@@ -546,7 +546,7 @@ cperf_test_vector_get_dummy(struct cperf_options *options)
return NULL;
}
t_vec->digest.phys_addr =
- rte_malloc_virt2phy(t_vec->digest.data);
+ rte_malloc_virt2iova(t_vec->digest.data);
t_vec->digest.length = options->digest_sz;
memcpy(t_vec->digest.data, digest, options->digest_sz);
t_vec->data.aead_offset = 0;
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index bb01e989a..8e5f90c73 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -8315,7 +8315,7 @@ static void cmd_dump_parsed(void *parsed_result,
struct cmd_dump_result *res = parsed_result;
if (!strcmp(res->dump, "dump_physmem"))
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
else if (!strcmp(res->dump, "dump_memzone"))
rte_memzone_dump(stdout);
else if (!strcmp(res->dump, "dump_struct_sizes"))
diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
index 8db35f5e4..6f3b92bc5 100644
--- a/doc/guides/rel_notes/release_17_11.rst
+++ b/doc/guides/rel_notes/release_17_11.rst
@@ -269,7 +269,7 @@ API Changes
* Xen dom0 in EAL was removed, as well as xenvirt PMD and vhost_xen.
-* ``rte_mem_phy2mch`` was used in Xen dom0 to obtain the physical address;
+* ``rte_mem_phy2iova`` was used in Xen dom0 to obtain the physical address;
remove this API as Xen dom0 support was removed.
* **Add return value to stats_get dev op API**
diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index 8c8d270f8..87fec60d1 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -1351,7 +1351,7 @@ int qman_init_fq(struct qman_fq *fq, u32 flags, struct qm_mcc_initfq *opts)
memset(&mcc->initfq.fqd.context_a, 0,
sizeof(mcc->initfq.fqd.context_a));
} else {
- phys_fq = rte_mem_virt2phy(fq);
+ phys_fq = rte_mem_virt2iova(fq);
qm_fqd_stashing_set64(&mcc->initfq.fqd, phys_fq);
}
}
diff --git a/drivers/bus/dpaa/base/qbman/qman.h b/drivers/bus/dpaa/base/qbman/qman.h
index 7c645f478..2c0f694cd 100644
--- a/drivers/bus/dpaa/base/qbman/qman.h
+++ b/drivers/bus/dpaa/base/qbman/qman.h
@@ -240,7 +240,7 @@ struct qm_portal {
#define EQCR_CARRYCLEAR(p) \
(void *)((unsigned long)(p) & (~(unsigned long)(QM_EQCR_SIZE << 6)))
-extern dma_addr_t rte_mem_virt2phy(const void *addr);
+extern dma_addr_t rte_mem_virt2iova(const void *addr);
/* Bit-wise logic to convert a ring pointer to a ring index */
static inline u8 EQCR_PTR2IDX(struct qm_eqcr_entry *e)
diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h
index dff13016d..1dd03847f 100644
--- a/drivers/bus/dpaa/rte_dpaa_bus.h
+++ b/drivers/bus/dpaa/rte_dpaa_bus.h
@@ -109,7 +109,7 @@ struct dpaa_portal {
/* TODO - this is costly, need to write a fast coversion routine */
static inline void *rte_dpaa_mem_ptov(iova_addr_t paddr)
{
- const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
+ const struct rte_memseg *memseg = rte_eal_get_iovamem_layout();
int i;
for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr != NULL; i++) {
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 7831201ad..4fbfd0f6b 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -234,7 +234,7 @@ int rte_fslmc_vfio_dmamap(void)
if (is_dma_done)
return 0;
- memseg = rte_eal_get_physmem_layout();
+ memseg = rte_eal_get_iovamem_layout();
if (memseg == NULL) {
FSLMC_VFIO_LOG(ERR, "Cannot get physical layout.");
return -ENODEV;
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 9524eb624..b4fd6496a 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -276,7 +276,7 @@ static void *dpaa2_mem_ptov(iova_addr_t paddr) __attribute__((unused));
/* todo - this is costly, need to write a fast coversion routine */
static void *dpaa2_mem_ptov(iova_addr_t paddr)
{
- const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
+ const struct rte_memseg *memseg = rte_eal_get_iovamem_layout();
int i;
for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
@@ -291,7 +291,7 @@ static void *dpaa2_mem_ptov(iova_addr_t paddr)
static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr) __attribute__((unused));
static iova_addr_t dpaa2_mem_vtop(uint64_t vaddr)
{
- const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
+ const struct rte_memseg *memseg = rte_eal_get_iovamem_layout();
int i;
for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 94b9f6700..fe3c46b10 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -113,7 +113,7 @@ dpaa_sec_alloc_ctx(dpaa_sec_session *ses)
static inline iova_addr_t
dpaa_mem_vtop(void *vaddr)
{
- const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
+ const struct rte_memseg *memseg = rte_eal_get_iovamem_layout();
uint64_t vaddr_64, paddr;
int i;
@@ -133,7 +133,7 @@ dpaa_mem_vtop(void *vaddr)
static inline void *
dpaa_mem_ptov(iova_addr_t paddr)
{
- const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
+ const struct rte_memseg *memseg = rte_eal_get_iovamem_layout();
int i;
for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
index 8bd60ffa7..d29ce44ff 100644
--- a/drivers/crypto/qat/qat_qp.c
+++ b/drivers/crypto/qat/qat_qp.c
@@ -106,7 +106,7 @@ queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size,
PMD_DRV_LOG(DEBUG, "Allocate memzone for %s, size %u on socket %u",
queue_name, queue_size, socket_id);
- ms = rte_eal_get_physmem_layout();
+ ms = rte_eal_get_iovamem_layout();
switch (ms[0].hugepage_sz) {
case(RTE_PGSIZE_2M):
memzone_flags = RTE_MEMZONE_2MB;
diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c
index 4947f2dd5..6bdfc0339 100644
--- a/drivers/mempool/octeontx/octeontx_fpavf.c
+++ b/drivers/mempool/octeontx/octeontx_fpavf.c
@@ -247,7 +247,7 @@ octeontx_fpapf_pool_setup(unsigned int gpool, unsigned int buf_size,
/* Configure stack */
fpa->pool_stack_base = memptr;
- phys_addr = rte_malloc_virt2phy(memptr);
+ phys_addr = rte_malloc_virt2iova(memptr);
buf_size /= FPA_LN_SIZE;
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 23918f6d3..915bf1e0e 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -99,11 +99,11 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
iova_addr_t phys_addr_q_base;
iova_addr_t phys_addr_prod_index;
- queue_base = rte_malloc_virt2phy(queue);
+ queue_base = rte_malloc_virt2iova(queue);
phys_addr_prod_index = queue_base +
offsetof(struct ark_rx_queue, prod_index);
- phys_addr_q_base = rte_malloc_virt2phy(queue->paddress_q);
+ phys_addr_q_base = rte_malloc_virt2iova(queue->paddress_q);
/* Verify HW */
if (ark_mpu_verify(queue->mpu, sizeof(iova_addr_t))) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 8c4b50ea7..4df4e3e1e 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -317,8 +317,8 @@ eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
if (ark_mpu_verify(queue->mpu, sizeof(struct ark_tx_meta)))
return -1;
- queue_base = rte_malloc_virt2phy(queue);
- ring_base = rte_malloc_virt2phy(queue->meta_q);
+ queue_base = rte_malloc_virt2iova(queue);
+ ring_base = rte_malloc_virt2iova(queue->meta_q);
cons_index_addr =
queue_base + offsetof(struct ark_tx_queue, cons_index);
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 845bb03d9..bdf5bbabd 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2829,8 +2829,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ "Using rte_mem_virt2iova()\n");
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map address to physical memory\n");
@@ -2864,8 +2864,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ "Using rte_mem_virt2iova()\n");
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map address to physical memory\n");
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 10898e19a..103856146 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -277,7 +277,7 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp,
if (!(mask & HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN))
mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY;
req.vlan_tag_tbl_addr = rte_cpu_to_le_64(
- rte_mem_virt2phy(vlan_table));
+ rte_mem_virt2iova(vlan_table));
req.num_vlan_tags = rte_cpu_to_le_32((uint32_t)vlan_count);
}
req.mask = rte_cpu_to_le_32(mask);
@@ -318,7 +318,7 @@ int bnxt_hwrm_cfa_vlan_antispoof_cfg(struct bnxt *bp, uint16_t fid,
req.fid = rte_cpu_to_le_16(fid);
req.vlan_tag_mask_tbl_addr =
- rte_cpu_to_le_64(rte_mem_virt2phy(vlan_table));
+ rte_cpu_to_le_64(rte_mem_virt2iova(vlan_table));
req.num_vlan_entries = rte_cpu_to_le_32((uint32_t)vlan_count);
rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
@@ -643,7 +643,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
}
rte_mem_lock_page(bp->hwrm_cmd_resp_addr);
bp->hwrm_cmd_resp_dma_addr =
- rte_mem_virt2phy(bp->hwrm_cmd_resp_addr);
+ rte_mem_virt2iova(bp->hwrm_cmd_resp_addr);
if (bp->hwrm_cmd_resp_dma_addr == 0) {
RTE_LOG(ERR, PMD,
"Unable to map response buffer to physical memory.\n");
@@ -669,7 +669,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
}
rte_mem_lock_page(bp->hwrm_short_cmd_req_addr);
bp->hwrm_short_cmd_req_dma_addr =
- rte_mem_virt2phy(bp->hwrm_short_cmd_req_addr);
+ rte_mem_virt2iova(bp->hwrm_short_cmd_req_addr);
if (bp->hwrm_short_cmd_req_dma_addr == 0) {
rte_free(bp->hwrm_short_cmd_req_addr);
RTE_LOG(ERR, PMD,
@@ -1752,7 +1752,7 @@ int bnxt_alloc_hwrm_resources(struct bnxt *bp)
if (bp->hwrm_cmd_resp_addr == NULL)
return -ENOMEM;
bp->hwrm_cmd_resp_dma_addr =
- rte_mem_virt2phy(bp->hwrm_cmd_resp_addr);
+ rte_mem_virt2iova(bp->hwrm_cmd_resp_addr);
if (bp->hwrm_cmd_resp_dma_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map response address to physical memory\n");
@@ -2621,7 +2621,7 @@ int bnxt_hwrm_func_buf_rgtr(struct bnxt *bp)
page_getenum(bp->pf.active_vfs * HWRM_MAX_REQ_LEN));
req.req_buf_len = rte_cpu_to_le_16(HWRM_MAX_REQ_LEN);
req.req_buf_page_addr[0] =
- rte_cpu_to_le_64(rte_mem_virt2phy(bp->pf.vf_req_buf));
+ rte_cpu_to_le_64(rte_mem_virt2iova(bp->pf.vf_req_buf));
if (req.req_buf_page_addr[0] == 0) {
RTE_LOG(ERR, PMD,
"unable to map buffer address to physical memory\n");
@@ -3043,7 +3043,7 @@ int bnxt_get_nvram_directory(struct bnxt *bp, uint32_t len, uint8_t *data)
rte_mem_lock_page(buf);
if (buf == NULL)
return -ENOMEM;
- dma_handle = rte_mem_virt2phy(buf);
+ dma_handle = rte_mem_virt2iova(buf);
if (dma_handle == 0) {
RTE_LOG(ERR, PMD,
"unable to map response address to physical memory\n");
@@ -3079,7 +3079,7 @@ int bnxt_hwrm_get_nvram_item(struct bnxt *bp, uint32_t index,
if (!buf)
return -ENOMEM;
- dma_handle = rte_mem_virt2phy(buf);
+ dma_handle = rte_mem_virt2iova(buf);
if (dma_handle == 0) {
RTE_LOG(ERR, PMD,
"unable to map response address to physical memory\n");
@@ -3140,7 +3140,7 @@ int bnxt_hwrm_flash_nvram(struct bnxt *bp, uint16_t dir_type,
if (!buf)
return -ENOMEM;
- dma_handle = rte_mem_virt2phy(buf);
+ dma_handle = rte_mem_virt2iova(buf);
if (dma_handle == 0) {
RTE_LOG(ERR, PMD,
"unable to map response address to physical memory\n");
@@ -3195,7 +3195,7 @@ static int bnxt_hwrm_func_vf_vnic_query(struct bnxt *bp, uint16_t vf,
req.vf_id = rte_cpu_to_le_16(bp->pf.first_vf_id + vf);
req.max_vnic_id_cnt = rte_cpu_to_le_32(bp->pf.total_vnics);
- req.vnic_id_tbl_addr = rte_cpu_to_le_64(rte_mem_virt2phy(vnic_ids));
+ req.vnic_id_tbl_addr = rte_cpu_to_le_64(rte_mem_virt2iova(vnic_ids));
if (req.vnic_id_tbl_addr == 0) {
HWRM_UNLOCK();
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 8e83e4704..1e6db4495 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -177,10 +177,10 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
+ "Using rte_mem_virt2iova()\n");
for (sz = 0; sz < total_alloc_len; sz += getpagesize())
rte_mem_lock_page(((char *)mz->addr) + sz);
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map ring address to physical memory\n");
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 76c9a35d7..2e4f0e5e8 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -197,8 +197,8 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ "Using rte_mem_virt2iova()\n");
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map vnic address to physical memory\n");
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 5156ac08d..67179eaf5 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -1790,7 +1790,7 @@ lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
m = m->next;
}
- phyaddr = rte_mem_virt2phy(g->sg);
+ phyaddr = rte_mem_virt2iova(g->sg);
if (phyaddr == RTE_BAD_PHYS_ADDR) {
PMD_TX_LOG(lio_dev, ERR, "bad phys addr\n");
goto xmit_failed;
diff --git a/drivers/net/mlx4/mlx4_mr.c b/drivers/net/mlx4/mlx4_mr.c
index 9700884b4..120e1f352 100644
--- a/drivers/net/mlx4/mlx4_mr.c
+++ b/drivers/net/mlx4/mlx4_mr.c
@@ -144,7 +144,7 @@ mlx4_check_mempool(struct rte_mempool *mp, uintptr_t *start, uintptr_t *end)
struct ibv_mr *
mlx4_mp2mr(struct ibv_pd *pd, struct rte_mempool *mp)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
uintptr_t start;
uintptr_t end;
unsigned int i;
diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c
index 6b29eed55..d4e4af568 100644
--- a/drivers/net/mlx5/mlx5_mr.c
+++ b/drivers/net/mlx5/mlx5_mr.c
@@ -272,7 +272,7 @@ mlx5_mp2mr_iter(struct rte_mempool *mp, void *arg)
struct mlx5_mr*
priv_mr_new(struct priv *priv, struct rte_mempool *mp)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
uintptr_t start;
uintptr_t end;
unsigned int i;
diff --git a/drivers/net/octeontx/base/octeontx_pkovf.c b/drivers/net/octeontx/base/octeontx_pkovf.c
index 5fefdffe3..06f9b5969 100644
--- a/drivers/net/octeontx/base/octeontx_pkovf.c
+++ b/drivers/net/octeontx/base/octeontx_pkovf.c
@@ -485,7 +485,7 @@ octeontx_pko_init_fc(const size_t pko_vf_count)
return -ENOMEM;
}
- pko_vf_ctl.fc_iomem.iova = rte_malloc_virt2phy((void *)
+ pko_vf_ctl.fc_iomem.iova = rte_malloc_virt2iova((void *)
pko_vf_ctl.fc_iomem.va);
pko_vf_ctl.fc_iomem.size = fc_mem_size;
diff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c
index fb79d7491..ad100676e 100644
--- a/drivers/net/sfc/sfc_tso.c
+++ b/drivers/net/sfc/sfc_tso.c
@@ -155,7 +155,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
header_len);
tsoh = txq->sw_ring[idx & txq->ptr_mask].tsoh;
- header_paddr = rte_malloc_virt2phy((void *)tsoh);
+ header_paddr = rte_malloc_virt2iova((void *)tsoh);
} else {
if (m->data_len == header_len) {
*in_off = 0;
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 96e5ed77f..a51ba45e0 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2484,7 +2484,7 @@ reserve_key_memory(struct l2fwd_crypto_options *options)
options->aad.data = rte_malloc("aad", MAX_KEY_SIZE, 0);
if (options->aad.data == NULL)
rte_exit(EXIT_FAILURE, "Failed to allocate memory for AAD");
- options->aad.phys_addr = rte_malloc_virt2phy(options->aad.data);
+ options->aad.phys_addr = rte_malloc_virt2iova(options->aad.data);
}
int
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index e48d562b4..a54a0b343 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -1271,7 +1271,7 @@ rte_crypto_op_init(struct rte_mempool *mempool,
__rte_crypto_op_reset(op, type);
- op->phys_addr = rte_mem_virt2phy(_op_data);
+ op->phys_addr = rte_mem_virt2iova(_op_data);
op->mempool = mempool;
}
diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index e981721aa..eea7cfe62 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -457,7 +457,7 @@ eal_check_mem_on_local_socket(void)
socket_id = rte_lcore_to_socket_id(rte_config.master_lcore);
- ms = rte_eal_get_physmem_layout();
+ ms = rte_eal_get_iovamem_layout();
for (i = 0; i < RTE_MAX_MEMSEG; i++)
if (ms[i].socket_id == socket_id &&
diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index d8882dcef..839befe59 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -51,7 +51,7 @@
* Get physical address of any mapped virtual address in the current process.
*/
iova_addr_t
-rte_mem_virt2phy(const void *virtaddr)
+rte_mem_virt2iova(const void *virtaddr)
{
/* XXX not implemented. This function is only used by
* rte_mempool_virt2phy() when hugepages are disabled. */
diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
index 080896f73..b7f2d72b9 100644
--- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map
+++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
@@ -14,7 +14,7 @@ DPDK_2.0 {
rte_cpu_get_flag_enabled;
rte_cycles_vmware_tsc_map;
rte_delay_us;
- rte_dump_physmem_layout;
+ rte_dump_iovamem_layout;
rte_dump_registers;
rte_dump_stack;
rte_dump_tailq;
@@ -25,8 +25,8 @@ DPDK_2.0 {
rte_eal_devargs_type_count;
rte_eal_get_configuration;
rte_eal_get_lcore_state;
- rte_eal_get_physmem_layout;
- rte_eal_get_physmem_size;
+ rte_eal_get_iovamem_layout;
+ rte_eal_get_iovamem_size;
rte_eal_has_hugepages;
rte_eal_hpet_init;
rte_eal_init;
@@ -62,10 +62,10 @@ DPDK_2.0 {
rte_malloc_set_limit;
rte_malloc_socket;
rte_malloc_validate;
- rte_malloc_virt2phy;
+ rte_malloc_virt2iova;
rte_mem_lock_page;
- rte_mem_phy2mch;
- rte_mem_virt2phy;
+ rte_mem_phy2iova;
+ rte_mem_virt2iova;
rte_memdump;
rte_memory_get_nchannel;
rte_memory_get_nrank;
diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 5ed83d20a..44bc072bf 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -55,7 +55,7 @@
* memory. The last element of the table contains a NULL address.
*/
const struct rte_memseg *
-rte_eal_get_physmem_layout(void)
+rte_eal_get_iovamem_layout(void)
{
return rte_eal_get_configuration()->mem_config->memseg;
}
@@ -63,7 +63,7 @@ rte_eal_get_physmem_layout(void)
/* get the total size of memory */
uint64_t
-rte_eal_get_physmem_size(void)
+rte_eal_get_iovamem_size(void)
{
const struct rte_mem_config *mcfg;
unsigned i = 0;
@@ -84,7 +84,7 @@ rte_eal_get_physmem_size(void)
/* Dump the physical memory layout on console */
void
-rte_dump_physmem_layout(FILE *f)
+rte_dump_iovamem_layout(FILE *f)
{
const struct rte_mem_config *mcfg;
unsigned i = 0;
diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c
index 3026e36b8..86457eaf0 100644
--- a/lib/librte_eal/common/eal_common_memzone.c
+++ b/lib/librte_eal/common/eal_common_memzone.c
@@ -251,7 +251,7 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,
mcfg->memzone_cnt++;
snprintf(mz->name, sizeof(mz->name), "%s", name);
- mz->phys_addr = rte_malloc_virt2phy(mz_addr);
+ mz->phys_addr = rte_malloc_virt2iova(mz_addr);
mz->addr = mz_addr;
mz->len = (requested_len == 0 ? elem->size : requested_len);
mz->hugepage_sz = elem->ms->hugepage_sz;
@@ -419,7 +419,7 @@ rte_eal_memzone_init(void)
if (rte_eal_process_type() == RTE_PROC_SECONDARY)
return 0;
- memseg = rte_eal_get_physmem_layout();
+ memseg = rte_eal_get_iovamem_layout();
if (memseg == NULL) {
RTE_LOG(ERR, EAL, "%s(): Cannot get physical layout\n", __func__);
return -1;
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index 6e0f85def..a5a27563d 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -352,7 +352,7 @@ int rte_eal_hugepage_attach(void);
* addresses are obtainable. It is only possible to get
* physical addresses when running as a privileged user.
*/
-bool rte_eal_using_phys_addrs(void);
+bool rte_eal_using_iova_addrs(void);
/**
* Find a bus capable of identifying a device.
diff --git a/lib/librte_eal/common/include/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h
index 491b479b1..b1a214c9d 100644
--- a/lib/librte_eal/common/include/rte_malloc.h
+++ b/lib/librte_eal/common/include/rte_malloc.h
@@ -333,7 +333,7 @@ rte_malloc_set_limit(const char *type, size_t max);
* otherwise return physical address of the buffer
*/
iova_addr_t
-rte_malloc_virt2phy(const void *addr);
+rte_malloc_virt2iova(const void *addr);
#ifdef __cplusplus
}
diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index 93e7a819f..173f141fc 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -134,7 +134,7 @@ int rte_mem_lock_page(const void *virt);
* @return
* The physical address or RTE_BAD_PHYS_ADDR on error.
*/
-iova_addr_t rte_mem_virt2phy(const void *virt);
+iova_addr_t rte_mem_virt2iova(const void *virt);
/**
* Get the layout of the available physical memory.
@@ -151,7 +151,7 @@ iova_addr_t rte_mem_virt2phy(const void *virt);
* - On error, return NULL. This should not happen since it is a fatal
* error that will probably cause the entire system to panic.
*/
-const struct rte_memseg *rte_eal_get_physmem_layout(void);
+const struct rte_memseg *rte_eal_get_iovamem_layout(void);
/**
* Dump the physical memory layout to a file.
@@ -159,7 +159,7 @@ const struct rte_memseg *rte_eal_get_physmem_layout(void);
* @param f
* A pointer to a file for output
*/
-void rte_dump_physmem_layout(FILE *f);
+void rte_dump_iovamem_layout(FILE *f);
/**
* Get the total amount of available physical memory.
@@ -167,7 +167,7 @@ void rte_dump_physmem_layout(FILE *f);
* @return
* The total amount of available physical memory in bytes.
*/
-uint64_t rte_eal_get_physmem_size(void);
+uint64_t rte_eal_get_iovamem_size(void);
/**
* Get the number of memory channels.
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index 506d7a415..f8473832a 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -249,7 +249,7 @@ rte_malloc_set_limit(__rte_unused const char *type,
* Return the physical address of a virtual address obtained through rte_malloc
*/
iova_addr_t
-rte_malloc_virt2phy(const void *addr)
+rte_malloc_virt2iova(const void *addr)
{
iova_addr_t paddr;
const struct malloc_elem *elem = malloc_elem_from_data(addr);
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index ad7278989..353e582d0 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -665,7 +665,7 @@ eal_check_mem_on_local_socket(void)
socket_id = rte_lcore_to_socket_id(rte_config.master_lcore);
- ms = rte_eal_get_physmem_layout();
+ ms = rte_eal_get_iovamem_layout();
for (i = 0; i < RTE_MAX_MEMSEG; i++)
if (ms[i].socket_id == socket_id &&
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 603164d77..016365958 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -106,7 +106,7 @@ test_phys_addrs_available(void)
return;
}
- physaddr = rte_mem_virt2phy(&tmp);
+ physaddr = rte_mem_virt2iova(&tmp);
if (physaddr == RTE_BAD_PHYS_ADDR) {
RTE_LOG(ERR, EAL,
"Cannot obtain physical addresses: %s. "
@@ -120,7 +120,7 @@ test_phys_addrs_available(void)
* Get physical address of any mapped virtual address in the current process.
*/
iova_addr_t
-rte_mem_virt2phy(const void *virtaddr)
+rte_mem_virt2iova(const void *virtaddr)
{
int fd, retval;
uint64_t page, physaddr;
@@ -191,7 +191,7 @@ find_physaddrs(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
iova_addr_t addr;
for (i = 0; i < hpi->num_pages[0]; i++) {
- addr = rte_mem_virt2phy(hugepg_tbl[i].orig_va);
+ addr = rte_mem_virt2iova(hugepg_tbl[i].orig_va);
if (addr == RTE_BAD_PHYS_ADDR)
return -1;
hugepg_tbl[i].physaddr = addr;
@@ -1495,7 +1495,7 @@ rte_eal_hugepage_attach(void)
}
bool
-rte_eal_using_phys_addrs(void)
+rte_eal_using_iova_addrs(void)
{
return phys_addrs_available;
}
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index b4dbf953a..8e8ed6d3b 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -103,7 +103,7 @@ rte_pci_map_device(struct rte_pci_device *dev)
break;
case RTE_KDRV_IGB_UIO:
case RTE_KDRV_UIO_GENERIC:
- if (rte_eal_using_phys_addrs()) {
+ if (rte_eal_using_iova_addrs()) {
/* map resources for devices that use uio */
ret = pci_uio_map_resource(dev);
}
@@ -145,7 +145,7 @@ rte_pci_unmap_device(struct rte_pci_device *dev)
void *
pci_find_max_end_va(void)
{
- const struct rte_memseg *seg = rte_eal_get_physmem_layout();
+ const struct rte_memseg *seg = rte_eal_get_iovamem_layout();
const struct rte_memseg *last = seg;
unsigned i = 0;
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 32b090325..9f50b13f2 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -692,7 +692,7 @@ vfio_get_group_no(const char *sysfs_base,
static int
vfio_type1_dma_map(int vfio_container_fd)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
int i, ret;
/* map all DPDK segments for DMA. use 1:1 PA to IOVA mapping */
@@ -728,7 +728,7 @@ vfio_type1_dma_map(int vfio_container_fd)
static int
vfio_spapr_dma_map(int vfio_container_fd)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
int i, ret;
struct vfio_iommu_spapr_register_memory reg = {
diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
index c173ccfdb..93429d2ec 100644
--- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map
+++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
@@ -14,7 +14,7 @@ DPDK_2.0 {
rte_cpu_get_flag_enabled;
rte_cycles_vmware_tsc_map;
rte_delay_us;
- rte_dump_physmem_layout;
+ rte_dump_iovamem_layout;
rte_dump_registers;
rte_dump_stack;
rte_dump_tailq;
@@ -25,8 +25,8 @@ DPDK_2.0 {
rte_eal_devargs_type_count;
rte_eal_get_configuration;
rte_eal_get_lcore_state;
- rte_eal_get_physmem_layout;
- rte_eal_get_physmem_size;
+ rte_eal_get_iovamem_layout;
+ rte_eal_get_iovamem_size;
rte_eal_has_hugepages;
rte_eal_hpet_init;
rte_eal_init;
@@ -62,10 +62,10 @@ DPDK_2.0 {
rte_malloc_set_limit;
rte_malloc_socket;
rte_malloc_validate;
- rte_malloc_virt2phy;
+ rte_malloc_virt2iova;
rte_mem_lock_page;
- rte_mem_phy2mch;
- rte_mem_virt2phy;
+ rte_mem_phy2iova;
+ rte_mem_virt2iova;
rte_memdump;
rte_memory_get_nchannel;
rte_memory_get_nrank;
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index a9b64fffe..f45377f7e 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -357,7 +357,7 @@ rte_mempool_free_memchunks(struct rte_mempool *mp)
* on error.
*/
int
-rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
+rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,
iova_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque)
{
@@ -439,7 +439,7 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
* number of objects added, or a negative value on error.
*/
int
-rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
+rte_mempool_populate_iova_tab(struct rte_mempool *mp, char *vaddr,
const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque)
{
@@ -452,7 +452,7 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
return -EEXIST;
if (mp->flags & MEMPOOL_F_NO_PHYS_CONTIG)
- return rte_mempool_populate_phys(mp, vaddr, RTE_BAD_PHYS_ADDR,
+ return rte_mempool_populate_iova(mp, vaddr, RTE_BAD_PHYS_ADDR,
pg_num * pg_sz, free_cb, opaque);
for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {
@@ -462,7 +462,7 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
paddr[i + n - 1] + pg_sz == paddr[i + n]; n++)
;
- ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,
+ ret = rte_mempool_populate_iova(mp, vaddr + i * pg_sz,
paddr[i], n * pg_sz, free_cb, opaque);
if (ret < 0) {
rte_mempool_free_memchunks(mp);
@@ -497,13 +497,13 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
return -EINVAL;
if (mp->flags & MEMPOOL_F_NO_PHYS_CONTIG)
- return rte_mempool_populate_phys(mp, addr, RTE_BAD_PHYS_ADDR,
+ return rte_mempool_populate_iova(mp, addr, RTE_BAD_PHYS_ADDR,
len, free_cb, opaque);
for (off = 0; off + pg_sz <= len &&
mp->populated_size < mp->size; off += phys_len) {
- paddr = rte_mem_virt2phy(addr + off);
+ paddr = rte_mem_virt2iova(addr + off);
if (paddr == RTE_BAD_PHYS_ADDR && rte_eal_has_hugepages()) {
ret = -EINVAL;
@@ -514,13 +514,13 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
for (phys_len = pg_sz; off + phys_len < len; phys_len += pg_sz) {
iova_addr_t paddr_tmp;
- paddr_tmp = rte_mem_virt2phy(addr + off + phys_len);
+ paddr_tmp = rte_mem_virt2iova(addr + off + phys_len);
if (paddr_tmp != paddr + phys_len)
break;
}
- ret = rte_mempool_populate_phys(mp, addr + off, paddr,
+ ret = rte_mempool_populate_iova(mp, addr + off, paddr,
phys_len, free_cb, opaque);
if (ret < 0)
goto fail;
@@ -604,7 +604,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)
paddr = mz->phys_addr;
if (rte_eal_has_hugepages())
- ret = rte_mempool_populate_phys(mp, mz->addr,
+ ret = rte_mempool_populate_iova(mp, mz->addr,
paddr, mz->len,
rte_mempool_memchunk_mz_free,
(void *)(uintptr_t)mz);
@@ -990,7 +990,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
if (mp_init)
mp_init(mp, mp_init_arg);
- ret = rte_mempool_populate_phys_tab(mp, vaddr, paddr, pg_num, pg_shift,
+ ret = rte_mempool_populate_iova_tab(mp, vaddr, paddr, pg_num, pg_shift,
NULL, NULL);
if (ret < 0 || ret != (int)mp->size)
goto fail;
diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index 3139be4f5..de2be4af0 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -577,7 +577,7 @@ rte_mempool_ops_get_capabilities(const struct rte_mempool *mp,
* @return
* - 0: Success;
* - -ENOTSUP - doesn't support register_memory_area ops (valid error case).
- * - Otherwise, rte_mempool_populate_phys fails thus pool create fails.
+ * - Otherwise, rte_mempool_populate_iova fails thus pool create fails.
*/
int
rte_mempool_ops_register_memory_area(const struct rte_mempool *mp,
@@ -894,7 +894,7 @@ rte_mempool_free(struct rte_mempool *mp);
* On error, the chunk is not added in the memory list of the
* mempool and a negative errno is returned.
*/
-int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
+int rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,
iova_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque);
@@ -925,7 +925,7 @@ int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
* On error, the chunks are not added in the memory list of the
* mempool and a negative errno is returned.
*/
-int rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
+int rte_mempool_populate_iova_tab(struct rte_mempool *mp, char *vaddr,
const iova_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque);
diff --git a/lib/librte_mempool/rte_mempool_version.map b/lib/librte_mempool/rte_mempool_version.map
index ff86dc9a7..c0cfee71e 100644
--- a/lib/librte_mempool/rte_mempool_version.map
+++ b/lib/librte_mempool/rte_mempool_version.map
@@ -34,8 +34,8 @@ DPDK_16.07 {
rte_mempool_ops_table;
rte_mempool_populate_anon;
rte_mempool_populate_default;
- rte_mempool_populate_phys;
- rte_mempool_populate_phys_tab;
+ rte_mempool_populate_iova;
+ rte_mempool_populate_iova_tab;
rte_mempool_populate_virt;
rte_mempool_register_ops;
rte_mempool_set_ops_byname;
diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 76c4eeca5..7702622c2 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -516,7 +516,7 @@ add_guest_pages(struct virtio_net *dev, struct rte_vhost_mem_region *reg,
uint64_t host_phys_addr;
uint64_t size;
- host_phys_addr = rte_mem_virt2phy((void *)(uintptr_t)host_user_addr);
+ host_phys_addr = rte_mem_virt2iova((void *)(uintptr_t)host_user_addr);
size = page_size - (guest_phys_addr & (page_size - 1));
size = RTE_MIN(size, reg_size);
@@ -527,7 +527,7 @@ add_guest_pages(struct virtio_net *dev, struct rte_vhost_mem_region *reg,
while (reg_size > 0) {
size = RTE_MIN(reg_size, page_size);
- host_phys_addr = rte_mem_virt2phy((void *)(uintptr_t)
+ host_phys_addr = rte_mem_virt2iova((void *)(uintptr_t)
host_user_addr);
add_one_guest_page(dev, guest_phys_addr, host_phys_addr, size);
diff --git a/test/test/commands.c b/test/test/commands.c
index 4097a3310..9f5028d41 100644
--- a/test/test/commands.c
+++ b/test/test/commands.c
@@ -147,7 +147,7 @@ static void cmd_dump_parsed(void *parsed_result,
struct cmd_dump_result *res = parsed_result;
if (!strcmp(res->dump, "dump_physmem"))
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
else if (!strcmp(res->dump, "dump_memzone"))
rte_memzone_dump(stdout);
else if (!strcmp(res->dump, "dump_struct_sizes"))
diff --git a/test/test/test_malloc.c b/test/test/test_malloc.c
index cee6469d8..7146e7a95 100644
--- a/test/test/test_malloc.c
+++ b/test/test/test_malloc.c
@@ -739,7 +739,7 @@ test_malloc_bad_params(void)
static int
is_mem_on_socket(int32_t socket)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
unsigned i;
for (i = 0; i < RTE_MAX_MEMSEG; i++) {
@@ -756,7 +756,7 @@ is_mem_on_socket(int32_t socket)
static int32_t
addr_to_socket(void * addr)
{
- const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+ const struct rte_memseg *ms = rte_eal_get_iovamem_layout();
unsigned i;
for (i = 0; i < RTE_MAX_MEMSEG; i++) {
diff --git a/test/test/test_memory.c b/test/test/test_memory.c
index 921bdc883..9ab0f52fd 100644
--- a/test/test/test_memory.c
+++ b/test/test/test_memory.c
@@ -64,17 +64,17 @@ test_memory(void)
* that at least one line is dumped
*/
printf("Dump memory layout\n");
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
/* check that memory size is != 0 */
- s = rte_eal_get_physmem_size();
+ s = rte_eal_get_iovamem_size();
if (s == 0) {
printf("No memory detected\n");
return -1;
}
/* try to read memory (should not segfault) */
- mem = rte_eal_get_physmem_layout();
+ mem = rte_eal_get_iovamem_layout();
for (i = 0; i < RTE_MAX_MEMSEG && mem[i].addr != NULL ; i++) {
/* check memory */
diff --git a/test/test/test_mempool.c b/test/test/test_mempool.c
index a225e1209..9b8d2697b 100644
--- a/test/test/test_mempool.c
+++ b/test/test/test_mempool.c
@@ -145,9 +145,9 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache)
MEMPOOL_HEADER_SIZE(mp, mp->cache_size))
GOTO_ERR(ret, out);
-#ifndef RTE_EXEC_ENV_BSDAPP /* rte_mem_virt2phy() not supported on bsd */
+#ifndef RTE_EXEC_ENV_BSDAPP /* rte_mem_virt2iova() not supported on bsd */
printf("get physical address of an object\n");
- if (rte_mempool_virt2phy(mp, obj) != rte_mem_virt2phy(obj))
+ if (rte_mempool_virt2phy(mp, obj) != rte_mem_virt2iova(obj))
GOTO_ERR(ret, out);
#endif
diff --git a/test/test/test_memzone.c b/test/test/test_memzone.c
index 0afb159e9..177bcb73e 100644
--- a/test/test/test_memzone.c
+++ b/test/test/test_memzone.c
@@ -139,7 +139,7 @@ test_memzone_reserve_flags(void)
int hugepage_16GB_avail = 0;
const size_t size = 100;
int i = 0;
- ms = rte_eal_get_physmem_layout();
+ ms = rte_eal_get_iovamem_layout();
for (i = 0; i < RTE_MAX_MEMSEG; i++) {
if (ms[i].hugepage_sz == RTE_PGSIZE_2M)
hugepage_2MB_avail = 1;
@@ -422,7 +422,7 @@ test_memzone_reserve_max(void)
if (mz == NULL){
printf("Failed to reserve a big chunk of memory - %s\n",
rte_strerror(rte_errno));
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
rte_memzone_dump(stdout);
return -1;
}
@@ -430,7 +430,7 @@ test_memzone_reserve_max(void)
if (mz->len != maxlen) {
printf("Memzone reserve with 0 size did not return bigest block\n");
printf("Expected size = %zu, actual size = %zu\n", maxlen, mz->len);
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
rte_memzone_dump(stdout);
return -1;
}
@@ -459,7 +459,7 @@ test_memzone_reserve_max_aligned(void)
if (mz == NULL){
printf("Failed to reserve a big chunk of memory - %s\n",
rte_strerror(rte_errno));
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
rte_memzone_dump(stdout);
return -1;
}
@@ -469,7 +469,7 @@ test_memzone_reserve_max_aligned(void)
" bigest block\n", align);
printf("Expected size = %zu, actual size = %zu\n",
maxlen, mz->len);
- rte_dump_physmem_layout(stdout);
+ rte_dump_iovamem_layout(stdout);
rte_memzone_dump(stdout);
return -1;
}
--
2.14.1
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 0/6] " Santosh Shukla
` (3 preceding siblings ...)
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 4/6] eal/memory: rename memory API to iova types Santosh Shukla
@ 2017-10-20 12:31 ` Santosh Shukla
2017-10-23 20:29 ` Thomas Monjalon
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 6/6] eal/common/rte_malloc: use pointer diff in virt2iova Santosh Shukla
2017-10-23 14:58 ` [dpdk-dev] [PATCH v3 0/6] make dpdk iova aware Thomas Monjalon
6 siblings, 1 reply; 91+ messages in thread
From: Santosh Shukla @ 2017-10-20 12:31 UTC (permalink / raw)
To: dev
Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal,
anatoly.burakov, Santosh Shukla
Removed dpdk iova aware ABI deprecation notice,
and updated ABI change details in release_17.11.rst.
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
---
doc/guides/rel_notes/deprecation.rst | 7 -------
doc/guides/rel_notes/release_17_11.rst | 28 ++++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 7 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 52058f580..d89d35320 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -29,13 +29,6 @@ Deprecation Notices
- ``rte_eal_devargs_type_count``
- ``rte_eal_parse_devargs_str``, replaced by ``rte_eal_devargs_parse``
-* eal: An ABI change is planned for 17.11 to make DPDK aware of IOVA address
- translation scheme.
- Reference to phys address in EAL data-structure or functions may change to
- IOVA address or more appropriate name.
- The change will be only for the name.
- Functional aspects of the API or data-structure will remain same.
-
* The mbuf flags PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated and
are respectively replaced by PKT_RX_VLAN_STRIPPED and
PKT_RX_QINQ_STRIPPED, that are better described. The old flags and
diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
index 6f3b92bc5..5287e96c3 100644
--- a/doc/guides/rel_notes/release_17_11.rst
+++ b/doc/guides/rel_notes/release_17_11.rst
@@ -302,6 +302,34 @@ ABI Changes
The size of the field ``port_id`` in the ``rte_eth_dev_data`` structure
changed, as described in the `New Features` section.
+* **Following datatypes, structure member and function renamed to iova type.**
+
+ * Renamed ``phys_addr_t`` to ``iova_addr_t``.
+ * Renamed ``buf_physaddr`` to ``buf_iovaaddr`` for struct rte_mbuf.
+ * Renamed ``phys_addr`` to ``iova_addr`` for struct rte_memseg.
+ * The Following memory translation api renamed from:
+
+ * ``rte_mempool_populate_phys()``
+ * ``rte_mempool_populate_phys_tab()``
+ * ``rte_eal_using_phys_addrs()``
+ * ``rte_mem_virt2phy()``
+ * ``rte_dump_physmem_layout()``
+ * ``rte_eal_get_physmem_layout()``
+ * ``rte_eal_get_physmem_size()``
+ * ``rte_malloc_virt2phy()``
+ * ``rte_mem_phy2mch()``
+
+ * To the following iova types api:
+
+ * ``rte_mempool_populate_iova()``
+ * ``rte_mempool_populate_iova_tab()``
+ * ``rte_eal_using_iova_addrs()``
+ * ``rte_mem_virt2iova()``
+ * ``rte_dump_iovamem_layout()``
+ * ``rte_eal_get_iovamem_layout()``
+ * ``rte_eal_get_iovamem_size()``
+ * ``rte_malloc_virt2iova()``
+ * ``rte_mem_phy2iova()``
Removed Items
-------------
--
2.14.1
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v3 6/6] eal/common/rte_malloc: use pointer diff in virt2iova
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 0/6] " Santosh Shukla
` (4 preceding siblings ...)
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice Santosh Shukla
@ 2017-10-20 12:31 ` Santosh Shukla
2017-10-23 14:58 ` [dpdk-dev] [PATCH v3 0/6] make dpdk iova aware Thomas Monjalon
6 siblings, 0 replies; 91+ messages in thread
From: Santosh Shukla @ 2017-10-20 12:31 UTC (permalink / raw)
To: dev
Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal,
anatoly.burakov, Santosh Shukla
Use RTE_PTR_DIFF macro in rte_mem_virt2iova api.
Suggested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
lib/librte_eal/common/rte_malloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index f8473832a..aa3bd5687 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -262,6 +262,6 @@ rte_malloc_virt2iova(const void *addr)
paddr = (uintptr_t)addr;
else
paddr = elem->ms->iova_addr +
- ((uintptr_t)addr - (uintptr_t)elem->ms->addr);
+ RTE_PTR_DIFF(addr, elem->ms->addr);
return paddr;
}
--
2.14.1
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/6] make dpdk iova aware
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 0/6] " Santosh Shukla
` (5 preceding siblings ...)
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 6/6] eal/common/rte_malloc: use pointer diff in virt2iova Santosh Shukla
@ 2017-10-23 14:58 ` Thomas Monjalon
2017-10-24 5:12 ` santosh
6 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-10-23 14:58 UTC (permalink / raw)
To: Santosh Shukla
Cc: dev, olivier.matz, jerin.jacob, hemant.agrawal, anatoly.burakov
20/10/2017 14:31, Santosh Shukla:
> v3:
> Include v2 review comment and rebased on
> top of upstream tip commit:6b9ed026a8704
>
>
> v2:
> Include build fixes reported in patchworks.
Please fix checkpatch issues, thanks
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/6] eal/memory: rename buf physaddr to buf iovaaddr
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 2/6] eal/memory: rename buf physaddr to buf iovaaddr Santosh Shukla
@ 2017-10-23 20:15 ` Thomas Monjalon
2017-10-25 9:55 ` Olivier MATZ
2017-10-23 20:34 ` Thomas Monjalon
2017-10-25 9:44 ` Olivier MATZ
2 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-10-23 20:15 UTC (permalink / raw)
To: Santosh Shukla
Cc: dev, olivier.matz, jerin.jacob, hemant.agrawal, anatoly.burakov
20/10/2017 14:31, Santosh Shukla:
> Rename buf_physaddr to buf_iovaaddr
>
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
[...]
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -411,7 +411,7 @@ struct rte_mbuf {
> * same mbuf cacheline0 layout for 32-bit and 64-bit. This makes
> * working on vector drivers easier.
> */
> - iova_addr_t buf_physaddr __rte_aligned(sizeof(iova_addr_t));
> + iova_addr_t buf_iovaaddr __rte_aligned(sizeof(iova_addr_t));
I really do not understand this naming scheme.
The "A" of IOVA means Address. So "addr" in iovaaddr is redundant.
It seems that IOVA is a too much famous acronym to avoid it.
Unfortunately, there is no justification in the commit message.
For the record, my preference was "IO address".
We could at least add an underscore in iova_addr.
But I will apply it as is because nobody else complained.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice Santosh Shukla
@ 2017-10-23 20:29 ` Thomas Monjalon
2017-10-24 5:06 ` santosh
0 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-10-23 20:29 UTC (permalink / raw)
To: Santosh Shukla
Cc: dev, olivier.matz, jerin.jacob, hemant.agrawal, anatoly.burakov
20/10/2017 14:31, Santosh Shukla:
> Removed dpdk iova aware ABI deprecation notice,
> and updated ABI change details in release_17.11.rst.
>
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> Acked-by: John McNamara <john.mcnamara@intel.com>
> ---
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> -* eal: An ABI change is planned for 17.11 to make DPDK aware of IOVA address
> - translation scheme.
> - Reference to phys address in EAL data-structure or functions may change to
> - IOVA address or more appropriate name.
> - The change will be only for the name.
> - Functional aspects of the API or data-structure will remain same.
Sorry, this series cannot be applied as is because it is breaking
more than EAL API. The API of mbuf and mempool are also changed.
We need to choose one of these three options:
1/ accept to break all API in 17.11
2/ postpone the whole series to 18.02
3/ rename only EAL API in 17.11 and postpone mbuf/mempool
One more comment:
For such a large change, we should provide a script in devtools
to help porting the applications. I suggest a sed script.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/6] eal: rename phys addr to iova addr
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 1/6] eal: rename phys addr to iova addr Santosh Shukla
@ 2017-10-23 20:32 ` Thomas Monjalon
2017-10-24 5:16 ` santosh
0 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-10-23 20:32 UTC (permalink / raw)
To: dev
Cc: Santosh Shukla, olivier.matz, jerin.jacob, hemant.agrawal,
anatoly.burakov
20/10/2017 14:31, Santosh Shukla:
> Renamed data type from phys_addr_t to iova_addr_t.
>
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Suggested title:
mem: rename physical to IOVA address type
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/6] eal/memory: rename buf physaddr to buf iovaaddr
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 2/6] eal/memory: rename buf physaddr to buf iovaaddr Santosh Shukla
2017-10-23 20:15 ` Thomas Monjalon
@ 2017-10-23 20:34 ` Thomas Monjalon
2017-10-24 5:17 ` santosh
2017-10-25 9:44 ` Olivier MATZ
2 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-10-23 20:34 UTC (permalink / raw)
To: Santosh Shukla, olivier.matz
Cc: dev, jerin.jacob, hemant.agrawal, anatoly.burakov
20/10/2017 14:31, Santosh Shukla:
> Rename buf_physaddr to buf_iovaaddr
>
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Suggested title:
mbuf: rename physical address to IOVA address
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice
2017-10-23 20:29 ` Thomas Monjalon
@ 2017-10-24 5:06 ` santosh
2017-10-25 9:45 ` Thomas Monjalon
0 siblings, 1 reply; 91+ messages in thread
From: santosh @ 2017-10-24 5:06 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, olivier.matz, jerin.jacob, hemant.agrawal, anatoly.burakov
Hi Thomas,
On Tuesday 24 October 2017 01:59 AM, Thomas Monjalon wrote:
> 20/10/2017 14:31, Santosh Shukla:
>> Removed dpdk iova aware ABI deprecation notice,
>> and updated ABI change details in release_17.11.rst.
>>
>> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
>> Acked-by: John McNamara <john.mcnamara@intel.com>
>> ---
>> --- a/doc/guides/rel_notes/deprecation.rst
>> +++ b/doc/guides/rel_notes/deprecation.rst
>> -* eal: An ABI change is planned for 17.11 to make DPDK aware of IOVA address
>> - translation scheme.
>> - Reference to phys address in EAL data-structure or functions may change to
>> - IOVA address or more appropriate name.
>> - The change will be only for the name.
>> - Functional aspects of the API or data-structure will remain same.
> Sorry, this series cannot be applied as is because it is breaking
> more than EAL API. The API of mbuf and mempool are also changed.
> We need to choose one of these three options:
> 1/ accept to break all API in 17.11
> 2/ postpone the whole series to 18.02
Theme of series is to make dpdk iova aware so I would prefer option 1) or 2).
However I have no strong opinion on this topic.
Lets get more opinion from others about option 1/2/3.
> 3/ rename only EAL API in 17.11 and postpone mbuf/mempool
>
> One more comment:
> For such a large change, we should provide a script in devtools
> to help porting the applications. I suggest a sed script.
+1.
Thanks.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/6] make dpdk iova aware
2017-10-23 14:58 ` [dpdk-dev] [PATCH v3 0/6] make dpdk iova aware Thomas Monjalon
@ 2017-10-24 5:12 ` santosh
2017-10-24 7:38 ` Thomas Monjalon
0 siblings, 1 reply; 91+ messages in thread
From: santosh @ 2017-10-24 5:12 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, olivier.matz, jerin.jacob, hemant.agrawal, anatoly.burakov
Hi Thomas,
On Monday 23 October 2017 08:28 PM, Thomas Monjalon wrote:
> 20/10/2017 14:31, Santosh Shukla:
>> v3:
>> Include v2 review comment and rebased on
>> top of upstream tip commit:6b9ed026a8704
>>
>>
>> v2:
>> Include build fixes reported in patchworks.
> Please fix checkpatch issues, thanks
>
Checkpatch warning coming from legacy code, not from iova change,
Same mentioned down in cover letter.
Will address them in v4.. After we conclude on your proposition on [5/6] patch of this series.
Thanks.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/6] eal: rename phys addr to iova addr
2017-10-23 20:32 ` Thomas Monjalon
@ 2017-10-24 5:16 ` santosh
0 siblings, 0 replies; 91+ messages in thread
From: santosh @ 2017-10-24 5:16 UTC (permalink / raw)
To: Thomas Monjalon, dev
Cc: olivier.matz, jerin.jacob, hemant.agrawal, anatoly.burakov
On Tuesday 24 October 2017 02:02 AM, Thomas Monjalon wrote:
> 20/10/2017 14:31, Santosh Shukla:
>> Renamed data type from phys_addr_t to iova_addr_t.
>>
>> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
>> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Suggested title:
> mem: rename physical to IOVA address type
>
+1. Thanks for Suggestion Thomas.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/6] eal/memory: rename buf physaddr to buf iovaaddr
2017-10-23 20:34 ` Thomas Monjalon
@ 2017-10-24 5:17 ` santosh
0 siblings, 0 replies; 91+ messages in thread
From: santosh @ 2017-10-24 5:17 UTC (permalink / raw)
To: Thomas Monjalon, olivier.matz
Cc: dev, jerin.jacob, hemant.agrawal, anatoly.burakov
On Tuesday 24 October 2017 02:04 AM, Thomas Monjalon wrote:
> 20/10/2017 14:31, Santosh Shukla:
>> Rename buf_physaddr to buf_iovaaddr
>>
>> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
>> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Suggested title:
> mbuf: rename physical address to IOVA address
>
+1. Thanks for Suggestion Thomas.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/6] make dpdk iova aware
2017-10-24 5:12 ` santosh
@ 2017-10-24 7:38 ` Thomas Monjalon
0 siblings, 0 replies; 91+ messages in thread
From: Thomas Monjalon @ 2017-10-24 7:38 UTC (permalink / raw)
To: santosh; +Cc: dev, olivier.matz, jerin.jacob, hemant.agrawal, anatoly.burakov
24/10/2017 07:12, santosh:
> Hi Thomas,
>
>
> On Monday 23 October 2017 08:28 PM, Thomas Monjalon wrote:
> > 20/10/2017 14:31, Santosh Shukla:
> >> v3:
> >> Include v2 review comment and rebased on
> >> top of upstream tip commit:6b9ed026a8704
> >>
> >>
> >> v2:
> >> Include build fixes reported in patchworks.
> > Please fix checkpatch issues, thanks
> >
> Checkpatch warning coming from legacy code, not from iova change,
> Same mentioned down in cover letter.
> Will address them in v4.. After we conclude on your proposition on [5/6] patch of this series.
Sorry, I had overlooked checkpatch issues.
No need to fix the checkpatch issues if it makes code lines
formatted differently of their context.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/6] eal/memory: rename buf physaddr to buf iovaaddr
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 2/6] eal/memory: rename buf physaddr to buf iovaaddr Santosh Shukla
2017-10-23 20:15 ` Thomas Monjalon
2017-10-23 20:34 ` Thomas Monjalon
@ 2017-10-25 9:44 ` Olivier MATZ
2 siblings, 0 replies; 91+ messages in thread
From: Olivier MATZ @ 2017-10-25 9:44 UTC (permalink / raw)
To: Santosh Shukla; +Cc: dev, thomas, jerin.jacob, hemant.agrawal, anatoly.burakov
Hi Santosh,
On Fri, Oct 20, 2017 at 06:01:32PM +0530, Santosh Shukla wrote:
> Rename buf_physaddr to buf_iovaaddr
>
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
>
> [...]
>
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -411,7 +411,7 @@ struct rte_mbuf {
> * same mbuf cacheline0 layout for 32-bit and 64-bit. This makes
> * working on vector drivers easier.
> */
> - iova_addr_t buf_physaddr __rte_aligned(sizeof(iova_addr_t));
> + iova_addr_t buf_iovaaddr __rte_aligned(sizeof(iova_addr_t));
If we want to avoid breaking the API for this release, we can
use an anonymous union and keep both fields. Please don't forget
to use RTE_STD_C11 (see commit 79d6f5fc58).
We can announce the deprecation of buf_physaddr for later.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice
2017-10-24 5:06 ` santosh
@ 2017-10-25 9:45 ` Thomas Monjalon
2017-10-25 9:50 ` Richardson, Bruce
0 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-10-25 9:45 UTC (permalink / raw)
To: santosh; +Cc: dev, olivier.matz, jerin.jacob, hemant.agrawal, anatoly.burakov
Hi Santosh,
24/10/2017 07:06, santosh:
> Hi Thomas,
>
>
> On Tuesday 24 October 2017 01:59 AM, Thomas Monjalon wrote:
> > 20/10/2017 14:31, Santosh Shukla:
> >> Removed dpdk iova aware ABI deprecation notice,
> >> and updated ABI change details in release_17.11.rst.
> >>
> >> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> >> Acked-by: John McNamara <john.mcnamara@intel.com>
> >> ---
> >> --- a/doc/guides/rel_notes/deprecation.rst
> >> +++ b/doc/guides/rel_notes/deprecation.rst
> >> -* eal: An ABI change is planned for 17.11 to make DPDK aware of IOVA address
> >> - translation scheme.
> >> - Reference to phys address in EAL data-structure or functions may change to
> >> - IOVA address or more appropriate name.
> >> - The change will be only for the name.
> >> - Functional aspects of the API or data-structure will remain same.
> > Sorry, this series cannot be applied as is because it is breaking
> > more than EAL API. The API of mbuf and mempool are also changed.
> > We need to choose one of these three options:
> > 1/ accept to break all API in 17.11
> > 2/ postpone the whole series to 18.02
>
> Theme of series is to make dpdk iova aware so I would prefer option 1) or 2).
> However I have no strong opinion on this topic.
> Lets get more opinion from others about option 1/2/3.
>
> > 3/ rename only EAL API in 17.11 and postpone mbuf/mempool
After discussing with Olivier it appeared there is a fourth solution.
We should not break any API (EAL, mbuf, mempool).
I would like to merge these changes in RC2, but keeping compatibility
with old names:
- When you rename a function or a type, you can define a macro for the
old name, alias the new name.
- When you rename a struct field, you can make an anonymous union
to allow both names.
Then we can deprecate the old names and remove them later.
Are you able to do these small changes today please?
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice
2017-10-25 9:45 ` Thomas Monjalon
@ 2017-10-25 9:50 ` Richardson, Bruce
2017-10-25 10:01 ` Thomas Monjalon
0 siblings, 1 reply; 91+ messages in thread
From: Richardson, Bruce @ 2017-10-25 9:50 UTC (permalink / raw)
To: Thomas Monjalon, santosh
Cc: dev, olivier.matz, jerin.jacob, hemant.agrawal, Burakov, Anatoly
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> Sent: Wednesday, October 25, 2017 10:46 AM
> To: santosh <santosh.shukla@caviumnetworks.com>
> Cc: dev@dpdk.org; olivier.matz@6wind.com; jerin.jacob@caviumnetworks.com;
> hemant.agrawal@nxp.com; Burakov, Anatoly <anatoly.burakov@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice
>
> Hi Santosh,
>
> 24/10/2017 07:06, santosh:
> > Hi Thomas,
> >
> >
> > On Tuesday 24 October 2017 01:59 AM, Thomas Monjalon wrote:
> > > 20/10/2017 14:31, Santosh Shukla:
> > >> Removed dpdk iova aware ABI deprecation notice, and updated ABI
> > >> change details in release_17.11.rst.
> > >>
> > >> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> > >> Acked-by: John McNamara <john.mcnamara@intel.com>
> > >> ---
> > >> --- a/doc/guides/rel_notes/deprecation.rst
> > >> +++ b/doc/guides/rel_notes/deprecation.rst
> > >> -* eal: An ABI change is planned for 17.11 to make DPDK aware of
> > >> IOVA address
> > >> - translation scheme.
> > >> - Reference to phys address in EAL data-structure or functions may
> > >> change to
> > >> - IOVA address or more appropriate name.
> > >> - The change will be only for the name.
> > >> - Functional aspects of the API or data-structure will remain same.
> > > Sorry, this series cannot be applied as is because it is breaking
> > > more than EAL API. The API of mbuf and mempool are also changed.
> > > We need to choose one of these three options:
> > > 1/ accept to break all API in 17.11
> > > 2/ postpone the whole series to 18.02
> >
> > Theme of series is to make dpdk iova aware so I would prefer option 1)
> or 2).
> > However I have no strong opinion on this topic.
> > Lets get more opinion from others about option 1/2/3.
> >
> > > 3/ rename only EAL API in 17.11 and postpone mbuf/mempool
>
> After discussing with Olivier it appeared there is a fourth solution.
> We should not break any API (EAL, mbuf, mempool).
>
> I would like to merge these changes in RC2, but keeping compatibility with
> old names:
> - When you rename a function or a type, you can define a macro for the old
> name, alias the new name.
Note: using a macro doesn't prevent the ABI being broken if you rename a public function. You'll need to use function versioning too.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/6] eal/memory: rename buf physaddr to buf iovaaddr
2017-10-23 20:15 ` Thomas Monjalon
@ 2017-10-25 9:55 ` Olivier MATZ
0 siblings, 0 replies; 91+ messages in thread
From: Olivier MATZ @ 2017-10-25 9:55 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Santosh Shukla, dev, jerin.jacob, hemant.agrawal, anatoly.burakov
On Mon, Oct 23, 2017 at 10:15:02PM +0200, Thomas Monjalon wrote:
> 20/10/2017 14:31, Santosh Shukla:
> > Rename buf_physaddr to buf_iovaaddr
> >
> > Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> > Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
> > ---
> [...]
> > --- a/lib/librte_mbuf/rte_mbuf.h
> > +++ b/lib/librte_mbuf/rte_mbuf.h
> > @@ -411,7 +411,7 @@ struct rte_mbuf {
> > * same mbuf cacheline0 layout for 32-bit and 64-bit. This makes
> > * working on vector drivers easier.
> > */
> > - iova_addr_t buf_physaddr __rte_aligned(sizeof(iova_addr_t));
> > + iova_addr_t buf_iovaaddr __rte_aligned(sizeof(iova_addr_t));
>
> I really do not understand this naming scheme.
> The "A" of IOVA means Address. So "addr" in iovaaddr is redundant.
+1
ioaddr looks clearer than iovaaddr.
It could also be io_addr or bus_addr.
>
> It seems that IOVA is a too much famous acronym to avoid it.
> Unfortunately, there is no justification in the commit message.
> For the record, my preference was "IO address".
>
> We could at least add an underscore in iova_addr.
>
> But I will apply it as is because nobody else complained.
>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice
2017-10-25 9:50 ` Richardson, Bruce
@ 2017-10-25 10:01 ` Thomas Monjalon
2017-10-25 10:05 ` Bruce Richardson
0 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-10-25 10:01 UTC (permalink / raw)
To: Richardson, Bruce
Cc: santosh, dev, olivier.matz, jerin.jacob, hemant.agrawal, Burakov,
Anatoly
25/10/2017 11:50, Richardson, Bruce:
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> > Sent: Wednesday, October 25, 2017 10:46 AM
> > To: santosh <santosh.shukla@caviumnetworks.com>
> > Cc: dev@dpdk.org; olivier.matz@6wind.com; jerin.jacob@caviumnetworks.com;
> > hemant.agrawal@nxp.com; Burakov, Anatoly <anatoly.burakov@intel.com>
> > Subject: Re: [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice
> >
> > Hi Santosh,
> >
> > 24/10/2017 07:06, santosh:
> > > Hi Thomas,
> > >
> > >
> > > On Tuesday 24 October 2017 01:59 AM, Thomas Monjalon wrote:
> > > > 20/10/2017 14:31, Santosh Shukla:
> > > >> Removed dpdk iova aware ABI deprecation notice, and updated ABI
> > > >> change details in release_17.11.rst.
> > > >>
> > > >> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> > > >> Acked-by: John McNamara <john.mcnamara@intel.com>
> > > >> ---
> > > >> --- a/doc/guides/rel_notes/deprecation.rst
> > > >> +++ b/doc/guides/rel_notes/deprecation.rst
> > > >> -* eal: An ABI change is planned for 17.11 to make DPDK aware of
> > > >> IOVA address
> > > >> - translation scheme.
> > > >> - Reference to phys address in EAL data-structure or functions may
> > > >> change to
> > > >> - IOVA address or more appropriate name.
> > > >> - The change will be only for the name.
> > > >> - Functional aspects of the API or data-structure will remain same.
> > > > Sorry, this series cannot be applied as is because it is breaking
> > > > more than EAL API. The API of mbuf and mempool are also changed.
> > > > We need to choose one of these three options:
> > > > 1/ accept to break all API in 17.11
> > > > 2/ postpone the whole series to 18.02
> > >
> > > Theme of series is to make dpdk iova aware so I would prefer option 1)
> > or 2).
> > > However I have no strong opinion on this topic.
> > > Lets get more opinion from others about option 1/2/3.
> > >
> > > > 3/ rename only EAL API in 17.11 and postpone mbuf/mempool
> >
> > After discussing with Olivier it appeared there is a fourth solution.
> > We should not break any API (EAL, mbuf, mempool).
> >
> > I would like to merge these changes in RC2, but keeping compatibility with
> > old names:
> > - When you rename a function or a type, you can define a macro for the old
> > name, alias the new name.
>
> Note: using a macro doesn't prevent the ABI being broken if you rename a public function. You'll need to use function versioning too.
True
We can use an inline function to avoid ABI breakage.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice
2017-10-25 10:01 ` Thomas Monjalon
@ 2017-10-25 10:05 ` Bruce Richardson
2017-10-25 10:12 ` Thomas Monjalon
0 siblings, 1 reply; 91+ messages in thread
From: Bruce Richardson @ 2017-10-25 10:05 UTC (permalink / raw)
To: Thomas Monjalon
Cc: santosh, dev, olivier.matz, jerin.jacob, hemant.agrawal, Burakov,
Anatoly
On Wed, Oct 25, 2017 at 12:01:26PM +0200, Thomas Monjalon wrote:
> 25/10/2017 11:50, Richardson, Bruce:
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> > > Sent: Wednesday, October 25, 2017 10:46 AM
> > > To: santosh <santosh.shukla@caviumnetworks.com>
> > > Cc: dev@dpdk.org; olivier.matz@6wind.com; jerin.jacob@caviumnetworks.com;
> > > hemant.agrawal@nxp.com; Burakov, Anatoly <anatoly.burakov@intel.com>
> > > Subject: Re: [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice
> > >
> > > Hi Santosh,
> > >
> > > 24/10/2017 07:06, santosh:
> > > > Hi Thomas,
> > > >
> > > >
> > > > On Tuesday 24 October 2017 01:59 AM, Thomas Monjalon wrote:
> > > > > 20/10/2017 14:31, Santosh Shukla:
> > > > >> Removed dpdk iova aware ABI deprecation notice, and updated ABI
> > > > >> change details in release_17.11.rst.
> > > > >>
> > > > >> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> > > > >> Acked-by: John McNamara <john.mcnamara@intel.com>
> > > > >> ---
> > > > >> --- a/doc/guides/rel_notes/deprecation.rst
> > > > >> +++ b/doc/guides/rel_notes/deprecation.rst
> > > > >> -* eal: An ABI change is planned for 17.11 to make DPDK aware of
> > > > >> IOVA address
> > > > >> - translation scheme.
> > > > >> - Reference to phys address in EAL data-structure or functions may
> > > > >> change to
> > > > >> - IOVA address or more appropriate name.
> > > > >> - The change will be only for the name.
> > > > >> - Functional aspects of the API or data-structure will remain same.
> > > > > Sorry, this series cannot be applied as is because it is breaking
> > > > > more than EAL API. The API of mbuf and mempool are also changed.
> > > > > We need to choose one of these three options:
> > > > > 1/ accept to break all API in 17.11
> > > > > 2/ postpone the whole series to 18.02
> > > >
> > > > Theme of series is to make dpdk iova aware so I would prefer option 1)
> > > or 2).
> > > > However I have no strong opinion on this topic.
> > > > Lets get more opinion from others about option 1/2/3.
> > > >
> > > > > 3/ rename only EAL API in 17.11 and postpone mbuf/mempool
> > >
> > > After discussing with Olivier it appeared there is a fourth solution.
> > > We should not break any API (EAL, mbuf, mempool).
> > >
> > > I would like to merge these changes in RC2, but keeping compatibility with
> > > old names:
> > > - When you rename a function or a type, you can define a macro for the old
> > > name, alias the new name.
> >
> > Note: using a macro doesn't prevent the ABI being broken if you rename a public function. You'll need to use function versioning too.
>
> True
> We can use an inline function to avoid ABI breakage.
Nope, inline function won't work either, since that ends up the same as
the macro and compiled into the end app, not the library ABI. You
need a public non-inline wrapper function to keep ABI, or else function
renaming via symbol versioning/mapping.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice
2017-10-25 10:05 ` Bruce Richardson
@ 2017-10-25 10:12 ` Thomas Monjalon
2017-10-25 10:32 ` Bruce Richardson
0 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-10-25 10:12 UTC (permalink / raw)
To: Bruce Richardson
Cc: santosh, dev, olivier.matz, jerin.jacob, hemant.agrawal, Burakov,
Anatoly
25/10/2017 12:05, Bruce Richardson:
> On Wed, Oct 25, 2017 at 12:01:26PM +0200, Thomas Monjalon wrote:
> > 25/10/2017 11:50, Richardson, Bruce:
> > > From: Thomas Monjalon
> > > > > On Tuesday 24 October 2017 01:59 AM, Thomas Monjalon wrote:
> > > > > > 20/10/2017 14:31, Santosh Shukla:
> > > > > >> Removed dpdk iova aware ABI deprecation notice, and updated ABI
> > > > > >> change details in release_17.11.rst.
> > > > > >>
> > > > > >> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> > > > > >> Acked-by: John McNamara <john.mcnamara@intel.com>
> > > > > >> ---
> > > > > >> --- a/doc/guides/rel_notes/deprecation.rst
> > > > > >> +++ b/doc/guides/rel_notes/deprecation.rst
> > > > > >> -* eal: An ABI change is planned for 17.11 to make DPDK aware of
> > > > > >> IOVA address
> > > > > >> - translation scheme.
> > > > > >> - Reference to phys address in EAL data-structure or functions may
> > > > > >> change to
> > > > > >> - IOVA address or more appropriate name.
> > > > > >> - The change will be only for the name.
> > > > > >> - Functional aspects of the API or data-structure will remain same.
> > > > > > Sorry, this series cannot be applied as is because it is breaking
> > > > > > more than EAL API. The API of mbuf and mempool are also changed.
> > > > > > We need to choose one of these three options:
> > > > > > 1/ accept to break all API in 17.11
> > > > > > 2/ postpone the whole series to 18.02
> > > > >
> > > > > Theme of series is to make dpdk iova aware so I would prefer option 1)
> > > > or 2).
> > > > > However I have no strong opinion on this topic.
> > > > > Lets get more opinion from others about option 1/2/3.
> > > > >
> > > > > > 3/ rename only EAL API in 17.11 and postpone mbuf/mempool
> > > >
> > > > After discussing with Olivier it appeared there is a fourth solution.
> > > > We should not break any API (EAL, mbuf, mempool).
> > > >
> > > > I would like to merge these changes in RC2, but keeping compatibility with
> > > > old names:
> > > > - When you rename a function or a type, you can define a macro for the old
> > > > name, alias the new name.
> > >
> > > Note: using a macro doesn't prevent the ABI being broken if you rename a public function. You'll need to use function versioning too.
> >
> > True
> > We can use an inline function to avoid ABI breakage.
>
> Nope, inline function won't work either, since that ends up the same as
> the macro and compiled into the end app, not the library ABI. You
> need a public non-inline wrapper function to keep ABI, or else function
> renaming via symbol versioning/mapping.
Ah ah ah, I'm writing before thinking :)
Yes, the function must not be inlined.
And generally speaking it is not an issue,
even for performance critical functions.
Adding one more function call in the path is not a bad thing
for deprecated functions.
I've seen another project (don't remember which one) adding a
sleep() in deprecated functions and increasing the sleep time
at each new release :)
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice
2017-10-25 10:12 ` Thomas Monjalon
@ 2017-10-25 10:32 ` Bruce Richardson
0 siblings, 0 replies; 91+ messages in thread
From: Bruce Richardson @ 2017-10-25 10:32 UTC (permalink / raw)
To: Thomas Monjalon
Cc: santosh, dev, olivier.matz, jerin.jacob, hemant.agrawal, Burakov,
Anatoly
On Wed, Oct 25, 2017 at 12:12:57PM +0200, Thomas Monjalon wrote:
> 25/10/2017 12:05, Bruce Richardson:
> > On Wed, Oct 25, 2017 at 12:01:26PM +0200, Thomas Monjalon wrote:
> > > 25/10/2017 11:50, Richardson, Bruce:
> > > > From: Thomas Monjalon
> > > > > > On Tuesday 24 October 2017 01:59 AM, Thomas Monjalon wrote:
> > > > > > > 20/10/2017 14:31, Santosh Shukla:
> > > > > > >> Removed dpdk iova aware ABI deprecation notice, and updated ABI
> > > > > > >> change details in release_17.11.rst.
> > > > > > >>
> > > > > > >> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> > > > > > >> Acked-by: John McNamara <john.mcnamara@intel.com>
> > > > > > >> ---
> > > > > > >> --- a/doc/guides/rel_notes/deprecation.rst
> > > > > > >> +++ b/doc/guides/rel_notes/deprecation.rst
> > > > > > >> -* eal: An ABI change is planned for 17.11 to make DPDK aware of
> > > > > > >> IOVA address
> > > > > > >> - translation scheme.
> > > > > > >> - Reference to phys address in EAL data-structure or functions may
> > > > > > >> change to
> > > > > > >> - IOVA address or more appropriate name.
> > > > > > >> - The change will be only for the name.
> > > > > > >> - Functional aspects of the API or data-structure will remain same.
> > > > > > > Sorry, this series cannot be applied as is because it is breaking
> > > > > > > more than EAL API. The API of mbuf and mempool are also changed.
> > > > > > > We need to choose one of these three options:
> > > > > > > 1/ accept to break all API in 17.11
> > > > > > > 2/ postpone the whole series to 18.02
> > > > > >
> > > > > > Theme of series is to make dpdk iova aware so I would prefer option 1)
> > > > > or 2).
> > > > > > However I have no strong opinion on this topic.
> > > > > > Lets get more opinion from others about option 1/2/3.
> > > > > >
> > > > > > > 3/ rename only EAL API in 17.11 and postpone mbuf/mempool
> > > > >
> > > > > After discussing with Olivier it appeared there is a fourth solution.
> > > > > We should not break any API (EAL, mbuf, mempool).
> > > > >
> > > > > I would like to merge these changes in RC2, but keeping compatibility with
> > > > > old names:
> > > > > - When you rename a function or a type, you can define a macro for the old
> > > > > name, alias the new name.
> > > >
> > > > Note: using a macro doesn't prevent the ABI being broken if you rename a public function. You'll need to use function versioning too.
> > >
> > > True
> > > We can use an inline function to avoid ABI breakage.
> >
> > Nope, inline function won't work either, since that ends up the same as
> > the macro and compiled into the end app, not the library ABI. You
> > need a public non-inline wrapper function to keep ABI, or else function
> > renaming via symbol versioning/mapping.
>
> Ah ah ah, I'm writing before thinking :)
> Yes, the function must not be inlined.
>
> And generally speaking it is not an issue,
> even for performance critical functions.
> Adding one more function call in the path is not a bad thing
> for deprecated functions.
> I've seen another project (don't remember which one) adding a
> sleep() in deprecated functions and increasing the sleep time
> at each new release :)
Genius!!
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/6] eal/memory: rename memory API to iova types
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 4/6] eal/memory: rename memory API to iova types Santosh Shukla
@ 2017-11-03 11:11 ` Thomas Monjalon
2017-11-03 11:35 ` santosh
0 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-03 11:11 UTC (permalink / raw)
To: Santosh Shukla
Cc: dev, olivier.matz, jerin.jacob, hemant.agrawal, anatoly.burakov
20/10/2017 14:31, Santosh Shukla:
> Renamed memory translational api to _iova types.
> The following api renamed from:
>
> rte_mempool_populate_phys()
> rte_mempool_populate_phys_tab()
These functions still have "physical addresses" in their description.
It is not consistent.
Please provide ABI compatibility for mempool functions.
> rte_eal_using_phys_addrs()
Why renaming rte_eal_using_phys_addrs?
I think we need to review how it is used.
Maybe it requires a rework.
> rte_mem_virt2phy()
> rte_dump_physmem_layout()
> rte_eal_get_physmem_layout()
> rte_eal_get_physmem_size()
Those 3 functions deal with physical memory layout.
I don't see a need to rename them.
But the dump function needs a change to avoid printing
"phys" even in VA case.
> rte_malloc_virt2phy()
> rte_mem_phy2mch()
This last function was removed with Xen.
It is wrong to rename it in the release notes.
It should just be removed from the map file (I will send a patch).
> To the following iova types api:
>
> rte_mempool_populate_iova()
> rte_mempool_populate_iova_tab()
> rte_eal_using_iova_addrs()
> rte_mem_virt2iova()
[...]
> rte_malloc_virt2iova()
I am not convinced by the names virt2iova.
I sounds like "virt to virt".
What about "virt2io" or "virt2io_addr"?
As the ABI is broken in EAL 17.11, we do not care about compatibility.
But we must keep an alias to the old function name in order to allow
a smooth API transition for applications.
I suggest to add static inline functions with the old names and set
the deprecated attribute.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/6] eal/memory: rename memory API to iova types
2017-11-03 11:11 ` Thomas Monjalon
@ 2017-11-03 11:35 ` santosh
2017-11-03 13:58 ` Thomas Monjalon
0 siblings, 1 reply; 91+ messages in thread
From: santosh @ 2017-11-03 11:35 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, olivier.matz, jerin.jacob, hemant.agrawal, anatoly.burakov
On Friday 03 November 2017 04:41 PM, Thomas Monjalon wrote:
> 20/10/2017 14:31, Santosh Shukla:
>> Renamed memory translational api to _iova types.
>> The following api renamed from:
>>
>> rte_mempool_populate_phys()
>> rte_mempool_populate_phys_tab()
> These functions still have "physical addresses" in their description.
> It is not consistent.
>
> Please provide ABI compatibility for mempool functions.
>
>> rte_eal_using_phys_addrs()
> Why renaming rte_eal_using_phys_addrs?
> I think we need to review how it is used.
> Maybe it requires a rework.
>
>> rte_mem_virt2phy()
>> rte_dump_physmem_layout()
>> rte_eal_get_physmem_layout()
>> rte_eal_get_physmem_size()
> Those 3 functions deal with physical memory layout.
> I don't see a need to rename them.
In iova=va mode, those api will have va address.
> But the dump function needs a change to avoid printing
> "phys" even in VA case.
>
>> rte_malloc_virt2phy()
>> rte_mem_phy2mch()
> This last function was removed with Xen.
> It is wrong to rename it in the release notes.
> It should just be removed from the map file (I will send a patch).
>
>> To the following iova types api:
>>
>> rte_mempool_populate_iova()
>> rte_mempool_populate_iova_tab()
>> rte_eal_using_iova_addrs()
>> rte_mem_virt2iova()
> [...]
>> rte_malloc_virt2iova()
> I am not convinced by the names virt2iova.
> I sounds like "virt to virt".
> What about "virt2io" or "virt2io_addr"?
no, iova can be _pa or _va, its an io_addr indeed but
I prefer virt2iova, same mentioned in deprecation notice (no strong opinion),
More suggestion on naming pl.?
> As the ABI is broken in EAL 17.11, we do not care about compatibility.
> But we must keep an alias to the old function name in order to allow
> a smooth API transition for applications.
> I suggest to add static inline functions with the old names and set
> the deprecated attribute.
ok, Will address in 18.02.
Thanks.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/6] eal/memory: rename memory API to iova types
2017-11-03 11:35 ` santosh
@ 2017-11-03 13:58 ` Thomas Monjalon
2017-11-03 15:22 ` [dpdk-dev] [PATCH v3 4/6] eal/memory: rename memory API to iovatypes Jonas Pfefferle1
0 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-03 13:58 UTC (permalink / raw)
To: santosh; +Cc: dev, olivier.matz, jerin.jacob, hemant.agrawal, anatoly.burakov
03/11/2017 12:35, santosh:
> On Friday 03 November 2017 04:41 PM, Thomas Monjalon wrote:
> > 20/10/2017 14:31, Santosh Shukla:
> >> Renamed memory translational api to _iova types.
> >> The following api renamed from:
> >>
> >> rte_mempool_populate_phys()
> >> rte_mempool_populate_phys_tab()
> > These functions still have "physical addresses" in their description.
> > It is not consistent.
> >
> > Please provide ABI compatibility for mempool functions.
> >
> >> rte_eal_using_phys_addrs()
> > Why renaming rte_eal_using_phys_addrs?
> > I think we need to review how it is used.
> > Maybe it requires a rework.
> >
> >> rte_mem_virt2phy()
> >> rte_dump_physmem_layout()
> >> rte_eal_get_physmem_layout()
> >> rte_eal_get_physmem_size()
> > Those 3 functions deal with physical memory layout.
> > I don't see a need to rename them.
>
> In iova=va mode, those api will have va address.
Yes addresses can be virtual.
But it is still physically segmented.
> > But the dump function needs a change to avoid printing
> > "phys" even in VA case.
> >
> >> rte_malloc_virt2phy()
> >> rte_mem_phy2mch()
> > This last function was removed with Xen.
> > It is wrong to rename it in the release notes.
> > It should just be removed from the map file (I will send a patch).
> >
> >> To the following iova types api:
> >>
> >> rte_mempool_populate_iova()
> >> rte_mempool_populate_iova_tab()
> >> rte_eal_using_iova_addrs()
> >> rte_mem_virt2iova()
> > [...]
> >> rte_malloc_virt2iova()
> > I am not convinced by the names virt2iova.
> > I sounds like "virt to virt".
> > What about "virt2io" or "virt2io_addr"?
>
> no, iova can be _pa or _va, its an io_addr indeed but
> I prefer virt2iova, same mentioned in deprecation notice (no strong opinion),
>
> More suggestion on naming pl.?
I like virt2io_addr but virt2iova is not so bad.
I agree with Santosh that we need more opinions.
> > As the ABI is broken in EAL 17.11, we do not care about compatibility.
> > But we must keep an alias to the old function name in order to allow
> > a smooth API transition for applications.
> > I suggest to add static inline functions with the old names and set
> > the deprecated attribute.
>
> ok, Will address in 18.02.
I would prefer these changes made in 17.11 as announced.
As you are not willing to work on it, I am trying to send some
updated patches.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/6] eal/memory: rename memory API to iovatypes
2017-11-03 13:58 ` Thomas Monjalon
@ 2017-11-03 15:22 ` Jonas Pfefferle1
0 siblings, 0 replies; 91+ messages in thread
From: Jonas Pfefferle1 @ 2017-11-03 15:22 UTC (permalink / raw)
To: Thomas Monjalon
Cc: santosh, dev, olivier.matz, jerin.jacob, hemant.agrawal, anatoly.burakov
"dev" <dev-bounces@dpdk.org> wrote on 11/03/2017 02:58:43 PM:
> From: Thomas Monjalon <thomas@monjalon.net>
> To: santosh <santosh.shukla@caviumnetworks.com>
> Cc: dev@dpdk.org, olivier.matz@6wind.com,
> jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
> anatoly.burakov@intel.com
> Date: 11/03/2017 02:59 PM
> Subject: Re: [dpdk-dev] [PATCH v3 4/6] eal/memory: rename memory API
> to iova types
> Sent by: "dev" <dev-bounces@dpdk.org>
>
> 03/11/2017 12:35, santosh:
> > On Friday 03 November 2017 04:41 PM, Thomas Monjalon wrote:
> > > 20/10/2017 14:31, Santosh Shukla:
> > >> Renamed memory translational api to _iova types.
> > >> The following api renamed from:
> > >>
> > >> rte_mempool_populate_phys()
> > >> rte_mempool_populate_phys_tab()
> > > These functions still have "physical addresses" in their description.
> > > It is not consistent.
> > >
> > > Please provide ABI compatibility for mempool functions.
> > >
> > >> rte_eal_using_phys_addrs()
> > > Why renaming rte_eal_using_phys_addrs?
> > > I think we need to review how it is used.
> > > Maybe it requires a rework.
> > >
> > >> rte_mem_virt2phy()
> > >> rte_dump_physmem_layout()
> > >> rte_eal_get_physmem_layout()
> > >> rte_eal_get_physmem_size()
> > > Those 3 functions deal with physical memory layout.
> > > I don't see a need to rename them.
> >
> > In iova=va mode, those api will have va address.
>
> Yes addresses can be virtual.
> But it is still physically segmented.
>
> > > But the dump function needs a change to avoid printing
> > > "phys" even in VA case.
> > >
> > >> rte_malloc_virt2phy()
> > >> rte_mem_phy2mch()
> > > This last function was removed with Xen.
> > > It is wrong to rename it in the release notes.
> > > It should just be removed from the map file (I will send a patch).
> > >
> > >> To the following iova types api:
> > >>
> > >> rte_mempool_populate_iova()
> > >> rte_mempool_populate_iova_tab()
> > >> rte_eal_using_iova_addrs()
> > >> rte_mem_virt2iova()
> > > [...]
> > >> rte_malloc_virt2iova()
> > > I am not convinced by the names virt2iova.
> > > I sounds like "virt to virt".
> > > What about "virt2io" or "virt2io_addr"?
> >
> > no, iova can be _pa or _va, its an io_addr indeed but
> > I prefer virt2iova, same mentioned in deprecation notice (no
> strong opinion),
> >
> > More suggestion on naming pl.?
>
> I like virt2io_addr but virt2iova is not so bad.
> I agree with Santosh that we need more opinions.
virt2iova +1
Another suggestion va2iova to be consistent with the names
>
> > > As the ABI is broken in EAL 17.11, we do not care about
compatibility.
> > > But we must keep an alias to the old function name in order to allow
> > > a smooth API transition for applications.
> > > I suggest to add static inline functions with the old names and set
> > > the deprecated attribute.
> >
> > ok, Will address in 18.02.
>
> I would prefer these changes made in 17.11 as announced.
> As you are not willing to work on it, I am trying to send some
> updated patches.
>
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware
2017-08-14 15:15 [dpdk-dev] [PATCH v1 0/4] make dpdk iova aware Santosh Shukla
` (4 preceding siblings ...)
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Santosh Shukla
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 01/15] mem: hide physical address error in VA mode Thomas Monjalon
` (15 more replies)
5 siblings, 16 replies; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
This v4 is a big rework to complete the patches sent by Santosh.
The core components for memory handling (memseg, malloc, memzone,
mempool, mbuf) are almost fully updated for IOVA awareness.
It will ease maintenance and upcoming reworks; that's why we should push
it in 17.11 LTS.
The most important changes in this revision v4 are:
- No API break: everything is aliased to keep old names during next
releases. It will ease apps migration, waiting for major ABI break.
- Rename type from iova_addr_t to rte_iova_t.
- Convert memzone field.
- Convert mempool fields.
- Convert mbuf address helpers.
- Reword doxygen comments and variable names in functions.
In PMDs, only the address type is renamed.
All PMDs will require some attention to transition to IOVA scheme.
KNI and NXP bus drivers are not reworded.
Santosh Shukla (5):
mem: rename segment address from physical to IOVA
malloc: use pointer diff macro in IOVA mapping
mbuf: rename physical address to IOVA
cryptodev: rename physical address type to IOVA
drivers/net: rename physical address type to IOVA
Thomas Monjalon (10):
mem: hide physical address error in VA mode
mem: introduce IOVA type
mem: rename address mapping function to IOVA
malloc: rename address mapping function to IOVA
memzone: rename address from physical to IOVA
mempool: rename addresses from physical to IOVA
mempool: rename address mapping function to IOVA
mempool: rename populate functions to IOVA
mbuf: rename data address helpers to IOVA
doc: add IOVA aware API changes in release notes
app/test-crypto-perf/cperf_ops.c | 6 +-
app/test-crypto-perf/cperf_test_common.c | 6 +-
app/test-crypto-perf/cperf_test_vector_parsing.c | 4 +-
app/test-crypto-perf/cperf_test_vectors.c | 6 +-
app/test-crypto-perf/cperf_test_vectors.h | 4 +-
doc/guides/prog_guide/cryptodev_lib.rst | 6 +-
doc/guides/prog_guide/img/mbuf1.svg | 2 +-
doc/guides/rel_notes/deprecation.rst | 7 --
doc/guides/rel_notes/release_17_11.rst | 17 ++++
drivers/bus/dpaa/base/qbman/qman.c | 2 +-
drivers/bus/dpaa/base/qbman/qman.h | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 +-
drivers/crypto/dpaa_sec/dpaa_sec.c | 28 +++---
drivers/crypto/mrvl/rte_mrvl_pmd.c | 4 +-
drivers/crypto/qat/qat_adf/qat_algs.h | 6 +-
drivers/crypto/qat/qat_crypto.c | 22 ++---
drivers/crypto/qat/qat_crypto.h | 2 +-
drivers/crypto/qat/qat_qp.c | 8 +-
drivers/mempool/dpaa/dpaa_mempool.c | 4 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 +-
drivers/mempool/octeontx/octeontx_fpavf.c | 4 +-
drivers/mempool/octeontx/rte_mempool_octeontx.c | 2 +-
drivers/net/ark/ark_ddm.c | 2 +-
drivers/net/ark/ark_ddm.h | 4 +-
drivers/net/ark/ark_ethdev_rx.c | 24 ++---
drivers/net/ark/ark_ethdev_tx.c | 8 +-
drivers/net/ark/ark_mpu.c | 2 +-
drivers/net/ark/ark_mpu.h | 4 +-
drivers/net/ark/ark_udm.c | 2 +-
drivers/net/ark/ark_udm.h | 4 +-
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/avp/rte_avp_common.h | 20 ++--
drivers/net/bnx2x/bnx2x.c | 44 ++++-----
drivers/net/bnx2x/bnx2x.h | 22 ++---
drivers/net/bnx2x/bnx2x_rxtx.c | 14 +--
drivers/net/bnx2x/bnx2x_stats.c | 2 +-
drivers/net/bnx2x/bnx2x_vfpf.c | 2 +-
drivers/net/bnx2x/ecore_sp.h | 2 +-
drivers/net/bnxt/bnxt.h | 10 +-
drivers/net/bnxt/bnxt_cpr.h | 4 +-
drivers/net/bnxt/bnxt_ethdev.c | 14 +--
drivers/net/bnxt/bnxt_hwrm.c | 26 +++---
drivers/net/bnxt/bnxt_ring.c | 10 +-
drivers/net/bnxt/bnxt_ring.h | 4 +-
drivers/net/bnxt/bnxt_rxr.h | 4 +-
drivers/net/bnxt/bnxt_txr.h | 2 +-
drivers/net/bnxt/bnxt_vnic.c | 8 +-
drivers/net/bnxt/bnxt_vnic.h | 6 +-
drivers/net/cxgbe/sge.c | 6 +-
drivers/net/dpaa/dpaa_rxtx.c | 6 +-
drivers/net/e1000/em_rxtx.c | 12 +--
drivers/net/e1000/igb_rxtx.c | 12 +--
drivers/net/ena/base/ena_plat_dpdk.h | 4 +-
drivers/net/ena/ena_ethdev.c | 6 +-
drivers/net/enic/enic_main.c | 8 +-
drivers/net/enic/enic_rxtx.c | 6 +-
drivers/net/fm10k/fm10k.h | 4 +-
drivers/net/fm10k/fm10k_ethdev.c | 4 +-
drivers/net/fm10k/fm10k_rxtx_vec.c | 4 +-
drivers/net/i40e/i40e_ethdev.c | 2 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 22 ++---
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 4 +-
drivers/net/i40e/i40e_rxtx_vec_neon.c | 6 +-
drivers/net/i40e/i40e_rxtx_vec_sse.c | 6 +-
drivers/net/ixgbe/ixgbe_rxtx.c | 18 ++--
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 6 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 6 +-
drivers/net/liquidio/lio_rxtx.c | 20 ++--
drivers/net/liquidio/lio_rxtx.h | 6 +-
drivers/net/mrvl/mrvl_ethdev.c | 8 +-
drivers/net/nfp/nfp_net.c | 8 +-
drivers/net/octeontx/base/octeontx_pkovf.c | 4 +-
drivers/net/octeontx/octeontx_rxtx.c | 2 +-
drivers/net/qede/base/bcm_osal.c | 10 +-
drivers/net/qede/base/bcm_osal.h | 2 +-
drivers/net/qede/qede_fdir.c | 2 +-
drivers/net/qede/qede_rxtx.c | 16 ++--
drivers/net/sfc/efsys.h | 2 +-
drivers/net/sfc/sfc.c | 4 +-
drivers/net/sfc/sfc_ef10_rx.c | 4 +-
drivers/net/sfc/sfc_ef10_tx.c | 6 +-
drivers/net/sfc/sfc_rx.c | 2 +-
drivers/net/sfc/sfc_tso.c | 4 +-
drivers/net/sfc/sfc_tx.c | 2 +-
drivers/net/thunderx/base/nicvf_hw.c | 2 +-
drivers/net/thunderx/base/nicvf_hw.h | 2 +-
drivers/net/thunderx/base/nicvf_hw_defs.h | 6 +-
drivers/net/thunderx/nicvf_ethdev.c | 10 +-
drivers/net/thunderx/nicvf_ethdev.h | 6 +-
drivers/net/thunderx/nicvf_rxtx.h | 4 +-
drivers/net/thunderx/nicvf_struct.h | 6 +-
drivers/net/virtio/virtio_ethdev.c | 10 +-
drivers/net/virtio/virtio_rxtx.h | 4 +-
drivers/net/virtio/virtqueue.h | 6 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 10 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 8 +-
examples/ipsec-secgw/esp.c | 12 +--
examples/l2fwd-crypto/main.c | 8 +-
lib/librte_cryptodev/rte_crypto.h | 2 +-
lib/librte_cryptodev/rte_crypto_sym.h | 6 +-
lib/librte_cryptodev/rte_cryptodev.c | 2 +-
lib/librte_cryptodev/rte_cryptodev.h | 2 +-
lib/librte_eal/bsdapp/eal/eal_memory.c | 15 ++-
lib/librte_eal/common/eal_common_memory.c | 4 +-
lib/librte_eal/common/eal_common_memzone.c | 6 +-
lib/librte_eal/common/include/rte_malloc.h | 17 +++-
lib/librte_eal/common/include/rte_memory.h | 28 +++++-
lib/librte_eal/common/include/rte_memzone.h | 6 +-
lib/librte_eal/common/rte_malloc.c | 22 ++---
lib/librte_eal/linuxapp/eal/eal_memory.c | 40 ++++----
lib/librte_eal/linuxapp/eal/eal_vfio.c | 6 +-
lib/librte_eal/rte_eal_version.map | 3 +-
lib/librte_kni/rte_kni.c | 2 +-
lib/librte_mbuf/rte_mbuf.c | 6 +-
lib/librte_mbuf/rte_mbuf.h | 53 ++++++++---
lib/librte_mempool/rte_mempool.c | 111 +++++++++++++----------
lib/librte_mempool/rte_mempool.h | 86 +++++++++++-------
lib/librte_mempool/rte_mempool_ops.c | 4 +-
lib/librte_mempool/rte_mempool_version.map | 2 +
lib/librte_vhost/vhost.h | 2 +-
lib/librte_vhost/vhost_user.c | 4 +-
lib/librte_vhost/virtio_net.c | 2 +-
test/test/test_cryptodev.c | 42 ++++-----
test/test/test_cryptodev.h | 4 +-
test/test/test_mbuf.c | 2 +-
test/test/test_mempool.c | 4 +-
test/test/test_memzone.c | 80 ++++++++--------
129 files changed, 708 insertions(+), 591 deletions(-)
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 01/15] mem: hide physical address error in VA mode
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 5:39 ` santosh
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 02/15] mem: introduce IOVA type Thomas Monjalon
` (14 subsequent siblings)
15 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
If the IOVA mode is not using physical addresses,
no need to log an error about physical address issue.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_eal/linuxapp/eal/eal_memory.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index ab287aa24..10b42d2fe 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -107,10 +107,11 @@ test_phys_addrs_available(void)
physaddr = rte_mem_virt2phy(&tmp);
if (physaddr == RTE_BAD_PHYS_ADDR) {
- RTE_LOG(ERR, EAL,
- "Cannot obtain physical addresses: %s. "
- "Only vfio will function.\n",
- strerror(errno));
+ if (rte_eal_iova_mode() == RTE_IOVA_PA)
+ RTE_LOG(ERR, EAL,
+ "Cannot obtain physical addresses: %s. "
+ "Only vfio will function.\n",
+ strerror(errno));
phys_addrs_available = false;
}
}
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 02/15] mem: introduce IOVA type
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 01/15] mem: hide physical address error in VA mode Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 5:38 ` santosh
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 03/15] mem: rename segment address from physical to IOVA Thomas Monjalon
` (13 subsequent siblings)
15 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
The IO virtual addresses may be used instead of physical addresses.
As IOVA is more generic, it should be used in most places instead
of physical address wording.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_eal/common/include/rte_memory.h | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index 5a3a956e3..f7eed9ab6 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -92,8 +92,16 @@ enum rte_page_sizes {
*/
#define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)
-typedef uint64_t phys_addr_t; /**< Physical address definition. */
+typedef uint64_t phys_addr_t; /**< Physical address. */
#define RTE_BAD_PHYS_ADDR ((phys_addr_t)-1)
+/**
+ * IO virtual address type.
+ * When the physical addressing mode is in use,
+ * the translation from a virtual address to a physical address
+ * is a direct mapping, i.e. the same value.
+ */
+typedef uint64_t rte_iova_t;
+#define RTE_BAD_IOVA ((rte_iova_t)-1)
/**
* Physical memory segment descriptor.
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 03/15] mem: rename segment address from physical to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 01/15] mem: hide physical address error in VA mode Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 02/15] mem: introduce IOVA type Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 04/15] mem: rename address mapping function " Thomas Monjalon
` (12 subsequent siblings)
15 siblings, 0 replies; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
From: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Renaming rte_memseg {.phys_addr} to {.iova}
Keep the deprecated name in an anonymous union to avoid breaking
the API.
Use rte_iova_t and RTE_BAD_IOVA where appropriate in
memory segment handling.
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_eal/bsdapp/eal/eal_memory.c | 8 ++++----
lib/librte_eal/common/eal_common_memory.c | 4 ++--
lib/librte_eal/common/include/rte_memory.h | 8 ++++++--
lib/librte_eal/common/rte_malloc.c | 6 +++---
lib/librte_eal/linuxapp/eal/eal_memory.c | 20 ++++++++++----------
lib/librte_eal/linuxapp/eal/eal_vfio.c | 6 +++---
6 files changed, 28 insertions(+), 24 deletions(-)
diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index 65c96b05e..66fab768f 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -56,7 +56,7 @@ rte_mem_virt2phy(const void *virtaddr)
/* XXX not implemented. This function is only used by
* rte_mempool_virt2phy() when hugepages are disabled. */
(void)virtaddr;
- return RTE_BAD_PHYS_ADDR;
+ return RTE_BAD_IOVA;
}
int
@@ -73,7 +73,7 @@ rte_eal_hugepage_init(void)
/* for debug purposes, hugetlbfs can be disabled */
if (internal_config.no_hugetlbfs) {
addr = malloc(internal_config.memory);
- mcfg->memseg[0].phys_addr = (phys_addr_t)(uintptr_t)addr;
+ mcfg->memseg[0].iova = (rte_iova_t)(uintptr_t)addr;
mcfg->memseg[0].addr = addr;
mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
mcfg->memseg[0].len = internal_config.memory;
@@ -88,7 +88,7 @@ rte_eal_hugepage_init(void)
hpi = &internal_config.hugepage_info[i];
for (j = 0; j < hpi->num_pages[0]; j++) {
struct rte_memseg *seg;
- uint64_t physaddr;
+ rte_iova_t physaddr;
int error;
size_t sysctl_size = sizeof(physaddr);
char physaddr_str[64];
@@ -114,7 +114,7 @@ rte_eal_hugepage_init(void)
seg = &mcfg->memseg[seg_idx++];
seg->addr = addr;
- seg->phys_addr = physaddr;
+ seg->iova = physaddr;
seg->hugepage_sz = hpi->hugepage_sz;
seg->len = hpi->hugepage_sz;
seg->nchannel = mcfg->nchannel;
diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 8f9d06f86..fc6c44da1 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -95,11 +95,11 @@ rte_dump_physmem_layout(FILE *f)
if (mcfg->memseg[i].addr == NULL)
break;
- fprintf(f, "Segment %u: phys:0x%"PRIx64", len:%zu, "
+ fprintf(f, "Segment %u: IOVA:0x%"PRIx64", len:%zu, "
"virt:%p, socket_id:%"PRId32", "
"hugepage_sz:%"PRIu64", nchannel:%"PRIx32", "
"nrank:%"PRIx32"\n", i,
- mcfg->memseg[i].phys_addr,
+ mcfg->memseg[i].iova,
mcfg->memseg[i].len,
mcfg->memseg[i].addr,
mcfg->memseg[i].socket_id,
diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index f7eed9ab6..78f48503e 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -107,7 +107,11 @@ typedef uint64_t rte_iova_t;
* Physical memory segment descriptor.
*/
struct rte_memseg {
- phys_addr_t phys_addr; /**< Start physical address. */
+ RTE_STD_C11
+ union {
+ phys_addr_t phys_addr; /**< deprecated - Start physical address. */
+ rte_iova_t iova; /**< Start IO address. */
+ };
RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
@@ -138,7 +142,7 @@ int rte_mem_lock_page(const void *virt);
* @param virt
* The virtual address.
* @return
- * The physical address or RTE_BAD_PHYS_ADDR on error.
+ * The physical address or RTE_BAD_IOVA on error.
*/
phys_addr_t rte_mem_virt2phy(const void *virt);
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index d65c05a4d..0028128a5 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -255,13 +255,13 @@ rte_malloc_virt2phy(const void *addr)
const struct malloc_elem *elem = malloc_elem_from_data(addr);
if (elem == NULL)
return RTE_BAD_PHYS_ADDR;
- if (elem->ms->phys_addr == RTE_BAD_PHYS_ADDR)
- return RTE_BAD_PHYS_ADDR;
+ if (elem->ms->iova == RTE_BAD_IOVA)
+ return RTE_BAD_IOVA;
if (rte_eal_iova_mode() == RTE_IOVA_VA)
paddr = (uintptr_t)addr;
else
- paddr = elem->ms->phys_addr +
+ paddr = elem->ms->iova +
((uintptr_t)addr - (uintptr_t)elem->ms->addr);
return paddr;
}
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 10b42d2fe..284758ac4 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -133,7 +133,7 @@ rte_mem_virt2phy(const void *virtaddr)
/* Cannot parse /proc/self/pagemap, no need to log errors everywhere */
if (!phys_addrs_available)
- return RTE_BAD_PHYS_ADDR;
+ return RTE_BAD_IOVA;
/* standard page size */
page_size = getpagesize();
@@ -142,7 +142,7 @@ rte_mem_virt2phy(const void *virtaddr)
if (fd < 0) {
RTE_LOG(ERR, EAL, "%s(): cannot open /proc/self/pagemap: %s\n",
__func__, strerror(errno));
- return RTE_BAD_PHYS_ADDR;
+ return RTE_BAD_IOVA;
}
virt_pfn = (unsigned long)virtaddr / page_size;
@@ -151,7 +151,7 @@ rte_mem_virt2phy(const void *virtaddr)
RTE_LOG(ERR, EAL, "%s(): seek error in /proc/self/pagemap: %s\n",
__func__, strerror(errno));
close(fd);
- return RTE_BAD_PHYS_ADDR;
+ return RTE_BAD_IOVA;
}
retval = read(fd, &page, PFN_MASK_SIZE);
@@ -159,12 +159,12 @@ rte_mem_virt2phy(const void *virtaddr)
if (retval < 0) {
RTE_LOG(ERR, EAL, "%s(): cannot read /proc/self/pagemap: %s\n",
__func__, strerror(errno));
- return RTE_BAD_PHYS_ADDR;
+ return RTE_BAD_IOVA;
} else if (retval != PFN_MASK_SIZE) {
RTE_LOG(ERR, EAL, "%s(): read %d bytes from /proc/self/pagemap "
"but expected %d:\n",
__func__, retval, PFN_MASK_SIZE);
- return RTE_BAD_PHYS_ADDR;
+ return RTE_BAD_IOVA;
}
/*
@@ -172,7 +172,7 @@ rte_mem_virt2phy(const void *virtaddr)
* pagemap.txt in linux Documentation)
*/
if ((page & 0x7fffffffffffffULL) == 0)
- return RTE_BAD_PHYS_ADDR;
+ return RTE_BAD_IOVA;
physaddr = ((page & 0x7fffffffffffffULL) * page_size)
+ ((unsigned long)virtaddr % page_size);
@@ -1031,9 +1031,9 @@ rte_eal_hugepage_init(void)
return -1;
}
if (rte_eal_iova_mode() == RTE_IOVA_VA)
- mcfg->memseg[0].phys_addr = (uintptr_t)addr;
+ mcfg->memseg[0].iova = (uintptr_t)addr;
else
- mcfg->memseg[0].phys_addr = RTE_BAD_PHYS_ADDR;
+ mcfg->memseg[0].iova = RTE_BAD_IOVA;
mcfg->memseg[0].addr = addr;
mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
mcfg->memseg[0].len = internal_config.memory;
@@ -1282,7 +1282,7 @@ rte_eal_hugepage_init(void)
if (j == RTE_MAX_MEMSEG)
break;
- mcfg->memseg[j].phys_addr = hugepage[i].physaddr;
+ mcfg->memseg[j].iova = hugepage[i].physaddr;
mcfg->memseg[j].addr = hugepage[i].final_va;
mcfg->memseg[j].len = hugepage[i].size;
mcfg->memseg[j].socket_id = hugepage[i].socket_id;
@@ -1293,7 +1293,7 @@ rte_eal_hugepage_init(void)
#ifdef RTE_ARCH_PPC_64
/* Use the phy and virt address of the last page as segment
* address for IBM Power architecture */
- mcfg->memseg[j].phys_addr = hugepage[i].physaddr;
+ mcfg->memseg[j].iova = hugepage[i].physaddr;
mcfg->memseg[j].addr = hugepage[i].final_va;
#endif
mcfg->memseg[j].len += mcfg->memseg[j].hugepage_sz;
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 5bbcdf9b9..b60921487 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -713,7 +713,7 @@ vfio_type1_dma_map(int vfio_container_fd)
if (rte_eal_iova_mode() == RTE_IOVA_VA)
dma_map.iova = dma_map.vaddr;
else
- dma_map.iova = ms[i].phys_addr;
+ dma_map.iova = ms[i].iova;
dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE;
ret = ioctl(vfio_container_fd, VFIO_IOMMU_MAP_DMA, &dma_map);
@@ -772,7 +772,7 @@ vfio_spapr_dma_map(int vfio_container_fd)
break;
create.window_size = RTE_MAX(create.window_size,
- ms[i].phys_addr + ms[i].len);
+ ms[i].iova + ms[i].len);
}
/* sPAPR requires window size to be a power of 2 */
@@ -816,7 +816,7 @@ vfio_spapr_dma_map(int vfio_container_fd)
if (rte_eal_iova_mode() == RTE_IOVA_VA)
dma_map.iova = dma_map.vaddr;
else
- dma_map.iova = ms[i].phys_addr;
+ dma_map.iova = ms[i].iova;
dma_map.flags = VFIO_DMA_MAP_FLAG_READ |
VFIO_DMA_MAP_FLAG_WRITE;
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 04/15] mem: rename address mapping function to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
` (2 preceding siblings ...)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 03/15] mem: rename segment address from physical to IOVA Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 5:41 ` santosh
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 05/15] malloc: " Thomas Monjalon
` (11 subsequent siblings)
15 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
The function rte_mem_virt2phy() is kept and used in functions which
works only with physical addresses.
For all other calls this function is replaced by rte_mem_virt2iova()
which does a direct mapping (no conversion) in the VA case.
Note: the new function rte_mem_virt2iova() function matches the
behaviour implemented in rte_mem_virt2phy() by the commit
680f6c12600f ("mem: honor IOVA mode in virt2phy")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/bus/dpaa/base/qbman/qman.c | 2 +-
drivers/bus/dpaa/base/qbman/qman.h | 2 +-
drivers/net/bnxt/bnxt_ethdev.c | 8 ++++----
drivers/net/bnxt/bnxt_hwrm.c | 20 ++++++++++----------
drivers/net/bnxt/bnxt_ring.c | 4 ++--
drivers/net/bnxt/bnxt_vnic.c | 4 ++--
drivers/net/liquidio/lio_rxtx.c | 2 +-
lib/librte_cryptodev/rte_cryptodev.c | 2 +-
lib/librte_eal/bsdapp/eal/eal_memory.c | 5 +++++
lib/librte_eal/common/include/rte_memory.h | 10 ++++++++++
lib/librte_eal/linuxapp/eal/eal_memory.c | 11 ++++++++---
lib/librte_eal/rte_eal_version.map | 1 +
lib/librte_mempool/rte_mempool.c | 4 ++--
lib/librte_vhost/vhost_user.c | 4 ++--
test/test/test_mempool.c | 4 ++--
15 files changed, 52 insertions(+), 31 deletions(-)
diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index 8c8d270f8..87fec60d1 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -1351,7 +1351,7 @@ int qman_init_fq(struct qman_fq *fq, u32 flags, struct qm_mcc_initfq *opts)
memset(&mcc->initfq.fqd.context_a, 0,
sizeof(mcc->initfq.fqd.context_a));
} else {
- phys_fq = rte_mem_virt2phy(fq);
+ phys_fq = rte_mem_virt2iova(fq);
qm_fqd_stashing_set64(&mcc->initfq.fqd, phys_fq);
}
}
diff --git a/drivers/bus/dpaa/base/qbman/qman.h b/drivers/bus/dpaa/base/qbman/qman.h
index 7c645f478..2c0f694cd 100644
--- a/drivers/bus/dpaa/base/qbman/qman.h
+++ b/drivers/bus/dpaa/base/qbman/qman.h
@@ -240,7 +240,7 @@ struct qm_portal {
#define EQCR_CARRYCLEAR(p) \
(void *)((unsigned long)(p) & (~(unsigned long)(QM_EQCR_SIZE << 6)))
-extern dma_addr_t rte_mem_virt2phy(const void *addr);
+extern dma_addr_t rte_mem_virt2iova(const void *addr);
/* Bit-wise logic to convert a ring pointer to a ring index */
static inline u8 EQCR_PTR2IDX(struct qm_eqcr_entry *e)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index b6c1daec7..9dc3901e1 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2852,8 +2852,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ "Using rte_mem_virt2iova()\n");
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map address to physical memory\n");
@@ -2887,8 +2887,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ "Using rte_mem_virt2iova()\n");
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map address to physical memory\n");
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 6e0e40f82..1fdc51cba 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -277,7 +277,7 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp,
if (!(mask & HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN))
mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY;
req.vlan_tag_tbl_addr = rte_cpu_to_le_64(
- rte_mem_virt2phy(vlan_table));
+ rte_mem_virt2iova(vlan_table));
req.num_vlan_tags = rte_cpu_to_le_32((uint32_t)vlan_count);
}
req.mask = rte_cpu_to_le_32(mask);
@@ -318,7 +318,7 @@ int bnxt_hwrm_cfa_vlan_antispoof_cfg(struct bnxt *bp, uint16_t fid,
req.fid = rte_cpu_to_le_16(fid);
req.vlan_tag_mask_tbl_addr =
- rte_cpu_to_le_64(rte_mem_virt2phy(vlan_table));
+ rte_cpu_to_le_64(rte_mem_virt2iova(vlan_table));
req.num_vlan_entries = rte_cpu_to_le_32((uint32_t)vlan_count);
rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
@@ -644,7 +644,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
}
rte_mem_lock_page(bp->hwrm_cmd_resp_addr);
bp->hwrm_cmd_resp_dma_addr =
- rte_mem_virt2phy(bp->hwrm_cmd_resp_addr);
+ rte_mem_virt2iova(bp->hwrm_cmd_resp_addr);
if (bp->hwrm_cmd_resp_dma_addr == 0) {
RTE_LOG(ERR, PMD,
"Unable to map response buffer to physical memory.\n");
@@ -670,7 +670,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
}
rte_mem_lock_page(bp->hwrm_short_cmd_req_addr);
bp->hwrm_short_cmd_req_dma_addr =
- rte_mem_virt2phy(bp->hwrm_short_cmd_req_addr);
+ rte_mem_virt2iova(bp->hwrm_short_cmd_req_addr);
if (bp->hwrm_short_cmd_req_dma_addr == 0) {
rte_free(bp->hwrm_short_cmd_req_addr);
RTE_LOG(ERR, PMD,
@@ -1753,7 +1753,7 @@ int bnxt_alloc_hwrm_resources(struct bnxt *bp)
if (bp->hwrm_cmd_resp_addr == NULL)
return -ENOMEM;
bp->hwrm_cmd_resp_dma_addr =
- rte_mem_virt2phy(bp->hwrm_cmd_resp_addr);
+ rte_mem_virt2iova(bp->hwrm_cmd_resp_addr);
if (bp->hwrm_cmd_resp_dma_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map response address to physical memory\n");
@@ -2622,7 +2622,7 @@ int bnxt_hwrm_func_buf_rgtr(struct bnxt *bp)
page_getenum(bp->pf.active_vfs * HWRM_MAX_REQ_LEN));
req.req_buf_len = rte_cpu_to_le_16(HWRM_MAX_REQ_LEN);
req.req_buf_page_addr[0] =
- rte_cpu_to_le_64(rte_mem_virt2phy(bp->pf.vf_req_buf));
+ rte_cpu_to_le_64(rte_mem_virt2iova(bp->pf.vf_req_buf));
if (req.req_buf_page_addr[0] == 0) {
RTE_LOG(ERR, PMD,
"unable to map buffer address to physical memory\n");
@@ -3044,7 +3044,7 @@ int bnxt_get_nvram_directory(struct bnxt *bp, uint32_t len, uint8_t *data)
rte_mem_lock_page(buf);
if (buf == NULL)
return -ENOMEM;
- dma_handle = rte_mem_virt2phy(buf);
+ dma_handle = rte_mem_virt2iova(buf);
if (dma_handle == 0) {
RTE_LOG(ERR, PMD,
"unable to map response address to physical memory\n");
@@ -3080,7 +3080,7 @@ int bnxt_hwrm_get_nvram_item(struct bnxt *bp, uint32_t index,
if (!buf)
return -ENOMEM;
- dma_handle = rte_mem_virt2phy(buf);
+ dma_handle = rte_mem_virt2iova(buf);
if (dma_handle == 0) {
RTE_LOG(ERR, PMD,
"unable to map response address to physical memory\n");
@@ -3141,7 +3141,7 @@ int bnxt_hwrm_flash_nvram(struct bnxt *bp, uint16_t dir_type,
if (!buf)
return -ENOMEM;
- dma_handle = rte_mem_virt2phy(buf);
+ dma_handle = rte_mem_virt2iova(buf);
if (dma_handle == 0) {
RTE_LOG(ERR, PMD,
"unable to map response address to physical memory\n");
@@ -3196,7 +3196,7 @@ static int bnxt_hwrm_func_vf_vnic_query(struct bnxt *bp, uint16_t vf,
req.vf_id = rte_cpu_to_le_16(bp->pf.first_vf_id + vf);
req.max_vnic_id_cnt = rte_cpu_to_le_32(bp->pf.total_vnics);
- req.vnic_id_tbl_addr = rte_cpu_to_le_64(rte_mem_virt2phy(vnic_ids));
+ req.vnic_id_tbl_addr = rte_cpu_to_le_64(rte_mem_virt2iova(vnic_ids));
if (req.vnic_id_tbl_addr == 0) {
HWRM_UNLOCK();
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 583c82569..efec2048e 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -177,10 +177,10 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
+ "Using rte_mem_virt2iova()\n");
for (sz = 0; sz < total_alloc_len; sz += getpagesize())
rte_mem_lock_page(((char *)mz->addr) + sz);
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map ring address to physical memory\n");
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 6f7c05bdf..cbcf9920a 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -197,8 +197,8 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
RTE_LOG(WARNING, PMD,
- "Using rte_mem_virt2phy()\n");
- mz_phys_addr = rte_mem_virt2phy(mz->addr);
+ "Using rte_mem_virt2iova()\n");
+ mz_phys_addr = rte_mem_virt2iova(mz->addr);
if (mz_phys_addr == 0) {
RTE_LOG(ERR, PMD,
"unable to map vnic address to physical memory\n");
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 2bbb893c2..773dfd30a 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -1790,7 +1790,7 @@ lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
m = m->next;
}
- phyaddr = rte_mem_virt2phy(g->sg);
+ phyaddr = rte_mem_virt2iova(g->sg);
if (phyaddr == RTE_BAD_PHYS_ADDR) {
PMD_TX_LOG(lio_dev, ERR, "bad phys addr\n");
goto xmit_failed;
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 80632117e..e5f287634 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -1284,7 +1284,7 @@ rte_crypto_op_init(struct rte_mempool *mempool,
__rte_crypto_op_reset(op, type);
- op->phys_addr = rte_mem_virt2phy(_op_data);
+ op->phys_addr = rte_mem_virt2iova(_op_data);
op->mempool = mempool;
}
diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index 66fab768f..0e021fff1 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -58,6 +58,11 @@ rte_mem_virt2phy(const void *virtaddr)
(void)virtaddr;
return RTE_BAD_IOVA;
}
+rte_iova_t
+rte_mem_virt2iova(const void *virtaddr)
+{
+ return rte_mem_virt2phy(virtaddr);
+}
int
rte_eal_hugepage_init(void)
diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index 78f48503e..c13300cc7 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -146,6 +146,16 @@ int rte_mem_lock_page(const void *virt);
*/
phys_addr_t rte_mem_virt2phy(const void *virt);
+/**
+ * Get IO virtual address of any mapped virtual address in the current process.
+ *
+ * @param virt
+ * The virtual address.
+ * @return
+ * The IO address or RTE_BAD_IOVA on error.
+ */
+rte_iova_t rte_mem_virt2iova(const void *virt);
+
/**
* Get the layout of the available physical memory.
*
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 284758ac4..a54b822ab 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -128,9 +128,6 @@ rte_mem_virt2phy(const void *virtaddr)
int page_size;
off_t offset;
- if (rte_eal_iova_mode() == RTE_IOVA_VA)
- return (uintptr_t)virtaddr;
-
/* Cannot parse /proc/self/pagemap, no need to log errors everywhere */
if (!phys_addrs_available)
return RTE_BAD_IOVA;
@@ -180,6 +177,14 @@ rte_mem_virt2phy(const void *virtaddr)
return physaddr;
}
+rte_iova_t
+rte_mem_virt2iova(const void *virtaddr)
+{
+ if (rte_eal_iova_mode() == RTE_IOVA_VA)
+ return (uintptr_t)virtaddr;
+ return rte_mem_virt2phy(virtaddr);
+}
+
/*
* For each hugepage in hugepg_tbl, fill the physaddr value. We find
* it by browsing the /proc/self/pagemap special file.
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 7c9bdc2ae..a600881f0 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -234,6 +234,7 @@ DPDK_17.11 {
rte_eal_vfio_intr_mode;
rte_lcore_has_role;
rte_memcpy_ptr;
+ rte_mem_virt2iova;
vfio_enable;
vfio_is_enabled;
vfio_noiommu_is_enabled;
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 6357fd48e..f62054e23 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -503,7 +503,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
for (off = 0; off + pg_sz <= len &&
mp->populated_size < mp->size; off += phys_len) {
- paddr = rte_mem_virt2phy(addr + off);
+ paddr = rte_mem_virt2iova(addr + off);
if (paddr == RTE_BAD_PHYS_ADDR && rte_eal_has_hugepages()) {
ret = -EINVAL;
@@ -514,7 +514,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
for (phys_len = pg_sz; off + phys_len < len; phys_len += pg_sz) {
phys_addr_t paddr_tmp;
- paddr_tmp = rte_mem_virt2phy(addr + off + phys_len);
+ paddr_tmp = rte_mem_virt2iova(addr + off + phys_len);
if (paddr_tmp != paddr + phys_len)
break;
diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 1f6cba4b9..97a5c3f1c 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -526,7 +526,7 @@ add_guest_pages(struct virtio_net *dev, struct rte_vhost_mem_region *reg,
uint64_t host_phys_addr;
uint64_t size;
- host_phys_addr = rte_mem_virt2phy((void *)(uintptr_t)host_user_addr);
+ host_phys_addr = rte_mem_virt2iova((void *)(uintptr_t)host_user_addr);
size = page_size - (guest_phys_addr & (page_size - 1));
size = RTE_MIN(size, reg_size);
@@ -537,7 +537,7 @@ add_guest_pages(struct virtio_net *dev, struct rte_vhost_mem_region *reg,
while (reg_size > 0) {
size = RTE_MIN(reg_size, page_size);
- host_phys_addr = rte_mem_virt2phy((void *)(uintptr_t)
+ host_phys_addr = rte_mem_virt2iova((void *)(uintptr_t)
host_user_addr);
add_one_guest_page(dev, guest_phys_addr, host_phys_addr, size);
diff --git a/test/test/test_mempool.c b/test/test/test_mempool.c
index dee73d658..fa8bad39f 100644
--- a/test/test/test_mempool.c
+++ b/test/test/test_mempool.c
@@ -144,9 +144,9 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache)
MEMPOOL_HEADER_SIZE(mp, mp->cache_size))
GOTO_ERR(ret, out);
-#ifndef RTE_EXEC_ENV_BSDAPP /* rte_mem_virt2phy() not supported on bsd */
+#ifndef RTE_EXEC_ENV_BSDAPP /* rte_mem_virt2iova() not supported on bsd */
printf("get physical address of an object\n");
- if (rte_mempool_virt2phy(mp, obj) != rte_mem_virt2phy(obj))
+ if (rte_mempool_virt2phy(mp, obj) != rte_mem_virt2iova(obj))
GOTO_ERR(ret, out);
#endif
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 05/15] malloc: rename address mapping function to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
` (3 preceding siblings ...)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 04/15] mem: rename address mapping function " Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 5:47 ` santosh
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 06/15] malloc: use pointer diff macro in IOVA mapping Thomas Monjalon
` (10 subsequent siblings)
15 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
The function rte_malloc_virt2phy() is renamed to rte_malloc_virt2iova().
The deprecated name is kept as an alias to avoid breaking the API.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-crypto-perf/cperf_test_vector_parsing.c | 4 ++--
app/test-crypto-perf/cperf_test_vectors.c | 6 +++---
drivers/mempool/octeontx/octeontx_fpavf.c | 2 +-
drivers/net/ark/ark_ethdev_rx.c | 4 ++--
drivers/net/ark/ark_ethdev_tx.c | 4 ++--
drivers/net/octeontx/base/octeontx_pkovf.c | 2 +-
drivers/net/sfc/sfc_tso.c | 2 +-
examples/l2fwd-crypto/main.c | 2 +-
lib/librte_eal/common/eal_common_memzone.c | 2 +-
lib/librte_eal/common/include/rte_malloc.h | 17 ++++++++++++-----
lib/librte_eal/common/rte_malloc.c | 16 ++++++++--------
lib/librte_eal/rte_eal_version.map | 2 +-
12 files changed, 35 insertions(+), 28 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c
index 3952632c1..d4736f9ef 100644
--- a/app/test-crypto-perf/cperf_test_vector_parsing.c
+++ b/app/test-crypto-perf/cperf_test_vector_parsing.c
@@ -445,7 +445,7 @@ parse_entry(char *entry, struct cperf_test_vector *vector,
} else if (strstr(key_token, "aad")) {
rte_free(vector->aad.data);
vector->aad.data = data;
- vector->aad.phys_addr = rte_malloc_virt2phy(vector->aad.data);
+ vector->aad.phys_addr = rte_malloc_virt2iova(vector->aad.data);
if (tc_found)
vector->aad.length = data_length;
else {
@@ -460,7 +460,7 @@ parse_entry(char *entry, struct cperf_test_vector *vector,
} else if (strstr(key_token, "digest")) {
rte_free(vector->digest.data);
vector->digest.data = data;
- vector->digest.phys_addr = rte_malloc_virt2phy(
+ vector->digest.phys_addr = rte_malloc_virt2iova(
vector->digest.data);
if (tc_found)
vector->digest.length = data_length;
diff --git a/app/test-crypto-perf/cperf_test_vectors.c b/app/test-crypto-perf/cperf_test_vectors.c
index e51dcc3f1..fa911ff69 100644
--- a/app/test-crypto-perf/cperf_test_vectors.c
+++ b/app/test-crypto-perf/cperf_test_vectors.c
@@ -498,7 +498,7 @@ cperf_test_vector_get_dummy(struct cperf_options *options)
return NULL;
}
t_vec->digest.phys_addr =
- rte_malloc_virt2phy(t_vec->digest.data);
+ rte_malloc_virt2iova(t_vec->digest.data);
t_vec->digest.length = options->digest_sz;
memcpy(t_vec->digest.data, digest,
options->digest_sz);
@@ -531,7 +531,7 @@ cperf_test_vector_get_dummy(struct cperf_options *options)
return NULL;
}
memcpy(t_vec->aad.data, aad, options->aead_aad_sz);
- t_vec->aad.phys_addr = rte_malloc_virt2phy(t_vec->aad.data);
+ t_vec->aad.phys_addr = rte_malloc_virt2iova(t_vec->aad.data);
t_vec->aad.length = options->aead_aad_sz;
} else {
t_vec->aad.data = NULL;
@@ -546,7 +546,7 @@ cperf_test_vector_get_dummy(struct cperf_options *options)
return NULL;
}
t_vec->digest.phys_addr =
- rte_malloc_virt2phy(t_vec->digest.data);
+ rte_malloc_virt2iova(t_vec->digest.data);
t_vec->digest.length = options->digest_sz;
memcpy(t_vec->digest.data, digest, options->digest_sz);
t_vec->data.aead_offset = 0;
diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c
index 07b6ffbe2..bab841ccd 100644
--- a/drivers/mempool/octeontx/octeontx_fpavf.c
+++ b/drivers/mempool/octeontx/octeontx_fpavf.c
@@ -244,7 +244,7 @@ octeontx_fpapf_pool_setup(unsigned int gpool, unsigned int buf_size,
/* Configure stack */
fpa->pool_stack_base = memptr;
- phys_addr = rte_malloc_virt2phy(memptr);
+ phys_addr = rte_malloc_virt2iova(memptr);
buf_size /= FPA_LN_SIZE;
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index f5d812a55..4e39d9557 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -99,11 +99,11 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
phys_addr_t phys_addr_q_base;
phys_addr_t phys_addr_prod_index;
- queue_base = rte_malloc_virt2phy(queue);
+ queue_base = rte_malloc_virt2iova(queue);
phys_addr_prod_index = queue_base +
offsetof(struct ark_rx_queue, prod_index);
- phys_addr_q_base = rte_malloc_virt2phy(queue->paddress_q);
+ phys_addr_q_base = rte_malloc_virt2iova(queue->paddress_q);
/* Verify HW */
if (ark_mpu_verify(queue->mpu, sizeof(phys_addr_t))) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 0e2d60deb..57841dfd1 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -317,8 +317,8 @@ eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
if (ark_mpu_verify(queue->mpu, sizeof(struct ark_tx_meta)))
return -1;
- queue_base = rte_malloc_virt2phy(queue);
- ring_base = rte_malloc_virt2phy(queue->meta_q);
+ queue_base = rte_malloc_virt2iova(queue);
+ ring_base = rte_malloc_virt2iova(queue->meta_q);
cons_index_addr =
queue_base + offsetof(struct ark_tx_queue, cons_index);
diff --git a/drivers/net/octeontx/base/octeontx_pkovf.c b/drivers/net/octeontx/base/octeontx_pkovf.c
index 2bf607b15..64e5d69b1 100644
--- a/drivers/net/octeontx/base/octeontx_pkovf.c
+++ b/drivers/net/octeontx/base/octeontx_pkovf.c
@@ -485,7 +485,7 @@ octeontx_pko_init_fc(const size_t pko_vf_count)
return -ENOMEM;
}
- pko_vf_ctl.fc_iomem.iova = rte_malloc_virt2phy((void *)
+ pko_vf_ctl.fc_iomem.iova = rte_malloc_virt2iova((void *)
pko_vf_ctl.fc_iomem.va);
pko_vf_ctl.fc_iomem.size = fc_mem_size;
diff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c
index fb79d7491..ad100676e 100644
--- a/drivers/net/sfc/sfc_tso.c
+++ b/drivers/net/sfc/sfc_tso.c
@@ -155,7 +155,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
header_len);
tsoh = txq->sw_ring[idx & txq->ptr_mask].tsoh;
- header_paddr = rte_malloc_virt2phy((void *)tsoh);
+ header_paddr = rte_malloc_virt2iova((void *)tsoh);
} else {
if (m->data_len == header_len) {
*in_off = 0;
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 841666028..06f90ab4a 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2484,7 +2484,7 @@ reserve_key_memory(struct l2fwd_crypto_options *options)
options->aad.data = rte_malloc("aad", MAX_KEY_SIZE, 0);
if (options->aad.data == NULL)
rte_exit(EXIT_FAILURE, "Failed to allocate memory for AAD");
- options->aad.phys_addr = rte_malloc_virt2phy(options->aad.data);
+ options->aad.phys_addr = rte_malloc_virt2iova(options->aad.data);
}
int
diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c
index 3026e36b8..ab681101b 100644
--- a/lib/librte_eal/common/eal_common_memzone.c
+++ b/lib/librte_eal/common/eal_common_memzone.c
@@ -251,7 +251,7 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,
mcfg->memzone_cnt++;
snprintf(mz->name, sizeof(mz->name), "%s", name);
- mz->phys_addr = rte_malloc_virt2phy(mz_addr);
+ mz->phys_addr = rte_malloc_virt2iova(mz_addr);
mz->addr = mz_addr;
mz->len = (requested_len == 0 ? elem->size : requested_len);
mz->hugepage_sz = elem->ms->hugepage_sz;
diff --git a/lib/librte_eal/common/include/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h
index 3d37f79b8..5d4c11a7c 100644
--- a/lib/librte_eal/common/include/rte_malloc.h
+++ b/lib/librte_eal/common/include/rte_malloc.h
@@ -323,17 +323,24 @@ int
rte_malloc_set_limit(const char *type, size_t max);
/**
- * Return the physical address of a virtual address obtained through
+ * Return the IO address of a virtual address obtained through
* rte_malloc
*
* @param addr
* Address obtained from a previous rte_malloc call
* @return
- * RTE_BAD_PHYS_ADDR on error
- * otherwise return physical address of the buffer
+ * RTE_BAD_IOVA on error
+ * otherwise return an address suitable for IO
*/
-phys_addr_t
-rte_malloc_virt2phy(const void *addr);
+rte_iova_t
+rte_malloc_virt2iova(const void *addr);
+
+__rte_deprecated
+static inline phys_addr_t
+rte_malloc_virt2phy(const void *addr)
+{
+ return rte_malloc_virt2iova(addr);
+}
#ifdef __cplusplus
}
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index 0028128a5..53057fcba 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -246,22 +246,22 @@ rte_malloc_set_limit(__rte_unused const char *type,
}
/*
- * Return the physical address of a virtual address obtained through rte_malloc
+ * Return the IO address of a virtual address obtained through rte_malloc
*/
-phys_addr_t
-rte_malloc_virt2phy(const void *addr)
+rte_iova_t
+rte_malloc_virt2iova(const void *addr)
{
- phys_addr_t paddr;
+ rte_iova_t iova;
const struct malloc_elem *elem = malloc_elem_from_data(addr);
if (elem == NULL)
- return RTE_BAD_PHYS_ADDR;
+ return RTE_BAD_IOVA;
if (elem->ms->iova == RTE_BAD_IOVA)
return RTE_BAD_IOVA;
if (rte_eal_iova_mode() == RTE_IOVA_VA)
- paddr = (uintptr_t)addr;
+ iova = (uintptr_t)addr;
else
- paddr = elem->ms->iova +
+ iova = elem->ms->iova +
((uintptr_t)addr - (uintptr_t)elem->ms->addr);
- return paddr;
+ return iova;
}
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index a600881f0..b4d7cd93c 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -60,7 +60,6 @@ DPDK_2.0 {
rte_malloc_set_limit;
rte_malloc_socket;
rte_malloc_validate;
- rte_malloc_virt2phy;
rte_mem_lock_page;
rte_mem_virt2phy;
rte_memdump;
@@ -233,6 +232,7 @@ DPDK_17.11 {
rte_eal_using_phys_addrs;
rte_eal_vfio_intr_mode;
rte_lcore_has_role;
+ rte_malloc_virt2iova;
rte_memcpy_ptr;
rte_mem_virt2iova;
vfio_enable;
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 06/15] malloc: use pointer diff macro in IOVA mapping
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
` (4 preceding siblings ...)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 05/15] malloc: " Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 07/15] memzone: rename address from physical to IOVA Thomas Monjalon
` (9 subsequent siblings)
15 siblings, 0 replies; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
From: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Use RTE_PTR_DIFF macro in rte_mem_virt2iova api.
Suggested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
lib/librte_eal/common/rte_malloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index 53057fcba..fe2278bcd 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -262,6 +262,6 @@ rte_malloc_virt2iova(const void *addr)
iova = (uintptr_t)addr;
else
iova = elem->ms->iova +
- ((uintptr_t)addr - (uintptr_t)elem->ms->addr);
+ RTE_PTR_DIFF(addr, elem->ms->addr);
return iova;
}
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 07/15] memzone: rename address from physical to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
` (5 preceding siblings ...)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 06/15] malloc: use pointer diff macro in IOVA mapping Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 5:50 ` santosh
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 08/15] mempool: rename addresses " Thomas Monjalon
` (8 subsequent siblings)
15 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
The struct rte_memzone field .phys_addr is renamed to .iova.
The deprecated name is kept in an anonymous union to avoid breaking
the API.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/crypto/qat/qat_qp.c | 2 +-
drivers/net/bnx2x/bnx2x.c | 2 +-
drivers/net/bnx2x/bnx2x_rxtx.c | 6 +--
drivers/net/bnxt/bnxt_ethdev.c | 4 +-
drivers/net/bnxt/bnxt_ring.c | 4 +-
drivers/net/bnxt/bnxt_vnic.c | 2 +-
drivers/net/cxgbe/sge.c | 2 +-
drivers/net/e1000/em_rxtx.c | 4 +-
drivers/net/e1000/igb_rxtx.c | 4 +-
drivers/net/ena/base/ena_plat_dpdk.h | 4 +-
drivers/net/enic/enic_main.c | 6 +--
drivers/net/fm10k/fm10k_ethdev.c | 4 +-
drivers/net/i40e/i40e_ethdev.c | 2 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 8 +--
drivers/net/ixgbe/ixgbe_rxtx.c | 4 +-
drivers/net/liquidio/lio_rxtx.c | 6 +--
drivers/net/nfp/nfp_net.c | 4 +-
drivers/net/qede/base/bcm_osal.c | 10 ++--
drivers/net/qede/qede_fdir.c | 2 +-
drivers/net/sfc/sfc.c | 2 +-
drivers/net/thunderx/nicvf_ethdev.c | 6 +--
drivers/net/virtio/virtio_ethdev.c | 8 +--
drivers/net/vmxnet3/vmxnet3_ethdev.c | 8 +--
drivers/net/vmxnet3/vmxnet3_rxtx.c | 4 +-
lib/librte_eal/common/eal_common_memzone.c | 6 +--
lib/librte_eal/common/include/rte_memzone.h | 6 ++-
lib/librte_mempool/rte_mempool.c | 4 +-
test/test/test_memzone.c | 80 ++++++++++++++---------------
29 files changed, 105 insertions(+), 101 deletions(-)
diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
index 814ba17a9..94aeb9f63 100644
--- a/drivers/crypto/qat/qat_qp.c
+++ b/drivers/crypto/qat/qat_qp.c
@@ -373,7 +373,7 @@ qat_queue_create(struct rte_cryptodev *dev, struct qat_queue *queue,
}
queue->base_addr = (char *)qp_mz->addr;
- queue->base_phys_addr = qp_mz->phys_addr;
+ queue->base_phys_addr = qp_mz->iova;
if (qat_qp_check_queue_alignment(queue->base_phys_addr,
queue_size_bytes)) {
PMD_DRV_LOG(ERR, "Invalid alignment on queue create "
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 44222af2f..6b4526b18 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -184,7 +184,7 @@ bnx2x_dma_alloc(struct bnx2x_softc *sc, size_t size, struct bnx2x_dma *dma,
PMD_DRV_LOG(ERR, "DMA alloc failed for %s", msg);
return -ENOMEM;
}
- dma->paddr = (uint64_t) z->phys_addr;
+ dma->paddr = (uint64_t) z->iova;
dma->vaddr = z->addr;
PMD_DRV_LOG(DEBUG, "%s: virt=%p phys=%" PRIx64, msg, dma->vaddr, dma->paddr);
diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c
index c72067f6f..99d7d285c 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.c
+++ b/drivers/net/bnx2x/bnx2x_rxtx.c
@@ -108,7 +108,7 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
bnx2x_rx_queue_release(rxq);
return -ENOMEM;
}
- fp->rx_desc_mapping = rxq->rx_ring_phys_addr = (uint64_t)dma->phys_addr;
+ fp->rx_desc_mapping = rxq->rx_ring_phys_addr = (uint64_t)dma->iova;
rxq->rx_ring = (uint64_t*)dma->addr;
memset((void *)rxq->rx_ring, 0, dma_size);
@@ -154,7 +154,7 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
PMD_RX_LOG(ERR, "RCQ alloc failed");
return -ENOMEM;
}
- fp->rx_comp_mapping = rxq->cq_ring_phys_addr = (uint64_t)dma->phys_addr;
+ fp->rx_comp_mapping = rxq->cq_ring_phys_addr = (uint64_t)dma->iova;
rxq->cq_ring = (union eth_rx_cqe*)dma->addr;
/* Link the CQ chain pages. */
@@ -289,7 +289,7 @@ bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev,
bnx2x_tx_queue_release(txq);
return -ENOMEM;
}
- fp->tx_desc_mapping = txq->tx_ring_phys_addr = (uint64_t)tz->phys_addr;
+ fp->tx_desc_mapping = txq->tx_ring_phys_addr = (uint64_t)tz->iova;
txq->tx_ring = (union eth_tx_bd_types *) tz->addr;
memset(txq->tx_ring, 0, tsize);
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 9dc3901e1..ccd50a704 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2847,7 +2847,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
return -ENOMEM;
}
memset(mz->addr, 0, mz->len);
- mz_phys_addr = mz->phys_addr;
+ mz_phys_addr = mz->iova;
if ((unsigned long)mz->addr == mz_phys_addr) {
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
@@ -2882,7 +2882,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
return -ENOMEM;
}
memset(mz->addr, 0, mz->len);
- mz_phys_addr = mz->phys_addr;
+ mz_phys_addr = mz->iova;
if ((unsigned long)mz->addr == mz_phys_addr) {
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index efec2048e..b196dd1e3 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -172,7 +172,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
return -ENOMEM;
}
memset(mz->addr, 0, mz->len);
- mz_phys_addr = mz->phys_addr;
+ mz_phys_addr = mz->iova;
if ((unsigned long)mz->addr == mz_phys_addr) {
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
@@ -231,7 +231,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
rx_ring->bd = ((char *)mz->addr + ag_ring_start);
rx_ring_info->ag_desc_ring =
(struct rx_prod_pkt_bd *)rx_ring->bd;
- rx_ring->bd_dma = mz->phys_addr + ag_ring_start;
+ rx_ring->bd_dma = mz->iova + ag_ring_start;
rx_ring_info->ag_desc_mapping = rx_ring->bd_dma;
rx_ring->mem_zone = (const void *)mz;
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index cbcf9920a..937ad6570 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -192,7 +192,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
if (!mz)
return -ENOMEM;
}
- mz_phys_addr = mz->phys_addr;
+ mz_phys_addr = mz->iova;
if ((unsigned long)mz->addr == mz_phys_addr) {
RTE_LOG(WARNING, PMD,
"Memzone physical address same as virtual.\n");
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index 33f7f0bc2..9f915158a 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -1318,7 +1318,7 @@ static void *alloc_ring(size_t nelem, size_t elem_size,
if (metadata)
*(void **)metadata = s;
- *phys = (uint64_t)tz->phys_addr;
+ *phys = (uint64_t)tz->iova;
return tz->addr;
}
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index d4d5fe6e1..32ca9202a 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -1289,7 +1289,7 @@ eth_em_tx_queue_setup(struct rte_eth_dev *dev,
txq->port_id = dev->data->port_id;
txq->tdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_TDT(queue_idx));
- txq->tx_ring_phys_addr = tz->phys_addr;
+ txq->tx_ring_phys_addr = tz->iova;
txq->tx_ring = (struct e1000_data_desc *) tz->addr;
PMD_INIT_LOG(DEBUG, "sw_ring=%p hw_ring=%p dma_addr=0x%"PRIx64,
@@ -1416,7 +1416,7 @@ eth_em_rx_queue_setup(struct rte_eth_dev *dev,
rxq->rdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDT(queue_idx));
rxq->rdh_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDH(queue_idx));
- rxq->rx_ring_phys_addr = rz->phys_addr;
+ rxq->rx_ring_phys_addr = rz->iova;
rxq->rx_ring = (struct e1000_rx_desc *) rz->addr;
PMD_INIT_LOG(DEBUG, "sw_ring=%p hw_ring=%p dma_addr=0x%"PRIx64,
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 8eee44e46..4590179e6 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -1553,7 +1553,7 @@ eth_igb_tx_queue_setup(struct rte_eth_dev *dev,
txq->port_id = dev->data->port_id;
txq->tdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_TDT(txq->reg_idx));
- txq->tx_ring_phys_addr = tz->phys_addr;
+ txq->tx_ring_phys_addr = tz->iova;
txq->tx_ring = (union e1000_adv_tx_desc *) tz->addr;
/* Allocate software ring */
@@ -1690,7 +1690,7 @@ eth_igb_rx_queue_setup(struct rte_eth_dev *dev,
}
rxq->rdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDT(rxq->reg_idx));
rxq->rdh_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDH(rxq->reg_idx));
- rxq->rx_ring_phys_addr = rz->phys_addr;
+ rxq->rx_ring_phys_addr = rz->iova;
rxq->rx_ring = (union e1000_adv_rx_desc *) rz->addr;
/* Allocate software ring. */
diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h
index 71a8c1e22..accecf518 100644
--- a/drivers/net/ena/base/ena_plat_dpdk.h
+++ b/drivers/net/ena/base/ena_plat_dpdk.h
@@ -191,7 +191,7 @@ typedef uint64_t dma_addr_t;
mz = rte_memzone_reserve(z_name, size, SOCKET_ID_ANY, 0); \
memset(mz->addr, 0, size); \
virt = mz->addr; \
- phys = mz->phys_addr; \
+ phys = mz->iova; \
handle = mz; \
} while (0)
#define ENA_MEM_FREE_COHERENT(dmadev, size, virt, phys, handle) \
@@ -209,7 +209,7 @@ typedef uint64_t dma_addr_t;
mz = rte_memzone_reserve(z_name, size, node, 0); \
memset(mz->addr, 0, size); \
virt = mz->addr; \
- phys = mz->phys_addr; \
+ phys = mz->iova; \
} while (0)
#define ENA_MEM_ALLOC_NODE(dmadev, size, virt, node, dev_node) \
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index f2e06e8d8..3a2a8d182 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -283,7 +283,7 @@ void enic_init_vnic_resources(struct enic *enic)
0 /* cq_entry_enable */,
1 /* cq_message_enable */,
0 /* interrupt offset */,
- (u64)enic->wq[index].cqmsg_rz->phys_addr);
+ (u64)enic->wq[index].cqmsg_rz->iova);
}
vnic_intr_init(&enic->intr,
@@ -362,7 +362,7 @@ enic_alloc_consistent(void *priv, size_t size,
}
vaddr = rz->addr;
- *dma_handle = (dma_addr_t)rz->phys_addr;
+ *dma_handle = (dma_addr_t)rz->iova;
mze = rte_malloc("enic memzone entry",
sizeof(struct enic_memzone_entry), 0);
@@ -395,7 +395,7 @@ enic_free_consistent(void *priv,
rte_spinlock_lock(&enic->memzone_list_lock);
LIST_FOREACH(mze, &enic->memzone_list, entries) {
if (mze->rz->addr == vaddr &&
- mze->rz->phys_addr == dma_handle)
+ mze->rz->iova == dma_handle)
break;
}
if (mze == NULL) {
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 7e52a2c9e..2d05a4669 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1893,7 +1893,7 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
return -ENOMEM;
}
q->hw_ring = mz->addr;
- q->hw_ring_phys_addr = mz->phys_addr;
+ q->hw_ring_phys_addr = mz->iova;
/* Check if number of descs satisfied Vector requirement */
if (!rte_is_power_of_2(nb_desc)) {
@@ -2053,7 +2053,7 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
return -ENOMEM;
}
q->hw_ring = mz->addr;
- q->hw_ring_phys_addr = mz->phys_addr;
+ q->hw_ring_phys_addr = mz->iova;
/*
* allocate memory for the RS bit tracker. Enough slots to hold the
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index bcd9ef1a6..c2c477e31 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3842,7 +3842,7 @@ i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_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,
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index a95a2c9ed..3d7170d53 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -265,7 +265,7 @@ i40e_fdir_setup(struct i40e_pf *pf)
goto fail_mem;
}
pf->fdir.prg_pkt = mz->addr;
- pf->fdir.dma_addr = mz->phys_addr;
+ pf->fdir.dma_addr = mz->iova;
pf->fdir.match_counter_index = I40E_COUNTER_INDEX_FDIR(hw->pf_id);
PMD_DRV_LOG(INFO, "FDIR setup successfully, with programming queue %u.",
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 904d37f08..943e1c1c2 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -1823,7 +1823,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
/* Zero all the descriptors in the ring. */
memset(rz->addr, 0, ring_size);
- rxq->rx_ring_phys_addr = rz->phys_addr;
+ rxq->rx_ring_phys_addr = rz->iova;
rxq->rx_ring = (union i40e_rx_desc *)rz->addr;
len = (uint16_t)(nb_desc + RTE_PMD_I40E_RX_MAX_BURST);
@@ -2161,7 +2161,7 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
txq->vsi = vsi;
txq->tx_deferred_start = tx_conf->tx_deferred_start;
- txq->tx_ring_phys_addr = tz->phys_addr;
+ txq->tx_ring_phys_addr = tz->iova;
txq->tx_ring = (struct i40e_tx_desc *)tz->addr;
/* Allocate software ring */
@@ -2695,7 +2695,7 @@ i40e_fdir_setup_tx_resources(struct i40e_pf *pf)
txq->reg_idx = pf->fdir.fdir_vsi->base_queue;
txq->vsi = pf->fdir.fdir_vsi;
- txq->tx_ring_phys_addr = tz->phys_addr;
+ txq->tx_ring_phys_addr = tz->iova;
txq->tx_ring = (struct i40e_tx_desc *)tz->addr;
/*
* don't need to allocate software ring and reset for the fdir
@@ -2751,7 +2751,7 @@ i40e_fdir_setup_rx_resources(struct i40e_pf *pf)
rxq->reg_idx = pf->fdir.fdir_vsi->base_queue;
rxq->vsi = pf->fdir.fdir_vsi;
- rxq->rx_ring_phys_addr = rz->phys_addr;
+ rxq->rx_ring_phys_addr = rz->iova;
rxq->rx_ring = (union i40e_rx_desc *)rz->addr;
/*
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 37bb57bf9..daaf02dab 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2599,7 +2599,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
else
txq->tdt_reg_addr = IXGBE_PCI_REG_ADDR(hw, IXGBE_TDT(txq->reg_idx));
- txq->tx_ring_phys_addr = tz->phys_addr;
+ txq->tx_ring_phys_addr = tz->iova;
txq->tx_ring = (union ixgbe_adv_tx_desc *) tz->addr;
/* Allocate software ring */
@@ -2901,7 +2901,7 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
IXGBE_PCI_REG_ADDR(hw, IXGBE_RDH(rxq->reg_idx));
}
- rxq->rx_ring_phys_addr = rz->phys_addr;
+ rxq->rx_ring_phys_addr = rz->iova;
rxq->rx_ring = (union ixgbe_adv_rx_desc *) rz->addr;
/*
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 773dfd30a..71099e146 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -172,7 +172,7 @@ lio_alloc_info_buffer(struct lio_device *lio_dev,
if (droq->info_mz == NULL)
return NULL;
- droq->info_list_dma = droq->info_mz->phys_addr;
+ droq->info_list_dma = droq->info_mz->iova;
droq->info_alloc_size = droq->info_mz->len;
droq->info_base_addr = (size_t)droq->info_mz->addr;
@@ -222,7 +222,7 @@ lio_init_droq(struct lio_device *lio_dev, uint32_t q_no,
return -1;
}
- droq->desc_ring_dma = droq->desc_ring_mz->phys_addr;
+ droq->desc_ring_dma = droq->desc_ring_mz->iova;
droq->desc_ring = (struct lio_droq_desc *)droq->desc_ring_mz->addr;
lio_dev_dbg(lio_dev, "droq[%d]: desc_ring: virt: 0x%p, dma: %lx\n",
@@ -734,7 +734,7 @@ lio_init_instr_queue(struct lio_device *lio_dev,
return -1;
}
- iq->base_addr_dma = iq->iq_mz->phys_addr;
+ iq->base_addr_dma = iq->iq_mz->iova;
iq->base_addr = (uint8_t *)iq->iq_mz->addr;
iq->max_count = num_descs;
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 8c1c1f0b2..7f1a026ac 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -1562,7 +1562,7 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev,
}
/* Saving physical and virtual addresses for the RX ring */
- rxq->dma = (uint64_t)tz->phys_addr;
+ rxq->dma = (uint64_t)tz->iova;
rxq->rxds = (struct nfp_net_rx_desc *)tz->addr;
/* mbuf pointers array for referencing mbufs linked to RX descriptors */
@@ -1718,7 +1718,7 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
txq->txq_flags = tx_conf->txq_flags;
/* Saving physical and virtual addresses for the TX ring */
- txq->dma = (uint64_t)tz->phys_addr;
+ txq->dma = (uint64_t)tz->iova;
txq->txds = (struct nfp_net_tx_desc *)tz->addr;
/* mbuf pointers array for referencing mbufs linked to TX descriptors */
diff --git a/drivers/net/qede/base/bcm_osal.c b/drivers/net/qede/base/bcm_osal.c
index e3a2cb452..fe42f3256 100644
--- a/drivers/net/qede/base/bcm_osal.c
+++ b/drivers/net/qede/base/bcm_osal.c
@@ -144,12 +144,12 @@ void *osal_dma_alloc_coherent(struct ecore_dev *p_dev,
*phys = 0;
return OSAL_NULL;
}
- *phys = mz->phys_addr;
+ *phys = mz->iova;
ecore_mz_mapping[ecore_mz_count++] = mz;
DP_VERBOSE(p_dev, ECORE_MSG_SP,
"Allocated dma memory size=%zu phys=0x%lx"
" virt=%p core=%d\n",
- mz->len, (unsigned long)mz->phys_addr, mz->addr, core_id);
+ mz->len, (unsigned long)mz->iova, mz->addr, core_id);
return mz->addr;
}
@@ -182,12 +182,12 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev *p_dev,
*phys = 0;
return OSAL_NULL;
}
- *phys = mz->phys_addr;
+ *phys = mz->iova;
ecore_mz_mapping[ecore_mz_count++] = mz;
DP_VERBOSE(p_dev, ECORE_MSG_SP,
"Allocated aligned dma memory size=%zu phys=0x%lx"
" virt=%p core=%d\n",
- mz->len, (unsigned long)mz->phys_addr, mz->addr, core_id);
+ mz->len, (unsigned long)mz->iova, mz->addr, core_id);
return mz->addr;
}
@@ -196,7 +196,7 @@ void osal_dma_free_mem(struct ecore_dev *p_dev, dma_addr_t phys)
uint16_t j;
for (j = 0 ; j < ecore_mz_count; j++) {
- if (phys == ecore_mz_mapping[j]->phys_addr) {
+ if (phys == ecore_mz_mapping[j]->iova) {
DP_VERBOSE(p_dev, ECORE_MSG_SP,
"Free memzone %s\n", ecore_mz_mapping[j]->name);
rte_memzone_free(ecore_mz_mapping[j]);
diff --git a/drivers/net/qede/qede_fdir.c b/drivers/net/qede/qede_fdir.c
index f8d60f5c5..da6364ee5 100644
--- a/drivers/net/qede/qede_fdir.c
+++ b/drivers/net/qede/qede_fdir.c
@@ -172,7 +172,7 @@ qede_config_cmn_fdir_filter(struct rte_eth_dev *eth_dev,
}
/* configure filter with ECORE_SPQ_MODE_EBLOCK */
rc = ecore_configure_rfs_ntuple_filter(p_hwfn, NULL,
- (dma_addr_t)mz->phys_addr,
+ (dma_addr_t)mz->iova,
pkt_len,
fdir_filter->action.rx_queue,
0, add);
diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index 390823a8c..1c1274067 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -61,7 +61,7 @@ sfc_dma_alloc(const struct sfc_adapter *sa, const char *name, uint16_t id,
return ENOMEM;
}
- esmp->esm_addr = mz->phys_addr;
+ esmp->esm_addr = mz->iova;
if (esmp->esm_addr == RTE_BAD_PHYS_ADDR) {
(void)rte_memzone_free(mz);
return EFAULT;
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 24ac3f98d..ea561395b 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -605,7 +605,7 @@ nicvf_qset_cq_alloc(struct rte_eth_dev *dev, struct nicvf *nic,
memset(rz->addr, 0, ring_size);
- rxq->phys = rz->phys_addr;
+ rxq->phys = rz->iova;
rxq->desc = rz->addr;
rxq->qlen_mask = desc_cnt - 1;
@@ -629,7 +629,7 @@ nicvf_qset_sq_alloc(struct rte_eth_dev *dev, struct nicvf *nic,
memset(rz->addr, 0, ring_size);
- sq->phys = rz->phys_addr;
+ sq->phys = rz->iova;
sq->desc = rz->addr;
sq->qlen_mask = desc_cnt - 1;
@@ -663,7 +663,7 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic,
memset(rz->addr, 0, ring_size);
- rbdr->phys = rz->phys_addr;
+ rbdr->phys = rz->iova;
rbdr->tail = 0;
rbdr->next_tail = 0;
rbdr->desc = rz->addr;
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index a8ae788d8..c6756ed3f 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -428,10 +428,10 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
memset(mz->addr, 0, mz->len);
- vq->vq_ring_mem = mz->phys_addr;
+ vq->vq_ring_mem = mz->iova;
vq->vq_ring_virt_mem = mz->addr;
PMD_INIT_LOG(DEBUG, "vq->vq_ring_mem: 0x%" PRIx64,
- (uint64_t)mz->phys_addr);
+ (uint64_t)mz->iova);
PMD_INIT_LOG(DEBUG, "vq->vq_ring_virt_mem: 0x%" PRIx64,
(uint64_t)(uintptr_t)mz->addr);
@@ -476,13 +476,13 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
txvq->port_id = dev->data->port_id;
txvq->mz = mz;
txvq->virtio_net_hdr_mz = hdr_mz;
- txvq->virtio_net_hdr_mem = hdr_mz->phys_addr;
+ txvq->virtio_net_hdr_mem = hdr_mz->iova;
} else if (queue_type == VTNET_CQ) {
cvq = &vq->cq;
cvq->vq = vq;
cvq->mz = mz;
cvq->virtio_net_hdr_mz = hdr_mz;
- cvq->virtio_net_hdr_mem = hdr_mz->phys_addr;
+ cvq->virtio_net_hdr_mem = hdr_mz->iova;
memset(cvq->virtio_net_hdr_mz->addr, 0, PAGE_SIZE);
hw->cvq = cvq;
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 9037d80c4..0fce5d953 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -484,7 +484,7 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
memset(mz->addr, 0, mz->len);
hw->shared = mz->addr;
- hw->sharedPA = mz->phys_addr;
+ hw->sharedPA = mz->iova;
/*
* Allocate a memzone for Vmxnet3_RxQueueDesc - Vmxnet3_TxQueueDesc
@@ -505,7 +505,7 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
hw->tqd_start = (Vmxnet3_TxQueueDesc *)mz->addr;
hw->rqd_start = (Vmxnet3_RxQueueDesc *)(hw->tqd_start + hw->num_tx_queues);
- hw->queueDescPA = mz->phys_addr;
+ hw->queueDescPA = mz->iova;
hw->queue_desc_len = (uint16_t)size;
if (dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
@@ -521,7 +521,7 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
memset(mz->addr, 0, mz->len);
hw->rss_conf = mz->addr;
- hw->rss_confPA = mz->phys_addr;
+ hw->rss_confPA = mz->iova;
}
return 0;
@@ -569,7 +569,7 @@ vmxnet3_dev_setup_memreg(struct rte_eth_dev *dev)
}
memset(mz->addr, 0, mz->len);
hw->memRegs = mz->addr;
- hw->memRegsPA = mz->phys_addr;
+ hw->memRegsPA = mz->iova;
}
num = hw->num_rx_queues;
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 01c85f138..aac23d845 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -979,7 +979,7 @@ vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev,
/* cmd_ring initialization */
ring->base = mz->addr;
- ring->basePA = mz->phys_addr;
+ ring->basePA = mz->iova;
/* comp_ring initialization */
comp_ring->base = ring->base + ring->size;
@@ -1090,7 +1090,7 @@ vmxnet3_dev_rx_queue_setup(struct rte_eth_dev *dev,
/* cmd_ring0 initialization */
ring0->base = mz->addr;
- ring0->basePA = mz->phys_addr;
+ ring0->basePA = mz->iova;
/* cmd_ring1 initialization */
ring1->base = ring0->base + ring0->size;
diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c
index ab681101b..ea072a25b 100644
--- a/lib/librte_eal/common/eal_common_memzone.c
+++ b/lib/librte_eal/common/eal_common_memzone.c
@@ -251,7 +251,7 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,
mcfg->memzone_cnt++;
snprintf(mz->name, sizeof(mz->name), "%s", name);
- mz->phys_addr = rte_malloc_virt2iova(mz_addr);
+ mz->iova = rte_malloc_virt2iova(mz_addr);
mz->addr = mz_addr;
mz->len = (requested_len == 0 ? elem->size : requested_len);
mz->hugepage_sz = elem->ms->hugepage_sz;
@@ -391,10 +391,10 @@ rte_memzone_dump(FILE *f)
for (i=0; i<RTE_MAX_MEMZONE; i++) {
if (mcfg->memzone[i].addr == NULL)
break;
- fprintf(f, "Zone %u: name:<%s>, phys:0x%"PRIx64", len:0x%zx"
+ fprintf(f, "Zone %u: name:<%s>, IO:0x%"PRIx64", len:0x%zx"
", virt:%p, socket_id:%"PRId32", flags:%"PRIx32"\n", i,
mcfg->memzone[i].name,
- mcfg->memzone[i].phys_addr,
+ mcfg->memzone[i].iova,
mcfg->memzone[i].len,
mcfg->memzone[i].addr,
mcfg->memzone[i].socket_id,
diff --git a/lib/librte_eal/common/include/rte_memzone.h b/lib/librte_eal/common/include/rte_memzone.h
index 1d0827f46..6f0ba1829 100644
--- a/lib/librte_eal/common/include/rte_memzone.h
+++ b/lib/librte_eal/common/include/rte_memzone.h
@@ -78,7 +78,11 @@ struct rte_memzone {
#define RTE_MEMZONE_NAMESIZE 32 /**< Maximum length of memory zone name.*/
char name[RTE_MEMZONE_NAMESIZE]; /**< Name of the memory zone. */
- phys_addr_t phys_addr; /**< Start physical address. */
+ RTE_STD_C11
+ union {
+ phys_addr_t phys_addr; /**< deprecated - Start physical address. */
+ rte_iova_t iova; /**< Start IO address. */
+ };
RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index f62054e23..aad3294ed 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -601,7 +601,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)
if (mp->flags & MEMPOOL_F_NO_PHYS_CONTIG)
paddr = RTE_BAD_PHYS_ADDR;
else
- paddr = mz->phys_addr;
+ paddr = mz->iova;
if (rte_eal_has_hugepages())
ret = rte_mempool_populate_phys(mp, mz->addr,
@@ -1213,7 +1213,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
fprintf(f, "mempool <%s>@%p\n", mp->name, mp);
fprintf(f, " flags=%x\n", mp->flags);
fprintf(f, " pool=%p\n", mp->pool_data);
- fprintf(f, " phys_addr=0x%" PRIx64 "\n", mp->mz->phys_addr);
+ fprintf(f, " iova=0x%" PRIx64 "\n", mp->mz->iova);
fprintf(f, " nb_mem_chunks=%u\n", mp->nb_mem_chunks);
fprintf(f, " size=%"PRIu32"\n", mp->size);
fprintf(f, " populated_size=%"PRIu32"\n", mp->populated_size);
diff --git a/test/test/test_memzone.c b/test/test/test_memzone.c
index 7ae31cf74..c9394c4a2 100644
--- a/test/test/test_memzone.c
+++ b/test/test/test_memzone.c
@@ -78,7 +78,7 @@
/* Test if memory overlaps: return 1 if true, or 0 if false. */
static int
-is_memory_overlap(phys_addr_t ptr1, size_t len1, phys_addr_t ptr2, size_t len2)
+is_memory_overlap(rte_iova_t ptr1, size_t len1, rte_iova_t ptr2, size_t len2)
{
if (ptr2 >= ptr1 && (ptr2 - ptr1) < len1)
return 1;
@@ -510,7 +510,7 @@ test_memzone_aligned(void)
printf("Unable to reserve 64-byte aligned memzone!\n");
return -1;
}
- if ((memzone_aligned_32->phys_addr & RTE_CACHE_LINE_MASK) != 0)
+ if ((memzone_aligned_32->iova & RTE_CACHE_LINE_MASK) != 0)
return -1;
if (((uintptr_t) memzone_aligned_32->addr & RTE_CACHE_LINE_MASK) != 0)
return -1;
@@ -521,7 +521,7 @@ test_memzone_aligned(void)
printf("Unable to reserve 128-byte aligned memzone!\n");
return -1;
}
- if ((memzone_aligned_128->phys_addr & 127) != 0)
+ if ((memzone_aligned_128->iova & 127) != 0)
return -1;
if (((uintptr_t) memzone_aligned_128->addr & 127) != 0)
return -1;
@@ -532,7 +532,7 @@ test_memzone_aligned(void)
printf("Unable to reserve 256-byte aligned memzone!\n");
return -1;
}
- if ((memzone_aligned_256->phys_addr & 255) != 0)
+ if ((memzone_aligned_256->iova & 255) != 0)
return -1;
if (((uintptr_t) memzone_aligned_256->addr & 255) != 0)
return -1;
@@ -543,7 +543,7 @@ test_memzone_aligned(void)
printf("Unable to reserve 512-byte aligned memzone!\n");
return -1;
}
- if ((memzone_aligned_512->phys_addr & 511) != 0)
+ if ((memzone_aligned_512->iova & 511) != 0)
return -1;
if (((uintptr_t) memzone_aligned_512->addr & 511) != 0)
return -1;
@@ -554,7 +554,7 @@ test_memzone_aligned(void)
printf("Unable to reserve 1024-byte aligned memzone!\n");
return -1;
}
- if ((memzone_aligned_1024->phys_addr & 1023) != 0)
+ if ((memzone_aligned_1024->iova & 1023) != 0)
return -1;
if (((uintptr_t) memzone_aligned_1024->addr & 1023) != 0)
return -1;
@@ -563,35 +563,35 @@ test_memzone_aligned(void)
/* check that zones don't overlap */
printf("check overlapping\n");
- if (is_memory_overlap(memzone_aligned_32->phys_addr, memzone_aligned_32->len,
- memzone_aligned_128->phys_addr, memzone_aligned_128->len))
+ if (is_memory_overlap(memzone_aligned_32->iova, memzone_aligned_32->len,
+ memzone_aligned_128->iova, memzone_aligned_128->len))
return -1;
- if (is_memory_overlap(memzone_aligned_32->phys_addr, memzone_aligned_32->len,
- memzone_aligned_256->phys_addr, memzone_aligned_256->len))
+ if (is_memory_overlap(memzone_aligned_32->iova, memzone_aligned_32->len,
+ memzone_aligned_256->iova, memzone_aligned_256->len))
return -1;
- if (is_memory_overlap(memzone_aligned_32->phys_addr, memzone_aligned_32->len,
- memzone_aligned_512->phys_addr, memzone_aligned_512->len))
+ if (is_memory_overlap(memzone_aligned_32->iova, memzone_aligned_32->len,
+ memzone_aligned_512->iova, memzone_aligned_512->len))
return -1;
- if (is_memory_overlap(memzone_aligned_32->phys_addr, memzone_aligned_32->len,
- memzone_aligned_1024->phys_addr, memzone_aligned_1024->len))
+ if (is_memory_overlap(memzone_aligned_32->iova, memzone_aligned_32->len,
+ memzone_aligned_1024->iova, memzone_aligned_1024->len))
return -1;
- if (is_memory_overlap(memzone_aligned_128->phys_addr, memzone_aligned_128->len,
- memzone_aligned_256->phys_addr, memzone_aligned_256->len))
+ if (is_memory_overlap(memzone_aligned_128->iova, memzone_aligned_128->len,
+ memzone_aligned_256->iova, memzone_aligned_256->len))
return -1;
- if (is_memory_overlap(memzone_aligned_128->phys_addr, memzone_aligned_128->len,
- memzone_aligned_512->phys_addr, memzone_aligned_512->len))
+ if (is_memory_overlap(memzone_aligned_128->iova, memzone_aligned_128->len,
+ memzone_aligned_512->iova, memzone_aligned_512->len))
return -1;
- if (is_memory_overlap(memzone_aligned_128->phys_addr, memzone_aligned_128->len,
- memzone_aligned_1024->phys_addr, memzone_aligned_1024->len))
+ if (is_memory_overlap(memzone_aligned_128->iova, memzone_aligned_128->len,
+ memzone_aligned_1024->iova, memzone_aligned_1024->len))
return -1;
- if (is_memory_overlap(memzone_aligned_256->phys_addr, memzone_aligned_256->len,
- memzone_aligned_512->phys_addr, memzone_aligned_512->len))
+ if (is_memory_overlap(memzone_aligned_256->iova, memzone_aligned_256->len,
+ memzone_aligned_512->iova, memzone_aligned_512->len))
return -1;
- if (is_memory_overlap(memzone_aligned_256->phys_addr, memzone_aligned_256->len,
- memzone_aligned_1024->phys_addr, memzone_aligned_1024->len))
+ if (is_memory_overlap(memzone_aligned_256->iova, memzone_aligned_256->len,
+ memzone_aligned_1024->iova, memzone_aligned_1024->len))
return -1;
- if (is_memory_overlap(memzone_aligned_512->phys_addr, memzone_aligned_512->len,
- memzone_aligned_1024->phys_addr, memzone_aligned_1024->len))
+ if (is_memory_overlap(memzone_aligned_512->iova, memzone_aligned_512->len,
+ memzone_aligned_1024->iova, memzone_aligned_1024->len))
return -1;
return 0;
}
@@ -601,9 +601,9 @@ check_memzone_bounded(const char *name, uint32_t len, uint32_t align,
uint32_t bound)
{
const struct rte_memzone *mz;
- phys_addr_t bmask;
+ rte_iova_t bmask;
- bmask = ~((phys_addr_t)bound - 1);
+ bmask = ~((rte_iova_t)bound - 1);
if ((mz = rte_memzone_reserve_bounded(name, len, SOCKET_ID_ANY, 0,
align, bound)) == NULL) {
@@ -612,7 +612,7 @@ check_memzone_bounded(const char *name, uint32_t len, uint32_t align,
return -1;
}
- if ((mz->phys_addr & ((phys_addr_t)align - 1)) != 0) {
+ if ((mz->iova & ((rte_iova_t)align - 1)) != 0) {
printf("%s(%s): invalid phys addr alignment\n",
__func__, mz->name);
return -1;
@@ -631,8 +631,8 @@ check_memzone_bounded(const char *name, uint32_t len, uint32_t align,
return -1;
}
- if ((mz->phys_addr & bmask) !=
- ((mz->phys_addr + mz->len - 1) & bmask)) {
+ if ((mz->iova & bmask) !=
+ ((mz->iova + mz->len - 1) & bmask)) {
printf("%s(%s): invalid memzone boundary %u crossed\n",
__func__, mz->name, bound);
return -1;
@@ -787,11 +787,11 @@ test_memzone(void)
/* check cache-line alignments */
printf("check alignments and lengths\n");
- if ((memzone1->phys_addr & RTE_CACHE_LINE_MASK) != 0)
+ if ((memzone1->iova & RTE_CACHE_LINE_MASK) != 0)
return -1;
- if ((memzone2->phys_addr & RTE_CACHE_LINE_MASK) != 0)
+ if ((memzone2->iova & RTE_CACHE_LINE_MASK) != 0)
return -1;
- if (memzone3 != NULL && (memzone3->phys_addr & RTE_CACHE_LINE_MASK) != 0)
+ if (memzone3 != NULL && (memzone3->iova & RTE_CACHE_LINE_MASK) != 0)
return -1;
if ((memzone1->len & RTE_CACHE_LINE_MASK) != 0 || memzone1->len == 0)
return -1;
@@ -806,16 +806,16 @@ test_memzone(void)
/* check that zones don't overlap */
printf("check overlapping\n");
- if (is_memory_overlap(memzone1->phys_addr, memzone1->len,
- memzone2->phys_addr, memzone2->len))
+ if (is_memory_overlap(memzone1->iova, memzone1->len,
+ memzone2->iova, memzone2->len))
return -1;
if (memzone3 != NULL &&
- is_memory_overlap(memzone1->phys_addr, memzone1->len,
- memzone3->phys_addr, memzone3->len))
+ is_memory_overlap(memzone1->iova, memzone1->len,
+ memzone3->iova, memzone3->len))
return -1;
if (memzone3 != NULL &&
- is_memory_overlap(memzone2->phys_addr, memzone2->len,
- memzone3->phys_addr, memzone3->len))
+ is_memory_overlap(memzone2->iova, memzone2->len,
+ memzone3->iova, memzone3->len))
return -1;
printf("check socket ID\n");
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 08/15] mempool: rename addresses from physical to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
` (6 preceding siblings ...)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 07/15] memzone: rename address from physical to IOVA Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 5:52 ` santosh
2017-11-06 15:44 ` Olivier MATZ
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 09/15] mempool: rename address mapping function " Thomas Monjalon
` (7 subsequent siblings)
15 siblings, 2 replies; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
The struct fields phys_addr_t rte_mempool_objhdr.physaddr and
rte_mempool_memhdr.phys_addr are renamed to rte_iova_t iova.
The deprecated names are kept in an anonymous union to avoid breaking
the API.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 +-
drivers/mempool/octeontx/octeontx_fpavf.c | 2 +-
drivers/mempool/octeontx/rte_mempool_octeontx.c | 2 +-
drivers/net/thunderx/nicvf_ethdev.h | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +-
lib/librte_mempool/rte_mempool.c | 64 ++++++++++++-------------
lib/librte_mempool/rte_mempool.h | 40 +++++++++-------
lib/librte_mempool/rte_mempool_ops.c | 4 +-
8 files changed, 62 insertions(+), 56 deletions(-)
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
index 56b71bede..0971929ef 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
@@ -39,7 +39,7 @@
struct buf_pool_cfg {
void *addr;
/**< The address from where DPAA2 will carve out the buffers */
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
/**< Physical address of the memory provided in addr */
uint32_t num;
/**< Number of buffers */
diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c
index bab841ccd..3bc50f35d 100644
--- a/drivers/mempool/octeontx/octeontx_fpavf.c
+++ b/drivers/mempool/octeontx/octeontx_fpavf.c
@@ -221,7 +221,7 @@ octeontx_fpapf_pool_setup(unsigned int gpool, unsigned int buf_size,
signed short buf_offset, unsigned int max_buf_count)
{
void *memptr = NULL;
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
unsigned int memsz;
struct fpavf_res *fpa = NULL;
uint64_t reg;
diff --git a/drivers/mempool/octeontx/rte_mempool_octeontx.c b/drivers/mempool/octeontx/rte_mempool_octeontx.c
index 9f1c07f9d..e89355cdd 100644
--- a/drivers/mempool/octeontx/rte_mempool_octeontx.c
+++ b/drivers/mempool/octeontx/rte_mempool_octeontx.c
@@ -220,7 +220,7 @@ octeontx_fpavf_get_capabilities(const struct rte_mempool *mp,
static int
octeontx_fpavf_register_memory_area(const struct rte_mempool *mp,
- char *vaddr, phys_addr_t paddr, size_t len)
+ char *vaddr, rte_iova_t paddr, size_t len)
{
struct octeontx_pool_info *pool_info;
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index 3734430f5..e92c3242a 100644
--- a/drivers/net/thunderx/nicvf_ethdev.h
+++ b/drivers/net/thunderx/nicvf_ethdev.h
@@ -78,7 +78,7 @@ nicvf_mempool_phy_offset(struct rte_mempool *mp)
hdr = STAILQ_FIRST(&mp->mem_list);
assert(hdr != NULL);
- return (uint64_t)((uintptr_t)hdr->addr - hdr->phys_addr);
+ return (uint64_t)((uintptr_t)hdr->addr - hdr->iova);
}
static inline uint16_t
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 0fce5d953..82d59ca8c 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -604,7 +604,7 @@ vmxnet3_dev_setup_memreg(struct rte_eth_dev *dev)
Vmxnet3_MemoryRegion *mr = &hw->memRegs->memRegs[j];
mr->startPA =
- (uintptr_t)STAILQ_FIRST(&mp[i]->mem_list)->phys_addr;
+ (uintptr_t)STAILQ_FIRST(&mp[i]->mem_list)->iova;
mr->length = STAILQ_FIRST(&mp[i]->mem_list)->len <= INT32_MAX ?
STAILQ_FIRST(&mp[i]->mem_list)->len : INT32_MAX;
mr->txQueueBits = index[i];
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index aad3294ed..7472f830c 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -128,7 +128,7 @@ static unsigned optimize_object_size(unsigned obj_size)
}
static void
-mempool_add_elem(struct rte_mempool *mp, void *obj, phys_addr_t physaddr)
+mempool_add_elem(struct rte_mempool *mp, void *obj, rte_iova_t iova)
{
struct rte_mempool_objhdr *hdr;
struct rte_mempool_objtlr *tlr __rte_unused;
@@ -136,7 +136,7 @@ mempool_add_elem(struct rte_mempool *mp, void *obj, phys_addr_t physaddr)
/* set mempool ptr in header */
hdr = RTE_PTR_SUB(obj, sizeof(*hdr));
hdr->mp = mp;
- hdr->physaddr = physaddr;
+ hdr->iova = iova;
STAILQ_INSERT_TAIL(&mp->elt_list, hdr, next);
mp->populated_size++;
@@ -270,12 +270,12 @@ rte_mempool_xmem_size(uint32_t elt_num, size_t total_elt_sz, uint32_t pg_shift,
*/
ssize_t
rte_mempool_xmem_usage(__rte_unused void *vaddr, uint32_t elt_num,
- size_t total_elt_sz, const phys_addr_t paddr[], uint32_t pg_num,
+ size_t total_elt_sz, const rte_iova_t iova[], uint32_t pg_num,
uint32_t pg_shift, unsigned int flags)
{
uint32_t elt_cnt = 0;
- phys_addr_t start, end;
- uint32_t paddr_idx;
+ rte_iova_t start, end;
+ uint32_t iova_idx;
size_t pg_sz = (size_t)1 << pg_shift;
unsigned int mask;
@@ -284,15 +284,15 @@ rte_mempool_xmem_usage(__rte_unused void *vaddr, uint32_t elt_num,
/* alignment need one additional object */
elt_num += 1;
- /* if paddr is NULL, assume contiguous memory */
- if (paddr == NULL) {
+ /* if iova is NULL, assume contiguous memory */
+ if (iova == NULL) {
start = 0;
end = pg_sz * pg_num;
- paddr_idx = pg_num;
+ iova_idx = pg_num;
} else {
- start = paddr[0];
- end = paddr[0] + pg_sz;
- paddr_idx = 1;
+ start = iova[0];
+ end = iova[0] + pg_sz;
+ iova_idx = 1;
}
while (elt_cnt < elt_num) {
@@ -300,15 +300,15 @@ rte_mempool_xmem_usage(__rte_unused void *vaddr, uint32_t elt_num,
/* enough contiguous memory, add an object */
start += total_elt_sz;
elt_cnt++;
- } else if (paddr_idx < pg_num) {
+ } else if (iova_idx < pg_num) {
/* no room to store one obj, add a page */
- if (end == paddr[paddr_idx]) {
+ if (end == iova[iova_idx]) {
end += pg_sz;
} else {
- start = paddr[paddr_idx];
- end = paddr[paddr_idx] + pg_sz;
+ start = iova[iova_idx];
+ end = iova[iova_idx] + pg_sz;
}
- paddr_idx++;
+ iova_idx++;
} else {
/* no more page, return how many elements fit */
@@ -316,7 +316,7 @@ rte_mempool_xmem_usage(__rte_unused void *vaddr, uint32_t elt_num,
}
}
- return (size_t)paddr_idx << pg_shift;
+ return (size_t)iova_idx << pg_shift;
}
/* free a memchunk allocated with rte_memzone_reserve() */
@@ -402,7 +402,7 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
memhdr->mp = mp;
memhdr->addr = vaddr;
- memhdr->phys_addr = paddr;
+ memhdr->iova = paddr;
memhdr->len = len;
memhdr->free_cb = free_cb;
memhdr->opaque = opaque;
@@ -483,7 +483,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
size_t len, size_t pg_sz, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque)
{
- phys_addr_t paddr;
+ rte_iova_t iova;
size_t off, phys_len;
int ret, cnt = 0;
@@ -503,24 +503,24 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
for (off = 0; off + pg_sz <= len &&
mp->populated_size < mp->size; off += phys_len) {
- paddr = rte_mem_virt2iova(addr + off);
+ iova = rte_mem_virt2iova(addr + off);
- if (paddr == RTE_BAD_PHYS_ADDR && rte_eal_has_hugepages()) {
+ if (iova == RTE_BAD_IOVA && rte_eal_has_hugepages()) {
ret = -EINVAL;
goto fail;
}
/* populate with the largest group of contiguous pages */
for (phys_len = pg_sz; off + phys_len < len; phys_len += pg_sz) {
- phys_addr_t paddr_tmp;
+ rte_iova_t iova_tmp;
- paddr_tmp = rte_mem_virt2iova(addr + off + phys_len);
+ iova_tmp = rte_mem_virt2iova(addr + off + phys_len);
- if (paddr_tmp != paddr + phys_len)
+ if (iova_tmp != iova + phys_len)
break;
}
- ret = rte_mempool_populate_phys(mp, addr + off, paddr,
+ ret = rte_mempool_populate_phys(mp, addr + off, iova,
phys_len, free_cb, opaque);
if (ret < 0)
goto fail;
@@ -547,7 +547,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)
char mz_name[RTE_MEMZONE_NAMESIZE];
const struct rte_memzone *mz;
size_t size, total_elt_sz, align, pg_sz, pg_shift;
- phys_addr_t paddr;
+ rte_iova_t iova;
unsigned mz_id, n;
unsigned int mp_flags;
int ret;
@@ -599,13 +599,13 @@ rte_mempool_populate_default(struct rte_mempool *mp)
}
if (mp->flags & MEMPOOL_F_NO_PHYS_CONTIG)
- paddr = RTE_BAD_PHYS_ADDR;
+ iova = RTE_BAD_IOVA;
else
- paddr = mz->iova;
+ iova = mz->iova;
if (rte_eal_has_hugepages())
ret = rte_mempool_populate_phys(mp, mz->addr,
- paddr, mz->len,
+ iova, mz->len,
rte_mempool_memchunk_mz_free,
(void *)(uintptr_t)mz);
else
@@ -958,7 +958,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
rte_mempool_ctor_t *mp_init, void *mp_init_arg,
rte_mempool_obj_cb_t *obj_init, void *obj_init_arg,
int socket_id, unsigned flags, void *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift)
+ const rte_iova_t iova[], uint32_t pg_num, uint32_t pg_shift)
{
struct rte_mempool *mp = NULL;
int ret;
@@ -970,7 +970,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
obj_init, obj_init_arg, socket_id, flags);
/* check that we have both VA and PA */
- if (paddr == NULL) {
+ if (iova == NULL) {
rte_errno = EINVAL;
return NULL;
}
@@ -990,7 +990,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
if (mp_init)
mp_init(mp, mp_init_arg);
- ret = rte_mempool_populate_phys_tab(mp, vaddr, paddr, pg_num, pg_shift,
+ ret = rte_mempool_populate_phys_tab(mp, vaddr, iova, pg_num, pg_shift,
NULL, NULL);
if (ret < 0 || ret != (int)mp->size)
goto fail;
diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index c69841ec4..41f8b2daf 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -157,7 +157,11 @@ struct rte_mempool_objsz {
struct rte_mempool_objhdr {
STAILQ_ENTRY(rte_mempool_objhdr) next; /**< Next in list. */
struct rte_mempool *mp; /**< The mempool owning the object. */
- phys_addr_t physaddr; /**< Physical address of the object. */
+ RTE_STD_C11
+ union {
+ rte_iova_t iova; /**< IO address of the object. */
+ phys_addr_t physaddr; /**< deprecated - Physical address of the object. */
+ };
#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
uint64_t cookie; /**< Debug cookie. */
#endif
@@ -203,7 +207,11 @@ struct rte_mempool_memhdr {
STAILQ_ENTRY(rte_mempool_memhdr) next; /**< Next in list. */
struct rte_mempool *mp; /**< The mempool owning the chunk */
void *addr; /**< Virtual address of the chunk */
- phys_addr_t phys_addr; /**< Physical address of the chunk */
+ RTE_STD_C11
+ union {
+ rte_iova_t iova; /**< IO address of the chunk */
+ phys_addr_t phys_addr; /**< Physical address of the chunk */
+ };
size_t len; /**< length of the chunk */
rte_mempool_memchunk_free_cb_t *free_cb; /**< Free callback */
void *opaque; /**< Argument passed to the free callback */
@@ -417,7 +425,7 @@ typedef int (*rte_mempool_get_capabilities_t)(const struct rte_mempool *mp,
* Notify new memory area to mempool.
*/
typedef int (*rte_mempool_ops_register_memory_area_t)
-(const struct rte_mempool *mp, char *vaddr, phys_addr_t paddr, size_t len);
+(const struct rte_mempool *mp, char *vaddr, rte_iova_t iova, size_t len);
/** Structure defining mempool operations structure */
struct rte_mempool_ops {
@@ -570,8 +578,8 @@ rte_mempool_ops_get_capabilities(const struct rte_mempool *mp,
* Pointer to the memory pool.
* @param vaddr
* Pointer to the buffer virtual address.
- * @param paddr
- * Pointer to the buffer physical address.
+ * @param iova
+ * Pointer to the buffer IO address.
* @param len
* Pool size.
* @return
@@ -581,7 +589,7 @@ rte_mempool_ops_get_capabilities(const struct rte_mempool *mp,
*/
int
rte_mempool_ops_register_memory_area(const struct rte_mempool *mp,
- char *vaddr, phys_addr_t paddr, size_t len);
+ char *vaddr, rte_iova_t iova, size_t len);
/**
* @internal wrapper for mempool_ops free callback.
@@ -797,11 +805,10 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size,
* @param vaddr
* Virtual address of the externally allocated memory buffer.
* Will be used to store mempool objects.
- * @param paddr
- * Array of physical addresses of the pages that comprises given memory
- * buffer.
+ * @param iova
+ * Array of IO addresses of the pages that comprises given memory buffer.
* @param pg_num
- * Number of elements in the paddr array.
+ * Number of elements in the iova array.
* @param pg_shift
* LOG2 of the physical pages size.
* @return
@@ -814,7 +821,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
rte_mempool_ctor_t *mp_init, void *mp_init_arg,
rte_mempool_obj_cb_t *obj_init, void *obj_init_arg,
int socket_id, unsigned flags, void *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift);
+ const rte_iova_t iova[], uint32_t pg_num, uint32_t pg_shift);
/**
* Create an empty mempool
@@ -1462,7 +1469,7 @@ rte_mempool_virt2phy(__rte_unused const struct rte_mempool *mp, const void *elt)
const struct rte_mempool_objhdr *hdr;
hdr = (const struct rte_mempool_objhdr *)RTE_PTR_SUB(elt,
sizeof(*hdr));
- return hdr->physaddr;
+ return hdr->iova;
}
/**
@@ -1573,11 +1580,10 @@ size_t rte_mempool_xmem_size(uint32_t elt_num, size_t total_elt_sz,
* @param total_elt_sz
* The size of each element, including header and trailer, as returned
* by rte_mempool_calc_obj_size().
- * @param paddr
- * Array of physical addresses of the pages that comprises given memory
- * buffer.
+ * @param iova
+ * Array of IO addresses of the pages that comprises given memory buffer.
* @param pg_num
- * Number of elements in the paddr array.
+ * Number of elements in the iova array.
* @param pg_shift
* LOG2 of the physical pages size.
* @param flags
@@ -1589,7 +1595,7 @@ size_t rte_mempool_xmem_size(uint32_t elt_num, size_t total_elt_sz,
* is the actual number of elements that can be stored in that buffer.
*/
ssize_t rte_mempool_xmem_usage(void *vaddr, uint32_t elt_num,
- size_t total_elt_sz, const phys_addr_t paddr[], uint32_t pg_num,
+ size_t total_elt_sz, const rte_iova_t iova[], uint32_t pg_num,
uint32_t pg_shift, unsigned int flags);
/**
diff --git a/lib/librte_mempool/rte_mempool_ops.c b/lib/librte_mempool/rte_mempool_ops.c
index a6b5f2002..92b9f90c4 100644
--- a/lib/librte_mempool/rte_mempool_ops.c
+++ b/lib/librte_mempool/rte_mempool_ops.c
@@ -142,14 +142,14 @@ rte_mempool_ops_get_capabilities(const struct rte_mempool *mp,
/* wrapper to notify new memory area to external mempool */
int
rte_mempool_ops_register_memory_area(const struct rte_mempool *mp, char *vaddr,
- phys_addr_t paddr, size_t len)
+ rte_iova_t iova, size_t len)
{
struct rte_mempool_ops *ops;
ops = rte_mempool_get_ops(mp->ops_index);
RTE_FUNC_PTR_OR_ERR_RET(ops->register_memory_area, -ENOTSUP);
- return ops->register_memory_area(mp, vaddr, paddr, len);
+ return ops->register_memory_area(mp, vaddr, iova, len);
}
/* sets mempool ops previously registered by rte_mempool_register_ops. */
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 09/15] mempool: rename address mapping function to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
` (7 preceding siblings ...)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 08/15] mempool: rename addresses " Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 5:54 ` santosh
2017-11-06 15:44 ` Olivier MATZ
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 10/15] mempool: rename populate functions " Thomas Monjalon
` (6 subsequent siblings)
15 siblings, 2 replies; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
The function rte_mempool_virt2phy() is renamed to rte_mempool_virt2iova().
The new function has one less parameter because it is unused.
The deprecated function is kept as an alias to avoid breaking the API.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-crypto-perf/cperf_test_common.c | 4 ++--
drivers/crypto/qat/qat_crypto.c | 2 +-
drivers/crypto/qat/qat_qp.c | 6 ++----
drivers/mempool/dpaa/dpaa_mempool.c | 4 ++--
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 ++--
lib/librte_eal/bsdapp/eal/eal_memory.c | 2 +-
lib/librte_mbuf/rte_mbuf.c | 2 +-
lib/librte_mbuf/rte_mbuf.h | 2 +-
lib/librte_mempool/rte_mempool.h | 19 ++++++++++++-------
test/test/test_mempool.c | 2 +-
10 files changed, 25 insertions(+), 22 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 46e4a46ec..08b313f8b 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -50,7 +50,7 @@ fill_single_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp,
/* start of buffer is after mbuf structure and priv data */
m->priv_size = 0;
m->buf_addr = (char *)m + mbuf_hdr_size;
- m->buf_physaddr = rte_mempool_virt2phy(mp, obj) +
+ m->buf_physaddr = rte_mempool_virt2iova(obj) +
mbuf_offset + mbuf_hdr_size;
m->buf_len = segment_sz;
m->data_len = segment_sz;
@@ -74,7 +74,7 @@ fill_multi_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp,
uint16_t mbuf_hdr_size = sizeof(struct rte_mbuf);
uint16_t remaining_segments = segments_nb;
struct rte_mbuf *next_mbuf;
- phys_addr_t next_seg_phys_addr = rte_mempool_virt2phy(mp, obj) +
+ phys_addr_t next_seg_phys_addr = rte_mempool_virt2iova(obj) +
mbuf_offset + mbuf_hdr_size;
do {
diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index 59bc81fb3..e49b71f28 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -527,7 +527,7 @@ qat_crypto_set_session_parameters(struct rte_cryptodev *dev,
PMD_INIT_FUNC_TRACE();
/* Set context descriptor physical address */
- session->cd_paddr = rte_mempool_virt2phy(NULL, session) +
+ session->cd_paddr = rte_mempool_virt2iova(session) +
offsetof(struct qat_session, cd);
session->min_qat_dev_gen = QAT_GEN1;
diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
index 94aeb9f63..ced3aa6a0 100644
--- a/drivers/crypto/qat/qat_qp.c
+++ b/drivers/crypto/qat/qat_qp.c
@@ -228,14 +228,12 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id,
qp->op_cookies[i];
sql_cookie->qat_sgl_src_phys_addr =
- rte_mempool_virt2phy(qp->op_cookie_pool,
- sql_cookie) +
+ rte_mempool_virt2iova(sql_cookie) +
offsetof(struct qat_crypto_op_cookie,
qat_sgl_list_src);
sql_cookie->qat_sgl_dst_phys_addr =
- rte_mempool_virt2phy(qp->op_cookie_pool,
- sql_cookie) +
+ rte_mempool_virt2iova(sql_cookie) +
offsetof(struct qat_crypto_op_cookie,
qat_sgl_list_dst);
}
diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c
index 8855fb655..f5ee80f2d 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.c
+++ b/drivers/mempool/dpaa/dpaa_mempool.c
@@ -172,8 +172,8 @@ dpaa_mbuf_free_bulk(struct rte_mempool *pool,
while (i < n) {
dpaa_buf_free(bp_info,
- (uint64_t)rte_mempool_virt2phy(pool,
- obj_table[i]) + bp_info->meta_data_size);
+ (uint64_t)rte_mempool_virt2iova(obj_table[i]) +
+ bp_info->meta_data_size);
i = i + 1;
}
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index d66492908..8bcbaa892 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -225,7 +225,7 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
/* convert mbuf to buffers for the remainder */
for (i = 0; i < n ; i++) {
#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA
- bufs[i] = (uint64_t)rte_mempool_virt2phy(pool, obj_table[i])
+ bufs[i] = (uint64_t)rte_mempool_virt2iova(obj_table[i])
+ meta_data_size;
#else
bufs[i] = (uint64_t)obj_table[i] + meta_data_size;
@@ -244,7 +244,7 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
for (i = 0; i < DPAA2_MBUF_MAX_ACQ_REL; i++) {
#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA
bufs[i] = (uint64_t)
- rte_mempool_virt2phy(pool, obj_table[n + i])
+ rte_mempool_virt2iova(obj_table[n + i])
+ meta_data_size;
#else
bufs[i] = (uint64_t)obj_table[n + i] + meta_data_size;
diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index 0e021fff1..6ba058578 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -54,7 +54,7 @@ phys_addr_t
rte_mem_virt2phy(const void *virtaddr)
{
/* XXX not implemented. This function is only used by
- * rte_mempool_virt2phy() when hugepages are disabled. */
+ * rte_mempool_virt2iova() when hugepages are disabled. */
(void)virtaddr;
return RTE_BAD_IOVA;
}
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index d6675ecb5..c96943522 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -134,7 +134,7 @@ rte_pktmbuf_init(struct rte_mempool *mp,
/* start of buffer is after mbuf structure and priv data */
m->priv_size = priv_size;
m->buf_addr = (char *)m + mbuf_size;
- m->buf_physaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
+ m->buf_physaddr = rte_mempool_virt2iova(m) + mbuf_size;
m->buf_len = (uint16_t)buf_len;
/* keep some headroom between start of buffer and data */
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 8aac0278d..0a555e2d5 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1298,7 +1298,7 @@ static inline void rte_pktmbuf_detach(struct rte_mbuf *m)
m->priv_size = priv_size;
m->buf_addr = (char *)m + mbuf_size;
- m->buf_physaddr = rte_mempool_virt2phy(mp, m) + mbuf_size;
+ m->buf_physaddr = rte_mempool_virt2iova(m) + mbuf_size;
m->buf_len = (uint16_t)buf_len;
rte_pktmbuf_reset_headroom(m);
m->data_len = 0;
diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index 41f8b2daf..4a31f03f2 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -1452,19 +1452,17 @@ rte_mempool_empty(const struct rte_mempool *mp)
}
/**
- * Return the physical address of elt, which is an element of the pool mp.
+ * Return the IO address of elt, which is an element of the pool mp.
*
- * @param mp
- * A pointer to the mempool structure.
* @param elt
* A pointer (virtual address) to the element of the pool.
* @return
- * The physical address of the elt element.
+ * The IO address of the elt element.
* If the mempool was created with MEMPOOL_F_NO_PHYS_CONTIG, the
- * returned value is RTE_BAD_PHYS_ADDR.
+ * returned value is RTE_BAD_IOVA.
*/
-static inline phys_addr_t
-rte_mempool_virt2phy(__rte_unused const struct rte_mempool *mp, const void *elt)
+static inline rte_iova_t
+rte_mempool_virt2iova(const void *elt)
{
const struct rte_mempool_objhdr *hdr;
hdr = (const struct rte_mempool_objhdr *)RTE_PTR_SUB(elt,
@@ -1472,6 +1470,13 @@ rte_mempool_virt2phy(__rte_unused const struct rte_mempool *mp, const void *elt)
return hdr->iova;
}
+__rte_deprecated
+static inline phys_addr_t
+rte_mempool_virt2phy(__rte_unused const struct rte_mempool *mp, const void *elt)
+{
+ return rte_mempool_virt2iova(elt);
+}
+
/**
* Check the consistency of mempool objects.
*
diff --git a/test/test/test_mempool.c b/test/test/test_mempool.c
index fa8bad39f..37ead503b 100644
--- a/test/test/test_mempool.c
+++ b/test/test/test_mempool.c
@@ -146,7 +146,7 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache)
#ifndef RTE_EXEC_ENV_BSDAPP /* rte_mem_virt2iova() not supported on bsd */
printf("get physical address of an object\n");
- if (rte_mempool_virt2phy(mp, obj) != rte_mem_virt2iova(obj))
+ if (rte_mempool_virt2iova(obj) != rte_mem_virt2iova(obj))
GOTO_ERR(ret, out);
#endif
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 10/15] mempool: rename populate functions to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
` (8 preceding siblings ...)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 09/15] mempool: rename address mapping function " Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 15:49 ` Olivier MATZ
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 11/15] mbuf: rename physical address " Thomas Monjalon
` (5 subsequent siblings)
15 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
The functions rte_mempool_populate_phys() and
rte_mempool_populate_phys_tab() are renamed to
rte_mempool_populate_iova() and rte_mempool_populate_iova_tab().
The deprecated functions are kept as aliases to avoid breaking the API.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_mempool/rte_mempool.c | 51 ++++++++++++++++++++----------
lib/librte_mempool/rte_mempool.h | 27 ++++++++++------
lib/librte_mempool/rte_mempool_version.map | 2 ++
3 files changed, 54 insertions(+), 26 deletions(-)
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 7472f830c..d50dba493 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -357,8 +357,8 @@ rte_mempool_free_memchunks(struct rte_mempool *mp)
* on error.
*/
int
-rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
- phys_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
+rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,
+ rte_iova_t iova, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque)
{
unsigned total_elt_sz;
@@ -368,7 +368,7 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
int ret;
/* Notify memory area to mempool */
- ret = rte_mempool_ops_register_memory_area(mp, vaddr, paddr, len);
+ ret = rte_mempool_ops_register_memory_area(mp, vaddr, iova, len);
if (ret != -ENOTSUP && ret < 0)
return ret;
@@ -402,7 +402,7 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
memhdr->mp = mp;
memhdr->addr = vaddr;
- memhdr->iova = paddr;
+ memhdr->iova = iova;
memhdr->len = len;
memhdr->free_cb = free_cb;
memhdr->opaque = opaque;
@@ -417,11 +417,11 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
while (off + total_elt_sz <= len && mp->populated_size < mp->size) {
off += mp->header_size;
- if (paddr == RTE_BAD_PHYS_ADDR)
+ if (iova == RTE_BAD_IOVA)
mempool_add_elem(mp, (char *)vaddr + off,
- RTE_BAD_PHYS_ADDR);
+ RTE_BAD_IOVA);
else
- mempool_add_elem(mp, (char *)vaddr + off, paddr + off);
+ mempool_add_elem(mp, (char *)vaddr + off, iova + off);
off += mp->elt_size + mp->trailer_size;
i++;
}
@@ -435,12 +435,20 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
return i;
}
+int
+rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
+ phys_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
+ void *opaque)
+{
+ return rte_mempool_populate_iova(mp, vaddr, paddr, len, free_cb, opaque);
+}
+
/* Add objects in the pool, using a table of physical pages. Return the
* number of objects added, or a negative value on error.
*/
int
-rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
- const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
+rte_mempool_populate_iova_tab(struct rte_mempool *mp, char *vaddr,
+ const rte_iova_t iova[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque)
{
uint32_t i, n;
@@ -452,18 +460,18 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
return -EEXIST;
if (mp->flags & MEMPOOL_F_NO_PHYS_CONTIG)
- return rte_mempool_populate_phys(mp, vaddr, RTE_BAD_PHYS_ADDR,
+ return rte_mempool_populate_iova(mp, vaddr, RTE_BAD_IOVA,
pg_num * pg_sz, free_cb, opaque);
for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {
/* populate with the largest group of contiguous pages */
for (n = 1; (i + n) < pg_num &&
- paddr[i + n - 1] + pg_sz == paddr[i + n]; n++)
+ iova[i + n - 1] + pg_sz == iova[i + n]; n++)
;
- ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,
- paddr[i], n * pg_sz, free_cb, opaque);
+ ret = rte_mempool_populate_iova(mp, vaddr + i * pg_sz,
+ iova[i], n * pg_sz, free_cb, opaque);
if (ret < 0) {
rte_mempool_free_memchunks(mp);
return ret;
@@ -475,6 +483,15 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
return cnt;
}
+int
+rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
+ const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
+ rte_mempool_memchunk_free_cb_t *free_cb, void *opaque)
+{
+ return rte_mempool_populate_iova_tab(mp, vaddr, paddr, pg_num, pg_shift,
+ free_cb, opaque);
+}
+
/* Populate the mempool with a virtual area. Return the number of
* objects added, or a negative value on error.
*/
@@ -497,7 +514,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
return -EINVAL;
if (mp->flags & MEMPOOL_F_NO_PHYS_CONTIG)
- return rte_mempool_populate_phys(mp, addr, RTE_BAD_PHYS_ADDR,
+ return rte_mempool_populate_iova(mp, addr, RTE_BAD_IOVA,
len, free_cb, opaque);
for (off = 0; off + pg_sz <= len &&
@@ -520,7 +537,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
break;
}
- ret = rte_mempool_populate_phys(mp, addr + off, iova,
+ ret = rte_mempool_populate_iova(mp, addr + off, iova,
phys_len, free_cb, opaque);
if (ret < 0)
goto fail;
@@ -604,7 +621,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)
iova = mz->iova;
if (rte_eal_has_hugepages())
- ret = rte_mempool_populate_phys(mp, mz->addr,
+ ret = rte_mempool_populate_iova(mp, mz->addr,
iova, mz->len,
rte_mempool_memchunk_mz_free,
(void *)(uintptr_t)mz);
@@ -990,7 +1007,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,
if (mp_init)
mp_init(mp, mp_init_arg);
- ret = rte_mempool_populate_phys_tab(mp, vaddr, iova, pg_num, pg_shift,
+ ret = rte_mempool_populate_iova_tab(mp, vaddr, iova, pg_num, pg_shift,
NULL, NULL);
if (ret < 0 || ret != (int)mp->size)
goto fail;
diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index 4a31f03f2..721227f6d 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -880,7 +880,7 @@ rte_mempool_free(struct rte_mempool *mp);
* Add a virtually and physically contiguous memory chunk in the pool
* where objects can be instantiated.
*
- * If the given physical address is unknown (paddr = RTE_BAD_PHYS_ADDR),
+ * If the given IO address is unknown (iova = RTE_BAD_IOVA),
* the chunk doesn't need to be physically contiguous (only virtually),
* and allocated objects may span two pages.
*
@@ -888,8 +888,8 @@ rte_mempool_free(struct rte_mempool *mp);
* A pointer to the mempool structure.
* @param vaddr
* The virtual address of memory that should be used to store objects.
- * @param paddr
- * The physical address
+ * @param iova
+ * The IO address
* @param len
* The length of memory in bytes.
* @param free_cb
@@ -901,6 +901,11 @@ rte_mempool_free(struct rte_mempool *mp);
* On error, the chunk is not added in the memory list of the
* mempool and a negative errno is returned.
*/
+int rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,
+ rte_iova_t iova, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
+ void *opaque);
+
+__rte_deprecated
int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
phys_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
void *opaque);
@@ -909,18 +914,17 @@ int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
* Add physical memory for objects in the pool at init
*
* Add a virtually contiguous memory chunk in the pool where objects can
- * be instantiated. The physical addresses corresponding to the virtual
- * area are described in paddr[], pg_num, pg_shift.
+ * be instantiated. The IO addresses corresponding to the virtual
+ * area are described in iova[], pg_num, pg_shift.
*
* @param mp
* A pointer to the mempool structure.
* @param vaddr
* The virtual address of memory that should be used to store objects.
- * @param paddr
- * An array of physical addresses of each page composing the virtual
- * area.
+ * @param iova
+ * An array of IO addresses of each page composing the virtual area.
* @param pg_num
- * Number of elements in the paddr array.
+ * Number of elements in the iova array.
* @param pg_shift
* LOG2 of the physical pages size.
* @param free_cb
@@ -932,6 +936,11 @@ int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,
* On error, the chunks are not added in the memory list of the
* mempool and a negative errno is returned.
*/
+int rte_mempool_populate_iova_tab(struct rte_mempool *mp, char *vaddr,
+ const rte_iova_t iova[], uint32_t pg_num, uint32_t pg_shift,
+ rte_mempool_memchunk_free_cb_t *free_cb, void *opaque);
+
+__rte_deprecated
int rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,
rte_mempool_memchunk_free_cb_t *free_cb, void *opaque);
diff --git a/lib/librte_mempool/rte_mempool_version.map b/lib/librte_mempool/rte_mempool_version.map
index ff86dc9a7..62b76f912 100644
--- a/lib/librte_mempool/rte_mempool_version.map
+++ b/lib/librte_mempool/rte_mempool_version.map
@@ -47,5 +47,7 @@ DPDK_17.11 {
rte_mempool_ops_get_capabilities;
rte_mempool_ops_register_memory_area;
+ rte_mempool_populate_iova;
+ rte_mempool_populate_iova_tab;
} DPDK_16.07;
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 11/15] mbuf: rename physical address to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
` (9 preceding siblings ...)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 10/15] mempool: rename populate functions " Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 15:52 ` Olivier MATZ
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 12/15] mbuf: rename data address helpers " Thomas Monjalon
` (4 subsequent siblings)
15 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
From: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Rename buf_physaddr to buf_iova.
Keep the deprecated name in an anonymous union to avoid breaking
the API.
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-crypto-perf/cperf_test_common.c | 4 ++--
doc/guides/prog_guide/img/mbuf1.svg | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 +-
drivers/crypto/dpaa_sec/dpaa_sec.c | 4 ++--
drivers/net/ark/ark_ethdev_rx.c | 8 ++++----
drivers/net/bnx2x/bnx2x_rxtx.c | 4 ++--
drivers/net/bnxt/bnxt_ring.h | 2 +-
drivers/net/cxgbe/sge.c | 4 ++--
drivers/net/dpaa/dpaa_rxtx.c | 6 +++---
drivers/net/ena/ena_ethdev.c | 6 +++---
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_rxtx.c | 6 +++---
drivers/net/fm10k/fm10k.h | 4 ++--
drivers/net/fm10k/fm10k_rxtx_vec.c | 4 ++--
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 4 ++--
drivers/net/i40e/i40e_rxtx_vec_neon.c | 6 +++---
drivers/net/i40e/i40e_rxtx_vec_sse.c | 6 +++---
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 6 +++---
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 6 +++---
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtqueue.h | 2 +-
lib/librte_kni/rte_kni.c | 2 +-
lib/librte_mbuf/rte_mbuf.c | 6 +++---
lib/librte_mbuf/rte_mbuf.h | 18 +++++++++++-------
lib/librte_vhost/virtio_net.c | 2 +-
test/test/test_mbuf.c | 2 +-
27 files changed, 63 insertions(+), 59 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 08b313f8b..84c5a3d76 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -50,7 +50,7 @@ fill_single_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp,
/* start of buffer is after mbuf structure and priv data */
m->priv_size = 0;
m->buf_addr = (char *)m + mbuf_hdr_size;
- m->buf_physaddr = rte_mempool_virt2iova(obj) +
+ m->buf_iova = rte_mempool_virt2iova(obj) +
mbuf_offset + mbuf_hdr_size;
m->buf_len = segment_sz;
m->data_len = segment_sz;
@@ -81,7 +81,7 @@ fill_multi_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp,
/* start of buffer is after mbuf structure and priv data */
m->priv_size = 0;
m->buf_addr = (char *)m + mbuf_hdr_size;
- m->buf_physaddr = next_seg_phys_addr;
+ m->buf_iova = next_seg_phys_addr;
next_seg_phys_addr += mbuf_hdr_size + segment_sz;
m->buf_len = segment_sz;
m->data_len = segment_sz;
diff --git a/doc/guides/prog_guide/img/mbuf1.svg b/doc/guides/prog_guide/img/mbuf1.svg
index 5bd84d1bf..8750424e3 100644
--- a/doc/guides/prog_guide/img/mbuf1.svg
+++ b/doc/guides/prog_guide/img/mbuf1.svg
@@ -482,7 +482,7 @@
sodipodi:role="line"
x="187.85715"
y="347.7193"
- id="tspan5240">(m->buf_physaddr is the</tspan><tspan
+ id="tspan5240">(m->buf_iova is the</tspan><tspan
sodipodi:role="line"
x="187.85715"
y="360.2193"
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index e14a9a975..c1b842f31 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -314,7 +314,7 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
* These routines are called with help of below MACRO's
*/
-#define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_physaddr)
+#define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_iova)
#define DPAA2_OP_VADDR_TO_IOVA(op) (op->phys_addr)
/**
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 30a2a3807..234c84f22 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -798,9 +798,9 @@ build_cipher_auth(struct rte_crypto_op *op, dpaa_sec_session *ses)
uint8_t *IV_ptr = rte_crypto_op_ctod_offset(op, uint8_t *,
ses->iv.offset);
- src_start_addr = sym->m_src->buf_physaddr + sym->m_src->data_off;
+ src_start_addr = sym->m_src->buf_iova + sym->m_src->data_off;
if (sym->m_dst)
- dst_start_addr = sym->m_dst->buf_physaddr + sym->m_dst->data_off;
+ dst_start_addr = sym->m_dst->buf_iova + sym->m_dst->data_off;
else
dst_start_addr = src_start_addr;
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 4e39d9557..2ffaeac3e 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -499,22 +499,22 @@ eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue)
case 0:
while (count != nb) {
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iova;
count++;
/* FALLTHROUGH */
case 3:
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iova;
count++;
/* FALLTHROUGH */
case 2:
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iova;
count++;
/* FALLTHROUGH */
case 1:
queue->paddress_q[seed_m++] =
- (*mbufs++)->buf_physaddr;
+ (*mbufs++)->buf_iova;
count++;
/* FALLTHROUGH */
diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c
index 99d7d285c..7c3324a6d 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.c
+++ b/drivers/net/bnx2x/bnx2x_rxtx.c
@@ -140,7 +140,7 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
return -ENOMEM;
}
rxq->sw_ring[idx] = mbuf;
- rxq->rx_ring[idx] = mbuf->buf_physaddr;
+ rxq->rx_ring[idx] = mbuf->buf_iova;
}
rxq->pkt_first_seg = NULL;
rxq->pkt_last_seg = NULL;
@@ -400,7 +400,7 @@ bnx2x_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
rx_mb = rxq->sw_ring[bd_cons];
rxq->sw_ring[bd_cons] = new_mb;
- rxq->rx_ring[bd_prod] = new_mb->buf_physaddr;
+ rxq->rx_ring[bd_prod] = new_mb->buf_iova;
rx_pref = NEXT_RX_BD(bd_cons) & MAX_RX_BD(rxq);
rte_prefetch0(rxq->sw_ring[rx_pref]);
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index 6d1eb5888..ac1ce2a57 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -41,7 +41,7 @@
#define RING_NEXT(ring, idx) (((idx) + 1) & (ring)->ring_mask)
#define RTE_MBUF_DATA_DMA_ADDR(mb) \
- ((uint64_t)((mb)->buf_physaddr + (mb)->data_off))
+ ((uint64_t)((mb)->buf_iova + (mb)->data_off))
#define DB_IDX_MASK 0xffffff
#define DB_IDX_VALID (0x1 << 26)
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index 9f915158a..fc10d9585 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -149,7 +149,7 @@ static int map_mbuf(struct rte_mbuf *mbuf, dma_addr_t *addr)
struct rte_mbuf *m = mbuf;
for (; m; m = m->next, addr++) {
- *addr = m->buf_physaddr + rte_pktmbuf_headroom(m);
+ *addr = m->buf_iova + rte_pktmbuf_headroom(m);
if (*addr == 0)
goto out_err;
}
@@ -423,7 +423,7 @@ static unsigned int refill_fl_usembufs(struct adapter *adap, struct sge_fl *q,
mbuf->nb_segs = 1;
mbuf->port = rxq->rspq.port_id;
- mapping = (dma_addr_t)RTE_ALIGN(mbuf->buf_physaddr +
+ mapping = (dma_addr_t)RTE_ALIGN(mbuf->buf_iova +
mbuf->data_off,
adap->sge.fl_align);
mapping |= buf_size_idx;
diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index a5a0db714..41e57f2e2 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -77,7 +77,7 @@
(_fd)->opaque = QM_FD_CONTIG << DPAA_FD_FORMAT_SHIFT; \
(_fd)->opaque |= ((_mbuf)->data_off) << DPAA_FD_OFFSET_SHIFT; \
(_fd)->opaque |= (_mbuf)->pkt_len; \
- (_fd)->addr = (_mbuf)->buf_physaddr; \
+ (_fd)->addr = (_mbuf)->buf_iova; \
(_fd)->bpid = _bpid; \
} while (0)
@@ -514,7 +514,7 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
sgt = temp->buf_addr + temp->data_off;
fd->format = QM_FD_SG;
- fd->addr = temp->buf_physaddr;
+ fd->addr = temp->buf_iova;
fd->offset = temp->data_off;
fd->bpid = bpid;
fd->length20 = mbuf->pkt_len;
@@ -523,7 +523,7 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
sg_temp = &sgt[i++];
sg_temp->opaque = 0;
sg_temp->val = 0;
- sg_temp->addr = cur_seg->buf_physaddr;
+ sg_temp->addr = cur_seg->buf_iova;
sg_temp->offset = cur_seg->data_off;
sg_temp->length = cur_seg->data_len;
if (RTE_MBUF_DIRECT(cur_seg)) {
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index a62c39875..22db8951f 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1167,7 +1167,7 @@ static int ena_populate_rx_queue(struct ena_ring *rxq, unsigned int count)
rte_prefetch0(mbufs[((next_to_use + 4) & ring_mask)]);
/* prepare physical address for DMA transaction */
- ebuf.paddr = mbuf->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ ebuf.paddr = mbuf->buf_iova + RTE_PKTMBUF_HEADROOM;
ebuf.len = mbuf->buf_len - RTE_PKTMBUF_HEADROOM;
/* pass resource to device */
rc = ena_com_add_single_rx_desc(rxq->ena_com_io_sq,
@@ -1726,7 +1726,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
* consideration pushed header
*/
if (mbuf->data_len > ena_tx_ctx.header_len) {
- ebuf->paddr = mbuf->buf_physaddr +
+ ebuf->paddr = mbuf->buf_iova +
mbuf->data_off +
ena_tx_ctx.header_len;
ebuf->len = mbuf->data_len - ena_tx_ctx.header_len;
@@ -1735,7 +1735,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
}
while ((mbuf = mbuf->next) != NULL) {
- ebuf->paddr = mbuf->buf_physaddr + mbuf->data_off;
+ ebuf->paddr = mbuf->buf_iova + mbuf->data_off;
ebuf->len = mbuf->data_len;
ebuf++;
tx_info->num_of_bufs++;
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 3a2a8d182..8af0ccd3c 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -316,7 +316,7 @@ enic_alloc_rx_queue_mbufs(struct enic *enic, struct vnic_rq *rq)
}
mb->data_off = RTE_PKTMBUF_HEADROOM;
- dma_addr = (dma_addr_t)(mb->buf_physaddr
+ dma_addr = (dma_addr_t)(mb->buf_iova
+ RTE_PKTMBUF_HEADROOM);
rq_enet_desc_enc(rqd, dma_addr,
(rq->is_sop ? RQ_ENET_TYPE_ONLY_SOP
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index 1d43bde9a..74450ea71 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -386,7 +386,7 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
/* Push descriptor for newly allocated mbuf */
nmb->data_off = RTE_PKTMBUF_HEADROOM;
- dma_addr = (dma_addr_t)(nmb->buf_physaddr +
+ dma_addr = (dma_addr_t)(nmb->buf_iova +
RTE_PKTMBUF_HEADROOM);
rq_enet_desc_enc(rqd_ptr, dma_addr,
(rq->is_sop ? RQ_ENET_TYPE_ONLY_SOP
@@ -578,7 +578,7 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
vlan_id = 0;
vlan_tag_insert = 0;
bus_addr = (dma_addr_t)
- (tx_pkt->buf_physaddr + tx_pkt->data_off);
+ (tx_pkt->buf_iova + tx_pkt->data_off);
descs = (struct wq_enet_desc *)wq->ring.descs;
desc_p = descs + head_idx;
@@ -630,7 +630,7 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
if (tx_pkt->next == NULL)
eop = 1;
desc_p = descs + head_idx;
- bus_addr = (dma_addr_t)(tx_pkt->buf_physaddr
+ bus_addr = (dma_addr_t)(tx_pkt->buf_iova
+ tx_pkt->data_off);
wq_enet_desc_enc((struct wq_enet_desc *)
&desc_tmp, bus_addr, data_len,
diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h
index 594dca4f9..1273aa865 100644
--- a/drivers/net/fm10k/fm10k.h
+++ b/drivers/net/fm10k/fm10k.h
@@ -253,11 +253,11 @@ struct fm10k_txq_ops {
};
#define MBUF_DMA_ADDR(mb) \
- ((uint64_t) ((mb)->buf_physaddr + (mb)->data_off))
+ ((uint64_t) ((mb)->buf_iova + (mb)->data_off))
/* enforce 512B alignment on default Rx DMA addresses */
#define MBUF_DMA_ADDR_DEFAULT(mb) \
- ((uint64_t) RTE_ALIGN(((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM),\
+ ((uint64_t) RTE_ALIGN(((mb)->buf_iova + RTE_PKTMBUF_HEADROOM),\
FM10K_RX_DATABUF_ALIGN))
static inline void fifo_reset(struct fifo *fifo, uint32_t len)
diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
index edc4ae16e..ce042d3d2 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -330,8 +330,8 @@ fm10k_rxq_rearm(struct fm10k_rx_queue *rxq)
p1 = (uintptr_t)&mb1->rearm_data;
*(uint64_t *)p1 = rxq->mbuf_initializer;
- /* 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);
diff --git a/drivers/net/i40e/i40e_rxtx_vec_altivec.c b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
index 5ab9445ed..5e4e472a3 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_altivec.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
@@ -100,7 +100,7 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq)
p1 = (uintptr_t)&mb1->rearm_data;
*(uint64_t *)p1 = rxq->mbuf_initializer;
- /* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */
+ /* load buf_addr(lo 64bit) and buf_iova(hi 64bit) */
vaddr0 = vec_ld(0, (vector unsigned long *)&mb0->buf_addr);
vaddr1 = vec_ld(0, (vector unsigned long *)&mb1->buf_addr);
@@ -538,7 +538,7 @@ vtx1(volatile struct i40e_tx_desc *txdp,
((uint64_t)pkt->data_len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT));
vector unsigned long descriptor = (vector unsigned long){
- pkt->buf_physaddr + pkt->data_off, high_qw};
+ pkt->buf_iova + pkt->data_off, high_qw};
*(vector unsigned long *)txdp = descriptor;
}
diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index d0e604068..12219274e 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -81,13 +81,13 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq)
mb0 = rxep[0].mbuf;
mb1 = rxep[1].mbuf;
- paddr = mb0->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb0->buf_iova + RTE_PKTMBUF_HEADROOM;
dma_addr0 = vdupq_n_u64(paddr);
/* flush desc with pa dma_addr */
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr0);
- paddr = mb1->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb1->buf_iova + RTE_PKTMBUF_HEADROOM;
dma_addr1 = vdupq_n_u64(paddr);
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr1);
}
@@ -515,7 +515,7 @@ vtx1(volatile struct i40e_tx_desc *txdp,
((uint64_t)flags << I40E_TXD_QW1_CMD_SHIFT) |
((uint64_t)pkt->data_len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT));
- uint64x2_t descriptor = {pkt->buf_physaddr + pkt->data_off, high_qw};
+ uint64x2_t descriptor = {pkt->buf_iova + pkt->data_off, high_qw};
vst1q_u64((uint64_t *)txdp, descriptor);
}
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 86e16ddf9..9d2d1f837 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -86,8 +86,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);
@@ -549,7 +549,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);
}
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
index 18e3d199f..2e87ffa0a 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
@@ -87,13 +87,13 @@ ixgbe_rxq_rearm(struct ixgbe_rx_queue *rxq)
* Data to be rearmed is 6 bytes long.
*/
vst1_u8((uint8_t *)&mb0->rearm_data, p);
- paddr = mb0->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb0->buf_iova + RTE_PKTMBUF_HEADROOM;
dma_addr0 = vsetq_lane_u64(paddr, zero, 0);
/* flush desc with pa dma_addr */
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr0);
vst1_u8((uint8_t *)&mb1->rearm_data, p);
- paddr = mb1->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ paddr = mb1->buf_iova + RTE_PKTMBUF_HEADROOM;
dma_addr1 = vsetq_lane_u64(paddr, zero, 0);
vst1q_u64((uint64_t *)&rxdp++->read, dma_addr1);
}
@@ -414,7 +414,7 @@ vtx1(volatile union ixgbe_adv_tx_desc *txdp,
struct rte_mbuf *pkt, uint64_t flags)
{
uint64x2_t descriptor = {
- pkt->buf_physaddr + pkt->data_off,
+ pkt->buf_iova + pkt->data_off,
(uint64_t)pkt->pkt_len << 46 | flags | pkt->data_len};
vst1q_u64((uint64_t *)&txdp->read, descriptor);
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index 158ccd91d..a3b5b6bfb 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -86,8 +86,8 @@ ixgbe_rxq_rearm(struct ixgbe_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));
@@ -667,7 +667,7 @@ vtx1(volatile union ixgbe_adv_tx_desc *txdp,
{
__m128i descriptor = _mm_set_epi64x((uint64_t)pkt->pkt_len << 46 |
flags | pkt->data_len,
- pkt->buf_physaddr + pkt->data_off);
+ pkt->buf_iova + pkt->data_off);
_mm_store_si128((__m128i *)&txdp->read, descriptor);
}
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 7f1a026ac..e141627cc 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -106,7 +106,7 @@ static uint16_t nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
#define NFP_QCP_MAX_ADD 0x7f
#define RTE_MBUF_DMA_ADDR_DEFAULT(mb) \
- (uint64_t)((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM)
+ (uint64_t)((mb)->buf_iova + RTE_PKTMBUF_HEADROOM)
/* nfp_qcp_ptr - Read or Write Pointer of a queue */
enum nfp_qcp_ptr {
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index c6756ed3f..d2576d5e0 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -493,7 +493,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
* VIRTIO_MBUF_DATA_DMA_ADDR in virtqueue.h for more information.
*/
if (!hw->virtio_user_dev)
- vq->offset = offsetof(struct rte_mbuf, buf_physaddr);
+ vq->offset = offsetof(struct rte_mbuf, buf_iova);
else {
vq->vq_ring_mem = (uintptr_t)mz->addr;
vq->offset = offsetof(struct rte_mbuf, buf_addr);
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 235f8c525..6c90d3779 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -79,7 +79,7 @@ struct rte_mbuf;
#define VIRTIO_MBUF_ADDR(mb, vq) \
((uint64_t)(*(uintptr_t *)((uintptr_t)(mb) + (vq)->offset)))
#else
-#define VIRTIO_MBUF_ADDR(mb, vq) ((mb)->buf_physaddr)
+#define VIRTIO_MBUF_ADDR(mb, vq) ((mb)->buf_iova)
#endif
/**
diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index 8c483c1f4..5ee38e9ad 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -456,7 +456,7 @@ va2pa(struct rte_mbuf *m)
{
return (void *)((unsigned long)m -
((unsigned long)m->buf_addr -
- (unsigned long)m->buf_physaddr));
+ (unsigned long)m->buf_iova));
}
static void
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index c96943522..71c65a042 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -134,7 +134,7 @@ rte_pktmbuf_init(struct rte_mempool *mp,
/* start of buffer is after mbuf structure and priv data */
m->priv_size = priv_size;
m->buf_addr = (char *)m + mbuf_size;
- m->buf_physaddr = rte_mempool_virt2iova(m) + mbuf_size;
+ m->buf_iova = rte_mempool_virt2iova(m) + mbuf_size;
m->buf_len = (uint16_t)buf_len;
/* keep some headroom between start of buffer and data */
@@ -211,7 +211,7 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)
/* generic checks */
if (m->pool == NULL)
rte_panic("bad mbuf pool\n");
- if (m->buf_physaddr == 0)
+ if (m->buf_iova == 0)
rte_panic("bad phys addr\n");
if (m->buf_addr == NULL)
rte_panic("bad virt addr\n");
@@ -244,7 +244,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)
__rte_mbuf_sanity_check(m, 1);
fprintf(f, "dump mbuf at %p, phys=%"PRIx64", buf_len=%u\n",
- m, (uint64_t)m->buf_physaddr, (unsigned)m->buf_len);
+ m, (uint64_t)m->buf_iova, (unsigned)m->buf_len);
fprintf(f, " pkt_len=%"PRIu32", ol_flags=%"PRIx64", nb_segs=%u, "
"in_port=%u\n", m->pkt_len, m->ol_flags,
(unsigned)m->nb_segs, (unsigned)m->port);
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 0a555e2d5..7a4634fdd 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -432,7 +432,11 @@ struct rte_mbuf {
* same mbuf cacheline0 layout for 32-bit and 64-bit. This makes
* working on vector drivers easier.
*/
- phys_addr_t buf_physaddr __rte_aligned(sizeof(phys_addr_t));
+ RTE_STD_C11
+ union {
+ rte_iova_t buf_iova;
+ rte_iova_t buf_physaddr; /**< deprecated */
+ } __rte_aligned(sizeof(rte_iova_t));
/* next 8 bytes are initialised on RX descriptor rearm */
MARKER64 rearm_data;
@@ -631,7 +635,7 @@ static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp);
static inline phys_addr_t
rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
{
- return mb->buf_physaddr + mb->data_off;
+ return mb->buf_iova + mb->data_off;
}
/**
@@ -649,7 +653,7 @@ rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
static inline phys_addr_t
rte_mbuf_data_dma_addr_default(const struct rte_mbuf *mb)
{
- return mb->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+ return mb->buf_iova + RTE_PKTMBUF_HEADROOM;
}
/**
@@ -840,7 +844,7 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header);
* For standard needs, prefer rte_pktmbuf_alloc().
*
* The caller can expect that the following fields of the mbuf structure
- * are initialized: buf_addr, buf_physaddr, buf_len, refcnt=1, nb_segs=1,
+ * are initialized: buf_addr, buf_iova, buf_len, refcnt=1, nb_segs=1,
* next=NULL, pool, priv_size. The other fields must be initialized
* by the caller.
*
@@ -1250,7 +1254,7 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *m)
rte_mbuf_refcnt_update(md, 1);
mi->priv_size = m->priv_size;
- mi->buf_physaddr = m->buf_physaddr;
+ mi->buf_iova = m->buf_iova;
mi->buf_addr = m->buf_addr;
mi->buf_len = m->buf_len;
@@ -1298,7 +1302,7 @@ static inline void rte_pktmbuf_detach(struct rte_mbuf *m)
m->priv_size = priv_size;
m->buf_addr = (char *)m + mbuf_size;
- m->buf_physaddr = rte_mempool_virt2iova(m) + mbuf_size;
+ m->buf_iova = rte_mempool_virt2iova(m) + mbuf_size;
m->buf_len = (uint16_t)buf_len;
rte_pktmbuf_reset_headroom(m);
m->data_len = 0;
@@ -1569,7 +1573,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)
* The offset into the data to calculate address from.
*/
#define rte_pktmbuf_mtophys_offset(m, o) \
- (phys_addr_t)((m)->buf_physaddr + (m)->data_off + (o))
+ (rte_iova_t)((m)->buf_iova + (m)->data_off + (o))
/**
* A macro that returns the physical address that points to the start of the
diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 3c6f1a531..6fee16e55 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -978,7 +978,7 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,
cur->data_len = cpy_len;
cur->data_off = 0;
cur->buf_addr = (void *)(uintptr_t)desc_addr;
- cur->buf_physaddr = hpa;
+ cur->buf_iova = hpa;
/*
* In zero copy mode, one mbuf can only reference data
diff --git a/test/test/test_mbuf.c b/test/test/test_mbuf.c
index 20e146b01..414509b20 100644
--- a/test/test/test_mbuf.c
+++ b/test/test/test_mbuf.c
@@ -906,7 +906,7 @@ test_failing_mbuf_sanity_check(struct rte_mempool *pktmbuf_pool)
}
badbuf = *buf;
- badbuf.buf_physaddr = 0;
+ badbuf.buf_iova = 0;
if (verify_mbuf_check_panics(&badbuf)) {
printf("Error with bad-physaddr mbuf test\n");
return -1;
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 12/15] mbuf: rename data address helpers to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
` (10 preceding siblings ...)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 11/15] mbuf: rename physical address " Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 15:56 ` Olivier MATZ
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 13/15] cryptodev: rename physical address type " Thomas Monjalon
` (3 subsequent siblings)
15 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
The following inline functions and macros have been renamed to be
consistent with the IOVA wording:
rte_mbuf_data_dma_addr -> rte_mbuf_data_iova
rte_mbuf_data_dma_addr_default -> rte_mbuf_data_iova_default
rte_pktmbuf_mtophys -> rte_pktmbuf_iova
rte_pktmbuf_mtophys_offset -> rte_pktmbuf_iova_offset
The deprecated functions and macros are kept to avoid breaking the API.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-crypto-perf/cperf_ops.c | 6 +++---
drivers/crypto/dpaa_sec/dpaa_sec.c | 6 +++---
drivers/crypto/mrvl/rte_mrvl_pmd.c | 4 ++--
drivers/crypto/qat/qat_crypto.c | 18 ++++++++--------
drivers/net/ark/ark_ethdev_tx.c | 2 +-
drivers/net/bnx2x/bnx2x.c | 2 +-
drivers/net/e1000/em_rxtx.c | 8 +++----
drivers/net/e1000/igb_rxtx.c | 8 +++----
drivers/net/i40e/i40e_rxtx.c | 14 ++++++------
drivers/net/ixgbe/ixgbe_rxtx.c | 14 ++++++------
drivers/net/liquidio/lio_rxtx.c | 8 +++----
drivers/net/liquidio/lio_rxtx.h | 2 +-
drivers/net/mrvl/mrvl_ethdev.c | 8 +++----
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/octeontx/octeontx_rxtx.c | 2 +-
drivers/net/qede/qede_rxtx.c | 16 +++++++-------
drivers/net/sfc/sfc_ef10_rx.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 4 ++--
drivers/net/sfc/sfc_rx.c | 2 +-
drivers/net/sfc/sfc_tso.c | 2 +-
drivers/net/sfc/sfc_tx.c | 2 +-
drivers/net/thunderx/nicvf_rxtx.h | 4 ++--
drivers/net/vmxnet3/vmxnet3_rxtx.c | 4 ++--
examples/ipsec-secgw/esp.c | 12 +++++------
examples/l2fwd-crypto/main.c | 4 ++--
lib/librte_mbuf/rte_mbuf.h | 41 ++++++++++++++++++++++++++---------
test/test/test_cryptodev.c | 42 ++++++++++++++++++------------------
test/test/test_cryptodev.h | 2 +-
28 files changed, 131 insertions(+), 110 deletions(-)
diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index bc6b24fc2..23d30ca39 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -221,7 +221,7 @@ cperf_set_ops_auth(struct rte_crypto_op **ops,
sym_op->auth.digest.data = rte_pktmbuf_mtod_offset(buf,
uint8_t *, offset);
sym_op->auth.digest.phys_addr =
- rte_pktmbuf_mtophys_offset(buf, offset);
+ rte_pktmbuf_iova_offset(buf, offset);
}
@@ -318,7 +318,7 @@ cperf_set_ops_cipher_auth(struct rte_crypto_op **ops,
sym_op->auth.digest.data = rte_pktmbuf_mtod_offset(buf,
uint8_t *, offset);
sym_op->auth.digest.phys_addr =
- rte_pktmbuf_mtophys_offset(buf, offset);
+ rte_pktmbuf_iova_offset(buf, offset);
}
if (options->auth_algo == RTE_CRYPTO_AUTH_SNOW3G_UIA2 ||
@@ -425,7 +425,7 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,
sym_op->aead.digest.data = rte_pktmbuf_mtod_offset(buf,
uint8_t *, offset);
sym_op->aead.digest.phys_addr =
- rte_pktmbuf_mtophys_offset(buf, offset);
+ rte_pktmbuf_iova_offset(buf, offset);
}
}
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 234c84f22..1d9d03aaa 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -577,7 +577,7 @@ build_auth_only(struct rte_crypto_op *op, dpaa_sec_session *ses)
ctx->op = op;
old_digest = ctx->digest;
- start_addr = rte_pktmbuf_mtophys(mbuf);
+ start_addr = rte_pktmbuf_iova(mbuf);
/* output */
sg = &cf->sg[0];
qm_sg_entry_set64(sg, sym->auth.digest.phys_addr);
@@ -637,10 +637,10 @@ build_cipher_only(struct rte_crypto_op *op, dpaa_sec_session *ses)
cf = &ctx->job;
ctx->op = op;
- src_start_addr = rte_pktmbuf_mtophys(sym->m_src);
+ src_start_addr = rte_pktmbuf_iova(sym->m_src);
if (sym->m_dst)
- dst_start_addr = rte_pktmbuf_mtophys(sym->m_dst);
+ dst_start_addr = rte_pktmbuf_iova(sym->m_dst);
else
dst_start_addr = src_start_addr;
diff --git a/drivers/crypto/mrvl/rte_mrvl_pmd.c b/drivers/crypto/mrvl/rte_mrvl_pmd.c
index 63895c540..f778a80fc 100644
--- a/drivers/crypto/mrvl/rte_mrvl_pmd.c
+++ b/drivers/crypto/mrvl/rte_mrvl_pmd.c
@@ -480,7 +480,7 @@ mrvl_request_prepare(struct sam_cio_op_params *request,
request->num_bufs = 1;
request->src = src_bd;
src_bd->vaddr = rte_pktmbuf_mtod(op->sym->m_src, void *);
- src_bd->paddr = rte_pktmbuf_mtophys(op->sym->m_src);
+ src_bd->paddr = rte_pktmbuf_iova(op->sym->m_src);
src_bd->len = rte_pktmbuf_data_len(op->sym->m_src);
/* Empty source. */
@@ -502,7 +502,7 @@ mrvl_request_prepare(struct sam_cio_op_params *request,
request->dst = dst_bd;
dst_bd->vaddr = rte_pktmbuf_mtod(dst_mbuf, void *);
- dst_bd->paddr = rte_pktmbuf_mtophys(dst_mbuf);
+ dst_bd->paddr = rte_pktmbuf_iova(dst_mbuf);
/*
* We can use all available space in dst_mbuf,
diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index e49b71f28..60148416b 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -1119,7 +1119,7 @@ qat_sgl_fill_array(struct rte_mbuf *buf, uint64_t buff_start,
{
int nr = 1;
- uint32_t buf_len = rte_pktmbuf_mtophys(buf) -
+ uint32_t buf_len = rte_pktmbuf_iova(buf) -
buff_start + rte_pktmbuf_data_len(buf);
list->bufers[0].addr = buff_start;
@@ -1143,7 +1143,7 @@ qat_sgl_fill_array(struct rte_mbuf *buf, uint64_t buff_start,
list->bufers[nr].len = rte_pktmbuf_data_len(buf);
list->bufers[nr].resrvd = 0;
- list->bufers[nr].addr = rte_pktmbuf_mtophys(buf);
+ list->bufers[nr].addr = rte_pktmbuf_iova(buf);
buf_len += list->bufers[nr].len;
buf = buf->next;
@@ -1499,26 +1499,26 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
* so as not to overwrite data in dest buffer
*/
src_buf_start =
- rte_pktmbuf_mtophys_offset(op->sym->m_src, min_ofs);
+ rte_pktmbuf_iova_offset(op->sym->m_src, min_ofs);
dst_buf_start =
- rte_pktmbuf_mtophys_offset(op->sym->m_dst, min_ofs);
+ rte_pktmbuf_iova_offset(op->sym->m_dst, min_ofs);
} else {
/* In-place operation
* Start DMA at nearest aligned address below min_ofs
*/
src_buf_start =
- rte_pktmbuf_mtophys_offset(op->sym->m_src, min_ofs)
+ rte_pktmbuf_iova_offset(op->sym->m_src, min_ofs)
& QAT_64_BTYE_ALIGN_MASK;
- if (unlikely((rte_pktmbuf_mtophys(op->sym->m_src) -
+ if (unlikely((rte_pktmbuf_iova(op->sym->m_src) -
rte_pktmbuf_headroom(op->sym->m_src))
> src_buf_start)) {
/* alignment has pushed addr ahead of start of mbuf
* so revert and take the performance hit
*/
src_buf_start =
- rte_pktmbuf_mtophys_offset(op->sym->m_src,
+ rte_pktmbuf_iova_offset(op->sym->m_src,
min_ofs);
}
dst_buf_start = src_buf_start;
@@ -1526,7 +1526,7 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
if (do_cipher || do_aead) {
cipher_param->cipher_offset =
- (uint32_t)rte_pktmbuf_mtophys_offset(
+ (uint32_t)rte_pktmbuf_iova_offset(
op->sym->m_src, cipher_ofs) - src_buf_start;
cipher_param->cipher_length = cipher_len;
} else {
@@ -1535,7 +1535,7 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
}
if (do_auth || do_aead) {
- auth_param->auth_off = (uint32_t)rte_pktmbuf_mtophys_offset(
+ auth_param->auth_off = (uint32_t)rte_pktmbuf_iova_offset(
op->sym->m_src, auth_ofs) - src_buf_start;
auth_param->auth_len = auth_len;
} else {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 57841dfd1..0d3c7dc41 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -93,7 +93,7 @@ eth_ark_tx_meta_from_mbuf(struct ark_tx_meta *meta,
const struct rte_mbuf *mbuf,
uint8_t flags)
{
- meta->physaddr = rte_mbuf_data_dma_addr(mbuf);
+ meta->physaddr = rte_mbuf_data_iova(mbuf);
meta->delta_ns = 0;
meta->data_len = rte_pktmbuf_data_len(mbuf);
meta->flags = flags;
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 6b4526b18..99b532bb4 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -2135,7 +2135,7 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0)
tx_start_bd = &txq->tx_ring[TX_BD(bd_prod, txq)].start_bd;
tx_start_bd->addr =
- rte_cpu_to_le_64(rte_mbuf_data_dma_addr(m0));
+ rte_cpu_to_le_64(rte_mbuf_data_iova(m0));
tx_start_bd->nbytes = rte_cpu_to_le_16(m0->data_len);
tx_start_bd->bd_flags.as_bitfield = ETH_TX_BD_FLAGS_START_BD;
tx_start_bd->general_data =
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index 32ca9202a..1d8f0794d 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -577,7 +577,7 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
* Set up Transmit Data Descriptor.
*/
slen = m_seg->data_len;
- buf_dma_addr = rte_mbuf_data_dma_addr(m_seg);
+ buf_dma_addr = rte_mbuf_data_iova(m_seg);
txd->buffer_addr = rte_cpu_to_le_64(buf_dma_addr);
txd->lower.data = rte_cpu_to_le_32(cmd_type_len | slen);
@@ -799,7 +799,7 @@ eth_em_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
rxm = rxe->mbuf;
rxe->mbuf = nmb;
dma_addr =
- rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(nmb));
+ rte_cpu_to_le_64(rte_mbuf_data_iova_default(nmb));
rxdp->buffer_addr = dma_addr;
rxdp->status = 0;
@@ -979,7 +979,7 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
*/
rxm = rxe->mbuf;
rxe->mbuf = nmb;
- dma = rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(nmb));
+ dma = rte_cpu_to_le_64(rte_mbuf_data_iova_default(nmb));
rxdp->buffer_addr = dma;
rxdp->status = 0;
@@ -1652,7 +1652,7 @@ em_alloc_rx_queue_mbufs(struct em_rx_queue *rxq)
}
dma_addr =
- rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(mbuf));
+ rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf));
/* Clear HW ring memory */
rxq->rx_ring[i] = rxd_init;
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 4590179e6..4ee12e9e4 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -597,7 +597,7 @@ eth_igb_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
* Set up transmit descriptor.
*/
slen = (uint16_t) m_seg->data_len;
- buf_dma_addr = rte_mbuf_data_dma_addr(m_seg);
+ buf_dma_addr = rte_mbuf_data_iova(m_seg);
txd->read.buffer_addr =
rte_cpu_to_le_64(buf_dma_addr);
txd->read.cmd_type_len =
@@ -925,7 +925,7 @@ eth_igb_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
rxm = rxe->mbuf;
rxe->mbuf = nmb;
dma_addr =
- rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(nmb));
+ rte_cpu_to_le_64(rte_mbuf_data_iova_default(nmb));
rxdp->read.hdr_addr = 0;
rxdp->read.pkt_addr = dma_addr;
@@ -1119,7 +1119,7 @@ eth_igb_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
*/
rxm = rxe->mbuf;
rxe->mbuf = nmb;
- dma = rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(nmb));
+ dma = rte_cpu_to_le_64(rte_mbuf_data_iova_default(nmb));
rxdp->read.pkt_addr = dma;
rxdp->read.hdr_addr = 0;
@@ -2203,7 +2203,7 @@ igb_alloc_rx_queue_mbufs(struct igb_rx_queue *rxq)
return -ENOMEM;
}
dma_addr =
- rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(mbuf));
+ rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf));
rxd = &rxq->rx_ring[i];
rxd->read.hdr_addr = 0;
rxd->read.pkt_addr = dma_addr;
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 943e1c1c2..8b4f612ff 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -589,7 +589,7 @@ i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq)
mb->nb_segs = 1;
mb->port = rxq->port_id;
dma_addr = rte_cpu_to_le_64(\
- rte_mbuf_data_dma_addr_default(mb));
+ rte_mbuf_data_iova_default(mb));
rxdp[i].read.hdr_addr = 0;
rxdp[i].read.pkt_addr = dma_addr;
}
@@ -752,7 +752,7 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
rxm = rxe->mbuf;
rxe->mbuf = nmb;
dma_addr =
- rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(nmb));
+ rte_cpu_to_le_64(rte_mbuf_data_iova_default(nmb));
rxdp->read.hdr_addr = 0;
rxdp->read.pkt_addr = dma_addr;
@@ -869,7 +869,7 @@ i40e_recv_scattered_pkts(void *rx_queue,
rxm = rxe->mbuf;
rxe->mbuf = nmb;
dma_addr =
- rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(nmb));
+ rte_cpu_to_le_64(rte_mbuf_data_iova_default(nmb));
/* Set data buffer address and data length of the mbuf */
rxdp->read.hdr_addr = 0;
@@ -1202,7 +1202,7 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
/* Setup TX Descriptor */
slen = m_seg->data_len;
- buf_dma_addr = rte_mbuf_data_dma_addr(m_seg);
+ buf_dma_addr = rte_mbuf_data_iova(m_seg);
PMD_TX_LOG(DEBUG, "mbuf: %p, TDD[%u]:\n"
"buf_dma_addr: %#"PRIx64";\n"
@@ -1301,7 +1301,7 @@ tx4(volatile struct i40e_tx_desc *txdp, struct rte_mbuf **pkts)
uint32_t i;
for (i = 0; i < 4; i++, txdp++, pkts++) {
- dma_addr = rte_mbuf_data_dma_addr(*pkts);
+ dma_addr = rte_mbuf_data_iova(*pkts);
txdp->buffer_addr = rte_cpu_to_le_64(dma_addr);
txdp->cmd_type_offset_bsz =
i40e_build_ctob((uint32_t)I40E_TD_CMD, 0,
@@ -1315,7 +1315,7 @@ tx1(volatile struct i40e_tx_desc *txdp, struct rte_mbuf **pkts)
{
uint64_t dma_addr;
- dma_addr = rte_mbuf_data_dma_addr(*pkts);
+ dma_addr = rte_mbuf_data_iova(*pkts);
txdp->buffer_addr = rte_cpu_to_le_64(dma_addr);
txdp->cmd_type_offset_bsz =
i40e_build_ctob((uint32_t)I40E_TD_CMD, 0,
@@ -2451,7 +2451,7 @@ i40e_alloc_rx_queue_mbufs(struct i40e_rx_queue *rxq)
mbuf->port = rxq->port_id;
dma_addr =
- rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(mbuf));
+ rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf));
rxd = &rxq->rx_ring[i];
rxd->read.pkt_addr = dma_addr;
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index daaf02dab..012d9ee83 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -185,7 +185,7 @@ tx4(volatile union ixgbe_adv_tx_desc *txdp, struct rte_mbuf **pkts)
int i;
for (i = 0; i < 4; ++i, ++txdp, ++pkts) {
- buf_dma_addr = rte_mbuf_data_dma_addr(*pkts);
+ buf_dma_addr = rte_mbuf_data_iova(*pkts);
pkt_len = (*pkts)->data_len;
/* write data to descriptor */
@@ -208,7 +208,7 @@ tx1(volatile union ixgbe_adv_tx_desc *txdp, struct rte_mbuf **pkts)
uint64_t buf_dma_addr;
uint32_t pkt_len;
- buf_dma_addr = rte_mbuf_data_dma_addr(*pkts);
+ buf_dma_addr = rte_mbuf_data_iova(*pkts);
pkt_len = (*pkts)->data_len;
/* write data to descriptor */
@@ -924,7 +924,7 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
* Set up Transmit Data Descriptor.
*/
slen = m_seg->data_len;
- buf_dma_addr = rte_mbuf_data_dma_addr(m_seg);
+ buf_dma_addr = rte_mbuf_data_iova(m_seg);
txd->read.buffer_addr =
rte_cpu_to_le_64(buf_dma_addr);
txd->read.cmd_type_len =
@@ -1633,7 +1633,7 @@ ixgbe_rx_alloc_bufs(struct ixgbe_rx_queue *rxq, bool reset_mbuf)
mb->data_off = RTE_PKTMBUF_HEADROOM;
/* populate the descriptors */
- dma_addr = rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(mb));
+ dma_addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mb));
rxdp[i].read.hdr_addr = 0;
rxdp[i].read.pkt_addr = dma_addr;
}
@@ -1865,7 +1865,7 @@ ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
rxm = rxe->mbuf;
rxe->mbuf = nmb;
dma_addr =
- rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(nmb));
+ rte_cpu_to_le_64(rte_mbuf_data_iova_default(nmb));
rxdp->read.hdr_addr = 0;
rxdp->read.pkt_addr = dma_addr;
@@ -2159,7 +2159,7 @@ ixgbe_recv_pkts_lro(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts,
if (!bulk_alloc) {
__le64 dma =
- rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(nmb));
+ rte_cpu_to_le_64(rte_mbuf_data_iova_default(nmb));
/*
* Update RX descriptor with the physical address of the
* new data buffer of the new allocated mbuf.
@@ -4188,7 +4188,7 @@ ixgbe_alloc_rx_queue_mbufs(struct ixgbe_rx_queue *rxq)
mbuf->port = rxq->port_id;
dma_addr =
- rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(mbuf));
+ rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf));
rxd = &rxq->rx_ring[i];
rxd->read.hdr_addr = 0;
rxd->read.pkt_addr = dma_addr;
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 71099e146..efad4e7c9 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -1298,7 +1298,7 @@ lio_alloc_soft_command(struct lio_device *lio_dev, uint32_t datasize,
sc = rte_pktmbuf_mtod(m, struct lio_soft_command *);
memset(sc, 0, LIO_SOFT_COMMAND_BUFFER_SIZE);
sc->size = LIO_SOFT_COMMAND_BUFFER_SIZE;
- sc->dma_addr = rte_mbuf_data_dma_addr(m);
+ sc->dma_addr = rte_mbuf_data_iova(m);
sc->mbuf = m;
dma_addr = sc->dma_addr;
@@ -1739,7 +1739,7 @@ lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
cmdsetup.s.u.datasize = pkt_len;
lio_prepare_pci_cmd(lio_dev, &ndata.cmd,
&cmdsetup, tag);
- ndata.cmd.cmd3.dptr = rte_mbuf_data_dma_addr(m);
+ ndata.cmd.cmd3.dptr = rte_mbuf_data_iova(m);
ndata.reqtype = LIO_REQTYPE_NORESP_NET;
} else {
struct lio_buf_free_info *finfo;
@@ -1771,7 +1771,7 @@ lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
&cmdsetup, tag);
memset(g->sg, 0, g->sg_size);
- g->sg[0].ptr[0] = rte_mbuf_data_dma_addr(m);
+ g->sg[0].ptr[0] = rte_mbuf_data_iova(m);
lio_add_sg_size(&g->sg[0], m->data_len, 0);
pkt_len = m->data_len;
finfo->mbuf = m;
@@ -1782,7 +1782,7 @@ lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
m = m->next;
while (frags--) {
g->sg[(i >> 2)].ptr[(i & 3)] =
- rte_mbuf_data_dma_addr(m);
+ rte_mbuf_data_iova(m);
lio_add_sg_size(&g->sg[(i >> 2)],
m->data_len, (i & 3));
pkt_len += m->data_len;
diff --git a/drivers/net/liquidio/lio_rxtx.h b/drivers/net/liquidio/lio_rxtx.h
index 85685dc7d..47d84fb16 100644
--- a/drivers/net/liquidio/lio_rxtx.h
+++ b/drivers/net/liquidio/lio_rxtx.h
@@ -688,7 +688,7 @@ lio_map_ring(void *buf)
{
phys_addr_t dma_addr;
- dma_addr = rte_mbuf_data_dma_addr_default(((struct rte_mbuf *)buf));
+ dma_addr = rte_mbuf_data_iova_default(((struct rte_mbuf *)buf));
return (uint64_t)dma_addr;
}
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 03d9fec64..a897ba013 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -1153,7 +1153,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
}
entries[i].buff.addr =
- rte_mbuf_data_dma_addr_default(mbufs[i]);
+ rte_mbuf_data_iova_default(mbufs[i]);
entries[i].buff.cookie = (pp2_cookie_t)(uint64_t)mbufs[i];
entries[i].bpool = bpool;
}
@@ -1598,7 +1598,7 @@ mrvl_rx_pkt_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
status = pp2_ppio_inq_desc_get_l2_pkt_error(&descs[i]);
if (unlikely(status != PP2_DESC_ERR_OK)) {
struct pp2_buff_inf binf = {
- .addr = rte_mbuf_data_dma_addr_default(mbuf),
+ .addr = rte_mbuf_data_iova_default(mbuf),
.cookie = (pp2_cookie_t)(uint64_t)mbuf,
};
@@ -1854,7 +1854,7 @@ mrvl_tx_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
sq->ent[sq->head].buff.cookie = (pp2_cookie_t)(uint64_t)mbuf;
sq->ent[sq->head].buff.addr =
- rte_mbuf_data_dma_addr_default(mbuf);
+ rte_mbuf_data_iova_default(mbuf);
sq->ent[sq->head].bpool =
(unlikely(mbuf->port == 0xff || mbuf->refcnt > 1)) ?
NULL : mrvl_port_to_bpool_lookup[mbuf->port];
@@ -1863,7 +1863,7 @@ mrvl_tx_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
pp2_ppio_outq_desc_reset(&descs[i]);
pp2_ppio_outq_desc_set_phys_addr(&descs[i],
- rte_pktmbuf_mtophys(mbuf));
+ rte_pktmbuf_iova(mbuf));
pp2_ppio_outq_desc_set_pkt_offset(&descs[i], 0);
pp2_ppio_outq_desc_set_pkt_len(&descs[i],
rte_pktmbuf_pkt_len(mbuf));
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index e141627cc..e9001f440 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -2266,7 +2266,7 @@ nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
*lmbuf = pkt;
dma_size = pkt->data_len;
- dma_addr = rte_mbuf_data_dma_addr(pkt);
+ dma_addr = rte_mbuf_data_iova(pkt);
PMD_TX_LOG(DEBUG, "Working with mbuf at dma address:"
"%" PRIx64 "\n", dma_addr);
diff --git a/drivers/net/octeontx/octeontx_rxtx.c b/drivers/net/octeontx/octeontx_rxtx.c
index 2b5842362..c97d5b351 100644
--- a/drivers/net/octeontx/octeontx_rxtx.c
+++ b/drivers/net/octeontx/octeontx_rxtx.c
@@ -70,7 +70,7 @@ __octeontx_xmit_pkts(void *lmtline_va, void *ioreg_va, int64_t *fc_status_va,
cmd_buf[0] |= (1ULL << 58); /* SET DF */
/* Setup PKO_SEND_GATHER_S */
- cmd_buf[(1 << 1) | 1] = rte_mbuf_data_dma_addr(tx_pkt);
+ cmd_buf[(1 << 1) | 1] = rte_mbuf_data_iova(tx_pkt);
cmd_buf[(1 << 1) | 0] = PKO_SEND_GATHER_SUBDC |
PKO_SEND_GATHER_LDTYPE(0x1ull) |
PKO_SEND_GATHER_GAUAR((long)gaura_id) |
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 49de13b48..8e8536f89 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -28,7 +28,7 @@ static inline int qede_alloc_rx_buffer(struct qede_rx_queue *rxq)
}
rxq->sw_rx_ring[idx].mbuf = new_mb;
rxq->sw_rx_ring[idx].page_offset = 0;
- mapping = rte_mbuf_data_dma_addr_default(new_mb);
+ mapping = rte_mbuf_data_iova_default(new_mb);
/* Advance PROD and get BD pointer */
rx_bd = (struct eth_rx_bd *)ecore_chain_produce(&rxq->rx_bd_ring);
rx_bd->addr.hi = rte_cpu_to_le_32(U64_HI(mapping));
@@ -1064,7 +1064,7 @@ qede_reuse_page(__rte_unused struct qede_dev *qdev,
curr_prod = &rxq->sw_rx_ring[idx];
*curr_prod = *curr_cons;
- new_mapping = rte_mbuf_data_dma_addr_default(curr_prod->mbuf) +
+ new_mapping = rte_mbuf_data_iova_default(curr_prod->mbuf) +
curr_prod->page_offset;
rx_bd_prod->addr.hi = rte_cpu_to_le_32(U64_HI(new_mapping));
@@ -1565,7 +1565,7 @@ qede_encode_sg_bd(struct qede_tx_queue *p_txq, struct rte_mbuf *m_seg,
memset(*bd2, 0, sizeof(struct eth_tx_2nd_bd));
nb_segs++;
}
- mapping = rte_mbuf_data_dma_addr(m_seg);
+ mapping = rte_mbuf_data_iova(m_seg);
QEDE_BD_SET_ADDR_LEN(*bd2, mapping, m_seg->data_len);
PMD_TX_LOG(DEBUG, txq, "BD2 len %04x", m_seg->data_len);
} else if (nb_segs == 1) {
@@ -1575,7 +1575,7 @@ qede_encode_sg_bd(struct qede_tx_queue *p_txq, struct rte_mbuf *m_seg,
memset(*bd3, 0, sizeof(struct eth_tx_3rd_bd));
nb_segs++;
}
- mapping = rte_mbuf_data_dma_addr(m_seg);
+ mapping = rte_mbuf_data_iova(m_seg);
QEDE_BD_SET_ADDR_LEN(*bd3, mapping, m_seg->data_len);
PMD_TX_LOG(DEBUG, txq, "BD3 len %04x", m_seg->data_len);
} else {
@@ -1583,7 +1583,7 @@ qede_encode_sg_bd(struct qede_tx_queue *p_txq, struct rte_mbuf *m_seg,
ecore_chain_produce(&txq->tx_pbl);
memset(tx_bd, 0, sizeof(*tx_bd));
nb_segs++;
- mapping = rte_mbuf_data_dma_addr(m_seg);
+ mapping = rte_mbuf_data_iova(m_seg);
QEDE_BD_SET_ADDR_LEN(tx_bd, mapping, m_seg->data_len);
PMD_TX_LOG(DEBUG, txq, "BD len %04x", m_seg->data_len);
}
@@ -1966,7 +1966,7 @@ qede_xmit_pkts(void *p_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
nbds++;
/* Map MBUF linear data for DMA and set in the BD1 */
- QEDE_BD_SET_ADDR_LEN(bd1, rte_mbuf_data_dma_addr(mbuf),
+ QEDE_BD_SET_ADDR_LEN(bd1, rte_mbuf_data_iova(mbuf),
mbuf->data_len);
bd1->data.bitfields = rte_cpu_to_le_16(bd1_bf);
bd1->data.bd_flags.bitfields = bd1_bd_flags_bf;
@@ -1979,11 +1979,11 @@ qede_xmit_pkts(void *p_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
nbds++;
/* BD1 */
- QEDE_BD_SET_ADDR_LEN(bd1, rte_mbuf_data_dma_addr(mbuf),
+ QEDE_BD_SET_ADDR_LEN(bd1, rte_mbuf_data_iova(mbuf),
hdr_size);
/* BD2 */
QEDE_BD_SET_ADDR_LEN(bd2, (hdr_size +
- rte_mbuf_data_dma_addr(mbuf)),
+ rte_mbuf_data_iova(mbuf)),
mbuf->data_len - hdr_size);
bd2->data.bitfields1 = rte_cpu_to_le_16(bd2_bf1);
if (mplsoudp_flg) {
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index 500d652a9..23e45b453 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -189,7 +189,7 @@ sfc_ef10_rx_qrefill(struct sfc_ef10_rxq *rxq)
* structure members.
*/
- phys_addr = rte_mbuf_data_dma_addr_default(m);
+ phys_addr = rte_mbuf_data_iova_default(m);
EFX_POPULATE_QWORD_2(rxq->rxq_hw_ring[id],
ESF_DZ_RX_KER_BYTE_CNT, buf_size,
ESF_DZ_RX_KER_BUF_ADDR, phys_addr);
diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c
index 167c91d66..2e246f40c 100644
--- a/drivers/net/sfc/sfc_ef10_tx.c
+++ b/drivers/net/sfc/sfc_ef10_tx.c
@@ -341,7 +341,7 @@ sfc_ef10_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
pkt_len = m_seg->pkt_len;
do {
- phys_addr_t seg_addr = rte_mbuf_data_dma_addr(m_seg);
+ phys_addr_t seg_addr = rte_mbuf_data_iova(m_seg);
unsigned int seg_len = rte_pktmbuf_data_len(m_seg);
unsigned int id = added & ptr_mask;
@@ -464,7 +464,7 @@ sfc_ef10_simple_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
SFC_ASSERT(rte_pktmbuf_data_len(pkt) <=
SFC_EF10_TX_DMA_DESC_LEN_MAX);
- sfc_ef10_tx_qdesc_dma_create(rte_mbuf_data_dma_addr(pkt),
+ sfc_ef10_tx_qdesc_dma_create(rte_mbuf_data_iova(pkt),
rte_pktmbuf_data_len(pkt),
true, &txq->txq_hw_ring[id]);
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index 79ed046ce..2ae095b23 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -128,7 +128,7 @@ sfc_efx_rx_qrefill(struct sfc_efx_rxq *rxq)
SFC_ASSERT(m->nb_segs == 1);
m->port = port_id;
- addr[i] = rte_pktmbuf_mtophys(m);
+ addr[i] = rte_pktmbuf_iova(m);
}
efx_rx_qpost(rxq->common, addr, rxq->buf_size,
diff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c
index ad100676e..2e7b595b1 100644
--- a/drivers/net/sfc/sfc_tso.c
+++ b/drivers/net/sfc/sfc_tso.c
@@ -141,7 +141,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
if (unlikely(tcph_off > encp->enc_tx_tso_tcp_header_offset_limit))
return EMSGSIZE;
- header_paddr = rte_pktmbuf_mtophys(m);
+ header_paddr = rte_pktmbuf_iova(m);
/*
* Sometimes headers may be split across multiple mbufs. In such cases
diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c
index 4ea7bd764..127d59e60 100644
--- a/drivers/net/sfc/sfc_tx.c
+++ b/drivers/net/sfc/sfc_tx.c
@@ -765,7 +765,7 @@ sfc_efx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
size_t seg_len;
seg_len = m_seg->data_len;
- next_frag = rte_mbuf_data_dma_addr(m_seg);
+ next_frag = rte_mbuf_data_iova(m_seg);
/*
* If we've started TSO transaction few steps earlier,
diff --git a/drivers/net/thunderx/nicvf_rxtx.h b/drivers/net/thunderx/nicvf_rxtx.h
index cd1b754bb..a3ccce290 100644
--- a/drivers/net/thunderx/nicvf_rxtx.h
+++ b/drivers/net/thunderx/nicvf_rxtx.h
@@ -60,7 +60,7 @@ fill_sq_desc_gather(union sq_entry_t *entry, struct rte_mbuf *pkt)
sqe.gather.subdesc_type = SQ_DESC_TYPE_GATHER;
sqe.gather.ld_type = NIC_SEND_LD_TYPE_E_LDT;
sqe.gather.size = pkt->data_len;
- sqe.gather.addr = rte_mbuf_data_dma_addr(pkt);
+ sqe.gather.addr = rte_mbuf_data_iova(pkt);
entry->buff[0] = sqe.buff[0];
entry->buff[1] = sqe.buff[1];
@@ -80,7 +80,7 @@ fill_sq_desc_gather(union sq_entry_t *entry, struct rte_mbuf *pkt)
entry->buff[0] = (uint64_t)SQ_DESC_TYPE_GATHER << 60 |
(uint64_t)NIC_SEND_LD_TYPE_E_LDT << 58 |
pkt->data_len;
- entry->buff[1] = rte_mbuf_data_dma_addr(pkt);
+ entry->buff[1] = rte_mbuf_data_iova(pkt);
}
#endif
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index aac23d845..437dcb1cc 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -509,7 +509,7 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
rte_cpu_to_le_64(txq->data_ring.basePA +
offset);
} else {
- gdesc->txd.addr = rte_mbuf_data_dma_addr(m_seg);
+ gdesc->txd.addr = rte_mbuf_data_iova(m_seg);
}
gdesc->dword[2] = dw2 | m_seg->data_len;
@@ -617,7 +617,7 @@ vmxnet3_renew_desc(vmxnet3_rx_queue_t *rxq, uint8_t ring_id,
*/
buf_info->m = mbuf;
buf_info->len = (uint16_t)(mbuf->buf_len - RTE_PKTMBUF_HEADROOM);
- buf_info->bufPA = rte_mbuf_data_dma_addr_default(mbuf);
+ buf_info->bufPA = rte_mbuf_data_iova_default(mbuf);
/* Load Rx Descriptor with the buffer's GPA */
rxd->addr = buf_info->bufPA;
diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c
index f7afe13c6..c3efe52b1 100644
--- a/examples/ipsec-secgw/esp.c
+++ b/examples/ipsec-secgw/esp.c
@@ -106,12 +106,12 @@ esp_inbound(struct rte_mbuf *m, struct ipsec_sa *sa,
aad = get_aad(m);
memcpy(aad, iv - sizeof(struct esp_hdr), 8);
sym_cop->aead.aad.data = aad;
- sym_cop->aead.aad.phys_addr = rte_pktmbuf_mtophys_offset(m,
+ sym_cop->aead.aad.phys_addr = rte_pktmbuf_iova_offset(m,
aad - rte_pktmbuf_mtod(m, uint8_t *));
sym_cop->aead.digest.data = rte_pktmbuf_mtod_offset(m, void*,
rte_pktmbuf_pkt_len(m) - sa->digest_len);
- sym_cop->aead.digest.phys_addr = rte_pktmbuf_mtophys_offset(m,
+ sym_cop->aead.digest.phys_addr = rte_pktmbuf_iova_offset(m,
rte_pktmbuf_pkt_len(m) - sa->digest_len);
} else {
sym_cop->cipher.data.offset = ip_hdr_len + sizeof(struct esp_hdr) +
@@ -157,7 +157,7 @@ esp_inbound(struct rte_mbuf *m, struct ipsec_sa *sa,
sym_cop->auth.digest.data = rte_pktmbuf_mtod_offset(m, void*,
rte_pktmbuf_pkt_len(m) - sa->digest_len);
- sym_cop->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(m,
+ sym_cop->auth.digest.phys_addr = rte_pktmbuf_iova_offset(m,
rte_pktmbuf_pkt_len(m) - sa->digest_len);
}
@@ -405,12 +405,12 @@ esp_outbound(struct rte_mbuf *m, struct ipsec_sa *sa,
aad = get_aad(m);
memcpy(aad, esp, 8);
sym_cop->aead.aad.data = aad;
- sym_cop->aead.aad.phys_addr = rte_pktmbuf_mtophys_offset(m,
+ sym_cop->aead.aad.phys_addr = rte_pktmbuf_iova_offset(m,
aad - rte_pktmbuf_mtod(m, uint8_t *));
sym_cop->aead.digest.data = rte_pktmbuf_mtod_offset(m, uint8_t *,
rte_pktmbuf_pkt_len(m) - sa->digest_len);
- sym_cop->aead.digest.phys_addr = rte_pktmbuf_mtophys_offset(m,
+ sym_cop->aead.digest.phys_addr = rte_pktmbuf_iova_offset(m,
rte_pktmbuf_pkt_len(m) - sa->digest_len);
} else {
switch (sa->cipher_algo) {
@@ -458,7 +458,7 @@ esp_outbound(struct rte_mbuf *m, struct ipsec_sa *sa,
sym_cop->auth.digest.data = rte_pktmbuf_mtod_offset(m, uint8_t *,
rte_pktmbuf_pkt_len(m) - sa->digest_len);
- sym_cop->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(m,
+ sym_cop->auth.digest.phys_addr = rte_pktmbuf_iova_offset(m,
rte_pktmbuf_pkt_len(m) - sa->digest_len);
}
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 06f90ab4a..b97367944 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -497,7 +497,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
uint8_t *) + ipdata_offset + data_len;
}
- op->sym->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(m,
+ op->sym->auth.digest.phys_addr = rte_pktmbuf_iova_offset(m,
rte_pktmbuf_pkt_len(m) - cparams->digest_length);
/* For wireless algorithms, offset/length must be in bits */
@@ -558,7 +558,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
uint8_t *) + ipdata_offset + data_len;
}
- op->sym->aead.digest.phys_addr = rte_pktmbuf_mtophys_offset(m,
+ op->sym->aead.digest.phys_addr = rte_pktmbuf_iova_offset(m,
rte_pktmbuf_pkt_len(m) - cparams->digest_length);
if (cparams->aad.length) {
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 7a4634fdd..6d91f7d38 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -625,21 +625,28 @@ rte_mbuf_prefetch_part2(struct rte_mbuf *m)
static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp);
/**
- * Return the DMA address of the beginning of the mbuf data
+ * Return the IO address of the beginning of the mbuf data
*
* @param mb
* The pointer to the mbuf.
* @return
- * The physical address of the beginning of the mbuf data
+ * The IO address of the beginning of the mbuf data
*/
+static inline rte_iova_t
+rte_mbuf_data_iova(const struct rte_mbuf *mb)
+{
+ return mb->buf_iova + mb->data_off;
+}
+
+__rte_deprecated
static inline phys_addr_t
rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
{
- return mb->buf_iova + mb->data_off;
+ return rte_mbuf_data_iova(mb);
}
/**
- * Return the default DMA address of the beginning of the mbuf data
+ * Return the default IO address of the beginning of the mbuf data
*
* This function is used by drivers in their receive function, as it
* returns the location where data should be written by the NIC, taking
@@ -648,12 +655,19 @@ rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
* @param mb
* The pointer to the mbuf.
* @return
- * The physical address of the beginning of the mbuf data
+ * The IO address of the beginning of the mbuf data
*/
+static inline rte_iova_t
+rte_mbuf_data_iova_default(const struct rte_mbuf *mb)
+{
+ return mb->buf_iova + RTE_PKTMBUF_HEADROOM;
+}
+
+__rte_deprecated
static inline phys_addr_t
rte_mbuf_data_dma_addr_default(const struct rte_mbuf *mb)
{
- return mb->buf_iova + RTE_PKTMBUF_HEADROOM;
+ return rte_mbuf_data_iova_default(mb);
}
/**
@@ -1564,7 +1578,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)
#define rte_pktmbuf_mtod(m, t) rte_pktmbuf_mtod_offset(m, t, 0)
/**
- * A macro that returns the physical address that points to an offset of the
+ * A macro that returns the IO address that points to an offset of the
* start of the data in the mbuf
*
* @param m
@@ -1572,17 +1586,24 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)
* @param o
* The offset into the data to calculate address from.
*/
-#define rte_pktmbuf_mtophys_offset(m, o) \
+#define rte_pktmbuf_iova_offset(m, o) \
(rte_iova_t)((m)->buf_iova + (m)->data_off + (o))
+/* deprecated */
+#define rte_pktmbuf_mtophys_offset(m, o) \
+ rte_pktmbuf_iova_offset(m, o)
+
/**
- * A macro that returns the physical address that points to the start of the
+ * A macro that returns the IO address that points to the start of the
* data in the mbuf
*
* @param m
* The packet mbuf.
*/
-#define rte_pktmbuf_mtophys(m) rte_pktmbuf_mtophys_offset(m, 0)
+#define rte_pktmbuf_iova(m) rte_pktmbuf_iova_offset(m, 0)
+
+/* deprecated */
+#define rte_pktmbuf_mtophys(m) rte_pktmbuf_iova(m)
/**
* A macro that returns the length of the packet.
diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index 72988c561..060b49826 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -1332,7 +1332,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
/* Set crypto operation authentication parameters */
sym_op->auth.digest.data = ut_params->digest;
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+ sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf, QUOTE_512_BYTES);
sym_op->auth.data.offset = 0;
@@ -1484,7 +1484,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
sym_op->m_src = ut_params->ibuf;
sym_op->auth.digest.data = ut_params->digest;
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+ sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf, QUOTE_512_BYTES);
sym_op->auth.data.offset = 0;
@@ -2385,7 +2385,7 @@ create_wireless_algo_hash_operation(const uint8_t *auth_tag,
TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
"no room to append auth tag");
ut_params->digest = sym_op->auth.digest.data;
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+ sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf, data_pad_len);
if (op == RTE_CRYPTO_AUTH_OP_GENERATE)
memset(sym_op->auth.digest.data, 0, auth_tag_len);
@@ -2441,7 +2441,7 @@ create_wireless_cipher_hash_operation(const struct wireless_test_data *tdata,
TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
"no room to append auth tag");
ut_params->digest = sym_op->auth.digest.data;
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+ sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf, data_pad_len);
if (op == RTE_CRYPTO_AUTH_OP_GENERATE)
memset(sym_op->auth.digest.data, 0, auth_tag_len);
@@ -2508,7 +2508,7 @@ create_wireless_algo_cipher_hash_operation(const uint8_t *auth_tag,
TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
"no room to append auth tag");
ut_params->digest = sym_op->auth.digest.data;
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+ sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf, data_pad_len);
if (op == RTE_CRYPTO_AUTH_OP_GENERATE)
memset(sym_op->auth.digest.data, 0, auth_tag_len);
@@ -2566,7 +2566,7 @@ create_wireless_algo_auth_cipher_operation(unsigned int auth_tag_len,
TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
"no room to append auth tag");
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+ sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf, data_pad_len);
memset(sym_op->auth.digest.data, 0, auth_tag_len);
@@ -5153,7 +5153,7 @@ create_aead_operation(enum rte_crypto_aead_operation op,
"no room to append aad");
sym_op->aead.aad.phys_addr =
- rte_pktmbuf_mtophys(ut_params->ibuf);
+ rte_pktmbuf_iova(ut_params->ibuf);
/* Copy AAD 18 bytes after the AAD pointer, according to the API */
memcpy(sym_op->aead.aad.data + 18, tdata->aad.data, tdata->aad.len);
TEST_HEXDUMP(stdout, "aad:", sym_op->aead.aad.data,
@@ -5175,7 +5175,7 @@ create_aead_operation(enum rte_crypto_aead_operation op,
"no room to append aad");
sym_op->aead.aad.phys_addr =
- rte_pktmbuf_mtophys(ut_params->ibuf);
+ rte_pktmbuf_iova(ut_params->ibuf);
memcpy(sym_op->aead.aad.data, tdata->aad.data, tdata->aad.len);
TEST_HEXDUMP(stdout, "aad:", sym_op->aead.aad.data,
tdata->aad.len);
@@ -5243,7 +5243,7 @@ create_aead_operation(enum rte_crypto_aead_operation op,
TEST_ASSERT_NOT_NULL(sym_op->aead.digest.data,
"no room to append digest");
memset(sym_op->aead.digest.data, 0, tdata->auth_tag.len);
- sym_op->aead.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+ sym_op->aead.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->obuf ? ut_params->obuf :
ut_params->ibuf,
plaintext_pad_len +
@@ -5253,7 +5253,7 @@ create_aead_operation(enum rte_crypto_aead_operation op,
ut_params->ibuf, tdata->auth_tag.len);
TEST_ASSERT_NOT_NULL(sym_op->aead.digest.data,
"no room to append digest");
- sym_op->aead.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+ sym_op->aead.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf,
plaintext_pad_len + aad_pad_len);
@@ -6226,7 +6226,7 @@ static int MD5_HMAC_create_op(struct crypto_unittest_params *ut_params,
ut_params->ibuf, MD5_DIGEST_LEN);
TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
"no room to append digest");
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+ sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf, plaintext_pad_len);
if (ut_params->auth_xform.auth.op == RTE_CRYPTO_AUTH_OP_VERIFY) {
@@ -6962,7 +6962,7 @@ create_gmac_operation(enum rte_crypto_auth_operation op,
TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
"no room to append digest");
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+ sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf, plaintext_pad_len);
if (op == RTE_CRYPTO_AUTH_OP_VERIFY) {
@@ -7484,7 +7484,7 @@ create_auth_operation(struct crypto_testsuite_params *ts_params,
TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
"no room to append auth tag");
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+ sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf, reference->plaintext.len);
if (auth_generate)
@@ -7531,7 +7531,7 @@ create_auth_GMAC_operation(struct crypto_testsuite_params *ts_params,
TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
"no room to append auth tag");
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+ sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf, reference->ciphertext.len);
if (auth_generate)
@@ -7584,7 +7584,7 @@ create_cipher_auth_operation(struct crypto_testsuite_params *ts_params,
TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
"no room to append auth tag");
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+ sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf, reference->ciphertext.len);
if (auth_generate)
@@ -7863,7 +7863,7 @@ create_aead_operation_SGL(enum rte_crypto_aead_operation op,
ut_params->ibuf, aad_len);
TEST_ASSERT_NOT_NULL(sym_op->aead.aad.data,
"no room to prepend aad");
- sym_op->aead.aad.phys_addr = rte_pktmbuf_mtophys(
+ sym_op->aead.aad.phys_addr = rte_pktmbuf_iova(
ut_params->ibuf);
memset(sym_op->aead.aad.data, 0, aad_len);
@@ -7883,7 +7883,7 @@ create_aead_operation_SGL(enum rte_crypto_aead_operation op,
ut_params->ibuf, aad_len);
TEST_ASSERT_NOT_NULL(sym_op->aead.aad.data,
"no room to prepend aad");
- sym_op->aead.aad.phys_addr = rte_pktmbuf_mtophys(
+ sym_op->aead.aad.phys_addr = rte_pktmbuf_iova(
ut_params->ibuf);
memset(sym_op->aead.aad.data, 0, aad_len);
@@ -8030,7 +8030,7 @@ test_authenticated_encryption_SGL(const struct aead_test_data *tdata,
digest_mem = rte_pktmbuf_append(ut_params->obuf,
tdata->auth_tag.len);
- digest_phys = rte_pktmbuf_mtophys_offset(
+ digest_phys = rte_pktmbuf_iova_offset(
ut_params->obuf,
tdata->plaintext.len + prepend_len);
}
@@ -8068,14 +8068,14 @@ test_authenticated_encryption_SGL(const struct aead_test_data *tdata,
* Place digest at the end of the last buffer
*/
if (!digest_phys)
- digest_phys = rte_pktmbuf_mtophys(buf) + to_trn;
+ digest_phys = rte_pktmbuf_iova(buf) + to_trn;
if (oop && buf_last_oop)
- digest_phys = rte_pktmbuf_mtophys(buf_last_oop) + to_trn;
+ digest_phys = rte_pktmbuf_iova(buf_last_oop) + to_trn;
if (!digest_mem && !oop) {
digest_mem = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
+ tdata->auth_tag.len);
- digest_phys = rte_pktmbuf_mtophys_offset(ut_params->ibuf,
+ digest_phys = rte_pktmbuf_iova_offset(ut_params->ibuf,
tdata->plaintext.len);
}
diff --git a/test/test/test_cryptodev.h b/test/test/test_cryptodev.h
index 2e9eb0b1c..e040b814f 100644
--- a/test/test/test_cryptodev.h
+++ b/test/test/test_cryptodev.h
@@ -164,7 +164,7 @@ pktmbuf_mtophys_offset(struct rte_mbuf *mbuf, int offset) {
printf("pktmbuf_mtophys_offset: offset out of buffer\n");
return 0;
}
- return rte_pktmbuf_mtophys_offset(m, offset);
+ return rte_pktmbuf_iova_offset(m, offset);
}
static inline struct rte_mbuf *
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 13/15] cryptodev: rename physical address type to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
` (11 preceding siblings ...)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 12/15] mbuf: rename data address helpers " Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 14/15] drivers/net: " Thomas Monjalon
` (2 subsequent siblings)
15 siblings, 0 replies; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
From: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Renamed data type from phys_addr_t to rte_iova_t.
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-crypto-perf/cperf_test_common.c | 2 +-
app/test-crypto-perf/cperf_test_vectors.h | 4 ++--
doc/guides/prog_guide/cryptodev_lib.rst | 6 +++---
drivers/crypto/dpaa_sec/dpaa_sec.c | 18 +++++++++---------
drivers/crypto/qat/qat_adf/qat_algs.h | 6 +++---
drivers/crypto/qat/qat_crypto.c | 2 +-
drivers/crypto/qat/qat_crypto.h | 2 +-
examples/l2fwd-crypto/main.c | 2 +-
lib/librte_cryptodev/rte_crypto.h | 2 +-
lib/librte_cryptodev/rte_crypto_sym.h | 6 +++---
lib/librte_cryptodev/rte_cryptodev.h | 2 +-
test/test/test_cryptodev.h | 2 +-
12 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 84c5a3d76..a95899a3f 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -74,7 +74,7 @@ fill_multi_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp,
uint16_t mbuf_hdr_size = sizeof(struct rte_mbuf);
uint16_t remaining_segments = segments_nb;
struct rte_mbuf *next_mbuf;
- phys_addr_t next_seg_phys_addr = rte_mempool_virt2iova(obj) +
+ rte_iova_t next_seg_phys_addr = rte_mempool_virt2iova(obj) +
mbuf_offset + mbuf_hdr_size;
do {
diff --git a/app/test-crypto-perf/cperf_test_vectors.h b/app/test-crypto-perf/cperf_test_vectors.h
index 85955703c..cb5d82845 100644
--- a/app/test-crypto-perf/cperf_test_vectors.h
+++ b/app/test-crypto-perf/cperf_test_vectors.h
@@ -78,13 +78,13 @@ struct cperf_test_vector {
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
uint16_t length;
} aad;
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
uint16_t length;
} digest;
diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 75ae085f6..2b338b926 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -539,12 +539,12 @@ chain.
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
} digest; /**< Digest parameters */
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
} aad;
/**< Additional authentication parameters */
} aead;
@@ -566,7 +566,7 @@ chain.
struct {
uint8_t *data;
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
} digest; /**< Digest parameters */
} auth;
};
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 1d9d03aaa..d1ef241aa 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -110,7 +110,7 @@ dpaa_sec_alloc_ctx(dpaa_sec_session *ses)
return ctx;
}
-static inline phys_addr_t
+static inline rte_iova_t
dpaa_mem_vtop(void *vaddr)
{
const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
@@ -124,14 +124,14 @@ dpaa_mem_vtop(void *vaddr)
paddr = memseg[i].phys_addr +
(vaddr_64 - memseg[i].addr_64);
- return (phys_addr_t)paddr;
+ return (rte_iova_t)paddr;
}
}
- return (phys_addr_t)(NULL);
+ return (rte_iova_t)(NULL);
}
static inline void *
-dpaa_mem_ptov(phys_addr_t paddr)
+dpaa_mem_ptov(rte_iova_t paddr)
{
const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
int i;
@@ -158,7 +158,7 @@ ern_sec_fq_handler(struct qman_portal *qm __rte_unused,
* all the packets in this queue could be dispatched into caam
*/
static int
-dpaa_sec_init_rx(struct qman_fq *fq_in, phys_addr_t hwdesc,
+dpaa_sec_init_rx(struct qman_fq *fq_in, rte_iova_t hwdesc,
uint32_t fqid_out)
{
struct qm_mcc_initfq fq_opts;
@@ -566,7 +566,7 @@ build_auth_only(struct rte_crypto_op *op, dpaa_sec_session *ses)
struct dpaa_sec_job *cf;
struct dpaa_sec_op_ctx *ctx;
struct qm_sg_entry *sg;
- phys_addr_t start_addr;
+ rte_iova_t start_addr;
uint8_t *old_digest;
ctx = dpaa_sec_alloc_ctx(ses);
@@ -626,7 +626,7 @@ build_cipher_only(struct rte_crypto_op *op, dpaa_sec_session *ses)
struct dpaa_sec_job *cf;
struct dpaa_sec_op_ctx *ctx;
struct qm_sg_entry *sg;
- phys_addr_t src_start_addr, dst_start_addr;
+ rte_iova_t src_start_addr, dst_start_addr;
uint8_t *IV_ptr = rte_crypto_op_ctod_offset(op, uint8_t *,
ses->iv.offset);
@@ -682,7 +682,7 @@ build_cipher_auth_gcm(struct rte_crypto_op *op, dpaa_sec_session *ses)
struct dpaa_sec_op_ctx *ctx;
struct qm_sg_entry *sg;
uint32_t length = 0;
- phys_addr_t src_start_addr, dst_start_addr;
+ rte_iova_t src_start_addr, dst_start_addr;
uint8_t *IV_ptr = rte_crypto_op_ctod_offset(op, uint8_t *,
ses->iv.offset);
@@ -793,7 +793,7 @@ build_cipher_auth(struct rte_crypto_op *op, dpaa_sec_session *ses)
struct dpaa_sec_job *cf;
struct dpaa_sec_op_ctx *ctx;
struct qm_sg_entry *sg;
- phys_addr_t src_start_addr, dst_start_addr;
+ rte_iova_t src_start_addr, dst_start_addr;
uint32_t length = 0;
uint8_t *IV_ptr = rte_crypto_op_ctod_offset(op, uint8_t *,
ses->iv.offset);
diff --git a/drivers/crypto/qat/qat_adf/qat_algs.h b/drivers/crypto/qat/qat_adf/qat_algs.h
index 2c8e03c0a..802ba95d1 100644
--- a/drivers/crypto/qat/qat_adf/qat_algs.h
+++ b/drivers/crypto/qat/qat_adf/qat_algs.h
@@ -104,8 +104,8 @@ struct qat_alg_buf_list {
struct qat_crypto_op_cookie {
struct qat_alg_buf_list qat_sgl_list_src;
struct qat_alg_buf_list qat_sgl_list_dst;
- phys_addr_t qat_sgl_src_phys_addr;
- phys_addr_t qat_sgl_dst_phys_addr;
+ rte_iova_t qat_sgl_src_phys_addr;
+ rte_iova_t qat_sgl_dst_phys_addr;
};
/* Common content descriptor */
@@ -124,7 +124,7 @@ struct qat_session {
void *bpi_ctx;
struct qat_alg_cd cd;
uint8_t *cd_cur_ptr;
- phys_addr_t cd_paddr;
+ rte_iova_t cd_paddr;
struct icp_qat_fw_la_bulk_req fw_req;
uint8_t aad_len;
struct qat_crypto_instance *inst;
diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index 60148416b..a572967c4 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -1376,7 +1376,7 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
* This address may used for setting AAD physical pointer
* into IV offset from op
*/
- phys_addr_t aad_phys_addr_aead = op->sym->aead.aad.phys_addr;
+ rte_iova_t aad_phys_addr_aead = op->sym->aead.aad.phys_addr;
if (ctx->qat_hash_alg ==
ICP_QAT_HW_AUTH_ALGO_GALOIS_128 ||
ctx->qat_hash_alg ==
diff --git a/drivers/crypto/qat/qat_crypto.h b/drivers/crypto/qat/qat_crypto.h
index 0ebb08349..c64d7756c 100644
--- a/drivers/crypto/qat/qat_crypto.h
+++ b/drivers/crypto/qat/qat_crypto.h
@@ -70,7 +70,7 @@ enum qat_device_gen {
struct qat_queue {
char memz_name[RTE_MEMZONE_NAMESIZE];
void *base_addr; /* Base address */
- phys_addr_t base_phys_addr; /* Queue physical address */
+ rte_iova_t base_phys_addr; /* Queue physical address */
uint32_t head; /* Shadow copy of the head */
uint32_t tail; /* Shadow copy of the tail */
uint32_t modulo;
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index b97367944..8c625edd1 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -140,7 +140,7 @@ enum l2fwd_crypto_xform_chain {
struct l2fwd_key {
uint8_t *data;
uint32_t length;
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
};
struct l2fwd_iv {
diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte_crypto.h
index eeed9ee25..3d672fe7d 100644
--- a/lib/librte_cryptodev/rte_crypto.h
+++ b/lib/librte_cryptodev/rte_crypto.h
@@ -118,7 +118,7 @@ struct rte_crypto_op {
struct rte_mempool *mempool;
/**< crypto operation mempool which operation is allocated from */
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
/**< physical address of crypto operation */
RTE_STD_C11
diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h
index 599206370..c981f0b98 100644
--- a/lib/librte_cryptodev/rte_crypto_sym.h
+++ b/lib/librte_cryptodev/rte_crypto_sym.h
@@ -548,7 +548,7 @@ struct rte_crypto_sym_op {
* For GCM (@ref RTE_CRYPTO_AEAD_AES_GCM), for
* "digest result" read "authentication tag T".
*/
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
/**< Physical address of digest */
} digest; /**< Digest parameters */
struct {
@@ -583,7 +583,7 @@ struct rte_crypto_sym_op {
* of the block size (16 bytes).
*
*/
- phys_addr_t phys_addr; /**< physical address */
+ rte_iova_t phys_addr; /**< physical address */
} aad;
/**< Additional authentication parameters */
} aead;
@@ -680,7 +680,7 @@ struct rte_crypto_sym_op {
* will overwrite any data at this location.
*
*/
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
/**< Physical address of digest */
} digest; /**< Digest parameters */
} auth;
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index a0d3a12ab..a25bff9ba 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -110,7 +110,7 @@ extern const char **rte_cyptodev_names;
* to calculate address from.
*/
#define rte_crypto_op_ctophys_offset(c, o) \
- (phys_addr_t)((c)->phys_addr + (o))
+ (rte_iova_t)((c)->phys_addr + (o))
/**
* Crypto parameters range description
diff --git a/test/test/test_cryptodev.h b/test/test/test_cryptodev.h
index e040b814f..bbdb91394 100644
--- a/test/test/test_cryptodev.h
+++ b/test/test/test_cryptodev.h
@@ -153,7 +153,7 @@ pktmbuf_mtod_offset(struct rte_mbuf *mbuf, int offset) {
return rte_pktmbuf_mtod_offset(m, uint8_t *, offset);
}
-static inline phys_addr_t
+static inline rte_iova_t
pktmbuf_mtophys_offset(struct rte_mbuf *mbuf, int offset) {
struct rte_mbuf *m;
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 14/15] drivers/net: rename physical address type to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
` (12 preceding siblings ...)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 13/15] cryptodev: rename physical address type " Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 15/15] doc: add IOVA aware API changes in release notes Thomas Monjalon
2017-11-06 22:48 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
15 siblings, 0 replies; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
From: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Renamed data type from phys_addr_t to rte_iova_t.
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/net/ark/ark_ddm.c | 2 +-
drivers/net/ark/ark_ddm.h | 4 +--
drivers/net/ark/ark_ethdev_rx.c | 12 ++++-----
drivers/net/ark/ark_ethdev_tx.c | 2 +-
drivers/net/ark/ark_mpu.c | 2 +-
drivers/net/ark/ark_mpu.h | 4 +--
drivers/net/ark/ark_udm.c | 2 +-
drivers/net/ark/ark_udm.h | 4 +--
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/avp/rte_avp_common.h | 20 +++++++--------
drivers/net/bnx2x/bnx2x.c | 40 +++++++++++++++---------------
drivers/net/bnx2x/bnx2x.h | 22 ++++++++--------
drivers/net/bnx2x/bnx2x_rxtx.c | 4 +--
drivers/net/bnx2x/bnx2x_stats.c | 2 +-
drivers/net/bnx2x/bnx2x_vfpf.c | 2 +-
drivers/net/bnx2x/ecore_sp.h | 2 +-
drivers/net/bnxt/bnxt.h | 10 ++++----
drivers/net/bnxt/bnxt_cpr.h | 4 +--
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/bnxt_hwrm.c | 6 ++---
drivers/net/bnxt/bnxt_ring.c | 2 +-
drivers/net/bnxt/bnxt_ring.h | 2 +-
drivers/net/bnxt/bnxt_rxr.h | 4 +--
drivers/net/bnxt/bnxt_txr.h | 2 +-
drivers/net/bnxt/bnxt_vnic.c | 2 +-
drivers/net/bnxt/bnxt_vnic.h | 6 ++---
drivers/net/liquidio/lio_rxtx.c | 4 +--
drivers/net/liquidio/lio_rxtx.h | 4 +--
drivers/net/octeontx/base/octeontx_pkovf.c | 2 +-
drivers/net/qede/base/bcm_osal.h | 2 +-
drivers/net/sfc/efsys.h | 2 +-
drivers/net/sfc/sfc.c | 2 +-
drivers/net/sfc/sfc_ef10_rx.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 4 +--
drivers/net/thunderx/base/nicvf_hw.c | 2 +-
drivers/net/thunderx/base/nicvf_hw.h | 2 +-
drivers/net/thunderx/base/nicvf_hw_defs.h | 6 ++---
drivers/net/thunderx/nicvf_ethdev.c | 4 +--
drivers/net/thunderx/nicvf_ethdev.h | 4 +--
drivers/net/thunderx/nicvf_struct.h | 6 ++---
drivers/net/virtio/virtio_rxtx.h | 4 +--
drivers/net/virtio/virtqueue.h | 4 +--
lib/librte_vhost/vhost.h | 2 +-
43 files changed, 111 insertions(+), 111 deletions(-)
diff --git a/drivers/net/ark/ark_ddm.c b/drivers/net/ark/ark_ddm.c
index 221460c78..929dc7d1f 100644
--- a/drivers/net/ark/ark_ddm.c
+++ b/drivers/net/ark/ark_ddm.c
@@ -93,7 +93,7 @@ ark_ddm_reset(struct ark_ddm_t *ddm)
}
void
-ark_ddm_setup(struct ark_ddm_t *ddm, phys_addr_t cons_addr, uint32_t interval)
+ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr, uint32_t interval)
{
ddm->setup.cons_write_index_addr = cons_addr;
ddm->setup.write_index_interval = interval / 4; /* 4 ns period */
diff --git a/drivers/net/ark/ark_ddm.h b/drivers/net/ark/ark_ddm.h
index de61926c3..f67ad012c 100644
--- a/drivers/net/ark/ark_ddm.h
+++ b/drivers/net/ark/ark_ddm.h
@@ -127,7 +127,7 @@ struct ark_ddm_cpld_ps_t {
#define ARK_DDM_SETUP 0x00e0
struct ark_ddm_setup_t {
- phys_addr_t cons_write_index_addr;
+ rte_iova_t cons_write_index_addr;
uint32_t write_index_interval; /* 4ns each */
volatile uint32_t cons_index;
};
@@ -165,7 +165,7 @@ void ark_ddm_start(struct ark_ddm_t *ddm);
int ark_ddm_stop(struct ark_ddm_t *ddm, const int wait);
void ark_ddm_reset(struct ark_ddm_t *ddm);
void ark_ddm_stats_reset(struct ark_ddm_t *ddm);
-void ark_ddm_setup(struct ark_ddm_t *ddm, phys_addr_t cons_addr,
+void ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr,
uint32_t interval);
void ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg);
void ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg);
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 2ffaeac3e..a3c0377c6 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -61,7 +61,7 @@ struct ark_rx_queue {
struct rte_mbuf **reserve_q;
/* array of physical addresses of the mbuf data pointer */
/* This point is a virtual address */
- phys_addr_t *paddress_q;
+ rte_iova_t *paddress_q;
struct rte_mempool *mb_pool;
struct ark_udm_t *udm;
@@ -95,9 +95,9 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
struct ark_rx_queue *queue,
uint16_t rx_queue_id __rte_unused, uint16_t rx_queue_idx)
{
- phys_addr_t queue_base;
- phys_addr_t phys_addr_q_base;
- phys_addr_t phys_addr_prod_index;
+ rte_iova_t queue_base;
+ rte_iova_t phys_addr_q_base;
+ rte_iova_t phys_addr_prod_index;
queue_base = rte_malloc_virt2iova(queue);
phys_addr_prod_index = queue_base +
@@ -106,7 +106,7 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
phys_addr_q_base = rte_malloc_virt2iova(queue->paddress_q);
/* Verify HW */
- if (ark_mpu_verify(queue->mpu, sizeof(phys_addr_t))) {
+ if (ark_mpu_verify(queue->mpu, sizeof(rte_iova_t))) {
PMD_DRV_LOG(ERR, "Illegal configuration rx queue\n");
return -1;
}
@@ -204,7 +204,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
socket_id);
queue->paddress_q =
rte_zmalloc_socket("Ark_rx_queue paddr",
- nb_desc * sizeof(phys_addr_t),
+ nb_desc * sizeof(rte_iova_t),
64,
socket_id);
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 0d3c7dc41..4ef55d10a 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -310,7 +310,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
static int
eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
{
- phys_addr_t queue_base, ring_base, cons_index_addr;
+ rte_iova_t queue_base, ring_base, cons_index_addr;
uint32_t write_interval_ns;
/* Verify HW -- MPU */
diff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c
index cd2c0788f..d4ba6dc70 100644
--- a/drivers/net/ark/ark_mpu.c
+++ b/drivers/net/ark/ark_mpu.c
@@ -118,7 +118,7 @@ ark_mpu_reset_stats(struct ark_mpu_t *mpu)
}
int
-ark_mpu_configure(struct ark_mpu_t *mpu, phys_addr_t ring, uint32_t ring_size,
+ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size,
int is_tx)
{
ark_mpu_reset(mpu);
diff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h
index a0171dbd6..f6f6c808c 100644
--- a/drivers/net/ark/ark_mpu.h
+++ b/drivers/net/ark/ark_mpu.h
@@ -75,7 +75,7 @@ struct ark_mpu_hw_t {
#define ARK_MPU_CFG 0x040
struct ark_mpu_cfg_t {
- phys_addr_t ring_base; /* phys_addr_t is a uint64_t */
+ rte_iova_t ring_base; /* rte_iova_t is a uint64_t */
uint32_t ring_size;
uint32_t ring_mask;
uint32_t min_host_move;
@@ -137,7 +137,7 @@ int ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size);
void ark_mpu_stop(struct ark_mpu_t *mpu);
void ark_mpu_start(struct ark_mpu_t *mpu);
int ark_mpu_reset(struct ark_mpu_t *mpu);
-int ark_mpu_configure(struct ark_mpu_t *mpu, phys_addr_t ring,
+int ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring,
uint32_t ring_size, int is_tx);
void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx);
diff --git a/drivers/net/ark/ark_udm.c b/drivers/net/ark/ark_udm.c
index 1ba7d26d4..7a429ac7e 100644
--- a/drivers/net/ark/ark_udm.c
+++ b/drivers/net/ark/ark_udm.c
@@ -122,7 +122,7 @@ ark_udm_configure(struct ark_udm_t *udm,
}
void
-ark_udm_write_addr(struct ark_udm_t *udm, phys_addr_t addr)
+ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr)
{
udm->rt_cfg.hw_prod_addr = addr;
}
diff --git a/drivers/net/ark/ark_udm.h b/drivers/net/ark/ark_udm.h
index 29bf1e8f7..915343fe2 100644
--- a/drivers/net/ark/ark_udm.h
+++ b/drivers/net/ark/ark_udm.h
@@ -137,7 +137,7 @@ struct ark_udm_tlp_ps_t {
#define ARK_UDM_RT_CFG 0x00e0
struct ark_udm_rt_cfg_t {
- phys_addr_t hw_prod_addr;
+ rte_iova_t hw_prod_addr;
uint32_t write_interval; /* 4ns cycles */
volatile uint32_t prod_idx; /* RO */
};
@@ -171,7 +171,7 @@ void ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
uint32_t dataroom,
uint32_t write_interval_ns);
-void ark_udm_write_addr(struct ark_udm_t *udm, phys_addr_t addr);
+void ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr);
void ark_udm_stats_reset(struct ark_udm_t *udm);
void ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg,
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index d615a2fb7..9b342bfa3 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -387,7 +387,7 @@ avp_dev_translate_buffer(struct avp_dev *avp, void *host_mbuf_address)
/* translate from host physical address to guest virtual address */
static void *
avp_dev_translate_address(struct rte_eth_dev *eth_dev,
- phys_addr_t host_phys_addr)
+ rte_iova_t host_phys_addr)
{
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
struct rte_mem_resource *resource;
diff --git a/drivers/net/avp/rte_avp_common.h b/drivers/net/avp/rte_avp_common.h
index 488d72168..54437e9a1 100644
--- a/drivers/net/avp/rte_avp_common.h
+++ b/drivers/net/avp/rte_avp_common.h
@@ -243,7 +243,7 @@ struct rte_avp_desc {
*/
struct rte_avp_memmap {
void *addr;
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
uint64_t length;
};
@@ -345,7 +345,7 @@ RTE_AVP_MAKE_VERSION(RTE_AVP_RELEASE_VERSION_1, \
*/
struct rte_avp_mempool_info {
void *addr;
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
uint64_t length;
};
@@ -359,10 +359,10 @@ struct rte_avp_device_info {
char ifname[RTE_AVP_NAMESIZE]; /**< Network device name for AVP */
- phys_addr_t tx_phys;
- phys_addr_t rx_phys;
- phys_addr_t alloc_phys;
- phys_addr_t free_phys;
+ rte_iova_t tx_phys;
+ rte_iova_t rx_phys;
+ rte_iova_t alloc_phys;
+ rte_iova_t free_phys;
uint32_t features; /**< Supported feature bitmap */
uint8_t min_rx_queues; /**< Minimum supported receive/free queues */
@@ -379,14 +379,14 @@ struct rte_avp_device_info {
uint32_t free_size; /**< Size of each free queue */
/* Used by Ethtool */
- phys_addr_t req_phys;
- phys_addr_t resp_phys;
- phys_addr_t sync_phys;
+ rte_iova_t req_phys;
+ rte_iova_t resp_phys;
+ rte_iova_t sync_phys;
void *sync_va;
/* mbuf mempool (used when a single memory area is supported) */
void *mbuf_va;
- phys_addr_t mbuf_phys;
+ rte_iova_t mbuf_phys;
/* mbuf mempools */
struct rte_avp_mempool_info pool[RTE_AVP_MAX_MEMPOOLS];
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 99b532bb4..9394f6c50 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -419,7 +419,7 @@ void bnx2x_read_dmae(struct bnx2x_softc *sc, uint32_t src_addr, uint32_t len32)
}
void
-bnx2x_write_dmae(struct bnx2x_softc *sc, phys_addr_t dma_addr, uint32_t dst_addr,
+bnx2x_write_dmae(struct bnx2x_softc *sc, rte_iova_t dma_addr, uint32_t dst_addr,
uint32_t len32)
{
struct dmae_command dmae;
@@ -447,7 +447,7 @@ bnx2x_write_dmae(struct bnx2x_softc *sc, phys_addr_t dma_addr, uint32_t dst_addr
}
static void
-bnx2x_write_dmae_phys_len(struct bnx2x_softc *sc, phys_addr_t phys_addr,
+bnx2x_write_dmae_phys_len(struct bnx2x_softc *sc, rte_iova_t phys_addr,
uint32_t addr, uint32_t len)
{
uint32_t dmae_wr_max = DMAE_LEN32_WR_MAX(sc);
@@ -823,14 +823,14 @@ bnx2x_fw_command(struct bnx2x_softc *sc, uint32_t command, uint32_t param)
static void
__storm_memset_dma_mapping(struct bnx2x_softc *sc, uint32_t addr,
- phys_addr_t mapping)
+ rte_iova_t mapping)
{
REG_WR(sc, addr, U64_LO(mapping));
REG_WR(sc, (addr + 4), U64_HI(mapping));
}
static void
-storm_memset_spq_addr(struct bnx2x_softc *sc, phys_addr_t mapping,
+storm_memset_spq_addr(struct bnx2x_softc *sc, rte_iova_t mapping,
uint16_t abs_fid)
{
uint32_t addr = (XSEM_REG_FAST_MEMORY +
@@ -1498,7 +1498,7 @@ bnx2x_set_q_rx_mode(struct bnx2x_softc *sc, uint8_t cl_id,
ramrod_param.rdata = BNX2X_SP(sc, rx_mode_rdata);
ramrod_param.rdata_mapping =
- (phys_addr_t)BNX2X_SP_MAPPING(sc, rx_mode_rdata),
+ (rte_iova_t)BNX2X_SP_MAPPING(sc, rx_mode_rdata),
bnx2x_set_bit(ECORE_FILTER_RX_MODE_PENDING, &sc->sp_state);
ramrod_param.ramrod_flags = ramrod_flags;
@@ -4599,9 +4599,9 @@ static void bnx2x_init_func_obj(struct bnx2x_softc *sc)
ecore_init_func_obj(sc,
&sc->func_obj,
BNX2X_SP(sc, func_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, func_rdata),
+ (rte_iova_t)BNX2X_SP_MAPPING(sc, func_rdata),
BNX2X_SP(sc, func_afex_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, func_afex_rdata),
+ (rte_iova_t)BNX2X_SP_MAPPING(sc, func_afex_rdata),
&bnx2x_func_sp_drv);
}
@@ -4772,7 +4772,7 @@ static void bnx2x_map_sb_state_machines(struct hc_index_data *index_data)
}
static void
-bnx2x_init_sb(struct bnx2x_softc *sc, phys_addr_t busaddr, int vfid,
+bnx2x_init_sb(struct bnx2x_softc *sc, rte_iova_t busaddr, int vfid,
uint8_t vf_valid, int fw_sb_id, int igu_sb_id)
{
struct hc_status_block_data_e2 sb_data_e2;
@@ -4918,7 +4918,7 @@ static void bnx2x_init_eth_fp(struct bnx2x_softc *sc, int idx)
sc->max_cos,
SC_FUNC(sc),
BNX2X_SP(sc, q_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, q_rdata),
+ (rte_iova_t)BNX2X_SP_MAPPING(sc, q_rdata),
q_type);
/* configure classification DBs */
@@ -4928,7 +4928,7 @@ static void bnx2x_init_eth_fp(struct bnx2x_softc *sc, int idx)
idx,
SC_FUNC(sc),
BNX2X_SP(sc, mac_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, mac_rdata),
+ (rte_iova_t)BNX2X_SP_MAPPING(sc, mac_rdata),
ECORE_FILTER_MAC_PENDING, &sc->sp_state,
ECORE_OBJ_TYPE_RX_TX, &sc->macs_pool);
}
@@ -5028,7 +5028,7 @@ static void bnx2x_init_tx_rings(struct bnx2x_softc *sc)
static void bnx2x_init_def_sb(struct bnx2x_softc *sc)
{
struct host_sp_status_block *def_sb = sc->def_sb;
- phys_addr_t mapping = sc->def_sb_dma.paddr;
+ rte_iova_t mapping = sc->def_sb_dma.paddr;
int igu_sp_sb_index;
int igu_seg_id;
int port = SC_PORT(sc);
@@ -5700,7 +5700,7 @@ static void bnx2x_init_objs(struct bnx2x_softc *sc)
SC_FUNC(sc),
SC_FUNC(sc),
BNX2X_SP(sc, mcast_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, mcast_rdata),
+ (rte_iova_t)BNX2X_SP_MAPPING(sc, mcast_rdata),
ECORE_FILTER_MCAST_PENDING,
&sc->sp_state, o_type);
@@ -5724,7 +5724,7 @@ static void bnx2x_init_objs(struct bnx2x_softc *sc)
SC_FUNC(sc),
SC_FUNC(sc),
BNX2X_SP(sc, rss_rdata),
- (phys_addr_t)BNX2X_SP_MAPPING(sc, rss_rdata),
+ (rte_iova_t)BNX2X_SP_MAPPING(sc, rss_rdata),
ECORE_FILTER_RSS_CONF_PENDING,
&sc->sp_state, ECORE_OBJ_TYPE_RX);
}
@@ -6445,9 +6445,9 @@ bnx2x_pf_rx_q_prep(struct bnx2x_softc *sc, struct bnx2x_fastpath *fp,
pause->pri_map = 1;
/* rxq setup */
- rxq_init->dscr_map = (phys_addr_t)rxq->rx_ring_phys_addr;
- rxq_init->rcq_map = (phys_addr_t)rxq->cq_ring_phys_addr;
- rxq_init->rcq_np_map = (phys_addr_t)(rxq->cq_ring_phys_addr +
+ rxq_init->dscr_map = (rte_iova_t)rxq->rx_ring_phys_addr;
+ rxq_init->rcq_map = (rte_iova_t)rxq->cq_ring_phys_addr;
+ rxq_init->rcq_np_map = (rte_iova_t)(rxq->cq_ring_phys_addr +
BNX2X_PAGE_SIZE);
/*
@@ -6486,7 +6486,7 @@ bnx2x_pf_tx_q_prep(struct bnx2x_softc *sc, struct bnx2x_fastpath *fp,
PMD_TX_LOG(ERR, "ERROR: TX queue is NULL");
return;
}
- txq_init->dscr_map = (phys_addr_t)txq->tx_ring_phys_addr;
+ txq_init->dscr_map = (rte_iova_t)txq->tx_ring_phys_addr;
txq_init->sb_cq_index = HC_INDEX_ETH_FIRST_TX_CQ_CONS + cos;
txq_init->traffic_type = LLFC_TRAFFIC_TYPE_NW;
txq_init->fw_sb_id = fp->fw_sb_id;
@@ -11059,7 +11059,7 @@ static int bnx2x_init_hw_func(struct bnx2x_softc *sc)
for (i = 0; i < L2_ILT_LINES(sc); i++) {
ilt->lines[cdu_ilt_start + i].page = sc->context[i].vcxt;
ilt->lines[cdu_ilt_start + i].page_mapping =
- (phys_addr_t)sc->context[i].vcxt_dma.paddr;
+ (rte_iova_t)sc->context[i].vcxt_dma.paddr;
ilt->lines[cdu_ilt_start + i].size = sc->context[i].size;
}
ecore_ilt_init_op(sc, INITOP_SET);
@@ -11357,7 +11357,7 @@ static void bnx2x_reset_port(struct bnx2x_softc *sc)
}
}
-static void bnx2x_ilt_wr(struct bnx2x_softc *sc, uint32_t index, phys_addr_t addr)
+static void bnx2x_ilt_wr(struct bnx2x_softc *sc, uint32_t index, rte_iova_t addr)
{
int reg;
uint32_t wb_write[2];
@@ -11587,7 +11587,7 @@ static int ecore_gunzip(struct bnx2x_softc *sc, const uint8_t * zbuf, int len)
}
static void
-ecore_write_dmae_phys_len(struct bnx2x_softc *sc, phys_addr_t phys_addr,
+ecore_write_dmae_phys_len(struct bnx2x_softc *sc, rte_iova_t phys_addr,
uint32_t addr, uint32_t len)
{
bnx2x_write_dmae_phys_len(sc, phys_addr, addr, len);
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 497bc69cf..17075d384 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -318,7 +318,7 @@ struct bnx2x_bar {
/* Used to manage DMA allocations. */
struct bnx2x_dma {
struct bnx2x_softc *sc;
- phys_addr_t paddr;
+ rte_iova_t paddr;
void *vaddr;
int nseg;
char msg[RTE_MEMZONE_NAMESIZE - 6];
@@ -371,10 +371,10 @@ struct bnx2x_fastpath {
struct bnx2x_dma sb_dma;
union bnx2x_host_hc_status_block status_block;
- phys_addr_t tx_desc_mapping;
+ rte_iova_t tx_desc_mapping;
- phys_addr_t rx_desc_mapping;
- phys_addr_t rx_comp_mapping;
+ rte_iova_t rx_desc_mapping;
+ rte_iova_t rx_comp_mapping;
uint16_t *sb_index_values;
uint16_t *sb_running_index;
@@ -469,7 +469,7 @@ union cdu_context {
struct hw_context {
struct bnx2x_dma vcxt_dma;
union cdu_context *vcxt;
- //phys_addr_t cxt_mapping;
+ //rte_iova_t cxt_mapping;
size_t size;
};
@@ -1243,7 +1243,7 @@ struct bnx2x_softc {
uint32_t gz_outlen;
#define GUNZIP_BUF(sc) (sc->gz_buf)
#define GUNZIP_OUTLEN(sc) (sc->gz_outlen)
-#define GUNZIP_PHYS(sc) (phys_addr_t)(sc->gz_buf_dma.paddr)
+#define GUNZIP_PHYS(sc) (rte_iova_t)(sc->gz_buf_dma.paddr)
#define FW_BUF_SIZE 0x40000
struct raw_op *init_ops;
@@ -1311,14 +1311,14 @@ struct bnx2x_softc {
*/
int fw_stats_req_size;
struct bnx2x_fw_stats_req *fw_stats_req;
- phys_addr_t fw_stats_req_mapping;
+ rte_iova_t fw_stats_req_mapping;
/*
* FW statistics data shortcut (points at the beginning of fw_stats
* buffer + fw_stats_req_size).
*/
int fw_stats_data_size;
struct bnx2x_fw_stats_data *fw_stats_data;
- phys_addr_t fw_stats_data_mapping;
+ rte_iova_t fw_stats_data_mapping;
/* tracking a pending STAT_QUERY ramrod */
uint16_t stats_pending;
@@ -1403,8 +1403,8 @@ union bnx2x_stats_show_data {
#define FUNC_FLG_LEADING 0x0020 /* PF only */
struct bnx2x_func_init_params {
- phys_addr_t fw_stat_map; /* (dma) valid if FUNC_FLG_STATS */
- phys_addr_t spq_map; /* (dma) valid if FUNC_FLG_SPQ */
+ rte_iova_t fw_stat_map; /* (dma) valid if FUNC_FLG_STATS */
+ rte_iova_t spq_map; /* (dma) valid if FUNC_FLG_SPQ */
uint16_t func_flgs;
uint16_t func_id; /* abs function id */
uint16_t pf_id;
@@ -1749,7 +1749,7 @@ uint32_t bnx2x_dmae_opcode(struct bnx2x_softc *sc, uint8_t src_type,
uint8_t comp_type);
void bnx2x_post_dmae(struct bnx2x_softc *sc, struct dmae_command *dmae, int idx);
void bnx2x_read_dmae(struct bnx2x_softc *sc, uint32_t src_addr, uint32_t len32);
-void bnx2x_write_dmae(struct bnx2x_softc *sc, phys_addr_t dma_addr,
+void bnx2x_write_dmae(struct bnx2x_softc *sc, rte_iova_t dma_addr,
uint32_t dst_addr, uint32_t len32);
void bnx2x_set_ctx_validation(struct bnx2x_softc *sc, struct eth_context *cxt,
uint32_t cid);
diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c
index 7c3324a6d..a0d4ac929 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.c
+++ b/drivers/net/bnx2x/bnx2x_rxtx.c
@@ -71,8 +71,8 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
struct bnx2x_softc *sc = dev->data->dev_private;
struct bnx2x_fastpath *fp = &sc->fp[queue_idx];
struct eth_rx_cqe_next_page *nextpg;
- phys_addr_t *rx_bd;
- phys_addr_t busaddr;
+ rte_iova_t *rx_bd;
+ rte_iova_t busaddr;
/* First allocate the rx queue data structure */
rxq = rte_zmalloc_socket("ethdev RX queue", sizeof(struct bnx2x_rx_queue),
diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c
index 6223cfef1..b9b859639 100644
--- a/drivers/net/bnx2x/bnx2x_stats.c
+++ b/drivers/net/bnx2x/bnx2x_stats.c
@@ -1338,7 +1338,7 @@ bnx2x_prep_fw_stats_req(struct bnx2x_softc *sc)
int i;
int first_queue_query_index;
struct stats_query_header *stats_hdr = &sc->fw_stats_req->hdr;
- phys_addr_t cur_data_offset;
+ rte_iova_t cur_data_offset;
struct stats_query_entry *cur_query_entry;
stats_hdr->cmd_num = sc->fw_stats_num;
diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c
index 0ca0df876..3c08f2a2b 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/bnx2x/bnx2x_vfpf.c
@@ -113,7 +113,7 @@ bnx2x_vf_finalize(struct bnx2x_softc *sc,
#define BNX2X_VF_CHANNEL_TRIES 100
static int
-bnx2x_do_req4pf(struct bnx2x_softc *sc, phys_addr_t phys_addr)
+bnx2x_do_req4pf(struct bnx2x_softc *sc, rte_iova_t phys_addr)
{
uint8_t *status = &sc->vf2pf_mbox->resp.common_reply.status;
uint8_t i;
diff --git a/drivers/net/bnx2x/ecore_sp.h b/drivers/net/bnx2x/ecore_sp.h
index 85ab4c28f..ff40413cf 100644
--- a/drivers/net/bnx2x/ecore_sp.h
+++ b/drivers/net/bnx2x/ecore_sp.h
@@ -36,7 +36,7 @@
#include "ecore_reg.h"
struct bnx2x_softc;
-typedef phys_addr_t ecore_dma_addr_t; /* expected to be 64 bit wide */
+typedef rte_iova_t ecore_dma_addr_t; /* expected to be 64 bit wide */
typedef volatile int ecore_atomic_t;
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 039b248ec..646fe79e3 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -133,7 +133,7 @@ struct bnxt_pf_info {
uint16_t max_vfs;
uint32_t func_cfg_flags;
void *vf_req_buf;
- phys_addr_t vf_req_buf_dma_addr;
+ rte_iova_t vf_req_buf_dma_addr;
uint32_t vf_req_fwd[8];
uint16_t total_vnics;
struct bnxt_child_vf_info *vf_info;
@@ -203,14 +203,14 @@ struct bnxt {
struct bnxt_rx_queue **rx_queues;
const void *rx_mem_zone;
struct rx_port_stats *hw_rx_port_stats;
- phys_addr_t hw_rx_port_stats_map;
+ rte_iova_t hw_rx_port_stats_map;
unsigned int tx_nr_rings;
unsigned int tx_cp_nr_rings;
struct bnxt_tx_queue **tx_queues;
const void *tx_mem_zone;
struct tx_port_stats *hw_tx_port_stats;
- phys_addr_t hw_tx_port_stats_map;
+ rte_iova_t hw_tx_port_stats_map;
/* Default completion ring */
struct bnxt_cp_ring_info *def_cp_ring;
@@ -236,9 +236,9 @@ struct bnxt {
uint16_t hwrm_cmd_seq;
void *hwrm_cmd_resp_addr;
- phys_addr_t hwrm_cmd_resp_dma_addr;
+ rte_iova_t hwrm_cmd_resp_dma_addr;
void *hwrm_short_cmd_req_addr;
- phys_addr_t hwrm_short_cmd_req_dma_addr;
+ rte_iova_t hwrm_short_cmd_req_dma_addr;
rte_spinlock_t hwrm_lock;
uint16_t max_req_len;
uint16_t max_resp_len;
diff --git a/drivers/net/bnxt/bnxt_cpr.h b/drivers/net/bnxt/bnxt_cpr.h
index e8f048a3b..ce2b0cb8a 100644
--- a/drivers/net/bnxt/bnxt_cpr.h
+++ b/drivers/net/bnxt/bnxt_cpr.h
@@ -86,10 +86,10 @@ struct bnxt_cp_ring_info {
struct cmpl_base *cp_desc_ring;
- phys_addr_t cp_desc_mapping;
+ rte_iova_t cp_desc_mapping;
struct ctx_hw_stats *hw_stats;
- phys_addr_t hw_stats_map;
+ rte_iova_t hw_stats_map;
uint32_t hw_stats_ctx_id;
struct bnxt_ring *cp_ring_struct;
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index ccd50a704..10735f6a8 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2796,7 +2796,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
const struct rte_memzone *mz = NULL;
static int version_printed;
uint32_t total_alloc_len;
- phys_addr_t mz_phys_addr;
+ rte_iova_t mz_phys_addr;
struct bnxt *bp;
int rc;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 1fdc51cba..bf1fb469a 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -3026,7 +3026,7 @@ int bnxt_get_nvram_directory(struct bnxt *bp, uint32_t len, uint8_t *data)
uint32_t entry_length;
uint8_t *buf;
size_t buflen;
- phys_addr_t dma_handle;
+ rte_iova_t dma_handle;
struct hwrm_nvm_get_dir_entries_input req = {0};
struct hwrm_nvm_get_dir_entries_output *resp = bp->hwrm_cmd_resp_addr;
@@ -3071,7 +3071,7 @@ int bnxt_hwrm_get_nvram_item(struct bnxt *bp, uint32_t index,
{
int rc;
uint8_t *buf;
- phys_addr_t dma_handle;
+ rte_iova_t dma_handle;
struct hwrm_nvm_read_input req = {0};
struct hwrm_nvm_read_output *resp = bp->hwrm_cmd_resp_addr;
@@ -3125,7 +3125,7 @@ int bnxt_hwrm_flash_nvram(struct bnxt *bp, uint16_t dir_type,
int rc;
struct hwrm_nvm_write_input req = {0};
struct hwrm_nvm_write_output *resp = bp->hwrm_cmd_resp_addr;
- phys_addr_t dma_handle;
+ rte_iova_t dma_handle;
uint8_t *buf;
HWRM_PREP(req, NVM_WRITE);
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index b196dd1e3..0fa2f0c0d 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -98,7 +98,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
struct rte_pci_device *pdev = bp->pdev;
const struct rte_memzone *mz = NULL;
char mz_name[RTE_MEMZONE_NAMESIZE];
- phys_addr_t mz_phys_addr;
+ rte_iova_t mz_phys_addr;
int sz;
int stats_len = (tx_ring_info || rx_ring_info) ?
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index ac1ce2a57..164f482e3 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -70,7 +70,7 @@
struct bnxt_ring {
void *bd;
- phys_addr_t bd_dma;
+ rte_iova_t bd_dma;
uint32_t ring_size;
uint32_t ring_mask;
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index cb0cef303..a94373d19 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -101,8 +101,8 @@ struct bnxt_rx_ring_info {
struct bnxt_sw_rx_bd *rx_buf_ring; /* sw ring */
struct bnxt_sw_rx_bd *ag_buf_ring; /* sw ring */
- phys_addr_t rx_desc_mapping;
- phys_addr_t ag_desc_mapping;
+ rte_iova_t rx_desc_mapping;
+ rte_iova_t ag_desc_mapping;
struct bnxt_ring *rx_ring_struct;
struct bnxt_ring *ag_ring_struct;
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index 3f3eb312b..2feac51db 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -49,7 +49,7 @@ struct bnxt_tx_ring_info {
struct tx_bd_long *tx_desc_ring;
struct bnxt_sw_tx_bd *tx_buf_ring;
- phys_addr_t tx_desc_mapping;
+ rte_iova_t tx_desc_mapping;
#define BNXT_DEV_STATE_CLOSING 0x1
uint32_t dev_state;
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 937ad6570..5bac26053 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -175,7 +175,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
BNXT_MAX_MC_ADDRS * ETHER_ADDR_LEN);
uint16_t max_vnics;
int i;
- phys_addr_t mz_phys_addr;
+ rte_iova_t mz_phys_addr;
max_vnics = bp->max_vnics;
snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
diff --git a/drivers/net/bnxt/bnxt_vnic.h b/drivers/net/bnxt/bnxt_vnic.h
index 544390453..875dc3c1c 100644
--- a/drivers/net/bnxt/bnxt_vnic.h
+++ b/drivers/net/bnxt/bnxt_vnic.h
@@ -53,11 +53,11 @@ struct bnxt_vnic_info {
uint16_t dflt_ring_grp;
uint16_t mru;
uint16_t hash_type;
- phys_addr_t rss_table_dma_addr;
+ rte_iova_t rss_table_dma_addr;
uint16_t *rss_table;
- phys_addr_t rss_hash_key_dma_addr;
+ rte_iova_t rss_hash_key_dma_addr;
void *rss_hash_key;
- phys_addr_t mc_list_dma_addr;
+ rte_iova_t mc_list_dma_addr;
char *mc_list;
uint32_t mc_addr_cnt;
#define BNXT_MAX_MC_ADDRS 16
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index efad4e7c9..376893ac8 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -1744,7 +1744,7 @@ lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
} else {
struct lio_buf_free_info *finfo;
struct lio_gather *g;
- phys_addr_t phyaddr;
+ rte_iova_t phyaddr;
int i, frags;
finfo = (struct lio_buf_free_info *)rte_malloc(NULL,
@@ -1791,7 +1791,7 @@ lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
}
phyaddr = rte_mem_virt2iova(g->sg);
- if (phyaddr == RTE_BAD_PHYS_ADDR) {
+ if (phyaddr == RTE_BAD_IOVA) {
PMD_TX_LOG(lio_dev, ERR, "bad phys addr\n");
goto xmit_failed;
}
diff --git a/drivers/net/liquidio/lio_rxtx.h b/drivers/net/liquidio/lio_rxtx.h
index 47d84fb16..ef033735f 100644
--- a/drivers/net/liquidio/lio_rxtx.h
+++ b/drivers/net/liquidio/lio_rxtx.h
@@ -686,7 +686,7 @@ lio_swap_8B_data(uint64_t *data, uint32_t blocks)
static inline uint64_t
lio_map_ring(void *buf)
{
- phys_addr_t dma_addr;
+ rte_iova_t dma_addr;
dma_addr = rte_mbuf_data_iova_default(((struct rte_mbuf *)buf));
@@ -696,7 +696,7 @@ lio_map_ring(void *buf)
static inline uint64_t
lio_map_ring_info(struct lio_droq *droq, uint32_t i)
{
- phys_addr_t dma_addr;
+ rte_iova_t dma_addr;
dma_addr = droq->info_list_dma + (i * LIO_DROQ_INFO_SIZE);
diff --git a/drivers/net/octeontx/base/octeontx_pkovf.c b/drivers/net/octeontx/base/octeontx_pkovf.c
index 64e5d69b1..f01d948e4 100644
--- a/drivers/net/octeontx/base/octeontx_pkovf.c
+++ b/drivers/net/octeontx/base/octeontx_pkovf.c
@@ -46,7 +46,7 @@
struct octeontx_pko_iomem {
uint8_t *va;
- phys_addr_t iova;
+ rte_iova_t iova;
size_t size;
};
diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index 74e518821..a384b01f6 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -63,7 +63,7 @@ typedef u32 OSAL_BE32;
#define osal_uintptr_t uintptr_t
-typedef phys_addr_t dma_addr_t;
+typedef rte_iova_t dma_addr_t;
typedef rte_spinlock_t osal_spinlock_t;
diff --git a/drivers/net/sfc/efsys.h b/drivers/net/sfc/efsys.h
index 0405d02bb..f428b6246 100644
--- a/drivers/net/sfc/efsys.h
+++ b/drivers/net/sfc/efsys.h
@@ -253,7 +253,7 @@ typedef struct __efsys_identifier_s efsys_identifier_t;
/* DMA */
-typedef phys_addr_t efsys_dma_addr_t;
+typedef rte_iova_t efsys_dma_addr_t;
typedef struct efsys_mem_s {
const struct rte_memzone *esm_mz;
diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index 1c1274067..49d7e9370 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -62,7 +62,7 @@ sfc_dma_alloc(const struct sfc_adapter *sa, const char *name, uint16_t id,
}
esmp->esm_addr = mz->iova;
- if (esmp->esm_addr == RTE_BAD_PHYS_ADDR) {
+ if (esmp->esm_addr == RTE_BAD_IOVA) {
(void)rte_memzone_free(mz);
return EFAULT;
}
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index 23e45b453..18d60c694 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -177,7 +177,7 @@ sfc_ef10_rx_qrefill(struct sfc_ef10_rxq *rxq)
++i, ++id) {
struct rte_mbuf *m = objs[i];
struct sfc_ef10_rx_sw_desc *rxd;
- phys_addr_t phys_addr;
+ rte_iova_t phys_addr;
SFC_ASSERT((id & ~ptr_mask) == 0);
rxd = &rxq->sw_ring[id];
diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c
index 2e246f40c..0454e79a2 100644
--- a/drivers/net/sfc/sfc_ef10_tx.c
+++ b/drivers/net/sfc/sfc_ef10_tx.c
@@ -195,7 +195,7 @@ sfc_ef10_tx_reap(struct sfc_ef10_txq *txq)
}
static void
-sfc_ef10_tx_qdesc_dma_create(phys_addr_t addr, uint16_t size, bool eop,
+sfc_ef10_tx_qdesc_dma_create(rte_iova_t addr, uint16_t size, bool eop,
efx_qword_t *edp)
{
EFX_POPULATE_QWORD_4(*edp,
@@ -341,7 +341,7 @@ sfc_ef10_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
pkt_len = m_seg->pkt_len;
do {
- phys_addr_t seg_addr = rte_mbuf_data_iova(m_seg);
+ rte_iova_t seg_addr = rte_mbuf_data_iova(m_seg);
unsigned int seg_len = rte_pktmbuf_data_len(m_seg);
unsigned int id = added & ptr_mask;
diff --git a/drivers/net/thunderx/base/nicvf_hw.c b/drivers/net/thunderx/base/nicvf_hw.c
index 2634285eb..dc0af1ca0 100644
--- a/drivers/net/thunderx/base/nicvf_hw.c
+++ b/drivers/net/thunderx/base/nicvf_hw.c
@@ -509,7 +509,7 @@ nicvf_qset_rbdr_precharge(void *dev, struct nicvf *nic,
struct rbdr_entry_t *desc, *desc0;
struct nicvf_rbdr *rbdr = nic->rbdr;
uint32_t count;
- nicvf_phys_addr_t phy;
+ nicvf_iova_addr_t phy;
assert(rbdr != NULL);
desc = rbdr->desc;
diff --git a/drivers/net/thunderx/base/nicvf_hw.h b/drivers/net/thunderx/base/nicvf_hw.h
index b7d0a3dc5..698aa4878 100644
--- a/drivers/net/thunderx/base/nicvf_hw.h
+++ b/drivers/net/thunderx/base/nicvf_hw.h
@@ -88,7 +88,7 @@ enum nicvf_err_e {
NICVF_ERR_RSS_GET_SZ, /* -8171 */
};
-typedef nicvf_phys_addr_t (*rbdr_pool_get_handler)(void *dev, void *opaque);
+typedef nicvf_iova_addr_t (*rbdr_pool_get_handler)(void *dev, void *opaque);
struct nicvf_hw_rx_qstats {
uint64_t q_rx_bytes;
diff --git a/drivers/net/thunderx/base/nicvf_hw_defs.h b/drivers/net/thunderx/base/nicvf_hw_defs.h
index 0fe673e6d..e7e092b61 100644
--- a/drivers/net/thunderx/base/nicvf_hw_defs.h
+++ b/drivers/net/thunderx/base/nicvf_hw_defs.h
@@ -213,7 +213,7 @@
#define NICVF_STATIC_ASSERT(s) _Static_assert(s, #s)
#define assert_primary(nic) assert((nic)->sqs_mode == 0)
-typedef uint64_t nicvf_phys_addr_t;
+typedef uint64_t nicvf_iova_addr_t;
/* vNIC HW Enumerations */
@@ -840,7 +840,7 @@ struct rbdr_entry_t {
uint64_t buf_addr:42;
uint64_t cache_align:7;
};
- nicvf_phys_addr_t full_addr;
+ nicvf_iova_addr_t full_addr;
};
#else
union {
@@ -849,7 +849,7 @@ struct rbdr_entry_t {
uint64_t buf_addr:42;
uint64_t rsvd0:15;
};
- nicvf_phys_addr_t full_addr;
+ nicvf_iova_addr_t full_addr;
};
#endif
};
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index ea561395b..d65d3cee7 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -680,7 +680,7 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic,
static void
nicvf_rbdr_release_mbuf(struct rte_eth_dev *dev, struct nicvf *nic,
- nicvf_phys_addr_t phy)
+ nicvf_iova_addr_t phy)
{
uint16_t qidx;
void *obj;
@@ -1429,7 +1429,7 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
};
}
-static nicvf_phys_addr_t
+static nicvf_iova_addr_t
rbdr_rte_mempool_get(void *dev, void *opaque)
{
uint16_t qidx;
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index e92c3242a..71bc3cf2a 100644
--- a/drivers/net/thunderx/nicvf_ethdev.h
+++ b/drivers/net/thunderx/nicvf_ethdev.h
@@ -104,7 +104,7 @@ nicvf_netdev_qidx(struct nicvf *nic, uint8_t local_qidx)
* P = V - offset
*/
static inline uintptr_t
-nicvf_mbuff_phy2virt(phys_addr_t phy, uint64_t mbuf_phys_off)
+nicvf_mbuff_phy2virt(rte_iova_t phy, uint64_t mbuf_phys_off)
{
return (uintptr_t)(phy + mbuf_phys_off);
}
@@ -112,7 +112,7 @@ nicvf_mbuff_phy2virt(phys_addr_t phy, uint64_t mbuf_phys_off)
static inline uintptr_t
nicvf_mbuff_virt2phy(uintptr_t virt, uint64_t mbuf_phys_off)
{
- return (phys_addr_t)(virt - mbuf_phys_off);
+ return (rte_iova_t)(virt - mbuf_phys_off);
}
static inline void
diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h
index e54a96f8e..0f8208ef1 100644
--- a/drivers/net/thunderx/nicvf_struct.h
+++ b/drivers/net/thunderx/nicvf_struct.h
@@ -46,7 +46,7 @@ struct nicvf_rbdr {
uintptr_t rbdr_status;
uintptr_t rbdr_door;
struct rbdr_entry_t *desc;
- nicvf_phys_addr_t phys;
+ nicvf_iova_addr_t phys;
uint32_t buffsz;
uint32_t tail;
uint32_t next_tail;
@@ -56,7 +56,7 @@ struct nicvf_rbdr {
struct nicvf_txq {
union sq_entry_t *desc;
- nicvf_phys_addr_t phys;
+ nicvf_iova_addr_t phys;
struct rte_mbuf **txbuffs;
uintptr_t sq_head;
uintptr_t sq_door;
@@ -87,7 +87,7 @@ struct nicvf_rxq {
uintptr_t cq_status;
uintptr_t cq_door;
union mbuf_initializer mbuf_initializer;
- nicvf_phys_addr_t phys;
+ nicvf_iova_addr_t phys;
union cq_entry_t *desc;
struct nicvf_rbdr *shared_rbdr;
struct nicvf *nic;
diff --git a/drivers/net/virtio/virtio_rxtx.h b/drivers/net/virtio/virtio_rxtx.h
index 2a7c3ad3a..54f1e849b 100644
--- a/drivers/net/virtio/virtio_rxtx.h
+++ b/drivers/net/virtio/virtio_rxtx.h
@@ -66,7 +66,7 @@ struct virtnet_tx {
struct virtqueue *vq;
/**< memzone to populate hdr. */
const struct rte_memzone *virtio_net_hdr_mz;
- phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
+ rte_iova_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
uint16_t queue_id; /**< DPDK queue index. */
uint16_t port_id; /**< Device port identifier. */
@@ -81,7 +81,7 @@ struct virtnet_ctl {
struct virtqueue *vq;
/**< memzone to populate hdr. */
const struct rte_memzone *virtio_net_hdr_mz;
- phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
+ rte_iova_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
uint16_t port_id; /**< Device port identifier. */
const struct rte_memzone *mz; /**< mem zone to populate CTL ring. */
};
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 6c90d3779..2305d91a4 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -203,8 +203,8 @@ struct virtqueue {
struct virtnet_ctl cq;
};
- phys_addr_t vq_ring_mem; /**< physical address of vring,
- * or virtual address for virtio_user. */
+ rte_iova_t vq_ring_mem; /**< physical address of vring,
+ * or virtual address for virtio_user. */
/**
* Head of the free chain in the descriptor table. If
diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index 01b17ca72..1cc81c17c 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -338,7 +338,7 @@ extern uint64_t VHOST_FEATURES;
extern struct virtio_net *vhost_devices[MAX_VHOST_DEVICE];
/* Convert guest physical address to host physical address */
-static __rte_always_inline phys_addr_t
+static __rte_always_inline rte_iova_t
gpa_to_hpa(struct virtio_net *dev, uint64_t gpa, uint64_t size)
{
uint32_t i;
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* [dpdk-dev] [PATCH v4 15/15] doc: add IOVA aware API changes in release notes
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
` (13 preceding siblings ...)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 14/15] drivers/net: " Thomas Monjalon
@ 2017-11-06 1:41 ` Thomas Monjalon
2017-11-06 5:56 ` santosh
2017-11-06 8:50 ` Mcnamara, John
2017-11-06 22:48 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
15 siblings, 2 replies; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 1:41 UTC (permalink / raw)
To: Santosh Shukla; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
The wording changes have been done in the API without breaking
the ABI. The deprecated fields and symbols can be removed later
when an another ABI change will be required.
The deprecation notice can be removed.
The release notes describe the new available API with IOVA wording.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
doc/guides/rel_notes/deprecation.rst | 7 -------
doc/guides/rel_notes/release_17_11.rst | 17 +++++++++++++++++
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index a93c3e170..817f19213 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -21,13 +21,6 @@ Deprecation Notices
- ``rte_eal_devargs_type_count``
- ``rte_eal_parse_devargs_str``, replaced by ``rte_eal_devargs_parse``
-* eal: An ABI change is planned for 17.11 to make DPDK aware of IOVA address
- translation scheme.
- Reference to phys address in EAL data-structure or functions may change to
- IOVA address or more appropriate name.
- The change will be only for the name.
- Functional aspects of the API or data-structure will remain same.
-
* pci: Several exposed functions are misnamed.
The following functions are deprecated starting from v17.11 and are replaced:
diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
index b96b23614..85505fa8e 100644
--- a/doc/guides/rel_notes/release_17_11.rst
+++ b/doc/guides/rel_notes/release_17_11.rst
@@ -321,6 +321,23 @@ API Changes
* ``rte_mem_phy2mch`` was used in Xen dom0 to obtain the physical address;
remove this API as Xen dom0 support was removed.
+* **Some data type, structure members and functions related to physical address
+ are deprecated and have new alias with IOVA wording.**
+
+ * ``phys_addr_t`` can be often replaced by ``rte_iova_t`` of same size.
+ * ``RTE_BAD_PHYS_ADDR`` is often replaced by ``RTE_BAD_IOVA`` of same value.
+ * ``rte_memseg.phys_addr`` is aliased with ``rte_memseg.iova_addr``.
+ * ``rte_mem_virt2phy()`` can often be replaced by ``rte_mem_virt2iova``.
+ * ``rte_malloc_virt2phy`` is aliased with ``rte_malloc_virt2iova``.
+ * ``rte_memzone.phys_addr`` is aliased with ``rte_memzone.iova``.
+ * ``rte_mempool_objhdr.physaddr`` is aliased with ``rte_mempool_objhdr.iova``.
+ * ``rte_mempool_memhdr.phys_addr`` is aliased with ``rte_mempool_memhdr.iova``.
+ * ``rte_mempool_virt2phy()`` can be replaced by ``rte_mempool_virt2iova()``.
+ * ``rte_mempool_populate_phys*()`` are aliased with ``rte_mempool_populate_iova*()``
+ * ``rte_mbuf.buf_physaddr`` is aliased with ``rte_mbuf.buf_iova``.
+ * ``rte_mbuf_data_dma_addr*()`` are aliased with ``rte_mbuf_data_iova*()``.
+ * ``rte_pktmbuf_mtophys*`` are aliased with ``rte_pktmbuf_iova*()``.
+
* **PCI bus API moved outside of the EAL**
The PCI bus previously implemented within the EAL has been moved.
--
2.14.2
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 02/15] mem: introduce IOVA type
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 02/15] mem: introduce IOVA type Thomas Monjalon
@ 2017-11-06 5:38 ` santosh
2017-11-06 8:37 ` Thomas Monjalon
0 siblings, 1 reply; 91+ messages in thread
From: santosh @ 2017-11-06 5:38 UTC (permalink / raw)
To: Thomas Monjalon
Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
On Monday 06 November 2017 07:11 AM, Thomas Monjalon wrote:
> The IO virtual addresses may be used instead of physical addresses.
> As IOVA is more generic, it should be used in most places instead
> of physical address wording.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> lib/librte_eal/common/include/rte_memory.h | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
> index 5a3a956e3..f7eed9ab6 100644
> --- a/lib/librte_eal/common/include/rte_memory.h
> +++ b/lib/librte_eal/common/include/rte_memory.h
> @@ -92,8 +92,16 @@ enum rte_page_sizes {
> */
> #define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)
>
> -typedef uint64_t phys_addr_t; /**< Physical address definition. */
> +typedef uint64_t phys_addr_t; /**< Physical address. */
> #define RTE_BAD_PHYS_ADDR ((phys_addr_t)-1)
> +/**
> + * IO virtual address type.
> + * When the physical addressing mode is in use,
> + * the translation from a virtual address to a physical address
> + * is a direct mapping, i.e. the same value.
> + */
I guess - that description applicable for iova=va mode
and for iova=pa mode - Need to do explicit virt2phy translation.
I believe you mis-wrote - s/physical addressing mode/virtual addressing mode.
With that:
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Thanks.
> +typedef uint64_t rte_iova_t;
> +#define RTE_BAD_IOVA ((rte_iova_t)-1)
>
> /**
> * Physical memory segment descriptor.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 01/15] mem: hide physical address error in VA mode
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 01/15] mem: hide physical address error in VA mode Thomas Monjalon
@ 2017-11-06 5:39 ` santosh
0 siblings, 0 replies; 91+ messages in thread
From: santosh @ 2017-11-06 5:39 UTC (permalink / raw)
To: Thomas Monjalon
Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
On Monday 06 November 2017 07:11 AM, Thomas Monjalon wrote:
> If the IOVA mode is not using physical addresses,
> no need to log an error about physical address issue.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 04/15] mem: rename address mapping function to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 04/15] mem: rename address mapping function " Thomas Monjalon
@ 2017-11-06 5:41 ` santosh
0 siblings, 0 replies; 91+ messages in thread
From: santosh @ 2017-11-06 5:41 UTC (permalink / raw)
To: Thomas Monjalon
Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
On Monday 06 November 2017 07:11 AM, Thomas Monjalon wrote:
> The function rte_mem_virt2phy() is kept and used in functions which
> works only with physical addresses.
> For all other calls this function is replaced by rte_mem_virt2iova()
> which does a direct mapping (no conversion) in the VA case.
>
> Note: the new function rte_mem_virt2iova() function matches the
> behaviour implemented in rte_mem_virt2phy() by the commit
> 680f6c12600f ("mem: honor IOVA mode in virt2phy")
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Thanks.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 05/15] malloc: rename address mapping function to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 05/15] malloc: " Thomas Monjalon
@ 2017-11-06 5:47 ` santosh
0 siblings, 0 replies; 91+ messages in thread
From: santosh @ 2017-11-06 5:47 UTC (permalink / raw)
To: Thomas Monjalon
Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
On Monday 06 November 2017 07:11 AM, Thomas Monjalon wrote:
> The function rte_malloc_virt2phy() is renamed to rte_malloc_virt2iova().
> The deprecated name is kept as an alias to avoid breaking the API.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 07/15] memzone: rename address from physical to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 07/15] memzone: rename address from physical to IOVA Thomas Monjalon
@ 2017-11-06 5:50 ` santosh
0 siblings, 0 replies; 91+ messages in thread
From: santosh @ 2017-11-06 5:50 UTC (permalink / raw)
To: Thomas Monjalon
Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
On Monday 06 November 2017 07:11 AM, Thomas Monjalon wrote:
> The struct rte_memzone field .phys_addr is renamed to .iova.
> The deprecated name is kept in an anonymous union to avoid breaking
> the API.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 08/15] mempool: rename addresses from physical to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 08/15] mempool: rename addresses " Thomas Monjalon
@ 2017-11-06 5:52 ` santosh
2017-11-06 15:44 ` Olivier MATZ
1 sibling, 0 replies; 91+ messages in thread
From: santosh @ 2017-11-06 5:52 UTC (permalink / raw)
To: Thomas Monjalon
Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
On Monday 06 November 2017 07:11 AM, Thomas Monjalon wrote:
> The struct fields phys_addr_t rte_mempool_objhdr.physaddr and
> rte_mempool_memhdr.phys_addr are renamed to rte_iova_t iova.
> The deprecated names are kept in an anonymous union to avoid breaking
> the API.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 09/15] mempool: rename address mapping function to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 09/15] mempool: rename address mapping function " Thomas Monjalon
@ 2017-11-06 5:54 ` santosh
2017-11-06 15:44 ` Olivier MATZ
1 sibling, 0 replies; 91+ messages in thread
From: santosh @ 2017-11-06 5:54 UTC (permalink / raw)
To: Thomas Monjalon
Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
On Monday 06 November 2017 07:11 AM, Thomas Monjalon wrote:
> The function rte_mempool_virt2phy() is renamed to rte_mempool_virt2iova().
> The new function has one less parameter because it is unused.
> The deprecated function is kept as an alias to avoid breaking the API.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 15/15] doc: add IOVA aware API changes in release notes
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 15/15] doc: add IOVA aware API changes in release notes Thomas Monjalon
@ 2017-11-06 5:56 ` santosh
2017-11-06 8:50 ` Mcnamara, John
1 sibling, 0 replies; 91+ messages in thread
From: santosh @ 2017-11-06 5:56 UTC (permalink / raw)
To: Thomas Monjalon
Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
On Monday 06 November 2017 07:11 AM, Thomas Monjalon wrote:
> The wording changes have been done in the API without breaking
> the ABI. The deprecated fields and symbols can be removed later
> when an another ABI change will be required.
> The deprecation notice can be removed.
>
> The release notes describe the new available API with IOVA wording.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 02/15] mem: introduce IOVA type
2017-11-06 5:38 ` santosh
@ 2017-11-06 8:37 ` Thomas Monjalon
2017-11-06 8:51 ` santosh
0 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 8:37 UTC (permalink / raw)
To: santosh; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
06/11/2017 06:38, santosh:
>
> On Monday 06 November 2017 07:11 AM, Thomas Monjalon wrote:
> > The IO virtual addresses may be used instead of physical addresses.
> > As IOVA is more generic, it should be used in most places instead
> > of physical address wording.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> > +/**
> > + * IO virtual address type.
> > + * When the physical addressing mode is in use,
> > + * the translation from a virtual address to a physical address
> > + * is a direct mapping, i.e. the same value.
> > + */
>
> I guess - that description applicable for iova=va mode
> and for iova=pa mode - Need to do explicit virt2phy translation.
> I believe you mis-wrote - s/physical addressing mode/virtual addressing mode.
Not sure to understand your comment.
Let me reword the description to be less ambiguous:
* When the physical addressing mode (IOVA as PA) is in use,
* the translation from an IO virtual address (IOVA) to a physical address
* is a direct mapping, i.e. the same value.
* Otherwise, in virtual mode (IOVA as VA), an IOMMU may do the translation.
Is this description correct?
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 15/15] doc: add IOVA aware API changes in release notes
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 15/15] doc: add IOVA aware API changes in release notes Thomas Monjalon
2017-11-06 5:56 ` santosh
@ 2017-11-06 8:50 ` Mcnamara, John
1 sibling, 0 replies; 91+ messages in thread
From: Mcnamara, John @ 2017-11-06 8:50 UTC (permalink / raw)
To: Thomas Monjalon, Santosh Shukla
Cc: olivier.matz, Gonzalez Monroy, Sergio, Burakov, Anatoly, dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> Sent: Monday, November 6, 2017 1:42 AM
> To: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> Cc: olivier.matz@6wind.com; Gonzalez Monroy, Sergio
> <sergio.gonzalez.monroy@intel.com>; Burakov, Anatoly
> <anatoly.burakov@intel.com>; dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v4 15/15] doc: add IOVA aware API changes in
> release notes
>
> The wording changes have been done in the API without breaking the ABI.
> The deprecated fields and symbols can be removed later when an another ABI
> change will be required.
> The deprecation notice can be removed.
>
> The release notes describe the new available API with IOVA wording.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 02/15] mem: introduce IOVA type
2017-11-06 8:37 ` Thomas Monjalon
@ 2017-11-06 8:51 ` santosh
2017-11-06 9:08 ` Thomas Monjalon
0 siblings, 1 reply; 91+ messages in thread
From: santosh @ 2017-11-06 8:51 UTC (permalink / raw)
To: Thomas Monjalon
Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
On Monday 06 November 2017 02:07 PM, Thomas Monjalon wrote:
> 06/11/2017 06:38, santosh:
>> On Monday 06 November 2017 07:11 AM, Thomas Monjalon wrote:
>>> The IO virtual addresses may be used instead of physical addresses.
>>> As IOVA is more generic, it should be used in most places instead
>>> of physical address wording.
>>>
>>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>>> ---
>>> +/**
>>> + * IO virtual address type.
>>> + * When the physical addressing mode is in use,
>>> + * the translation from a virtual address to a physical address
>>> + * is a direct mapping, i.e. the same value.
>>> + */
>> I guess - that description applicable for iova=va mode
>> and for iova=pa mode - Need to do explicit virt2phy translation.
>> I believe you mis-wrote - s/physical addressing mode/virtual addressing mode.
> Not sure to understand your comment.
> Let me reword the description to be less ambiguous:
>
> * When the physical addressing mode (IOVA as PA) is in use,
> * the translation from an IO virtual address (IOVA) to a physical address
> * is a direct mapping, i.e. the same value.
> * Otherwise, in virtual mode (IOVA as VA), an IOMMU may do the translation.
>
> Is this description correct?
>
Yes.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 02/15] mem: introduce IOVA type
2017-11-06 8:51 ` santosh
@ 2017-11-06 9:08 ` Thomas Monjalon
0 siblings, 0 replies; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 9:08 UTC (permalink / raw)
To: santosh; +Cc: olivier.matz, sergio.gonzalez.monroy, anatoly.burakov, dev
06/11/2017 09:51, santosh:
>
> On Monday 06 November 2017 02:07 PM, Thomas Monjalon wrote:
> > 06/11/2017 06:38, santosh:
> >> On Monday 06 November 2017 07:11 AM, Thomas Monjalon wrote:
> >>> The IO virtual addresses may be used instead of physical addresses.
> >>> As IOVA is more generic, it should be used in most places instead
> >>> of physical address wording.
> >>>
> >>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> >>> ---
> >>> +/**
> >>> + * IO virtual address type.
> >>> + * When the physical addressing mode is in use,
> >>> + * the translation from a virtual address to a physical address
> >>> + * is a direct mapping, i.e. the same value.
> >>> + */
> >> I guess - that description applicable for iova=va mode
> >> and for iova=pa mode - Need to do explicit virt2phy translation.
> >> I believe you mis-wrote - s/physical addressing mode/virtual addressing mode.
> > Not sure to understand your comment.
> > Let me reword the description to be less ambiguous:
> >
> > * When the physical addressing mode (IOVA as PA) is in use,
> > * the translation from an IO virtual address (IOVA) to a physical address
> > * is a direct mapping, i.e. the same value.
> > * Otherwise, in virtual mode (IOVA as VA), an IOMMU may do the translation.
> >
> > Is this description correct?
> >
> Yes.
Good, so I can change the description with this one
and add your ack, right?
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 08/15] mempool: rename addresses from physical to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 08/15] mempool: rename addresses " Thomas Monjalon
2017-11-06 5:52 ` santosh
@ 2017-11-06 15:44 ` Olivier MATZ
1 sibling, 0 replies; 91+ messages in thread
From: Olivier MATZ @ 2017-11-06 15:44 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Santosh Shukla, sergio.gonzalez.monroy, anatoly.burakov, dev
On Mon, Nov 06, 2017 at 02:41:34AM +0100, Thomas Monjalon wrote:
> The struct fields phys_addr_t rte_mempool_objhdr.physaddr and
> rte_mempool_memhdr.phys_addr are renamed to rte_iova_t iova.
> The deprecated names are kept in an anonymous union to avoid breaking
> the API.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 09/15] mempool: rename address mapping function to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 09/15] mempool: rename address mapping function " Thomas Monjalon
2017-11-06 5:54 ` santosh
@ 2017-11-06 15:44 ` Olivier MATZ
1 sibling, 0 replies; 91+ messages in thread
From: Olivier MATZ @ 2017-11-06 15:44 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Santosh Shukla, sergio.gonzalez.monroy, anatoly.burakov, dev
On Mon, Nov 06, 2017 at 02:41:35AM +0100, Thomas Monjalon wrote:
> The function rte_mempool_virt2phy() is renamed to rte_mempool_virt2iova().
> The new function has one less parameter because it is unused.
> The deprecated function is kept as an alias to avoid breaking the API.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 10/15] mempool: rename populate functions to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 10/15] mempool: rename populate functions " Thomas Monjalon
@ 2017-11-06 15:49 ` Olivier MATZ
2017-11-06 15:58 ` Thomas Monjalon
0 siblings, 1 reply; 91+ messages in thread
From: Olivier MATZ @ 2017-11-06 15:49 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Santosh Shukla, sergio.gonzalez.monroy, anatoly.burakov, dev
On Mon, Nov 06, 2017 at 02:41:36AM +0100, Thomas Monjalon wrote:
> The functions rte_mempool_populate_phys() and
> rte_mempool_populate_phys_tab() are renamed to
> rte_mempool_populate_iova() and rte_mempool_populate_iova_tab().
> The deprecated functions are kept as aliases to avoid breaking the API.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
I agree with the changes of that patch too.
However, after the patches, few references to phys address still
remain in rte_mempool.h. Some examples below:
/** Mempool over one chunk of physically continuous memory */
#define MEMPOOL_PG_NUM_DEFAULT 1
...
* The memory chunks where objects are stored. Each chunk is virtually
* and physically contiguous.
...
#define MEMPOOL_F_NO_PHYS_CONTIG 0x0020 /**< Don't need physically contiguous objs. */
/**
* This capability flag is advertised by a mempool handler, if the whole
* memory area containing the objects must be physically contiguous.
* Note: This flag should not be passed by application.
*/
#define MEMPOOL_F_CAPA_PHYS_CONTIG 0x0040
...
* - Mempool driver must also set MEMPOOL_F_CAPA_PHYS_CONTIG flag along with
* MEMPOOL_F_CAPA_BLK_ALIGNED_OBJECTS.
...
* - Otherwise, rte_mempool_populate_phys fails thus pool create fails.
...
* - MEMPOOL_F_NO_PHYS_CONTIG: If set, allocated objects won't
* necessarily be contiguous in physical memory.
...
...
I think we should also change them to IO.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 11/15] mbuf: rename physical address to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 11/15] mbuf: rename physical address " Thomas Monjalon
@ 2017-11-06 15:52 ` Olivier MATZ
2017-11-06 16:00 ` Thomas Monjalon
0 siblings, 1 reply; 91+ messages in thread
From: Olivier MATZ @ 2017-11-06 15:52 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Santosh Shukla, sergio.gonzalez.monroy, anatoly.burakov, dev
On Mon, Nov 06, 2017 at 02:41:37AM +0100, Thomas Monjalon wrote:
> From: Santosh Shukla <santosh.shukla@caviumnetworks.com>
>
> Rename buf_physaddr to buf_iova.
> Keep the deprecated name in an anonymous union to avoid breaking
> the API.
>
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Just be aware that I still see some references to ->buf_physaddr.
$ git grep buf_physaddr
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c: op->sym->aead.digest.phys_addr = mbuf->buf_physaddr;
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c: mbuf->buf_physaddr = (uint64_t)op;
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c: op = (struct rte_crypto_op *)mbuf->buf_physaddr;
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c: mbuf->buf_physaddr = op->sym->aead.digest.phys_addr;
drivers/crypto/dpaa_sec/dpaa_sec.c: src_start_addr = sym->m_src->buf_physaddr + sym->m_src->data_off;
drivers/crypto/dpaa_sec/dpaa_sec.c: dst_start_addr = sym->m_dst->buf_physaddr + sym->m_dst->data_off;
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h: uint64_t buf_physaddr;
lib/librte_eal/linuxapp/kni/kni_net.c: (unsigned long)m->buf_physaddr);
lib/librte_eal/linuxapp/kni/kni_net.c: return phys_to_virt(m->buf_physaddr + m->data_off);
lib/librte_eal/linuxapp/kni/kni_net.c: (unsigned long)m->buf_physaddr));
lib/librte_mbuf/rte_mbuf.h: rte_iova_t buf_physaddr; /**< deprecated */
Apart from that,
Acked-by: Olivier Matz <olivier.matz@6wind.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 12/15] mbuf: rename data address helpers to IOVA
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 12/15] mbuf: rename data address helpers " Thomas Monjalon
@ 2017-11-06 15:56 ` Olivier MATZ
2017-11-06 16:03 ` Thomas Monjalon
0 siblings, 1 reply; 91+ messages in thread
From: Olivier MATZ @ 2017-11-06 15:56 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Santosh Shukla, sergio.gonzalez.monroy, anatoly.burakov, dev
On Mon, Nov 06, 2017 at 02:41:38AM +0100, Thomas Monjalon wrote:
> The following inline functions and macros have been renamed to be
> consistent with the IOVA wording:
>
> rte_mbuf_data_dma_addr -> rte_mbuf_data_iova
> rte_mbuf_data_dma_addr_default -> rte_mbuf_data_iova_default
> rte_pktmbuf_mtophys -> rte_pktmbuf_iova
> rte_pktmbuf_mtophys_offset -> rte_pktmbuf_iova_offset
>
> The deprecated functions and macros are kept to avoid breaking the API.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Same here, there are some remaining references after I apply the patches
(maybe we are not on the same base commit id).
$ git grep 'mbuf.*phys'
...
lib/librte_mbuf/rte_mbuf.c: fprintf(f, "dump mbuf at %p, phys=%"PRIx64", buf_len=%u\n",
...
test/test/test_cryptodev.h:pktmbuf_mtophys_offset(struct rte_mbuf *mbuf, int offset) {
test/test/test_cryptodev.h: printf("pktmbuf_mtophys_offset: offset out of buffer\n");
test/test/test_cryptodev_blockcipher.c: pktmbuf_mtophys_offset(iobuf,
test/test/test_cryptodev_blockcipher.c: pktmbuf_mtophys_offset(sym_op->m_src,
Apart from that,
Acked-by: Olivier Matz <olivier.matz@6wind.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 10/15] mempool: rename populate functions to IOVA
2017-11-06 15:49 ` Olivier MATZ
@ 2017-11-06 15:58 ` Thomas Monjalon
2017-11-06 16:39 ` Olivier MATZ
0 siblings, 1 reply; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 15:58 UTC (permalink / raw)
To: Olivier MATZ; +Cc: Santosh Shukla, sergio.gonzalez.monroy, anatoly.burakov, dev
06/11/2017 16:49, Olivier MATZ:
> On Mon, Nov 06, 2017 at 02:41:36AM +0100, Thomas Monjalon wrote:
> > The functions rte_mempool_populate_phys() and
> > rte_mempool_populate_phys_tab() are renamed to
> > rte_mempool_populate_iova() and rte_mempool_populate_iova_tab().
> > The deprecated functions are kept as aliases to avoid breaking the API.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>
> I agree with the changes of that patch too.
> However, after the patches, few references to phys address still
> remain in rte_mempool.h. Some examples below:
>
> /** Mempool over one chunk of physically continuous memory */
> #define MEMPOOL_PG_NUM_DEFAULT 1
> ...
> * The memory chunks where objects are stored. Each chunk is virtually
> * and physically contiguous.
> ...
> #define MEMPOOL_F_NO_PHYS_CONTIG 0x0020 /**< Don't need physically contiguous objs. */
> /**
> * This capability flag is advertised by a mempool handler, if the whole
> * memory area containing the objects must be physically contiguous.
> * Note: This flag should not be passed by application.
> */
> #define MEMPOOL_F_CAPA_PHYS_CONTIG 0x0040
> ...
> * - Mempool driver must also set MEMPOOL_F_CAPA_PHYS_CONTIG flag along with
> * MEMPOOL_F_CAPA_BLK_ALIGNED_OBJECTS.
> ...
> * - Otherwise, rte_mempool_populate_phys fails thus pool create fails.
> ...
> * - MEMPOOL_F_NO_PHYS_CONTIG: If set, allocated objects won't
> * necessarily be contiguous in physical memory.
> ...
> ...
>
> I think we should also change them to IO.
Yes I did not change them because I was not sure how to word it.
Feel free to send a patch for the flags and few other doxygen comments.
Thanks
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 11/15] mbuf: rename physical address to IOVA
2017-11-06 15:52 ` Olivier MATZ
@ 2017-11-06 16:00 ` Thomas Monjalon
0 siblings, 0 replies; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 16:00 UTC (permalink / raw)
To: Olivier MATZ
Cc: Santosh Shukla, sergio.gonzalez.monroy, anatoly.burakov, dev,
hemant.agrawal, shreyansh.jain
06/11/2017 16:52, Olivier MATZ:
> On Mon, Nov 06, 2017 at 02:41:37AM +0100, Thomas Monjalon wrote:
> > From: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> >
> > Rename buf_physaddr to buf_iova.
> > Keep the deprecated name in an anonymous union to avoid breaking
> > the API.
> >
> > Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> > Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>
> Just be aware that I still see some references to ->buf_physaddr.
>
> $ git grep buf_physaddr
> drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c: op->sym->aead.digest.phys_addr = mbuf->buf_physaddr;
> drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c: mbuf->buf_physaddr = (uint64_t)op;
> drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c: op = (struct rte_crypto_op *)mbuf->buf_physaddr;
> drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c: mbuf->buf_physaddr = op->sym->aead.digest.phys_addr;
> drivers/crypto/dpaa_sec/dpaa_sec.c: src_start_addr = sym->m_src->buf_physaddr + sym->m_src->data_off;
> drivers/crypto/dpaa_sec/dpaa_sec.c: dst_start_addr = sym->m_dst->buf_physaddr + sym->m_dst->data_off;
> lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h: uint64_t buf_physaddr;
> lib/librte_eal/linuxapp/kni/kni_net.c: (unsigned long)m->buf_physaddr);
> lib/librte_eal/linuxapp/kni/kni_net.c: return phys_to_virt(m->buf_physaddr + m->data_off);
> lib/librte_eal/linuxapp/kni/kni_net.c: (unsigned long)m->buf_physaddr));
> lib/librte_mbuf/rte_mbuf.h: rte_iova_t buf_physaddr; /**< deprecated */
Yes, it is on purpose.
KNI is known to work only with physical addresses for now.
I am not sure about NXP buses, but I had the feeling that it deserves a
separate work.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 12/15] mbuf: rename data address helpers to IOVA
2017-11-06 15:56 ` Olivier MATZ
@ 2017-11-06 16:03 ` Thomas Monjalon
0 siblings, 0 replies; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 16:03 UTC (permalink / raw)
To: Olivier MATZ; +Cc: Santosh Shukla, sergio.gonzalez.monroy, anatoly.burakov, dev
06/11/2017 16:56, Olivier MATZ:
> On Mon, Nov 06, 2017 at 02:41:38AM +0100, Thomas Monjalon wrote:
> > The following inline functions and macros have been renamed to be
> > consistent with the IOVA wording:
> >
> > rte_mbuf_data_dma_addr -> rte_mbuf_data_iova
> > rte_mbuf_data_dma_addr_default -> rte_mbuf_data_iova_default
> > rte_pktmbuf_mtophys -> rte_pktmbuf_iova
> > rte_pktmbuf_mtophys_offset -> rte_pktmbuf_iova_offset
> >
> > The deprecated functions and macros are kept to avoid breaking the API.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>
> Same here, there are some remaining references after I apply the patches
> (maybe we are not on the same base commit id).
>
> $ git grep 'mbuf.*phys'
> ...
> lib/librte_mbuf/rte_mbuf.c: fprintf(f, "dump mbuf at %p, phys=%"PRIx64", buf_len=%u\n",
> ...
> test/test/test_cryptodev.h:pktmbuf_mtophys_offset(struct rte_mbuf *mbuf, int offset) {
> test/test/test_cryptodev.h: printf("pktmbuf_mtophys_offset: offset out of buffer\n");
> test/test/test_cryptodev_blockcipher.c: pktmbuf_mtophys_offset(iobuf,
> test/test/test_cryptodev_blockcipher.c: pktmbuf_mtophys_offset(sym_op->m_src,
You are right.
I will fix those occurences.
Thanks for the review.
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 10/15] mempool: rename populate functions to IOVA
2017-11-06 15:58 ` Thomas Monjalon
@ 2017-11-06 16:39 ` Olivier MATZ
0 siblings, 0 replies; 91+ messages in thread
From: Olivier MATZ @ 2017-11-06 16:39 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Santosh Shukla, sergio.gonzalez.monroy, anatoly.burakov, dev
On Mon, Nov 06, 2017 at 04:58:13PM +0100, Thomas Monjalon wrote:
> 06/11/2017 16:49, Olivier MATZ:
> > On Mon, Nov 06, 2017 at 02:41:36AM +0100, Thomas Monjalon wrote:
> > > The functions rte_mempool_populate_phys() and
> > > rte_mempool_populate_phys_tab() are renamed to
> > > rte_mempool_populate_iova() and rte_mempool_populate_iova_tab().
> > > The deprecated functions are kept as aliases to avoid breaking the API.
> > >
> > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> >
> > I agree with the changes of that patch too.
> > However, after the patches, few references to phys address still
> > remain in rte_mempool.h. Some examples below:
> >
> > /** Mempool over one chunk of physically continuous memory */
> > #define MEMPOOL_PG_NUM_DEFAULT 1
> > ...
> > * The memory chunks where objects are stored. Each chunk is virtually
> > * and physically contiguous.
> > ...
> > #define MEMPOOL_F_NO_PHYS_CONTIG 0x0020 /**< Don't need physically contiguous objs. */
> > /**
> > * This capability flag is advertised by a mempool handler, if the whole
> > * memory area containing the objects must be physically contiguous.
> > * Note: This flag should not be passed by application.
> > */
> > #define MEMPOOL_F_CAPA_PHYS_CONTIG 0x0040
> > ...
> > * - Mempool driver must also set MEMPOOL_F_CAPA_PHYS_CONTIG flag along with
> > * MEMPOOL_F_CAPA_BLK_ALIGNED_OBJECTS.
> > ...
> > * - Otherwise, rte_mempool_populate_phys fails thus pool create fails.
> > ...
> > * - MEMPOOL_F_NO_PHYS_CONTIG: If set, allocated objects won't
> > * necessarily be contiguous in physical memory.
> > ...
> > ...
> >
> > I think we should also change them to IO.
>
> Yes I did not change them because I was not sure how to word it.
> Feel free to send a patch for the flags and few other doxygen comments.
Ok, we can do it in another iteration.
Thanks for the rework.
Acked-by: Olivier Matz <olivier.matz@6wind.com>
^ permalink raw reply [flat|nested] 91+ messages in thread
* Re: [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
` (14 preceding siblings ...)
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 15/15] doc: add IOVA aware API changes in release notes Thomas Monjalon
@ 2017-11-06 22:48 ` Thomas Monjalon
15 siblings, 0 replies; 91+ messages in thread
From: Thomas Monjalon @ 2017-11-06 22:48 UTC (permalink / raw)
To: Santosh Shukla, olivier.matz; +Cc: dev, sergio.gonzalez.monroy, anatoly.burakov
06/11/2017 02:41, Thomas Monjalon:
> Santosh Shukla (5):
> mem: rename segment address from physical to IOVA
> malloc: use pointer diff macro in IOVA mapping
> mbuf: rename physical address to IOVA
> cryptodev: rename physical address type to IOVA
> drivers/net: rename physical address type to IOVA
>
> Thomas Monjalon (10):
> mem: hide physical address error in VA mode
> mem: introduce IOVA type
> mem: rename address mapping function to IOVA
> malloc: rename address mapping function to IOVA
> memzone: rename address from physical to IOVA
> mempool: rename addresses from physical to IOVA
> mempool: rename address mapping function to IOVA
> mempool: rename populate functions to IOVA
> mbuf: rename data address helpers to IOVA
> doc: add IOVA aware API changes in release notes
Applied with suggested fixes
^ permalink raw reply [flat|nested] 91+ messages in thread
end of thread, other threads:[~2017-11-06 22:48 UTC | newest]
Thread overview: 91+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-14 15:15 [dpdk-dev] [PATCH v1 0/4] make dpdk iova aware Santosh Shukla
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 1/4] eal: rename phys_addr_t to iova_addr_t Santosh Shukla
2017-09-18 14:06 ` Burakov, Anatoly
2017-09-18 14:31 ` santosh
2017-09-18 14:32 ` Burakov, Anatoly
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 2/4] eal/memory: rename buf_physaddr to buf_iovaaddr Santosh Shukla
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 3/4] eal/memory: rename memory translational api to _iova types Santosh Shukla
2017-08-14 15:15 ` [dpdk-dev] [PATCH v1 4/4] doc: remove dpdk iova aware notice Santosh Shukla
2017-09-18 18:44 ` Mcnamara, John
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Santosh Shukla
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 1/5] eal: rename phys_addr_t to iova_addr_t Santosh Shukla
2017-09-18 15:19 ` Burakov, Anatoly
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 2/5] eal/memory: rename buf_physaddr to buf_iovaaddr Santosh Shukla
2017-09-18 15:20 ` Burakov, Anatoly
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 3/5] eal/memory: rename memseg member phys to iova addr Santosh Shukla
2017-09-18 15:04 ` Burakov, Anatoly
2017-09-18 15:08 ` santosh
2017-09-18 15:11 ` Burakov, Anatoly
2017-09-18 15:21 ` Burakov, Anatoly
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 4/5] eal/memory: rename memory api to iova types Santosh Shukla
2017-09-05 10:31 ` [dpdk-dev] [PATCH v2 5/5] doc: remove dpdk iova aware notice Santosh Shukla
2017-09-19 13:38 ` Mcnamara, John
2017-10-17 13:31 ` [dpdk-dev] [PATCH v2 0/5] make dpdk iova aware Thomas Monjalon
2017-10-17 14:12 ` santosh
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 0/6] " Santosh Shukla
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 1/6] eal: rename phys addr to iova addr Santosh Shukla
2017-10-23 20:32 ` Thomas Monjalon
2017-10-24 5:16 ` santosh
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 2/6] eal/memory: rename buf physaddr to buf iovaaddr Santosh Shukla
2017-10-23 20:15 ` Thomas Monjalon
2017-10-25 9:55 ` Olivier MATZ
2017-10-23 20:34 ` Thomas Monjalon
2017-10-24 5:17 ` santosh
2017-10-25 9:44 ` Olivier MATZ
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 3/6] eal/memory: rename memseg member phys to iova addr Santosh Shukla
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 4/6] eal/memory: rename memory API to iova types Santosh Shukla
2017-11-03 11:11 ` Thomas Monjalon
2017-11-03 11:35 ` santosh
2017-11-03 13:58 ` Thomas Monjalon
2017-11-03 15:22 ` [dpdk-dev] [PATCH v3 4/6] eal/memory: rename memory API to iovatypes Jonas Pfefferle1
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 5/6] doc: remove dpdk iova aware notice Santosh Shukla
2017-10-23 20:29 ` Thomas Monjalon
2017-10-24 5:06 ` santosh
2017-10-25 9:45 ` Thomas Monjalon
2017-10-25 9:50 ` Richardson, Bruce
2017-10-25 10:01 ` Thomas Monjalon
2017-10-25 10:05 ` Bruce Richardson
2017-10-25 10:12 ` Thomas Monjalon
2017-10-25 10:32 ` Bruce Richardson
2017-10-20 12:31 ` [dpdk-dev] [PATCH v3 6/6] eal/common/rte_malloc: use pointer diff in virt2iova Santosh Shukla
2017-10-23 14:58 ` [dpdk-dev] [PATCH v3 0/6] make dpdk iova aware Thomas Monjalon
2017-10-24 5:12 ` santosh
2017-10-24 7:38 ` Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 01/15] mem: hide physical address error in VA mode Thomas Monjalon
2017-11-06 5:39 ` santosh
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 02/15] mem: introduce IOVA type Thomas Monjalon
2017-11-06 5:38 ` santosh
2017-11-06 8:37 ` Thomas Monjalon
2017-11-06 8:51 ` santosh
2017-11-06 9:08 ` Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 03/15] mem: rename segment address from physical to IOVA Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 04/15] mem: rename address mapping function " Thomas Monjalon
2017-11-06 5:41 ` santosh
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 05/15] malloc: " Thomas Monjalon
2017-11-06 5:47 ` santosh
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 06/15] malloc: use pointer diff macro in IOVA mapping Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 07/15] memzone: rename address from physical to IOVA Thomas Monjalon
2017-11-06 5:50 ` santosh
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 08/15] mempool: rename addresses " Thomas Monjalon
2017-11-06 5:52 ` santosh
2017-11-06 15:44 ` Olivier MATZ
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 09/15] mempool: rename address mapping function " Thomas Monjalon
2017-11-06 5:54 ` santosh
2017-11-06 15:44 ` Olivier MATZ
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 10/15] mempool: rename populate functions " Thomas Monjalon
2017-11-06 15:49 ` Olivier MATZ
2017-11-06 15:58 ` Thomas Monjalon
2017-11-06 16:39 ` Olivier MATZ
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 11/15] mbuf: rename physical address " Thomas Monjalon
2017-11-06 15:52 ` Olivier MATZ
2017-11-06 16:00 ` Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 12/15] mbuf: rename data address helpers " Thomas Monjalon
2017-11-06 15:56 ` Olivier MATZ
2017-11-06 16:03 ` Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 13/15] cryptodev: rename physical address type " Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 14/15] drivers/net: " Thomas Monjalon
2017-11-06 1:41 ` [dpdk-dev] [PATCH v4 15/15] doc: add IOVA aware API changes in release notes Thomas Monjalon
2017-11-06 5:56 ` santosh
2017-11-06 8:50 ` Mcnamara, John
2017-11-06 22:48 ` [dpdk-dev] [PATCH v4 00/15] make DPDK IOVA aware Thomas Monjalon
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).