1. 12 3月, 2020 1 次提交
    • A
      net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed · a20f9970
      Andrew Lunn 提交于
      By default, DSA drivers should configure CPU and DSA ports to their
      maximum speed. In many configurations this is sufficient to make the
      link work.
      
      In some cases it is necessary to configure the link to run slower,
      e.g. because of limitations of the SoC it is connected to. Or back to
      back PHYs are used and the PHY needs to be driven in order to
      establish link. In this case, phylink is used.
      
      Only instantiate phylink if it is required. If there is no PHY, or no
      fixed link properties, phylink can upset a link which works in the
      default configuration.
      
      Fixes: 0e279218 ("net: dsa: Use PHYLINK for the CPU/DSA ports")
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a20f9970
  2. 04 3月, 2020 1 次提交
  3. 06 1月, 2020 1 次提交
  4. 18 12月, 2019 1 次提交
  5. 24 11月, 2019 1 次提交
  6. 05 11月, 2019 1 次提交
    • A
      net: of_get_phy_mode: Change API to solve int/unit warnings · 0c65b2b9
      Andrew Lunn 提交于
      Before this change of_get_phy_mode() returned an enum,
      phy_interface_t. On error, -ENODEV etc, is returned. If the result of
      the function is stored in a variable of type phy_interface_t, and the
      compiler has decided to represent this as an unsigned int, comparision
      with -ENODEV etc, is a signed vs unsigned comparision.
      
      Fix this problem by changing the API. Make the function return an
      error, or 0 on success, and pass a pointer, of type phy_interface_t,
      where the phy mode should be stored.
      
      v2:
      Return with *interface set to PHY_INTERFACE_MODE_NA on error.
      Add error checks to all users of of_get_phy_mode()
      Fixup a few reverse christmas tree errors
      Fixup a few slightly malformed reverse christmas trees
      
      v3:
      Fix 0-day reported errors.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c65b2b9
  7. 28 8月, 2019 2 次提交
  8. 18 8月, 2019 1 次提交
  9. 10 7月, 2019 1 次提交
  10. 15 6月, 2019 1 次提交
  11. 13 6月, 2019 1 次提交
  12. 31 5月, 2019 1 次提交
  13. 30 5月, 2019 2 次提交
  14. 06 5月, 2019 1 次提交
  15. 01 5月, 2019 5 次提交
  16. 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
  17. 25 2月, 2019 1 次提交
  18. 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
  19. 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
  20. 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
  21. 24 11月, 2018 1 次提交
  22. 01 6月, 2018 1 次提交
  23. 27 4月, 2018 2 次提交
  24. 24 1月, 2018 1 次提交
  25. 10 11月, 2017 2 次提交
  26. 28 10月, 2017 1 次提交
  27. 26 9月, 2017 1 次提交
  28. 22 9月, 2017 1 次提交
  29. 08 8月, 2017 2 次提交