From patchwork Tue Oct 20 02:11:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 7441641 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4DC9D9F443 for ; Tue, 20 Oct 2015 02:12:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A9DE20785 for ; Tue, 20 Oct 2015 02:12:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 554062078B for ; Tue, 20 Oct 2015 02:12:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752098AbbJTCMY (ORCPT ); Mon, 19 Oct 2015 22:12:24 -0400 Received: from mga01.intel.com ([192.55.52.88]:44505 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752123AbbJTCMX (ORCPT ); Mon, 19 Oct 2015 22:12:23 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 19 Oct 2015 19:12:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,705,1437462000"; d="scan'208";a="584221808" Received: from phlsvsds.ph.intel.com ([10.228.195.38]) by FMSMGA003.fm.intel.com with ESMTP; 19 Oct 2015 19:12:22 -0700 Received: from phlsvsds.ph.intel.com (localhost.localdomain [127.0.0.1]) by phlsvsds.ph.intel.com (8.13.8/8.13.8) with ESMTP id t9K2CLnh008791; Mon, 19 Oct 2015 22:12:21 -0400 Received: (from iweiny@localhost) by phlsvsds.ph.intel.com (8.13.8/8.13.8/Submit) id t9K2CKTD008788; Mon, 19 Oct 2015 22:12:20 -0400 X-Authentication-Warning: phlsvsds.ph.intel.com: iweiny set sender to ira.weiny@intel.com using -f From: ira.weiny@intel.com To: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org Cc: dledford@redhat.com, linux-rdma@vger.kernel.org, dennis.dalessandro@intel.com, mike.marciniszyn@intel.com, Ira Weiny Subject: [PATCH v2 21/22] staging/rdma/hfi1: add additional rc traces Date: Mon, 19 Oct 2015 22:11:36 -0400 Message-Id: <1445307097-8244-22-git-send-email-ira.weiny@intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1445307097-8244-1-git-send-email-ira.weiny@intel.com> References: <1445307097-8244-1-git-send-email-ira.weiny@intel.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mike Marciniszyn Add additional rc traces to aid in debugging rc retry logic. Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Ira Weiny --- drivers/staging/rdma/hfi1/rc.c | 4 ++++ drivers/staging/rdma/hfi1/trace.c | 4 ++-- drivers/staging/rdma/hfi1/trace.h | 48 +++++++++++++++++++++++++++++---------- 3 files changed, 42 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rdma/hfi1/rc.c b/drivers/staging/rdma/hfi1/rc.c index 72d442143b1c..0b19206ff33e 100644 --- a/drivers/staging/rdma/hfi1/rc.c +++ b/drivers/staging/rdma/hfi1/rc.c @@ -927,6 +927,7 @@ static void rc_timeout(unsigned long arg) ibp->n_rc_timeouts++; qp->s_flags &= ~HFI1_S_TIMER; del_timer(&qp->s_timer); + trace_hfi1_rc_timeout(qp, qp->s_last_psn + 1); restart_rc(qp, qp->s_last_psn + 1, 1); hfi1_schedule_send(qp); } @@ -1442,6 +1443,8 @@ static void rc_rcv_resp(struct hfi1_ibport *ibp, spin_lock_irqsave(&qp->s_lock, flags); + trace_hfi1_rc_ack(qp, psn); + /* Ignore invalid responses. */ if (cmp_psn(psn, qp->s_next_psn) >= 0) goto ack_done; @@ -1630,6 +1633,7 @@ static noinline int rc_rcv_error(struct hfi1_other_headers *ohdr, void *data, u8 i, prev; int old_req; + trace_hfi1_rc_rcv_error(qp, psn); if (diff > 0) { /* * Packet sequence error. diff --git a/drivers/staging/rdma/hfi1/trace.c b/drivers/staging/rdma/hfi1/trace.c index 70ad7b9fc1ce..f55b75194847 100644 --- a/drivers/staging/rdma/hfi1/trace.c +++ b/drivers/staging/rdma/hfi1/trace.c @@ -126,13 +126,13 @@ const char *parse_everbs_hdrs( case OP(RC, ACKNOWLEDGE): trace_seq_printf(p, AETH_PRN, be32_to_cpu(eh->aeth) >> 24, - be32_to_cpu(eh->aeth) & HFI1_QPN_MASK); + be32_to_cpu(eh->aeth) & HFI1_MSN_MASK); break; /* aeth + atomicacketh */ case OP(RC, ATOMIC_ACKNOWLEDGE): trace_seq_printf(p, AETH_PRN " " ATOMICACKETH_PRN, (be32_to_cpu(eh->at.aeth) >> 24) & 0xff, - be32_to_cpu(eh->at.aeth) & HFI1_QPN_MASK, + be32_to_cpu(eh->at.aeth) & HFI1_MSN_MASK, (unsigned long long)ib_u64_get(eh->at.atomic_ack_eth)); break; /* atomiceth */ diff --git a/drivers/staging/rdma/hfi1/trace.h b/drivers/staging/rdma/hfi1/trace.h index 0354dca9a6f4..db51cf55c538 100644 --- a/drivers/staging/rdma/hfi1/trace.h +++ b/drivers/staging/rdma/hfi1/trace.h @@ -1290,37 +1290,61 @@ TRACE_EVENT(hfi1_sdma_state, #undef TRACE_SYSTEM #define TRACE_SYSTEM hfi1_rc -DECLARE_EVENT_CLASS(hfi1_sdma_rc, +DECLARE_EVENT_CLASS(hfi1_rc_template, TP_PROTO(struct hfi1_qp *qp, u32 psn), TP_ARGS(qp, psn), TP_STRUCT__entry( DD_DEV_ENTRY(dd_from_ibdev(qp->ibqp.device)) __field(u32, qpn) - __field(u32, flags) + __field(u32, s_flags) __field(u32, psn) - __field(u32, sending_psn) - __field(u32, sending_hpsn) + __field(u32, s_psn) + __field(u32, s_next_psn) + __field(u32, s_sending_psn) + __field(u32, s_sending_hpsn) + __field(u32, r_psn) ), TP_fast_assign( DD_DEV_ASSIGN(dd_from_ibdev(qp->ibqp.device)) __entry->qpn = qp->ibqp.qp_num; - __entry->flags = qp->s_flags; + __entry->s_flags = qp->s_flags; __entry->psn = psn; - __entry->sending_psn = qp->s_sending_psn; - __entry->sending_hpsn = qp->s_sending_hpsn; + __entry->s_psn = qp->s_psn; + __entry->s_next_psn = qp->s_next_psn; + __entry->s_sending_psn = qp->s_sending_psn; + __entry->s_sending_hpsn = qp->s_sending_hpsn; + __entry->r_psn = qp->r_psn; ), TP_printk( - "[%s] qpn 0x%x flags 0x%x psn 0x%x sending_psn 0x%x sending_hpsn 0x%x", + "[%s] qpn 0x%x s_flags 0x%x psn 0x%x s_psn 0x%x s_next_psn 0x%x s_sending_psn 0x%x sending_hpsn 0x%x r_psn 0x%x", __get_str(dev), __entry->qpn, - __entry->flags, + __entry->s_flags, __entry->psn, - __entry->sending_psn, - __entry->sending_psn + __entry->s_psn, + __entry->s_next_psn, + __entry->s_sending_psn, + __entry->s_sending_hpsn, + __entry->r_psn ) ); -DEFINE_EVENT(hfi1_sdma_rc, hfi1_rc_sendcomplete, +DEFINE_EVENT(hfi1_rc_template, hfi1_rc_sendcomplete, + TP_PROTO(struct hfi1_qp *qp, u32 psn), + TP_ARGS(qp, psn) +); + +DEFINE_EVENT(hfi1_rc_template, hfi1_rc_ack, + TP_PROTO(struct hfi1_qp *qp, u32 psn), + TP_ARGS(qp, psn) +); + +DEFINE_EVENT(hfi1_rc_template, hfi1_rc_timeout, + TP_PROTO(struct hfi1_qp *qp, u32 psn), + TP_ARGS(qp, psn) +); + +DEFINE_EVENT(hfi1_rc_template, hfi1_rc_rcv_error, TP_PROTO(struct hfi1_qp *qp, u32 psn), TP_ARGS(qp, psn) );