Re: [PATCH 2/2] svcrdma: Remove extra writeargs sanity check for NFSv2/3

2014-07-11 Thread J. Bruce Fields
On Thu, Jul 10, 2014 at 04:43:54PM -0400, Chuck Lever wrote:
> I think the sanity check you pointed out is strictly satisfied by
> testing against the unaligned number of bytes. Is there a strong
> reason to do the extra math for that check during each WRITE?

I can't think of any good reason why the check should be against the
rounded-up length.

So my worry was just a more general "uh-oh, a non-multiple-of-4-length
is pretty weird, future me may not remember that's a possibility."

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] cxgb4/iw_cxgb4: use firmware ord/ird resource limits

2014-07-11 Thread Hariprasad Shenai
Advertise a larger max read queue depth for qps, and gather the resource limits
from fw and use them to avoid exhaustinq all the resources.

Design:

cxgb4:

Obtain the max_ordird_qp and max_ird_adapter device params from FW
at init time and pass them up to the ULDs when they attach.  If these
parameters are not available, due to older firmware, then hard-code
the values based on the known values for older firmware.
iw_cxgb4:

Fix the c4iw_query_device() to report these correct values based on
adapter parameters.  ibv_query_device() will always return:

max_qp_rd_atom = max_qp_init_rd_atom = min(module_max, max_ordird_qp)
max_res_rd_atom = max_ird_adapter

Bump up the per qp max module option to 32, allowing it to be increased
by the user up to the device max of max_ordird_qp.  32 seems to be
sufficient to maximize throughput for streaming read benchmarks.

Fail connection setup if the negotiated IRD exhausts the available
adapter ird resources.  So the driver will track the amount of ird
resource in use and not send an RI_WR/INIT to FW that would reduce the
available ird resources below zero.

Signed-off-by: Steve Wise 
Signed-off-by: Hariprasad Shenai 
---
 drivers/infiniband/hw/cxgb4/cm.c|   80 ---
 drivers/infiniband/hw/cxgb4/device.c|2 +
 drivers/infiniband/hw/cxgb4/iw_cxgb4.h  |9 ++-
 drivers/infiniband/hw/cxgb4/provider.c  |6 +-
 drivers/infiniband/hw/cxgb4/qp.c|   53 +--
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h  |3 +
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |   18 +
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h  |2 +
 drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h   |2 +
 9 files changed, 141 insertions(+), 34 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index d62a0f9..df5bd3d 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -79,9 +79,10 @@ static int dack_mode = 1;
 module_param(dack_mode, int, 0644);
 MODULE_PARM_DESC(dack_mode, "Delayed ack mode (default=1)");
 
-int c4iw_max_read_depth = 8;
+uint c4iw_max_read_depth = 32;
 module_param(c4iw_max_read_depth, int, 0644);
-MODULE_PARM_DESC(c4iw_max_read_depth, "Per-connection max ORD/IRD 
(default=8)");
+MODULE_PARM_DESC(c4iw_max_read_depth,
+"Per-connection max ORD/IRD (default=32)");
 
 static int enable_tcp_timestamps;
 module_param(enable_tcp_timestamps, int, 0644);
@@ -813,6 +814,8 @@ static void send_mpa_req(struct c4iw_ep *ep, struct sk_buff 
*skb,
if (mpa_rev_to_use == 2) {
mpa->private_data_size = htons(ntohs(mpa->private_data_size) +
   sizeof (struct 
mpa_v2_conn_params));
+   PDBG("%s initiator ird %u ord %u\n", __func__, ep->ird,
+ep->ord);
mpa_v2_params.ird = htons((u16)ep->ird);
mpa_v2_params.ord = htons((u16)ep->ord);
 
@@ -1182,8 +1185,8 @@ static int connect_request_upcall(struct c4iw_ep *ep)
sizeof(struct mpa_v2_conn_params);
} else {
/* this means MPA_v1 is used. Send max supported */
-   event.ord = c4iw_max_read_depth;
-   event.ird = c4iw_max_read_depth;
+   event.ord = cur_max_read_depth(ep->com.dev);
+   event.ird = cur_max_read_depth(ep->com.dev);
event.private_data_len = ep->plen;
event.private_data = ep->mpa_pkt + sizeof(struct mpa_message);
}
@@ -1247,6 +1250,8 @@ static int update_rx_credits(struct c4iw_ep *ep, u32 
credits)
return credits;
 }
 
+#define RELAXED_IRD_NEGOTIATION 1
+
 static int process_mpa_reply(struct c4iw_ep *ep, struct sk_buff *skb)
 {
struct mpa_message *mpa;
@@ -1358,17 +1363,33 @@ static int process_mpa_reply(struct c4iw_ep *ep, struct 
sk_buff *skb)
MPA_V2_IRD_ORD_MASK;
resp_ord = ntohs(mpa_v2_params->ord) &
MPA_V2_IRD_ORD_MASK;
+   PDBG("%s responder ird %u ord %u ep ird %u ord %u\n",
+__func__, resp_ird, resp_ord, ep->ird, ep->ord);
 
/*
 * This is a double-check. Ideally, below checks are
 * not required since ird/ord stuff has been taken
 * care of in c4iw_accept_cr
 */
-   if ((ep->ird < resp_ord) || (ep->ord > resp_ird)) {
+   if (ep->ird < resp_ord) {
+   if (RELAXED_IRD_NEGOTIATION && resp_ord <=
+   ep->com.dev->rdev.lldi.max_ordird_qp)
+   ep->ird = resp_ord;
+   else
+   insuff_ird = 1;
+   } else if (ep

[PATCH 3/4] cxgb4/iw_cxgb4: display TPTE on errors

2014-07-11 Thread Hariprasad Shenai
With ingress WRITE or READ RESPONSE errors, HW provides the offending
stag from the packet.  This patch adds logic to log the parsed TPTE
in this case. cxgb4 now exports a function to read a TPTE entry
from adapter memory.

Signed-off-by: Steve Wise 
Signed-off-by: Hariprasad Shenai 
---
 drivers/infiniband/hw/cxgb4/device.c|   27 --
 drivers/infiniband/hw/cxgb4/ev.c|   53 --
 drivers/infiniband/hw/cxgb4/t4.h|4 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |   66 +++
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h  |1 +
 5 files changed, 140 insertions(+), 11 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/device.c 
b/drivers/infiniband/hw/cxgb4/device.c
index d2d3dba..e8b79a3 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -241,12 +241,31 @@ static int dump_stag(int id, void *p, void *data)
struct c4iw_debugfs_data *stagd = data;
int space;
int cc;
+   struct fw_ri_tpte tpte;
+   int ret;
 
space = stagd->bufsize - stagd->pos - 1;
if (space == 0)
return 1;
 
-   cc = snprintf(stagd->buf + stagd->pos, space, "0x%x\n", id<<8);
+   ret = cxgb4_read_tpte(stagd->devp->rdev.lldi.ports[0], (u32)id<<8,
+ (__be32 *)&tpte);
+   if (ret) {
+   pr_info("%s cxgb4_read_tpte err %d\n", __func__, ret);
+   return ret;
+   }
+   cc = snprintf(stagd->buf + stagd->pos, space,
+ "stag: idx 0x%x valid %d key 0x%x state %d pdid %d "
+ "perm 0x%x ps %d len 0x%llx va 0x%llx\n",
+ (u32)id<<8,
+ G_FW_RI_TPTE_VALID(ntohl(tpte.valid_to_pdid)),
+ G_FW_RI_TPTE_STAGKEY(ntohl(tpte.valid_to_pdid)),
+ G_FW_RI_TPTE_STAGSTATE(ntohl(tpte.valid_to_pdid)),
+ G_FW_RI_TPTE_PDID(ntohl(tpte.valid_to_pdid)),
+ G_FW_RI_TPTE_PERM(ntohl(tpte.locread_to_qpid)),
+ G_FW_RI_TPTE_PS(ntohl(tpte.locread_to_qpid)),
+ ((u64)ntohl(tpte.len_hi) << 32) | ntohl(tpte.len_lo),
+ ((u64)ntohl(tpte.va_hi) << 32) | ntohl(tpte.va_lo_fbo));
if (cc < space)
stagd->pos += cc;
return 0;
@@ -259,7 +278,7 @@ static int stag_release(struct inode *inode, struct file 
*file)
printk(KERN_INFO "%s null stagd?\n", __func__);
return 0;
}
-   kfree(stagd->buf);
+   vfree(stagd->buf);
kfree(stagd);
return 0;
 }
@@ -282,8 +301,8 @@ static int stag_open(struct inode *inode, struct file *file)
idr_for_each(&stagd->devp->mmidr, count_idrs, &count);
spin_unlock_irq(&stagd->devp->lock);
 
-   stagd->bufsize = count * sizeof("0x12345678\n");
-   stagd->buf = kmalloc(stagd->bufsize, GFP_KERNEL);
+   stagd->bufsize = count * 256;
+   stagd->buf = vmalloc(stagd->bufsize);
if (!stagd->buf) {
ret = -ENOMEM;
goto err1;
diff --git a/drivers/infiniband/hw/cxgb4/ev.c b/drivers/infiniband/hw/cxgb4/ev.c
index d61d0a1..97379f4 100644
--- a/drivers/infiniband/hw/cxgb4/ev.c
+++ b/drivers/infiniband/hw/cxgb4/ev.c
@@ -35,6 +35,53 @@
 
 #include "iw_cxgb4.h"
 
+static void print_tpte(struct c4iw_dev *dev, u32 stag)
+{
+   int ret;
+   struct fw_ri_tpte tpte;
+
+   ret = cxgb4_read_tpte(dev->rdev.lldi.ports[0], stag,
+ (__be32 *)&tpte);
+   if (ret) {
+   pr_err("%s cxgb4_read_tpte err %d\n", __func__, ret);
+   return;
+   }
+   pr_err("stag idx 0x%x valid %d key 0x%x state %d pdid %d "
+  "perm 0x%x ps %d len 0x%llx va 0x%llx\n",
+  stag & 0xff00,
+  G_FW_RI_TPTE_VALID(ntohl(tpte.valid_to_pdid)),
+  G_FW_RI_TPTE_STAGKEY(ntohl(tpte.valid_to_pdid)),
+  G_FW_RI_TPTE_STAGSTATE(ntohl(tpte.valid_to_pdid)),
+  G_FW_RI_TPTE_PDID(ntohl(tpte.valid_to_pdid)),
+  G_FW_RI_TPTE_PERM(ntohl(tpte.locread_to_qpid)),
+  G_FW_RI_TPTE_PS(ntohl(tpte.locread_to_qpid)),
+  ((u64)ntohl(tpte.len_hi) << 32) | ntohl(tpte.len_lo),
+  ((u64)ntohl(tpte.va_hi) << 32) | ntohl(tpte.va_lo_fbo));
+}
+
+static void dump_err_cqe(struct c4iw_dev *dev, struct t4_cqe *err_cqe)
+{
+   __be64 *p = (void *)err_cqe;
+
+   pr_err("AE qpid %d opcode %d status 0x%x "
+  "type %d len 0x%x wrid.hi 0x%x wrid.lo 0x%x\n",
+  CQE_QPID(err_cqe), CQE_OPCODE(err_cqe),
+  CQE_STATUS(err_cqe), CQE_TYPE(err_cqe), ntohl(err_cqe->len),
+  CQE_WRID_HI(err_cqe), CQE_WRID_LOW(err_cqe));
+
+   pr_err("%016llx %016llx %016llx %016llx\n",
+  be64_to_cpu(p[0]), be64_to_cpu(p[1]), be64_to_cpu(p[2]),
+  be64_to_cpu(p[3]));
+
+ 

[PATCH 4/4] cxgb4/iw_cxgb4: work request logging feature

2014-07-11 Thread Hariprasad Shenai
This commit enhances the iwarp driver to optionally keep a log of rdma
work request timining data for kernel mode QPs.  If iw_cxgb4 module option
c4iw_wr_log is set to non-zero, each work request is tracked and timing
data maintained in a rolling log that is 4096 entries deep by default.
Module option c4iw_wr_log_size_order allows specifing a log2 size to use
instead of the default order of 12 (4096 entries). Both module options
are read-only and must be passed in at module load time to set them. IE:

modprobe iw_cxgb4 c4iw_wr_log=1 c4iw_wr_log_size_order=10

The timing data is viewable via the iw_cxgb4 debugfs file "wr_log".
Writing anything to this file will clear all the timing data.
Data tracked includes:

- The host time when the work request was posted, just before ringing
the doorbell.  The host time when the completion was polled by the
application.  This is also the time the log entry is created.  The delta
of these two times is the amount of time took processing the work request.

- The qid of the EQ used to post the work request.

- The work request opcode.

- The cqe wr_id field.  For sq completions requests this is the swsqe
index.  For recv completions this is the MSN of the ingress SEND.
This value can be used to match log entries from this log with firmware
flowc event entries.

- The sge timestamp value just before ringing the doorbell when
posting,  the sge timestamp value just after polling the completion,
and CQE.timestamp field from the completion itself.  With these three
timestamps we can track the latency from post to poll, and the amount
of time the completion resided in the CQ before being reaped by the
application.  With debug firmware, the sge timestamp is also logged by
firmware in its flowc history so that we can compute the latency from
posting the work request until the firmware sees it.

Signed-off-by: Steve Wise 
Signed-off-by: Hariprasad Shenai 
---
 drivers/infiniband/hw/cxgb4/cq.c|4 +
 drivers/infiniband/hw/cxgb4/device.c|  137 +++
 drivers/infiniband/hw/cxgb4/iw_cxgb4.h  |   17 +++
 drivers/infiniband/hw/cxgb4/qp.c|   12 ++
 drivers/infiniband/hw/cxgb4/t4.h|4 +
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |   14 +++
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h  |2 +
 drivers/net/ethernet/chelsio/cxgb4/t4_regs.h|6 +
 8 files changed, 196 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
index f04a838..de9bcf2 100644
--- a/drivers/infiniband/hw/cxgb4/cq.c
+++ b/drivers/infiniband/hw/cxgb4/cq.c
@@ -633,11 +633,15 @@ proc_cqe:
wq->sq.cidx = (uint16_t)idx;
PDBG("%s completing sq idx %u\n", __func__, wq->sq.cidx);
*cookie = wq->sq.sw_sq[wq->sq.cidx].wr_id;
+   if (c4iw_wr_log)
+   c4iw_log_wr_stats(wq, hw_cqe);
t4_sq_consume(wq);
} else {
PDBG("%s completing rq idx %u\n", __func__, wq->rq.cidx);
*cookie = wq->rq.sw_rq[wq->rq.cidx].wr_id;
BUG_ON(t4_rq_empty(wq));
+   if (c4iw_wr_log)
+   c4iw_log_wr_stats(wq, hw_cqe);
t4_rq_consume(wq);
goto skip_cqe;
}
diff --git a/drivers/infiniband/hw/cxgb4/device.c 
b/drivers/infiniband/hw/cxgb4/device.c
index e8b79a3..f070b08 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -55,6 +55,15 @@ module_param(allow_db_coalescing_on_t5, int, 0644);
 MODULE_PARM_DESC(allow_db_coalescing_on_t5,
 "Allow DB Coalescing on T5 (default = 0)");
 
+int c4iw_wr_log = 0;
+module_param(c4iw_wr_log, int, 0444);
+MODULE_PARM_DESC(c4iw_wr_log, "Enables logging of work request timing data.");
+
+int c4iw_wr_log_size_order = 12;
+module_param(c4iw_wr_log_size_order, int, 0444);
+MODULE_PARM_DESC(c4iw_wr_log_size_order,
+"Number of entries (log2) in the work request timing log.");
+
 struct uld_ctx {
struct list_head entry;
struct cxgb4_lld_info lldi;
@@ -103,6 +112,117 @@ static ssize_t debugfs_read(struct file *file, char 
__user *buf, size_t count,
return simple_read_from_buffer(buf, count, ppos, d->buf, d->pos);
 }
 
+void c4iw_log_wr_stats(struct t4_wq *wq, struct t4_cqe *cqe)
+{
+   struct wr_log_entry le;
+   int idx;
+
+   if (!wq->rdev->wr_log)
+   return;
+
+   idx = (atomic_inc_return(&wq->rdev->wr_log_idx) - 1) &
+   (wq->rdev->wr_log_size - 1);
+   le.poll_sge_ts = cxgb4_read_sge_timestamp(wq->rdev->lldi.ports[0]);
+   getnstimeofday(&le.poll_host_ts);
+   le.valid = 1;
+   le.cqe_sge_ts = CQE_TS(cqe);
+   if (SQ_TYPE(cqe)) {
+   le.qid = wq->sq.qid;
+   le.opcode = CQE_OPCODE(cqe);
+   le.post_host_ts = wq->sq.sw_sq[wq->sq.cidx].host_ts;
+   le.post

[PATCH 1/4] iw_cxgb4: Detect Ing. Padding Boundary at run-time

2014-07-11 Thread Hariprasad Shenai
Updates iw_cxgb4 to determine the Ingress Padding Boundary from
cxgb4_lld_info, and take subsequent actions.

Signed-off-by: Steve Wise 
Signed-off-by: Hariprasad Shenai 
---
 drivers/infiniband/hw/cxgb4/cq.c|4 ++--
 drivers/infiniband/hw/cxgb4/device.c|   21 +
 drivers/infiniband/hw/cxgb4/iw_cxgb4.h  |   12 
 drivers/infiniband/hw/cxgb4/provider.c  |4 ++--
 drivers/infiniband/hw/cxgb4/qp.c|   10 ++
 drivers/infiniband/hw/cxgb4/t4.h|8 
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |2 ++
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h  |2 ++
 8 files changed, 47 insertions(+), 16 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
index c04292c..f04a838 100644
--- a/drivers/infiniband/hw/cxgb4/cq.c
+++ b/drivers/infiniband/hw/cxgb4/cq.c
@@ -895,7 +895,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int 
entries,
/*
 * Make actual HW queue 2x to avoid cdix_inc overflows.
 */
-   hwentries = min(entries * 2, T4_MAX_IQ_SIZE);
+   hwentries = min(entries * 2, rhp->rdev.hw_queue.t4_max_iq_size);
 
/*
 * Make HW queue at least 64 entries so GTS updates aren't too
@@ -912,7 +912,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int 
entries,
if (ucontext) {
memsize = roundup(memsize, PAGE_SIZE);
hwentries = memsize / sizeof *chp->cq.queue;
-   while (hwentries > T4_MAX_IQ_SIZE) {
+   while (hwentries > rhp->rdev.hw_queue.t4_max_iq_size) {
memsize -= PAGE_SIZE;
hwentries = memsize / sizeof *chp->cq.queue;
}
diff --git a/drivers/infiniband/hw/cxgb4/device.c 
b/drivers/infiniband/hw/cxgb4/device.c
index dd93aad..95e6c6c 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -768,6 +768,27 @@ static struct c4iw_dev *c4iw_alloc(const struct 
cxgb4_lld_info *infop)
}
devp->rdev.lldi = *infop;
 
+   /* init various hw-queue params based on lld info */
+   pr_info("%s: ing. padding boundary is %d, egrsstatuspagesize = %d\n",
+   __func__, devp->rdev.lldi.sge_ingpadboundary,
+   devp->rdev.lldi.sge_egrstatuspagesize);
+
+   devp->rdev.hw_queue.t4_eq_status_entries =
+   devp->rdev.lldi.sge_ingpadboundary > 64 ? 2 : 1;
+   devp->rdev.hw_queue.t4_max_eq_size =
+   65520 - devp->rdev.hw_queue.t4_eq_status_entries;
+   devp->rdev.hw_queue.t4_max_iq_size = 65520 - 1;
+   devp->rdev.hw_queue.t4_max_rq_size =
+   8192 - devp->rdev.hw_queue.t4_eq_status_entries;
+   devp->rdev.hw_queue.t4_max_sq_size =
+   devp->rdev.hw_queue.t4_max_eq_size - 1;
+   devp->rdev.hw_queue.t4_max_qp_depth =
+   devp->rdev.hw_queue.t4_max_rq_size - 1;
+   devp->rdev.hw_queue.t4_max_cq_depth =
+   devp->rdev.hw_queue.t4_max_iq_size - 1;
+   devp->rdev.hw_queue.t4_stat_len =
+   devp->rdev.lldi.sge_egrstatuspagesize;
+
/*
 * For T5 devices, we map all of BAR2 with WC.
 * For T4 devices with onchip qp mem, we map only that part
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h 
b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
index 125bc5d..9b9754c 100644
--- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
+++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
@@ -139,6 +139,17 @@ struct c4iw_stats {
u64  pas_ofld_conn_fails;
 };
 
+struct c4iw_hw_queue {
+   int t4_eq_status_entries;
+   int t4_max_eq_size;
+   int t4_max_iq_size;
+   int t4_max_rq_size;
+   int t4_max_sq_size;
+   int t4_max_qp_depth;
+   int t4_max_cq_depth;
+   int t4_stat_len;
+};
+
 struct c4iw_rdev {
struct c4iw_resource resource;
unsigned long qpshift;
@@ -156,6 +167,7 @@ struct c4iw_rdev {
unsigned long oc_mw_pa;
void __iomem *oc_mw_kva;
struct c4iw_stats stats;
+   struct c4iw_hw_queue hw_queue;
struct t4_dev_status_page *status_page;
 };
 
diff --git a/drivers/infiniband/hw/cxgb4/provider.c 
b/drivers/infiniband/hw/cxgb4/provider.c
index b1d3053..1d41b92 100644
--- a/drivers/infiniband/hw/cxgb4/provider.c
+++ b/drivers/infiniband/hw/cxgb4/provider.c
@@ -319,13 +319,13 @@ static int c4iw_query_device(struct ib_device *ibdev,
props->vendor_part_id = (u32)dev->rdev.lldi.pdev->device;
props->max_mr_size = T4_MAX_MR_SIZE;
props->max_qp = T4_MAX_NUM_QP;
-   props->max_qp_wr = T4_MAX_QP_DEPTH;
+   props->max_qp_wr = dev->rdev.hw_queue.t4_max_qp_depth;
props->max_sge = T4_MAX_RECV_SGE;
props->max_sge_rd = 1;
props->max_qp_rd_atom = c4iw_max_read_depth;
props->max_qp_init_rd_atom = c4iw_max_read_depth;
props->max_cq = T4_MAX_NUM_CQ;
-   prop

[PATCH 0/4] Misc. fixes for iw_cxgb4

2014-07-11 Thread Hariprasad Shenai
This patch series adds support to determine ingress padding boundary at runtime.
Advertise a larger max read queue depth for qps, and gather the resource limits
from fw and use them to avoid exhausting all the resources and display TPTE on
errors and add support for work request logging feature.

The patches series is created against 'net-next' tree.
And includes patches on cxgb4 and iw_cxgb4 driver.

Since this patch-series contains changes which are dependent on commit id
fc5ab02 ("cxgb4: Replaced the backdoor mechanism to access the HW memory with
PCIe Window method") of net-next tree, we would like to request this patch
series to get merged via David Miller's 'net-next' tree.

We have included all the maintainers of respective drivers. Kindly review the
change and let us know in case of any review comments.

Hariprasad Shenai (4):
  iw_cxgb4: Detect Ing. Padding Boundary at run-time
  cxgb4/iw_cxgb4: use firmware ord/ird resource limits
  cxgb4/iw_cxgb4: display TPTE on errors
  cxgb4/iw_cxgb4: work request logging feature

 drivers/infiniband/hw/cxgb4/cm.c|   80 +++---
 drivers/infiniband/hw/cxgb4/cq.c|8 +-
 drivers/infiniband/hw/cxgb4/device.c|  187 ++-
 drivers/infiniband/hw/cxgb4/ev.c|   53 ++-
 drivers/infiniband/hw/cxgb4/iw_cxgb4.h  |   38 +-
 drivers/infiniband/hw/cxgb4/provider.c  |   10 +-
 drivers/infiniband/hw/cxgb4/qp.c|   75 --
 drivers/infiniband/hw/cxgb4/t4.h|   16 +--
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h  |3 +
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |  100 
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h  |7 +
 drivers/net/ethernet/chelsio/cxgb4/t4_regs.h|6 +
 drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h   |2 +
 13 files changed, 524 insertions(+), 61 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH opensm] osm_subnet.c: Change default for perfmgr_query_cpi option

2014-07-11 Thread Hal Rosenstock

New default for PerfMgr query CPI is TRUE rather than FALSE.
More admins need to use this and this was too often being missed 
during configuration so make admins turn this off rather than on
(once enabling perfmgr itself).

Signed-off-by: Hal Rosenstock 
---
diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c
index 1065408..26fe78c 100644
--- a/opensm/osm_subnet.c
+++ b/opensm/osm_subnet.c
@@ -1564,7 +1564,7 @@ void osm_subn_set_default_opt(IN osm_subn_opt_t * p_opt)
p_opt->event_db_dump_file = NULL; /* use default */
p_opt->perfmgr_rm_nodes = TRUE;
p_opt->perfmgr_log_errors = TRUE;
-   p_opt->perfmgr_query_cpi = FALSE;
+   p_opt->perfmgr_query_cpi = TRUE;
p_opt->perfmgr_xmit_wait_log = FALSE;
p_opt->perfmgr_xmit_wait_threshold = 
OSM_PERFMGR_DEFAULT_XMIT_WAIT_THRESHOLD;
 #endif /* ENABLE_OSM_PERF_MGR */
@@ -2645,7 +2645,7 @@ int osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * 
p_opts)
"perfmgr_log_errors %s\n\n"
"# Query PerfMgt Get(ClassPortInfo) for extended capabilities\n"
"# Extended capabilities include 64 bit extended counters\n"
-   "# and transmit wait support (default FALSE)\n"
+   "# and transmit wait support (default TRUE)\n"
"perfmgr_query_cpi %s\n\n"
"# Log xmit_wait errors (default FALSE)\n"
"perfmgr_xmit_wait_log %s\n\n"
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC Patch V1 12/30] mm, IB/qib: Use cpu_to_mem()/numa_mem_id() to support memoryless node

2014-07-11 Thread Jiang Liu
When CONFIG_HAVE_MEMORYLESS_NODES is enabled, cpu_to_node()/numa_node_id()
may return a node without memory, and later cause system failure/panic
when calling kmalloc_node() and friends with returned node id.
So use cpu_to_mem()/numa_mem_id() instead to get the nearest node with
memory for the/current cpu.

If CONFIG_HAVE_MEMORYLESS_NODES is disabled, cpu_to_mem()/numa_mem_id()
is the same as cpu_to_node()/numa_node_id().

Signed-off-by: Jiang Liu 
---
 drivers/infiniband/hw/qib/qib_file_ops.c |4 ++--
 drivers/infiniband/hw/qib/qib_init.c |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c 
b/drivers/infiniband/hw/qib/qib_file_ops.c
index b15e34eeef68..55540295e0e3 100644
--- a/drivers/infiniband/hw/qib/qib_file_ops.c
+++ b/drivers/infiniband/hw/qib/qib_file_ops.c
@@ -1312,8 +1312,8 @@ static int setup_ctxt(struct qib_pportdata *ppd, int ctxt,
assign_ctxt_affinity(fp, dd);
 
numa_id = qib_numa_aware ? ((fd->rec_cpu_num != -1) ?
-   cpu_to_node(fd->rec_cpu_num) :
-   numa_node_id()) : dd->assigned_node_id;
+   cpu_to_mem(fd->rec_cpu_num) : numa_mem_id()) :
+   dd->assigned_node_id;
 
rcd = qib_create_ctxtdata(ppd, ctxt, numa_id);
 
diff --git a/drivers/infiniband/hw/qib/qib_init.c 
b/drivers/infiniband/hw/qib/qib_init.c
index 8d3c78ddc906..85ff56ad1075 100644
--- a/drivers/infiniband/hw/qib/qib_init.c
+++ b/drivers/infiniband/hw/qib/qib_init.c
@@ -133,7 +133,7 @@ int qib_create_ctxts(struct qib_devdata *dd)
int local_node_id = pcibus_to_node(dd->pcidev->bus);
 
if (local_node_id < 0)
-   local_node_id = numa_node_id();
+   local_node_id = numa_mem_id();
dd->assigned_node_id = local_node_id;
 
/*
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html