From: Junxian Huang huangjunxian6@hisilicon.com
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8HZ7W
--------------------------------------------------------------------------
While creating AH, dmac is already resolved in kernel. Response dmac to userspace so that userspace doesn't need to resolve dmac repeatly.
Signed-off-by: Junxian Huang huangjunxian6@hisilicon.com --- drivers/infiniband/hw/hns/hns_roce_ah.c | 1 + include/uapi/rdma/hns-abi.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_ah.c b/drivers/infiniband/hw/hns/hns_roce_ah.c index 03a714243c57..abe11f4027a9 100644 --- a/drivers/infiniband/hw/hns/hns_roce_ah.c +++ b/drivers/infiniband/hw/hns/hns_roce_ah.c @@ -117,6 +117,7 @@ int hns_roce_create_ah(struct ib_ah *ibah, struct rdma_ah_init_attr *init_attr, if (udata) { resp.priority = ah->av.sl; resp.tc_mode = tc_mode; + memcpy(resp.dmac, ah_attr->roce.dmac, ETH_ALEN); 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 722313599d87..d49d3a569b21 100644 --- a/include/uapi/rdma/hns-abi.h +++ b/include/uapi/rdma/hns-abi.h @@ -135,7 +135,7 @@ struct hns_roce_ib_create_qp_resp { struct hns_roce_ib_create_ah_resp { __u8 priority; __u8 tc_mode; - __u8 reserved[6]; + __u8 dmac[6]; };
struct hns_roce_ib_modify_qp_resp {