[PATCH] net/tap: Modified TAP BPF program as per the new Kernel-version upgrade requirements.
Stephen Hemminger
stephen at networkplumber.org
Thu Jan 4 21:32:00 CET 2024
On Thu, 4 Jan 2024 22:57:56 +0530
madhuker.mythri at oracle.com wrote:
> From: Madhuker Mythri <madhuker.mythri at oracle.com>
>
> When multiple queues configured, internally RSS will be enabled and thus TAP BPF RSS byte-code will be loaded on to the Kernel using BPF system calls.
>
> Here, the problem is loading the existing BPF byte-code to the Kernel-5.15 and above versions throws errors, i.e: Kernel BPF verifier not accepted this existing BPF byte-code and system calls return error code "-7" as follows:
> ------------------------
> rss_add_actions(): Failed to load BPF section l3_l4 (7): Argument list too long
> ------------------------
>
> RCA: These errors started coming after from the Kernel-5.15 version, in which lots of new BPF verification restrictions were added for safe execution of byte-code on to the Kernel, due to which existing BPF program verification does not pass.
> Here are the major BPF verifier restrictions observed:
> 1) Need to use new BPF maps structure.
> 2) Kernel SKB data pointer access not allowed.
> 3) Undefined loops were not allowed(which are bounded by a variable value).
> 4) unreachable instructions(like: undefined array access).
>
> After addressing all these Kernel BPF verifier restrictions able to load the BPF byte-code onto the Kernel successfully.
>
> Note: This new BPF changes supports from Kernel:4.10 version.
>
> Bugzilla Id: 1329
>
> Signed-off-by: Madhuker Mythri <madhuker.mythri at oracle.com>
> ---
> drivers/net/tap/bpf/tap_bpf_program.c | 243 +-
> drivers/net/tap/tap_bpf_api.c | 4 +-
> drivers/net/tap/tap_bpf_insns.h | 3781 ++++++++++++++-----------
> 3 files changed, 2151 insertions(+), 1877 deletions(-)
Patch has trailing whitespace, git complains:
$ git am /tmp/bpf.mbox
Applying: net/tap: Modified TAP BPF program as per the new Kernel-version upgrade requirements.
/home/shemminger/DPDK/main/.git/worktrees/libbpf/rebase-apply/patch:98: trailing whitespace.
// queue match
/home/shemminger/DPDK/main/.git/worktrees/libbpf/rebase-apply/patch:243: trailing whitespace.
/** Is IP fragmented **/
/home/shemminger/DPDK/main/.git/worktrees/libbpf/rebase-apply/patch:326: trailing whitespace.
/* bpf_printk(">>>>> rss_l3_l4 hash=0x%x queue:1=%u\n", hash, queue); */
warning: 3 lines add whitespace errors.
More information about the dev
mailing list