[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHOuc7Nd_=H6UVUYbjvy9cjYHu+x4kcGm8qTZqyb8dQu5tyR-g@mail.gmail.com>
Date: Wed, 9 May 2012 07:22:39 +0200
From: Oskar Berggren <oskar.berggren@...il.com>
To: Oskar Berggren <oskar.berggren@...il.com>,
Stephen Hemminger <stephen.hemminger@...tta.com>,
netdev@...r.kernel.org
Subject: Re: ipctl - new tool for efficient read/write of net related sysctl
2012/5/7 Thomas Graf <tgraf@...radead.org>:
> On Sun, May 06, 2012 at 02:46:01PM +0200, Oskar Berggren wrote:
>> 2012/5/6 Stephen Hemminger <stephen.hemminger@...tta.com>:
>> >
>> >>
>> >> In a project of mine I need to read (and possibly set) many of the
>> >> properties
>> >> found under /proc/sys/net/ipv4/conf/. This is simple enough, except
>> >> that
>> >> when you have hundreds of interfaces, it is really slow. In my tests
>> >> it takes
>> >> about 4 seconds to read a single variable for 700 interfaces. For a
>> >> while I
>> >> worked around this using the binary sysctl() interface, but this is
>> >> deprecated.
>> >>
>> >
>> > What about exposing these as NETLINK attributes? That would be faster
>> > and you could do bulk updates.
>>
>>
>> This is my first attempt at using NETLINK, so could you please elaborate?
>> Below is the generic netlink interface I implemented so far. Any pointers
>> on how I should do this differently?
>
> What Stephen means is to use the existing message types RTM_SETLINK
> and RTM_GETLINK in the NETLINK_ROUTE family.
>
> This is already partially implemented. See the IFLA_AF_SPEC attribute
> carrying IPV4_DEVCONF_ and DEVCONF_ (IPv6). Grep for rtnl_af_register()
> and you will find the corresponding implementations.
>
> Feel free to complete these existing interfaces, such as adding write
> support to IPv6 or adding support to iproute2 which is currently
> lacking.
Cool, this seems to be exactly what I need. I'll experiment with it
when I get the time.
/Oskar
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists