Thread (39 messages) 39 messages, 3 authors, 2020-05-18

[PATCH net-next v4 20/33] vhost_net: also populate XDP frame size

flat view
STALE2352d LANDED: 2 (1M)

From: Jesper Dangaard Brouer <hidden>
Date: 2020-05-14 10:50:52
Also in: bpf
Subsystem: the rest, virtio host (vhost) · Maintainers: Linus Torvalds, "Michael S. Tsirkin", Jason Wang, Eugenio Pérez

Status: Landed in mainline as 05afee298afc on 2020-05-15.

Revision v4 (4 revisions archived); 2 review trailers (1 from subsystem maintainers).

Revisions (4)
  1. v2 re-posted go to this post
  2. v1 [diff against previous]
  3. v3 [diff against previous]
  4. v4 current [diff against previous]
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.

Cc: Jason Wang <redacted>
Signed-off-by: Jesper Dangaard Brouer <redacted>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <redacted>
---
 drivers/vhost/net.c |    1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 2927f02cc7e1..516519dcc8ff 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -747,6 +747,7 @@ static int vhost_net_build_xdp(struct vhost_net_virtqueue *nvq,
 	xdp->data = buf + pad;
 	xdp->data_end = xdp->data + len;
 	hdr->buflen = buflen;
+	xdp->frame_sz = buflen;
 
 	--net->refcnt_bias;
 	alloc_frag->offset += buflen;

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help