* [PATCH 21/24][RFC] scsi_tgt: use of sense accessors
@ 2008-02-04 17:53 Boaz Harrosh
2008-02-05 16:21 ` Pete Wyckoff
0 siblings, 1 reply; 4+ messages in thread
From: Boaz Harrosh @ 2008-02-04 17:53 UTC (permalink / raw)
To: James Bottomley, FUJITA Tomonori, Christoph Hellwig, Jens Axboe
Cc: Andrew Morton
FIXME: I need help with this driver (Pete?)
I used scsi_sense() in a none const way. But since
scsi_tgt is the ULD here, it can just access it's own sense
buffer directly. I did not use scsi_eh_cpy_sense() because
I did not want the extra copy. Pete will want to use a 260
bytes buffer here.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Need-help-from: Pete Wyckoff <pw@osc.edu>
---
drivers/scsi/scsi_tgt_lib.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
index e01a985..d42f318 100644
--- a/drivers/scsi/scsi_tgt_lib.c
+++ b/drivers/scsi/scsi_tgt_lib.c
@@ -29,6 +29,7 @@
#include <scsi/scsi_host.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_tgt.h>
+#include <scsi/scsi_eh.h>
#include "scsi_tgt_priv.h"
@@ -397,7 +398,7 @@ static int scsi_tgt_copy_sense(struct scsi_cmnd *cmd, unsigned long uaddr,
{
char __user *p = (char __user *) uaddr;
- if (copy_from_user(cmd->sense_buffer, p,
+ if (copy_from_user(scsi_sense(cmd), p,
min_t(unsigned, SCSI_SENSE_BUFFERSIZE, len))) {
printk(KERN_ERR "Could not copy the sense buffer\n");
return -EIO;
--
1.5.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 21/24][RFC] scsi_tgt: use of sense accessors
2008-02-04 17:53 [PATCH 21/24][RFC] scsi_tgt: use of sense accessors Boaz Harrosh
@ 2008-02-05 16:21 ` Pete Wyckoff
2008-02-05 16:53 ` FUJITA Tomonori
0 siblings, 1 reply; 4+ messages in thread
From: Pete Wyckoff @ 2008-02-05 16:21 UTC (permalink / raw)
To: Boaz Harrosh
Cc: James Bottomley, FUJITA Tomonori, Christoph Hellwig, Jens Axboe,
Jeff Garzik, linux-scsi, Andrew Morton
bharrosh@panasas.com wrote on Mon, 04 Feb 2008 19:53 +0200:
> FIXME: I need help with this driver (Pete?)
> I used scsi_sense() in a none const way. But since
> scsi_tgt is the ULD here, it can just access it's own sense
> buffer directly. I did not use scsi_eh_cpy_sense() because
> I did not want the extra copy. Pete will want to use a 260
> bytes buffer here.
>
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> Need-help-from: Pete Wyckoff <pw@osc.edu>
FYI, I never use scsi_tgt. Only just pure userspace on the target,
and a dumb ethernet NIC that does not know it is speaking any form
of SCSI.
People who need scsi_tgt have real target-enabled NICs like the
fancy qla4xxx. Those act as SCSI targets across FC or IP or
whatever and bring commands into the kernel, which then relays them
to a userspace tgtd process, which does the read/write as necessary,
and returns a result code to the NIC to ship back across FC.
So sorry, I won't take a guess at what has to happen here. But
yeah, you are right that an OSD target implementation would at times
need a sense buffer bigger than 96. Protocol maximum length for all
sense data is 264.
-- Pete
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 21/24][RFC] scsi_tgt: use of sense accessors
2008-02-05 16:21 ` Pete Wyckoff
@ 2008-02-05 16:53 ` FUJITA Tomonori
2008-02-05 17:28 ` Jeff Garzik
0 siblings, 1 reply; 4+ messages in thread
From: FUJITA Tomonori @ 2008-02-05 16:53 UTC (permalink / raw)
To: pw
Cc: bharrosh, James.Bottomley, fujita.tomonori, hch, jens.axboe, jeff,
linux-scsi, akpm
On Tue, 5 Feb 2008 11:21:33 -0500
Pete Wyckoff <pw@osc.edu> wrote:
> bharrosh@panasas.com wrote on Mon, 04 Feb 2008 19:53 +0200:
> > FIXME: I need help with this driver (Pete?)
> > I used scsi_sense() in a none const way. But since
> > scsi_tgt is the ULD here, it can just access it's own sense
> > buffer directly. I did not use scsi_eh_cpy_sense() because
> > I did not want the extra copy. Pete will want to use a 260
> > bytes buffer here.
> >
> > Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> > Need-help-from: Pete Wyckoff <pw@osc.edu>
>
> FYI, I never use scsi_tgt. Only just pure userspace on the target,
> and a dumb ethernet NIC that does not know it is speaking any form
> of SCSI.
Seems that many people misunderstand STGT iSCSI (and iSER), FCoE, and
SRP (not implemented yet) software target drivers. They don't use the
tgt kernel module. They just run in user space like user-space nfs
daemon.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 21/24][RFC] scsi_tgt: use of sense accessors
2008-02-05 16:53 ` FUJITA Tomonori
@ 2008-02-05 17:28 ` Jeff Garzik
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2008-02-05 17:28 UTC (permalink / raw)
To: FUJITA Tomonori
Cc: pw, bharrosh, James.Bottomley, fujita.tomonori, hch, jens.axboe,
linux-scsi, akpm, Linus Torvalds
FUJITA Tomonori wrote:
> On Tue, 5 Feb 2008 11:21:33 -0500
> Pete Wyckoff <pw@osc.edu> wrote:
>
>> bharrosh@panasas.com wrote on Mon, 04 Feb 2008 19:53 +0200:
>>> FIXME: I need help with this driver (Pete?)
>>> I used scsi_sense() in a none const way. But since
>>> scsi_tgt is the ULD here, it can just access it's own sense
>>> buffer directly. I did not use scsi_eh_cpy_sense() because
>>> I did not want the extra copy. Pete will want to use a 260
>>> bytes buffer here.
>>>
>>> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
>>> Need-help-from: Pete Wyckoff <pw@osc.edu>
>> FYI, I never use scsi_tgt. Only just pure userspace on the target,
>> and a dumb ethernet NIC that does not know it is speaking any form
>> of SCSI.
>
> Seems that many people misunderstand STGT iSCSI (and iSER), FCoE, and
> SRP (not implemented yet) software target drivers. They don't use the
> tgt kernel module. They just run in user space like user-space nfs
> daemon.
FWIW, some AHCI and other SATA chips implement ATA target mode. I'm
watching this SCSI work with interest, hoping that many of the concepts
(and code?) can be applied to SATA as well.
If for no other reason than I can build a cheap ATA protocol analyzer,
or bridge.
Jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-02-05 17:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-04 17:53 [PATCH 21/24][RFC] scsi_tgt: use of sense accessors Boaz Harrosh
2008-02-05 16:21 ` Pete Wyckoff
2008-02-05 16:53 ` FUJITA Tomonori
2008-02-05 17:28 ` Jeff Garzik
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.