All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: daniel.turull@gmail.com
Cc: David Miller <davem@davemloft.net>,
	eric.dumazet@gmail.com, netdev@vger.kernel.org, voravit@kth.se,
	robert@herjulf.net
Subject: Re: [PATH] dev: reusing unregistered ifindex values in net_device
Date: Thu, 18 Nov 2010 08:14:52 -0800	[thread overview]
Message-ID: <20101118081452.7a38deb7@nehalam> (raw)
In-Reply-To: <20101118.080139.193717791.davem@davemloft.net>

On Thu, 18 Nov 2010 08:01:39 -0800 (PST)
David Miller <davem@davemloft.net> wrote:

> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Thu, 18 Nov 2010 16:37:08 +0100
> 
> > Two bugs 
> > 
> > 1) ifindex is not initialized : you'll be suprised of random values
> > 
> > 2) ifindex should not be reused. You'll be surprised so applications can
> > break. SNMP comes to mind.
> 
> Right, the current algorithm is intentionally trying to avoid new
> devices from using indexes that were used by another device in the
> past.

Also think of the case of adding 10,000 VLAN's. If the search started from
beginning on each insertion dev_new_index would go from O(N) to O(N^2) which
really hurts.

      reply	other threads:[~2010-11-18 16:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18 15:25 [PATH] dev: reusing unregistered ifindex values in net_device Daniel Turull
2010-11-18 15:37 ` Eric Dumazet
2010-11-18 15:43   ` Daniel Turull
2010-11-18 16:01   ` David Miller
2010-11-18 16:14     ` Stephen Hemminger [this message]

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=20101118081452.7a38deb7@nehalam \
    --to=shemminger@vyatta.com \
    --cc=daniel.turull@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=robert@herjulf.net \
    --cc=voravit@kth.se \
    /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.