1. 21 Jun, 2023 40 commits
    • Christian Marangi's avatar
      leds: trigger: netdev: add additional specific link speed mode · d5e01266
      Christian Marangi authored
      Add additional modes for specific link speed. Use ethtool APIs to get the
      current link speed and enable the LED accordingly. Under netdev event
      handler the rtnl lock is already held and is not needed to be set to
      access ethtool APIs.
      
      This is especially useful for PHY and Switch that supports LEDs hw
      control for specific link speed. (example scenario a PHY that have 2 LED
      connected one green and one orange where the green is turned on with
      1000mbps speed and orange is turned on with 10mpbs speed)
      
      On mode set from sysfs we check if we have enabled split link speed mode
      and reject enabling generic link mode to prevent wrong and redundant
      configuration.
      
      Rework logic on the set baseline state to support these new modes to
      select if we need to turn on or off the LED.
      
      Add additional modes:
      - link_10: Turn on LED when link speed is 10mbps
      - link_100: Turn on LED when link speed is 100mbps
      - link_1000: Turn on LED when link speed is 1000mbps
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Acked-by: default avatarLee Jones <lee@kernel.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d5e01266
    • Ivan Vecera's avatar
      bnxt_en: Link representors to PCI device · 7ad7b702
      Ivan Vecera authored
      Link VF representors to parent PCI device to benefit from
      systemd defined naming scheme.
      
      Without this change the representor is visible as ethN.
      Signed-off-by: default avatarIvan Vecera <ivecera@redhat.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Reviewed-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Link: https://lore.kernel.org/r/20230620144855.288443-1-ivecera@redhat.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7ad7b702
    • Jakub Kicinski's avatar
      Merge branch 'selftests-preparations-for-out-of-order-operations-patches-in-mlxsw' · f31b6c64
      Jakub Kicinski authored
      Petr Machata says:
      
      ====================
      selftests: Preparations for out-of-order-operations patches in mlxsw
      
      The mlxsw driver currently makes the assumption that the user applies
      configuration in a bottom-up manner. Thus netdevices need to be added to
      the bridge before IP addresses are configured on that bridge or SVI added
      on top of it. Enslaving a netdevice to another netdevice that already has
      uppers is in fact forbidden by mlxsw for this reason. Despite this safety,
      it is rather easy to get into situations where the offloaded configuration
      is just plain wrong.
      
      Over the course of the following several patchsets, mlxsw code is going to
      be adjusted to diminish the space of wrongly offloaded configurations.
      Ideally the offload state will reflect the actual state, regardless of the
      sequence of operation used to construct that state.
      
      Several selftests build configurations that will not be offloadable in the
      future on some systems. The reason is that what will get offloaded is the
      actual configuration, not the configuration steps.
      
      For example, when a port is added to a bridge that has an IP address, that
      bridge will get a RIF, which it would not have with the current code. But
      on Nvidia Spectrum-1 machines, MAC addresses of all RIFs need to have the
      same prefix, which the bridge will violate. The RIF thus couldn't be
      created, and the enslavement is therefore canceled, because it would lead
      to an unoffloadable configuration. This breaks some selftests.
      
      In this patchset, adjust selftests to avoid the configurations that mlxsw
      would be incapable of offloading, while maintaining relevance with regards
      to the feature that is being tested. There are generally two cases of
      fixes:
      
      - Disabling IPv6 autogen on bridges that do not participate in routing,
        either because of the abovementioned requirement to keep the same MAC
        prefix on all in-HW router interfaces, or, on 802.1ad bridges, because
        in-HW router interfaces are not supported at all.
      
      - Setting the bridge MAC address to what it will become after the first
        member port is attached, so that the in-HW router interface is created
        with a supported MAC address.
      
      The patchset is then split thus:
      
      - Patches #1-#7 adjust generic selftests
      - Patches #8-#16 adjust mlxsw-specific selftests
      ====================
      
      Link: https://lore.kernel.org/r/cover.1687265905.git.petrm@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f31b6c64
    • Petr Machata's avatar
      selftests: mlxsw: one_armed_router: Use port MAC for bridge address · 664bc72d
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      At the time that the front panel port is enslaved to the bridge, the bridge
      MAC address does not have the same prefix as other interfaces in the
      system. On Nvidia Spectrum-1 machines all the RIFs have to have the same
      38-bit MAC address prefix. Since the bridge does not obey this limitation,
      the RIF cannot be created, and the enslavement attempt is vetoed on the
      grounds of the configuration not being offloadable.
      
      The bridge eventually inherits MAC address from its first member, after the
      enslavement is acked. A number of (mainly VXLAN) selftests already work
      around the problem by setting the MAC address to whatever it will
      eventually be anyway. Do the same for this selftest.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      664bc72d
    • Petr Machata's avatar
      selftests: mlxsw: vxlan: Disable IPv6 autogen on bridges · 55415775
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      At the time that the front panel port is enslaved to the bridge (this holds
      for all bridges used here), the bridge MAC address does not have the same
      prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all
      the RIFs have to have the same 38-bit MAC address prefix. Since the bridge
      does not obey this limitation, the RIF cannot be created, and the
      enslavement attempt is vetoed on the grounds of the configuration not being
      offloadable.
      
      The selftest itself however checks various aspects of VXLAN offloading and
      the bridges do not need to participate in routing traffic. The IP addresses
      or the RIFs are irrelevant.
      
      Fix by disabling automatic IPv6 address generation for the HW-offloaded
      bridges in this selftest, thus exempting them from mlxsw router attention.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      55415775
    • Petr Machata's avatar
      selftests: mlxsw: spectrum: q_in_vni_veto: Disable IPv6 autogen on a bridge · 08035d8e
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      At the time that the front panel port is enslaved to the bridge, the bridge
      MAC address does not have the same prefix as other interfaces in the
      system. On Nvidia Spectrum-1 machines all the RIFs have to have the same
      38-bit MAC address prefix. Since the bridge does not obey this limitation,
      the RIF cannot be created, and the enslavement attempt is vetoed on the
      grounds of the configuration not being offloadable.
      
      The selftest itself however checks vetoing of a different aspect of the
      configuration and the bridge does not need to participate in routing
      traffic. The IP address or the RIF are irrelevant.
      
      Fix by disabling automatic IPv6 address generation for the HW-offloaded
      bridge in this selftest, thus exempting it from mlxsw router attention.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      08035d8e
    • Petr Machata's avatar
      selftests: mlxsw: qos_mc_aware: Disable IPv6 autogen on bridges · ea2d5f75
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      At the time that the front panel port is enslaved to the bridge (this holds
      for both bridges used here), the bridge MAC address does not have the same
      prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all
      the RIFs have to have the same 38-bit MAC address prefix. Since the bridge
      does not obey this limitation, the RIF cannot be created, and the
      enslavement attempt is vetoed on the grounds of the configuration not being
      offloadable.
      
      The selftest itself however checks traffic prioritization and scheduling,
      and the bridges serve for their L2 forwarding capabilities, and do not need
      to participate in routing traffic. The IP addresses or the RIFs are
      irrelevant.
      
      Fix by disabling automatic IPv6 address generation for the HW-offloaded
      bridges in this selftest, thus exempting them from mlxsw router attention.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ea2d5f75
    • Petr Machata's avatar
      selftests: mlxsw: qos_ets_strict: Disable IPv6 autogen on bridges · ec7023e6
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      At the time that the front panel port is enslaved to the bridge (this holds
      for both bridges used here), the bridge MAC address does not have the same
      prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all
      the RIFs have to have the same 38-bit MAC address prefix. Since the bridge
      does not obey this limitation, the RIF cannot be created, and the
      enslavement attempt is vetoed on the grounds of the configuration not being
      offloadable.
      
      The selftest itself however checks traffic prioritization and scheduling,
      and the bridges serve for their L2 forwarding capabilities, and do not need
      to participate in routing traffic. The IP addresses or the RIFs are
      irrelevant.
      
      Fix by disabling automatic IPv6 address generation for the HW-offloaded
      bridges in this selftest, thus exempting them from mlxsw router attention.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ec7023e6
    • Petr Machata's avatar
      selftests: mlxsw: qos_dscp_bridge: Disable IPv6 autogen on a bridge · 6349f9bb
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      At the time that the front panel port is enslaved to the bridge, the bridge
      MAC address does not have the same prefix as other interfaces in the
      system. On Nvidia Spectrum-1 machines all the RIFs have to have the same
      38-bit MAC address prefix. Since the bridge does not obey this limitation,
      the RIF cannot be created, and the enslavement attempt is vetoed on the
      grounds of the configuration not being offloadable.
      
      The selftest itself however checks DCB DSCP-based prioritization, and the
      bridge serves for its L2 forwarding capabilities, and does not need to
      participate in routing traffic. The IP address or the RIF are irrelevant.
      
      Fix by disabling automatic IPv6 address generation for the HW-offloaded
      bridge in this selftest, thus exempting it from mlxsw router attention.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6349f9bb
    • Petr Machata's avatar
      selftests: mlxsw: mirror_gre_scale: Disable IPv6 autogen on a bridge · 32b3a7bf
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      At the time that the front panel port is enslaved to the bridge, the bridge
      MAC address does not have the same prefix as other interfaces in the
      system. On Nvidia Spectrum-1 machines all the RIFs have to have the same
      38-bit MAC address prefix. Since the bridge does not obey this limitation,
      the RIF cannot be created, and the enslavement attempt is vetoed on the
      grounds of the configuration not being offloadable.
      
      The selftest itself however checks how many mirroring sessions a machine is
      capable of offloading. The IP address or the RIF are irrelevant.
      
      Fix by disabling automatic IPv6 address generation for the HW-offloaded
      bridge in this selftest, thus exempting it from mlxsw router attention.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      32b3a7bf
    • Petr Machata's avatar
      selftests: mlxsw: extack: Disable IPv6 autogen on bridges · a758dc46
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      At the time that the front panel port is enslaved to the bridge (this holds
      for all bridges used here), the bridge MAC address does not have the same
      prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all
      the RIFs have to have the same 38-bit MAC address prefix. Since the bridge
      does not obey this limitation, the RIF cannot be created, and the
      enslavement attempt is vetoed on the grounds of the configuration not being
      offloadable.
      
      The selftest itself however checks whether a different vetoed aspect of the
      configuration provides an extack. The IP address or the RIF are irrelevant.
      
      Fix by disabling automatic IPv6 address generation for the HW-offloaded
      bridges in this selftest, thus exempting them from mlxsw router attention.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a758dc46
    • Petr Machata's avatar
      selftests: mlxsw: q_in_q_veto: Disable IPv6 autogen on bridges · 8cfdd300
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      The swp enslavement to the 802.1ad bridge is not allowed, because RIFs are
      not allowed to be created for 802.1ad bridges, but the address indicates
      one needs to be created. Thus the veto selftests fail already during the
      port enslavement. Then the attempt to create a VLAN on top of the same
      bridge is not vetoed, because the bridge is not related to mlxsw, and the
      selftest fails.
      
      Fix by disabling automatic IPv6 address generation for the bridges in this
      selftest, thus exempting them from the mlxsw router attention.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8cfdd300
    • Petr Machata's avatar
      selftests: forwarding: router_bridge: Use port MAC for bridge address · 5e71bf50
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      At the time that the front panel port is enslaved to the bridge, the bridge
      MAC address does not have the same prefix as other interfaces in the
      system. On Nvidia Spectrum-1 machines all the RIFs have to have the same
      38-bit MAC address prefix. Since the bridge does not obey this limitation,
      the RIF cannot be created, and the enslavement attempt is vetoed on the
      grounds of the configuration not being offloadable.
      
      The bridge eventually inherits MAC address from its first member, after the
      enslavement is acked. A number of (mainly VXLAN) selftests already work
      around the problem by setting the MAC address to whatever it will
      eventually be anyway. Do the same here.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5e71bf50
    • Petr Machata's avatar
      selftests: forwarding: mirror_gre_*: Use port MAC for bridge address · 8fd32576
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      At the time that the front panel port is enslaved to the bridge, the bridge
      MAC address does not have the same prefix as other interfaces in the
      system. On Nvidia Spectrum-1 machines all the RIFs have to have the same
      38-bit MAC address prefix. Since the bridge does not obey this limitation,
      the RIF cannot be created, and the enslavement attempt is vetoed on the
      grounds of the configuration not being offloadable.
      
      The bridge eventually inherits MAC address from its first member, after the
      enslavement is acked. A number of (mainly VXLAN) selftests already work
      around the problem by setting the MAC address to whatever it will
      eventually be anyway. Do the same for several mirror_gre selftests.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8fd32576
    • Petr Machata's avatar
      selftests: forwarding: mirror_gre_*: Disable IPv6 autogen on bridges · 92c3bb53
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      At the time that the front panel port is enslaved to the bridge, the bridge
      MAC address does not have the same prefix as other interfaces in the
      system. On Nvidia Spectrum-1 machines all the RIFs have to have the same
      38-bit MAC address prefix. Since the bridge does not obey this limitation,
      the RIF cannot be created, and the enslavement attempt is vetoed on the
      grounds of the configuration not being offloadable.
      
      These two selftests however check mirroring traffic to a gretap netdevice.
      The bridge here does not participate in routing traffic and the IP address
      or the RIF are irrelevant.
      
      Fix by disabling automatic IPv6 address generation for the HW-offloaded
      bridges in these selftests, thus exempting them from mlxsw router
      attention. Since the bridges are only used for L2 forwarding, this change
      should not hinder usefulness of this selftest for testing SW datapath or HW
      datapaths in other devices.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      92c3bb53
    • Petr Machata's avatar
      selftests: forwarding: pedit_dsfield: Disable IPv6 autogen on a bridge · f61018dc
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      At the time that the front panel port is enslaved to the bridge, the bridge
      MAC address does not have the same prefix as other interfaces in the
      system. On Nvidia Spectrum-1 machines all the RIFs have to have the same
      38-bit MAC address prefix. Since the bridge does not obey this limitation,
      the RIF cannot be created, and the enslavement attempt is vetoed on the
      grounds of the configuration not being offloadable.
      
      The selftest itself however checks whether skbedit changes packet priority
      as appropriate. The bridge thus does not need to participate in routing
      traffic and the IP address or the RIF are irrelevant.
      
      Fix by disabling automatic IPv6 address generation for the HW-offloaded
      bridge in this selftest, thus exempting it from mlxsw router attention.
      Since the bridge is only used for L2 forwarding, this change should not
      hinder usefulness of this selftest for testing SW datapath or HW datapaths
      in other devices.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f61018dc
    • Petr Machata's avatar
      selftests: forwarding: skbedit_priority: Disable IPv6 autogen on a bridge · d7442b7d
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      At the time that the front panel port is enslaved to the bridge, the bridge
      MAC address does not have the same prefix as other interfaces in the
      system. On Nvidia Spectrum-1 machines all the RIFs have to have the same
      38-bit MAC address prefix. Since the bridge does not obey this limitation,
      the RIF cannot be created, and the enslavement attempt is vetoed on the
      grounds of the configuration not being offloadable.
      
      The selftest itself however checks operation of pedit on IPv4 and IPv6
      dsfield and its parts. The bridge thus does not need to participate in
      routing traffic and the IP address or the RIF are irrelevant.
      
      Fix by disabling automatic IPv6 address generation for the HW-offloaded
      bridge in this selftest, thus exempting it from mlxsw router attention.
      Since the bridge is only used for L2 forwarding, this change should not
      hinder usefulness of this selftest for testing SW datapath or HW datapaths
      in other devices.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d7442b7d
    • Petr Machata's avatar
      selftests: forwarding: dual_vxlan_bridge: Disable IPv6 autogen on bridges · c8015333
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      This will cause this selftest to fail spuriously. The swp enslavement to
      the 802.1ad bridge is not allowed, because RIFs are not allowed to be
      created for 802.1ad bridges, but the address indicates one needs to be
      created.
      
      Fix by disabling automatic IPv6 address generation for the HW-offloaded
      bridge in this selftest, thus exempting it from mlxsw router attention.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c8015333
    • Petr Machata's avatar
      selftests: forwarding: q_in_vni: Disable IPv6 autogen on bridges · 8c3736ce
      Petr Machata authored
      In a future patch, mlxsw will start adding RIFs to uppers of front panel
      port netdevices, if they have an IP address.
      
      This will cause this selftest to fail spuriously. The swp enslavement to
      the 802.1ad bridge is not allowed, because RIFs are not allowed to be
      created for 802.1ad bridges, but the address indicates one needs to be
      created.
      
      Fix by disabling automatic IPv6 address generation for the HW-offloaded
      bridge in this selftest, thus exempting it from mlxsw router attention.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8c3736ce
    • Horatiu Vultur's avatar
      net: micrel: Change to receive timestamp in the frame for lan8841 · cc755495
      Horatiu Vultur authored
      Currently for each timestamp frame, the SW needs to go and read the
      received timestamp over the MDIO bus. But the HW has the capability
      to store the received nanoseconds part and the least significant two
      bits of the seconds in the reserved field of the PTP header. In this
      way we could save few MDIO transactions (actually a little more
      transactions because the access to the PTP registers are indirect)
      for each received frame.
      
      Instead of reading the rest of seconds part of the timestamp of the
      frame using MDIO transactions schedule PTP worker thread to read the
      seconds part every 500ms and then for each of the received frames use
      this information. Because if for example running with 512 frames per
      second, there is no point to read 512 times the second part.
      
      Doing all these changes will give a great CPU usage performance.
      Running ptp4l with logSyncInterval of -9 will give a ~60% CPU
      improvement.
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cc755495
    • Jakub Kicinski's avatar
      Merge branch 'net-stmmac-dwmac-qcom-ethqos-add-support-for-emac4' · 4cb13ff1
      Jakub Kicinski authored
      Bartosz Golaszewski says:
      
      ====================
      net: stmmac: dwmac-qcom-ethqos: add support for EMAC4
      
      Extend the dwmac-qcom-ethqos driver to support EMAC4. While at it: rework the
      code somewhat. The bindings have been reviewed by DT maintainers.
      
      This is a sub-series of [1] with only the patches targetting the net subsystem
      as they can go in independently.
      
      [1] https://lore.kernel.org/lkml/20230617001644.4e093326@kernel.org/T/
      ====================
      
      Link: https://lore.kernel.org/r/20230619092402.195578-1-brgl@bgdev.plSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4cb13ff1
    • Bartosz Golaszewski's avatar
      net: stmmac: dwmac-qcom-ethqos: add support for emac4 on sa8775p platforms · 8c4d92e8
      Bartosz Golaszewski authored
      sa8775p uses EMAC version 4, add the relevant defines, rename the
      has_emac3 switch to has_emac_ge_3 (has emac greater-or-equal than 3)
      and add the new compatible.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8c4d92e8
    • Bartosz Golaszewski's avatar
      dt-bindings: net: qcom,ethqos: add description for sa8775p · d0e3d29f
      Bartosz Golaszewski authored
      Add the compatible for the MAC controller on sa8775p platforms. This MAC
      works with a single interrupt so add minItems to the interrupts property.
      The fourth clock's name is different here so change it. Enable relevant
      PHY properties. Add the relevant compatibles to the binding document for
      snps,dwmac as well.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d0e3d29f
    • Bartosz Golaszewski's avatar
      net: stmmac: add new switch to struct plat_stmmacenet_data · aa571b62
      Bartosz Golaszewski authored
      On some platforms, the PCS can be integrated in the MAC so the driver
      will not see any PCS link activity. Add a switch that allows the platform
      drivers to let the core code know.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Reviewed-by: default avatarJose Abreu <Jose.Abreu@synopsys.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      aa571b62
    • Bartosz Golaszewski's avatar
      net: stmmac: dwmac-qcom-ethqos: add support for SGMII · 463120c3
      Bartosz Golaszewski authored
      On sa8775p the MAC is connected to the external PHY over SGMII so add
      support for it to the driver.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      463120c3
    • Bartosz Golaszewski's avatar
      net: stmmac: dwmac-qcom-ethqos: prepare the driver for more PHY modes · 25c4a076
      Bartosz Golaszewski authored
      In preparation for supporting SGMII, let's make the code a bit more
      generic. Add a new callback for MAC configuration so that we can assign
      a different variant of it in the future.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      25c4a076
    • Bartosz Golaszewski's avatar
      net: stmmac: dwmac-qcom-ethqos: add support for the phyaux clock · feeb2716
      Bartosz Golaszewski authored
      On sa8775p, the EMAC revision is 4 and we use SGMII instead of RGMII.
      There's no "rgmii" clock but there's a fourth clock under a different
      name: "phyaux". Add a new field to the chip data struct that specifies
      the link clock name. Default to "rgmii" for backward compatibility.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      feeb2716
    • Bartosz Golaszewski's avatar
      net: stmmac: dwmac-qcom-ethqos: add support for the optional serdes phy · 0dec3b48
      Bartosz Golaszewski authored
      On sa8775p platforms, there's a SGMII SerDes PHY between the MAC and
      external PHY that we need to enable and configure.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0dec3b48
    • Bartosz Golaszewski's avatar
      net: stmmac: dwmac-qcom-ethqos: remove stray space · f2b17585
      Bartosz Golaszewski authored
      There's an unnecessary space in the rgmii_updatel() function, remove it.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f2b17585
    • Bartosz Golaszewski's avatar
      net: stmmac: dwmac-qcom-ethqos: add a newline between headers · 97f73bc5
      Bartosz Golaszewski authored
      Typically we use a newline between global and local headers so add it
      here as well.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      97f73bc5
    • Bartosz Golaszewski's avatar
      net: stmmac: dwmac-qcom-ethqos: add missing include · ee8dacca
      Bartosz Golaszewski authored
      device_get_phy_mode() is declared in linux/property.h but this header
      is not included.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ee8dacca
    • Bartosz Golaszewski's avatar
      net: stmmac: dwmac-qcom-ethqos: use a helper variable for &pdev->dev · 302555a0
      Bartosz Golaszewski authored
      Shrink code and avoid line breaks by using a helper variable for
      &pdev->dev.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      302555a0
    • Bartosz Golaszewski's avatar
      net: stmmac: dwmac-qcom-ethqos: tweak the order of local variables · 7b5e64a9
      Bartosz Golaszewski authored
      Make sure we follow the reverse-xmas tree convention.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7b5e64a9
    • Bartosz Golaszewski's avatar
      net: stmmac: dwmac-qcom-ethqos: rename a label in probe() · 9bc58060
      Bartosz Golaszewski authored
      The err_mem label's name is unclear. It actually should be reached on
      any error after stmmac_probe_config_dt() succeeds. Name it after the
      cleanup action that needs to be called before exiting.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9bc58060
    • Bartosz Golaszewski's avatar
      net: stmmac: dwmac-qcom-ethqos: shrink clock code with devres · 9fc68f23
      Bartosz Golaszewski authored
      We can use a devm action to completely drop the remove callback and use
      stmmac_pltfr_remove() directly for remove. We can also drop one of the
      goto labels.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9fc68f23
    • Arnd Bergmann's avatar
      sfc: fix uninitialized variable use · f61d2d5c
      Arnd Bergmann authored
      The new efx_bind_neigh() function contains a broken code path when IPV6 is
      disabled:
      
      drivers/net/ethernet/sfc/tc_encap_actions.c:144:7: error: variable 'n' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
                      if (encap->type & EFX_ENCAP_FLAG_IPV6) {
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/sfc/tc_encap_actions.c:184:8: note: uninitialized use occurs here
                      if (!n) {
                           ^
      drivers/net/ethernet/sfc/tc_encap_actions.c:144:3: note: remove the 'if' if its condition is always false
                      if (encap->type & EFX_ENCAP_FLAG_IPV6) {
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/sfc/tc_encap_actions.c:141:22: note: initialize the variable 'n' to silence this warning
                      struct neighbour *n;
                                         ^
                                          = NULL
      
      Change it to use the existing error handling path here.
      
      Fixes: 7e5e7d80 ("sfc: neighbour lookup for TC encap action offload")
      Suggested-by: default avatarEdward Cree <ecree.xilinx@gmail.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarEdward Cree <ecree.xilinx@gmail.com>
      Link: https://lore.kernel.org/r/20230619091215.2731541-2-arnd@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f61d2d5c
    • Arnd Bergmann's avatar
      sfc: add CONFIG_INET dependency for TC offload · 40cba833
      Arnd Bergmann authored
      The driver now fails to link when CONFIG_INET is disabled, so
      add an explicit Kconfig dependency:
      
      ld.lld: error: undefined symbol: ip_route_output_flow
      >>> referenced by tc_encap_actions.c
      >>>               drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_tc_flower_create_encap_md) in archive vmlinux.a
      
      ld.lld: error: undefined symbol: ip_send_check
      >>> referenced by tc_encap_actions.c
      >>>               drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_gen_encap_header) in archive vmlinux.a
      >>> referenced by tc_encap_actions.c
      >>>               drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_gen_encap_header) in archive vmlinux.a
      
      ld.lld: error: undefined symbol: arp_tbl
      >>> referenced by tc_encap_actions.c
      >>>               drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_tc_netevent_event) in archive vmlinux.a
      >>> referenced by tc_encap_actions.c
      >>>               drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_tc_netevent_event) in archive vmlinux.a
      
      Fixes: a1e82162 ("sfc: generate encap headers for TC offload")
      Reviewed-by: default avatarEdward Cree <ecree.xilinx@gmail.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Closes: https://lore.kernel.org/oe-kbuild-all/202306151656.yttECVTP-lkp@intel.com/Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20230619091215.2731541-1-arnd@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      40cba833
    • Andrew Lunn's avatar
      net: phy-c45: Fix genphy_c45_ethtool_set_eee description · b7c31ccd
      Andrew Lunn authored
      The text has been cut/paste from genphy_c45_ethtool_get_eee but not
      changed to reflect it performs set.
      
      Additionally, extend the comment. This function implements the logic
      that eee_enabled has global control over EEE. When eee_enabled is
      false, no link modes will be advertised, and as a result, the MAC
      should not transmit LPI.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Link: https://lore.kernel.org/r/20230619220332.4038924-1-andrew@lunn.chSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b7c31ccd
    • Eric Dumazet's avatar
      net: remove sk_is_ipmr() and sk_is_icmpv6() helpers · 634236b3
      Eric Dumazet authored
      Blamed commit added these helpers for sake of detecting RAW
      sockets specific ioctl.
      
      syzbot complained about it [1].
      
      Issue here is that RAW sockets could pretend there was no need
      to call ipmr_sk_ioctl()
      
      Regardless of inet_sk(sk)->inet_num, we must be prepared
      for ipmr_ioctl() being called later. This must happen
      from ipmr_sk_ioctl() context only.
      
      We could add a safety check in ipmr_ioctl() at the risk of breaking
      applications.
      
      Instead, remove sk_is_ipmr() and sk_is_icmpv6() because their
      name would be misleading, once we change their implementation.
      
      [1]
      BUG: KASAN: stack-out-of-bounds in ipmr_ioctl+0xb12/0xbd0 net/ipv4/ipmr.c:1654
      Read of size 4 at addr ffffc90003aefae4 by task syz-executor105/5004
      
      CPU: 0 PID: 5004 Comm: syz-executor105 Not tainted 6.4.0-rc6-syzkaller-01304-gc08afcdc #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
      Call Trace:
      <TASK>
      __dump_stack lib/dump_stack.c:88 [inline]
      dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
      print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351
      print_report mm/kasan/report.c:462 [inline]
      kasan_report+0x11c/0x130 mm/kasan/report.c:572
      ipmr_ioctl+0xb12/0xbd0 net/ipv4/ipmr.c:1654
      raw_ioctl+0x4e/0x1e0 net/ipv4/raw.c:881
      sock_ioctl_out net/core/sock.c:4186 [inline]
      sk_ioctl+0x151/0x440 net/core/sock.c:4214
      inet_ioctl+0x18c/0x380 net/ipv4/af_inet.c:1001
      sock_do_ioctl+0xcc/0x230 net/socket.c:1189
      sock_ioctl+0x1f8/0x680 net/socket.c:1306
      vfs_ioctl fs/ioctl.c:51 [inline]
      __do_sys_ioctl fs/ioctl.c:870 [inline]
      __se_sys_ioctl fs/ioctl.c:856 [inline]
      __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856
      do_syscall_x64 arch/x86/entry/common.c:50 [inline]
      do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
      entry_SYSCALL_64_after_hwframe+0x63/0xcd
      RIP: 0033:0x7f2944bf6ad9
      Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
      RSP: 002b:00007ffd8897a028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f2944bf6ad9
      RDX: 0000000000000000 RSI: 00000000000089e1 RDI: 0000000000000003
      RBP: 00007f2944bbac80 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000246 R12: 00007f2944bbad10
      R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
      </TASK>
      
      The buggy address belongs to stack of task syz-executor105/5004
      and is located at offset 36 in frame:
      sk_ioctl+0x0/0x440 net/core/sock.c:4172
      
      This frame has 2 objects:
      [32, 36) 'karg'
      [48, 88) 'buffer'
      
      Fixes: e1d001fa ("net: ioctl: Use kernel memory on protocol ioctl callbacks")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Breno Leitao <leitao@debian.org>
      Cc: Kuniyuki Iwashima <kuniyu@amazon.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://lore.kernel.org/r/20230619124336.651528-1-edumazet@google.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      634236b3
    • Eric Dumazet's avatar
      ipv6: fix a typo in ip6mr_sk_ioctl() · 3a4f0edb
      Eric Dumazet authored
      SIOCGETSGCNT_IN6 uses a "struct sioc_sg_req6 buffer".
      
      Unfortunately the blamed commit made hard to ensure type safety.
      
      syzbot reported:
      
      BUG: KASAN: stack-out-of-bounds in ip6mr_ioctl+0xba3/0xcb0 net/ipv6/ip6mr.c:1917
      Read of size 16 at addr ffffc900039afb68 by task syz-executor937/5008
      
      CPU: 1 PID: 5008 Comm: syz-executor937 Not tainted 6.4.0-rc6-syzkaller-01304-gc08afcdc #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
      Call Trace:
      <TASK>
      __dump_stack lib/dump_stack.c:88 [inline]
      dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
      print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351
      print_report mm/kasan/report.c:462 [inline]
      kasan_report+0x11c/0x130 mm/kasan/report.c:572
      ip6mr_ioctl+0xba3/0xcb0 net/ipv6/ip6mr.c:1917
      rawv6_ioctl+0x4e/0x1e0 net/ipv6/raw.c:1143
      sock_ioctl_out net/core/sock.c:4186 [inline]
      sk_ioctl+0x151/0x440 net/core/sock.c:4214
      inet6_ioctl+0x1b8/0x290 net/ipv6/af_inet6.c:582
      sock_do_ioctl+0xcc/0x230 net/socket.c:1189
      sock_ioctl+0x1f8/0x680 net/socket.c:1306
      vfs_ioctl fs/ioctl.c:51 [inline]
      __do_sys_ioctl fs/ioctl.c:870 [inline]
      __se_sys_ioctl fs/ioctl.c:856 [inline]
      __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856
      do_syscall_x64 arch/x86/entry/common.c:50 [inline]
      do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
      entry_SYSCALL_64_after_hwframe+0x63/0xcd
      RIP: 0033:0x7f255849bad9
      Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
      RSP: 002b:00007ffd06792778 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f255849bad9
      RDX: 0000000000000000 RSI: 00000000000089e1 RDI: 0000000000000003
      RBP: 00007f255845fc80 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000246 R12: 00007f255845fd10
      R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
      </TASK>
      
      The buggy address belongs to stack of task syz-executor937/5008
      and is located at offset 40 in frame:
      sk_ioctl+0x0/0x440 net/core/sock.c:4172
      
      This frame has 2 objects:
      [32, 36) 'karg'
      [48, 88) 'buffer'
      
      Fixes: e1d001fa ("net: ioctl: Use kernel memory on protocol ioctl callbacks")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: David Ahern <dsahern@kernel.org>
      Cc: Kuniyuki Iwashima <kuniyu@amazon.com>
      Reviewed-by: default avatarBreno Leitao <leitao@debian.org>
      Link: https://lore.kernel.org/r/20230619072740.464528-1-edumazet@google.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3a4f0edb