From patchwork Thu Sep 17 10:41:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 78036 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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 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 Acked-by: Hemant Agrawal Acked-by: Ray Kinsella --- 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; From patchwork Thu Sep 17 10:41:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 78037 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0ABF0A04BC; Thu, 17 Sep 2020 12:42:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2FB121D600; Thu, 17 Sep 2020 12:41:50 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 00C5B1D5F8 for ; Thu, 17 Sep 2020 12:41:48 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 969415C056B; Thu, 17 Sep 2020 06:41:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Thu, 17 Sep 2020 06:41:47 -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=Zbvw9Z3q6bqum S/3d5tlK0zbBVAXR6eUeAMyXpQqe+k=; b=JbxQx5ArxTkdBa+BTJCqm9cqyhmWn Mvws4fwuV0y9BjotNlxilhNyFmKBIuNqtKxTmSZm3su5L9kJt7kk2JcTnKjv4mml NbZVsS6Ma1IrinK1vFzq6tCf83sbLQyIJR+EJXibKoQc3ru4tFh6edqepZGykB4x IV/lSoAF/Af5YWZnNvR6fMT8drty+d488OnaxVi5JdjMd2bM4weeczdfFpOVD4JI TdcVNqsMKsmjfjThWSN/Jn+fQY3VhRV+QiQelx4yWpbrbUrIXy9rJYz8o/JucXda bWcCOvwQATzA60onEhYcaEbv1Rn2CL2jiol2j9wPL566z2AA78JaLvHbw== 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=Zbvw9Z3q6bqumS/3d5tlK0zbBVAXR6eUeAMyXpQqe+k=; b=uOuWVHON ijrNNGRIDg8+LawgWy1ZDaL6ges0yF2zyJHXpppukmILAyD7rPYIznbtU2qRXFoT Ef8RbMG210fX4OBKoOm2qEK2kozRCCdYysincmvN1+3fARy1dup0D1IwWh7FH6NJ DbSVp7XyWOLXpWWplxY6tswSL6p1uCqXpWeV3F7YLNGUPKkr+G5yd+CrP69fJiNw syvbrhOluVuxd9tCLqbUWFpgBFfJETeCwsXcZQFcQXo0rcGCC+ahRCz6yjAmQP3c U2pMyr0xHv1zYMx/z03Jx/UGy2OXp64cfpYGz13MuMYZHrZDQK1xylKM5DoE6EpT fZ1IrF2WMI5o7Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrtdeggdefvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepvdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho 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 55E503064687; Thu, 17 Sep 2020 06:41:46 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com, mdr@ashroe.eu, Andrew Rybchenko , John McNamara , Marko Kovacevic , Olivier Matz Date: Thu, 17 Sep 2020 12:41:31 +0200 Message-Id: <20200917104133.6186-3-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 Subject: [dpdk-dev] [PATCH v2 2/4] mempool: 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 physaddr and phys_addr from the structures rte_mempool_objhdr and rte_mempool_memhdr. They are replaced with the fields iova which are at the same offsets. Remove the deprecated macro MEMPOOL_F_NO_PHYS_CONTIG which is an alias of the more recent MEMPOOL_F_NO_IOVA_CONTIG. Signed-off-by: Thomas Monjalon Acked-by: Andrew Rybchenko Acked-by: Ray Kinsella --- doc/guides/rel_notes/release_20_11.rst | 6 ++++++ lib/librte_mempool/rte_mempool.h | 13 ++----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index c49e612c43..71f970f1ac 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -88,6 +88,12 @@ API Changes the structures ``rte_memseg`` and ``rte_memzone``. The field ``iova`` is remaining from the old unions. +* mempool: Removed the unioned fields ``phys_addr`` and ``physaddr`` from + the structures ``rte_mempool_memhdr`` and ``rte_mempool_objhdr``. + The field ``iova`` is remaining from the old unions. + The flag name ``MEMPOOL_F_NO_PHYS_CONTIG`` is removed, + while the aliased flag ``MEMPOOL_F_NO_IOVA_CONTIG`` is kept. + * 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/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index 6ad7e31170..9ea7ff934c 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -138,11 +138,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. */ - RTE_STD_C11 - union { - rte_iova_t iova; /**< IO address of the object. */ - phys_addr_t physaddr; /**< deprecated - Physical address of the object. */ - }; + rte_iova_t iova; /**< IO address of the object. */ #ifdef RTE_LIBRTE_MEMPOOL_DEBUG uint64_t cookie; /**< Debug cookie. */ #endif @@ -188,11 +184,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 */ - RTE_STD_C11 - union { - rte_iova_t iova; /**< IO address of the chunk */ - phys_addr_t phys_addr; /**< Physical address of the chunk */ - }; + rte_iova_t iova; /**< IO 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 */ @@ -269,7 +261,6 @@ struct rte_mempool { #define MEMPOOL_F_SC_GET 0x0008 /**< Default get is "single-consumer".*/ #define MEMPOOL_F_POOL_CREATED 0x0010 /**< Internal: pool is created. */ #define MEMPOOL_F_NO_IOVA_CONTIG 0x0020 /**< Don't need IOVA contiguous objs. */ -#define MEMPOOL_F_NO_PHYS_CONTIG MEMPOOL_F_NO_IOVA_CONTIG /* deprecated */ /** * @internal When debug is enabled, store some statistics. From patchwork Thu Sep 17 10:41:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 78038 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EE931A04BC; Thu, 17 Sep 2020 12:42:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6C5CD1D5FB; Thu, 17 Sep 2020 12:41:54 +0200 (CEST) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by dpdk.org (Postfix) with ESMTP id 492BA1D5FA for ; Thu, 17 Sep 2020 12:41:52 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id C2813580196; Thu, 17 Sep 2020 06:41:51 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Thu, 17 Sep 2020 06:41:51 -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=S05OijbMpKU0V 9sctXtw/6hvSKZFmP7Q0DXIntUZr6M=; b=X+cHBqPoVTyngjMUOtE1Dh1LEgj2P nKfbvwkdzMvpwW5VW7f34OVF6l2Br8hvIu3R1frRnE4LZ9izFLw+h5yqkF8BR4QN pJKypNunXzgzihIQHhzcdJd7z4m+jlUg0hcaEqJAvI77UKJ/oArznlVP0XUCeUBR ikZ2sygLKJom52IWfpSn6Mh2+8boMTcsjxZbrqBzwHtT/rL458ZqQJoXRQ6SiRVV n2YsFThdt8KMg36U9nPT5dpP916JX1a4rdMCY2KqcMwvbkwIy3fpni9e4b6teQig dwUzUP6gvBBnz5qgY4Qo1N5Vrlw6zjJAInRXBmChharRlHSiSiqw2cSxA== 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=S05OijbMpKU0V9sctXtw/6hvSKZFmP7Q0DXIntUZr6M=; b=KpqzoUPL nbZ/w5yJFtD6MnWxxyGGKnK6Wo8mCb6UUeIK5a3VN4mh2PgfOlNCxd1g4x593yiv esb0AQ4n3/zh7WeVbZiheCNFLHKZeS7ZgvyWF8AevhKINKH+wTTIPda55icPtjku xfwQ/sXab/auKiX8sRxCamo9FbjMMQK4HYYDu6oYF4xwKRiBQVmCdbBkq8IsanxH QKubiMxqHFT/aKzrLEfUEp37DQw6N4qndyZ4xUd9eX8DP2gV4vS7ngGWXBP2Y2sX HShxZHvc2xBJ1Jq5x+7BGJksDmWmyalWy7C4/r25vmdR7x/Eco00wtDxMoovMZpX xJfIRMatxJ4ppg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrtdeggdefvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedukeduhfffjeevjedvhfdvgffhtdevveefheffjeelfedvhedvteeh jeduhffgueenucffohhmrghinhepughighgvshhtrdgurghtrgenucfkphepjeejrddufe egrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth 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 CAE8B3064687; Thu, 17 Sep 2020 06:41:48 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com, mdr@ashroe.eu, Andrew Rybchenko , John McNamara , Marko Kovacevic , Nicolas Chautru , Anoob Joseph , Fiona Trahe , Ashish Gupta , Somalapuram Amaranath , Akhil Goyal , Hemant Agrawal , Nagadheeraj Rottela , Srikanth Jampala , Jay Zhou , Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , Ori Kam , Bruce Richardson , Radu Nicolau , Tomasz Kantecki , Sunil Kumar Kori , Pavan Nikhilesh , Olivier Matz Date: Thu, 17 Sep 2020 12:41:32 +0200 Message-Id: <20200917104133.6186-4-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 Subject: [dpdk-dev] [PATCH v2 3/4] mbuf: remove deprecated function and macro 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 functions - rte_mbuf_data_dma_addr - rte_mbuf_data_dma_addr_default which aliased the more recent functions - rte_mbuf_data_iova - rte_mbuf_data_iova_default Remove the deprecated macros - rte_pktmbuf_mtophys - rte_pktmbuf_mtophys_offset which aliased the more recent macros - rte_pktmbuf_iova - rte_pktmbuf_iova_offset Signed-off-by: Thomas Monjalon Acked-by: Andrew Rybchenko Acked-by: Hemant Agrawal Acked-by: Ray Kinsella --- doc/guides/rel_notes/release_20_11.rst | 5 +++ .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 16 +++---- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 16 +++---- drivers/common/cpt/cpt_ucode.h | 12 +++--- drivers/compress/qat/qat_comp.c | 4 +- drivers/crypto/ccp/ccp_crypto.c | 22 +++++----- drivers/crypto/dpaa_sec/dpaa_sec.c | 42 +++++++++---------- drivers/crypto/nitrox/nitrox_sym_reqmgr.c | 6 +-- drivers/crypto/virtio/virtio_rxtx.c | 6 +-- drivers/net/axgbe/axgbe_rxtx.c | 4 +- drivers/net/octeontx2/otx2_ethdev_sec_tx.h | 2 +- examples/fips_validation/main.c | 4 +- lib/librte_mbuf/rte_mbuf.h | 21 ---------- 13 files changed, 72 insertions(+), 88 deletions(-) diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index 71f970f1ac..a290b44ae5 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -94,6 +94,11 @@ API Changes The flag name ``MEMPOOL_F_NO_PHYS_CONTIG`` is removed, while the aliased flag ``MEMPOOL_F_NO_IOVA_CONTIG`` is kept. +* mbuf: Removed the functions ``rte_mbuf_data_dma_addr*`` + and the macros ``rte_pktmbuf_mtophys*``. + The same functionality is still available with the functions and macros + having ``iova`` in their names instead of ``dma_addr`` or ``mtophys``. + * 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/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c index 930718cd47..61f9c04ba2 100644 --- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c @@ -950,14 +950,14 @@ fpga_dma_desc_te_fill(struct rte_bbdev_enc_op *op, desc->num_null = op->ldpc_enc.n_filler; /* Set inbound data buffer address */ desc->in_addr_hi = (uint32_t)( - rte_pktmbuf_mtophys_offset(input, in_offset) >> 32); + rte_pktmbuf_iova_offset(input, in_offset) >> 32); desc->in_addr_lw = (uint32_t)( - rte_pktmbuf_mtophys_offset(input, in_offset)); + rte_pktmbuf_iova_offset(input, in_offset)); desc->out_addr_hi = (uint32_t)( - rte_pktmbuf_mtophys_offset(output, out_offset) >> 32); + rte_pktmbuf_iova_offset(output, out_offset) >> 32); desc->out_addr_lw = (uint32_t)( - rte_pktmbuf_mtophys_offset(output, out_offset)); + rte_pktmbuf_iova_offset(output, out_offset)); /* Save software context needed for dequeue */ desc->op_addr = op; /* Set total number of CBs in an op */ @@ -998,9 +998,9 @@ fpga_dma_desc_ld_fill(struct rte_bbdev_dec_op *op, desc->error = 0; /* Set inbound data buffer address */ desc->in_addr_hi = (uint32_t)( - rte_pktmbuf_mtophys_offset(input, in_offset) >> 32); + rte_pktmbuf_iova_offset(input, in_offset) >> 32); desc->in_addr_lw = (uint32_t)( - rte_pktmbuf_mtophys_offset(input, in_offset)); + rte_pktmbuf_iova_offset(input, in_offset)); desc->rm_e = op->ldpc_dec.cb_params.e; desc->harq_input_length = harq_in_length; desc->et_dis = !check_bit(op->ldpc_dec.op_flags, @@ -1021,9 +1021,9 @@ fpga_dma_desc_ld_fill(struct rte_bbdev_dec_op *op, desc->max_iter = op->ldpc_dec.iter_max; desc->qm_idx = op->ldpc_dec.q_m / 2; desc->out_addr_hi = (uint32_t)( - rte_pktmbuf_mtophys_offset(output, out_offset) >> 32); + rte_pktmbuf_iova_offset(output, out_offset) >> 32); desc->out_addr_lw = (uint32_t)( - rte_pktmbuf_mtophys_offset(output, out_offset)); + rte_pktmbuf_iova_offset(output, out_offset)); /* Save software context needed for dequeue */ desc->op_addr = op; /* Set total number of CBs in an op */ diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c index 6be9131e72..37018b9c7f 100644 --- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c @@ -1251,14 +1251,14 @@ fpga_dma_desc_te_fill(struct rte_bbdev_enc_op *op, desc->offset = desc_offset; /* Set inbound data buffer address */ desc->in_addr_hi = (uint32_t)( - rte_pktmbuf_mtophys_offset(input, in_offset) >> 32); + rte_pktmbuf_iova_offset(input, in_offset) >> 32); desc->in_addr_lw = (uint32_t)( - rte_pktmbuf_mtophys_offset(input, in_offset)); + rte_pktmbuf_iova_offset(input, in_offset)); desc->out_addr_hi = (uint32_t)( - rte_pktmbuf_mtophys_offset(output, out_offset) >> 32); + rte_pktmbuf_iova_offset(output, out_offset) >> 32); desc->out_addr_lw = (uint32_t)( - rte_pktmbuf_mtophys_offset(output, out_offset)); + rte_pktmbuf_iova_offset(output, out_offset)); /* Save software context needed for dequeue */ desc->op_addr = op; @@ -1302,9 +1302,9 @@ fpga_dma_desc_td_fill(struct rte_bbdev_dec_op *op, desc->done = 0; /* Set inbound data buffer address */ desc->in_addr_hi = (uint32_t)( - rte_pktmbuf_mtophys_offset(input, in_offset) >> 32); + rte_pktmbuf_iova_offset(input, in_offset) >> 32); desc->in_addr_lw = (uint32_t)( - rte_pktmbuf_mtophys_offset(input, in_offset)); + rte_pktmbuf_iova_offset(input, in_offset)); desc->in_len = in_length; desc->k = k; desc->crc_type = !check_bit(op->turbo_dec.op_flags, @@ -1316,9 +1316,9 @@ fpga_dma_desc_td_fill(struct rte_bbdev_dec_op *op, desc->max_iter = op->turbo_dec.iter_max * 2; desc->offset = desc_offset; desc->out_addr_hi = (uint32_t)( - rte_pktmbuf_mtophys_offset(output, out_offset) >> 32); + rte_pktmbuf_iova_offset(output, out_offset) >> 32); desc->out_addr_lw = (uint32_t)( - rte_pktmbuf_mtophys_offset(output, out_offset)); + rte_pktmbuf_iova_offset(output, out_offset)); /* Save software context needed for dequeue */ desc->op_addr = op; diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h index 44067cf1b1..4e79fbf7a5 100644 --- a/drivers/common/cpt/cpt_ucode.h +++ b/drivers/common/cpt/cpt_ucode.h @@ -2918,7 +2918,7 @@ prepare_iov_from_pkt(struct rte_mbuf *pkt, if (!start_offset) { seg_data = rte_pktmbuf_mtod(pkt, void *); - seg_phys = rte_pktmbuf_mtophys(pkt); + seg_phys = rte_pktmbuf_iova(pkt); seg_size = pkt->data_len; } else { while (start_offset >= pkt->data_len) { @@ -2927,7 +2927,7 @@ prepare_iov_from_pkt(struct rte_mbuf *pkt, } seg_data = rte_pktmbuf_mtod_offset(pkt, void *, start_offset); - seg_phys = rte_pktmbuf_mtophys_offset(pkt, start_offset); + seg_phys = rte_pktmbuf_iova_offset(pkt, start_offset); seg_size = pkt->data_len - start_offset; if (!seg_size) return 1; @@ -2942,7 +2942,7 @@ prepare_iov_from_pkt(struct rte_mbuf *pkt, while (unlikely(pkt != NULL)) { seg_data = rte_pktmbuf_mtod(pkt, void *); - seg_phys = rte_pktmbuf_mtophys(pkt); + seg_phys = rte_pktmbuf_iova(pkt); seg_size = pkt->data_len; if (!seg_size) break; @@ -2972,7 +2972,7 @@ prepare_iov_from_pkt_inplace(struct rte_mbuf *pkt, iov_ptr_t *iovec; seg_data = rte_pktmbuf_mtod(pkt, void *); - seg_phys = rte_pktmbuf_mtophys(pkt); + seg_phys = rte_pktmbuf_iova(pkt); seg_size = pkt->data_len; /* first seg */ @@ -3001,7 +3001,7 @@ prepare_iov_from_pkt_inplace(struct rte_mbuf *pkt, while (unlikely(pkt != NULL)) { seg_data = rte_pktmbuf_mtod(pkt, void *); - seg_phys = rte_pktmbuf_mtophys(pkt); + seg_phys = rte_pktmbuf_iova(pkt); seg_size = pkt->data_len; if (!seg_size) @@ -3463,7 +3463,7 @@ fill_digest_params(struct rte_crypto_op *cop, params.mac_buf.vaddr = rte_pktmbuf_mtod_offset(m_dst, void *, off); params.mac_buf.dma_addr = - rte_pktmbuf_mtophys_offset(m_dst, off); + rte_pktmbuf_iova_offset(m_dst, off); params.mac_buf.size = mac_len; } } else { diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c index 335fd63b98..3a064ec3b2 100644 --- a/drivers/compress/qat/qat_comp.c +++ b/drivers/compress/qat/qat_comp.c @@ -305,9 +305,9 @@ qat_comp_build_request(void *in_op, uint8_t *out_msg, comp_req->comp_pars.out_buffer_sz; comp_req->comn_mid.src_data_addr = - rte_pktmbuf_mtophys_offset(op->m_src, op->src.offset); + rte_pktmbuf_iova_offset(op->m_src, op->src.offset); comp_req->comn_mid.dest_data_addr = - rte_pktmbuf_mtophys_offset(op->m_dst, op->dst.offset); + rte_pktmbuf_iova_offset(op->m_dst, op->dst.offset); } if (unlikely(rte_pktmbuf_pkt_len(op->m_dst) < QAT_MIN_OUT_BUF_SIZE)) { diff --git a/drivers/crypto/ccp/ccp_crypto.c b/drivers/crypto/ccp/ccp_crypto.c index 4256734d16..db3fb6eff8 100644 --- a/drivers/crypto/ccp/ccp_crypto.c +++ b/drivers/crypto/ccp/ccp_crypto.c @@ -1571,7 +1571,7 @@ ccp_perform_hmac(struct rte_crypto_op *op, ccp_cryptodev_driver_id); addr = session->auth.pre_compute; - src_addr = rte_pktmbuf_mtophys_offset(op->sym->m_src, + src_addr = rte_pktmbuf_iova_offset(op->sym->m_src, op->sym->auth.data.offset); append_ptr = (void *)rte_pktmbuf_append(op->sym->m_src, session->auth.ctx_len); @@ -1743,7 +1743,7 @@ ccp_perform_sha(struct rte_crypto_op *op, op->sym->session, ccp_cryptodev_driver_id); - src_addr = rte_pktmbuf_mtophys_offset(op->sym->m_src, + src_addr = rte_pktmbuf_iova_offset(op->sym->m_src, op->sym->auth.data.offset); append_ptr = (void *)rte_pktmbuf_append(op->sym->m_src, @@ -1832,7 +1832,7 @@ ccp_perform_sha3_hmac(struct rte_crypto_op *op, op->sym->session, ccp_cryptodev_driver_id); - src_addr = rte_pktmbuf_mtophys_offset(op->sym->m_src, + src_addr = rte_pktmbuf_iova_offset(op->sym->m_src, op->sym->auth.data.offset); append_ptr = (uint8_t *)rte_pktmbuf_append(op->sym->m_src, session->auth.ctx_len); @@ -1972,7 +1972,7 @@ ccp_perform_sha3(struct rte_crypto_op *op, op->sym->session, ccp_cryptodev_driver_id); - src_addr = rte_pktmbuf_mtophys_offset(op->sym->m_src, + src_addr = rte_pktmbuf_iova_offset(op->sym->m_src, op->sym->auth.data.offset); append_ptr = (uint8_t *)rte_pktmbuf_append(op->sym->m_src, session->auth.ctx_len); @@ -2041,7 +2041,7 @@ ccp_perform_aes_cmac(struct rte_crypto_op *op, ccp_cryptodev_driver_id); key_addr = rte_mem_virt2phy(session->auth.key_ccp); - src_addr = rte_pktmbuf_mtophys_offset(op->sym->m_src, + src_addr = rte_pktmbuf_iova_offset(op->sym->m_src, op->sym->auth.data.offset); append_ptr = (uint8_t *)rte_pktmbuf_append(op->sym->m_src, session->auth.ctx_len); @@ -2221,10 +2221,10 @@ ccp_perform_aes(struct rte_crypto_op *op, desc = &cmd_q->qbase_desc[cmd_q->qidx]; - src_addr = rte_pktmbuf_mtophys_offset(op->sym->m_src, + src_addr = rte_pktmbuf_iova_offset(op->sym->m_src, op->sym->cipher.data.offset); if (likely(op->sym->m_dst != NULL)) - dest_addr = rte_pktmbuf_mtophys_offset(op->sym->m_dst, + dest_addr = rte_pktmbuf_iova_offset(op->sym->m_dst, op->sym->cipher.data.offset); else dest_addr = src_addr; @@ -2303,11 +2303,11 @@ ccp_perform_3des(struct rte_crypto_op *op, return -ENOTSUP; } - src_addr = rte_pktmbuf_mtophys_offset(op->sym->m_src, + src_addr = rte_pktmbuf_iova_offset(op->sym->m_src, op->sym->cipher.data.offset); if (unlikely(op->sym->m_dst != NULL)) dest_addr = - rte_pktmbuf_mtophys_offset(op->sym->m_dst, + rte_pktmbuf_iova_offset(op->sym->m_dst, op->sym->cipher.data.offset); else dest_addr = src_addr; @@ -2385,10 +2385,10 @@ ccp_perform_aes_gcm(struct rte_crypto_op *op, struct ccp_queue *cmd_q) iv = rte_crypto_op_ctod_offset(op, uint8_t *, session->iv.offset); key_addr = session->cipher.key_phys; - src_addr = rte_pktmbuf_mtophys_offset(op->sym->m_src, + src_addr = rte_pktmbuf_iova_offset(op->sym->m_src, op->sym->aead.data.offset); if (unlikely(op->sym->m_dst != NULL)) - dest_addr = rte_pktmbuf_mtophys_offset(op->sym->m_dst, + dest_addr = rte_pktmbuf_iova_offset(op->sym->m_dst, op->sym->aead.data.offset); else dest_addr = src_addr; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index c4339336de..97002170b0 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -748,7 +748,7 @@ build_auth_only_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) sg++; } - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->offset = data_offset; if (data_len <= (mbuf->data_len - data_offset)) { @@ -761,7 +761,7 @@ build_auth_only_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) (mbuf = mbuf->next)) { cpu_to_hw_sg(sg); sg++; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); if (data_len > mbuf->data_len) sg->length = mbuf->data_len; else @@ -866,7 +866,7 @@ build_auth_only(struct rte_crypto_op *op, dpaa_sec_session *ses) sg++; } - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->offset = data_offset; sg->length = data_len; @@ -946,7 +946,7 @@ build_cipher_only_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) /* 1st seg */ sg = &cf->sg[2]; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len - data_offset; sg->offset = data_offset; @@ -955,7 +955,7 @@ build_cipher_only_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) while (mbuf) { cpu_to_hw_sg(sg); sg++; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len; mbuf = mbuf->next; } @@ -980,7 +980,7 @@ build_cipher_only_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) /* 1st seg */ sg++; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len - data_offset; sg->offset = data_offset; @@ -989,7 +989,7 @@ build_cipher_only_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) while (mbuf) { cpu_to_hw_sg(sg); sg++; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len; mbuf = mbuf->next; } @@ -1121,7 +1121,7 @@ build_cipher_auth_gcm_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) cpu_to_hw_sg(out_sg); /* 1st seg */ - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len - sym->aead.data.offset; sg->offset = sym->aead.data.offset; @@ -1130,7 +1130,7 @@ build_cipher_auth_gcm_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) while (mbuf) { cpu_to_hw_sg(sg); sg++; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len; mbuf = mbuf->next; } @@ -1178,7 +1178,7 @@ build_cipher_auth_gcm_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) /* 3rd seg */ sg++; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len - sym->aead.data.offset; sg->offset = sym->aead.data.offset; @@ -1187,7 +1187,7 @@ build_cipher_auth_gcm_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) while (mbuf) { cpu_to_hw_sg(sg); sg++; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len; mbuf = mbuf->next; } @@ -1367,7 +1367,7 @@ build_cipher_auth_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) cpu_to_hw_sg(out_sg); /* 1st seg */ - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len - sym->auth.data.offset; sg->offset = sym->auth.data.offset; @@ -1376,7 +1376,7 @@ build_cipher_auth_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) while (mbuf) { cpu_to_hw_sg(sg); sg++; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len; mbuf = mbuf->next; } @@ -1415,7 +1415,7 @@ build_cipher_auth_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) /* 2nd seg */ sg++; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len - sym->auth.data.offset; sg->offset = sym->auth.data.offset; @@ -1424,7 +1424,7 @@ build_cipher_auth_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) while (mbuf) { cpu_to_hw_sg(sg); sg++; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len; mbuf = mbuf->next; } @@ -1555,10 +1555,10 @@ build_proto(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; @@ -1614,7 +1614,7 @@ build_proto_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) /* 1st seg */ sg = &cf->sg[2]; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->offset = 0; /* Successive segs */ @@ -1624,7 +1624,7 @@ build_proto_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) mbuf = mbuf->next; cpu_to_hw_sg(sg); sg++; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->offset = 0; } sg->length = mbuf->buf_len - mbuf->data_off; @@ -1646,7 +1646,7 @@ build_proto_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) qm_sg_entry_set64(in_sg, rte_dpaa_mem_vtop(sg)); /* 1st seg */ - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len; sg->offset = 0; @@ -1655,7 +1655,7 @@ build_proto_sg(struct rte_crypto_op *op, dpaa_sec_session *ses) while (mbuf) { cpu_to_hw_sg(sg); sg++; - qm_sg_entry_set64(sg, rte_pktmbuf_mtophys(mbuf)); + qm_sg_entry_set64(sg, rte_pktmbuf_iova(mbuf)); sg->length = mbuf->data_len; sg->offset = 0; in_len += sg->length; diff --git a/drivers/crypto/nitrox/nitrox_sym_reqmgr.c b/drivers/crypto/nitrox/nitrox_sym_reqmgr.c index d9b4267764..4492247801 100644 --- a/drivers/crypto/nitrox/nitrox_sym_reqmgr.c +++ b/drivers/crypto/nitrox/nitrox_sym_reqmgr.c @@ -269,7 +269,7 @@ extract_cipher_auth_digest(struct nitrox_softreq *sr, op->sym->auth.data.length + digest->len)) return -EINVAL; - digest->iova = rte_pktmbuf_mtophys_offset(mdst, + digest->iova = rte_pktmbuf_iova_offset(mdst, op->sym->auth.data.offset + op->sym->auth.data.length); digest->virt = rte_pktmbuf_mtod_offset(mdst, uint8_t *, @@ -318,7 +318,7 @@ create_sglist_from_mbuf(struct nitrox_sgtable *sgtbl, struct rte_mbuf *mbuf, if (datalen <= mlen) mlen = datalen; sglist[cnt].len = mlen; - sglist[cnt].iova = rte_pktmbuf_mtophys_offset(m, off); + sglist[cnt].iova = rte_pktmbuf_iova_offset(m, off); sglist[cnt].virt = rte_pktmbuf_mtod_offset(m, uint8_t *, off); sgtbl->total_bytes += mlen; cnt++; @@ -327,7 +327,7 @@ create_sglist_from_mbuf(struct nitrox_sgtable *sgtbl, struct rte_mbuf *mbuf, mlen = rte_pktmbuf_data_len(m) < datalen ? rte_pktmbuf_data_len(m) : datalen; sglist[cnt].len = mlen; - sglist[cnt].iova = rte_pktmbuf_mtophys(m); + sglist[cnt].iova = rte_pktmbuf_iova(m); sglist[cnt].virt = rte_pktmbuf_mtod(m, uint8_t *); sgtbl->total_bytes += mlen; cnt++; diff --git a/drivers/crypto/virtio/virtio_rxtx.c b/drivers/crypto/virtio/virtio_rxtx.c index e9a63cb5a0..e1cb4ad104 100644 --- a/drivers/crypto/virtio/virtio_rxtx.c +++ b/drivers/crypto/virtio/virtio_rxtx.c @@ -284,18 +284,18 @@ virtqueue_crypto_sym_enqueue_xmit( } /* indirect vring: src data */ - desc[idx].addr = rte_pktmbuf_mtophys_offset(sym_op->m_src, 0); + desc[idx].addr = rte_pktmbuf_iova_offset(sym_op->m_src, 0); desc[idx].len = (sym_op->cipher.data.offset + sym_op->cipher.data.length); desc[idx++].flags = VRING_DESC_F_NEXT; /* indirect vring: dst data */ if (sym_op->m_dst) { - desc[idx].addr = rte_pktmbuf_mtophys_offset(sym_op->m_dst, 0); + desc[idx].addr = rte_pktmbuf_iova_offset(sym_op->m_dst, 0); desc[idx].len = (sym_op->cipher.data.offset + sym_op->cipher.data.length); } else { - desc[idx].addr = rte_pktmbuf_mtophys_offset(sym_op->m_src, 0); + desc[idx].addr = rte_pktmbuf_iova_offset(sym_op->m_src, 0); desc[idx].len = (sym_op->cipher.data.offset + sym_op->cipher.data.length); } diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index 30c467db71..da3a9822b8 100644 --- a/drivers/net/axgbe/axgbe_rxtx.c +++ b/drivers/net/axgbe/axgbe_rxtx.c @@ -95,7 +95,7 @@ int axgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, axgbe_rx_queue_release(rxq); return -ENOMEM; } - rxq->ring_phys_addr = (uint64_t)dma->phys_addr; + rxq->ring_phys_addr = (uint64_t)dma->iova; rxq->desc = (volatile union axgbe_rx_desc *)dma->addr; memset((void *)rxq->desc, 0, size); /* Allocate software ring */ @@ -530,7 +530,7 @@ int axgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, return -ENOMEM; } memset(tz->addr, 0, tsize); - txq->ring_phys_addr = (uint64_t)tz->phys_addr; + txq->ring_phys_addr = (uint64_t)tz->iova; txq->desc = tz->addr; txq->queue_id = queue_idx; txq->port_id = dev->data->port_id; diff --git a/drivers/net/octeontx2/otx2_ethdev_sec_tx.h b/drivers/net/octeontx2/otx2_ethdev_sec_tx.h index f8130ca624..15122b4154 100644 --- a/drivers/net/octeontx2/otx2_ethdev_sec_tx.h +++ b/drivers/net/octeontx2/otx2_ethdev_sec_tx.h @@ -87,7 +87,7 @@ otx2_sec_event_tx(struct otx2_ssogws *ws, struct rte_event *ev, */ rte_pktmbuf_append(m, extend_tail); data = rte_pktmbuf_prepend(m, extend_head); - data_addr = rte_pktmbuf_mtophys(m); + data_addr = rte_pktmbuf_iova(m); /* * Move the Ethernet header, to insert otx2_ipsec_fp_out_hdr prior diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c index efd32a86a5..0a1c8b568c 100644 --- a/examples/fips_validation/main.c +++ b/examples/fips_validation/main.c @@ -531,7 +531,7 @@ prepare_auth_op(void) sym->auth.data.length = vec.pt.len; sym->auth.digest.data = pt + vec.pt.len; - sym->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset( + sym->auth.digest.phys_addr = rte_pktmbuf_iova_offset( env.mbuf, vec.pt.len); memcpy(pt, vec.pt.val, vec.pt.len); @@ -584,7 +584,7 @@ prepare_aead_op(void) memcpy(pt, vec.pt.val, vec.pt.len); sym->aead.data.length = vec.pt.len; sym->aead.digest.data = pt + vec.pt.len; - sym->aead.digest.phys_addr = rte_pktmbuf_mtophys_offset( + sym->aead.digest.phys_addr = rte_pktmbuf_iova_offset( env.mbuf, vec.pt.len); } else { uint8_t *ct; diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 7259575a77..a1414ed7cd 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -151,13 +151,6 @@ 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 rte_mbuf_data_iova(mb); -} - /** * Return the default IO address of the beginning of the mbuf data * @@ -176,13 +169,6 @@ 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 rte_mbuf_data_iova_default(mb); -} - /** * Return the mbuf owning the data buffer address of an indirect mbuf. * @@ -1537,13 +1523,6 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m) return m; } -/* deprecated */ -#define rte_pktmbuf_mtophys_offset(m, o) \ - rte_pktmbuf_iova_offset(m, o) - -/* deprecated */ -#define rte_pktmbuf_mtophys(m) rte_pktmbuf_iova(m) - /** * A macro that returns the length of the packet. * From patchwork Thu Sep 17 10:41:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 78039 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C1CD7A04BC; Thu, 17 Sep 2020 12:42:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 02A8D1D613; Thu, 17 Sep 2020 12:41:57 +0200 (CEST) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by dpdk.org (Postfix) with ESMTP id B30F71D609 for ; Thu, 17 Sep 2020 12:41:55 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id 21F065801AB; Thu, 17 Sep 2020 06:41:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Thu, 17 Sep 2020 06:41:55 -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=dgcVujSM0E9jg 5O9Y/YWWv0GnndTpPxfi0fTVmq1z6s=; b=kT2YR2V6lVW3ltxW+lfo+RWc6rSkF CSO6Xg8UNoYKAFM7Sbt11GqmQCM47Ygwt/4D9duzddQI3otILmdXwp7DJmo6N7uH A8L1ARgIsmHjp/NnHr+eWu3laVz+5GOlgQ1xLu5+zFMQekOXquyox9AyvOSpyPjc aZej/Ir/L64JibKflCbqprG3uB+skJ28skPw4vao9B8tHhkFh/T03FaGigEtReEk CJs5ZjRKcZg/ti+R7L9Yap7JUwWOfuPi2n1Br21RADWp1iw47no2uyyG6PTaRQ8J q6w2yGRYbH/upXn9mQcH9Mvbf5YkgqKZOnUPYHIpTAzGRYbXSqR9Moylg== 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=dgcVujSM0E9jg5O9Y/YWWv0GnndTpPxfi0fTVmq1z6s=; b=uU5HERUa j6PPsrmKroNjN93hTiGOoitktHjRDsRyh5/5/M3ske8Hh5QxiQHdtQd9LJG06R5r 9vP3M5Wkd19+1w1QQIp9/GuHZSL/cXolHsZkUEv2u55IRt/2crj3zJed8Nx2JVH5 0EOX+vKtf8maIGFkKEBVNxC1CmDpayThXA3NknLJc4fgD8zp9x6TPwJw/j0H2fXA s3nUOBMFc2uvHuUGWXPC1smnvi6Gf0QWejxkTjUhnmEieFgwSwYGScAe+y+AtlGF po4o704FAPOvq2yY1nFwGC1plFp5SGBR7iMQ2H+Kzk8IqhoYDN4J0uyb1IoMGUYG /bNINybY5TPm4Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrtdeggdefvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepfeenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho 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 327B1306467D; Thu, 17 Sep 2020 06:41:53 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com, mdr@ashroe.eu, Andrew Rybchenko , Neil Horman , John McNamara , Marko Kovacevic , Anoob Joseph , Beilei Xing , Jeff Guo , Jingjing Wu , Qiming Yang , Qi Zhang , Ferruh Yigit , Olivier Matz Date: Thu, 17 Sep 2020 12:41:33 +0200 Message-Id: <20200917104133.6186-5-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 Subject: [dpdk-dev] [PATCH v2 4/4] mbuf: remove physical address alias 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 buf_physaddr union field from rte_mbuf. It is replaced with buf_iova which is at the same offset. The single field buf_physaddr in rte_kni_mbuf is also renamed. This concludes a 3-year process of semantic change. Signed-off-by: Thomas Monjalon Acked-by: Andrew Rybchenko Acked-by: Ray Kinsella --- doc/guides/rel_notes/deprecation.rst | 2 -- doc/guides/rel_notes/release_20_11.rst | 3 +++ drivers/common/cpt/cpt_ucode.h | 2 +- drivers/net/i40e/i40e_rxtx_vec_avx2.c | 18 +++++++++--------- drivers/net/iavf/iavf_rxtx_vec_avx2.c | 18 +++++++++--------- drivers/net/ice/ice_rxtx_vec_avx2.c | 18 +++++++++--------- kernel/linux/kni/kni_net.c | 6 +++--- lib/librte_eal/linux/include/rte_kni_common.h | 2 +- lib/librte_mbuf/rte_mbuf_core.h | 6 +----- 9 files changed, 36 insertions(+), 39 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 52168f7751..143b7694a5 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -148,8 +148,6 @@ Deprecation Notices avoiding impact on vectorized implementation of the driver datapaths, while evaluating performance gains of a better use of the first cache line. - The deprecated unioned field ``buf_physaddr`` will be removed in DPDK 20.11. - * ethdev: Split the ``struct eth_dev_ops`` struct to hide it as much as possible will be done in 20.11. Currently the ``struct eth_dev_ops`` struct is accessible by the application diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index a290b44ae5..4a7f6f4b6c 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -99,6 +99,9 @@ API Changes The same functionality is still available with the functions and macros having ``iova`` in their names instead of ``dma_addr`` or ``mtophys``. +* mbuf: Removed the unioned field ``buf_physaddr`` from ``rte_mbuf``. + The field ``buf_iova`` is remaining from the old union. + * 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/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h index 4e79fbf7a5..763355fb1f 100644 --- a/drivers/common/cpt/cpt_ucode.h +++ b/drivers/common/cpt/cpt_ucode.h @@ -2862,7 +2862,7 @@ alloc_op_meta(struct rte_mbuf *m_src, tailroom = rte_pktmbuf_tailroom(m_src); if (likely(tailroom > len + 8)) { mdata = (uint8_t *)m_src->buf_addr + m_src->buf_len; - mphys = m_src->buf_physaddr + m_src->buf_len; + mphys = m_src->buf_iova + m_src->buf_len; mdata -= len; mphys -= len; buf->vaddr = mdata; diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c index 3bcef13638..37e7db5d7e 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c +++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c @@ -59,8 +59,8 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq) mb0 = rxep[0].mbuf; mb1 = rxep[1].mbuf; - /* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */ - RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_physaddr) != + /* load buf_addr(lo 64bit) and buf_iova(hi 64bit) */ + RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iova) != offsetof(struct rte_mbuf, buf_addr) + 8); vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr); vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr); @@ -92,8 +92,8 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq) mb2 = rxep[2].mbuf; mb3 = rxep[3].mbuf; - /* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */ - RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_physaddr) != + /* load buf_addr(lo 64bit) and buf_iova(hi 64bit) */ + RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iova) != offsetof(struct rte_mbuf, buf_addr) + 8); vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr); vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr); @@ -814,7 +814,7 @@ vtx1(volatile struct i40e_tx_desc *txdp, ((uint64_t)pkt->data_len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT)); __m128i descriptor = _mm_set_epi64x(high_qw, - pkt->buf_physaddr + pkt->data_off); + pkt->buf_iova + pkt->data_off); _mm_store_si128((__m128i *)txdp, descriptor); } @@ -843,11 +843,11 @@ vtx(volatile struct i40e_tx_desc *txdp, ((uint64_t)pkt[0]->data_len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT); __m256i desc2_3 = _mm256_set_epi64x( - hi_qw3, pkt[3]->buf_physaddr + pkt[3]->data_off, - hi_qw2, pkt[2]->buf_physaddr + pkt[2]->data_off); + hi_qw3, pkt[3]->buf_iova + pkt[3]->data_off, + hi_qw2, pkt[2]->buf_iova + pkt[2]->data_off); __m256i desc0_1 = _mm256_set_epi64x( - hi_qw1, pkt[1]->buf_physaddr + pkt[1]->data_off, - hi_qw0, pkt[0]->buf_physaddr + pkt[0]->data_off); + hi_qw1, pkt[1]->buf_iova + pkt[1]->data_off, + hi_qw0, pkt[0]->buf_iova + pkt[0]->data_off); _mm256_store_si256((void *)(txdp + 2), desc2_3); _mm256_store_si256((void *)txdp, desc0_1); } diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx2.c b/drivers/net/iavf/iavf_rxtx_vec_avx2.c index e5e0fd3095..8f28afc8c5 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_avx2.c +++ b/drivers/net/iavf/iavf_rxtx_vec_avx2.c @@ -52,8 +52,8 @@ iavf_rxq_rearm(struct iavf_rx_queue *rxq) mb0 = rxp[0]; mb1 = rxp[1]; - /* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */ - RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_physaddr) != + /* load buf_addr(lo 64bit) and buf_iova(hi 64bit) */ + RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iova) != offsetof(struct rte_mbuf, buf_addr) + 8); vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr); vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr); @@ -85,8 +85,8 @@ iavf_rxq_rearm(struct iavf_rx_queue *rxq) mb2 = rxp[2]; mb3 = rxp[3]; - /* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */ - RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_physaddr) != + /* load buf_addr(lo 64bit) and buf_iova(hi 64bit) */ + RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iova) != offsetof(struct rte_mbuf, buf_addr) + 8); vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr); vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr); @@ -1391,7 +1391,7 @@ iavf_vtx1(volatile struct iavf_tx_desc *txdp, ((uint64_t)pkt->data_len << IAVF_TXD_QW1_TX_BUF_SZ_SHIFT)); __m128i descriptor = _mm_set_epi64x(high_qw, - pkt->buf_physaddr + pkt->data_off); + pkt->buf_iova + pkt->data_off); _mm_store_si128((__m128i *)txdp, descriptor); } @@ -1430,15 +1430,15 @@ iavf_vtx(volatile struct iavf_tx_desc *txdp, __m256i desc2_3 = _mm256_set_epi64x (hi_qw3, - pkt[3]->buf_physaddr + pkt[3]->data_off, + pkt[3]->buf_iova + pkt[3]->data_off, hi_qw2, - pkt[2]->buf_physaddr + pkt[2]->data_off); + pkt[2]->buf_iova + pkt[2]->data_off); __m256i desc0_1 = _mm256_set_epi64x (hi_qw1, - pkt[1]->buf_physaddr + pkt[1]->data_off, + pkt[1]->buf_iova + pkt[1]->data_off, hi_qw0, - pkt[0]->buf_physaddr + pkt[0]->data_off); + pkt[0]->buf_iova + pkt[0]->data_off); _mm256_store_si256((void *)(txdp + 2), desc2_3); _mm256_store_si256((void *)txdp, desc0_1); } diff --git a/drivers/net/ice/ice_rxtx_vec_avx2.c b/drivers/net/ice/ice_rxtx_vec_avx2.c index be50677c2f..b653805160 100644 --- a/drivers/net/ice/ice_rxtx_vec_avx2.c +++ b/drivers/net/ice/ice_rxtx_vec_avx2.c @@ -52,8 +52,8 @@ ice_rxq_rearm(struct ice_rx_queue *rxq) mb0 = rxep[0].mbuf; mb1 = rxep[1].mbuf; - /* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */ - RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_physaddr) != + /* load buf_addr(lo 64bit) and buf_iova(hi 64bit) */ + RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iova) != offsetof(struct rte_mbuf, buf_addr) + 8); vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr); vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr); @@ -85,8 +85,8 @@ ice_rxq_rearm(struct ice_rx_queue *rxq) mb2 = rxep[2].mbuf; mb3 = rxep[3].mbuf; - /* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */ - RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_physaddr) != + /* load buf_addr(lo 64bit) and buf_iova(hi 64bit) */ + RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, buf_iova) != offsetof(struct rte_mbuf, buf_addr) + 8); vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr); vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr); @@ -689,7 +689,7 @@ ice_vtx1(volatile struct ice_tx_desc *txdp, ((uint64_t)pkt->data_len << ICE_TXD_QW1_TX_BUF_SZ_S)); __m128i descriptor = _mm_set_epi64x(high_qw, - pkt->buf_physaddr + pkt->data_off); + pkt->buf_iova + pkt->data_off); _mm_store_si128((__m128i *)txdp, descriptor); } @@ -728,15 +728,15 @@ ice_vtx(volatile struct ice_tx_desc *txdp, __m256i desc2_3 = _mm256_set_epi64x (hi_qw3, - pkt[3]->buf_physaddr + pkt[3]->data_off, + pkt[3]->buf_iova + pkt[3]->data_off, hi_qw2, - pkt[2]->buf_physaddr + pkt[2]->data_off); + pkt[2]->buf_iova + pkt[2]->data_off); __m256i desc0_1 = _mm256_set_epi64x (hi_qw1, - pkt[1]->buf_physaddr + pkt[1]->data_off, + pkt[1]->buf_iova + pkt[1]->data_off, hi_qw0, - pkt[0]->buf_physaddr + pkt[0]->data_off); + pkt[0]->buf_iova + pkt[0]->data_off); _mm256_store_si256((void *)(txdp + 2), desc2_3); _mm256_store_si256((void *)txdp, desc0_1); } diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c index c82c881a2c..4b752083da 100644 --- a/kernel/linux/kni/kni_net.c +++ b/kernel/linux/kni/kni_net.c @@ -47,7 +47,7 @@ iova2kva(struct kni_dev *kni, void *iova) static inline void * iova2data_kva(struct kni_dev *kni, struct rte_kni_mbuf *m) { - return phys_to_virt(iova_to_phys(kni->usr_tsk, m->buf_physaddr) + + return phys_to_virt(iova_to_phys(kni->usr_tsk, m->buf_iova) + m->data_off); } #endif @@ -67,7 +67,7 @@ pa2va(void *pa, struct rte_kni_mbuf *m) va = (void *)((unsigned long)pa + (unsigned long)m->buf_addr - - (unsigned long)m->buf_physaddr); + (unsigned long)m->buf_iova); return va; } @@ -75,7 +75,7 @@ pa2va(void *pa, struct rte_kni_mbuf *m) static void * kva2data_kva(struct rte_kni_mbuf *m) { - return phys_to_virt(m->buf_physaddr + m->data_off); + return phys_to_virt(m->buf_iova + m->data_off); } static inline void * diff --git a/lib/librte_eal/linux/include/rte_kni_common.h b/lib/librte_eal/linux/include/rte_kni_common.h index 7313ef504e..21b477f0aa 100644 --- a/lib/librte_eal/linux/include/rte_kni_common.h +++ b/lib/librte_eal/linux/include/rte_kni_common.h @@ -75,7 +75,7 @@ struct rte_kni_fifo { */ struct rte_kni_mbuf { void *buf_addr __attribute__((__aligned__(RTE_CACHE_LINE_SIZE))); - uint64_t buf_physaddr; + uint64_t buf_iova; uint16_t data_off; /**< Start address of data in segment buffer. */ char pad1[2]; uint16_t nb_segs; /**< Number of segments. */ diff --git a/lib/librte_mbuf/rte_mbuf_core.h b/lib/librte_mbuf/rte_mbuf_core.h index cee3d5aff5..8c2c20644d 100644 --- a/lib/librte_mbuf/rte_mbuf_core.h +++ b/lib/librte_mbuf/rte_mbuf_core.h @@ -476,11 +476,7 @@ struct rte_mbuf { * same mbuf cacheline0 layout for 32-bit and 64-bit. This makes * working on vector drivers easier. */ - RTE_STD_C11 - union { - rte_iova_t buf_iova; - rte_iova_t buf_physaddr; /**< deprecated */ - } __rte_aligned(sizeof(rte_iova_t)); + rte_iova_t buf_iova __rte_aligned(sizeof(rte_iova_t)); /* next 8 bytes are initialised on RX descriptor rearm */ RTE_MARKER64 rearm_data;