Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp291352pxu; Wed, 25 Nov 2020 03:21:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJyF+xnKHU/l3uyJfxppZbsQE6L1VIJHXcFyx26q9mXOPzAJyvM7tIulakCXrSFWLRsUd/YI X-Received: by 2002:a17:906:6683:: with SMTP id z3mr2749964ejo.27.1606303296039; Wed, 25 Nov 2020 03:21:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606303296; cv=none; d=google.com; s=arc-20160816; b=JejbXLGHVvB+8Ua0Y4MbUXYDER2e8oa38v4HJI5AVj3AATMLvGaXkUHCC0gU2BSfF+ K08ChddkNlvWGI5xiXJVE6cHUTcvbaIdoffQ+Dxm9pp0pfgxFYN39H2MUrasLv2X9e6C m+BI3kMrr0O9HOlNox1ghLNGK2lpc40NGSC7ItwQvI5RGSbYUozdR1+CpSKGer/yL2bv YgMivbVQQwxuGrMfyinOzJky9GN/9i639qs1cSb++s/nYU4pF9nVXTzcQYIkwHoT7Ifq odhAPIkTro3jz/qxRNbOtTWCUU/2bo8vaepTc3H8Tu+ak3Ot5qpwtRqeiVzfk+boPaR9 oFjg== 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=zu/0xmXlaDABvq6r7zqamQ2WuJBTK7BYJVbbGKeJBKY=; b=QIzSEXL4t8anR3m3D9qEjpyMn7kO3wV4yBZw7So/oC0zrEfa5P/4LH9CQnJEy5QEUc e3ROCOrKXUgRT7XqHVwAXcWj3agEDyc2U11MRed3O26rXPWjxftQpmPbTfw008jPKqUm OJCeYpMY93ittKvCOJpyve97B5VdCz+z0jltF8S4KyqHA6mZO3xUTJe+EAy/Vf5eCAFU zB6GtAbH6e22dEavdvzv5P3Z1j+Kk87rF/8g4fgSJf6qWX1zC/kANqwBwUBlo/AfG2BB gMcNnfMIkAXFF/14ZFrM+jd4T6/7RVVDVGYRJd3W57G6l+OC/KKceM9GkGYvHRvQobXF lHlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AWFLdXJ7; 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 u6si1110065ejy.300.2020.11.25.03.21.12; Wed, 25 Nov 2020 03:21:36 -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=AWFLdXJ7; 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 S1727885AbgKYLRS (ORCPT + 99 others); Wed, 25 Nov 2020 06:17:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42951 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727268AbgKYLRS (ORCPT ); Wed, 25 Nov 2020 06:17:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606303037; 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=zu/0xmXlaDABvq6r7zqamQ2WuJBTK7BYJVbbGKeJBKY=; b=AWFLdXJ7ofylgmVaCIuzg1eOlnNcU7213qJEP2vrGcXnTM0TMMxbcGhAtmZ1hHIHKW2+wI qNngsbcIh47ywXS0SpuisnTcguvitLM6oFEWiqIGvemCKkvKNF+jdXYWiZIk6C44N2EUoF sVZHPocM+3fS/GcdWaVpJLCICq5sOVg= 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-437-UBfojiHJNpiYo2Nr2nIqkQ-1; Wed, 25 Nov 2020 06:17:13 -0500 X-MC-Unique: UBfojiHJNpiYo2Nr2nIqkQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 47B4C1005D44; Wed, 25 Nov 2020 11:17:11 +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 452F3100AE32; Wed, 25 Nov 2020 11:17:08 +0000 (UTC) From: Laurent Vivier To: linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Paul Mackerras , linux-pci@vger.kernel.org, Thomas Gleixner , Marc Zyngier , linuxppc-dev@lists.ozlabs.org, Benjamin Herrenschmidt , "Michael S . Tsirkin" , Greg Kurz , Christoph Hellwig , Michael Ellerman , Laurent Vivier Subject: [PATCH v2 2/2] powerpc/pseries: pass MSI affinity to irq_create_mapping() Date: Wed, 25 Nov 2020 12:16:57 +0100 Message-Id: <20201125111657.1141295-3-lvivier@redhat.com> In-Reply-To: <20201125111657.1141295-1-lvivier@redhat.com> References: <20201125111657.1141295-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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. Signed-off-by: Laurent Vivier --- arch/powerpc/platforms/pseries/msi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c index 133f6adcb39c..b3ac2455faad 100644 --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c @@ -458,7 +458,8 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type) return hwirq; } - virq = irq_create_mapping(NULL, hwirq); + virq = irq_create_mapping_affinity(NULL, hwirq, + entry->affinity); if (!virq) { pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq); -- 2.28.0