On Tue, Jun 29, 2021 at 10:37:34AM -0700, Rumen Telbizov wrote: > Add support for policy routing via marks to the bpf_fib_lookup > helper. The bpf_fib_lookup struct is constrained to 64B for > performance. Since the smac and dmac entries are used only for > output, put them in an anonymous struct and then add a union > around a second struct that contains the mark to use in the FIB > lookup. > > Signed-off-by: David Ahern <dsahern@xxxxxxxxxx> > Signed-off-by: Rumen Telbizov <telbizov@xxxxxxxxx> > --- > include/uapi/linux/bpf.h | 16 ++++++++++++++-- > net/core/filter.c | 4 ++-- > 2 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h > index ec6d85a81744..6c78cc9c3c75 100644 > --- a/include/uapi/linux/bpf.h > +++ b/include/uapi/linux/bpf.h > @@ -5925,8 +5925,20 @@ struct bpf_fib_lookup { > /* output */ > __be16 h_vlan_proto; > __be16 h_vlan_TCI; > - __u8 smac[6]; /* ETH_ALEN */ > - __u8 dmac[6]; /* ETH_ALEN */ > + > + union { > + /* input */ > + struct { > + __u32 mark; /* fwmark for policy routing */ > + /* 2 4-byte holes for input */ > + }; Tabs seem to be eaten and spit back out with spaces from your email client :(