1. 21 7月, 2021 23 次提交
  2. 20 7月, 2021 17 次提交
    • R
      net: phy: at803x: simplify custom phy id matching · 8887ca54
      Russell King 提交于
      The at803x driver contains a function, at803x_match_phy_id(), which
      tests whether the PHY ID matches the value passed, comparing phy_id
      with phydev->phy_id and testing all bits that in the driver's mask.
      
      This is the same test that is used to match the driver, with phy_id
      replaced with the driver specified ID, phydev->drv->phy_id.
      
      Hence, we already know the value of the bits being tested if we look
      at phydev->drv->phy_id directly, and we do not require a complicated
      test to check them. Test directly against phydev->drv->phy_id instead.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NFabio Estevam <festevam@gmail.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8887ca54
    • C
      net: marvell: clean up trigraph warning on ??! string · fa660684
      Colin Ian King 提交于
      The character sequence ??! is a trigraph and causes the following
      clang warning:
      
      drivers/net/ethernet/marvell/mvneta.c:2604:39: warning: trigraph ignored [-Wtrigraphs]
      
      Clean this by replacing it with single ?.
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fa660684
    • C
      atm: idt77252: clean up trigraph warning on ??) string · d43b2393
      Colin Ian King 提交于
      The character sequence ??) is a trigraph and causes the following
      clang warning:
      
      drivers/atm/idt77252.c:3544:35: warning: trigraph ignored [-Wtrigraphs]
      
      Clean this by replacing it with single ?.
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d43b2393
    • M
      net: phy: intel-xway: Add RGMII internal delay configuration · be393dd6
      Martin Schiller 提交于
      This adds the possibility to configure the RGMII RX/TX clock skew via
      devicetree.
      
      Simply set phy mode to "rgmii-id", "rgmii-rxid" or "rgmii-txid" and add
      the "rx-internal-delay-ps" or "tx-internal-delay-ps" property to the
      devicetree.
      
      Furthermore, a warning is now issued if the phy mode is configured to
      "rgmii" and an internal delay is set in the phy (e.g. by pin-strapping),
      as in the dp83867 driver.
      Signed-off-by: NMartin Schiller <ms@dev.tdt.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      be393dd6
    • R
      net: phylink: add phy change pause mode debug · d34869b4
      Russell King (Oracle) 提交于
      Augment the phy link debug prints with the pause state.
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d34869b4
    • R
      net: mvpp2: deny disabling autoneg for 802.3z modes · 635a85ac
      Russell King (Oracle) 提交于
      The documentation for Armada 8040 says:
      
        Bit 2 Field InBandAnEn In-band Auto-Negotiation enable. ...
        When <PortType> = 1 (1000BASE-X) this field must be set to 1.
      
      We presently ignore whether userspace requests autonegotiation or not
      through the ethtool ksettings interface. However, we have some network
      interfaces that wish to do this. To offer a consistent API across
      network interfaces, deny the ability to disable autonegotiation on
      mvpp2 hardware when in 1000BASE-X and 2500BASE-X.
      
      This means the only way to switch between 2500BASE-X and 1000BASE-X
      on SFPs that support this will be:
      
       # ethtool -s ethX advertise 0x20000006000 # 1000BASE-X Pause AsymPause
       # ethtool -s ethX advertise 0xe000        # 2500BASE-X Pause AsymPause
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Acked-by: NMarek Behún <kabel@kernel.org>
      Acked-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      635a85ac
    • R
      net: mvneta: deny disabling autoneg for 802.3z modes · c762b7fa
      Russell King (Oracle) 提交于
      The documentation for Armada 38x says:
      
        Bit 2 Field InBandAnEn In-band Auto-Negotiation enable. ...
        When <PortType> = 1 (1000BASE-X) this field must be set to 1.
      
      We presently ignore whether userspace requests autonegotiation or not
      through the ethtool ksettings interface. However, we have some network
      interfaces that wish to do this. To offer a consistent API across
      network interfaces, deny the ability to disable autonegotiation on
      mvneta hardware when in 1000BASE-X and 2500BASE-X.
      
      This means the only way to switch between 2500BASE-X and 1000BASE-X
      on SFPs that support this will be:
      
       # ethtool -s ethX advertise 0x20000002000 # 1000BASE-X Pause
       # ethtool -s ethX advertise 0xa000        # 2500BASE-X Pause
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Acked-by: NMarek Behún <kabel@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c762b7fa
    • Y
      net: ipv4: add capability check for net administration · 8292d7f6
      Yang Yang 提交于
      Root in init user namespace can modify /proc/sys/net/ipv4/ip_forward
      without CAP_NET_ADMIN, this doesn't follow the principle of
      capabilities. For example, let's take a look at netdev_store(),
      root can't modify netdev attribute without CAP_NET_ADMIN.
      So let's keep the consistency of permission check logic.
      Reported-by: NZeal Robot <zealci@zte.com.cn>
      Signed-off-by: NYang Yang <yang.yang29@zte.com.cn>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8292d7f6
    • D
      Merge branch 'qcom-dts-updates' · b79c6fba
      David S. Miller 提交于
      Alex Elder says:
      
      ====================
      arm64: dts: qcom: DTS updates
      
      This series updates some IPA-related DT nodes.
      
      Newer versions of IPA do not require an interconnect between IPA
      and SoC internal memory.  The first patch updates the DT binding
      to reflect this.
      
      The second patch adds IPA information to "sc7280.dtsi", using only
      two interconnects.  It includes the definition of the reserved
      memory area used to hold IPA firmware.
      
      The last patch defines the reserved IPA firmware memory area in
      "sc7180.dtsi".
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b79c6fba
    • A
      arm64: dts: qcom: sc7180: define ipa_fw_mem node · fd0f72c3
      Alex Elder 提交于
      Define the reserved memory space used for IPA firmware for the
      Qualcomm SC7180 SoC.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fd0f72c3
    • A
      arm64: dts: qcom: sc7280: add IPA information · f8bd3c82
      Alex Elder 提交于
      Add IPA-related nodes and definitions to "sc7280.dtsi", including
      the reserved memory area used for AP-based IPA firmware loading.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f8bd3c82
    • A
      dt-bindings: net: qcom,ipa: make imem interconnect optional · 6a0eb6c9
      Alex Elder 提交于
      On some newer SoCs, the interconnect between IPA and SoC internal
      memory (imem) is not used.  Reflect this in the binding by moving
      the definition of the "imem" interconnect to the end and defining
      minItems to be 2 for both the interconnects and interconnect-names
      properties.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6a0eb6c9
    • A
      net: ipa: fix IPA v4.11 interconnect data · 0ac26271
      Alex Elder 提交于
      Currently three interconnects are defined for the Qualcomm SC7280
      SoC, but this was based on a misunderstanding.  There should only be
      two interconnects defined:  one between the IPA and system memory;
      and another between the AP and IPA config space.  The bandwidths
      defined for the memory and config interconnects do not match what I
      understand to be proper values, so update these.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0ac26271
    • F
      dt-bindings: net: fec: Fix indentation · a38c02ef
      Fabio Estevam 提交于
      The following warning is observed when running 'make dtbs_check':
      Documentation/devicetree/bindings/net/fsl,fec.yaml:85:7: [warning] wrong indentation: expected 8 but found 6 (indentation)
      
      Fix the indentation accordingly.
      Signed-off-by: NFabio Estevam <festevam@gmail.com>
      Reviewed-by: NJoakim Zhang <qiangqing.zhang@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a38c02ef
    • D
      Merge branch 'fdb-fanout' · 083cd5a4
      David S. Miller 提交于
      Vladimir Oltean says:
      
      ====================
      Fan out FDB entries pointing towards the bridge to all switchdev member ports
      
      The "DSA RX filtering" series has added some important support for
      interpreting addresses towards the bridge device as host addresses and
      installing them as FDB entries towards the CPU port, but it does not
      cover all circumstances and needs further work.
      
      To be precise, the mechanism introduced in that series only works as
      long as the ports are fairly static and no port joins or leaves the
      bridge once the configuration is done. If any port leaves, host FDB
      entries that were installed during runtime (for example the user changes
      the MAC address of the bridge device) will be prematurely deleted,
      resulting in a broken setup.
      
      I see this work as targeted for "net-next" because technically it was
      not supposed to work. Also, there are still corner cases and holes to be
      plugged. For example, today, FDB entries on foreign interfaces are not
      covered by br_fdb_replay(), which means that there are cases where some
      host addresses are either lost, or never deleted by DSA. That will be
      resolved once more work gets accepted, in particular the "Allow
      forwarding for the software bridge data path to be offloaded to capable
      devices" series, which moves the br_fdb_replay() call to the bridge core
      and therefore would be required to solve the problem in a generic way
      for every switchdev driver and not just for DSA.
      
      These patches also pave the way for a cleaner implementation for FDB
      entries pointing towards a LAG upper interface in DSA (that code needs
      only to be added, nothing changed), however this is not done here.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      083cd5a4
    • V
      net: dsa: use switchdev_handle_fdb_{add,del}_to_device · b94dc99c
      Vladimir Oltean 提交于
      Using the new fan-out helper for FDB entries installed on the software
      bridge, we can install host addresses with the proper refcount on the
      CPU port, such that this case:
      
      ip link set swp0 master br0
      ip link set swp1 master br0
      ip link set swp2 master br0
      ip link set swp3 master br0
      ip link set br0 address 00:01:02:03:04:05
      ip link set swp3 nomaster
      
      works properly and the br0 address remains installed as a host entry
      with refcount 3 instead of getting deleted.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b94dc99c
    • V
      net: switchdev: introduce a fanout helper for SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE · 8ca07176
      Vladimir Oltean 提交于
      Currently DSA has an issue with FDB entries pointing towards the bridge
      in the presence of br_fdb_replay() being called at port join and leave
      time.
      
      In particular, each bridge port will ask for a replay for the FDB
      entries pointing towards the bridge when it joins, and for another
      replay when it leaves.
      
      This means that for example, a bridge with 4 switch ports will notify
      DSA 4 times of the bridge MAC address.
      
      But if the MAC address of the bridge changes during the normal runtime
      of the system, the bridge notifies switchdev [ once ] of the deletion of
      the old MAC address as a local FDB towards the bridge, and of the
      insertion [ again once ] of the new MAC address as a local FDB.
      
      This is a problem, because DSA keeps the old MAC address as a host FDB
      entry with refcount 4 (4 ports asked for it using br_fdb_replay). So the
      old MAC address will not be deleted. Additionally, the new MAC address
      will only be installed with refcount 1, and when the first switch port
      leaves the bridge (leaving 3 others as still members), it will delete
      with it the new MAC address of the bridge from the local FDB entries
      kept by DSA (because the br_fdb_replay call on deletion will bring the
      entry's refcount from 1 to 0).
      
      So the problem, really, is that the number of br_fdb_replay() calls is
      not matched with the refcount that a host FDB is offloaded to DSA during
      normal runtime.
      
      An elegant way to solve the problem would be to make the switchdev
      notification emitted by br_fdb_change_mac_address() result in a host FDB
      kept by DSA which has a refcount exactly equal to the number of ports
      under that bridge. Then, no matter how many DSA ports join or leave that
      bridge, the host FDB entry will always be deleted when there are exactly
      zero remaining DSA switch ports members of the bridge.
      
      To implement the proposed solution, we remember that the switchdev
      objects and port attributes have some helpers provided by switchdev,
      which can be optionally called by drivers:
      switchdev_handle_port_obj_{add,del} and switchdev_handle_port_attr_set.
      These helpers:
      - fan out a switchdev object/attribute emitted for the bridge towards
        all the lower interfaces that pass the check_cb().
      - fan out a switchdev object/attribute emitted for a bridge port that is
        a LAG towards all the lower interfaces that pass the check_cb().
      
      In other words, this is the model we need for the FDB events too:
      something that will keep an FDB entry emitted towards a physical port as
      it is, but translate an FDB entry emitted towards the bridge into N FDB
      entries, one per physical port.
      
      Of course, there are many differences between fanning out a switchdev
      object (VLAN) on 3 lower interfaces of a LAG and fanning out an FDB
      entry on 3 lower interfaces of a LAG. Intuitively, an FDB entry towards
      a LAG should be treated specially, because FDB entries are unicast, we
      can't just install the same address towards 3 destinations. It is
      imaginable that drivers might want to treat this case specifically, so
      create some methods for this case and do not recurse into the LAG lower
      ports, just the bridge ports.
      
      DSA also listens for FDB entries on "foreign" interfaces, aka interfaces
      bridged with us which are not part of our hardware domain: think an
      Ethernet switch bridged with a Wi-Fi AP. For those addresses, DSA
      installs host FDB entries. However, there we have the same problem
      (those host FDB entries are installed with a refcount of only 1) and an
      even bigger one which we did not have with FDB entries towards the
      bridge:
      
      br_fdb_replay() is currently not called for FDB entries on foreign
      interfaces, just for the physical port and for the bridge itself.
      
      So when DSA sniffs an address learned by the software bridge towards a
      foreign interface like an e1000 port, and then that e1000 leaves the
      bridge, DSA remains with the dangling host FDB address. That will be
      fixed separately by replaying all FDB entries and not just the ones
      towards the port and the bridge.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8ca07176