[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: Network Device virtqueue numbering
On Wed, May 18, 2016 at 10:38:13AM +0200, Ladi Prosek wrote: > Hello virtio-comment, > > This is a comment on section "5.1.2 Network Device: virtqueues" of > virtio 1.0 spec CS 04, copied below. > > The numbers don't add up. For 1-based N, receiveqN is at index 2N-2, > transmitqN at index 2N-1 and controlq (if present) at index 2N. > Specifically for the N=1 special case mentioned in the paragraph, > controlq would be at index 2 and not 2*1+2 = 4. > > This could be fixed either by using the correct queue indices [2N-2, > 2N-1, 2N] instead of [2N, 2N+1, 2N+2] or by switching to 0-based > receiveq/transmitq numbering. > > Thanks! > Ladi Yes- that't a mistake. Numbers go 0 to 2N-1, 2N is the control queue. > > 5.1.2 Virtqueues > > 0 > receiveq1 > 1 > transmitq1 > … > 2N > receiveqN > 2N+1 > transmitqN > 2N+2 > controlq > > N=1 if VIRTIO_NET_F_MQ is not negotiated, otherwise N is set by > max_virtqueue_pairs. > > controlq only exists if VIRTIO_NET_F_CTRL_VQ set.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]