Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Broadcom NetXtreme-E RoCE driver.
0003  *
0004  * Copyright (c) 2016 - 2017, Broadcom. All rights reserved.  The term
0005  * Broadcom refers to Broadcom Limited and/or its subsidiaries.
0006  *
0007  * This software is available to you under a choice of one of two
0008  * licenses.  You may choose to be licensed under the terms of the GNU
0009  * General Public License (GPL) Version 2, available from the file
0010  * COPYING in the main directory of this source tree, or the
0011  * BSD license below:
0012  *
0013  * Redistribution and use in source and binary forms, with or without
0014  * modification, are permitted provided that the following conditions
0015  * are met:
0016  *
0017  * 1. Redistributions of source code must retain the above copyright
0018  *    notice, this list of conditions and the following disclaimer.
0019  * 2. Redistributions in binary form must reproduce the above copyright
0020  *    notice, this list of conditions and the following disclaimer in
0021  *    the documentation and/or other materials provided with the
0022  *    distribution.
0023  *
0024  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
0025  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
0026  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
0027  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
0028  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0029  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0030  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
0031  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
0032  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
0033  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
0034  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0035  *
0036  * Description: Statistics (header)
0037  *
0038  */
0039 
0040 #ifndef __BNXT_RE_HW_STATS_H__
0041 #define __BNXT_RE_HW_STATS_H__
0042 
0043 enum bnxt_re_hw_stats {
0044     BNXT_RE_ACTIVE_PD,
0045     BNXT_RE_ACTIVE_AH,
0046     BNXT_RE_ACTIVE_QP,
0047     BNXT_RE_ACTIVE_SRQ,
0048     BNXT_RE_ACTIVE_CQ,
0049     BNXT_RE_ACTIVE_MR,
0050     BNXT_RE_ACTIVE_MW,
0051     BNXT_RE_RX_PKTS,
0052     BNXT_RE_RX_BYTES,
0053     BNXT_RE_TX_PKTS,
0054     BNXT_RE_TX_BYTES,
0055     BNXT_RE_RECOVERABLE_ERRORS,
0056     BNXT_RE_RX_ERRORS,
0057     BNXT_RE_RX_DISCARDS,
0058     BNXT_RE_TO_RETRANSMITS,
0059     BNXT_RE_SEQ_ERR_NAKS_RCVD,
0060     BNXT_RE_MAX_RETRY_EXCEEDED,
0061     BNXT_RE_RNR_NAKS_RCVD,
0062     BNXT_RE_MISSING_RESP,
0063     BNXT_RE_UNRECOVERABLE_ERR,
0064     BNXT_RE_BAD_RESP_ERR,
0065     BNXT_RE_LOCAL_QP_OP_ERR,
0066     BNXT_RE_LOCAL_PROTECTION_ERR,
0067     BNXT_RE_MEM_MGMT_OP_ERR,
0068     BNXT_RE_REMOTE_INVALID_REQ_ERR,
0069     BNXT_RE_REMOTE_ACCESS_ERR,
0070     BNXT_RE_REMOTE_OP_ERR,
0071     BNXT_RE_DUP_REQ,
0072     BNXT_RE_RES_EXCEED_MAX,
0073     BNXT_RE_RES_LENGTH_MISMATCH,
0074     BNXT_RE_RES_EXCEEDS_WQE,
0075     BNXT_RE_RES_OPCODE_ERR,
0076     BNXT_RE_RES_RX_INVALID_RKEY,
0077     BNXT_RE_RES_RX_DOMAIN_ERR,
0078     BNXT_RE_RES_RX_NO_PERM,
0079     BNXT_RE_RES_RX_RANGE_ERR,
0080     BNXT_RE_RES_TX_INVALID_RKEY,
0081     BNXT_RE_RES_TX_DOMAIN_ERR,
0082     BNXT_RE_RES_TX_NO_PERM,
0083     BNXT_RE_RES_TX_RANGE_ERR,
0084     BNXT_RE_RES_IRRQ_OFLOW,
0085     BNXT_RE_RES_UNSUP_OPCODE,
0086     BNXT_RE_RES_UNALIGNED_ATOMIC,
0087     BNXT_RE_RES_REM_INV_ERR,
0088     BNXT_RE_RES_MEM_ERROR,
0089     BNXT_RE_RES_SRQ_ERR,
0090     BNXT_RE_RES_CMP_ERR,
0091     BNXT_RE_RES_INVALID_DUP_RKEY,
0092     BNXT_RE_RES_WQE_FORMAT_ERR,
0093     BNXT_RE_RES_CQ_LOAD_ERR,
0094     BNXT_RE_RES_SRQ_LOAD_ERR,
0095     BNXT_RE_RES_TX_PCI_ERR,
0096     BNXT_RE_RES_RX_PCI_ERR,
0097     BNXT_RE_OUT_OF_SEQ_ERR,
0098     BNXT_RE_TX_ATOMIC_REQ,
0099     BNXT_RE_TX_READ_REQ,
0100     BNXT_RE_TX_READ_RES,
0101     BNXT_RE_TX_WRITE_REQ,
0102     BNXT_RE_TX_SEND_REQ,
0103     BNXT_RE_RX_ATOMIC_REQ,
0104     BNXT_RE_RX_READ_REQ,
0105     BNXT_RE_RX_READ_RESP,
0106     BNXT_RE_RX_WRITE_REQ,
0107     BNXT_RE_RX_SEND_REQ,
0108     BNXT_RE_RX_ROCE_GOOD_PKTS,
0109     BNXT_RE_RX_ROCE_GOOD_BYTES,
0110     BNXT_RE_OOB,
0111     BNXT_RE_NUM_EXT_COUNTERS
0112 };
0113 
0114 #define BNXT_RE_NUM_STD_COUNTERS (BNXT_RE_OUT_OF_SEQ_ERR + 1)
0115 
0116 struct bnxt_re_rstat {
0117     struct bnxt_qplib_roce_stats    errs;
0118     struct bnxt_qplib_ext_stat      ext_stat;
0119 };
0120 
0121 struct bnxt_re_stats {
0122     struct bnxt_re_rstat            rstat;
0123 };
0124 
0125 struct rdma_hw_stats *bnxt_re_ib_alloc_hw_port_stats(struct ib_device *ibdev,
0126                              u32 port_num);
0127 int bnxt_re_ib_get_hw_stats(struct ib_device *ibdev,
0128                 struct rdma_hw_stats *stats,
0129                 u32 port, int index);
0130 #endif /* __BNXT_RE_HW_STATS_H__ */