From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0097.outbound.protection.outlook.com [157.56.111.97]) by dpdk.org (Postfix) with ESMTP id 0EFBB137D for ; Fri, 27 May 2016 12:33:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=DlSlJWHWY/gB+UKbkofPInGxCvkBRuHHDVl/FYB8uZ0=; b=mp3r6UvLL7uKUXcYESTO1GV80U45VaiFsYSFZuwRDV1eG46/TStC27yrp5kzmiVjJ5sUASM5WLQwU2hUpgrPbOjlUuFTCKrs7IF/pTDPztSLE2Zm4VNDYw+vQJ/FsxlyCLA+x2UdcWNa9lFMTTOnKDXuA1Ld0fpM4+T7adKOtPg= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (122.167.15.180) by CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (TLS) id 15.1.506.9; Fri, 27 May 2016 10:33:42 +0000 Date: Fri, 27 May 2016 16:03:17 +0530 From: Jerin Jacob To: "Hunt, David" CC: , , , Message-ID: <20160527103311.GA13577@localhost.localdomain> References: <1460642270-8803-1-git-send-email-olivier.matz@6wind.com> <1463665501-18325-1-git-send-email-david.hunt@intel.com> <1463665501-18325-2-git-send-email-david.hunt@intel.com> <20160524153509.GA11249@localhost.localdomain> <574818EA.7010806@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <574818EA.7010806@intel.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [122.167.15.180] X-ClientProxiedBy: PN1PR01CA0043.INDPRD01.PROD.OUTLOOK.COM (10.164.136.143) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-Office365-Filtering-Correlation-Id: efe8c219-a9e6-4f10-35f9-08d3861a6136 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 2:/6YSxrZrOCyUJ/xYOWG3+ZZie8kc4zKzfy31fDajiJy0W4gQ4Los0zF9wtV/5eMd9ws2YTMOxyBXieuV+QyYh8ngGjshOpaiKKWHjkuT81OatcFamMxGBRQeLrDsPw3XbAMJikDfUNm+3fyzdzsvg43U+5l5RLQMIqGOt2kRMwXHF6BcLiNoZWvfjoaFkg5l; 3:FLj7e2XIimFYyMDwIQMK7zeNHyUF8dQlKxK2xXGZp1wC+3vlDBZl0VHa60zAgfNK3sbv1KfAay1ZRph6qygoSyBAET+OnCMYApYYX9z1hODtSEl6cOaDXYKMUTHnGEC2 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 25:PnXAabwm+4OUTNrdVJXWlp+sEVA+tK/ja4dLPWZM+uACD+77NTCmRn763yz0AAeXJD/tti44yAqbWAFtA1VXXeb7l6CSp0fx6HB6sI4nbpYLNT0C5iUa8UkfVaEuW7IlIsPohSATu1uDF0zOAnjiNm1hHG9jdJzsdyJps89f928xsovLm80Uj00Q/vgftQjdih3lezu2NGkIo1lBRk4TGw6fcyByCbNLh4cDsgyGpOmGLSgzZ4n/FY31Crv9CHJwWksvdPHIDPpdYU48YFnIMxF1TGQWq7OFLrvivKVvpHONwmYmG9ZRxuMw0JFrN9C1xXQx5j8GO0wRzLoTo2EsfSI8dEiau6FrUHHEKNbdMgsSkY/4LFo7sZeVBMqZ9IMgNLuDlAGiLh47R14ht+lPb+sM9rcD02kO5XYbV8s1tUIqAUwpRp49Art65mFjzQsxl645o3te6ZMew4TVuTFbxA2tjIkDWcqtn4ZtL7HnDpT7fImi0Y9CxgqGkQTjK4PCwejjdI5leNy+XaB7VgWOJvmf+5AivUv6lerDuxVo4vTIVTaeeLogTi1+I6Pi7x5IL1plvZLav7YveSFYJgHnYH2HJWfdmEgz2C9pk9VOJ96/fFZAhowbQ+vAXHfyyPoA+EYxYyti0ecmCet6ztAzgkMbI8Q/WRKyeQtgbj1Nlt6qmvAdGo0EFSC6ghUqtUzxMwIp8a/1T/L9Yzd4IRuOeEnfviu51ZlYVi0kfvqG+zNXDKQdsjyX/pGQeURHVo5z X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 20:x9mWnt3Rku2N/0QYOIUfeSE9cjSIWfYOYoUjLEI1Eyjgcrj4mh5mAlAQaSGDeYZrGh1nx1v9LqBexnXpl7I2Y7Kh9owOwpcCisv7EoxIzYmgFdT3es1ZDqVKjeCD/g6MOUuJcsYNoUetY6o/VsiVqiCcuN8bbGe4XoeG7B3O9RuRgaarJMwg1selQ3VI4mY66eC2m0YyWjAwmtfmI8gXFOKi9Kn33fmJe3c5CmY5HWcbwz1sXeKUWxyqkRXAkAiLd8NGlYoJ3MTe0kCJLsoV2BBsdjJ0D7cjb1HRJYMSxGspFSpKQI0V/+JwMWH5bgdfOT2LO0KDiuzs8GHWJgp1jm1km4fRJvtZva+ZrqdOH4TkUJzguq5hw+LrJ6R8VNYV/KOkMi/Jf4xWHEsNrGZWudGZShYlZwt+UGN83qf/Mf6iXxcLJdxEReO9jPbTaT0lfZn76smIO3Pea2zqAi3cT7JRnJxXy3xZzWOw0U2maiLBcuVKiw/dQlR5voXVZJaCAQR4yb5CgaalbSlLu3HT8VVd3ykKO/G69rXyJmRDRujguv0iWJ2kxOqSGgc81PDppLLVDLIhKm375Oq/l6qeQq7wsZ6aCj5wRoHKIlsk1Go= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 4:iVsHWU9TRYDeTq48KIcnLL4eue8eFnAJ7l1bNdwL96VnFK1u0Vi5F4xDGW8/FSWyti/2qgALC323r0sSO1XHyPnQEyX4DBTI7V7vJJFJ9pYGCmCDPWjpd4rqB36wQygXZvqw44b6AjyyHvCYhHTI5XtQtXGlDuSEYHeyShbWMMvNno/O3lUrbsEolac8IEwYC7sdBbOpnpJdaXtXCOn8ebPTg4oJP5krav53SjWuYV24V3xCnVh45aZiY55JP8hOiWCy+QN90HF8fXzzecFqb4pMirUaEwFTea8GZ1UNBmDxOzw2A9e2/02m6R4PycVBIbglb9SznZVmtmUaPXPPBwysi+XY1E0JWRbhoHAO3Xhv93jJW70Jl/zgG95jTRd0 X-Forefront-PRVS: 09555FB1AD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(24454002)(76104003)(377454003)(2906002)(3846002)(23726003)(586003)(8676002)(5004730100002)(81166006)(6116002)(1076002)(4326007)(110136002)(5008740100001)(4001350100001)(189998001)(54356999)(93886004)(50466002)(50986999)(76176999)(92566002)(33656002)(66066001)(61506002)(47776003)(83506001)(77096005)(46406003)(2950100001)(9686002)(42186005)(97756001)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1725; 23:65XRrhg5cDrlblF/9G1lqO7bdMcoIHiPBebKMG7?= =?us-ascii?Q?DCmtRo0oDymquVZgllfFYMMbgWO8+w0xiWbQvNOVOdrjXaMUWBNaPf7uSDBa?= =?us-ascii?Q?CyB8kPsLYipk/8m+CFtayiWQMpkyEFQ6jqChjg5Bnl2YLKRlphlV9CMmh+Da?= =?us-ascii?Q?lbjOwU18cny6OgsJBInRTX+HZPKCpTvLLDr1j86syHEvtCljv3XQQp9gPIqC?= =?us-ascii?Q?B+CixlGz2u7Fx5geKq6QWt3Tozjkqjznf91iWvEXmIVDqVAY7gNFY2buuJEJ?= =?us-ascii?Q?FnVsDqVAZ8R8SuX8oePooYS4ZRrZL/cBEbCsu2bylHnMwlQxHWVTqVbaaIiw?= =?us-ascii?Q?NWQKN/FVrMgPbOX1LiOAXr4iGug1sz52IA5q9DGSKs+sm9uT1lEVvfZ7TEKj?= =?us-ascii?Q?2v9QTaexh+mX4sNd2VdMWXwCXYSpOCyjXp7wcsj3rGj90+3TOxL9auYHSljR?= =?us-ascii?Q?Na0opWT3SMtMwKdXhLTNKDgjSokRIdF5ZTh6oX1W2zaAISOBijR47EvX4T0I?= =?us-ascii?Q?kit46ydNYFEplc0kr0kK3GLn1Iw8jgjZlNaRzmRJh2/K0HtcKvvkzPS1ZBVU?= =?us-ascii?Q?hy3dAggcQtN3JnVOSKAB+TXk0TAfrR3/j7yqy+Vk6KF18wuHoUSREI8hqdm5?= =?us-ascii?Q?7xAkp42WnRddJETzqHbhB6uK+i7Bpg1sBSlErBtKYPvsFrjXA1Qtreo2N/50?= =?us-ascii?Q?Gp+htIMyRQQjSarGy0uazYHfoVrNm0WkTVFZJm3lWpF+ZjK5XE984ssAtYYn?= =?us-ascii?Q?Xc9Qc4pasOu+8zN5moE/7jTxxl0XV7EDjvSngevYZktb+oIQy0ClNnugDgpS?= =?us-ascii?Q?QnmofhTr//hZpht0J00e2ACfIXNhhzEhhKPBs/bVspCkt4Qtt3uAyt+pbnkn?= =?us-ascii?Q?RRKP734zwV/vhEBJzmypSYr39dO+yLg9DEbBOF+I4BQSFSSEX1A1Bd/BbB7q?= =?us-ascii?Q?fNhU1wARfRrFFY983BZvcPfIpikrRgXuDnUIEU/yOx7VDlsBPS4V9+0InEfP?= =?us-ascii?Q?VSNbL3SKdvisTdiVU0HLe22hw?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 5:PFWY4JC/7EsZTjWX25VmfdeteRccMPkDpqcpKKskuBBEYjcQdDduvrQbDSeT14u1gjCoMpTzKSgY1Y2DpMzYcTB9L5YJWC48BU3AU6EMIC65HPGsuadcM6cIMjeqIgzXJ9dQAtQ14Mh2dj7FL94vaA==; 24:Z3BA2BukyMxrsNlMsrX6Qn7yOZEZ9d43TJVuafz2VqQwyovKXh8k1OqLT2eY9IQ0rcQGldKfCp+9mIgBZnBBlY0ecCBUk3/2kQoJVWyIiIg=; 7:XlHPiz6ezsUu6hsGd7xqxoOcMhOM04dvt/D1gSTodTfuzyihDj1Y6ob564k7DUXAq71fz8Bq0VEmh1JOL933Kn2a1Cq77DoZoGZEjUnQv77PIZpoQ2tZ7G9btEiLf3jKmiee7ODDrHNXujQq6+QtOA4zIq8zQXlPYtc2upEA2AxEbWwe4LqqJF0PzZwefwGu SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2016 10:33:42.3835 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: Re: [dpdk-dev] [PATCH v5 1/3] mempool: support external handler X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 10:33:46 -0000 On Fri, May 27, 2016 at 10:52:42AM +0100, Hunt, David wrote: > > > On 5/24/2016 4:35 PM, Jerin Jacob wrote: > > On Thu, May 19, 2016 at 02:44:59PM +0100, David Hunt wrote: > > > + /* > > > + * Since we have 4 combinations of the SP/SC/MP/MC examine the flags to > > > + * set the correct index into the handler table. > > > + */ > > > + if (flags & (MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET)) > > > + rte_mempool_set_handler(mp, "ring_sp_sc"); > > > + else if (flags & MEMPOOL_F_SP_PUT) > > > + rte_mempool_set_handler(mp, "ring_sp_mc"); > > > + else if (flags & MEMPOOL_F_SC_GET) > > > + rte_mempool_set_handler(mp, "ring_mp_sc"); > > > + else > > > + rte_mempool_set_handler(mp, "ring_mp_mc"); > > IMO, We should decouple the implementation specific flags of _a_ > > external pool manager implementation from the generic rte_mempool_create_empty > > function as going further when we introduce new flags for custom HW accelerated > > external pool manager then this common code will be bloated. > > These flags are only there to maintain backward compatibility for the > default handlers. I would not > envisage adding more flags to this, I would suggest just adding a new > handler using the new API calls. > So I would not see this code growing much in the future. IMHO, For _each_ HW accelerated external pool manager we may need to introduce specific flag to tune to specific use cases.i.e MEMPOOL_F_* flags for this exiting pool manager implemented in SW. For instance, when we add a new HW external pool manager we may need to add MEMPOOL_MYHW_DONT_FREE_ON_SEND (just a random name) to achieve certain functionally. So I propose let "unsigned flags" in mempool create to be the opaque type and each external pool manager can define what it makes sense to that specific pool manager as there is NO other means to configure the pool manager. For instance, on HW accelerated pool manager, the flag MEMPOOL_F_SP_PUT may not make much sense as it can work with MP without any additional settings in HW. So instead of adding these checks in common code, IMO, lets move this to a pool manager specific "function pointer" function and invoke the function pointer from generic mempool create function. What do you think? Jerin