28 Dec, 2011

11 commits

  • Comment-only change to better explain why TIPC's configuration lock is
    temporarily released while activating support for network interfaces,
    and why the existing activation code doesn't require rework.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Permits run-time alteration of default link settings on a per-media
    and per-bearer basis, in addition to the existing per-link basis.
    The following syntax can now be used:

    tipc-config -lt=/
    tipc-config -lp=/
    tipc-config -lw=/

    Note that changes to the default settings for a given media type has
    no effect on the default settings used by existing bearers. Similarly,
    changes to default bearer settings has no effect on existing link
    endpoints that utilize that interface.

    Thanks to Florian Westphal for his contributions to
    the development of this enhancement.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Adds a check to ensure that TIPC ignores an incoming neighbor discovery
    message that specifies an invalid media address as its source. The check
    ensures that the source address is a valid, non-broadcast address that
    could legally be used by a neighboring link endpoint.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Reworks TIPC's media address data structure and associated processing
    routines to transfer all media-specific details of address conversion
    to the associated TIPC media adaptation code. TIPC's generic bearer code
    now only needs to know which media type an address is associated with
    and whether or not it is a broadcast address, and totally ignores the
    "value" field that contains the actual media-specific addressing info.

    These changes eliminate the need for a number of endianness conversion
    operations and will make it easier for TIPC to support new media types
    in the future.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Enhances TIPC's Ethernet media support to provide 3 new address conversion
    routines, which allow TIPC to interpret an address that is in string form
    and to convert an address to and from the 20 byte format used in TIPC's
    neighbor discovery messages.

    These routines are pre-requisites to a follow on commit that hides all
    media-specific addressing details from TIPC's generic bearer code.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Enhances conversion of a media address to printable form so that an
    unconvertable address will be displayed as a string of hex digits,
    rather than not being displayed at all. (Also removes a pointless check
    for the existence of the media-specific address conversion routine,
    since the routine is not optional.)

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Simplifies error handling performed during media registration, since
    TIPC no longer supports the dynamic addition of new media types that
    are potentially error-prone. These simplifications include the following:

    1) No longer check for premature registration of a new media type.
    2) No longer check for negative link priority values (which was pointless
    since such values are unsigned, and could cause a compiler warning).
    3) No longer generate a warning describing the exact cause of any
    registration failure (just warns that overall registration failed).

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Changes TIPC's list of registered media types from an array of media
    structures to an array of pointers to media structures. This eliminates
    the need to copy of the contents of the structure passed in during media
    registration.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Streamlines the detection of an attempt to register a TIPC media structure
    using an already registered name or type identifier. The revised logic now
    reuses an existing routine to detect an existing name and no longer
    unnecessarily manipulates the media type counter during an unsuccessful
    registration attempt.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Speeds up the registration of TIPC media types by passing in a structure
    containing the required information, rather than by passing in the various
    fields describing the media type individually.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Permits a Linux container to use TIPC sockets even when it has its own
    network namespace defined by removing the check that prohibits such use.
    This makes it possible for users who wish to isolate their container
    network traffic from normal network traffic to utilize TIPC.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     

27 Dec, 2011

5 commits

  • v2, based on Jay's review.

    I kept the 'link must be up' part, because this is enforced in the code.

    Signed-off-by: Nicolas de Pesloüan
    Signed-off-by: Jay Vosburgh
    cc: Andy Gospodarek
    Signed-off-by: David S. Miller

    Nicolas de Pesloüan
     
  • RDBG() wasn't even used, and the messages printed by RT6_DEBUG() were
    far from useful. Just get rid of all this stuff, we can replace it
    with something more suitable if we want.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Include linux/slab.h to fix below build error:

    CC drivers/net/ethernet/mellanox/mlx4/resource_tracker.o
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'mlx4_init_resource_tracker':
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:233: error: implicit declaration of function 'kzalloc'
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:234: warning: assignment makes pointer from integer without a cast
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'mlx4_free_resource_tracker':
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:264: error: implicit declaration of function 'kfree'
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'alloc_qp_tr':
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:370: warning: assignment makes pointer from integer without a cast
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'alloc_mtt_tr':
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:386: warning: assignment makes pointer from integer without a cast
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'alloc_mpt_tr':
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:402: warning: assignment makes pointer from integer without a cast
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'alloc_eq_tr':
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:417: warning: assignment makes pointer from integer without a cast
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'alloc_cq_tr':
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:431: warning: assignment makes pointer from integer without a cast
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'alloc_srq_tr':
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:446: warning: assignment makes pointer from integer without a cast
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'alloc_counter_tr':
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:461: warning: assignment makes pointer from integer without a cast
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'add_res_range':
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:521: warning: assignment makes pointer from integer without a cast
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'mac_add_to_slave':
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:1193: warning: assignment makes pointer from integer without a cast
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'add_mcg_res':
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:2521: warning: assignment makes pointer from integer without a cast
    make[5]: *** [drivers/net/ethernet/mellanox/mlx4/resource_tracker.o] Error 1
    make[4]: *** [drivers/net/ethernet/mellanox/mlx4] Error 2
    make[3]: *** [drivers/net/ethernet/mellanox] Error 2
    make[2]: *** [drivers/net/ethernet] Error 2
    make[1]: *** [drivers/net] Error 2
    make: *** [drivers] Error 2

    Signed-off-by: Axel Lin
    Signed-off-by: David S. Miller

    Axel Lin
     
  • Otherwise we leave uninitialized kernel memory in there.

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

    David S. Miller
     
  • The NLA_PUT macro should accept the actual attribute length, not
    the amount of elements in array :(

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

    Pavel Emelyanov
     

25 Dec, 2011

4 commits

  • David S. Miller
     
  • This patch adds the match that allows to perform extended
    accounting. It requires the new nfnetlink_acct infrastructure.

    # iptables -I INPUT -p tcp --sport 80 -m nfacct --nfacct-name http-traffic
    # iptables -I OUTPUT -p tcp --dport 80 -m nfacct --nfacct-name http-traffic

    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     
  • We currently have two ways to account traffic in netfilter:

    - iptables chain and rule counters:

    # iptables -L -n -v
    Chain INPUT (policy DROP 3 packets, 867 bytes)
    pkts bytes target prot opt in out source destination
    8 1104 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0

    - use flow-based accounting provided by ctnetlink:

    # conntrack -L
    tcp 6 431999 ESTABLISHED src=192.168.1.130 dst=212.106.219.168 sport=58152 dport=80 packets=47 bytes=7654 src=212.106.219.168 dst=192.168.1.130 sport=80 dport=58152 packets=49 bytes=66340 [ASSURED] mark=0 use=1

    While trying to display real-time accounting statistics, we require
    to pool the kernel periodically to obtain this information. This is
    OK if the number of flows is relatively low. However, in case that
    the number of flows is huge, we can spend a considerable amount of
    cycles to iterate over the list of flows that have been obtained.

    Moreover, if we want to obtain the sum of the flow accounting results
    that match some criteria, we have to iterate over the whole list of
    existing flows, look for matchings and update the counters.

    This patch adds the extended accounting infrastructure for
    nfnetlink which aims to allow displaying real-time traffic accounting
    without the need of complicated and resource-consuming implementation
    in user-space. Basically, this new infrastructure allows you to create
    accounting objects. One accounting object is composed of packet and
    byte counters.

    In order to manipulate create accounting objects, you require the
    new libnetfilter_acct library. It contains several examples of use:

    libnetfilter_acct/examples# ./nfacct-add http-traffic
    libnetfilter_acct/examples# ./nfacct-get
    http-traffic = { pkts = 000000000000, bytes = 000000000000 };

    Then, you can use one of this accounting objects in several iptables
    rules using the new nfacct match (which comes in a follow-up patch):

    # iptables -I INPUT -p tcp --sport 80 -m nfacct --nfacct-name http-traffic
    # iptables -I OUTPUT -p tcp --dport 80 -m nfacct --nfacct-name http-traffic

    The idea is simple: if one packet matches the rule, the nfacct match
    updates the counters.

    Thanks to Patrick McHardy, Eric Dumazet, Changli Gao for reviewing and
    providing feedback for this contribution.

    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     
  • Aim of this patch is to provide full range of rps_flow_cnt on 64bit arches.

    Theorical limit on number of flows is 2^32

    Fix some buggy RPS/RFS macros as well.

    Signed-off-by: Eric Dumazet
    CC: Tom Herbert
    CC: Xi Wang
    CC: Laurent Chavey
    Signed-off-by: David S. Miller

    Eric Dumazet
     

24 Dec, 2011

13 commits


23 Dec, 2011

7 commits