<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/ipv4/fib_rules.c, branch linux-2.6.37.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.37.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.37.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2010-10-06T03:39:38Z</updated>
<entry>
<title>fib: RCU conversion of fib_lookup()</title>
<updated>2010-10-06T03:39:38Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2010-10-05T10:41:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ebc0ffae5dfb4447e0a431ffe7fe1d467c48bbb9'/>
<id>urn:sha1:ebc0ffae5dfb4447e0a431ffe7fe1d467c48bbb9</id>
<content type='text'>
fib_lookup() converted to be called in RCU protected context, no
reference taken and released on a contended cache line (fib_clntref)

fib_table_lookup() and fib_semantic_match() get an additional parameter.

struct fib_info gets an rcu_head field, and is freed after an rcu grace
period.

Stress test :
(Sending 160.000.000 UDP frames on same neighbour,
IP route cache disabled, dual E5540 @2.53GHz,
32bit kernel, FIB_HASH) (about same results for FIB_TRIE)

Before patch :

real	1m31.199s
user	0m13.761s
sys	23m24.780s

After patch:

real	1m5.375s
user	0m14.997s
sys	15m50.115s

Before patch Profile :

13044.00 15.4% __ip_route_output_key vmlinux
 8438.00 10.0% dst_destroy           vmlinux
 5983.00  7.1% fib_semantic_match    vmlinux
 5410.00  6.4% fib_rules_lookup      vmlinux
 4803.00  5.7% neigh_lookup          vmlinux
 4420.00  5.2% _raw_spin_lock        vmlinux
 3883.00  4.6% rt_set_nexthop        vmlinux
 3261.00  3.9% _raw_read_lock        vmlinux
 2794.00  3.3% fib_table_lookup      vmlinux
 2374.00  2.8% neigh_resolve_output  vmlinux
 2153.00  2.5% dst_alloc             vmlinux
 1502.00  1.8% _raw_read_lock_bh     vmlinux
 1484.00  1.8% kmem_cache_alloc      vmlinux
 1407.00  1.7% eth_header            vmlinux
 1406.00  1.7% ipv4_dst_destroy      vmlinux
 1298.00  1.5% __copy_from_user_ll   vmlinux
 1174.00  1.4% dev_queue_xmit        vmlinux
 1000.00  1.2% ip_output             vmlinux

After patch Profile :

13712.00 15.8% dst_destroy             vmlinux
 8548.00  9.9% __ip_route_output_key   vmlinux
 7017.00  8.1% neigh_lookup            vmlinux
 4554.00  5.3% fib_semantic_match      vmlinux
 4067.00  4.7% _raw_read_lock          vmlinux
 3491.00  4.0% dst_alloc               vmlinux
 3186.00  3.7% neigh_resolve_output    vmlinux
 3103.00  3.6% fib_table_lookup        vmlinux
 2098.00  2.4% _raw_read_lock_bh       vmlinux
 2081.00  2.4% kmem_cache_alloc        vmlinux
 2013.00  2.3% _raw_spin_lock          vmlinux
 1763.00  2.0% __copy_from_user_ll     vmlinux
 1763.00  2.0% ip_output               vmlinux
 1761.00  2.0% ipv4_dst_destroy        vmlinux
 1631.00  1.9% eth_header              vmlinux
 1440.00  1.7% _raw_read_unlock_bh     vmlinux

Reference results, if IP route cache is enabled :

real	0m29.718s
user	0m10.845s
sys	7m37.341s

25213.00 29.5% __ip_route_output_key   vmlinux
 9011.00 10.5% dst_release             vmlinux
 4817.00  5.6% ip_push_pending_frames  vmlinux
 4232.00  5.0% ip_finish_output        vmlinux
 3940.00  4.6% udp_sendmsg             vmlinux
 3730.00  4.4% __copy_from_user_ll     vmlinux
 3716.00  4.4% ip_route_output_flow    vmlinux
 2451.00  2.9% __xfrm_lookup           vmlinux
 2221.00  2.6% ip_append_data          vmlinux
 1718.00  2.0% _raw_spin_lock_bh       vmlinux
 1655.00  1.9% __alloc_skb             vmlinux
 1572.00  1.8% sock_wfree              vmlinux
 1345.00  1.6% kfree                   vmlinux

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>fib: cleanups</title>
<updated>2010-10-05T07:47:38Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2010-10-04T20:00:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6a31d2a97c04ffe9b161ec0177a2296366ff9249'/>
<id>urn:sha1:6a31d2a97c04ffe9b161ec0177a2296366ff9249</id>
<content type='text'>
Code style cleanups before upcoming functional changes.
C99 initializer for fib_props array.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: rtnetlink: decouple rtnetlink address families from real address families</title>
<updated>2010-04-26T14:13:54Z</updated>
<author>
<name>Patrick McHardy</name>
</author>
<published>2010-04-26T14:02:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=25239cee7e8732dbdc9f5d324f1c22a3bdec1d1f'/>
<id>urn:sha1:25239cee7e8732dbdc9f5d324f1c22a3bdec1d1f</id>
<content type='text'>
Decouple rtnetlink address families from real address families in socket.h to
be able to add rtnetlink interfaces to code that is not a real address family
without increasing AF_MAX/NPROTO.

This will be used to add support for multicast route dumping from all tables
as the proc interface can't be extended to support anything but the main table
without breaking compatibility.

This partialy undoes the patch to introduce independant families for routing
rules and converts ipmr routing rules to a new rtnetlink family. Similar to
that patch, values up to 127 are reserved for real address families, values
above that may be used arbitrarily.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
</content>
</entry>
<entry>
<title>net: fib_rules: mark arguments to fib_rules_register const and __net_initdata</title>
<updated>2010-04-26T14:02:04Z</updated>
<author>
<name>Patrick McHardy</name>
</author>
<published>2010-04-26T14:02:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3d0c9c4eb2dbdcc461be4084abd87a9a9e70f713'/>
<id>urn:sha1:3d0c9c4eb2dbdcc461be4084abd87a9a9e70f713</id>
<content type='text'>
fib_rules_register() duplicates the template passed to it without modification,
mark the argument as const. Additionally the templates are only needed when
instantiating a new namespace, so mark them as __net_initdata, which means
they can be discarded when CONFIG_NET_NS=n.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
</content>
</entry>
<entry>
<title>net: fib_rules: decouple address families from real address families</title>
<updated>2010-04-13T21:49:31Z</updated>
<author>
<name>Patrick McHardy</name>
</author>
<published>2010-04-13T05:03:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0f87b1dd01b51dc3c789f7a212656a4a87eee1bd'/>
<id>urn:sha1:0f87b1dd01b51dc3c789f7a212656a4a87eee1bd</id>
<content type='text'>
Decouple the address family values used for fib_rules from the real
address families in socket.h. This allows to use fib_rules for
code that is not a real address family without increasing AF_MAX/NPROTO.

Values up to 127 are reserved for real address families and map directly
to the corresponding AF value, values starting from 128 are for other
uses. rtnetlink is changed to invoke the AF_UNSPEC dumpit/doit handlers
for these families.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: fib_rules: set family in fib_rule_hdr centrally</title>
<updated>2010-04-13T21:49:30Z</updated>
<author>
<name>Patrick McHardy</name>
</author>
<published>2010-04-13T05:03:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=28bb17268b92b0c568f2496e5e631008f9108409'/>
<id>urn:sha1:28bb17268b92b0c568f2496e5e631008f9108409</id>
<content type='text'>
All fib_rules implementations need to set the family in their -&gt;fill()
functions. Since the value is available to the generic fib_nl_fill_rule()
function, set it there.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: fib_rules: consolidate IPv4 and DECnet -&gt;default_pref() functions.</title>
<updated>2010-04-13T21:49:30Z</updated>
<author>
<name>Patrick McHardy</name>
</author>
<published>2010-04-13T05:03:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d8a566beaa75c6ad5e38cdccf0ea5294323e7866'/>
<id>urn:sha1:d8a566beaa75c6ad5e38cdccf0ea5294323e7866</id>
<content type='text'>
Both functions are equivalent, consolidate them since a following patch
needs a third implementation for multicast routing.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Allow fib_rule_unregister to batch</title>
<updated>2009-12-03T20:22:55Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2009-12-03T20:22:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e9c5158ac26affd5d8ce006521bdfb7148090e18'/>
<id>urn:sha1:e9c5158ac26affd5d8ce006521bdfb7148090e18</id>
<content type='text'>
Refactor the code so fib_rules_register always takes a template instead
of the actual fib_rules_ops structure that will be used.  This is
required for network namespace support so 2 out of the 3 callers already
do this, it allows the error handling to be made common, and it allows
fib_rules_unregister to free the template for hte caller.

Modify fib_rules_unregister to use call_rcu instead of syncrhonize_rcu
to allw multiple namespaces to be cleaned up in the same rcu grace
period.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net 04/05: fib_rules: allow to delete local rule</title>
<updated>2009-12-03T20:14:37Z</updated>
<author>
<name>Patrick McHardy</name>
</author>
<published>2009-12-03T01:25:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5adef1809147a9c39119ffd5a13a1ca4fe23a411'/>
<id>urn:sha1:5adef1809147a9c39119ffd5a13a1ca4fe23a411</id>
<content type='text'>
commit d124356ce314fff22a047ea334379d5105b2d834
Author: Patrick McHardy &lt;kaber@trash.net&gt;
Date:   Thu Dec 3 12:16:35 2009 +0100

    net: fib_rules: allow to delete local rule

    Allow to delete the local rule and recreate it with a higher priority. This
    can be used to force packets with a local destination out on the wire instead
    of routing them to loopback. Additionally this patch allows to recreate rules
    with a priority of 0.

    Combined with the previous patch to allow oif classification, a socket can
    be bound to the desired interface and packets routed to the wire like this:

    # move local rule to lower priority
    ip rule add pref 1000 lookup local
    ip rule del pref 0

    # route packets of sockets bound to eth0 to the wire independant
    # of the destination address
    ip rule add pref 100 oif eth0 lookup 100
    ip route add default dev eth0 table 100

    Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv4: fib table algorithm performance improvement</title>
<updated>2009-10-05T07:21:56Z</updated>
<author>
<name>Stephen Hemminger</name>
</author>
<published>2009-09-20T10:35:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=16c6cf8bb471392fd09b48b7c27e7d83a446b4bc'/>
<id>urn:sha1:16c6cf8bb471392fd09b48b7c27e7d83a446b4bc</id>
<content type='text'>
The FIB algorithim for IPV4 is set at compile time, but kernel goes through
the overhead of function call indirection at runtime. Save some
cycles by turning the indirect calls to direct calls to either
hash or trie code.

Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
