Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Oct 2012 13:33:05 -0400
From:      Ming Fu <ming.fu@netsweeper.com>
To:        freebsd-net@freebsd.org
Subject:   Re: netmap NETMAP_SW_RING or NETMAP_HW_RING
Message-ID:  <507EEBD1.3020703@netsweeper.com>
In-Reply-To: <507EDFCE.3060702@netsweeper.com>
References:  <507EDFCE.3060702@netsweeper.com>

next in thread | previous in thread | raw e-mail | index | archive | help
After a second look at the netmap_open code, I believe the 
NETMAP_HW_RING is the choice.

My next trouble to to receive packets.

The program spins off 8 threads, each thread try to bind to one of the 
queue on an igb card. (queue 0-7).
depending on how I call the netmap_open().
if I call
     netmap_open(&me, id /*| NETMAP_HW_RING */, 1);

The program will able to receive packets, but of course each thread 
receives packet from all 8 queues.

If I call
     netmap_open(&me, id | NETMAP_HW_RING , 1)
none of the thread was able to receive packet.

come across the following line of code in nm_util.c
     } else if (ringid & NETMAP_HW_RING) {
         D("XXX check multiple threads");
What does it suggest? any special requirement for multi-threaded program?

Regards,
Ming


On 10/17/2012 12:41 PM, Ming Fu wrote:
> Hi,
>
> What is the difference between NETMAP_SW_RING and NETMAP_HW_RING.
> When using netmap_open() in the example code to create a netmap fdesc, 
> one of these two need to be ORed to the queue ID, in order to bind 
> only one RX queue.
>
> netmap code updated from FreeBSD RELENG_9.
>
> Regards,
> Ming
>
>
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?507EEBD1.3020703>