netmap NETMAP_SW_RING or NETMAP_HW_RING

Ming Fu ming.fu at netsweeper.com
Wed Oct 17 17:33:07 UTC 2012


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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"



More information about the freebsd-net mailing list