Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp410557pxu; Thu, 26 Nov 2020 01:40:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4dpm8Va6r3yNEbtUu0BbRnqT1nmi5o4KqTNMszLg8SguCFccoUvVBtoyhTmtNo0WA8UHO X-Received: by 2002:a05:6402:3098:: with SMTP id de24mr1678521edb.155.1606383600239; Thu, 26 Nov 2020 01:40:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606383600; cv=none; d=google.com; s=arc-20160816; b=NOdYmCtyT66uvvV/mDnG0cNHhmk3xyss6z2Q0iNxnhg+15MTC4EtPCWZrj5Z+STMh7 OfvnNHcZXatsguHfEZ9ZCB/HPar5DZWRPJqsJbgdumnRraGhetnwXfSkRvj5VdxVfGon NRV4TsGtYir1CV8VFvAqezyT6Hq5xzWyxYFI+/dz2P/N+4S457ZB6rz0F3hkI2mOM+ht bHhl9oCuWVc+WyYkX2AJJnnbNvLAUO8uPBXMYN6QjTmudIBQDB0FCOKTrq+tEF1q3m2w 6BxLfemK7VQdt9n9lrk4i+TmyLJKeBtMrlu+6GFj1FGIFy0TNqJMRKMBotaP57oKmkSR qHFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=06TAJy3xUxdyF3ZqUXTpSOBOE91UVvZ9pbxbYyn8zIk=; b=e/QKj6NoIA96gWMX8iti2u+Rp03MmumM9wiiL9pWsQOKzEBF8SaCC1saSQaQowRuUn RiU8hamdS+yPvd5xfSYIUAB7UQ1GqJXUSj7dv7x17Jqbcy0SwOFmZmLzXMHRpg0XX/P2 sm6kbff60J+CXzRkrY3hyBF+OXwqfs2OUdIymBqD3X6Hbzp8JxeKUjpwVe2jZWonTHdF b9nJDIQqN7n1sIgyD1GZdXzM/o2NFqNHSVmNetuDCpEu/bWi7mF6t1/lruk9D3bGme9Y pItzXteiwLGadA9v6qnVzDk5Ze1aKDt2nRhnMmwq7T08CFIkA8uGm5MjdEKIKr4YXdLR HuXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=MJHv2k+G; 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 l15si2824316edq.356.2020.11.26.01.39.38; Thu, 26 Nov 2020 01:40:00 -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=@ellerman.id.au header.s=201909 header.b=MJHv2k+G; 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 S2387427AbgKZDWz (ORCPT + 99 others); Wed, 25 Nov 2020 22:22:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731106AbgKZDWz (ORCPT ); Wed, 25 Nov 2020 22:22:55 -0500 Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D32A9C0613D4; Wed, 25 Nov 2020 19:22:54 -0800 (PST) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4ChNP64Xkcz9sVH; Thu, 26 Nov 2020 14:22:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1606360970; bh=VD5TisT5ZeXiMTVV+mDfjwYZ697RK3H5XI2Uko5WKkQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=MJHv2k+GKeIIexh6flzGS3pN64+Ne0G3xu1HEQevZlgqQAYfBoy6718zQWX00aK6k +VKWdlRnCxwm9B1iUBocNkhxMSi7ZSTovQiwl/GD4NfNZpE1Mg6ntG0Lc1WrYo5/79 AWMeJ9mSdvIRqmbHCouDkIny1coi3HxENAksR+LmNkUoI2w8bKKQv+EX41YgCnoDJ9 0RMWQsRAcP3PeCyg4fzzcJeMAukIJXu549Ea3ttEjdngP6X5CDFnNSo/BK4rUoW/Ix BPLOtEkITCp7TLQeWV21hmOfeGNGtLRZFwQT9y45O1BPX0bzhk4nany0UxTgeSbA/Y qRMypA7QEjKNA== From: Michael Ellerman To: Laurent Vivier , linux-kernel@vger.kernel.org Cc: linux-pci@vger.kernel.org, Christoph Hellwig , Paul Mackerras , Greg Kurz , linuxppc-dev@lists.ozlabs.org, Thomas Gleixner , Benjamin Herrenschmidt , linux-block@vger.kernel.org, "Michael S . Tsirkin" , Marc Zyngier , Laurent Vivier Subject: Re: [PATCH v3 2/2] powerpc/pseries: pass MSI affinity to irq_create_mapping() In-Reply-To: <20201125150932.1150619-3-lvivier@redhat.com> References: <20201125150932.1150619-1-lvivier@redhat.com> <20201125150932.1150619-3-lvivier@redhat.com> Date: Thu, 26 Nov 2020 14:22:49 +1100 Message-ID: <87zh34yf7a.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Laurent Vivier writes: > 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. > > BugId: https://bugzilla.redhat.com/show_bug.cgi?id=1702939 > Signed-off-by: Laurent Vivier > Reviewed-by: Greg Kurz > --- > arch/powerpc/platforms/pseries/msi.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Acked-by: Michael Ellerman cheers > 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