From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0056.outbound.protection.outlook.com [104.47.33.56]) by dpdk.org (Postfix) with ESMTP id E0A5C2BF3 for ; Mon, 15 Jan 2018 13:36:58 +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=/dO7B/qBMQRn3LAljWIG++3VS3WvQMAPipZcxeR/vRg=; b=FoZMVJjEzBuCSmId+R5C/SGhBgMWarZN8nn1AdgoS8v9rE3VlS55cDhE4YEespbl9amQlmPj0WklbKPbatN6R7yNelEsj0XQvHNZlBDbBJP4i9jvjxEU43hK+JhXqWAx8jPQdorTMV180gEKHSScciiQ99jHvTUGYuKdtaFBBDE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (106.200.202.243) by BN3PR07MB2513.namprd07.prod.outlook.com (10.167.4.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Mon, 15 Jan 2018 12:36:56 +0000 Date: Mon, 15 Jan 2018 18:06:37 +0530 From: Jerin Jacob To: Hemant Agrawal Cc: dev@dpdk.org, olivier.matz@6wind.com, santosh.shukla@caviumnetworks.com Message-ID: <20180115123636.GC833@jerin> References: <1513333483-4372-1-git-send-email-hemant.agrawal@nxp.com> <1515996674-26338-1-git-send-email-hemant.agrawal@nxp.com> <1515996674-26338-4-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515996674-26338-4-git-send-email-hemant.agrawal@nxp.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-Originating-IP: [106.200.202.243] X-ClientProxiedBy: PN1PR01CA0101.INDPRD01.PROD.OUTLOOK.COM (10.174.144.17) To BN3PR07MB2513.namprd07.prod.outlook.com (10.167.4.138) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 56017eda-0968-4f97-6700-08d55c14aaee X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534125)(4602075)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:BN3PR07MB2513; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2513; 3:Ez4laE1Q8owhSpFwc4cYNsAFruLqKn/kZkhfDruxUR3JHjJhvyWvu9VVAk5pcL3Mo1sUvGB/8sXMeuSfonQMqtQbcJb5VFAgO2+cnLYvokibaNbFEsHEjY5IQbvR4dFzuam/Cc2O67E/LYx6PXqXh0d7CAGHt64eeAtgt2/d+6EMizUHkHlomyNWM0xxbbEwIqumVoQg/iuR+tMZN7Ke4v2yX6ce0r/oFLP+C5tshnM0Up6FdB1316NmggFVecZe; 25:pAHT31fa98Ed6XGDh6sR8+P+6xgFgiBWp8zX+18J+PR+kU5UYIVz4nrQkFneTzSTwkk6XvROdYKZTFdRRjreV5fpfNRfqz330fZriZpU7jX3WMK9de+BZ7ef1jqIB+WLh5Kq1qd6Pe7q2WBg9HZrTZjqQrYRAl+gEdkm0gPDaNp4+NfEMi/SBxVi3urVqyVOu8hDTGXLa7A0Wj2jmjAdZrayJR93R9u+X2xWvikQktCRm6P0FHvlxZsniWVNkg5BAvOJzQaUKWqibKKnZOq0Ym5bTN4FVGCNqHpQXLs+Ev5rPbqzmRD+uP5YCbn1K60rV75I8I0DdE31tM8tER/t0Q==; 31:JpC8iaaGGmtaIziwwSv8fLM4Zz6z9esZikaRESgB5OOGCDmWvPi9qFFvDDUl8qrX9Y8+NihB5UkeugSWpIMaZw+FCkBLG9dYrKMuZiS6L0s3YvvWoxR+3MC38oKL0Ry87YIol7EZhs9y0vxBLzvn+Wo+NPqHE65jCpaW2ImAuh8r9D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antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3231023)(944501161)(3002001)(93006095)(10201501046)(6041268)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:BN3PR07MB2513; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN3PR07MB2513; X-Forefront-PRVS: 0553CBB77A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39850400004)(346002)(39380400002)(396003)(376002)(366004)(189003)(199004)(13464003)(106356001)(33656002)(105586002)(7736002)(305945005)(966005)(6116002)(9686003)(66066001)(6306002)(72206003)(478600001)(53936002)(55016002)(81166006)(23726003)(8676002)(47776003)(229853002)(8936002)(81156014)(3846002)(4326008)(33716001)(25786009)(68736007)(107886003)(53376002)(6246003)(52116002)(386003)(2950100002)(316002)(42882006)(5660300001)(6916009)(6666003)(50466002)(2906002)(1076002)(83506002)(97736004)(58126008)(16526018)(16586007)(5009440100003)(8656006)(6496006)(33896004)(76176011)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR07MB2513; H:jerin; 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; BN3PR07MB2513; 23:2FbsAcwfPbF7qwy+83io5BE939f8Dw3navygitrKd?= =?us-ascii?Q?0Ay4ggplcpOtNrH8Vq/Kn8dZxX+1LRllF6h1osMETEEJNjaZ5bvK6GQnCJjT?= =?us-ascii?Q?NIfXqSEcXN4IAQH/SfOga/m6pEdJujkBdtSeMZSyWlmhKUNKp+u+ls5f0cxb?= =?us-ascii?Q?Qezzsp9qeeuA0BAbR6Pm58GrC2128sel5xdflmck9CaPlFb2hjpPwxqV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=; 7:ZzPXQ7aMglaCnCC4LF5ZWE3wF71cjXwxIOSJTrIoWxHwsLEVpg7iXVwn1i9yDpFrU0KPXUWDVd8Hp4jJs+VyhiUbQ4NyjsoDBFjpGcphiIhoQpzxI/nB+GMdNDhhmP/2ZbpffYqkspSvuC3TJsjxtrbqtrvBnu8bfWpOpSQZCsCKHdHn/Ks3OfBcrb6uCFY8e9jJrU+O2hjnGtL5eA6foaZaAF9pf4Sn0PdKoUBEsZ0lnkywAHs2g5d6cxfeLkQn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2018 12:36:56.0894 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 56017eda-0968-4f97-6700-08d55c14aaee X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2513 Subject: Re: [dpdk-dev] [PATCH v2 3/5] mbuf: support register mempool Hw ops name APIs 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: Mon, 15 Jan 2018 12:36:59 -0000 -----Original Message----- > Date: Mon, 15 Jan 2018 11:41:12 +0530 > From: Hemant Agrawal > To: dev@dpdk.org > CC: jerin.jacob@caviumnetworks.com, olivier.matz@6wind.com, > santosh.shukla@caviumnetworks.com > Subject: [PATCH v2 3/5] mbuf: support register mempool Hw ops name APIs > X-Mailer: git-send-email 2.7.4 > > With this patch the specific HW mempool are no longer required to be > specified in the config file at compile. A default platform hw mempool > can be detected dynamically and published to config at run time. > Only one type of HW mempool can be active default. > > Signed-off-by: Hemant Agrawal > --- > lib/librte_mbuf/Makefile | 1 + > lib/librte_mbuf/rte_mbuf.c | 42 +++++++++++++++++++++++++++++++++--- > lib/librte_mbuf/rte_mbuf.h | 20 +++++++++++++++++ > lib/librte_mbuf/rte_mbuf_version.map | 8 +++++++ > 4 files changed, 68 insertions(+), 3 deletions(-) > > diff --git a/lib/librte_mbuf/Makefile b/lib/librte_mbuf/Makefile > index 398f724..85c4f9e 100644 > --- a/lib/librte_mbuf/Makefile > +++ b/lib/librte_mbuf/Makefile > @@ -7,6 +7,7 @@ include $(RTE_SDK)/mk/rte.vars.mk > LIB = librte_mbuf.a > > CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 > +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common > LDLIBS += -lrte_eal -lrte_mempool > > EXPORT_MAP := rte_mbuf_version.map > diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c > index c085c37..fd3b6f5 100644 > --- a/lib/librte_mbuf/rte_mbuf.c > +++ b/lib/librte_mbuf/rte_mbuf.c > @@ -58,6 +58,7 @@ > #include > #include > #include > +#include > > /* > * ctrlmbuf constructor, given as a callback function to > @@ -148,6 +149,43 @@ rte_pktmbuf_init(struct rte_mempool *mp, > m->next = NULL; > } > > +int > +rte_mbuf_register_platform_mempool_ops(const char *ops_name) > +{ > + if (internal_config.plat_mbuf_pool_ops_name == NULL) { > + internal_config.plat_mbuf_pool_ops_name = ops_name; > + return 0; > + } > + RTE_LOG(ERR, MBUF, > + "%s is already registered as platform mbuf pool ops\n", > + internal_config.plat_mbuf_pool_ops_name); > + return -EACCES; > +} > + > +const char * > +rte_mbuf_platform_mempool_ops(void) > +{ > + return internal_config.plat_mbuf_pool_ops_name; > +} > + > +/* Return mbuf pool ops name */ > +static const char * > +rte_mbuf_best_mempool_ops(void) > +{ > + /* User defined mempool ops takes the priority */ > + const char *best_ops = rte_eal_mbuf_default_mempool_ops(); > + if (best_ops) > + return best_ops; > + > + /* Next choice is platform configured mempool ops */ > + best_ops = rte_mbuf_platform_mempool_ops(); > + if (best_ops) > + return best_ops; > + > + /* Last choice is to use the compile time config pool */ > + return RTE_MBUF_DEFAULT_MEMPOOL_OPS; > +} The mempool ops selection makes sense to me. We could add an "weight" based mempool ops selection in future here. http://dpdk.org/dev/patchwork/patch/32245/