From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0047.outbound.protection.outlook.com [104.47.42.47]) by dpdk.org (Postfix) with ESMTP id 560AF7CBE for ; Tue, 5 Sep 2017 12:32:10 +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=ckaMwRWWnFBBE/WbmWmnmhqcpdKwB0JKiZ6p3S0/7g8=; b=Y0fUj4gl45eP+m1QhbDkjm9np2GwqjCO63OA+f+x48A8DwWVOofCnW/oshx06YUlxNBEQN+3/b1KgXyDLgKccEIt8pqHyPv5PGurdtBRvw+EtaGkZU1jfQ/Ujjdv8INKj78xB7HeGKhYBkkBOdHbW+Wyv51KhxmF8n6j977IkBI= 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:05 +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:17 +0530 Message-Id: <20170905103119.20511-4-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: 7fa4a13e-25a9-455c-8003-08d4f4495c53 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:GPIa1wvcPyVDH56Wisma7AHi/NmJs3wXcCkIHWyBzX/5Q1fRi9izYHkp5It0o+YyUVSYziwDyj59c7dcowonR3k2d7JcZvQVjui/Way65vqe1BgUmaSCsJ58DSepOsCXLDD6OoGBC7jazlr26ndHdQKaU/ftQ9k+GhAzJQFHy7OPAsTRFifzWmbOcKhpjMognzg44z5Ca3YRDdmTM2DxOOg/3SyqD2FRhwHKRRpLEAFj3Pu9jRKin09BN1piJyJq; 25:eySIBWSVVVbpJpnHB5NXHGZe5lH3vunDWeRYCUG2Mk/scLW15RB024Y2tD8EZv3P5C64brPnQBqAJhkqfkIzxM7fOrgzN+Pw4UZGmhEaI96S4DfdCkyCFLe8Ch5x4VVHUPqGnxTMElc95cYOEcAwjaVxQkUiVjUXeVxkki1nBChGknbB5+sOp0L+RctF20x9d9Q01dt8JAeumrtn8s6VS+gAcEpKa2vvMITMQYouy8qgsEs+1Lz6R2EmwYzZhGHZxoAkP0ELf/72LEUkKOX1+F8oIYIAmF5dCae/0hnLWZPK/T7yooUtZPVW/ycqr+Kc/lThtTcWX8JlUr5UXnxRog==; 31:fbndJEQLJzt4g7i2nbX4ez7Kt9DUFoG0mxtChHjBB9mIuiGUaZDN404+aHbFkp78iPd7jDDZp6TS+wxkWL9UGSTrlZavYxZxd6FzVwXoUAItmismawcdWIJq8FzlEAjiMHj2zYsc2DKb0IVP9ClaVTbOddLKfv46ZnduTZ3vBey2c6c/Coizet5aKdHBisngoW1weDYegJK9XLbhSDrRRl08RFhBUkqA/8saf2o939c= X-MS-TrafficTypeDiagnostic: MWHPR07MB3102: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3102; 20:AIFfyGDnqgeDPG4ooYcOjxA+uAHr3G9jFio+oFewvPfRe2nTNJQuKB4iJ25PsETC7PvrBP7wxVtQn3F2fkw3UbXU6OC8u4Ny+iITQFdAxfZWISh0HMKhIZQbXuc1W9Mu7rPtEXmf/idO55zG6VMSW2KReFDpA20kC3plmjSvUqwRvNXXCfkMw00twesUnPJUDctn0Spqcxg4vSAbrOKoAwrI9ilNjEj/RjrimeV8Hxa5bDohTHkfHLjG6NcOBz90NsiCSVvNPqXW82fC4aGHWHmnU6Hx5DpbccWoq5BF/tkIAJHQHF7FW3LsWUHG6O7EPPKzTCoGOjKraz146zK1BGeYwmyXaNPTxeX++VxSFZ4sLarsELmnC2ro3L+SiUDe7J7zhoox6ew3BCmQCzox92MggFoIxNTx8MAqaPDr/jN/ZPGqMTmfc39eiei+MMG1GIs8jrta9CVtvMt98mNghb08m/cvsgmWe70aj1/vw2MrW1X3Q22glNUVzHA+UOvQHgIhb+P5gwIyA+6n58dm+YpHUjI29OxG0jwwatNSdeYz3dUVUIPUIb6tnKOjRgB6jw9YaW9DUCq79lYS56XswuKhGF32HWMMXoAU6nFtSFs=; 4:+XlmEdTynWazyxuqPnAMGn9WrM16j4cCw3oUwmDVPgP8Uoz3ahyKbVbL6NKNkn+yeRBrardDFErUklOv5kUC2qPlUhyzSW7VlnhYp3nPviph2HZOtCFgbtfjMz5msPIaCfgNYk5xmxjQ9rPPkehMwuSAQK2zB+DgHSbNEcWuwlgt6gpWJJ7ercI4SKypvXJQ5j3fEeyK904Pz52sDzr4XyBjOibD1FT9VT3eddlPsaa4xh8TaAdOtK/JQf/QChrg X-Exchange-Antispam-Report-Test: UriScan:; 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)(6512007)(76176999)(66066001)(478600001)(47776003)(189998001)(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:d21aiX1TcptNPcu5CEYxAhG8PgbpeyEW54UVEo3C9?= =?us-ascii?Q?6E4ioelsiF25R4l+DXIVHkZ+/+wrfutVb+95UZWaY1FsQtDtjhF/pUp/GclI?= =?us-ascii?Q?9RbOQ4k/WKPCRkYpNbcP1bjG/UsZy+EWv0rPbPo1iVMHfH/N4rQVB+2dMoPb?= =?us-ascii?Q?T1n2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Kg7mbPCIhZCs9TQu0qqzItVMEqgtNkpNo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2017 10:32:05.6879 (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 3/5] eal/memory: rename memseg member phys to iova addr 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:10 -0000 Renaming rte_memseg {.phys_addr} to {.iova_addr} Signed-off-by: Santosh Shukla --- v1 --> v2: - includes freebsdp v1 build fixes. lib/librte_eal/bsdapp/eal/eal_memory.c | 4 ++-- lib/librte_eal/common/eal_common_memory.c | 2 +- lib/librte_eal/common/include/rte_memory.h | 4 ++-- lib/librte_eal/common/rte_malloc.c | 5 +++-- lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++---- lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 ++-- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c index 10c2e121f..d8882dcef 100644 --- a/lib/librte_eal/bsdapp/eal/eal_memory.c +++ b/lib/librte_eal/bsdapp/eal/eal_memory.c @@ -73,7 +73,7 @@ rte_eal_hugepage_init(void) /* for debug purposes, hugetlbfs can be disabled */ if (internal_config.no_hugetlbfs) { addr = malloc(internal_config.memory); - mcfg->memseg[0].phys_addr = (iova_addr_t)(uintptr_t)addr; + mcfg->memseg[0].iova_addr = (iova_addr_t)(uintptr_t)addr; mcfg->memseg[0].addr = addr; mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K; mcfg->memseg[0].len = internal_config.memory; @@ -114,7 +114,7 @@ rte_eal_hugepage_init(void) seg = &mcfg->memseg[seg_idx++]; seg->addr = addr; - seg->phys_addr = physaddr; + seg->iova_addr = (iova_addr_t)physaddr; seg->hugepage_sz = hpi->hugepage_sz; seg->len = hpi->hugepage_sz; seg->nchannel = mcfg->nchannel; diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c index 996877ef5..5ed83d20a 100644 --- a/lib/librte_eal/common/eal_common_memory.c +++ b/lib/librte_eal/common/eal_common_memory.c @@ -100,7 +100,7 @@ rte_dump_physmem_layout(FILE *f) "virt:%p, socket_id:%"PRId32", " "hugepage_sz:%"PRIu64", nchannel:%"PRIx32", " "nrank:%"PRIx32"\n", i, - mcfg->memseg[i].phys_addr, + mcfg->memseg[i].iova_addr, mcfg->memseg[i].len, mcfg->memseg[i].addr, mcfg->memseg[i].socket_id, diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h index 5face8c86..6b148ba8e 100644 --- a/lib/librte_eal/common/include/rte_memory.h +++ b/lib/librte_eal/common/include/rte_memory.h @@ -98,14 +98,14 @@ enum rte_page_sizes { */ #define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE) -typedef uint64_t iova_addr_t; /**< Physical address definition. */ +typedef uint64_t iova_addr_t; /**< Iova address definition. */ #define RTE_BAD_PHYS_ADDR ((iova_addr_t)-1) /** * Physical memory segment descriptor. */ struct rte_memseg { - iova_addr_t phys_addr; /**< Start physical address. */ + iova_addr_t iova_addr; /**< Start iova(_pa or _va) address. */ RTE_STD_C11 union { void *addr; /**< Start virtual address. */ diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c index 3ce6034bf..b65a06f9d 100644 --- a/lib/librte_eal/common/rte_malloc.c +++ b/lib/librte_eal/common/rte_malloc.c @@ -254,7 +254,8 @@ rte_malloc_virt2phy(const void *addr) const struct malloc_elem *elem = malloc_elem_from_data(addr); if (elem == NULL) return RTE_BAD_PHYS_ADDR; - if (elem->ms->phys_addr == RTE_BAD_PHYS_ADDR) + if (elem->ms->iova_addr == RTE_BAD_PHYS_ADDR) return RTE_BAD_PHYS_ADDR; - return elem->ms->phys_addr + ((uintptr_t)addr - (uintptr_t)elem->ms->addr); + return elem->ms->iova_addr + + ((uintptr_t)addr - (uintptr_t)elem->ms->addr); } diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index 405c15bcd..5d9702c72 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -154,7 +154,7 @@ rte_mem_virt2phy(const void *virtaddr) if (virtaddr > memseg->addr && virtaddr < RTE_PTR_ADD(memseg->addr, memseg->len)) { - return memseg->phys_addr + + return memseg->iova_addr + RTE_PTR_DIFF(virtaddr, memseg->addr); } } @@ -1059,7 +1059,7 @@ rte_eal_hugepage_init(void) strerror(errno)); return -1; } - mcfg->memseg[0].phys_addr = RTE_BAD_PHYS_ADDR; + mcfg->memseg[0].iova_addr = RTE_BAD_PHYS_ADDR; mcfg->memseg[0].addr = addr; mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K; mcfg->memseg[0].len = internal_config.memory; @@ -1319,7 +1319,7 @@ rte_eal_hugepage_init(void) if (j == RTE_MAX_MEMSEG) break; - mcfg->memseg[j].phys_addr = hugepage[i].physaddr; + mcfg->memseg[j].iova_addr = hugepage[i].physaddr; mcfg->memseg[j].addr = hugepage[i].final_va; mcfg->memseg[j].len = hugepage[i].size; mcfg->memseg[j].socket_id = hugepage[i].socket_id; @@ -1330,7 +1330,7 @@ rte_eal_hugepage_init(void) #ifdef RTE_ARCH_PPC_64 /* Use the phy and virt address of the last page as segment * address for IBM Power architecture */ - mcfg->memseg[j].phys_addr = hugepage[i].physaddr; + mcfg->memseg[j].iova_addr = hugepage[i].physaddr; mcfg->memseg[j].addr = hugepage[i].final_va; #endif mcfg->memseg[j].len += mcfg->memseg[j].hugepage_sz; diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c index 946df7e31..c03fd713c 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c @@ -706,7 +706,7 @@ vfio_type1_dma_map(int vfio_container_fd) dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map); dma_map.vaddr = ms[i].addr_64; dma_map.size = ms[i].len; - dma_map.iova = ms[i].phys_addr; + dma_map.iova = ms[i].iova_addr; dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE; ret = ioctl(vfio_container_fd, VFIO_IOMMU_MAP_DMA, &dma_map); @@ -792,7 +792,7 @@ vfio_spapr_dma_map(int vfio_container_fd) dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map); dma_map.vaddr = ms[i].addr_64; dma_map.size = ms[i].len; - dma_map.iova = ms[i].phys_addr; + dma_map.iova = ms[i].iova_addr; dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE; -- 2.11.0