From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 358AEA04BC; Thu, 17 Sep 2020 12:41:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 85A591D5F3; Thu, 17 Sep 2020 12:41:46 +0200 (CEST) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by dpdk.org (Postfix) with ESMTP id C03CB1D5F2 for ; Thu, 17 Sep 2020 12:41:45 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id 4C3035801A0; Thu, 17 Sep 2020 06:41:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Thu, 17 Sep 2020 06:41:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=CG9aQVtoWy3Cq 3Ighg+1WOkiLPmwx9T917a78OsRae8=; b=k22PA5na+pAOnCwY/lcMyNkJw6meC d1Av68Ir+GL94k6mbcLlMrguONTdevPM5AMrG1167mWVJofjp20PLCiU7F7Vnfw8 2IV1pE3v5MleWjcqEpLMwUwJITkhlxqdk2ALIHo5/rANud0F3b9BT47SUOLd5Z5m x41DmDbXIfvi38DSHlcqiYdsvmEBfoeLRJHi/O71voETe1A4xBASFMsp4Oh3Egmp /V7at7Guxuqq7wCcu8qy2Pem0vfPBu10oe2bvYjt7I2vp2EMoHCOqaiAqnmHYSF4 Qr4bWtm8GnXh37/ss3f4fPM6ZSYc/XN/vx37hSnNo6jjG+WGDhpITnwOA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=CG9aQVtoWy3Cq3Ighg+1WOkiLPmwx9T917a78OsRae8=; b=qAPDuQlN Lfp6jStVteigJFYO7yrh2fHVVAVoaMfbN54qLRNXg7pYC9vUJfW7b44kTwxuhoyz SCkPqHjukbtx8sZmd2b6xDc6HdO+lzEL9Nu9oevj1Nu7/q4Tc1aHP/oMdQGePh+v m58OO/QKnywh6v25xOWNs4koKb5ZMzRlKzBIJmhRKho4YwLxSYLdIb2otzsUmrS7 R3uSM5dmPECahGRBlZh/SER0/04qQi+4DuVP2qe+i5znx2rdRkj27zWsV/vnJw0T DCrLtN/vOla+kHcJPToMFms7um+ZvcUW+JOp/VXpqTFuPL48iqWVUsg1Mze4bE+S UukMqKZRXrzgyA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrtdeggdefvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepudenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 57E42306467D; Thu, 17 Sep 2020 06:41:42 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com, mdr@ashroe.eu, Andrew Rybchenko , Anatoly Burakov , John McNamara , Marko Kovacevic , Hemant Agrawal , Sachin Saxena , Fiona Trahe , Ashish Gupta , Somalapuram Amaranath , Anoob Joseph , Jay Zhou , Qiming Yang , Qi Zhang , Gagandeep Singh , Akhil Goyal , Ferruh Yigit Date: Thu, 17 Sep 2020 12:41:30 +0200 Message-Id: <20200917104133.6186-2-thomas@monjalon.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200917104133.6186-1-thomas@monjalon.net> References: <20200914161801.572174-1-thomas@monjalon.net> <20200917104133.6186-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 1/4] mem: remove physical address aliases X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Remove the deprecated unioned fields phys_addr from the structures rte_memseg and rte_memzone. They are replaced with the fields iova which are at the same offsets. Signed-off-by: Thomas Monjalon Acked-by: Andrew Rybchenko Acked-by: Anatoly Burakov --- doc/guides/rel_notes/release_20_11.rst | 4 ++++ drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 +- drivers/common/dpaax/dpaax_iova_table.c | 2 +- drivers/compress/qat/qat_comp.c | 2 +- drivers/compress/qat/qat_comp_pmd.c | 2 +- drivers/crypto/ccp/ccp_dev.c | 2 +- drivers/crypto/octeontx/otx_cryptodev_hw_access.c | 2 +- drivers/crypto/virtio/virtio_cryptodev.c | 6 +++--- drivers/net/ice/base/ice_osdep.h | 2 +- drivers/net/pfe/base/pfe.h | 2 +- lib/librte_eal/include/rte_memory.h | 6 +----- lib/librte_eal/include/rte_memzone.h | 6 +----- lib/librte_kni/rte_kni.c | 14 +++++++------- 13 files changed, 24 insertions(+), 28 deletions(-) diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index b729bdf200..c49e612c43 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -84,6 +84,10 @@ API Changes Also, make sure to start the actual text at the margin. ======================================================= +* mem: Removed the unioned field ``phys_addr`` from + the structures ``rte_memseg`` and ``rte_memzone``. + The field ``iova`` is remaining from the old unions. + * mbuf: Removed the unioned field ``refcnt_atomic`` from the structures ``rte_mbuf`` and ``rte_mbuf_ext_shared_info``. The field ``refcnt`` is remaining from the old unions. diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 35423df12b..2dd53c63ba 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -368,7 +368,7 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr) memseg = rte_mem_virt2memseg((void *)(uintptr_t)vaddr, NULL); if (memseg) - return memseg->phys_addr + RTE_PTR_DIFF(vaddr, memseg->addr); + return memseg->iova + RTE_PTR_DIFF(vaddr, memseg->addr); return (size_t)NULL; } diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c index 5ba8ed1933..91bee65e7b 100644 --- a/drivers/common/dpaax/dpaax_iova_table.c +++ b/drivers/common/dpaax/dpaax_iova_table.c @@ -440,7 +440,7 @@ dpaax_memevent_walk_memsegs(const struct rte_memseg_list *msl __rte_unused, void *arg __rte_unused) { DPAAX_DEBUG("Walking for %p (pa=%"PRIu64") and len %zu", - ms->addr, ms->phys_addr, len); + ms->addr, ms->iova, len); dpaax_iova_table_update(rte_mem_virt2phy(ms->addr), ms->addr, len); return 0; } diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c index 9e1fd2fe91..335fd63b98 100644 --- a/drivers/compress/qat/qat_comp.c +++ b/drivers/compress/qat/qat_comp.c @@ -957,7 +957,7 @@ static int qat_comp_create_templates(struct qat_comp_xform *qat_xform, ICP_QAT_FW_SLICE_XLAT); comp_req->u1.xlt_pars.inter_buff_ptr = - interm_buff_mz->phys_addr; + interm_buff_mz->iova; } #if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c index 311e561685..18ecb34ba7 100644 --- a/drivers/compress/qat/qat_comp_pmd.c +++ b/drivers/compress/qat/qat_comp_pmd.c @@ -242,7 +242,7 @@ qat_comp_setup_inter_buffers(struct qat_comp_dev_private *comp_dev, } mz_start = (uint8_t *)memzone->addr; - mz_start_phys = memzone->phys_addr; + mz_start_phys = memzone->iova; QAT_LOG(DEBUG, "Memzone %s: addr = %p, phys = 0x%"PRIx64 ", size required %d, size created %zu", inter_buff_mz_name, mz_start, mz_start_phys, diff --git a/drivers/crypto/ccp/ccp_dev.c b/drivers/crypto/ccp/ccp_dev.c index 7d98b2eb25..664ddc1747 100644 --- a/drivers/crypto/ccp/ccp_dev.c +++ b/drivers/crypto/ccp/ccp_dev.c @@ -546,7 +546,7 @@ ccp_add_device(struct ccp_device *dev, int type) cmd_q->qsize, SOCKET_ID_ANY); cmd_q->qbase_addr = (void *)q_mz->addr; cmd_q->qbase_desc = (void *)q_mz->addr; - cmd_q->qbase_phys_addr = q_mz->phys_addr; + cmd_q->qbase_phys_addr = q_mz->iova; cmd_q->qcontrol = 0; /* init control reg to zero */ diff --git a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c index ce546c2ffe..ee36b0183e 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c +++ b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c @@ -556,7 +556,7 @@ otx_cpt_get_resource(const struct rte_cryptodev *dev, uint8_t group, } mem = rz->addr; - dma_addr = rz->phys_addr; + dma_addr = rz->iova; alloc_len = len; memset(mem, 0, len); diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c index 31a5f1072a..1822f21744 100644 --- a/drivers/crypto/virtio/virtio_cryptodev.c +++ b/drivers/crypto/virtio/virtio_cryptodev.c @@ -411,7 +411,7 @@ virtio_crypto_queue_setup(struct rte_cryptodev *dev, * and only accepts 32 bit page frame number. * Check if the allocated physical memory exceeds 16TB. */ - if ((mz->phys_addr + vq->vq_ring_size - 1) + if ((mz->iova + vq->vq_ring_size - 1) >> (VIRTIO_PCI_QUEUE_ADDR_SHIFT + 32)) { VIRTIO_CRYPTO_INIT_LOG_ERR("vring address shouldn't be " "above 16TB!"); @@ -420,10 +420,10 @@ virtio_crypto_queue_setup(struct rte_cryptodev *dev, memset(mz->addr, 0, sizeof(mz->len)); vq->mz = mz; - vq->vq_ring_mem = mz->phys_addr; + vq->vq_ring_mem = mz->iova; vq->vq_ring_virt_mem = mz->addr; VIRTIO_CRYPTO_INIT_LOG_DBG("vq->vq_ring_mem(physical): 0x%"PRIx64, - (uint64_t)mz->phys_addr); + (uint64_t)mz->iova); VIRTIO_CRYPTO_INIT_LOG_DBG("vq->vq_ring_virt_mem: 0x%"PRIx64, (uint64_t)(uintptr_t)mz->addr); diff --git a/drivers/net/ice/base/ice_osdep.h b/drivers/net/ice/base/ice_osdep.h index 360e435b8d..9a170b5143 100644 --- a/drivers/net/ice/base/ice_osdep.h +++ b/drivers/net/ice/base/ice_osdep.h @@ -258,7 +258,7 @@ ice_alloc_dma_mem(__rte_unused struct ice_hw *hw, mem->size = size; mem->va = mz->addr; - mem->pa = mz->phys_addr; + mem->pa = mz->iova; mem->zone = (const void *)mz; PMD_DRV_LOG(DEBUG, "memzone %s allocated with physical address: " "%"PRIu64, mz->name, mem->pa); diff --git a/drivers/net/pfe/base/pfe.h b/drivers/net/pfe/base/pfe.h index 72741ba4a8..0a88e98c1b 100644 --- a/drivers/net/pfe/base/pfe.h +++ b/drivers/net/pfe/base/pfe.h @@ -414,7 +414,7 @@ static inline phys_addr_t pfe_mem_vtop(uint64_t vaddr) memseg = rte_mem_virt2memseg((void *)(uintptr_t)vaddr, NULL); if (memseg) - return memseg->phys_addr + RTE_PTR_DIFF(vaddr, memseg->addr); + return memseg->iova + RTE_PTR_DIFF(vaddr, memseg->addr); return (size_t)NULL; } diff --git a/lib/librte_eal/include/rte_memory.h b/lib/librte_eal/include/rte_memory.h index 65374d53a3..bba9b5300a 100644 --- a/lib/librte_eal/include/rte_memory.h +++ b/lib/librte_eal/include/rte_memory.h @@ -43,11 +43,7 @@ extern "C" { #define RTE_MEMSEG_FLAG_DO_NOT_FREE (1 << 0) /**< Prevent this segment from being freed back to the OS. */ struct rte_memseg { - RTE_STD_C11 - union { - phys_addr_t phys_addr; /**< deprecated - Start physical address. */ - rte_iova_t iova; /**< Start IO address. */ - }; + rte_iova_t iova; /**< Start IO address. */ RTE_STD_C11 union { void *addr; /**< Start virtual address. */ diff --git a/lib/librte_eal/include/rte_memzone.h b/lib/librte_eal/include/rte_memzone.h index 091c9522f7..5db1210831 100644 --- a/lib/librte_eal/include/rte_memzone.h +++ b/lib/librte_eal/include/rte_memzone.h @@ -51,11 +51,7 @@ struct rte_memzone { #define RTE_MEMZONE_NAMESIZE 32 /**< Maximum length of memory zone name.*/ char name[RTE_MEMZONE_NAMESIZE]; /**< Name of the memory zone. */ - RTE_STD_C11 - union { - phys_addr_t phys_addr; /**< deprecated - Start physical address. */ - rte_iova_t iova; /**< Start IO address. */ - }; + rte_iova_t iova; /**< Start IO address. */ RTE_STD_C11 union { void *addr; /**< Start virtual address. */ diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index bcf82cc2d5..837d0217d2 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -276,37 +276,37 @@ rte_kni_alloc(struct rte_mempool *pktmbuf_pool, /* TX RING */ kni->tx_q = kni->m_tx_q->addr; kni_fifo_init(kni->tx_q, KNI_FIFO_COUNT_MAX); - dev_info.tx_phys = kni->m_tx_q->phys_addr; + dev_info.tx_phys = kni->m_tx_q->iova; /* RX RING */ kni->rx_q = kni->m_rx_q->addr; kni_fifo_init(kni->rx_q, KNI_FIFO_COUNT_MAX); - dev_info.rx_phys = kni->m_rx_q->phys_addr; + dev_info.rx_phys = kni->m_rx_q->iova; /* ALLOC RING */ kni->alloc_q = kni->m_alloc_q->addr; kni_fifo_init(kni->alloc_q, KNI_FIFO_COUNT_MAX); - dev_info.alloc_phys = kni->m_alloc_q->phys_addr; + dev_info.alloc_phys = kni->m_alloc_q->iova; /* FREE RING */ kni->free_q = kni->m_free_q->addr; kni_fifo_init(kni->free_q, KNI_FIFO_COUNT_MAX); - dev_info.free_phys = kni->m_free_q->phys_addr; + dev_info.free_phys = kni->m_free_q->iova; /* Request RING */ kni->req_q = kni->m_req_q->addr; kni_fifo_init(kni->req_q, KNI_FIFO_COUNT_MAX); - dev_info.req_phys = kni->m_req_q->phys_addr; + dev_info.req_phys = kni->m_req_q->iova; /* Response RING */ kni->resp_q = kni->m_resp_q->addr; kni_fifo_init(kni->resp_q, KNI_FIFO_COUNT_MAX); - dev_info.resp_phys = kni->m_resp_q->phys_addr; + dev_info.resp_phys = kni->m_resp_q->iova; /* Req/Resp sync mem area */ kni->sync_addr = kni->m_sync_addr->addr; dev_info.sync_va = kni->m_sync_addr->addr; - dev_info.sync_phys = kni->m_sync_addr->phys_addr; + dev_info.sync_phys = kni->m_sync_addr->iova; kni->pktmbuf_pool = pktmbuf_pool; kni->group_id = conf->group_id; -- 2.28.0