Skip to contentSkip to conversation

scsi: qedf: Add port_id getter

PATCH Superseded Daniel Wagner 4 participants 9 messages Sep 23, 2019 – Oct 1, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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'

---
 drivers/scsi/qedf/qedf_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/scsi/qedf/qedf_main.c +8 -0
index 9c24f3834d70..8fe8c3fdde1b 100644
@@ -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,
Signature · 1 line
2.16.4
maintainer
#1 lore raw
Quoted 26 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Daniel Wagner
Sent: Monday, September 23, 2019 4:08 PM
To: [email protected]
Cc: [email protected]; [email protected]; Daniel Wagner <[email protected]>
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'

---
 drivers/scsi/qedf/qedf_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/scsi/qedf/qedf_main.c index renamed from drivers/scsi/qedf/qedf_main.c +0 -0

9c24f3834d70..8fe8c3fdde1b 100644

drivers/scsi/qedf/qedf_main.c static int qedf_fcoe_reset(struct Scsi_Host *shost) · line 1932

Quoted 7 lines
drivers/scsi/qedf/qedf_main.c +4 -0
@@ -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

Quoted 15 lines
drivers/scsi/qedf/qedf_main.c +2 -0
+
 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

#2 lore raw
Quoted 6 lines · Saurav Kashyap

drivers/scsi/qedf/qedf_main.c static int qedf_fcoe_reset(struct Scsi_Host *shost)

Quoted 4 lines
drivers/scsi/qedf/qedf_main.c +4 -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.

Oops, sorry about that.

Thanks
Daniel

#3 lore raw

Hi Saurav,

Quoted 9 lines · Daniel Wagner
Quoted 6 lines · Saurav Kashyap

drivers/scsi/qedf/qedf_main.c static int qedf_fcoe_reset(struct Scsi_Host *shost)

Quoted 4 lines
drivers/scsi/qedf/qedf_main.c +4 -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.

Oops, sorry about that.

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

https://lore.kernel.org/linux-scsi/[email protected]/

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

maintainer
#4 lore raw

Hi Daniel,

Quoted 24 lines

-----Original Message-----
From: Daniel Wagner <[email protected]>
Sent: Tuesday, September 24, 2019 12:54 PM
To: Saurav Kashyap <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]
Subject: [EXT] Re: [PATCH] scsi: qedf: Add port_id getter

External Email

----------------------------------------------------------------------
Hi Saurav,

Quoted 9 lines · Daniel Wagner
Quoted 6 lines · Saurav Kashyap

drivers/scsi/qedf/qedf_main.c static int qedf_fcoe_reset(struct Scsi_Host *shost)

Quoted 4 lines
drivers/scsi/qedf/qedf_main.c +4 -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.

Oops, sorry about that.

Quoted 8 lines

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

https://lore.kernel.org/linux-scsi/[email protected]/

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

Quoted 3 lines

Thanks,
Daniel

#5 lore raw

PATCH v2 1/1 scsi: qedf: Add port_id getter

In reply to Saurav Kashyap

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'

---

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

 drivers/scsi/qedf/qedf_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/scsi/qedf/qedf_main.c +8 -0
index 9c24f3834d70..8fe8c3fdde1b 100644
@@ -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,
Signature · 1 line
2.16.4
maintainer Acked-by on v2 1/1
#6 lore raw
Quoted 52 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Daniel Wagner
Sent: Tuesday, September 24, 2019 12:59 PM
To: [email protected]
Cc: [email protected]; [email protected]; Daniel Wagner <[email protected]>
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'

---

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

 drivers/scsi/qedf/qedf_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/scsi/qedf/qedf_main.c +8 -0
index 9c24f3834d70..8fe8c3fdde1b 100644
@@ -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,
Quoted 3 lines

.get_host_speed = fc_get_host_speed,
--
2.16.4

Thanks for the patch.

Reviewed-by on v2 1/1
#7 lore raw
In reply to Daniel Wagner
Quoted 35 lines · 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'

---

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

 drivers/scsi/qedf/qedf_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/scsi/qedf/qedf_main.c +7 -0
index 9c24f3834d70..8fe8c3fdde1b 100644
@@ -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)
 {

drivers/scsi/qedf/qedf_main.c static struct fc_function_template qedf_fc_transport_fn = { · line 2009

Quoted 7 lines
drivers/scsi/qedf/qedf_main.c +1 -0
@@ -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,

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke		      Teamlead Storage & Networking
[email protected]			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 247165 (AG München), GF: Felix Imendörffer
#8 lore raw
In reply to Daniel Wagner

Daniel,

Quoted 5 lines

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!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering