[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 19/61] virtio-net : cleanup : use QOM cast.
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH 19/61] virtio-net : cleanup : use QOM cast. |
Date: |
Mon, 7 Jan 2013 23:16:11 +0200 |
On Mon, Jan 07, 2013 at 07:40:32PM +0100, address@hidden wrote:
> @@ -130,7 +124,9 @@ static void virtio_net_set_status(struct VirtIODevice
> *vdev, uint8_t status)
>
> static void virtio_net_set_link_status(NetClientState *nc)
> {
> - VirtIONet *n = DO_UPCAST(NICState, nc, nc)->opaque;
> + void *opaque = DO_UPCAST(NICState, nc, nc)->opaque;
> + VirtIONet *n = VIRTIO_NET(opaque);
> + VirtIODevice *vdev = VIRTIO_DEVICE(n);
> uint16_t old_status = n->status;
>
> if (nc->link_down)
I note this adds more pointer chasing due to runtime casts on data path
operations. Can well be trivial but this really needs to be verified
with a performance test. Was this done? Same comment applies to block.
An alternative is to add _fast casts without runtime checks.
--
MST
- [Qemu-devel] [PATCH 14/61] virtio-blk : cleanup : remove qdev field., (continued)
- [Qemu-devel] [PATCH 14/61] virtio-blk : cleanup : remove qdev field., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 16/61] virtio-net : add the virtio-net device., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 17/61] virtio-net-pci : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 15/61] virtio-net : show the VirtIONet structure., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 13/61] virtio-blk : cleanup : use QOM cast., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 20/61] virtio-net : cleanup : init and exit function., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 18/61] virtio-net-s390 : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 23/61] virtio-scsi : don't use pointer for configuration., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 21/61] virtio-net : cleanup : remove qdev field., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 19/61] virtio-net : cleanup : use QOM cast., fred . konrad, 2013/01/07
- Re: [Qemu-devel] [PATCH 19/61] virtio-net : cleanup : use QOM cast.,
Michael S. Tsirkin <=
[Qemu-devel] [PATCH 30/61] virtio-scsi : cleanup : init and exit functions., fred . konrad, 2013/01/07
[Qemu-devel] [PATCH 33/61] virtio-balloon : add the virtio-balloon device., fred . konrad, 2013/01/07
[Qemu-devel] [PATCH 34/61] virtio-balloon-pci : switch to the new API., fred . konrad, 2013/01/07
[Qemu-devel] [PATCH 32/61] virtio-balloon : show the VirtIOBalloon structure., fred . konrad, 2013/01/07
[Qemu-devel] [PATCH 36/61] virtio-balloon : cleanup : QOM casts., fred . konrad, 2013/01/07
[Qemu-devel] [PATCH 35/61] virtio-balloon : cleanup : init and exit function., fred . konrad, 2013/01/07
[Qemu-devel] [PATCH 40/61] virtio-rng : add virtio-rng device., fred . konrad, 2013/01/07