1. 06 5月, 2019 1 次提交
  2. 01 5月, 2019 5 次提交
  3. 26 2月, 2019 1 次提交
    • W
      net: dsa: fix a leaked reference by adding missing of_node_put · 9919a363
      Wen Yang 提交于
      The call to of_parse_phandle returns a node pointer with refcount
      incremented thus it must be explicitly decremented after the last
      usage.
      
      Detected by coccinelle with the following warnings:
      ./net/dsa/port.c:294:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 284, but without a corresponding object release within this function.
      ./net/dsa/dsa2.c:627:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 618, but without a corresponding object release within this function.
      ./net/dsa/dsa2.c:630:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 618, but without a corresponding object release within this function.
      ./net/dsa/dsa2.c:636:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 618, but without a corresponding object release within this function.
      ./net/dsa/dsa2.c:639:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 618, but without a corresponding object release within this function.
      Signed-off-by: NWen Yang <wen.yang99@zte.com.cn>
      Reviewed-by: NVivien Didelot <vivien.didelot@gmail.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: netdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9919a363
  4. 25 2月, 2019 1 次提交
  5. 23 2月, 2019 1 次提交
    • F
      net: dsa: Add ndo_vlan_rx_{add, kill}_vid implementation · 061f6a50
      Florian Fainelli 提交于
      In order to properly support VLAN filtering being enabled/disabled on a
      bridge, while having other ports being non bridge port members, we need
      to support the ndo_vlan_rx_{add,kill}_vid callbacks in order to make
      sure the non-bridge ports can continue receiving VLAN tags, even when
      the switch is globally configured to do ingress/egress VID checking.
      
      Since we can call dsa_port_vlan_{add,del} with a bridge_dev pointer
      NULL, we now need to check that in these two functions.
      
      We specifically deal with two possibly problematic cases:
      
      - creating a bridge VLAN entry while there is an existing VLAN device
        claiming that same VID
      
      - creating a VLAN device while there is an existing bridge VLAN entry
        with that VID
      
      Those are both resolved with returning -EBUSY back to user-space.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      061f6a50
  6. 22 2月, 2019 3 次提交
    • F
      net: dsa: Add setter for SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS · ea87005a
      Florian Fainelli 提交于
      In preparation for removing SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT,
      add support for a function that processes the
      SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS and
      SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS attributes and returns not
      supported for any flag set, since DSA does not currently support
      toggling those bridge port attributes (yet).
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ea87005a
    • R
      net: dsa: enable flooding for bridge ports · c1388063
      Russell King 提交于
      Switches work by learning the MAC address for each attached station by
      monitoring traffic from each station.  When a station sends a packet,
      the switch records which port the MAC address is connected to.
      
      With IPv4 networking, before communication commences with a neighbour,
      an ARP packet is broadcasted to all stations asking for the MAC address
      corresponding with the IPv4.  The desired station responds with an ARP
      reply, and the ARP reply causes the switch to learn which port the
      station is connected to.
      
      With IPv6 networking, the situation is rather different.  Rather than
      broadcasting ARP packets, a "neighbour solicitation" is multicasted
      rather than broadcasted.  This multicast needs to reach the intended
      station in order for the neighbour to be discovered.
      
      Once a neighbour has been discovered, and entered into the sending
      stations neighbour cache, communication can restart at a point later
      without sending a new neighbour solicitation, even if the entry in
      the neighbour cache is marked as stale.  This can be after the MAC
      address has expired from the forwarding cache of the DSA switch -
      when that occurs, there is a long pause in communication.
      
      Our DSA implementation for mv88e6xxx switches disables flooding of
      multicast and unicast frames for bridged ports.  As per the above
      description, this is fine for IPv4 networking, since the broadcasted
      ARP queries will be sent to and received by all stations on the same
      network.  However, this breaks IPv6 very badly - blocking neighbour
      solicitations and later causing connections to stall.
      
      The defaults that the Linux bridge code expect from bridges are for
      unknown unicast and unknown multicast frames to be flooded to all ports
      on the bridge, which is at odds to the defaults adopted by our DSA
      implementation for mv88e6xxx switches.
      
      This commit enables by default flooding of both unknown unicast and
      unknown multicast frames whenever a port is added to a bridge, and
      disables the flooding when a port leaves the bridge.  This means that
      mv88e6xxx DSA switches now behave as per the bridge(8) man page, and
      IPv6 works flawlessly through such a switch.
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: NVivien Didelot <vivien.didelot@gmail.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c1388063
    • R
      net: dsa: add support for bridge flags · 57652796
      Russell King 提交于
      The Linux bridge implementation allows various properties of the bridge
      to be controlled, such as flooding unknown unicast and multicast frames.
      This patch adds the necessary DSA infrastructure to allow the Linux
      bridge support to control these properties for DSA switches.
      Reviewed-by: NVivien Didelot <vivien.didelot@gmail.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      [florian: Add missing dp and ds variables declaration to fix build]
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      57652796
  7. 21 2月, 2019 1 次提交
    • R
      net: dsa: fix unintended change of bridge interface STP state · 9c2054a5
      Russell King 提交于
      When a DSA port is added to a bridge and brought up, the resulting STP
      state programmed into the hardware depends on the order that these
      operations are performed.  However, the Linux bridge code believes that
      the port is in disabled mode.
      
      If the DSA port is first added to a bridge and then brought up, it will
      be in blocking mode.  If it is brought up and then added to the bridge,
      it will be in disabled mode.
      
      This difference is caused by DSA always setting the STP mode in
      dsa_port_enable() whether or not this port is part of a bridge.  Since
      bridge always sets the STP state when the port is added, brought up or
      taken down, it is unnecessary for us to manipulate the STP state.
      
      Apparently, this code was copied from Rocker, and the very next day a
      similar fix for Rocker was merged but was not propagated to DSA.  See
      e47172ab ("rocker: put port in FORWADING state after leaving bridge")
      
      Fixes: b73adef6 ("net: dsa: integrate with SWITCHDEV for HW bridging")
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NVivien Didelot <vivien.didelot@gmail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c2054a5
  8. 24 11月, 2018 1 次提交
  9. 01 6月, 2018 1 次提交
  10. 27 4月, 2018 2 次提交
  11. 24 1月, 2018 1 次提交
  12. 10 11月, 2017 2 次提交
  13. 28 10月, 2017 1 次提交
  14. 26 9月, 2017 1 次提交
  15. 22 9月, 2017 1 次提交
  16. 08 8月, 2017 5 次提交
  17. 25 5月, 2017 1 次提交
    • V
      net: dsa: support cross-chip ageing time · 64dba236
      Vivien Didelot 提交于
      Now that the switchdev bridge ageing time attribute is propagated to all
      switch chips of the fabric, each switch can check if the requested value
      is valid and program itself, so that the whole fabric shares a common
      ageing time setting.
      
      This is especially needed for switch chips in between others, containing
      no bridge port members but evidently used in the data path.
      
      To achieve that, remove the condition which skips the other switches. We
      also don't need to identify the target switch anymore, thus remove the
      sw_index member of the dsa_notifier_ageing_time_info notifier structure.
      
      On ZII Dev Rev B (with two 88E6352 and one 88E6185) and ZII Dev Rev C
      (with two 88E6390X), we have the following hardware configuration:
      
          # ip link add name br0 type bridge
          # ip link set master br0 dev lan6
          br0: port 1(lan6) entered blocking state
          br0: port 1(lan6) entered disabled state
          # echo 2000 > /sys/class/net/br0/bridge/ageing_time
      
      Before this patch:
      
          zii-rev-b# cat /sys/kernel/debug/mv88e6xxx/sw*/age_time
          300000
          300000
          15000
      
          zii-rev-c# cat /sys/kernel/debug/mv88e6xxx/sw*/age_time
          300000
          18750
      
      After this patch:
      
          zii-rev-b# cat /sys/kernel/debug/mv88e6xxx/sw*/age_time
          15000
          15000
          15000
      
          zii-rev-c# cat /sys/kernel/debug/mv88e6xxx/sw*/age_time
          18750
          18750
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      64dba236
  18. 23 5月, 2017 11 次提交