lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 16 Mar 2020 18:22:58 -0700 (PDT) From: David Miller <davem@...emloft.net> To: brouer@...hat.com Cc: netdev@...r.kernel.org, linux-net-drivers@...arflare.com, ecree@...arflare.com, mhabets@...arflare.com, cmclachlan@...arflare.com, ilias.apalodimas@...aro.org, lorenzo@...nel.org, sameehj@...zon.com Subject: Re: [PATCH net-next] sfc: fix XDP-redirect in this driver From: Jesper Dangaard Brouer <brouer@...hat.com> Date: Fri, 13 Mar 2020 14:25:19 +0100 > XDP-redirect is broken in this driver sfc. XDP_REDIRECT requires > tailroom for skb_shared_info when creating an SKB based on the > redirected xdp_frame (both in cpumap and veth). > > The fix requires some initial explaining. The driver uses RX page-split > when possible. It reserves the top 64 bytes in the RX-page for storing > dma_addr (struct efx_rx_page_state). It also have the XDP recommended > headroom of XDP_PACKET_HEADROOM (256 bytes). As it doesn't reserve any > tailroom, it can still fit two standard MTU (1500) frames into one page. > > The sizeof struct skb_shared_info in 320 bytes. Thus drivers like ixgbe > and i40e, reduce their XDP headroom to 192 bytes, which allows them to > fit two frames with max 1536 bytes into a 4K page (192+1536+320=2048). > > The fix is to reduce this drivers headroom to 128 bytes and add the 320 > bytes tailroom. This account for reserved top 64 bytes in the page, and > still fit two frame in a page for normal MTUs. > > We must never go below 128 bytes of headroom for XDP, as one cacheline > is for xdp_frame area and next cacheline is reserved for metadata area. > > Fixes: eb9a36be7f3e ("sfc: perform XDP processing on received packets") > Signed-off-by: Jesper Dangaard Brouer <brouer@...hat.com> > --- > Targetted net-next as this is part of a patchset for adding XDP frame > size and reserving tailroom for multi-buffer XDP Applied, thanks Jesper.
Powered by blists - more mailing lists