From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0056.outbound.protection.outlook.com [104.47.34.56]) by dpdk.org (Postfix) with ESMTP id 849931B1B0 for ; Wed, 17 Jan 2018 08:49:52 +0100 (CET) Received: from BN6PR03CA0024.namprd03.prod.outlook.com (2603:10b6:404:23::34) by BN1PR0301MB0722.namprd03.prod.outlook.com (2a01:111:e400:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Wed, 17 Jan 2018 07:49:51 +0000 Received: from BN1BFFO11FD019.protection.gbl (2a01:111:f400:7c10::1:121) by BN6PR03CA0024.outlook.office365.com (2603:10b6:404:23::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Wed, 17 Jan 2018 07:49:51 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD019.mail.protection.outlook.com (10.58.144.82) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Wed, 17 Jan 2018 07:49:50 +0000 Received: from [10.232.133.65] (B10814-12.ap.freescale.net [10.232.133.65]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w0H7nmxM003331; Wed, 17 Jan 2018 00:49:49 -0700 To: Olivier Matz References: <1512563473-19969-1-git-send-email-hemant.agrawal@nxp.com> <20171219102456.ghipiyb2ig43d4nk@glumotte.dev.6wind.com> <830d3e36-921b-ef7a-51a4-6d135b15e973@nxp.com> <20171219110204.uqxw4xy66o65pnjz@glumotte.dev.6wind.com> <9adf0fc2-b233-26c6-b866-236d6277a4ed@nxp.com> <42572f99-99bd-ee70-e631-b817d1d679ac@nxp.com> <20171222135929.ei35n7gs55u3jqvr@platinum> <20180116135155.x5g576ax5gsy2ezv@platinum> CC: From: Hemant Agrawal Message-ID: Date: Wed, 17 Jan 2018 13:19:47 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20180116135155.x5g576ax5gsy2ezv@platinum> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131606489911079505; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(376002)(346002)(39860400002)(396003)(39380400002)(2980300002)(1110001)(1109001)(339900001)(24454002)(189003)(199004)(67846002)(83506002)(31686004)(65956001)(58126008)(86362001)(50466002)(76176011)(64126003)(105606002)(230700001)(47776003)(106466001)(65806001)(4326008)(53546011)(81156014)(8676002)(5660300001)(104016004)(93886005)(97736004)(77096006)(305945005)(356003)(81166006)(6246003)(31696002)(316002)(23746002)(6916009)(2950100002)(8936002)(2906002)(508600001)(229853002)(26005)(65826007)(36756003)(85426001)(53936002)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0722; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD019; 1:7k8+jAoiNsoCoRsWMF5x7ukU5OofQokole7vpYtoZf5hq0kTRrXHMwgRjbhobGH05r44tH6AbcXB5poPCHEkvPv1rZVILGqG75lzV3eLhvhAZ8jh3LfelZcfGsFfHCUI X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 272bdf4a-36e6-49c9-3251-08d55d7ee3c0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:BN1PR0301MB0722; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0722; 3:7TJj0UpG01OZ0Y6/OggB25AtzrVsv0Y6LQAFzfID7Ns1CdLX+YvC2K+ggjKv3DKanKTWH68hIwPs8PzutrXomnB5dmUeIC+GyMMVs9JLSy3MEsutU0hFx8s1bqa25xtLExATXGL6+BtyqUyxjGO0hJ3RIfM3myDt0pK/9WgdnDW3U7+MiNnJu1Qvsr4z9afNtTEeh5GYjOueYOoKwV2Li9rpXYeYRH3WfL7MYLxQKMDs42y0F0Gb4VTRporlF7J5rmbbRPeCQXJu+wl4XGiqtIPQiNoroQqnCrWiflOFQ/eqL7gT+IjiZepnR5/NUtgtVHEZeVJGHLszu0RVBeh+cziI3rN0/T+6PPx/x3N/HYc=; 25:gWxP7keqXw0VWsO0bpMzXdvCdd5SY6+ITfxtjfxt28Ji239HAHNylFFwdSR1nkx5+cwy741II5LBvsaN5S+Yo/V/DtfOo2kTKFQAMo4zUSF1sJaD4qnRrtgqfbgHe4RTjDjLbxhsmam8DVYh2zEu5TZ4QwWGAEBxAQSSXcke9iJ8qmm0s/q0kp4hjdO3t2BJwWcUv0ASEuAZK00Kd6sxTfRtS416fF3oSEqGfb11FxdlLXg0/lBtLWbsJl8W4K63kGAwjVYzwPOB0jtT0YvxbMLaSfh7CCJ/dGWX+1eOgS4mgDT9EuNyihtGa8PZA1/aC1l1LXoJ+rUlk9STtIifwQ== X-MS-TrafficTypeDiagnostic: BN1PR0301MB0722: X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0722; 31:T3HCtgQp1qhZ0ouxRx03XwcBRgk3LmEneSY3L25dmdL4kbAzJ6VPiLCLPK0n+zEawOe4+ijT9d4y2KDZ46e7Z8JPNr4SjrUE9SHl9iF2ZiF441M5st1dUd1+DkrTY+ew1ruQFlZhFNXwWeWyQsGmpeZnfIDZcV08EoFVhbe83iIgBlOP/02NGqXuBosuZE4H6XoVlMCso0olZFK7MZzpQ+78mt9gT72z1Nuoa7NnYFw=; 4:wSTb4pTIVNkzcgFRY8xRReAhGidfqjsPPnwOMmJN0UXFYaMhB/ZTAm7rEg7On6Gb98ZoqFCEOIEEjp5i81onOPX0TCL2I+PA8e39qM6DKy5DPDGeAIQdG6mRtD7b37Bg3x7XM6Vm1n0+N+K9fS/L8mTVtyukvJTtVwuHyLIGqC2K9vHZ/KQ+VcGmtmQoPQxNhZbJAmMllTX2e5jjacQ657UOLLZB5wILFUC/lXbZkPMRO2R8K9xf1mcSk/XodF9UR3Lc2grtJh3WJSAFjN5vWqQTujfU42nMus9pNKyuNMjaGO4V9334h2b44Y4fb7Fv X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(131327999870524); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(10201501046)(3231023)(2400042)(944501161)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123561025)(20161123556025)(20161123565025)(20161123563025)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201708071742011); SRVR:BN1PR0301MB0722; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN1PR0301MB0722; X-Forefront-PRVS: 0555EC8317 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BN1PR0301MB0722; 23:ogQuZ2nJkPS7+ohstNNJXcMZzAgd+em3FZQ?= =?Windows-1252?Q?zOKBbYCY02HsIcUWgUwdCYZL+1vjlBg/XQ50NUCJ5rHV9vhikN+YvqNT?= =?Windows-1252?Q?rUyW/Rvsgqqo1PqT/HUZ5GcOKycIm2n3C0I/z8oKIPDZy9WxfaRRfrzr?= =?Windows-1252?Q?JX8OHk4DIBwQk4HgQU25OFQDmxsGAo5DlCAD3E1gGqQ1d01auaqxWEA1?= =?Windows-1252?Q?tdCW1jDQ2TnsnEYFbQ9aacIeCEDOjy6FAx+d+/AypB971+hdc2w7iBFw?= =?Windows-1252?Q?/ExanmYJEywXs+XHmPhbusiVswKVDfuFms57wlLyjs3PCqL/xwft6A3c?= =?Windows-1252?Q?e5bwnwR+QQfWy8P6L1C7Bopg7ZwPAhFih0P4ERAR9Lsy57Olz6SdjiQX?= =?Windows-1252?Q?3TcViEr+Oya48/MGnPaxcGA9dBzsdHqzpWvUfHxZ3SxI9w7sMby1n3Dq?= =?Windows-1252?Q?3sSfZjm4lS7vW57BM1aJ9uWd7p6SOO37EBY7vens8npsf8yCFTuXjvUo?= =?Windows-1252?Q?6/Z3ai0UJUTKbYlTaV7KEg+cPtj3ZCizFtRIPpYeF1x6e2ays7s/IV1F?= =?Windows-1252?Q?nJaJzacBRceal2xe1YumRkXgDZFKlH1YCwyPRW/xlUcQKFj14L6pqnmw?= =?Windows-1252?Q?F0Ml1/Uybv1BUPq4yF/g5aEQHxHFNTmPzaMqeVylLPSnYYvKQp0ApM01?= =?Windows-1252?Q?w1N9G3swFtB25qU+m/d7g9LvDbAqW5lhxXiWpbvHzX1CGhxPSfG82gFy?= =?Windows-1252?Q?Q9IBD+J7zIRfgdObkoNX7DFl5DLgyyqFdSIejx4AoDV1uliY6bD35BGO?= =?Windows-1252?Q?5k/rO7dl+0Kk615XlfOhqPQ2VkbmcU3mYX7PXZKXQzPlcSm/MvF0xnhj?= =?Windows-1252?Q?poj5RvONaUb45y5e81jgrqIZjKZUWWePQqLZ96wcek3XQweirQeCZTr3?= =?Windows-1252?Q?6gxYETFZuL+oapz+QK5WW1EHebAZcH0Lx52l5ECJwByfMcGZP5YJJM2Y?= =?Windows-1252?Q?4aJrMo1K0ScFXdhOrun4k1BOGUTMOlUwLFWxH4gY2G87rhQsNcXt3oE6?= =?Windows-1252?Q?yh7BJZADOQ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7:oaflzpc1lQ6vWLKvSu4HevqbDNd+0TYK8pJijDi1BuwYEDV9OWbmk5cdxqQ0PVYUk89JvjTFP8S4RfG8tgAfmqxYVQj1tFKSOfkvwzd7c9Jyy7BbKGb9pWkuoFvaSSHg689QMtndWdEmrAdFWpAK373DlT538hvKxMyYUBPp6J88JMx90vsxM+NVIPpSuR8g2BkVCkC7v/880hl0WmBmzzS8q4FVU+NZ2IwDAakoTP0Rhs+d63OPOhNLed3sXK0+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2018 07:49:50.8895 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 272bdf4a-36e6-49c9-3251-08d55d7ee3c0 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR0301MB0722 Subject: Re: [dpdk-dev] [PATCH 1/2] mempool: indicate the usages of multi memzones 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: Wed, 17 Jan 2018 07:49:53 -0000 Hi Olivier, On 1/16/2018 7:21 PM, Olivier Matz wrote: > On Fri, Dec 22, 2017 at 09:48:01PM +0530, Hemant Agrawal wrote: >> On 12/22/2017 7:29 PM, Olivier MATZ wrote: >>> On Wed, Dec 20, 2017 at 05:29:59PM +0530, Hemant Agrawal wrote: >>>> On 12/19/2017 6:38 PM, Hemant Agrawal wrote: >>>>> >>>>>> That's true, I commented too fast :) >>>>>> And what about using mp->nb_mem_chunks instead? Would it do the job >>>>>> in your use-case? >>>>> >>>>> It should work. Let me check it out. >>>> >>>> There is a slight problem with nb_mem_chunks. >>>> >>>> It is getting incremented in the end of "rte_mempool_populate_phys", >>>> while the elements are getting populated before it in the call of >>>> mempool_add_elem. >>>> >>>> I can use nb_mem_chunks are '0' check. However it can break in future if >>>> mempool_populate_phys changes. >>> >>> Sorry, I'm not sure I'm getting what you say. >>> >>> My question was about using mp->nb_mem_chunks instead of a new flag in the >>> dppa driver. Am I missing something? >>> >> >> mp->nb_mem_chunks gets finalized when the mempool is fully created. It's >> value is transient before that i.e. it will keep on changing on the every >> call to rte_mempool_populate_phys. >> >> However, we need this information on the very first element allocation. So, >> nb_mem_chunks will not work. > > I see 2 other alternatives: > > 1/ in your driver, register a callback rte_mempool_ops_register_memory_area() > that sets a private flag if (len < total_elt_sz * mp->size). > Thanks! This one works. Now, the changes will be confined to dpaa code only. I will send a v2 for that. > 2/ Move > STAILQ_INSERT_TAIL(&mp->mem_list, memhdr, next); > mp->nb_mem_chunks++; > before the calls to mempool_add_elem(), and in your driver check if > SLIST_FIRST(&mp->mem_list)->len < total_elt_sz * mp->size > > If we can avoid to again create another flag, it is better. >