Vector Packet Processing (VPP) portability on FreeBSD

Jim Thompson jim at netgate.com
Tue May 11 14:27:51 UTC 2021



> On May 11, 2021, at 7:04 AM, Mark Johnston <markj at freebsd.org> wrote:
> 
> On Tue, May 11, 2021 at 12:43:10PM +0000, Francois ten Krooden wrote:
>> On  Monday, 10 May 2021 16:10 Konstantin Belousov wrote:
>> 
>> 
>>> On Mon, May 10, 2021 at 11:08:18AM +0000, Francois ten Krooden wrote:
>>>> 3. What are suitable alternatives for reading information from procfs and
>>> sysfs on FreeBSD?
>>> Understand what information is obtained, then what for is it actually used,
>>> then match it against equivalent FreeBSD approach, then gather the
>>> required information.
>> 
>> Thank you.  This was basically what we suspected.
>> One of the ones we are unsure about is what the equivalent of /proc/self/pagemap on Linux would be.
>> The one idea we had is using procstat_getvmmap from libprocstat, but haven't finished investigating yet.
> 
> I believe DPDK's libeal uses /proc/pagemap to look up the physical
> address of large page mappings.  Assuming you want to do the same thing,
> there is the MEM_EXTRACT_PADDR /dev/mem ioctl.  It was added
> specifically for DPDK.  See the mem(4) man page for details on its
> usage.

Upthread mentioned Netgate (we do pfSense) as being possibly involved in a port of VPP to FreeBSD.  We do have some interest, and I had once handed this to a contractor, but
not much progress was made, and we had our hands full with pfSense and our VPP-based product (tnsr).  VPP has been discussed on freebsd-net before.

You and your team have made it much farther.

I’d spoken to the VPP ‘core team’ about the sustainability of a port of VPP to FreeBSD, and they didn’t say ’No’.  The lead VPP person at Cisco used to be a FreeBSD src committer, and he basically said, “Patches welcome”.   Someone will probably want to bring CSIT along to help prevent regressions on FreeBSD, but that team also seemed open when I checked.

IMO, netmap seems a better approach on FreeBSD, as you’ll eventually want something like the ‘router plugin’ to be able to communicate between the kernel and VPP, obtain FIBs, etc.  
We’ve been strong proponents of (and a main contributor to) the ‘linux-cp” plugin, (a better version of the router plugin, partially upstreamed to VPP), but it’s based on netlink, and is has more linux-isms than the main body of VPP.  Netmap has a very nice architecture for building something similar, where packets can be directly sent to and received from the host rings by VPP, and these host rings are associated with an interface ring. Netmap-fwd uses this to good effect.

Netmap is slightly slower in maximum PPS than DPDK, but for your use case (IPsec), you won't see a difference (assuming some things when I say this.)

Jim


More information about the freebsd-net mailing list