Commit 4a43554d authored by Junxian Huang's avatar Junxian Huang Committed by Juan Zhou
Browse files

RDMA/hns: Response dmac to userspace

maillist inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8HZ7W
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d3f4020a213e1cb125eed2363fca372a23f7de7a



----------------------------------------------------------------------

While creating AH, dmac is already resolved in kernel. Response dmac
to userspace so that userspace doesn't need to resolve dmac repeatedly.

Signed-off-by: default avatarJunxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20231207114231.2872104-3-huangjunxian6@hisilicon.com


Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarJuan Zhou <zhoujuan51@h-partners.com>
parent 70e70910
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,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)));
	}
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,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 {