vale and netmap module questions

Vincenzo Maffione v.maffione at gmail.com
Thu Sep 6 08:15:22 UTC 2018


Il giorno gio 6 set 2018 alle ore 08:35 Marko Zec <zec at fer.hr> ha scritto:

> On Wed, 5 Sep 2018 17:42:06 -0700
> John-Mark Gurney <jmg at funkthat.com> wrote:
>
> > Marko Zec wrote this message on Wed, Sep 05, 2018 at 12:47 +0200:
> > > On Wed, 5 Sep 2018 12:36:38 +0200
> > > Vincenzo Maffione <v.maffione at gmail.com> wrote:
> > >
> > > > Hi Marko,
> > > >   Thanks a lot for identifying the problem.
> > > > If I understand correctly, simply adding -D VIMAGE here
> > > >
> https://github.com/luigirizzo/netmap/blob/master/sys/modules/netmap/Makefile#L11
> > > > would at least mitigate the issue.
> > > > If you think I'm right I'll just add it.
> > >
> > > Right, go for it...
> >
> > Why not just hook up netmap to the build?
>
> I have no idea why it is on by default only on amd64...  Perhaps due to
> the lack of adopters / testers on other platforms?  Perhaps the code has
> some assumptions re. memory coherence model, or unaligned accesses,
> which hold the water on amd64 but not necessarily elsewhere?
>

We used netmap on aarch64 (on Linux) with no problems.
There can certainly be bugs on untested platforms, but there are no
assumptions about the cache coherence
model. And we do not use unaligned access, of course, which would slow down
the whole thing.


>
> > Because if you add -DVIMAGE to the Makefile, you'll now break people
> > who have kernels w/o VIMAGE..
>
> No, and this is certifiable.  At least in this particular case, we have
> only two macro instances which set / restore curvnet prior to calling
> into the network stack.  If the network stack is of the non-VNET kind,
> and thus doesn't care about curvnet, that won't do any harm.
>

Yes indeed. I just tried on FreeBSD 10.3 (with VIMAGE off) and netmap works
when compiled with -DVIMAGE.


>
> > And the only reason to build netmap module manually is because it's not
> hooked up.
>
> There's still a reason to retain the possibility to build netmap as
> module, as this speeds up the development cycles for netmap-internal
> hackers / experimenters.
>

> But beyond that, running netmap without native support in device
> drivers is pretty much pointless.
>

Not really. Netmap exports software-only ports, like pipes, monitor, VALE
ports, etc, that you can use with profit even
without native support.
The real problem, if I recall correctly, is that FreeBSD modules introduce
a significant overhead every time you need
to invoke a module function from the kernel core image. I guess it is a
matter of reference counters and locks.
So running netmap as a module leads to significantly lower performance. But
it is ok for regression testing and
experimentation.

-- 
Vincenzo


More information about the freebsd-net mailing list