From: Yanjun Zhu <yanjun.zhu@linux.dev>
To: "Saleem, Shiraz" <shiraz.saleem@intel.com>,
"Ismail, Mustafa" <mustafa.ismail@intel.com>,
"jgg@ziepe.ca" <jgg@ziepe.ca>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: [PATCHv3 1/1] RDMA/irdma: Make the source udp port vary
Date: Tue, 4 Jan 2022 23:34:53 +0800 [thread overview]
Message-ID: <e247c581-edd3-59b6-9e6f-a0301a84ec1b@linux.dev> (raw)
In-Reply-To: <06ce030593a4480694ee3d6d9be0ceda@intel.com>
在 2022/1/4 23:07, Saleem, Shiraz 写道:
>> Subject: [PATCHv3 1/1] RDMA/irdma: Make the source udp port vary
>>
>> From: Zhu Yanjun <yanjun.zhu@linux.dev>
>>
>> Based on the link https://www.spinics.net/lists/linux-rdma/msg73735.html,
>> get the source udp port number for a QP based on the grh.flow_label or
>> lqpn/rqrpn. This provides a better spread of traffic across NIC RX queues.
>> The method in the commit 2b880b2e5e03 ("RDMA/mlx5: Define RoCEv2 udp
>> source port when set path") is a standard way. So it is also adopted in this
>> commit.
>>
>> Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
>> ---
>> V2->V3: Move to the block of IB_QP_AV in the mask and IB_AH_GRH in
>> V2->ah_flags
>> V1->V2: Adopt a standard method to get udp source port.
>> ---
>> drivers/infiniband/hw/irdma/verbs.c | 14 ++++++++++++++
>> 1 file changed, 14 insertions(+)
>>
>> diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
>> index 8cd5f9261692..31039b295206 100644
>> --- a/drivers/infiniband/hw/irdma/verbs.c
>> +++ b/drivers/infiniband/hw/irdma/verbs.c
>> @@ -1094,6 +1094,15 @@ static int irdma_query_pkey(struct ib_device *ibdev,
>> u32 port, u16 index,
>> return 0;
>> }
>>
>> +
>> +static u16 irdma_get_udp_sport(u32 fl, u32 lqpn, u32 rqpn) {
>> + if (!fl)
>> + fl = rdma_calc_flow_label(lqpn, rqpn);
>> +
>> + return rdma_flow_label_to_udp_sport(fl); }
>> +
>> /**
>> * irdma_modify_qp_roce - modify qp request
>> * @ibqp: qp's pointer for modify
>> @@ -1167,6 +1176,11 @@ int irdma_modify_qp_roce(struct ib_qp *ibqp, struct
>> ib_qp_attr *attr,
>>
>> memset(&iwqp->roce_ah, 0, sizeof(iwqp->roce_ah));
>> if (attr->ah_attr.ah_flags & IB_AH_GRH) {
>> + u32 fl = udp_info->flow_label;
>> + u32 lqp = ibqp->qp_num;
>> + u32 rqp = roce_info->dest_qp;
>> +
>> + udp_info->src_port = irdma_get_udp_sport(fl, lqp, rqp);
> The flow label used in function is not right as udp_info->flow_label is only set a few lines below. Kindly fold this fix into your next revision.
Thanks. " attr->ah_attr.grh.flow_label " should be OK.
Zhu Yanjun
>
>> udp_info->ttl = attr->ah_attr.grh.hop_limit;
>> udp_info->flow_label = attr->ah_attr.grh.flow_label;
>> udp_info->tos = attr->ah_attr.grh.traffic_class;
>> --
>> 2.27.0
prev parent reply other threads:[~2022-01-04 15:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-21 17:39 [PATCHv3 1/1] RDMA/irdma: Make the source udp port vary yanjun.zhu
2021-12-21 23:07 ` Ismail, Mustafa
2022-01-03 9:47 ` Leon Romanovsky
2022-01-04 7:51 ` yanjun.zhu
2022-01-04 8:44 ` Leon Romanovsky
2022-01-04 15:07 ` Saleem, Shiraz
2022-01-04 15:34 ` Yanjun Zhu [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=e247c581-edd3-59b6-9e6f-a0301a84ec1b@linux.dev \
--to=yanjun.zhu@linux.dev \
--cc=jgg@ziepe.ca \
--cc=linux-rdma@vger.kernel.org \
--cc=mustafa.ismail@intel.com \
--cc=shiraz.saleem@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.