Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4527536imj; Tue, 12 Feb 2019 18:35:26 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibc5g/zZ5YV5uiBMAIvTnGjFgApB7RpLXKDHeHT7YeYmOCKBSZVG+YwS6G3LkqL8AQiaxA6 X-Received: by 2002:a17:902:f01:: with SMTP id 1mr2131085ply.41.1550025326896; Tue, 12 Feb 2019 18:35:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550025326; cv=none; d=google.com; s=arc-20160816; b=rBHqPxI1EIyuXaDryV5mXDJB2X7lQxtVH5+hhZ69Qq0TPQKn6oF7RPacZr4jl00anL JJUo2YAkXC6eyz0Gl8Uc3pATitc5aHkegPmgrWeaPjEvn7hnPlxPxgsoLuMF/qKCs/Sz WCgt3oiggFrSjrQ5yQbMiaq6Orv4yv7iIAEVH7XtHM1m01nTjDErYA0NuDho/CPRsSrO g3hHs4aBeEb9N58sH4VS47RZzlb2Fh8gC9d8n3rPoYUshjO7F4QHkKcunR8GmpMYT+Jx 0mWuhGZlyHXu/bGs0dsbwL/PHziKf4lBSGn2DDDQcMUdEhG9O+ySaEhaR/AO939p1Shm NSng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=feLeJWISjrzUnnH5Qar+xaQM4gR+y0ZKzrBTAiasVmI=; b=WpxoifwWYyI0prd8M5xlCY9i3J+gO6UUooYC3VARDCWyQrvQAH0Oi1j9Uv2bRl88Br y3hdgL1iO3AFlEeZ2RRzKJkGW4puFbzKJTFXPmy13e8WiBZkQcGXiGsk6M/4rRsC1oMG nbbcypMqXfTppgPg2OLrIKlsgIyT5oXe7Sq7z2S5PcnjI7m4ESBpqxtxj/18qccDnq8U b4yU8InrEJL6GhgZFIMgzHKeEY79jr4j4CDngEsaHN4vnXf1Kul7VMUPSw2qIAG+Q4by ip24md2z30bobzcuQm13sDn+1MbetRI2M7K73RzroqHVHKB7sLeCDMqw4fEdFQfL9lf3 DOCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="UnGd2/YV"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2si13040961pgp.429.2019.02.12.18.35.11; Tue, 12 Feb 2019 18:35:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="UnGd2/YV"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732515AbfBLXm2 (ORCPT + 99 others); Tue, 12 Feb 2019 18:42:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:44108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732343AbfBLXm1 (ORCPT ); Tue, 12 Feb 2019 18:42:27 -0500 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B5B012084E; Tue, 12 Feb 2019 23:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550014946; bh=+ljDVPXUImG1Z+vSoOkg9hae4sm9zQLd0klZvq3ppo0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UnGd2/YVAge9uRcZZCgcz5V08Kl8zL+g1nV66TA1iBWAbXqrxEUyoGnk0oM6JDPiV ueWRe0fctmjmpYtNdzULLonc0fgP/UThgAwDYwLMRcyWLTMIG2DTnP3jEGB7Nk4mvp ak3CFx0o/u68xiGHuNw0MPxHwswS4uwwR+Smoq9E= Date: Tue, 12 Feb 2019 17:42:24 -0600 From: Bjorn Helgaas To: Ming Lei Cc: Christoph Hellwig , Thomas Gleixner , Jens Axboe , linux-block@vger.kernel.org, Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Keith Busch Subject: Re: [PATCH V2 4/4] genirq/affinity: Document .calc_sets as required in case of multiple sets Message-ID: <20190212234224.GA96272@google.com> References: <20190212130439.14501-1-ming.lei@redhat.com> <20190212130439.14501-5-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190212130439.14501-5-ming.lei@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 12, 2019 at 09:04:39PM +0800, Ming Lei wrote: > Now NVMe has implemented the .calc_sets callback for caculating each > set's vectors. > > For other cases of multiple irq sets, it isn't a good way to pre-caculate > each set's vectors before allocating IRQ vectors because NVMe's same issue > exists too. s/irq/IRQ/ so it's consistent in the paragraph. > Document .calc_sets as required explicitly for multiple sets. > > Signed-off-by: Ming Lei Acked-by: Bjorn Helgaas Note minor comments below. > --- > drivers/pci/msi.c | 4 ++-- > include/linux/interrupt.h | 3 ++- > 2 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c > index 4c0b47867258..9f91fa713141 100644 > --- a/drivers/pci/msi.c > +++ b/drivers/pci/msi.c > @@ -1039,7 +1039,7 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec, > * If the caller is passing in sets, we can't support a range of > * vectors. The caller needs to handle that. Looks like this comment needs to be tweaked, maybe along the lines of: If the caller requests multiple sets of IRQs where each set requires different affinity, it must also supply a ->calc_sets() callback to compute the affinity cpumask for each set. (I'm not 100% clear on how calc_sets() works, so I might not have described this exactly right.) > */ > - if (affd && affd->nr_sets && minvec != maxvec) > + if (affd && affd->nr_sets > 1 && !affd->calc_sets) > return -EINVAL; > > if (WARN_ON_ONCE(dev->msi_enabled)) > @@ -1097,7 +1097,7 @@ static int __pci_enable_msix_range(struct pci_dev *dev, > * If the caller is passing in sets, we can't support a range of > * supported vectors. The caller needs to handle that. Similar comment update here? > */ > - if (affd && affd->nr_sets && minvec != maxvec) > + if (affd && affd->nr_sets > 1 && !affd->calc_sets) > return -EINVAL; > > if (WARN_ON_ONCE(dev->msix_enabled)) > diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h > index 7a27f6ba1f2f..a053f7fb0ff1 100644 > --- a/include/linux/interrupt.h > +++ b/include/linux/interrupt.h > @@ -269,7 +269,8 @@ struct irq_affinity_notify { > * the MSI(-X) vector space > * @nr_sets: Length of passed in *sets array > * @set_vectors: Number of affinitized sets > - * @calc_sets: Callback for caculating set vectors > + * @calc_sets: Callback for caculating set vectors, required for > + * multiple irq sets. > * @priv: Private data of @calc_sets > */ > struct irq_affinity { > -- > 2.9.5 >