1. 15 Jul, 2024 2 commits
    • Vladimir Oltean's avatar
      net: dpaa: eliminate NR_CPUS dependency in egress_fqs[] and conf_fqs[] · e7072750
      Vladimir Oltean authored
      The driver uses the DPAA_TC_TXQ_NUM and DPAA_ETH_TXQ_NUM macros for TX
      queue handling, and they depend on CONFIG_NR_CPUS.
      
      In generic .config files, these can go to very large (8096 CPUs) values
      for the systems that DPAA1 is integrated in (1-24 CPUs). We allocate a
      lot of resources that will never be used. Those are:
      - system memory
      - QMan FQIDs as managed by qman_alloc_fqid_range(). This is especially
        painful since currently, when booting with CONFIG_NR_CPUS=8096, a
        LS1046A-RDB system will only manage to probe 3 of its 6 interfaces.
        The rest will run out of FQD ("/reserved-memory/qman-fqd" in the
        device tree) and fail at the qman_create_fq() stage of the probing
        process.
      - netdev queues as alloc_etherdev_mq() argument. The high queue indices
        are simply hidden from the network stack after the call to
        netif_set_real_num_tx_queues().
      
      With just a tiny bit more effort, we can replace the NR_CPUS
      compile-time constant with the num_possible_cpus() run-time constant,
      and dynamically allocate the egress_fqs[] and conf_fqs[] arrays.
      Even on a system with a high CONFIG_NR_CPUS, num_possible_cpus() will
      remain equal to the number of available cores on the SoC.
      
      The replacement is as follows:
      - DPAA_TC_TXQ_NUM -> dpaa_num_txqs_per_tc()
      - DPAA_ETH_TXQ_NUM -> dpaa_max_num_txqs()
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Acked-by: default avatarMadalin Bucur <madalin.bucur@oss.nxp.com>
      Link: https://patch.msgid.link/20240713225336.1746343-3-vladimir.oltean@nxp.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e7072750
    • Vladimir Oltean's avatar
      net: dpaa: avoid on-stack arrays of NR_CPUS elements · 555a05d8
      Vladimir Oltean authored
      The dpaa-eth driver is written for PowerPC and Arm SoCs which have 1-24
      CPUs. It depends on CONFIG_NR_CPUS having a reasonably small value in
      Kconfig. Otherwise, there are 2 functions which allocate on-stack arrays
      of NR_CPUS elements, and these can quickly explode in size, leading to
      warnings such as:
      
        drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:3280:12: warning:
        stack frame size (16664) exceeds limit (2048) in 'dpaa_eth_probe' [-Wframe-larger-than]
      
      The problem is twofold:
      - Reducing the array size to the boot-time num_possible_cpus() (rather
        than the compile-time NR_CPUS) creates a variable-length array,
        which should be avoided in the Linux kernel.
      - Using NR_CPUS as an array size makes the driver blow up in stack
        consumption with generic, as opposed to hand-crafted, .config files.
      
      A simple solution is to use dynamic allocation for num_possible_cpus()
      elements (aka a small number determined at runtime).
      
      Link: https://lore.kernel.org/all/202406261920.l5pzM1rj-lkp@intel.com/Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarBreno Leitao <leitao@debian.org>
      Acked-by: default avatarMadalin Bucur <madalin.bucur@oss.nxp.com>
      Link: https://patch.msgid.link/20240713225336.1746343-2-vladimir.oltean@nxp.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      555a05d8
  2. 14 Jul, 2024 5 commits
    • Jakub Kicinski's avatar
      Merge tag 'ipsec-next-2024-07-13' of... · 62fdd170
      Jakub Kicinski authored
      Merge tag 'ipsec-next-2024-07-13' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
      
      Steffen Klassert says:
      
      ====================
      pull request (net-next): ipsec-next 2024-07-13
      
      1) Support sending NAT keepalives in ESP in UDP states.
         Userspace IKE daemon had to do this before, but the
         kernel can better keep track of it.
         From Eyal Birger.
      
      2) Support IPsec crypto offload for IPv6 ESP and IPv4 UDP-encapsulated
         ESP data paths. Currently, IPsec crypto offload is enabled for GRO
         code path only. This patchset support UDP encapsulation for the non
         GRO path. From Mike Yu.
      
      * tag 'ipsec-next-2024-07-13' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next:
        xfrm: Support crypto offload for outbound IPv4 UDP-encapsulated ESP packet
        xfrm: Support crypto offload for inbound IPv4 UDP-encapsulated ESP packet
        xfrm: Allow UDP encapsulation in crypto offload control path
        xfrm: Support crypto offload for inbound IPv6 ESP packets not in GRO path
        xfrm: support sending NAT keepalives in ESP in UDP states
      ====================
      
      Link: https://patch.msgid.link/20240713102416.3272997-1-steffen.klassert@secunet.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      62fdd170
    • Jakub Kicinski's avatar
      Merge branch 'introduce-en7581-ethernet-support' · ecb1e1dc
      Jakub Kicinski authored
      Lorenzo Bianconi says:
      
      ====================
      Introduce EN7581 ethernet support
      
      Add airoha_eth driver in order to introduce ethernet support for
      Airoha EN7581 SoC available on EN7581 development board.
      EN7581 mac controller is mainly composed by Frame Engine (FE) and
      QoS-DMA (QDMA) modules. FE is used for traffic offloading (just basic
      functionalities are supported now) while QDMA is used for DMA operation
      and QOS functionalities between mac layer and the dsa switch (hw QoS is
      not available yet and it will be added in the future).
      Currently only hw lan features are available, hw wan will be added with
      subsequent patches.
      ====================
      
      Link: https://patch.msgid.link/cover.1720818878.git.lorenzo@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ecb1e1dc
    • Lorenzo Bianconi's avatar
      net: airoha: Introduce ethernet support for EN7581 SoC · 23020f04
      Lorenzo Bianconi authored
      Add airoha_eth driver in order to introduce ethernet support for
      Airoha EN7581 SoC available on EN7581 development board (en7581-evb).
      EN7581 mac controller is mainly composed by the Frame Engine (PSE+PPE)
      and QoS-DMA (QDMA) modules. FE is used for traffic offloading (just
      basic functionalities are currently supported) while QDMA is used for
      DMA operations and QOS functionalities between the mac layer and the
      external modules conncted to the FE GDM ports (e.g MT7530 DSA switch
      or external phys).
      A general overview of airoha_eth architecture is reported below:
      
                     ┌───────┐                                     ┌───────┐
                     │ QDMA2 │                                     │ QDMA1 │
                     └───┬───┘                                     └───┬───┘
                         │                                             │
                 ┌───────▼─────────────────────────────────────────────▼────────┐
                 │                                                              │
                 │       P5                                            P0       │
                 │                                                              │
                 │                                                              │
                 │                                                              │    ┌──────┐
                 │                                                           P3 ├────► GDM3 │
                 │                                                              │    └──────┘
                 │                                                              │
                 │                                                              │
      ┌─────┐    │                                                              │
      │ PPE ◄────┤ P4                          PSE                              │
      └─────┘    │                                                              │
                 │                                                              │
                 │                                                              │
                 │                                                              │    ┌──────┐
                 │                                                           P9 ├────► GDM4 │
                 │                                                              │    └──────┘
                 │                                                              │
                 │                                                              │
                 │                                                              │
                 │        P2                                           P1       │
                 └─────────┬───────────────────────────────────────────┬────────┘
                           │                                           │
                       ┌───▼──┐                                     ┌──▼───┐
                       │ GDM2 │                                     │ GDM1 │
                       └──────┘                                     └──┬───┘
                                                                       │
                                                                  ┌────▼─────┐
                                                                  │  MT7530  │
                                                                  └──────────┘
      
      Currently only hw LAN features (QDMA1+GDM1) are available while hw WAN
      (QDMA2+GDM{2,3,4}) ones will be added with subsequent patches introducing
      traffic offloading support.
      Tested-by: default avatarBenjamin Larsson <benjamin.larsson@genexis.eu>
      Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
      Link: https://patch.msgid.link/274945d2391c195098ab180a46d0617b18b9e42c.1720818878.git.lorenzo@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      23020f04
    • Lorenzo Bianconi's avatar
      dt-bindings: net: airoha: Add EN7581 ethernet controller · 6bc8719c
      Lorenzo Bianconi authored
      Introduce device-tree binding documentation for Airoha EN7581 ethernet
      mac controller.
      Reviewed-by: default avatarRob Herring (Arm) <robh@kernel.org>
      Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
      Link: https://patch.msgid.link/7dfecf8aa4e6519562a94455b95c49e1b3c858a0.1720818878.git.lorenzo@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6bc8719c
    • Jakub Kicinski's avatar
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue · 861f34e6
      Jakub Kicinski authored
      Tony Nguyen says:
      
      ====================
      ice: Switch API optimizations
      
      Marcin Szycik says:
      
      Optimize the process of creating a recipe in the switch block by removing
      duplicate switch ID words and changing how result indexes are fitted into
      recipes. In many cases this can decrease the number of recipes required to
      add a certain set of rules, potentially allowing a more varied set of rules
      to be created. Total rule count will also increase, since less words will
      be left unused/wasted. There are only 64 rules available in total, so every
      one counts.
      
      After this modification, many fields and some structs became unused or were
      simplified, resulting in overall simpler implementation.
      
      * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
        ice: Add tracepoint for adding and removing switch rules
        ice: Remove unused members from switch API
        ice: Optimize switch recipe creation
        ice: remove unused recipe bookkeeping data
        ice: Simplify bitmap setting in adding recipe
        ice: Remove reading all recipes before adding a new one
        ice: Remove unused struct ice_prot_lkup_ext members
      ====================
      
      Link: https://patch.msgid.link/20240711181312.2019606-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      861f34e6
  3. 13 Jul, 2024 33 commits