Linux block layer
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Christoph Hellwig <hch@lst.de>, mst@redhat.com
Cc: axboe@kernel.dk, pbonzini@redhat.com,
	virtualization@lists.linux-foundation.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/9] virtio_pci: don't duplicate the msix_enable flag in struct pci_dev
Date: Fri, 3 Feb 2017 15:56:26 +0800	[thread overview]
Message-ID: <e3316a3d-4ad7-c64a-59a2-33470cb88424@redhat.com> (raw)
In-Reply-To: <1485504997-17584-4-git-send-email-hch@lst.de>



On 2017年01月27日 16:16, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Jason Wang <jasowang@redhat.com>

>   drivers/virtio/virtio_pci_common.c | 5 ++---
>   drivers/virtio/virtio_pci_common.h | 2 --
>   drivers/virtio/virtio_pci_legacy.c | 2 +-
>   drivers/virtio/virtio_pci_modern.c | 2 +-
>   include/uapi/linux/virtio_pci.h    | 2 +-
>   5 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
> index 5880e86..9c4ad7d3f 100644
> --- a/drivers/virtio/virtio_pci_common.c
> +++ b/drivers/virtio/virtio_pci_common.c
> @@ -125,7 +125,7 @@ void vp_del_vqs(struct virtio_device *vdev)
>   
>   	vp_remove_vqs(vdev);
>   
> -	if (vp_dev->msix_enabled) {
> +	if (vp_dev->pci_dev->msix_enabled) {
>   		for (i = 0; i < vp_dev->msix_vectors; i++)
>   			free_cpumask_var(vp_dev->msix_affinity_masks[i]);
>   
> @@ -245,7 +245,6 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs,
>   			allocated_vectors++;
>   	}
>   
> -	vp_dev->msix_enabled = 1;
>   	return 0;
>   
>   out_remove_vqs:
> @@ -341,7 +340,7 @@ int vp_set_vq_affinity(struct virtqueue *vq, int cpu)
>   	if (!vq->callback)
>   		return -EINVAL;
>   
> -	if (vp_dev->msix_enabled) {
> +	if (vp_dev->pci_dev->msix_enabled) {
>   		int vec = vp_dev->msix_vector_map[vq->index];
>   		struct cpumask *mask = vp_dev->msix_affinity_masks[vec];
>   		unsigned int irq = pci_irq_vector(vp_dev->pci_dev, vec);
> diff --git a/drivers/virtio/virtio_pci_common.h b/drivers/virtio/virtio_pci_common.h
> index 8559386..217ca87 100644
> --- a/drivers/virtio/virtio_pci_common.h
> +++ b/drivers/virtio/virtio_pci_common.h
> @@ -64,8 +64,6 @@ struct virtio_pci_device {
>   	/* the IO mapping for the PCI config space */
>   	void __iomem *ioaddr;
>   
> -	/* MSI-X support */
> -	int msix_enabled;
>   	cpumask_var_t *msix_affinity_masks;
>   	/* Name strings for interrupts. This size should be enough,
>   	 * and I'm too lazy to allocate each name separately. */
> diff --git a/drivers/virtio/virtio_pci_legacy.c b/drivers/virtio/virtio_pci_legacy.c
> index 47292da..2ab6aee 100644
> --- a/drivers/virtio/virtio_pci_legacy.c
> +++ b/drivers/virtio/virtio_pci_legacy.c
> @@ -165,7 +165,7 @@ static void del_vq(struct virtqueue *vq)
>   
>   	iowrite16(vq->index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL);
>   
> -	if (vp_dev->msix_enabled) {
> +	if (vp_dev->pci_dev->msix_enabled) {
>   		iowrite16(VIRTIO_MSI_NO_VECTOR,
>   			  vp_dev->ioaddr + VIRTIO_MSI_QUEUE_VECTOR);
>   		/* Flush the write out to device */
> diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
> index 00e6fc1..e5ce310 100644
> --- a/drivers/virtio/virtio_pci_modern.c
> +++ b/drivers/virtio/virtio_pci_modern.c
> @@ -412,7 +412,7 @@ static void del_vq(struct virtqueue *vq)
>   
>   	vp_iowrite16(vq->index, &vp_dev->common->queue_select);
>   
> -	if (vp_dev->msix_enabled) {
> +	if (vp_dev->pci_dev->msix_enabled) {
>   		vp_iowrite16(VIRTIO_MSI_NO_VECTOR,
>   			     &vp_dev->common->queue_msix_vector);
>   		/* Flush the write out to device */
> diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
> index 90007a1..15b4385 100644
> --- a/include/uapi/linux/virtio_pci.h
> +++ b/include/uapi/linux/virtio_pci.h
> @@ -79,7 +79,7 @@
>    * configuration space */
>   #define VIRTIO_PCI_CONFIG_OFF(msix_enabled)	((msix_enabled) ? 24 : 20)
>   /* Deprecated: please use VIRTIO_PCI_CONFIG_OFF instead */
> -#define VIRTIO_PCI_CONFIG(dev)	VIRTIO_PCI_CONFIG_OFF((dev)->msix_enabled)
> +#define VIRTIO_PCI_CONFIG(dev)	VIRTIO_PCI_CONFIG_OFF((dev)->pci_dev->msix_enabled)
>   
>   /* Virtio ABI version, this must match exactly */
>   #define VIRTIO_PCI_ABI_VERSION		0

  reply	other threads:[~2017-02-03  7:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27  8:16 automatic IRQ affinity for virtio V2 Christoph Hellwig
2017-01-27  8:16 ` [PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info Christoph Hellwig
2017-02-03  7:54   ` Jason Wang
2017-02-03  8:22     ` Christoph Hellwig
2017-01-27  8:16 ` [PATCH 2/9] virtio_pci: use shared interrupts for virtqueues Christoph Hellwig
2017-02-03  7:54   ` Jason Wang
2017-02-03  8:26     ` Christoph Hellwig
2017-02-03  9:47       ` Jason Wang
2017-02-03  9:52         ` Christoph Hellwig
2017-02-03  9:56           ` Jason Wang
2017-01-27  8:16 ` [PATCH 3/9] virtio_pci: don't duplicate the msix_enable flag in struct pci_dev Christoph Hellwig
2017-02-03  7:56   ` Jason Wang [this message]
2017-01-27  8:16 ` [PATCH 4/9] virtio_pci: simplify MSI-X setup Christoph Hellwig
2017-02-03  7:57   ` Jason Wang
2017-01-27  8:16 ` [PATCH 5/9] virtio: allow drivers to request IRQ affinity when creating VQs Christoph Hellwig
2017-02-03  8:01   ` Jason Wang
2017-01-27  8:16 ` [PATCH 6/9] virtio: provide a method to get the IRQ affinity mask for a virtqueue Christoph Hellwig
2017-02-03  8:02   ` Jason Wang
2017-01-27  8:16 ` [PATCH 7/9] blk-mq: provide a default queue mapping for virtio device Christoph Hellwig
2017-01-27  8:16 ` [PATCH 8/9] virtio_blk: use virtio IRQ affinity Christoph Hellwig
2017-01-27  8:16 ` [PATCH 9/9] virtio_scsi: " Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2017-02-05 17:15 automatic IRQ affinity for virtio V3 Christoph Hellwig
2017-02-05 17:15 ` [PATCH 3/9] virtio_pci: don't duplicate the msix_enable flag in struct pci_dev Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3316a3d-4ad7-c64a-59a2-33470cb88424@redhat.com \
    --to=jasowang@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox