Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99f9f3d4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IB/mlx4: Make sure RQ allocation is always valid
  RDMA/cma: Fix initialization of next_port
  IB/mlx4: Fix zeroing of rnr_retry value in ib_modify_qp()
  mlx4_core: Don't set MTT address in dMPT entries with PA set
  mlx4_core: Check firmware command interface revision
  IB/mthca, mlx4_core: Fix typo in comment
  mlx4_core: Free catastrophic error MSI-X interrupt with correct dev_id
  mlx4_core: Initialize ctx_list and ctx_lock earlier
  mlx4_core: Fix CQ context layout
parents 22353f35 a4cd7ed8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2773,8 +2773,8 @@ static int cma_init(void)
	int ret;

	get_random_bytes(&next_port, sizeof next_port);
	next_port = (next_port % (sysctl_local_port_range[1] -
				  sysctl_local_port_range[0])) +
	next_port = ((unsigned int) next_port %
		    (sysctl_local_port_range[1] - sysctl_local_port_range[0])) +
		    sysctl_local_port_range[0];
	cma_wq = create_singlethread_workqueue("rdma_cm");
	if (!cma_wq)
+22 −11
Original line number Diff line number Diff line
@@ -189,18 +189,28 @@ static int send_wqe_overhead(enum ib_qp_type type)
}

static int set_rq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
		       struct mlx4_ib_qp *qp)
		       int is_user, int has_srq, struct mlx4_ib_qp *qp)
{
	/* Sanity check RQ size before proceeding */
	if (cap->max_recv_wr  > dev->dev->caps.max_wqes  ||
	    cap->max_recv_sge > dev->dev->caps.max_rq_sg)
		return -EINVAL;

	qp->rq.max = cap->max_recv_wr ? roundup_pow_of_two(cap->max_recv_wr) : 0;
	if (has_srq) {
		/* QPs attached to an SRQ should have no RQ */
		if (cap->max_recv_wr)
			return -EINVAL;

		qp->rq.max = qp->rq.max_gs = 0;
	} else {
		/* HW requires >= 1 RQ entry with >= 1 gather entry */
		if (is_user && (!cap->max_recv_wr || !cap->max_recv_sge))
			return -EINVAL;

	qp->rq.wqe_shift = ilog2(roundup_pow_of_two(cap->max_recv_sge *
						    sizeof (struct mlx4_wqe_data_seg)));
	qp->rq.max_gs    = (1 << qp->rq.wqe_shift) / sizeof (struct mlx4_wqe_data_seg);
		qp->rq.max	 = roundup_pow_of_two(max(1, cap->max_recv_wr));
		qp->rq.max_gs	 = roundup_pow_of_two(max(1, cap->max_recv_sge));
		qp->rq.wqe_shift = ilog2(qp->rq.max_gs * sizeof (struct mlx4_wqe_data_seg));
	}

	cap->max_recv_wr  = qp->rq.max;
	cap->max_recv_sge = qp->rq.max_gs;
@@ -285,7 +295,7 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
	qp->sq.head	    = 0;
	qp->sq.tail	    = 0;

	err = set_rq_size(dev, &init_attr->cap, qp);
	err = set_rq_size(dev, &init_attr->cap, !!pd->uobject, !!init_attr->srq, qp);
	if (err)
		goto err;

@@ -762,11 +772,6 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
		optpar |= MLX4_QP_OPTPAR_PKEY_INDEX;
	}

	if (attr_mask & IB_QP_RNR_RETRY) {
		context->params1 |= cpu_to_be32(attr->rnr_retry << 13);
		optpar |= MLX4_QP_OPTPAR_RNR_RETRY;
	}

	if (attr_mask & IB_QP_AV) {
		if (mlx4_set_path(dev, &attr->ah_attr, &context->pri_path,
				  attr_mask & IB_QP_PORT ? attr->port_num : qp->port)) {
@@ -802,6 +807,12 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,

	context->pd	    = cpu_to_be32(to_mpd(ibqp->pd)->pdn);
	context->params1    = cpu_to_be32(MLX4_IB_ACK_REQ_FREQ << 28);

	if (attr_mask & IB_QP_RNR_RETRY) {
		context->params1 |= cpu_to_be32(attr->rnr_retry << 13);
		optpar |= MLX4_QP_OPTPAR_RNR_RETRY;
	}

	if (attr_mask & IB_QP_RETRY_CNT) {
		context->params1 |= cpu_to_be32(attr->retry_cnt << 16);
		optpar |= MLX4_QP_OPTPAR_RETRY_COUNT;
+1 −1
Original line number Diff line number Diff line
@@ -772,7 +772,7 @@ int mthca_QUERY_FW(struct mthca_dev *dev, u8 *status)

	MTHCA_GET(dev->fw_ver,   outbox, QUERY_FW_VER_OFFSET);
	/*
	 * FW subminor version is at more signifant bits than minor
	 * FW subminor version is at more significant bits than minor
	 * version, so swap here.
	 */
	dev->fw_ver = (dev->fw_ver & 0xffff00000000ull) |
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ struct mlx4_cq_context {
	__be32			solicit_producer_index;
	__be32			consumer_index;
	__be32			producer_index;
	u8			reserved6[2];
	u32			reserved6[2];
	__be64			db_rec_addr;
};

+3 −1
Original line number Diff line number Diff line
@@ -490,9 +490,11 @@ static void mlx4_free_irqs(struct mlx4_dev *dev)

	if (eq_table->have_irq)
		free_irq(dev->pdev->irq, dev);
	for (i = 0; i < MLX4_NUM_EQ; ++i)
	for (i = 0; i < MLX4_EQ_CATAS; ++i)
		if (eq_table->eq[i].have_irq)
			free_irq(eq_table->eq[i].irq, eq_table->eq + i);
	if (eq_table->eq[MLX4_EQ_CATAS].have_irq)
		free_irq(eq_table->eq[MLX4_EQ_CATAS].irq, dev);
}

static int __devinit mlx4_map_clr_int(struct mlx4_dev *dev)
Loading