From: Leon Romanovsky <leon@kernel.org>
To: yanjun.zhu@linux.dev
Cc: liangwenpeng@huawei.com, jgg@ziepe.ca, mustafa.ismail@intel.com,
shiraz.saleem@intel.com, zyjzyj2000@gmail.com,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH 5/5] RDMA/rxe: Remove the redundant randomization for UDP source port
Date: Wed, 5 Jan 2022 10:56:09 +0200 [thread overview]
Message-ID: <YdVdKU+jr5lHVaI3@unreal> (raw)
In-Reply-To: <aa57e98b2ba3b86da11367ab13d4a96c@linux.dev>
On Wed, Jan 05, 2022 at 08:42:03AM +0000, yanjun.zhu@linux.dev wrote:
> January 5, 2022 3:49 PM, "Leon Romanovsky" <leon@kernel.org> wrote:
>
> > On Wed, Jan 05, 2022 at 05:12:37PM -0500, yanjun.zhu@linux.dev wrote:
> >
> >> From: Zhu Yanjun <yanjun.zhu@linux.dev>
> >>
> >> Since the UDP source port is modified in rxe_modify_qp, the randomization
> >> for UDP source port is redundant in this function. So remove it.
> >>
> >> Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
> >> ---
> >> drivers/infiniband/sw/rxe/rxe_qp.c | 10 ++--------
> >> 1 file changed, 2 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
> >> index 54b8711321c1..84d6ffe7350a 100644
> >> --- a/drivers/infiniband/sw/rxe/rxe_qp.c
> >> +++ b/drivers/infiniband/sw/rxe/rxe_qp.c
> >> @@ -210,15 +210,9 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
> >> return err;
> >> qp->sk->sk->sk_user_data = qp;
> >>
> >> - /* pick a source UDP port number for this QP based on
> >> - * the source QPN. this spreads traffic for different QPs
> >> - * across different NIC RX queues (while using a single
> >> - * flow for a given QP to maintain packet order).
> >> - * the port number must be in the Dynamic Ports range
> >> - * (0xc000 - 0xffff).
> >> + /* Source UDP port number for this QP is modified in rxe_qp_modify.
> >> */
> >
> > This makes me wonder why do we set this src_port here?
> > Are we using this field before modify QP?
>
> The commit d3c04a3a6870 ("IB/rxe: vary the source udp port for receive scaling") sets this src_port here.
>
> The advantage of setting src_port here is: before rxe_modify_qp, the src port is randomized, not 0xc000.
> So after/before rxe_modify_qp, the src port is the same value.
>
> If the src port is changed in rxe_modify_qp, before rxe_modify_qp, the src port is 0xc000, after rxe_modify_qp,
> the src port is randomized, for example, src port is 0xF043.
I'm asking if you use qp->src_port between this line and rxe_modify_qp?
Thanks
>
> So when the new method is adopted, I removed this.
>
> Zhu Yanjun
>
> >
> > Thanks
> >
> >> - qp->src_port = RXE_ROCE_V2_SPORT +
> >> - (hash_32_generic(qp_num(qp), 14) & 0x3fff);
> >> + qp->src_port = RXE_ROCE_V2_SPORT;
> >> qp->sq.max_wr = init->cap.max_send_wr;
> >>
> >> /* These caps are limited by rxe_qp_chk_cap() done by the caller */
> >> --
> >> 2.27.0
next prev parent reply other threads:[~2022-01-05 8:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 22:12 [PATCHv2 0/5] Generate UDP src port with flow label or lqpn/rqpn yanjun.zhu
2022-01-05 22:12 ` [PATCH 1/5] RDMA/core: Calculate UDP source port based on " yanjun.zhu
2022-01-05 7:49 ` Leon Romanovsky
2022-01-05 22:12 ` [PATCH 2/5] RDMA/hns: Replace get_udp_sport with rdma_get_udp_sport yanjun.zhu
2022-01-05 7:49 ` Leon Romanovsky
2022-01-05 22:12 ` [PATCH 3/5] RDMA/irdma: Make the source udp port vary yanjun.zhu
2022-01-05 7:50 ` Leon Romanovsky
2022-01-05 15:40 ` Saleem, Shiraz
2022-01-05 22:12 ` [PATCH 4/5] RDMA/rxe: Use the standard method to produce udp source port yanjun.zhu
2022-01-05 7:52 ` Leon Romanovsky
2022-01-05 8:27 ` Zhu Yanjun
2022-01-05 8:55 ` Leon Romanovsky
2022-01-05 9:13 ` yanjun.zhu
2022-01-05 12:42 ` Zhu Yanjun
2022-01-05 22:12 ` [PATCH 5/5] RDMA/rxe: Remove the redundant randomization for UDP " yanjun.zhu
2022-01-05 7:49 ` Leon Romanovsky
2022-01-05 8:42 ` yanjun.zhu
2022-01-05 8:56 ` Leon Romanovsky [this message]
2022-01-05 9:03 ` yanjun.zhu
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=YdVdKU+jr5lHVaI3@unreal \
--to=leon@kernel.org \
--cc=jgg@ziepe.ca \
--cc=liangwenpeng@huawei.com \
--cc=linux-rdma@vger.kernel.org \
--cc=mustafa.ismail@intel.com \
--cc=shiraz.saleem@intel.com \
--cc=yanjun.zhu@linux.dev \
--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;
as well as URLs for NNTP newsgroup(s).