DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] How to use --virtaddr for multi-process client app.
@ 2017-08-23 18:35 Ming Fu
  2017-08-28  8:12 ` Sergio Gonzalez Monroy
  0 siblings, 1 reply; 3+ messages in thread
From: Ming Fu @ 2017-08-23 18:35 UTC (permalink / raw)
  To: users

This is my first try on dpdk. I attached a snort process as an multi-process client similar to the client in the client-server example. The snort receives mbuf from the server process through a dpdk ring. A skeleton client worked, but once linked to snort, it failed in rte_eal_init().

EAL: Detected 48 lcore(s)
EAL: RTE Version: 'DPDK 17.08.0'
PANIC in rte_eal_config_reattach():
Cannot mmap memory for rte_config at [0x7ffff7faf000], got [0x7fffdea94000] - please use '--base-virtaddr' option

Strace show that the mmap() returns a different address than requested. What address should I set the -base-virtaddr to? Is there a way to avoid this kind of problem in general?

Thanks,
Ming

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

* Re: [dpdk-users] How to use --virtaddr for multi-process client app.
  2017-08-23 18:35 [dpdk-users] How to use --virtaddr for multi-process client app Ming Fu
@ 2017-08-28  8:12 ` Sergio Gonzalez Monroy
  2017-08-28 18:53   ` Ming Fu
  0 siblings, 1 reply; 3+ messages in thread
From: Sergio Gonzalez Monroy @ 2017-08-28  8:12 UTC (permalink / raw)
  To: Ming Fu, users

Hi Ming,

If you have ASLR enabled, every time you run an application the dynamic 
linker (ie. ld-linux) uses different addresses for the process mappings.
Basically the problem here is that the primary DPDK process creates a 
mapping for shared huge pages and the secondary process tries to map 
those shared huge pages in the same VMA as the primary process.
If there is already a mapping in the requested VMA, it fails with the 
error you are getting.
The --base-virtaddr option is only useful if you *disable* ASLR so the 
mappings are deterministic. Thus, you could find which VMA is free in 
both processes.

Another "option" is to just keep executing the client application until 
it works. As you can imagine, it is not a very reliable solution but 
avoids disabling ASLR.

Thanks,
Sergio

On 23/08/2017 19:35, Ming Fu wrote:
> This is my first try on dpdk. I attached a snort process as an multi-process client similar to the client in the client-server example. The snort receives mbuf from the server process through a dpdk ring. A skeleton client worked, but once linked to snort, it failed in rte_eal_init().
>
> EAL: Detected 48 lcore(s)
> EAL: RTE Version: 'DPDK 17.08.0'
> PANIC in rte_eal_config_reattach():
> Cannot mmap memory for rte_config at [0x7ffff7faf000], got [0x7fffdea94000] - please use '--base-virtaddr' option
>
> Strace show that the mmap() returns a different address than requested. What address should I set the -base-virtaddr to? Is there a way to avoid this kind of problem in general?
>
> Thanks,
> Ming

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

* Re: [dpdk-users] How to use --virtaddr for multi-process client app.
  2017-08-28  8:12 ` Sergio Gonzalez Monroy
@ 2017-08-28 18:53   ` Ming Fu
  0 siblings, 0 replies; 3+ messages in thread
From: Ming Fu @ 2017-08-28 18:53 UTC (permalink / raw)
  To: Sergio Gonzalez Monroy, users

This really helps, the --base-virtaddr should applied to the mp_server application.

Ming

-----Original Message-----
From: Sergio Gonzalez Monroy [mailto:sergio.gonzalez.monroy@intel.com] 
Sent: August-28-17 4:13 AM
To: Ming Fu <Ming.Fu@esentire.com>; users@dpdk.org
Subject: Re: [dpdk-users] How to use --virtaddr for multi-process client app.

Hi Ming,

If you have ASLR enabled, every time you run an application the dynamic linker (ie. ld-linux) uses different addresses for the process mappings.
Basically the problem here is that the primary DPDK process creates a mapping for shared huge pages and the secondary process tries to map those shared huge pages in the same VMA as the primary process.
If there is already a mapping in the requested VMA, it fails with the error you are getting.
The --base-virtaddr option is only useful if you *disable* ASLR so the mappings are deterministic. Thus, you could find which VMA is free in both processes.

Another "option" is to just keep executing the client application until it works. As you can imagine, it is not a very reliable solution but avoids disabling ASLR.

Thanks,
Sergio

On 23/08/2017 19:35, Ming Fu wrote:
> This is my first try on dpdk. I attached a snort process as an multi-process client similar to the client in the client-server example. The snort receives mbuf from the server process through a dpdk ring. A skeleton client worked, but once linked to snort, it failed in rte_eal_init().
>
> EAL: Detected 48 lcore(s)
> EAL: RTE Version: 'DPDK 17.08.0'
> PANIC in rte_eal_config_reattach():
> Cannot mmap memory for rte_config at [0x7ffff7faf000], got 
> [0x7fffdea94000] - please use '--base-virtaddr' option
>
> Strace show that the mmap() returns a different address than requested. What address should I set the -base-virtaddr to? Is there a way to avoid this kind of problem in general?
>
> Thanks,
> Ming

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

end of thread, other threads:[~2017-08-28 18:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 18:35 [dpdk-users] How to use --virtaddr for multi-process client app Ming Fu
2017-08-28  8:12 ` Sergio Gonzalez Monroy
2017-08-28 18:53   ` Ming Fu

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).