OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [virtio-dev] Clarification of VIRTIO_F_EVENT_IDX driver conditions.


The issue may trigger in the unlikely uint16_t overflow case of computing the difference between two index positions. An example would be a network driver where the host and guest are producing and consuming steadily but at different rates. The producer is producing faster than the consumer such that the consumer never needed to be notified of new events, as it is still playing catch up processing the queue.

If the producer finally catches up to the consumer and the catchup occurs just past the overflow point, there exists a case where a notification must be sent but is not sent according to the current ruleset. 

-Patrick Mosca

> On Jun 5, 2022, at 1:29 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> 
> On Wed, Jun 01, 2022 at 01:03:27PM -0700, Patrick Mosca wrote:
>> We ran into an edge case in the VIRTIO_F_EVENT_IDX feature where a notification could be missed if there is a "streak" in skipped notifications. If the difference between the event index and available index wraps before a notification is needed, there exists a case where a notification must be sent but is not sent.
>> 
>> 
>> Signed-off-by: Patrick Mosca <pmosca@apple.com>
>> Signed-off-by: Cameron Esfahani <dirty@apple.com>
>> ---
>> split-ring.tex | 3 +++
>> 1 file changed, 3 insertions(+)
>> 
>> diff --git a/split-ring.tex b/split-ring.tex
>> index bfef62d..9650e5e 100644
>> --- a/split-ring.tex
>> +++ b/split-ring.tex
>> @@ -530,6 +530,9 @@ \subsection{Available Buffer Notification Suppression}\label{sec:Basic Facilitie
>>         \item If the \field{idx} field in the available ring (which determined
>>           where that descriptor index was placed) was equal to
>>           \field{avail_event}, the driver MUST send a notification.
>> +        \item If the number of descriptors added to the queue since
>> +          the last notification is greater than 65535, the driver MUST
>> +          send a notification.
>>         \item Otherwise the driver SHOULD NOT send a notification.
>>   \end{itemize}
>> \end{itemize}
>> -- 
>> 2.32.0 (Apple Git-131)
>> 
>> 
>> -Patrick Mosca
> 
> I am not sure I understand. Can you give an example of how the issue
> triggers please?
> 
> -- 
> MST
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
> 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]