Skip to content

Commit 2b62185

Browse files
majdmellanoxdledford
authored andcommitted
IB/mlx5: Fix RoCE Address Path fields
When working over a RoCE network, the UDP source port should be set only for statically connected QPs (RC, UC and XRC). Fixes: 2811ba5 ("IB/mlx5: Add RoCE fields to Address Vector") Signed-off-by: Majd Dibbiny <[email protected]> Reviewed-by: Yishai Hadas <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 31fde03 commit 2b62185

File tree

1 file changed

+6
-2
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+6
-2
lines changed

drivers/infiniband/hw/mlx5/qp.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2339,8 +2339,12 @@ static int mlx5_set_path(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
23392339
if (err)
23402340
return err;
23412341
memcpy(path->rmac, ah->roce.dmac, sizeof(ah->roce.dmac));
2342-
path->udp_sport = mlx5_get_roce_udp_sport(dev, port,
2343-
grh->sgid_index);
2342+
if (qp->ibqp.qp_type == IB_QPT_RC ||
2343+
qp->ibqp.qp_type == IB_QPT_UC ||
2344+
qp->ibqp.qp_type == IB_QPT_XRC_INI ||
2345+
qp->ibqp.qp_type == IB_QPT_XRC_TGT)
2346+
path->udp_sport = mlx5_get_roce_udp_sport(dev, port,
2347+
grh->sgid_index);
23442348
path->dci_cfi_prio_sl = (sl & 0x7) << 4;
23452349
if (gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP)
23462350
path->ecn_dscp = (grh->traffic_class >> 2) & 0x3f;

0 commit comments

Comments
 (0)