* [PATCH net] bnx2x: Prevent false warning for lack of FC NPIV
@ 2016-03-15 17:52 Yuval Mintz
2016-03-18 23:23 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Yuval Mintz @ 2016-03-15 17:52 UTC (permalink / raw)
To: davem, netdev; +Cc: Ariel.Elior, linux-scsi, andrew.patterson, Yuval Mintz
Not all adapters have FC-NPIV configured. If bnx2fc is used with such an
adapter, driver would read irrelevant data from the the nvram and log
"FC-NPIV table with bad length..." In system logs.
Simply accept that reading '0' as the feature offset in nvram indicates
the feature isn't there and return.
Reported-by: Andrew Patterson <andrew.patterson@hpe.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
---
Hi Dave,
Please consider applying this to `net'.
Thanks,
Yuval
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 2bf9c87..32652ad 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -14814,6 +14814,10 @@ static int bnx2x_get_fc_npiv(struct net_device *dev,
}
offset = SHMEM2_RD(bp, fc_npiv_nvram_tbl_addr[BP_PORT(bp)]);
+ if (!offset) {
+ DP(BNX2X_MSG_MCP, "No FC-NPIV in NVRAM\n");
+ goto out;
+ }
DP(BNX2X_MSG_MCP, "Offset of FC-NPIV in NVRAM: %08x\n", offset);
/* Read the table contents from nvram */
--
1.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] bnx2x: Prevent false warning for lack of FC NPIV
2016-03-15 17:52 [PATCH net] bnx2x: Prevent false warning for lack of FC NPIV Yuval Mintz
@ 2016-03-18 23:23 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-03-18 23:23 UTC (permalink / raw)
To: Yuval.Mintz; +Cc: netdev, Ariel.Elior, linux-scsi, andrew.patterson
From: Yuval Mintz <Yuval.Mintz@qlogic.com>
Date: Tue, 15 Mar 2016 19:52:04 +0200
> Not all adapters have FC-NPIV configured. If bnx2fc is used with such an
> adapter, driver would read irrelevant data from the the nvram and log
> "FC-NPIV table with bad length..." In system logs.
>
> Simply accept that reading '0' as the feature offset in nvram indicates
> the feature isn't there and return.
>
> Reported-by: Andrew Patterson <andrew.patterson@hpe.com>
> Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-18 23:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-15 17:52 [PATCH net] bnx2x: Prevent false warning for lack of FC NPIV Yuval Mintz
2016-03-18 23:23 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).