Commit a46107c
committed
bpf: Allow XDP dev-bound programs to perform XDP_REDIRECT into maps
JIRA: https://issues.redhat.com/browse/RHEL-78204
commit 714070c
Author: Lorenzo Bianconi <[email protected]>
Date: Mon Apr 28 17:44:02 2025 +0200
bpf: Allow XDP dev-bound programs to perform XDP_REDIRECT into maps
In the current implementation if the program is dev-bound to a specific
device, it will not be possible to perform XDP_REDIRECT into a DEVMAP
or CPUMAP even if the program is running in the driver NAPI context and
it is not attached to any map entry. This seems in contrast with the
explanation available in bpf_prog_map_compatible routine.
Fix the issue introducing __bpf_prog_map_compatible utility routine in
order to avoid bpf_prog_is_dev_bound() check running bpf_check_tail_call()
at program load time (bpf_prog_select_runtime()).
Continue forbidding to attach a dev-bound program to XDP maps
(BPF_MAP_TYPE_PROG_ARRAY, BPF_MAP_TYPE_DEVMAP and BPF_MAP_TYPE_CPUMAP).
Fixes: 3d76a4d ("bpf: XDP metadata RX kfuncs")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Martin KaFai Lau <[email protected]>
Acked-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Jerome Marchand <[email protected]>1 parent 910e483 commit a46107c
1 file changed
+16
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2378 | 2378 | | |
2379 | 2379 | | |
2380 | 2380 | | |
2381 | | - | |
2382 | | - | |
| 2381 | + | |
| 2382 | + | |
2383 | 2383 | | |
2384 | 2384 | | |
2385 | 2385 | | |
| |||
2388 | 2388 | | |
2389 | 2389 | | |
2390 | 2390 | | |
2391 | | - | |
2392 | | - | |
2393 | | - | |
2394 | | - | |
2395 | | - | |
2396 | | - | |
2397 | | - | |
2398 | | - | |
2399 | 2391 | | |
2400 | 2392 | | |
2401 | 2393 | | |
| |||
2429 | 2421 | | |
2430 | 2422 | | |
2431 | 2423 | | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
2432 | 2437 | | |
2433 | 2438 | | |
2434 | 2439 | | |
| |||
2441 | 2446 | | |
2442 | 2447 | | |
2443 | 2448 | | |
2444 | | - | |
| 2449 | + | |
2445 | 2450 | | |
2446 | 2451 | | |
2447 | 2452 | | |
| |||
0 commit comments