[ipxe-devel] [PATCH v2 3/4] [virtio] Add virtio 1.0 PCI support

Ladi Prosek lprosek at redhat.com
Wed Mar 16 08:18:48 UTC 2016


On Tue, Mar 15, 2016 at 6:54 PM, Stefan Hajnoczi <stefanha at redhat.com> wrote:
> On Mon, Mar 14, 2016 at 03:48:24PM +0100, Ladi Prosek wrote:
>> @@ -130,7 +131,11 @@ void vring_kick(unsigned int ioaddr, struct vring_virtqueue *vq, int num_added)
>>     vr->avail->idx += num_added;
>>
>>     mb();
>> -   if (!(vr->used->flags & VRING_USED_F_NO_NOTIFY))
>> -           vp_notify(ioaddr, vq->queue_index);
>> +   if (!(vr->used->flags & VRING_USED_F_NO_NOTIFY)) {
>> +           if (ioaddr) {
>
> It would be nice to add /* Legacy virtio */ and /* VIRTIO 1.0 */
> comments here so it's clear that ioaddr is distinguishing between the
> virtio versions.

Will do.

>> diff --git a/src/include/ipxe/virtio-ring.h b/src/include/ipxe/virtio-ring.h
>> index e44d13c..3f7478b 100644
>> --- a/src/include/ipxe/virtio-ring.h
>> +++ b/src/include/ipxe/virtio-ring.h
>> @@ -79,6 +79,7 @@ struct vring_virtqueue {
>>     void *vdata[MAX_QUEUE_NUM];
>>     /* PCI */
>>     int queue_index;
>> +   struct virtio_pci_region notification;
>
> virtio-ring.h should #include "virtio-pci.h" if it uses this struct or
> is there some kind of circular dependency problem?

Will do. There is a circular dependency but virtio-pci.h has a forward
decl so this will work.



More information about the ipxe-devel mailing list