Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2050811pxu; Tue, 24 Nov 2020 15:55:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9ae1iorAY4ptLqt8vd38Xtewbbpj7cIhv4LFqgW6iEY2IJb8RqAk3NfoQ/Vwj11xzjqQm X-Received: by 2002:a17:906:95c4:: with SMTP id n4mr427223ejy.222.1606262130043; Tue, 24 Nov 2020 15:55:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606262130; cv=none; d=google.com; s=arc-20160816; b=Vex0b19xhjJ7NqKlAdvzsZ+iy4odL2MeVknZVP/c0NpFxqtZsC93f4E7sXSr/K/B4Z +vR69cWRCXVcH4ds3N75bETpR71zrhU6cPdteDa5sy8XoS6O6kL3qg+zR3UoYX8s4dVW T/WMbNZ2LJYUKWYlpcVvG29vawolLXGKSdvEF5WBiRceuqIpXTDg/8HLwrJZGj/7cyn7 MuL0Uk//0kzk37XyyVv6wHu7BujM7URrarSspVEZvgQxT0W4lh2g2Zmc6nw/6/wFYQ9R c9Wzzd+P4PEIoDltxxZCn8wmYzMj66AsRC92q+8DtGAYscJWfc0kXcKlC2eSB1u+P+Lb Fqig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pruzrQouk9MyD9Ysfhx+ZPTNO+LhkPA5Pe+NxzsDRfw=; b=jzKhlDbl35cU0cQcNmUssbILVc3prL04KRAxBqOPJoXieJJNVsVqZFr+ez1I2R9b+S tJsxd+w2qjPAPkG/x3vGpS9YB1GUF/hnSRgWZCf1wecqcM5fqZa0AgVP+pOkG2IHeqO+ becmw6wfigt6uQ9kRqHjy4PkOE5cF0xYXNPbH7/826hHRAnEnGdFKFpJuCqktrjyjhOg BP5ZsnH+GDISW4A5x3GR4rVuEDD0NtpypZVI4qqgIfbQI/b6i4WWIhebA5feJcrJdxhp 648pRTSk5CCqm8MEMpfZJUe+Zrr/1dVhOewVfwLGFol/cFDFqoRfZ5PT2lUigECfZrLv I+ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MMucw70O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si264085ejr.241.2020.11.24.15.55.07; Tue, 24 Nov 2020 15:55:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MMucw70O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730017AbgKXUDd (ORCPT + 99 others); Tue, 24 Nov 2020 15:03:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:34797 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730001AbgKXUDc (ORCPT ); Tue, 24 Nov 2020 15:03:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606248211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pruzrQouk9MyD9Ysfhx+ZPTNO+LhkPA5Pe+NxzsDRfw=; b=MMucw70O3zkF8z3TLv/ZaUnlQc+TmfVb8+DJbYMiPXI6Jz14qBVYMeeu3cAMwQb05ieJxg kiRQEDocN8Lv1ewXQ4On/8txuWBSwmEL57a4I2hSP/RGQ5I9GGmKE+CUVhDDJxYJWTJrBU BnwkYDSgumFdKCrrZFNPxQe4rta6Wdo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-328-7YeQ_o1APmq2yKrCeuY72A-1; Tue, 24 Nov 2020 15:03:27 -0500 X-MC-Unique: 7YeQ_o1APmq2yKrCeuY72A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 50C79107AD89; Tue, 24 Nov 2020 20:03:25 +0000 (UTC) Received: from thinkpad.redhat.com (ovpn-113-83.ams2.redhat.com [10.36.113.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E5D15D6AB; Tue, 24 Nov 2020 20:03:21 +0000 (UTC) From: Laurent Vivier To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Paul Mackerras , Benjamin Herrenschmidt , Michael Ellerman , linux-block@vger.kernel.org, "Michael S . Tsirkin" , Marc Zyngier , linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, Christoph Hellwig , Laurent Vivier Subject: [PATCH 2/2] powerpc/pseries: pass MSI affinity to irq_create_mapping() Date: Tue, 24 Nov 2020 21:03:08 +0100 Message-Id: <20201124200308.1110744-3-lvivier@redhat.com> In-Reply-To: <20201124200308.1110744-1-lvivier@redhat.com> References: <20201124200308.1110744-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With virtio multiqueue, normally each queue IRQ is mapped to a CPU. But since commit 0d9f0a52c8b9f ("virtio_scsi: use virtio IRQ affinity") this is broken on pseries. The affinity is correctly computed in msi_desc but this is not applied to the system IRQs. It appears the affinity is correctly passed to rtas_setup_msi_irqs() but lost at this point and never passed to irq_domain_alloc_descs() (see commit 06ee6d571f0e ("genirq: Add affinity hint to irq allocation")) because irq_create_mapping() doesn't take an affinity parameter. As the previous patch has added the affinity parameter to irq_create_mapping() we can forward the affinity from rtas_setup_msi_irqs() to irq_domain_alloc_descs(). With this change, the virtqueues are correctly dispatched between the CPUs on pseries. This problem cannot be shown on x86_64 for two reasons: - the call path traverses arch_setup_msi_irqs() that is arch specific: virtscsi_probe() virtscsi_init() vp_modern_find_vqs() vp_find_vqs() vp_find_vqs_msix() pci_alloc_irq_vectors_affinity() __pci_enable_msix_range() pci_msi_setup_msi_irqs() arch_setup_msi_irqs() rtas_setup_msi_irqs() irq_create_mapping() irq_domain_alloc_descs() __irq_alloc_descs() - and x86_64 has CONFIG_PCI_MSI_IRQ_DOMAIN that uses another path: virtscsi_probe() virtscsi_init() vp_modern_find_vqs() vp_find_vqs() vp_find_vqs_msix() pci_alloc_irq_vectors_affinity() __pci_enable_msix_range() __msi_domain_alloc_irqs() __irq_domain_alloc_irqs() __irq_alloc_descs() Signed-off-by: Laurent Vivier --- arch/powerpc/platforms/pseries/msi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c index 42ba08eaea91..58197f92c6a2 100644 --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c @@ -458,7 +458,7 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type) return hwirq; } - virq = irq_create_mapping(NULL, hwirq, NULL); + virq = irq_create_mapping(NULL, hwirq, entry->affinity); if (!virq) { pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq); -- 2.28.0