[dpdk-dev] [PATCH 1/2] drivers/mempool: add stack mempool handler as driver
Shreyansh Jain
shreyansh.jain at nxp.com
Tue Mar 28 13:42:47 CEST 2017
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
More information about the dev
mailing list