From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0040.outbound.protection.outlook.com [104.47.42.40]) by dpdk.org (Postfix) with ESMTP id 4846558F6 for ; Tue, 5 Sep 2017 12:32:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=CWlCpkdVcmO7Mp7645yd/ZYLIYAd8sQgb8AUhoVyJuQ=; b=dXxrWe4X+tOpBM8SCbGqCc09yaa62PD+QhGCOBtew5lEUmLdC1nzXvejj+p7h60OJien8CcXEVAoCmwyk/HM0pnWyC3bJuNVy9iwLWTtXikEv8Y9YvVP8qBbO0tjfo0nQ3iz2grJXj5tLR5CZAs3lF+y90o+AEoEK9tzFgdGb6I= Received: from localhost.localdomain (14.140.2.178) by MWHPR07MB3102.namprd07.prod.outlook.com (10.172.95.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Tue, 5 Sep 2017 10:32:00 +0000 From: Santosh Shukla To: dev@dpdk.org Cc: thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, olivier.matz@6wind.com, Santosh Shukla Date: Tue, 5 Sep 2017 16:01:16 +0530 Message-Id: <20170905103119.20511-3-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170905103119.20511-1-santosh.shukla@caviumnetworks.com> References: <20170814151537.29454-1-santosh.shukla@caviumnetworks.com> <20170905103119.20511-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: PN1PR01CA0073.INDPRD01.PROD.OUTLOOK.COM (10.174.144.141) To MWHPR07MB3102.namprd07.prod.outlook.com (10.172.95.8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f364e72c-1d83-4a2d-8682-08d4f44959d4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR07MB3102; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3102; 3:XRYBAU7l5rPBJxIBeBgN8/MWPskO23gAkhilLeeBrgnNbcSz7AsIn9nNEchXPI8p3CyUAxH1W4ZVdyfDH8Ph+aDofwmgGk3XN2pdJqdWoTIqTcaGz0SwN9fJjjGq7918ptgrrhU8VlWaadgYZ/wFLdDSrfTZ9DL0wYfLCb502Jehm24/ht9TgkcQq2RugM43+T5l+Fb/tSmuUrSb/p+Er4OYYUQb1P7V/yoRH0t+BonoLOfj+2E97IQGdLZIy8tQ; 25:aR/nnbFUZjyEMo4UGCHe/d1PdlH9851IeCQxl8iraI4dJI81GOhop2nuU690r39HgtgUobCc8LTHPNPDyHgdXyeCN2eHZtT+thN63F1GPljY2d5aln44NMYrn1vRaLFazoFk5CfQxzxy0sNSIG85P8kanv7cpdAzui3n9InLni1EtzTIKKmkzmaBGBlVjQm1QZ4my4gVW+7JDNMcB5KPebfmqQU08W2gzWnSD5YhgV295fbI81y9Qgw/JUDtQZYbn1jzBEr69fs2LIwa5sWeX8SlJhVdJETNuapp3ZuHWSAgFLJZ0qDq10V4sK4qA5rbcIIkhuxMhSnCA0g1J/Qr3g==; 31:wlWq4+Z7t7JZz6wKdMj9cCzwTGVGyKPxo6T9ZziNd9j1KzteN+NZwGzjlkULAcp8cB7Qejl8EYuLoAhBnNzTssfu8l7VyqgR6dReLCcmuUXdrf7C1NPebxaT37piTiFyid4WITpsG1DoXaFLsIz6dSLV4y8nLECm44XDgV8KOBOOZcfrs3+FWvJgpnxn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684); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(6041248)(20161123558100)(20161123555025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR07MB3102; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR07MB3102; X-Forefront-PRVS: 0421BF7135 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(189002)(199003)(8676002)(6116002)(7736002)(101416001)(50986999)(5003940100001)(48376002)(53936002)(8936002)(305945005)(107886003)(110136004)(50466002)(97736004)(1076002)(6916009)(3846002)(2906002)(81156014)(81166006)(50226002)(2950100002)(42882006)(105586002)(4326008)(6506006)(6666003)(8656003)(25786009)(5660300001)(5009440100003)(68736007)(6486002)(72206003)(2361001)(33646002)(2351001)(36756003)(5890100001)(575784001)(6512007)(76176999)(66066001)(478600001)(47776003)(189998001)(551934003)(106356001)(42186005)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3102; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB3102; 23:eWtnkztdoPJtBcYTV07JEAh8O+h5FYxeACeUDFCJh?= =?us-ascii?Q?QTyYHiIwj2xjQOQ+YPrbwgoE8P4/Ym/iJqBO1uWfvjhlb3FPH3+k3hlxaH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G3xXY1a2ODMpeaun4TlNaQ1azLhr+tYKO3ygiVb+dMCeKtWRG5ogyG8QRIUaI3FXj3MYQGzijDMaAV6dkl2pi7GXKSQ+V79NN0TOrpGPBn0p+pXenv20p6VkKtIwtbqO2aR0RGDUx201l3bGTcI+oLD98rIjAPLWlw2EPcjV9uMxyTxnx/RzlPjdOfvWF6cWXHUJgoLxJ2MEYGb5Kyq+v2L77hSUwg1uh3k4wmo50= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2017 10:32:00.6722 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3102 Subject: [dpdk-dev] [PATCH v2 2/5] eal/memory: rename buf_physaddr to buf_iovaaddr 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: , X-List-Received-Date: Tue, 05 Sep 2017 10:32:08 -0000 Signed-off-by: Santosh Shukla --- 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(m->buf_iovaaddr is thebuf_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