linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] scsi: Create a lightweight FC Transport option for Virtual FC Hosts.
@ 2017-01-18 20:28 Cathy Avery
  2017-01-18 20:28 ` [PATCH 1/2] scsi: scsi_transport_fc: Provide a lightweight " Cathy Avery
  2017-01-18 20:28 ` [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host Cathy Avery
  0 siblings, 2 replies; 13+ messages in thread
From: Cathy Avery @ 2017-01-18 20:28 UTC (permalink / raw)
  To: kys, haiyangz, jejb, martin.petersen; +Cc: devel, linux-kernel, linux-scsi

Currently virtual FC hosts or lightweight hosts are not able to be
manually scanned  via sysfs due to the fact that they do not
contain the complete characteristic set associated with a normal FC host
( missing rports, vports, etc ) and are not consistent with the current FC
transport model.

Patch 1: The patch provides a lightweight option to the current FC 
transport class. The new option is selected by a driver when it 
indicates it wants the lightweight transport in fc_function_template.

Patch 2: storvsc elects using the new lightweight FC host option.

Cathy Avery (2):
  scsi: scsi_transport_fc: Provide a lightweight option for Virtual FC
    Hosts.
  scsi: storvsc: Add support for FC lightweight host.

 drivers/scsi/scsi_transport_fc.c | 125 +++++++++++++++++++++++++++++++++++++--
 drivers/scsi/storvsc_drv.c       |   6 +-
 include/scsi/scsi_transport_fc.h |   1 +
 3 files changed, 123 insertions(+), 9 deletions(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/2] scsi: scsi_transport_fc: Provide a lightweight option for Virtual FC Hosts.
  2017-01-18 20:28 [PATCH 0/2] scsi: Create a lightweight FC Transport option for Virtual FC Hosts Cathy Avery
@ 2017-01-18 20:28 ` Cathy Avery
  2017-01-19 15:11   ` Christoph Hellwig
  2017-01-18 20:28 ` [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host Cathy Avery
  1 sibling, 1 reply; 13+ messages in thread
From: Cathy Avery @ 2017-01-18 20:28 UTC (permalink / raw)
  To: kys, haiyangz, jejb, martin.petersen; +Cc: devel, linux-kernel, linux-scsi

The patch provides a means to offer a lightweight option to the
current FC transport class. The new option is selected by a
driver when it indicates it wants the lightweight
transport via fc_function_template.

Signed-off-by: Cathy Avery <cavery@redhat.com>
---
 drivers/scsi/scsi_transport_fc.c | 125 +++++++++++++++++++++++++++++++++++++--
 include/scsi/scsi_transport_fc.h |   1 +
 2 files changed, 122 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 03577bd..4adc669 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -50,6 +50,15 @@ static int fc_bsg_hostadd(struct Scsi_Host *, struct fc_host_attrs *);
 static int fc_bsg_rportadd(struct Scsi_Host *, struct fc_rport *);
 static void fc_bsg_remove(struct request_queue *);
 static void fc_bsg_goose_queue(struct fc_rport *);
+static int fc_host_lw_setup(struct Scsi_Host *, struct fc_host_attrs *);
+static int fc_host_hw_setup(struct Scsi_Host *, struct fc_host_attrs *);
+static int fc_host_hw_remove(struct fc_host_attrs *);
+static struct scsi_transport_template *
+	fc_attach_lw_transport(struct fc_function_template *);
+static struct scsi_transport_template *
+	fc_attach_hw_transport(struct fc_function_template *);
+static void fc_remove_lw_host(struct Scsi_Host *);
+static void fc_remove_hw_host(struct Scsi_Host *, struct fc_host_attrs *);
 
 /*
  * Module Parameters
@@ -352,6 +361,10 @@ struct fc_internal {
 
 #define to_fc_internal(tmpl)	container_of(tmpl, struct fc_internal, t)
 
+
+static void fc_release_lw_transport(struct fc_internal *);
+static void fc_release_hw_transport(struct fc_internal *);
+
 static int fc_target_setup(struct transport_container *tc, struct device *dev,
 			   struct device *cdev)
 {
@@ -387,7 +400,26 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev,
 {
 	struct Scsi_Host *shost = dev_to_shost(dev);
 	struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
+	struct fc_internal *i = to_fc_internal(shost->transportt);
+
+	if (i->f->lightweight_transport)
+		return fc_host_lw_setup(shost, fc_host);
+
+	return fc_host_hw_setup(shost, fc_host);
+}
+
+static int fc_host_lw_setup(struct Scsi_Host *shost,
+			    struct fc_host_attrs *fc_host)
+{
+	fc_host->node_name = -1;
+	fc_host->port_name = -1;
+
+	return 0;
+}
 
+static int fc_host_hw_setup(struct Scsi_Host *shost,
+			    struct fc_host_attrs *fc_host)
+{
 	/*
 	 * Set default values easily detected by the midlayer as
 	 * failure cases.  The scsi lldd is responsible for initializing
@@ -468,7 +500,16 @@ static int fc_host_remove(struct transport_container *tc, struct device *dev,
 {
 	struct Scsi_Host *shost = dev_to_shost(dev);
 	struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
+	struct fc_internal *i = to_fc_internal(shost->transportt);
+
+	if (i->f->lightweight_transport)
+		return 0;
 
+	return fc_host_hw_remove(fc_host);
+}
+
+static int fc_host_hw_remove(struct fc_host_attrs *fc_host)
+{
 	fc_bsg_remove(fc_host->rqst_q);
 	return 0;
 }
@@ -2175,6 +2216,49 @@ static int fc_it_nexus_response(struct Scsi_Host *shost, u64 nexus, int result)
 struct scsi_transport_template *
 fc_attach_transport(struct fc_function_template *ft)
 {
+	if (ft->lightweight_transport)
+		return fc_attach_lw_transport(ft);
+
+	return fc_attach_hw_transport(ft);
+}
+EXPORT_SYMBOL(fc_attach_transport);
+
+
+struct scsi_transport_template *
+fc_attach_lw_transport(struct fc_function_template *ft)
+{
+	int count;
+	struct fc_internal *i;
+
+	i = kzalloc(sizeof(struct fc_internal),
+			GFP_KERNEL);
+
+	if (unlikely(!i))
+		return NULL;
+
+	i->t.host_attrs.ac.attrs = &i->host_attrs[0];
+	i->t.host_attrs.ac.class = &fc_host_class.class;
+	i->t.host_attrs.ac.match = fc_host_match;
+	i->t.host_size = sizeof(struct fc_host_attrs);
+	transport_container_register(&i->t.host_attrs);
+
+	i->f = ft;
+
+	count = 0;
+	SETUP_HOST_ATTRIBUTE_RD(node_name);
+	SETUP_HOST_ATTRIBUTE_RD(port_name);
+
+	BUG_ON(count > FC_HOST_NUM_ATTRS);
+
+	i->host_attrs[count] = NULL;
+
+	return &i->t;
+}
+
+
+struct scsi_transport_template *
+fc_attach_hw_transport(struct fc_function_template *ft)
+{
 	int count;
 	struct fc_internal *i = kzalloc(sizeof(struct fc_internal),
 					GFP_KERNEL);
@@ -2318,12 +2402,27 @@ fc_attach_transport(struct fc_function_template *ft)
 
 	return &i->t;
 }
-EXPORT_SYMBOL(fc_attach_transport);
 
 void fc_release_transport(struct scsi_transport_template *t)
 {
 	struct fc_internal *i = to_fc_internal(t);
 
+	if (i->f->lightweight_transport)
+		fc_release_lw_transport(i);
+	else
+		fc_release_hw_transport(i);
+}
+EXPORT_SYMBOL(fc_release_transport);
+
+void fc_release_lw_transport(struct fc_internal *i)
+{
+	transport_container_unregister(&i->t.host_attrs);
+
+	kfree(i);
+}
+
+void fc_release_hw_transport(struct fc_internal *i)
+{
 	transport_container_unregister(&i->t.target_attrs);
 	transport_container_unregister(&i->t.host_attrs);
 	transport_container_unregister(&i->rport_attr_cont);
@@ -2331,7 +2430,6 @@ void fc_release_transport(struct scsi_transport_template *t)
 
 	kfree(i);
 }
-EXPORT_SYMBOL(fc_release_transport);
 
 /**
  * fc_queue_work - Queue work to the fc_host workqueue.
@@ -2438,10 +2536,30 @@ fc_flush_devloss(struct Scsi_Host *shost)
 void
 fc_remove_host(struct Scsi_Host *shost)
 {
+	struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
+	struct fc_internal *i = to_fc_internal(shost->transportt);
+
+	if (i->f->lightweight_transport)
+		fc_remove_lw_host(shost);
+
+	else
+		fc_remove_hw_host(shost, fc_host);
+}
+EXPORT_SYMBOL(fc_remove_host);
+
+void
+fc_remove_lw_host(struct Scsi_Host *shost)
+{
+	/* flush all scan work items */
+	scsi_flush_work(shost);
+}
+
+void
+fc_remove_hw_host(struct Scsi_Host *shost, struct fc_host_attrs *fc_host)
+{
 	struct fc_vport *vport = NULL, *next_vport = NULL;
 	struct fc_rport *rport = NULL, *next_rport = NULL;
 	struct workqueue_struct *work_q;
-	struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
 	unsigned long flags;
 
 	spin_lock_irqsave(shost->host_lock, flags);
@@ -2484,7 +2602,6 @@ fc_remove_host(struct Scsi_Host *shost)
 		destroy_workqueue(work_q);
 	}
 }
-EXPORT_SYMBOL(fc_remove_host);
 
 static void fc_terminate_rport_io(struct fc_rport *rport)
 {
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 924c8e6..b1c03cc 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -718,6 +718,7 @@ struct fc_function_template {
 	unsigned long	show_host_system_hostname:1;
 
 	unsigned long	disable_target_scan:1;
+	unsigned long	lightweight_transport:1;
 };
 
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host.
  2017-01-18 20:28 [PATCH 0/2] scsi: Create a lightweight FC Transport option for Virtual FC Hosts Cathy Avery
  2017-01-18 20:28 ` [PATCH 1/2] scsi: scsi_transport_fc: Provide a lightweight " Cathy Avery
@ 2017-01-18 20:28 ` Cathy Avery
  2017-01-18 23:15   ` Dan Carpenter
  2017-01-23  3:13   ` Fam Zheng
  1 sibling, 2 replies; 13+ messages in thread
From: Cathy Avery @ 2017-01-18 20:28 UTC (permalink / raw)
  To: kys, haiyangz, jejb, martin.petersen; +Cc: devel, linux-kernel, linux-scsi

Enable FC lightweight host option so that the luns exposed by
the driver may be manually scanned.

Signed-off-by: Cathy Avery <cavery@redhat.com>
---
 drivers/scsi/storvsc_drv.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 888e16e..fc1d6ba 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1882,6 +1882,7 @@ static struct hv_driver storvsc_drv = {
 static struct fc_function_template fc_transport_functions = {
 	.show_host_node_name = 1,
 	.show_host_port_name = 1,
+	.lightweight_transport = 1,
 };
 #endif
 
@@ -1906,11 +1907,6 @@ static int __init storvsc_drv_init(void)
 	fc_transport_template = fc_attach_transport(&fc_transport_functions);
 	if (!fc_transport_template)
 		return -ENODEV;
-
-	/*
-	 * Install Hyper-V specific timeout handler.
-	 */
-	fc_transport_template->eh_timed_out = storvsc_eh_timed_out;
 #endif
 
 	ret = vmbus_driver_register(&storvsc_drv);
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host.
  2017-01-18 20:28 ` [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host Cathy Avery
@ 2017-01-18 23:15   ` Dan Carpenter
  2017-01-19 17:55     ` Cathy Avery
  2017-01-23  3:13   ` Fam Zheng
  1 sibling, 1 reply; 13+ messages in thread
From: Dan Carpenter @ 2017-01-18 23:15 UTC (permalink / raw)
  To: Cathy Avery
  Cc: kys, haiyangz, jejb, martin.petersen, devel, linux-kernel, linux-scsi

On Wed, Jan 18, 2017 at 03:28:58PM -0500, Cathy Avery wrote:
> Enable FC lightweight host option so that the luns exposed by
> the driver may be manually scanned.
> 
> Signed-off-by: Cathy Avery <cavery@redhat.com>
> ---
>  drivers/scsi/storvsc_drv.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 888e16e..fc1d6ba 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -1882,6 +1882,7 @@ static struct hv_driver storvsc_drv = {
>  static struct fc_function_template fc_transport_functions = {
>  	.show_host_node_name = 1,
>  	.show_host_port_name = 1,
> +	.lightweight_transport = 1,
>  };
>  #endif
>  
> @@ -1906,11 +1907,6 @@ static int __init storvsc_drv_init(void)
>  	fc_transport_template = fc_attach_transport(&fc_transport_functions);
>  	if (!fc_transport_template)
>  		return -ENODEV;
> -
> -	/*
> -	 * Install Hyper-V specific timeout handler.
> -	 */
> -	fc_transport_template->eh_timed_out = storvsc_eh_timed_out;

I don't undestand how removing this is related.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/2] scsi: scsi_transport_fc: Provide a lightweight option for Virtual FC Hosts.
  2017-01-18 20:28 ` [PATCH 1/2] scsi: scsi_transport_fc: Provide a lightweight " Cathy Avery
@ 2017-01-19 15:11   ` Christoph Hellwig
  2017-01-19 17:59     ` Cathy Avery
  2017-01-27 15:45     ` KY Srinivasan
  0 siblings, 2 replies; 13+ messages in thread
From: Christoph Hellwig @ 2017-01-19 15:11 UTC (permalink / raw)
  To: Cathy Avery
  Cc: kys, haiyangz, jejb, martin.petersen, devel, linux-kernel, linux-scsi

On Wed, Jan 18, 2017 at 03:28:57PM -0500, Cathy Avery wrote:
> The patch provides a means to offer a lightweight option to the
> current FC transport class. The new option is selected by a
> driver when it indicates it wants the lightweight
> transport via fc_function_template.

This need some really good documentation in the code and changelog
what "lightweight" means.  It's a pretty horrible term, btw.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host.
  2017-01-18 23:15   ` Dan Carpenter
@ 2017-01-19 17:55     ` Cathy Avery
  2017-01-20  9:31       ` Dan Carpenter
  0 siblings, 1 reply; 13+ messages in thread
From: Cathy Avery @ 2017-01-19 17:55 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: kys, haiyangz, jejb, martin.petersen, devel, linux-kernel, linux-scsi



On 01/18/2017 06:15 PM, Dan Carpenter wrote:
> On Wed, Jan 18, 2017 at 03:28:58PM -0500, Cathy Avery wrote:
>> Enable FC lightweight host option so that the luns exposed by
>> the driver may be manually scanned.
>>
>> Signed-off-by: Cathy Avery <cavery@redhat.com>
>> ---
>>   drivers/scsi/storvsc_drv.c | 6 +-----
>>   1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
>> index 888e16e..fc1d6ba 100644
>> --- a/drivers/scsi/storvsc_drv.c
>> +++ b/drivers/scsi/storvsc_drv.c
>> @@ -1882,6 +1882,7 @@ static struct hv_driver storvsc_drv = {
>>   static struct fc_function_template fc_transport_functions = {
>>   	.show_host_node_name = 1,
>>   	.show_host_port_name = 1,
>> +	.lightweight_transport = 1,
>>   };
>>   #endif
>>   
>> @@ -1906,11 +1907,6 @@ static int __init storvsc_drv_init(void)
>>   	fc_transport_template = fc_attach_transport(&fc_transport_functions);
>>   	if (!fc_transport_template)
>>   		return -ENODEV;
>> -
>> -	/*
>> -	 * Install Hyper-V specific timeout handler.
>> -	 */
>> -	fc_transport_template->eh_timed_out = storvsc_eh_timed_out;
> I don't undestand how removing this is related.

Its not related but it is also not necessary so I took it out. The 
default scsi timeout handler will be used.

I can certainly put it back.

Cathy
>
> regards,
> dan carpenter

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/2] scsi: scsi_transport_fc: Provide a lightweight option for Virtual FC Hosts.
  2017-01-19 15:11   ` Christoph Hellwig
@ 2017-01-19 17:59     ` Cathy Avery
  2017-01-27 15:45     ` KY Srinivasan
  1 sibling, 0 replies; 13+ messages in thread
From: Cathy Avery @ 2017-01-19 17:59 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: kys, haiyangz, jejb, martin.petersen, devel, linux-kernel, linux-scsi



On 01/19/2017 10:11 AM, Christoph Hellwig wrote:
> On Wed, Jan 18, 2017 at 03:28:57PM -0500, Cathy Avery wrote:
>> The patch provides a means to offer a lightweight option to the
>> current FC transport class. The new option is selected by a
>> driver when it indicates it wants the lightweight
>> transport via fc_function_template.
> This need some really good documentation in the code and changelog
> what "lightweight" means.  It's a pretty horrible term, btw.

Thanks, I will work on better documentation and a better name.

Cathy

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host.
  2017-01-19 17:55     ` Cathy Avery
@ 2017-01-20  9:31       ` Dan Carpenter
  2017-01-22 18:51         ` Cathy Avery
  0 siblings, 1 reply; 13+ messages in thread
From: Dan Carpenter @ 2017-01-20  9:31 UTC (permalink / raw)
  To: Cathy Avery
  Cc: kys, haiyangz, jejb, martin.petersen, devel, linux-kernel, linux-scsi

On Thu, Jan 19, 2017 at 12:55:27PM -0500, Cathy Avery wrote:
> 
> 
> On 01/18/2017 06:15 PM, Dan Carpenter wrote:
> >On Wed, Jan 18, 2017 at 03:28:58PM -0500, Cathy Avery wrote:
> >>Enable FC lightweight host option so that the luns exposed by
> >>the driver may be manually scanned.
> >>
> >>Signed-off-by: Cathy Avery <cavery@redhat.com>
> >>---
> >>  drivers/scsi/storvsc_drv.c | 6 +-----
> >>  1 file changed, 1 insertion(+), 5 deletions(-)
> >>
> >>diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> >>index 888e16e..fc1d6ba 100644
> >>--- a/drivers/scsi/storvsc_drv.c
> >>+++ b/drivers/scsi/storvsc_drv.c
> >>@@ -1882,6 +1882,7 @@ static struct hv_driver storvsc_drv = {
> >>  static struct fc_function_template fc_transport_functions = {
> >>  	.show_host_node_name = 1,
> >>  	.show_host_port_name = 1,
> >>+	.lightweight_transport = 1,
> >>  };
> >>  #endif
> >>@@ -1906,11 +1907,6 @@ static int __init storvsc_drv_init(void)
> >>  	fc_transport_template = fc_attach_transport(&fc_transport_functions);
> >>  	if (!fc_transport_template)
> >>  		return -ENODEV;
> >>-
> >>-	/*
> >>-	 * Install Hyper-V specific timeout handler.
> >>-	 */
> >>-	fc_transport_template->eh_timed_out = storvsc_eh_timed_out;
> >I don't undestand how removing this is related.
> 
> Its not related but it is also not necessary so I took it out. The
> default scsi timeout handler will be used.
> 
> I can certainly put it back.

I'm not sure that we understand each other properly.

Has this patch already been committed?  If so, then there is no need to
put it back.

But it if hasn't been committed, can you resend the patches with that
bit broken out into a separate patch with its own changelog?  Patches
should only do one thing but you're  saying that it's doing two
unrelated things.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host.
  2017-01-20  9:31       ` Dan Carpenter
@ 2017-01-22 18:51         ` Cathy Avery
  2017-01-22 19:24           ` Dan Carpenter
  0 siblings, 1 reply; 13+ messages in thread
From: Cathy Avery @ 2017-01-22 18:51 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: kys, haiyangz, jejb, martin.petersen, devel, linux-kernel,
	linux-scsi, Christoph Hellwig

I'm sorry.  In my zeal to push out this patch I have done a poor job of 
communication on a number of levels.

The first patch which deals with the fc transport changes will not set 
the scsi_transport_template.eh_timed_out function directly during 
lightweight fc_attach_transport(). It instead relies on whatever was 
indicated as the scsi_host_template timeout handler during 
inscsi_times_out() scsi_error.c.

So yes in a sense it is related but now I believe I understand your 
point. Perhaps this would fall more under the heading of post 
fc_transport implementation storvsc cleanup necessitating its own patch.

I will break it out in the next go round.

Thanks,

Cathy


On 01/20/2017 04:31 AM, Dan Carpenter wrote:
> On Thu, Jan 19, 2017 at 12:55:27PM -0500, Cathy Avery wrote:
>>
>> On 01/18/2017 06:15 PM, Dan Carpenter wrote:
>>> On Wed, Jan 18, 2017 at 03:28:58PM -0500, Cathy Avery wrote:
>>>> Enable FC lightweight host option so that the luns exposed by
>>>> the driver may be manually scanned.
>>>>
>>>> Signed-off-by: Cathy Avery <cavery@redhat.com>
>>>> ---
>>>>   drivers/scsi/storvsc_drv.c | 6 +-----
>>>>   1 file changed, 1 insertion(+), 5 deletions(-)
>>>>
>>>> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
>>>> index 888e16e..fc1d6ba 100644
>>>> --- a/drivers/scsi/storvsc_drv.c
>>>> +++ b/drivers/scsi/storvsc_drv.c
>>>> @@ -1882,6 +1882,7 @@ static struct hv_driver storvsc_drv = {
>>>>   static struct fc_function_template fc_transport_functions = {
>>>>   	.show_host_node_name = 1,
>>>>   	.show_host_port_name = 1,
>>>> +	.lightweight_transport = 1,
>>>>   };
>>>>   #endif
>>>> @@ -1906,11 +1907,6 @@ static int __init storvsc_drv_init(void)
>>>>   	fc_transport_template = fc_attach_transport(&fc_transport_functions);
>>>>   	if (!fc_transport_template)
>>>>   		return -ENODEV;
>>>> -
>>>> -	/*
>>>> -	 * Install Hyper-V specific timeout handler.
>>>> -	 */
>>>> -	fc_transport_template->eh_timed_out = storvsc_eh_timed_out;
>>> I don't undestand how removing this is related.
>> Its not related but it is also not necessary so I took it out. The
>> default scsi timeout handler will be used.
>>
>> I can certainly put it back.
> I'm not sure that we understand each other properly.
>
> Has this patch already been committed?  If so, then there is no need to
> put it back.
>
> But it if hasn't been committed, can you resend the patches with that
> bit broken out into a separate patch with its own changelog?  Patches
> should only do one thing but you're  saying that it's doing two
> unrelated things.
>
> regards,
> dan carpenter
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host.
  2017-01-22 18:51         ` Cathy Avery
@ 2017-01-22 19:24           ` Dan Carpenter
  0 siblings, 0 replies; 13+ messages in thread
From: Dan Carpenter @ 2017-01-22 19:24 UTC (permalink / raw)
  To: Cathy Avery
  Cc: jejb, linux-scsi, martin.petersen, haiyangz, linux-kernel,
	Christoph Hellwig, devel

On Sun, Jan 22, 2017 at 01:51:13PM -0500, Cathy Avery wrote:
> I'm sorry.  In my zeal to push out this patch I have done a poor job
> of communication on a number of levels.
> 
> The first patch which deals with the fc transport changes will not
> set the scsi_transport_template.eh_timed_out function directly
> during lightweight fc_attach_transport(). It instead relies on
> whatever was indicated as the scsi_host_template timeout handler
> during inscsi_times_out() scsi_error.c.
> 
> So yes in a sense it is related but now I believe I understand your
> point. Perhaps this would fall more under the heading of post
> fc_transport implementation storvsc cleanup necessitating its own
> patch.
> 
> I will break it out in the next go round.

Ah...  Actually it probably belongs in this patch, it just wasn't
obvious to me how they were related (I'm a total newbie with this code
so that's probably part of the confusion).  Since you're resend the code
anyway, could you just add this information to the commit message?

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host.
  2017-01-18 20:28 ` [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host Cathy Avery
  2017-01-18 23:15   ` Dan Carpenter
@ 2017-01-23  3:13   ` Fam Zheng
  2017-01-23 20:55     ` Cathy Avery
  1 sibling, 1 reply; 13+ messages in thread
From: Fam Zheng @ 2017-01-23  3:13 UTC (permalink / raw)
  To: Cathy Avery
  Cc: kys, haiyangz, jejb, martin.petersen, devel, linux-kernel, linux-scsi

On Wed, 01/18 15:28, Cathy Avery wrote:
> Enable FC lightweight host option so that the luns exposed by
> the driver may be manually scanned.

Hi Cathy, out of curiosity: how does this relate to issue_lip operation? And how
to trigger manual scan with this patch?

Fam

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host.
  2017-01-23  3:13   ` Fam Zheng
@ 2017-01-23 20:55     ` Cathy Avery
  0 siblings, 0 replies; 13+ messages in thread
From: Cathy Avery @ 2017-01-23 20:55 UTC (permalink / raw)
  To: Fam Zheng
  Cc: kys, haiyangz, jejb, martin.petersen, devel, linux-kernel, linux-scsi

Hi,

There is no way to issue a lip directly as  the current client for this 
feature ( storvsc ) does not handle that request as a physical fc hba 
can. Storvsc only has two fc attributes exposed -  port_name and node_name.

You can rescan the bus with the standard echo "- - -" > 
/sys/class/scsi_host/hostX/scan.

Cathy


On 01/22/2017 10:13 PM, Fam Zheng wrote:
> On Wed, 01/18 15:28, Cathy Avery wrote:
>> Enable FC lightweight host option so that the luns exposed by
>> the driver may be manually scanned.
> Hi Cathy, out of curiosity: how does this relate to issue_lip operation? And how
> to trigger manual scan with this patch?
>
> Fam

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH 1/2] scsi: scsi_transport_fc: Provide a lightweight option for Virtual FC Hosts.
  2017-01-19 15:11   ` Christoph Hellwig
  2017-01-19 17:59     ` Cathy Avery
@ 2017-01-27 15:45     ` KY Srinivasan
  1 sibling, 0 replies; 13+ messages in thread
From: KY Srinivasan @ 2017-01-27 15:45 UTC (permalink / raw)
  To: Christoph Hellwig, Cathy Avery
  Cc: Haiyang Zhang, jejb, martin.petersen, devel, linux-kernel, linux-scsi



> -----Original Message-----
> From: Christoph Hellwig [mailto:hch@infradead.org]
> Sent: Thursday, January 19, 2017 7:12 AM
> To: Cathy Avery <cavery@redhat.com>
> Cc: KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; jejb@linux.vnet.ibm.com;
> martin.petersen@oracle.com; devel@linuxdriverproject.org; linux-
> kernel@vger.kernel.org; linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 1/2] scsi: scsi_transport_fc: Provide a lightweight option
> for Virtual FC Hosts.
> 
> On Wed, Jan 18, 2017 at 03:28:57PM -0500, Cathy Avery wrote:
> > The patch provides a means to offer a lightweight option to the
> > current FC transport class. The new option is selected by a
> > driver when it indicates it wants the lightweight
> > transport via fc_function_template.
> 
> This need some really good documentation in the code and changelog
> what "lightweight" means.  It's a pretty horrible term, btw.

This was a concept that James proposed almost a year ago. I agree, we need to document this
better.

K. Y

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-01-27 15:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-18 20:28 [PATCH 0/2] scsi: Create a lightweight FC Transport option for Virtual FC Hosts Cathy Avery
2017-01-18 20:28 ` [PATCH 1/2] scsi: scsi_transport_fc: Provide a lightweight " Cathy Avery
2017-01-19 15:11   ` Christoph Hellwig
2017-01-19 17:59     ` Cathy Avery
2017-01-27 15:45     ` KY Srinivasan
2017-01-18 20:28 ` [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host Cathy Avery
2017-01-18 23:15   ` Dan Carpenter
2017-01-19 17:55     ` Cathy Avery
2017-01-20  9:31       ` Dan Carpenter
2017-01-22 18:51         ` Cathy Avery
2017-01-22 19:24           ` Dan Carpenter
2017-01-23  3:13   ` Fam Zheng
2017-01-23 20:55     ` Cathy Avery

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).