Skip to contentSkip to conversation

add callback

PATCH NAK Vikas Gupta 2 participants 4 messages Aug 14

Subsystems (5)
lore
Share & tools
lore

Vikas Gupta

author maintainer
#0 lore raw

cover add callback

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(+)
Signature · 1 line
2.47.1
author maintainer
#1 lore raw

PATCH 1/2 bng_re: add support for the shutdown callback

From: "Usman S. Ansari" <[email protected]>

At present it calls bng_re_remove(), which adequately handles device teardown on shutdown. Appropriate shutdown-specific handling will be introduced in the future.

---
 drivers/infiniband/hw/bng_re/bng_dev.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/infiniband/hw/bng_re/bng_dev.c +6 -0
index 311c8bc93160..42b473919d09 100644
@@ -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,
 };
 
Signature · 1 line
2.47.1
author maintainer
#2 lore raw

PATCH 2/2 bnge: add steps in bnge_shutdown()

In reply to Vikas Gupta

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.

---
 .../net/ethernet/broadcom/bnge/bnge_core.c    | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
drivers/net/ethernet/broadcom/bnge/bnge_core.c +24 -0
index 68b74eb2c3a2..9846d29b4fe3 100644
@@ -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 = {
Signature · 1 line
2.47.1
Nacked-by on the v1 series NAK
#3 lore raw
In reply to Vikas Gupta
Quoted 10 lines · 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

bng_re driver.

The current situation is becoming unacceptable. We have been waiting for almost 8 months for proper user-space support, which is a mandatory requirement for RDMA drivers.

https://lore.kernel.org/linux-rdma/20260318161330.GH352386@unreal/
https://lore.kernel.org/linux-rdma/20260114115858.GA10680@unreal/

Broadcom doesn't leave me with no other option but to remove the driver.

Thanks

Quoted 12 lines

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(+)
Signature · 1 line
2.47.1