All of lore.kernel.org
 help / color / mirror / Atom feed
From: yanjun.zhu@linux.dev
To: jgg@ziepe.ca, mustafa.ismail@intel.com, shiraz.saleem@intel.com,
	zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org,
	yanjun.zhu@linux.dev, leonro@nvidia.com
Subject: [PATCH v3 2/4] RDMA/hns: Replace get_udp_sport with rdma_get_udp_sport
Date: Thu,  6 Jan 2022 13:03:57 -0500	[thread overview]
Message-ID: <20220106180359.2915060-3-yanjun.zhu@linux.dev> (raw)
In-Reply-To: <20220106180359.2915060-1-yanjun.zhu@linux.dev>

From: Zhu Yanjun <yanjun.zhu@linux.dev>

Several drivers have the same function xxx_get_udp_sport. So this
function is moved to ib_verbs.h.

Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index eb0defa80d0d..cb795663b813 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -4488,14 +4488,6 @@ static int modify_qp_rtr_to_rts(struct ib_qp *ibqp,
 	return 0;
 }
 
-static inline u16 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);
-}
-
 static int get_dip_ctx_idx(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
 			   u32 *dip_idx)
 {
@@ -4712,8 +4704,8 @@ static int hns_roce_v2_set_path(struct ib_qp *ibqp,
 	}
 
 	hr_reg_write(context, QPC_UDPSPN,
-		     is_udp ? get_udp_sport(grh->flow_label, ibqp->qp_num,
-					    attr->dest_qp_num) : 0);
+		     is_udp ? rdma_get_udp_sport(grh->flow_label, ibqp->qp_num,
+						 attr->dest_qp_num) : 0);
 
 	hr_reg_clear(qpc_mask, QPC_UDPSPN);
 
-- 
2.27.0


  parent reply	other threads:[~2022-01-06  1:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 18:03 [PATCH v3 0/4] Generate UDP src port with flow label or lqpn/rqpn yanjun.zhu
2022-01-06 18:03 ` [PATCH v3 1/4] RDMA/core: Calculate UDP source port based on " yanjun.zhu
2022-01-06 18:03 ` yanjun.zhu [this message]
2022-01-07 10:03   ` [PATCH v3 2/4] RDMA/hns: Replace get_udp_sport with rdma_get_udp_sport Wenpeng Liang
2022-01-06 18:03 ` [PATCH v3 3/4] RDMA/irdma: Make the source udp port vary yanjun.zhu
2022-01-06 18:03 ` [PATCH v3 4/4] RDMA/rxe: Use the standard method to produce udp source port yanjun.zhu
2022-01-07 23:39 ` [PATCH v3 0/4] Generate UDP src port with flow label or lqpn/rqpn Jason Gunthorpe

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=20220106180359.2915060-3-yanjun.zhu@linux.dev \
    --to=yanjun.zhu@linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=leonro@nvidia.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 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.