diff options
author | Mitesh Ahuja <mitesh.ahuja@emulex.com> | 2014-12-18 11:42:55 +0300 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2015-02-18 19:24:45 +0300 |
commit | cad1fbb0fd0e72ae2e7c18d486ff33e26c275f6c (patch) | |
tree | 2fa4be1805ec54facfdd987b23f85b8e563261e5 /drivers/infiniband/hw/ocrdma/ocrdma_ah.c | |
parent | bfa76d49576599a4b9f9b7a71f23d73d6dcff735 (diff) | |
download | linux-cad1fbb0fd0e72ae2e7c18d486ff33e26c275f6c.tar.xz |
RDMA/ocrdma: Add support for IB stack compliant stats in sysfs.
Add the following per-port sysfs traffic counters for RoCE:
port_xmit_packets
port_rcv_packets
port_rcv_data
port_xmit_data
Signed-off-by: Mitesh Ahuja <mitesh.ahuja@emulex.com>
Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: Selvin Xavier <selvin.xavier@emulex.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma_ah.c')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_ah.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c index f3cc8c9e65ae..b80b57b40043 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c @@ -29,11 +29,13 @@ #include <net/netevent.h> #include <rdma/ib_addr.h> +#include <rdma/ib_mad.h> #include "ocrdma.h" #include "ocrdma_verbs.h" #include "ocrdma_ah.h" #include "ocrdma_hw.h" +#include "ocrdma_stats.h" #define OCRDMA_VID_PCP_SHIFT 0xD @@ -191,5 +193,20 @@ int ocrdma_process_mad(struct ib_device *ibdev, struct ib_grh *in_grh, struct ib_mad *in_mad, struct ib_mad *out_mad) { - return IB_MAD_RESULT_SUCCESS; + int status; + struct ocrdma_dev *dev; + + switch (in_mad->mad_hdr.mgmt_class) { + case IB_MGMT_CLASS_PERF_MGMT: + dev = get_ocrdma_dev(ibdev); + if (!ocrdma_pma_counters(dev, out_mad)) + status = IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY; + else + status = IB_MAD_RESULT_SUCCESS; + break; + default: + status = IB_MAD_RESULT_SUCCESS; + break; + } + return status; } |