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
461 MLX5_IB_QP_UNDERLAY = 1 << 10,461 MLX5_IB_QP_UNDERLAY = 1 << 10,
462 MLX5_IB_QP_PCI_WRITE_END_PADDING = 1 << 11,462 MLX5_IB_QP_PCI_WRITE_END_PADDING = 1 << 11,
463 MLX5_IB_QP_TUNNEL_OFFLOAD = 1 << 12,463 MLX5_IB_QP_TUNNEL_OFFLOAD = 1 << 12,
464 MLX5_IB_QP_PACKET_BASED_CREDIT = 1 << 13,
464};465};
465 466
466struct mlx5_umr_wr {467struct 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
1889 MLX5_QP_FLAG_BFREG_INDEX |1889 MLX5_QP_FLAG_BFREG_INDEX |
1890 MLX5_QP_FLAG_TYPE_DCT |1890 MLX5_QP_FLAG_TYPE_DCT |
1891 MLX5_QP_FLAG_TYPE_DCI |1891 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))
1893 return -EINVAL;1894 return -EINVAL;
1894 1895
1895 err = get_qp_user_index(to_mucontext(pd->uobject->context),1896 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
1925 qp->flags_en |= MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC;1926 qp->flags_en |= MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC;
1926 }1927 }
1927 1928
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
1928 if (init_attr->create_flags & IB_QP_CREATE_SOURCE_QPN) {1938 if (init_attr->create_flags & IB_QP_CREATE_SOURCE_QPN) {
1929 if (init_attr->qp_type != IB_QPT_UD ||1939 if (init_attr->qp_type != IB_QPT_UD ||
1930 (MLX5_CAP_GEN(dev->mdev, port_type) !=1940 (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
2021 MLX5_SET(qpc, qpc, cd_slave_send, 1);2031 MLX5_SET(qpc, qpc, cd_slave_send, 1);
2022 if (qp->flags & MLX5_IB_QP_MANAGED_RECV)2032 if (qp->flags & MLX5_IB_QP_MANAGED_RECV)
2023 MLX5_SET(qpc, qpc, cd_slave_receive, 1);2033 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);
2025 if (qp->scat_cqe && is_connected(init_attr->qp_type)) {2036 if (qp->scat_cqe && is_connected(init_attr->qp_type)) {
2026 configure_responder_scat_cqe(init_attr, qpc);2037 configure_responder_scat_cqe(init_attr, qpc);
2027 configure_requester_scat_cqe(dev, init_attr,2038 configure_requester_scat_cqe(dev, init_attr,
include/uapi/rdma/mlx5-abi.h+1−0
@@ -48,6 +48,7 @@ enum { · 47 unmodified lines
48 MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_UC = 1 << 6,48 MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_UC = 1 << 6,
49 MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC = 1 << 7,49 MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC = 1 << 7,
50 MLX5_QP_FLAG_ALLOW_SCATTER_CQE = 1 << 8,50 MLX5_QP_FLAG_ALLOW_SCATTER_CQE = 1 << 8,
51 MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE = 1 << 9,
51};52};
52 53
53enum {54enum {

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