public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Smart <James.Smart@Emulex.Com>
To: Christof Schmitt <christof.schmitt@de.ibm.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	Sven Schuetz <sven@linux.vnet.ibm.com>
Subject: Re: [patch 2/2] zfcp: Add FC pass-through support
Date: Tue, 7 Apr 2009 19:17:58 -0400	[thread overview]
Message-ID: <49DBDF26.6090601@emulex.com> (raw)
In-Reply-To: <20090406163534.659628000@de.ibm.com>



Christof Schmitt wrote:
--- a/drivers/s390/scsi/zfcp_fc.c       2009-04-06 17:23:25.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_fc.c       2009-04-06 17:24:30.000000000 +0200
...
> +static void zfcp_fc_generic_els_handler(unsigned long data)
> +{
> +       struct zfcp_els_fc_job *els_fc_job = (struct zfcp_els_fc_job *) data;
> +       struct fc_bsg_job *job = els_fc_job->job;
> +       struct fc_bsg_reply *reply = job->reply;
> +
> +       if (els_fc_job->els.status) {
> +               /* request rejected or timed out */
> +               reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_REJECT;
> +               goto out;
> +       }
> +
> +       reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK;
> +       reply->reply_payload_rcv_len = blk_rq_bytes(job->req->next_rq);

My intent was to not have the LLDD reference (or even know about) the
request structures and that bsg exists underneath.

Thus, for the last line above, it should be:
           reply->reply_payload_rcv_len = job->reply_payload->data_len;

Although, I'm a little surprised that your els interface doesn't supply the
received data length to you, rather than the global assumption that you sized 
the reply buffer for exactly what you always get.


> +struct zfcp_ct_fc_job {
> +       struct zfcp_send_ct ct;
> +       struct fc_bsg_job *job;
> +};
> +
> +static void zfcp_fc_generic_ct_handler(unsigned long data)
> +{
> +       struct zfcp_ct_fc_job *ct_fc_job = (struct zfcp_ct_fc_job *) data;
> +       struct fc_bsg_job *job = ct_fc_job->job;
> +
> +       job->reply->reply_data.ctels_reply.status = ct_fc_job->ct.status ?
> +                               FC_CTELS_STATUS_REJECT : FC_CTELS_STATUS_OK;
> +       job->state_flags = FC_RQST_STATE_DONE;
> +       job->reply->reply_payload_rcv_len = blk_rq_bytes(job->req->next_rq);

same comment as above.

> +       job->job_done(job);
> +
> +       zfcp_wka_port_put(ct_fc_job->ct.wka_port);
> +
> +       kfree(ct_fc_job);
> +}

Are you going to add support for the ELS/CT request timing out (e.g. for
bsg_timeout callback) ?

Everything else looks good, and looks like it wasn't much effort to support.
Great.

-- james s


  reply	other threads:[~2009-04-07 23:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-06 16:31 [patch 0/2] FC pass-through support for zfcp Christof Schmitt
2009-04-06 16:31 ` [patch 1/2] zfcp: Set WKA-port to offline on adapter deactivation Christof Schmitt
2009-04-06 16:31 ` [patch 2/2] zfcp: Add FC pass-through support Christof Schmitt
2009-04-07 23:17   ` James Smart [this message]
2009-04-08  7:39     ` Christof Schmitt
2009-04-08 11:29   ` Heiko Carstens
2009-04-08 11:38     ` Christof Schmitt

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=49DBDF26.6090601@emulex.com \
    --to=james.smart@emulex.com \
    --cc=christof.schmitt@de.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sven@linux.vnet.ibm.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