-
Notifications
You must be signed in to change notification settings - Fork 190
Xdp bench redir map action drop #532
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
Xdp bench redir map action drop #532
Conversation
tohojo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits, and as Jesper already pointed out on the kernel list, please update the man page as well.
I also have one reservation about the option: --egress-action will silently fail if --load-egress is not set. We should error out here instead, to avoid having silent errors that are hard to debug. Probably the easiest way to do this is to have a DEVMAP_EGRESS_NONE option in the enum that is not exposed as a visible option value, and checking that --load-egress was supplied if the option egress_action value is different from NONE...
ac80f7f to
f4d3368
Compare
|
Thanks for your review!
man page updated. LMK if you spot any issues.
Fixed using your suggestion. Couldn't think of a better way. For now NONE and FORWARD are equivalent after the initial check. LMK if this is confusing. |
tohojo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option handling looks good now!
But please don't edit the man page directly; edit the README.org file, then recompile the man page (should update on make, assuming you have Emacs installed).
Also, totally forgot the first time around: we'll need a selftest for this. Just a simple test to see that the new options work correctly should be fine; you can just copy and adjust one of the existing tests in test-xdp-bench.sh :)
Great!
Oh, didn't realize that the man page is generated. Will do.
|
f4d3368 to
e0469f4
Compare
Add a new `--egress-action` option for devmap and devmap-multi that allows selecting different actions for egress. This change only adds the existing forward action. egress-action is initialized to DEVMAP_EGRESS_NONE to allow for checking if the user selected `--egress-action` without `--load-egress`. Signed-off-by: Dragos Tatulea <[email protected]>
Simple XDP_DROP program as egress action. Signed-off-by: Dragos Tatulea <[email protected]>
e0469f4 to
c3801dd
Compare
tohojo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - thanks!
As requested by Jesper, added a egress mode for xdp-bench in
redirect-mapandredirect-multimapmodes. This action can beforward(as before) ordrop(new).Haven't found any guidelines for contribution so please excuse me if I omitted something.