From patchwork Sun Dec 9 16:38:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Satish Kharat X-Patchwork-Id: 10720147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F66E18B8 for ; Sun, 9 Dec 2018 16:54:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3ECB2A0C3 for ; Sun, 9 Dec 2018 16:54:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E88322A0D9; Sun, 9 Dec 2018 16:54:10 +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=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham 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 807952A0C3 for ; Sun, 9 Dec 2018 16:54:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726126AbeLIQyK (ORCPT ); Sun, 9 Dec 2018 11:54:10 -0500 Received: from alln-iport-6.cisco.com ([173.37.142.93]:26680 "EHLO alln-iport-6.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726078AbeLIQyJ (ORCPT ); Sun, 9 Dec 2018 11:54:09 -0500 X-Greylist: delayed 559 seconds by postgrey-1.27 at vger.kernel.org; Sun, 09 Dec 2018 11:54:07 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3433; q=dns/txt; s=iport; t=1544374449; x=1545584049; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ilGopu9N2R41Z/R9wR63MORm7/Q41ixNnrDuRExogXQ=; b=QL3Nhx6yUcyvwCdaXvRzcYIU/recp5T++uAR4oF2KnilNbQG4rgQKM2T GG75Ug81gMRPX2MFkYg1E6tuZpsfFcdARBUMSDnCOaEnMC/Ixj4E6t0nd ri+wshhfcOrrCz98kEaFe6rjPIDF45UkXeeoDW4fSKCvuxmNM0YOdCYNu Q=; X-IronPort-AV: E=Sophos;i="5.56,335,1539648000"; d="scan'208";a="209959932" Received: from alln-core-11.cisco.com ([173.36.13.133]) by alln-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Dec 2018 16:44:48 +0000 Received: from satish-ini-cisco-com.cisco.com (satish-ini.cisco.com [10.193.101.67]) by alln-core-11.cisco.com (8.15.2/8.15.2) with ESMTP id wB9GiXtC022582; Sun, 9 Dec 2018 16:44:48 GMT From: Satish Kharat To: linux-scsi@vger.kernel.org Cc: Satish Kharat Subject: [PATCH] scsi : fnic: Impose upper limit on max. # of CQs processed per intr. Date: Sun, 9 Dec 2018 08:38:39 -0800 Message-Id: <20181209163844.48020-5-satishkh@cisco.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181209163844.48020-1-satishkh@cisco.com> References: <20181209163844.48020-1-satishkh@cisco.com> X-Outbound-SMTP-Client: 10.193.101.67, satish-ini.cisco.com X-Outbound-Node: alln-core-11.cisco.com Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This change is to impose an upper limit on the max number of CQ entries (corresponding to the copy wq) processed in an interrupt. Using module param to set the limit. Signed-off-by: Satish Kharat --- drivers/scsi/fnic/fnic.h | 2 ++ drivers/scsi/fnic/fnic_isr.c | 6 +++--- drivers/scsi/fnic/fnic_main.c | 7 ++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/fnic/fnic.h b/drivers/scsi/fnic/fnic.h index d094ba59ed15..ec84711e9a20 100644 --- a/drivers/scsi/fnic/fnic.h +++ b/drivers/scsi/fnic/fnic.h @@ -128,6 +128,7 @@ __fnic_set_state_flags(fnicp, st_flags, 1) extern unsigned int fnic_log_level; +extern unsigned int io_completions; #define FNIC_MAIN_LOGGING 0x01 #define FNIC_FCS_LOGGING 0x02 @@ -196,6 +197,7 @@ enum fnic_state { #define FNIC_WQ_MAX 1 #define FNIC_RQ_MAX 1 #define FNIC_CQ_MAX (FNIC_WQ_COPY_MAX + FNIC_WQ_MAX + FNIC_RQ_MAX) +#define FNIC_DFLT_IO_COMPLETIONS 256 struct mempool; diff --git a/drivers/scsi/fnic/fnic_isr.c b/drivers/scsi/fnic/fnic_isr.c index 4e3a50202e8c..da4602b63495 100644 --- a/drivers/scsi/fnic/fnic_isr.c +++ b/drivers/scsi/fnic/fnic_isr.c @@ -51,7 +51,7 @@ static irqreturn_t fnic_isr_legacy(int irq, void *data) } if (pba & (1 << FNIC_INTX_WQ_RQ_COPYWQ)) { - work_done += fnic_wq_copy_cmpl_handler(fnic, -1); + work_done += fnic_wq_copy_cmpl_handler(fnic, io_completions); work_done += fnic_wq_cmpl_handler(fnic, -1); work_done += fnic_rq_cmpl_handler(fnic, -1); @@ -72,7 +72,7 @@ static irqreturn_t fnic_isr_msi(int irq, void *data) fnic->fnic_stats.misc_stats.last_isr_time = jiffies; atomic64_inc(&fnic->fnic_stats.misc_stats.isr_count); - work_done += fnic_wq_copy_cmpl_handler(fnic, -1); + work_done += fnic_wq_copy_cmpl_handler(fnic, io_completions); work_done += fnic_wq_cmpl_handler(fnic, -1); work_done += fnic_rq_cmpl_handler(fnic, -1); @@ -125,7 +125,7 @@ static irqreturn_t fnic_isr_msix_wq_copy(int irq, void *data) fnic->fnic_stats.misc_stats.last_isr_time = jiffies; atomic64_inc(&fnic->fnic_stats.misc_stats.isr_count); - wq_copy_work_done = fnic_wq_copy_cmpl_handler(fnic, -1); + wq_copy_work_done = fnic_wq_copy_cmpl_handler(fnic, io_completions); vnic_intr_return_credits(&fnic->intr[FNIC_MSIX_WQ_COPY], wq_copy_work_done, 1 /* unmask intr */, diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index cc461fd7bef1..6a63941b2d8e 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c @@ -69,6 +69,11 @@ unsigned int fnic_log_level; module_param(fnic_log_level, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(fnic_log_level, "bit mask of fnic logging levels"); + +unsigned int io_completions = FNIC_DFLT_IO_COMPLETIONS; +module_param(io_completions, int, S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(io_completions, "Max CQ entries to process at a time"); + unsigned int fnic_trace_max_pages = 16; module_param(fnic_trace_max_pages, uint, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(fnic_trace_max_pages, "Total allocated memory pages " @@ -501,7 +506,7 @@ static int fnic_cleanup(struct fnic *fnic) } /* Clean up completed IOs and FCS frames */ - fnic_wq_copy_cmpl_handler(fnic, -1); + fnic_wq_copy_cmpl_handler(fnic, io_completions); fnic_wq_cmpl_handler(fnic, -1); fnic_rq_cmpl_handler(fnic, -1);