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

Commit 4e396db8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  mlx4_core: Fix thinko in QP destroy (incorrect bitmap_free)
  RDMA/cxgb3: Set the max_qp_init_rd_atom attribute in query_device
  IB/ehca: Fix static rate calculation
  IB/ehca: Return physical link information in query_port()
  IB/ipath: Fix race with ACK retry timeout list management
  IB/ipath: Fix memory leak in ipath_resize_cq() if copy_to_user() fails
  mlx4_core: Fix possible bad free in mlx4_buf_free()
parents a052f447 e383d19e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1000,6 +1000,7 @@ static int iwch_query_device(struct ib_device *ibdev,
	props->max_sge = dev->attr.max_sge_per_wr;
	props->max_sge_rd = 1;
	props->max_qp_rd_atom = dev->attr.max_rdma_reads_per_qp;
	props->max_qp_init_rd_atom = dev->attr.max_rdma_reads_per_qp;
	props->max_cq = dev->attr.max_cqs;
	props->max_cqe = dev->attr.max_cqes_per_cq;
	props->max_mr = dev->attr.max_mem_regs;
+39 −9
Original line number Diff line number Diff line
@@ -50,6 +50,38 @@

static struct kmem_cache *av_cache;

int ehca_calc_ipd(struct ehca_shca *shca, int port,
		  enum ib_rate path_rate, u32 *ipd)
{
	int path = ib_rate_to_mult(path_rate);
	int link, ret;
	struct ib_port_attr pa;

	if (path_rate == IB_RATE_PORT_CURRENT) {
		*ipd = 0;
		return 0;
	}

	if (unlikely(path < 0)) {
		ehca_err(&shca->ib_device, "Invalid static rate! path_rate=%x",
			 path_rate);
		return -EINVAL;
	}

	ret = ehca_query_port(&shca->ib_device, port, &pa);
	if (unlikely(ret < 0)) {
		ehca_err(&shca->ib_device, "Failed to query port  ret=%i", ret);
		return ret;
	}

	link = ib_width_enum_to_int(pa.active_width) * pa.active_speed;

	/* IPD = round((link / path) - 1) */
	*ipd = ((link + (path >> 1)) / path) - 1;

	return 0;
}

struct ib_ah *ehca_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr)
{
	int ret;
@@ -69,15 +101,13 @@ struct ib_ah *ehca_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr)
	av->av.slid_path_bits = ah_attr->src_path_bits;

	if (ehca_static_rate < 0) {
		int ah_mult = ib_rate_to_mult(ah_attr->static_rate);
		int ehca_mult =
			ib_rate_to_mult(shca->sport[ah_attr->port_num].rate );

		if (ah_mult >= ehca_mult)
			av->av.ipd = 0;
		else
			av->av.ipd = (ah_mult > 0) ?
				((ehca_mult - 1) / ah_mult) : 0;
		u32 ipd;
		if (ehca_calc_ipd(shca, ah_attr->port_num,
				  ah_attr->static_rate, &ipd)) {
			ret = -EINVAL;
			goto create_ah_exit1;
		}
		av->av.ipd = ipd;
	} else
		av->av.ipd = ehca_static_rate;

+0 −1
Original line number Diff line number Diff line
@@ -95,7 +95,6 @@ struct ehca_sma_attr {
struct ehca_sport {
	struct ib_cq *ibcq_aqp1;
	struct ib_qp *ibqp_aqp1;
	enum ib_rate  rate;
	enum ib_port_state port_state;
	struct ehca_sma_attr saved_attr;
};
+14 −6
Original line number Diff line number Diff line
@@ -151,7 +151,6 @@ int ehca_query_port(struct ib_device *ibdev,
	}

	memset(props, 0, sizeof(struct ib_port_attr));
	props->state = rblock->state;

	switch (rblock->max_mtu) {
	case 0x1:
@@ -188,11 +187,20 @@ int ehca_query_port(struct ib_device *ibdev,
	props->subnet_timeout  = rblock->subnet_timeout;
	props->init_type_reply = rblock->init_type_reply;

	if (rblock->state && rblock->phys_width) {
		props->phys_state      = rblock->phys_pstate;
		props->state           = rblock->phys_state;
		props->active_width    = rblock->phys_width;
		props->active_speed    = rblock->phys_speed;
	} else {
		/* old firmware releases don't report physical
		 * port info, so use default values
		 */
		props->phys_state      = 5;
		props->state           = rblock->state;
		props->active_width    = IB_WIDTH_12X;
		props->active_speed    = 0x1;

	/* at the moment (logical) link state is always LINK_UP */
	props->phys_state      = 0x5;
	}

query_port1:
	ehca_free_fw_ctrlblock(rblock);
+3 −0
Original line number Diff line number Diff line
@@ -189,6 +189,9 @@ int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct *vma);

void ehca_poll_eqs(unsigned long data);

int ehca_calc_ipd(struct ehca_shca *shca, int port,
		  enum ib_rate path_rate, u32 *ipd);

#ifdef CONFIG_PPC_64K_PAGES
void *ehca_alloc_fw_ctrlblock(gfp_t flags);
void ehca_free_fw_ctrlblock(void *ptr);
Loading