History

IB/mlx5: Add packet based credit mode support

The device can support two credit modes, message based (default) and packet based. In order to enable packet based mode, the QP should be created with special flag that indicates this. This patch adds support for the new DV QP creation flag that can be used for RC QPs in order to change the credit mode.

Danit Goldberg committed 7 years ago

Commit 569c6651 parent 3fd3c803 files · +15 −2Browse files

Unified · Split

3 files
  1. drivers/infiniband/hw/mlx5/mlx5_ib.h +1 −0
  2. drivers/infiniband/hw/mlx5/qp.c +13 −2
  3. include/uapi/rdma/mlx5-abi.h +1 −0
drivers/infiniband/hw/mlx5/mlx5_ib.h+1−0
@@ -461,6 +461,7 @@ enum mlx5_ib_qp_flags { · 460 unmodified lines
461461 MLX5_IB_QP_UNDERLAY = 1 << 10,
462462 MLX5_IB_QP_PCI_WRITE_END_PADDING = 1 << 11,
463463 MLX5_IB_QP_TUNNEL_OFFLOAD = 1 << 12,
464+ MLX5_IB_QP_PACKET_BASED_CREDIT = 1 << 13,
464465 };
465466
466467 struct mlx5_umr_wr {
drivers/infiniband/hw/mlx5/qp.c+13−2
@@ -1889,7 +1889,8 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, · 1888 unmodified lines
18891889 MLX5_QP_FLAG_BFREG_INDEX |
18901890 MLX5_QP_FLAG_TYPE_DCT |
18911891 MLX5_QP_FLAG_TYPE_DCI |
1892− MLX5_QP_FLAG_ALLOW_SCATTER_CQE))
1892+ MLX5_QP_FLAG_ALLOW_SCATTER_CQE |
1893+ MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE))
18931894 return -EINVAL;
18941895
18951896 err = get_qp_user_index(to_mucontext(pd->uobject->context),
@@ -1925,6 +1926,15 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, · 29 unmodified lines
19251926 qp->flags_en |= MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC;
19261927 }
19271928
1929+ if (ucmd.flags & MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE) {
1930+ if (init_attr->qp_type != IB_QPT_RC ||
1931+ !MLX5_CAP_GEN(dev->mdev, qp_packet_based)) {
1932+ mlx5_ib_dbg(dev, "packet based credit mode isn't supported\n");
1933+ return -EOPNOTSUPP;
1934+ }
1935+ qp->flags |= MLX5_IB_QP_PACKET_BASED_CREDIT;
1936+ }
1937+
19281938 if (init_attr->create_flags & IB_QP_CREATE_SOURCE_QPN) {
19291939 if (init_attr->qp_type != IB_QPT_UD ||
19301940 (MLX5_CAP_GEN(dev->mdev, port_type) !=
@@ -2021,7 +2031,8 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, · 90 unmodified lines
20212031 MLX5_SET(qpc, qpc, cd_slave_send, 1);
20222032 if (qp->flags & MLX5_IB_QP_MANAGED_RECV)
20232033 MLX5_SET(qpc, qpc, cd_slave_receive, 1);
2024−
2034+ if (qp->flags & MLX5_IB_QP_PACKET_BASED_CREDIT)
2035+ MLX5_SET(qpc, qpc, req_e2e_credit_mode, 1);
20252036 if (qp->scat_cqe && is_connected(init_attr->qp_type)) {
20262037 configure_responder_scat_cqe(init_attr, qpc);
20272038 configure_requester_scat_cqe(dev, init_attr,
include/uapi/rdma/mlx5-abi.h+1−0
@@ -48,6 +48,7 @@ enum { · 47 unmodified lines
4848 MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_UC = 1 << 6,
4949 MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC = 1 << 7,
5050 MLX5_QP_FLAG_ALLOW_SCATTER_CQE = 1 << 8,
51+ MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE = 1 << 9,
5152 };
5253
5354 enum {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t