From patchwork Tue May 15 18:19:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Wise X-Patchwork-Id: 10401757 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 42F7C601E9 for ; Tue, 15 May 2018 18:23:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 321ED26E49 for ; Tue, 15 May 2018 18:23:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26839283BB; Tue, 15 May 2018 18:23:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91F0026E49 for ; Tue, 15 May 2018 18:23:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752392AbeEOSXi (ORCPT ); Tue, 15 May 2018 14:23:38 -0400 Received: from 72-48-214-68.dyn.grandenetworks.net ([72.48.214.68]:47684 "EHLO smtp.opengridcomputing.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751859AbeEOSXg (ORCPT ); Tue, 15 May 2018 14:23:36 -0400 Received: by smtp.opengridcomputing.com (Postfix, from userid 503) id 4C05D2B88F; Tue, 15 May 2018 13:23:35 -0500 (CDT) From: Steve Wise Date: Tue, 15 May 2018 11:19:21 -0700 Subject: [PATCH rdma-next] iw_cxgb4: remove wr_id attributes To: jgg@mellanox.com, dledford@redhat.com Cc: linux-rdma@vger.kernel.org Message-Id: <20180515182335.4C05D2B88F@smtp.opengridcomputing.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/infiniband/hw/cxgb4/restrack.c | 55 ---------------------------------- 1 file changed, 55 deletions(-) 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;