Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2346467ybm; Thu, 23 May 2019 15:33:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqybWO08P6wZbGqE8bow2RX+50yAw2jZ4uHqDo3dEFTqB+by13DVxYVz6FGE1/FtQk7fhhnl X-Received: by 2002:a63:cf:: with SMTP id 198mr99808774pga.228.1558650825098; Thu, 23 May 2019 15:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558650825; cv=none; d=google.com; s=arc-20160816; b=WZC3+GY/8VAyTYGSL9mxAsbvzlao8Q2otYw02pDLt7ZE2XLN//z4PWor4Ig4EGC2YI zITuBPm9v+dZz0mXhnonkt6YqNLmKnAa/xtJvmvYzNJhVH8sycKaO5E4/FDeWuXFj+tP yrz59rGnRvf/47J6mgBzD/dHFOCWf0tl/PCbmy464bBAemL6s46h7WuAMLOjv4xxMKxt RzIJAaLZ/kbTWnb7Vu7nMgzTqtZbLGTCgxgfGl8FWLP+GwYf9OeHz+lVsZ0Ffgg4g1Ur 6/sUphT0QEuzfR4QyGXgyBczEIN9OK7AWKySBtb4jYQUtvRCQ6bKTa3giUPw24y9Jn3Z MA5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:cc:to:from; bh=XlhI1rNIjA5uJO3eODwEg7sbGScBX0erlsPhhLUzj9g=; b=YtjCKuGtzpEbEjs7o8U42qx29OfsME3Vqm8S5/V1OL/UYqnnbOG/dnU8wHBrmzcK2x /TVHBg+qg873w27ISSOTZP5EjbOEGU+l0+0BFaPsR3+GwQ5isk/y4YK5tnUM6Z1kHCQm fA8ahXbvA+Er0j7aB6ZblUnWshVqjNtjmUXjuJN+8fBVi4QZxo6+O8Fe8LVNeoUo6/FZ 22yxCRSBUg2WEjIcSnfwhhQCWDrxlYo8K8drMd3dbywQO996uIXwuq/lKbML2wrFT9PT xUsniKgb28ip9Zhk3MVNL3Gyvpt3FA5GYG5mlrqc5EbQ4Dh1cHD31+Gg+YHHs5zi6iFI kC3g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w184si1434517pfw.271.2019.05.23.15.33.30; Thu, 23 May 2019 15:33:45 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388497AbfEWWbL (ORCPT + 99 others); Thu, 23 May 2019 18:31:11 -0400 Received: from ale.deltatee.com ([207.54.116.67]:59930 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387735AbfEWWbK (ORCPT ); Thu, 23 May 2019 18:31:10 -0400 Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hTwEs-00062O-Eu; Thu, 23 May 2019 16:31:08 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1hTwEp-0001S5-Qq; Thu, 23 May 2019 16:31:03 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-ntb@googlegroups.com, linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kselftest@vger.kernel.org, Jon Mason , Joerg Roedel Cc: Bjorn Helgaas , Allen Hubbe , Dave Jiang , Serge Semin , Eric Pilmore , Logan Gunthorpe Date: Thu, 23 May 2019 16:30:52 -0600 Message-Id: <20190523223100.5526-3-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523223100.5526-1-logang@deltatee.com> References: <20190523223100.5526-1-logang@deltatee.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-ntb@googlegroups.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-kselftest@vger.kernel.org, jdmason@kudzu.us, joro@8bytes.org, bhelgaas@google.com, dave.jiang@intel.com, allenbh@gmail.com, fancer.lancer@gmail.com, epilmore@gigaio.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,MYRULES_NO_TEXT autolearn=ham autolearn_force=no version=3.4.2 Subject: [PATCH v5 02/10] PCI/switchtec: Add module parameter to request more interrupts X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Seeing the we want to use more interrupts in the NTB MSI code we need to be able allocate more (sometimes virtual) interrupts in the switchtec driver. Therefore add a module parameter to request to allocate additional interrupts. This puts virtually no limit on the number of MSI interrupts available to NTB clients. Signed-off-by: Logan Gunthorpe Cc: Bjorn Helgaas --- drivers/pci/switch/switchtec.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index e22766c79fe9..8b1db78197d9 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -30,6 +30,10 @@ module_param(use_dma_mrpc, bool, 0644); MODULE_PARM_DESC(use_dma_mrpc, "Enable the use of the DMA MRPC feature"); +static int nirqs = 32; +module_param(nirqs, int, 0644); +MODULE_PARM_DESC(nirqs, "number of interrupts to allocate (more may be useful for NTB applications)"); + static dev_t switchtec_devt; static DEFINE_IDA(switchtec_minor_ida); @@ -1247,8 +1251,12 @@ static int switchtec_init_isr(struct switchtec_dev *stdev) int dma_mrpc_irq; int rc; - nvecs = pci_alloc_irq_vectors(stdev->pdev, 1, 4, - PCI_IRQ_MSIX | PCI_IRQ_MSI); + if (nirqs < 4) + nirqs = 4; + + nvecs = pci_alloc_irq_vectors(stdev->pdev, 1, nirqs, + PCI_IRQ_MSIX | PCI_IRQ_MSI | + PCI_IRQ_VIRTUAL); if (nvecs < 0) return nvecs; -- 2.20.1