-
Notifications
You must be signed in to change notification settings - Fork 163
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: Add support for xdp_buff with empty linear part #409
Conversation
Remove a condition in xdp_parse_load_bytes_prog that assumes the packet header data is in the linear part of the xdp_buff. Signed-off-by: Nimrod Oren <[email protected]> Reviewed-by: Tariq Toukan <[email protected]>
Remove a condition in xdp_basic_prog that assumes the packet header data is in the linear part of the xdp_buff. Signed-off-by: Nimrod Oren <[email protected]> Reviewed-by: Tariq Toukan <[email protected]>
This commit introduces xdp_read_data_load_bytes_prog to xdp-bench. This program uses the bpf_xdp_load_bytes helper for packet data access. In contrast, xdp_read_data_prog uses direct packet access. This addition aligns with the existing behavior of -p parse-ip: - 'xdp-bench -p read-data' loads xdp_read_data_prog. - 'xdp-bench -p read-data -l load-bytes' loads xdp_read_data_load_bytes_prog. Signed-off-by: Nimrod Oren <[email protected]> Reviewed-by: Tariq Toukan <[email protected]>
This commit introduces xdp_swap_macs_load_bytes_prog to xdp-bench. This program uses the bpf_xdp_load_bytes and bpf_xdp_store_bytes helpers for packet data access. In contrast, xdp_swap_macs_prog uses direct packet access. This addition aligns with the existing behavior of -p parse-ip: - 'xdp-bench -p swap-macs' loads xdp_swap_macs_prog. - 'xdp-bench -p swap-macs -l load-bytes' loads xdp_swap_macs_load_bytes_prog. Signed-off-by: Nimrod Oren <[email protected]> Reviewed-by: Tariq Toukan <[email protected]>
nimrod-oren ***@***.***> writes:
In some network driver implementations, the linear part of the
xdp_buff structure might be empty, with all data stored in the frags
section. Accessing packet data directly is impossible in this case,
and requires an API like the bpf_xdp_load/store_bytes helpers or
dynptr.
Which driver does that? None that's in-tree, AFAIK?
|
mlx5 (in certain configurations) is an example. |
Introduced in commit cd02a1a24897. |
Huh, I never noticed that go in. I remember there was some discussion around it (in https://lore.kernel.org/r/[email protected]), but I also remember the outcome differently. Ah well, in that case I certainly have no objections to merging this :) |
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.
LGTM, thanks for the patch :)
Update the documentation to reflect the changes made in pull request xdp-project#409 (d7edea3). Signed-off-by: Nimrod Oren <[email protected]>
Update the documentation to reflect the changes made in pull request xdp-project#409 (d7edea3). Signed-off-by: Nimrod Oren <[email protected]>
In some network driver implementations, the linear part of the xdp_buff structure might be empty, with all data stored in the frags section. Accessing packet data directly is impossible in this case, and requires an API like the bpf_xdp_load/store_bytes helpers or dynptr.
This pull request ensures support for all xdp-bench packet operations (swap-macs, read-data, etc.) of basic actions (DROP, PASS, TX) when the linear part is empty.
The next step is to extend this functionality to the REDIRECT actions and explore integration with other tools beyond xdp-bench. After that, the plan is to introduce the option to use the superior dynptr API as another packet access alternative.