linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: yanjun.zhu@linux.dev
To: "Leon Romanovsky" <leon@kernel.org>, "Zhu Yanjun" <zyjzyj2000@gmail.com>
Cc: liangwenpeng@huawei.com, "Jason Gunthorpe" <jgg@ziepe.ca>,
	mustafa.ismail@intel.com,
	"Shiraz Saleem" <shiraz.saleem@intel.com>,
	"RDMA mailing list" <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH 4/5] RDMA/rxe: Use the standard method to produce udp source port
Date: Wed, 05 Jan 2022 09:13:31 +0000	[thread overview]
Message-ID: <377b2cd0762ee3137efcfb545105564a@linux.dev> (raw)
In-Reply-To: <YdVc5BMAaOh2aO2C@unreal>

January 5, 2022 4:55 PM, "Leon Romanovsky" <leon@kernel.org> wrote:

> On Wed, Jan 05, 2022 at 04:27:38PM +0800, Zhu Yanjun wrote:
> 
>> On Wed, Jan 5, 2022 at 3:52 PM Leon Romanovsky <leon@kernel.org> wrote:
>> 
>> On Wed, Jan 05, 2022 at 05:12:36PM -0500, yanjun.zhu@linux.dev wrote:
>>> From: Zhu Yanjun <yanjun.zhu@linux.dev>
>>> 
>>> Use the standard method to produce udp source port.
>>> 
>>> Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
>>> ---
>>> drivers/infiniband/sw/rxe/rxe_verbs.c | 6 ++++++
>>> 1 file changed, 6 insertions(+)
>>> 
>>> diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
>>> index 0aa0d7e52773..42fa81b455de 100644
>>> --- a/drivers/infiniband/sw/rxe/rxe_verbs.c
>>> +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
>>> @@ -469,6 +469,12 @@ static int rxe_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
>>> if (err)
>>> goto err1;
>>> 
>>> + if ((mask & IB_QP_AV) && (attr->ah_attr.ah_flags & IB_AH_GRH))
>> 
>> You are leaving src_port default and wired to same port as other QPs
>> without any randomization.
>> 
>> Hi,
>> 
>> I do not get you. Why do you think I am leaving src_pport default?
> 
> Because in original code, you randomized src_port without any relation
> to mask flags.
> 
> qp->src_port = RXE_ROCE_V2_SPORT +
> (hash_32_generic(qp_num(qp), 14) & 0x3fff);
> 
> After patch #5, if user doesn't pass "proper" mask, you will leave
> qp->src_port to be equal to RXE_ROCE_V2_SPORT, which is different from
> the current behaviour.

About the "proper" mask, please check this link https://patchwork.kernel.org/project/linux-rdma/patch/20211218204438.1345160-1-yanjun.zhu@linux.dev/

"the udp_sport is only set when address vector and dest qpn (IB_QP_AV and IB_QP_DEST_QPN) is provided."

Zhu Yanjun
> 
> Thanks
> 
>> Thanks.
>> 
>> Zhu Yanjun
>> 
>> Thanks
>> 
>>> + qp->src_port = rdma_get_udp_sport(attr->ah_attr.grh.flow_label,
>>> + qp->ibqp.qp_num,
>>> + qp->attr.dest_qp_num);
>>> +
>>> +
>>> return 0;
>>> 
>>> err1:
>>> --
>>> 2.27.0
>>>

  reply	other threads:[~2022-01-05  9:13 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 [this message]
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
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=377b2cd0762ee3137efcfb545105564a@linux.dev \
    --to=yanjun.zhu@linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=liangwenpeng@huawei.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mustafa.ismail@intel.com \
    --cc=shiraz.saleem@intel.com \
    --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).