-
Notifications
You must be signed in to change notification settings - Fork 118
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
test_xdp_redirect.sh migration #8308
Open
bastien-curutchet
wants to merge
5
commits into
kernel-patches:bpf-next_base
Choose a base branch
from
bastien-curutchet:b4/xdp_redirect
base: bpf-next_base
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
test_xdp_redirect.sh migration #8308
bastien-curutchet
wants to merge
5
commits into
kernel-patches:bpf-next_base
from
bastien-curutchet:b4/xdp_redirect
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bastien-curutchet
force-pushed
the
b4/xdp_redirect
branch
from
January 3, 2025 10:21
7893c61
to
683d84b
Compare
kernel-patches-daemon-bpf
bot
force-pushed
the
bpf-next_base
branch
from
January 3, 2025 18:19
da86bde
to
2db328a
Compare
Hi all, This patch series continues the work to migrate the *.sh tests into prog_tests. test_xdp_redirect.sh tests the XDP redirections done through bpf_redirect(). These XDP redirections are already tested by prog_tests/xdp_do_redirect.c but IMO it doesn't cover the exact same code path because xdp_do_redirect.c uses bpf_prog_test_run_opts() to trigger redirections of 'fake packets' while test_xdp_redirect.sh redirects packets coming from the network. Also, the test_xdp_redirect.sh script tests the redirections with both SKB and DRV modes while xdp_do_redirect.c only tests the DRV mode. The patch series adds two new test cases in prog_tests/xdp_do_redirect.c to replace the test_xdp_redirect.sh script. # Describe the purpose of this series. The information you put here # will be used by the project maintainer to make a decision whether # your patches should be reviewed, and in what priority order. Please be # very detailed and link to any relevant discussions or sites that the # maintainer can review to better understand your proposed changes. If you # only have a single patch in your series, the contents of the cover # letter will be appended to the "under-the-cut" portion of the patch. # Lines starting with # will be removed from the cover letter. You can # use them to add notes or reminders to yourself. If you want to use # markdown headers in your cover letter, start the line with ">#". # You can add trailers to the cover letter. Any email addresses found in # these trailers will be added to the addresses specified/generated # during the b4 send stage. You can also run "b4 prep --auto-to-cc" to # auto-populate the To: and Cc: trailers based on the code being # modified. To: Alexei Starovoitov <[email protected]> To: Daniel Borkmann <[email protected]> To: David S. Miller <[email protected]> To: Jakub Kicinski <[email protected]> To: Jesper Dangaard Brouer <[email protected]> To: John Fastabend <[email protected]> To: Andrii Nakryiko <[email protected]> To: Martin KaFai Lau <[email protected]> To: Eduard Zingerman <[email protected]> To: Song Liu <[email protected]> To: Yonghong Song <[email protected]> To: KP Singh <[email protected]> To: Stanislav Fomichev <[email protected]> To: Hao Luo <[email protected]> To: Jiri Olsa <[email protected]> To: Mykola Lysenko <[email protected]> To: Shuah Khan <[email protected]> Cc: Thomas Petazzoni <[email protected]> Cc: Alexis Lothore <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]> --- Changes in v2: - Add bpf-next marker - Use directly skel->progs instead of 'bpf_object__find_program_by_name()' - Use 'ip -n NSX' in SYS calls instead of opening NSX with open_netns() - Use #define for static indexes of veth1 and veth2 - Delete the useless second ping - Link to v1: https://lore.kernel.org/r/[email protected] --- b4-submit-tracking --- # This section is used internally by b4 prep for tracking purposes. { "series": { "revision": 2, "change-id": "20241219-xdp_redirect-2b8ec79dc24e", "prefixes": [ "bpf-next" ], "history": { "v1": [ "[email protected]" ] } } }
SEC("redirect_to_111") and SEC("redirect_to_222") can't be loaded by the __load() helper. Rename both sections SEC("xdp") so it can be interpreted by the __load() helper in upcoming patch. Update the test_xdp_redirect.sh to use the program name instead of the section name to load the BPF program. Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
test_xdp_redirect.sh can't be used by the BPF CI. Migrate test_xdp_redirect.sh into two new test cases in xdp_do_redirect.c. They use the same network topology and the same BPF programs located in progs/test_xdp_redirect.c and progs/xdp_dummy.c. Remove test_xdp_redirect.sh and its Makefile entry. Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
prog_tests/xdp_do_redirect.c is the only user of the BPF programs located in progs/test_xdp_do_redirect.c and progs/test_xdp_redirect.c. There is no need to keep both files with such close names. Move test_xdp_redirect.c contents to test_xdp_do_redirect.c and remove progs/test_xdp_redirect.c Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
bastien-curutchet
force-pushed
the
b4/xdp_redirect
branch
from
January 6, 2025 09:53
683d84b
to
cbe8acc
Compare
kernel-patches-daemon-bpf
bot
force-pushed
the
bpf-next_base
branch
5 times, most recently
from
January 6, 2025 21:43
5c57fa7
to
2410e16
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.