1. 22 5月, 2020 3 次提交
  2. 15 5月, 2020 6 次提交
    • J
      xdp: For Intel AF_XDP drivers add XDP frame_sz · 2a637c5b
      Jesper Dangaard Brouer 提交于
      Intel drivers implement native AF_XDP zerocopy in separate C-files,
      that have its own invocation of bpf_prog_run_xdp(). The setup of
      xdp_buff is also handled in separately from normal code path.
      
      This patch update XDP frame_sz for AF_XDP zerocopy drivers i40e, ice
      and ixgbe, as the code changes needed are very similar.  Introduce a
      helper function xsk_umem_xdp_frame_sz() for calculating frame size.
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NBjörn Töpel <bjorn.topel@intel.com>
      Cc: intel-wired-lan@lists.osuosl.org
      Cc: Magnus Karlsson <magnus.karlsson@intel.com>
      Link: https://lore.kernel.org/bpf/158945347511.97035.8536753731329475655.stgit@firesoul
      2a637c5b
    • J
      ice: Add XDP frame size to driver · d4ecdbf7
      Jesper Dangaard Brouer 提交于
      This driver uses different memory models depending on PAGE_SIZE at
      compile time. For PAGE_SIZE 4K it uses page splitting, meaning for
      normal MTU frame size is 2048 bytes (and headroom 192 bytes). For
      larger MTUs the driver still use page splitting, by allocating
      order-1 pages (8192 bytes) for RX frames. For PAGE_SIZE larger than
      4K, driver instead advance its rx_buffer->page_offset with the frame
      size "truesize".
      
      For XDP frame size calculations, this mean that in PAGE_SIZE larger
      than 4K mode the frame_sz change on a per packet basis. For the page
      split 4K PAGE_SIZE mode, xdp.frame_sz is more constant and can be
      updated once outside the main NAPI loop.
      
      The default setting in the driver uses build_skb(), which provides
      the necessary headroom and tailroom for XDP-redirect in RX-frame
      (in both modes).
      
      There is one complication, which is legacy-rx mode (configurable via
      ethtool priv-flags). There are zero headroom in this mode, which is a
      requirement for XDP-redirect to work. The conversion to xdp_frame
      (convert_to_xdp_frame) will detect this insufficient space, and
      xdp_do_redirect() call will fail. This is deemed acceptable, as it
      allows other XDP actions to still work in legacy-mode. In
      legacy-mode + larger PAGE_SIZE due to lacking tailroom, we also
      accept that xdp_adjust_tail shrink doesn't work.
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Cc: intel-wired-lan@lists.osuosl.org
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Cc: Alexander Duyck <alexander.duyck@gmail.com>
      Link: https://lore.kernel.org/bpf/158945347002.97035.328088795813704587.stgit@firesoul
      d4ecdbf7
    • J
      i40e: Add XDP frame size to driver · 24104024
      Jesper Dangaard Brouer 提交于
      This driver uses different memory models depending on PAGE_SIZE at
      compile time. For PAGE_SIZE 4K it uses page splitting, meaning for
      normal MTU frame size is 2048 bytes (and headroom 192 bytes). For
      larger MTUs the driver still use page splitting, by allocating
      order-1 pages (8192 bytes) for RX frames. For PAGE_SIZE larger than
      4K, driver instead advance its rx_buffer->page_offset with the frame
      size "truesize".
      
      For XDP frame size calculations, this mean that in PAGE_SIZE larger
      than 4K mode the frame_sz change on a per packet basis. For the page
      split 4K PAGE_SIZE mode, xdp.frame_sz is more constant and can be
      updated once outside the main NAPI loop.
      
      The default setting in the driver uses build_skb(), which provides
      the necessary headroom and tailroom for XDP-redirect in RX-frame
      (in both modes).
      
      There is one complication, which is legacy-rx mode (configurable via
      ethtool priv-flags). There are zero headroom in this mode, which is a
      requirement for XDP-redirect to work. The conversion to xdp_frame
      (convert_to_xdp_frame) will detect this insufficient space, and
      xdp_do_redirect() call will fail. This is deemed acceptable, as it
      allows other XDP actions to still work in legacy-mode. In
      legacy-mode + larger PAGE_SIZE due to lacking tailroom, we also
      accept that xdp_adjust_tail shrink doesn't work.
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Cc: intel-wired-lan@lists.osuosl.org
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Cc: Alexander Duyck <alexander.duyck@gmail.com>
      Link: https://lore.kernel.org/bpf/158945346494.97035.12809400414566061815.stgit@firesoul
      24104024
    • J
      ixgbevf: Add XDP frame size to VF driver · 81f3c628
      Jesper Dangaard Brouer 提交于
      This patch mirrors the changes to ixgbe in previous patch.
      
      This VF driver doesn't support XDP_REDIRECT, but correct tailroom is
      still necessary for BPF-helper xdp_adjust_tail.  In legacy-mode +
      larger PAGE_SIZE, due to lacking tailroom, we accept that
      xdp_adjust_tail shrink doesn't work.
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Cc: intel-wired-lan@lists.osuosl.org
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Cc: Alexander Duyck <alexander.duyck@gmail.com>
      Link: https://lore.kernel.org/bpf/158945345984.97035.13518286183248025173.stgit@firesoul
      81f3c628
    • J
      ixgbe: Add XDP frame size to driver · cf025128
      Jesper Dangaard Brouer 提交于
      This driver uses different memory models depending on PAGE_SIZE at
      compile time. For PAGE_SIZE 4K it uses page splitting, meaning for
      normal MTU frame size is 2048 bytes (and headroom 192 bytes). For
      larger MTUs the driver still use page splitting, by allocating
      order-1 pages (8192 bytes) for RX frames. For PAGE_SIZE larger than
      4K, driver instead advance its rx_buffer->page_offset with the frame
      size "truesize".
      
      For XDP frame size calculations, this mean that in PAGE_SIZE larger
      than 4K mode the frame_sz change on a per packet basis. For the page
      split 4K PAGE_SIZE mode, xdp.frame_sz is more constant and can be
      updated once outside the main NAPI loop.
      
      The default setting in the driver uses build_skb(), which provides
      the necessary headroom and tailroom for XDP-redirect in RX-frame
      (in both modes).
      
      There is one complication, which is legacy-rx mode (configurable via
      ethtool priv-flags). There are zero headroom in this mode, which is a
      requirement for XDP-redirect to work. The conversion to xdp_frame
      (convert_to_xdp_frame) will detect this insufficient space, and
      xdp_do_redirect() call will fail. This is deemed acceptable, as it
      allows other XDP actions to still work in legacy-mode. In
      legacy-mode + larger PAGE_SIZE due to lacking tailroom, we also
      accept that xdp_adjust_tail shrink doesn't work.
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Cc: intel-wired-lan@lists.osuosl.org
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Cc: Alexander Duyck <alexander.duyck@gmail.com>
      Link: https://lore.kernel.org/bpf/158945345455.97035.14334355929030628741.stgit@firesoul
      cf025128
    • J
      ixgbe: Fix XDP redirect on archs with PAGE_SIZE above 4K · 88eb0ee1
      Jesper Dangaard Brouer 提交于
      The ixgbe driver have another memory model when compiled on archs with
      PAGE_SIZE above 4096 bytes. In this mode it doesn't split the page in
      two halves, but instead increment rx_buffer->page_offset by truesize of
      packet (which include headroom and tailroom for skb_shared_info).
      
      This is done correctly in ixgbe_build_skb(), but in ixgbe_rx_buffer_flip
      which is currently only called on XDP_TX and XDP_REDIRECT, it forgets
      to add the tailroom for skb_shared_info. This breaks XDP_REDIRECT, for
      veth and cpumap.  Fix by adding size of skb_shared_info tailroom.
      
      Maintainers notice: This fix have been queued to Jeff.
      
      Fixes: 64530739 ("ixgbe: add initial support for xdp redirect")
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Link: https://lore.kernel.org/bpf/158945344946.97035.17031588499266605743.stgit@firesoul
      88eb0ee1
  3. 01 5月, 2020 1 次提交
  4. 22 4月, 2020 2 次提交
  5. 20 4月, 2020 14 次提交
  6. 18 4月, 2020 14 次提交
新手
引导
客服 返回
顶部