All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, dsahern@gmail.com, jiri@mellanox.com,
	alexpe@mellanox.com, mlxsw@mellanox.com,
	Ido Schimmel <idosch@mellanox.com>
Subject: [PATCH net-next 16/17] ipv6: Stop sending in-kernel notifications for each nexthop
Date: Sat, 15 Jun 2019 17:07:50 +0300	[thread overview]
Message-ID: <20190615140751.17661-17-idosch@idosch.org> (raw)
In-Reply-To: <20190615140751.17661-1-idosch@idosch.org>

From: Ido Schimmel <idosch@mellanox.com>

Both listeners - mlxsw and netdevsim - of IPv6 FIB notifications are now
ready to handle IPv6 multipath notifications.

Therefore, stop ignoring such notifications in both drivers and stop
sending notification for each added / deleted nexthop.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
---
 .../ethernet/mellanox/mlxsw/spectrum_router.c |  2 --
 drivers/net/netdevsim/fib.c                   |  7 -----
 net/ipv6/ip6_fib.c                            | 28 +++++++++++--------
 3 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 2f5fa1fac825..1ad3bb88f85f 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -6228,8 +6228,6 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb,
 				NL_SET_ERR_MSG_MOD(info->extack, "IPv6 route with nexthop objects is not supported");
 				return notifier_from_errno(-EINVAL);
 			}
-			if (fen6_info->multipath_rt)
-				return NOTIFY_DONE;
 		}
 		break;
 	}
diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c
index 6e5498ef3855..2acef70f93db 100644
--- a/drivers/net/netdevsim/fib.c
+++ b/drivers/net/netdevsim/fib.c
@@ -197,13 +197,6 @@ static int nsim_fib_event_nb(struct notifier_block *nb, unsigned long event,
 
 	case FIB_EVENT_ENTRY_ADD:  /* fall through */
 	case FIB_EVENT_ENTRY_DEL:
-		if (info->family == AF_INET6) {
-			struct fib6_entry_notifier_info *fen6_info = ptr;
-
-			if (fen6_info->multipath_rt)
-				return NOTIFY_DONE;
-		}
-
 		err = nsim_fib_event(data, info,
 				     event == FIB_EVENT_ENTRY_ADD);
 		break;
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index df08ba8fe6fc..e08f2a502d09 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1140,11 +1140,13 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct fib6_info *rt,
 add:
 		nlflags |= NLM_F_CREATE;
 
-		err = call_fib6_entry_notifiers(info->nl_net,
-						FIB_EVENT_ENTRY_ADD,
-						rt, extack);
-		if (err)
-			return err;
+		if (!info->skip_notify_kernel) {
+			err = call_fib6_entry_notifiers(info->nl_net,
+							FIB_EVENT_ENTRY_ADD,
+							rt, extack);
+			if (err)
+				return err;
+		}
 
 		rcu_assign_pointer(rt->fib6_next, iter);
 		fib6_info_hold(rt);
@@ -1169,11 +1171,13 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct fib6_info *rt,
 			return -ENOENT;
 		}
 
-		err = call_fib6_entry_notifiers(info->nl_net,
-						FIB_EVENT_ENTRY_REPLACE,
-						rt, extack);
-		if (err)
-			return err;
+		if (!info->skip_notify_kernel) {
+			err = call_fib6_entry_notifiers(info->nl_net,
+							FIB_EVENT_ENTRY_REPLACE,
+							rt, extack);
+			if (err)
+				return err;
+		}
 
 		fib6_info_hold(rt);
 		rcu_assign_pointer(rt->fib6_node, fn);
@@ -1856,9 +1860,11 @@ static void fib6_del_route(struct fib6_table *table, struct fib6_node *fn,
 
 	fib6_purge_rt(rt, fn, net);
 
-	call_fib6_entry_notifiers(net, FIB_EVENT_ENTRY_DEL, rt, NULL);
+	if (!info->skip_notify_kernel)
+		call_fib6_entry_notifiers(net, FIB_EVENT_ENTRY_DEL, rt, NULL);
 	if (!info->skip_notify)
 		inet6_rt_notify(RTM_DELROUTE, rt, info, 0);
+
 	fib6_info_release(rt);
 }
 
-- 
2.20.1


  parent reply	other threads:[~2019-06-15 14:10 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-15 14:07 [PATCH net-next 00/17] mlxsw: Improve IPv6 route insertion rate Ido Schimmel
2019-06-15 14:07 ` [PATCH net-next 01/17] netlink: Document all fields of 'struct nl_info' Ido Schimmel
2019-06-17  1:16   ` David Ahern
2019-06-15 14:07 ` [PATCH net-next 02/17] netlink: Add field to skip in-kernel notifications Ido Schimmel
2019-06-17  1:17   ` David Ahern
2019-06-17  6:37     ` Ido Schimmel
2019-06-15 14:07 ` [PATCH net-next 03/17] ipv6: Extend notifier info for multipath routes Ido Schimmel
2019-06-17  1:22   ` David Ahern
2019-06-17  6:46     ` Ido Schimmel
2019-06-15 14:07 ` [PATCH net-next 04/17] mlxsw: spectrum_router: Ignore IPv6 multipath notifications Ido Schimmel
2019-06-15 14:07 ` [PATCH net-next 05/17] netdevsim: " Ido Schimmel
2019-06-15 14:07 ` [PATCH net-next 06/17] ipv6: Add IPv6 multipath notifications for add / replace Ido Schimmel
2019-06-17 13:01   ` David Ahern
2019-06-15 14:07 ` [PATCH net-next 07/17] ipv6: Add IPv6 multipath notification for route delete Ido Schimmel
2019-06-17 13:03   ` David Ahern
2019-06-15 14:07 ` [PATCH net-next 08/17] netdevsim: Adjust accounting for IPv6 multipath notifications Ido Schimmel
2019-06-17  1:27   ` David Ahern
2019-06-17  6:49     ` Ido Schimmel
2019-06-15 14:07 ` [PATCH net-next 09/17] mlxsw: spectrum_router: Remove processing of IPv6 append notifications Ido Schimmel
2019-06-15 14:07 ` [PATCH net-next 10/17] mlxsw: spectrum_router: Prepare function to return errors Ido Schimmel
2019-06-15 14:07 ` [PATCH net-next 11/17] mlxsw: spectrum_router: Pass multiple routes to work item Ido Schimmel
2019-06-15 14:07 ` [PATCH net-next 12/17] mlxsw: spectrum_router: Adjust IPv6 replace logic to new notifications Ido Schimmel
2019-06-15 14:07 ` [PATCH net-next 13/17] mlxsw: spectrum_router: Pass array of routes to route handling functions Ido Schimmel
2019-06-15 14:07 ` [PATCH net-next 14/17] mlxsw: spectrum_router: Add / delete multiple IPv6 nexthops Ido Schimmel
2019-06-15 14:07 ` [PATCH net-next 15/17] mlxsw: spectrum_router: Create IPv6 multipath routes in one go Ido Schimmel
2019-06-15 14:07 ` Ido Schimmel [this message]
2019-06-17 13:06   ` [PATCH net-next 16/17] ipv6: Stop sending in-kernel notifications for each nexthop David Ahern
2019-06-15 14:07 ` [PATCH net-next 17/17] selftests: mlxsw: Add a test for FIB offload indication Ido Schimmel
2019-06-16 21:04 ` [PATCH net-next 00/17] mlxsw: Improve IPv6 route insertion rate David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190615140751.17661-17-idosch@idosch.org \
    --to=idosch@idosch.org \
    --cc=alexpe@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.