azunite / netmap

Automatically exported from code.google.com/p/netmap
0 stars 0 forks source link

pkt-gen.c : nmd is copied but not used + multi-queue in pkt-gen #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please directly see this commit :
https://github.com/MappaM/netmap/commit/f2d683633fd16cb80132d2c9da7d9521aea85714

You say "copy, we overwrite ringid" as a comment but you don't use the copy.

So the threaded version of pkt-gen is not working as the nr_ringid is never 
taken into account (it is set in the unused copy).

If I may, I don't understand how we should use the new interface naming 
convention with multiqueue/multithread in pkt-gen. Looking to the code :

if (g->nthreads > 1) {
      if (nmd.req.nr_flags != NR_REG_ALL_NIC) {
            D("invalid nthreads mode %d", nmd.req.nr_flags);
                                continue;
}

The interface parameter should have no suffix to be put in NR_REG_ALL_NIC mode. 
But in that case, the first nm_open() effectively register for all NICs and the 
POLL IN on the "per-queue" threads is never notified.

So my workaround when using pktgen with multi-thread and POLLIN is to use the 
"^" suffix to attach the interface to the host only, and change pkt-gen to 
accept it :
https://github.com/MappaM/netmap/commit/787fe7ccdf2f8a6e9efea3dce10b89ff2fbee9d7

Thanks,
Tom Barbette <tom.barbette@ulg.ac.be>

Original issue reported on code.google.com by mapp...@gmail.com on 22 Apr 2014 at 2:35

GoogleCodeExporter commented 9 years ago
After some tests I'm not sur anymore about that part :
"The interface parameter should have no suffix to be put in NR_REG_ALL_NIC 
mode. But in that case, the first nm_open() effectively register for all NICs 
and the POLL IN on the "per-queue" threads is never notified."
As it's working in another of my programs... Maybe it was because I did the 
test before the correction I propose...
But the primary concern stays ;)

Original comment by mapp...@gmail.com on 25 Apr 2014 at 7:35

GoogleCodeExporter commented 9 years ago
Dear Tom,
thank you for your primary patch. 
(https://github.com/MappaM/netmap/commit/f2d683633fd16cb80132d2c9da7d9521aea8571
4)

We used this to fix part of the issue 11 
(https://code.google.com/p/netmap/issues/detail?id=11&can=1).

Original comment by stefanog...@gmail.com on 8 Jul 2014 at 2:27