aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/qib/qib_verbs.c
diff options
context:
space:
mode:
authorMike Marciniszyn <mike.marciniszyn@intel.com>2013-06-15 17:07:03 -0400
committerRoland Dreier <roland@purestorage.com>2013-06-21 20:19:50 -0400
commitddb8876589702a9396d15d9d4075e6388d0600cf (patch)
treebd6f63590a238c2eec2706033b9cf15c14e12c7b /drivers/infiniband/hw/qib/qib_verbs.c
parent85caafe307a06e4f9993c8f3c994a07374c07831 (diff)
IB/qib: Convert opcode counters to per-context
This fix changes the opcode relative counters for receive to per context. Profiling has shown that when mulitple contexts are being used there is a lot of cache activity associated with these counters. The code formerly kept these counters per port, but only provided the interface to read per HCA. This patch converts the read of counters to per HCA and adds the debugfs hooks to be able to read the file as a sequence of opcodes. Reviewed-by: Dean Luick <dean.luick@intel.com> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_verbs.c')
-rw-r--r--drivers/infiniband/hw/qib/qib_verbs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c
index 904c384aa361..092b0bb1bb78 100644
--- a/drivers/infiniband/hw/qib/qib_verbs.c
+++ b/drivers/infiniband/hw/qib/qib_verbs.c
@@ -645,9 +645,11 @@ void qib_ib_rcv(struct qib_ctxtdata *rcd, void *rhdr, void *data, u32 tlen)
645 } else 645 } else
646 goto drop; 646 goto drop;
647 647
648 opcode = be32_to_cpu(ohdr->bth[0]) >> 24; 648 opcode = (be32_to_cpu(ohdr->bth[0]) >> 24) & 0x7f;
649 ibp->opstats[opcode & 0x7f].n_bytes += tlen; 649#ifdef CONFIG_DEBUG_FS
650 ibp->opstats[opcode & 0x7f].n_packets++; 650 rcd->opstats->stats[opcode].n_bytes += tlen;
651 rcd->opstats->stats[opcode].n_packets++;
652#endif
651 653
652 /* Get the destination QP number. */ 654 /* Get the destination QP number. */
653 qp_num = be32_to_cpu(ohdr->bth[1]) & QIB_QPN_MASK; 655 qp_num = be32_to_cpu(ohdr->bth[1]) & QIB_QPN_MASK;