On Thu, Oct 22, 2015 at 11:12 AM, Adrian Chadd <adrian.chadd at gmail.com> wrote:> On 22 October 2015 at 09:35, Slawa Olhovchenkov <slw at zxy.spb.ru> wrote: >> On Sun, Oct 18, 2015 at 07:45:52PM -0700, Adrian Chadd wrote: >> >>> Heh, file a bug with luigi; it should be defined better inside netmap itself. >> >> I am CC: luigi. >> >> Next question: do kevent RX/TX sync? >> In my setup I am need to manual NIOCTXSYNC/NIOCRXSYNC. > > Hi, > > Nope. kqueue() doesn't do the implicit sync like poll() does; it's > just the notification path.actually not. When the file descriptor is registered there is an implicit sync, and there is another one when an event is posted for the file descriptor. unless there are bugs, of course. cheers luigi -- -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo at iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2217533 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+-------------------------------
On Thu, Oct 22, 2015 at 11:24:53AM -0700, Luigi Rizzo wrote:> On Thu, Oct 22, 2015 at 11:12 AM, Adrian Chadd <adrian.chadd at gmail.com> wrote: > > On 22 October 2015 at 09:35, Slawa Olhovchenkov <slw at zxy.spb.ru> wrote: > >> On Sun, Oct 18, 2015 at 07:45:52PM -0700, Adrian Chadd wrote: > >> > >>> Heh, file a bug with luigi; it should be defined better inside netmap itself. > >> > >> I am CC: luigi. > >> > >> Next question: do kevent RX/TX sync? > >> In my setup I am need to manual NIOCTXSYNC/NIOCRXSYNC. > > > > Hi, > > > > Nope. kqueue() doesn't do the implicit sync like poll() does; it's > > just the notification path. > > actually not. When the file descriptor is registered there > is an implicit sync, and there is another one when an event > is posted for the file descriptor. > > unless there are bugs, of course.I am register file descriptor in kevent with EV_SET(ke+used, thr->outside.fd, EVFILT_READ, EV_ADD | EV_ENABLE | EV_CLEAR, 0, 0, &thr->outside); after got event in kevent(kq, NULL, 0, ke, max_event, NULL) I am don't see anything in rxring. if I do ioctl(fd, NIOCRXSYNC, NULL) after kevent I am see received packets in rxring, but nothing transmited. if I do ioctl(fd, NIOCTXSYNC, NULL) before kevent -- packets transmited. I am try this in VirtualBox VM. Also, can you look in this thread about VLAN processing?
On 22 October 2015 at 11:24, Luigi Rizzo <rizzo at iet.unipi.it> wrote:> On Thu, Oct 22, 2015 at 11:12 AM, Adrian Chadd <adrian.chadd at gmail.com> wrote: >> On 22 October 2015 at 09:35, Slawa Olhovchenkov <slw at zxy.spb.ru> wrote: >>> On Sun, Oct 18, 2015 at 07:45:52PM -0700, Adrian Chadd wrote: >>> >>>> Heh, file a bug with luigi; it should be defined better inside netmap itself. >>> >>> I am CC: luigi. >>> >>> Next question: do kevent RX/TX sync? >>> In my setup I am need to manual NIOCTXSYNC/NIOCRXSYNC. >> >> Hi, >> >> Nope. kqueue() doesn't do the implicit sync like poll() does; it's >> just the notification path. > > actually not. When the file descriptor is registered there > is an implicit sync, and there is another one when an event > is posted for the file descriptor. > > unless there are bugs, of course.Hm, I think there are bugs. I'll have to go remember what I saw when I was messing with this. I actually think it's doing the full sync each time and not the lazy sync (ie, only when the ring is empty) which kills performance. I think that was the "bug". -a
On Thu, Oct 22, 2015 at 11:24:53AM -0700, Luigi Rizzo wrote:> On Thu, Oct 22, 2015 at 11:12 AM, Adrian Chadd <adrian.chadd at gmail.com> wrote: > > On 22 October 2015 at 09:35, Slawa Olhovchenkov <slw at zxy.spb.ru> wrote: > >> On Sun, Oct 18, 2015 at 07:45:52PM -0700, Adrian Chadd wrote: > >> > >>> Heh, file a bug with luigi; it should be defined better inside netmap itself. > >> > >> I am CC: luigi. > >> > >> Next question: do kevent RX/TX sync? > >> In my setup I am need to manual NIOCTXSYNC/NIOCRXSYNC. > > > > Hi, > > > > Nope. kqueue() doesn't do the implicit sync like poll() does; it's > > just the notification path. > > actually not. When the file descriptor is registered there > is an implicit sync, and there is another one when an event > is posted for the file descriptor. > > unless there are bugs, of course.I found strange behaivor: 1. open netmap and register in main thread 2. kevent register in different thread 3. result: got event by kevent but no ring sinc (all head,tail,cur still 0). Is this normal? Or is this bug? open and registering netmap in same thread as kevent resolve this.