Re: [net-next PATCH 11/12] net: add notifier hooks for devmap bpf map

2017-07-31 Thread John Fastabend
On 07/31/2017 01:55 AM, Daniel Borkmann wrote: > On 07/30/2017 03:28 PM, Levin, Alexander (Sasha Levin) wrote: >> On Mon, Jul 17, 2017 at 09:30:02AM -0700, John Fastabend wrote: >>> @@ -341,9 +368,11 @@ static int dev_map_update_elem(struct bpf_map *map, >>> void *key, void *value, >>> * Reme

Re: [net-next PATCH 11/12] net: add notifier hooks for devmap bpf map

2017-07-31 Thread Daniel Borkmann
On 07/30/2017 03:28 PM, Levin, Alexander (Sasha Levin) wrote: On Mon, Jul 17, 2017 at 09:30:02AM -0700, John Fastabend wrote: @@ -341,9 +368,11 @@ static int dev_map_update_elem(struct bpf_map *map, void *key, void *value, * Remembering the driver side flush operation will happen befor

Re: [net-next PATCH 11/12] net: add notifier hooks for devmap bpf map

2017-07-30 Thread Levin, Alexander (Sasha Levin)
On Mon, Jul 17, 2017 at 09:30:02AM -0700, John Fastabend wrote: >@@ -341,9 +368,11 @@ static int dev_map_update_elem(struct bpf_map *map, void >*key, void *value, >* Remembering the driver side flush operation will happen before the >* net device is removed. >*/ >+ mut

[net-next PATCH 11/12] net: add notifier hooks for devmap bpf map

2017-07-17 Thread John Fastabend
The BPF map devmap holds a refcnt on the net_device structure when it is in the map. We need to do this to ensure on driver unload we don't lose a dev reference. However, its not very convenient to have to manually unload the map when destroying a net device so add notifier handlers to do the clea