From: Randy Dunlap <randy.dunlap@oracle.com>
To: bo yang <bo.yang@lsi.com>
Cc: linux-scsi@vger.kernel.org, James.Bottomley@SteelEye.com,
akpm@osdl.org, linux-kernel@vger.kernel.org, Bo.yang@lsi.com,
Sumant.patro@lsi.com
Subject: Re: [PATCH 3/8] scsi: megaraid_sas - add module param max_sectors, cmd_per_lun
Date: Fri, 28 Sep 2007 13:31:56 -0700 [thread overview]
Message-ID: <20070928133156.ce2db688.randy.dunlap@oracle.com> (raw)
In-Reply-To: <1190820470.5955.12.camel@dhcp-75-534.se.lsil.com>
On Wed, 26 Sep 2007 11:27:50 -0400 bo yang wrote:
> Adding module parameters to configure max sectors per request & # of cmds per lun.
>
> Signed-off-by: Bo Yang <bo.yang@lsi.com>
>
> ---
> drivers/scsi/megaraid/megaraid_sas.c | 94 ++++++++++++++++++++++++-
> drivers/scsi/megaraid/megaraid_sas.h | 2
> 2 files changed, 94 insertions(+), 2 deletions(-)
>
> diff -uprN linux-2.6.22_orig/drivers/scsi/megaraid/megaraid_sas.c linux-2.6.22_new/drivers/scsi/megaraid/megaraid_sas.c
> --- linux-2.6.22_orig/drivers/scsi/megaraid/megaraid_sas.c 2007-09-26 13:30:36.000000000 -0700
> +++ linux-2.6.22_new/drivers/scsi/megaraid/megaraid_sas.c 2007-09-27 20:37:11.000000000 -0700
> @@ -2301,6 +2318,31 @@ static int megasas_start_aen(struct mega
> class_locale.word);
> }
>
> +static ssize_t
> +sysfs_max_sectors_read(struct kobject *kobj,
> + struct bin_attribute *bin_attr,
> + char *buf, loff_t off, size_t count)
> +{
> + struct Scsi_Host *host = class_to_shost(container_of(kobj,
> + struct class_device, kobj));
> + struct megasas_instance *instance =
> + (struct megasas_instance *)host->hostdata;
> +
> + count = sprintf(buf, "%u\n", instance->max_sectors_per_req);
> +
> + return count+1;
What's the +1 for?
> +}
> +
> +static struct bin_attribute sysfs_max_sectors_attr = {
> + .attr = {
> + .name = "max_sectors",
> + .mode = S_IRUSR|S_IRGRP|S_IROTH,
> + .owner = THIS_MODULE,
> + },
> + .size = 7,
> + .read = sysfs_max_sectors_read,
> +};
> +
> /**
> * megasas_io_attach - Attaches this driver to SCSI mid-layer
> * @instance: Adapter soft state
> @@ -2308,17 +2350,48 @@ static int megasas_start_aen(struct mega
> static int megasas_io_attach(struct megasas_instance *instance)
> {
> struct Scsi_Host *host = instance->host;
> + int error;
>
> /*
> - * Export parameters required by SCSI mid-layer
> + * Export host parameters required by SCSI
> + * mid-layer
> */
> host->irq = instance->pdev->irq;
> host->unique_id = instance->unique_id;
> host->can_queue = instance->max_fw_cmds - MEGASAS_INT_CMDS;
> host->this_id = instance->init_id;
> host->sg_tablesize = instance->max_num_sge;
> +
> + /*
> + * Check if the module parameter value for max_sectors can be used
> + */
> + if (max_sectors && max_sectors <= instance->max_sectors_per_req)
> + instance->max_sectors_per_req = max_sectors;
> + else {
> + if (max_sectors)
> + printk(KERN_INFO
> + "megasas: max_sectors should be > 0 and"
Need a space after "and" above or before "<=" below here.
> + "<= %d\n",
> + instance->max_sectors_per_req);
> + }
> +
> host->max_sectors = instance->max_sectors_per_req;
> - host->cmd_per_lun = 128;
> +
> + /*
> + * Check if the module parameter value for cmd_per_lun can be used
> + */
> + instance->cmd_per_lun = MEGASAS_DEFAULT_CMD_PER_LUN;
> + if (cmd_per_lun && cmd_per_lun <= MEGASAS_DEFAULT_CMD_PER_LUN)
> + instance->cmd_per_lun = cmd_per_lun;
> + else
> + printk(KERN_INFO "megasas: cmd_per_lun should be > 0 and"
Same comment as above.
> + "<= %d\n", MEGASAS_DEFAULT_CMD_PER_LUN);
> +
> + host->cmd_per_lun = instance->cmd_per_lun;
> +
> + printk(KERN_DEBUG "megasas: max_sectors : 0x%x, cmd_per_lun : 0x%x\n",
> + instance->max_sectors_per_req, instance->cmd_per_lun);
> +
> host->max_channel = MEGASAS_MAX_CHANNELS - 1;
> host->max_id = MEGASAS_MAX_DEV_PER_CHANNEL;
> host->max_lun = MEGASAS_MAX_LUN;
---
~Randy
Phaedrus says that Quality is about caring.
next prev parent reply other threads:[~2007-09-28 20:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-26 15:27 [PATCH 3/8] scsi: megaraid_sas - add module param max_sectors, cmd_per_lun bo yang
2007-09-28 20:31 ` Randy Dunlap [this message]
2007-09-28 21:30 ` Brian King
[not found] ` <9738BCBE884FDB42801FAD8A7769C265010A09BF@NAMAIL1.ad.lsil.com>
2007-10-01 17:50 ` Brian King
-- strict thread matches above, loose matches on Subject: below --
2007-10-01 15:51 bo yang
2007-10-03 21:00 ` Randy Dunlap
2007-10-30 17:38 ` Christoph Hellwig
2007-11-06 19:06 ` Yang, Bo
2007-11-07 17:42 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070928133156.ce2db688.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=James.Bottomley@SteelEye.com \
--cc=Sumant.patro@lsi.com \
--cc=akpm@osdl.org \
--cc=bo.yang@lsi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox