xdp-forward: added VLANS support #504
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds support for VLAN processing. All the directions are supported:
However, this adds ~4% overhead, therefore it's disabled by default. To enabled it,
xdp-forwardneeds to be recompiled with eitherVLANS_USERSPACEorVLANS_PATCHEDbased on desired mode. 2 modes are supported:xdp-forward, userspace part usesnetlinkto get all the VLAN interfaces on top ofxdp-forward-enabled devices. The map that maps vlan ifindex to underlying physical ifindex+VLAN ID is then passed to XDP program. (bpf_fib_lookupreturns VLAN interface ifindex when packet is forwarded to VLANed network, but VLAN interfaces does not implement xmit function for xdp. Therefore, packet needs to be sent out of physical inf). Limitation of this version is, that mapping map is not automatically updated, so when VLAN interface is changed (removed, added, vlan id)xdp-forwardrequires manual reload.bpf_fib_lookupfor support of physical device lookup for vlan interfaces. (@tohojo is working on this patch)Performance comparison:
Before this patch, the performance of VLAN tagged traffic was even slower with
xdp-forwardenabled as it was just passing it to the stack but added some overhead.