1. 17 Oct, 2023 2 commits
    • Yunsheng Lin's avatar
      page_pool: fragment API support for 32-bit arch with 64-bit DMA · 90de47f0
      Yunsheng Lin authored
      Currently page_pool_alloc_frag() is not supported in 32-bit
      arch with 64-bit DMA because of the overlap issue between
      pp_frag_count and dma_addr_upper in 'struct page' for those
      arches, which seems to be quite common, see [1], which means
      driver may need to handle it when using fragment API.
      
      It is assumed that the combination of the above arch with an
      address space >16TB does not exist, as all those arches have
      64b equivalent, it seems logical to use the 64b version for a
      system with a large address space. It is also assumed that dma
      address is page aligned when we are dma mapping a page aligned
      buffer, see [2].
      
      That means we're storing 12 bits of 0 at the lower end for a
      dma address, we can reuse those bits for the above arches to
      support 32b+12b, which is 16TB of memory.
      
      If we make a wrong assumption, a warning is emitted so that
      user can report to us.
      
      1. https://lore.kernel.org/all/20211117075652.58299-1-linyunsheng@huawei.com/
      2. https://lore.kernel.org/all/20230818145145.4b357c89@kernel.org/Tested-by: default avatarAlexander Lobakin <aleksander.lobakin@intel.com>
      Signed-off-by: default avatarYunsheng Lin <linyunsheng@huawei.com>
      CC: Lorenzo Bianconi <lorenzo@kernel.org>
      CC: Alexander Duyck <alexander.duyck@gmail.com>
      CC: Liang Chen <liangchen.linux@gmail.com>
      CC: Guillaume Tucker <guillaume.tucker@collabora.com>
      CC: Matthew Wilcox <willy@infradead.org>
      CC: Linux-MM <linux-mm@kvack.org>
      Link: https://lore.kernel.org/r/20231013064827.61135-2-linyunsheng@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      90de47f0
    • Jacob Keller's avatar
      net: stub tcp_gro_complete if CONFIG_INET=n · e411a8e3
      Jacob Keller authored
      A few networking drivers including bnx2x, bnxt, qede, and idpf call
      tcp_gro_complete as part of offloading TCP GRO. The function is only
      defined if CONFIG_INET is true, since its TCP specific and is meaningless
      if the kernel lacks IP networking support.
      
      The combination of trying to use the complex network drivers with
      CONFIG_NET but not CONFIG_INET is rather unlikely in practice: most use
      cases are going to need IP networking.
      
      The tcp_gro_complete function just sets some data in the socket buffer for
      use in processing the TCP packet in the event that the GRO was offloaded to
      the device. If the kernel lacks TCP support, such setup will simply go
      unused.
      
      The bnx2x, bnxt, and qede drivers wrap their TCP offload support in
      CONFIG_INET checks and skip handling on such kernels.
      
      The idpf driver did not check CONFIG_INET and thus fails to link if the
      kernel is configured  with CONFIG_NET=y, CONFIG_IDPF=(m|y), and
      CONFIG_INET=n.
      
      While checking CONFIG_INET does allow the driver to bypass significantly
      more instructions in the event that we know TCP networking isn't supported,
      the configuration is unlikely to be used widely.
      
      Rather than require driver authors to care about this, stub the
      tcp_gro_complete function when CONFIG_INET=n. This allows drivers to be
      left as-is. It does mean the idpf driver will perform slightly more work
      than strictly necessary when CONFIG_INET=n, since it will still execute
      some of the skb setup in idpf_rx_rsc. However, that work would be performed
      in the case where CONFIG_INET=y anyways.
      
      I did not change the existing drivers, since they appear to wrap a
      significant portion of code when CONFIG_INET=n. There is little benefit in
      trashing these drivers just to unwrap and remove the CONFIG_INET check.
      
      Using a stub for tcp_gro_complete is still beneficial, as it means future
      drivers no longer need to worry about this case of CONFIG_NET=y and
      CONFIG_INET=n, which should reduce noise from buildbots that check such a
      configuration.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
      Link: https://lore.kernel.org/r/20231013185502.1473541-1-jacob.e.keller@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e411a8e3
  2. 16 Oct, 2023 20 commits
  3. 15 Oct, 2023 18 commits