mlxsw_sp_span_respin(mlxsw_sp);
switch (fib_work->event) {
- case FIB_EVENT_ENTRY_REPLACE_TMP:
+ case FIB_EVENT_ENTRY_REPLACE:
err = mlxsw_sp_router_fib6_replace(mlxsw_sp,
fib_work->fib6_work.rt_arr,
fib_work->fib6_work.nrt6);
mlxsw_sp_router_fib_abort(mlxsw_sp);
mlxsw_sp_router_fib6_work_fini(&fib_work->fib6_work);
break;
- case FIB_EVENT_ENTRY_DEL_TMP:
+ case FIB_EVENT_ENTRY_DEL:
mlxsw_sp_router_fib6_del(mlxsw_sp,
fib_work->fib6_work.rt_arr,
fib_work->fib6_work.nrt6);
int err;
switch (fib_work->event) {
- case FIB_EVENT_ENTRY_REPLACE_TMP: /* fall through */
+ case FIB_EVENT_ENTRY_REPLACE: /* fall through */
case FIB_EVENT_ENTRY_APPEND: /* fall through */
- case FIB_EVENT_ENTRY_DEL_TMP:
+ case FIB_EVENT_ENTRY_DEL:
fen6_info = container_of(info, struct fib6_entry_notifier_info,
info);
err = mlxsw_sp_router_fib6_work_init(&fib_work->fib6_work,
return notifier_from_errno(err);
case FIB_EVENT_ENTRY_ADD: /* fall through */
case FIB_EVENT_ENTRY_REPLACE: /* fall through */
- case FIB_EVENT_ENTRY_REPLACE_TMP: /* fall through */
case FIB_EVENT_ENTRY_APPEND:
if (router->aborted) {
NL_SET_ERR_MSG_MOD(info->extack, "FIB offload was aborted. Not configuring route");
break;
case FIB_EVENT_ENTRY_REPLACE: /* fall through */
- case FIB_EVENT_ENTRY_ADD: /* fall through */
case FIB_EVENT_ENTRY_DEL:
err = nsim_fib_event(data, info, event != FIB_EVENT_ENTRY_DEL);
break;
FIB_EVENT_NH_DEL,
FIB_EVENT_VIF_ADD,
FIB_EVENT_VIF_DEL,
- FIB_EVENT_ENTRY_REPLACE_TMP,
- FIB_EVENT_ENTRY_DEL_TMP,
};
struct fib_notifier_ops {
};
rt->fib6_table->fib_seq++;
- return call_fib6_notifiers(net, FIB_EVENT_ENTRY_REPLACE_TMP,
- &info.info);
+ return call_fib6_notifiers(net, FIB_EVENT_ENTRY_REPLACE, &info.info);
}
struct fib6_dump_arg {
static int fib6_rt_dump(struct fib6_info *rt, struct fib6_dump_arg *arg)
{
- if (rt == arg->net->ipv6.fib6_null_entry)
- return 0;
- return call_fib6_entry_notifier(arg->nb, FIB_EVENT_ENTRY_ADD,
- rt, arg->extack);
-}
-
-static int fib6_rt_dump_tmp(struct fib6_info *rt, struct fib6_dump_arg *arg)
-{
- enum fib_event_type fib_event = FIB_EVENT_ENTRY_REPLACE_TMP;
+ enum fib_event_type fib_event = FIB_EVENT_ENTRY_REPLACE;
int err;
if (!rt || rt == arg->net->ipv6.fib6_null_entry)
static int fib6_node_dump(struct fib6_walker *w)
{
- struct fib6_info *rt;
- int err = 0;
-
- err = fib6_rt_dump_tmp(w->leaf, w->args);
- if (err)
- goto out;
+ int err;
- for_each_fib6_walker_rt(w) {
- err = fib6_rt_dump(rt, w->args);
- if (err)
- break;
- }
-out:
+ err = fib6_rt_dump(w->leaf, w->args);
w->leaf = NULL;
return err;
}
add:
nlflags |= NLM_F_CREATE;
- if (!info->skip_notify_kernel) {
+ /* The route should only be notified if it is the first
+ * route in the node or if it is added as a sibling
+ * route to the first route in the node.
+ */
+ if (!info->skip_notify_kernel &&
+ (notify_sibling_rt || ins == &fn->leaf)) {
enum fib_event_type fib_event;
if (notify_sibling_rt)
fib_event = FIB_EVENT_ENTRY_APPEND;
else
- fib_event = FIB_EVENT_ENTRY_REPLACE_TMP;
- /* The route should only be notified if it is the first
- * route in the node or if it is added as a sibling
- * route to the first route in the node.
- */
- if (notify_sibling_rt || ins == &fn->leaf)
- err = call_fib6_entry_notifiers(info->nl_net,
- fib_event, rt,
- extack);
-
+ fib_event = FIB_EVENT_ENTRY_REPLACE;
err = call_fib6_entry_notifiers(info->nl_net,
- FIB_EVENT_ENTRY_ADD,
- rt, extack);
+ fib_event, rt,
+ extack);
if (err) {
struct fib6_info *sibling, *next_sibling;
return -ENOENT;
}
- if (!info->skip_notify_kernel) {
- enum fib_event_type fib_event;
-
- fib_event = FIB_EVENT_ENTRY_REPLACE_TMP;
- if (ins == &fn->leaf)
- err = call_fib6_entry_notifiers(info->nl_net,
- fib_event, rt,
- extack);
+ if (!info->skip_notify_kernel && ins == &fn->leaf) {
err = call_fib6_entry_notifiers(info->nl_net,
FIB_EVENT_ENTRY_REPLACE,
rt, extack);
if (!info->skip_notify_kernel) {
if (notify_del)
- call_fib6_entry_notifiers(net, FIB_EVENT_ENTRY_DEL_TMP,
+ call_fib6_entry_notifiers(net, FIB_EVENT_ENTRY_DEL,
rt, NULL);
else if (replace_rt)
call_fib6_entry_notifiers_replace(net, replace_rt);
- call_fib6_entry_notifiers(net, FIB_EVENT_ENTRY_DEL, rt, NULL);
}
if (!info->skip_notify)
inet6_rt_notify(RTM_DELROUTE, rt, info, 0);
replace_rt);
else
call_fib6_multipath_entry_notifiers(net,
- FIB_EVENT_ENTRY_DEL_TMP,
+ FIB_EVENT_ENTRY_DEL,
rt, rt->fib6_nsiblings,
NULL);
}
- call_fib6_multipath_entry_notifiers(net,
- FIB_EVENT_ENTRY_DEL,
- rt,
- rt->fib6_nsiblings,
- NULL);
list_for_each_entry_safe(sibling, next_sibling,
&rt->fib6_siblings,
fib6_siblings) {
{
struct fib6_info *rt_notif = NULL, *rt_last = NULL;
struct nl_info *info = &cfg->fc_nlinfo;
- enum fib_event_type event_type;
struct fib6_config r_cfg;
struct rtnexthop *rtnh;
struct fib6_info *rt;
if (rt_notif->fib6_nsiblings != nhn - 1)
fib_event = FIB_EVENT_ENTRY_APPEND;
else
- fib_event = FIB_EVENT_ENTRY_REPLACE_TMP;
+ fib_event = FIB_EVENT_ENTRY_REPLACE;
err = call_fib6_multipath_entry_notifiers(info->nl_net,
fib_event, rt_notif,
goto add_errout;
}
}
- event_type = replace ? FIB_EVENT_ENTRY_REPLACE : FIB_EVENT_ENTRY_ADD;
- err = call_fib6_multipath_entry_notifiers(info->nl_net, event_type,
- rt_notif, nhn - 1, extack);
- if (err) {
- /* Delete all the siblings that were just added */
- err_nh = NULL;
- goto add_errout;
- }
/* success ... tell user about new route */
ip6_route_mpath_notify(rt_notif, rt_last, info, nlflags);