]> xenbits.xensource.com Git - people/jgross/linux.git/commitdiff
iommu/amd: Allocate IOMMU irqs using numa locality info
authorVasant Hegde <vasant.hegde@amd.com>
Tue, 21 Mar 2023 09:23:48 +0000 (09:23 +0000)
committerJoerg Roedel <jroedel@suse.de>
Wed, 22 Mar 2023 14:43:40 +0000 (15:43 +0100)
Use numa information to allocate irq resources and also to set
irq affinity. This optimizes the IOMMU interrupt handling.

Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Reviewed-by: Alexey Kardashevskiy <aik@amd.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/20230321092348.6127-3-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/init.c

index 19a46b9f73574f6ffb68979090953d8fe9490d56..141eca29c951155e4b63b730ae08647f51dc9361 100644 (file)
@@ -2383,6 +2383,7 @@ static int iommu_setup_intcapxt(struct amd_iommu *iommu)
        struct irq_domain *domain;
        struct irq_alloc_info info;
        int irq, ret;
+       int node = dev_to_node(&iommu->dev->dev);
 
        domain = iommu_get_irqdomain();
        if (!domain)
@@ -2392,7 +2393,7 @@ static int iommu_setup_intcapxt(struct amd_iommu *iommu)
        info.type = X86_IRQ_ALLOC_TYPE_AMDVI;
        info.data = iommu;
 
-       irq = irq_domain_alloc_irqs(domain, 1, NUMA_NO_NODE, &info);
+       irq = irq_domain_alloc_irqs(domain, 1, node, &info);
        if (irq < 0) {
                irq_domain_remove(domain);
                return irq;