From patchwork Thu Nov 9 00:15:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ching Huang X-Patchwork-Id: 10050439 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 8C88960381 for ; Thu, 9 Nov 2017 08:15:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B1BE2ABC2 for ; Thu, 9 Nov 2017 08:15:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E6E22ABC4; Thu, 9 Nov 2017 08:15:14 +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=-4.9 required=2.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 D798F2ABC2 for ; Thu, 9 Nov 2017 08:15:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753248AbdKIIPN (ORCPT ); Thu, 9 Nov 2017 03:15:13 -0500 Received: from mail-it0-f46.google.com ([209.85.214.46]:55130 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753124AbdKIIPM (ORCPT ); Thu, 9 Nov 2017 03:15:12 -0500 Received: by mail-it0-f46.google.com with SMTP id 72so9740237itk.3 for ; Thu, 09 Nov 2017 00:15:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=areca-com-tw.20150623.gappssmtp.com; s=20150623; h=subject:from:to:date:message-id:mime-version :content-transfer-encoding; bh=ZLzK/faMHcVmHi3+MBMSWpEZS6JsdxukA+9sVJzL4Sg=; b=0rlWQTtsBaCHtdCNNpqsQcu5CSJAjXHQkvE2ZueNCUcwhmXgPN6wfk42J6AqvFP7Br uZZI0X6iOsB82rKyqkSdvOHOhAJhxIs6KC70Iwj/wXU8z4L1jkNtaPuGlmPF5yUTDN4x SjPr2bad/Pb2Z0oIZD8XoiFv/6PvazfuSerPmnpOjwuTLLbu1b3oSgL0HaEwXVkSLzHb 1p/XcJ9trLqOm5msGZ9gM9xbWrHHzX6c1vdgXCJbkx8j6MfPtMJNS4/ucUbDUScGfAdz dauvRKykWOP7+3GJSNI3tz8kvwuAu3SH052xnmAZ+IF4vG4lFAG/Y30zizZP1A5To+Na DDGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:date:message-id:mime-version :content-transfer-encoding; bh=ZLzK/faMHcVmHi3+MBMSWpEZS6JsdxukA+9sVJzL4Sg=; b=jWRuHl6qurnM+FptfYRxNZJrN4O8VMX/TO/yURkRSLLOkjBaSw5nm8Da2f3bLYh8k2 Ihi1R2dNrbv/sJQqfUb6nal6vMOOWx2yvPcYjIgsnvuy4C7yGDTimzPlvl8zI17J1y3q iI/DNw0w06wqc4leSTCD9RsEn7zqOAyg+e3yjDsFN/X/QMmHpnlWW7TxqntofadrL3AL Zog1/WvHSnQWysVmtIsCFegEW+Tvf9QG6Zv3ZUFAfmF0T75GNTezPk+DpYZvcOHk+cD6 JQgLleSOmA7E5nO7rW+mg6dntkTDhh0hd6cqC2cMGceGpE1aPMH1a8vmpzP7lXe+KU4g OnNQ== X-Gm-Message-State: AJaThX4LGlhz7FqiqW1raZKKN5SLSWzmNa2r8qrND4XwscsbIFT7vkeU OBTyGl5DzatHemD7/HLYA+Ze8A== X-Google-Smtp-Source: ABhQp+QsomZ+JRWYGXZlHVscCkwCUvv7JDjUPXlCZoMIGlRY2jZW/n7mcf+rf9IH3TcOdJKUPFF+lg== X-Received: by 10.36.216.194 with SMTP id b185mr4545587itg.114.1510215311832; Thu, 09 Nov 2017 00:15:11 -0800 (PST) Received: from [192.168.0.106] (60-248-88-209.HINET-IP.hinet.net. [60.248.88.209]) by smtp.gmail.com with ESMTPSA id 8sm2978271iob.32.2017.11.09.00.15.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 00:15:10 -0800 (PST) Subject: [PATCH 7/13] scsi: arcmsr: add driver option cmd_per_lun to set host->cmd_per_lun value by user From: Ching Huang To: martin.petersen@oracle.com, James.Bottomley@HansenPartnership.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, jthumshirn@suse.de, hare@suse.de, dan.carpenter@oracle.com, hch@infradead.org Date: Thu, 09 Nov 2017 08:15:09 +0800 Message-ID: <1510186509.4523.81.camel@Centos6.3-64> Mime-Version: 1.0 X-Mailer: Evolution 2.32.3 (2.32.3-37.el6) 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 From: Ching Huang add driver option cmd_per_lun to set host->cmd_per_lun value by user Signed-off-by: Ching Huang diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h --- a/drivers/scsi/arcmsr/arcmsr.h 2017-08-04 17:40:54.000000000 +0800 +++ b/drivers/scsi/arcmsr/arcmsr.h 2017-08-04 18:12:54.000000000 +0800 @@ -61,7 +61,9 @@ struct device_attribute; #define ARCMSR_MAX_XFER_SECTORS_C 304 #define ARCMSR_MAX_TARGETID 17 #define ARCMSR_MAX_TARGETLUN 8 -#define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD +#define ARCMSR_MAX_CMD_PERLUN 128 +#define ARCMSR_DEFAULT_CMD_PERLUN 32 +#define ARCMSR_MIN_CMD_PERLUN 1 #define ARCMSR_MAX_QBUFFER 4096 #define ARCMSR_DEFAULT_SG_ENTRIES 38 #define ARCMSR_MAX_HBB_POSTQUEUE 264 diff -uprN a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c --- a/drivers/scsi/arcmsr/arcmsr_hba.c 2017-11-08 18:52:04.000000000 +0800 +++ b/drivers/scsi/arcmsr/arcmsr_hba.c 2017-11-08 18:52:48.000000000 +0800 @@ -79,6 +79,10 @@ static int host_can_queue = ARCMSR_DEFAU module_param(host_can_queue, int, S_IRUGO); MODULE_PARM_DESC(host_can_queue, " adapter queue depth(32 ~ 1024), default is 128"); +static int cmd_per_lun = ARCMSR_DEFAULT_CMD_PERLUN; +module_param(cmd_per_lun, int, S_IRUGO); +MODULE_PARM_DESC(cmd_per_lun, " device queue depth(1 ~ 128), default is 32"); + #define ARCMSR_SLEEPTIME 10 #define ARCMSR_RETRYCOUNT 12 @@ -141,7 +145,7 @@ static struct scsi_host_template arcmsr_ .this_id = ARCMSR_SCSI_INITIATOR_ID, .sg_tablesize = ARCMSR_DEFAULT_SG_ENTRIES, .max_sectors = ARCMSR_MAX_XFER_SECTORS_C, - .cmd_per_lun = ARCMSR_MAX_CMD_PERLUN, + .cmd_per_lun = ARCMSR_DEFAULT_CMD_PERLUN, .use_clustering = ENABLE_CLUSTERING, .shost_attrs = arcmsr_host_attrs, .no_write_same = 1, @@ -884,7 +888,9 @@ static int arcmsr_probe(struct pci_dev * if ((host_can_queue < ARCMSR_MIN_OUTSTANDING_CMD) || (host_can_queue > ARCMSR_MAX_OUTSTANDING_CMD)) host_can_queue = ARCMSR_DEFAULT_OUTSTANDING_CMD; host->can_queue = host_can_queue; /* max simultaneous cmds */ - host->cmd_per_lun = ARCMSR_MAX_CMD_PERLUN; + if ((cmd_per_lun < ARCMSR_MIN_CMD_PERLUN) || (cmd_per_lun > ARCMSR_MAX_CMD_PERLUN)) + cmd_per_lun = ARCMSR_DEFAULT_CMD_PERLUN; + host->cmd_per_lun = cmd_per_lun; host->this_id = ARCMSR_SCSI_INITIATOR_ID; host->unique_id = (bus << 8) | dev_fun; pci_set_drvdata(pdev, host);