diff options
author | Zhu Yanjun <yanjun.zhu@linux.dev> | 2022-01-06 19:03:58 +0100 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2022-01-08 00:34:55 +0100 |
commit | 69e609ba96620aaca3c3bdcbaba5f8dee3b12f5f (patch) | |
tree | da8200452b915b56965f9f76014e8c4958084f9e | |
parent | RDMA/hns: Replace get_udp_sport with rdma_get_udp_sport (diff) | |
download | linux-69e609ba96620aaca3c3bdcbaba5f8dee3b12f5f.tar.xz linux-69e609ba96620aaca3c3bdcbaba5f8dee3b12f5f.zip |
RDMA/irdma: Make the source udp port vary
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.
Link: https://lore.kernel.org/r/20220106180359.2915060-4-yanjun.zhu@linux.dev
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
-rw-r--r-- | drivers/infiniband/hw/irdma/verbs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c index 456fed94b145..460e757d3fe6 100644 --- a/drivers/infiniband/hw/irdma/verbs.c +++ b/drivers/infiniband/hw/irdma/verbs.c @@ -1171,6 +1171,10 @@ int irdma_modify_qp_roce(struct ib_qp *ibqp, struct ib_qp_attr *attr, 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; + udp_info->src_port = + rdma_get_udp_sport(udp_info->flow_label, + ibqp->qp_num, + roce_info->dest_qp); irdma_qp_rem_qos(&iwqp->sc_qp); dev->ws_remove(iwqp->sc_qp.vsi, ctx_info->user_pri); ctx_info->user_pri = rt_tos2priority(udp_info->tos); |