From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: Re: [PATCH 1/2] drivers/mempool: add stack mempool handler as driver Date: Fri, 24 Mar 2017 17:22:27 +0100 Message-ID: <20170324172227.5bdfac8c@platinum> References: <1490004190-16892-1-git-send-email-shreyansh.jain@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: , , To: Shreyansh Jain Return-path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id E27B269D8 for ; Fri, 24 Mar 2017 17:22:31 +0100 (CET) Received: by mail-wm0-f48.google.com with SMTP id u132so17120214wmg.0 for ; Fri, 24 Mar 2017 09:22:31 -0700 (PDT) In-Reply-To: <1490004190-16892-1-git-send-email-shreyansh.jain@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" Hi Shreyansh, On Mon, 20 Mar 2017 15:33:09 +0530, Shreyansh Jain wrote: > CONFIG_RTE_DRIVER_MEMPOOL_STACK option added to common_base. > Stack mempool handler moved from lib/librte_mempool into drivers/mempool. > > With this patch, the Stack mempool handler registration is optional and > toggled via the configuration file. In case disabled (N), it would imply > request for creating of mempool would fail. > > Signed-off-by: Shreyansh Jain > --- > config/common_base | 5 + > drivers/Makefile | 1 + > drivers/mempool/Makefile | 36 +++++ > drivers/mempool/stack/Makefile | 55 ++++++++ > drivers/mempool/stack/rte_mempool_stack.c | 147 +++++++++++++++++++++ > .../mempool/stack/rte_mempool_stack_version.map | 4 + > lib/librte_mempool/Makefile | 1 - > lib/librte_mempool/rte_mempool_stack.c | 147 --------------------- > 8 files changed, 248 insertions(+), 148 deletions(-) > create mode 100644 drivers/mempool/Makefile > create mode 100644 drivers/mempool/stack/Makefile > create mode 100644 drivers/mempool/stack/rte_mempool_stack.c > create mode 100644 drivers/mempool/stack/rte_mempool_stack_version.map > delete mode 100644 lib/librte_mempool/rte_mempool_stack.c I tried to pass the mempool autotest, and it issues a segfault. I think the libraries are missing in rte.app.mk, so no handler is registered. Adding the following code in lib/librte_mempool/rte_mempool_ops.c fixes the crash. ops = rte_mempool_get_ops(mp->ops_index); + if (ops == NULL || ops->alloc == NULL) + return -ENOTSUP; return ops->alloc(mp); Now that drivers are not linked to the mempool library, it can happen that there is no handler. Could you please add this patch in your patchset? I also checked that compilation works in shared lib mode. It looks good, but I think there will be a behavior change if CONFIG_RTE_EAL_PMD_PATH is empty (default). This option is probably used by distros to indicate where dpdk plugins are installed, and when it is set, all drivers of this directory are loaded, so in that case it won't change. But when unset, the drivers have to be loaded manually, and with this change, the mempool driver will have to be loaded with the -d eal option. Could you please check what occurs in that case? At least see if it displays a nice error or if it crashes. I suspect it will crash Also, the MAINTAINERS file should be updated. Thanks, Olivier