All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 06/16] RDMA/srpt: Fix handling of command / TMF submission failure
@ 2019-01-25 18:34 Bart Van Assche
  2019-02-02  0:15 ` Mike Christie
  2019-02-02  0:53 ` Bart Van Assche
  0 siblings, 2 replies; 3+ messages in thread
From: Bart Van Assche @ 2019-01-25 18:34 UTC (permalink / raw)
  To: target-devel

If submitting an SRP IU to the target core fails, send the SCSI
response "BUSY" to the initiator instead of not sending any
response.

Reviewed-by: Hannes Reinecke <hare@suse.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Mike Christie <mchristi@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 8cee8c6c6be9..4fc901d1c0c1 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -1505,7 +1505,7 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch,
 			pr_err("0x%llx: parsing SRP descriptor table failed.\n",
 			       srp_cmd->tag);
 		}
-		goto release_ioctx;
+		goto busy;
 	}
 
 	rc = target_submit_cmd_map_sgls(cmd, ch->sess, srp_cmd->cdb,
@@ -1516,13 +1516,12 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch,
 	if (rc != 0) {
 		pr_debug("target_submit_cmd() returned %d for tag %#llx\n", rc,
 			 srp_cmd->tag);
-		goto release_ioctx;
+		goto busy;
 	}
 	return;
 
-release_ioctx:
-	send_ioctx->state = SRPT_STATE_DONE;
-	srpt_release_cmd(cmd);
+busy:
+	target_send_busy(cmd);
 }
 
 static int srp_tmr_to_tcm(int fn)
-- 
2.20.1.495.gaa96b0ce6b-goog

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

* Re: [PATCH 06/16] RDMA/srpt: Fix handling of command / TMF submission failure
  2019-01-25 18:34 [PATCH 06/16] RDMA/srpt: Fix handling of command / TMF submission failure Bart Van Assche
@ 2019-02-02  0:15 ` Mike Christie
  2019-02-02  0:53 ` Bart Van Assche
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Christie @ 2019-02-02  0:15 UTC (permalink / raw)
  To: target-devel

On 01/25/2019 12:34 PM, Bart Van Assche wrote:
> If submitting an SRP IU to the target core fails, send the SCSI
> response "BUSY" to the initiator instead of not sending any
> response.
> 
> Reviewed-by: Hannes Reinecke <hare@suse.com>
> Cc: Doug Ledford <dledford@redhat.com>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Cc: Nicholas Bellinger <nab@linux-iscsi.org>
> Cc: Mike Christie <mchristi@redhat.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/infiniband/ulp/srpt/ib_srpt.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
> index 8cee8c6c6be9..4fc901d1c0c1 100644
> --- a/drivers/infiniband/ulp/srpt/ib_srpt.c
> +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
> @@ -1505,7 +1505,7 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch,
>  			pr_err("0x%llx: parsing SRP descriptor table failed.\n",
>  			       srp_cmd->tag);
>  		}
> -		goto release_ioctx;
> +		goto busy;
>  	}
>  
>  	rc = target_submit_cmd_map_sgls(cmd, ch->sess, srp_cmd->cdb,
> @@ -1516,13 +1516,12 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch,
>  	if (rc != 0) {
>  		pr_debug("target_submit_cmd() returned %d for tag %#llx\n", rc,
>  			 srp_cmd->tag);
> -		goto release_ioctx;
> +		goto busy;
>  	}
>  	return;
>  
> -release_ioctx:
> -	send_ioctx->state = SRPT_STATE_DONE;
> -	srpt_release_cmd(cmd);
> +busy:
> +	target_send_busy(cmd);
>  }
>  
>  static int srp_tmr_to_tcm(int fn)
> 

Can you not do transport_generic_request_failure(cmd, TCM_LUN_BUSY),
because some of the cmd's bits are not yet set?

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

* Re: [PATCH 06/16] RDMA/srpt: Fix handling of command / TMF submission failure
  2019-01-25 18:34 [PATCH 06/16] RDMA/srpt: Fix handling of command / TMF submission failure Bart Van Assche
  2019-02-02  0:15 ` Mike Christie
@ 2019-02-02  0:53 ` Bart Van Assche
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2019-02-02  0:53 UTC (permalink / raw)
  To: target-devel

On Fri, 2019-02-01 at 18:15 -0600, Mike Christie wrote:
+AD4 On 01/25/2019 12:34 PM, Bart Van Assche wrote:
+AD4 +AD4 If submitting an SRP IU to the target core fails, send the SCSI
+AD4 +AD4 response +ACI-BUSY+ACI to the initiator instead of not sending any
+AD4 +AD4 response.
+AD4 +AD4 
+AD4 +AD4 Reviewed-by: Hannes Reinecke +ADw-hare+AEA-suse.com+AD4
+AD4 +AD4 Cc: Doug Ledford +ADw-dledford+AEA-redhat.com+AD4
+AD4 +AD4 Cc: Jason Gunthorpe +ADw-jgg+AEA-ziepe.ca+AD4
+AD4 +AD4 Cc: Nicholas Bellinger +ADw-nab+AEA-linux-iscsi.org+AD4
+AD4 +AD4 Cc: Mike Christie +ADw-mchristi+AEA-redhat.com+AD4
+AD4 +AD4 Cc: Christoph Hellwig +ADw-hch+AEA-lst.de+AD4
+AD4 +AD4 Signed-off-by: Bart Van Assche +ADw-bvanassche+AEA-acm.org+AD4
+AD4 +AD4 ---
+AD4 +AD4  drivers/infiniband/ulp/srpt/ib+AF8-srpt.c +AHw 9 +-+-+-+------
+AD4 +AD4  1 file changed, 4 insertions(+-), 5 deletions(-)
+AD4 +AD4 
+AD4 +AD4 diff --git a/drivers/infiniband/ulp/srpt/ib+AF8-srpt.c b/drivers/infiniband/ulp/srpt/ib+AF8-srpt.c
+AD4 +AD4 index 8cee8c6c6be9..4fc901d1c0c1 100644
+AD4 +AD4 --- a/drivers/infiniband/ulp/srpt/ib+AF8-srpt.c
+AD4 +AD4 +-+-+- b/drivers/infiniband/ulp/srpt/ib+AF8-srpt.c
+AD4 +AD4 +AEAAQA -1505,7 +-1505,7 +AEAAQA static void srpt+AF8-handle+AF8-cmd(struct srpt+AF8-rdma+AF8-ch +ACo-ch,
+AD4 +AD4  			pr+AF8-err(+ACI-0x+ACU-llx: parsing SRP descriptor table failed.+AFw-n+ACI,
+AD4 +AD4  			       srp+AF8-cmd-+AD4-tag)+ADs
+AD4 +AD4  		+AH0
+AD4 +AD4 -		goto release+AF8-ioctx+ADs
+AD4 +AD4 +-		goto busy+ADs
+AD4 +AD4  	+AH0
+AD4 +AD4  
+AD4 +AD4  	rc +AD0 target+AF8-submit+AF8-cmd+AF8-map+AF8-sgls(cmd, ch-+AD4-sess, srp+AF8-cmd-+AD4-cdb,
+AD4 +AD4 +AEAAQA -1516,13 +-1516,12 +AEAAQA static void srpt+AF8-handle+AF8-cmd(struct srpt+AF8-rdma+AF8-ch +ACo-ch,
+AD4 +AD4  	if (rc +ACEAPQ 0) +AHs
+AD4 +AD4  		pr+AF8-debug(+ACI-target+AF8-submit+AF8-cmd() returned +ACU-d for tag +ACUAIw-llx+AFw-n+ACI, rc,
+AD4 +AD4  			 srp+AF8-cmd-+AD4-tag)+ADs
+AD4 +AD4 -		goto release+AF8-ioctx+ADs
+AD4 +AD4 +-		goto busy+ADs
+AD4 +AD4  	+AH0
+AD4 +AD4  	return+ADs
+AD4 +AD4  
+AD4 +AD4 -release+AF8-ioctx:
+AD4 +AD4 -	send+AF8-ioctx-+AD4-state +AD0 SRPT+AF8-STATE+AF8-DONE+ADs
+AD4 +AD4 -	srpt+AF8-release+AF8-cmd(cmd)+ADs
+AD4 +AD4 +-busy:
+AD4 +AD4 +-	target+AF8-send+AF8-busy(cmd)+ADs
+AD4 +AD4  +AH0
+AD4 +AD4  
+AD4 +AD4  static int srp+AF8-tmr+AF8-to+AF8-tcm(int fn)
+AD4 +AD4 
+AD4 
+AD4 Can you not do transport+AF8-generic+AF8-request+AF8-failure(cmd, TCM+AF8-LUN+AF8-BUSY),
+AD4 because some of the cmd's bits are not yet set?

Hi Mike,

That's correct. I think it is only safe to call transport+AF8-generic+AF8-request+AF8-failure()
after a command has been submitted to the target core. target+AF8-send+AF8-busy() is called
if submitting a command to the target core failed. Hence the following comment above
target+AF8-send+AF8-busy():

+ACI-Note: Only call this function if target+AF8-submit+AF8-cmd+ACo() failed.+ACI

Bart.

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

end of thread, other threads:[~2019-02-02  0:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-25 18:34 [PATCH 06/16] RDMA/srpt: Fix handling of command / TMF submission failure Bart Van Assche
2019-02-02  0:15 ` Mike Christie
2019-02-02  0:53 ` Bart Van Assche

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.