summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOr Har-Toov <ohartoov@nvidia.com>2025-12-18 17:58:53 +0200
committerLeon Romanovsky <leon@kernel.org>2026-01-05 02:43:12 -0500
commit3fd984d5cd8f0df8e79337fbd9283c31dee9ed31 (patch)
treec62b328dc655a89eadaaec988b967f46a1e5ec39
parent51a07ce2fefd061edf4ba552a741c85f07b3e6dd (diff)
RDMA/mlx5: Raise async event on device speed change
Raise IB_EVENT_DEVICE_SPEED_CHANGE whenever the speed of one of the device's ports changes. Usually all ports of the device changes together. This ensures user applications and upper-layer software are immediately notified when bandwidth changes, improving traffic management in dynamic environments. This is especially useful for vports which are part of a LAG configuration, to know if the effective speed of the LAG was changed. Signed-off-by: Or Har-Toov <ohartoov@nvidia.com> Reviewed-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Edward Srouji <edwards@nvidia.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
-rw-r--r--drivers/infiniband/hw/mlx5/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 40284bbb45d6..bea42acbeaad 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -2838,6 +2838,14 @@ static int handle_port_change(struct mlx5_ib_dev *ibdev, struct mlx5_eqe *eqe,
case MLX5_PORT_CHANGE_SUBTYPE_ACTIVE:
case MLX5_PORT_CHANGE_SUBTYPE_DOWN:
case MLX5_PORT_CHANGE_SUBTYPE_INITIALIZED:
+ if (ibdev->ib_active) {
+ struct ib_event speed_event = {};
+
+ speed_event.device = &ibdev->ib_dev;
+ speed_event.event = IB_EVENT_DEVICE_SPEED_CHANGE;
+ ib_dispatch_event(&speed_event);
+ }
+
/* In RoCE, port up/down events are handled in
* mlx5_netdev_event().
*/