netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: manish.rangankar@cavium.com
Cc: lduncan@suse.com, cleech@redhat.com, martin.petersen@oracle.com,
	jejb@linux.vnet.ibm.com, linux-scsi@vger.kernel.org,
	netdev@vger.kernel.org, Yuval.Mintz@cavium.com,
	QLogic-Storage-Upstream@cavium.com,
	Nilesh Javali <nilesh.javali@cavium.com>,
	Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>,
	Chad Dupuis <chad.dupuis@cavium.com>,
	Saurav Kashyap <saurav.kashyap@cavium.com>,
	Arun Easi <arun.easi@cavium.com>
Subject: Re: [RFC 5/6] qedi: Add support for iSCSI session management.
Date: Wed, 19 Oct 2016 15:28:01 +0200	[thread overview]
Message-ID: <20161019132801.eptbf2dpuoilplpd@linux-x5ow.site> (raw)
In-Reply-To: <1476853273-22960-6-git-send-email-manish.rangankar@cavium.com>

On Wed, Oct 19, 2016 at 01:01:12AM -0400, manish.rangankar@cavium.com wrote:
> From: Manish Rangankar <manish.rangankar@cavium.com>
> 
> This patch adds support for iscsi_transport LLD Login,
> Logout, NOP-IN/NOP-OUT, Async, Reject PDU processing
> and Firmware async event handling support.
> 
> Signed-off-by: Nilesh Javali <nilesh.javali@cavium.com>
> Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
> Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
> Signed-off-by: Saurav Kashyap <saurav.kashyap@cavium.com>
> Signed-off-by: Arun Easi <arun.easi@cavium.com>
> Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com>
> ---

[...]

> +void qedi_iscsi_unmap_sg_list(struct qedi_cmd *cmd)
> +{
> +	struct scsi_cmnd *sc = cmd->scsi_cmd;
> +
> +	if (cmd->io_tbl.sge_valid && sc) {
> +		scsi_dma_unmap(sc);
> +		cmd->io_tbl.sge_valid = 0;
> +	}
> +}

Maybe set sge_valid to 0 and then call scsi_dma_unmap(). I don't know if it's
really racy but it looks like it is.

[...]

> +static void qedi_process_text_resp(struct qedi_ctx *qedi,
> +				   union iscsi_cqe *cqe,
> +				   struct iscsi_task *task,
> +				   struct qedi_conn *qedi_conn)
> +{
> +	struct iscsi_conn *conn = qedi_conn->cls_conn->dd_data;
> +	struct iscsi_session *session = conn->session;
> +	struct iscsi_task_context *task_ctx;
> +	struct iscsi_text_rsp *resp_hdr_ptr;
> +	struct iscsi_text_response_hdr *cqe_text_response;
> +	struct qedi_cmd *cmd;
> +	int pld_len;
> +	u32 *tmp;
> +
> +	cmd = (struct qedi_cmd *)task->dd_data;
> +	task_ctx = (struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks,
> +								  cmd->task_id);

No need to cast here, qedi_get_task_mem() returns void *.

[...]

> +	cqe_login_response = &cqe->cqe_common.iscsi_hdr.login_response;
> +	task_ctx = (struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks,
> +							  cmd->task_id);

Same here.

[...]

> +	}
> +
> +	pbl = (struct scsi_bd *)qedi->bdq_pbl;
> +	pbl += (qedi->bdq_prod_idx % qedi->rq_num_entries);
> +	pbl->address.hi =
> +		      cpu_to_le32((u32)(((u64)(qedi->bdq[idx].buf_dma)) >> 32));
> +	pbl->address.lo =
> +			cpu_to_le32(((u32)(((u64)(qedi->bdq[idx].buf_dma)) &
> +					    0xffffffff)));

Is this LISP or C?

> +	QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_CONN,
> +		  "pbl [0x%p] pbl->address hi [0x%llx] lo [0x%llx] idx [%d]\n",
> +		  pbl, pbl->address.hi, pbl->address.lo, idx);
> +	pbl->opaque.hi = cpu_to_le32((u32)(((u64)0) >> 32));

Isn't this plain pbl->opaque.hi = 0; ?

> +	pbl->opaque.lo = cpu_to_le32(((u32)(((u64)idx) & 0xffffffff)));
> +

[...]

> +	switch (comp_type) {
> +	case ISCSI_CQE_TYPE_SOLICITED:
> +	case ISCSI_CQE_TYPE_SOLICITED_WITH_SENSE:
> +		fw_task_ctx =
> +		  (struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks,
> +						      cqe->cqe_solicited.itid);

Again, no cast needed.

[...]

> +	writel(*(u32 *)&dbell, qedi_conn->ep->p_doorbell);
> +	/* Make sure fw idx is coherent */
> +	wmb();
> +	mmiowb();

Isn't either wmb() or mmiowb() enough?

[..]

> +
> +	fw_task_ctx =
> +	     (struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks, tid);

Cast again.

[...]

> +	fw_task_ctx =
> +	     (struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks, tid);

^^

[...]

> +	fw_task_ctx =
> +	(struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks, tid);


[...]

> +	fw_task_ctx =
> +	      (struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks, tid);
> +

[...]

> +
> +	qedi = (struct qedi_ctx *)iscsi_host_priv(shost);

Same goes for iscsi_host_priv();

[...]

> +	ret = wait_event_interruptible_timeout(qedi_ep->ofld_wait,
> +					       ((qedi_ep->state ==
> +						EP_STATE_OFLDCONN_FAILED) ||
> +						(qedi_ep->state ==
> +						EP_STATE_OFLDCONN_COMPL)),
> +						msecs_to_jiffies(timeout_ms));

Maybe:
#define QEDI_OLDCON_STATE(q) ((q)->state == EP_STATE_OFLDCONN_FAILED || \
				(q)->state == EP_STATE_OFLDCONN_COMPL)

ret = wait_event_interruptible_timeout(qedi_ep->ofld_wait,
					QEDI_OLDCON_STATE(qedi_ep),
					msec_to_jiffies(timeout_ms));

But that could be just me hating linewraps.

[...]

Thanks,
	Johannes

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

  parent reply	other threads:[~2016-10-19 14:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-19  5:01 [RFC 0/6] Add QLogic FastLinQ iSCSI (qedi) driver manish.rangankar
2016-10-19  5:01 ` [RFC 1/6] qed: Add support for hardware offloaded iSCSI manish.rangankar
2016-10-19  7:31   ` Hannes Reinecke
2016-10-19 22:28     ` Arun Easi
2016-10-19  9:09   ` Johannes Thumshirn
2016-10-20  0:14     ` Arun Easi
2016-10-20  7:09       ` Johannes Thumshirn
2016-10-19  5:01 ` [RFC 2/6] qed: Add iSCSI out of order packet handling manish.rangankar
2016-10-19  7:36   ` Hannes Reinecke
2016-10-20 12:58     ` Mintz, Yuval
2016-10-19  9:39   ` Johannes Thumshirn
2016-10-20  0:43     ` Arun Easi
2016-10-19  5:01 ` [RFC 3/6] qedi: Add QLogic FastLinQ offload iSCSI driver framework manish.rangankar
2016-10-19  7:45   ` Hannes Reinecke
2016-10-20  8:27     ` Rangankar, Manish
2016-10-19 10:02   ` Johannes Thumshirn
2016-10-20  8:41     ` Rangankar, Manish
2016-10-23 14:04     ` Rangankar, Manish
2016-10-19  5:01 ` [RFC 4/6] qedi: Add LL2 iSCSI interface for offload iSCSI manish.rangankar
2016-10-19  7:53   ` Hannes Reinecke
2016-10-19  5:01 ` [RFC 5/6] qedi: Add support for iSCSI session management manish.rangankar
2016-10-19  8:03   ` Hannes Reinecke
2016-10-20  9:09     ` Rangankar, Manish
2016-10-19 13:28   ` Johannes Thumshirn [this message]
2016-10-20  9:12     ` Rangankar, Manish
2016-10-19  5:01 ` [RFC 6/6] qedi: Add support for data path manish.rangankar
2016-10-19 10:24   ` Hannes Reinecke
2016-10-20  9:24     ` Rangankar, Manish

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=20161019132801.eptbf2dpuoilplpd@linux-x5ow.site \
    --to=jthumshirn@suse.de \
    --cc=QLogic-Storage-Upstream@cavium.com \
    --cc=Yuval.Mintz@cavium.com \
    --cc=adheer.chandravanshi@qlogic.com \
    --cc=arun.easi@cavium.com \
    --cc=chad.dupuis@cavium.com \
    --cc=cleech@redhat.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=lduncan@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=manish.rangankar@cavium.com \
    --cc=martin.petersen@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=nilesh.javali@cavium.com \
    --cc=saurav.kashyap@cavium.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).