-
Notifications
You must be signed in to change notification settings - Fork 5
bpf: Support non-linear skbs for BPF_PROG_TEST_RUN #5893
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: Support non-linear skbs for BPF_PROG_TEST_RUN #5893
Conversation
|
Upstream branch: c9110e6 |
|
Upstream branch: c9110e6 |
99004b6 to
59bf7b3
Compare
0e26bd3 to
4e70ac0
Compare
|
Upstream branch: abc8a95 |
59bf7b3 to
709e838
Compare
4e70ac0 to
c04dd5a
Compare
|
Upstream branch: 929adf8 |
709e838 to
b25eb4f
Compare
c04dd5a to
4754b79
Compare
|
Upstream branch: 2d92ef7 |
b25eb4f to
239f562
Compare
4754b79 to
af15c58
Compare
|
Upstream branch: b338cf8 |
239f562 to
b405453
Compare
af15c58 to
c979e9f
Compare
|
Upstream branch: 9621eb6 |
This bit of refactoring aims to simplify the next patch in this series, in which freeing 'data' is a bit less straightforward. Signed-off-by: Paul Chaignon <[email protected]>
This patch adds support for crafting non-linear skbs in BPF test runs for tc programs, via a new flag BPF_F_TEST_SKB_NON_LINEAR. When this flag is set, only the L2 header is pulled in the linear area. This is particularly useful to test support for non-linear skbs in large codebases such as Cilium. We've had multiple bugs in the past few years where we were missing calls to bpf_skb_pull_data(). This support in BPF_PROG_TEST_RUN would allow us to automatically cover this case in our BPF tests. In addition to the selftests introduced later in the series, this patch was tested by setting BPF_F_TEST_SKB_NON_LINEAR for all tc selftests programs and checking test failures were expected. Suggested-by: Daniel Borkmann <[email protected]> Signed-off-by: Paul Chaignon <[email protected]>
Contrary to most flags currently used in selftests, the BPF_F_TEST_SKB_NON_LINEAR flag is not passed at program loading time, but when calling BPF_PROG_TEST_RUN. This patch updates the test loader to support it. Signed-off-by: Paul Chaignon <[email protected]>
This patch adds two new selftests in the direct packet access suite, to cover the non-linear case with BPF_F_TEST_SKB_NON_LINEAR. The first tests the behavior of the bounds check with a non-linear skb. The second extends the first with a call to bpf_skb_pull_data() to be able to access the packet. Signed-off-by: Paul Chaignon <[email protected]>
b405453 to
7ba7ac4
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=998848 expired. Closing PR. |
Pull request for series with
subject: bpf: Support non-linear skbs for BPF_PROG_TEST_RUN
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=998848