Skip to contentSkip to conversation

virtio_net: don't require ANY_LAYOUT with VERSION_1

PATCH Applied Michael S. Tsirkin 4 participants 7 messages Jul 15, 2015 – Jul 22, 2015

Subsystems (4)
lore
Share & tools
lore

Michael S. Tsirkin

author maintainer
#0 lore raw

PATCH 1/1 virtio_net: don't require ANY_LAYOUT with VERSION_1

ANY_LAYOUT is a compatibility feature. It's implied for VERSION_1 devices, and non-transitional devices might not offer it. Change code to behave accordingly.

---
 drivers/net/virtio_net.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/virtio_net.c +2 -1
index 63c7810..7fbca37 100644
@@ -1828,7 +1828,8 @@ static int virtnet_probe(struct virtio_device *vdev)
 	else
 		vi->hdr_len = sizeof(struct virtio_net_hdr);
 
-	if (virtio_has_feature(vdev, VIRTIO_F_ANY_LAYOUT))
+	if (virtio_has_feature(vdev, VIRTIO_F_ANY_LAYOUT) ||
+	    virtio_has_feature(vdev, VIRTIO_F_VERSION_1))
 		vi->any_header_sg = true;
 
 	if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ))
Signature · 1 line
MST
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Michael S. Tsirkin

ANY_LAYOUT is a compatibility feature. It's implied for VERSION_1 devices, and non-transitional devices might not offer it. Change code to behave accordingly.

---
 drivers/net/virtio_net.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/virtio_net.c +0 -0
index 63c7810..7fbca37 100644

drivers/net/virtio_net.c static int virtnet_probe(struct virtio_device *vdev) · line 1835

Quoted 9 lines
drivers/net/virtio_net.c +2 -1
@@ -1828,7 +1828,8 @@ static int virtnet_probe(struct virtio_device *vdev)
 	else
 		vi->hdr_len = sizeof(struct virtio_net_hdr);
 
-	if (virtio_has_feature(vdev, VIRTIO_F_ANY_LAYOUT))
+	if (virtio_has_feature(vdev, VIRTIO_F_ANY_LAYOUT) ||
+	    virtio_has_feature(vdev, VIRTIO_F_VERSION_1))
 		vi->any_header_sg = true;
 
 	if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ))
Reviewed-by on v1 1/1
#3 lore raw
In reply to Michael S. Tsirkin
Quoted 8 lines · Michael S. Tsirkin

ANY_LAYOUT is a compatibility feature. It's implied for VERSION_1 devices, and non-transitional devices might not offer it. Change code to behave accordingly.

---
 drivers/net/virtio_net.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

author maintainer
#5 lore raw
Quoted 10 lines · David Miller

From: "Michael S. Tsirkin" <[email protected]>
Date: Wed, 15 Jul 2015 15:26:19 +0300

Quoted 5 lines

ANY_LAYOUT is a compatibility feature. It's implied for VERSION_1 devices, and non-transitional devices might not offer it. Change code to behave accordingly.

Applied.

Thanks!
Please also forward this to stable as it's a spec
compliance question.

Signature · 1 line
MST
author maintainer
#6 lore raw
In reply to David Miller
Quoted 10 lines · David Miller

From: "Michael S. Tsirkin" <[email protected]>
Date: Wed, 15 Jul 2015 15:26:19 +0300

Quoted 5 lines

ANY_LAYOUT is a compatibility feature. It's implied for VERSION_1 devices, and non-transitional devices might not offer it. Change code to behave accordingly.

Applied.

Thanks!
Please also forward this to stable as it's a spec
compliance question.

Signature · 1 line
MST