Re: [PATCHv6 bpf-next 1/3] xdp: add a new helper for dev map multicast support

2020-07-11 Thread David Ahern
On 7/10/20 6:26 PM, Hangbin Liu wrote: >> >> The point of DEVMAP_HASH is to allow map management where key == device >> index (vs DEVMAP which for any non-trivial use case is going to require >> key != device index). You could require the exclude map to be >> DEVMAP_HASH and the key to be the index

Re: [PATCHv6 bpf-next 1/3] xdp: add a new helper for dev map multicast support

2020-07-10 Thread Hangbin Liu
On Fri, Jul 10, 2020 at 07:46:18AM -0600, David Ahern wrote: > >> > >> I'm probably missing something fundamental, but why do you need to walk > >> the keys? Why not just do a lookup on the device index? > > > > This functions is to check if the device index is in exclude map. > > > > The device

Re: [PATCHv6 bpf-next 1/3] xdp: add a new helper for dev map multicast support

2020-07-10 Thread David Ahern
On 7/10/20 12:55 AM, Hangbin Liu wrote: > Hi David, > On Thu, Jul 09, 2020 at 10:33:38AM -0600, David Ahern wrote: >>> +bool dev_in_exclude_map(struct bpf_dtab_netdev *obj, struct bpf_map *map, >>> + int exclude_ifindex) >>> +{ >>> + struct bpf_dtab_netdev *ex_obj = NULL; >>> +

Re: [PATCHv6 bpf-next 1/3] xdp: add a new helper for dev map multicast support

2020-07-09 Thread Hangbin Liu
Hi David, On Thu, Jul 09, 2020 at 10:33:38AM -0600, David Ahern wrote: > > +bool dev_in_exclude_map(struct bpf_dtab_netdev *obj, struct bpf_map *map, > > + int exclude_ifindex) > > +{ > > + struct bpf_dtab_netdev *ex_obj = NULL; > > + u32 key, next_key; > > + int err; > > +

Re: [PATCHv6 bpf-next 1/3] xdp: add a new helper for dev map multicast support

2020-07-09 Thread David Ahern
On 7/8/20 7:30 PM, Hangbin Liu wrote: > This patch is for xdp multicast support. In this implementation we > add a new helper to accept two maps: forward map and exclude map. > We will redirect the packet to all the interfaces in *forward map*, but > exclude the interfaces that in *exclude map*. >

[PATCHv6 bpf-next 1/3] xdp: add a new helper for dev map multicast support

2020-07-08 Thread Hangbin Liu
This patch is for xdp multicast support. In this implementation we add a new helper to accept two maps: forward map and exclude map. We will redirect the packet to all the interfaces in *forward map*, but exclude the interfaces that in *exclude map*. To achive this I add a new ex_map for struct bp