From: David Ahern <dsahern@kernel.org>
To: stephen@networkplumber.org
Cc: netdev@vger.kernel.org, David Ahern <dsahern@gmail.com>
Subject: [PATCH iproute2-next 0/3] Improve batch times by caching link lookups
Date: Mon, 7 Jan 2019 14:55:49 -0800 [thread overview]
Message-ID: <20190107225552.8441-1-dsahern@kernel.org> (raw)
From: David Ahern <dsahern@gmail.com>
Many commands convert device names to an index using ll_name_to_index.
ll_name_to_index calls if_nametoindex which is ioctl based and the
result is not cached. When using a batch file this means the same device
lookups can be done repeatedly adding unnecessary overhead
(socket + ioctl + close for each device lookup).
This series adds a new function, ll_link_get, to send a netlink based
RTM_GETLINK. If successful, the result is cached in idx_head and name_head
so future lookups can re-use the entry. ll_name_to_index is updated to use
ll_link_get over if_nametoindex.
The first 2 patches add a means to drop an entry from the cache and updates
iplink_modify to use that new function to drop entries on device renames.
David Ahern (3):
ll_map: Add function to remove link cache entry by index
ip link: Drop cache entry on name changes
Improve batch times by caching link lookups
include/ll_map.h | 1 +
ip/ip_common.h | 3 ++-
ip/iplink.c | 10 ++++++++--
ip/iplink_vxcan.c | 3 ++-
ip/link_veth.c | 3 ++-
lib/ll_map.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
6 files changed, 72 insertions(+), 6 deletions(-)
--
2.11.0
next reply other threads:[~2019-01-07 22:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-07 22:55 David Ahern [this message]
2019-01-07 22:55 ` [PATCH iproute2-next 1/3] ll_map: Add function to remove link cache entry by index David Ahern
2019-01-07 22:55 ` [PATCH iproute2-next 2/3] ip link: Drop cache entry on name changes David Ahern
2019-01-08 0:06 ` Stephen Hemminger
2019-01-08 0:26 ` David Ahern
2019-01-07 22:55 ` [PATCH iproute2-next 3/3] Improve batch times by caching link lookups David Ahern
2019-01-08 0:05 ` Stephen Hemminger
2019-01-08 0:28 ` David Ahern
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=20190107225552.8441-1-dsahern@kernel.org \
--to=dsahern@kernel.org \
--cc=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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 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).