netdev
[Top] [All Lists]

[Fwd: dev_get_by_index is not hashed: O(n)]

To: "'netdev@xxxxxxxxxxx'" <netdev@xxxxxxxxxxx>
Subject: [Fwd: dev_get_by_index is not hashed: O(n)]
From: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Date: Wed, 28 Aug 2002 00:33:23 -0700
Organization: Candela Technologies
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020722
-- 
Ben Greear <greearb@xxxxxxxxxxxxxxx>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear



-- Attached file included as plaintext by Ecartis --
-- File: dev_get_by_index is not hashed:  O(n)

Message-ID: <3D6C781B.8010506@xxxxxxxxxxxxxxx>
Date: Wed, 28 Aug 2002 00:13:31 -0700
From: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Organization: Candela Technologies
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020722
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: linux-net <linux-net@xxxxxxxxxxxxxxx>
Subject: dev_get_by_index is not hashed:  O(n)
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I just noticed that dev_get_by_index is not hashed, it is just a linear
search through all interfaces.  This call is made in many places in the
kernel, and particularly in route.c

For machines with large numbers of interfaces (VLANs for instance),
this could be a real performance drag.

Any reason we don't keep interfaces in a hash-table by index?

Ben

-- 
Ben Greear <greearb@xxxxxxxxxxxxxxx>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear





<Prev in Thread] Current Thread [Next in Thread>
  • [Fwd: dev_get_by_index is not hashed: O(n)], Ben Greear <=