1. 25 3月, 2023 7 次提交
  2. 23 3月, 2023 3 次提交
  3. 18 3月, 2023 1 次提交
  4. 17 3月, 2023 2 次提交
    • M
      net: dsa: microchip: fix RGMII delay configuration on KSZ8765/KSZ8794/KSZ8795 · 5ae06327
      Marek Vasut 提交于
      The blamed commit has replaced a ksz_write8() call to address
      REG_PORT_5_CTRL_6 (0x56) with a ksz_set_xmii() -> ksz_pwrite8() call to
      regs[P_XMII_CTRL_1], which is also defined as 0x56 for ksz8795_regs[].
      
      The trouble is that, when compared to ksz_write8(), ksz_pwrite8() also
      adjusts the register offset with the port base address. So in reality,
      ksz_pwrite8(offset=0x56) accesses register 0x56 + 0x50 = 0xa6, which in
      this switch appears to be unmapped, and the RGMII delay configuration on
      the CPU port does nothing.
      
      So if the switch wasn't fine with the RGMII delay configuration done
      through pin strapping and relied on Linux to apply a different one in
      order to pass traffic, this is now broken.
      
      Using the offset translation logic imposed by ksz_pwrite8(), the correct
      value for regs[P_XMII_CTRL_1] should have been 0x6 on ksz8795_regs[], in
      order to really end up accessing register 0x56.
      
      Static code analysis shows that, despite there being multiple other
      accesses to regs[P_XMII_CTRL_1] in this driver, the only code path that
      is applicable to ksz8795_regs[] and ksz8_dev_ops is ksz_set_xmii().
      Therefore, the problem is isolated to RGMII delays.
      
      In its current form, ksz8795_regs[] contains the same value for
      P_XMII_CTRL_0 and for P_XMII_CTRL_1, and this raises valid suspicions
      that writes made by the driver to regs[P_XMII_CTRL_0] might overwrite
      writes made to regs[P_XMII_CTRL_1] or vice versa.
      
      Again, static analysis shows that the only accesses to P_XMII_CTRL_0
      from the driver are made from code paths which are not reachable with
      ksz8_dev_ops. So the accesses made by ksz_set_xmii() are safe for this
      switch family.
      
      [ vladimiroltean: rewrote commit message ]
      
      Fixes: c476bede ("net: dsa: microchip: ksz8795: use common xmii function")
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Acked-by: NArun Ramadoss <arun.ramadoss@microchip.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20230315231916.2998480-1-vladimir.oltean@nxp.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      5ae06327
    • V
      net: dsa: mv88e6xxx: fix max_mtu of 1492 on 6165, 6191, 6220, 6250, 6290 · 7e951737
      Vladimir Oltean 提交于
      There are 3 classes of switch families that the driver is aware of, as
      far as mv88e6xxx_change_mtu() is concerned:
      
      - MTU configuration is available per port. Here, the
        chip->info->ops->port_set_jumbo_size() method will be present.
      
      - MTU configuration is global to the switch. Here, the
        chip->info->ops->set_max_frame_size() method will be present.
      
      - We don't know how to change the MTU. Here, none of the above methods
        will be present.
      
      Switch families MV88E6165, MV88E6191, MV88E6220, MV88E6250 and MV88E6290
      fall in category 3.
      
      The blamed commit has adjusted the MTU for all 3 categories by EDSA_HLEN
      (8 bytes), resulting in a new maximum MTU of 1492 being reported by the
      driver for these switches.
      
      I don't have the hardware to test, but I do have a MV88E6390 switch on
      which I can simulate this by commenting out its .port_set_jumbo_size
      definition from mv88e6390_ops. The result is this set of messages at
      probe time:
      
      mv88e6085 d0032004.mdio-mii:10: nonfatal error -34 setting MTU to 1500 on port 1
      mv88e6085 d0032004.mdio-mii:10: nonfatal error -34 setting MTU to 1500 on port 2
      mv88e6085 d0032004.mdio-mii:10: nonfatal error -34 setting MTU to 1500 on port 3
      mv88e6085 d0032004.mdio-mii:10: nonfatal error -34 setting MTU to 1500 on port 4
      mv88e6085 d0032004.mdio-mii:10: nonfatal error -34 setting MTU to 1500 on port 5
      mv88e6085 d0032004.mdio-mii:10: nonfatal error -34 setting MTU to 1500 on port 6
      mv88e6085 d0032004.mdio-mii:10: nonfatal error -34 setting MTU to 1500 on port 7
      mv88e6085 d0032004.mdio-mii:10: nonfatal error -34 setting MTU to 1500 on port 8
      
      It is highly implausible that there exist Ethernet switches which don't
      support the standard MTU of 1500 octets, and this is what the DSA
      framework says as well - the error comes from dsa_slave_create() ->
      dsa_slave_change_mtu(slave_dev, ETH_DATA_LEN).
      
      But the error messages are alarming, and it would be good to suppress
      them.
      
      As a consequence of this unlikeliness, we reimplement mv88e6xxx_get_max_mtu()
      and mv88e6xxx_change_mtu() on switches from the 3rd category as follows:
      the maximum supported MTU is 1500, and any request to set the MTU to a
      value larger than that fails in dev_validate_mtu().
      
      Fixes: b9c587fe ("dsa: mv88e6xxx: Include tagger overhead when setting MTU for DSA and CPU ports")
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NSimon Horman <simon.horman@corigine.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7e951737
  5. 14 3月, 2023 2 次提交
  6. 09 3月, 2023 1 次提交
    • V
      net: dsa: mt7530: permit port 5 to work without port 6 on MT7621 SoC · c8b8a3c6
      Vladimir Oltean 提交于
      The MT7530 switch from the MT7621 SoC has 2 ports which can be set up as
      internal: port 5 and 6. Arınç reports that the GMAC1 attached to port 5
      receives corrupted frames, unless port 6 (attached to GMAC0) has been
      brought up by the driver. This is true regardless of whether port 5 is
      used as a user port or as a CPU port (carrying DSA tags).
      
      Offline debugging (blind for me) which began in the linked thread showed
      experimentally that the configuration done by the driver for port 6
      contains a step which is needed by port 5 as well - the write to
      CORE_GSWPLL_GRP2 (note that I've no idea as to what it does, apart from
      the comment "Set core clock into 500Mhz"). Prints put by Arınç show that
      the reset value of CORE_GSWPLL_GRP2 is RG_GSWPLL_POSDIV_500M(1) |
      RG_GSWPLL_FBKDIV_500M(40) (0x128), both on the MCM MT7530 from the
      MT7621 SoC, as well as on the standalone MT7530 from MT7623NI Bananapi
      BPI-R2. Apparently, port 5 on the standalone MT7530 can work under both
      values of the register, while on the MT7621 SoC it cannot.
      
      The call path that triggers the register write is:
      
      mt753x_phylink_mac_config() for port 6
      -> mt753x_pad_setup()
         -> mt7530_pad_clk_setup()
      
      so this fully explains the behavior noticed by Arınç, that bringing port
      6 up is necessary.
      
      The simplest fix for the problem is to extract the register writes which
      are needed for both port 5 and 6 into a common mt7530_pll_setup()
      function, which is called at mt7530_setup() time, immediately after
      switch reset. We can argue that this mirrors the code layout introduced
      in mt7531_setup() by commit 42bc4faf ("net: mt7531: only do PLL once
      after the reset"), in that the PLL setup has the exact same positioning,
      and further work to consolidate the separate setup() functions is not
      hindered.
      
      Testing confirms that:
      
      - the slight reordering of writes to MT7530_P6ECR and to
        CORE_GSWPLL_GRP1 / CORE_GSWPLL_GRP2 introduced by this change does not
        appear to cause problems for the operation of port 6 on MT7621 and on
        MT7623 (where port 5 also always worked)
      
      - packets sent through port 5 are not corrupted anymore, regardless of
        whether port 6 is enabled by phylink or not (or even present in the
        device tree)
      
      My algorithm for determining the Fixes: tag is as follows. Testing shows
      that some logic from mt7530_pad_clk_setup() is needed even for port 5.
      Prior to commit ca366d6c ("net: dsa: mt7530: Convert to PHYLINK
      API"), a call did exist for all phy_is_pseudo_fixed_link() ports - so
      port 5 included. That commit replaced it with a temporary "Port 5 is not
      supported!" comment, and the following commit 38f790a8 ("net: dsa:
      mt7530: Add support for port 5") replaced that comment with a
      configuration procedure in mt7530_setup_port5() which was insufficient
      for port 5 to work. I'm laying the blame on the patch that claimed
      support for port 5, although one would have also needed the change from
      commit c3b8e079 ("net: dsa: mt7530: setup core clock even in TRGMII
      mode") for the write to be performed completely independently from port
      6's configuration.
      
      Thanks go to Arınç for describing the problem, for debugging and for
      testing.
      Reported-by: NArınç ÜNAL <arinc.unal@arinc9.com>
      Link: https://lore.kernel.org/netdev/f297c2c4-6e7c-57ac-2394-f6025d309b9d@arinc9.com/
      Fixes: 38f790a8 ("net: dsa: mt7530: Add support for port 5")
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Tested-by: NArınç ÜNAL <arinc.unal@arinc9.com>
      Reviewed-by: NSimon Horman <simon.horman@corigine.com>
      Link: https://lore.kernel.org/r/20230307155411.868573-1-vladimir.oltean@nxp.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      c8b8a3c6
  7. 27 2月, 2023 4 次提交
    • R
      net: dsa: ocelot_ext: remove unnecessary phylink.h include · 724337be
      Russell King (Oracle) 提交于
      During review of ocelot_ext, it created a private phylink instance
      that wasn't necessary. This was removed for subsequent postings,
      but the include file seems to have been left behind. Remove it.
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      724337be
    • V
      net: mscc: ocelot: fix duplicate driver name error · ef1a99c6
      Vladimir Oltean 提交于
      When compiling a kernel which has both CONFIG_NET_DSA_MSCC_OCELOT_EXT
      and CONFIG_MSCC_OCELOT_SWITCH enabled, the following error message will
      be printed:
      
      [    5.266588] Error: Driver 'ocelot-switch' is already registered, aborting...
      
      Rename the ocelot_ext.c driver to "ocelot-ext-switch" to avoid the name
      duplication, and update the mfd_cell entry for its resources.
      
      Fixes: 3d7316ac ("net: dsa: ocelot: add external ocelot switch control")
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ef1a99c6
    • V
      net: dsa: felix: fix internal MDIO controller resource length · 940af261
      Vladimir Oltean 提交于
      The blamed commit did not properly convert the resource start/end format
      into the DEFINE_RES_MEM_NAMED() start/length format, resulting in a
      resource for vsc9959_imdio_res which is much longer than expected:
      
      $ cat /proc/iomem
      1f8000000-1f815ffff : pcie@1f0000000
        1f8140000-1f815ffff : 0000:00:00.5
          1f8148030-1f815006f : imdio
      
      vs (correct)
      
      $ cat /proc/iomem
      1f8000000-1f815ffff : pcie@1f0000000
        1f8140000-1f815ffff : 0000:00:00.5
          1f8148030-1f814803f : imdio
      
      Luckily it's not big enough to exceed the size of the parent resource
      (pci_resource_end(pdev, VSC9959_IMDIO_PCI_BAR)), and it doesn't overlap
      with anything else that the Linux driver uses currently, so the larger
      than expected size isn't a practical problem that I can see. Although it
      is clearly wrong in the /proc/iomem output.
      
      Fixes: 044d447a ("net: dsa: felix: use DEFINE_RES_MEM_NAMED for resources")
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      940af261
    • V
      net: dsa: seville: ignore mscc-miim read errors from Lynx PCS · 0322ef49
      Vladimir Oltean 提交于
      During the refactoring in the commit below, vsc9953_mdio_read() was
      replaced with mscc_miim_read(), which has one extra step: it checks for
      the MSCC_MIIM_DATA_ERROR bits before returning the result.
      
      On T1040RDB, there are 8 QSGMII PCSes belonging to the switch, and they
      are organized in 2 groups. First group responds to MDIO addresses 4-7
      because QSGMIIACR1[MDEV_PORT] is 1, and the second group responds to
      MDIO addresses 8-11 because QSGMIIBCR1[MDEV_PORT] is 2. I have double
      checked that these values are correctly set in the SERDES, as well as
      PCCR1[QSGMA_CFG] and PCCR1[QSGMB_CFG] are both 0b01.
      
      mscc_miim_read: phyad 8 reg 0x1 MIIM_DATA 0x2d
      mscc_miim_read: phyad 8 reg 0x5 MIIM_DATA 0x5801
      mscc_miim_read: phyad 8 reg 0x1 MIIM_DATA 0x2d
      mscc_miim_read: phyad 8 reg 0x5 MIIM_DATA 0x5801
      mscc_miim_read: phyad 9 reg 0x1 MIIM_DATA 0x2d
      mscc_miim_read: phyad 9 reg 0x5 MIIM_DATA 0x5801
      mscc_miim_read: phyad 9 reg 0x1 MIIM_DATA 0x2d
      mscc_miim_read: phyad 9 reg 0x5 MIIM_DATA 0x5801
      mscc_miim_read: phyad 10 reg 0x1 MIIM_DATA 0x2d
      mscc_miim_read: phyad 10 reg 0x5 MIIM_DATA 0x5801
      mscc_miim_read: phyad 10 reg 0x1 MIIM_DATA 0x2d
      mscc_miim_read: phyad 10 reg 0x5 MIIM_DATA 0x5801
      mscc_miim_read: phyad 11 reg 0x1 MIIM_DATA 0x2d
      mscc_miim_read: phyad 11 reg 0x5 MIIM_DATA 0x5801
      mscc_miim_read: phyad 11 reg 0x1 MIIM_DATA 0x2d
      mscc_miim_read: phyad 11 reg 0x5 MIIM_DATA 0x5801
      mscc_miim_read: phyad 4 reg 0x1 MIIM_DATA 0x3002d, ERROR
      mscc_miim_read: phyad 4 reg 0x5 MIIM_DATA 0x3da01, ERROR
      mscc_miim_read: phyad 5 reg 0x1 MIIM_DATA 0x3002d, ERROR
      mscc_miim_read: phyad 5 reg 0x5 MIIM_DATA 0x35801, ERROR
      mscc_miim_read: phyad 5 reg 0x1 MIIM_DATA 0x3002d, ERROR
      mscc_miim_read: phyad 5 reg 0x5 MIIM_DATA 0x35801, ERROR
      mscc_miim_read: phyad 6 reg 0x1 MIIM_DATA 0x3002d, ERROR
      mscc_miim_read: phyad 6 reg 0x5 MIIM_DATA 0x35801, ERROR
      mscc_miim_read: phyad 6 reg 0x1 MIIM_DATA 0x3002d, ERROR
      mscc_miim_read: phyad 6 reg 0x5 MIIM_DATA 0x35801, ERROR
      mscc_miim_read: phyad 7 reg 0x1 MIIM_DATA 0x3002d, ERROR
      mscc_miim_read: phyad 7 reg 0x5 MIIM_DATA 0x35801, ERROR
      mscc_miim_read: phyad 7 reg 0x1 MIIM_DATA 0x3002d, ERROR
      mscc_miim_read: phyad 7 reg 0x5 MIIM_DATA 0x35801, ERROR
      
      As can be seen, the data in MIIM_DATA is still valid despite having the
      MSCC_MIIM_DATA_ERROR bits set. The driver as introduced in commit
      84705fc1 ("net: dsa: felix: introduce support for Seville VSC9953
      switch") was ignoring these bits, perhaps deliberately (although
      unbeknownst to me).
      
      This is an old IP and the hardware team cannot seem to be able to help
      me track down a plausible reason for these failures. I'll keep
      investigating, but in the meantime, this is a direct regression which
      must be restored to a working state.
      
      The only thing I can do is keep ignoring the errors as before.
      
      Fixes: b9965845 ("net: dsa: ocelot: felix: utilize shared mscc-miim driver for indirect MDIO access")
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0322ef49
  8. 16 2月, 2023 1 次提交
  9. 13 2月, 2023 1 次提交
  10. 11 2月, 2023 1 次提交
    • A
      net: dsa: ocelot: add PTP dependency for NET_DSA_MSCC_OCELOT_EXT · f99f22e0
      Arnd Bergmann 提交于
      A new user of MSCC_OCELOT_SWITCH_LIB was added, bringing back an old
      link failure that was fixed with e5f31552 ("ethernet: fix
      PTP_1588_CLOCK dependencies"):
      
      x86_64-linux-ld: drivers/net/ethernet/mscc/ocelot_ptp.o: in function `ocelot_ptp_enable':
      ocelot_ptp.c:(.text+0x8ee): undefined reference to `ptp_find_pin'
      x86_64-linux-ld: drivers/net/ethernet/mscc/ocelot_ptp.o: in function `ocelot_get_ts_info':
      ocelot_ptp.c:(.text+0xd5d): undefined reference to `ptp_clock_index'
      x86_64-linux-ld: drivers/net/ethernet/mscc/ocelot_ptp.o: in function `ocelot_init_timestamp':
      ocelot_ptp.c:(.text+0x15ca): undefined reference to `ptp_clock_register'
      x86_64-linux-ld: drivers/net/ethernet/mscc/ocelot_ptp.o: in function `ocelot_deinit_timestamp':
      ocelot_ptp.c:(.text+0x16b7): undefined reference to `ptp_clock_unregister'
      
      Add the same PTP dependency here, as well as in the MSCC_OCELOT_SWITCH_LIB
      symbol itself to make it more obvious what is going on when the next
      driver selects it.
      
      Fixes: 3d7316ac ("net: dsa: ocelot: add external ocelot switch control")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NColin Foster <colin.foster@in-advantage.com>
      Link: https://lore.kernel.org/r/20230209124435.1317781-1-arnd@kernel.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      f99f22e0
  11. 07 2月, 2023 1 次提交
    • V
      net: dsa: mt7530: don't change PVC_EG_TAG when CPU port becomes VLAN-aware · 0b6d6425
      Vladimir Oltean 提交于
      Frank reports that in a mt7530 setup where some ports are standalone and
      some are in a VLAN-aware bridge, 8021q uppers of the standalone ports
      lose their VLAN tag on xmit, as seen by the link partner.
      
      This seems to occur because once the other ports join the VLAN-aware
      bridge, mt7530_port_vlan_filtering() also calls
      mt7530_port_set_vlan_aware(ds, cpu_dp->index), and this affects the way
      that the switch processes the traffic of the standalone port.
      
      Relevant is the PVC_EG_TAG bit. The MT7530 documentation says about it:
      
      EG_TAG: Incoming Port Egress Tag VLAN Attribution
      0: disabled (system default)
      1: consistent (keep the original ingress tag attribute)
      
      My interpretation is that this setting applies on the ingress port, and
      "disabled" is basically the normal behavior, where the egress tag format
      of the packet (tagged or untagged) is decided by the VLAN table
      (MT7530_VLAN_EGRESS_UNTAG or MT7530_VLAN_EGRESS_TAG).
      
      But there is also an option of overriding the system default behavior,
      and for the egress tagging format of packets to be decided not by the
      VLAN table, but simply by copying the ingress tag format (if ingress was
      tagged, egress is tagged; if ingress was untagged, egress is untagged;
      aka "consistent). This is useful in 2 scenarios:
      
      - VLAN-unaware bridge ports will always encounter a miss in the VLAN
        table. They should forward a packet as-is, though. So we use
        "consistent" there. See commit e045124e ("net: dsa: mt7530: fix
        tagged frames pass-through in VLAN-unaware mode").
      
      - Traffic injected from the CPU port. The operating system is in god
        mode; if it wants a packet to exit as VLAN-tagged, it sends it as
        VLAN-tagged. Otherwise it sends it as VLAN-untagged*.
      
      *This is true only if we don't consider the bridge TX forwarding offload
      feature, which mt7530 doesn't support.
      
      So for now, make the CPU port always stay in "consistent" mode to allow
      software VLANs to be forwarded to their egress ports with the VLAN tag
      intact, and not stripped.
      
      Link: https://lore.kernel.org/netdev/trinity-e6294d28-636c-4c40-bb8b-b523521b00be-1674233135062@3c-app-gmx-bs36/
      Fixes: e045124e ("net: dsa: mt7530: fix tagged frames pass-through in VLAN-unaware mode")
      Reported-by: NFrank Wunderlich <frank-w@public-files.de>
      Tested-by: NFrank Wunderlich <frank-w@public-files.de>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Tested-by: NArınç ÜNAL <arinc.unal@arinc9.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20230205140713.1609281-1-vladimir.oltean@nxp.comSigned-off-by: NPaolo Abeni <pabeni@redhat.com>
      0b6d6425
  12. 31 1月, 2023 5 次提交
  13. 28 1月, 2023 1 次提交
  14. 27 1月, 2023 3 次提交
  15. 24 1月, 2023 3 次提交
    • A
      net: dsa: microchip: add support for credit based shaper · 71d7920f
      Arun Ramadoss 提交于
      KSZ9477, KSZ9567, KSZ9563, KSZ8563 and LAN937x supports Credit based
      shaper. To differentiate the chip supporting cbs, tc_cbs_supported
      flag is introduced in ksz_chip_data.
      And KSZ series has 16bit Credit increment registers whereas LAN937x has
      24bit register. The value to be programmed in the credit increment is
      determined using the successive multiplication method to convert decimal
      fraction to hexadecimal fraction.
      For example: if idleslope is 10000 and sendslope is -90000, then
      bandwidth is 10000 - (-90000) = 100000.
      The 10% bandwidth of 100Mbps means 10/100 = 0.1(decimal). This value has
      to be converted to hexa.
      1) 0.1 * 16 = 1.6  --> fraction 0.6 Carry = 1 (MSB)
      2) 0.6 * 16 = 9.6  --> fraction 0.6 Carry = 9
      3) 0.6 * 16 = 9.6  --> fraction 0.6 Carry = 9
      4) 0.6 * 16 = 9.6  --> fraction 0.6 Carry = 9
      5) 0.6 * 16 = 9.6  --> fraction 0.6 Carry = 9
      6) 0.6 * 16 = 9.6  --> fraction 0.6 Carry = 9 (LSB)
      Now 0.1(decimal) becomes 0.199999(Hex).
      If it is LAN937x, 24 bit value will be programmed to Credit Inc
      register, 0x199999. For others 16 bit value will be prgrammed, 0x1999.
      Signed-off-by: NArun Ramadoss <arun.ramadoss@microchip.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      71d7920f
    • A
      net: dsa: microchip: enable port queues for tc mqprio · e30f33a5
      Arun Ramadoss 提交于
      LAN937x family of switches has 8 queues per port where the KSZ switches
      has 4 queues per port. By default, only one queue per port is enabled.
      The queues are configurable in 2, 4 or 8. This patch add 8 number of
      queues for LAN937x and 4 for other switches.
      In the tag_ksz.c file, prioirty of the packet is queried using the skb
      buffer and the corresponding value is updated in the tag.
      Signed-off-by: NArun Ramadoss <arun.ramadoss@microchip.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      e30f33a5
    • A
      net: dsa: microchip: fix probe of I2C-connected KSZ8563 · 360fdc99
      Ahmad Fatoum 提交于
      Starting with commit eee16b14 ("net: dsa: microchip: perform the
      compatibility check for dev probed"), the KSZ switch driver now bails
      out if it thinks the DT compatible doesn't match the actual chip ID
      read back from the hardware:
      
        ksz9477-switch 1-005f: Device tree specifies chip KSZ9893 but found
        KSZ8563, please fix it!
      
      For the KSZ8563, which used ksz_switch_chips[KSZ9893], this was fine
      at first, because it indeed shares the same chip id as the KSZ9893.
      
      Commit b4490809 ("net: dsa: microchip: add separate struct
      ksz_chip_data for KSZ8563 chip") started differentiating KSZ9893
      compatible chips by consulting the 0x1F register. The resulting breakage
      was fixed for the SPI driver in the same commit by introducing the
      appropriate ksz_switch_chips[KSZ8563], but not for the I2C driver.
      
      Fix this for I2C-connected KSZ8563 now to get it probing again.
      
      Fixes: b4490809 ("net: dsa: microchip: add separate struct ksz_chip_data for KSZ8563 chip").
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NAhmad Fatoum <a.fatoum@pengutronix.de>
      Acked-by: NArun Ramadoss <arun.ramadoss@microchip.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20230120110933.1151054-1-a.fatoum@pengutronix.deSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      360fdc99
  16. 23 1月, 2023 2 次提交
    • V
      net: mscc: ocelot: add MAC Merge layer support for VSC9959 · 6505b680
      Vladimir Oltean 提交于
      Felix (VSC9959) has a DEV_GMII:MM_CONFIG block composed of 2 registers
      (ENABLE_CONFIG and VERIF_CONFIG). Because the MAC Merge statistics and
      pMAC statistics are already in the Ocelot switch lib even if just Felix
      supports them, I'm adding support for the whole MAC Merge layer in the
      common Ocelot library too.
      
      There is an interrupt (shared with the PTP interrupt) which signals
      changes to the MM verification state. This is done because the
      preemptible traffic classes should be committed to hardware only once
      the verification procedure has declared the link partner of being
      capable of receiving preemptible frames.
      
      We implement ethtool getters and setters for the MAC Merge layer state.
      The "TX enabled" and "verify status" are taken from the IRQ handler,
      using a mutex to ensure serialized access.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6505b680
    • V
      net: mscc: ocelot: export ethtool MAC Merge stats for Felix VSC9959 · ab3f97a9
      Vladimir Oltean 提交于
      The Felix VSC9959 switch supports frame preemption and has a MAC Merge
      layer. In addition to the structured stats that exist for the eMAC,
      export the counters associated with its pMAC (pause, RMON, MAC, PHY,
      control) plus the high-level MAC Merge layer stats. The unstructured
      ethtool counters, as well as the rtnl_link_stats64 were left to report
      only the eMAC counters.
      
      Because statistics processing is quite self-contained in ocelot_stats.c
      now, I've opted for introducing an ocelot->mm_supported bool, based on
      which the common switch lib does everything, rather than pushing the
      TSN-specific code in felix_vsc9959.c, as happens for other TSN stuff.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ab3f97a9
  17. 21 1月, 2023 1 次提交
  18. 20 1月, 2023 1 次提交