From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 10 08:05:27 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E4BF1065672 for ; Thu, 10 Jun 2010 08:05:26 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id E74BE8FC18 for ; Thu, 10 Jun 2010 08:05:24 +0000 (UTC) Received: by iwn7 with SMTP id 7so3546875iwn.13 for ; Thu, 10 Jun 2010 01:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=c0hEfUZFRybzFOAKJBZf/pAenG8ZzN7Un3OA/1uxQgA=; b=E53Y/g1Wj/Ssq1Y5olsDIE2Xk4LnV0thnrVeUJGnREtaFCY6FogpVQo5/8NLiUHBkK fx+WB4wcKfPoJjWQyhHggyQXw27UUbRJdUvZ82THxo8XGJ/Wlvzfk28vS7HsSvlMhXLs A005UnN8JRRFJC8CawG0JushdAh1xVo3xFstE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=KJ1tOdLLKbg9VJF+B3R8sjyRAEjO0kEyAoZsKRtj4uR8Fv1EKQ5JdU2tanqzl7lZyQ KkJMyzC6Rsbs8pU6PSNYfm4aPZjOxHgt3Fda/LX94xxseLdW8LMHRzVCNDHA+iRq3Ki7 SRoflfYCormtlNX+lA+1+ny2HysxihVBkzDk4= MIME-Version: 1.0 Received: by 10.231.111.209 with SMTP id t17mr9018196ibp.182.1276157124260; Thu, 10 Jun 2010 01:05:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.231.156.76 with HTTP; Thu, 10 Jun 2010 01:05:24 -0700 (PDT) In-Reply-To: <201006092321.05453.max@love2party.net> References: <201006092321.05453.max@love2party.net> Date: Thu, 10 Jun 2010 16:05:24 +0800 X-Google-Sender-Auth: aCYHrrFlVRFs-aFMx7wHpcE9lSo Message-ID: From: Adrian Chadd To: Max Laier Content-Type: text/plain; charset=ISO-8859-1 Cc: Nick Rogers , freebsd-hackers@freebsd.org Subject: Re: arp(8) performance w/ many aliases assigned to an interface X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 08:05:28 -0000 On 10 June 2010 05:21, Max Laier 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? 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 ? Adrian