driver inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5WKYW
-----------------------------------------------------------------------
The user mode driver needs to use the mac type to sense whether it is in ROH mode, so it is necessary to add the mac type to the user mode driver.
Signed-off-by: Guofeng Yue yueguofeng@hisilicon.com Signed-off-by: Ke Chen chenke54@huawei.com Reviewed-by: Yangyang Li liyangyang20@huawei.com --- drivers/infiniband/hw/hns/hns_roce_main.c | 1 + include/uapi/rdma/hns-abi.h | 2 ++ 2 files changed, 3 insertions(+)
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index 5cc4ae91851e..43ab590f9aac 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -430,6 +430,7 @@ static int hns_roce_alloc_ucontext(struct ib_ucontext *uctx, }
resp.cqe_size = hr_dev->caps.cqe_sz; + resp.mac_type = hr_dev->mac_type;
ret = ib_copy_to_udata(udata, &resp, min(udata->outlen, sizeof(resp))); diff --git a/include/uapi/rdma/hns-abi.h b/include/uapi/rdma/hns-abi.h index b8a5d65333aa..e79cd4a15cbe 100644 --- a/include/uapi/rdma/hns-abi.h +++ b/include/uapi/rdma/hns-abi.h @@ -116,6 +116,8 @@ struct hns_roce_ib_alloc_ucontext_resp { __u32 reserved; __u32 config; __u32 max_inline_data; + __u8 mac_type; + __u8 rsv1[7]; };
struct hns_roce_ib_alloc_ucontext {