19 Oct, 2011

1 commit

  • Need to cleanup bridge device timers and ports when being bridge
    device is being removed via netlink.

    This fixes the problem of observed when doing:
    ip link add br0 type bridge
    ip link set dev eth1 master br0
    ip link set br0 up
    ip link del br0

    which would cause br0 to hang in unregister_netdev because
    of leftover reference count.

    Reported-by: Sridhar Samudrala
    Signed-off-by: Stephen Hemminger
    Acked-by: Sridhar Samudrala
    Signed-off-by: David S. Miller

    stephen hemminger
     

07 Oct, 2011

1 commit

  • This resolves a regression seen by some users of bridging.
    Some users use the bridge like a dummy device.
    They expect to be able to put an IPv6 address on the device
    with no ports attached. Although there are better ways of doing
    this, there is no reason to not allow it.

    Note: the bridge still will reflect the state of ports in the
    bridge if there are any added.

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

    stephen hemminger
     

31 Aug, 2011

1 commit


25 Aug, 2011

2 commits


23 Aug, 2011

1 commit

  • Jan Beulich reported a possible net_device leak in bridge code after
    commit bb900b27a2f4 (bridge: allow creating bridge devices with netlink)

    Reported-by: Jan Beulich
    Signed-off-by: Eric Dumazet
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Eric Dumazet
     

11 Aug, 2011

1 commit


10 Aug, 2011

1 commit

  • This ensures the neighbor entries associated with the bridge
    dev are flushed, also invalidating the associated cached L2 headers.

    This means we br_add_if/br_del_if ports to implement hand-over and
    not wind up with bridge packets going out with stale MAC.

    This means we can also change MAC of port device and also not wind
    up with bridge packets going out with stale MAC.

    This builds on Stephen Hemminger's patch, also handling the br_del_if
    case and the port MAC change case.

    Cc: Stephen Hemminger
    Signed-off-by: Andrei Warkentin
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Andrei Warkentin
     

29 Jul, 2011

1 commit


27 Jul, 2011

1 commit

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

    Signed-off-by: Arun Sharma
    Reviewed-by: Eric Dumazet
    Cc: Ingo Molnar
    Cc: David Miller
    Cc: Eric Dumazet
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun Sharma
     

26 Jul, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
    fs: Merge split strings
    treewide: fix potentially dangerous trailing ';' in #defined values/expressions
    uwb: Fix misspelling of neighbourhood in comment
    net, netfilter: Remove redundant goto in ebt_ulog_packet
    trivial: don't touch files that are removed in the staging tree
    lib/vsprintf: replace link to Draft by final RFC number
    doc: Kconfig: `to be' -> `be'
    doc: Kconfig: Typo: square -> squared
    doc: Konfig: Documentation/power/{pm => apm-acpi}.txt
    drivers/net: static should be at beginning of declaration
    drivers/media: static should be at beginning of declaration
    drivers/i2c: static should be at beginning of declaration
    XTENSA: static should be at beginning of declaration
    SH: static should be at beginning of declaration
    MIPS: static should be at beginning of declaration
    ARM: static should be at beginning of declaration
    rcu: treewide: Do not use rcu_read_lock_held when calling rcu_dereference_check
    Update my e-mail address
    PCIe ASPM: forcedly -> forcibly
    gma500: push through device driver tree
    ...

    Fix up trivial conflicts:
    - arch/arm/mach-ep93xx/dma-m2p.c (deleted)
    - drivers/gpio/gpio-ep93xx.c (renamed and context nearby)
    - drivers/net/r8169.c (just context changes)

    Linus Torvalds
     

23 Jul, 2011

5 commits

  • Some minor cleanups that won't impact code:
    1. Remove inline from non-critical functions; compiler will most
    likely inline them anyway.
    2. Make function args const where possible.
    3. Whitespace cleanup

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

    stephen hemminger
     
  • When STP changes state of interface need to send a new link
    message to reflect that change.

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

    stephen hemminger
     
  • If a new device is added to a bridge, the ethernet address of the
    bridge network device may change. When the address changes, the
    appropriate callback is called, but with the wrong device argument.
    The address of the bridge device (ie br0) changes not the address
    of the device being passed to add_if (ie eth0).

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

    stephen hemminger
     
  • If the message_age is already greater than the max_age, then the
    BPDU is bogus. Linux won't generate BPDU, but conformance tester
    or buggy implementation might.

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

    stephen hemminger
     
  • A bridge topology with three systems:

    +------+ +------+
    | A(2) |--| B(1) |
    +------+ +------+
    \ /
    +------+
    | C(3) |
    +------+

    What is supposed to happen:
    * bridge with the lowest ID is elected root (for example: B)
    * C detects that A->C is higher cost path and puts in blocking state

    What happens. Bridge with lowest id (B) is elected correctly as
    root and things start out fine initially. But then config BPDU
    doesn't get transmitted from A -> C. Because of that
    the link from A-C is transistioned to the forwarding state.

    The root cause of this is that the configuration messages
    is generated with bogus message age, and dropped before
    sending.

    In the standardmessage_age is supposed to be:
    the time since the generation of the Configuration BPDU by
    the Root that instigated the generation of this Configuration BPDU.

    Reimplement this by recording the timestamp (age + jiffies) when
    recording config information. The old code incorrectly used the time
    elapsed on the ageing timer which was incorrect.

    See also:
    https://bugzilla.vyatta.com/show_bug.cgi?id=7164

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

    stephen hemminger
     

21 Jul, 2011

1 commit


18 Jul, 2011

3 commits


14 Jul, 2011

1 commit

  • Now that there is a one-to-one correspondance between neighbour
    and hh_cache entries, we no longer need:

    1) dynamic allocation
    2) attachment to dst->hh
    3) refcounting

    Initialization of the hh_cache entry is indicated by hh_len
    being non-zero, and such initialization is always done with
    the neighbour's lock held as a writer.

    Signed-off-by: David S. Miller

    David S. Miller
     

06 Jul, 2011

2 commits


25 Jun, 2011

1 commit

  • The bridge currently floods packets to groups that we have never
    seen before to all ports. This is not required by RFC4541 and
    in fact it is not desirable in environment where traffic to
    unregistered group is always present.

    This patch changes the behaviour so that we only send traffic
    to unregistered groups to ports marked as routers.

    The user can always force flooding behaviour to any given port
    by marking it as a router.

    Note that this change does not apply to traffic to 224.0.0.X
    as traffic to those groups must always be flooded to all ports.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

21 Jun, 2011

1 commit


20 Jun, 2011

1 commit


17 Jun, 2011

2 commits

  • Upon reception of a MGM report packet the kernel sets the mrouters_only flag
    in a skb that is a clone of the original skb, which means that the bridge
    loses track of MGM packets (cb buffers are tied to a specific skb and not
    shared) and it ends up forwading join requests to the bridge interface.

    This can cause unexpected membership timeouts and intermitent/permanent loss
    of connectivity as described in RFC 4541 [2.1.1. IGMP Forwarding Rules]:

    A snooping switch should forward IGMP Membership Reports only to
    those ports where multicast routers are attached.
    [...]
    Sending membership reports to other hosts can result, for IGMPv1
    and IGMPv2, in unintentionally preventing a host from joining a
    specific multicast group.

    Signed-off-by: Fernando Luis Vazquez Cao
    Signed-off-by: David S. Miller

    Fernando Luis Vázquez Cao
     
  • Upon reception of a IGMP/IGMPv2 membership report the kernel sets the
    mrouters_only flag in a skb that may be a clone of the original skb, which
    means that sometimes the bridge loses track of membership report packets (cb
    buffers are tied to a specific skb and not shared) and it ends up forwading
    join requests to the bridge interface.

    This can cause unexpected membership timeouts and intermitent/permanent loss
    of connectivity as described in RFC 4541 [2.1.1. IGMP Forwarding Rules]:

    A snooping switch should forward IGMP Membership Reports only to
    those ports where multicast routers are attached.
    [...]
    Sending membership reports to other hosts can result, for IGMPv1
    and IGMPv2, in unintentionally preventing a host from joining a
    specific multicast group.

    Signed-off-by: Fernando Luis Vazquez Cao
    Tested-by: Hayato Kakuta
    Signed-off-by: David S. Miller

    Fernando Luis Vázquez Cao
     

10 Jun, 2011

1 commit

  • The message size allocated for rtnl ifinfo dumps was limited to
    a single page. This is not enough for additional interface info
    available with devices that support SR-IOV and caused a bug in
    which VF info would not be displayed if more than approximately
    40 VFs were created per interface.

    Implement a new function pointer for the rtnl_register service that will
    calculate the amount of data required for the ifinfo dump and allocate
    enough data to satisfy the request.

    Signed-off-by: Greg Rose
    Signed-off-by: Jeff Kirsher

    Greg Rose
     

07 Jun, 2011

1 commit

  • Like in commit 0972ddb237 (provide cow_metrics() methods to blackhole
    dst_ops), we must provide a cow_metrics for bridges fake_dst_ops as
    well.

    This fixes a regression coming from commits 62fa8a846d7d (net: Implement
    read-only protection and COW'ing of metrics.) and 33eb9873a28 (bridge:
    initialize fake_rtable metrics)

    ip link set mybridge mtu 1234
    -->
    [ 136.546243] Pid: 8415, comm: ip Tainted: P
    2.6.39.1-00006-g40545b7 #103 ASUSTeK Computer Inc. V1Sn
    /V1Sn
    [ 136.546256] EIP: 0060:[] EFLAGS: 00010202 CPU: 0
    [ 136.546268] EIP is at 0x0
    [ 136.546273] EAX: f14a389c EBX: 000005d4 ECX: f80d32c0 EDX: f80d1da1
    [ 136.546279] ESI: f14a3000 EDI: f255bf10 EBP: f15c3b54 ESP: f15c3b48
    [ 136.546285] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    [ 136.546293] Process ip (pid: 8415, ti=f15c2000 task=f4741f80
    task.ti=f15c2000)
    [ 136.546297] Stack:
    [ 136.546301] f80c658f f14a3000 ffffffed f15c3b64 c12cb9c8 f80d1b80
    ffffffa1 f15c3bbc
    [ 136.546315] c12da347 c12d9c7d 00000000 f7670b00 00000000 f80d1b80
    ffffffa6 f15c3be4
    [ 136.546329] 00000004 f14a3000 f255bf20 00000008 f15c3bbc c11d6cae
    00000000 00000000
    [ 136.546343] Call Trace:
    [ 136.546359] [] ? br_change_mtu+0x5f/0x80 [bridge]
    [ 136.546372] [] dev_set_mtu+0x38/0x80
    [ 136.546381] [] do_setlink+0x1a7/0x860
    [ 136.546390] [] ? rtnl_fill_ifinfo+0x9bd/0xc70
    [ 136.546400] [] ? nla_parse+0x6e/0xb0
    [ 136.546409] [] rtnl_newlink+0x361/0x510
    [ 136.546420] [] ? vmalloc_sync_all+0x100/0x100
    [ 136.546429] [] ? error_code+0x5a/0x60
    [ 136.546438] [] ? rtnl_configure_link+0x80/0x80
    [ 136.546446] [] rtnetlink_rcv_msg+0xfa/0x210
    [ 136.546454] [] ? __rtnl_unlock+0x20/0x20
    [ 136.546463] [] netlink_rcv_skb+0x8e/0xb0
    [ 136.546471] [] rtnetlink_rcv+0x1c/0x30
    [ 136.546479] [] netlink_unicast+0x23a/0x280
    [ 136.546487] [] netlink_sendmsg+0x26b/0x2f0
    [ 136.546497] [] sock_sendmsg+0xc8/0x100
    [ 136.546508] [] ? __alloc_pages_nodemask+0xe1/0x750
    [ 136.546517] [] ? _copy_from_user+0x42/0x60
    [ 136.546525] [] ? verify_iovec+0x4c/0xc0
    [ 136.546534] [] sys_sendmsg+0x1c5/0x200
    [ 136.546542] [] ? __do_fault+0x310/0x410
    [ 136.546549] [] ? do_wp_page+0x1d6/0x6b0
    [ 136.546557] [] ? handle_pte_fault+0xe1/0x720
    [ 136.546565] [] ? sys_getsockname+0x7f/0x90
    [ 136.546574] [] ? handle_mm_fault+0xb1/0x180
    [ 136.546582] [] ? vmalloc_sync_all+0x100/0x100
    [ 136.546589] [] ? do_page_fault+0x173/0x3d0
    [ 136.546596] [] ? sys_recvmsg+0x3b/0x60
    [ 136.546605] [] sys_socketcall+0x293/0x2d0
    [ 136.546614] [] sysenter_do_call+0x12/0x26
    [ 136.546619] Code: Bad EIP value.
    [ 136.546627] EIP: [] 0x0 SS:ESP 0068:f15c3b48
    [ 136.546645] CR2: 0000000000000000
    [ 136.546652] ---[ end trace 6909b560e78934fa ]---

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

    Alexander Holler
     

28 May, 2011

1 commit


27 May, 2011

1 commit


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