Thread (12 messages) 12 messages, 2 authors, 2017-07-06

Re: [PATCH net] virtio-net: unbreak cusmed packet for small buffer XDP

From: Jason Wang <jasowang@redhat.com>
Date: 2017-06-28 02:14:47
Also in: lkml, virtualization


On 2017年06月28日 10:02, Michael S. Tsirkin wrote:
On Wed, Jun 28, 2017 at 09:54:03AM +0800, Jason Wang wrote:
quoted
We should allow csumed packet for small buffer, otherwise XDP_PASS
won't work correctly.

Fixes commit bb91accf2733 ("virtio-net: XDP support for small buffers")
Signed-off-by: Jason Wang <jasowang@redhat.com>
The issue would be VIRTIO_NET_HDR_F_DATA_VALID might be set.
What do you think?
I think it's safe. For XDP_PASS, it work like in the past. For XDP_TX, 
we zero the vnet header. For adjusting header, XDP prog should deal with 
csum.

Thanks
quoted
---
The patch is needed for -stable.
---
  drivers/net/virtio_net.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 143d8a9..499fcc9 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -413,7 +413,7 @@ static struct sk_buff *receive_small(struct net_device *dev,
  		void *orig_data;
  		u32 act;
  
-		if (unlikely(hdr->hdr.gso_type || hdr->hdr.flags))
+		if (unlikely(hdr->hdr.gso_type))
  			goto err_xdp;
  
  		xdp.data_hard_start = buf + VIRTNET_RX_PAD + vi->hdr_len;
-- 
2.7.4
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help