From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1on0063.outbound.protection.outlook.com [157.56.112.63]) by dpdk.org (Postfix) with ESMTP id 72F192C51 for ; Mon, 6 Jun 2016 16:38:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=A8bVTAZH/gH28vUKpZJUYJGKC6Y713ONAid74YYw6yk=; b=Gq2EaGuzZAaSc9UqJuzRuWC9cWLrNF67027qSIX44lZuqY8EgYvnA3FMdEj7rJT6cS6gTlN5j8X/xhjjOCWQUONsqG0p79Vj4DnaPURu4inDJgjliLqX+gyADCQpHzYzCk8U6Rt3lW8cb0LWzkCIEnowv2ULxEFjazdMMQn83ks= Received: from DB5PR0401MB2054.eurprd04.prod.outlook.com (10.166.11.137) by DB5PR0401MB2054.eurprd04.prod.outlook.com (10.166.11.137) with Microsoft SMTP Server (TLS) id 15.1.506.9; Mon, 6 Jun 2016 14:38:00 +0000 Received: from DB5PR0401MB2054.eurprd04.prod.outlook.com ([10.166.11.137]) by DB5PR0401MB2054.eurprd04.prod.outlook.com ([10.166.11.137]) with mapi id 15.01.0506.016; Mon, 6 Jun 2016 14:38:00 +0000 From: Shreyansh Jain To: David Hunt , "dev@dpdk.org" CC: "olivier.matz@6wind.com" , "viktorin@rehivetech.com" , "jerin.jacob@caviumnetworks.com" Thread-Topic: [dpdk-dev] [PATCH v8 1/3] mempool: support external mempool operations Thread-Index: AQHRvaht0RXQVWk8xkWSzpGmKHutFp/chXRA Date: Mon, 6 Jun 2016 14:38:00 +0000 Message-ID: References: <1464874043-67467-1-git-send-email-david.hunt@intel.com> <1464965906-108927-1-git-send-email-david.hunt@intel.com> <1464965906-108927-2-git-send-email-david.hunt@intel.com> In-Reply-To: <1464965906-108927-2-git-send-email-david.hunt@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; x-originating-ip: [192.88.169.1] x-ms-office365-filtering-correlation-id: bc33b4c3-c7f1-4e1f-1f0d-08d38e182921 x-microsoft-exchange-diagnostics: 1; DB5PR0401MB2054; 5:CkkK2Y1o/2owICapBMWe3nI4jn2XiVN+c8IDBqSYSFl7fQw1dN5wn83YmdX2NeR08xgqKmysaksWY8ndMMbX36bn59u13Ccg9vj35exXNK2Z3uj0xlo/FzNwiXYWjIKsUYuEOUxpgIiUDDxgC6uPiw==; 24:veZqPSDCX9n+jiVRDMAvsRR0REII3HXsliZXfbr24xOdInKg15lGFduj8alrrg92czrUtzP21qXGtCTdERrj4uwHK14ihQVlB+xTbBPPpw0=; 7:l83tf7xxpoaeNdDXvr9oY9YJpLGk/EG6eegK9BWCE76ESMI/1IrrEBMkSj9NYks7tdgJ43pNQyAPciWh/tL8KyjzG1pt5LDK6mbV8Y7b0PpEdLbjX9DKX6v9imw6GnWryClqaS8a5zBw9QNNsYaSFOlez/bkbPtqAJjA8A80sNVslZ9acD7RDZ83g5/FpKDW63nkrEwaL2pC0wzwmi3V4Y7eTVzWkbfxwEDhJGHpLpY= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR0401MB2054; 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)(6055026); SRVR:DB5PR0401MB2054; BCL:0; PCL:0; RULEID:; SRVR:DB5PR0401MB2054; x-forefront-prvs: 096507C068 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(2906002)(5008740100001)(4326007)(33656002)(87936001)(6116002)(76576001)(5001770100001)(97736004)(3660700001)(102836003)(189998001)(3846002)(3280700002)(586003)(5002640100001)(5003600100002)(10400500002)(105586002)(5004730100002)(106356001)(106116001)(66066001)(122556002)(76176999)(11100500001)(2900100001)(2950100001)(92566002)(86362001)(81156014)(50986999)(101416001)(54356999)(8936002)(74316001)(68736007)(2501003)(81166006)(77096005)(9686002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR0401MB2054; H:DB5PR0401MB2054.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jun 2016 14:38:00.8048 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR0401MB2054 Subject: Re: [dpdk-dev] [PATCH v8 1/3] mempool: support external mempool operations 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: Mon, 06 Jun 2016 14:38:02 -0000 Hi, (Apologies for overly-eager email sent on this thread earlier. Will be more= careful in future). This is more of a question/clarification than a comment. (And I have taken = only some snippets from original mail to keep it cleaner) > +MEMPOOL_REGISTER_OPS(ops_mp_mc); > +MEMPOOL_REGISTER_OPS(ops_sp_sc); > +MEMPOOL_REGISTER_OPS(ops_mp_sc); > +MEMPOOL_REGISTER_OPS(ops_sp_mc); >>From the above what I understand is that multiple packet pool handlers can = be created. I have a use-case where application has multiple pools but only the packet = pool is hardware backed. Using the hardware for general buffer requirements= would prove costly. >>From what I understand from the patch, selection of the pool is based on th= e flags below. > + /* > + * Since we have 4 combinations of the SP/SC/MP/MC examine the flags to > + * set the correct index into the table of ops structs. > + */ > + if (flags & (MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET)) > + rte_mempool_set_ops_byname(mp, "ring_sp_sc"); > + else if (flags & MEMPOOL_F_SP_PUT) > + rte_mempool_set_ops_byname(mp, "ring_sp_mc"); > + else if (flags & MEMPOOL_F_SC_GET) > + rte_mempool_set_ops_byname(mp, "ring_mp_sc"); > + else > + rte_mempool_set_ops_byname(mp, "ring_mp_mc"); > + Is there any way I can achieve the above use case of multiple pools which c= an be selected by an application - something like a run-time toggle/flag? - Shreyansh