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.


Checking in here. Is the problem a little more clear now?

-Patrick Mosca

On Jun 24, 2022, at 3:39 PM, Patrick Mosca <pmosca@apple.com> wrote:

Are you sure this is not an implementation bug? 

Possibly yes, but the specification could probably be made clearer to avoid such an implementation bug.

My concern is that the helper method in question was originally part of the 0.9.5 specification, even though it is no longer directly provided in the 1.0+ versions of the specification.

static inline int vring_need_event(uint16_t event_idx, uint16_t new_idx, uint16_t old_idx)
{
return (uint16_t)(new_idx - event_idx - 1) < (uint16_t)(new_idx - old_idx);
}

Neither the 0.9.5 nor the current specification mention any requirement of notifying during a wrap, even though the Linux implementation correctly checks that unmentioned case, which was not provided in that 0.9.5 helper method or explicitly mentioned in the current specification.


-Patrick Mosca

On Jun 17, 2022, at 3:30 AM, Michael S. Tsirkin <mst@redhat.com> wrote:

On Thu, Jun 16, 2022 at 01:53:38PM -0700, Patrick Mosca wrote:
The issue may trigger in the unlikely uint16_t overflow case of
computing the difference between two index positions.

Are you sure this is not an implementation bug? I don't see
anywhere in the spec where we suggest 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

I don't see it sorry. Example?

--
MST





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