History

bpf: add bpf_redirect_map helper routine

BPF programs can use the devmap with a bpf_redirect_map() helper routine to forward packets to netdevice in map.

John Fastabend committed 9 years ago

Commit 97f91a71 parent 546ac1f5 files · +78 −1Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/bpf.h+7−1
@@ -348,6 +348,11 @@ union bpf_attr { · 347 unmodified lines
348 * @flags: bit 0 - if set, redirect to ingress instead of egress348 * @flags: bit 0 - if set, redirect to ingress instead of egress
349 * other bits - reserved349 * other bits - reserved
350 * Return: TC_ACT_REDIRECT350 * 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 * u32 bpf_get_route_realm(skb)357 * u32 bpf_get_route_realm(skb)
353 * retrieve a dst's tclassid358 * retrieve a dst's tclassid
@@ -592,7 +597,8 @@ union bpf_attr { · 238 unmodified lines
592 FN(get_socket_uid), \597 FN(get_socket_uid), \
593 FN(set_hash), \598 FN(set_hash), \
594 FN(setsockopt), \599 FN(setsockopt), \
595 FN(skb_adjust_room),600 FN(skb_adjust_room), \
601 FN(redirect_map),
596 602
597/* integer value in 'imm' field of BPF_CALL instruction selects which helper603/* integer value in 'imm' field of BPF_CALL instruction selects which helper
598 * function eBPF program intends to call604 * function eBPF program intends to call