1. 06 Apr, 2021 3 commits
  2. 05 Apr, 2021 12 commits
  3. 04 Apr, 2021 2 commits
  4. 03 Apr, 2021 7 commits
    • David S. Miller's avatar
      Merge branch 'stmmac-xdp' · 428e68e1
      David S. Miller authored
      Ong Boon Leong says:
      
      ====================
      stmmac: Add XDP support
      
      This is the v4 patch series for adding XDP native support to stmmac.
      
      Changes in v4:
      5/6: Move TX clean timer setup to the end of NAPI RX process and
           group it under stmmac_finalize_xdp_rx().
           Also, fixed stmmac_xdp_xmit_back() returns STMMAC_XDP_CONSUMED
           if XDP buffer conversion to XDP frame fails.
      
      6/6: Move xdp_do_flush(0 into stmmac_finalize_xdp_rx() and combine
           the XDP verdict of XDP TX and XDP REDIRECT together.
      
      I retested the patch series on the 'xdp2' and 'xdp_redirect' related to
      changes above and found the result to be satisfactory.
      
      History of previous patch series:
      v3: https://patchwork.kernel.org/project/netdevbpf/cover/20210331154135.8507-1-boon.leong.ong@intel.com/
      v2: https://patchwork.kernel.org/project/netdevbpf/list/?series=457757
      v1: https://patchwork.kernel.org/project/netdevbpf/list/?series=457139
      
      It will be great if community can help to test or review the v4 series
      and provide me any input if any.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      428e68e1
    • Ong Boon Leong's avatar
      net: stmmac: Add support for XDP_REDIRECT action · 8b278a5b
      Ong Boon Leong authored
      This patch adds the support of XDP_REDIRECT to another remote cpu for
      further action. It also implements ndo_xdp_xmit ops, enabling the driver
      to transmit packets forwarded to it by XDP program running on another
      interface.
      
      This patch has been tested using "xdp_redirect_cpu" for XDP_REDIRECT
      + drop testing. It also been tested with "xdp_redirect" sample app
      which can be used to exercise ndo_xdp_xmit ops. The burst traffics are
      generated using pktgen_sample03_burst_single_flow.sh in samples/pktgen
      directory.
      
      v4: Move xdp_do_flush() processing into stmmac_finalize_xdp_rx() and
          combined the XDP verdict of XDP TX and REDIRECT together.
      
      v3: Added 'nq->trans_start = jiffies' to avoid TX time-out as we are
          sharing TX queue between slow path and XDP. Thanks to Jakub Kicinski
          for point out.
      Signed-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8b278a5b
    • Ong Boon Leong's avatar
      net: stmmac: Add support for XDP_TX action · be8b38a7
      Ong Boon Leong authored
      This patch adds support for XDP_TX action which enables XDP program to
      transmit back received frames.
      
      This patch has been tested with the "xdp2" app located in samples/bpf
      dir. The DUT receives burst traffic packet generated using pktgen script
      'pktgen_sample03_burst_single_flow.sh'.
      
      v4: Moved stmmac_tx_timer_arm() to be done once at the end of NAPI RX.
          Fixed stmmac_xdp_xmit_back() to return STMMAC_XDP_CONSUMED if
          XDP buffer to frame conversion fails. Thanks to Jakub's input.
      
      v3: Added 'nq->trans_start = jiffies' to avoid TX time-out as we are
          sharing TX queue between slow path and XDP. Thanks to Jakub Kicinski
          for pointing out.
      Signed-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be8b38a7
    • Ong Boon Leong's avatar
      net: stmmac: Add initial XDP support · 5fabb012
      Ong Boon Leong authored
      This patch adds the initial XDP support to stmmac driver. It supports
      XDP_PASS, XDP_DROP and XDP_ABORTED actions. Upcoming patches will add
      support for XDP_TX and XDP_REDIRECT.
      
      To support XDP headroom, this patch adds page_offset into RX buffer and
      change the dma_sync_single_for_device|cpu(). The DMA address used for
      RX operation are changed to take into page_offset too. As page_pool
      can handle dma_sync_single_for_device() on behalf of driver with
      PP_FLAG_DMA_SYNC_DEV flag, we skip doing that in stmmac driver.
      
      Current stmmac driver supports split header support (SPH) in RX but
      the flexibility of splitting header and payload at different position
      makes it very complex to be supported for XDP processing. In addition,
      jumbo frame is not supported in XDP to keep the initial codes simple.
      
      This patch has been tested with the sample app "xdp1" located in
      samples/bpf directory for both SKB and Native (XDP) mode. The burst
      traffic generated using pktgen_sample03_burst_single_flow.sh in
      samples/pktgen directory.
      
      Changes in v3:
       - factor in xdp header and tail adjustment done by XDP program.
         Thanks to Jakub Kicinski for pointing out the gap in v2.
      
      Changes in v2:
       - fix for "warning: variable 'len' set but not used" reported by lkp.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5fabb012
    • Ong Boon Leong's avatar
      net: stmmac: arrange Tx tail pointer update to stmmac_flush_tx_descriptors · d96febed
      Ong Boon Leong authored
      This patch organizes TX tail pointer update into a new function called
      stmmac_flush_tx_descriptors() so that we can reuse it in stmmac_xmit(),
      stmmac_tso_xmit() and up-coming XDP implementation.
      
      Changes to v2:
       - Fix for warning: unused variable ‘desc_size’
         https://patchwork.hopto.org/static/nipa/457321/12170149/build_32bit/stderrSigned-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d96febed
    • Ong Boon Leong's avatar
      net: stmmac: make SPH enable/disable to be configurable · d08d32d1
      Ong Boon Leong authored
      SPH functionality splits header and payload according to split mode and
      offsef fields (SPLM and SPLOFST). It is beneficials for Linux network
      stack RX processing however it adds a lot of complexity in XDP
      processing.
      
      So, this patch makes the split-header (SPH) capability of the controller
      is stored in "priv->sph_cap" and the enabling/disabling of SPH is decided
      by "priv->sph".
      
      This is to prepare initial XDP enabling for stmmac to disable the use of
      SPH whenever XDP is enabled.
      Signed-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d08d32d1
    • Ong Boon Leong's avatar
      net: stmmac: set IRQ affinity hint for multi MSI vectors · 8deec94c
      Ong Boon Leong authored
      Certain platform likes Intel mGBE has independent hardware IRQ resources
      for TX and RX DMA operation. In preparation to support XDP TX, we add IRQ
      affinity hint to group both RX and TX queue of the same queue ID to the
      same CPU.
      
      Changes in v2:
       - IRQ affinity hint need to set to null before IRQ is released.
         Thanks to issue reported by Song, Yoong Siang.
      Reported-by: default avatarSong, Yoong Siang <yoong.siang.song@intel.com>
      Signed-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8deec94c
  5. 02 Apr, 2021 16 commits