From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0042.outbound.protection.outlook.com [104.47.40.42]) by dpdk.org (Postfix) with ESMTP id 3F9E85594 for ; Wed, 27 Jul 2016 11:51:55 +0200 (CEST) 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=b7PIRliJnqBRimdYt1eox3lOB6tIhrOv9HrDFyB7nc0=; b=dLDYHteP/zx9ZJ0YBFO2L2/zL58oPhPtskcmRe6beerUyymxFkXUPA+LuI5A8JzWk6ORcOI54fvxju+Jz8NC6eYVU8Uz+04G1Q/Na23yNcrI5yHnTR0+zBIViawBGdGnIjadV6JuDzLta/1YVjuGvLIhhRWNzl3PukRnv0d6Lnk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (14.140.2.178) by BLUPR0701MB1715.namprd07.prod.outlook.com (10.163.85.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Wed, 27 Jul 2016 09:51:47 +0000 Date: Wed, 27 Jul 2016 15:21:29 +0530 From: Jerin Jacob To: Hemant Agrawal CC: David Hunt , "dev@dpdk.org" , Thomas Monjalon , "olivier.matz@6wind.com" , "viktorin@rehivetech.com" , Shreyansh Jain Message-ID: <20160727095128.GA11679@localhost.localdomain> References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MAXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (10.164.147.11) To BLUPR0701MB1715.namprd07.prod.outlook.com (10.163.85.141) X-MS-Office365-Filtering-Correlation-Id: 7e795f80-b664-4269-d22f-08d3b603a2be X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1715; 2:gDai/U0baOV6MR/IvapS+VsFJqnGGSJdpfEfHS57Eit+PRqJmGk3sy8ZXJBbnn1duEegx6cqWSX6RpT2qFPJrYzK5OOyybXYS2wqTuBp91YHsD16q4qgUFB3lgjZe7OznTJUilwZ5FdcNlZM1QfIz6f+PfAjLLx/gYY9ivOrVkqiXZt3Bwv89AFJpGN/Tzey; 3:9pbk8c57efdYiwlzvH0hOC45ml8n0fY3TrElH340FjPiVnF5EimDsoSUMzLZcoEa5G3+VxtFM2gsVSqKa23Q77qMFjWyj4byJA8/a27WOzmD3LQAEbrR4OehYJbM2Gle; 25:8/+3ae1OWz5ANfFkO+BDpi7ziLpfRtD29Bc03CcXWoVkiTJaywq0kF/0Z6Zk6r6j5aPeNaw2krKbxnY01UDfeq1nbAheLTtn6Aza2cGmqAk2YlD8k1bb270m3Z7ERgO5VDuyLbW6/qgQ629S1sAQDBzOPhu/CdKZtOqBeNtIZ26FZSUxGy+ImbXrNv6qe9GEU1iOp4WnDmNdg7bnWpNG8yadSYpBpaVqZA2I08bu19utz3olc5Vl6cCFci0MW2+sBa2gIXmbTJ4cZ4nLgzQxhlW2+95wUHjT69d/HZPgW/VSI7fwxCCXXkgMwBHTqXR4snSAmZ/6NnfegpQo/5EwIANwzr0LN7ZYp7CswZ6J62GpD3n4utL+b8GFLuRdfg8YcOacumRog0MzacDAHTKccgbP4d/50c81AISN40CrvwM= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1715; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1715; 31:Gu/PvDzkK2Kgs1p9lgSC0JUb/bGIJuew/fWN2UwDA2qTG3wONfoCk+ckFoml3PH0LUmvZeO0erqPXwkG+dlGSI8uDReSeqUAOzprGd1amsNJC3/HvcqVRYQvzlEhYGSA910b8hIPqdH7gdOG0RKluMMhDqZa5bmskaVbLfBIzQfnjRMQlXxsvTgSguU36ypiui8CXCCnifeS/EAghmNIwg==; 20:7f7FmbsiadVeHHCeazUMk2jId7aOEoOGjz8goaaAtNACfacVKvZwhLwO8B0UtZmdCzV3wi7mkAgzVdwomMmQaSqyVfxbNWs6/WEK0H45l3AW8q4hucgUwFmt3JRBptVSXPLHWSUO3vQMdxT2FLlmw5dapNl+HyCZfb2lbcDblZyoH8cmov5Y+HZRcpDofEyzKzZZgtuz+X0NDT6/5xfirowfL0QoPbqNKdtsqPwBd77PwYZyvhJ12+/Zr6xqsk0C/tedvOjDYLE68oQ6Zp/r9sqarNYB+HDQy9ztRuhwLz4H0AXTMOklU1uvTGoH1+AI5TNP3Y+C9ytn/wX00SN9uqCFW7R4Q9jx7+nwU8vxiyt5+BySXZGXzJeB0ztWmOjbGsQ1Pk/wCTjXqsrarnB0F6FwxE3DWvDg04s7lyXSsayn1FvxqKUtTelUg7KldCs7aL+9zTq3TYWIJAO5AWwKoUsYt/adulVq0sWRCxnouMPFUTV9PLhUkoOlrupE3jQrdenyMqe9RvSUFACGvocS2ODLrYFYuUdAscEJW/jlwR4YU6lqXTCIU5rqqdtkqxoYP28dKY8y70jRNLN6DBi2msd+F2+VgukgLLmnou+XJKs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:BLUPR0701MB1715; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1715; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1715; 4:zqd3pxuRNQicI4iRmXT4DAEUg1VjG17qlj7NCzf9+k6LukFyzPsWblYEsNPBsCAifRhEIBaXu29TBK8fGYRG6D73E+r2xzV/FulKgqh0YOox3Y/KXVK0C58Kp/7fPoMsfcCVeiZeDtCfTPyCIEGjlogv3FGFj1+VMZrKZRX1f1KVM6b546VA1nnTxz5YJ1aX7F+SlRMm1+6HdQDmA8QC006fhX7Kx6lmS4mI/HKlaC5gtAUDJI48K7bLfSDggDdSQ/YxkynOCNxAcOiz+0WcQfLE0kNj725O/znSYCUa8EK2nP1bRf02s7d7tZSPS2CxlzQMjNdmSD9GPvN22hLU3RmxM+TfTBps5oXMrNi9MTWsmAAx3gNvlCbKKzpCu1s31zwsfcw7TizCEJ/RrrUhnXj41/3ehqzox+liWBcQj7A= X-Forefront-PRVS: 0016DEFF96 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(189002)(24454002)(199003)(54356999)(76176999)(8676002)(68736007)(4326007)(586003)(1076002)(3846002)(6116002)(42186005)(5009440100003)(2906002)(101416001)(46406003)(305945005)(81156014)(50986999)(7846002)(77096005)(23726003)(7736002)(9686002)(50466002)(8666005)(2950100001)(81166006)(92566002)(97736004)(105586002)(33656002)(4001350100001)(47776003)(61506002)(83506001)(97756001)(189998001)(66066001)(110136002)(106356001)(7099028)(110426003)(18370500001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1715; H:localhost.localdomain; 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; BLUPR0701MB1715; 23:Ah7mh4gXHqRNx8Ln9LKnb2fVqbD1y4gIC6m+DnP?= =?us-ascii?Q?xPEtDmaL+qK5lmjTcTmbnEBY9MbPFtLkhPFn+YAA26hYPKofw8qY50H8j7mC?= =?us-ascii?Q?v5dFnVWesw/z9cF/RaSFomweFk9kk4o61Y45R+/eHLIPJGgiDnvn7sL4xyVY?= =?us-ascii?Q?df/yFQqe1BUAGRYSD+O08hZl3bIwXm6VRA2Gi2wcZcN0L4is9QwB4rCkUQfy?= =?us-ascii?Q?/P7fajq1rHciDzhWJUoklPV6YaaRPWdoUeiTBnsKD7mWiuPu4M1jMOuAU/ph?= =?us-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GUQEX4qFh0b4dAZMLqx4unqS?= =?us-ascii?Q?AKocQjMyWrIf85WWYLV7A8+68Skqr2+ki/b+d+kI2J6fsoaniwPopRJJ0eQ?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1715; 6:8KqjCldiXq/RGNTw8HudT7fKniTiKnHEP8pTQa3asU/bF+YMl3TfT3/u8TQqESfp0skiAtYBtInPW5Rk85l4IMFg2PfjDxZzoLmeeIh9lN5PzBeq4TB/1ASh4da4b/4Z8bkTPPSzi78y52ue68LweodQgsPWJSvniDGcnubsl50Xbd1T+qWJslvr9UtA/dtO11QY4omsn56XMi7jwSxu8T9rFlzvSrWm5wFZBMG1oAE5tzFw2JJLqGR0+mbUs4Xu9BbPfG6iron69zQn80772zOdXEyaWTYgYRkLxIurMnk=; 5:eiVkLSR+avEWPKEnD5fc62HDQlcq7yjkLx/HmRb7gq/+FLaskMx4RF1WEzuHo4lV5Xjp3806abNhbibDjxS0IDjKnOJLo3Psjr7pPWiXMEiSldZR3dMBXiWEH/G/JkFlnTgIVe/hAj3Z5Ah8OoxQqA==; 24:L+Ks1kZDxES/XOkcM2oAHPsM5JBvkH+ZC3irAmOdN438UkpDVW2VSsUkQkz1EDzRvBeA6Jgo87KNJCJxWbuK7Zsbr1kAtI5Zbq265VhCFW4=; 7:+uI43g/fXeoLMpQkP5jc5Jfrm693ZE2Y2FoRdhL6n+NCEcDPhPOlUTIJsl6yp+Hv5kxzyQGV4jUJ/lUTAdezk9rId/mx96kAhqa0OlSKzQBPozCryIXfBvTBDyw6/hXKC2/9PFpyD6tTOa9VwAn3fLvibghhT5AhaSWNv6ViCpCuKQY+jZ7esG4m3fH1zeJnS0aCX5NEy6kqV90qyvk0skGtKWH9E0h8l+BkDg8Zf2M4fJBiETGN14j9zhax6xeD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2016 09:51:47.1529 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1715 Subject: Re: [dpdk-dev] usages issue with external mempool 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: Wed, 27 Jul 2016 09:51:55 -0000 On Tue, Jul 26, 2016 at 10:11:13AM +0000, Hemant Agrawal wrote: > Hi, > There was lengthy discussions w.r.t external mempool patches. However, I am still finding usages issue with the agreed approach. > > The existing API to create packet mempool, "rte_pktmbuf_pool_create" does not provide the option to change the object init iterator. This may be the reason that many applications (e.g. OVS) are using rte_mempool_create to create packet mempool with their own object iterator (e.g. ovs_rte_pktmbuf_init). > > e.g the existing usages are: > dmp->mp = rte_mempool_create(mp_name, mp_size, MBUF_SIZE(mtu), > MP_CACHE_SZ, > sizeof(struct rte_pktmbuf_pool_private), > rte_pktmbuf_pool_init, NULL, > ovs_rte_pktmbuf_init, NULL, > socket_id, 0); > > > With the new API set for packet pool create, this need to be changed to: > > dmp->mp = rte_mempool_create_empty(mp_name, mp_size, MBUF_SIZE(mtu), > MP_CACHE_SZ, > sizeof(struct rte_pktmbuf_pool_private), > socket_id, 0); > if (dmp->mp == NULL) > break; > > rte_errno = rte_mempool_set_ops_byname(dmp-mp, > RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL); > if (rte_errno != 0) { > RTE_LOG(ERR, MBUF, "error setting mempool handler\n"); > return NULL; > } > rte_pktmbuf_pool_init(dmp->mp, NULL); > > ret = rte_mempool_populate_default(dmp->mp); > if (ret < 0) { > rte_mempool_free(dmp->mp); > rte_errno = -ret; > return NULL; > } > > rte_mempool_obj_iter(dmp->mp, ovs_rte_pktmbuf_init, NULL); > > This is not a user friendly approach to ask for changing 1 API to 6 new APIs. Or, am I missing something? I agree, To me, this is very bad. I have raised this concern earlier also Since applications like OVS goes through "rte_mempool_create" for even packet buffer pool creation. IMO it make senses to extend "rte_mempool_create" to take one more argument to provide external pool handler name(NULL for default). I don't see any valid technical reason to treat external pool handler based mempool creation API different from default handler. Oliver, David Thoughts ? If we agree on this then may be I can send the API deprecation notices for rte_mempool_create for v16.11 Jerin > > I think, we should do one of the following: > > 1. Enhance "rte_pktmbuf_pool_create" to optionally accept "rte_mempool_obj_cb_t *obj_init, void *obj_init_arg" as inputs. If obj_init is not present, default can be used. > 2. Create a new wrapper API (e.g. e_pktmbuf_pool_create_new) with the above said behavior e.g.: > /* helper to create a mbuf pool */ > struct rte_mempool * > rte_pktmbuf_pool_create_new(const char *name, unsigned n, > unsigned cache_size, uint16_t priv_size, uint16_t data_room_size, > rte_mempool_obj_cb_t *obj_init, void *obj_init_arg, > int socket_id) > 3. Let the existing rte_mempool_create accept flag as "MEMPOOL_F_HW_PKT_POOL". Obviously, if this flag is set - all other flag values should be ignored. This was discussed earlier also. > > Please share your opinion. > > Regards, > Hemant > >