Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp504515pxu; Wed, 25 Nov 2020 08:28:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvAuVQp+paYFE8ythbZ+6VVVfg1VSLYVplsOsFgvdeAItYamuhrZbI3caPbpEgPygvHFpe X-Received: by 2002:aa7:cb4a:: with SMTP id w10mr4187666edt.343.1606321689842; Wed, 25 Nov 2020 08:28:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606321689; cv=none; d=google.com; s=arc-20160816; b=BHAlG0k+tX2tmnkW/b+wckuX1l2u0YsSpng1wjXgXGz2H9W1YUp8S6xydBbfl3pEl+ 7K7Ayx0arBukMHW05P2VVYaVH8briUCVUPsgG6Ai1Y7hfJEOafQaNBWgbPbllCN5SQuo rnaopBBzTmGCfga+fEOc6585uhljYD9pyM2eU6+XIg/iHBydWZ9+35jpsq+hSWJIZCVU FM45ZkmChddO3k204xAl0OZgILwsXp2oHwmyqhxz2tCiHcKoeBGcYUyp1NH+qJPVR02T xJykHimFZNcYaWY8X8cOpEzVMsJx0ccUgQJb8Dx/btOwmdxmd7nLkSQ0UHwnNzp7kI1i 2qFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=o/Y0frm+n6+KcF0/nn/2XkdcdJw5e1jlF8WzBJfpXEs=; b=leZCZydijQONFB0e7hISfRR+N1pftcFzcI1QxnfqTa/jLR1a6VBcgFDX1EtkDHX7MY W9KsxADdmxENP8pP0/xlpIKkduIEbrXkWu2zlNDro68sr5z3jKqRZZll9HIX9nJs1W4e Dn9DtBylKQDCQa/lyr9RtmCXj1InLIzeja8kPn/kw6G7vMMT+c4BZwfmEEFpPX3MGH9N 2LzVfBESFjOvxegSb2Mq7U2yAMpjLshFTB/qYFXJ2OtfaNGA7R9jO0iW0kdBEMEVNORy lkprUm8xgxCzTZNTBjiQ741GWNkKJtYle0UGSQZHCHSSqixfXQKPc7QjFLHRun01JMED ND8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jHIozx69; 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 k26si1527246ejz.41.2020.11.25.08.27.47; Wed, 25 Nov 2020 08:28:09 -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=jHIozx69; 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 S1730727AbgKYQZC (ORCPT + 99 others); Wed, 25 Nov 2020 11:25:02 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:34116 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729690AbgKYQZB (ORCPT ); Wed, 25 Nov 2020 11:25:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606321500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o/Y0frm+n6+KcF0/nn/2XkdcdJw5e1jlF8WzBJfpXEs=; b=jHIozx692+mLqaUHgzoxrVz3lzgEOPHhA5Fj3S/DzwvO7lLAW9f+Lgqo0gR1LA8pY06vHt DDfP7o388GZp7RINfk1LuZmnGyq5JV69PXCjwuwCXIc6QsEhVUs0WqW1ukDmrRmQknCAqE 9/qKNeDAx/DgMGEAR/PKmb8/AV3v6PI= 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-578-JMyfGYw_NGS3vgQc4F4nCg-1; Wed, 25 Nov 2020 11:24:58 -0500 X-MC-Unique: JMyfGYw_NGS3vgQc4F4nCg-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 BA308101AFA7; Wed, 25 Nov 2020 16:24:55 +0000 (UTC) Received: from [10.36.113.83] (ovpn-113-83.ams2.redhat.com [10.36.113.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D09E10016F4; Wed, 25 Nov 2020 16:24:47 +0000 (UTC) Subject: Re: [PATCH v3 2/2] powerpc/pseries: pass MSI affinity to irq_create_mapping() To: Denis Kirjanov Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Christoph Hellwig , Paul Mackerras , Greg Kurz , linuxppc-dev@lists.ozlabs.org, Thomas Gleixner , Benjamin Herrenschmidt , Michael Ellerman , linux-block@vger.kernel.org, "Michael S . Tsirkin" , Marc Zyngier References: <20201125150932.1150619-1-lvivier@redhat.com> <20201125150932.1150619-3-lvivier@redhat.com> From: Laurent Vivier Message-ID: <7184880b-0351-ae18-d2e1-fab7b79fc864@redhat.com> Date: Wed, 25 Nov 2020 17:24:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/11/2020 17:05, Denis Kirjanov wrote: > On 11/25/20, 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. > > Please add "Fixes" tag. In fact, the code in commit 0d9f0a52c8b9f is correct. The problem is with MSI/X irq affinity and pseries. So this patch fixes more than virtio_scsi. I put this information because this commit allows to clearly show the problem. Perhaps I should remove this line in fact? Thanks, Laurent > > Thanks! > >> >> 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(-) >> >> 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 >> >> >