diff options
author | Zhu Yanjun <yanjun.zhu@linux.dev> | 2022-01-06 13:03:59 -0500 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2022-01-07 19:34:56 -0400 |
commit | 104f062fd1b9c8571dba6a3020649da6bbc66259 (patch) | |
tree | 7b472cc48579d9173f004be604b5b2e60640362c /drivers/infiniband/sw/rxe/rxe_verbs.c | |
parent | 69e609ba96620aaca3c3bdcbaba5f8dee3b12f5f (diff) | |
download | linux-104f062fd1b9c8571dba6a3020649da6bbc66259.tar.gz linux-104f062fd1b9c8571dba6a3020649da6bbc66259.tar.bz2 linux-104f062fd1b9c8571dba6a3020649da6bbc66259.zip |
RDMA/rxe: Use the standard method to produce udp source port
Use the standard method to produce udp source port.
Link: https://lore.kernel.org/r/20220106180359.2915060-5-yanjun.zhu@linux.dev
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/sw/rxe/rxe_verbs.c')
-rw-r--r-- | drivers/infiniband/sw/rxe/rxe_verbs.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c index 07ca169110bf..915ad6664321 100644 --- a/drivers/infiniband/sw/rxe/rxe_verbs.c +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c @@ -468,6 +468,11 @@ 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)) + 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: |