Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp346576pxu; Wed, 25 Nov 2020 04:55:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJymyfJDN5+vbtLbsm6cYboCIwUxEjSyqx/o9nT5AaESvj+C1TWmULvmkX8FxOU8EKBPekci X-Received: by 2002:a17:906:a183:: with SMTP id s3mr1468730ejy.60.1606308953813; Wed, 25 Nov 2020 04:55:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606308953; cv=none; d=google.com; s=arc-20160816; b=ITzEy813J3uUL4qjTEFWUcsxIPQX+A0TKtmhca/rYaMZgFQfm87tJnmielF46+v9og lh1yUSXFlvzC3ygwsPO9BkQ9xt0RHU9AcNQBYoXZpkA9FyO32uljxC2bX/fnOn4cJrXu p/GW+Ae32nEg/jz/DxkC6A7TKLmFXT0DUL9HCaYVWw67oZC/LjDiuQRdCobE9Qrg8VLB /EnSwpiElxHj78ARnYS5IdJO6J1kncorFbQiAcDUGkRk/fCaVpiHzy+GsfKd+SMRq1c3 tOupHQYJ7buA0Xjj9PNA5ZJz1qcwywQVh//CStNehpxHyPQFFOBBg6lcaIRQ67S1xmoM oDdQ== 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:subject:cc:to:from:date; bh=OQMuYq0qN/m5B/6NXBSp70F4yuBUmLuwHzxl5fBMvtY=; b=e7uay12xP2MG1KNhbD+EVBTNv3QsJFLzgwsMHZkCmv+4Y24lIsTB0OaWV6jpv4IEec sUCtCpwAgHAtReixLEchxl488tjUwLpnBA5D8MU6MGIQF8SmKJ2B3p0Mto6fBiTca3Ku yIDRstBhbPNgEXJLt2Qz1gRGTVm8DNYU2vNlfKVQ/Tt/Eq5UOuIYuCAs+l6eaiClXDIx /GMKEM/5O7Wz1cWnO65ShshrDsMeNspSdtkpqSBISsTIliTv0Kw7pUj4CfptVfhRKrQY kk5ydj/kgu/ZN1msoM6suyYEJO9TlxRPSfuH2s6qCMD9KvGvnLStn5EeXFYQzXZu6nq9 WV2A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zc3si1191248ejb.158.2020.11.25.04.55.29; Wed, 25 Nov 2020 04:55:53 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729423AbgKYMvw (ORCPT + 99 others); Wed, 25 Nov 2020 07:51:52 -0500 Received: from smtpout1.mo804.mail-out.ovh.net ([79.137.123.220]:41929 "EHLO smtpout1.mo804.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728902AbgKYMvv (ORCPT ); Wed, 25 Nov 2020 07:51:51 -0500 Received: from mxplan5.mail.ovh.net (unknown [10.109.143.90]) by mo804.mail-out.ovh.net (Postfix) with ESMTPS id B96687545376; Wed, 25 Nov 2020 13:51:47 +0100 (CET) Received: from kaod.org (37.59.142.100) by DAG8EX1.mxp5.local (172.16.2.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Wed, 25 Nov 2020 13:51:46 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-100R003f5f17775-3d78-4887-bece-db38842b427c, 13817E1CA0648EB9EE095497159C33290D197662) smtp.auth=groug@kaod.org Date: Wed, 25 Nov 2020 13:51:45 +0100 From: Greg Kurz To: Laurent Vivier CC: , , "Paul Mackerras" , , Thomas Gleixner , Marc Zyngier , , Benjamin Herrenschmidt , "Michael S . Tsirkin" , Christoph Hellwig , Michael Ellerman Subject: Re: [PATCH v2 2/2] powerpc/pseries: pass MSI affinity to irq_create_mapping() Message-ID: <20201125135145.64a51c4e@bahia.lan> In-Reply-To: <20201125111657.1141295-3-lvivier@redhat.com> References: <20201125111657.1141295-1-lvivier@redhat.com> <20201125111657.1141295-3-lvivier@redhat.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [37.59.142.100] X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG8EX1.mxp5.local (172.16.2.71) X-Ovh-Tracer-GUID: f9887add-59a7-4ca7-a478-288848d6728e X-Ovh-Tracer-Id: 6008646329849649656 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedujedrudehtddggeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvffukfgjfhfogggtgfhisehtjeertdertddvnecuhfhrohhmpefirhgvghcumfhurhiiuceoghhrohhugheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpedvfefgtdegleduudejjeelfffghfehtdeigefggfduvdfgkeevgfeftedtjeehveenucffohhmrghinheprhgvughhrghtrdgtohhmnecukfhppedtrddtrddtrddtpdefjedrheelrddugedvrddutddtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehgrhhouhhgsehkrghougdrohhrghdprhgtphhtthhopehmphgvsegvlhhlvghrmhgrnhdrihgurdgruh Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Nov 2020 12:16:57 +0100 Laurent Vivier wrote: > 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. > Since it is public, maybe add: BugId: https://bugzilla.redhat.com/show_bug.cgi?id=1702939 ? > Signed-off-by: Laurent Vivier > --- Anyway, Reviewed-by: Greg Kurz > 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);