[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-scsi
Subject: Re: [PATCH 23/25] lpfc: Correct upcalling nvmet_fc transport during io done downcall
From: Hannes Reinecke <hare () suse ! de>
Date: 2018-12-28 12:35:15
Message-ID: 3cc86ef8-9b42-ab72-4953-51b7db83dbe7 () suse ! de
[Download RAW message or body]
On 12/27/18 12:33 AM, James Smart wrote:
> When the transport calls into the lpfc target to release an io job
> structure, which corresponds to an exchange, and if the driver was
> waiting for an exchange in order to post a previously received command
> to the transport, the driver immediately takes the io job and reuses
> the context for the prior command and calls nvmet_fc_rcv_fcp_req()
> to tell the transport about a newly received command.
>
> Problem is, the execution of the io job release may be in the context
> of the back end driver and its bio completion handlers, thus it may be
> in a irq context and protection code kicks in in the bio and request
> layers that are subsequently called.
>
> Rework lpfc so that instead of immediately upcalling, queue it to a
> deferred work thread and have the thread make the upcall.
>
> Took advantage of this change to remove duplicated code with the normal
> command receive path that preps the io job and upcalls nvmet_fc. Created
> a common routine both paths use.
>
> Also corrected some errors that were found during review of the context
> freeing and reuse - basically unlocked operations and a somewhat disjoint
> set of calls to release associated job elements. Cleaned up this path and
> added locks for coherency.
>
> Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> ---
> drivers/scsi/lpfc/lpfc.h | 1 +
> drivers/scsi/lpfc/lpfc_nvmet.c | 247 ++++++++++++++++++++++-------------------
> drivers/scsi/lpfc/lpfc_nvmet.h | 1 +
> 3 files changed, 137 insertions(+), 112 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cheers,
Hannes
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic