netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Maciej Żenczykowski" <zenczykowski@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	Lorenzo Colitti <lorenzo@google.com>,
	Tom Herbert <therbert@google.com>
Subject: Re: [PATCH net-next 1/2] ipv6: force RTF_NONEXTHOP for SIT device
Date: Wed, 12 Sep 2012 13:53:13 -0700	[thread overview]
Message-ID: <CANP3RGcpM+an8u5-cxz-VqKFFN0Oj4zsrcQ3YXz=a4_4J6XLzQ@mail.gmail.com> (raw)
In-Reply-To: <1347451266.13103.882.camel@edumazet-glaptop>

On Wed, Sep 12, 2012 at 5:01 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> We have special handling of SIT devices in addrconf_prefix_route()
> to avoid using a neighbour for each destination.
>
> If routing entry is :
>
> ip -6 route add 2001:db8::/64 dev sit1
>
> Then the kernel will create a new route for every new address
> under 2001:db8::/64 that we send a packet to (potentially, 2^64
> routes).
>
> Under load, we immediately get the infamous "Neighbour table overflow"
> message and machine eventually crash.
>
> This does not happen if we specify a next-hop explicitly, like so:
>
> ip -6 route add 2001:db8::/64 via fe80:: dev sit1
>
> We can avoid this hassle doing the SIT test in ip6_route_add() instead
> of addrconf_prefix_route().
>
> This permits ip6_pol_route() to clone route instead of calling
> rt6_alloc_cow() and allocate a neighbour
>
> Reported-by: Lorenzo Colitti <lorenzo@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Maciej Żenczykowski <maze@google.com>
> Cc: Tom Herbert <therbert@google.com>
> ---
>  net/ipv6/addrconf.c |   10 ----------
>  net/ipv6/route.c    |    9 +++++++++
>  2 files changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 1237d5d..c6837d2 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -1679,16 +1679,6 @@ addrconf_prefix_route(struct in6_addr *pfx, int plen, struct net_device *dev,
>         };
>
>         cfg.fc_dst = *pfx;
> -
> -       /* Prevent useless cloning on PtP SIT.
> -          This thing is done here expecting that the whole
> -          class of non-broadcast devices need not cloning.
> -        */
> -#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
> -       if (dev->type == ARPHRD_SIT && (dev->flags & IFF_POINTOPOINT))
> -               cfg.fc_flags |= RTF_NONEXTHOP;
> -#endif
> -
>         ip6_route_add(&cfg);
>  }
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 399613b..d4ba3fc 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -1540,6 +1540,15 @@ int ip6_route_add(struct fib6_config *cfg)
>         } else
>                 rt->rt6i_prefsrc.plen = 0;
>
> +       /* Prevent useless cloning on PtP SIT.
> +        *  This thing is done here expecting that the whole
> +        *  class of non-broadcast devices need not cloning.
> +        */
> +#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
> +       if (dev && dev->type == ARPHRD_SIT && (dev->flags & IFF_POINTOPOINT))
> +               cfg->fc_flags |= RTF_NONEXTHOP;
> +#endif
> +
>         if (cfg->fc_flags & (RTF_GATEWAY | RTF_NONEXTHOP)) {
>                 err = rt6_bind_neighbour(rt, dev);
>                 if (err)
>
>

Acked-by: Maciej Żenczykowski <maze@google.com>

  reply	other threads:[~2012-09-12 20:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 12:01 [PATCH net-next 1/2] ipv6: force RTF_NONEXTHOP for SIT device Eric Dumazet
2012-09-12 20:53 ` Maciej Żenczykowski [this message]
2012-09-13  2:59 ` Eric Dumazet
2012-09-13  3:15   ` [PATCH v2 net-next] ipv6: prevent useless neigh alloc on PTP or lo routes Eric Dumazet
2012-09-13 21:13     ` David Miller
2012-09-13 21:51       ` Eric Dumazet

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='CANP3RGcpM+an8u5-cxz-VqKFFN0Oj4zsrcQ3YXz=a4_4J6XLzQ@mail.gmail.com' \
    --to=zenczykowski@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=lorenzo@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.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).