Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1572924 > unrolled thread

Re: [PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info

Started byJason Wang <jasowang@redhat.com>
First post2017-02-03 09:00 +0100
Last post2017-02-03 09:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info Jason Wang <jasowang@redhat.com> - 2017-02-03 09:00 +0100
    Re: [PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info Christoph Hellwig <hch@lst.de> - 2017-02-03 09:30 +0100

#1572924 — Re: [PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info

FromJason Wang <jasowang@redhat.com>
Date2017-02-03 09:00 +0100
SubjectRe: [PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info
Message-ID<t6GWL-7cT-17@gated-at.bofh.it>

On 2017年01月27日 16:16, Christoph Hellwig wrote:
> We don't really need struct virtio_pci_vq_info, as most field in there
> are redundant:
>
>   - the vq backpointer is not strictly neede to start with
>   - the entry in the vqs list is not needed - the generic virtqueue already
>     has list, we only need to check if it has a callback to get the same
>     semantics
>   - we can use a simple array to look up the MSI-X vec if needed.
>   - That simple array now also duoble serves to replace the per_vq_vectors
>     flag
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   drivers/virtio/virtio_pci_common.c | 117 +++++++++++--------------------------
>   drivers/virtio/virtio_pci_common.h |  25 +-------
>   drivers/virtio/virtio_pci_legacy.c |   6 +-
>   drivers/virtio/virtio_pci_modern.c |   6 +-
>   4 files changed, 39 insertions(+), 115 deletions(-)
>
> diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
> index 186cbab..a3376731 100644
> --- a/drivers/virtio/virtio_pci_common.c
> +++ b/drivers/virtio/virtio_pci_common.c
> @@ -62,16 +62,13 @@ static irqreturn_t vp_config_changed(int irq, void *opaque)
>   static irqreturn_t vp_vring_interrupt(int irq, void *opaque)
>   {
>   	struct virtio_pci_device *vp_dev = opaque;
> -	struct virtio_pci_vq_info *info;
>   	irqreturn_t ret = IRQ_NONE;
> -	unsigned long flags;
> +	struct virtqueue *vq;
>   
> -	spin_lock_irqsave(&vp_dev->lock, flags);
> -	list_for_each_entry(info, &vp_dev->virtqueues, node) {
> -		if (vring_interrupt(irq, info->vq) == IRQ_HANDLED)
> +	list_for_each_entry(vq, &vp_dev->vdev.vqs, list) {
> +		if (vq->callback && vring_interrupt(irq, vq) == IRQ_HANDLED)

The check of vq->callback seems redundant, we will check it soon in 
vring_interrupt().

Thanks

[toc] | [next] | [standalone]


#1572942

FromChristoph Hellwig <hch@lst.de>
Date2017-02-03 09:30 +0100
Message-ID<t6HpM-7CB-15@gated-at.bofh.it>
In reply to#1572924
On Fri, Feb 03, 2017 at 03:54:36PM +0800, Jason Wang wrote:
>> +	list_for_each_entry(vq, &vp_dev->vdev.vqs, list) {
>> +		if (vq->callback && vring_interrupt(irq, vq) == IRQ_HANDLED)
>
> The check of vq->callback seems redundant, we will check it soon in 
> vring_interrupt().

Good point - I wanted to keep things exactly as-is and dіdn't notice
we were already protected.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web