Date: Thu, 6 Sep 2018 10:12:57 +0200 From: Vincenzo Maffione <v.maffione@gmail.com> To: Marko Zec <zec@fer.hr> Cc: jmg@funkthat.com, bz@freebsd.org, Luigi Rizzo <rizzo@iet.unipi.it>, "freebsd-net@freebsd.org" <net@freebsd.org> Subject: Re: vale and netmap module questions Message-ID: <CA%2B_eA9gBkgOHu0Sipr-uLiFt6Ru7GK8bYsdpEeWHqpHcmp4pJg@mail.gmail.com> In-Reply-To: <20180906083535.36ac39ce@x23> References: <20180901014953.GV45503@funkthat.com> <CA%2B_eA9gH_uzxV_YLBH1XdM-ygPUxXzD_W9_b45jTmeY-t0bQKg@mail.gmail.com> <20180901211123.GZ45503@funkthat.com> <20180904164303.68c43b6e@x23> <20180904162815.GA75530@funkthat.com> <CA%2B_eA9jp2rB0GjojNrbWuQJ3fChpF6U5KPOX-DvEzJDVzOSP4w@mail.gmail.com> <20180905104433.08ad13b8@x23> <CA%2B_eA9gxCrJXVFaooD4x491Ksff5=gomwfn0=E0X0_iuupuBHg@mail.gmail.com> <20180905124730.0f266c37@x23> <20180906004206.GB75530@funkthat.com> <20180906083535.36ac39ce@x23>
next in thread | previous in thread | raw e-mail | index | archive | help
Il giorno gio 6 set 2018 alle ore 08:35 Marko Zec <zec@fer.hr> ha scritto: > On Wed, 5 Sep 2018 17:42:06 -0700 > John-Mark Gurney <jmg@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@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B_eA9gBkgOHu0Sipr-uLiFt6Ru7GK8bYsdpEeWHqpHcmp4pJg>