From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0071.outbound.protection.outlook.com [104.47.32.71]) by dpdk.org (Postfix) with ESMTP id 5122228F3; Thu, 1 Feb 2018 11:17:48 +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=Baoet6g8yYbw3/ZcMKdAp4bTq3wpk+vPlPpcHC7qrGc=; b=UxwUES6rZLGWArRvlnKAJj+aXMCbGN4TEco3I/Ud7gzCWp8uZwsIt3qWVfZLJ6oSHG6Cpv7ntrz+9bMKYR0mg2nLEgjZDTVE2EEXGerKOQIAbUMnq+mdLOaLoxlfF+Dxf7eofwpRn2VXtg7Wn2VImn1R2ZE/KX1oTVOnWSnnEo0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [192.168.0.105] (103.76.56.167) by BLUPR0701MB1891.namprd07.prod.outlook.com (10.162.88.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Thu, 1 Feb 2018 10:17:44 +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> <90005aad-1508-44bc-92a4-7c5d5f7b0246@caviumnetworks.com> <53796b3f-b2c2-dcfc-a10b-71ce1a68d3d2@caviumnetworks.com> <618e4eb2-e66c-592c-2065-f86328916d5d@solarflare.com> From: santosh Message-ID: <37391638-fa88-4e50-d4a9-f83e24dc2667@caviumnetworks.com> Date: Thu, 1 Feb 2018 15:47:29 +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: <618e4eb2-e66c-592c-2065-f86328916d5d@solarflare.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [103.76.56.167] X-ClientProxiedBy: PN1PR01CA0095.INDPRD01.PROD.OUTLOOK.COM (10.174.144.11) To BLUPR0701MB1891.namprd07.prod.outlook.com (10.162.88.152) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0202814e-95db-4c77-dd60-08d5695d09fa X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:BLUPR0701MB1891; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1891; 3:2IXQ58385Th6l+XwSGusm4wOf9cWWAUU1k8rsffMTy4shO4doJi/8ripBa+U8rZkpEROnxZJ9/fffYzmpdOUx4aO9CSjMpBj6F8dMa7V7mSvT8cVkUVSGg/4esDWA+0YKb96DTEtd5vY/0tUnHskixFgXgiO0HnmO/uTpxiED/kQb0TDMU92/agFxgJjeLuAV5x5AtoxKuDXXZq+sBIkQEGCZC09FPzPzylNeuNWL+7T9IA8I7tHsG0WDKduUjho; 25:ElxYWnTJKH0YdWfs3LBM504NXZ8miODX4pD9h3ZzYKY6KjJB2KH4YUaLlUtGb6pAJQqbycgqk4qLBYRRALwWEpYqhPJSsO7ltMvezH9Jwud9fMOClHq+rWZfL/Tj3UAlPVYdl3+aF/57CsBf+emBT3/S4P4lPGJtsslAgypoYgzBpCakK6kNLDAVDq7EwsLp9MUDrdxxWeZWnA9yD7nhMc73v4U46PUt7sc9dfzAV/j+wl7K5eR7GsU4fJCTWCC9dBgKPLSHWjZquVOXg4rbemLKh0XgaVgle4bQxHraR4H5ObnymStvliBDefGeUpaCA+mf1hFJDSgpX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T8mFJrq7xeC3HPFNZXdQa9fmX5jU7P/BunTRLb3B2sR+z3p2Uhc/DAl0/+DToQjW0qnYt6dtaBGhX0TP4otYB7hVHGuwk5SXg9ckpfE2CHDo5IwNuHzKPthNweBUtZvoy2P0f+anYk0hsoZAnoXk7W2g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(3231101)(2400082)(944501161)(10201501046)(3002001)(6041288)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:BLUPR0701MB1891; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1891; X-Forefront-PRVS: 0570F1F193 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(346002)(396003)(366004)(376002)(39860400002)(39380400002)(189003)(199004)(8676002)(93886005)(117156002)(81156014)(107886003)(6666003)(36756003)(31686004)(42882006)(8936002)(65826007)(65956001)(2906002)(5660300001)(31696002)(316002)(97736004)(47776003)(16526019)(16576012)(2950100002)(2870700001)(105586002)(68736007)(65806001)(110136005)(386003)(72206003)(50466002)(52116002)(64126003)(86152003)(53936002)(53546011)(59450400001)(6116002)(66066001)(81166006)(90366009)(23676004)(52146003)(58126008)(2486003)(76176011)(6486002)(7736002)(26005)(478600001)(305945005)(3846002)(77096007)(25786009)(4326008)(83506002)(229853002)(6246003)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1891; H:[192.168.0.105]; 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?MTtCTFVQUjA3MDFNQjE4OTE7MjM6T09GSjhzMDJlY2VwVFZLdG9SMlJZVGxJ?= =?utf-8?B?dTRQZm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qr7v2qZWCaxd/gwp7kr7qXUzUCP3syVI1M/Qf1wivEQEIoUEdozJeRH+DNEIwdYXC86ysNViOLX2XfudvzXlZvqFZuJaixjKpys20UneMOW SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2018 10:17:44.9041 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0202814e-95db-4c77-dd60-08d5695d09fa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1891 Subject: Re: [dpdk-stable] [dpdk-dev] [RFC v2 01/17] mempool: fix phys contig check if populate default skipped X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 10:17:48 -0000 On Thursday 01 February 2018 03:30 PM, Andrew Rybchenko wrote: > On 02/01/2018 12:30 PM, santosh wrote: >> On Thursday 01 February 2018 02:48 PM, Andrew Rybchenko wrote: >>> On 02/01/2018 12:09 PM, santosh wrote: >>>> 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; >>> Above line is not mandatory. "mp->flags | mp_flags" could be simply >>> passed to  rte_mempool_xmem_size() below. >>> >> That depends and again upto application requirement, if app further down >> wants to refer mp->flags for _align/_contig then better update to mp->flags. >> >> But that wasn't the point of discussion, I'm trying to understand that >> w/o this patch, whats could be the application level problem? > > The problem that it is fragile. If application does not use > rte_mempool_populate_default() it has to care about addition > of mempool capability flags into mempool flags. If it is not done, Capability flags should get updated to mempool flags. Or else _get_ops_capabilities() to update capa flags to mempool flags internally, I recall that I proposed same in the past.   [...] > The idea of the patch is to make it a bit more robust. I have no > idea how it can break something. If capability flags are already > there - no problem. If no, just make sure that we locally have them. > I would prefer _get_ops_capabilities() updates capa flags to mp->flag for once, rather than doing (mp->flags | mp_flags) across mempool func.