1. 01 11月, 2012 1 次提交
    • J
      net: create generic bridge ops · e5a55a89
      John Fastabend 提交于
      The PF_BRIDGE:RTM_{GET|SET}LINK nlmsg family and type are
      currently embedded in the ./net/bridge module. This prohibits
      them from being used by other bridging devices. One example
      of this being hardware that has embedded bridging components.
      
      In order to use these nlmsg types more generically this patch
      adds two net_device_ops hooks. One to set link bridge attributes
      and another to dump the current bride attributes.
      
      	ndo_bridge_setlink()
      	ndo_bridge_getlink()
      
      CC: Lennert Buytenhek <buytenh@wantstofly.org>
      CC: Stephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e5a55a89
  2. 02 10月, 2012 1 次提交
  3. 20 9月, 2012 1 次提交
  4. 15 8月, 2012 1 次提交
  5. 27 6月, 2012 1 次提交
  6. 16 4月, 2012 2 次提交
    • J
      net: add generic PF_BRIDGE:RTM_ FDB hooks · 77162022
      John Fastabend 提交于
      This adds two new flags NTF_MASTER and NTF_SELF that can
      now be used to specify where PF_BRIDGE netlink commands should
      be sent. NTF_MASTER sends the commands to the 'dev->master'
      device for parsing. Typically this will be the linux net/bridge,
      or open-vswitch devices. Also without any flags set the command
      will be handled by the master device as well so that current user
      space tools continue to work as expected.
      
      The NTF_SELF flag will push the PF_BRIDGE commands to the
      device. In the basic example below the commands are then parsed
      and programmed in the embedded bridge.
      
      Note if both NTF_SELF and NTF_MASTER bits are set then the
      command will be sent to both 'dev->master' and 'dev' this allows
      user space to easily keep the embedded bridge and software bridge
      in sync.
      
      There is a slight complication in the case with both flags set
      when an error occurs. To resolve this the rtnl handler clears
      the NTF_ flag in the netlink ack to indicate which sets completed
      successfully. The add/del handlers will abort as soon as any
      error occurs.
      
      To support this new net device ops were added to call into
      the device and the existing bridging code was refactored
      to use these. There should be no required changes in user space
      to support the current bridge behavior.
      
      A basic setup with a SR-IOV enabled NIC looks like this,
      
                veth0  veth2
                  |      |
                ------------
                |  bridge0 |   <---- software bridging
                ------------
                     /
                     /
        ethx.y      ethx
          VF         PF
           \         \          <---- propagate FDB entries to HW
           \         \
        --------------------
        |  Embedded Bridge |    <---- hardware offloaded switching
        --------------------
      
      In this case the embedded bridge must be managed to allow 'veth0'
      to communicate with 'ethx.y' correctly. At present drivers managing
      the embedded bridge either send frames onto the network which
      then get dropped by the switch OR the embedded bridge will flood
      these frames. With this patch we have a mechanism to manage the
      embedded bridge correctly from user space. This example is specific
      to SR-IOV but replacing the VF with another PF or dropping this
      into the DSA framework generates similar management issues.
      
      Examples session using the 'br'[1] tool to add, dump and then
      delete a mac address with a new "embedded" option and enabled
      ixgbe driver:
      
      # br fdb add 22:35:19:ac:60:59 dev eth3
      # br fdb
      port    mac addr                flags
      veth0   22:35:19:ac:60:58       static
      veth0   9a:5f:81:f7:f6:ec       local
      eth3    00:1b:21:55:23:59       local
      eth3    22:35:19:ac:60:59       static
      veth0   22:35:19:ac:60:57       static
      #br fdb add 22:35:19:ac:60:59 embedded dev eth3
      #br fdb
      port    mac addr                flags
      veth0   22:35:19:ac:60:58       static
      veth0   9a:5f:81:f7:f6:ec       local
      eth3    00:1b:21:55:23:59       local
      eth3    22:35:19:ac:60:59       static
      veth0   22:35:19:ac:60:57       static
      eth3    22:35:19:ac:60:59       local embedded
      #br fdb del 22:35:19:ac:60:59 embedded dev eth3
      
      I added a couple lines to 'br' to set the flags correctly is all. It
      is my opinion that the merit of this patch is now embedded and SW
      bridges can both be modeled correctly in user space using very nearly
      the same message passing.
      
      [1] 'br' tool was published as an RFC here and will be renamed 'bridge'
          http://patchwork.ozlabs.org/patch/117664/
      
      Thanks to Jamal Hadi Salim, Stephen Hemminger and Ben Hutchings for
      valuable feedback, suggestions, and review.
      
      v2: fixed api descriptions and error case with both NTF_SELF and
          NTF_MASTER set plus updated patch description.
      Signed-off-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      77162022
    • H
      bridge: Add multicast_querier toggle and disable queries by default · c5c23260
      Herbert Xu 提交于
      Sending general queries was implemented as an optimisation to speed
      up convergence on start-up.  In order to prevent interference with
      multicast routers a zero source address has to be used.
      
      Unfortunately these packets appear to cause some multicast-aware
      switches to misbehave, e.g., by disrupting multicast packets to us.
      
      Since the multicast snooping feature still functions without sending
      our own queries, this patch will change the default to not send
      queries.
      
      For those that need queries in order to speed up convergence on start-up,
      a toggle is provided to restore the previous behaviour.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c5c23260
  7. 11 4月, 2012 1 次提交
    • H
      bridge: Do not send queries on multicast group leaves · 996304bb
      Herbert Xu 提交于
      As it stands the bridge IGMP snooping system will respond to
      group leave messages with queries for remaining membership.
      This is both unnecessary and undesirable.  First of all any
      multicast routers present should be doing this rather than us.
      What's more the queries that we send may end up upsetting other
      multicast snooping swithces in the system that are buggy.
      
      In fact, we can simply remove the code that send these queries
      because the existing membership expiry mechanism doesn't rely
      on them anyway.
      
      So this patch simply removes all code associated with group
      queries in response to group leave messages.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      996304bb
  8. 17 12月, 2011 1 次提交
  9. 12 12月, 2011 1 次提交
  10. 09 12月, 2011 1 次提交
  11. 17 11月, 2011 1 次提交
  12. 19 10月, 2011 1 次提交
  13. 07 10月, 2011 1 次提交
    • S
      bridge: allow forwarding some link local frames · 515853cc
      stephen hemminger 提交于
      This is based on an earlier patch by Nick Carter with comments
      by David Lamparter but with some refinements. Thanks for their patience
      this is a confusing area with overlap of standards, user requirements,
      and compatibility with earlier releases.
      
      It adds a new sysfs attribute
         /sys/class/net/brX/bridge/group_fwd_mask
      that controls forwarding of frames with address of: 01-80-C2-00-00-0X
      The default setting has no forwarding to retain compatibility.
      
      One change from earlier releases is that forwarding of group
      addresses is not dependent on STP being enabled or disabled. This
      choice was made based on interpretation of tie 802.1 standards.
      I expect complaints will arise because of this, but better to follow
      the standard than continue acting incorrectly by default.
      
      The filtering mask is writeable, but only values that don't forward
      known control frames are allowed. It intentionally blocks attempts
      to filter control protocols. For example: writing a 8 allows
      forwarding 802.1X PAE addresses which is the most common request.
      Reported-by: NDavid Lamparter <equinox@diac24.net>
      Original-patch-by: NNick Carter <ncarter100@gmail.com>
      Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Tested-by: NBenjamin Poirier <benjamin.poirier@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      515853cc
  14. 23 7月, 2011 1 次提交
    • S
      bridge: send proper message_age in config BPDU · 0c03150e
      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=7164Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c03150e
  15. 29 4月, 2011 1 次提交
  16. 05 4月, 2011 4 次提交
  17. 28 3月, 2011 1 次提交
  18. 17 3月, 2011 1 次提交
  19. 12 2月, 2011 1 次提交
    • H
      bridge: Replace mp->mglist hlist with a bool · 8a870178
      Herbert Xu 提交于
      As it turns out we never need to walk through the list of multicast
      groups subscribed by the bridge interface itself (the only time we'd
      want to do that is when we shut down the bridge, in which case we
      simply walk through all multicast groups), we don't really need to
      keep an hlist for mp->mglist.
      
      This means that we can replace it with just a single bit to indicate
      whether the bridge interface is subscribed to a group.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a870178
  20. 25 1月, 2011 1 次提交
  21. 16 11月, 2010 3 次提交
  22. 02 7月, 2010 2 次提交
  23. 24 6月, 2010 1 次提交
  24. 16 6月, 2010 3 次提交
  25. 15 6月, 2010 1 次提交
    • P
      net: Make accesses to ->br_port safe for sparse RCU · 81bdf5bd
      Paul E. McKenney 提交于
      The new versions of the rcu_dereference() APIs requires that any pointers
      passed to one of these APIs be fully defined.  The ->br_port field
      in struct net_device points to a struct net_bridge_port, which is an
      incomplete type.  This commit therefore changes ->br_port to be a void*,
      and introduces a br_port() helper function to convert the type to struct
      net_bridge_port, and applies this new helper function where required.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: David Miller <davem@davemloft.net>
      Cc: Stephen Hemminger <shemminger@linux-foundation.org>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      81bdf5bd
  26. 02 6月, 2010 1 次提交
  27. 16 5月, 2010 3 次提交
  28. 06 5月, 2010 1 次提交
    • W
      bridge: make bridge support netpoll · c06ee961
      WANG Cong 提交于
      Based on the previous patch, make bridge support netpoll by:
      
      1) implement the 2 methods to support netpoll for bridge;
      
      2) modify netpoll during forwarding packets via bridge;
      
      3) disable netpoll support of bridge when a netpoll-unabled device
         is added to bridge;
      
      4) enable netpoll support when all underlying devices support netpoll.
      
      Cc: David Miller <davem@davemloft.net>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: Stephen Hemminger <shemminger@linux-foundation.org>
      Cc: Matt Mackall <mpm@selenic.com>
      Signed-off-by: NWANG Cong <amwang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c06ee961
  29. 23 4月, 2010 1 次提交