From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752371AbcJDPWX (ORCPT ); Tue, 4 Oct 2016 11:22:23 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:35598 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751126AbcJDPWW (ORCPT ); Tue, 4 Oct 2016 11:22:22 -0400 Subject: Re: [RFC] IB/srp: export reset-host via sysfs To: Bart Van Assche , "dledford@redhat.com" , "sean.hefty@intel.com" , "hal.rosenstock@gmail.com" References: <1475589609-26451-1-git-send-email-gi-oh.kim@profitbricks.com> Cc: "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" From: Gioh Kim Message-ID: Date: Tue, 4 Oct 2016 17:22:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 >> --- >> 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. >