Message ID | 20190107225552.8441-1-dsahern@kernel.org |
---|---|
Headers | show
Return-Path: <netdev-owner@vger.kernel.org> X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="zbzOrTBU"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43YW3H1rD1z9sDP for <patchwork-incoming-netdev@ozlabs.org>; Tue, 8 Jan 2019 09:56:27 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726936AbfAGW4O (ORCPT <rfc822;patchwork-incoming-netdev@ozlabs.org>); Mon, 7 Jan 2019 17:56:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:38812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726667AbfAGW4O (ORCPT <rfc822;netdev@vger.kernel.org>); Mon, 7 Jan 2019 17:56:14 -0500 Received: from kenny.it.cumulusnetworks.com. (fw.cumulusnetworks.com [216.129.126.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BA2FC2070B; Mon, 7 Jan 2019 22:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546901773; bh=P/ilCpd4s9SbI4ShDqGeI0MAG51+DPlKb0HeBxeXj94=; h=From:To:Cc:Subject:Date:From; b=zbzOrTBU7WPv0s8vdijYAo0yEkXxQT7yyKwJ71w9UWn+BlFI7Vz/ktIV700x+VtvC NI6wTHOXX57d89xeT75wBMMkdVusmdeFOQYvdbDLqULYkS8Xxb9/xnnGShD5SrcUr0 LzRVyHKYyBGKCd4RGHel7mdugnToW0VWuDzJEMzw= 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 Message-Id: <20190107225552.8441-1-dsahern@kernel.org> X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: <netdev.vger.kernel.org> X-Mailing-List: netdev@vger.kernel.org |
Series |
Improve batch times by caching link lookups
|
expand
|
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(-)