All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: rshearma@brocade.com
Cc: netdev@vger.kernel.org, dsa@cumulusnetworks.com
Subject: Re: [PATCH net v2] ipv4: Avoid caching l3mdev dst on mismatched local route
Date: Mon, 24 Apr 2017 12:52:52 -0400 (EDT)	[thread overview]
Message-ID: <20170424.125252.1943124382341210457.davem@davemloft.net> (raw)
In-Reply-To: <1492806899-6215-1-git-send-email-rshearma@brocade.com>

From: Robert Shearman <rshearma@brocade.com>
Date: Fri, 21 Apr 2017 21:34:59 +0100

> David reported that doing the following:
> 
>     ip li add red type vrf table 10
>     ip link set dev eth1 vrf red
>     ip addr add 127.0.0.1/8 dev red
>     ip link set dev eth1 up
>     ip li set red up
>     ping -c1 -w1 -I red 127.0.0.1
>     ip li del red
> 
> when either policy routing IP rules are present or the local table
> lookup ip rule is before the l3mdev lookup results in a hang with
> these messages:
> 
>     unregister_netdevice: waiting for red to become free. Usage count = 1
> 
> The problem is caused by caching the dst used for sending the packet
> out of the specified interface on a local route with a different
> nexthop interface. Thus the dst could stay around until the route in
> the table the lookup was done is deleted which may be never.
> 
> Address the problem by not forcing output device to be the l3mdev in
> the flow's output interface if the lookup didn't use the l3mdev. This
> then results in the dst using the right device according to the route.
> 
> Changes in v2:
>  - make the dev_out passed in by __ip_route_output_key_hash correct
>    instead of checking the nh dev if FLOWI_FLAG_SKIP_NH_OIF is set as
>    suggested by David.
> 
> Fixes: 5f02ce24c2696 ("net: l3mdev: Allow the l3mdev to be a loopback")
> Reported-by: David Ahern <dsa@cumulusnetworks.com>
> Suggested-by: David Ahern <dsa@cumulusnetworks.com>
> Signed-off-by: Robert Shearman <rshearma@brocade.com>

Applied, thanks.

  parent reply	other threads:[~2017-04-24 16:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 12:58 [PATCH net] ipv4: Avoid caching dsts when lookup skipped nh oif check Robert Shearman
2017-04-20 14:21 ` David Ahern
2017-04-20 14:39   ` Robert Shearman
2017-04-20 14:59     ` David Ahern
2017-04-20 15:05       ` Robert Shearman
2017-04-20 15:16         ` David Ahern
2017-04-20 15:35           ` Robert Shearman
2017-04-21 20:34             ` [PATCH net v2] ipv4: Avoid caching l3mdev dst on mismatched local route Robert Shearman
2017-04-21 20:37               ` David Ahern
2017-04-24 16:52               ` David Miller [this message]
2017-04-20 22:18 ` [PATCH net] ipv4: Avoid caching dsts when lookup skipped nh oif check David Ahern
2017-04-21 17:17   ` Robert Shearman

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=20170424.125252.1943124382341210457.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=netdev@vger.kernel.org \
    --cc=rshearma@brocade.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 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.