diff options
author | 2024-11-22 18:53:08 +0800 | |
---|---|---|
committer | 2024-12-25 23:39:11 -0500 | |
commit | 20b6d8a7b9bdced0c5f9a4887dbf123dd8e334c0 (patch) | |
tree | 917b7005790ceb05b3c142e781266b9bb6069b10 | |
parent | RDMA/mlx5: Handle link status event only for LAG device (diff) | |
download | wireguard-linux-20b6d8a7b9bdced0c5f9a4887dbf123dd8e334c0.tar.xz wireguard-linux-20b6d8a7b9bdced0c5f9a4887dbf123dd8e334c0.zip |
RDMA/hns: Support fast path for link-down events dispatching
hns3 NIC driver can directly notify the RoCE driver about link status
events bypassing the netdev notifier. This can provide more timely
event dispatching for ULPs.
Signed-off-by: Yuyu Li <liyuyu6@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 697b17cca02e..5c911d1def03 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -7178,9 +7178,22 @@ static int hns_roce_hw_v2_reset_notify(struct hnae3_handle *handle, return ret; } +static void hns_roce_hw_v2_link_status_change(struct hnae3_handle *handle, + bool linkup) +{ + struct hns_roce_dev *hr_dev = (struct hns_roce_dev *)handle->priv; + struct net_device *netdev = handle->rinfo.netdev; + + if (linkup || !hr_dev) + return; + + ib_dispatch_port_state_event(&hr_dev->ib_dev, netdev); +} + static const struct hnae3_client_ops hns_roce_hw_v2_ops = { .init_instance = hns_roce_hw_v2_init_instance, .uninit_instance = hns_roce_hw_v2_uninit_instance, + .link_status_change = hns_roce_hw_v2_link_status_change, .reset_notify = hns_roce_hw_v2_reset_notify, }; |