All of lore.kernel.org
 help / color / mirror / Atom feed
* [virtio-dev] Packed ring only devices clarification
@ 2021-01-29  8:38 Maxime Coquelin
  2021-01-29  9:04 ` Jason Wang
  2021-01-29 15:58 ` [virtio-dev] " Michael S. Tsirkin
  0 siblings, 2 replies; 6+ messages in thread
From: Maxime Coquelin @ 2021-01-29  8:38 UTC (permalink / raw)
  To: virtio-dev, Michael S. Tsirkin, Jason Wang

Hello,

In the Virtqueues section of the Virtio specification [0], it is
mentioned that:

"
Every driver and device supports either the Packed or the Split
Virtqueue format, or both.
"

However, it seems there is no way to differentiate whether the device
supports both split and packed ring, or only packed ring by reading
its features bits.

In the case of live-migration, it means we would need to trigger a
features negotiation before the migration is initiated, and see if
FEATURES_OK device status bit is set. Still, we could not be sure a
failure would be due to the device supporting only packed ring.

Is my understanding correct?

If so, maybe we would need to introduce a new feature bit for split
ring, and also a feature bit indicating compliance with the new spec
version for backward compatibility:

VIRTIO_F_VERSION_1_2(39):
    This indicates compliance with Virtio version 1.2 specification.

VIRTIO_F_RING_SPLIT(40):
    This feature indicates support for the split virtqueue layout as
    described in 2.6 Split Virtqueues.


Best regards,
Maxime

[0]:
https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html#x1-230005


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [virtio-dev] Packed ring only devices clarification
  2021-01-29  8:38 [virtio-dev] Packed ring only devices clarification Maxime Coquelin
@ 2021-01-29  9:04 ` Jason Wang
  2021-01-29  9:14   ` Maxime Coquelin
  2021-01-29 15:58 ` [virtio-dev] " Michael S. Tsirkin
  1 sibling, 1 reply; 6+ messages in thread
From: Jason Wang @ 2021-01-29  9:04 UTC (permalink / raw)
  To: Maxime Coquelin, virtio-dev, Michael S. Tsirkin


On 2021/1/29 下午4:38, Maxime Coquelin wrote:
> Hello,
>
> In the Virtqueues section of the Virtio specification [0], it is
> mentioned that:
>
> "
> Every driver and device supports either the Packed or the Split
> Virtqueue format, or both.
> "
>
> However, it seems there is no way to differentiate whether the device
> supports both split and packed ring, or only packed ring by reading
> its features bits.
>
> In the case of live-migration, it means we would need to trigger a
> features negotiation before the migration is initiated, and see if
> FEATURES_OK device status bit is set. Still, we could not be sure a
> failure would be due to the device supporting only packed ring.
>
> Is my understanding correct?


Yes, I think so.


>
> If so, maybe we would need to introduce a new feature bit for split
> ring, and also a feature bit indicating compliance with the new spec
> version for backward compatibility:
>
> VIRTIO_F_VERSION_1_2(39):
>      This indicates compliance with Virtio version 1.2 specification.
>
> VIRTIO_F_RING_SPLIT(40):
>      This feature indicates support for the split virtqueue layout as
>      described in 2.6 Split Virtqueues.


A question here, do we want to fix this issues with old driver (when 
both of the above are not negotiated)?

Thanks


>
>
> Best regards,
> Maxime
>
> [0]:
> https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html#x1-230005
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [virtio-dev] Packed ring only devices clarification
  2021-01-29  9:04 ` Jason Wang
@ 2021-01-29  9:14   ` Maxime Coquelin
  2021-02-01  7:02     ` Jason Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Maxime Coquelin @ 2021-01-29  9:14 UTC (permalink / raw)
  To: Jason Wang, virtio-dev, Michael S. Tsirkin



On 1/29/21 10:04 AM, Jason Wang wrote:
> 
> On 2021/1/29 下午4:38, Maxime Coquelin wrote:
>> Hello,
>>
>> In the Virtqueues section of the Virtio specification [0], it is
>> mentioned that:
>>
>> "
>> Every driver and device supports either the Packed or the Split
>> Virtqueue format, or both.
>> "
>>
>> However, it seems there is no way to differentiate whether the device
>> supports both split and packed ring, or only packed ring by reading
>> its features bits.
>>
>> In the case of live-migration, it means we would need to trigger a
>> features negotiation before the migration is initiated, and see if
>> FEATURES_OK device status bit is set. Still, we could not be sure a
>> failure would be due to the device supporting only packed ring.
>>
>> Is my understanding correct?
> 
> 
> Yes, I think so.
> 
> 
>>
>> If so, maybe we would need to introduce a new feature bit for split
>> ring, and also a feature bit indicating compliance with the new spec
>> version for backward compatibility:
>>
>> VIRTIO_F_VERSION_1_2(39):
>>      This indicates compliance with Virtio version 1.2 specification.
>>
>> VIRTIO_F_RING_SPLIT(40):
>>      This feature indicates support for the split virtqueue layout as
>>      described in 2.6 Split Virtqueues.
> 
> 
> A question here, do we want to fix this issues with old driver (when
> both of the above are not negotiated)?

Could you elaborate please? I am not sure to understand your question.

For existing devices only supporting packed ring (if it exists, I don't
know any for now), maybe their drivers could have a quirk adding above
features. If we do that, we may want to rename VIRTIO_F_VERSION_1_2 with
something else to restrict it to rings layout support.

Thanks,
Maxime

> Thanks
> 
> 
>>
>>
>> Best regards,
>> Maxime
>>
>> [0]:
>> https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html#x1-230005
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
>> For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [virtio-dev] Re: Packed ring only devices clarification
  2021-01-29  8:38 [virtio-dev] Packed ring only devices clarification Maxime Coquelin
  2021-01-29  9:04 ` Jason Wang
@ 2021-01-29 15:58 ` Michael S. Tsirkin
  2021-02-01  7:04   ` Jason Wang
  1 sibling, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2021-01-29 15:58 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: virtio-dev, Jason Wang

On Fri, Jan 29, 2021 at 09:38:25AM +0100, Maxime Coquelin wrote:
> Hello,
> 
> In the Virtqueues section of the Virtio specification [0], it is
> mentioned that:
> 
> "
> Every driver and device supports either the Packed or the Split
> Virtqueue format, or both.
> "
> 
> However, it seems there is no way to differentiate whether the device
> supports both split and packed ring, or only packed ring by reading
> its features bits.
> 
> In the case of live-migration, it means we would need to trigger a
> features negotiation before the migration is initiated, and see if
> FEATURES_OK device status bit is set. Still, we could not be sure a
> failure would be due to the device supporting only packed ring.
> 
> Is my understanding correct?


The simple answer is that live migration is transparent to
guests and so isn't ATM described by the virtio spec.

devices implementing live migration need not constrain
themselves to using the feature bits described in the spec,
e.g. vhost-user has its own "protocol features".

> If so, maybe we would need to introduce a new feature bit for split
> ring, and also a feature bit indicating compliance with the new spec
> version for backward compatibility:
> 
> VIRTIO_F_VERSION_1_2(39):
>     This indicates compliance with Virtio version 1.2 specification.
> 
> VIRTIO_F_RING_SPLIT(40):
>     This feature indicates support for the split virtqueue layout as
>     described in 2.6 Split Virtqueues.
> 
> 
> Best regards,
> Maxime
> 
> [0]:
> https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html#x1-230005


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [virtio-dev] Packed ring only devices clarification
  2021-01-29  9:14   ` Maxime Coquelin
@ 2021-02-01  7:02     ` Jason Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Wang @ 2021-02-01  7:02 UTC (permalink / raw)
  To: Maxime Coquelin, virtio-dev, Michael S. Tsirkin


On 2021/1/29 下午5:14, Maxime Coquelin wrote:
>
> On 1/29/21 10:04 AM, Jason Wang wrote:
>> On 2021/1/29 下午4:38, Maxime Coquelin wrote:
>>> Hello,
>>>
>>> In the Virtqueues section of the Virtio specification [0], it is
>>> mentioned that:
>>>
>>> "
>>> Every driver and device supports either the Packed or the Split
>>> Virtqueue format, or both.
>>> "
>>>
>>> However, it seems there is no way to differentiate whether the device
>>> supports both split and packed ring, or only packed ring by reading
>>> its features bits.
>>>
>>> In the case of live-migration, it means we would need to trigger a
>>> features negotiation before the migration is initiated, and see if
>>> FEATURES_OK device status bit is set. Still, we could not be sure a
>>> failure would be due to the device supporting only packed ring.
>>>
>>> Is my understanding correct?
>>
>> Yes, I think so.
>>
>>
>>> If so, maybe we would need to introduce a new feature bit for split
>>> ring, and also a feature bit indicating compliance with the new spec
>>> version for backward compatibility:
>>>
>>> VIRTIO_F_VERSION_1_2(39):
>>>       This indicates compliance with Virtio version 1.2 specification.
>>>
>>> VIRTIO_F_RING_SPLIT(40):
>>>       This feature indicates support for the split virtqueue layout as
>>>       described in 2.6 Split Virtqueues.
>>
>> A question here, do we want to fix this issues with old driver (when
>> both of the above are not negotiated)?
> Could you elaborate please? I am not sure to understand your question.


I meant it looks to me we can't avoid the feature pre-negotiation, if we 
migrate to an elder qemu?


>
> For existing devices only supporting packed ring (if it exists, I don't
> know any for now),


Spec doesn't forbid that so I guess there would be some hardware 
implementation will do packed only.


>   maybe their drivers could have a quirk adding above
> features.


It won't be easy consider there will be a software updating in the guest.


>   If we do that, we may want to rename VIRTIO_F_VERSION_1_2 with
> something else to restrict it to rings layout support.


This looks like a common issue which is not packed specific, it might 
happen when destination mandate some features but src doesn't (e.g 
VIRTIO_F_ACCESS_PLATFORM).

Maybe it's the time to introduce an API in the spec to know the features 
that is forced by the device.

Thanks


>
> Thanks,
> Maxime
>
>> Thanks
>>
>>
>>>
>>> Best regards,
>>> Maxime
>>>
>>> [0]:
>>> https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html#x1-230005
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
>>> For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [virtio-dev] Re: Packed ring only devices clarification
  2021-01-29 15:58 ` [virtio-dev] " Michael S. Tsirkin
@ 2021-02-01  7:04   ` Jason Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Wang @ 2021-02-01  7:04 UTC (permalink / raw)
  To: Michael S. Tsirkin, Maxime Coquelin; +Cc: virtio-dev


On 2021/1/29 下午11:58, Michael S. Tsirkin wrote:
> On Fri, Jan 29, 2021 at 09:38:25AM +0100, Maxime Coquelin wrote:
>> Hello,
>>
>> In the Virtqueues section of the Virtio specification [0], it is
>> mentioned that:
>>
>> "
>> Every driver and device supports either the Packed or the Split
>> Virtqueue format, or both.
>> "
>>
>> However, it seems there is no way to differentiate whether the device
>> supports both split and packed ring, or only packed ring by reading
>> its features bits.
>>
>> In the case of live-migration, it means we would need to trigger a
>> features negotiation before the migration is initiated, and see if
>> FEATURES_OK device status bit is set. Still, we could not be sure a
>> failure would be due to the device supporting only packed ring.
>>
>> Is my understanding correct?
>
> The simple answer is that live migration is transparent to
> guests and so isn't ATM described by the virtio spec.


This might require more thoughts, consider in a cloud with multiple 
virtio implementations. How do management know it's safe to migrate 
between two nodes? We probably need something like the concept of 
cluster but there should be way for management to know which parts of 
features is supported and mandated by a device.

Thanks


>
> devices implementing live migration need not constrain
> themselves to using the feature bits described in the spec,
> e.g. vhost-user has its own "protocol features".
>
>> If so, maybe we would need to introduce a new feature bit for split
>> ring, and also a feature bit indicating compliance with the new spec
>> version for backward compatibility:
>>
>> VIRTIO_F_VERSION_1_2(39):
>>      This indicates compliance with Virtio version 1.2 specification.
>>
>> VIRTIO_F_RING_SPLIT(40):
>>      This feature indicates support for the split virtqueue layout as
>>      described in 2.6 Split Virtqueues.
>>
>>
>> Best regards,
>> Maxime
>>
>> [0]:
>> https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html#x1-230005


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-02-01  7:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29  8:38 [virtio-dev] Packed ring only devices clarification Maxime Coquelin
2021-01-29  9:04 ` Jason Wang
2021-01-29  9:14   ` Maxime Coquelin
2021-02-01  7:02     ` Jason Wang
2021-01-29 15:58 ` [virtio-dev] " Michael S. Tsirkin
2021-02-01  7:04   ` Jason Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.