linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/4] varlen extended and vendor-specific cdbs
@ 2007-11-01 17:54 Boaz Harrosh
  2007-11-01 18:00 ` [PATCH 1/4] Let scsi_cmnd->cmnd use request->cmd[] buffer Boaz Harrosh
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Boaz Harrosh @ 2007-11-01 17:54 UTC (permalink / raw)
  To: James Bottomley, Jens Axboe, Mike Christie, FUJITA Tomonori,
	linux-scsi
  Cc: Pete Wyckoff, Benny Halevy

This is a proposal for adding support for variable-length, extended, and 
vendor specific CDBs. It should now cover the entire range of the
SCSI standard.

This patchset extends my original submission (over a year old) in
that it starts with cleaning up scsi_cmnd, hence the first patch. The
other three are similar to the ones submitted before.

This effort is orthogonal to the bidi and scsi_data_buffer effort
and can be accepted now. The patchset, however, is presented in this RFC
on top of the scsi_data_buffer patches, as they sit in my tree. They
can easily be rebased to current scsi-misc. The iscsi patch is on top
of the iscsi branch of the iscsi-git-tree.

(Matthew, these patches will conflict with your scsi_cmnd cleanup patches
I promise to rebase them before submission)

A complete git-tree based on scsi-misc which includes a complete bidi
and varlen work can be fetched from:
 - git://git.bhalevy.com/open-osd bidi branch (varlen branch is this work)
 - http://www.bhalevy.com/git - has the gitweb GUI

[1/4] Let scsi_cmnd->cmnd use request->cmd buffer
  Here I let scsi_cmnd->cmnd point to the space allocated by
  request->cmd, instead of copying the data. The scsi_cmnd->cmd_len
  is guaranteed to contain the right length of the command.
  I have tried to go over every single place in the kernel that uses
  scsi_cmnd->cmnd and make sure it looks sane. Surprisingly to me,
  that was not at all bad. I hope I did not miss anything.

  I've tested on an x86_64 machine booting from a sata disk and
  ran the iscsi regression tests as well as my bidi and varlen tests
  on top of the complete patchset and all tests passed.

[2/4] block layer varlen-cdb
  Unlike the scsi approach (see below), I did not want to unify
  cmd[]/cmd_len and the *varlen_cdb and varlen_cdb_len
  members of struct request. This is because unlike scsi, block
  devices do not have a .max_cmd_len parameter to protect them
  from unexpected large commands. 
  In the case varlen_cdb and varlen_cdb_len are used the cmd[] 
  buffer is ignored and the cmd_len will be set to zero.

[3/4] scsi: varlen extended and vendor-specific cdbs
  Adds support for variable length, extended, and vendor-specific
  cdbs at the scsi mid-layer.

[4/4] iscsi: extended cdb support
  This is on top of the iscsi branch. In the URL above there
  are the three missing patches for iscsi, that add support
  for AHSs.

Boaz

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCHSET 0/3] Is it time for varlen extended and vendor-specific cdbs
@ 2008-03-25 16:21 Boaz Harrosh
  2008-04-13 16:30 ` [PATCHSET 0/4 ver2] " Boaz Harrosh
  0 siblings, 1 reply; 10+ messages in thread
From: Boaz Harrosh @ 2008-03-25 16:21 UTC (permalink / raw)
  To: James Bottomley, Jens Axboe, Christoph Hellwig, linux-scsi,
	Andrew

Submitted is a patchset for adding support for variable-length, extended,
and vendor specific CDBs. It should now cover the entire range of the 
SCSI standard. (and/or any other use of command packets in block devices)

They are based on scsi-misc/scsi-rc-fixes/linux-block. They are aimed
for the 2.6.26 merge window. Andrew please also include them in -mm
for testing.

Difference from last time, is at struct request. I did a smallish
hack to save the extra pointer space. The pointer now shares it's
space with the request->cmd, as they are mutual exclusive. The
flag to switch between them is when cmd_len == 0 and varlen_cdb_len != 0
I've added 2 accessors to hide the mess. I think this approach
should be safe with legacy drivers.

This is on top of the size shrink to struct scsi_cmnd gained
in the first patch. We save upto 12 bytes on 32 bit ARCHs

So over all, this cleans things up, and add fixtures without
*any extra cost*.

[1/3] Let scsi_cmnd->cmnd use request->cmd buffer
  Here I let scsi_cmnd->cmnd point to the space allocated by
  request->cmd, instead of copying the data. The scsi_cmnd->cmd_len
  is guaranteed to contain the right length of the command.
  I have tried to go over every single place in the kernel that uses
  scsi_cmnd->cmnd and make sure it looks sane. Surprisingly to me,
  that was not at all bad. I hope I did not miss anything.

  I've tested on an x86_64 machine booting from a sata disk and
  ran the iscsi regression tests as well as my bidi and varlen tests
  on top of the complete patchset and all tests passed.

[2/3] block layer varlen-cd
   Here I added an option to use a user supplied buffer for an arbitrary
   large command. Buffer must be kept valid until execution of request
   ends. The pointer to the buffer shares it's space with the fixed
   length command, so the size of struct request does not change.

[3/3] scsi: varlen extended and vendor-specific cdbs
  Adds support for variable length, extended, and vendor-specific
  cdbs at the scsi mid-layer.

Boaz


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-04-13 16:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-01 17:54 [RFC 0/4] varlen extended and vendor-specific cdbs Boaz Harrosh
2007-11-01 18:00 ` [PATCH 1/4] Let scsi_cmnd->cmnd use request->cmd[] buffer Boaz Harrosh
2007-11-01 18:05 ` [PATCH 2/4] block layer varlen-cdb Boaz Harrosh
2007-11-01 18:40   ` Matthew Wilcox
2007-11-02  6:32     ` Benny Halevy
2007-11-02 11:17       ` Matthew Wilcox
2007-11-05  9:17         ` Boaz Harrosh
2007-11-01 18:07 ` [PATCH 3/4] scsi: varlen extended and vendor-specific cdbs Boaz Harrosh
2007-11-01 18:10 ` [PATCH 4/4] iscsi: extended cdb support Boaz Harrosh
  -- strict thread matches above, loose matches on Subject: below --
2008-03-25 16:21 [PATCHSET 0/3] Is it time for varlen extended and vendor-specific cdbs Boaz Harrosh
2008-04-13 16:30 ` [PATCHSET 0/4 ver2] " Boaz Harrosh
2008-04-13 16:39   ` [PATCH 3/4] scsi: " Boaz Harrosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).