Skip to contentSkip to conversation

virtio-net: Remove RX_EXTRA feature

PATCH In review Alex Williamson 3 participants 7 messages Jun 12, 2009 – Jun 16, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-net: Remove RX_EXTRA feature

No need to use a feature bit to identify the RX modes. The guest will get an error back if the backend doesn't support these controls.

---

 hw/virtio-net.c |    3 +--
 hw/virtio-net.h |    8 ++++----
 2 files changed, 5 insertions(+), 6 deletions(-)
hw/virtio-net.c +1 -2
index d584287..fd5753a 100644
@@ -122,8 +122,7 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev)
                         (1 << VIRTIO_NET_F_STATUS) |
                         (1 << VIRTIO_NET_F_CTRL_VQ) |
                         (1 << VIRTIO_NET_F_CTRL_RX) |
-                        (1 << VIRTIO_NET_F_CTRL_VLAN) |
-                        (1 << VIRTIO_NET_F_CTRL_RX_EXTRA);
+                        (1 << VIRTIO_NET_F_CTRL_VLAN);
 
     return features;
 }
hw/virtio-net.h +4 -4
index 2085181..9bc4210 100644
@@ -43,7 +43,6 @@
 #define VIRTIO_NET_F_CTRL_VQ    17      /* Control channel available */
 #define VIRTIO_NET_F_CTRL_RX    18      /* Control channel RX mode support */
 #define VIRTIO_NET_F_CTRL_VLAN  19      /* Control channel VLAN filtering */
-#define VIRTIO_NET_F_CTRL_RX_EXTRA 20   /* Extra RX mode control support */
 
 #define VIRTIO_NET_S_LINK_UP    1       /* Link is up */
 
@@ -106,9 +105,10 @@ typedef uint8_t virtio_net_ctrl_ack;
 /*
  * Control the RX mode, ie. promisucous, allmulti, etc...
  * All commands require an "out" sg entry containing a 1 byte
- * state value, zero = disable, non-zero = enable.  Commands
- * 0 and 1 are supported with the VIRTIO_NET_F_CTRL_RX feature.
- * Commands 2-5 are added with VIRTIO_NET_F_CTRL_RX_EXTRA.
+ * state value, zero = disable, non-zero = enable.  This group
+ * of commands are available with the VIRTIO_NET_F_CTRL_RX
+ * feature.  Individual commands may return VIRTIO_NET_ERR if
+ * unsupported by the host.
  */
 #define VIRTIO_NET_CTRL_RX_MODE    0
  #define VIRTIO_NET_CTRL_RX_MODE_PROMISC      0
#1 lore raw
Quoted 4 lines · Alex Williamson

No need to use a feature bit to identify the RX modes. The guest will get an error back if the backend doesn't support these controls.

What's the motivation here - are we running out of feature bits already? Using feature bits for everything makes the interface more consistent and IMO easier to use.

Quoted 48 lines

---

 hw/virtio-net.c |    3 +--
 hw/virtio-net.h |    8 ++++----
 2 files changed, 5 insertions(+), 6 deletions(-)
hw/virtio-net.c +1 -2
index d584287..fd5753a 100644
@@ -122,8 +122,7 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev)
                         (1 << VIRTIO_NET_F_STATUS) |
                         (1 << VIRTIO_NET_F_CTRL_VQ) |
                         (1 << VIRTIO_NET_F_CTRL_RX) |
-                        (1 << VIRTIO_NET_F_CTRL_VLAN) |
-                        (1 << VIRTIO_NET_F_CTRL_RX_EXTRA);
+                        (1 << VIRTIO_NET_F_CTRL_VLAN);
 
     return features;
 }
hw/virtio-net.h +4 -4
index 2085181..9bc4210 100644
@@ -43,7 +43,6 @@
 #define VIRTIO_NET_F_CTRL_VQ    17      /* Control channel available */
 #define VIRTIO_NET_F_CTRL_RX    18      /* Control channel RX mode support */
 #define VIRTIO_NET_F_CTRL_VLAN  19      /* Control channel VLAN filtering */
-#define VIRTIO_NET_F_CTRL_RX_EXTRA 20   /* Extra RX mode control support */
 
 #define VIRTIO_NET_S_LINK_UP    1       /* Link is up */
 
@@ -106,9 +105,10 @@ typedef uint8_t virtio_net_ctrl_ack;
 /*
  * Control the RX mode, ie. promisucous, allmulti, etc...
  * All commands require an "out" sg entry containing a 1 byte
- * state value, zero = disable, non-zero = enable.  Commands
- * 0 and 1 are supported with the VIRTIO_NET_F_CTRL_RX feature.
- * Commands 2-5 are added with VIRTIO_NET_F_CTRL_RX_EXTRA.
+ * state value, zero = disable, non-zero = enable.  This group
+ * of commands are available with the VIRTIO_NET_F_CTRL_RX
+ * feature.  Individual commands may return VIRTIO_NET_ERR if
+ * unsupported by the host.
  */
 #define VIRTIO_NET_CTRL_RX_MODE    0
  #define VIRTIO_NET_CTRL_RX_MODE_PROMISC      0
#2 lore raw
Quoted 9 lines · Michael S. Tsirkin
Quoted 4 lines · Alex Williamson

No need to use a feature bit to identify the RX modes.  The guest will get an error back if the backend doesn't support these controls.

What's the motivation here - are we running out of feature bits already? Using feature bits for everything makes the interface more consistent and IMO easier to use.

See the thread starting here:

http://lists.gnu.org/archive/html/qemu-devel/2009-06/msg00519.html

Both Rusty and Mark voted against the feature bit.

Alex

#3 lore raw
Quoted 11 lines · Alex Williamson
Quoted 9 lines · Michael S. Tsirkin
Quoted 4 lines · Alex Williamson

No need to use a feature bit to identify the RX modes. The guest will get an error back if the backend doesn't support these controls.

What's the motivation here - are we running out of feature bits already? Using feature bits for everything makes the interface more consistent and IMO easier to use.

Quoted 5 lines

See the thread starting here:

http://lists.gnu.org/archive/html/qemu-devel/2009-06/msg00519.html

Both Rusty and Mark voted against the feature bit.

Not quite. I was unclear. I support the use of a feature bit. My question is more meta.

Features do need justification. (Not much, but some). It's hard to see the use case where this feature offers significant advantages over promisc. Without that, I'd wait until someone reports a need.

Thanks,
Rusty.

#4 lore raw
Quoted 12 lines · Rusty Russell
Quoted 11 lines · Alex Williamson
Quoted 9 lines · Michael S. Tsirkin
Quoted 4 lines · Alex Williamson

No need to use a feature bit to identify the RX modes. The guest will get an error back if the backend doesn't support these controls.

What's the motivation here - are we running out of feature bits already? Using feature bits for everything makes the interface more consistent and IMO easier to use.

Quoted 8 lines
Quoted 5 lines

See the thread starting here:

http://lists.gnu.org/archive/html/qemu-devel/2009-06/msg00519.html

Both Rusty and Mark voted against the feature bit.

Not quite. I was unclear. I support the use of a feature bit. My question is more meta.

Oh, ok. Let's put this patch on hold then.

Quoted 3 lines

Features do need justification. (Not much, but some). It's hard to see the use case where this feature offers significant advantages over promisc. Without that, I'd wait until someone reports a need.

Thanks for clarifying, a need has been reported. DMX is a proprietary OS that intends to run on KVM and make use of virtio-net. They would like to be able to toggle unicast and multicast independently as well as mask broadcast traffic. The original series re-arranged some of the filter code in the virtio-net backend that allows these filter options to drop out nicely. Thanks,

Alex

#5 lore raw
Quoted 11 lines · Alex Williamson
Quoted 3 lines · Rusty Russell

It's hard to see
the use case where this feature offers significant advantages over promisc. Without that, I'd wait until someone reports a need.

Thanks for clarifying, a need has been reported. DMX is a proprietary OS that intends to run on KVM and make use of virtio-net. They would like to be able to toggle unicast and multicast independently as well as mask broadcast traffic. The original series re-arranged some of the filter code in the virtio-net backend that allows these filter options to drop out nicely.

That's sufficient for me.

Could you re-send feature-based patches if you're happy? Rusty.

#6 lore raw
Quoted 6 lines · Rusty Russell
Quoted 5 lines · Alex Williamson
Quoted 3 lines · Rusty Russell

It's hard to see
the use case where this feature offers significant advantages over promisc. Without that, I'd wait until someone reports a need.

Quoted 8 lines
Quoted 6 lines

Thanks for clarifying, a need has been reported. DMX is a proprietary OS that intends to run on KVM and make use of virtio-net. They would like to be able to toggle unicast and multicast independently as well as mask broadcast traffic. The original series re-arranged some of the filter code in the virtio-net backend that allows these filter options to drop out nicely.

That's sufficient for me.

Great, this feature bit removal patch is official dead then.

Quoted 1 line

Could you re-send feature-based patches if you're happy?

The feature based version already went into the tree via Mark's patch queue, but I'll bounce you copies in case you have any comments that we can fixup in tree before we sync the Linux virtio-net header. Thanks,

Alex