* [RFC] IB/srp: export reset-host via sysfs
@ 2016-10-04 14:00 Gioh Kim
[not found] ` <1475589609-26451-1-git-send-email-gi-oh.kim-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Gioh Kim @ 2016-10-04 14:00 UTC (permalink / raw)
To: bart.vanassche, dledford, sean.hefty, hal.rosenstock
Cc: linux-rdma, linux-kernel, Gioh Kim
Standard SCSI device has host_reset sysfs interface.
This patch exports the host_reset interface for upper layer.
Signed-off-by: Gioh Kim <gi-oh.kim@profitbricks.com>
---
drivers/infiniband/ulp/srp/ib_srp.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 3322ed7..92e6c3f 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -2628,6 +2628,15 @@ static int srp_reset_device(struct scsi_cmnd *scmnd)
return SUCCESS;
}
+static int srp_scsi_host_reset(struct Scsi_Host *shost, int reset_type)
+{
+ struct srp_target_port *target = host_to_target(shost);
+
+ shost_printk(KERN_EMERG, target->scsi_host, PFX "SRP reset_host called\n");
+
+ return srp_reconnect_rport(target->rport);
+}
+
static int srp_reset_host(struct scsi_cmnd *scmnd)
{
struct srp_target_port *target = host_to_target(scmnd->device->host);
@@ -2858,6 +2867,7 @@ static struct scsi_host_template srp_template = {
.use_clustering = ENABLE_CLUSTERING,
.shost_attrs = srp_host_attrs,
.track_queue_depth = 1,
+ .host_reset = srp_scsi_host_reset,
};
static int srp_sdev_count(struct Scsi_Host *host)
--
2.5.0
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <1475589609-26451-1-git-send-email-gi-oh.kim-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>]
* Re: [RFC] IB/srp: export reset-host via sysfs [not found] ` <1475589609-26451-1-git-send-email-gi-oh.kim-EIkl63zCoXaH+58JC4qpiA@public.gmane.org> @ 2016-10-04 14:24 ` Bart Van Assche [not found] ` <af0d75ef-734d-2cdf-05d8-bf4cd9c59ef9-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Bart Van Assche @ 2016-10-04 14:24 UTC (permalink / raw) To: Gioh Kim, dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 10/04/16 07:00, Gioh Kim wrote: > Standard SCSI device has host_reset sysfs interface. > This patch exports the host_reset interface for upper layer. > > Signed-off-by: Gioh Kim <gi-oh.kim-EIkl63zCoXaH+58JC4qpiA@public.gmane.org> > --- > drivers/infiniband/ulp/srp/ib_srp.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c > index 3322ed7..92e6c3f 100644 > --- a/drivers/infiniband/ulp/srp/ib_srp.c > +++ b/drivers/infiniband/ulp/srp/ib_srp.c > @@ -2628,6 +2628,15 @@ static int srp_reset_device(struct scsi_cmnd *scmnd) > return SUCCESS; > } > > +static int srp_scsi_host_reset(struct Scsi_Host *shost, int reset_type) > +{ > + struct srp_target_port *target = host_to_target(shost); > + > + shost_printk(KERN_EMERG, target->scsi_host, PFX "SRP reset_host called\n"); > + > + return srp_reconnect_rport(target->rport); > +} > + > static int srp_reset_host(struct scsi_cmnd *scmnd) > { > struct srp_target_port *target = host_to_target(scmnd->device->host); > @@ -2858,6 +2867,7 @@ static struct scsi_host_template srp_template = { > .use_clustering = ENABLE_CLUSTERING, > .shost_attrs = srp_host_attrs, > .track_queue_depth = 1, > + .host_reset = srp_scsi_host_reset, > }; Hello Gioh, A patch description should not only explain what is changed but also why a change is considered useful. Why do you think it would be useful to allow users to trigger a call of srp_reconnect_rport() through sysfs instead of using the functionality that is already available through sysfs, namely removing a SCSI host and reconnecting? Bart. -- 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <af0d75ef-734d-2cdf-05d8-bf4cd9c59ef9-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>]
* Re: [RFC] IB/srp: export reset-host via sysfs [not found] ` <af0d75ef-734d-2cdf-05d8-bf4cd9c59ef9-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org> @ 2016-10-04 15:22 ` Gioh Kim 0 siblings, 0 replies; 3+ messages in thread From: Gioh Kim @ 2016-10-04 15:22 UTC (permalink / raw) To: Bart Van Assche, dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 04.10.2016 16:24, Bart Van Assche wrote: > On 10/04/16 07:00, Gioh Kim wrote: >> Standard SCSI device has host_reset sysfs interface. >> This patch exports the host_reset interface for upper layer. >> >> Signed-off-by: Gioh Kim <gi-oh.kim-EIkl63zCoXaH+58JC4qpiA@public.gmane.org> >> --- >> drivers/infiniband/ulp/srp/ib_srp.c | 10 ++++++++++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c >> b/drivers/infiniband/ulp/srp/ib_srp.c >> index 3322ed7..92e6c3f 100644 >> --- a/drivers/infiniband/ulp/srp/ib_srp.c >> +++ b/drivers/infiniband/ulp/srp/ib_srp.c >> @@ -2628,6 +2628,15 @@ static int srp_reset_device(struct scsi_cmnd >> *scmnd) >> return SUCCESS; >> } >> >> +static int srp_scsi_host_reset(struct Scsi_Host *shost, int reset_type) >> +{ >> + struct srp_target_port *target = host_to_target(shost); >> + >> + shost_printk(KERN_EMERG, target->scsi_host, PFX "SRP reset_host >> called\n"); >> + >> + return srp_reconnect_rport(target->rport); >> +} >> + >> static int srp_reset_host(struct scsi_cmnd *scmnd) >> { >> struct srp_target_port *target = >> host_to_target(scmnd->device->host); >> @@ -2858,6 +2867,7 @@ static struct scsi_host_template srp_template = { >> .use_clustering = ENABLE_CLUSTERING, >> .shost_attrs = srp_host_attrs, >> .track_queue_depth = 1, >> + .host_reset = srp_scsi_host_reset, >> }; > > Hello Gioh, > > A patch description should not only explain what is changed but also > why a change is considered useful. Why do you think it would be useful > to allow users to trigger a call of srp_reconnect_rport() through > sysfs instead of using the functionality that is already available > through sysfs, namely removing a SCSI host and reconnecting? Hello Bart, It's my mistake to miss 0000-cover-letter.patch file including description. I'm testing SCSI devices which are exported by the remote servers via IB network. I know that SCSI error handling mechanism calls reset-host when something wrong happens. But the SCSI error handling tries sending ABORT commands and other actions before resetting host. I found that those ABORT commands could generate more stress on the remove server. So I need to reset SCSI host (which mean reconnecting) when the remote server starts to become slow or have some problem to handle IO. And I think I can use some utilities for SCSI device, such like sg3 utils, to handle srp connection. Thank you for your reply. Best regards, Gioh Kim > > Bart. > -- 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-04 15:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-04 14:00 [RFC] IB/srp: export reset-host via sysfs Gioh Kim
[not found] ` <1475589609-26451-1-git-send-email-gi-oh.kim-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2016-10-04 14:24 ` Bart Van Assche
[not found] ` <af0d75ef-734d-2cdf-05d8-bf4cd9c59ef9-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-10-04 15:22 ` Gioh Kim
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox