[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8a2be07b-acf6-1148-e299-8196c18cfeed@linux.alibaba.com>
Date: Sat, 14 May 2022 17:36:53 +0800
From: Guangguan Wang <guangguan.wang@...ux.alibaba.com>
To: Leon Romanovsky <leon@...nel.org>
Cc: kgraul@...ux.ibm.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, linux-s390@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 1/2] net/smc: send cdc msg inline if qp has
sufficient inline space
On 2022/5/14 14:02, Leon Romanovsky wrote:
>> diff --git a/net/smc/smc_wr.c b/net/smc/smc_wr.c
>> index 24be1d03fef9..8a2f9a561197 100644
>> --- a/net/smc/smc_wr.c
>> +++ b/net/smc/smc_wr.c
>> @@ -554,10 +554,11 @@ void smc_wr_remember_qp_attr(struct smc_link *lnk)
>> static void smc_wr_init_sge(struct smc_link *lnk)
>> {
>> int sges_per_buf = (lnk->lgr->smc_version == SMC_V2) ? 2 : 1;
>> + bool send_inline = (lnk->qp_attr.cap.max_inline_data >= SMC_WR_TX_SIZE);
>
> When will it be false? You are creating QPs with max_inline_data == SMC_WR_TX_SIZE?
>
>> u32 i;
>>
>> for (i = 0; i < lnk->wr_tx_cnt; i++) {
>> - lnk->wr_tx_sges[i].addr =
>> + lnk->wr_tx_sges[i].addr = send_inline ? (u64)(&lnk->wr_tx_bufs[i]) :
>> lnk->wr_tx_dma_addr + i * SMC_WR_BUF_SIZE;
>> lnk->wr_tx_sges[i].length = SMC_WR_TX_SIZE;
>> lnk->wr_tx_sges[i].lkey = lnk->roce_pd->local_dma_lkey;
>> @@ -575,6 +576,8 @@ static void smc_wr_init_sge(struct smc_link *lnk)
>> lnk->wr_tx_ibs[i].opcode = IB_WR_SEND;
>> lnk->wr_tx_ibs[i].send_flags =
>> IB_SEND_SIGNALED | IB_SEND_SOLICITED;
>> + if (send_inline)
>> + lnk->wr_tx_ibs[i].send_flags |= IB_SEND_INLINE;
>
> If you try to transfer data == SMC_WR_TX_SIZE, you will get -ENOMEM error.
> IB drivers check that length < qp->max_inline_data.
>
> Thanks
>
Got it.
I should create qps with max_inline_data == 0, and get the actual max_inline_data by query_qp.
And I should use lnk->qp_attr.cap.max_inline_data > SMC_WR_TX_SIZE to decide whether to send inline or not.
Thank you.
Powered by blists - more mailing lists