Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Chengguang Xu <cgxu519@mykernel.net>
To: Leon Romanovsky <leon@kernel.org>
Cc: zyjzyj2000@gmail.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org
Subject: Re: [PATCH] RDMA/rxe: change payload type to u32 from int
Date: Fri, 4 Mar 2022 10:08:29 +0800	[thread overview]
Message-ID: <fbb14096-c8fa-80f2-3692-ee4f828e452f@mykernel.net> (raw)
In-Reply-To: <YiEDNPT/T69Y0Vmu@unreal>

在 2022/3/4 2:04, Leon Romanovsky 写道:
> On Wed, Mar 02, 2022 at 10:10:54PM +0800, Chengguang Xu wrote:
>> The type of wqe length is u32 so change variable payload
>> to type u32 to avoid overflow on large wqe length.
>>
>> Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
>> ---
>>   drivers/infiniband/sw/rxe/rxe_req.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
>> index 5eb89052dd66..e989ee3a2033 100644
>> --- a/drivers/infiniband/sw/rxe/rxe_req.c
>> +++ b/drivers/infiniband/sw/rxe/rxe_req.c
>> @@ -612,7 +612,7 @@ int rxe_requester(void *arg)
>>   	struct sk_buff *skb;
>>   	struct rxe_send_wqe *wqe;
>>   	enum rxe_hdr_mask mask;
>> -	int payload;
>> +	u32 payload;
> This change is not complete, functions in rxe_requester() that receive
> payload as an input should be changed too.

IIUC, when calling those functions payload has been cut off to mtu size
and I think mtu will be much smaller than 2GB, so there is no rish of 
overflow.

Thanks,
Chengguang

>
>>   	int mtu;
>>   	int opcode;
>>   	int ret;
>> -- 
>> 2.27.0
>>
>>



  reply	other threads:[~2022-03-04  2:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-02 14:10 [PATCH] RDMA/rxe: change payload type to u32 from int Chengguang Xu
2022-03-03  2:26 ` Zhu Yanjun
2022-03-03 18:04 ` Leon Romanovsky
2022-03-04  2:08   ` Chengguang Xu [this message]
2022-03-04  7:10     ` Leon Romanovsky
2022-03-04  7:20       ` Chengguang Xu

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=fbb14096-c8fa-80f2-3692-ee4f828e452f@mykernel.net \
    --to=cgxu519@mykernel.net \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=zyjzyj2000@gmail.com \
    /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