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
348348 * @flags: bit 0 - if set, redirect to ingress instead of egress
349349 * other bits - reserved
350350 * 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: --
351356 *
352357 * u32 bpf_get_route_realm(skb)
353358 * retrieve a dst's tclassid
@@ -592,7 +597,8 @@ union bpf_attr { · 238 unmodified lines
592597 FN(get_socket_uid), \
593598 FN(set_hash), \
594599 FN(setsockopt), \
595− FN(skb_adjust_room),
600+ FN(skb_adjust_room), \
601+ FN(redirect_map),
596602
597603 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
598604 * function eBPF program intends to call