Re: [PATCH v2 for-next 1/4] RDMA/hns: Export hardware capability flags to userspace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux