On 2020/8/27 20:40, Jason Gunthorpe wrote: > On Thu, Aug 20, 2020 at 09:17:46PM +0800, Weihang Li wrote: >> From: Xi Wang <wangxi11@xxxxxxxxxx> >> >> The libhns in userspace for HIP09 will use the hardware's capability to >> enable some features. So export the hardware capablility flags to userspace >> by reusing the reserved fields in structure >> "hns_roce_ib_alloc_ucontext_resp". >> >> Signed-off-by: Xi Wang <wangxi11@xxxxxxxxxx> >> Signed-off-by: Weihang Li <liweihang@xxxxxxxxxx> >> drivers/infiniband/hw/hns/hns_roce_main.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_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c >> index 5907cfd..98945df 100644 >> +++ b/drivers/infiniband/hw/hns/hns_roce_main.c >> @@ -313,6 +313,7 @@ static int hns_roce_alloc_ucontext(struct ib_ucontext *uctx, >> return -EAGAIN; >> >> resp.qp_tab_size = hr_dev->caps.num_qps; >> + resp.cap_flags = (u32)hr_dev->caps.flags; > > This makes all the HNS_ROCE_CAP_FLAG_* values uapi, they need to be > moved to the uapi header too. > > Or rethink this to only expose what you want to be uapi. > > Jason > Hi Jason, Thanks for your comments, we will only expose the needed flag to be uapi. Considering that this cap_flags field is not necessary for this series, I will drop #1 and send a new version. And the modification about cap_flags will be sent later. Weihang