DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Running 2 process on the same machine
@ 2016-11-07 15:28 Keren Hochman
  2016-11-07 22:36 ` Wiles, Keith
  0 siblings, 1 reply; 5+ messages in thread
From: Keren Hochman @ 2016-11-07 15:28 UTC (permalink / raw)
  To: dev

Hi,
I need to run 2 process that uses dpdk on the same machine. One uses dpdk
drivers, and the other just read from a pcap file.  If I disable hugepages
in the second process rte_mempool_create fails. What is the correct way to
handle this?

Thanks, Keren

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

* Re: [dpdk-dev] Running 2 process on the same machine
  2016-11-07 15:28 [dpdk-dev] Running 2 process on the same machine Keren Hochman
@ 2016-11-07 22:36 ` Wiles, Keith
  2016-11-08  9:44   ` Keren Hochman
  0 siblings, 1 reply; 5+ messages in thread
From: Wiles, Keith @ 2016-11-07 22:36 UTC (permalink / raw)
  To: Keren Hochman; +Cc: dev


> On Nov 7, 2016, at 7:28 AM, Keren Hochman <keren.hochman@lightcyber.com> wrote:
> 
> Hi,
> I need to run 2 process that uses dpdk on the same machine. One uses dpdk
> drivers, and the other just read from a pcap file.  If I disable hugepages
> in the second process rte_mempool_create fails. What is the correct way to
> handle this?

If you look at the two scripts in Pktgen pktgen-master.sh and pktgen-slave.sh these two scripts setup two instances of pktgen on the same machine. Plus you can read the README.md file.

http://dpdk.org/browse/apps/pktgen-dpdk/refs/

You have to make sure you have enough memory (huge pages) allocated for both instances to run.

Then use —file-prefix XX to give each instance a different prefix for the huge page files in /dev/hugepages if that is the location of the files on your system. I would remove any files in that directory to free up the memory.

Use the —socket-mem to allocate the correct amount of memory for each instances this way DPDK does not consume all the pages for a given instance.

Make sure you blacklist the ports you do not want on the first instance using -b option and then blacklist the ports from the first instance while allowing the other ports to be used on the second one.

That should do it for most cases.

> 
> Thanks, Keren

Regards,
Keith


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

* Re: [dpdk-dev] Running 2 process on the same machine
  2016-11-07 22:36 ` Wiles, Keith
@ 2016-11-08  9:44   ` Keren Hochman
  2016-11-08 12:02     ` Keren Hochman
  0 siblings, 1 reply; 5+ messages in thread
From: Keren Hochman @ 2016-11-08  9:44 UTC (permalink / raw)
  To: Wiles, Keith; +Cc: dev

Thank you for your response, I still can not run the 2 process together.
if I add --no-pci to one process it can replace white and black lists
right?

Thanks, keren

On Tue, Nov 8, 2016 at 12:36 AM, Wiles, Keith <keith.wiles@intel.com> wrote:

>
> > On Nov 7, 2016, at 7:28 AM, Keren Hochman <keren.hochman@lightcyber.com>
> wrote:
> >
> > Hi,
> > I need to run 2 process that uses dpdk on the same machine. One uses dpdk
> > drivers, and the other just read from a pcap file.  If I disable
> hugepages
> > in the second process rte_mempool_create fails. What is the correct way
> to
> > handle this?
>
> If you look at the two scripts in Pktgen pktgen-master.sh and
> pktgen-slave.sh these two scripts setup two instances of pktgen on the same
> machine. Plus you can read the README.md file.
>
> http://dpdk.org/browse/apps/pktgen-dpdk/refs/
>
> You have to make sure you have enough memory (huge pages) allocated for
> both instances to run.
>
> Then use —file-prefix XX to give each instance a different prefix for the
> huge page files in /dev/hugepages if that is the location of the files on
> your system. I would remove any files in that directory to free up the
> memory.
>
> Use the —socket-mem to allocate the correct amount of memory for each
> instances this way DPDK does not consume all the pages for a given instance.
>
> Make sure you blacklist the ports you do not want on the first instance
> using -b option and then blacklist the ports from the first instance while
> allowing the other ports to be used on the second one.
>
> That should do it for most cases.
>
> >
> > Thanks, Keren
>
> Regards,
> Keith
>
>

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

* Re: [dpdk-dev] Running 2 process on the same machine
  2016-11-08  9:44   ` Keren Hochman
@ 2016-11-08 12:02     ` Keren Hochman
  2016-11-14 15:44       ` Bruce Richardson
  0 siblings, 1 reply; 5+ messages in thread
From: Keren Hochman @ 2016-11-08 12:02 UTC (permalink / raw)
  To: Wiles, Keith; +Cc: dev

Also, I can't understand how to define socket-mem. I did not see anything
related to hugepages in /etc/sysctl.conf. Can i mount hugepages to 2
different dirs instead and use --huge-dir ?
Thank you.





















On Tue, Nov 8, 2016 at 11:44 AM, Keren Hochman <keren.hochman@lightcyber.com
> wrote:

> Thank you for your response, I still can not run the 2 process together.
> if I add --no-pci to one process it can replace white and black lists
> right?
>
> Thanks, keren
>
> On Tue, Nov 8, 2016 at 12:36 AM, Wiles, Keith <keith.wiles@intel.com>
> wrote:
>
>>
>> > On Nov 7, 2016, at 7:28 AM, Keren Hochman <keren.hochman@lightcyber.com>
>> wrote:
>> >
>> > Hi,
>> > I need to run 2 process that uses dpdk on the same machine. One uses
>> dpdk
>> > drivers, and the other just read from a pcap file.  If I disable
>> hugepages
>> > in the second process rte_mempool_create fails. What is the correct way
>> to
>> > handle this?
>>
>> If you look at the two scripts in Pktgen pktgen-master.sh and
>> pktgen-slave.sh these two scripts setup two instances of pktgen on the same
>> machine. Plus you can read the README.md file.
>>
>> http://dpdk.org/browse/apps/pktgen-dpdk/refs/
>>
>> You have to make sure you have enough memory (huge pages) allocated for
>> both instances to run.
>>
>> Then use —file-prefix XX to give each instance a different prefix for the
>> huge page files in /dev/hugepages if that is the location of the files on
>> your system. I would remove any files in that directory to free up the
>> memory.
>>
>> Use the —socket-mem to allocate the correct amount of memory for each
>> instances this way DPDK does not consume all the pages for a given instance.
>>
>> Make sure you blacklist the ports you do not want on the first instance
>> using -b option and then blacklist the ports from the first instance while
>> allowing the other ports to be used on the second one.
>>
>> That should do it for most cases.
>>
>> >
>> > Thanks, Keren
>>
>> Regards,
>> Keith
>>
>>
>

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

* Re: [dpdk-dev] Running 2 process on the same machine
  2016-11-08 12:02     ` Keren Hochman
@ 2016-11-14 15:44       ` Bruce Richardson
  0 siblings, 0 replies; 5+ messages in thread
From: Bruce Richardson @ 2016-11-14 15:44 UTC (permalink / raw)
  To: Keren Hochman; +Cc: Wiles, Keith, dev

On Tue, Nov 08, 2016 at 02:02:32PM +0200, Keren Hochman wrote:
> Also, I can't understand how to define socket-mem. I did not see anything
> related to hugepages in /etc/sysctl.conf. Can i mount hugepages to 2
> different dirs instead and use --huge-dir ?
> Thank you.
> 
Doing so would be a replacement for using the --file-prefix option,
because even with two different hugepage mount points all pages can be
used via each one, meaning the first process can still use all hugepage
memory. The only exception to this that I know of is if the two mountpoints
are for two different sizes of hugepages.

With regards to the process failing if you use the --no-huge option: did
you try running with --no-huge and a -m or --socket-mem option? By
default, I think the --no-huge option only allocates a relatively small
amount of memory for DPDK use. Try "--no-huge -m 2048" and see if that
helps.

Regards,
/Bruce

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

end of thread, other threads:[~2016-11-14 15:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-07 15:28 [dpdk-dev] Running 2 process on the same machine Keren Hochman
2016-11-07 22:36 ` Wiles, Keith
2016-11-08  9:44   ` Keren Hochman
2016-11-08 12:02     ` Keren Hochman
2016-11-14 15:44       ` Bruce Richardson

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