aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/net/xdp_sock.h
diff options
context:
space:
mode:
authorJesper Dangaard Brouer <brouer@redhat.com>2020-05-14 12:51:10 +0200
committerAlexei Starovoitov <ast@kernel.org>2020-05-14 21:21:56 -0700
commitd4ecdbf7aa2fa4feac09befb04cdaf44e6dc938b (patch)
tree2cbc3416a573bffba3b7105c0118a05964c79d57 /include/net/xdp_sock.h
parenti40e: Add XDP frame size to driver (diff)
downloadwireguard-linux-d4ecdbf7aa2fa4feac09befb04cdaf44e6dc938b.tar.xz
wireguard-linux-d4ecdbf7aa2fa4feac09befb04cdaf44e6dc938b.zip
ice: Add XDP frame size to driver
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: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Alexei 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
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions