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

bpf: handle VLAN before XDP meta-data in from-netdev #24063

Merged
merged 1 commit into from Feb 28, 2023

Conversation

julianwiedmann
Copy link
Member

VLAN traffic entering from-netdev@eth0 either gets dropped, or immediately handed back to the stack with CTX_ACT_OK. We then expect to process the packet a second time in from-netdev@eth0.vlanXXX.

Move this logic back to the front of from-netdev, before handling any potential meta_data that was passed up by the XDP program.

In practice this doesn't fix anything - our XDP program currently doesn't handle VLAN traffic at all, and just passes it up without setting any meta_data. So we merely clarify the intent, and restore old behaviour.

VLAN traffic entering from-netdev@eth0 either gets dropped, or immediately
handed back to the stack with CTX_ACT_OK. We then expect to process the
packet a second time in from-netdev@eth0.vlanXXX.

Move this logic back to the front of from-netdev, before handling any
potential meta_data that was passed up by the XDP program.

In practice this doesn't fix anything - our XDP program currently doesn't
handle VLAN traffic at all, and just passes it up without setting any
meta_data. So we merely clarify the intent, and restore old behaviour.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
@julianwiedmann julianwiedmann added sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. kind/cleanup This includes no functional changes. release-note/misc This PR makes changes that have no direct user impact. labels Feb 28, 2023
@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann julianwiedmann marked this pull request as ready for review February 28, 2023 13:13
@julianwiedmann julianwiedmann requested a review from a team as a code owner February 28, 2023 13:13
Copy link
Contributor

@aspsk aspsk left a comment

Choose a reason for hiding this comment

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

Looks ok. But I wonder, is there a reason for this change?

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 28, 2023
@julianwiedmann
Copy link
Member Author

Looks ok. But I wonder, is there a reason for this change?

Sanity mostly - I needed to walk down that code path recently, and was worried whether we could end up accidentally taking the redirect-to-tunnel case while the VLAN header is still on. So let's clean it up, before it ends up causing us trouble later on.

@aspsk
Copy link
Contributor

aspsk commented Feb 28, 2023

So let's clean it up, before it ends up causing us trouble later on

Yes, makes sense

@sayboras sayboras merged commit 6821a82 into cilium:master Feb 28, 2023
@julianwiedmann julianwiedmann deleted the 1.14-host-vlan branch February 28, 2023 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup This includes no functional changes. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants