DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] How rte_mempool_ops_table is populated in a DPDK client application?
@ 2017-09-01 13:36 Ming Fu
  0 siblings, 0 replies; 5+ messages in thread
From: Ming Fu @ 2017-09-01 13:36 UTC (permalink / raw)
  To: users

Try to make snort to receive packet from a dpdk ring as an client application. The DPDK is compiled into the snort DAQ lib statically. The DAQ lib is then linked to snort statically.

What I am find is that the rte_mempool_ops_table is all 0, causing the client to crash when free the received mbuf from the ring. I was wondering how this rte_mempool_ops_table is populated during DPDK initialization for a client application.

The my dpdk snort went through rte_eal_init(), rte_ring_lookup() and rte_mempool_lookup() without error.

Thanks
Ming

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] How rte_mempool_ops_table is populated in a DPDK client application?
  2017-09-01 20:56   ` Ming Fu
@ 2017-09-01 21:01     ` Stephen Hemminger
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2017-09-01 21:01 UTC (permalink / raw)
  To: Ming Fu; +Cc: users

On Fri, 1 Sep 2017 20:56:12 +0000
Ming Fu <Ming.Fu@esentire.com> wrote:

> Hi Stephen,
> 
> Is there any document or example project I can reference as how to properly setup static initializer for DPDK from a GNU like Makefile.
> 
> Thanks,
> Ming

It is somewhere in DPDK documentation already

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] How rte_mempool_ops_table is populated in a DPDK client application?
  2017-09-01 20:47 ` Stephen Hemminger
@ 2017-09-01 20:56   ` Ming Fu
  2017-09-01 21:01     ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Ming Fu @ 2017-09-01 20:56 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: users

Hi Stephen,

Is there any document or example project I can reference as how to properly setup static initializer for DPDK from a GNU like Makefile.

Thanks,
Ming
-----Original Message-----
From: Stephen Hemminger [mailto:stephen@networkplumber.org] 
Sent: September-01-17 4:47 PM
To: Ming Fu <Ming.Fu@esentire.com>
Cc: users@dpdk.org
Subject: Re: [dpdk-users] How rte_mempool_ops_table is populated in a DPDK client application?

On Fri, 1 Sep 2017 20:26:48 +0000
Ming Fu <Ming.Fu@esentire.com> wrote:

> Did some digging and find that the rte_mempool_ops_table is populated from function rte_mempool_register_ops().
> From a small program build in the dpdk example, the rte_mempool_register_ops() is called from the following stack trace
> 
> (gdb) where
> #0  0x000000000047eea0 in rte_mempool_register_ops ()
> #1  0x00000000006a8abd in __libc_csu_init ()
> #2  0x00007ffff71f97bf in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
> #3  0x0000000000440f29 in _start ()
> 
> So this function is called probably before rte_eal_init(). If I have an application linked to a static lib of dpdk outside of dpdk build tree, how do I make it to register the call to rte_mempool_register_ops from __libc_csu_init()?
> 
> Thanks
> Ming
> 
> From: Ming Fu
> Sent: September-01-17 9:36 AM
> To: users@dpdk.org
> Subject: How rte_mempool_ops_table is populated in a DPDK client application?
> 
> Try to make snort to receive packet from a dpdk ring as an client application. The DPDK is compiled into the snort DAQ lib statically. The DAQ lib is then linked to snort statically.
> 
> What I am find is that the rte_mempool_ops_table is all 0, causing the client to crash when free the received mbuf from the ring. I was wondering how this rte_mempool_ops_table is populated during DPDK initialization for a client application.
> 
> The my dpdk snort went through rte_eal_init(), rte_ring_lookup() and rte_mempool_lookup() without error.
> 
> Thanks
> Ming

Make sure static initalizers are run in your program. If you use the DPDK mk rules, it works correctly.
If you use other build environments, you need to adjust the linker flags.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] How rte_mempool_ops_table is populated in a DPDK client application?
  2017-09-01 20:26 Ming Fu
@ 2017-09-01 20:47 ` Stephen Hemminger
  2017-09-01 20:56   ` Ming Fu
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2017-09-01 20:47 UTC (permalink / raw)
  To: Ming Fu; +Cc: users

On Fri, 1 Sep 2017 20:26:48 +0000
Ming Fu <Ming.Fu@esentire.com> wrote:

> Did some digging and find that the rte_mempool_ops_table is populated from function rte_mempool_register_ops().
> From a small program build in the dpdk example, the rte_mempool_register_ops() is called from the following stack trace
> 
> (gdb) where
> #0  0x000000000047eea0 in rte_mempool_register_ops ()
> #1  0x00000000006a8abd in __libc_csu_init ()
> #2  0x00007ffff71f97bf in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
> #3  0x0000000000440f29 in _start ()
> 
> So this function is called probably before rte_eal_init(). If I have an application linked to a static lib of dpdk outside of dpdk build tree, how do I make it to register the call to rte_mempool_register_ops from __libc_csu_init()?
> 
> Thanks
> Ming
> 
> From: Ming Fu
> Sent: September-01-17 9:36 AM
> To: users@dpdk.org
> Subject: How rte_mempool_ops_table is populated in a DPDK client application?
> 
> Try to make snort to receive packet from a dpdk ring as an client application. The DPDK is compiled into the snort DAQ lib statically. The DAQ lib is then linked to snort statically.
> 
> What I am find is that the rte_mempool_ops_table is all 0, causing the client to crash when free the received mbuf from the ring. I was wondering how this rte_mempool_ops_table is populated during DPDK initialization for a client application.
> 
> The my dpdk snort went through rte_eal_init(), rte_ring_lookup() and rte_mempool_lookup() without error.
> 
> Thanks
> Ming

Make sure static initalizers are run in your program. If you use the DPDK mk rules, it works correctly.
If you use other build environments, you need to adjust the linker flags.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] How rte_mempool_ops_table is populated in a DPDK client application?
@ 2017-09-01 20:26 Ming Fu
  2017-09-01 20:47 ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Ming Fu @ 2017-09-01 20:26 UTC (permalink / raw)
  To: users

Did some digging and find that the rte_mempool_ops_table is populated from function rte_mempool_register_ops().
>From a small program build in the dpdk example, the rte_mempool_register_ops() is called from the following stack trace

(gdb) where
#0  0x000000000047eea0 in rte_mempool_register_ops ()
#1  0x00000000006a8abd in __libc_csu_init ()
#2  0x00007ffff71f97bf in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x0000000000440f29 in _start ()

So this function is called probably before rte_eal_init(). If I have an application linked to a static lib of dpdk outside of dpdk build tree, how do I make it to register the call to rte_mempool_register_ops from __libc_csu_init()?

Thanks
Ming

From: Ming Fu
Sent: September-01-17 9:36 AM
To: users@dpdk.org
Subject: How rte_mempool_ops_table is populated in a DPDK client application?

Try to make snort to receive packet from a dpdk ring as an client application. The DPDK is compiled into the snort DAQ lib statically. The DAQ lib is then linked to snort statically.

What I am find is that the rte_mempool_ops_table is all 0, causing the client to crash when free the received mbuf from the ring. I was wondering how this rte_mempool_ops_table is populated during DPDK initialization for a client application.

The my dpdk snort went through rte_eal_init(), rte_ring_lookup() and rte_mempool_lookup() without error.

Thanks
Ming

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-01 21:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-01 13:36 [dpdk-users] How rte_mempool_ops_table is populated in a DPDK client application? Ming Fu
2017-09-01 20:26 Ming Fu
2017-09-01 20:47 ` Stephen Hemminger
2017-09-01 20:56   ` Ming Fu
2017-09-01 21:01     ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).