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

Commit 2d630d1a 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: Add helper to move QP to ready-to-send
  mlx4_core: Add HW queues allocation helpers
  RDMA/nes: Remove volatile qualifier from struct nes_hw_cq.cq_vbase
  mlx4_core: CQ resizing should pass a 0 opcode modifier to MODIFY_CQ
  mlx4_core: Move kernel doorbell management into core
  IB/ehca: Bump version number to 0026
  IB/ehca: Make some module parameters bool, update descriptions
  IB/ehca: Remove mr_largepage parameter
  IB/ehca: Move high-volume debug output to higher debug levels
  IB/ehca: Prevent posting of SQ WQEs if QP not in RTS
  IPoIB: Handle 4K IB MTU for UD (datagram) mode
  RDMA/nes: Fix adapter reset after PXE boot
  RDMA/nes: Print IPv4 addresses in a readable format
  RDMA/nes: Use print_mac() to format ethernet addresses for printing
parents f375d558 ed4d3c10
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ struct ehca_qp {
	};
	u32 qp_type;
	enum ehca_ext_qp_type ext_type;
	enum ib_qp_state state;
	struct ipz_queue ipz_squeue;
	struct ipz_queue ipz_rqueue;
	struct h_galpas galpas;
+1 −1
Original line number Diff line number Diff line
@@ -633,7 +633,7 @@ static inline int find_next_online_cpu(struct ehca_comp_pool *pool)
	unsigned long flags;

	WARN_ON_ONCE(!in_interrupt());
	if (ehca_debug_level)
	if (ehca_debug_level >= 3)
		ehca_dmp(&cpu_online_map, sizeof(cpumask_t), "");

	spin_lock_irqsave(&pool->last_cpu_lock, flags);
+32 −43
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@
#include "ehca_tools.h"
#include "hcp_if.h"

#define HCAD_VERSION "0025"
#define HCAD_VERSION "0026"

MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Christoph Raisch <raisch@de.ibm.com>");
@@ -60,7 +60,6 @@ MODULE_VERSION(HCAD_VERSION);
static int ehca_open_aqp1     = 0;
static int ehca_hw_level      = 0;
static int ehca_poll_all_eqs  = 1;
static int ehca_mr_largepage  = 1;

int ehca_debug_level   = 0;
int ehca_nr_ports      = 2;
@@ -70,45 +69,40 @@ int ehca_static_rate = -1;
int ehca_scaling_code  = 0;
int ehca_lock_hcalls   = -1;

module_param_named(open_aqp1,     ehca_open_aqp1,     int, S_IRUGO);
module_param_named(open_aqp1,     ehca_open_aqp1,     bool, S_IRUGO);
module_param_named(debug_level,   ehca_debug_level,   int,  S_IRUGO);
module_param_named(hw_level,      ehca_hw_level,      int,  S_IRUGO);
module_param_named(nr_ports,      ehca_nr_ports,      int,  S_IRUGO);
module_param_named(use_hp_mr,     ehca_use_hp_mr,     int, S_IRUGO);
module_param_named(use_hp_mr,     ehca_use_hp_mr,     bool, S_IRUGO);
module_param_named(port_act_time, ehca_port_act_time, int,  S_IRUGO);
module_param_named(poll_all_eqs,  ehca_poll_all_eqs,  int, S_IRUGO);
module_param_named(poll_all_eqs,  ehca_poll_all_eqs,  bool, S_IRUGO);
module_param_named(static_rate,   ehca_static_rate,   int,  S_IRUGO);
module_param_named(scaling_code,  ehca_scaling_code,  int, S_IRUGO);
module_param_named(mr_largepage,  ehca_mr_largepage,  int, S_IRUGO);
module_param_named(scaling_code,  ehca_scaling_code,  bool, S_IRUGO);
module_param_named(lock_hcalls,   ehca_lock_hcalls,   bool, S_IRUGO);

MODULE_PARM_DESC(open_aqp1,
		 "AQP1 on startup (0: no (default), 1: yes)");
		 "Open AQP1 on startup (default: no)");
MODULE_PARM_DESC(debug_level,
		 "debug level"
		 " (0: no debug traces (default), 1: with debug traces)");
		 "Amount of debug output (0: none (default), 1: traces, "
		 "2: some dumps, 3: lots)");
MODULE_PARM_DESC(hw_level,
		 "hardware level"
		 " (0: autosensing (default), 1: v. 0.20, 2: v. 0.21)");
		 "Hardware level (0: autosensing (default), "
		 "0x10..0x14: eHCA, 0x20..0x23: eHCA2)");
MODULE_PARM_DESC(nr_ports,
		 "number of connected ports (-1: autodetect, 1: port one only, "
		 "2: two ports (default)");
MODULE_PARM_DESC(use_hp_mr,
		 "high performance MRs (0: no (default), 1: yes)");
		 "Use high performance MRs (default: no)");
MODULE_PARM_DESC(port_act_time,
		 "time to wait for port activation (default: 30 sec)");
		 "Time to wait for port activation (default: 30 sec)");
MODULE_PARM_DESC(poll_all_eqs,
		 "polls all event queues periodically"
		 " (0: no, 1: yes (default))");
		 "Poll all event queues periodically (default: yes)");
MODULE_PARM_DESC(static_rate,
		 "set permanent static rate (default: disabled)");
		 "Set permanent static rate (default: no static rate)");
MODULE_PARM_DESC(scaling_code,
		 "set scaling code (0: disabled/default, 1: enabled)");
MODULE_PARM_DESC(mr_largepage,
		 "use large page for MR (0: use PAGE_SIZE (default), "
		 "1: use large page depending on MR size");
		 "Enable scaling code (default: no)");
MODULE_PARM_DESC(lock_hcalls,
		 "serialize all hCalls made by the driver "
		 "Serialize all hCalls made by the driver "
		 "(default: autodetect)");

DEFINE_RWLOCK(ehca_qp_idr_lock);
@@ -275,6 +269,7 @@ static int ehca_sense_attributes(struct ehca_shca *shca)
	u64 h_ret;
	struct hipz_query_hca *rblock;
	struct hipz_query_port *port;
	const char *loc_code;

	static const u32 pgsize_map[] = {
		HCA_CAP_MR_PGSIZE_4K,  0x1000,
@@ -283,6 +278,12 @@ static int ehca_sense_attributes(struct ehca_shca *shca)
		HCA_CAP_MR_PGSIZE_16M, 0x1000000,
	};

	ehca_gen_dbg("Probing adapter %s...",
		     shca->ofdev->node->full_name);
	loc_code = of_get_property(shca->ofdev->node, "ibm,loc-code", NULL);
	if (loc_code)
		ehca_gen_dbg(" ... location lode=%s", loc_code);

	rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
	if (!rblock) {
		ehca_gen_err("Cannot allocate rblock memory.");
@@ -350,11 +351,9 @@ static int ehca_sense_attributes(struct ehca_shca *shca)

	/* translate supported MR page sizes; always support 4K */
	shca->hca_cap_mr_pgsize = EHCA_PAGESIZE;
	if (ehca_mr_largepage) { /* support extra sizes only if enabled */
	for (i = 0; i < ARRAY_SIZE(pgsize_map); i += 2)
		if (rblock->memory_page_size_supported & pgsize_map[i])
			shca->hca_cap_mr_pgsize |= pgsize_map[i + 1];
	}

	/* query max MTU from first port -- it's the same for all ports */
	port = (struct hipz_query_port *)rblock;
@@ -567,8 +566,7 @@ static int ehca_destroy_aqp1(struct ehca_sport *sport)

static ssize_t ehca_show_debug_level(struct device_driver *ddp, char *buf)
{
	return snprintf(buf, PAGE_SIZE, "%d\n",
			ehca_debug_level);
	return snprintf(buf, PAGE_SIZE, "%d\n", ehca_debug_level);
}

static ssize_t ehca_store_debug_level(struct device_driver *ddp,
@@ -657,14 +655,6 @@ static ssize_t ehca_show_adapter_handle(struct device *dev,
}
static DEVICE_ATTR(adapter_handle, S_IRUGO, ehca_show_adapter_handle, NULL);

static ssize_t ehca_show_mr_largepage(struct device *dev,
				      struct device_attribute *attr,
				      char *buf)
{
	return sprintf(buf, "%d\n", ehca_mr_largepage);
}
static DEVICE_ATTR(mr_largepage, S_IRUGO, ehca_show_mr_largepage, NULL);

static struct attribute *ehca_dev_attrs[] = {
	&dev_attr_adapter_handle.attr,
	&dev_attr_num_ports.attr,
@@ -681,7 +671,6 @@ static struct attribute *ehca_dev_attrs[] = {
	&dev_attr_cur_mw.attr,
	&dev_attr_max_pd.attr,
	&dev_attr_max_ah.attr,
	&dev_attr_mr_largepage.attr,
	NULL
};

+10 −6
Original line number Diff line number Diff line
@@ -1794,6 +1794,7 @@ static int ehca_check_kpages_per_ate(struct scatterlist *page_list,
	int t;
	for (t = start_idx; t <= end_idx; t++) {
		u64 pgaddr = page_to_pfn(sg_page(&page_list[t])) << PAGE_SHIFT;
		if (ehca_debug_level >= 3)
			ehca_gen_dbg("chunk_page=%lx value=%016lx", pgaddr,
				     *(u64 *)abs_to_virt(phys_to_abs(pgaddr)));
		if (pgaddr - PAGE_SIZE != *prev_pgaddr) {
@@ -1862,10 +1863,13 @@ static int ehca_set_pagebuf_user2(struct ehca_mr_pginfo *pginfo,
						pgaddr &
						~(pginfo->hwpage_size - 1));
				}
				if (ehca_debug_level >= 3) {
					u64 val = *(u64 *)abs_to_virt(
						phys_to_abs(pgaddr));
					ehca_gen_dbg("kpage=%lx chunk_page=%lx "
					     "value=%016lx", *kpage, pgaddr,
					     *(u64 *)abs_to_virt(
						     phys_to_abs(pgaddr)));
						     "value=%016lx",
						     *kpage, pgaddr, val);
				}
				prev_pgaddr = pgaddr;
				i++;
				pginfo->kpage_cnt++;
+9 −6
Original line number Diff line number Diff line
@@ -550,6 +550,7 @@ static struct ehca_qp *internal_create_qp(
	spin_lock_init(&my_qp->spinlock_r);
	my_qp->qp_type = qp_type;
	my_qp->ext_type = parms.ext_type;
	my_qp->state = IB_QPS_RESET;

	if (init_attr->recv_cq)
		my_qp->recv_cq =
@@ -965,7 +966,7 @@ static int prepare_sqe_rts(struct ehca_qp *my_qp, struct ehca_shca *shca,
		 qp_num, bad_send_wqe_p);
	/* convert wqe pointer to vadr */
	bad_send_wqe_v = abs_to_virt((u64)bad_send_wqe_p);
	if (ehca_debug_level)
	if (ehca_debug_level >= 2)
		ehca_dmp(bad_send_wqe_v, 32, "qp_num=%x bad_wqe", qp_num);
	squeue = &my_qp->ipz_squeue;
	if (ipz_queue_abs_to_offset(squeue, (u64)bad_send_wqe_p, &q_ofs)) {
@@ -978,7 +979,7 @@ static int prepare_sqe_rts(struct ehca_qp *my_qp, struct ehca_shca *shca,
	wqe = (struct ehca_wqe *)ipz_qeit_calc(squeue, q_ofs);
	*bad_wqe_cnt = 0;
	while (wqe->optype != 0xff && wqe->wqef != 0xff) {
		if (ehca_debug_level)
		if (ehca_debug_level >= 2)
			ehca_dmp(wqe, 32, "qp_num=%x wqe", qp_num);
		wqe->nr_of_data_seg = 0; /* suppress data access */
		wqe->wqef = WQEF_PURGE; /* WQE to be purged */
@@ -1450,7 +1451,7 @@ static int internal_modify_qp(struct ib_qp *ibqp,
		/* no support for max_send/recv_sge yet */
	}

	if (ehca_debug_level)
	if (ehca_debug_level >= 2)
		ehca_dmp(mqpcb, 4*70, "qp_num=%x", ibqp->qp_num);

	h_ret = hipz_h_modify_qp(shca->ipz_hca_handle,
@@ -1508,6 +1509,8 @@ static int internal_modify_qp(struct ib_qp *ibqp,
	if (attr_mask & IB_QP_QKEY)
		my_qp->qkey = attr->qkey;

	my_qp->state = qp_new_state;

modify_qp_exit2:
	if (squeue_locked) { /* this means: sqe -> rts */
		spin_unlock_irqrestore(&my_qp->spinlock_s, flags);
@@ -1763,7 +1766,7 @@ int ehca_query_qp(struct ib_qp *qp,
	if (qp_init_attr)
		*qp_init_attr = my_qp->init_attr;

	if (ehca_debug_level)
	if (ehca_debug_level >= 2)
		ehca_dmp(qpcb, 4*70, "qp_num=%x", qp->qp_num);

query_qp_exit1:
@@ -1811,7 +1814,7 @@ int ehca_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
		goto modify_srq_exit0;
	}

	if (ehca_debug_level)
	if (ehca_debug_level >= 2)
		ehca_dmp(mqpcb, 4*70, "qp_num=%x", my_qp->real_qp_num);

	h_ret = hipz_h_modify_qp(shca->ipz_hca_handle, my_qp->ipz_qp_handle,
@@ -1864,7 +1867,7 @@ int ehca_query_srq(struct ib_srq *srq, struct ib_srq_attr *srq_attr)
	srq_attr->srq_limit = EHCA_BMASK_GET(
		MQPCB_CURR_SRQ_LIMIT, qpcb->curr_srq_limit);

	if (ehca_debug_level)
	if (ehca_debug_level >= 2)
		ehca_dmp(qpcb, 4*70, "qp_num=%x", my_qp->real_qp_num);

query_srq_exit1:
Loading