From patchwork Tue Dec 5 01:55:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ching Huang X-Patchwork-Id: 10092585 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 1CDD860348 for ; Tue, 5 Dec 2017 09:55:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 033B828929 for ; Tue, 5 Dec 2017 09:55:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB7C129459; Tue, 5 Dec 2017 09:55:51 +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=-5.4 required=2.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED, DKIM_VALID, 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 7AE8828929 for ; Tue, 5 Dec 2017 09:55:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753187AbdLEJzf (ORCPT ); Tue, 5 Dec 2017 04:55:35 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:42583 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753111AbdLEJzM (ORCPT ); Tue, 5 Dec 2017 04:55:12 -0500 Received: by mail-pf0-f180.google.com with SMTP id d23so10810350pfe.9 for ; Tue, 05 Dec 2017 01:55:11 -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:cc:date:message-id:mime-version :content-transfer-encoding; bh=sp30oOl9GhI7vnOEOHVLwwiUHDahTiqHtn8kYo7te0w=; b=HhTMcMyrZCLk2FluVE35Bh1GLzeJ2enAk9vjUmM+NKF14r+Bx38B9DkQ1w5pMTVDkT i7Z+ZGdixsGui47PZJyCeXUDRuIs2Z1ZxfcITOUc6SQiILOBpkQcRgwKTvz7E/oGGZKH vXYViTMDbu9FWvRKyeGslW4FgOXy+XAzbklbUizl+oRdcZJLYabpK5g0asBhCIwynup+ PwjASplP3pYNSUt7NrfFuOzLGnhoMhI7BoMbELmn3rsdRRGdwSW5MaoU5Ai6FtX7qzjy wLNTnAe+vMVadTJGWZVtpq2s/sbZGTP9i6njRK8dEsP3MV5ShyTQGumApmiFse/NjVM1 3Cxg== 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:cc:date:message-id:mime-version :content-transfer-encoding; bh=sp30oOl9GhI7vnOEOHVLwwiUHDahTiqHtn8kYo7te0w=; b=unZfbmwzKvbN6kp2jrdwUyUiOC5PYF8iO077WeWTaJOIUV19ml2NeoYN4kgMr6ohPv 4dFS8V5gw2vVFR0SKjtOHATQ1qbUn/sH/fzPhSRln7J0gXz1u4EjvP9J67p7OV61l7j8 Jqbv0/p7KvpDHyt/5uOb5JtDEXPfvj386lR0PZtwo8zJLx+oaid5/BQT8NRL4Gy2T6M5 wFRQW0DTuKo/NPrgfOmrct8pQ1E15xldbe2udfHVYZSjOtVPjebOMrYxfUzjKCLhKktO L1Zk7mFvx+RSqWle6P0j9GY3F2bIOunz5KcmUsi6IavyyRpBx+URczPoKPVKBBz9XViM 7ccw== X-Gm-Message-State: AJaThX66Qac0tyKvM1440uRw4rLdoCEfOr/7BIKG+g86TX4WFitXRLQq eYgELWbRk4npIoi5I6k6WRLKP8yM X-Google-Smtp-Source: AGs4zMbqYSPG3i5o2gF+dXErwgMkFP5weFX4v9DbO8BE9CfaFpGl8QQFRi12xCd60RBAlUY6D1XJ5w== X-Received: by 10.84.248.132 with SMTP id q4mr18158597pll.121.1512467710944; Tue, 05 Dec 2017 01:55:10 -0800 (PST) Received: from [192.168.0.105] (60-248-88-209.HINET-IP.hinet.net. [60.248.88.209]) by smtp.gmail.com with ESMTPSA id h69sm28341410pfk.166.2017.12.05.01.55.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 01:55:09 -0800 (PST) Subject: [PATCH 8/17] 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, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: James.Bottomley@HansenPartnership.com, sfr@canb.auug.org.au Date: Tue, 05 Dec 2017 09:55:02 +0800 Message-ID: <1512438902.4577.55.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-12-05 15:26:06.000000000 +0800 +++ b/drivers/scsi/arcmsr/arcmsr.h 2017-12-05 15:26:32.000000000 +0800 @@ -56,7 +56,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-12-05 11:46:30.000000000 +0800 +++ b/drivers/scsi/arcmsr/arcmsr_hba.c 2017-12-05 11:46:18.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);