qp.c (877f075aac900288ce2e6a64075cceff09210a7e) qp.c (f360d88a2efddf2d2a2d01a8ac76fded34d624b4)
1/*
2 * Copyright (c) 2013, Mellanox Technologies inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 793 unchanged lines hidden (view full) ---

802 struct mlx5_ib_create_qp ucmd;
803 int inlen = sizeof(*in);
804 int err;
805
806 mutex_init(&qp->mutex);
807 spin_lock_init(&qp->sq.lock);
808 spin_lock_init(&qp->rq.lock);
809
1/*
2 * Copyright (c) 2013, Mellanox Technologies inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 793 unchanged lines hidden (view full) ---

802 struct mlx5_ib_create_qp ucmd;
803 int inlen = sizeof(*in);
804 int err;
805
806 mutex_init(&qp->mutex);
807 spin_lock_init(&qp->sq.lock);
808 spin_lock_init(&qp->rq.lock);
809
810 if (init_attr->create_flags & IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK) {
811 if (!(dev->mdev.caps.flags & MLX5_DEV_CAP_FLAG_BLOCK_MCAST)) {
812 mlx5_ib_dbg(dev, "block multicast loopback isn't supported\n");
813 return -EINVAL;
814 } else {
815 qp->flags |= MLX5_IB_QP_BLOCK_MULTICAST_LOOPBACK;
816 }
817 }
818
810 if (init_attr->sq_sig_type == IB_SIGNAL_ALL_WR)
811 qp->sq_signal_bits = MLX5_WQE_CTRL_CQ_UPDATE;
812
813 if (pd && pd->uobject) {
814 if (ib_copy_from_udata(&ucmd, udata, sizeof(ucmd))) {
815 mlx5_ib_dbg(dev, "copy failed\n");
816 return -EFAULT;
817 }

--- 55 unchanged lines hidden (view full) ---

873 if (init_attr->qp_type != MLX5_IB_QPT_REG_UMR)
874 in->ctx.flags_pd = cpu_to_be32(to_mpd(pd ? pd : devr->p0)->pdn);
875 else
876 in->ctx.flags_pd = cpu_to_be32(MLX5_QP_LAT_SENSITIVE);
877
878 if (qp->wq_sig)
879 in->ctx.flags_pd |= cpu_to_be32(MLX5_QP_ENABLE_SIG);
880
819 if (init_attr->sq_sig_type == IB_SIGNAL_ALL_WR)
820 qp->sq_signal_bits = MLX5_WQE_CTRL_CQ_UPDATE;
821
822 if (pd && pd->uobject) {
823 if (ib_copy_from_udata(&ucmd, udata, sizeof(ucmd))) {
824 mlx5_ib_dbg(dev, "copy failed\n");
825 return -EFAULT;
826 }

--- 55 unchanged lines hidden (view full) ---

882 if (init_attr->qp_type != MLX5_IB_QPT_REG_UMR)
883 in->ctx.flags_pd = cpu_to_be32(to_mpd(pd ? pd : devr->p0)->pdn);
884 else
885 in->ctx.flags_pd = cpu_to_be32(MLX5_QP_LAT_SENSITIVE);
886
887 if (qp->wq_sig)
888 in->ctx.flags_pd |= cpu_to_be32(MLX5_QP_ENABLE_SIG);
889
890 if (qp->flags & MLX5_IB_QP_BLOCK_MULTICAST_LOOPBACK)
891 in->ctx.flags_pd |= cpu_to_be32(MLX5_QP_BLOCK_MCAST);
892
881 if (qp->scat_cqe && is_connected(init_attr->qp_type)) {
882 int rcqe_sz;
883 int scqe_sz;
884
885 rcqe_sz = mlx5_ib_get_cqe_size(dev, init_attr->recv_cq);
886 scqe_sz = mlx5_ib_get_cqe_size(dev, init_attr->send_cq);
887
888 if (rcqe_sz == 128)

--- 2144 unchanged lines hidden ---
893 if (qp->scat_cqe && is_connected(init_attr->qp_type)) {
894 int rcqe_sz;
895 int scqe_sz;
896
897 rcqe_sz = mlx5_ib_get_cqe_size(dev, init_attr->recv_cq);
898 scqe_sz = mlx5_ib_get_cqe_size(dev, init_attr->send_cq);
899
900 if (rcqe_sz == 128)

--- 2144 unchanged lines hidden ---