From: Nikita Kiryushin <kiryushin@ancud.ru>
To: Sudarsana Kalluru <skalluru@marvell.com>
Cc: Nikita Kiryushin <kiryushin@ancud.ru>,
Manish Chopra <manishc@marvell.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
lvc-project@linuxtesting.org
Subject: [PATCH net-next] bnx2x: turn off FCoE if storage MAC-address setup failed
Date: Fri, 12 Jul 2024 16:29:15 +0300 [thread overview]
Message-ID: <20240712132915.54710-1-kiryushin@ancud.ru> (raw)
As of now, initial storage MAC setup (in bnx2x_init_one) is not checked.
This can lead to unexpected FCoE behavior (as address will be in unexpected
state) without notice.
Check dev_addr_add for storage MAC and if it failes produce error message
and turn off FCoE feature.
Signed-off-by: Nikita Kiryushin <kiryushin@ancud.ru>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 678829646cec..c5d5e85777d4 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -13988,8 +13988,12 @@ static int bnx2x_init_one(struct pci_dev *pdev,
if (!NO_FCOE(bp)) {
/* Add storage MAC address */
rtnl_lock();
- dev_addr_add(bp->dev, bp->fip_mac, NETDEV_HW_ADDR_T_SAN);
+ rc = dev_addr_add(bp->dev, bp->fip_mac, NETDEV_HW_ADDR_T_SAN);
rtnl_unlock();
+ if (rc) {
+ dev_err(&pdev->dev, "Cannot add storage MAC address\n");
+ bp->flags |= NO_FCOE_FLAG;
+ }
}
BNX2X_DEV_INFO(
"%s (%c%d) PCI-E found at mem %lx, IRQ %d, node addr %pM\n",
--
2.34.1
next reply other threads:[~2024-07-12 13:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-12 13:29 Nikita Kiryushin [this message]
2024-07-13 14:41 ` Andrew Lunn
2024-07-15 14:10 ` Nikita Kiryushin
2024-10-25 18:15 ` Nikita Kiryushin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240712132915.54710-1-kiryushin@ancud.ru \
--to=kiryushin@ancud.ru \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=manishc@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=skalluru@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®