linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Grover <agrover@redhat.com>
To: Varun Prakash <varun@chelsio.com>,
	target-devel@vger.kernel.org, linux-scsi@vger.kernel.org
Cc: nab@linux-iscsi.org, swise@opengridcomputing.com,
	kxie@chelsio.com, indranil@chelsio.com
Subject: Re: [PATCH v3 03/13] iscsi-target: add void (*iscsit_get_rx_pdu)()
Date: Mon, 8 Aug 2016 20:19:41 -0700	[thread overview]
Message-ID: <684b7d66-ee8b-a2fd-c949-1e449df1e8a1@redhat.com> (raw)
In-Reply-To: <f993801e40717417bb752ddeb20765b25b092584.1461088672.git.varun@chelsio.com>

Hi Varun,

On 04/19/2016 11:30 AM, Varun Prakash wrote:
> Add void (*iscsit_get_rx_pdu)() to
> struct iscsit_transport, iscsi-target
> uses this callback to receive and
> process Rx iSCSI PDUs.
>
> cxgbit.ko needs this callback to
> reuse iscsi-target Rx thread.
>
> Signed-off-by: Varun Prakash <varun@chelsio.com>
> Acked-by: Sagi Grimberg <sagi@grimberg.me>
> ---
>  drivers/infiniband/ulp/isert/ib_isert.c | 10 ++++++++++
>  drivers/target/iscsi/iscsi_target.c     | 10 ++--------
>  include/target/iscsi/iscsi_transport.h  |  1 +
>  3 files changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
> index 411e446..9118d7c 100644
> --- a/drivers/infiniband/ulp/isert/ib_isert.c
> +++ b/drivers/infiniband/ulp/isert/ib_isert.c
> @@ -3273,6 +3273,15 @@ static void isert_free_conn(struct iscsi_conn *conn)
>  	isert_put_conn(isert_conn);
>  }
>
> +static void isert_get_rx_pdu(struct iscsi_conn *conn)
> +{
> +	struct completion comp;
> +
> +	init_completion(&comp);
> +
> +	wait_for_completion_interruptible(&comp);
> +}
> +

Does this mean that the iser rx thread just does nothing and waits to 
receive a signal to exit?

If we don't set *iscsit_get_rx_pdu for iser, so the thread exits 
immediately from iscsi_target_rx_thread, would that be an ok change?

Thanks -- Regards -- Andy

>  static struct iscsit_transport iser_target_transport = {
>  	.name			= "IB/iSER",
>  	.transport_type		= ISCSI_INFINIBAND,
> @@ -3291,6 +3300,7 @@ static struct iscsit_transport iser_target_transport = {
>  	.iscsit_queue_data_in	= isert_put_datain,
>  	.iscsit_queue_status	= isert_put_response,
>  	.iscsit_aborted_task	= isert_aborted_task,
> +	.iscsit_get_rx_pdu	= isert_get_rx_pdu,
>  	.iscsit_get_sup_prot_ops = isert_get_sup_prot_ops,
>  };
>
> diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
> index 0724c83..9fa9f0b 100644
> --- a/drivers/target/iscsi/iscsi_target.c
> +++ b/drivers/target/iscsi/iscsi_target.c
> @@ -3951,14 +3951,8 @@ int iscsi_target_rx_thread(void *arg)
>  	if (rc < 0 || iscsi_target_check_conn_state(conn))
>  		return 0;
>
> -	if (conn->conn_transport->transport_type == ISCSI_INFINIBAND) {
> -		struct completion comp;
> -
> -		init_completion(&comp);
> -		rc = wait_for_completion_interruptible(&comp);
> -		if (rc < 0)
> -			goto transport_err;
> -
> +	if (conn->conn_transport->iscsit_get_rx_pdu) {
> +		conn->conn_transport->iscsit_get_rx_pdu(conn);
>  		goto transport_err;
>  	}
>
> diff --git a/include/target/iscsi/iscsi_transport.h b/include/target/iscsi/iscsi_transport.h
> index 3b0053e..ccc68a0 100644
> --- a/include/target/iscsi/iscsi_transport.h
> +++ b/include/target/iscsi/iscsi_transport.h
> @@ -25,6 +25,7 @@ struct iscsit_transport {
>  	int (*iscsit_xmit_pdu)(struct iscsi_conn *, struct iscsi_cmd *,
>  			       struct iscsi_datain_req *, const void *, u32);
>  	void (*iscsit_release_cmd)(struct iscsi_conn *, struct iscsi_cmd *);
> +	void (*iscsit_get_rx_pdu)(struct iscsi_conn *);
>  	enum target_prot_op (*iscsit_get_sup_prot_ops)(struct iscsi_conn *);
>  };
>
>

  reply	other threads:[~2016-08-09  3:19 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 18:30 [PATCH v3 00/13] Chelsio iSCSI target offload driver Varun Prakash
2016-04-19 18:30 ` [PATCH v3 01/13] iscsi-target: add int (*iscsit_xmit_pdu)() Varun Prakash
2016-04-19 18:30 ` [PATCH v3 02/13] iscsi-target: add void (*iscsit_release_cmd)() Varun Prakash
2016-04-19 18:30 ` [PATCH v3 03/13] iscsi-target: add void (*iscsit_get_rx_pdu)() Varun Prakash
2016-08-09  3:19   ` Andy Grover [this message]
2016-08-13 16:56     ` Varun Prakash
2016-04-19 18:30 ` [PATCH v3 04/13] iscsi-target: split iscsi_target_rx_thread() Varun Prakash
2016-04-19 18:30 ` [PATCH v3 05/13] iscsi-target: add int (*iscsit_validate_params)() Varun Prakash
2016-04-19 18:30 ` [PATCH v3 06/13] iscsi-target: add void (*iscsit_get_r2t_ttt)() Varun Prakash
2016-04-19 18:30 ` [PATCH v3 07/13] iscsi-target: move iscsit_thread_check_cpumask() Varun Prakash
2016-04-19 18:30 ` [PATCH v3 08/13] iscsi-target: use conn_transport->transport_type in text rsp Varun Prakash
2016-04-19 18:30 ` [PATCH v3 09/13] iscsi-target: add new offload transport type Varun Prakash
2016-04-19 18:30 ` [PATCH v3 10/13] iscsi-target: clear tx_thread_active Varun Prakash
2016-04-19 18:30 ` [PATCH v3 11/13] iscsi-target: call complete on conn_logout_comp Varun Prakash
2016-04-19 18:30 ` [PATCH v3 12/13] iscsi-target: export symbols Varun Prakash
2016-04-19 18:30 ` [PATCH v3 13/13] cxgbit: add files for cxgbit.ko Varun Prakash
2016-04-30 15:54   ` Or Gerlitz
2016-05-18 11:45     ` Or Gerlitz
2016-05-24  6:40       ` Nicholas A. Bellinger
2016-05-25 15:04         ` Or Gerlitz
2016-05-25 17:40           ` Steve Wise
2016-05-25 20:41             ` Or Gerlitz
2016-05-26  4:55               ` Nicholas A. Bellinger
2016-05-26 18:58                 ` Varun Prakash
2016-07-05 21:24                   ` Or Gerlitz
2016-07-06 17:17                     ` Varun Prakash
2016-07-07  7:54                       ` Or Gerlitz
2016-07-08 18:03                         ` Varun Prakash
2016-07-08 18:36                           ` Steve Wise
2016-07-12  7:53                             ` Or Gerlitz

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=684b7d66-ee8b-a2fd-c949-1e449df1e8a1@redhat.com \
    --to=agrover@redhat.com \
    --cc=indranil@chelsio.com \
    --cc=kxie@chelsio.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=swise@opengridcomputing.com \
    --cc=target-devel@vger.kernel.org \
    --cc=varun@chelsio.com \
    /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).