net: comment fixes against BPF devmap helper calls
Subsystems (3)
PATCH 1/1 net: comment fixes against BPF devmap helper calls
Update BPF comments to accurately reflect XDP usage.
Fixes 97f91a7cf04ff ("bpf: add bpf_redirect_map helper routine")
Reported-by Alexei Starovoitov <[email protected]>
Signed-off-by John Fastabend <[email protected]>
--- include/uapi/linux/bpf.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
include/uapi/linux/bpf.h +11 -5
@@ -345,14 +345,20 @@ enum bpf_attach_type {* int bpf_redirect(ifindex, flags) * redirect to another netdev * @ifindex: ifindex of the net device -* @flags: bit 0 - if set, redirect to ingress instead of egress -* other bits - reserved -* Return: TC_ACT_REDIRECT -* int bpf_redirect_map(key, map, flags) +* @flags: +* cls_bpf: +* bit 0 - if set, redirect to ingress instead of egress +* other bits - reserved +* xdp_bpf: +* all bits - reserved +* Return: cls_bpf: TC_ACT_REDIRECT +* xdp_bfp: XDP_REDIRECT +* int bpf_redirect_map(map, key, flags) * redirect to endpoint in map +* @map: pointer to dev map * @key: index in map to lookup -* @map: fd of map to do lookup in * @flags: -- +* Return: XDP_REDIRECT on success or XDP_ABORT on error * * u32 bpf_get_route_realm(skb) * retrieve a dst's tclassid
Daniel Borkmann
maintainerQuoted 19 lines · John Fastabend
Update BPF comments to accurately reflect XDP usage.
Fixes 97f91a7cf04ff ("bpf: add bpf_redirect_map helper routine")Reported-by Alexei Starovoitov <[email protected]>Signed-off-by John Fastabend <[email protected]>--- include/uapi/linux/bpf.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)include/uapi/linux/bpf.h +0
-2@@ -345,14 +345,20 @@ enum bpf_attach_type {* int bpf_redirect(ifindex, flags) * redirect to another netdev * @ifindex: ifindex of the net device -* @flags: bit 0 - if set, redirect to ingress instead of egress -* other bits - reserved
include/uapi/linux/bpf.h enum bpf_attach_type { · line 355
Quoted 10 lines
include/uapi/linux/bpf.h +8
-2-* Return: TC_ACT_REDIRECT -* int bpf_redirect_map(key, map, flags) +* @flags: +* cls_bpf: +* bit 0 - if set, redirect to ingress instead of egress +* other bits - reserved +* xdp_bpf: +* all bits - reserved +* Return: cls_bpf: TC_ACT_REDIRECT +* xdp_bfp: XDP_REDIRECT
We should probably also mention the XDP_ABORTED / TC_ACT_SHOT on error(/misuse) similarly as below.
Quoted 11 lines
include/uapi/linux/bpf.h +3
-1+* int bpf_redirect_map(map, key, flags) * redirect to endpoint in map +* @map: pointer to dev map * @key: index in map to lookup -* @map: fd of map to do lookup in * @flags: -- +* Return: XDP_REDIRECT on success or XDP_ABORT on error * * u32 bpf_get_route_realm(skb) * retrieve a dst's tclassid