1. Aug 03, 2023
  2. Aug 02, 2023
    • Yang Li's avatar
      net: Remove duplicated include in mac.c · 34093c9f
      Yang Li authored
      
      
      ./drivers/net/ethernet/freescale/fman/mac.c: linux/of_platform.h is included more than once.
      
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6039
      
      
      Signed-off-by: default avatarYang Li <yang.lee@linux.alibaba.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      34093c9f
    • Willem de Bruijn's avatar
      selftests/net: report rcv_mss in tcp_mmap · bd60438e
      Willem de Bruijn authored
      
      
      tcp_mmap tests TCP_ZEROCOPY_RECEIVE. If 0% of data is received using
      mmap, this may be due to mss. Report rcv_mss to identify this cause.
      
      Output of a run failed due to too small mss:
      
          received 32768 MB (0 % mmap'ed) in 8.40458 s, 32.7057 Gbit
            cpu usage user:0.027922 sys:8.21126, 251.44 usec per MB, 3252 c-switches, rcv_mss 1428
      
      Output on a successful run:
      
          received 32768 MB (99.9507 % mmap'ed) in 4.69023 s, 58.6064 Gbit
            cpu usage user:0.029172 sys:2.56105, 79.0473 usec per MB, 57591 c-switches, rcv_mss 4096
      
      Suggested-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bd60438e
    • David S. Miller's avatar
      Merge branch 'icssg-driver' · 27bcd122
      David S. Miller authored
      
      
      MD Danish Anwar says:
      
      ====================
      Introduce ICSSG based ethernet Driver
      
      The Programmable Real-time Unit and Industrial Communication Subsystem
      Gigabit (PRU_ICSSG) is a low-latency microcontroller subsystem in the TI
      SoCs. This subsystem is provided for the use cases like the implementation
      of custom peripheral interfaces, offloading of tasks from the other
      processor cores of the SoC, etc.
      
      The subsystem includes many accelerators for data processing like
      multiplier and multiplier-accumulator. It also has peripherals like
      UART, MII/RGMII, MDIO, etc. Every ICSSG core includes two 32-bit
      load/store RISC CPU cores called PRUs.
      
      The above features allow it to be used for implementing custom firmware
      based peripherals like ethernet.
      
      This series adds the YAML documentation and the driver with basic EMAC
      support for TI AM654 Silicon Rev 2 SoC with the PRU_ICSSG Sub-system.
      running dual-EMAC firmware.
      This currently supports basic EMAC with 1Gbps and 100Mbps link. 10M and
      half-duplex modes are not yet supported because they require the support
      of an IEP, which will be added later.
      Advanced features like switch-dev and timestamping will be added later.
      
      This is the v13 of the patch series [v1]. This version of the patchset
      addresses comments made on v12.
      
      There series doesn't have any dependency.
      
      Changes from v12 to v13 :
      *) Rebased the series on latest net-next.
      *) Addressed Jakub's comments on ndo_xmit API. Now we will only stop queues
         based on occupancy not on dma errors.
      *) Removed limiting the number of serviced packets to budget for Tx NAPI.
         Now Tx NAPI will keep servicing packets.
      *) Removed netif_running() check when packet arrives.
      *) Introduced prototypes of APIs in the same patch where these APIs are added.
         Dropped __maybe_unused tags as compiler only cares about prototypes
         existing, not whether actual callers are in place. Now prototypes of these
         APIs are present in the same patch where they are introduced but thes APIs
         are called later (in patch 6).
      
      Changes from v11 to v12 :
      *) Rebased the series on latest net-next.
      *) Addressed Jakub's comments on ndo_xmit API.
      *) Added hooks to .get_rmon_stats for the driver. Now tx / rx bucket size
         and frame counts per bucket will be fetched by ethtool_rmon_stats instead
         of ethtool -S.
      *) Added __maybe_unused tags to unused config and classifier APIs in patch
         2,3 and 4. These tags are later removed in patch 6.
      
      Changes from v10 to v11 :
      *) Rebased the series on latest net-next.
      *) Split the ICSSG driver introduction patch into 9 different patches as
         asked by Jakub.
      *) Introduced new patch(patch 8/10) to dump Standard network interface
         staticstics via ndo_get_stats64. Now certain stats that are reported by
         ICSSG hardware and are also part of struct rtnl_link_stats64, will be
         reported by ndo_get_stats64. While other stats that are not part of the
         struct rtnl_link_stats64 will be reported by ethtool -S. These stats
         are not duplicated.
      
      Changes from v9 to v10 :
      *) Rebased the series on latest net-next.
      *) Moved 'ndev prueth->emac[mac] == emac' assignment to the end of function
         prueth_netdev_init().
      *) In unsupported phy_mode switch case instead of returning -EINVAL, store
         the error code in ret and 'goto free'
      
      Changes from v8 to v9 :
      *) Rebased the series on latest net-next.
      *) Fixed smatch and sparse warnings as pointed by Simon.
      *) Fixed leaky ndev in prueth_netdev_init() as asked by Simon.
      
      Changes from v7 to v8 :
      *) Rebased the series on 6.5-rc1.
      *) Fixed few formattings.
      
      Changes from v6 to v7 :
      *) Added RB tag of Rob in patch 1 of this series.
      *) Addressed Simon's comment on patch 2 of the series.
      *) Rebased patchset on next-20230428 linux-next.
      
      Changes from v5 to v6 :
      *) Added RB tag of Andrew Lunn in patch 2 of this series.
      *) Addressed Rob's comment on patch 1 of the series.
      *) Rebased patchset on next-20230421 linux-next.
      
      Changes from v4 to v5 :
      *) Re-arranged properties section in ti,icssg-prueth.yaml file.
      *) Added requirement for minimum one ethernet port.
      *) Fixed some minor formatting errors as asked by Krzysztof.
      *) Dropped SGMII mode from enum mii_mode as SGMII mode is not currently
         supported by the driver.
      *) Added switch-case block to handle different phy modes by ICSSG driver.
      
      Changes from v3 to v4 :
      *) Addressed Krzysztof's comments and fixed dt_binding_check errors in
         patch 1/2.
      *) Added interrupt-extended property in ethernet-ports properties section.
      *) Fixed comments in file icssg_switch_map.h according to the Linux coding
         style in patch 2/2. Added Documentation of structures in patch 2/2.
      
      Changes from v2 to v3 :
      *) Addressed Rob and Krzysztof's comments on patch 1 of this series.
         Fixed indentation. Removed description and pinctrl section from
         ti,icssg-prueth.yaml file.
      *) Addressed Krzysztof, Paolo, Randy, Andrew and Christophe's comments on
         patch 2 of this seires.
      *) Fixed blanklines in Kconfig and Makefile. Changed structures to const
         as suggested by Krzysztof.
      *) Fixed while loop logic in emac_tx_complete_packets() API as suggested
         by Paolo. Previously in the loop's last iteration 'budget' was 0 and
         napi_consume_skb would wrongly assume the caller is not in NAPI context
         Now, budget won't be zero in last iteration of loop.
      *) Removed inline functions addr_to_da1() and addr_to_da0() as asked by
         Andrew.
      *) Added dev_err_probe() instead of dev_err() as suggested by Christophe.
      *) In ti,icssg-prueth.yaml file, in the patternProperties section of
         ethernet-ports, kept the port name as "port" instead of "ethernet-port"
         as all other drivers were using "port". Will change it if is compulsory
         to use "ethernet-port".
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      27bcd122
    • MD Danish Anwar's avatar
      net: ti: icssg-prueth: Add Power management support · a46750a1
      MD Danish Anwar authored
      
      
      Add suspend / resume APIs to support power management in ICSSG ethernet
      driver.
      
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a46750a1
    • MD Danish Anwar's avatar
      net: ti: icssg-prueth: Add ethtool ops for ICSSG Ethernet driver · 8fb86b0d
      MD Danish Anwar authored
      
      
      Add icssg_ethtool.c file. This file will be used for dumping statistics
      via ethtool for ICSSG ethernet driver.
      
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8fb86b0d
    • MD Danish Anwar's avatar
      net: ti: icssg-prueth: Add Standard network staticstics · c2f67d19
      MD Danish Anwar authored
      
      
      Implement .ndo_get_stats64 to dump standard network interface
      statistics for ICSSG ethernet driver.
      
      Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c2f67d19
    • MD Danish Anwar's avatar
      net: ti: icssg-prueth: Add ICSSG Stats · c1e10d5d
      MD Danish Anwar authored
      
      
      Add icssg_stats.c to help dump, icssg related driver statistics.
      
      ICSSG has hardware registers for providing statistics like total rx bytes,
      total tx bytes, etc. These registers are of 32 bits and hence in case of 1G
      link, they overflows in around 32 seconds. The behaviour of these registers
      is such that they don't roll back to 0 after overflow but rather stay at
      UINT_MAX.
      
      These registers support a feature where the value written to them is
      subtracted from the register. This feature can be utilized to fix the
      overflowing of stats.
      
      This solution uses a Workqueues based solution where a function gets
      called before the registers overflow (every 25 seconds in 1G link, 25000
      seconds in 100M link), this function saves the register
      values in local variables and writes the last read value to the
      register. So any update during the read will be taken care of.
      
      Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1e10d5d
    • Roger Quadros's avatar
      net: ti: icssg-prueth: Add ICSSG ethernet driver · 128d5874
      Roger Quadros authored
      
      
      This is the Ethernet driver for TI AM654 Silicon rev. 2
      with the ICSSG PRU Sub-system running dual-EMAC firmware.
      
      The Programmable Real-time Unit and Industrial Communication Subsystem
      Gigabit (PRU_ICSSG) is a low-latency microcontroller subsystem in the TI
      SoCs. This subsystem is provided for the use cases like implementation of
      custom peripheral interfaces, offloading of tasks from the other
      processor cores of the SoC, etc.
      
      Every ICSSG core has two Programmable Real-Time Unit(PRUs),
      two auxiliary Real-Time Transfer Unit (RT_PRUs), and
      two Transmit Real-Time Transfer Units (TX_PRUs). Each one of these runs
      its own firmware. Every ICSSG core has two MII ports connect to these
      PRUs and also a MDIO port.
      
      The cores can run different firmwares to support different protocols and
      features like switch-dev, timestamping, etc.
      
      It uses System DMA to transfer and receive packets and
      shared memory register emulation between the firmware and
      driver for control and configuration.
      
      This patch adds support for basic EMAC functionality with 1Gbps
      and 100Mbps link speed. 10M and half duplex mode are not supported
      currently as they require IEP, the support for which will be added later.
      Support for switch-dev, timestamp, etc. will be added later
      by subsequent patch series.
      
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarVignesh Raghavendra <vigneshr@ti.com>
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      128d5874
    • MD Danish Anwar's avatar
      dt-bindings: net: Add ICSSG Ethernet · 172e604a
      MD Danish Anwar authored
      
      
      Add a YAML binding document for the ICSSG Programmable real time unit
      based Ethernet hardware. The ICSSG driver uses the PRU and PRUSS consumer
      APIs to interface the PRUs and load/run the firmware for supporting
      ethernet functionality.
      
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      172e604a
    • MD Danish Anwar's avatar
      net: ti: icssg-prueth: Add icssg queues APIs and macros · b8d5008f
      MD Danish Anwar authored
      
      
      Add icssg_queue.c file. This file introduces macros and APIs related to
      ICSSG queues. These will be used by ICSSG Ethernet driver.
      
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b8d5008f
    • MD Danish Anwar's avatar
      net: ti: icssg-prueth: Add Firmware config and classification APIs. · e9b4ece7
      MD Danish Anwar authored
      
      
      Add icssg_config.h / .c and icssg_classifier.c files. These are firmware
      configuration and classification related files. These will be used by
      ICSSG ethernet driver.
      
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9b4ece7
    • MD Danish Anwar's avatar
      net: ti: icssg-prueth: Add mii helper apis and macros · b6ba7752
      MD Danish Anwar authored
      
      
      Add MII helper APIs and MACROs. These APIs and MACROs will be later used
      by ICSSG Ethernet driver. Also introduce icssg_prueth.h which has
      definition of prueth related structures.
      
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6ba7752
    • MD Danish Anwar's avatar
      net: ti: icssg-prueth: Add Firmware Interface for ICSSG Ethernet driver. · 61f4d204
      MD Danish Anwar authored
      
      
      Add firmware interface related headers and macros for ICSSG Ethernet
      driver. These macros will be later used by the ICSSG ethernet driver.
      
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      61f4d204
    • Ante Knezic's avatar
      net: dsa: mv88e6xxx: Add erratum 3.14 for 88E6390X and 88E6190X · 745d7e38
      Ante Knezic authored
      
      
      Fixes XAUI/RXAUI lane alignment errors.
      Issue causes dropped packets when trying to communicate over
      fiber via SERDES lanes of port 9 and 10.
      Errata document applies only to 88E6190X and 88E6390X devices.
      Requires poking in undocumented registers.
      
      Signed-off-by: default avatarAnte Knezic <ante.knezic@helmholz.de>
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      745d7e38
    • David S. Miller's avatar
      Merge branch 'tc-flower-SPI' · 996dcfff
      David S. Miller authored
      
      
      Ratheesh Kannoth says:
      
      ====================
      Packet classify by matching against SPI
      
      1.  net: flow_dissector: Add IPSEC dissector.
      Flow dissector patch reads IPSEC headers (ESP or AH) header
      from packet and retrieves the SPI header.
      
      2. tc: flower: support for SPI.
      TC control path changes to pass SPI field from userspace to
      kernel.
      
      3. tc: flower: Enable offload support IPSEC SPI field.
      Next patch enables the HW support for classify offload for ESP/AH.
      This patch enables the HW offload control.
      
      4. octeontx2-pf: TC flower offload support for SPI field.
      HW offload support for classification in octeontx2 driver.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      996dcfff
    • Ratheesh Kannoth's avatar
      octeontx2-pf: TC flower offload support for SPI field · 73b4c04e
      Ratheesh Kannoth authored
      
      
      Driver support to offload TC flower rules which matches
      against SPI field of IPSEC packets (AH/ESP).
      
      Signed-off-by: default avatarRatheesh Kannoth <rkannoth@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      73b4c04e
    • Ratheesh Kannoth's avatar
      tc: flower: Enable offload support IPSEC SPI field. · c8915d73
      Ratheesh Kannoth authored
      
      
      This patch enables offload for TC classifier
      flower rules which matches against SPI field.
      
      Signed-off-by: default avatarRatheesh Kannoth <rkannoth@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c8915d73