diff options
author | Willem de Bruijn <willemb@google.com> | 2020-05-30 21:41:31 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-01 21:01:46 +0200 |
commit | 96aa1b22bd6bb9fccf62f6261f390ed6f3e7967f (patch) | |
tree | 36eef58c8426bc69d7db97739101bf11ebc887af /CREDITS | |
parent | cls_flower: remove mpls_opts_policy (diff) | |
download | linux-96aa1b22bd6bb9fccf62f6261f390ed6f3e7967f.tar.xz linux-96aa1b22bd6bb9fccf62f6261f390ed6f3e7967f.zip |
tun: correct header offsets in napi frags mode
Tun in IFF_NAPI_FRAGS mode calls napi_gro_frags. Unlike netif_rx and
netif_gro_receive, this expects skb->data to point to the mac layer.
But skb_probe_transport_header, __skb_get_hash_symmetric, and
xdp_do_generic in tun_get_user need skb->data to point to the network
header. Flow dissection also needs skb->protocol set, so
eth_type_trans has to be called.
Ensure the link layer header lies in linear as eth_type_trans pulls
ETH_HLEN. Then take the same code paths for frags as for not frags.
Push the link layer header back just before calling napi_gro_frags.
By pulling up to ETH_HLEN from frag0 into linear, this disables the
frag0 optimization in the special case when IFF_NAPI_FRAGS is used
with zero length iov[0] (and thus empty skb->linear).
Fixes: 90e33d459407 ("tun: enable napi_gro_frags() for TUN/TAP driver")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Petar Penkov <ppenkov@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'CREDITS')
0 files changed, 0 insertions, 0 deletions