From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0055.outbound.protection.outlook.com [104.47.34.55]) by dpdk.org (Postfix) with ESMTP id ECF869E3 for ; Tue, 7 Feb 2017 05:00:24 +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=DvJAus9HvJzp259IoOTujqO3woLjYBISHQoNdjZ9CGs=; b=I6tibhQidCqDqhp+0qyGmh9L71q0HyTvxNrFLfRMDszH+FNMcf33ktW3ISWsFarVXr7HnIFYV7VogaOpnNV/Xy2HamlEViHmgYSbi8zDany5MGX1W3mo2foKOdjYWALgreNOLcy7W7dWZZ08c+9TrzKTKy54qVUQxUTMjfBZWH4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from santosh-Latitude-E5530-non-vPro (14.140.2.178) by BY1PR0701MB1722.namprd07.prod.outlook.com (10.162.111.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Tue, 7 Feb 2017 04:00:20 +0000 Date: Tue, 7 Feb 2017 09:30:01 +0530 From: Santosh Shukla To: Olivier Matz CC: , , , Message-ID: <20170207035959.GA23401@santosh-Latitude-E5530-non-vPro> References: <1484922017-26030-1-git-send-email-santosh.shukla@caviumnetworks.com> <1484925221-18431-1-git-send-email-santosh.shukla@caviumnetworks.com> <20170131113151.3f8e07a0@platinum> <20170131143211.GA31464@santosh-Latitude-E5530-non-vPro> <20170206180115.480e07af@platinum> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170206180115.480e07af@platinum> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MA1PR01CA0038.INDPRD01.PROD.OUTLOOK.COM (10.164.116.138) To BY1PR0701MB1722.namprd07.prod.outlook.com (10.162.111.141) X-MS-Office365-Filtering-Correlation-Id: 30b77b14-3a5c-4e7e-d62d-08d44f0dd6c8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1722; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 3:hk9sOwhTQerobNFDN8/c2Wprh2b9T9f/lVzxqLpEfRBknc/i4NREEQHXh+Fz6AD6Yw0NZhdmS5pFxoaT283OtHZLmtUb9UcDaEUTaIr7C6NmXTX23WYj6fcu3FgDQTWAdOAuRWJcbJ7WxErIWPYsmbAxilMDdNQmOXNPHJtLOPBOfV2Cs76g6nFbOMId+C5n4EXldPExOGZzEAP3VDIZUZLNEPBclxdOeXNUroWB8IvEhrfJVoFvZZN39hkMmD9pewRds3LqSSEva5DuzS04Gg==; 25:hMwtW2eiEqXaiCm88oR4WX5eNRvKmhdG6D22S1sEOWY1xnqnj/W4OnI01k2qSATgpHtq1Af5tDymdJNQYDnViN/WAm2NPEKsV2m8rea74sYiKAJU4OKjubT4aXigDCBMdC/QRhg35D1iZZRuAuDGMueATH5CgSGeNYZJUzMYK4bJiZHHSaFPfQL3hsx9vRVZFjynyY4qaZe05E+m3EilCq1nc/nDDSS4zMrglJu/XZERVmmL3mXFLGiMS0A5ACwPcNGwMUCPPkwYG3XAQLI2ZD7bGQKg0ovaRWM6/Hifn1rfVLPP7lhtIrYBKZptSIoE2Kl5l786VH4iyIIWaoNfpe4tZp2pqWvkmpm9HxlRsqcc8iW9pqhGgHAlqr6kEpGioMEeDvwd8YVJ9OEYg3n4CJb6K8Eu7NbFxvenWBfZZpG+3N/ake9Uvcm5NDkafrMhHrIf5CbyTp6Q9qAvqxyVUQ== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 31:zTRO0LIpRLPi3H+K2GyMoo2JcpQ5I6KVsETUHePZiOGx/6Ce8GQNoz6OREP+ND9+7Aez6BELa2KbEz06GXob+Ak1t6p+2dYphxNRgqXgu1RPK2Ep5jZ/8o60dSP/YOOBaflPzER2h8ikEy2pCJdDEBZZFzT+hdKOJ4uSnoIdmoWqHh2IedKqWExSp+2NvIfvm5s4nriBlOk1DYs/IKb9MK1mFVSaXMN87/XsCOA9oZfT1HdZVhtSZGNxg4vrP9hIAnvOunxkCLmBQQXZp3S2Xw==; 20:D93pKmeiDAiKkHwqe4aHFQwC/B0lo5FNay4A6zIprIqKSOdtY165rZ3n1FANb/voGnyn8VzV/PLN+jyfI+QcZa1sMk+pPmnM9k9ohh/uC8ptN4l7PhE9Q12uMn3aGMegjLErIzyARvLJU7jlBzxIaUGsla/9pUD7SgFniHmj+xHfMbRI88r0w0+BDMOfuJP77xnl3YpvioYbz9eqvAg1U/23Jm0fLgywLG0AiWHBHebUfRwcEiESrGk+jQ5DER+7kb7dtbOJffQKmse05ePQO1Z+j6QRe7LDRqj0xgivgYuhaYNOq51PWtPidCUHPAFHCiq/jNmNzEofeRrM84+uA/BqLvOguXi2XZr/Fv/c4bAlVRlamjYMnVxy+Gn03xZ40HCzXOywGZapty9dFI+iKWuo06hbetcHl07gVycSp1d8U4N0+FSHiU47sdtHdKGl459UcpiQ5YyTzT6r59LC57iXGjNgbKwHU2wP7rJlRf6+AbwO8r1qDKfxrmwlQAjtlwtcb0rIN/0lXASM9j+9V+s2OVp5bB4NJAwJ0EKOpcHFpbTpJHL8q10QuI9xXSjFIkL0YXWDwwBzZ3ERDPFQxKROllHVKu6SIEzfKCQVeS0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(20170203043)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123560025)(20161123558025)(20161123555025)(20161123562025)(6072148); SRVR:BY1PR0701MB1722; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1722; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 4:HAD95J5wE4Uf0D1hHyjHa1WyCU6PEeBNPkFod2ds2UKbXXRdN1pbdfPGf01Ys2Q1GsYb1a5wjxjZLAZp47tgGm9+wlz0dsXM1iyw+69bSvJN63YGmF3GeXQuW35P8zINmV2OJ+1aTMmPHorM7DkZTfjEsAu1em4M1lSfHHwVRucYzdBo5KLb5CNvl7DrKKiyACKPfq3bo5i2NbBV2tZjyrKvMaimSi4EsxlMnknMzp8VaPEaCuPW1La2zIQ0rOvBf44ht1Au97rJ5te0j/gm8c3Xj3zskv71Y6bp5nj/nTcfh5XzbdefRflAcNwOEhey9Ki875qTW6mC64w7EIia9W0zjEJBRrK0cwYVtFblHxocPmWhE1Y5w5g/TMnnKCFoC9K473Q+P8mF56NuIYQ9z8iSgpIkgKDA71pkcA3FdcCOUaBWcxr4ndTwUJrhvH0eEw1/zWu0dmjZ3WKWDXYITqCLLZRn9RvrIjnI1E9boDjuyR5xR0CEv7RUoK05Bl8ZwcQqmSHiknUTqlcln9bFMHVMNDbjsIQcIVNrGOyMMGGFTbV4tcJQTbFvzIBEg3EyZd570T4WxdEDQg7KG2LOX3WOkXGslhksIsMpbz6AMaVABihATdIxS2srsPOM77Oh X-Forefront-PRVS: 0211965D06 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(979002)(6009001)(7916002)(39450400003)(189002)(199003)(24454002)(43544003)(38730400002)(47776003)(66066001)(2950100002)(92566002)(97756001)(6666003)(46406003)(33716001)(42882006)(25786008)(68736007)(6916009)(229853002)(53936002)(6496005)(6246003)(8656002)(9686003)(54906002)(55016002)(7736002)(33656002)(93886004)(305945005)(42186005)(105586002)(106356001)(81166006)(8676002)(50466002)(4001350100001)(97736004)(83506001)(81156014)(54356999)(2906002)(76176999)(4326007)(50986999)(5009440100003)(6116002)(101416001)(23726003)(5660300001)(1076002)(189998001)(110136004)(3846002)(7099028)(110426004)(18370500001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1722; H:santosh-Latitude-E5530-non-vPro; 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: =?us-ascii?Q?1; BY1PR0701MB1722; 23:Jr1UAT6YhPwyg3fMxK608ZPIciNwzKnR/xZa28y?= =?us-ascii?Q?WHtE5f37fRmkkgeGopz09rRH/aMgSzp/bDrJmVA/4WZSZQEHldu/RORGBTZr?= =?us-ascii?Q?LUizy44drEHel5cvSwiYgF88eGsWYODIvIjGKIGWvv8QlKxA7p8b4T9TGyoY?= =?us-ascii?Q?MStR10mE+df964obu72BKRjLR7Lbw/hgGb2OwPATxhgatF3vp7qFMp79b530?= =?us-ascii?Q?+TBuaDiIROfQ2uTrhQjtg7ftxl519S+bFTvFYydjcT4I1OAqXVxnRJlCSmX9?= =?us-ascii?Q?QPGi4xEgFHomqnsY+X2rt5yALDMuEK+PcCopQMFvZysQh3cLhfrnXLjjLAAV?= =?us-ascii?Q?PPsfkQ6JRjBA5lQWuX93xwkdpng0+gYgW0BnQcibwpXqfSHD33nMBYxqFsUt?= =?us-ascii?Q?N/ozNxPrZLakcuCHxBVZmAJ2uiHZFshqHR8p/Y+KJ5Ip+3ltt2Y0DPT00Rab?= =?us-ascii?Q?EF6trLRM84Rv2jnLhYpol/NAxrix8QjiKkWZ+ywJOUSeF8vqUidR+E2A5AsK?= =?us-ascii?Q?cm1JNCyRmkze7jKV/u0g3SCzter8HwMFeuT02M1YLKXjAgkyGy0WTiEh1Fte?= =?us-ascii?Q?avW6nDi/chZfJbcIoKII9Oh9aco4qnmVJ84FIxD+ceCnvMnGAVQzrDCSbo93?= =?us-ascii?Q?fDwT6nFgrTpyrivzhDgPLd1E28FOoYC5Z9PEdDjDqyQw1AEm6MyogwFZx7Gr?= =?us-ascii?Q?TbaFR5CqKc3AQre3kC53/2YRJm1eJUtlttvE0d7O+vV+bqkJfrUnmcPtquHL?= =?us-ascii?Q?nCzTz79WblZ2KOdD4hXWgiPxnh/PcTZo7v7F20nL+ZRoN+VyN2oGp4WRWdmj?= =?us-ascii?Q?QY1KwrVNTq3MZoLpdM8bEJZg5Uz30b5aPQNm8TK53IdlUyZLnZ/4F6uQQHRx?= =?us-ascii?Q?F62OB/P34wBVsZ7tdBz5pfL9qk2qDu4dsAQtwaJoEKJtCdd0oBwOYGinmHZs?= =?us-ascii?Q?Krs883lVbu2JzhYxdVxpodU74XpIU47njtagKtYQfPlbEY2TUFjcOWAwaH4x?= =?us-ascii?Q?A2obnnKQYgsDNqWcPuJt1nB61aqnEEAEnyrZ25ZHcstBwkEdlFbYkEDAxTR7?= =?us-ascii?Q?Q6G+wJiexWu+ty7qBLaZhzHObR1OWhittt+nrc3d8tSAwcko24fY8iYOeMxR?= =?us-ascii?Q?idr+xOns179GjgMAYe297DAzGmvT7li02QGb2otqm19ro3eGuy1czgnSo98m?= =?us-ascii?Q?YbhSC4WvNO+PZGRuA4734QwIcxk/ePVHpUIwI2yeUMZGZ1KlFwYdz7loLch2?= =?us-ascii?Q?xpyliltCCyumY8vDHsXIW1JHG9jsXAL2+ZtiopTz3KJaUxhj+d8f+apv0kBi?= =?us-ascii?Q?B4xOJcCmUPXsPIV8sAK7wGxI2+8pomO4VsdNs0HWHtHvuAExivzg2LZVVi7o?= =?us-ascii?Q?vGWzUgD1wGmSGjebM5a6O6lx1u5sECaQQZ6XXGtYne9uyksjoaxTJwopKluc?= =?us-ascii?Q?2amiV2UUOS2wMClIrB1mKj92U02gNhbnVFpmp3Il6O31VZHLq4wjvoG5nD/F?= =?us-ascii?Q?vb5qYv5ndgPg8y/looWpQ5YxmQOBJc3WsQWM6PdvwFOdzAL+aEKVrj0Jy?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 6:D3rmN0fdEKwWzpSfK4PVp0cWugbr5jBGIwgT4gYPwqZ+g0WzU1w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wiKYLDJ/FZ81wPY3NOVpsIXzUM8uirvIfcIisQ436x6nvVUAtrvw7dgS4TbV3UrfZHFX+xPDhH94zZS/J/OidCv10El9c2X9UK6yUiPnOti7Jo0ycOZrPLeVFcj3XZXKCQXDzCGoCyuIVYAOKPQzpRqD+Z8Q== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2017 04:00:20.4863 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1722 Subject: Re: [dpdk-dev] [PATCH v2] mempool: Introduce _populate_mz_range api 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, 07 Feb 2017 04:00:25 -0000 Hi Olivier, On Mon, Feb 06, 2017 at 06:01:15PM +0100, Olivier Matz wrote: > On Tue, 31 Jan 2017 20:02:26 +0530, Santosh Shukla > wrote: > > Hi Olivier, > > > > Reply inline. > > > > On Tue, Jan 31, 2017 at 11:31:51AM +0100, Olivier Matz wrote: > > > Hi Santosh, > > > > > > I guess this patch is targeted for 17.05, right? > > > > > > > Yes. > > > > > Please see some other comments below. > > > > > > On Fri, 20 Jan 2017 20:43:41 +0530, > > > wrote: > > > > From: Santosh Shukla [snip..] > > > > --- a/lib/librte_mempool/rte_mempool.h > > > > +++ b/lib/librte_mempool/rte_mempool.h > > > > @@ -387,6 +387,12 @@ typedef int (*rte_mempool_dequeue_t)(struct > > > > rte_mempool *mp, */ > > > > typedef unsigned (*rte_mempool_get_count)(const struct > > > > rte_mempool *mp); +/** > > > > + * Set the memzone va/pa addr range and len in the external pool. > > > > + */ > > > > +typedef void (*rte_mempool_populate_mz_range_t)(struct > > > > rte_mempool *mp, > > > > + const struct rte_memzone *mz); > > > > + > > > > > > And this API would be: > > > typedef void (*rte_mempool_populate_t)(struct rte_mempool *mp, > > > char *vaddr, phys_addr_t paddr, size_t len) > > > > > > > > > If your hw absolutly needs a contiguous memory, a solution could be: > > > > > > - add a new flag MEMPOOL_F_CONTIG (maybe a better nale could be > > > found) saying that all the mempool objects must be contiguous. > > > - add the ops_populate() callback in rte_mempool_populate_phys(), as > > > suggested above > > > > > > Then: > > > > > > /* create an empty mempool */ > > > rte_mempool_create_empty(...); > > > > > > /* set the handler: > > > * in the ext handler, the mempool flags are updated with > > > * MEMPOOL_F_CONTIG > > > */ > > > rte_mempool_set_ops_byname(..., "my_hardware"); > > > > > > > You mean, ext handler will set mempool flag using 'pool_config' > > param; somethng like rte_mempool_ops_by_name(..., "my_hardware" , > > MEMPOOL_F_CONTIG); ? > > I don't mean changing the API of rte_mempool_set_ops_byname(). > I was suggesting something like this: > > static int your_handler_alloc(struct rte_mempool *mp) > { > /* handler init */ > ... > > mp->flags |= MEMPOOL_F_CONTIG; > return 0; > } > Ok,. Will do in v3. > And update rte_mempool_populate_*() functions to manage this flag: > instead of segment, just fail if it cannot fit in one segment. It won't > really solve the issue, but at least it will be properly detected, and > the user could take dispositions to have more contiguous memory (ex: > use larger hugepages, allocate hugepages at boot time). > Agree. Will take care in v3. > > > > > /* if MEMPOOL_F_CONTIG is set, all populate() functions should > > > ensure > > > * that there is only one contiguous zone > > > */ > > > rte_mempool_populate_default(...); > > > > > > > I am not too sure about scope of MEMPOOL_F_CONTIG. How > > MEMPOOL_F_CONTIG flag {setted by application/ driver by calling > > rte_mempool_create(..., flag)} can make sure only one contiguous > > zone? Like to understand from you. > > As described above, there would be no change from application point of > view. The handler would set the mempool flag by itself to change the > behavior of the populate functions. > > Right. > > > > In my understanding: > > rte_mempool_populate_default() will request for memzone based on > > mp->size value; And if mp->size more than one hugepage_sz{i.e. one mz > > request not enough} then it will request more hugepages{ i.e. more mz > > request},. So IIIU then contiguity not gauranteed. > > Yes, that's how it works today. As EAL cannot guarantees that the > hugepages are physically contiguous, it tries to segment the mempool > objects in several memory zones. > > > Regards, > Olivier > > > Regards, Santosh