Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: liweihang <liweihang@huawei.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: "dledford@redhat.com" <dledford@redhat.com>,
	"jgg@nvidia.com" <jgg@nvidia.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linuxarm@openeuler.org" <linuxarm@openeuler.org>
Subject: Re: [PATCH for-next] RDMA/hns: Add caps flag for UD inline of userspace
Date: Tue, 5 Jan 2021 07:27:52 +0000	[thread overview]
Message-ID: <55ea08e37714492ebf5acc66d2be3cd6@huawei.com> (raw)
In-Reply-To: 20210105065605.GO31158@unreal

On 2021/1/5 14:56, Leon Romanovsky wrote:
> 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@huawei.com>
>> ---
>>  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
> 

Thanks for your advice, will avoid overwriting fields in this funtion.

Weihang

      reply	other threads:[~2021-01-05  7:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05  1:36 [PATCH for-next] RDMA/hns: Add caps flag for UD inline of userspace Weihang Li
2021-01-05  6:56 ` Leon Romanovsky
2021-01-05  7:27   ` liweihang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55ea08e37714492ebf5acc66d2be3cd6@huawei.com \
    --to=liweihang@huawei.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@openeuler.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox