Skip to contentSkip to conversation

vhost-user: don't ignore CTRL_VLAN feature

RFC In review Tiwei Bie 3 participants 9 messages Jun 11, 2019 – Jul 18, 2019

lore
Share & tools
lore

Tiwei Bie

author
#0 lore raw

RFC 1/1 vhost-user: don't ignore CTRL_VLAN feature

The VIRTIO_NET_F_CTRL_VLAN feature requires the support of vhost-user backend. But it will be advertised to guest driver as long as it's enabled by users in QEMU, while it's not supported by vhost-user backend. This patch fixes this issue.

Fixes 72018d1e1917 ("vhost-user: ignore qemu-only features")

---
It's not clear in the spec that, whether vlan filtering is also best-effort:
https://github.com/oasis-tcs/virtio-spec/blob/37057052e7/content.tex#L3372

 hw/net/vhost_net.c | 2 ++
 1 file changed, 2 insertions(+)
hw/net/vhost_net.c +2 -0
index a6b719035c..1444fc9230 100644
@@ -75,6 +75,8 @@ static const int user_feature_bits[] = {
     VIRTIO_NET_F_MTU,
     VIRTIO_F_IOMMU_PLATFORM,
 
+    VIRTIO_NET_F_CTRL_VLAN,
+
     /* This bit implies RARP isn't sent by QEMU out of band */
     VIRTIO_NET_F_GUEST_ANNOUNCE,
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 6 lines · Tiwei Bie

The VIRTIO_NET_F_CTRL_VLAN feature requires the support of vhost-user backend. But it will be advertised to guest driver as long as it's enabled by users in QEMU, while it's not supported by vhost-user backend. This patch fixes this issue.

Fixes 72018d1e1917 ("vhost-user: ignore qemu-only features")

My understanding is if may want to revert this patch.

Quoted 7 lines

---
It's not clear in the spec that, whether vlan filtering is also best-effort:
https://github.com/oasis-tcs/virtio-spec/blob/37057052e7/content.tex#L3372

It should be a bug of the code, we should consider to implement ctrl command for vhost-user.

Thanks

Quoted 17 lines
  hw/net/vhost_net.c | 2 ++
  1 file changed, 2 insertions(+)
hw/net/vhost_net.c +2 -0
index a6b719035c..1444fc9230 100644
@@ -75,6 +75,8 @@ static const int user_feature_bits[] = {
      VIRTIO_NET_F_MTU,
      VIRTIO_F_IOMMU_PLATFORM,
 
+    VIRTIO_NET_F_CTRL_VLAN,
+
      /* This bit implies RARP isn't sent by QEMU out of band */
      VIRTIO_NET_F_GUEST_ANNOUNCE,
 
author
#2 lore raw
Quoted 22 lines · Jason Wang
Quoted 6 lines · Tiwei Bie

The VIRTIO_NET_F_CTRL_VLAN feature requires the support of vhost-user backend. But it will be advertised to guest driver as long as it's enabled by users in QEMU, while it's not supported by vhost-user backend. This patch fixes this issue.

Fixes 72018d1e1917 ("vhost-user: ignore qemu-only features")

My understanding is if may want to revert this patch.

Quoted 7 lines

---
It's not clear in the spec that, whether vlan filtering is also best-effort:
https://github.com/oasis-tcs/virtio-spec/blob/37057052e7/content.tex#L3372

Quoted 2 lines

It should be a bug of the code, we should consider to implement ctrl command for vhost-user.

Yeah, we need to pass these information to backends if we want to make it possible to support it in vhost-user.

Quoted 19 lines

Thanks

Quoted 15 lines
  hw/net/vhost_net.c | 2 ++
  1 file changed, 2 insertions(+)
hw/net/vhost_net.c +2 -0
index a6b719035c..1444fc9230 100644
@@ -75,6 +75,8 @@ static const int user_feature_bits[] = {
      VIRTIO_NET_F_MTU,
      VIRTIO_F_IOMMU_PLATFORM,
+    VIRTIO_NET_F_CTRL_VLAN,
+
      /* This bit implies RARP isn't sent by QEMU out of band */
      VIRTIO_NET_F_GUEST_ANNOUNCE,
#3 lore raw
In reply to Tiwei Bie
Quoted 4 lines · Tiwei Bie

The VIRTIO_NET_F_CTRL_VLAN feature requires the support of vhost-user backend. But it will be advertised to guest driver as long as it's enabled by users in QEMU, while it's not supported by vhost-user backend. This patch fixes this issue.

Fixes by making guest refuse to send vlan tags?
I agree it seems cleaner, but which guests does this actually help?

Quoted 4 lines
Fixes 72018d1e1917 ("vhost-user: ignore qemu-only features")

A change like that will break migration compatibility, will it not? Maybe we need to tie it to a machine version somehow...

Quoted 4 lines

---
It's not clear in the spec that, whether vlan filtering is also best-effort:
https://github.com/oasis-tcs/virtio-spec/blob/37057052e7/content.tex#L3372

So what breaks if we declare it best effort for now? And does it really help if we report that vlan filtering is not supported to guests?

Quoted 18 lines
 hw/net/vhost_net.c | 2 ++
 1 file changed, 2 insertions(+)
hw/net/vhost_net.c +2 -0
index a6b719035c..1444fc9230 100644
@@ -75,6 +75,8 @@ static const int user_feature_bits[] = {
     VIRTIO_NET_F_MTU,
     VIRTIO_F_IOMMU_PLATFORM,
 
+    VIRTIO_NET_F_CTRL_VLAN,
+
     /* This bit implies RARP isn't sent by QEMU out of band */
     VIRTIO_NET_F_GUEST_ANNOUNCE,
 
Signature · 1 line
2.17.1
author
#4 lore raw
Quoted 7 lines · Michael S. Tsirkin
Quoted 4 lines · Tiwei Bie

The VIRTIO_NET_F_CTRL_VLAN feature requires the support of vhost-user backend. But it will be advertised to guest driver as long as it's enabled by users in QEMU, while it's not supported by vhost-user backend. This patch fixes this issue.

Fixes by making guest refuse to send vlan tags?

Fixes by not advertising this feature bit to guest driver when it's not supported, and guest won't expect the device to do vlan filtering then.

Quoted 8 lines

I agree it seems cleaner, but which guests does this actually help?

Quoted 4 lines
Fixes 72018d1e1917 ("vhost-user: ignore qemu-only features")

A change like that will break migration compatibility, will it not?

Yeah, that's a problem...

Quoted 11 lines

Maybe we need to tie it to a machine version somehow...

Quoted 4 lines

---
It's not clear in the spec that, whether vlan filtering is also best-effort:
https://github.com/oasis-tcs/virtio-spec/blob/37057052e7/content.tex#L3372

So what breaks if we declare it best effort for now? And does it really help if we report that vlan filtering is not supported to guests?

If it's best effort, then it won't violate the spec to advertise this feature when it's not supported in backends.

Quoted 21 lines
Quoted 21 lines


 hw/net/vhost_net.c | 2 ++
 1 file changed, 2 insertions(+)
hw/net/vhost_net.c +2 -0
index a6b719035c..1444fc9230 100644
@@ -75,6 +75,8 @@ static const int user_feature_bits[] = {
     VIRTIO_NET_F_MTU,
     VIRTIO_F_IOMMU_PLATFORM,
 
+    VIRTIO_NET_F_CTRL_VLAN,
+
     /* This bit implies RARP isn't sent by QEMU out of band */
     VIRTIO_NET_F_GUEST_ANNOUNCE,
 
Signature · 1 line
2.17.1
#5 lore raw
Quoted 32 lines · Tiwei Bie
Quoted 7 lines · Michael S. Tsirkin
Quoted 4 lines · Tiwei Bie

The VIRTIO_NET_F_CTRL_VLAN feature requires the support of vhost-user backend. But it will be advertised to guest driver as long as it's enabled by users in QEMU, while it's not supported by vhost-user backend. This patch fixes this issue.

Fixes by making guest refuse to send vlan tags?

Fixes by not advertising this feature bit to guest driver when it's not supported, and guest won't expect the device to do vlan filtering then.

Quoted 8 lines

I agree it seems cleaner, but which guests does this actually help?

Quoted 4 lines
Fixes 72018d1e1917 ("vhost-user: ignore qemu-only features")

A change like that will break migration compatibility, will it not?

Yeah, that's a problem...

Quoted 8 lines

Maybe we need to tie it to a machine version somehow...

Quoted 4 lines

---
It's not clear in the spec that, whether vlan filtering is also best-effort:
https://github.com/oasis-tcs/virtio-spec/blob/37057052e7/content.tex#L3372

Quoted 7 lines
Quoted 3 lines

So what breaks if we declare it best effort for now? And does it really help if we report that vlan filtering is not supported to guests?

If it's best effort, then it won't violate the spec to advertise this feature when it's not supported in backends.

OK so it's up to you. Want to propose a spec patch? We already say mac filter is best effort ...

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines


 hw/net/vhost_net.c | 2 ++
 1 file changed, 2 insertions(+)
hw/net/vhost_net.c +2 -0
index a6b719035c..1444fc9230 100644
@@ -75,6 +75,8 @@ static const int user_feature_bits[] = {
     VIRTIO_NET_F_MTU,
     VIRTIO_F_IOMMU_PLATFORM,
 
+    VIRTIO_NET_F_CTRL_VLAN,
+
     /* This bit implies RARP isn't sent by QEMU out of band */
     VIRTIO_NET_F_GUEST_ANNOUNCE,
 
Signature · 1 line
2.17.1
#6 lore raw
Quoted 28 lines · Michael S. Tsirkin
Quoted 27 lines · Tiwei Bie
Quoted 6 lines · Michael S. Tsirkin
Quoted 4 lines · Tiwei Bie

The VIRTIO_NET_F_CTRL_VLAN feature requires the support of vhost-user backend. But it will be advertised to guest driver as long as it's enabled by users in QEMU, while it's not supported by vhost-user backend. This patch fixes this issue.

Fixes by making guest refuse to send vlan tags?

Fixes by not advertising this feature bit to guest driver when it's not supported, and guest won't expect the device to do vlan filtering then.

Quoted 7 lines

I agree it seems cleaner, but which guests does this actually help?

Quoted 4 lines
Fixes 72018d1e1917 ("vhost-user: ignore qemu-only features")

A change like that will break migration compatibility, will it not?

Yeah, that's a problem...

Quoted 7 lines

Maybe we need to tie it to a machine version somehow...

Quoted 4 lines

---
It's not clear in the spec that, whether vlan filtering is also best-effort:
https://github.com/oasis-tcs/virtio-spec/blob/37057052e7/content.tex#L3372

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

So what breaks if we declare it best effort for now? And does it really help if we report that vlan filtering is not supported to guests?

If it's best effort, then it won't violate the spec to advertise this feature when it's not supported in backends.

OK so it's up to you. Want to propose a spec patch? We already say mac filter is best effort ...

This probably need more thought. Consider in the future, we want to have filters that can steering packet based on its mac address to a specific queue. Then we can add e.g macvlan offloading support. Saying "best effort" might be wrong in that cases.

Thanks

Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines

  hw/net/vhost_net.c | 2 ++
  1 file changed, 2 insertions(+)
hw/net/vhost_net.c +2 -0
index a6b719035c..1444fc9230 100644
@@ -75,6 +75,8 @@ static const int user_feature_bits[] = {
      VIRTIO_NET_F_MTU,
      VIRTIO_F_IOMMU_PLATFORM,
 
+    VIRTIO_NET_F_CTRL_VLAN,
+
      /* This bit implies RARP isn't sent by QEMU out of band */
      VIRTIO_NET_F_GUEST_ANNOUNCE,
 
Signature · 1 line
2.17.1
#7 lore raw
Quoted 40 lines · Jason Wang
Quoted 28 lines · Michael S. Tsirkin
Quoted 27 lines · Tiwei Bie
Quoted 6 lines · Michael S. Tsirkin
Quoted 4 lines · Tiwei Bie

The VIRTIO_NET_F_CTRL_VLAN feature requires the support of vhost-user backend. But it will be advertised to guest driver as long as it's enabled by users in QEMU, while it's not supported by vhost-user backend. This patch fixes this issue.

Fixes by making guest refuse to send vlan tags?

Fixes by not advertising this feature bit to guest driver when it's not supported, and guest won't expect the device to do vlan filtering then.

Quoted 7 lines

I agree it seems cleaner, but which guests does this actually help?

Quoted 4 lines
Fixes 72018d1e1917 ("vhost-user: ignore qemu-only features")

A change like that will break migration compatibility, will it not?

Yeah, that's a problem...

Quoted 7 lines

Maybe we need to tie it to a machine version somehow...

Quoted 4 lines

---
It's not clear in the spec that, whether vlan filtering is also best-effort:
https://github.com/oasis-tcs/virtio-spec/blob/37057052e7/content.tex#L3372

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

So what breaks if we declare it best effort for now? And does it really help if we report that vlan filtering is not supported to guests?

If it's best effort, then it won't violate the spec to advertise this feature when it's not supported in backends.

OK so it's up to you. Want to propose a spec patch? We already say mac filter is best effort ...

Quoted 8 lines

This probably need more thought. Consider in the future, we want to have filters that can steering packet based on its mac address to a specific queue. Then we can add e.g macvlan offloading support. Saying "best effort" might be wrong in that cases.

Thanks

We can always add a feature bit. Spec should reflect the way implementations behave now.

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

  hw/net/vhost_net.c | 2 ++
  1 file changed, 2 insertions(+)
hw/net/vhost_net.c +2 -0
index a6b719035c..1444fc9230 100644
@@ -75,6 +75,8 @@ static const int user_feature_bits[] = {
      VIRTIO_NET_F_MTU,
      VIRTIO_F_IOMMU_PLATFORM,
+    VIRTIO_NET_F_CTRL_VLAN,
+
      /* This bit implies RARP isn't sent by QEMU out of band */
      VIRTIO_NET_F_GUEST_ANNOUNCE,
Signature · 1 line
2.17.1
author
#8 lore raw
In reply to Michael S. Tsirkin
Quoted 37 lines · Michael S. Tsirkin
Quoted 36 lines · Tiwei Bie
Quoted 7 lines · Michael S. Tsirkin
Quoted 4 lines · Tiwei Bie

The VIRTIO_NET_F_CTRL_VLAN feature requires the support of vhost-user backend. But it will be advertised to guest driver as long as it's enabled by users in QEMU, while it's not supported by vhost-user backend. This patch fixes this issue.

Fixes by making guest refuse to send vlan tags?

Fixes by not advertising this feature bit to guest driver when it's not supported, and guest won't expect the device to do vlan filtering then.

Quoted 8 lines

I agree it seems cleaner, but which guests does this actually help?

Quoted 4 lines
Fixes 72018d1e1917 ("vhost-user: ignore qemu-only features")

A change like that will break migration compatibility, will it not?

Yeah, that's a problem...

Quoted 11 lines

Maybe we need to tie it to a machine version somehow...

Quoted 4 lines

---
It's not clear in the spec that, whether vlan filtering is also best-effort:
https://github.com/oasis-tcs/virtio-spec/blob/37057052e7/content.tex#L3372

So what breaks if we declare it best effort for now? And does it really help if we report that vlan filtering is not supported to guests?

Quoted 6 lines
Quoted 3 lines

If it's best effort, then it won't violate the spec to advertise this feature when it's not supported in backends.

OK so it's up to you. Want to propose a spec patch? We already say mac filter is best effort ...

Done, below is the link:
https://lists.oasis-open.org/archives/virtio-dev/201907/msg00035.html

Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines



 hw/net/vhost_net.c | 2 ++
 1 file changed, 2 insertions(+)
hw/net/vhost_net.c +2 -0
index a6b719035c..1444fc9230 100644
@@ -75,6 +75,8 @@ static const int user_feature_bits[] = {
     VIRTIO_NET_F_MTU,
     VIRTIO_F_IOMMU_PLATFORM,
 
+    VIRTIO_NET_F_CTRL_VLAN,
+
     /* This bit implies RARP isn't sent by QEMU out of band */
     VIRTIO_NET_F_GUEST_ANNOUNCE,
 
Signature · 1 line
2.17.1