fix: multiple xdp attach to one iface #27
Merged
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.
Closes #22
This PR uses the chaining multiple XDP programs method. In reality we load only one
xdp_main
program which calls the underlying programs in a sequence if a packet is passed by the first program it goes through the next program and it keeps going.To be able to activate a program (which is tied to a service) is running, we set its map value to something more than zero otherwise the service either is stopped or not started at all.
for example, a zero packet loss rate means it passes all packets and a zero bandwidth means an unlimited bandwidth.
Here is some tests results after making the fix:
As it can be seen, no changes observed in the tests, so the new changes should be ok to go.