From: Varun Prakash <varun@chelsio.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>,
target-devel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/6] target/iscsi: Call .iscsit_release_cmd() once
Date: Wed, 10 May 2017 21:33:03 +0530 [thread overview]
Message-ID: <20170510160252.GA1674@chelsio.com> (raw)
In-Reply-To: <1494316166.16894.55.camel@haakon3.risingtidesystems.com>
On Tue, May 09, 2017 at 12:49:26AM -0700, Nicholas A. Bellinger wrote:
> Hi Varun,
>
> On Sun, 2017-05-07 at 18:22 +0530, Varun Prakash wrote:
> > On Mon, May 01, 2017 at 09:33:31PM -0700, Nicholas A. Bellinger wrote:
>
> <SNIP>
>
> Indeed.
>
> Looking at other hw drivers like qla2xxx that have this same
> requirement, they do *_unmap_sg() once a completion interrupt has
> triggered, but before target_core_fabric_ops->release_cmd() is invoked
> and se_cmd->t_task_sg has already been freed.
>
> So I'm open to adding a target_core_fabric_ops->unmap_sg() to do this
> ahead of target_core_transport.c:transport_free_pages().
>
> That said, snother option is to perform *_unmap_sg() internally in
> cxgbit once DDP completion for WRITEs has completed, but before it's
> submitted into iscsi_target -> target_core.
>
> AFAICT from a quick scan of cxgbit code, the two scenarios for this
> would be:
>
> *) For ISCSI_OP_SCSI_CMD with immediate data, once
> cxgbit_get_immediate_data() is invoked. Either for all cases when this
> is invoked (eg: does the DDP SGLs both immediate, unsolicited and
> solicited data when mapped..?), or only when iscsi_cmd->immediate_data =
> 1 && iscsi_cmd_flags & ICF_GOT_LAST_DATAOUT is true.
>
> *) For ISCSI_OP_SCSI_DATA_OUT with FINAL_BIT set, before
> iscsit_check_dataout_payload() is called to invoke target_execute_cmd()
>
> WDYT..?
>
Current cxgbit code does following in cxgbit_release_cmd()
1. put_page() in case of PASSTHROUGH_SG_TO_MEM_NOALLOC.
2. dma_unmap_sg() DDP SGL.
3. free hw DDP resource.
If cxgbit does cleanup internally then lot of error handling code is
required in cxgbit driver, eg: - PDU with F bit set never arrives,
header digest errors etc.
Another approach to add target_core_fabrics_ops->unmap_sg() will not work
for ERL 2 case because for calling ->iscsit_unmap_sg() valid
cmd->conn pointer is required, in case of ERL 2 cmd->conn can be NULL,
but we can use this approach because in current cxgbit code I enable DDP
only for ERL 0 case, similiary I can add code
to enable PASSTHROUGH_SG_TO_MEM_NOALLOC only for ERL 0 case.
next prev parent reply other threads:[~2017-05-10 16:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170330171244.8346-1-bart.vanassche@sandisk.com>
2017-03-30 17:12 ` [PATCH 1/6] target: Fix VERIFY and WRITE VERIFY command parsing Bart Van Assche
2017-04-02 22:43 ` Nicholas A. Bellinger
2017-03-30 17:12 ` [PATCH 2/6] target/iscsi: Call .iscsit_release_cmd() once Bart Van Assche
2017-04-02 22:59 ` Nicholas A. Bellinger
2017-04-04 5:06 ` Varun Prakash
2017-04-13 7:44 ` Varun Prakash
2017-05-02 4:33 ` Nicholas A. Bellinger
2017-05-07 12:52 ` Varun Prakash
2017-05-09 7:49 ` Nicholas A. Bellinger
2017-05-10 16:03 ` Varun Prakash [this message]
2017-11-01 0:07 ` Bart Van Assche
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=20170510160252.GA1674@chelsio.com \
--to=varun@chelsio.com \
--cc=bart.vanassche@sandisk.com \
--cc=nab@linux-iscsi.org \
--cc=stable@vger.kernel.org \
--cc=target-devel@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;
as well as URLs for NNTP newsgroup(s).