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

Tutorial improve parsing of VLANs (rebased #73) #168

Merged
merged 5 commits into from
Nov 15, 2020

Conversation

netoptimizer
Copy link
Member

This is a rebase of PR #73 which had a conflict with submodule system.

Given XDP is very performance focused, it is unwise to default
parse many VLAN layers.  Those 2 as it is very uncommon to have more.

Signed-off-by: Jesper Dangaard Brouer <[email protected]>
This is based on same function from packet-solutions/xdp_vlan02_kern.c
that also extracts VLANs.

It needs to be removed from packet-solutions/xdp_vlan02_kern.c, but
for now its just ifdef defined out-of-code.  Need to run some tests
and look at BPF byte-code to make sure it does the right thing.

The original parse_ethhdr() is implemented by calling parse_ethhdr_vlan()
with NULL argument for stucture to collect IDs into.  The compiler
should remove the parts that are not needed.

Signed-off-by: Jesper Dangaard Brouer <[email protected]>
@netoptimizer
Copy link
Member Author

Did some basic manual testing and it seems to work

@netoptimizer netoptimizer merged commit 9ee02ae into master Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant