public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: New-style module parameters in SCSI drivers
Date: Fri, 8 Oct 2004 15:39:23 +0100	[thread overview]
Message-ID: <20041008143923.GQ16153@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <1097202556.9363.16.camel@localhost.localdomain>

On Fri, Oct 08, 2004 at 12:29:16PM +1000, Rusty Russell wrote:
> Well, it'd never be neat.  I'd rather encourage migration: in 2.6.10 I
> will start my jihad on MODULE_PARM, ideally finished before 2.6.11. 

OK.  As long as the barrage of complaints is omnidirectional and it's
not just me who sucks.

> It's usually better that someone who knows the code does the transition
> (you can often do better than a naive substitution), so my first step
> might be to clean up Linus' compile, then make MODULE_PARM warn, to
> encourage people to help.

While we're breaking the world, we should probably take this opportunity
to Do Things Right.  Here are all the ways I've noticed with a quick
grep of doing two common tasks in SCSI drivers.

First, the maximum number of commands that may be in flight to any
given device simultaneously:

drivers/scsi/3w-xxxx.c:                 cmds_per_lun
drivers/scsi/atari_scsi.c:              setup_cmd_per_lun
drivers/scsi/sun3_scsi.c:               setup_cmd_per_lun
drivers/scsi/sun3_scsi_vme.c:           setup_cmd_per_lun
drivers/scsi/dc395x.c:                  tags
drivers/scsi/megaraid.c:                max_cmd_per_lun
drivers/scsi/megaraid/megaraid_mbox.c:  cmd_per_lun
drivers/scsi/qla2xxx/qla_os.c:          ql2xmaxqdepth
drivers/scsi/sym53c8xx_2/sym_glue.c:    max_tag

Second, what host ID to use:

drivers/scsi/aha152x.c:                 scsiid
drivers/scsi/dc395x.c:                  adapter_id
drivers/scsi/ibmmca.c:                  scsi_id
drivers/scsi/sun3_scsi.c:               setup_hostid
drivers/scsi/sun3_scsi_vme.c:           setup_hostid
drivers/scsi/pcmcia/aha152x_stub.c:     host_id
drivers/scsi/sym53c8xx_2/sym_glue.c:    hostid

I honestly don't think any more variants _could_ exist, for either
of these oh-so-common things to do.  Not to mention that using these
parameters is a small-system thing to do -- what if you have 25 scsi
adapters and some of them should be different host IDs from each other?
What if you need to send only two tagged commands at once to your crappy
cd-rom, but your raid array needs 256 tags to be in use in order to get
any kind of performance?

Admittedly, there are hacks for the second case in many drivers (see the
sym2 driver -- puke!)  But before we break the world, let's discuss how
to do this right so we can at least have a model to work towards.

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

  reply	other threads:[~2004-10-08 14:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-01 15:26 [PATCH] sym53c8xx module parameter passing not working (2.5.6) Heinzmann, Robert
2004-10-01 15:29 ` Christoph Hellwig
2004-10-01 16:55   ` Matthew Wilcox
2004-10-08  1:30     ` Matthew Wilcox
2004-10-08  2:29       ` Rusty Russell
2004-10-08 14:39         ` Matthew Wilcox [this message]
2004-10-01 21:11 ` Matthew Wilcox
2004-10-01 21:28   ` Randy.Dunlap

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=20041008143923.GQ16153@parcelfarce.linux.theplanet.co.uk \
    --to=matthew@wil.cx \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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