Skip to content

Commit

Permalink
ipv4: fib: Convert FIB notification chain to be atomic
Browse files Browse the repository at this point in the history
In order not to hold RTNL for long periods of time we're going to dump
the FIB tables using RCU.

Convert the FIB notification chain to be atomic, as we can't block in
RCU critical sections.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ido Schimmel authored and David S. Miller committed Dec 4, 2016
1 parent 17f8be7 commit d3f706f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,25 @@
#include <trace/events/fib.h>
#include "fib_lookup.h"

static BLOCKING_NOTIFIER_HEAD(fib_chain);
static ATOMIC_NOTIFIER_HEAD(fib_chain);

int register_fib_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_register(&fib_chain, nb);
return atomic_notifier_chain_register(&fib_chain, nb);
}
EXPORT_SYMBOL(register_fib_notifier);

int unregister_fib_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_unregister(&fib_chain, nb);
return atomic_notifier_chain_unregister(&fib_chain, nb);
}
EXPORT_SYMBOL(unregister_fib_notifier);

int call_fib_notifiers(struct net *net, enum fib_event_type event_type,
struct fib_notifier_info *info)
{
info->net = net;
return blocking_notifier_call_chain(&fib_chain, event_type, info);
return atomic_notifier_call_chain(&fib_chain, event_type, info);
}

static int call_fib_entry_notifiers(struct net *net,
Expand Down

0 comments on commit d3f706f

Please sign in to comment.