Skip to contentSkip to conversation

virtio-spec: clarify ro/rw bits and updating rule of virtio-net status field

PATCH In review Jason Wang 3 participants 8 messages Mar 20, 2012 – Mar 23, 2012 virtio core

lore
Share & tools
lore

Jason Wang

author
#0 lore raw

PATCH 1/1 virtio-spec: clarify ro/rw bits and updating rule of virtio-net status field

This patch clarifies VIRTIO_NET_S_LINK_UP as a read-only bit and VIRTIO_NET_S_ANNOUNCE as a read-writable bit. Also introduce the write 1 to clear semantics for all read-writable bits of config status field. This could help to reduce the config status field updating race between host and guest and also simplify the implementation.

---
 virtio-0.9.4.lyx |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)
virtio-0.9.4.lyx +21 -2
index 6c7bab1..614ab55 100644
@@ -58,6 +58,7 @@
 \html_be_strict false
 \author -608949062 "Rusty Russell,,," 
 \author 1531152142 "pbonzini" 
+\author 2090695081 "jason" 
 \end_header
 
 \begin_body
@@ -4013,7 +4014,21 @@ layout Two configuration fields are currently defined.
  The mac address field always exists (though is only valid if VIRTIO_NET_F_MAC
  is set), and the status field only exists if VIRTIO_NET_F_STATUS is set.
  Two bits are currently defined for the status field: VIRTIO_NET_S_LINK_UP
- and VIRTIO_NET_S_ANNOUNCE.
+ 
+\change_inserted 2090695081 1332220873
+(read-only) 
+\change_unchanged
+and VIRTIO_NET_S_ANNOUNCE
+\change_inserted 2090695081 1332220883
+ (read-writable)
+\change_unchanged
+.
+
+\change_inserted 2090695081 1332220901
+ Writing 1 to any read-writable bit of status filed would cause the bit
+ to be cleared.
+
+\change_unchanged
  
 \begin_inset listings
 inline false
@@ -4915,7 +4930,11 @@ Processing this notification involves:
 \end_layout
 
 \begin_layout Enumerate
-Clearing VIRTIO_NET_S_ANNOUNCE bit in the status field.
+Clearing VIRTIO_NET_S_ANNOUNCE bit in the status field
+\change_inserted 2090695081 1332220849
+ (by writing 1 to VIRTIO_NET_S_ANNOUNCE bit)
+\change_unchanged
+.
 \end_layout
 
 \begin_layout Enumerate
#1 lore raw
Quoted 7 lines · Jason Wang

This patch clarifies VIRTIO_NET_S_LINK_UP as a read-only bit and VIRTIO_NET_S_ANNOUNCE as a read-writable bit. Also introduce the write 1 to clear semantics for all read-writable bits of config status field. This could help to reduce the config status field updating race between host and guest and also simplify the implementation.

This approach assumes an active config field, which neither lguest nor S/390 have.

Thanks,
Rusty.

Signature · 1 line
  How could I marry someone with more hair than me?  http://baldalex.org
#2 lore raw
In reply to Jason Wang
Quoted 7 lines · Jason Wang

This patch clarifies VIRTIO_NET_S_LINK_UP as a read-only bit and VIRTIO_NET_S_ANNOUNCE as a read-writable bit. Also introduce the write 1 to clear semantics for all read-writable bits of config status field. This could help to reduce the config status field updating race between host and guest and also simplify the implementation.

This approach assumes an active config field, which neither lguest nor S/390 have.

Thanks,
Rusty.

Signature · 1 line
  How could I marry someone with more hair than me?  http://baldalex.org
#3 lore raw
Quoted 7 lines · Rusty Russell
Quoted 6 lines · Jason Wang

This patch clarifies VIRTIO_NET_S_LINK_UP as a read-only bit and VIRTIO_NET_S_ANNOUNCE as a read-writable bit. Also introduce the write 1 to clear semantics for all read-writable bits of config status field. This could help to reduce the config status field updating race between host and guest and also simplify the implementation.

Quoted 7 lines
Quoted 1 line

This approach assumes an active config field, which neither lguest nor S/390 have.

Thanks,
Rusty.

What does 'active' mean in this context?

Quoted 2 lines
Signature · 1 line
  How could I marry someone with more hair than me?  http://baldalex.org
#4 lore raw
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Rusty Russell
Quoted 7 lines · Jason Wang

This patch clarifies VIRTIO_NET_S_LINK_UP as a read-only bit and VIRTIO_NET_S_ANNOUNCE as a read-writable bit. Also introduce the write 1 to clear semantics for all read-writable bits of config status field. This could help to reduce the config status field updating race between host and guest and also simplify the implementation.

Quoted 7 lines
Quoted 5 lines

This approach assumes an active config field, which neither lguest nor S/390 have.

Thanks,
Rusty.

What does 'active' mean in this context?

It means you are assuming that writes to the config field trap to the host.

Rusty.

Signature · 1 line
  How could I marry someone with more hair than me?  http://baldalex.org
#5 lore raw
Quoted 17 lines · Rusty Russell
Quoted 16 lines · Michael S. Tsirkin
Quoted 14 lines · Rusty Russell
Quoted 7 lines · Jason Wang

This patch clarifies VIRTIO_NET_S_LINK_UP as a read-only bit and VIRTIO_NET_S_ANNOUNCE as a read-writable bit. Also introduce the write 1 to clear semantics for all read-writable bits of config status field. This could help to reduce the config status field updating race between host and guest and also simplify the implementation.

This approach assumes an active config field, which neither lguest nor S/390 have.

Thanks,
Rusty.

Quoted 6 lines
Quoted 1 line

What does 'active' mean in this context?

It means you are assuming that writes to the config field trap to the host.

Rusty.

Ah. Right, we need to trap for host to clear the bit. OK, so let's make the bit RO, and add VIRTIO_NET_CTRL_ANNOUNCED to acknowledge that we've seen VIRTIO_NET_S_ANNOUNCE using the control VQ?

If there's no ctrl VQ, we won't acknowledge the feature bit ...

Quoted 2 lines
Signature · 1 line
  How could I marry someone with more hair than me?  http://baldalex.org
#6 lore raw
Quoted 4 lines · Michael S. Tsirkin

Ah. Right, we need to trap for host to clear the bit. OK, so let's make the bit RO, and add VIRTIO_NET_CTRL_ANNOUNCED to acknowledge that we've seen VIRTIO_NET_S_ANNOUNCE using the control VQ?

Thanks, that's nice. Guest should send arp packets first, then send VIRTIO_NET_CTRL_ANNOUNCED, and ignore the bit being set in the meantime.

Thanks,
Rusty.

Signature · 1 line
  How could I marry someone with more hair than me?  http://baldalex.org
author
#7 lore raw
Quoted 10 lines · Rusty Russell
Quoted 4 lines · Michael S. Tsirkin

Ah. Right, we need to trap for host to clear the bit. OK, so let's make the bit RO, and add VIRTIO_NET_CTRL_ANNOUNCED to acknowledge that we've seen VIRTIO_NET_S_ANNOUNCE using the control VQ?

Thanks, that's nice. Guest should send arp packets first, then send VIRTIO_NET_CTRL_ANNOUNCED, and ignore the bit being set in the meantime.

Thanks,
Rusty.

Sure, I would update and re-send the spec updating patch.

Thanks