diff mbox

[rdma-next] iw_cxgb4: remove wr_id attributes

Message ID 20180515182335.4C05D2B88F@smtp.opengridcomputing.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show

Commit Message

Steve Wise May 15, 2018, 6:19 p.m. UTC
Remove sq/rq wr_id attributes because typically they are pointers and
we don't want to pass up kernel pointers.

Fixes: 056f9c7f39bf ("iw_cxgb4: dump detailed driver-specific QP information")
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
 drivers/infiniband/hw/cxgb4/restrack.c | 55 ----------------------------------
 1 file changed, 55 deletions(-)

Comments

Jason Gunthorpe May 15, 2018, 11:15 p.m. UTC | #1
On Tue, May 15, 2018 at 11:19:21AM -0700, Steve Wise wrote:
> Remove sq/rq wr_id attributes because typically they are pointers and
> we don't want to pass up kernel pointers.
> 
> Fixes: 056f9c7f39bf ("iw_cxgb4: dump detailed driver-specific QP information")
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> ---
>  drivers/infiniband/hw/cxgb4/restrack.c | 55 ----------------------------------
>  1 file changed, 55 deletions(-)

Applied to for-next, thanks

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

Patch

diff --git a/drivers/infiniband/hw/cxgb4/restrack.c b/drivers/infiniband/hw/cxgb4/restrack.c
index 8d1106b..b9724d0 100644
--- a/drivers/infiniband/hw/cxgb4/restrack.c
+++ b/drivers/infiniband/hw/cxgb4/restrack.c
@@ -97,8 +97,6 @@  static int fill_swsqe(struct sk_buff *msg, struct t4_sq *sq, u16 idx,
 		goto err;
 	if (rdma_nl_put_driver_u32(msg, "opcode", sqe->opcode))
 		goto err;
-	if (rdma_nl_put_driver_u64_hex(msg, "wr_id", sqe->wr_id))
-		goto err;
 	if (rdma_nl_put_driver_u32(msg, "complete", sqe->complete))
 		goto err;
 	if (sqe->complete &&
@@ -134,50 +132,14 @@  static int fill_swsqes(struct sk_buff *msg, struct t4_sq *sq,
 	return -EMSGSIZE;
 }
 
-static int fill_swrqe(struct sk_buff *msg, struct t4_rq *rq, u16 idx,
-		      struct t4_swrqe *rqe)
-{
-	if (rdma_nl_put_driver_u32(msg, "idx", idx))
-		goto err;
-	if (rdma_nl_put_driver_u64_hex(msg, "wr_id", rqe->wr_id))
-		goto err;
-	return 0;
-err:
-	return -EMSGSIZE;
-}
-
-/*
- * Dump the first and last pending rqes.
- */
-static int fill_swrqes(struct sk_buff *msg, struct t4_rq *rq,
-		       u16 first_idx, struct t4_swrqe *first_rqe,
-		       u16 last_idx, struct t4_swrqe *last_rqe)
-{
-	if (!first_rqe)
-		goto out;
-	if (fill_swrqe(msg, rq, first_idx, first_rqe))
-		goto err;
-	if (!last_rqe)
-		goto out;
-	if (fill_swrqe(msg, rq, last_idx, last_rqe))
-		goto err;
-out:
-	return 0;
-err:
-	return -EMSGSIZE;
-}
-
 static int fill_res_qp_entry(struct sk_buff *msg,
 			     struct rdma_restrack_entry *res)
 {
 	struct ib_qp *ibqp = container_of(res, struct ib_qp, res);
 	struct t4_swsqe *fsp = NULL, *lsp = NULL;
-	struct t4_swrqe *frp = NULL, *lrp = NULL;
 	struct c4iw_qp *qhp = to_c4iw_qp(ibqp);
 	u16 first_sq_idx = 0, last_sq_idx = 0;
-	u16 first_rq_idx = 0, last_rq_idx = 0;
 	struct t4_swsqe first_sqe, last_sqe;
-	struct t4_swrqe first_rqe, last_rqe;
 	struct nlattr *table_attr;
 	struct t4_wq wq;
 
@@ -206,20 +168,6 @@  static int fill_res_qp_entry(struct sk_buff *msg,
 			lsp = &last_sqe;
 		}
 	}
-
-	/* If there are any pending rqes, copy the first and last */
-	if (wq.rq.cidx != wq.rq.pidx) {
-		first_rq_idx = wq.rq.cidx;
-		first_rqe = qhp->wq.rq.sw_rq[first_rq_idx];
-		frp = &first_rqe;
-		last_rq_idx = wq.rq.pidx;
-		if (last_rq_idx-- == 0)
-			last_rq_idx = wq.rq.size - 1;
-		if (last_rq_idx != first_rq_idx) {
-			last_rqe = qhp->wq.rq.sw_rq[last_rq_idx];
-			lrp = &last_rqe;
-		}
-	}
 	spin_unlock_irq(&qhp->lock);
 
 	if (fill_sq(msg, &wq))
@@ -231,9 +179,6 @@  static int fill_res_qp_entry(struct sk_buff *msg,
 	if (fill_rq(msg, &wq))
 		goto err_cancel_table;
 
-	if (fill_swrqes(msg, &wq.rq, first_rq_idx, frp, last_rq_idx, lrp))
-		goto err_cancel_table;
-
 	nla_nest_end(msg, table_attr);
 	return 0;