bpf: flowlabel in bpf_fib_lookup should be flowinfo
Subsystems (5)
PATCH 1/1 bpf: flowlabel in bpf_fib_lookup should be flowinfo
From: David Ahern <[email protected]>
As Michal noted the flow struct takes both the flow label and priority. Update the bpf_fib_lookup API to note that it is flowinfo and not just the flow label.
--- include/uapi/linux/bpf.h | 2 +- net/core/filter.c | 2 +- samples/bpf/xdp_fwd_kern.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
include/uapi/linux/bpf.h +1 -1
@@ -2623,7 +2623,7 @@ struct bpf_fib_lookup {union {/* inputs to lookup */ __u8 tos;/* AF_INET */ -__be32 flowlabel;/* AF_INET6 */ +__be32 flowinfo;/* AF_INET6, flow_label + priority */ /* output: metric of fib result (IPv4/IPv6 only) */ __u32 rt_metric;
net/core/filter.c +1 -1
@@ -4222,7 +4222,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, fl6.flowi6_oif =0 ; strict =RT6_LOOKUP_F_HAS_SADDR ; } - fl6.flowlabel = params->flowlabel; + fl6.flowlabel = params->flowinfo; fl6.flowi6_scope =0 ; fl6.flowi6_flags =0 ; fl6.mp_hash =0 ;
samples/bpf/xdp_fwd_kern.c +1 -1
@@ -88,7 +88,7 @@ static __always_inline int xdp_fwd_flags(struct xdp_md *ctx, u32 flags)return XDP_PASS ; fib_params.family =AF_INET6 ; - fib_params.flowlabel = *(__be32 *)ip6h &IPV6_FLOWINFO_MASK ; + fib_params.flowinfo = *(__be32 *)ip6h &IPV6_FLOWINFO_MASK ; fib_params.l4_protocol = ip6h->nexthdr; fib_params.sport =0 ; fib_params.dport =0 ;
Signature · 1 line
2.11.0
Alexei Starovoitov
AppliedQuoted 8 lines · On Sun, Jun 03, 2018 at 08:15:19AM -0700, [email protected] wrote:
From: David Ahern <[email protected]>
As Michal noted the flow struct takes both the flow label and priority. Update the
bpf_fib_lookupAPI to note that it is flowinfo and not just the flow label.Cc Michal Kubecek <[email protected]>Signed-off-by David Ahern <[email protected]>
Applied, Thanks
Quoted 12 lines · Alexei Starovoitov
Quoted 8 lines · On Sun, Jun 03, 2018 at 08:15:19AM -0700, [email protected] wrote:
From: David Ahern <[email protected]>
As Michal noted the flow struct takes both the flow label and priority. Update the
bpf_fib_lookupAPI to note that it is flowinfo and not just the flow label.Cc Michal Kubecek <[email protected]>Signed-off-by David Ahern <[email protected]>Applied, Thanks
I noticed 4.17 was released. Just to make sure we are on the same page, this patch needs to be 4.18.
Quoted 8 lines · David Ahern
Quoted 7 lines · Alexei Starovoitov
Quoted 6 lines · On Sun, Jun 03, 2018 at 08:15:19AM -0700, [email protected] wrote:
From: David Ahern <[email protected]>
As Michal noted the flow struct takes both the flow label and priority. Update the
bpf_fib_lookupAPI to note that it is flowinfo and not just the flow label.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Cc Michal Kubecek <[email protected]>Signed-off-by David Ahern <[email protected]>Applied, Thanks
I noticed 4.17 was released. Just to make sure we are on the same page, this patch needs to be 4.18.
It was applied to bpf-next obviously.
As soon as we resolve the situation with af_xdp the PR will be sent to Dave for net-next, so net-next can be sent to Linus.