diff mbox

[v3,10/20] lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command

Message ID 55242ae6.b7GjnkXu1bXVHKz1%james.smart@emulex.com (mailing list archive)
State New, archived
Headers show

Commit Message

James Smart April 7, 2015, 7:07 p.m. UTC
Fix provide host name and OS name in RSNN-NN FC-GS command

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
---
 drivers/scsi/lpfc/lpfc_ct.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

Comments

Sebastian Herbszt April 14, 2015, 10:02 p.m. UTC | #1
James Smart wrote:
> 
> Fix provide host name and OS name in RSNN-NN FC-GS command
> 
> Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
> Signed-off-by: James Smart <james.smart@emulex.com>
> ---
>  drivers/scsi/lpfc/lpfc_ct.c | 21 +++++++++++++++++++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
> index 61a32cd..5fb431a 100644
> --- a/drivers/scsi/lpfc/lpfc_ct.c
> +++ b/drivers/scsi/lpfc/lpfc_ct.c
> @@ -1074,8 +1074,25 @@ lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol,
>  
>  	lpfc_decode_firmware_rev(vport->phba, fwrev, 0);
>  
> -	n = snprintf(symbol, size, "Emulex %s FV%s DV%s",
> -		vport->phba->ModelName, fwrev, lpfc_release_version);
> +	n = snprintf(symbol, size, "Emulex %s", vport->phba->ModelName);
> +
> +	if (size < n)
> +		return n;
> +	n += snprintf(symbol + n, size - n, " FV%s", fwrev);
> +
> +	if (size < n)
> +		return n;
> +	n += snprintf(symbol + n, size - n, " DV%s", lpfc_release_version);
> +
> +	if (size < n)
> +		return n;
> +	n += snprintf(symbol + n, size - n, " HN:%s", init_utsname()->nodename);
> +
> +	/* Note :- OS name is "Linux" */
> +	if (size < n)
> +		return n;
> +	n += snprintf(symbol + n, size - n, " OS:%s", init_utsname()->sysname);
> +
>  	return n;
>  }

Does this actually "fix" anything? If not maybe drop "fix" from the
patch subject and description.

Sebastian
--
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
James Smart April 18, 2015, 3:40 p.m. UTC | #2
Fixes those things that parse the result of what data is registered with 
the fabric.

-- james


On 4/14/2015 6:02 PM, Sebastian Herbszt wrote:
> James Smart wrote:
>> Fix provide host name and OS name in RSNN-NN FC-GS command
>>
>> Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
>> Signed-off-by: James Smart <james.smart@emulex.com>
>> ---
>>   drivers/scsi/lpfc/lpfc_ct.c | 21 +++++++++++++++++++--
>>   1 file changed, 19 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
>> index 61a32cd..5fb431a 100644
>> --- a/drivers/scsi/lpfc/lpfc_ct.c
>> +++ b/drivers/scsi/lpfc/lpfc_ct.c
>> @@ -1074,8 +1074,25 @@ lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol,
>>   
>>   	lpfc_decode_firmware_rev(vport->phba, fwrev, 0);
>>   
>> -	n = snprintf(symbol, size, "Emulex %s FV%s DV%s",
>> -		vport->phba->ModelName, fwrev, lpfc_release_version);
>> +	n = snprintf(symbol, size, "Emulex %s", vport->phba->ModelName);
>> +
>> +	if (size < n)
>> +		return n;
>> +	n += snprintf(symbol + n, size - n, " FV%s", fwrev);
>> +
>> +	if (size < n)
>> +		return n;
>> +	n += snprintf(symbol + n, size - n, " DV%s", lpfc_release_version);
>> +
>> +	if (size < n)
>> +		return n;
>> +	n += snprintf(symbol + n, size - n, " HN:%s", init_utsname()->nodename);
>> +
>> +	/* Note :- OS name is "Linux" */
>> +	if (size < n)
>> +		return n;
>> +	n += snprintf(symbol + n, size - n, " OS:%s", init_utsname()->sysname);
>> +
>>   	return n;
>>   }
> Does this actually "fix" anything? If not maybe drop "fix" from the
> patch subject and description.
>
> Sebastian
>
>

--
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
Sebastian Herbszt April 21, 2015, 11:15 p.m. UTC | #3
James Smart wrote:
> Fixes those things that parse the result of what data is registered with 
> the fabric.
> 
> -- james

Any particular "thing" you got on your mind?
qla2xxx does not provide this information (yet).

Sebastian
--
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
James Smart April 22, 2015, 12:40 a.m. UTC | #4
Primarily emulex applications that display san connectivity.  There are also some Switch mgmt suites that at least display this information. Not sure how much they act on it.

-- james s
diff mbox

Patch

diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index 61a32cd..5fb431a 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -1074,8 +1074,25 @@  lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol,
 
 	lpfc_decode_firmware_rev(vport->phba, fwrev, 0);
 
-	n = snprintf(symbol, size, "Emulex %s FV%s DV%s",
-		vport->phba->ModelName, fwrev, lpfc_release_version);
+	n = snprintf(symbol, size, "Emulex %s", vport->phba->ModelName);
+
+	if (size < n)
+		return n;
+	n += snprintf(symbol + n, size - n, " FV%s", fwrev);
+
+	if (size < n)
+		return n;
+	n += snprintf(symbol + n, size - n, " DV%s", lpfc_release_version);
+
+	if (size < n)
+		return n;
+	n += snprintf(symbol + n, size - n, " HN:%s", init_utsname()->nodename);
+
+	/* Note :- OS name is "Linux" */
+	if (size < n)
+		return n;
+	n += snprintf(symbol + n, size - n, " OS:%s", init_utsname()->sysname);
+
 	return n;
 }