From: Yangyang Li liyangyang20@huawei.com
driver inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8AL44
--------------------------------------------------------------------------
For RDMA over UB Link mode, UB Link replaces the current Ethernet. Add a new ARP protocol HW ID 38 and enable CM link building and netdevice event for this mode.
Signed-off-by: Yangyang Li liyangyang20@huawei.com Signed-off-by: Chengchang Tang tangchengchang@huawei.com Signed-off-by: Haoyue Xu xuhaoyue1@hisilicon.com --- drivers/infiniband/core/cma.c | 3 ++- drivers/infiniband/core/roce_gid_mgmt.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 82640924e990..672cc8571ac9 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -582,7 +582,8 @@ cma_validate_port(struct ib_device *device, u8 port, if ((dev_type != ARPHRD_INFINIBAND) && rdma_protocol_ib(device, port)) return ERR_PTR(-ENODEV);
- if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port)) { + if ((dev_type == ARPHRD_ETHER || dev_type == ARPHRD_UB) + && rdma_protocol_roce(device, port)) { ndev = dev_get_by_index(dev_addr->net, bound_if_index); if (!ndev) return ERR_PTR(-ENODEV); diff --git a/drivers/infiniband/core/roce_gid_mgmt.c b/drivers/infiniband/core/roce_gid_mgmt.c index 6b8364bb032d..282b595b0754 100644 --- a/drivers/infiniband/core/roce_gid_mgmt.c +++ b/drivers/infiniband/core/roce_gid_mgmt.c @@ -754,7 +754,7 @@ static int netdevice_event(struct notifier_block *this, unsigned long event, struct net_device *ndev = netdev_notifier_info_to_dev(ptr); struct netdev_event_work_cmd cmds[ROCE_NETDEV_CALLBACK_SZ] = { {NULL} };
- if (ndev->type != ARPHRD_ETHER) + if (ndev->type != ARPHRD_ETHER && ndev->type != ARPHRD_UB) return NOTIFY_DONE;
switch (event) { @@ -820,7 +820,7 @@ static int addr_event(struct notifier_block *this, unsigned long event, struct update_gid_event_work *work; enum gid_op_type gid_op;
- if (ndev->type != ARPHRD_ETHER) + if (ndev->type != ARPHRD_ETHER && ndev->type != ARPHRD_UB) return NOTIFY_DONE;
switch (event) {