From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH v2 3/5] mbuf: support register mempool Hw ops name APIs Date: Mon, 15 Jan 2018 17:11:29 +0530 Message-ID: <20180115114127.GA29114@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 Cc: dev@dpdk.org, olivier.matz@6wind.com, santosh.shukla@caviumnetworks.com To: Hemant Agrawal Return-path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0055.outbound.protection.outlook.com [104.47.41.55]) by dpdk.org (Postfix) with ESMTP id 49F0671B5 for ; Mon, 15 Jan 2018 12:41:51 +0100 (CET) Content-Disposition: inline In-Reply-To: <1515996674-26338-4-git-send-email-hemant.agrawal@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----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) > +{ Should we also check the following? if (internal_config.plat_mbuf_pool_ops_name != NULL && strncmp(internal_config.plat_mbuf_pool_ops_name, ops_name, ..) == 0) return 0; i.e avoid returning error if the same the driver but another instance(different ethdev port) updates the same ops_name value.