Skip to content

Commit 20b6d8a

Browse files
Yuyu Lirleon
authored andcommitted
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>
1 parent 3790137 commit 20b6d8a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7178,9 +7178,22 @@ static int hns_roce_hw_v2_reset_notify(struct hnae3_handle *handle,
71787178
return ret;
71797179
}
71807180

7181+
static void hns_roce_hw_v2_link_status_change(struct hnae3_handle *handle,
7182+
bool linkup)
7183+
{
7184+
struct hns_roce_dev *hr_dev = (struct hns_roce_dev *)handle->priv;
7185+
struct net_device *netdev = handle->rinfo.netdev;
7186+
7187+
if (linkup || !hr_dev)
7188+
return;
7189+
7190+
ib_dispatch_port_state_event(&hr_dev->ib_dev, netdev);
7191+
}
7192+
71817193
static const struct hnae3_client_ops hns_roce_hw_v2_ops = {
71827194
.init_instance = hns_roce_hw_v2_init_instance,
71837195
.uninit_instance = hns_roce_hw_v2_uninit_instance,
7196+
.link_status_change = hns_roce_hw_v2_link_status_change,
71847197
.reset_notify = hns_roce_hw_v2_reset_notify,
71857198
};
71867199

0 commit comments

Comments
 (0)