diff mbox series

[net-next,6/9] ipv4: Handle route deletion notification during flush

Message ID 20191210172402.463397-7-idosch@idosch.org
State Changes Requested
Delegated to: David Miller
Headers show
Series Simplify IPv4 route offload API | expand

Commit Message

Ido Schimmel Dec. 10, 2019, 5:23 p.m. UTC
From: Ido Schimmel <idosch@mellanox.com>

In a similar fashion to previous patch, when a route is deleted as part
of table flushing, promote the next route in the list, if exists.
Otherwise, simply emit a delete notification.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
 net/ipv4/fib_trie.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

David Ahern Dec. 11, 2019, 5:46 p.m. UTC | #1
On 12/10/19 10:23 AM, Ido Schimmel wrote:
> From: Ido Schimmel <idosch@mellanox.com>
> 
> In a similar fashion to previous patch, when a route is deleted as part
> of table flushing, promote the next route in the list, if exists.
> Otherwise, simply emit a delete notification.

I am not following your point on a flush. If all routes are getting
deleted, why do you need to promote the next one in the list?

> 
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> ---
>  net/ipv4/fib_trie.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
> index 2d338469d4f2..60947a44d363 100644
> --- a/net/ipv4/fib_trie.c
> +++ b/net/ipv4/fib_trie.c
> @@ -1995,6 +1995,8 @@ int fib_table_flush(struct net *net, struct fib_table *tb, bool flush_all)
>  				continue;
>  			}
>  
> +			fib_notify_alias_delete(net, n->key, &n->leaf, fa,
> +						NULL);
>  			call_fib_entry_notifiers(net, FIB_EVENT_ENTRY_DEL,
>  						 n->key,
>  						 KEYLENGTH - fa->fa_slen, fa,
>
David Ahern Dec. 11, 2019, 5:52 p.m. UTC | #2
On 12/11/19 10:46 AM, David Ahern wrote:
> On 12/10/19 10:23 AM, Ido Schimmel wrote:
>> From: Ido Schimmel <idosch@mellanox.com>
>>
>> In a similar fashion to previous patch, when a route is deleted as part
>> of table flushing, promote the next route in the list, if exists.
>> Otherwise, simply emit a delete notification.
> 
> I am not following your point on a flush. If all routes are getting
> deleted, why do you need to promote the next one in the list?

never mind. I see. The second notifier gets deleted in patch 9 and the
new notifier is needed to remove the offloaded route.

> 
>>
>> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
>> ---
>>  net/ipv4/fib_trie.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
>> index 2d338469d4f2..60947a44d363 100644
>> --- a/net/ipv4/fib_trie.c
>> +++ b/net/ipv4/fib_trie.c
>> @@ -1995,6 +1995,8 @@ int fib_table_flush(struct net *net, struct fib_table *tb, bool flush_all)
>>  				continue;
>>  			}
>>  
>> +			fib_notify_alias_delete(net, n->key, &n->leaf, fa,
>> +						NULL);
>>  			call_fib_entry_notifiers(net, FIB_EVENT_ENTRY_DEL,
>>  						 n->key,
>>  						 KEYLENGTH - fa->fa_slen, fa,
>>
>
David Ahern Dec. 11, 2019, 5:52 p.m. UTC | #3
On 12/10/19 10:23 AM, Ido Schimmel wrote:
> From: Ido Schimmel <idosch@mellanox.com>
> 
> In a similar fashion to previous patch, when a route is deleted as part
> of table flushing, promote the next route in the list, if exists.
> Otherwise, simply emit a delete notification.
> 
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> ---
>  net/ipv4/fib_trie.c | 2 ++
>  1 file changed, 2 insertions(+)
> 

Reviewed-by: David Ahern <dsahern@gmail.com>
diff mbox series

Patch

diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 2d338469d4f2..60947a44d363 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1995,6 +1995,8 @@  int fib_table_flush(struct net *net, struct fib_table *tb, bool flush_all)
 				continue;
 			}
 
+			fib_notify_alias_delete(net, n->key, &n->leaf, fa,
+						NULL);
 			call_fib_entry_notifiers(net, FIB_EVENT_ENTRY_DEL,
 						 n->key,
 						 KEYLENGTH - fa->fa_slen, fa,