netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: netdev@vger.kernel.org
Cc: jhs@mojatatu.com, David Ahern <dsahern@gmail.com>,
	Satish Ashok <sashok@cumulusnetworks.com>
Subject: [PATCH net-next 2/3] net: ipv4: flush neighbor entries when carrier is off
Date: Sun,  5 Nov 2017 22:57:52 -0800	[thread overview]
Message-ID: <1509951473-25990-3-git-send-email-dsahern@gmail.com> (raw)
In-Reply-To: <1509951473-25990-1-git-send-email-dsahern@gmail.com>

Commit a6db4494d218c ("net: ipv4: Consider failed nexthops in multipath
routes") added support for checking neighbor state when selecting a path
for multipath route lookups. It works but incurs a delay waiting for
the neighbor entry to timeout. Improve the path selection by flushing
non-permanent neighbor entries when carrier is off.

Signed-off-by: Satish Ashok <sashok@cumulusnetworks.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
---
 net/ipv4/fib_frontend.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index f02819134ba2..aa8fea74858f 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1226,10 +1226,13 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
 		break;
 	case NETDEV_CHANGE:
 		flags = dev_get_flags(dev);
-		if (flags & (IFF_RUNNING | IFF_LOWER_UP))
+		if (flags & (IFF_RUNNING | IFF_LOWER_UP)) {
 			fib_sync_up(dev, RTNH_F_LINKDOWN);
-		else
+		} else {
 			fib_sync_down_dev(dev, event, false);
+			if (IN_DEV_IGNORE_ROUTES_WITH_LINKDOWN(in_dev))
+				neigh_carrier_down(&arp_tbl, dev);
+		}
 		/* fall through */
 	case NETDEV_CHANGEMTU:
 		rt_cache_flush(net);
-- 
2.1.4

  parent reply	other threads:[~2017-11-06  6:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06  6:57 [PATCH net-next 0/3] net: flush neighbor entries when carrier is off David Ahern
2017-11-06  6:57 ` [PATCH net-next 1/3] net: neigh: Add helper to flush entries on carrier down David Ahern
2017-11-06  6:57 ` David Ahern [this message]
2017-11-06 10:47   ` [PATCH net-next 2/3] net: ipv4: flush neighbor entries when carrier is off Ido Schimmel
2017-11-06 14:49     ` David Ahern
2017-11-07  5:29       ` David Ahern
2017-11-06  6:57 ` [PATCH net-next 3/3] net: ipv6: " David Ahern
     [not found] ` <CAKYOsXz3RFqbzENy1rz8kjsr3aF0u2kxBHrSQ3uNfFfQTWbJRQ@mail.gmail.com>
2017-11-08  3:39   ` [PATCH net-next 0/3] net: " 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=1509951473-25990-3-git-send-email-dsahern@gmail.com \
    --to=dsahern@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=sashok@cumulusnetworks.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).