All of lore.kernel.org
 help / color / mirror / Atom feed
From: Varun Prakash <varun@chelsio.com>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org,
	nab@linux-iscsi.org, swise@opengridcomputing.com,
	kxie@chelsio.com, indranil@chelsio.com
Subject: Re: [PATCH v2 03/16] iscsi-target: add int (*iscsit_xmit_datain_pdu)()
Date: Mon, 11 Apr 2016 21:42:39 +0530	[thread overview]
Message-ID: <20160411161236.GA2180@chelsio.com> (raw)
In-Reply-To: <570A8F7B.30701@grimberg.me>

On Sun, Apr 10, 2016 at 08:38:03PM +0300, Sagi Grimberg wrote:
> 
> 
> On 09/04/16 16:11, Varun Prakash wrote:
> >Add int (*iscsit_xmit_datain_pdu)() to
> >struct iscsit_transport, iscsi-target
> >uses this callback to transmit a DATAIN
> >iSCSI PDU.
> >
> >Signed-off-by: Varun Prakash <varun@chelsio.com>
> >---
> >  drivers/target/iscsi/iscsi_target.c    | 143 +++++++++++++++++++--------------
> >  include/target/iscsi/iscsi_transport.h |   3 +
> >  2 files changed, 86 insertions(+), 60 deletions(-)
> >
> >diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
> >index 0e7a481..9e65e5d 100644
> >--- a/drivers/target/iscsi/iscsi_target.c
> >+++ b/drivers/target/iscsi/iscsi_target.c
> >@@ -577,6 +577,84 @@ static int iscsit_xmit_pdu(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
> >  	return 0;
> >  }
> >
> >+static int iscsit_map_iovec(struct iscsi_cmd *, struct kvec *, u32, u32);
> >+static void iscsit_unmap_iovec(struct iscsi_cmd *);
> >+static u32 iscsit_do_crypto_hash_sg(struct ahash_request *, struct iscsi_cmd *,
> >+				    u32, u32, u32, u8 *);
> >+static int
> >+iscsit_xmit_datain_pdu(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
> >+		       struct iscsi_datain_req *dr, struct iscsi_datain *datain)
> 
> Looks very similar to xmit_pdu(), if we add a datain pointer that
> can be null for normal pdus would that reduce code duplication?

Yes, we can have a common xmit function for all pdus -

int iscsit_xmit_pdu(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
		    struct iscsi_datain_req *dr, const void *buf, u32 buf_len);

dr will be NULL for non datain pdus and buf will point to data buffer.
For datain pdus buf will point to datain(struct iscsi_datain) buffer, buf_len will be zero.

I will add this in -v3, thanks.

  reply	other threads:[~2016-04-11 16:12 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-09 13:11 [PATCH v2 00/16] Chelsio iSCSI target offload driver Varun Prakash
2016-04-09 13:11 ` [PATCH v2 01/16] iscsi-target: add callback to alloc and free PDU Varun Prakash
2016-04-10 17:33   ` Sagi Grimberg
2016-04-11 14:54     ` Varun Prakash
2016-04-13  9:56       ` Sagi Grimberg
2016-04-13 16:21         ` Varun Prakash
2016-04-09 13:11 ` [PATCH v2 02/16] iscsi-target: add int (*iscsit_xmit_pdu)() Varun Prakash
2016-04-10 17:36   ` Sagi Grimberg
2016-04-09 13:11 ` [PATCH v2 03/16] iscsi-target: add int (*iscsit_xmit_datain_pdu)() Varun Prakash
2016-04-10 17:38   ` Sagi Grimberg
2016-04-11 16:12     ` Varun Prakash [this message]
2016-04-09 13:11 ` [PATCH v2 04/16] iscsi-target: add void (*iscsit_release_cmd)() Varun Prakash
2016-04-10 17:42   ` Sagi Grimberg
2016-04-11 17:16     ` Varun Prakash
2016-04-09 13:11 ` [PATCH v2 05/16] iscsi-target: add void (*iscsit_get_rx_pdu)() Varun Prakash
2016-04-10 17:43   ` Sagi Grimberg
2016-04-09 13:11 ` [PATCH v2 06/16] iscsi-target: split iscsi_target_rx_thread() Varun Prakash
2016-04-09 13:11 ` [PATCH v2 07/16] iscsi-target: add int (*iscsit_validate_params)() Varun Prakash
2016-04-10 17:50   ` Sagi Grimberg
2016-04-11 17:44     ` Varun Prakash
2016-04-09 13:11 ` [PATCH v2 08/16] iscsi-target: add void (*iscsit_get_r2t_ttt)() Varun Prakash
2016-04-10 17:51   ` Sagi Grimberg
2016-04-11 18:08     ` Varun Prakash
2016-04-13  9:52       ` Sagi Grimberg
2016-04-13 13:03         ` Varun Prakash
2016-04-09 13:11 ` [PATCH v2 09/16] iscsi-target: move iscsit_thread_check_cpumask() Varun Prakash
2016-04-09 13:11 ` [PATCH v2 10/16] iscsi-target: use conn->network_transport in text rsp Varun Prakash
2016-04-10 17:55   ` Sagi Grimberg
2016-04-09 13:11 ` [PATCH v2 11/16] iscsi-target: add new offload transport type Varun Prakash
2016-04-10 17:56   ` Sagi Grimberg
2016-04-09 13:11 ` [PATCH v2 12/16] iscsi-target: clear tx_thread_active Varun Prakash
2016-04-09 13:11 ` [PATCH v2 13/16] iscsi-target: call complete on conn_logout_comp Varun Prakash
2016-04-09 13:11 ` [PATCH v2 14/16] iscsi-target: export symbols Varun Prakash
2016-04-09 13:11 ` [PATCH v2 15/16] iscsi-target: fix seq_end_offset calculation Varun Prakash
2016-04-10 17:59   ` Sagi Grimberg
2016-04-09 13:11 ` [PATCH v2 16/16] cxgbit: add files for cxgbit.ko Varun Prakash

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=20160411161236.GA2180@chelsio.com \
    --to=varun@chelsio.com \
    --cc=indranil@chelsio.com \
    --cc=kxie@chelsio.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=sagi@grimberg.me \
    --cc=swise@opengridcomputing.com \
    --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 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.