From: Jakub Sitnicki <jakub@cloudflare.com>
To: virtualization@lists.linux-foundation.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
linux-kernel@vger.kernel.org, kernel-team@cloudflare.com,
Caleb Raitto <caraitto@google.com>
Subject: [PATCH 1/2] virtio_pci: Don't make an extra copy of cpu affinity mask
Date: Thu, 19 Oct 2023 12:16:24 +0200 [thread overview]
Message-ID: <20231019101625.412936-1-jakub@cloudflare.com> (raw)
Since commit 19e226e8cc5d ("virtio: Make vp_set_vq_affinity() take a
mask.") it is actually not needed to have a local copy of the cpu mask.
Pass the cpu mask we got as argument to set the irq affinity hint.
Cc: Caleb Raitto <caraitto@google.com>
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
---
drivers/virtio/virtio_pci_common.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
index c2524a7207cf..8927bc338f06 100644
--- a/drivers/virtio/virtio_pci_common.c
+++ b/drivers/virtio/virtio_pci_common.c
@@ -433,21 +433,14 @@ int vp_set_vq_affinity(struct virtqueue *vq, const struct cpumask *cpu_mask)
struct virtio_device *vdev = vq->vdev;
struct virtio_pci_device *vp_dev = to_vp_device(vdev);
struct virtio_pci_vq_info *info = vp_dev->vqs[vq->index];
- struct cpumask *mask;
unsigned int irq;
if (!vq->callback)
return -EINVAL;
if (vp_dev->msix_enabled) {
- mask = vp_dev->msix_affinity_masks[info->msix_vector];
irq = pci_irq_vector(vp_dev->pci_dev, info->msix_vector);
- if (!cpu_mask)
- irq_set_affinity_hint(irq, NULL);
- else {
- cpumask_copy(mask, cpu_mask);
- irq_set_affinity_hint(irq, mask);
- }
+ irq_set_affinity_hint(irq, cpu_mask);
}
return 0;
}
--
2.41.0
next reply other threads:[~2023-10-19 10:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 10:16 Jakub Sitnicki [this message]
2023-10-19 10:16 ` [PATCH 2/2] virtio_pci: Switch away from deprecated irq_set_affinity_hint Jakub Sitnicki
2023-10-19 12:54 ` Xuan Zhuo
2023-10-19 12:55 ` [PATCH 1/2] virtio_pci: Don't make an extra copy of cpu affinity mask Xuan Zhuo
2023-10-23 16:52 ` Jakub Sitnicki
2023-10-24 2:31 ` Xuan Zhuo
2023-10-24 8:17 ` Jakub Sitnicki
2023-10-24 10:53 ` Xuan Zhuo
2023-10-24 11:26 ` Jakub Sitnicki
2023-10-24 11:46 ` Xuan Zhuo
2023-10-24 11:55 ` Jakub Sitnicki
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=20231019101625.412936-1-jakub@cloudflare.com \
--to=jakub@cloudflare.com \
--cc=caraitto@google.com \
--cc=jasowang@redhat.com \
--cc=kernel-team@cloudflare.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=xuanzhuo@linux.alibaba.com \
/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
all inboxes | Powered by JetHome®