[virtio-spec PATCH 0/5] Receiving Used Buffers example code: cleanups and an extra mb()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patches before the last are small cleanups.

In the last patch I'm trying to extract / generalize an idea from Stefan
Hajnoczi's review of my virtio-net driver for OVMF.

Unfortunately I can't find Stefan's email on any mailing list archive
(sourceforge, gmane, mail-archive etc. all have only my response), so
I'll quote it here.

The patch Stefan was reviewing is
<http://thread.gmane.org/gmane.comp.bios.tianocore.devel/2804/focus=2819>:

  [PATCH v3 10/15]
  OvmfPkg: VirtioNetDxe: implement Tx: SNP.Transmit and SNP.GetStatus

On 06/07/13 16:17, Stefan Hajnoczi wrote:

> There is no read memory barrier between fetching TxCurUsed and
> fetching UsedElem[].Id.  In theory I think there is no guarantee that
> Dev->TxRing.Used.UsedElem[UsedElemIdx].Id is fetched *after*
> Dev->TxRing.Used.Idx.  On x86 it shouldn't be a problem but I expected
> a read memory barrier after comparing fetching Dev->TxRing.Used.Idx.

(Solely for the record, my response is at
<http://thread.gmane.org/gmane.comp.bios.tianocore.devel/3052>.)

In the last patch I'm trying to apply this remark to the virtio spec.
Hopefully I'm not misrepresenting the idea, nor glossing over any
important differences between the VirtioNetDxe code Stefan was actually
reviewing and the example code in the virtio spec.

I didn't add

  Suggested-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>

to the last patch, because my translation may easily have corrupted his
idea, but if the patch is deemed worthwhile, please do add his
Suggested-by.


I'm not subscribed to the virtualization list, please keep me CC'd.

Thanks!

Laszlo Ersek (5):
  Receiving Used Buffers: fix typo in "ring empty" condition in example
    code
  Receiving Used Buffers: re-disable interrupts when staying in the
    loop
  Receiving Used Buffers: variable for Queue Size is called "qsz"
    elsewhere
  Receiving Used Buffers: switch . and -> operators, add missing &
  Receiving Used Buffers: prevent speculative load when not
    sequentially consistent

 virtio-spec.lyx |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization




[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux