15 Apr, 2011

1 commit

  • fib_select_default() is a complete NOP, and completely pointless
    to invoke, when we have no more than 1 default route installed.

    And this is far and away the common case.

    So remember how many prefixlen==0 routes we have in the routing
    table, and elide the call when we have no more than one of those.

    This cuts output route creation time by 157 cycles on Niagara2+.

    In order to add the new int to fib_table, we have to correct the type
    of ->tb_data[] to unsigned long, otherwise the private area will be
    unaligned on 64-bit systems.

    Signed-off-by: David S. Miller
    Reviewed-by: Eric Dumazet

    David S. Miller
     

11 Apr, 2011

1 commit


25 Mar, 2011

2 commits


13 Mar, 2011

1 commit


11 Mar, 2011

1 commit


09 Mar, 2011

1 commit


08 Mar, 2011

1 commit

  • When doing output route lookups, we have to select the source address
    if the user has not specified an explicit one.

    First, if the route has an explicit preferred source address
    specified, then we use that.

    Otherwise we search the route's outgoing interface for a suitable
    address.

    This search can be precomputed and cached at route insertion time.

    The only missing part is that we have to refresh this precomputed
    value any time addresses are added or removed from the interface, and
    this is accomplished by fib_update_nh_saddrs().

    Signed-off-by: David S. Miller

    David S. Miller
     

18 Feb, 2011

2 commits


02 Feb, 2011

1 commit


01 Feb, 2011

2 commits

  • Both fib_trie and fib_hash have a local implementation of
    fib_table_select_default(). This is completely unnecessary
    code duplication.

    Since we now remember the fib_table and the head of the fib
    alias list of the default route, we can implement one single
    generic version of this routine.

    Looking at the fib_hash implementation you may get the impression
    that it's possible for there to be multiple top-level routes in
    the table for the default route. The truth is, it isn't, the
    insert code will only allow one entry to exist in the zero
    prefix hash table, because all keys evaluate to zero and all
    keys in a hash table must be unique.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • This will be used later to implement fib_select_default() in a
    completely generic manner, instead of the current situation where the
    default route is re-looked up in the TRIE/HASH table and then the
    available aliases are analyzed.

    Signed-off-by: David S. Miller

    David S. Miller
     

29 Jan, 2011

1 commit


14 Jan, 2011

1 commit

  • Fix dependencies of netfilter realm match: it depends on NET_CLS_ROUTE,
    which itself depends on NET_SCHED; this dependency is missing from netfilter.

    Since matching on realms is also useful without having NET_SCHED enabled and
    the option really only controls whether the tclassid member is included in
    route and dst entries, rename the config option to IP_ROUTE_CLASSID and move
    it outside of traffic scheduling context to get rid of the NET_SCHED dependeny.

    Reported-by: Vladis Kletnieks
    Signed-off-by: Patrick McHardy

    Patrick McHardy
     

29 Oct, 2010

1 commit

  • When we stop a namespace we flush the table and free one, but the
    added fn_zone-s (and their hashes if grown) are leaked. Need to free.
    Tries releases all its stuff in the flushing code.

    Shame on us - this bug exists since the very first make-fib-per-net
    patches in 2.6.27 :(

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     

06 Oct, 2010

1 commit

  • 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
    Signed-off-by: David S. Miller

    Eric Dumazet
     

06 Nov, 2009

1 commit


30 Oct, 2009

1 commit


05 Oct, 2009

1 commit


04 May, 2009

1 commit


27 Apr, 2009

1 commit


05 Feb, 2008

1 commit

  • compile error building without CONFIG_FS_PROC:

    net/ipv4/fib_frontend.c: In function 'fib_net_init':
    net/ipv4/fib_frontend.c:1032: error: implicit declaration of function 'fib_proc_
    init'
    net/ipv4/fib_frontend.c: In function 'fib_net_exit':
    net/ipv4/fib_frontend.c:1047: error: implicit declaration of function 'fib_proc_
    exit'

    Signed-off-by: Li Zefan
    Signed-off-by: David S. Miller

    Li Zefan
     

01 Feb, 2008

3 commits

  • The namespace is not available in the fib_sync_down_addr, add it as a
    parameter.

    Looking up a device by the pointer to it is OK. Looking up using a
    result from fib_trie/fib_hash table lookup is also safe. No need to
    fix that at all. So, just fix lookup by address and insertion to the
    hash table path.

    Signed-off-by: Denis V. Lunev
    Signed-off-by: David S. Miller

    Denis V. Lunev
     
  • This is required to make fib_info lookups namespace aware. In the
    other case initial namespace devices are marked as dead in the local
    routing table during other namespace stop.

    Signed-off-by: Denis V. Lunev
    Signed-off-by: David S. Miller

    Denis V. Lunev
     
  • fib_sync_down can be called with an address and with a device. In
    reality it is called either with address OR with a device. The
    codepath inside is completely different, so lets separate it into two
    calls for these two cases.

    Signed-off-by: Denis V. Lunev
    Signed-off-by: David S. Miller

    Denis V. Lunev
     

29 Jan, 2008

13 commits


07 Nov, 2007

1 commit