From: Stephen Hemminger <stephen@networkplumber.org>
To: madhuker.mythri@oracle.com
Cc: dev@dpdk.org, ferruh.yigit@amd.com
Subject: Re: [PATCH] net/tap: Modified TAP BPF program as per the Kernel-version upgrade requirements.
Date: Fri, 12 Jan 2024 08:40:34 -0800 [thread overview]
Message-ID: <20240112084034.7de67fb9@hermes.local> (raw)
In-Reply-To: <20240112134821.2067-1-madhuker.mythri@oracle.com>
On Fri, 12 Jan 2024 19:18:21 +0530
madhuker.mythri@oracle.com wrote:
> From: Madhuker Mythri <madhuker.mythri@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, instead use the BPF helper functions.
> 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.
>
> Verified with the latest DPDK-23.11 code, using the python extracted
> BPF instructions able to load sucessfully on to the Kernel tap device.
>
> Bugzilla Id: 1329
>
> Signed-off-by: Madhuker Mythri <madhuker.mythri@oracle.com>
The DPDK practice is to keep patches as followons of original thread.
Please use --msg-id option for reply.
Also put v2 in the mail.
The BPF program doesn't have to meet all the requirements of DPDK checkpatch
since it doesn't use EAL, but it should follow conventions. For example:
$ ./devtools/checkpatches.sh ~/Downloads/tap-bpf.mbox
### [PATCH] net/tap: Modified TAP BPF program as per the Kernel-version upgrade requirements.
WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#92:
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.
WARNING:TYPO_SPELLING: 'sucessfully' may be misspelled - perhaps 'successfully'?
#109:
BPF instructions able to load sucessfully on to the Kernel tap device.
^^^^^^^^^^^
...
WARNING:BRACES: braces {} are not necessary for single statement blocks
#659: FILE: drivers/net/tap/bpf/tap_bpf_program.c:120:
+ if (rsskey == NULL) {
return TC_ACT_OK;
}
ERROR:ELSE_AFTER_BRACE: else should follow close brace '}'
#769: FILE: drivers/net/tap/bpf/tap_bpf_program.c:156:
+ }
+ else {
CHECK:BRACES: Unbalanced braces around else statement
#769: FILE: drivers/net/tap/bpf/tap_bpf_program.c:156:
+ else {
ERROR:SPACING: space required before the open parenthesis '('
#790: FILE: drivers/net/tap/bpf/tap_bpf_program.c:168:
+ if(k == hash)
CHECK:BRACES: Blank lines aren't necessary before a close brace '}'
#807: FILE: drivers/net/tap/bpf/tap_bpf_program.c:176:
+}
total: 2 errors, 7 warnings, 2 checks, 3314 lines checked
0/1 valid patch
next prev parent reply other threads:[~2024-01-12 16:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 13:48 madhuker.mythri
2024-01-12 16:40 ` Stephen Hemminger [this message]
2024-01-12 16:41 ` Stephen Hemminger
2024-01-13 17:50 ` [External] : " Madhuker Mythri
2024-01-13 18:05 ` Stephen Hemminger
2024-01-16 16:43 ` Stephen Hemminger
2024-01-12 16:42 ` Stephen Hemminger
2024-01-13 17:52 ` [External] : " Madhuker Mythri
2024-01-13 18:06 ` Stephen Hemminger
2024-01-16 5:43 ` Madhuker Mythri
2024-01-16 16:40 ` Stephen Hemminger
2024-01-17 3:25 ` Stephen Hemminger
2024-01-17 16:19 ` Madhuker Mythri
2024-01-12 16:43 ` Stephen Hemminger
2024-01-12 16:46 ` Stephen Hemminger
2024-01-13 17:55 ` [External] : " Madhuker Mythri
2024-01-12 17:53 ` [RFC v3] tap: rework the BPF header parsing Stephen Hemminger
2024-02-07 18:55 ` [PATCH] net/tap: Modified TAP BPF program as per the Kernel-version upgrade requirements Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240112084034.7de67fb9@hermes.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=madhuker.mythri@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).