BPF programs can use the devmap with a bpf_redirect_map() helper routine to forward packets to netdevice in map.
Showing the changes to include/uapi/linux (1 of 5 files). Show all
Unified · Split
| @@ -348,6 +348,11 @@ union bpf_attr { · 347 unmodified lines | ||
| 348 | 348 | * @flags: bit 0 - if set, redirect to ingress instead of egress |
| 349 | 349 | * other bits - reserved |
| 350 | 350 | * Return: TC_ACT_REDIRECT |
| 351 | + * int bpf_redirect_map(key, map, flags) | |
| 352 | + * redirect to endpoint in map | |
| 353 | + * @key: index in map to lookup | |
| 354 | + * @map: fd of map to do lookup in | |
| 355 | + * @flags: -- | |
| 351 | 356 | * |
| 352 | 357 | * u32 bpf_get_route_realm(skb) |
| 353 | 358 | * retrieve a dst's tclassid |
| @@ -592,7 +597,8 @@ union bpf_attr { · 238 unmodified lines | ||
| 592 | 597 | FN(get_socket_uid), \ |
| 593 | 598 | FN(set_hash), \ |
| 594 | 599 | FN(setsockopt), \ |
| 595 | − FN(skb_adjust_room), | |
| 600 | + FN(skb_adjust_room), \ | |
| 601 | + FN(redirect_map), | |
| 596 | 602 | |
| 597 | 603 | /* integer value in 'imm' field of BPF_CALL instruction selects which helper |
| 598 | 604 | * function eBPF program intends to call |