From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0082.outbound.protection.outlook.com [104.47.36.82]) by dpdk.org (Postfix) with ESMTP id 8D4F67D7E for ; Mon, 14 Aug 2017 17:16:56 +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=HM32yYAg5J/MS5zrRBSaiGsLuScfJaM3Z7oAbZZrVRw=; b=E6HRiencBU5pJ+F7U9j/5lBUsCEjvRCQxmRkS9upAuCClEdj9Xe5KI04wEy5pmFSL9U6X9UwGYeQs+N+1P834dg+BbmFKTDVV5Jce5vaqFarJhnMcdt0SMpoklzHodkyTVIdE7wiTYaJ0hSUFagu7cmd17lXpaYnq5IQ/FSX5zM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from localhost.localdomain (14.140.2.178) by BN6PR07MB3091.namprd07.prod.outlook.com (10.172.105.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1341.17; Mon, 14 Aug 2017 15:16:52 +0000 From: Santosh Shukla To: dev@dpdk.org Cc: olivier.matz@6wind.com, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, Santosh Shukla Date: Mon, 14 Aug 2017 20:45:35 +0530 Message-Id: <20170814151537.29454-3-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170814151537.29454-1-santosh.shukla@caviumnetworks.com> References: <20170814151537.29454-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BMXPR01CA0040.INDPRD01.PROD.OUTLOOK.COM (10.174.214.26) To BN6PR07MB3091.namprd07.prod.outlook.com (10.172.105.9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0ccfd3b6-b14e-4f9e-b94e-08d4e3277f52 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN6PR07MB3091; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3091; 3:ZhLgQ8Zhj42uBTJ/2OaI/DEcdHuM5x72iMuIu/aXIfwhAVQCF29S7O0qNQqNbbaC2HeiLNPw/e98jO+uqNNEN5oG0nGDWYULGOT3rkCKdCXBuQboNT831/GStkkSAebYKL+ThuI9zRMxykNI7Q+0L/dU1gT8PgaM75MNOxRq0zuDZXfYrqtGW7yu0jjAJ+mcrwWx8k26PeRXWdim0MARen5q8GDVvAIlgxV7qcSE3tdYaWviIcSAshOhqwW/5V45; 25:zKvyVPqsa54+72m8Nw03DOvYzk0CKtZbPOgo4TiiW/5pVRUB4+BfPuL3Jw3WyG5CjukLtWAXNsfbB+Y2g0OQSHugs/eqNgfeyDR/JWTbzBOClavKJkGUNNhzIECciRYtH9slxg3/qGAxYFfvEQXqZ5RM2keGBf7Q2fRDanJiWE7OIklmzrWKcjeWchNHCNqui7soVEi2ViJkQ0XbVQnDiNyvgQCUuE1exka52cD1GSEl+EXVJuLKfFFGVg7EZbxN6l2G7DxHpfKIVjqt2uvildoVjaGwKI4Hwf/mBlYOd1f02EpbXMYmHdn6UGzipl98st9TyajryOAsEnHq30xGLA==; 31:+r0b3I4o+eAg1WwsVUrqDT0ZoHceKScVKqtE3ZY396vNfpm+Lv8gzo6YQmlQ1AteYWJwYKbjh0D4G61NGta9B97LeNsCgUnWKRajWEDYYOF3qhJ7GZgvMidrg6iaQiCNbaQ+N6y2H1vGjHMYgZ1DvzHSkFxkizJv8LJIFZudI6Ze4Vt7rvM+Hi5/ZXIRB3lrbarNleI3FRJY8sv0J7Ia7enH4blFbFJOBFhIULrVY54= X-MS-TrafficTypeDiagnostic: BN6PR07MB3091: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3091; 20:zHpM4h9xv0QjbVDtgMsG0rxiMtB7+qAcOAiqkg+2ST7FrHJBXvinaXwoCz5Iz/R/h+Y1K7JgiOdHTlNPI099pldwXykH3uR2/B1CGVwvgpojU+M1miKQM0tIOZ+MBJyoqKRh50AGhAnWQsOEy9mguom3s5hbZolCHow8c7GCnhXXMD5Ewcmttn6DUvGtkB37dXkx7BXrVyRsGN87Mmb8/ei2x3DENjuSxNd0auxzlZ7fFkYY3FhOy+YroH+itXlFD6ACjS793hv+nZRxlwh33dA0aMjQ9LqPXSlHRE39k5aNcKfiy1sjFTbCvYZj9lTUFY6/3p+RvdJNGwu2rBroLHtbFjtEE5WdV5me2Ri7JwP297Ll/1iRAjB80fj9LLqEupdO+TpK3X+bpzSteaJ8eP2KKyBMWX1YF22uqYYeHe5HNGMz9dR1J1B78qKlzpnYzpGrXCCQcVMk7izFY01lzhD33JserqHTvG5DakJSXL8hky9BvO84jW4P7VZPlUSgKYYfuEoxnNuPxHOudRM9G04Voqm9PAW1AhsYJOt0OGrgSO/yddYZvcvyPXUsM0pxGK5cunYf3dKpxDIznGBiWOuey5MUE/R0IveyoHOulTU=; 4:yYrHd1hVloNYAOoXK7E+djafXLJgrY45UnZx26F711xmqjzfZ6EQzzjqp4Lyzw0nfMwXfcm/dLUCq/NVIphtW1+zsgDyRkNxD/ZRCD9TUJd/p+LNpqS4bcZVLFnfGShjOvugKbljtZzUgybilbGlNEZ4ijqNH/Bs6RYXo9q2wcYt8Qi+k4lh4l93Xna25+FNXt6K9CEIJx7VksmSH3u9IAIkaMvEepCyqGJyhQziWeo848IX9d1xRmAywVmG/V4EKRlKhE9kEe9Bd/lktXkzEqyJ1b5kOSS438YefFogkWE= X-Exchange-Antispam-Report-Test: UriScan:(275809806118684); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(20161123558100)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3091; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3091; X-Forefront-PRVS: 039975700A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6069001)(6009001)(189002)(199003)(81156014)(2906002)(6512007)(478600001)(2950100002)(42882006)(6916009)(50466002)(48376002)(47776003)(107886003)(5890100001)(36756003)(5660300001)(5009440100003)(7350300001)(81166006)(8656003)(8676002)(53936002)(110136004)(6506006)(3846002)(6116002)(25786009)(2361001)(42186005)(4326008)(105586002)(2351001)(106356001)(189998001)(6486002)(50226002)(68736007)(1076002)(97736004)(575784001)(50986999)(76176999)(33646002)(7736002)(551934003)(6666003)(5003940100001)(305945005)(72206003)(66066001)(101416001)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3091; 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) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR07MB3091; 23:geHRt966mG8eBZ53N4Rtpev+4HMWYo3BjUEf69/hs?= =?us-ascii?Q?zvcSWWXC+ZXu3dCnWU9EOTzgGzPEZGfGtV4QDscPup9KEDx2KQRhxSXztDFE?= =?us-ascii?Q?j0NqT7JvPoNu5pYZ/D1BydZM9ONMURcVw3wkEbRKavXV8p087Gh6HRvcWEok?= =?us-ascii?Q?4xihg8/jrJxzHfQyoDwv+SgMDiRcEtzikSmgm5bfMf7OLeY/1lpEtwyDGFvY?= =?us-ascii?Q?UO5UA+B9aC35wGx8GCvLKcoE8VK7oZzfTPE9xEeF+gHtILvm9WiL4saYabWE?= =?us-ascii?Q?da30opkWK3eKYQJHW9wW6xcQSGd+/gP3a6QhEGr+FjrIef2ENUox9sHg80UN?= =?us-ascii?Q?X+6zyPsm27Q/7pAm2ws9BlsgZJV+7cEryBIlYFnu4mZHVWrRTdeQhljdnMc8?= =?us-ascii?Q?zTC9JU3qamPODakQKXP2Ro9C/QPr0ipkkfGPY1KMnLPuRDV59cSY3GiRD3LD?= =?us-ascii?Q?uc1hB4VjZW4qGF6j8oYczgsB46BgoLDMI3KLUVjH/Ka9tQsy4bhcpcR8gJVy?= =?us-ascii?Q?9mYFcn666drfJ2+q5LYV4ncfr5enTZQQ8ZGvpM0uA7Z98SSp9YfESuZior8r?= =?us-ascii?Q?4WUoxvSz2PReNxD8fqy3q45nXL82TItX9PSEM3bYRVCWahvdaSR5cBqvLfvI?= =?us-ascii?Q?K5T7R1F11hblitqIRikz+5wXDRb453JctPS2oJQxz5z8Y9tf0NjR3h/3cijr?= =?us-ascii?Q?YPIP9iHR60ndGp0Cxdr775ZaYXNNop/42qPSoKe0FAklFgsj838GBIQuShbn?= =?us-ascii?Q?69p7ZsviC8xA+oRpHWNIJwfFh9cNPTgLNilPPqfVQRBdGkDoANwI/hIPBkDa?= =?us-ascii?Q?PHW0DUDrpOsJBdA2midOqHs2uES43B0IyzALHou6CCMbT4siFATcUb3tUHrW?= =?us-ascii?Q?v+tpXfRU9OJMFtkcft9NaHPUielmOZvw/geiYtQieftxa/LTW3roDzlw1nEc?= =?us-ascii?Q?nHsVr5vm8AG2Nem1U6OIyL/Ul9GZtWAvfTE9GRQlEd5khDNduLthWpydezPA?= =?us-ascii?Q?saJ2TZ7FgNykQjrIa6cG5SEWlayFG6rp0/2aqyG+bz6CFm5Y5g34gRnHZg1x?= =?us-ascii?Q?c0y4wqnodsMUjMLXtzLhBsZR96BVRs4/zNgKwE9xB7A11qqZWRA4bN/OP8Rm?= =?us-ascii?Q?HFznxV6T1xJ59gHs/463YZO77Tyab99HsMNXu2Wh15Uk2tw+mxxDppypLls9?= =?us-ascii?Q?n9zdBgPLKQTWEeCt3DoiO4lDhbVYr71fEqzTN4DxrEz77IQULG/or0ZATsLn?= =?us-ascii?Q?GXhvRKck9YdT0Broy9/dB+9Z1jYQbukdDQlgcFNyjedd9XL2Ro/kpinQZifH?= =?us-ascii?Q?uIgMHo7kMQwxFUKqjkn2QjmZcA7qYDdEtMwlvka0XsvB4Ieust5Ed3atbAn3?= =?us-ascii?Q?CJ9+A=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3091; 6:ovfhEPZB/bkoO+R3mxTr7KudFD4elnJ/fXx7k9Q2prqe+x6pWV/p0MHuqIaeKnRZBO/6wG6bPTLnDTHKrCWTj5AdFqt2cL0lDCSi1iV+WTKjvNCtAW/5CzqztPozkeVReCxP4jvRolRnKF1zr5B854b/CFMiAFiZkRxZ+CcAYoKLyeMrMQyFeO3R7O93zQg/klmklg6oxIc22xNmbA7Z0LLgIqbS9juyoZR+pK0+Gn47fSUF+SLOishjUkScJun8HRu6qPBry053pf0N2VoJrEM0JOVD2rrPpnvumLHGApZshXUOD7V5KBbgM8Yrx4Z7+VDWKfzHvDLUWA0aBSXoQw==; 5:torbslqsHhECNw7wI+bd2aTqrpP3CywCHNVN/sjAp2G5YTJlUJ3U8U6uHt2XaMp10L4Hvi75g/MCapYs1ufYl9Kxe8cq7XbTGHXAxDHekYYzbT8gQjyN/fTPMcn9MKzS+H8Pg5pvvDToDpUyoJmlrg==; 24:o13dZjS0fmx2MPgBve46wxPN5A0iT4nmKVgEzi99MSRkFvY2ZNeBwEMz5MwlygvuIWMDhjBw+RQyEb8ZKfJi0T6KnO601zGZNf1Mq9820mE=; 7:/SLFDrSc9LQMjB3XZMzg6awxXgCU8sWrQhyeZYdFFRBycMOPC9qHo4HzJnXyNbjUWAov0zliIg6ivRbAZ0KHuX5TyFf9vLCX4YDmrrjUSHx5iiXyvSo+LCVsvkevyoYdLKnTZib/nPH2hEpuRUQE5mDDgtLDCbWOm+jh3nxaZ6t4Fu4oCH4n+FsCs84dSP9Hixx+tSR9KbybxmgJ14AmANrtFODR3Lvn5c+MqASV4aA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2017 15:16:52.0752 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3091 Subject: [dpdk-dev] [PATCH v1 2/4] 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: Mon, 14 Aug 2017 15:16:57 -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 +- lib/librte_eal/common/eal_common_memory.c | 2 +- lib/librte_eal/common/include/rte_memory.h | 2 +- lib/librte_eal/common/rte_malloc.c | 4 ++-- lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++---- lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 ++-- .../linuxapp/eal/include/exec-env/rte_kni_common.h | 2 +- lib/librte_eal/linuxapp/kni/kni_net.c | 6 +++--- lib/librte_kni/rte_kni.c | 2 +- lib/librte_mbuf/rte_mbuf.c | 6 +++--- lib/librte_mbuf/rte_mbuf.h | 14 +++++++------- lib/librte_vhost/virtio_net.c | 2 +- test/test/test_mbuf.c | 2 +- 31 files changed, 66 insertions(+), 66 deletions(-) diff --git a/doc/guides/prog_guide/img/mbuf1.svg b/doc/guides/prog_guide/img/mbuf1.svg index 5bd84d1bf..2f856bfd9 100644 --- a/doc/guides/prog_guide/img/mbuf1.svg +++ b/doc/guides/prog_guide/img/mbuf1.svg @@ -482,7 +482,7 @@ sodipodi:role="line" x="187.85715" y="347.7193" - id="tspan5240">(m->buf_physaddr is the(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/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c index 996877ef5..5ed83d20a 100644 --- a/lib/librte_eal/common/eal_common_memory.c +++ b/lib/librte_eal/common/eal_common_memory.c @@ -100,7 +100,7 @@ rte_dump_physmem_layout(FILE *f) "virt:%p, socket_id:%"PRId32", " "hugepage_sz:%"PRIu64", nchannel:%"PRIx32", " "nrank:%"PRIx32"\n", i, - mcfg->memseg[i].phys_addr, + mcfg->memseg[i].iova_addr, mcfg->memseg[i].len, mcfg->memseg[i].addr, mcfg->memseg[i].socket_id, diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h index 5face8c86..fc0fdf740 100644 --- a/lib/librte_eal/common/include/rte_memory.h +++ b/lib/librte_eal/common/include/rte_memory.h @@ -105,7 +105,7 @@ typedef uint64_t iova_addr_t; /**< Physical address definition. */ * Physical memory segment descriptor. */ struct rte_memseg { - iova_addr_t phys_addr; /**< Start physical address. */ + iova_addr_t iova_addr; /**< Start iova(_pa/_va) address. */ RTE_STD_C11 union { void *addr; /**< Start virtual address. */ diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c index 3ce6034bf..d03a5348a 100644 --- a/lib/librte_eal/common/rte_malloc.c +++ b/lib/librte_eal/common/rte_malloc.c @@ -254,7 +254,7 @@ rte_malloc_virt2phy(const void *addr) const struct malloc_elem *elem = malloc_elem_from_data(addr); if (elem == NULL) return RTE_BAD_PHYS_ADDR; - if (elem->ms->phys_addr == RTE_BAD_PHYS_ADDR) + if (elem->ms->iova_addr == RTE_BAD_PHYS_ADDR) return RTE_BAD_PHYS_ADDR; - return elem->ms->phys_addr + ((uintptr_t)addr - (uintptr_t)elem->ms->addr); + return elem->ms->iova_addr + ((uintptr_t)addr - (uintptr_t)elem->ms->addr); } diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index 405c15bcd..5d9702c72 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -154,7 +154,7 @@ rte_mem_virt2phy(const void *virtaddr) if (virtaddr > memseg->addr && virtaddr < RTE_PTR_ADD(memseg->addr, memseg->len)) { - return memseg->phys_addr + + return memseg->iova_addr + RTE_PTR_DIFF(virtaddr, memseg->addr); } } @@ -1059,7 +1059,7 @@ rte_eal_hugepage_init(void) strerror(errno)); return -1; } - mcfg->memseg[0].phys_addr = RTE_BAD_PHYS_ADDR; + mcfg->memseg[0].iova_addr = RTE_BAD_PHYS_ADDR; mcfg->memseg[0].addr = addr; mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K; mcfg->memseg[0].len = internal_config.memory; @@ -1319,7 +1319,7 @@ rte_eal_hugepage_init(void) if (j == RTE_MAX_MEMSEG) break; - mcfg->memseg[j].phys_addr = hugepage[i].physaddr; + mcfg->memseg[j].iova_addr = hugepage[i].physaddr; mcfg->memseg[j].addr = hugepage[i].final_va; mcfg->memseg[j].len = hugepage[i].size; mcfg->memseg[j].socket_id = hugepage[i].socket_id; @@ -1330,7 +1330,7 @@ rte_eal_hugepage_init(void) #ifdef RTE_ARCH_PPC_64 /* Use the phy and virt address of the last page as segment * address for IBM Power architecture */ - mcfg->memseg[j].phys_addr = hugepage[i].physaddr; + mcfg->memseg[j].iova_addr = hugepage[i].physaddr; mcfg->memseg[j].addr = hugepage[i].final_va; #endif mcfg->memseg[j].len += mcfg->memseg[j].hugepage_sz; diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c index 946df7e31..c03fd713c 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c @@ -706,7 +706,7 @@ vfio_type1_dma_map(int vfio_container_fd) dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map); dma_map.vaddr = ms[i].addr_64; dma_map.size = ms[i].len; - dma_map.iova = ms[i].phys_addr; + dma_map.iova = ms[i].iova_addr; dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE; ret = ioctl(vfio_container_fd, VFIO_IOMMU_MAP_DMA, &dma_map); @@ -792,7 +792,7 @@ vfio_spapr_dma_map(int vfio_container_fd) dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map); dma_map.vaddr = ms[i].addr_64; dma_map.size = ms[i].len; - dma_map.iova = ms[i].phys_addr; + dma_map.iova = ms[i].iova_addr; dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE; diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h index 7960afee2..4985b3079 100644 --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h @@ -116,7 +116,7 @@ struct rte_kni_fifo { */ struct rte_kni_mbuf { void *buf_addr __attribute__((__aligned__(RTE_CACHE_LINE_SIZE))); - uint64_t buf_physaddr; + uint64_t buf_iovaaddr; uint16_t data_off; /**< Start address of data in segment buffer. */ char pad1[2]; uint16_t nb_segs; /**< Number of segments. */ diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c index db9f48989..7f986f482 100644 --- a/lib/librte_eal/linuxapp/kni/kni_net.c +++ b/lib/librte_eal/linuxapp/kni/kni_net.c @@ -69,7 +69,7 @@ pa2va(void *pa, struct rte_kni_mbuf *m) va = (void *)((unsigned long)pa + (unsigned long)m->buf_addr - - (unsigned long)m->buf_physaddr); + (unsigned long)m->buf_iovaaddr); return va; } @@ -77,7 +77,7 @@ pa2va(void *pa, struct rte_kni_mbuf *m) static void * kva2data_kva(struct rte_kni_mbuf *m) { - return phys_to_virt(m->buf_physaddr + m->data_off); + return phys_to_virt(m->buf_iovaaddr + m->data_off); } /* virtual address to physical address */ @@ -88,7 +88,7 @@ va2pa(void *va, struct rte_kni_mbuf *m) pa = (void *)((unsigned long)va - ((unsigned long)m->buf_addr - - (unsigned long)m->buf_physaddr)); + (unsigned long)m->buf_iovaaddr)); return pa; } diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index 8c483c1f4..d12dde77d 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -456,7 +456,7 @@ va2pa(struct rte_mbuf *m) { return (void *)((unsigned long)m - ((unsigned long)m->buf_addr - - (unsigned long)m->buf_physaddr)); + (unsigned long)m->buf_iovaaddr)); } static void diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 26a62b8e1..0ff3acaba 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -135,7 +135,7 @@ rte_pktmbuf_init(struct rte_mempool *mp, /* start of buffer is after mbuf structure and priv data */ m->priv_size = priv_size; m->buf_addr = (char *)m + mbuf_size; - m->buf_physaddr = rte_mempool_virt2phy(mp, m) + mbuf_size; + m->buf_iovaaddr = rte_mempool_virt2phy(mp, m) + mbuf_size; m->buf_len = (uint16_t)buf_len; /* keep some headroom between start of buffer and data */ @@ -211,7 +211,7 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header) /* generic checks */ if (m->pool == NULL) rte_panic("bad mbuf pool\n"); - if (m->buf_physaddr == 0) + if (m->buf_iovaaddr == 0) rte_panic("bad phys addr\n"); if (m->buf_addr == NULL) rte_panic("bad virt addr\n"); @@ -244,7 +244,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len) __rte_mbuf_sanity_check(m, 1); fprintf(f, "dump mbuf at %p, phys=%"PRIx64", buf_len=%u\n", - m, (uint64_t)m->buf_physaddr, (unsigned)m->buf_len); + m, (uint64_t)m->buf_iovaaddr, (unsigned)m->buf_len); fprintf(f, " pkt_len=%"PRIu32", ol_flags=%"PRIx64", nb_segs=%u, " "in_port=%u\n", m->pkt_len, m->ol_flags, (unsigned)m->nb_segs, (unsigned)m->port); diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 4563b5dc3..995b86ced 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -411,7 +411,7 @@ struct rte_mbuf { * same mbuf cacheline0 layout for 32-bit and 64-bit. This makes * working on vector drivers easier. */ - iova_addr_t buf_physaddr __rte_aligned(sizeof(iova_addr_t)); + iova_addr_t buf_iovaaddr __rte_aligned(sizeof(iova_addr_t)); /* next 8 bytes are initialised on RX descriptor rearm */ MARKER64 rearm_data; @@ -597,7 +597,7 @@ static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp); static inline iova_addr_t rte_mbuf_data_dma_addr(const struct rte_mbuf *mb) { - return mb->buf_physaddr + mb->data_off; + return mb->buf_iovaaddr + mb->data_off; } /** @@ -615,7 +615,7 @@ rte_mbuf_data_dma_addr(const struct rte_mbuf *mb) static inline iova_addr_t rte_mbuf_data_dma_addr_default(const struct rte_mbuf *mb) { - return mb->buf_physaddr + RTE_PKTMBUF_HEADROOM; + return mb->buf_iovaaddr + RTE_PKTMBUF_HEADROOM; } /** @@ -806,7 +806,7 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header); * For standard needs, prefer rte_pktmbuf_alloc(). * * The caller can expect that the following fields of the mbuf structure - * are initialized: buf_addr, buf_physaddr, buf_len, refcnt=1, nb_segs=1, + * are initialized: buf_addr, buf_iovaaddr, buf_len, refcnt=1, nb_segs=1, * next=NULL, pool, priv_size. The other fields must be initialized * by the caller. * @@ -1214,7 +1214,7 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *m) rte_mbuf_refcnt_update(md, 1); mi->priv_size = m->priv_size; - mi->buf_physaddr = m->buf_physaddr; + mi->buf_iovaaddr = m->buf_iovaaddr; mi->buf_addr = m->buf_addr; mi->buf_len = m->buf_len; @@ -1262,7 +1262,7 @@ static inline void rte_pktmbuf_detach(struct rte_mbuf *m) m->priv_size = priv_size; m->buf_addr = (char *)m + mbuf_size; - m->buf_physaddr = rte_mempool_virt2phy(mp, m) + mbuf_size; + m->buf_iovaaddr = rte_mempool_virt2phy(mp, m) + mbuf_size; m->buf_len = (uint16_t)buf_len; rte_pktmbuf_reset_headroom(m); m->data_len = 0; @@ -1533,7 +1533,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m) * The offset into the data to calculate address from. */ #define rte_pktmbuf_mtophys_offset(m, o) \ - (iova_addr_t)((m)->buf_physaddr + (m)->data_off + (o)) + (iova_addr_t)((m)->buf_iovaaddr + (m)->data_off + (o)) /** * A macro that returns the physical address that points to the start of the diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index a5f0eebaa..73b92b378 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -838,7 +838,7 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vring_desc *descs, cur->data_len = cpy_len; cur->data_off = 0; cur->buf_addr = (void *)(uintptr_t)desc_addr; - cur->buf_physaddr = hpa; + cur->buf_iovaaddr = hpa; /* * In zero copy mode, one mbuf can only reference data diff --git a/test/test/test_mbuf.c b/test/test/test_mbuf.c index 3396b4a93..326b75dca 100644 --- a/test/test/test_mbuf.c +++ b/test/test/test_mbuf.c @@ -907,7 +907,7 @@ test_failing_mbuf_sanity_check(struct rte_mempool *pktmbuf_pool) } badbuf = *buf; - badbuf.buf_physaddr = 0; + badbuf.buf_iovaaddr = 0; if (verify_mbuf_check_panics(&badbuf)) { printf("Error with bad-physaddr mbuf test\n"); return -1; -- 2.11.0