From patchwork Sun Nov 6 23:07:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9414169 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 107F96048F for ; Sun, 6 Nov 2016 23:08:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0337728CCD for ; Sun, 6 Nov 2016 23:08:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAAE228CAA; Sun, 6 Nov 2016 23:08:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9253828CAA for ; Sun, 6 Nov 2016 23:08:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751427AbcKFXHm (ORCPT ); Sun, 6 Nov 2016 18:07:42 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:57481 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751167AbcKFXH3 (ORCPT ); Sun, 6 Nov 2016 18:07:29 -0500 Received: from 50-247-105-171-static.hfc.comcastbusiness.net ([50.247.105.171] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.85_2 #1 (Red Hat Linux)) id 1c3WXA-0006qR-K3; Sun, 06 Nov 2016 23:07:28 +0000 From: Christoph Hellwig To: tglx@linutronix.de Cc: axboe@kernel.dk, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] blk-mq: add a first_vec argument to blk_mq_pci_map_queues Date: Sun, 6 Nov 2016 15:07:26 -0800 Message-Id: <1478473646-12524-3-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1478473646-12524-1-git-send-email-hch@lst.de> References: <1478473646-12524-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This allows skipping the first N IRQ vectors in case they are used for control or admin interrupts. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- block/blk-mq-pci.c | 6 ++++-- drivers/nvme/host/pci.c | 2 +- include/linux/blk-mq-pci.h | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/block/blk-mq-pci.c b/block/blk-mq-pci.c index 966c216..03ff7c4 100644 --- a/block/blk-mq-pci.c +++ b/block/blk-mq-pci.c @@ -21,6 +21,7 @@ * blk_mq_pci_map_queues - provide a default queue mapping for PCI device * @set: tagset to provide the mapping for * @pdev: PCI device associated with @set. + * @first_vec: first interrupt vectors to use for queues (usually 0) * * This function assumes the PCI device @pdev has at least as many available * interrupt vetors as @set has queues. It will then queuery the vector @@ -28,12 +29,13 @@ * that maps a queue to the CPUs that have irq affinity for the corresponding * vector. */ -int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev) +int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev, + int first_vec) { const struct cpumask *mask; unsigned int queue, cpu; - for (queue = 0; queue < set->nr_hw_queues; queue++) { + for (queue = first_vec; queue < set->nr_hw_queues; queue++) { mask = pci_irq_get_affinity(pdev, queue); if (!mask) return -EINVAL; diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 0fc99f0..a05fbaf 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -272,7 +272,7 @@ static int nvme_pci_map_queues(struct blk_mq_tag_set *set) { struct nvme_dev *dev = set->driver_data; - return blk_mq_pci_map_queues(set, to_pci_dev(dev->dev)); + return blk_mq_pci_map_queues(set, to_pci_dev(dev->dev), 0); } /** diff --git a/include/linux/blk-mq-pci.h b/include/linux/blk-mq-pci.h index 6ab5952..fde26d2 100644 --- a/include/linux/blk-mq-pci.h +++ b/include/linux/blk-mq-pci.h @@ -4,6 +4,7 @@ struct blk_mq_tag_set; struct pci_dev; -int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev); +int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev, + int first_vec); #endif /* _LINUX_BLK_MQ_PCI_H */