Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge lwaftr to next #1047

Closed
wants to merge 427 commits into from
Closed

Merge lwaftr to next #1047

wants to merge 427 commits into from

Conversation

wingo
Copy link
Contributor

@wingo wingo commented Oct 20, 2016

This PR merges in the last 5 months or so of lwaftr development to upstream Snabb. It also adds Snabb vMX, the system that joins up a Snabb dataplane to an external virtualized control/management plane, also adding "on-a-stick" operation for the lwaftr in particular but in a way that can apply to any Snabb dataplane.

With a few minor exceptions, this diff includes only changes to src/apps/lwaftr, src/programs/snabbvmx, and src/programs/lwaftr. Review is very welcome on any of it, but I expect that you will want to focus on the non-lwaftr, non-vmx bits.

dpino and others added 30 commits August 18, 2016 10:52
Use a fixed amount of memory for reassembling IPv6 fragments, on a ctable.
It only allocates once, on initialization, and never frees memory.
When the backing table is full, it randomly ejects fragments.

Tests include out-of-order reassembly.
Bounds checking is done to avoid buffer overflows, regardles of input offsets.

This includes a to-memory clone for Igalia's struct packet implementation.
This allows IPv6 reassembly to avoid a subtle packet corruption bug on
implementations where packet.data is an abstraction rather than a raw buffer.
This requires new tests to only be added to one file, rather than two,
helping maintainability.
Normalize the vlan and non-vlan test suite
This is ctables-based, and similar to hardened IPv6 reassembly.
Hardened IPv4 reassembly. All tests pass.
Our codebase now relies on vlan tags being stripped/inserted nearer the edges
of the app network.
Remove obsolete l2_size approach
This also includes a facility to regenerate test counter files.
Add a flag to allow monitor all packets in on-a-stick mode
This allows more accurate reporting in cases where apps process the packets
before the lwaftr can (and after leaving it), including:
a) Fragmentation/reassembly
b) Control-plane messages, including ARP/NDP/pinging the lwaftr itself
@@ -75,6 +70,32 @@ function PodHashMap.new(key_type, value_type, hash_fn)
return phm
end

-- FIXME: There should be a library to help allocate anonymous
-- hugepages, not this code.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still true. :-)
(Not a blocker, no action required for this PR).

@@ -70,6 +70,7 @@ end

function selftest ()
print("selftest: timer")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a spurious new line. (Not a blocker)

@eugeneia
Copy link
Member

There is a new “nh_fwd” app that seems to be very lwaftr centric, or at least the README is vague to me. Why does it not belong into apps/lwaftr?

@wingo
Copy link
Contributor Author

wingo commented Oct 20, 2016

The nh_fwd (next-hop forward) app is part of snabb vmx. It sits outside (around, really) a snabb data plane and forwards control traffic to a virtualized control plane, such as an Ubuntu image or a Juniper vMX switch. That way it learns the next hop and can stamp on the L2 address of where the packets should go next. It is not lwaftr-specific.

if not args.counter:match(".counter$") then
args.counter = args.counter..".counter"
end
if not shm.exists("/"..S.getpid().."/"..args.counter) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be shm.exists(args.counter). SHM paths are no longer resolved based on a changing shm.path.

@kbara
Copy link
Contributor

kbara commented Oct 20, 2016

I haven't spotted anything else that @eugeneia hasn't.

dpino and others added 4 commits October 20, 2016 17:44
This also addresses the review comments from upstream #1047, noting that
the shm.exists() API changed.
If we are recording ingress drops to a counter, use the right check for
the counter's existence.  Addresses
snabbco#1047 (review).
@kbara
Copy link
Contributor

kbara commented Oct 21, 2016

The three new commits look ok to me.

@kbara kbara self-assigned this Oct 21, 2016
Fix shm.exists() check in ingress drop monitor
@wingo
Copy link
Contributor Author

wingo commented Oct 21, 2016

Added a couple patches to lwaftr that address Max's feedback. @kbara how does it look to you?

Remove duplicated code in SnabbVMX selftests
@kbara
Copy link
Contributor

kbara commented Oct 21, 2016

LGTM, thanks for all your work on this.

@dpino
Copy link
Contributor

dpino commented Oct 21, 2016

Originally nh_fwd was its own app but then it was moved to apps/lwaftr. It's true that it could be used for other apps that need to forward traffic to a service (in this case the lwaftr) and to a VM, but until there's a real need to reuse it we decided to move it to apps/lwaftr. What @eugeneia spotted is the remaining README that we forgot to remove.

@wingo
Copy link
Contributor Author

wingo commented Oct 21, 2016

So I made the rookie mistake of just making this a PR from lwaftr instead of branching off lwaftr and PR'ing from that. I will merge 3d33fb6 to wingo-next and pr that to next.

@wingo
Copy link
Contributor Author

wingo commented Oct 21, 2016

@dpino thanks for the clarification on that, let's fix the readme issue in a followup

teknico and others added 4 commits October 21, 2016 16:48
* Remove the 'lwaftr generator' command
* Move the 'packetblaster lwaftr' code from src/apps/ to the command directory
* Add docs for using 'packetblaster lwaftr' in place of 'lwaftr generator'
Remove hardcoded constants in nh_fwd
@wingo
Copy link
Contributor Author

wingo commented Oct 27, 2016

Closing this PR as it's already merged and I made the rookie mistake of PRing this from a live branch which continues to get updates and thus false-alarm notifications. Thank you all!

@wingo wingo closed this Oct 27, 2016
dpino pushed a commit to dpino/snabb that referenced this pull request Apr 19, 2018
Merge v2018.04 prerelease from next to lwaftr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants