From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0064.outbound.protection.outlook.com [104.47.34.64]) by dpdk.org (Postfix) with ESMTP id 279781B8D3; Thu, 1 Feb 2018 10:10:09 +0100 (CET) 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=X6B7ht740qlz8U+WLACe45XfjTDNgv9FaHD7GbBr/nc=; b=XwqCUookcjvUwR15EIT+c9gFR85C/7DA7ZHsv4CgX4DDFKI/GMF7AyqTFJurQBxR+Vr3QJrOFXpgHwgHEg3i0RZl86qc2obnSlHwzhh9vaiADwIm43SujYsylqWuJC+vCFzoXeii4dTVFowDz7W+v9o1orkn1P+jdXhNLZsaGrw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [192.168.0.105] (103.76.56.167) by CY1PR0701MB1897.namprd07.prod.outlook.com (10.163.42.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Thu, 1 Feb 2018 09:10:05 +0000 To: Andrew Rybchenko , Olivier Matz Cc: dev@dpdk.org, stable@dpdk.org, jerin.jacob@caviumnetworks.com References: <1511539591-20966-1-git-send-email-arybchenko@solarflare.com> <1516713372-10572-1-git-send-email-arybchenko@solarflare.com> <1516713372-10572-2-git-send-email-arybchenko@solarflare.com> <20180131164504.cnfgfwo2x3ftxnaj@platinum> From: santosh Message-ID: <90005aad-1508-44bc-92a4-7c5d5f7b0246@caviumnetworks.com> Date: Thu, 1 Feb 2018 14:39:49 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [103.76.56.167] X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (10.174.220.25) To CY1PR0701MB1897.namprd07.prod.outlook.com (10.163.42.27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 76f93c61-61c1-4792-d788-08d5695396a0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY1PR0701MB1897; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1897; 3:u/od/HoY4ompjaP0RWTirAf/bWgqbRjwOdk2te8OnKQRMcqzDh9+Lib+80kLCasLRnCexulK0U3jXjyOzNW4SDci4A619NRefFed6gFRDiqUX5MTMO9hcNbyNt3uX2n19Mx4bZPREzuxc69kehuaQR26gofT/lxrNHPCAIt4GJ2C4IJ21TTxYP+BIGTpjEHGFXOad618KfJvvlz1SMYFZMzulPdw6I4MI0z/in03s1hpyLUjYS+outZg61UXBGcG; 25:vUFTLW1C+e5LMg6NSTuXGJXzU7MDKK3EcEMQmS8AGeRsXKffGM7ZSDLbMF3KiTkNdlfxOBs8qhnDsFF039A2MH9O8DZp9A5A1MC4B9lYlG2HcAgycc+Lh1pidxVMrYGjEVPzla0J3znX91qvH2/aMGkXvA53AcKlrxDruvqedLbzyA34ewB6ioru3qbe5fGD59KiA8jsEa8Ozbt+w7PqE97QO+2TKMmuIWgLsGEGwXT4ZF7sqkABuxtlSyHJ32OfqoPLtL3Kyrb32NkPuDTKMH2q3JqlIeZNr7bEypb5Ww5NdX8E9i96aWfi5ISSNFl4h9/XwREfSDQ50Qj6zy4BTQ==; 31:ZN6TqrfiLqm5Tc4sQ+Vk4lQVxQO+nWaPQ83jFgIp1hW/kEWc7cMigt4+ZWpW/6w7hN7baNSNz0C92awM19eQRwvUpRNsXKBhdjQFuGIehRuGXLxWxf1mSWtV/NIlfTH6u9dKzMScIJ5K4vIsG/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Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(10201501046)(93006095)(3231101)(2400082)(944501161)(3002001)(6041288)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:CY1PR0701MB1897; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1897; X-Forefront-PRVS: 0570F1F193 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(346002)(366004)(39380400002)(396003)(39860400002)(376002)(199004)(189003)(83506002)(316002)(93886005)(53546011)(77096007)(26005)(105586002)(8936002)(64126003)(229853002)(97736004)(86152003)(58126008)(8676002)(81156014)(31686004)(81166006)(36756003)(42882006)(3846002)(16526019)(6666003)(6116002)(2950100002)(110136005)(52116002)(5660300001)(386003)(65826007)(76176011)(59450400001)(2486003)(23676004)(52146003)(16576012)(478600001)(7736002)(230700001)(25786009)(305945005)(4326008)(107886003)(6246003)(31696002)(2906002)(53936002)(72206003)(106356001)(47776003)(50466002)(6486002)(90366009)(68736007)(65956001)(66066001)(65806001)(117156002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1897; H:[192.168.0.105]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjA3MDFNQjE4OTc7MjM6a3hYRnFJT0dkNEdGRjUrbU5PSFVIWXVj?= =?utf-8?B?MmFaMSs1MldQQ1dVdm8rMFBjRS8zeitsTngrYitYckR6KzRKL1BTWGhHOXpI?= =?utf-8?B?eDZRM21HcnNZK1E2T2dNbXdyN21Sdy9DQ1UyTFF4UkRndGlMT0N2TVUxQTc4?= =?utf-8?B?T016OE82alhoY1hTVXJTZUU3a1puRUF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: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2018 09:10:05.4524 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 76f93c61-61c1-4792-d788-08d5695396a0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1897 Subject: Re: [dpdk-dev] [RFC v2 01/17] mempool: fix phys contig check if populate default skipped 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: Thu, 01 Feb 2018 09:10:09 -0000 On Thursday 01 February 2018 12:24 PM, Andrew Rybchenko wrote: > On 02/01/2018 08:05 AM, santosh wrote: >> On Wednesday 31 January 2018 10:15 PM, Olivier Matz wrote: >>> On Tue, Jan 23, 2018 at 01:15:56PM +0000, Andrew Rybchenko wrote: >>>> There is not specified dependency between rte_mempool_populate_default() >>>> and rte_mempool_populate_iova(). So, the second should not rely on the >>>> fact that the first adds capability flags to the mempool flags. >>>> >>>> Fixes: 65cf769f5e6a ("mempool: detect physical contiguous objects") >>>> Cc: stable@dpdk.org >>>> >>>> Signed-off-by: Andrew Rybchenko >>> Looks good to me. I agree it's strange that the mp->flags are >>> updated with capabilities only in rte_mempool_populate_default(). >>> I see that this behavior is removed later in the patchset since the >>> get_capa() is removed! >>> >>> However maybe this single patch could go in 18.02. >>> +Santosh +Jerin since it's mostly about Octeon. >> rte_mempool_xmem_size should return correct size if MEMPOOL_F_CAPA_BLK_ALIGNED_OBJECTS flag >> is set in 'mp->flags'. Thats why _ops_get_capabilities() called in _populate_default() but not >> at _populate_iova(). >> I think, this 'alone' patch may break octeontx mempool. > > The patch does not touch rte_mempool_populate_default(). > _ops_get_capabilities() is still called there before > rte_mempool_xmem_size(). The theoretical problem which > the patch tries to fix is the case when > rte_mempool_populate_default() is not called at all. I.e. application > calls _ops_get_capabilities() to get flags, then, together with > mp->flags, calls rte_mempool_xmem_size() directly, allocates > calculated amount of memory and calls _populate_iova(). > In that case, Application does like below: /* Get mempool capabilities */ mp_flags = 0; ret = rte_mempool_ops_get_capabilities(mp, &mp_flags); if ((ret < 0) && (ret != -ENOTSUP)) return ret; /* update mempool capabilities */ mp->flags |= mp_flags; /* calc xmem sz */ size = rte_mempool_xmem_size(n, total_elt_sz, pg_shift, mp->flags); /* rsrv memory */ mz = rte_memzone_reserve_aligned(mz_name, size,...); /* now populate iova */ ret = rte_mempool_populate_iova(mp,,..); won't it work? However I understand that clubbing `_get_ops_capa() + flag-updation` into _populate_iova() perhaps better from user PoV. > Since later patches of the series reconsider memory size > calculation etc, it is up to you if it makes sense to apply it > in 18.02 as a fix. >