03 Feb, 2011

10 commits


02 Feb, 2011

11 commits


01 Feb, 2011

19 commits

  • None of the set types need uaccess.h since this is handled centrally
    in ip_set_core. Most set types additionally don't need bitops.h and
    spinlock.h since they use neither. tcp.h is only needed by those
    using before(), udp.h is not needed at all.

    Signed-off-by: Patrick McHardy

    Patrick McHardy
     
  • Replace calls of the form:

    nla_parse(tb, ATTR_MAX, nla_data(attr), nla_len(attr), policy)

    by:

    nla_parse_nested(tb, ATTR_MAX, attr, policy)

    Signed-off-by: Patrick McHardy

    Patrick McHardy
     
  • The patch adds the combined module of the "SET" target and "set" match
    to netfilter. Both the previous and the current revisions are supported.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the list:set type support in two flavours:
    without and with timeout. The sets has two sides: for the userspace,
    they store the names of other (non list:set type of) sets: one can add,
    delete and test set names. For the kernel, it forms an ordered union of
    the member sets: the members sets are tried in order when elements are
    added, deleted and tested and the process stops at the first success.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the hash:net,port type support in four flavours:
    for IPv4 and IPv6, both without and with timeout support. The elements
    are two dimensional: IPv4/IPv6 network address/prefix and protocol/port
    pairs.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the hash:net type support in four flavours:
    for IPv4 and IPv6, both without and with timeout support. The elements
    are one dimensional: IPv4/IPv6 network address/prefixes.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the hash:ip,port,net type support in four flavours:
    for IPv4 and IPv6, both without and with timeout support. The elements
    are three dimensional: IPv4/IPv6 address, protocol/port and IPv4/IPv6
    network address/prefix triples. The different prefixes are searched/matched
    from the longest prefix to the shortes one (most specific to least).
    In other words the processing time linearly grows with the number of
    different prefixes in the set.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the hash:ip,port,ip type support in four flavours:
    for IPv4 and IPv6, both without and with timeout support. The elements
    are three dimensional: IPv4/IPv6 address, protocol/port and IPv4/IPv6
    address triples.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the hash:ip,port type support in four flavours:
    for IPv4 and IPv6, both without and with timeout support. The elements
    are two dimensional: IPv4/IPv6 address and protocol/port pairs. The port
    is interpeted for TCP, UPD, ICMP and ICMPv6 (at the latters as type/code
    of course).

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the hash:ip type support in four flavours:
    for IPv4 or IPv6, both without and with timeout support.

    All the hash types are based on the "array hash" or ahash structure
    and functions as a good compromise between minimal memory footprint
    and speed. The hashing uses arrays to resolve clashes. The hash table
    is resized (doubled) when searching becomes too long. Resizing can be
    triggered by userspace add commands only and those are serialized by
    the nfnl mutex. During resizing the set is read-locked, so the only
    possible concurrent operations are the kernel side readers. Those are
    protected by RCU locking.

    Because of the four flavours and the other hash types, the functions
    are implemented in general forms in the ip_set_ahash.h header file
    and the real functions are generated before compiling by macro expansion.
    Thus the dereferencing of low-level functions and void pointer arguments
    could be avoided: the low-level functions are inlined, the function
    arguments are pointers of type-specific structures.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the bitmap:port type in two flavours, without
    and with timeout support to store TCP/UDP ports from a range.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the bitmap:ip,mac set type in two flavours,
    without and with timeout support. In this kind of set one can store
    IPv4 address and (source) MAC address pairs. The type supports elements
    added without the MAC part filled out: when the first matching from kernel
    happens, the MAC part is automatically filled out. The timing out of the
    elements stars when an element is complete in the IP,MAC pair.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the bitmap:ip set type in two flavours, without
    and with timeout support. In this kind of set one can store IPv4
    addresses (or network addresses) from a given range.

    In order not to waste memory, the timeout version does not rely on
    the kernel timer for every element to be timed out but on garbage
    collection. All set types use this mechanism.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The patch adds the IP set core support to the kernel.

    The IP set core implements a netlink (nfnetlink) based protocol by which
    one can create, destroy, flush, rename, swap, list, save, restore sets,
    and add, delete, test elements from userspace. For simplicity (and backward
    compatibilty and for not to force ip(6)tables to be linked with a netlink
    library) reasons a small getsockopt-based protocol is also kept in order
    to communicate with the ip(6)tables match and target.

    The netlink protocol passes all u16, etc values in network order with
    NLA_F_NET_BYTEORDER flag. The protocol enforces the proper use of the
    NLA_F_NESTED and NLA_F_NET_BYTEORDER flags.

    For other kernel subsystems (netfilter match and target) the API contains
    the functions to add, delete and test elements in sets and the required calls
    to get/put refereces to the sets before those operations can be performed.

    The set types (which are implemented in independent modules) are stored
    in a simple RCU protected list. A set type may have variants: for example
    without timeout or with timeout support, for IPv4 or for IPv6. The sets
    (i.e. the pointers to the sets) are stored in an array. The sets are
    identified by their index in the array, which makes possible easy and
    fast swapping of sets. The array is protected indirectly by the nfnl
    mutex from nfnetlink. The content of the sets are protected by the rwlock
    of the set.

    There are functional differences between the add/del/test functions
    for the kernel and userspace:

    - kernel add/del/test: works on the current packet (i.e. one element)
    - kernel test: may trigger an "add" operation in order to fill
    out unspecified parts of the element from the packet (like MAC address)
    - userspace add/del: works on the netlink message and thus possibly
    on multiple elements from the IPSET_ATTR_ADT container attribute.
    - userspace add: may trigger resizing of a set

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The patch adds the NFNL_SUBSYS_IPSET id and NLA_PUT_NET* macros to the
    vanilla kernel.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • Move all shared mem code to bnx2x to avoid code duplication. bnx2x now
    performs:

    - Read the FCoE and iSCSI max connection information.
    - Read the iSCSI and FCoE MACs from NPAR configuration in shmem.
    - Block the CNIC for the current function if there is neither FCoE nor
    iSCSI valid configuration by returning NULL from bnx2x_cnic_probe().

    Signed-off-by: Vladislav Zolotarov
    Signed-off-by: Eilon Greenstein
    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Vladislav Zolotarov
     
  • 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
     
  • David S. Miller