Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jun 2010 13:52:57 +0200
From:      Max Laier <max@love2party.net>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        Nick Rogers <ncrogers@gmail.com>, freebsd-hackers@freebsd.org
Subject:   Re: arp(8) performance w/ many aliases assigned to an interface
Message-ID:  <201006101352.57499.max@love2party.net>
In-Reply-To: <AANLkTin7sEJscNBLWi2NDEOcZ1yIvl3r-xgWBDcsoXdB@mail.gmail.com>
References:  <AANLkTikLZCREKNUdon_kRHtzvPkk-XbbXF9ghUuBjoGw@mail.gmail.com> <201006092321.05453.max@love2party.net> <AANLkTin7sEJscNBLWi2NDEOcZ1yIvl3r-xgWBDcsoXdB@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 10 June 2010 10:05:24 Adrian Chadd wrote:
> On 10 June 2010 05:21, Max Laier <max@love2party.net> wrote:
> >> Is there something that can be done to speedup the call to
> >> if_indextoname(), or would it be worthwhile for me to submit a patch
> >> that adds the ability to skip the interface lookup as an arp(8) option?
> > 
> > how about the attached:
> This patch only short-circuits the lookup for a specific case - lots
> of entries with the same ifname. What about other situations - say,
> alternating interfaces in ARP?

Yes, it is bandaid, but I believe it covers most if not all common cases.  I 
didn't want to start with a full cache, to avoid a big memory footprint.

> I read if_indextoname(). The problem is that each call is sucking down
> the ifaddrs table and looking for the index. Is this likely to be a
> problem in other situations, rather than just /usr/sbin/arp ?

I was also thinking about building a sysctl to export index to name 
information directly, but I don't think it's worth the hassle.  Other (long 
running) programs that need index->name mapping over and over again already do 
caching that is specific to their particular usecase.  See e.g. routed's if.c

Regards,
  Max



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006101352.57499.max>