public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: bharrosh@panasas.com, James.Bottomley@suse.de,
	jaxboe@fusionio.com, linux-scsi@vger.kernel.org,
	Sathya.Prakash@lsi.com
Subject: Re: [PATCH] scsi: fix scsi_get_lba helper function for pc command
Date: Wed, 02 Jun 2010 09:13:51 -0400	[thread overview]
Message-ID: <yq1bpbtbmr4.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <20100602180515J.fujita.tomonori@lab.ntt.co.jp> (FUJITA Tomonori's message of "Wed, 2 Jun 2010 18:05:35 +0900")

>>>>> "Tomo" == FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> writes:

>> scsi LLDs can be pass-through for disks, as well as lots of other
>> type of devices. They should not assume the role of a disk. The use
>> of blk_rq_pos() at LLDs is probably wrong in the first place. Unless
>> it is some kind of scsi emulation driver like scsi_debug.

Tomo> Not only scsi_debug. Have you seen how scsi_get_lba() is used?
Tomo> LLDs sometime needs to know lba in scsi commands.

scsi_get_lba() is used by DIX/DIF-aware HBA drivers to get the first LBA
for use in reference tag verification/preparation.

This code path is only executed by the drivers if the command protection
mode is > SCSI_PROT_NORMAL which can only be true for a READ/WRITE
command.  I don't see any drivers using it for other purposes.

I have some changes in the pipeline to better support protection
interleaving in DIF Type 2.  I was contemplating renaming scsi_get_lba()
to scsi_get_reference_tag() or something to that effect.

As as for the reason scsi_get_lba() looks at the start sector directly:
I was simply trying to avoid growing struct scsi_cmnd.  The "correct"
thing would have been to add an initial reference tag field to scsi_cmnd
and have that be filled out by sd_prot_op().

-- 
Martin K. Petersen	Oracle Linux Engineering

  parent reply	other threads:[~2010-06-02 13:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-02  7:33 [PATCH] scsi: fix scsi_get_lba helper function for pc command FUJITA Tomonori
2010-06-02  8:14 ` Boaz Harrosh
2010-06-02  8:39   ` FUJITA Tomonori
2010-06-02  8:54     ` Boaz Harrosh
2010-06-02  9:05       ` FUJITA Tomonori
2010-06-02  9:23         ` Boaz Harrosh
2010-06-02 13:13         ` Martin K. Petersen [this message]
2010-06-03 10:59           ` FUJITA Tomonori
2010-06-03 11:03             ` Prakash, Sathya
2010-06-02 14:07 ` James Bottomley
2010-06-02 14:55   ` Douglas Gilbert
2010-06-03 11:18     ` FUJITA Tomonori

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=yq1bpbtbmr4.fsf@sermon.lab.mkp.net \
    --to=martin.petersen@oracle.com \
    --cc=James.Bottomley@suse.de \
    --cc=Sathya.Prakash@lsi.com \
    --cc=bharrosh@panasas.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=jaxboe@fusionio.com \
    --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