All of lore.kernel.org
 help / color / mirror / Atom feed
* FC: fix rport dev_loss_tmo initialization
@ 2010-08-06  8:02 michaelc
  2010-08-06  8:02 ` [PATCH 1/5] fc class: add fc host default default dev loss setting michaelc
  0 siblings, 1 reply; 16+ messages in thread
From: michaelc @ 2010-08-06  8:02 UTC (permalink / raw)
  To: linux-scsi, jeykholt, andrew.vasquez, giridhar.malavali,
	James.Smart, brking

This patchset fixes a bug where the rport dev_loss_tmo
is reset when devices are added, because the driver
sets the dev_loss_tmo in the scsi_host_template slave_configure
function. 

The patches were made over scsi-misc. I have tested lpfc and
qla2xxx, and I have compile tested ibmvfc and fnic.


[PATCH 1/5] fc class: add fc host default default dev loss setting
[PATCH 2/5] qla2xxx: do not reset dev_loss_tmo in slave callout
[PATCH 3/5] lpfc: do not reset dev_loss_tmo in slave callout
[PATCH 4/5] fnic: do not reset dev_loss_tmo in slave callout
[PATCH 5/5] ibmvfc: do not reset dev_loss_tmo in slave callout

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

* [PATCH 1/5] fc class: add fc host default default dev loss setting
  2010-08-06  8:02 FC: fix rport dev_loss_tmo initialization michaelc
@ 2010-08-06  8:02 ` michaelc
  2010-08-06  8:02   ` [PATCH 2/5] qla2xxx: do not reset dev_loss_tmo in slave callout michaelc
  2010-08-09 14:53   ` [PATCH 1/5] fc class: add fc host default default dev loss setting James Smart
  0 siblings, 2 replies; 16+ messages in thread
From: michaelc @ 2010-08-06  8:02 UTC (permalink / raw)
  To: linux-scsi, jeykholt, andrew.vasquez, giridhar.malavali,
	James.Smart, brking
  Cc: Mike Christie

From: Mike Christie <michaelc@cs.wisc.edu>

This patch adds a fc_host setting to store the
default dev_loss_tmo. It is used if the driver
has a callack to get the value from the LLD. If
the callback is not set, then we use the fc class
module default value.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/scsi_transport_fc.c |    6 +++++-
 include/scsi/scsi_transport_fc.h |    4 ++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 0681378..01a5f9b 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -2525,7 +2525,11 @@ fc_rport_create(struct Scsi_Host *shost, int channel,
 
 	rport->maxframe_size = -1;
 	rport->supported_classes = FC_COS_UNSPECIFIED;
-	rport->dev_loss_tmo = fc_dev_loss_tmo;
+	if (fci->f->get_host_def_dev_loss_tmo) {
+		fci->f->get_host_def_dev_loss_tmo(shost);
+		rport->dev_loss_tmo = fc_host_def_dev_loss_tmo(shost);
+	} else
+		rport->dev_loss_tmo = fc_dev_loss_tmo;
 	memcpy(&rport->node_name, &ids->node_name, sizeof(rport->node_name));
 	memcpy(&rport->port_name, &ids->port_name, sizeof(rport->port_name));
 	rport->port_id = ids->port_id;
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 87d81b3..9f98fca 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -496,6 +496,7 @@ struct fc_host_attrs {
 	u64 fabric_name;
 	char symbolic_name[FC_SYMBOLIC_NAME_SIZE];
 	char system_hostname[FC_SYMBOLIC_NAME_SIZE];
+	u32 def_dev_loss_tmo;
 
 	/* Private (Transport-managed) Attributes */
 	enum fc_tgtid_binding_type  tgtid_bind_type;
@@ -580,6 +581,8 @@ struct fc_host_attrs {
 	(((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name)
 #define fc_host_devloss_work_q(x) \
 	(((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q)
+#define fc_host_def_dev_loss_tmo(x) \
+	(((struct fc_host_attrs *)(x)->shost_data)->def_dev_loss_tmo)
 
 
 struct fc_bsg_buffer {
@@ -640,6 +643,7 @@ struct fc_function_template {
 	void	(*get_host_fabric_name)(struct Scsi_Host *);
 	void	(*get_host_symbolic_name)(struct Scsi_Host *);
 	void	(*set_host_system_hostname)(struct Scsi_Host *);
+	void	(*get_host_def_dev_loss_tmo)(struct Scsi_Host *);
 
 	struct fc_host_statistics * (*get_fc_host_stats)(struct Scsi_Host *);
 	void	(*reset_fc_host_stats)(struct Scsi_Host *);
-- 
1.6.6.1


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

* [PATCH 2/5] qla2xxx: do not reset dev_loss_tmo in slave callout
  2010-08-06  8:02 ` [PATCH 1/5] fc class: add fc host default default dev loss setting michaelc
@ 2010-08-06  8:02   ` michaelc
  2010-08-06  8:02     ` [PATCH 3/5] lpfc: " michaelc
  2010-08-09 14:53   ` [PATCH 1/5] fc class: add fc host default default dev loss setting James Smart
  1 sibling, 1 reply; 16+ messages in thread
From: michaelc @ 2010-08-06  8:02 UTC (permalink / raw)
  To: linux-scsi, jeykholt, andrew.vasquez, giridhar.malavali,
	James.Smart, brking
  Cc: Mike Christie

From: Mike Christie <michaelc@cs.wisc.edu>

This fixes a bug where the driver was resetting the
rport dev_loss_tmo when devices were added by adding
support for the get_host_def_dev_loss_tmo callout.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/qla2xxx/qla_attr.c |   11 +++++++++++
 drivers/scsi/qla2xxx/qla_os.c   |    5 -----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 420238c..679a432 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1530,6 +1530,15 @@ qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
 }
 
 static void
+qla2x00_get_host_def_loss_tmo(struct Scsi_Host *shost)
+{
+	scsi_qla_host_t *vha = shost_priv(shost);
+	struct qla_hw_data *ha = vha->hw;
+
+	fc_host_def_dev_loss_tmo(shost) = ha->port_down_retry_count;
+}
+
+static void
 qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport)
 {
 	struct Scsi_Host *host = rport_to_shost(rport);
@@ -1903,6 +1912,7 @@ struct fc_function_template qla2xxx_transport_functions = {
 	.show_host_fabric_name = 1,
 	.get_host_port_state = qla2x00_get_host_port_state,
 	.show_host_port_state = 1,
+	.get_host_def_dev_loss_tmo = qla2x00_get_host_def_loss_tmo,
 
 	.dd_fcrport_size = sizeof(struct fc_port *),
 	.show_rport_supported_classes = 1,
@@ -1949,6 +1959,7 @@ struct fc_function_template qla2xxx_transport_vport_functions = {
 	.show_host_fabric_name = 1,
 	.get_host_port_state = qla2x00_get_host_port_state,
 	.show_host_port_state = 1,
+	.get_host_def_dev_loss_tmo = qla2x00_get_host_def_loss_tmo,
 
 	.dd_fcrport_size = sizeof(struct fc_port *),
 	.show_rport_supported_classes = 1,
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index ff2172d..61e6aac 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1295,17 +1295,12 @@ static int
 qla2xxx_slave_configure(struct scsi_device *sdev)
 {
 	scsi_qla_host_t *vha = shost_priv(sdev->host);
-	struct qla_hw_data *ha = vha->hw;
-	struct fc_rport *rport = starget_to_rport(sdev->sdev_target);
 	struct req_que *req = vha->req;
 
 	if (sdev->tagged_supported)
 		scsi_activate_tcq(sdev, req->max_q_depth);
 	else
 		scsi_deactivate_tcq(sdev, req->max_q_depth);
-
-	rport->dev_loss_tmo = ha->port_down_retry_count;
-
 	return 0;
 }
 
-- 
1.6.6.1


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

* [PATCH 3/5] lpfc: do not reset dev_loss_tmo in slave callout
  2010-08-06  8:02   ` [PATCH 2/5] qla2xxx: do not reset dev_loss_tmo in slave callout michaelc
@ 2010-08-06  8:02     ` michaelc
  2010-08-06  8:02       ` [PATCH 4/5] fnic: " michaelc
  2010-08-06  8:05       ` [PATCH 3/5] lpfc: " Mike Christie
  0 siblings, 2 replies; 16+ messages in thread
From: michaelc @ 2010-08-06  8:02 UTC (permalink / raw)
  To: linux-scsi, jeykholt, andrew.vasquez, giridhar.malavali,
	James.Smart, brking
  Cc: Mike Christie

From: Mike Christie <michaelc@cs.wisc.edu>

This fixes a bug where the driver was resetting the
rport dev_loss_tmo when devices were added by adding
support for the get_host_def_dev_loss_tmo callout.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/lpfc/lpfc_attr.c |   10 ++++++++++
 drivers/scsi/lpfc/lpfc_scsi.c |   10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 868874c..a998375 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -4328,6 +4328,14 @@ lpfc_get_starget_port_name(struct scsi_target *starget)
 		ndlp ? wwn_to_u64(ndlp->nlp_portname.u.wwn) : 0;
 }
 
+static void
+lpfc_get_host_def_loss_tmo(struct Scsi_Host *shost)
+{
+        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
+
+	fc_host_def_dev_loss_tmo(shost) = vport->cfg_devloss_tmo;
+}
+
 /**
  * lpfc_set_rport_loss_tmo - Set the rport dev loss tmo
  * @rport: fc rport address.
@@ -4436,6 +4444,7 @@ struct fc_function_template lpfc_transport_functions = {
 	.get_host_fabric_name = lpfc_get_host_fabric_name,
 	.show_host_fabric_name = 1,
 
+	.get_host_def_dev_loss_tmo = lpfc_get_host_def_loss_tmo,
 	/*
 	 * The LPFC driver treats linkdown handling as target loss events
 	 * so there are no sysfs handlers for link_down_tmo.
@@ -4503,6 +4512,7 @@ struct fc_function_template lpfc_vport_transport_functions = {
 	.get_host_fabric_name = lpfc_get_host_fabric_name,
 	.show_host_fabric_name = 1,
 
+	.get_host_def_dev_loss_tmo = lpfc_get_host_def_loss_tmo,
 	/*
 	 * The LPFC driver treats linkdown handling as target loss events
 	 * so there are no sysfs handlers for link_down_tmo.
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index c818a72..be91350 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -3656,7 +3656,6 @@ lpfc_slave_alloc(struct scsi_device *sdev)
  *
  * This routine configures following items
  *   - Tag command queuing support for @sdev if supported.
- *   - Dev loss time out value of fc_rport.
  *   - Enable SLI polling for fcp ring if ENABLE_FCP_RING_POLLING flag is set.
  *
  * Return codes:
@@ -3667,21 +3666,12 @@ lpfc_slave_configure(struct scsi_device *sdev)
 {
 	struct lpfc_vport *vport = (struct lpfc_vport *) sdev->host->hostdata;
 	struct lpfc_hba   *phba = vport->phba;
-	struct fc_rport   *rport = starget_to_rport(sdev->sdev_target);
 
 	if (sdev->tagged_supported)
 		scsi_activate_tcq(sdev, vport->cfg_lun_queue_depth);
 	else
 		scsi_deactivate_tcq(sdev, vport->cfg_lun_queue_depth);
 
-	/*
-	 * Initialize the fc transport attributes for the target
-	 * containing this scsi device.  Also note that the driver's
-	 * target pointer is stored in the starget_data for the
-	 * driver's sysfs entry point functions.
-	 */
-	rport->dev_loss_tmo = vport->cfg_devloss_tmo;
-
 	if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) {
 		lpfc_sli_handle_fast_ring_event(phba,
 			&phba->sli.ring[LPFC_FCP_RING], HA_R0RE_REQ);
-- 
1.6.6.1


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

* [PATCH 4/5] fnic: do not reset dev_loss_tmo in slave callout
  2010-08-06  8:02     ` [PATCH 3/5] lpfc: " michaelc
@ 2010-08-06  8:02       ` michaelc
  2010-08-06  8:02         ` [PATCH 5/5] ibmvfc: " michaelc
  2010-08-06 15:06         ` [PATCH 4/5] fnic: " Joe Eykholt
  2010-08-06  8:05       ` [PATCH 3/5] lpfc: " Mike Christie
  1 sibling, 2 replies; 16+ messages in thread
From: michaelc @ 2010-08-06  8:02 UTC (permalink / raw)
  To: linux-scsi, jeykholt, andrew.vasquez, giridhar.malavali,
	James.Smart, brking
  Cc: Mike Christie

From: Mike Christie <michaelc@cs.wisc.edu>

This fixes a bug where the driver was resetting the
rport dev_loss_tmo when devices were added by adding
support for the get_host_def_dev_loss_tmo callout.

Patch has only been compile tested.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/fnic/fnic_main.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index 9eb7a9e..df91a61 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -80,8 +80,6 @@ static struct libfc_function_template fnic_transport_template = {
 static int fnic_slave_alloc(struct scsi_device *sdev)
 {
 	struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
-	struct fc_lport *lp = shost_priv(sdev->host);
-	struct fnic *fnic = lport_priv(lp);
 
 	sdev->tagged_supported = 1;
 
@@ -89,8 +87,6 @@ static int fnic_slave_alloc(struct scsi_device *sdev)
 		return -ENXIO;
 
 	scsi_activate_tcq(sdev, FNIC_DFLT_QUEUE_DEPTH);
-	rport->dev_loss_tmo = fnic->config.port_down_timeout / 1000;
-
 	return 0;
 }
 
@@ -113,6 +109,15 @@ static struct scsi_host_template fnic_host_template = {
 	.shost_attrs = fnic_attrs,
 };
 
+static void
+fnic_get_host_def_loss_tmo(struct Scsi_Host *shost)
+{
+	struct fc_lport *lp = shost_priv(shost);
+	struct fnic *fnic = lport_priv(lp);
+
+	fc_host_def_dev_loss_tmo(shost) = fnic->config.port_down_timeout / 1000;
+}
+
 static void fnic_get_host_speed(struct Scsi_Host *shost);
 static struct scsi_transport_template *fnic_fc_transport;
 static struct fc_host_statistics *fnic_get_stats(struct Scsi_Host *);
@@ -142,6 +147,7 @@ static struct fc_function_template fnic_fc_functions = {
 	.show_rport_dev_loss_tmo = 1,
 	.issue_fc_host_lip = fnic_reset,
 	.get_fc_host_stats = fnic_get_stats,
+	.get_host_def_dev_loss_tmo = fnic_get_host_def_loss_tmo,
 	.dd_fcrport_size = sizeof(struct fc_rport_libfc_priv),
 	.terminate_rport_io = fnic_terminate_rport_io,
 	.bsg_request = fc_lport_bsg_request,
-- 
1.6.6.1


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

* [PATCH 5/5] ibmvfc: do not reset dev_loss_tmo in slave callout
  2010-08-06  8:02       ` [PATCH 4/5] fnic: " michaelc
@ 2010-08-06  8:02         ` michaelc
  2010-08-06 15:06         ` [PATCH 4/5] fnic: " Joe Eykholt
  1 sibling, 0 replies; 16+ messages in thread
From: michaelc @ 2010-08-06  8:02 UTC (permalink / raw)
  To: linux-scsi, jeykholt, andrew.vasquez, giridhar.malavali,
	James.Smart, brking
  Cc: Mike Christie

From: Mike Christie <michaelc@cs.wisc.edu>

This fixes a bug where the driver was resetting the
rport dev_loss_tmo when devices were added by adding
support for the get_host_def_dev_loss_tmo callout.

Patch has only been compile tested.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/ibmvscsi/ibmvfc.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index bd96cec..56b68a8 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -1027,6 +1027,11 @@ static void ibmvfc_get_host_port_state(struct Scsi_Host *shost)
 	spin_unlock_irqrestore(shost->host_lock, flags);
 }
 
+static void ibmvfc_set_host_def_dev_loss_tmo(struct Scsi_Host *shost)
+{
+	fc_host_def_dev_loss_tmo(shost) = dev_loss_tmo;
+}
+
 /**
  * ibmvfc_set_rport_dev_loss_tmo - Set rport's device loss timeout
  * @rport:		rport struct
@@ -2751,7 +2756,6 @@ static int ibmvfc_target_alloc(struct scsi_target *starget)
 static int ibmvfc_slave_configure(struct scsi_device *sdev)
 {
 	struct Scsi_Host *shost = sdev->host;
-	struct fc_rport *rport = starget_to_rport(sdev->sdev_target);
 	unsigned long flags = 0;
 
 	spin_lock_irqsave(shost->host_lock, flags);
@@ -2763,8 +2767,6 @@ static int ibmvfc_slave_configure(struct scsi_device *sdev)
 		scsi_activate_tcq(sdev, sdev->queue_depth);
 	} else
 		scsi_deactivate_tcq(sdev, sdev->queue_depth);
-
-	rport->dev_loss_tmo = dev_loss_tmo;
 	spin_unlock_irqrestore(shost->host_lock, flags);
 	return 0;
 }
@@ -4847,6 +4849,8 @@ static struct fc_function_template ibmvfc_transport_functions = {
 	.get_host_speed = ibmvfc_get_host_speed,
 	.show_host_speed = 1,
 
+	.get_host_def_dev_loss_tmo = ibmvfc_set_host_def_dev_loss_tmo,
+
 	.issue_fc_host_lip = ibmvfc_issue_fc_host_lip,
 	.terminate_rport_io = ibmvfc_terminate_rport_io,
 
-- 
1.6.6.1


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

* Re: [PATCH 3/5] lpfc: do not reset dev_loss_tmo in slave callout
  2010-08-06  8:02     ` [PATCH 3/5] lpfc: " michaelc
  2010-08-06  8:02       ` [PATCH 4/5] fnic: " michaelc
@ 2010-08-06  8:05       ` Mike Christie
  1 sibling, 0 replies; 16+ messages in thread
From: Mike Christie @ 2010-08-06  8:05 UTC (permalink / raw)
  To: michaelc
  Cc: linux-scsi, jeykholt, andrew.vasquez, giridhar.malavali,
	James.Smart, brking

On 08/06/2010 03:02 AM, michaelc@cs.wisc.edu wrote:
>
> +static void
> +lpfc_get_host_def_loss_tmo(struct Scsi_Host *shost)
> +{
> +        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;

This part of the patch has whitespaces when I should have used tabs. git 
am --whitespace=fix will fix it up, or I can resend another patch if you 
want.

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

* Re: [PATCH 4/5] fnic: do not reset dev_loss_tmo in slave callout
  2010-08-06  8:02       ` [PATCH 4/5] fnic: " michaelc
  2010-08-06  8:02         ` [PATCH 5/5] ibmvfc: " michaelc
@ 2010-08-06 15:06         ` Joe Eykholt
  2010-08-06 16:32           ` Mike Christie
  1 sibling, 1 reply; 16+ messages in thread
From: Joe Eykholt @ 2010-08-06 15:06 UTC (permalink / raw)
  To: michaelc
  Cc: linux-scsi, andrew.vasquez, giridhar.malavali, James.Smart, brking

On 8/6/10 1:02 AM, michaelc@cs.wisc.edu wrote:
> From: Mike Christie<michaelc@cs.wisc.edu>
>
> This fixes a bug where the driver was resetting the
> rport dev_loss_tmo when devices were added by adding
> support for the get_host_def_dev_loss_tmo callout.

fnic devloss timeout isn't settable on the host.
It's only configurable from network configuration.
So, I think this patch is unnecessary.

Note that we don't have a set method, so the
/sys file will be read-only.

> Patch has only been compile tested.
>
> Signed-off-by: Mike Christie<michaelc@cs.wisc.edu>
> ---
>   drivers/scsi/fnic/fnic_main.c |   14 ++++++++++----
>   1 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
> index 9eb7a9e..df91a61 100644
> --- a/drivers/scsi/fnic/fnic_main.c
> +++ b/drivers/scsi/fnic/fnic_main.c
> @@ -80,8 +80,6 @@ static struct libfc_function_template fnic_transport_template = {
>   static int fnic_slave_alloc(struct scsi_device *sdev)
>   {
>   	struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
> -	struct fc_lport *lp = shost_priv(sdev->host);
> -	struct fnic *fnic = lport_priv(lp);
>
>   	sdev->tagged_supported = 1;
>
> @@ -89,8 +87,6 @@ static int fnic_slave_alloc(struct scsi_device *sdev)
>   		return -ENXIO;
>
>   	scsi_activate_tcq(sdev, FNIC_DFLT_QUEUE_DEPTH);
> -	rport->dev_loss_tmo = fnic->config.port_down_timeout / 1000;
> -
>   	return 0;
>   }
>
> @@ -113,6 +109,15 @@ static struct scsi_host_template fnic_host_template = {
>   	.shost_attrs = fnic_attrs,
>   };
>
> +static void
> +fnic_get_host_def_loss_tmo(struct Scsi_Host *shost)
> +{
> +	struct fc_lport *lp = shost_priv(shost);
> +	struct fnic *fnic = lport_priv(lp);
> +
> +	fc_host_def_dev_loss_tmo(shost) = fnic->config.port_down_timeout / 1000;
> +}
> +
>   static void fnic_get_host_speed(struct Scsi_Host *shost);
>   static struct scsi_transport_template *fnic_fc_transport;
>   static struct fc_host_statistics *fnic_get_stats(struct Scsi_Host *);
> @@ -142,6 +147,7 @@ static struct fc_function_template fnic_fc_functions = {
>   	.show_rport_dev_loss_tmo = 1,
>   	.issue_fc_host_lip = fnic_reset,
>   	.get_fc_host_stats = fnic_get_stats,
> +	.get_host_def_dev_loss_tmo = fnic_get_host_def_loss_tmo,
>   	.dd_fcrport_size = sizeof(struct fc_rport_libfc_priv),
>   	.terminate_rport_io = fnic_terminate_rport_io,
>   	.bsg_request = fc_lport_bsg_request,

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

* Re: [PATCH 4/5] fnic: do not reset dev_loss_tmo in slave callout
  2010-08-06 15:06         ` [PATCH 4/5] fnic: " Joe Eykholt
@ 2010-08-06 16:32           ` Mike Christie
  2010-08-06 16:51             ` Mike Christie
  0 siblings, 1 reply; 16+ messages in thread
From: Mike Christie @ 2010-08-06 16:32 UTC (permalink / raw)
  To: Joe Eykholt
  Cc: linux-scsi, andrew.vasquez, giridhar.malavali, James.Smart, brking

On 08/06/2010 10:06 AM, Joe Eykholt wrote:
> On 8/6/10 1:02 AM, michaelc@cs.wisc.edu wrote:
>> From: Mike Christie<michaelc@cs.wisc.edu>
>>
>> This fixes a bug where the driver was resetting the
>> rport dev_loss_tmo when devices were added by adding
>> support for the get_host_def_dev_loss_tmo callout.
>
> fnic devloss timeout isn't settable on the host.
> It's only configurable from network configuration.
> So, I think this patch is unnecessary.
>
> Note that we don't have a set method, so the
> /sys file will be read-only.

Ah yeah, I see that now. I argee it is not needed to fix the bug I was 
fixing. It might be nice to have it, so drivers are setting the dev loss 
tmo in the same way though. It does not matter to me either way though.

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

* Re: [PATCH 4/5] fnic: do not reset dev_loss_tmo in slave callout
  2010-08-06 16:32           ` Mike Christie
@ 2010-08-06 16:51             ` Mike Christie
  2010-08-06 20:20               ` James Bottomley
  0 siblings, 1 reply; 16+ messages in thread
From: Mike Christie @ 2010-08-06 16:51 UTC (permalink / raw)
  To: Joe Eykholt
  Cc: linux-scsi, andrew.vasquez, giridhar.malavali, James.Smart, brking

On 08/06/2010 11:32 AM, Mike Christie wrote:
> tmo in the same way though. It does not matter to me either way though.

I take that last line back. If it is ok, I would like to have all FC 
drivers using the fc class in the same way if possible.

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

* Re: [PATCH 4/5] fnic: do not reset dev_loss_tmo in slave callout
  2010-08-06 16:51             ` Mike Christie
@ 2010-08-06 20:20               ` James Bottomley
  2010-08-06 21:14                 ` Mike Christie
  0 siblings, 1 reply; 16+ messages in thread
From: James Bottomley @ 2010-08-06 20:20 UTC (permalink / raw)
  To: Mike Christie
  Cc: Joe Eykholt, linux-scsi, andrew.vasquez, giridhar.malavali,
	James.Smart, brking

On Fri, 2010-08-06 at 11:51 -0500, Mike Christie wrote:
> On 08/06/2010 11:32 AM, Mike Christie wrote:
> > tmo in the same way though. It does not matter to me either way though.
> 
> I take that last line back. If it is ok, I would like to have all FC 
> drivers using the fc class in the same way if possible.

OK, I think I agree with that.  How about I take this after the merge
window closes so we have time to canvass objections?

James



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

* Re: [PATCH 4/5] fnic: do not reset dev_loss_tmo in slave callout
  2010-08-06 20:20               ` James Bottomley
@ 2010-08-06 21:14                 ` Mike Christie
  0 siblings, 0 replies; 16+ messages in thread
From: Mike Christie @ 2010-08-06 21:14 UTC (permalink / raw)
  To: James Bottomley
  Cc: Joe Eykholt, linux-scsi, andrew.vasquez, giridhar.malavali,
	James.Smart, brking

On 08/06/2010 03:20 PM, James Bottomley wrote:
> On Fri, 2010-08-06 at 11:51 -0500, Mike Christie wrote:
>> On 08/06/2010 11:32 AM, Mike Christie wrote:
>>> tmo in the same way though. It does not matter to me either way though.
>>
>> I take that last line back. If it is ok, I would like to have all FC
>> drivers using the fc class in the same way if possible.
>
> OK, I think I agree with that.  How about I take this after the merge
> window closes so we have time to canvass objections?
>

Sounds good.

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

* Re: [PATCH 1/5] fc class: add fc host default default dev loss setting
  2010-08-06  8:02 ` [PATCH 1/5] fc class: add fc host default default dev loss setting michaelc
  2010-08-06  8:02   ` [PATCH 2/5] qla2xxx: do not reset dev_loss_tmo in slave callout michaelc
@ 2010-08-09 14:53   ` James Smart
  2010-08-09 15:00     ` Mike Christie
  1 sibling, 1 reply; 16+ messages in thread
From: James Smart @ 2010-08-09 14:53 UTC (permalink / raw)
  To: michaelc; +Cc: linux-scsi, jeykholt, andrew.vasquez, giridhar.malavali, brking

Mike,

why the motivation to get the dev_loss_tmo from the LLDD ?  I would have 
assumed this would have become a base fc_host attribute which is rd/wr, the 
default coming from the module parameter, with the "set" propagating to the 
LLDD to change all rports to the host value (either new direct callback, or 
loop which calls rport set routine).

- james s


michaelc@cs.wisc.edu wrote:
> From: Mike Christie <michaelc@cs.wisc.edu>
> 
> This patch adds a fc_host setting to store the
> default dev_loss_tmo. It is used if the driver
> has a callack to get the value from the LLD. If
> the callback is not set, then we use the fc class
> module default value.
> 


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

* Re: [PATCH 1/5] fc class: add fc host default default dev loss setting
  2010-08-09 14:53   ` [PATCH 1/5] fc class: add fc host default default dev loss setting James Smart
@ 2010-08-09 15:00     ` Mike Christie
  2010-08-09 15:17       ` Mike Christie
  0 siblings, 1 reply; 16+ messages in thread
From: Mike Christie @ 2010-08-09 15:00 UTC (permalink / raw)
  To: James Smart
  Cc: linux-scsi, jeykholt, andrew.vasquez, giridhar.malavali, brking

On 08/09/2010 09:53 AM, James Smart wrote:
> Mike,
>
> why the motivation to get the dev_loss_tmo from the LLDD ? I would have
> assumed this would have become a base fc_host attribute which is rd/wr,
> the default coming from the module parameter, with the "set" propagating
> to the LLDD to change all rports to the host value (either new direct
> callback, or loop which calls rport set routine).

qla2xxx and fnic set the default/initial dev_loss_tmo based on some 
value they get from firmware.

Should I allow either where a lld can override it if they want to set it 
based on fw/hw info. If I do this should I keep the lpfc dev_loss_tmo on 
the scsi_host for backward compat and then add the fc_host r/w attr for 
it too?



>
> - james s
>
>
> michaelc@cs.wisc.edu wrote:
>> From: Mike Christie <michaelc@cs.wisc.edu>
>>
>> This patch adds a fc_host setting to store the
>> default dev_loss_tmo. It is used if the driver
>> has a callack to get the value from the LLD. If
>> the callback is not set, then we use the fc class
>> module default value.
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html


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

* Re: [PATCH 1/5] fc class: add fc host default default dev loss setting
  2010-08-09 15:00     ` Mike Christie
@ 2010-08-09 15:17       ` Mike Christie
  2010-08-09 18:32         ` Andrew Vasquez
  0 siblings, 1 reply; 16+ messages in thread
From: Mike Christie @ 2010-08-09 15:17 UTC (permalink / raw)
  To: James Smart
  Cc: linux-scsi, jeykholt, andrew.vasquez, giridhar.malavali, brking

On 08/09/2010 10:00 AM, Mike Christie wrote:
> On 08/09/2010 09:53 AM, James Smart wrote:
>> Mike,
>>
>> why the motivation to get the dev_loss_tmo from the LLDD ? I would have
>> assumed this would have become a base fc_host attribute which is rd/wr,
>> the default coming from the module parameter, with the "set" propagating
>> to the LLDD to change all rports to the host value (either new direct
>> callback, or loop which calls rport set routine).
>
> qla2xxx and fnic set the default/initial dev_loss_tmo based on some
> value they get from firmware.
>

The qla2xxx mention is not right.

Andrew,

It looks like when the port_down_retry_count is set the 
login_retry_count could be adjusted. When the dev_loss_tmo is set by 
sysfs does qla2xxx, possibly want to adjust the login_retry_count?

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

* Re: [PATCH 1/5] fc class: add fc host default default dev loss setting
  2010-08-09 15:17       ` Mike Christie
@ 2010-08-09 18:32         ` Andrew Vasquez
  0 siblings, 0 replies; 16+ messages in thread
From: Andrew Vasquez @ 2010-08-09 18:32 UTC (permalink / raw)
  To: Mike Christie
  Cc: James Smart, linux-scsi, jeykholt, Giridhar Malavali, brking

On Mon, 09 Aug 2010, Mike Christie wrote:

> On 08/09/2010 10:00 AM, Mike Christie wrote:
> > On 08/09/2010 09:53 AM, James Smart wrote:
> >> Mike,
> >>
> >> why the motivation to get the dev_loss_tmo from the LLDD ? I would have
> >> assumed this would have become a base fc_host attribute which is rd/wr,
> >> the default coming from the module parameter, with the "set" propagating
> >> to the LLDD to change all rports to the host value (either new direct
> >> callback, or loop which calls rport set routine).
> >
> > qla2xxx and fnic set the default/initial dev_loss_tmo based on some
> > value they get from firmware.
> >
> 
> The qla2xxx mention is not right.
> 
> Andrew,
> 
> It looks like when the port_down_retry_count is set the 
> login_retry_count could be adjusted.

Actualy it's the other way around.  login_retry_count is initially
seeded with NVRAM values, then based on value, reassigned to
port_down_retry_count.

> When the dev_loss_tmo is set by 
> sysfs does qla2xxx, possibly want to adjust the login_retry_count?

I'd prefer to continue to have port_down_retry_count stay as a seeded
value to the transport (fc_host).

-- av

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

end of thread, other threads:[~2010-08-09 18:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-06  8:02 FC: fix rport dev_loss_tmo initialization michaelc
2010-08-06  8:02 ` [PATCH 1/5] fc class: add fc host default default dev loss setting michaelc
2010-08-06  8:02   ` [PATCH 2/5] qla2xxx: do not reset dev_loss_tmo in slave callout michaelc
2010-08-06  8:02     ` [PATCH 3/5] lpfc: " michaelc
2010-08-06  8:02       ` [PATCH 4/5] fnic: " michaelc
2010-08-06  8:02         ` [PATCH 5/5] ibmvfc: " michaelc
2010-08-06 15:06         ` [PATCH 4/5] fnic: " Joe Eykholt
2010-08-06 16:32           ` Mike Christie
2010-08-06 16:51             ` Mike Christie
2010-08-06 20:20               ` James Bottomley
2010-08-06 21:14                 ` Mike Christie
2010-08-06  8:05       ` [PATCH 3/5] lpfc: " Mike Christie
2010-08-09 14:53   ` [PATCH 1/5] fc class: add fc host default default dev loss setting James Smart
2010-08-09 15:00     ` Mike Christie
2010-08-09 15:17       ` Mike Christie
2010-08-09 18:32         ` Andrew Vasquez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.