ibmvnic: fix firmware version when no firmware level has been provided by the VIOS server
PATCH 1/1 ibmvnic: fix firmware version when no firmware level has been provided by the VIOS server
Older versions of VIOS servers do not send the firmware level in the VPD buffer for the ibmvnic driver. Thus, not only the current message is mis- leading but the firmware version in the ethtool will be NULL. Therefore, this patch fixes the firmware string and its warning.
--- drivers/net/ethernet/ibm/ibmvnic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/ibm/ibmvnic.c +5 -1
@@ -3290,7 +3290,11 @@ static void handle_vpd_rsp(union ibmvnic_crq *crq,*/ substr =strnstr (adapter->vpd->buff,"RM" , adapter->vpd->len);if (!substr) { -dev_info (dev,"No FW level provided by VPD\n" ); +dev_info (dev,"Warning - No FW level has been provided in the VPD buffer by the VIOS Server\n" ); + ptr =strncpy ((char *)adapter->fw_version,"N/A" , +3 *sizeof (char )); +if (!ptr) +dev_err (dev,"Failed to inform that firmware version is unavailable to the adapter\n" ); goto complete; }
Signature · 1 line
2.14.3
From: Desnes Augusto Nunes do Rosario <[email protected]>
Date: Thu, 1 Feb 2018 16:04:30 -0200
Quoted 8 lines
Older versions of VIOS servers do not send the firmware level in the VPD buffer for the ibmvnic driver. Thus, not only the current message is mis- leading but the firmware version in the ethtool will be NULL. Therefore, this patch fixes the firmware string and its warning.
Fixes 4e6759be28e4 ("ibmvnic: Feature implementation of VPD for the ibmvnic driver")Signed-off-by Desnes A. Nunes do Rosario <[email protected]>
Applied.
Please do not put empty lines between Fixes: and Signed-off-by: and other tags, all tags are equal and are placed together in an uninterrupted sequences of consequetive lines.
Thank you.
Hello David,
Thank you for your review and the heads up about protocol.
Quoted 20 lines · David Miller
From: Desnes Augusto Nunes do Rosario <[email protected]>
Date: Thu, 1 Feb 2018 16:04:30 -0200Quoted 8 lines
Older versions of VIOS servers do not send the firmware level in the VPD buffer for the ibmvnic driver. Thus, not only the current message is mis- leading but the firmware version in the ethtool will be NULL. Therefore, this patch fixes the firmware string and its warning.
Fixes 4e6759be28e4 ("ibmvnic: Feature implementation of VPD for the ibmvnic driver")Signed-off-by Desnes A. Nunes do Rosario <[email protected]>Applied.
Please do not put empty lines between Fixes: and Signed-off-by: and other tags, all tags are equal and are placed together in an uninterrupted sequences of consequetive lines.
Thank you.
Signature · 5 lines
Desnes Augusto Nunes do Rosário ------------------------------------------ Linux Developer - IBM / Brazil M.Sc. in Electrical and Computer Engineering - UFRN
Quoted 17 lines · Desnes Augusto Nunes do Rosario
Older versions of VIOS servers do not send the firmware level in the VPD buffer for the ibmvnic driver. Thus, not only the current message is mis- leading but the firmware version in the ethtool will be NULL. Therefore, this patch fixes the firmware string and its warning.
Fixes 4e6759be28e4 ("ibmvnic: Feature implementation of VPD for the ibmvnic driver")Signed-off-by Desnes A. Nunes do Rosario <[email protected]>--- drivers/net/ethernet/ibm/ibmvnic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/net/ethernet/ibm/ibmvnic.c +0
-0
drivers/net/ethernet/ibm/ibmvnic.c static void handle_vpd_rsp(union ibmvnic_crq *crq, · line 3294
Quoted 6 lines
drivers/net/ethernet/ibm/ibmvnic.c +2
-1@@ -3290,7 +3290,11 @@ static void handle_vpd_rsp(union ibmvnic_crq *crq,*/ substr =strnstr (adapter->vpd->buff,"RM" , adapter->vpd->len);if (!substr) { -dev_info (dev,"No FW level provided by VPD\n" ); +dev_info (dev,"Warning - No FW level has been provided in the VPD buffer by the VIOS Server\n" ); + ptr = strncpy((char *)adapter->fw_version, "N/A",
Is "N/A" the right thing to report? Would something like "Unknown" or "Unreported" be better?
drivers/net/ethernet/ibm/ibmvnic.c static void handle_vpd_rsp(union ibmvnic_crq *crq, · line 3297
Quoted 3 lines
drivers/net/ethernet/ibm/ibmvnic.c +3
-0+ 3 * sizeof(char)); +if (!ptr) +dev_err (dev,"Failed to inform that firmware version is unavailable to the adapter\n" );
The sentence structure here seems awkward. I would probably just get rid of this error and this one later in the function.
dev_err(dev, "Failed to isolate FW level string\n");
Instead just check and report if adapter->fw_version == NULL in the complete: label section.
-Tyrel
Quoted 3 lines
drivers/net/ethernet/ibm/ibmvnic.c +0
-0goto complete; }
Hello Tyrel,
I concur with your observations, but since this patch has already been merged, I'll address them in another patch.
Thank you for your review,
Quoted 43 lines · Tyrel Datwyler
Quoted 17 lines · Desnes Augusto Nunes do Rosario
Older versions of VIOS servers do not send the firmware level in the VPD buffer for the ibmvnic driver. Thus, not only the current message is mis- leading but the firmware version in the ethtool will be NULL. Therefore, this patch fixes the firmware string and its warning.
Fixes 4e6759be28e4 ("ibmvnic: Feature implementation of VPD for the ibmvnic driver")Signed-off-by Desnes A. Nunes do Rosario <[email protected]>--- drivers/net/ethernet/ibm/ibmvnic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/net/ethernet/ibm/ibmvnic.c +0
-0drivers/net/ethernet/ibm/ibmvnic.c static void handle_vpd_rsp(union ibmvnic_crq *crq, · line 3294
Quoted 6 lines
drivers/net/ethernet/ibm/ibmvnic.c +2
-1@@ -3290,7 +3290,11 @@ static void handle_vpd_rsp(union ibmvnic_crq *crq,*/ substr =strnstr (adapter->vpd->buff,"RM" , adapter->vpd->len);if (!substr) { -dev_info (dev,"No FW level provided by VPD\n" ); +dev_info (dev,"Warning - No FW level has been provided in the VPD buffer by the VIOS Server\n" ); + ptr = strncpy((char *)adapter->fw_version, "N/A",Is "N/A" the right thing to report? Would something like "Unknown" or "Unreported" be better?
drivers/net/ethernet/ibm/ibmvnic.c static void handle_vpd_rsp(union ibmvnic_crq *crq, · line 3297
Quoted 3 lines
drivers/net/ethernet/ibm/ibmvnic.c +3
-0+ 3 * sizeof(char)); +if (!ptr) +dev_err (dev,"Failed to inform that firmware version is unavailable to the adapter\n" );The sentence structure here seems awkward. I would probably just get rid of this error and this one later in the function.
dev_err(dev, "Failed to isolate FW level string\n");Instead just check and report if
adapter->fw_version== NULL in the complete: label section.-Tyrel
Quoted 3 lines
drivers/net/ethernet/ibm/ibmvnic.c +0
-0goto complete; }
Signature · 5 lines
Desnes Augusto Nunes do Rosário ------------------------------------------ Linux Developer - IBM / Brazil M.Sc. in Electrical and Computer Engineering - UFRN
Quoted 3 lines · Desnes Augusto Nunes do Rosário
Hello Tyrel,
I concur with your observations, but since this patch has already been merged, I'll address them in another patch.
Fair enough. I didn't realize David had already merged it till after I sent my review.
-Tyrel
Quoted 48 lines
Thank you for your review,
Quoted 43 lines · Tyrel Datwyler
Quoted 17 lines · Desnes Augusto Nunes do Rosario
Older versions of VIOS servers do not send the firmware level in the VPD buffer for the ibmvnic driver. Thus, not only the current message is mis- leading but the firmware version in the ethtool will be NULL. Therefore, this patch fixes the firmware string and its warning.
Fixes 4e6759be28e4 ("ibmvnic: Feature implementation of VPD for the ibmvnic driver")Signed-off-by Desnes A. Nunes do Rosario <[email protected]>---
drivers/net/ethernet/ibm/ibmvnic.c| 6 +++++-1 file changed, 5 insertions(+), 1 deletion(-)drivers/net/ethernet/ibm/ibmvnic.c +0
-0drivers/net/ethernet/ibm/ibmvnic.c static void handle_vpd_rsp(union ibmvnic_crq *crq, · line 3294
Quoted 6 lines
drivers/net/ethernet/ibm/ibmvnic.c +2
-1@@ -3290,7 +3290,11 @@ static void handle_vpd_rsp(union ibmvnic_crq *crq,*/ substr = strnstr(adapter->vpd->buff, "RM", adapter->vpd->len); if (!substr) { - dev_info(dev, "No FW level provided by VPD\n"); + dev_info(dev, "Warning - No FW level has been provided in the VPD buffer by the VIOS Server\n"); + ptr = strncpy((char *)adapter->fw_version, "N/A",Is "N/A" the right thing to report? Would something like "Unknown" or "Unreported" be better?
drivers/net/ethernet/ibm/ibmvnic.c static void handle_vpd_rsp(union ibmvnic_crq *crq, · line 3297
Quoted 3 lines
drivers/net/ethernet/ibm/ibmvnic.c +3
-0+ 3 * sizeof(char)); + if (!ptr) + dev_err(dev, "Failed to inform that firmware version is unavailable to the adapter\n");The sentence structure here seems awkward. I would probably just get rid of this error and this one later in the function.
dev_err(dev, "Failed to isolate FW level string\n");
Instead just check and report if
adapter->fw_version== NULL in the complete: label section.-Tyrel
Quoted 3 lines
drivers/net/ethernet/ibm/ibmvnic.c +0
-0goto complete; }