From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0061.outbound.protection.outlook.com [104.47.41.61]) by dpdk.org (Postfix) with ESMTP id 1312E1B19D for ; Mon, 18 Sep 2017 17:08:25 +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=lNievjS9WnBOInaWR5WSPrJywUojkIe0mliDj3i/4Bs=; b=GaHV8BaYztKtb+c5hdOF+dGvdTMDpDqBbLifzjbTCgQtV45ZRVd7ixUTfD7dIZBMJCM5fsYVvkjGb3+e+hV0Lef/7cE9ZMZ227oswzrXju0WFCQuYBxcf151DdN/qUscQobx6ZWlDfNGXsI9r14mZfYneANfbf0N4dD6/hth6Uw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [10.89.1.12] (14.140.2.178) by BN6PR07MB3092.namprd07.prod.outlook.com (10.172.105.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Mon, 18 Sep 2017 15:08:22 +0000 To: "Burakov, Anatoly" , dev@dpdk.org References: <20170814151537.29454-1-santosh.shukla@caviumnetworks.com> <20170905103119.20511-1-santosh.shukla@caviumnetworks.com> <20170905103119.20511-4-santosh.shukla@caviumnetworks.com> From: santosh Message-ID: Date: Mon, 18 Sep 2017 20:38:07 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: PN1PR01CA0116.INDPRD01.PROD.OUTLOOK.COM (10.174.144.32) To BN6PR07MB3092.namprd07.prod.outlook.com (10.172.105.10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6038857b-306a-4071-7dba-08d4fea71b35 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:BN6PR07MB3092; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3092; 3:ysrHyuSwQU3AT7k1EX8ykrtiiG7lk3b6+0Vj8G4QpCtQd7lZBXQ1vlfEqE6p74R0Yen6JNuPuCvkOZ4S1GiZ7b5w2WYiR07fCmaiI4XQHGy2vCyWxHU4uD92CCLdlFkfi5zlRgfvr8EvXQmSJMCYbEPcqJQ3mOFRcSSLQTYRUxbZ0zsacAU/RGr4ZzjALQiPyjz9p06N0QmlyAJi3177vOaU+HH/nmDFSgLRpw23xtWY8V8idu0+wyhONeQq6Wy9; 25:agaxOLwhE7Fddnbge/59rHy46FxaB944CZWO44hELFV4m4xUTjStQaas/MV4Y3wrl3UnvfD/UxL1nuWj4fU0MWuj3tML9kLQUhW05YgMpPqw7E0cEdHun6GEDQIU1GL1alZynrBjbvu6JLmgUeolw5WFYhVu6fkpF7tZHRRIG5jRDpXe0cyXTSNh5iwIMGmD4kUUcRbM2QfRlFRHJw/taCa0gRTST0/luFpnACSc2ewP7b1lIr0TUNw4/TGUhbA5KsmzhRTdWxUS7Y5kOEYa+q0yLy88kcFMHktb4KjXLpygapk4VBUvV/8f0OVjbDRGA9AsOQ7zwheqDdeTww4Skw==; 31:qPtz4DbQt8/bXGtEjK1+pdk06PS1jBMs2X9TkS8zePn4WNjpD4p8KYRbuw/mQHdfra89LDbYWrpBL/Ej4g1D360yCY9iCVXKe5fSgwORX4bBAQFW3nyGwdixd4ZbQZ0ZcS1R+FRdW5BFjp64iPGT5mZX9eCwtUmCPTNGhCrh92DM1O7JQNKSf8QGLubFftk1vPLTCm4IDpUzv/AIhgY+6TIz6yfGfLK/r7LSNj5RgbI= X-MS-TrafficTypeDiagnostic: BN6PR07MB3092: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3092; 20:GieZM8KEUaQHPuRS4HhNgimYRZxUBK2Tn/2y4z6wv99YIow4PIS6EisxSj2bzv3zFO8qURlggm2nHQ95tLJsmN+/gclr0s1jW41LFFN3jkbKMsKS60moNWUJB/ohsV5M81Hy+WTkBK1wv0U04Kvs0mzySb3Pc9k57kHQROQxMTsVrc8Db0JlVkC0+2Q1oGHDZ6IbhHNw4+Z+G9MUsH7jh2r6/E4G31y1mRrY+RllwcLNn6smac7jnUKpW40LCCdT6mBCbIbU4cSI6CZ9f3V4yQEze6xBdzn1hPpxTW/8VgGPHC9BzHDkb2w7JimjiKh3RRKVW/KIx38vmnP0Hg7t6GjGaCpzGFSMveaVhLkyiFAFkVQwg65oiwStuD5HPXwc26HxrRuwfg7o6Eop9TtHE9V9MH9LqukRPfiOMFrtatyGDXX9ieAq74Rc9iXUjqkff2xufrNW7nX92aTTFB3cltawGjb2gPq6IHFlIcE5jYNmItXSRRnFmBsz+p1H6b1B9EJ/Gn6SaEL5xePHOyQXaZOMVsXso+syo822wl2T9ZmleTWnWo/POvcby8mwjAjbWL48ahrHlI7xkGc2RN5WTw9xTJcjbIJNN1DG4jOLGk4=; 4:LAFBI1BhVZ1NV6ruyod6VbYG4UJCA9UJI/F1fazrUrnVI25DlzB23WOXBTS6gRn+AVJG5FHKhA2lm/KaK5pgbUy1lCrXxt4MOXcROE5z9/2mErF3/jYel/+qsez/vuzM4oDDijBhN3oZPJQitD32TF9ZW/+feRGRRKFqsXYz0MqwhQAS3VbIIF+W4VGxt8/mmL6+S1G7d7K/5ZuxHxU4tktoLYNyMcM3wcgRg9SsYmOTTJa7mhe/g4LQed9WybsN 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)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(10201501046)(3002001)(6041248)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3092; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3092; X-Forefront-PRVS: 04347F8039 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6049001)(346002)(376002)(189002)(199003)(24454002)(377454003)(72206003)(8676002)(81156014)(81166006)(31696002)(93886005)(97736004)(189998001)(68736007)(77096006)(6486002)(6666003)(90366009)(42882006)(2950100002)(5009440100003)(230700001)(83506001)(16576012)(58126008)(65806001)(65956001)(23676002)(229853002)(316002)(6116002)(66066001)(36756003)(16526017)(3846002)(105586002)(110136004)(31686004)(50986999)(86152003)(2906002)(50466002)(101416001)(33646002)(47776003)(76176999)(6246003)(106356001)(64126003)(54356999)(478600001)(25786009)(8936002)(53936002)(7736002)(305945005)(65826007)(53546010)(5660300001)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3092; H:[10.89.1.12]; 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: =?utf-8?B?MTtCTjZQUjA3TUIzMDkyOzIzOnM1d3BpeDZPelR3R0lSRmxNdGM0TjhFcHNH?= =?utf-8?B?N0JwTGo0Wi96bnpXYko0MDRFOU02ejUzanhxSEdyTmpJMUwrWW5tL2srUk5Q?= =?utf-8?B?R1ZaNmdzZnp6ZUpyTTlxckN0ckd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FuclRxaU5Y?= =?utf-8?B?K3NtZFh1MzVGZ093d3g5SEdOcHVNNXQ5OTIzK2szT1FwUUF5bE0zOEE1QXVt?= =?utf-8?Q?pwRdn2?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3092; 6:zqlVqhrdu20uZa3hXSS5UBgZ0zHlTPPSP1f+Tbz1TZ+Oz9z10kq8aMNiP11SJkixmYfWvGAQkg7ZmoW1R6QmhqCXjYvS0V8+oD3GeAyC3XQBs0tvFfAnLBph7DQMAI6PP9CiBuJNSciVdyyb+xx+VjHONcOb5/ELKkXy6zlvG2vG+8psTmq5QnfO+9EXyglgDSXT+5gzylojeYYcap5vfRipNpT2+eMxtajjYuGXg8lIz72dUQJlNfs+2MnQp9AapceoPBdl++4AkdLUgNPX1tRH+73du3uOzTQuXi5TL+1A/gRjrCAaZ3YylwRSK97NemG4y0oyoJ/QP6cAbTsSMQ==; 5:tiWLwaTAh+cH5ua6jenS+gyPS+/zw51A7ePJRQDeVRkzmgDpgUeC70yuQS1uBW0S/EKQYPefVj3Q2IL/wDwU87wZ3s6OhktkRmyG9TPDcyaMUWwcRs0WB8kVn/t8ALiVrKBdu6wdWBdxIZP7t9wy7A==; 24:WosPKCY6tFMoonoqo2wJRJRCzCltjUipzE/xgJYLrSpW4+Tz/KokcfNLRakPBOdNe/xvIYAxhsNlYzfpO4APvCXUKOOQ9hKBb2GgCoijUzw=; 7:bsUdFU4kdBhmNiURU27FEhqZYeKLUtjqp3lBy2QjRB+qq45rrmJ440A/RbyX0aoYLL1zAdu4kWXSwYuUeHYybZUJC3QHsE/0RMd6yA61wNozKK+xYbE9uyu06Cfvbk80YE4NdOzyjIyA/tzNgitNje277lBXGc+keuRAuIFVJMfWvOwWawI/IrD33Di6Wfh03V7jYiHV7fF2/S/rS+aNgxKyXtrgdamVnweuNkm1Lp8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2017 15:08:22.4785 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3092 Subject: Re: [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: Mon, 18 Sep 2017 15:08:25 -0000 Hi Anatoly, On Monday 18 September 2017 08:34 PM, Burakov, Anatoly wrote: > On 05-Sep-17 11:31 AM, Santosh Shukla wrote: >> 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); > > Hi Santosh, > > I understand that this is a simple search-replace patch, but maybe you could go ahead and fix this to be RTE_PTR_DIFF, like in below case. > Agree, Little scared to do more than one change in patch series ;). Will do. It as separate patch, if that makes sense. Thanks.