All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dsahern@kernel.org
Cc: netdev@vger.kernel.org, David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH iproute2] ip link: Do not call ll_name_to_index when creating a new link
Date: Thu, 17 May 2018 15:36:04 -0700	[thread overview]
Message-ID: <20180517153604.0d905a36@xeon-e3> (raw)
In-Reply-To: <20180517222237.72388-1-dsahern@kernel.org>

On Thu, 17 May 2018 16:22:37 -0600
dsahern@kernel.org wrote:

> From: David Ahern <dsahern@gmail.com>
> 
> Using iproute2 to create a bridge and add 4094 vlans to it can take from
> 2 to 3 *minutes*. The reason is the extraneous call to ll_name_to_index.
> ll_name_to_index results in an ioctl(SIOCGIFINDEX) call which in turn
> invokes dev_load. If the index does not exist, which it won't when
> creating a new link, dev_load calls modprobe twice -- once for
> netdev-NAME and again for NAME. This is unnecessary overhead for each
> link create.
> 
> When ip link is invoked for a new device, there is no reason to
> call ll_name_to_index for the new device. With this patch, creating
> a bridge and adding 4094 vlans takes less than 3 *seconds*.
> 
> Signed-off-by: David Ahern <dsahern@gmail.com>

Yes this looks like a real problem.
Isn't the cache supposed to reduce this?

Don't like to make lots of special case flags.

  reply	other threads:[~2018-05-17 22:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 22:22 [PATCH iproute2] ip link: Do not call ll_name_to_index when creating a new link dsahern
2018-05-17 22:36 ` Stephen Hemminger [this message]
2018-05-17 22:47   ` David Ahern
2018-05-18  0:17   ` David Ahern
2018-05-18 22:08     ` Stephen Hemminger
2018-05-18 23:40       ` David Ahern
2018-05-25 15:21         ` Stephen Hemminger

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=20180517153604.0d905a36@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --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.