Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1028976pxu; Thu, 26 Nov 2020 20:16:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjPYNOOWV0yYL3Wt9UFtD9HwTgRkaGMEUmpUBwIb21AHM4KV1BWaj1v6X9/XVcDYlzzROx X-Received: by 2002:a17:906:7c95:: with SMTP id w21mr5455234ejo.304.1606450599211; Thu, 26 Nov 2020 20:16:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606450599; cv=none; d=google.com; s=arc-20160816; b=AQ3scn1Yfy4fbwdeLDyCQZ5NADOi3iecoVr9kJj8xKN6nf+qAi7+Z/Hj1SVrCFh2ZH JUCOzjbBKrpHdO3vw4r13iXl+wJlEuI2XxfxhB+QfF1GxgxuFH/XB7JteYalmWr5oZH9 krDNYyEakgCKFhmVj0mRTo/pRAFfcmCi6t+gJgn6jvXgiiToogxZyUdyPu/VLE3A3GDq UdqHhbYBl/2qLWuXZWW4UwcTdxCc1ptS1orNSEoMLPmqorgq5WddYtNEe6Npv0ZzS0VP hNdUV4xnOKRtTjalBsylxow+NPMK3nQK2iLD/CNNKtPiYesMBJAN4EHPGB2SDspXv5yP Y/Wg== 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=saFRkzBjwNYVIzOFQ9gg9qkqgMtu8TL9hGt5bH7Do50=; b=y08FD4xUmLsKQOjngMWaYEUeOS/XmXnyO7nNACNtDozyehuuQ7r+TJIllAP2Yvoiyo wQjdqR/+R6HgzyHWTe9sMDR/f6eEmztCUGda9qa9wQP5vl6Do7FraaTwC5ShKv7QHRJY K+0ISqccoe+Kx5msvuYOF0hA34gGngJS/vyheL4JIjw0hLlCR0L/8t/UiiwJL5ateSwb 79ebgmtHZR8+cfI7xih88TdDivYqIejqkqZvcIDuoIudJsE7v6vJMrvR3A6piVZdpKIT rtit+emVJzldFBCpGlGiHm+zke63xoGB8qQi5lLbwl6Mz4qP8AQzkauqSjYLGt8YeTio oAlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PQ6AT20a; 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 r8si3509651eji.608.2020.11.26.20.16.12; Thu, 26 Nov 2020 20:16:39 -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=PQ6AT20a; 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 S2388870AbgKZI3U (ORCPT + 99 others); Thu, 26 Nov 2020 03:29:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59590 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388866AbgKZI3T (ORCPT ); Thu, 26 Nov 2020 03:29:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606379358; 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=saFRkzBjwNYVIzOFQ9gg9qkqgMtu8TL9hGt5bH7Do50=; b=PQ6AT20aBZVzAjAAGeFUePFhXmnSU5mVWuKW1+TXi6MTRFmyYKnJ4DK6w8RXv+zwPgaXqz rlL3AY2jC0Uv+tNVoah+JP75omq0B0xQhSb8IVcniL+rWNyuCFiq7hzdv0e0+6uO/wZiRv hH5SNhXIFKHCVgxtU1KHr8Vo5KhWnO4= 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-28-TcFidZI_MIehiIoxx3YsYg-1; Thu, 26 Nov 2020 03:29:12 -0500 X-MC-Unique: TcFidZI_MIehiIoxx3YsYg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C36AA10151E7; Thu, 26 Nov 2020 08:29:10 +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 066E45C1B4; Thu, 26 Nov 2020 08:29:07 +0000 (UTC) From: Laurent Vivier To: linux-kernel@vger.kernel.org Cc: Paul Mackerras , linux-pci@vger.kernel.org, Thomas Gleixner , linux-block@vger.kernel.org, "Michael S . Tsirkin" , Marc Zyngier , Christoph Hellwig , Greg Kurz , linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Benjamin Herrenschmidt , Laurent Vivier Subject: [PATCH v4 2/2] powerpc/pseries: Pass MSI affinity to irq_create_mapping() Date: Thu, 26 Nov 2020 09:28:52 +0100 Message-Id: <20201126082852.1178497-3-lvivier@redhat.com> In-Reply-To: <20201126082852.1178497-1-lvivier@redhat.com> References: <20201126082852.1178497-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With virtio multiqueue, normally each queue IRQ is mapped to a CPU. Commit 0d9f0a52c8b9f ("virtio_scsi: use virtio IRQ affinity") exposed an existing shortcoming of the arch code by moving virtio_scsi to the automatic IRQ affinity assignment. 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 Reviewed-by: Greg Kurz Acked-by: Michael Ellerman --- 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