]> git.baikalelectronics.ru Git - kernel.git/commit
vhost_net: Also populate XDP frame size
authorJesper Dangaard Brouer <brouer@redhat.com>
Thu, 14 May 2020 10:50:39 +0000 (12:50 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 15 May 2020 04:21:55 +0000 (21:21 -0700)
commitd510ddf9e81e4d7ec3f2bb99a15a5c9d7c6096c3
treedcda0b333a72b6af22edd6bd36a9e65914aef529
parent80bf7d962340e5cb5af43be6950227dd70a1ea66
vhost_net: Also populate XDP frame size

In vhost_net_build_xdp() the 'buf' that gets queued via an xdp_buff
have embedded a struct tun_xdp_hdr (located at xdp->data_hard_start)
which contains the buffer length 'buflen' (with tailroom for
skb_shared_info). Also storing this buflen in xdp->frame_sz, does not
obsolete struct tun_xdp_hdr, as it also contains a struct
virtio_net_hdr with other information.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/bpf/158945343928.97035.4620233649151726289.stgit@firesoul
drivers/vhost/net.c