Lines Matching defs:context
748 static int mlx4_ib_alloc_wqn(struct mlx4_ib_ucontext *context,
751 struct mlx4_ib_dev *dev = to_mdev(context->ibucontext.device);
755 mutex_lock(&context->wqn_ranges_mutex);
757 range = list_first_entry_or_null(&context->wqn_ranges_list,
776 list_add(&range->list, &context->wqn_ranges_list);
793 mutex_unlock(&context->wqn_ranges_mutex);
798 static void mlx4_ib_release_wqn(struct mlx4_ib_ucontext *context,
801 struct mlx4_ib_dev *dev = to_mdev(context->ibucontext.device);
804 mutex_lock(&context->wqn_ranges_mutex);
823 mutex_unlock(&context->wqn_ranges_mutex);
832 struct mlx4_ib_ucontext *context = rdma_udata_to_drv_context(
907 err = mlx4_ib_alloc_wqn(context, qp, range_size, &qpn);
944 mlx4_ib_release_wqn(context, qp, 0);
946 mlx4_ib_db_unmap_user(context, &qp->db);
963 struct mlx4_ib_ucontext *context = rdma_udata_to_drv_context(
1230 mlx4_ib_db_unmap_user(context, &qp->db);
1895 struct mlx4_qp_context *context)
1902 context->pri_path.sched_queue = MLX4_IB_DEFAULT_SCHED_QUEUE | ((qp->port - 1) << 6);
1909 context->pri_path.grh_mylmc = 0x80 | (u8) smac_index;
2054 static void fill_qp_rss_context(struct mlx4_qp_context *context,
2059 rss_context = (void *)context + offsetof(struct mlx4_qp_context,
2091 struct mlx4_qp_context *context;
2126 context = kzalloc(sizeof *context, GFP_KERNEL);
2127 if (!context)
2130 context->flags = cpu_to_be32((to_mlx4_state(new_state) << 28) |
2134 context->flags |= cpu_to_be32(MLX4_QP_PM_MIGRATED << 11);
2139 context->flags |= cpu_to_be32(MLX4_QP_PM_MIGRATED << 11);
2142 context->flags |= cpu_to_be32(MLX4_QP_PM_REARM << 11);
2145 context->flags |= cpu_to_be32(MLX4_QP_PM_ARMED << 11);
2151 context->param3 |= cpu_to_be32(1 << 25);
2154 context->param3 |= cpu_to_be32(1 << 29);
2157 context->mtu_msgmax = (IB_MTU_4096 << 5) | 11;
2159 context->mtu_msgmax = (MLX4_RAW_QP_MTU << 5) | MLX4_RAW_QP_MSGMAX;
2162 context->mtu_msgmax = (IB_MTU_4096 << 5) |
2165 context->mtu_msgmax = (IB_MTU_4096 << 5) | 13;
2172 context->mtu_msgmax = (attr->path_mtu << 5) |
2178 context->rq_size_stride = ilog2(qp->rq.wqe_cnt) << 3;
2179 context->rq_size_stride |= qp->rq.wqe_shift - 4;
2183 context->sq_size_stride = ilog2(qp->sq.wqe_cnt) << 3;
2184 context->sq_size_stride |= qp->sq.wqe_shift - 4;
2190 context->sq_size_stride |= !!qp->sq_no_prefetch << 7;
2191 context->xrcd = cpu_to_be32((u32) qp->xrcdn);
2193 context->param3 |= cpu_to_be32(1 << 30);
2197 context->usr_page = cpu_to_be32(
2200 context->usr_page = cpu_to_be32(
2204 context->remote_qpn = cpu_to_be32(attr->dest_qp_num);
2209 mlx4_set_sched(&context->pri_path, attr->port_num);
2225 context->pri_path.counter_index = counter_index;
2228 context->pri_path.fl |=
2230 context->pri_path.vlan_control |=
2234 context->pri_path.counter_index =
2247 context->rlkey_roce_mode |= (qpc_roce_mode << 6);
2253 context->pri_path.disable_pkey_check = 0x40;
2254 context->pri_path.pkey_index = attr->pkey_index;
2275 if (mlx4_set_path(dev, attr, attr_mask, qp, &context->pri_path,
2290 context->rlkey_roce_mode |= (qpc_roce_mode << 6);
2296 context->pri_path.ackto |= attr->timeout << 3;
2310 &context->alt_path,
2314 context->alt_path.pkey_index = attr->alt_pkey_index;
2315 context->alt_path.ackto = attr->alt_timeout << 3;
2319 context->pd = cpu_to_be32(pd->pdn);
2322 context->params1 = cpu_to_be32(MLX4_IB_ACK_REQ_FREQ << 28);
2328 context->cqn_send = cpu_to_be32(send_cq->mcq.cqn);
2329 context->cqn_recv = cpu_to_be32(recv_cq->mcq.cqn);
2333 context->params1 |= cpu_to_be32(1 << 11);
2336 context->params1 |= cpu_to_be32(attr->rnr_retry << 13);
2341 context->params1 |= cpu_to_be32(attr->retry_cnt << 16);
2347 context->params1 |=
2353 context->next_send_psn = cpu_to_be32(attr->sq_psn);
2357 context->params2 |=
2363 context->params2 |= to_mlx4_access_flags(qp, attr, attr_mask);
2368 context->params2 |= cpu_to_be32(MLX4_QP_BIT_RIC);
2371 context->rnr_nextrecvpsn |= cpu_to_be32(attr->min_rnr_timer << 24);
2375 context->rnr_nextrecvpsn |= cpu_to_be32(attr->rq_psn);
2381 context->qkey = cpu_to_be32(IB_QP_SET_QKEY);
2393 context->qkey = cpu_to_be32(attr->qkey);
2399 context->srqn = cpu_to_be32(1 << 24 |
2405 context->db_rec_addr = cpu_to_be64(qp->db.dma);
2411 context->pri_path.sched_queue = (qp->port - 1) << 6;
2415 context->pri_path.sched_queue |= MLX4_IB_DEFAULT_QP0_SCHED_QUEUE;
2417 context->pri_path.fl = 0x80;
2420 context->pri_path.fl = 0x80;
2421 context->pri_path.sched_queue |= MLX4_IB_DEFAULT_SCHED_QUEUE;
2427 context->pri_path.feup = 1 << 7; /* don't fsm */
2432 err = handle_eth_ud_smac_index(dev, qp, context);
2444 context->pri_path.ackto = (context->pri_path.ackto & 0xf8) |
2449 context->srqn = cpu_to_be32(7 << 28);
2458 context->pri_path.ackto = MLX4_IB_LINK_TYPE_ETH;
2472 context->rlkey_roce_mode |= (1 << 4);
2498 fill_qp_rss_context(context, qp);
2499 context->flags |= cpu_to_be32(1 << MLX4_RSS_QPC_FLAG_OFFSET);
2503 to_mlx4_state(new_state), context, optpar,
2589 kfree(context);
3359 /* Use QKEY from the QP context, which is set by master */
3982 struct mlx4_qp_context context;
3996 err = mlx4_qp_query(dev->dev, &qp->mqp, &context);
4002 mlx4_state = be32_to_cpu(context.flags) >> 28;
4006 qp_attr->path_mtu = context.mtu_msgmax >> 5;
4008 to_ib_mig_state((be32_to_cpu(context.flags) >> 11) & 0x3);
4009 qp_attr->qkey = be32_to_cpu(context.qkey);
4010 qp_attr->rq_psn = be32_to_cpu(context.rnr_nextrecvpsn) & 0xffffff;
4011 qp_attr->sq_psn = be32_to_cpu(context.next_send_psn) & 0xffffff;
4012 qp_attr->dest_qp_num = be32_to_cpu(context.remote_qpn) & 0xffffff;
4014 to_ib_qp_access_flags(be32_to_cpu(context.params2));
4017 to_rdma_ah_attr(dev, &qp_attr->ah_attr, &context.pri_path);
4018 to_rdma_ah_attr(dev, &qp_attr->alt_ah_attr, &context.alt_path);
4019 qp_attr->alt_pkey_index = context.alt_path.pkey_index & 0x7f;
4024 qp_attr->pkey_index = context.pri_path.pkey_index & 0x7f;
4028 qp_attr->port_num = context.pri_path.sched_queue & 0x40 ? 2 : 1;
4033 qp_attr->max_rd_atomic = 1 << ((be32_to_cpu(context.params1) >> 21) & 0x7);
4036 1 << ((be32_to_cpu(context.params2) >> 21) & 0x7);
4038 (be32_to_cpu(context.rnr_nextrecvpsn) >> 24) & 0x1f;
4039 qp_attr->timeout = context.pri_path.ackto >> 3;
4040 qp_attr->retry_cnt = (be32_to_cpu(context.params1) >> 16) & 0x7;
4041 qp_attr->rnr_retry = (be32_to_cpu(context.params1) >> 13) & 0x7;
4042 qp_attr->alt_timeout = context.alt_path.ackto >> 3;