SnabbCo/snabbswitch — pull request #138 by alexandergall (2014-04-17 13:23:45+00:00)
Title: L2 VPN take 2

This pull request incorporates all changes I've made sine the first request. I have also made more sensible commits this time which hopefully make it easier to understand.

Up front: please let's not waste time again on the class.lua thing. I acknowledge that it's controversial. It's still there because Luke asked me to keep it. Whether we need a convention for OOP in this project or not and how it should look like should better be discussed elsewhere. It should have little to no impact on the main purpose of this pull request.

The gist of it is to see whether we can have the cake and it, too. I.e. whether we can have higher-level, reusable code for packet handling without dramatic loss of performance. The current code clearly falls short of that. Getting rid of the "NYIs" was fairly easy but the real challenge is to avoid GC. The encapsulation is not that bad (however still not quite acceptable, in particular due to the jitter that it induces in the forwarding path) but the packet matching for decapsulation sucks big time. Let's find out if this can be made to work or whether we need something entirely different.

I have some interesting real-life performance figures to share, but I'll take that to the mailing list.

make test on chur fails for core.lib and apps.vhost.vhost_user, but it does so on the master branch as well.

I have also included workarounds for bugs related to the transmission of multi-buffer packets. Those are not proposed fixes, of course.