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 15:20:24 +0800 [thread overview]
Message-ID: <6c0f0b0b-33f9-2aea-525e-1dc73b3e4ad5@mykernel.net> (raw)
In-Reply-To: <YiG7f16SZolUhks3@unreal>
在 2022/3/4 15:10, Leon Romanovsky 写道:
> On Fri, Mar 04, 2022 at 10:08:29AM +0800, Chengguang Xu wrote:
>> 在 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.
> It is not because of overflow, but desire to have proper types for whole
> call stack without shadow casting and ambiguity.
Okay, that makes sense, let me fold into v2 version.
Thanks,
Chengguang
prev parent reply other threads:[~2022-03-04 7:20 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
2022-03-04 7:10 ` Leon Romanovsky
2022-03-04 7:20 ` Chengguang Xu [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=6c0f0b0b-33f9-2aea-525e-1dc73b3e4ad5@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