Re: [PATCH] target/iscsi: fix digest computation for chained SGs

2015-07-21 Thread Roland Dreier
On Tue, Jul 21, 2015 at 1:57 AM, Sagi Grimberg wrote: > How were you able to get a chained SG list in the target code? Local hack. So this bug can't be hit in current mainline code, but patch improves the code and removes a hidden booby-trap, so I think it makes sense to apply. -- To unsubscribe

Re: [PATCH v2 1/8] qla2xxx: kill sessions/log out initiator on RSCN and port down events

2015-07-27 Thread Roland Dreier
On Mon, Jul 27, 2015 at 1:09 AM, Hannes Reinecke wrote: > Hmm? What happened to the original FIXME? > Is it not required anymore? Not sure I follow the question. The original FIXME was "/* FIXME: Re-enable Global event handling.. */" and this patch indeed re-enables global event handling. I don

Re: [PATCH 8/8] IB/srp: Add multichannel support

2014-10-10 Thread Roland Dreier
On Mon, Oct 6, 2014 at 4:16 AM, Bart Van Assche wrote: > On 10/02/14 19:30, Christoph Hellwig wrote: >> Also if we want to merge scsi LLDDs that can take advantage of >> multiqueue support it would probably be best if I take this via the SCSI >> tree. > Sending these patches to you is fine with m

SCSI error handling -- one error blocks the whole SCSI host

2013-05-23 Thread Roland Dreier
At LSF this year, we had a discussion about error handling and in particular the problem that SCSI midlayer error handling waits for the entire SCSI host (HBA) to quiesce before it starts to abort commands etc. James made the suggestion that FC should handle things the way SAS does, because SAS ha

[PATCH] tcm_qla2xxx: Fix residual for underrun commands that fail

2013-06-05 Thread Roland Dreier
From: Roland Dreier Suppose an initiator sends a DATA IN command with an allocation length shorter than the FC transfer length -- we get a target message like TARGET_CORE[qla2xxx]: Expected Transfer Length: 256 does not match SCSI CDB Length: 0 for SAM Opcode: 0x12 In that case, the

[PATCH] [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal

2013-08-05 Thread Roland Dreier
From: Roland Dreier There is a nasty bug in the SCSI SG_IO ioctl that in some circumstances leads to one process writing data into the address space of some other random unrelated process if the ioctl is interrupted by a signal. What happens is the following: - A process issues an SG_IO ioctl

Re: [PATCH] [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal

2013-08-05 Thread Roland Dreier
+ } > bio_free_map_data(bmd); > bio_put(bio); > return ret; Yes, looks reasonable -- I can't think of any reason why anyone would ever want the bio code to copy to a random userspace address space. Acked-by: Roland Dreier -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH v2] [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal

2013-08-05 Thread Roland Dreier
From: Roland Dreier There is a nasty bug in the SCSI SG_IO ioctl that in some circumstances leads to one process writing data into the address space of some other random unrelated process if the ioctl is interrupted by a signal. What happens is the following: - A process issues an SG_IO ioctl

Re: [PATCH v2] [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal

2013-08-07 Thread Roland Dreier
On Wed, Aug 7, 2013 at 7:38 AM, David Milburn wrote: > I was able to succesfully test this patch overnight, I had been experimenting > with the > sg driver setting the BIO_NULL_MAPPED flag in sg_rq_end_io_usercontext for a > orphan process > which prevented the corruption, but your solution seem

Re: [PATCH v2] [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal

2013-08-08 Thread Roland Dreier
On Wed, Aug 7, 2013 at 9:31 AM, Douglas Gilbert wrote: > So what kind of signal was leading to your "stomping on the memory"? > Was it user generated or something like SIGIO, SIGPIPE or a RT signal? It was sometimes SIGHUP (for reopening log files) and sometimes SIGALARM (for various periodic thi

Re: [PATCH v2] [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal

2013-08-15 Thread Roland Dreier
Jens / James, do you guys plan to send this to Linus for 3.11? Triggering this bug is a bit esoteric but the impact is pretty nasty (corrupting an unrelated process). Thanks, Roland -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vge

Re: [PATCH 9/9] tcm_qla2xxx: Add special case for COMPARE_AND_WRITE data_direction

2013-08-21 Thread Roland Dreier
On Tue, Aug 20, 2013 at 1:08 PM, Nicholas A. Bellinger wrote: > Add a special case for COMPARE_AND_WRITE for the reverse data direction > mapping used for pci_map_sg() + friends. I don't understand this. In fact the whole patch series looks quite confused. COMPARE AND WRITE is a normal Data-Out

Re: [PATCH 9/9] tcm_qla2xxx: Add special case for COMPARE_AND_WRITE data_direction

2013-08-21 Thread Roland Dreier
On Wed, Aug 21, 2013 at 7:38 AM, Roland Dreier wrote: > I don't understand this. In fact the whole patch series looks quite > confused. COMPARE AND WRITE is a normal Data-Out command, with no > requirement for special bidirectional handling or anything like that. > The only

Re: [PATCH v2] IB/srp: Add 64-bit LUN support

2015-04-02 Thread Roland Dreier
Thanks, applied at last. I'm assuming the vscsi changes are OK since they look mechanical and we haven't heard anything from IBM people. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vge

Re: [PATCH 00/11] First pass at merging Bart's HA work

2012-11-26 Thread Roland Dreier
> This series compiles, but is otherwise UNTESTED. I'll be working on that > over the next few days, with an eye on getting as much of Bart's work > into 3.8 as possible. Hi Dave, Great to have you back. Certainly I'd like to get this stuff into 3.8 too. A couple of comments: - I think the

Re: [PATCH] UAPI: (Scripted) Disintegrate include/rdma

2012-11-26 Thread Roland Dreier
Thanks, applied. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 00/11] First pass at merging Bart's HA work

2012-11-26 Thread Roland Dreier
> I'm amenable to that, but we do need an agreed patch set, as Roland > says. I also hate to apply the pressure, but I suspect -rc7 was the > last -rc, so I'm expecting the merge window to open on 2/12. I think the srp_transport bits are all simple and non-controversial. So at least from my persp

Re: [PATCH 00/11] First pass at merging Bart's HA work

2012-11-29 Thread Roland Dreier
On Mon, Nov 26, 2012 at 8:04 PM, David Dillow wrote: > We can push it through James's tree if need be, but Bart's code is > pretty self-contained, and going through the SCSI tree will introduce > merge dependencies. It'd be much easier to push it all through the RDMA > tree, especially if we want

[PATCH 0/5] target task management fixes and cleanups

2013-01-02 Thread Roland Dreier
From: Roland Dreier Hi Nic, A few fixes for TMR handling (fix crashes when a backend is really slow, fix a reference leak if we get a TMR for a non-existent LUN) and a couple of trivial cleanups in related code. Roland Dreier (5): target: Don't let abort handling free pending write com

[PATCH 2/5] target: Fix use-after-free in LUN RESET handling

2013-01-02 Thread Roland Dreier
From: Roland Dreier If a backend IO takes a really long then an initiator might abort a command, and then when it gives up on the abort, send a LUN reset too, all before we process any of the original command or the abort. (The abort will wait for the backend IO to complete too) When the

[PATCH 3/5] target: Release se_cmd when LUN lookup fails for TMR

2013-01-02 Thread Roland Dreier
From: Roland Dreier When transport_lookup_tmr_lun() fails and we return a task management response from target_complete_tmr_failure(), we need to call transport_cmd_check_stop_to_fabric() to release the last ref to the cmd after calling se_tfo->queue_tm_rsp(), or else we will never remove

[PATCH 1/5] target: Don't let abort handling free pending write commands too soon

2013-01-02 Thread Roland Dreier
From: Roland Dreier The following sequence happens for write commands (or any other commands with a data out phase): - The transport calls target_submit_cmd(), which sets CMD_T_ACTIVE in cmd->transport_state and sets cmd->t_state to TRANSPORT_NEW_CMD. - Things

[PATCH 5/5] target: Remove never-used TMR_FABRIC_TMR enum value

2013-01-02 Thread Roland Dreier
From: Roland Dreier Signed-off-by: Roland Dreier --- include/target/target_core_base.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 7cae236..02ed017 100644 --- a/include/target/target_core_base.h +++ b/include

[PATCH 4/5] target: Remove useless if statement

2013-01-02 Thread Roland Dreier
From: Roland Dreier We do the same thing no matter which way the test goes, so just remove the test and do what we're going to do. The debug messages printed the wrong value of CMD_T_ACTIVE and don't seem particularly useful, remove them too. Signed-off-by: Roland Dreier --- driv

Re: [PATCH] iscsi-target: Fix bug in handling of ExpStatSN ACK during u32 wrap-around

2013-01-07 Thread Roland Dreier
On Wed, Dec 26, 2012 at 1:33 PM, Ben Hutchings wrote: >> if (!(cmd->cmd_flags & ICF_OOO_CMDSN) && !cmd->immediate_cmd && >> - (cmd->cmd_sn >= conn->sess->exp_cmd_sn)) { >> + iscsi_sna_gte(cmd->stat_sn, conn->sess->exp_cmd_sn)) { >>

[PATCH] iscsi-target: Fix CmdSN comparison (use cmd->cmd_sn instead of cmd->stat_sn)

2013-01-07 Thread Roland Dreier
From: Roland Dreier Commit 64c13330a389 ("iscsi-target: Fix bug in handling of ExpStatSN ACK during u32 wrap-around") introduced a bug where we compare the wrong SN against our ExpCmdSN. Reported-by: Ben Hutchings Signed-off-by: Roland Dreier --- drivers/target/iscsi/iscsi_target_

Re: [LSF/MM TOPIC] Thin provisioning SOFT_THRESHOLD error handling

2013-02-04 Thread Roland Dreier
On Tue, Jan 29, 2013 at 12:14 AM, Hannes Reinecke wrote: > I would like to discuss at LSF the possible implementations > and handling mechanism for this kind of failure scenarios. I'd be interested in that discussion. With my Pure hat on, our array can generate these thin provisioning threshold

Re: [LSF/MM TOPIC] I_T Nexus loss SCSI error handling

2013-02-04 Thread Roland Dreier
On Mon, Jan 21, 2013 at 3:18 AM, Hannes Reinecke wrote: > The current error handler still uses a 'target reset' (or, rather, bus > reset) strategy, although the respective TMF has been obsoleted since > SAM-3. SAM-5 defines an I_T nexus loss event instead, which so far has only > been implemented

[PATCH 1/3] target: Fix sense data for out-of-bounds IO operations

2013-02-08 Thread Roland Dreier
From: Roland Dreier We're supposed to return LOGICAL BLOCK ADDRESS OUT OF RANGE, not INVALID FIELD IN CDB. Signed-off-by: Roland Dreier --- drivers/target/target_core_sbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/target_core_sbc.c b/drivers/t

[PATCH 2/3] target: Fix error checking for UNMAP commands

2013-02-08 Thread Roland Dreier
From: Roland Dreier SBC-3 (revision 35) says: The PARAMETER LIST LENGTH field specifies the length in bytes of the UNMAP parameter list that is available to be transferred from the Data-Out Buffer. If the parameter list length is greater than zero and less than 0008h (i.e

[PATCH 3/3] target: Fix parameter list length checking in MODE SELECT

2013-02-08 Thread Roland Dreier
From: Roland Dreier An empty parameter list (length == 0) is not an error, so succeed MODE SELECT in this case. If the parameter list length is too small, return the correct sense code of PARAMETER LIST LENGTH ERROR. Signed-off-by: Roland Dreier --- drivers/target/target_core_spc.c | 13

Re: [PATCH 2/3] target: Fix error checking for UNMAP commands

2013-02-09 Thread Roland Dreier
On Sat, Feb 9, 2013 at 1:23 AM, Chris Boot wrote: >> + case TCM_PARAMETER_LIST_LENGTH_ERROR: >> + /* CURRENT ERROR */ >> + buffer[0] = 0x70; >> + buffer[SPC_ADD_SENSE_LEN_OFFSET] = 10; >> + /* ILLEGAL REQUEST */ >> + buffe

[PATCH] [SCSI] Wake blockdev queue in scsi_internal_device_unblock() for SDEV_RUNNING

2013-02-25 Thread Roland Dreier
From: Roland Dreier If a SCSI device's old state is already SDEV_RUNNING and we're moving to the same SDEV_RUNNING state, still wake the blockdev queue in scsi_internal_device_unblock(). This fixes a case where we silently hang SCSI commands forever during device discovery. One wa

Re: [RFC 01/11] iscsi-target: Add iscsit_transport API template

2013-03-07 Thread Roland Dreier
On Thu, Mar 7, 2013 at 5:45 PM, Nicholas A. Bellinger wrote: > +EXPORT_SYMBOL(iscsit_get_transport); It's not clear to me why this needs to be exported. Who would use it outside the core iscsi target module? -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of

Re: [RFC 01/11] iscsi-target: Add iscsit_transport API template

2013-03-08 Thread Roland Dreier
On Thu, Mar 7, 2013 at 10:02 PM, Nicholas A. Bellinger wrote: > Or and I discussed this point in the last status call, and given what > the initiator did originally (eg: export iscsi_transport) he asked to > keep it under drivers/infiniband/ulp/isert/ with the extra include bits. > > I'd have a sl

Re: [PATCH] [SCSI] Wake blockdev queue in scsi_internal_device_unblock() for SDEV_RUNNING

2013-03-11 Thread Roland Dreier
> With the old scsi_lib code, scsi_internal_device_unblock() will return > an error at this point because the sdev state is already SDEV_RUNNING. > This means we skip the call to blk_start_queue() and never actually > start executing commands again. > > Fix this by still going ahead and finishing s

Re: [PATCH] [SCSI] Wake blockdev queue in scsi_internal_device_unblock() for SDEV_RUNNING

2013-03-11 Thread Roland Dreier
On Mon, Mar 11, 2013 at 11:08 AM, Mike Christie wrote: >> If at the same time a SAS fabric event goes to the HBA, what can >> happen is the following: >> >> - mpt2sas calls _scsih_block_io_all_device() -> >> scsi_internal_device_block(sdev) >> >>(In response to some HBA firmware even

Re: SCSI breakage on non-cache coherent architectures

2007-11-19 Thread Roland Dreier
> I've been debugging various issues on the PowerPC 44x embedded > architecture which happens to have non-coherent PCI DMA. > > One of the problem I'm hitting is that one really need to enforce > kmalloc alignement to cache lines or bad things will happen (among > others with USB), for some

Re: SCSI breakage on non-cache coherent architectures

2007-11-19 Thread Roland Dreier
> 2) Add the __dma_cacheline_aligned tag. > > But note that with #2 it could get quite ugly because the > alignment and size both have a minimum that needs to be > enforced, not just the alignment alone. So either: > > struct foo { > unsigned int other_unrelated_stuff; > > s

Re: SCSI breakage on non-cache coherent architectures

2007-11-20 Thread Roland Dreier
> Actually, we already established on IRC that the lasi700 driver doesn't > need this, principally because the parisc architecture doesn't do an > invalidate for DMA_FROM_DEVICE but a flush and invalidate > (architecturally, if you read our manuals, even pdc is entitled to write > back dirty l

Re: [PATCH 1/2] DMA buffer alignment annotations

2007-12-21 Thread Roland Dreier
> > +#define __dma_aligned > > __attribute__((aligned(ARCH_MIN_DMA_ALIGNMENT))) > > +#define __dma_buffer __dma_buffer_line(__LINE__) > > +#define __dma_buffer_line(line) __dma_aligned;\ > > + char __dma_pad_##line[0] __dma_aligned > You i

Re: [PATCH 2/2] scsi: Use new __dma_buffer to align sense buffer in scsi_cmnd

2007-12-21 Thread Roland Dreier
> It's also incomplete as a fix because I don't see what guarantees the > buffer size will always exceed cache line size There's a macro trick that adds a pad member after the buffer too, so that it gets rounded up to the cacheline size: > +#define __dma_aligned > __attribute__

Re: Integration of SCST in the mainstream Linux kernel

2008-01-29 Thread Roland Dreier
> . . STGT read SCST read.STGT read > SCST read. > . . performance performance . performance > performance . > . . (0.5K, MB/s) (0.5K, MB/s) . (1 MB, MB/s) > (1 MB, MB/s)

Re: Integration of SCST in the mainstream Linux kernel

2008-02-06 Thread Roland Dreier
> Sorry, but I'm afraid you got this wrong. When the iSER transport is > used instead of TCP, all data is sent via RDMA, including unsolicited > data. If you have look at the iSER implementation in the Linux kernel > (source files under drivers/infiniband/ulp/iser), you will see that > all dat

[PATCH] target: Return an error for WRITE SAME with ANCHOR==1

2013-10-14 Thread Roland Dreier
From: Roland Dreier Per SBC-3, since we report ANC_SUP==0 in VPD page B2h, we need to return an error (ILLEGAL REQUEST/INVALID FIELD IN CDB) for all WRITE SAME requests with ANCHOR==1. Signed-off-by: Roland Dreier --- drivers/target/target_core_sbc.c | 5 + 1 file changed, 5 insertions

[PATCH] qla2xxx: Remove last vestiges of qla_tgt_cmd.cmd_list

2014-01-31 Thread Roland Dreier
From: Roland Dreier The only place this struct member is touched is in one INIT_LIST_HEAD. Signed-off-by: Roland Dreier --- drivers/scsi/qla2xxx/qla_target.c | 2 -- drivers/scsi/qla2xxx/qla_target.h | 1 - 2 files changed, 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b

[PATCH] target: Fix missing length check in spc_emulate_evpd_83()

2014-02-03 Thread Roland Dreier
From: Roland Dreier Commit fbfe858fea2a ("target_core_spc: Include target device descriptor in VPD page 83") added a new length variable, but (due to a cut and paste mistake?) just checks scsi_name_len against 256 twice. Fix this to check scsi_target_len for overflow too. Signed-off-

[PATCH] target: Simplify command completion by removing CMD_T_FAILED flag

2014-02-03 Thread Roland Dreier
From: Roland Dreier The CMD_T_FAILED flag is set used in one place to record the result of a trivial test, and it is only tested once, few lines later. We might as well make the code simpler and easier to read by directly doing the test of "success" where we want to use it. Sig

Re: [PATCH 0/2] Include protection information in iscsi header

2014-06-02 Thread Roland Dreier
On Sun, Jun 1, 2014 at 9:19 AM, Sagi Grimberg wrote: > Although these patches involve 3 subsystems with different > maintainers (scsi, iser, target) I would prefer seeing these > patches included together. Why? Because they break wire compatibility? I hate to say it but even if they're merged a

Re: Asynchronous scsi scanning

2007-05-15 Thread Roland Dreier
> No, it does matter. Your suggestion doesn't work, because > /sys/module/scsi_mod/parameters/ belongs to the module code. To create > a new attribute there, you use the module_param() code -- and there's > no way to have code called when your parameter is changed. If I'm not misunderstandin

Re: [ofa-general] [PATCH 2/2] ib fmr pool: flush used clean entries

2008-02-26 Thread Roland Dreier
This looks like a really nice approach to me. Olaf? - R. - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 0/7] series to fix qla2xxx use-after-free

2012-07-16 Thread Roland Dreier
From: Roland Dreier Hi Nic, Here's a series that's fundamentally about fixing a use-after-free in qla_target code. It ends up being seven patches because I wanted to make each step easy to review, and several of these are just cleanups that stand on their own. We have a few mo

[PATCH 1/7] qla2xxx: Get rid of redundant qla_tgt_sess.tearing_down

2012-07-16 Thread Roland Dreier
From: Roland Dreier The only place that sets qla_tgt_sess.tearing_down calls target_splice_sess_cmd_list() immediately afterwards, without dropping the lock it holds. That function sets se_session.sess_tearing_down, so we can get rid of the qla_target-specific flag, and in the one place that

[PATCH 2/7] target: Un-export target_get_sess_cmd()

2012-07-16 Thread Roland Dreier
From: Roland Dreier There are no in-tree users of target_get_sess_cmd() outside of target_core_transport.c. Any new code should use the higher-level target_submit_cmd() interface. So let's un-export target_get_sess_cmd() and make it static to the one file where it's actually used.

[PATCH 3/7] sbp-target: Consolidate duplicated error path code in sbp_handle_command()

2012-07-16 Thread Roland Dreier
From: Roland Dreier Cc: Chris Boot Cc: Stefan Richter Signed-off-by: Roland Dreier --- drivers/target/sbp/sbp_target.c | 28 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index

[PATCH 5/7] target: Check sess_tearing_down in target_get_sess_cmd()

2012-07-16 Thread Roland Dreier
From: Roland Dreier Target core code assumes that target_splice_sess_cmd_list() has set sess_tearing_down and moved the list of pending commands to sess_wait_list, no more commands will be added to the session; if any are added, nothing keeps the se_session from being freed while the command is

[PATCH 6/7] qla2xxx: Remove racy, now-redundant check of sess_tearing_down

2012-07-16 Thread Roland Dreier
From: Roland Dreier Now that target_submit_cmd() / target_get_sess_cmd() check sess_tearing_down before adding commands to the list, we no longer need the check in qlt_do_work(). In fact this check is racy anyway (and that race is what inspired the change to add the check of sess_tearing_down

[PATCH 4/7] target: Allow for target_submit_cmd() returning errors

2012-07-16 Thread Roland Dreier
From: Roland Dreier We want it to be possible for target_submit_cmd() to return errors up to its fabric module callers. For now just update the prototype to return an int, and update all callers to handle non-zero return values as an error. Cc: Chad Dupuis Cc: Arun Easi Cc: Chris Boot Cc

[PATCH 7/7] target: Remove se_session.sess_wait_list

2012-07-16 Thread Roland Dreier
From: Roland Dreier Since we set se_session.sess_tearing_down and stop new commands from being added to se_session.sess_cmd_list before we wait for commands to finish when freeing a session, there's no need for a separate sess_wait_list -- if we let new commands be added to sess_cmd_list

Re: [PATCH 4/7] target: Allow for target_submit_cmd() returning errors

2012-07-16 Thread Roland Dreier
On Mon, Jul 16, 2012 at 4:00 PM, Nicholas A. Bellinger wrote: > Mmmm. The original target_submit_cmd() code had been propagating up a > return value, but then we decided (via Agrover's patch) that it made > more sense for target_submit_cmd() to always handle exceptions via > normal TFO callbacks,

Re: [PATCH 5/7] target: Check sess_tearing_down in target_get_sess_cmd()

2012-07-16 Thread Roland Dreier
On Mon, Jul 16, 2012 at 4:08 PM, Nicholas A. Bellinger wrote: > However, I'm still leaning towards a way to do this for tcm_qla2xxx that > does not require all fabric callers to handle target_submit_cmd() > exceptions directly.. > > How about a special target_get_sess_cmd() failure callback to fre

Re: [PATCH 5/7] target: Check sess_tearing_down in target_get_sess_cmd()

2012-07-16 Thread Roland Dreier
> OK, I'll take a look at how you handle this... So looking at commit bc187ea6c3b3 in the tree you just pushed out ("target: Check sess_tearing_down in target_get_sess_cmd()") it looks like you just return from target_submit_cmd() if we fail to add the command to sess_cmd_list -- doesn't this mean

Re: [PATCH 5/7] target: Check sess_tearing_down in target_get_sess_cmd()

2012-07-17 Thread Roland Dreier
On Mon, Jul 16, 2012 at 6:56 PM, Nicholas A. Bellinger wrote: >> Do you have a plan for how to handle this? Do we really want to plumb >> through another callback to tell the fabric driver to free the command >> in this case? > I need to think more about this ahead of changing it back again for-

Re: [PATCH] target: Remove unused se_cmd.cmd_spdtl

2012-08-18 Thread Roland Dreier
On Fri, Aug 17, 2012 at 6:02 PM, Nicholas A. Bellinger wrote: > No, or at least that is not what happens anymore with current target > core + iscsi-target code.. > > The se_cmd->data_length re-assignment here is what will be used by > iscsi-target fabric code for all iSCSI descriptor related alloc

[PATCH] qla2xxx: Fix endianness of task management response code

2012-09-18 Thread Roland Dreier
From: Roland Dreier The qla2xxx firmware actually expects the task management response code in a CTIO IOCB with SCSI status mode 1 to be in little-endian byte order, ie the response code should be the first byte in the sense_data[] array. The old code erroneously byte-swapped the response code

Re: [PATCH] qla2xxx: Fix endianness of task management response code

2012-09-19 Thread Roland Dreier
On Wed, Sep 19, 2012 at 12:59 AM, James Bottomley wrote: > Is this also true on Big Endian Hardware? Because the fix you have > assumes that the TIO IOCB with SCSI status mode 1 should be CPU > endian ... that doesn't look right since this is passed directly over > the PCI bus (and the PCI bus is

Re: [PATCH] qla2xxx: Fix endianness of task management response code

2012-09-21 Thread Roland Dreier
On Fri, Sep 21, 2012 at 1:02 AM, James Bottomley wrote: > The data in status1 appears to get used a word at a time ... what about > the other three bytes you don't set; are they guaranteed to be zero? (in > which case this works, it just looks wrong from the way the thing is > used in the rest of

[PATCH 0/2] qla2xxx target fixes

2012-10-11 Thread Roland Dreier
From: Roland Dreier Hi everyone, a couple of qla2xxx target fixes that we've been shipping for a while at Pure and that I've finally got around to cleaning up and merging to the latest kernel tree... Roland Dreier (2): tcm_qla2xxx: Format VPD page 83h SCSI name string accord

[PATCH 1/2] tcm_qla2xxx: Format VPD page 83h SCSI name string according to SPC

2012-10-11 Thread Roland Dreier
From: Roland Dreier My draft of SPC-4 says the following about the SCSI name string in inquiry VPD page 83h: The SCSI NAME STRING field starts with either: a) the four UTF-8 characters 'eui.' concatenated with 16, 24, or 32 hexadecimal digits (i.e., the UTF-8 ch

[PATCH 2/2] qla2xxx: Update target lookup session tables when a target session changes

2012-10-11 Thread Roland Dreier
From: Roland Dreier It is possible for the target code to change the loop_id or s_id of a target session in reaction to an FC fabric change. However, the session structures are stored in tables that are indexed by these two keys, and if we just change the session structure but leave the

Re: [PATCH 0/2] Fix the qla2xxx loopback selftests

2012-10-22 Thread Roland Dreier
On Tue, Aug 14, 2012 at 2:15 PM, Chad Dupuis wrote: > > > On Tue, 14 Aug 2012, st...@purestorage.com wrote: > >> From: Steve Hodgson >> >> A few months ago our 2.6.39 based kernel started crashing almost 100% >> of the time when running the selftests, after seeminly unrelated kernel >> changes. I

[PATCH 0/4] Make aborts work on tcm_qla2xxx, other cleanups

2012-11-16 Thread Roland Dreier
From: Roland Dreier Hi Nic, Here's a series that makes aborts actually work on qla2xxx. Stopping and releasing commands is quite convoluted so I'm not sure the first patch is totally correct, but without it I can easily reproduce task hangs or list corruption by having an initiat

[PATCH 1/4] target: Fix handling of aborted commands

2012-11-16 Thread Roland Dreier
From: Roland Dreier - If we stop processing an already-aborted command in target_execute_cmd(), then we need to complete t_transport_stop_comp to wake up the the TMR handling thread, or else it will end up waiting forever. - If we've a already sent an "aborted" status f

[PATCH 2/4] qla2xxx: Look up LUN for abort requests

2012-11-16 Thread Roland Dreier
From: Steve Hodgson Search through the list of pending commands on the session list to find the command the initiator is actually aborting, so that we can pass the correct LUN to the core TMR handling code. Signed-off-by: Steve Hodgson Signed-off-by: Roland Dreier --- drivers/scsi/qla2xxx

[PATCH 3/4] target: Clean up logic in transport_put_cmd()

2012-11-16 Thread Roland Dreier
From: Roland Dreier No need to have a goto where a return is clearer. Signed-off-by: Roland Dreier --- drivers/target/target_core_transport.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target

[PATCH 4/4] target: Clean up flow in transport_check_aborted_status()

2012-11-16 Thread Roland Dreier
From: Roland Dreier Signed-off-by: Roland Dreier --- drivers/target/target_core_transport.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 0f29d70..f225f90

Re: [ANNOUNCE]: Broadcom (Emulex) FC Target driver - efct

2017-05-16 Thread Roland Dreier
On Sun, Mar 5, 2017 at 8:35 AM, Sebastian Herbszt wrote: > Just like Hannes I do favour integration. I guess it could be > comparable to qla2xxx + tcm_qla2xxx, lpfc + lpfc_scst and > lpfc + tcm_lpfc. That approach might even help Bart with his > target driver unification if he didn't give up on th

[RFC] First pass at InfiniBand SRP initiator

2005-07-15 Thread Roland Dreier
efine DRV_NAME "ib_srp" +#define PFXDRV_NAME ": " +#define DRV_VERSION"0.01" +#define DRV_RELDATE"January 11, 2005" + +MODULE_AUTHOR("Roland Dreier"); +MODULE_DESCRIPTION("InfiniBand SCSI RDMA Protocol driv