* [PATCH net-next 0/2] add callback
@ 2026-08-14 9:10 Vikas Gupta
2026-08-14 9:10 ` [PATCH net-next 1/2] bng_re: add support for the shutdown callback Vikas Gupta
2026-08-14 9:10 ` [PATCH net-next 2/2] bnge: add steps in bnge_shutdown() Vikas Gupta
0 siblings, 2 replies; 3+ messages in thread
From: Vikas Gupta @ 2026-08-14 9:10 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, andrew+netdev, horms
Cc: netdev, linux-kernel, linux-rdma, leonro, jgg, bhargava.marreddy,
rahul-rg.gupta, vsrama-krishna.nemani, rajashekar.hudumula,
ajit.khaparde, siva.kallam, usman.ansari, Vikas Gupta
Hi,
This series introduces support for the PCI shutdown callback. Patch 1
implements it in the bng_re (RoCE) driver and patch 2 in the bnge
driver.
Thanks,
Vikas
Usman S. Ansari (1):
bng_re: add support for the shutdown callback
Vikas Gupta (1):
bnge: add steps in bnge_shutdown()
drivers/infiniband/hw/bng_re/bng_dev.c | 6 +++++
.../net/ethernet/broadcom/bnge/bnge_core.c | 24 +++++++++++++++++++
2 files changed, 30 insertions(+)
--
2.47.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH net-next 1/2] bng_re: add support for the shutdown callback
2026-08-14 9:10 [PATCH net-next 0/2] add callback Vikas Gupta
@ 2026-08-14 9:10 ` Vikas Gupta
2026-08-14 9:10 ` [PATCH net-next 2/2] bnge: add steps in bnge_shutdown() Vikas Gupta
1 sibling, 0 replies; 3+ messages in thread
From: Vikas Gupta @ 2026-08-14 9:10 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, andrew+netdev, horms
Cc: netdev, linux-kernel, linux-rdma, leonro, jgg, bhargava.marreddy,
rahul-rg.gupta, vsrama-krishna.nemani, rajashekar.hudumula,
ajit.khaparde, siva.kallam, usman.ansari, Vikas Gupta
From: "Usman S. Ansari" <usman.ansari@broadcom.com>
At present it calls bng_re_remove(), which adequately handles device
teardown on shutdown. Appropriate shutdown-specific handling will be
introduced in the future.
Signed-off-by: Usman S. Ansari <usman.ansari@broadcom.com>
Reviewed-by: Siva Reddy Kallam <siva.kallam@broadcom.com>
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
---
drivers/infiniband/hw/bng_re/bng_dev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/infiniband/hw/bng_re/bng_dev.c b/drivers/infiniband/hw/bng_re/bng_dev.c
index 311c8bc93160..42b473919d09 100644
--- a/drivers/infiniband/hw/bng_re/bng_dev.c
+++ b/drivers/infiniband/hw/bng_re/bng_dev.c
@@ -477,6 +477,11 @@ static void bng_re_remove(struct auxiliary_device *adev)
kfree(dev_info);
}
+static void bng_re_shutdown(struct auxiliary_device *adev)
+{
+ bng_re_remove(adev);
+}
+
static const struct auxiliary_device_id bng_re_id_table[] = {
{ .name = BNG_RE_ADEV_NAME ".rdma", },
{},
@@ -488,6 +493,7 @@ static struct auxiliary_driver bng_re_driver = {
.name = "rdma",
.probe = bng_re_probe,
.remove = bng_re_remove,
+ .shutdown = bng_re_shutdown,
.id_table = bng_re_id_table,
};
--
2.47.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH net-next 2/2] bnge: add steps in bnge_shutdown()
2026-08-14 9:10 [PATCH net-next 0/2] add callback Vikas Gupta
2026-08-14 9:10 ` [PATCH net-next 1/2] bng_re: add support for the shutdown callback Vikas Gupta
@ 2026-08-14 9:10 ` Vikas Gupta
1 sibling, 0 replies; 3+ messages in thread
From: Vikas Gupta @ 2026-08-14 9:10 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, andrew+netdev, horms
Cc: netdev, linux-kernel, linux-rdma, leonro, jgg, bhargava.marreddy,
rahul-rg.gupta, vsrama-krishna.nemani, rajashekar.hudumula,
ajit.khaparde, siva.kallam, usman.ansari, Vikas Gupta,
Dharmender Garg
Since the driver now implements ndo_open and ndo_close with full link
management, the shutdown callback must mirror the close sequence to
ensure the device is brought down cleanly.
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Reviewed-by: Dharmender Garg <dharmender.garg@broadcom.com>
Reviewed-by: Rahul Gupta <rahul-rg.gupta@broadcom.com>
---
.../net/ethernet/broadcom/bnge/bnge_core.c | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_core.c b/drivers/net/ethernet/broadcom/bnge/bnge_core.c
index 68b74eb2c3a2..9846d29b4fe3 100644
--- a/drivers/net/ethernet/broadcom/bnge/bnge_core.c
+++ b/drivers/net/ethernet/broadcom/bnge/bnge_core.c
@@ -5,12 +5,14 @@
#include <linux/crash_dump.h>
#include <linux/module.h>
#include <linux/pci.h>
+#include <linux/rtnetlink.h>
#include "bnge.h"
#include "bnge_devlink.h"
#include "bnge_hwrm.h"
#include "bnge_hwrm_lib.h"
#include "bnge_link.h"
+#include "bnge_resc.h"
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION(DRV_SUMMARY);
@@ -406,12 +408,34 @@ static void bnge_remove_one(struct pci_dev *pdev)
static void bnge_shutdown(struct pci_dev *pdev)
{
+ struct bnge_dev *bd = pci_get_drvdata(pdev);
+ struct net_device *dev;
+
+ dev = bd ? bd->netdev : NULL;
+ if (!dev)
+ return;
+
+ rtnl_lock();
+ netdev_lock(dev);
+
+ if (netif_running(dev))
+ netif_close(dev);
+
+ if (bnge_hwrm_func_drv_unrgtr(bd)) {
+ pcie_flr(pdev);
+ goto shutdown_exit;
+ }
+ bnge_free_irqs(bd);
pci_disable_device(pdev);
if (system_state == SYSTEM_POWER_OFF) {
pci_wake_from_d3(pdev, 0);
pci_set_power_state(pdev, PCI_D3hot);
}
+
+shutdown_exit:
+ netdev_unlock(dev);
+ rtnl_unlock();
}
static struct pci_driver bnge_driver = {
--
2.47.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-14 9:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14 9:10 [PATCH net-next 0/2] add callback Vikas Gupta
2026-08-14 9:10 ` [PATCH net-next 1/2] bng_re: add support for the shutdown callback Vikas Gupta
2026-08-14 9:10 ` [PATCH net-next 2/2] bnge: add steps in bnge_shutdown() Vikas Gupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox