25 May, 2011

1 commit


23 May, 2011

2 commits

  • In the old days, we used to access dev->master in __netif_receive_skb()
    in a rcu_read_lock section.

    So one synchronize_net() call was needed in netdev_set_master() to make
    sure another cpu could not use old master while/after we release it.

    We now use netdev_rx_handler infrastructure and added one
    synchronize_net() call in bond_release()/bond_release_all()

    Remove the obsolete synchronize_net() from netdev_set_master() and add
    one in bridge del_nbp() after its netdev_rx_handler_unregister() call.

    This makes enslave -d a bit faster.

    Signed-off-by: Eric Dumazet
    CC: Jiri Pirko
    CC: Stephen Hemminger
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • In the previous patch I added NETDEV_JOIN, now
    we can notify netconsole when adding a device to a bridge too.

    Signed-off-by: WANG Cong
    Cc: Neil Horman
    Signed-off-by: David S. Miller

    Amerigo Wang
     

18 May, 2011

1 commit


14 May, 2011

1 commit

  • The commit 6b1e960fdbd75dcd9bcc3ba5ff8898ff1ad30b6e
    bridge: Reset IPCB when entering IP stack on NF_FORWARD
    broke forwarding of IPV6 packets in bridge because it would
    call bp_parse_ip_options with an IPV6 packet.

    Reported-by: Noah Meyerhans
    Signed-off-by: Stephen Hemminger
    Reviewed-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

12 May, 2011

1 commit


10 May, 2011

2 commits

  • The optimizations in commit 255d0dc34068a976
    (netfilter: x_table: speedup compat operations) assume that
    xt_compat_add_offset is called once per rule.

    ebtables however called it for each match/target found in a rule.

    The match/watcher/target parser already returns the needed delta, so it
    is sufficient to move the xt_compat_add_offset call to a more reasonable
    location.

    While at it, also get rid of the unused COMPAT iterator macros.

    Signed-off-by: Florian Westphal
    Signed-off-by: Patrick McHardy

    Florian Westphal
     
  • commit 255d0dc34068a976 (netfilter: x_table: speedup compat operations)
    made ebtables not working anymore.

    1) xt_compat_calc_jump() is not an exact match lookup
    2) compat_table_info() has a typo in xt_compat_init_offsets() call
    3) compat_do_replace() misses a xt_compat_init_offsets() call

    Reported-by: dann frazier
    Signed-off-by: Eric Dumazet
    Signed-off-by: Patrick McHardy

    Eric Dumazet
     

03 May, 2011

1 commit

  • Four years ago, Patrick made a change to hold rtnl mutex during netlink
    dump callbacks.

    I believe it was a wrong move. This slows down concurrent dumps, making
    good old /proc/net/ files faster than rtnetlink in some situations.

    This occurred to me because one "ip link show dev ..." was _very_ slow
    on a workload adding/removing network devices in background.

    All dump callbacks are able to use RCU locking now, so this patch does
    roughly a revert of commits :

    1c2d670f366 : [RTNETLINK]: Hold rtnl_mutex during netlink dump callbacks
    6313c1e0992 : [RTNETLINK]: Remove unnecessary locking in dump callbacks

    This let writers fight for rtnl mutex and readers going full speed.

    It also takes care of phonet : phonet_route_get() is now called from rcu
    read section. I renamed it to phonet_route_get_rcu()

    Signed-off-by: Eric Dumazet
    Cc: Patrick McHardy
    Cc: Remi Denis-Courmont
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Eric Dumazet
     

30 Apr, 2011

1 commit


29 Apr, 2011

1 commit


27 Apr, 2011

1 commit


23 Apr, 2011

1 commit


22 Apr, 2011

1 commit

  • This reverts commit 1e253c3b8a1aeed51eef6fc366812f219b97de65.

    It breaks 802.3ad bonding inside of a bridge.

    The commit was meant to support transport bridging, and specifically
    virtual machines bridged to an ethernet interface connected to a
    switch port wiht 802.1x enabled.

    But this isn't the way to do it, it breaks too many other things.

    Signed-off-by: David S. Miller

    David S. Miller
     

19 Apr, 2011

1 commit


18 Apr, 2011

1 commit


13 Apr, 2011

1 commit

  • Commit 462fb2af9788a82 (bridge : Sanitize skb before it enters the IP
    stack), missed one IPCB init before calling ip_options_compile()

    Thanks to Scot Doyle for his tests and bug reports.

    Reported-by: Scot Doyle
    Signed-off-by: Eric Dumazet
    Cc: Hiroaki SHIMODA
    Acked-by: Bandan Das
    Acked-by: Stephen Hemminger
    Cc: Jan Lübbe
    Signed-off-by: David S. Miller

    Eric Dumazet
     

12 Apr, 2011

1 commit


08 Apr, 2011

1 commit


05 Apr, 2011

7 commits

  • Apply restrictions on STP parameters based 802.1D 1998 standard.
    * Fixes missing locking in set path cost ioctl
    * Uses common code for both ioctl and sysfs

    This is based on an earlier patch Sasikanth V but with overhaul.

    Note:
    1. It does NOT enforce the restriction on the relationship max_age and
    forward delay or hello time because in existing implementation these are
    set as independant operations.

    2. If STP is disabled, there is no restriction on forward delay

    3. No restriction on holding time because users use Linux code to act
    as hub or be sticky.

    4. Although standard allow 0-255, Linux only allows 0-63 for port priority
    because more bits are reserved for port number.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • Add netlink device ops to allow creating bridge device via netlink.
    This works in a manner similar to vlan, macvlan and bonding.

    Example:
    # ip link add link dev br0 type bridge
    # ip link del dev br0

    The change required rearranging initializtion code to deal with
    being called by create link. Most of the initialization happens
    in br_dev_setup, but allocation of stats is done in ndo_init callback
    to deal with allocation failure. Sysfs setup has to wait until
    after the network device kobject is registered.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • Use RTM_NEWNEIGH and RTM_DELNEIGH to allow updating of entries
    in bridge forwarding table. This allows manipulating static entries
    which is not possible with existing tools.

    Example (using bridge extensions to iproute2)
    # br fdb add 00:02:03:04:05:06 dev eth0

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • This allows applications to query and monitor bridge forwarding
    table in the same method used for neighbor table. The forward table
    entries are returned in same structure format as used by the ioctl.
    If more information is desired in future, the netlink method is
    extensible.

    Example (using bridge extensions to iproute2)
    # br monitor

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • In some cases, look up of forward database entry is done with RCU;
    and for others no RCU is needed because of locking. Split the two
    cases into two differnt loops (and take off inline).

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • Adds tracking the last used time in forwarding table.
    Rename ageing_timer to updated to better describe it.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • Later patch provides ability to create non-local static entry.
    To make this easier move the updating of the flag values to
    after the code that creates entry.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     

31 Mar, 2011

1 commit


30 Mar, 2011

2 commits

  • "len = ntohs(ip6h->payload_len)" does not include the length of the ipv6
    header itself, which the rest of this function assumes, though.

    This leads to a length check less restrictive as it should be in the
    following line for one thing. For another, it very likely leads to an
    integer underrun when substracting the offset and therefore to a very
    high new value of 'len' due to its unsignedness. This will ultimately
    lead to the pskb_trim_rcsum() practically never being called, even in
    the cases where it should.

    Signed-off-by: Linus Lüssing
    Signed-off-by: David S. Miller

    Linus Lüssing
     
  • net/bridge/br_stp_if.c: In function ‘br_stp_recalculate_bridge_id’:
    net/bridge/br_stp_if.c:216:3: warning: ‘return’ with no value, in function returning non-void

    Signed-off-by: G.Balaji
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Balaji G
     

28 Mar, 2011

1 commit


23 Mar, 2011

1 commit

  • The ipv6_dev_get_saddr() is currently called with an uninitialized
    destination address. Although in tests it usually seemed to nevertheless
    always fetch the right source address, there seems to be a possible race
    condition.

    Therefore this commit changes this, first setting the destination
    address and only after that fetching the source address.

    Reported-by: Jan Beulich
    Signed-off-by: Linus Lüssing
    Signed-off-by: David S. Miller

    Linus Lüssing
     

19 Mar, 2011

1 commit

  • Whenever we enter the IP stack proper from bridge netfilter we
    need to ensure that the skb is in a form the IP stack expects
    it to be in.

    The entry point on NF_FORWARD did not meet the requirements of
    the IP stack, therefore leading to potential crashes/panics.

    This patch fixes the problem.

    Signed-off-by: Herbert Xu
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Herbert Xu
     

17 Mar, 2011

1 commit


16 Mar, 2011

1 commit


15 Mar, 2011

2 commits

  • If Spanning Tree Protocol is not enabled, there is no good reason for
    the bridge code to wait for the forwarding delay period before enabling
    the link. The purpose of the forwarding delay is to allow STP to
    learn about other bridges before nominating itself.

    The only possible impact is that when starting up a new port
    the bridge may flood a packet now, where previously it might have
    seen traffic from the other host and preseeded the forwarding table.

    Includes change for local variable br already available in that func.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • This makes the bridge device behave like a physical device.
    In earlier releases the bridge always asserted carrier. This
    changes the behavior so that bridge device carrier is on only
    if one or more ports are in the forwarding state. This
    should help IPv6 autoconfiguration, DHCP, and routing daemons.

    I did brief testing with Network and Virt manager and they
    seem fine, but since this changes behavior of bridge, it should
    wait until net-next (2.6.39).

    Signed-off-by: Stephen Hemminger
    Reviewed-by: Nicolas de Pesloüan
    Tested-By: Adam Majer
    Signed-off-by: David S. Miller

    stephen hemminger
     

13 Mar, 2011

1 commit


11 Mar, 2011

2 commits


04 Mar, 2011

1 commit