From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shreyansh Jain Subject: Re: [PATCH 1/2] drivers/mempool: add stack mempool handler as driver Date: Tue, 28 Mar 2017 17:12:47 +0530 Message-ID: References: <1490004190-16892-1-git-send-email-shreyansh.jain@nxp.com> <20170324172227.5bdfac8c@platinum> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Cc: , , To: Olivier Matz Return-path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0040.outbound.protection.outlook.com [104.47.34.40]) by dpdk.org (Postfix) with ESMTP id AC93B2C74 for ; Tue, 28 Mar 2017 13:36:54 +0200 (CEST) In-Reply-To: <20170324172227.5bdfac8c@platinum> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hello Olivier, On Friday 24 March 2017 09:52 PM, Olivier Matz wrote: [..] > 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. I have been trying to simulate the segfault that you are referring to above. But, I think it should not be the case. If a mempool handler is not registered (as librte_mempool_ring was not included in mk/rte.app.mk, so, no "ring_mp_mc"), the caller would get error. The mempool_autotest is reporting: --->8-- RTE>>mempool_autotest cannot allocate mp_nocache mempool Test Failed --->8-- > > 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); Can you tell me for which case did your code reach rte_mempool_ops_alloc() and segfault? In my case, librte_mempool_ring and librte_mempool_stack are not added to mk/rte.app.mk and it is static compilation. > > 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? Yes, once I can get this issue reproduced. Because I think there is one more place similar code should go (rte_mempool_ops_getcount). As per what I can see, this would only happen if rte_mempool_xmem_create is called and then directly alloc is called. That is not happening for mempool_autotest. - Shreyansh