1. 01 Feb, 2023 3 commits
    • Maciej Fijalkowski's avatar
      ice: Store page count inside ice_rx_buf · ac075339
      Maciej Fijalkowski authored
      This will allow us to avoid carrying additional auxiliary array of page
      counts when dealing with XDP multi buffer support. Previously combining
      fragmented frame to skb was not affected in the same way as XDP would be
      as whole frame is needed to be in place before executing XDP prog.
      Therefore, when going through HW Rx descriptors one-by-one, calls to
      ice_put_rx_buf() need to be taken *after* running XDP prog on a
      potentially multi buffered frame, so some additional storage of
      page count is needed.
      
      By adding page count to rx buf, it will make it easier to walk through
      processed entries at the end of rx cleaning routine and decide whether
      or not buffers should be recycled.
      
      While at it, bump ice_rx_buf::pagecnt_bias from u16 up to u32. It was
      proven many times that calculations on variables smaller than standard
      register size are harmful. This was also the case during experiments
      with embedding page count to ice_rx_buf - when this was added as u16 it
      had a performance impact.
      Signed-off-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Reviewed-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Link: https://lore.kernel.org/bpf/20230131204506.219292-4-maciej.fijalkowski@intel.com
      ac075339
    • Maciej Fijalkowski's avatar
      ice: Add xdp_buff to ice_rx_ring struct · cb0473e0
      Maciej Fijalkowski authored
      In preparation for XDP multi-buffer support, let's store xdp_buff on
      Rx ring struct. This will allow us to combine fragmented frames across
      separate NAPI cycles in the same way as currently skb fragments are
      handled. This means that skb pointer on Rx ring will become redundant
      and will be removed. For now it is kept and layout of Rx ring struct was
      not inspected, some member movement will be needed later on so that will
      be the time to take care of it.
      Signed-off-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Reviewed-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Link: https://lore.kernel.org/bpf/20230131204506.219292-3-maciej.fijalkowski@intel.com
      cb0473e0
    • Maciej Fijalkowski's avatar
      ice: Prepare legacy-rx for upcoming XDP multi-buffer support · c61bcebd
      Maciej Fijalkowski authored
      Rx path is going to be modified in a way that fragmented frame will be
      gathered within xdp_buff in the first place. This approach implies that
      underlying buffer has to provide tailroom for skb_shared_info. This is
      currently the case when ring uses build_skb but not when legacy-rx knob
      is turned on. This case configures 2k Rx buffers and has no way to
      provide either headroom or tailroom - FWIW it currently has
      XDP_PACKET_HEADROOM which is broken and in here it is removed. 2k Rx
      buffers were used so driver in this setting was able to support 9k MTU
      as it can chain up to 5 Rx buffers. With offset configuring HW writing
      2k of a data was passing the half of the page which broke the assumption
      of our internal page recycling tricks.
      
      Now if above got fixed and legacy-rx path would be left as is, when
      referring to skb_shared_info via xdp_get_shared_info_from_buff(),
      packet's content would be corrupted again. Hence size of Rx buffer needs
      to be lowered and therefore supported MTU. This operation will allow us
      to keep the unified data path and with 8k MTU users (if any of
      legacy-rx) would still be good to go. However, tendency is to drop the
      support for this code path at some point.
      
      Add ICE_RXBUF_1664 as vsi::rx_buf_len and ICE_MAX_FRAME_LEGACY_RX (8320)
      as vsi::max_frame for legacy-rx. For bigger page sizes configure 3k Rx
      buffers, not 2k.
      
      Since headroom support is removed, disable data_meta support on legacy-rx.
      When preparing XDP buff, rely on ice_rx_ring::rx_offset setting when
      deciding whether to support data_meta or not.
      Signed-off-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Reviewed-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Link: https://lore.kernel.org/bpf/20230131204506.219292-2-maciej.fijalkowski@intel.com
      c61bcebd
  2. 30 Jan, 2023 9 commits
  3. 28 Jan, 2023 28 commits