Re: [PATCH RFC bpf-next 2/4] bpf: Add support to attach bpf program to a devmap

2020-05-22 Thread David Ahern
On 5/22/20 10:02 AM, Toke Høiland-Jørgensen wrote: >> @@ -563,12 +619,23 @@ static struct bpf_dtab_netdev >> *__dev_map_alloc_node(struct net *net, >> if (!dev->dev) >> goto err_out; >> >> +if (prog_id) { >> +prog = bpf_prog_by_id(prog_id); >> +if (I

Re: [PATCH RFC bpf-next 2/4] bpf: Add support to attach bpf program to a devmap

2020-05-22 Thread Toke Høiland-Jørgensen
David Ahern writes: > Add BPF_XDP_DEVMAP attach type for use with programs associated with a > DEVMAP. > > DEVMAPs can associate a program with a device entry by setting the > value to pair. The program associated with the id must have > type XDP with expected attach type BPF_XDP_DEVMAP. When a

[PATCH RFC bpf-next 2/4] bpf: Add support to attach bpf program to a devmap

2020-05-21 Thread David Ahern
Add BPF_XDP_DEVMAP attach type for use with programs associated with a DEVMAP. DEVMAPs can associate a program with a device entry by setting the value to pair. The program associated with the id must have type XDP with expected attach type BPF_XDP_DEVMAP. When a program is associated with a devi