linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: qedf: Add port_id getter
@ 2019-09-23 10:37 Daniel Wagner
  2019-09-24  6:08 ` Saurav Kashyap
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Wagner @ 2019-09-23 10:37 UTC (permalink / raw)
  To: QLogic-Storage-Upstream; +Cc: linux-scsi, linux-kernel, Daniel Wagner

Add qedf_get_host_port_id() to the transport template.

The fc_transport_template initializes the port_id member to the
default value of -1. The new getter ensures that the sysfs entry shows
the current value and not the default one, e.g by using 'lsscsi -H -t'

Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 drivers/scsi/qedf/qedf_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 9c24f3834d70..8fe8c3fdde1b 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -1926,6 +1926,13 @@ static int qedf_fcoe_reset(struct Scsi_Host *shost)
 	return 0;
 }
 
+static void qedf_get_host_port_id(struct Scsi_Host *shost)
+{
+	struct fc_lport *lport = shost_priv(shost);
+
+	fc_host_port_id(shost) = lport->port_id;
+}
+
 static struct fc_host_statistics *qedf_fc_get_host_stats(struct Scsi_Host
 	*shost)
 {
@@ -1996,6 +2003,7 @@ static struct fc_function_template qedf_fc_transport_fn = {
 	.show_host_active_fc4s = 1,
 	.show_host_maxframe_size = 1,
 
+	.get_host_port_id = qedf_get_host_port_id,
 	.show_host_port_id = 1,
 	.show_host_supported_speeds = 1,
 	.get_host_speed = fc_get_host_speed,
-- 
2.16.4


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

* RE: [PATCH] scsi: qedf: Add port_id getter
  2019-09-23 10:37 [PATCH] scsi: qedf: Add port_id getter Daniel Wagner
@ 2019-09-24  6:08 ` Saurav Kashyap
  2019-09-24  7:11   ` Daniel Wagner
  2019-09-24  7:29   ` [PATCH v2] " Daniel Wagner
  0 siblings, 2 replies; 9+ messages in thread
From: Saurav Kashyap @ 2019-09-24  6:08 UTC (permalink / raw)
  To: Daniel Wagner, QLogic-Storage-Upstream; +Cc: linux-scsi, linux-kernel


> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org <linux-scsi-owner@vger.kernel.org> On
> Behalf Of Daniel Wagner
> Sent: Monday, September 23, 2019 4:08 PM
> To: QLogic-Storage-Upstream@cavium.com
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; Daniel Wagner
> <dwagner@suse.de>
> Subject: [PATCH] scsi: qedf: Add port_id getter
> 
> Add qedf_get_host_port_id() to the transport template.
> 
> The fc_transport_template initializes the port_id member to the default value of
> -1. The new getter ensures that the sysfs entry shows the current value and not
> the default one, e.g by using 'lsscsi -H -t'
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
>  drivers/scsi/qedf/qedf_main.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index
> 9c24f3834d70..8fe8c3fdde1b 100644
> --- a/drivers/scsi/qedf/qedf_main.c
> +++ b/drivers/scsi/qedf/qedf_main.c
> @@ -1926,6 +1926,13 @@ static int qedf_fcoe_reset(struct Scsi_Host *shost)
>  	return 0;
>  }
> 
> +static void qedf_get_host_port_id(struct Scsi_Host *shost) {
> +	struct fc_lport *lport = shost_priv(shost);
> +
> +	fc_host_port_id(shost) = lport->port_id; }

Minor stuff, the closing brace should be in next line. Please submit v2.

Thanks,
~Saurav
> +
>  static struct fc_host_statistics *qedf_fc_get_host_stats(struct Scsi_Host
>  	*shost)
>  {
> @@ -1996,6 +2003,7 @@ static struct fc_function_template
> qedf_fc_transport_fn = {
>  	.show_host_active_fc4s = 1,
>  	.show_host_maxframe_size = 1,
> 
> +	.get_host_port_id = qedf_get_host_port_id,
>  	.show_host_port_id = 1,
>  	.show_host_supported_speeds = 1,
>  	.get_host_speed = fc_get_host_speed,
> --
> 2.16.4


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

* Re: [PATCH] scsi: qedf: Add port_id getter
  2019-09-24  6:08 ` Saurav Kashyap
@ 2019-09-24  7:11   ` Daniel Wagner
  2019-09-24  7:23     ` Daniel Wagner
  2019-09-24  7:29   ` [PATCH v2] " Daniel Wagner
  1 sibling, 1 reply; 9+ messages in thread
From: Daniel Wagner @ 2019-09-24  7:11 UTC (permalink / raw)
  To: Saurav Kashyap; +Cc: QLogic-Storage-Upstream, linux-scsi, linux-kernel

On Tue, Sep 24, 2019 at 06:08:09AM +0000, Saurav Kashyap wrote:
> > +static void qedf_get_host_port_id(struct Scsi_Host *shost) {
> > +	struct fc_lport *lport = shost_priv(shost);
> > +
> > +	fc_host_port_id(shost) = lport->port_id; }
> 
> Minor stuff, the closing brace should be in next line. Please submit v2.

Oops, sorry about that.

Thanks
Daniel

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

* Re: [PATCH] scsi: qedf: Add port_id getter
  2019-09-24  7:11   ` Daniel Wagner
@ 2019-09-24  7:23     ` Daniel Wagner
  2019-09-24  9:10       ` [EXT] " Saurav Kashyap
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Wagner @ 2019-09-24  7:23 UTC (permalink / raw)
  To: Saurav Kashyap; +Cc: QLogic-Storage-Upstream, linux-scsi, linux-kernel

Hi Saurav,

On Tue, Sep 24, 2019 at 09:11:38AM +0200, Daniel Wagner wrote:
> On Tue, Sep 24, 2019 at 06:08:09AM +0000, Saurav Kashyap wrote:
> > > +static void qedf_get_host_port_id(struct Scsi_Host *shost) {
> > > +	struct fc_lport *lport = shost_priv(shost);
> > > +
> > > +	fc_host_port_id(shost) = lport->port_id; }
> > 
> > Minor stuff, the closing brace should be in next line. Please submit v2.
> 
> Oops, sorry about that.

The patch I sent out had the closing brace on a new
line:

https://lore.kernel.org/linux-scsi/20190923103738.67749-1-dwagner@suse.de/

Now I am a bit confused how I screwed it up. Anyway, I'll send it out
again after with hexdump there is not a special ASCII character
hidden :)

Thanks,
Daniel

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

* [PATCH v2] scsi: qedf: Add port_id getter
  2019-09-24  6:08 ` Saurav Kashyap
  2019-09-24  7:11   ` Daniel Wagner
@ 2019-09-24  7:29   ` Daniel Wagner
  2019-09-24  9:06     ` Saurav Kashyap
                       ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Daniel Wagner @ 2019-09-24  7:29 UTC (permalink / raw)
  To: QLogic-Storage-Upstream; +Cc: linux-scsi, linux-kernel, Daniel Wagner

Add qedf_get_host_port_id() to the transport template.

The fc_transport_template initializes the port_id member to the
default value of -1. The new getter ensures that the sysfs entry shows
the current value and not the default one, e.g by using 'lsscsi -H -t'

Signed-off-by: Daniel Wagner <dwagner@suse.de>
---

changes v2:
  - place closing brace on new line, fix whitespace damage

 drivers/scsi/qedf/qedf_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 9c24f3834d70..8fe8c3fdde1b 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -1926,6 +1926,13 @@ static int qedf_fcoe_reset(struct Scsi_Host *shost)
 	return 0;
 }
 
+static void qedf_get_host_port_id(struct Scsi_Host *shost)
+{
+	struct fc_lport *lport = shost_priv(shost);
+
+	fc_host_port_id(shost) = lport->port_id;
+}
+
 static struct fc_host_statistics *qedf_fc_get_host_stats(struct Scsi_Host
 	*shost)
 {
@@ -1996,6 +2003,7 @@ static struct fc_function_template qedf_fc_transport_fn = {
 	.show_host_active_fc4s = 1,
 	.show_host_maxframe_size = 1,
 
+	.get_host_port_id = qedf_get_host_port_id,
 	.show_host_port_id = 1,
 	.show_host_supported_speeds = 1,
 	.get_host_speed = fc_get_host_speed,
-- 
2.16.4


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

* RE: [PATCH v2] scsi: qedf: Add port_id getter
  2019-09-24  7:29   ` [PATCH v2] " Daniel Wagner
@ 2019-09-24  9:06     ` Saurav Kashyap
  2019-09-24 12:03     ` Hannes Reinecke
  2019-10-01  3:05     ` Martin K. Petersen
  2 siblings, 0 replies; 9+ messages in thread
From: Saurav Kashyap @ 2019-09-24  9:06 UTC (permalink / raw)
  To: Daniel Wagner, QLogic-Storage-Upstream; +Cc: linux-scsi, linux-kernel



> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org <linux-scsi-owner@vger.kernel.org> On
> Behalf Of Daniel Wagner
> Sent: Tuesday, September 24, 2019 12:59 PM
> To: QLogic-Storage-Upstream@cavium.com
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; Daniel Wagner
> <dwagner@suse.de>
> Subject: [PATCH v2] scsi: qedf: Add port_id getter
> 
> Add qedf_get_host_port_id() to the transport template.
> 
> The fc_transport_template initializes the port_id member to the
> default value of -1. The new getter ensures that the sysfs entry shows
> the current value and not the default one, e.g by using 'lsscsi -H -t'
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
> 
> changes v2:
>   - place closing brace on new line, fix whitespace damage
> 
>  drivers/scsi/qedf/qedf_main.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
> index 9c24f3834d70..8fe8c3fdde1b 100644
> --- a/drivers/scsi/qedf/qedf_main.c
> +++ b/drivers/scsi/qedf/qedf_main.c
> @@ -1926,6 +1926,13 @@ static int qedf_fcoe_reset(struct Scsi_Host *shost)
>  	return 0;
>  }
> 
> +static void qedf_get_host_port_id(struct Scsi_Host *shost)
> +{
> +	struct fc_lport *lport = shost_priv(shost);
> +
> +	fc_host_port_id(shost) = lport->port_id;
> +}
> +
>  static struct fc_host_statistics *qedf_fc_get_host_stats(struct Scsi_Host
>  	*shost)
>  {
> @@ -1996,6 +2003,7 @@ static struct fc_function_template
> qedf_fc_transport_fn = {
>  	.show_host_active_fc4s = 1,
>  	.show_host_maxframe_size = 1,
> 
> +	.get_host_port_id = qedf_get_host_port_id,
>  	.show_host_port_id = 1,
>  	.show_host_supported_speeds = 1,
>  	.get_host_speed = fc_get_host_speed,
> --
> 2.16.4

Thanks for the patch.

Acked-by: Saurav Kashyap <skashyap@marvell.com>


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

* RE: [EXT] Re: [PATCH] scsi: qedf: Add port_id getter
  2019-09-24  7:23     ` Daniel Wagner
@ 2019-09-24  9:10       ` Saurav Kashyap
  0 siblings, 0 replies; 9+ messages in thread
From: Saurav Kashyap @ 2019-09-24  9:10 UTC (permalink / raw)
  To: Daniel Wagner; +Cc: QLogic-Storage-Upstream, linux-scsi, linux-kernel

Hi Daniel,

> -----Original Message-----
> From: Daniel Wagner <dwagner@suse.de>
> Sent: Tuesday, September 24, 2019 12:54 PM
> To: Saurav Kashyap <skashyap@marvell.com>
> Cc: QLogic-Storage-Upstream@cavium.com; linux-scsi@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: [EXT] Re: [PATCH] scsi: qedf: Add port_id getter
> 
> External Email
> 
> ----------------------------------------------------------------------
> Hi Saurav,
> 
> On Tue, Sep 24, 2019 at 09:11:38AM +0200, Daniel Wagner wrote:
> > On Tue, Sep 24, 2019 at 06:08:09AM +0000, Saurav Kashyap wrote:
> > > > +static void qedf_get_host_port_id(struct Scsi_Host *shost) {
> > > > +	struct fc_lport *lport = shost_priv(shost);
> > > > +
> > > > +	fc_host_port_id(shost) = lport->port_id; }
> > >
> > > Minor stuff, the closing brace should be in next line. Please submit v2.
> >
> > Oops, sorry about that.
> 
> The patch I sent out had the closing brace on a new
> line:
> 
> https://lore.kernel.org/linux-scsi/20190923103738.67749-1-dwagner@suse.de/
> 
> Now I am a bit confused how I screwed it up. Anyway, I'll send it out
> again after with hexdump there is not a special ASCII character
> hidden :)

Sorry about that, I changed my email client and it remove the extra lines.

Thanks,
~Saurav
> 
> Thanks,
> Daniel

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

* Re: [PATCH v2] scsi: qedf: Add port_id getter
  2019-09-24  7:29   ` [PATCH v2] " Daniel Wagner
  2019-09-24  9:06     ` Saurav Kashyap
@ 2019-09-24 12:03     ` Hannes Reinecke
  2019-10-01  3:05     ` Martin K. Petersen
  2 siblings, 0 replies; 9+ messages in thread
From: Hannes Reinecke @ 2019-09-24 12:03 UTC (permalink / raw)
  To: Daniel Wagner, QLogic-Storage-Upstream; +Cc: linux-scsi, linux-kernel

On 9/24/19 9:29 AM, Daniel Wagner wrote:
> Add qedf_get_host_port_id() to the transport template.
> 
> The fc_transport_template initializes the port_id member to the
> default value of -1. The new getter ensures that the sysfs entry shows
> the current value and not the default one, e.g by using 'lsscsi -H -t'
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
> 
> changes v2:
>   - place closing brace on new line, fix whitespace damage
> 
>  drivers/scsi/qedf/qedf_main.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
> index 9c24f3834d70..8fe8c3fdde1b 100644
> --- a/drivers/scsi/qedf/qedf_main.c
> +++ b/drivers/scsi/qedf/qedf_main.c
> @@ -1926,6 +1926,13 @@ static int qedf_fcoe_reset(struct Scsi_Host *shost)
>  	return 0;
>  }
>  
> +static void qedf_get_host_port_id(struct Scsi_Host *shost)
> +{
> +	struct fc_lport *lport = shost_priv(shost);
> +
> +	fc_host_port_id(shost) = lport->port_id;
> +}
> +
>  static struct fc_host_statistics *qedf_fc_get_host_stats(struct Scsi_Host
>  	*shost)
>  {
> @@ -1996,6 +2003,7 @@ static struct fc_function_template qedf_fc_transport_fn = {
>  	.show_host_active_fc4s = 1,
>  	.show_host_maxframe_size = 1,
>  
> +	.get_host_port_id = qedf_get_host_port_id,
>  	.show_host_port_id = 1,
>  	.show_host_supported_speeds = 1,
>  	.get_host_speed = fc_get_host_speed,
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      Teamlead Storage & Networking
hare@suse.de			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 247165 (AG München), GF: Felix Imendörffer

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

* Re: [PATCH v2] scsi: qedf: Add port_id getter
  2019-09-24  7:29   ` [PATCH v2] " Daniel Wagner
  2019-09-24  9:06     ` Saurav Kashyap
  2019-09-24 12:03     ` Hannes Reinecke
@ 2019-10-01  3:05     ` Martin K. Petersen
  2 siblings, 0 replies; 9+ messages in thread
From: Martin K. Petersen @ 2019-10-01  3:05 UTC (permalink / raw)
  To: Daniel Wagner; +Cc: QLogic-Storage-Upstream, linux-scsi, linux-kernel


Daniel,

> Add qedf_get_host_port_id() to the transport template.
>
> The fc_transport_template initializes the port_id member to the
> default value of -1. The new getter ensures that the sysfs entry shows
> the current value and not the default one, e.g by using 'lsscsi -H -t'

Applied to 5.5/scsi-queue, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2019-10-01  3:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-23 10:37 [PATCH] scsi: qedf: Add port_id getter Daniel Wagner
2019-09-24  6:08 ` Saurav Kashyap
2019-09-24  7:11   ` Daniel Wagner
2019-09-24  7:23     ` Daniel Wagner
2019-09-24  9:10       ` [EXT] " Saurav Kashyap
2019-09-24  7:29   ` [PATCH v2] " Daniel Wagner
2019-09-24  9:06     ` Saurav Kashyap
2019-09-24 12:03     ` Hannes Reinecke
2019-10-01  3:05     ` Martin K. Petersen

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