From: David Dillow <dillowda-1Heg1YXhbW8@public.gmane.org>
To: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org,
fujita.tomonori-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org,
brking-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
Subject: Re: [PATCH 13/18] ib_srp: Allow SRP disconnect through sysfs
Date: Sun, 26 Feb 2012 01:33:39 -0500 [thread overview]
Message-ID: <1330238021.1026.88.camel@obelisk.thedillows.org> (raw)
In-Reply-To: <2116892.gZCKSBP7SJ@asus>
On Sat, 2012-01-14 at 12:52 +0000, Bart Van Assche wrote:
> Make it possible to disconnect the IB RC connection used by the
> SRP protocol to communicate with a target.
>
> Let the SRP transport layer create a sysfs "delete" attribute for
> initiator drivers that support this functionality.
>
> + rport->ft = &ib_srp_transport_functions;
The initiator should not be mucking around with internal functions of
the transport. Even if this is going to live in srp_rport rather than
srp_internal like other transports, this assignment should be done in
srp_rport_add().
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
> index 3882adf..22e0c5d 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.h
> +++ b/drivers/infiniband/ulp/srp/ib_srp.h
> @@ -154,6 +154,7 @@ struct srp_target_port {
> u16 io_class;
> struct srp_host *srp_host;
> struct Scsi_Host *scsi_host;
> + struct srp_rport *rport;
Why do we need to save this in our target? You don't use it anywhere in
this patch.
> --- a/drivers/scsi/scsi_transport_srp.c
> +++ b/drivers/scsi/scsi_transport_srp.c
> @@ -116,6 +116,22 @@ show_srp_rport_roles(struct device *dev, struct device_attribute *attr,
>
> static DEVICE_ATTR(roles, S_IRUGO, show_srp_rport_roles, NULL);
>
> +static ssize_t store_srp_rport_delete(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + struct srp_rport *rport = transport_class_to_srp_rport(dev);
This should translate to the srp_internal and then use the function
template there instead of adding them to srp_rport.
struct Scsi_Host *shost = rport_to_shost(rport);
struct srp_internal *i = to_srp_internal(shost->transportt);
if (!i->f->rport_delete)
return -ENOSYS;
i->f->rport_delete(rport);
return count;
> diff --git a/include/scsi/scsi_transport_srp.h b/include/scsi/scsi_transport_srp.h
> index 9c60ca1..1a109ff 100644
> --- a/include/scsi/scsi_transport_srp.h
> +++ b/include/scsi/scsi_transport_srp.h
> @@ -14,13 +14,23 @@ struct srp_rport_identifiers {
> };
>
> struct srp_rport {
> + /* for initiator and target drivers */
> +
> + struct srp_function_template *ft;
This isn't needed; while perhaps more efficient, it breaks from the
practice used by other SCSI transports.
> struct device dev;
>
> u8 port_id[16];
> u8 roles;
> +
> + /* for initiator drivers */
> +
> + void *lld_data; /* LLD private data */
Other transports add a private data size to the transport's function
templates, and allocate space at the end of the rport. See
fc_function_template:dd_fcrport_size and fc_rport:dd_data.
Using this model will let use store our pointer there for now, and may
let us merge the rport allocation of the initiator with the transport's
allocation in the future.
Or it may just be complexity for no real gain; I can certainly see that
argument against it.
--
Dave Dillow
National Center for Computational Science
Oak Ridge National Laboratory
(865) 241-6602 office
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-02-26 6:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-14 12:36 [PATCH 00/18, v2] Make ib_srp better suited for H.A. purposes Bart Van Assche
2012-01-14 12:47 ` [PATCH 09/18] srp_transport: Fix atttribute registration Bart Van Assche
2012-01-14 12:48 ` [PATCH 10/18] srp_transport: Simplify attribute initialization code Bart Van Assche
2012-01-14 12:50 ` [PATCH 11/18] srp_transport: Document sysfs attributes Bart Van Assche
2012-01-14 12:52 ` [PATCH 13/18] ib_srp: Allow SRP disconnect through sysfs Bart Van Assche
2012-02-26 6:33 ` David Dillow [this message]
2012-01-14 12:55 ` [PATCH 16/18] scsi: Add scsi_host_template.slave_delete callback Bart Van Assche
2012-01-14 12:56 ` [PATCH 17/18] srp_transport: Add transport layer recovery support Bart Van Assche
2012-07-16 22:07 ` Mike Christie
2012-07-16 22:28 ` David Dillow
2012-07-16 22:38 ` Mike Christie
2012-07-16 22:44 ` David Dillow
2012-07-17 12:59 ` bart
2012-08-18 10:50 ` Bart Van Assche
2012-08-19 23:09 ` David Dillow
2012-07-16 22:29 ` Mike Christie
2012-01-14 22:10 ` [PATCH 00/18, v2] Make ib_srp better suited for H.A. purposes David Dillow
[not found] ` <1326579013.8227.4.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2012-01-15 9:28 ` Bart Van Assche
[not found] ` <CAO+b5-qv0LRFZ3QkyS+bFXF7Sx7WPeqgSX3q5Ph-jCFKNU0uCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-05 6:13 ` David Dillow
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=1330238021.1026.88.camel@obelisk.thedillows.org \
--to=dillowda-1heg1yxhbw8@public.gmane.org \
--cc=brking-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
--cc=bvanassche-HInyCGIudOg@public.gmane.org \
--cc=fujita.tomonori-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=roland-BHEL68pLQRGGvPXPguhicg@public.gmane.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).