Commit 592642e6 authored by Saurav Kashyap's avatar Saurav Kashyap Committed by Martin K. Petersen
Browse files

scsi: qedf: Populate sysfs attributes for vport

Few vport parameters were displayed by systool as 'Unknown' or 'NULL'.
Copy speed, supported_speed, frame_size and update port_type for NPIV port.

Link: https://lore.kernel.org/r/20220919134434.3513-1-njavali@marvell.com


Cc: stable@vger.kernel.org
Tested-by: default avatarGuangwu Zhang <guazhang@redhat.com>
Reviewed-by: default avatarJohn Meneghini <jmeneghi@redhat.com>
Signed-off-by: default avatarSaurav Kashyap <skashyap@marvell.com>
Signed-off-by: default avatarNilesh Javali <njavali@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent fd2f0452
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -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);