02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

24 Aug, 2017

1 commit

  • Now when ipv4 route inserts a fib_info, it memcmp fib_metrics.
    It means ipv4 route identifies one route also with metrics.

    But when removing a route, it tries to find the route without
    caring about the metrics. It will cause that the route with
    right metrics can't be removed.

    Thomas noticed this issue when doing the testing:

    1. add:
    # ip route append 192.168.7.0/24 dev v window 1000
    # ip route append 192.168.7.0/24 dev v window 1001
    # ip route append 192.168.7.0/24 dev v window 1002
    # ip route append 192.168.7.0/24 dev v window 1003
    2. delete:
    # ip route delete 192.168.7.0/24 dev v window 1002
    3. show:
    192.168.7.0/24 proto boot scope link window 1001
    192.168.7.0/24 proto boot scope link window 1002
    192.168.7.0/24 proto boot scope link window 1003

    The one with window 1002 wasn't deleted but the first one was.

    This patch is to do metrics match when looking up and deleting
    one route.

    Reported-by: Thomas Haller
    Signed-off-by: Xin Long
    Acked-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Xin Long
     

30 May, 2017

1 commit

  • Pass extack arg down to lwtunnel_build_state and the build_state callbacks.
    Add messages for failures in lwtunnel_build_state, and add the extarg to
    nla_parse where possible in the build_state callbacks.

    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     

23 May, 2017

1 commit


25 Jul, 2015

1 commit

  • fib_select_default considers alternative routes only when
    res->fi is for the first alias in res->fa_head. In the
    common case this can happen only when the initial lookup
    matches the first alias with highest TOS value. This
    prevents the alternative routes to require specific TOS.

    This patch solves the problem as follows:

    - routes that require specific TOS should be returned by
    fib_select_default only when TOS matches, as already done
    in fib_table_lookup. This rule implies that depending on the
    TOS we can have many different lists of alternative gateways
    and we have to keep the last used gateway (fa_default) in first
    alias for the TOS instead of using single tb_default value.

    - as the aliases are ordered by many keys (TOS desc,
    fib_priority asc), we restrict the possible results to
    routes with matching TOS and lowest metric (fib_priority)
    and routes that match any TOS, again with lowest metric.

    For example, packet with TOS 8 can not use gw3 (not lowest
    metric), gw4 (different TOS) and gw6 (not lowest metric),
    all other gateways can be used:

    tos 8 via gw1 metric 2 fa_head and res->fi
    tos 8 via gw2 metric 2
    tos 8 via gw3 metric 3
    tos 4 via gw4
    tos 0 via gw5
    tos 0 via gw6 metric 1

    Reported-by: Hagen Paul Pfeifer
    Signed-off-by: Julian Anastasov
    Signed-off-by: David S. Miller

    Julian Anastasov
     

12 Mar, 2015

1 commit

  • This patch is meant to collapse local and main into one by converting
    tb_data from an array to a pointer. Doing this allows us to point the
    local table into the main while maintaining the same variables in the
    table.

    As such the tb_data was converted from an array to a pointer, and a new
    array called data is added in order to still provide an object for tb_data
    to point to.

    In order to track the origin of the fib aliases a tb_id value was added in
    a hole that existed on 64b systems. Using this we can also reverse the
    merge in the event that custom FIB rules are enabled.

    With this patch I am seeing an improvement of 20ns to 30ns for routing
    lookups as long as custom rules are not enabled, with custom rules enabled
    we fall back to split tables and the original behavior.

    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Alexander Duyck
     

28 Feb, 2015

2 commits

  • Make use of an empty spot in the alias to store the suffix length so that
    we don't need to pull that information from the leaf_info structure.

    This patch also makes a slight change to the user statistics. Instead of
    incrementing semantic_match_miss once per leaf_info miss we now just
    increment it once per leaf if a match was not found.

    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Alexander Duyck
     
  • There isn't any advantage to having it as a list and by making it an hlist
    we make the fib_alias more compatible with the list_info in terms of the
    type of list used.

    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Alexander Duyck
     

26 Jan, 2015

1 commit


29 Dec, 2013

1 commit


20 Oct, 2013

1 commit

  • There are a mix of function prototypes with and without extern
    in the kernel sources. Standardize on not using extern for
    function prototypes.

    Function prototypes don't need to be written with extern.
    extern is assumed by the compiler. Its use is as unnecessary as
    using auto to declare automatic/local variables in a block.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

19 Oct, 2013

1 commit


25 Mar, 2011

1 commit


13 Mar, 2011

1 commit


08 Mar, 2011

1 commit


01 Feb, 2011

1 commit


05 Nov, 2010

1 commit


21 Oct, 2010

1 commit


18 Oct, 2010

1 commit

  • Get rid of fib_hash_lock rwlock.

    The fn_zone hash table resize is the noticeable part of this patch.

    I added a seqlock per fn_zone, so that readers can restart their lookup
    in the (very rare) case a writer expanded the hash table.

    Add rcu heads in fib_alias and fib_node, use call_rcu() to defer their
    freeing, and use appropriate _rcu list manipulations.

    Stress test (160.000.000 udp frames sent, IP route cache disabled to
    mimic DDOS attack, FIB_HASH)

    Before:
    real 0m41.191s
    user 0m13.137s
    sys 8m55.241s

    After:
    real 0m38.091s
    user 0m13.189s
    sys 7m53.018s

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

    Eric Dumazet
     

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
     

19 May, 2009

1 commit


29 Jan, 2008

3 commits

  • Currently, sizeof(struct fib_alias) is 24 or 48 bytes on 32/64 bits
    arches.

    Because of SLAB_HWCACHE_ALIGN requirement, these are rounded to 32 and
    64 bytes respectively.

    This patch moves rcu to the end of fib_alias, and conditionally
    defines it only for CONFIG_IP_FIB_TRIE.

    We also remove SLAB_HWCACHE_ALIGN requirement for fib_alias and
    fib_node objects because it is not necessary.

    (BTW SLUB currently denies it for objects smaller than
    cache_line_size() / 2, but not SLAB)

    Finally, sizeof(fib_alias) go back to 16 and 32 bytes.

    Then, we can embed one fib_alias on each fib_node, to favor locality.
    Most of the time access to the fib_alias will be free because one
    cache line contains both the list head (fn_alias) and (one of) the
    list element.

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

    Eric Dumazet
     
  • Signed-off-by: Denis V. Lunev
    Acked-by: Alexey Kuznetsov
    Signed-off-by: David S. Miller

    Denis V. Lunev
     
  • ipv4: no need pass pointer to a default into fib_detect_death

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

    Denis V. Lunev
     

25 May, 2007

1 commit


29 Sep, 2006

2 commits


23 Sep, 2006

3 commits

  • Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • Introduces struct fib_config replacing the ugly struct kern_rta
    prone to ordering issues. Avoids creating faked netlink messages
    for auto generated routes or requests via ioctl.

    A new interface net/nexthop.h is added to help navigate through
    nexthop configuration arrays.

    A new struct nl_info will be used to carry the necessary netlink
    information to be used for notifications later on.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • Use u32 for routing table IDs in net/ipv4 and net/decnet in preparation of
    support for a larger number of routing tables. net/ipv6 already uses u32
    everywhere and needs no further changes. No functional changes are made by
    this patch.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

30 Aug, 2005

1 commit


19 Jun, 2005

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds