Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/mlx5: Allow scatter to CQE without global signaled WRs

Requester scatter to CQE is restricted to QPs configured to signal
all WRs.

This patch adds ability to enable scatter to cqe (force enable)
in the requester without sig_all, for users who do not want all WRs
signaled but rather just the ones whose data found in the CQE.

Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
Reviewed-by: Guy Levi <guyle@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>

authored by

Yonatan Cohen and committed by
Doug Ledford
6f4bc0ea 2e43bb31

+12 -3
+11 -3
drivers/infiniband/hw/mlx5/qp.c
··· 1706 1706 1707 1707 static void configure_requester_scat_cqe(struct mlx5_ib_dev *dev, 1708 1708 struct ib_qp_init_attr *init_attr, 1709 + struct mlx5_ib_create_qp *ucmd, 1709 1710 void *qpc) 1710 1711 { 1711 1712 enum ib_qp_type qpt = init_attr->qp_type; 1712 1713 int scqe_sz; 1714 + bool allow_scat_cqe = 0; 1713 1715 1714 1716 if (qpt == IB_QPT_UC || qpt == IB_QPT_UD) 1715 1717 return; 1716 1718 1717 - if (init_attr->sq_sig_type != IB_SIGNAL_ALL_WR) 1719 + if (ucmd) 1720 + allow_scat_cqe = ucmd->flags & MLX5_QP_FLAG_ALLOW_SCATTER_CQE; 1721 + 1722 + if (!allow_scat_cqe && init_attr->sq_sig_type != IB_SIGNAL_ALL_WR) 1718 1723 return; 1719 1724 1720 1725 scqe_sz = mlx5_ib_get_cqe_size(init_attr->send_cq); ··· 1841 1836 MLX5_QP_FLAG_TUNNEL_OFFLOADS | 1842 1837 MLX5_QP_FLAG_BFREG_INDEX | 1843 1838 MLX5_QP_FLAG_TYPE_DCT | 1844 - MLX5_QP_FLAG_TYPE_DCI)) 1839 + MLX5_QP_FLAG_TYPE_DCI | 1840 + MLX5_QP_FLAG_ALLOW_SCATTER_CQE)) 1845 1841 return -EINVAL; 1846 1842 1847 1843 err = get_qp_user_index(to_mucontext(pd->uobject->context), ··· 1977 1971 1978 1972 if (qp->scat_cqe && is_connected(init_attr->qp_type)) { 1979 1973 configure_responder_scat_cqe(init_attr, qpc); 1980 - configure_requester_scat_cqe(dev, init_attr, qpc); 1974 + configure_requester_scat_cqe(dev, init_attr, 1975 + (pd && pd->uobject) ? &ucmd : NULL, 1976 + qpc); 1981 1977 } 1982 1978 1983 1979 if (qp->rq.wqe_cnt) {
+1
include/uapi/rdma/mlx5-abi.h
··· 47 47 MLX5_QP_FLAG_TYPE_DCI = 1 << 5, 48 48 MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_UC = 1 << 6, 49 49 MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC = 1 << 7, 50 + MLX5_QP_FLAG_ALLOW_SCATTER_CQE = 1 << 8, 50 51 }; 51 52 52 53 enum {