Skip to contentSkip to conversation

qedf: Populate sysfs attributes for vport

PATCH Superseded Nilesh Javali 3 participants 3 messages Sep 12, 2022 – Sep 16, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qedf: Populate sysfs attributes for vport

From: Saurav Kashyap <[email protected]>

Copy speed, supported_speed, frame_size and update port_type for NPIV port.

---
 drivers/scsi/qedf/qedf_main.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/scsi/qedf/qedf_main.c +21 -0
index 3d6b137314f3..cc6d9decf62c 100644
@@ -1921,6 +1921,27 @@ static int qedf_vport_create(struct fc_vport *vport, bool disabled)
 		fc_vport_setlink(vn_port);
 	}
 
+	/* Set symbolic node name */
+	if (base_qedf->pdev->device == QL45xxx)
+		snprintf(fc_host_symbolic_name(vn_port->host), 256,
+			 "Marvell FastLinQ 45xxx FCoE v%s", QEDF_VERSION);
+
+	if (base_qedf->pdev->device == QL41xxx)
+		snprintf(fc_host_symbolic_name(vn_port->host), 256,
+			 "Marvell FastLinQ 41xxx FCoE v%s", QEDF_VERSION);
+
+	/* Set supported speed */
+	fc_host_supported_speeds(vn_port->host) = n_port->link_supported_speeds;
+
+	/* Set speed */
+	vn_port->link_speed = n_port->link_speed;
+
+	/* Set port type */
+	fc_host_port_type(vn_port->host) = FC_PORTTYPE_NPIV;
+
+	/* Set maxframe size */
+	fc_host_maxframe_size(vn_port->host) = n_port->mfs;
+
 	QEDF_INFO(&(base_qedf->dbg_ctx), QEDF_LOG_NPIV, "vn_port=%p.\n",
 		   vn_port);
 
Signature · 1 line
2.23.1
Tested-by Guangwu Zhang Reviewed-by on v1 1/1
#1 lore raw

This patch addresses a day one bug found by a Red Hat QA Test.

This patch has been applied to RHEL test build
and proven to resolve the bug.

Quoted 42 lines · Nilesh Javali

From: Saurav Kashyap <[email protected]>

Copy speed, supported_speed, frame_size and update port_type for NPIV port.

---
  drivers/scsi/qedf/qedf_main.c | 21 +++++++++++++++++++++
  1 file changed, 21 insertions(+)
drivers/scsi/qedf/qedf_main.c +21 -0
index 3d6b137314f3..cc6d9decf62c 100644
@@ -1921,6 +1921,27 @@ static int qedf_vport_create(struct fc_vport *vport, bool disabled)
  		fc_vport_setlink(vn_port);
  	}
 
+	/* Set symbolic node name */
+	if (base_qedf->pdev->device == QL45xxx)
+		snprintf(fc_host_symbolic_name(vn_port->host), 256,
+			 "Marvell FastLinQ 45xxx FCoE v%s", QEDF_VERSION);
+
+	if (base_qedf->pdev->device == QL41xxx)
+		snprintf(fc_host_symbolic_name(vn_port->host), 256,
+			 "Marvell FastLinQ 41xxx FCoE v%s", QEDF_VERSION);
+
+	/* Set supported speed */
+	fc_host_supported_speeds(vn_port->host) = n_port->link_supported_speeds;
+
+	/* Set speed */
+	vn_port->link_speed = n_port->link_speed;
+
+	/* Set port type */
+	fc_host_port_type(vn_port->host) = FC_PORTTYPE_NPIV;
+
+	/* Set maxframe size */
+	fc_host_maxframe_size(vn_port->host) = n_port->mfs;
+
  	QEDF_INFO(&(base_qedf->dbg_ctx), QEDF_LOG_NPIV, "vn_port=%p.\n",
  		   vn_port);
 
#2 lore raw
In reply to Nilesh Javali

Nilesh,

Quoted 2 lines

Copy speed, supported_speed, frame_size and update port_type for NPIV port.

The commit description should explain why this change is needed.

Thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering