[RFC PATCH 1/1] mlx4: trigger IB events needed by SMC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The mlx4 driver does not trigger an IB_EVENT_PORT_ACTIVE when the
RoCE network interface is activated. When SMC determines the RoCE
device port to be used, it checks the port states.
This patch triggers IB events for NETDEV_UP and NETDEV_DOWN.

Signed-off-by: Ursula Braun <ubraun@xxxxxxxxxxxxx>
---
 drivers/infiniband/hw/mlx4/main.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 4ec519afc45b..81a1fd9e8615 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -2447,6 +2447,26 @@ static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev,
 		     event == NETDEV_UP || event == NETDEV_CHANGE))
 			update_qps_port = port;
 
+		if (dev == iboe->netdevs[port - 1] &&
+		    event == NETDEV_UP) {
+			struct ib_event ibev = { };
+
+			ibev.device = &ibdev->ib_dev;
+			ibev.element.port_num = port;
+			ibev.event = IB_EVENT_PORT_ACTIVE;
+			ib_dispatch_event(&ibev);
+		}
+
+		if (dev == iboe->netdevs[port - 1] &&
+		    event == NETDEV_DOWN) {
+			struct ib_event ibev = { };
+
+			ibev.device = &ibdev->ib_dev;
+			ibev.element.port_num = port;
+			ibev.event = IB_EVENT_PORT_ERR;
+			ib_dispatch_event(&ibev);
+		}
+
 	}
 	spin_unlock_bh(&iboe->lock);
 
-- 
2.16.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux