public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Wagner <wagi@kernel.org>
To: "Jens Axboe" <axboe@kernel.dk>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"Keith Busch" <kbusch@kernel.org>,
	"Christoph Hellwig" <hch@lst.de>,
	"Sagi Grimberg" <sagi@grimberg.me>,
	"John Garry" <john.g.garry@oracle.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Hannes Reinecke" <hare@suse.de>,
	"Ming Lei" <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-pci@vger.kernel.org, virtualization@lists.linux.dev,
	 linux-scsi@vger.kernel.org, megaraidlinux.pdl@broadcom.com,
	 mpi3mr-linuxdrv.pdl@broadcom.com,
	MPT-FusionLinux.pdl@broadcom.com,  storagedev@microchip.com,
	linux-nvme@lists.infradead.org,  Daniel Wagner <wagi@kernel.org>
Subject: [PATCH v5 2/8] PCI: hookup irq_get_affinity callback
Date: Fri, 15 Nov 2024 17:37:46 +0100	[thread overview]
Message-ID: <20241115-refactor-blk-affinity-helpers-v5-2-c472afd84d9f@kernel.org> (raw)
In-Reply-To: <20241115-refactor-blk-affinity-helpers-v5-0-c472afd84d9f@kernel.org>

struct bus_type has a new callback for retrieving the IRQ affinity for a
device. Hook this callback up for PCI based devices.

Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
 drivers/pci/pci-driver.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 35270172c833186995aebdda6f95ab3ffd7c67a0..a9cb0e3ad2e6eca58c34683303b1242228e96909 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1670,6 +1670,19 @@ static void pci_dma_cleanup(struct device *dev)
 		iommu_device_unuse_default_domain(dev);
 }
 
+/**
+ * pci_device_irq_get_affinity - get IRQ affinity mask for device
+ * @dev: ptr to dev structure
+ * @irq_vec: interrupt vector number
+ *
+ * Return the CPU affinity mask for @dev and @irq_vec.
+ */
+static const struct cpumask *pci_device_irq_get_affinity(struct device *dev,
+					unsigned int irq_vec)
+{
+	return pci_irq_get_affinity(to_pci_dev(dev), irq_vec);
+}
+
 const struct bus_type pci_bus_type = {
 	.name		= "pci",
 	.match		= pci_bus_match,
@@ -1677,6 +1690,7 @@ const struct bus_type pci_bus_type = {
 	.probe		= pci_device_probe,
 	.remove		= pci_device_remove,
 	.shutdown	= pci_device_shutdown,
+	.irq_get_affinity = pci_device_irq_get_affinity,
 	.dev_groups	= pci_dev_groups,
 	.bus_groups	= pci_bus_groups,
 	.drv_groups	= pci_drv_groups,

-- 
2.47.0


  parent reply	other threads:[~2024-11-15 16:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-15 16:37 [PATCH v5 0/8] blk: refactor queue affinity helpers Daniel Wagner
2024-11-15 16:37 ` [PATCH v5 1/8] driver core: bus: add irq_get_affinity callback to bus_type Daniel Wagner
2024-11-16  7:43   ` Greg Kroah-Hartman
2024-11-15 16:37 ` Daniel Wagner [this message]
2024-11-21  8:57   ` [PATCH v5 2/8] PCI: hookup irq_get_affinity callback John Garry
2024-11-15 16:37 ` [PATCH v5 3/8] virtio: " Daniel Wagner
2024-11-21  9:01   ` John Garry
2024-11-21  9:44     ` Daniel Wagner
2024-11-15 16:37 ` [PATCH v5 4/8] blk-mq: introduce blk_mq_map_hw_queues Daniel Wagner
2024-11-21  3:09   ` Ming Lei
2024-11-21  9:08   ` John Garry
2024-12-02 13:48     ` Daniel Wagner
2024-11-15 16:37 ` [PATCH v5 5/8] scsi: replace blk_mq_pci_map_queues with blk_mq_map_hw_queues Daniel Wagner
2024-11-21  2:37   ` Martin K. Petersen
2024-11-21  3:13   ` Ming Lei
2024-11-21  9:09   ` John Garry
2024-11-15 16:37 ` [PATCH v5 6/8] nvme: " Daniel Wagner
2024-11-21  3:15   ` Ming Lei
2024-11-21  9:09   ` John Garry
2024-11-15 16:37 ` [PATCH v5 7/8] virtio: blk/scsi: replace blk_mq_virtio_map_queues " Daniel Wagner
2024-11-21  3:17   ` Ming Lei
2024-11-21  9:10   ` John Garry
2024-11-15 16:37 ` [PATCH v5 8/8] blk-mq: remove unused queue mapping helpers Daniel Wagner
2024-11-21  3:19   ` Ming Lei
2024-11-21  9:10   ` John Garry

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=20241115-refactor-blk-affinity-helpers-v5-2-c472afd84d9f@kernel.org \
    --to=wagi@kernel.org \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=axboe@kernel.dk \
    --cc=bhelgaas@google.com \
    --cc=eperezma@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jasowang@redhat.com \
    --cc=john.g.garry@oracle.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=megaraidlinux.pdl@broadcom.com \
    --cc=ming.lei@redhat.com \
    --cc=mpi3mr-linuxdrv.pdl@broadcom.com \
    --cc=mst@redhat.com \
    --cc=sagi@grimberg.me \
    --cc=storagedev@microchip.com \
    --cc=virtualization@lists.linux.dev \
    --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