Re: [PATCH 1/3] bpf: Add support for mark with bpf_fib_lookup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Give credit to David Ahern for this patch. Shall we change anything there?

Sorry for the whitespaces. It seems like I can't properly do this from gmail.
Let me try to redo the whole thing from the command line.

On Tue, Jun 29, 2021 at 10:51 AM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> wrote:
>
> Rumen Telbizov <rumen.telbizov@xxxxxxxxxxxxxxxxx> writes:
>
> > 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 */
> > + };
> > +
> > + /* output: source and dest mac */
> > + struct {
> > + __u8 smac[6]; /* ETH_ALEN */
> > + __u8 dmac[6]; /* ETH_ALEN */
> > + };
> > + };
> > };
>
> Looks like your mailer mangled the indentation of the whole thing.
> Threading is broken too...
>
> -Toke
>




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux