Re: [PATCH for-next] RDMA/hns: Add caps flag for UD inline of userspace

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

 



On Tue, Jan 05, 2021 at 09:36:55AM +0800, Weihang Li wrote:
> HIP09 supports UD inline up to size of 1024 Bytes, the caps flag is got
> from firmware and passed back to userspace when creating QP.
>
> Signed-off-by: Weihang Li <liweihang@xxxxxxxxxx>
> ---
>  drivers/infiniband/hw/hns/hns_roce_device.h | 1 +
>  drivers/infiniband/hw/hns/hns_roce_hw_v2.c  | 3 +++
>  drivers/infiniband/hw/hns/hns_roce_hw_v2.h  | 1 +
>  drivers/infiniband/hw/hns/hns_roce_qp.c     | 3 +++
>  include/uapi/rdma/hns-abi.h                 | 1 +
>  5 files changed, 9 insertions(+)
>
> diff --git a/drivers/infiniband/hw/hns/hns_roce_device.h b/drivers/infiniband/hw/hns/hns_roce_device.h
> index 55d5386..87716da 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_device.h
> +++ b/drivers/infiniband/hw/hns/hns_roce_device.h
> @@ -214,6 +214,7 @@ enum {
>  	HNS_ROCE_CAP_FLAG_FRMR                  = BIT(8),
>  	HNS_ROCE_CAP_FLAG_QP_FLOW_CTRL		= BIT(9),
>  	HNS_ROCE_CAP_FLAG_ATOMIC		= BIT(10),
> +	HNS_ROCE_CAP_FLAG_UD_SQ_INL		= BIT(13),
>  	HNS_ROCE_CAP_FLAG_SDI_MODE		= BIT(14),
>  	HNS_ROCE_CAP_FLAG_STASH			= BIT(17),
>  };
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> index 833e1f2..619e828 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> @@ -1916,6 +1916,8 @@ static void set_default_caps(struct hns_roce_dev *hr_dev)
>  		caps->gmv_buf_pg_sz = 0;
>  		caps->gid_table_len[0] = caps->gmv_bt_num * (HNS_HW_PAGE_SIZE /
>  					 caps->gmv_entry_sz);
> +		caps->flags |= HNS_ROCE_CAP_FLAG_UD_SQ_INL;
> +		caps->max_sq_inline = HNS_ROCE_V2_MAX_SQ_INL_EXT;

You are doing very similar assignment in the top of set_default_caps().
  1803         caps->max_sq_inline     = HNS_ROCE_V2_MAX_SQ_INLINE;

IMHO, it will be better to have one assignment instead of overwrite in
the same function.

Thanks



[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