提交 a51f06e1 编写于 作者: S Selvin Xavier 提交者: Roland Dreier

RDMA/ocrdma: Query controller information

Issue mailbox commands to query ocrdma controller information and phy
information and print them while adding ocrdma device.
Signed-off-by: NSelvin Xavier <selvin.xavier@emulex.com>
Signed-off-by: NDevesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 bbc5ec52
...@@ -2,4 +2,4 @@ ccflags-y := -Idrivers/net/ethernet/emulex/benet ...@@ -2,4 +2,4 @@ ccflags-y := -Idrivers/net/ethernet/emulex/benet
obj-$(CONFIG_INFINIBAND_OCRDMA) += ocrdma.o obj-$(CONFIG_INFINIBAND_OCRDMA) += ocrdma.o
ocrdma-y := ocrdma_main.o ocrdma_verbs.o ocrdma_hw.o ocrdma_ah.o ocrdma-y := ocrdma_main.o ocrdma_verbs.o ocrdma_hw.o ocrdma_ah.o ocrdma_stats.o
...@@ -44,10 +44,17 @@ ...@@ -44,10 +44,17 @@
#define OCRDMA_ROCE_DRV_DESC "Emulex OneConnect RoCE Driver" #define OCRDMA_ROCE_DRV_DESC "Emulex OneConnect RoCE Driver"
#define OCRDMA_NODE_DESC "Emulex OneConnect RoCE HCA" #define OCRDMA_NODE_DESC "Emulex OneConnect RoCE HCA"
#define OC_NAME_SH OCRDMA_NODE_DESC "(Skyhawk)"
#define OC_NAME_UNKNOWN OCRDMA_NODE_DESC "(Unknown)"
#define OC_SKH_DEVICE_PF 0x720
#define OC_SKH_DEVICE_VF 0x728
#define OCRDMA_MAX_AH 512 #define OCRDMA_MAX_AH 512
#define OCRDMA_UVERBS(CMD_NAME) (1ull << IB_USER_VERBS_CMD_##CMD_NAME) #define OCRDMA_UVERBS(CMD_NAME) (1ull << IB_USER_VERBS_CMD_##CMD_NAME)
#define convert_to_64bit(lo, hi) ((u64)hi << 32 | (u64)lo)
struct ocrdma_dev_attr { struct ocrdma_dev_attr {
u8 fw_ver[32]; u8 fw_ver[32];
u32 vendor_id; u32 vendor_id;
...@@ -86,6 +93,12 @@ struct ocrdma_dev_attr { ...@@ -86,6 +93,12 @@ struct ocrdma_dev_attr {
u8 num_ird_pages; u8 num_ird_pages;
}; };
struct ocrdma_dma_mem {
void *va;
dma_addr_t pa;
u32 size;
};
struct ocrdma_pbl { struct ocrdma_pbl {
void *va; void *va;
dma_addr_t pa; dma_addr_t pa;
...@@ -151,6 +164,26 @@ struct ocrdma_mr { ...@@ -151,6 +164,26 @@ struct ocrdma_mr {
struct ocrdma_hw_mr hwmr; struct ocrdma_hw_mr hwmr;
}; };
struct ocrdma_stats {
u8 type;
struct ocrdma_dev *dev;
};
struct stats_mem {
struct ocrdma_mqe mqe;
void *va;
dma_addr_t pa;
u32 size;
char *debugfs_mem;
};
struct phy_info {
u16 auto_speeds_supported;
u16 fixed_speeds_supported;
u16 phy_type;
u16 interface_type;
};
struct ocrdma_dev { struct ocrdma_dev {
struct ib_device ibdev; struct ib_device ibdev;
struct ocrdma_dev_attr attr; struct ocrdma_dev_attr attr;
...@@ -194,6 +227,9 @@ struct ocrdma_dev { ...@@ -194,6 +227,9 @@ struct ocrdma_dev {
struct mqe_ctx mqe_ctx; struct mqe_ctx mqe_ctx;
struct be_dev_info nic_info; struct be_dev_info nic_info;
struct phy_info phy;
char model_number[32];
u32 hba_port_num;
struct list_head entry; struct list_head entry;
struct rcu_head rcu; struct rcu_head rcu;
...@@ -201,6 +237,20 @@ struct ocrdma_dev { ...@@ -201,6 +237,20 @@ struct ocrdma_dev {
struct ocrdma_mr *stag_arr[OCRDMA_MAX_STAG]; struct ocrdma_mr *stag_arr[OCRDMA_MAX_STAG];
u16 pvid; u16 pvid;
u32 asic_id; u32 asic_id;
ulong last_stats_time;
struct mutex stats_lock; /* provide synch for debugfs operations */
struct stats_mem stats_mem;
struct ocrdma_stats rsrc_stats;
struct ocrdma_stats rx_stats;
struct ocrdma_stats wqe_stats;
struct ocrdma_stats tx_stats;
struct ocrdma_stats db_err_stats;
struct ocrdma_stats tx_qp_err_stats;
struct ocrdma_stats rx_qp_err_stats;
struct ocrdma_stats tx_dbg_stats;
struct ocrdma_stats rx_dbg_stats;
struct dentry *dir;
}; };
struct ocrdma_cq { struct ocrdma_cq {
...@@ -434,6 +484,17 @@ static inline int ocrdma_resolve_dmac(struct ocrdma_dev *dev, ...@@ -434,6 +484,17 @@ static inline int ocrdma_resolve_dmac(struct ocrdma_dev *dev,
return 0; return 0;
} }
static inline char *hca_name(struct ocrdma_dev *dev)
{
switch (dev->nic_info.pdev->device) {
case OC_SKH_DEVICE_PF:
case OC_SKH_DEVICE_VF:
return OC_NAME_SH;
default:
return OC_NAME_UNKNOWN;
}
}
static inline int ocrdma_get_eq_table_index(struct ocrdma_dev *dev, static inline int ocrdma_get_eq_table_index(struct ocrdma_dev *dev,
int eqid) int eqid)
{ {
......
...@@ -243,6 +243,23 @@ static int ocrdma_get_mbx_errno(u32 status) ...@@ -243,6 +243,23 @@ static int ocrdma_get_mbx_errno(u32 status)
return err_num; return err_num;
} }
char *port_speed_string(struct ocrdma_dev *dev)
{
char *str = "";
u16 speeds_supported;
speeds_supported = dev->phy.fixed_speeds_supported |
dev->phy.auto_speeds_supported;
if (speeds_supported & OCRDMA_PHY_SPEED_40GBPS)
str = "40Gbps ";
else if (speeds_supported & OCRDMA_PHY_SPEED_10GBPS)
str = "10Gbps ";
else if (speeds_supported & OCRDMA_PHY_SPEED_1GBPS)
str = "1Gbps ";
return str;
}
static int ocrdma_get_mbx_cqe_errno(u16 cqe_status) static int ocrdma_get_mbx_cqe_errno(u16 cqe_status)
{ {
int err_num = -EINVAL; int err_num = -EINVAL;
...@@ -332,6 +349,11 @@ static void *ocrdma_init_emb_mqe(u8 opcode, u32 cmd_len) ...@@ -332,6 +349,11 @@ static void *ocrdma_init_emb_mqe(u8 opcode, u32 cmd_len)
return mqe; return mqe;
} }
static void *ocrdma_alloc_mqe(void)
{
return kzalloc(sizeof(struct ocrdma_mqe), GFP_KERNEL);
}
static void ocrdma_free_q(struct ocrdma_dev *dev, struct ocrdma_queue_info *q) static void ocrdma_free_q(struct ocrdma_dev *dev, struct ocrdma_queue_info *q)
{ {
dma_free_coherent(&dev->nic_info.pdev->dev, q->size, q->va, q->dma); dma_free_coherent(&dev->nic_info.pdev->dev, q->size, q->va, q->dma);
...@@ -1154,6 +1176,96 @@ static int ocrdma_mbx_query_fw_config(struct ocrdma_dev *dev) ...@@ -1154,6 +1176,96 @@ static int ocrdma_mbx_query_fw_config(struct ocrdma_dev *dev)
return status; return status;
} }
int ocrdma_mbx_rdma_stats(struct ocrdma_dev *dev, bool reset)
{
struct ocrdma_rdma_stats_req *req = dev->stats_mem.va;
struct ocrdma_mqe *mqe = &dev->stats_mem.mqe;
struct ocrdma_rdma_stats_resp *old_stats = NULL;
int status;
old_stats = kzalloc(sizeof(*old_stats), GFP_KERNEL);
if (old_stats == NULL)
return -ENOMEM;
memset(mqe, 0, sizeof(*mqe));
mqe->hdr.pyld_len = dev->stats_mem.size;
mqe->hdr.spcl_sge_cnt_emb |=
(1 << OCRDMA_MQE_HDR_SGE_CNT_SHIFT) &
OCRDMA_MQE_HDR_SGE_CNT_MASK;
mqe->u.nonemb_req.sge[0].pa_lo = (u32) (dev->stats_mem.pa & 0xffffffff);
mqe->u.nonemb_req.sge[0].pa_hi = (u32) upper_32_bits(dev->stats_mem.pa);
mqe->u.nonemb_req.sge[0].len = dev->stats_mem.size;
/* Cache the old stats */
memcpy(old_stats, req, sizeof(struct ocrdma_rdma_stats_resp));
memset(req, 0, dev->stats_mem.size);
ocrdma_init_mch((struct ocrdma_mbx_hdr *)req,
OCRDMA_CMD_GET_RDMA_STATS,
OCRDMA_SUBSYS_ROCE,
dev->stats_mem.size);
if (reset)
req->reset_stats = reset;
status = ocrdma_nonemb_mbx_cmd(dev, mqe, dev->stats_mem.va);
if (status)
/* Copy from cache, if mbox fails */
memcpy(req, old_stats, sizeof(struct ocrdma_rdma_stats_resp));
else
ocrdma_le32_to_cpu(req, dev->stats_mem.size);
kfree(old_stats);
return status;
}
static int ocrdma_mbx_get_ctrl_attribs(struct ocrdma_dev *dev)
{
int status = -ENOMEM;
struct ocrdma_dma_mem dma;
struct ocrdma_mqe *mqe;
struct ocrdma_get_ctrl_attribs_rsp *ctrl_attr_rsp;
struct mgmt_hba_attribs *hba_attribs;
mqe = ocrdma_alloc_mqe();
if (!mqe)
return status;
memset(mqe, 0, sizeof(*mqe));
dma.size = sizeof(struct ocrdma_get_ctrl_attribs_rsp);
dma.va = dma_alloc_coherent(&dev->nic_info.pdev->dev,
dma.size, &dma.pa, GFP_KERNEL);
if (!dma.va)
goto free_mqe;
mqe->hdr.pyld_len = dma.size;
mqe->hdr.spcl_sge_cnt_emb |=
(1 << OCRDMA_MQE_HDR_SGE_CNT_SHIFT) &
OCRDMA_MQE_HDR_SGE_CNT_MASK;
mqe->u.nonemb_req.sge[0].pa_lo = (u32) (dma.pa & 0xffffffff);
mqe->u.nonemb_req.sge[0].pa_hi = (u32) upper_32_bits(dma.pa);
mqe->u.nonemb_req.sge[0].len = dma.size;
memset(dma.va, 0, dma.size);
ocrdma_init_mch((struct ocrdma_mbx_hdr *)dma.va,
OCRDMA_CMD_GET_CTRL_ATTRIBUTES,
OCRDMA_SUBSYS_COMMON,
dma.size);
status = ocrdma_nonemb_mbx_cmd(dev, mqe, dma.va);
if (!status) {
ctrl_attr_rsp = (struct ocrdma_get_ctrl_attribs_rsp *)dma.va;
hba_attribs = &ctrl_attr_rsp->ctrl_attribs.hba_attribs;
dev->hba_port_num = hba_attribs->phy_port;
strncpy(dev->model_number,
hba_attribs->controller_model_number, 31);
}
dma_free_coherent(&dev->nic_info.pdev->dev, dma.size, dma.va, dma.pa);
free_mqe:
kfree(mqe);
return status;
}
static int ocrdma_mbx_query_dev(struct ocrdma_dev *dev) static int ocrdma_mbx_query_dev(struct ocrdma_dev *dev)
{ {
int status = -ENOMEM; int status = -ENOMEM;
...@@ -1201,6 +1313,35 @@ int ocrdma_mbx_get_link_speed(struct ocrdma_dev *dev, u8 *lnk_speed) ...@@ -1201,6 +1313,35 @@ int ocrdma_mbx_get_link_speed(struct ocrdma_dev *dev, u8 *lnk_speed)
return status; return status;
} }
static int ocrdma_mbx_get_phy_info(struct ocrdma_dev *dev)
{
int status = -ENOMEM;
struct ocrdma_mqe *cmd;
struct ocrdma_get_phy_info_rsp *rsp;
cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_PHY_DETAILS, sizeof(*cmd));
if (!cmd)
return status;
ocrdma_init_mch((struct ocrdma_mbx_hdr *)&cmd->u.cmd[0],
OCRDMA_CMD_PHY_DETAILS, OCRDMA_SUBSYS_COMMON,
sizeof(*cmd));
status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
if (status)
goto mbx_err;
rsp = (struct ocrdma_get_phy_info_rsp *)cmd;
dev->phy.phy_type = le16_to_cpu(rsp->phy_type);
dev->phy.auto_speeds_supported =
le16_to_cpu(rsp->auto_speeds_supported);
dev->phy.fixed_speeds_supported =
le16_to_cpu(rsp->fixed_speeds_supported);
mbx_err:
kfree(cmd);
return status;
}
int ocrdma_mbx_alloc_pd(struct ocrdma_dev *dev, struct ocrdma_pd *pd) int ocrdma_mbx_alloc_pd(struct ocrdma_dev *dev, struct ocrdma_pd *pd)
{ {
int status = -ENOMEM; int status = -ENOMEM;
...@@ -2570,6 +2711,13 @@ int ocrdma_init_hw(struct ocrdma_dev *dev) ...@@ -2570,6 +2711,13 @@ int ocrdma_init_hw(struct ocrdma_dev *dev)
status = ocrdma_mbx_create_ah_tbl(dev); status = ocrdma_mbx_create_ah_tbl(dev);
if (status) if (status)
goto conf_err; goto conf_err;
status = ocrdma_mbx_get_phy_info(dev);
if (status)
goto conf_err;
status = ocrdma_mbx_get_ctrl_attribs(dev);
if (status)
goto conf_err;
return 0; return 0;
conf_err: conf_err:
......
...@@ -133,4 +133,6 @@ bool ocrdma_is_qp_in_rq_flushlist(struct ocrdma_cq *, struct ocrdma_qp *); ...@@ -133,4 +133,6 @@ bool ocrdma_is_qp_in_rq_flushlist(struct ocrdma_cq *, struct ocrdma_qp *);
void ocrdma_flush_qp(struct ocrdma_qp *); void ocrdma_flush_qp(struct ocrdma_qp *);
int ocrdma_get_irq(struct ocrdma_dev *dev, struct ocrdma_eq *eq); int ocrdma_get_irq(struct ocrdma_dev *dev, struct ocrdma_eq *eq);
int ocrdma_mbx_rdma_stats(struct ocrdma_dev *, bool reset);
char *port_speed_string(struct ocrdma_dev *dev);
#endif /* __OCRDMA_HW_H__ */ #endif /* __OCRDMA_HW_H__ */
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "ocrdma_ah.h" #include "ocrdma_ah.h"
#include "be_roce.h" #include "be_roce.h"
#include "ocrdma_hw.h" #include "ocrdma_hw.h"
#include "ocrdma_stats.h"
#include "ocrdma_abi.h" #include "ocrdma_abi.h"
MODULE_VERSION(OCRDMA_ROCE_DRV_VERSION); MODULE_VERSION(OCRDMA_ROCE_DRV_VERSION);
...@@ -372,6 +373,15 @@ static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info) ...@@ -372,6 +373,15 @@ static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info)
spin_lock(&ocrdma_devlist_lock); spin_lock(&ocrdma_devlist_lock);
list_add_tail_rcu(&dev->entry, &ocrdma_dev_list); list_add_tail_rcu(&dev->entry, &ocrdma_dev_list);
spin_unlock(&ocrdma_devlist_lock); spin_unlock(&ocrdma_devlist_lock);
/* Init stats */
ocrdma_add_port_stats(dev);
pr_info("%s %s: %s \"%s\" port %d\n",
dev_name(&dev->nic_info.pdev->dev), hca_name(dev),
port_speed_string(dev), dev->model_number,
dev->hba_port_num);
pr_info("%s ocrdma%d driver loaded successfully\n",
dev_name(&dev->nic_info.pdev->dev), dev->id);
return dev; return dev;
alloc_err: alloc_err:
...@@ -400,6 +410,7 @@ static void ocrdma_remove(struct ocrdma_dev *dev) ...@@ -400,6 +410,7 @@ static void ocrdma_remove(struct ocrdma_dev *dev)
/* first unregister with stack to stop all the active traffic /* first unregister with stack to stop all the active traffic
* of the registered clients. * of the registered clients.
*/ */
ocrdma_rem_port_stats(dev);
ib_unregister_device(&dev->ibdev); ib_unregister_device(&dev->ibdev);
spin_lock(&ocrdma_devlist_lock); spin_lock(&ocrdma_devlist_lock);
...@@ -492,6 +503,8 @@ static int __init ocrdma_init_module(void) ...@@ -492,6 +503,8 @@ static int __init ocrdma_init_module(void)
{ {
int status; int status;
ocrdma_init_debugfs();
status = register_inetaddr_notifier(&ocrdma_inetaddr_notifier); status = register_inetaddr_notifier(&ocrdma_inetaddr_notifier);
if (status) if (status)
return status; return status;
...@@ -513,6 +526,7 @@ static void __exit ocrdma_exit_module(void) ...@@ -513,6 +526,7 @@ static void __exit ocrdma_exit_module(void)
{ {
be_roce_unregister_driver(&ocrdma_drv); be_roce_unregister_driver(&ocrdma_drv);
ocrdma_unregister_inet6addr_notifier(); ocrdma_unregister_inet6addr_notifier();
ocrdma_rem_debugfs();
} }
module_init(ocrdma_init_module); module_init(ocrdma_init_module);
......
...@@ -72,6 +72,7 @@ enum { ...@@ -72,6 +72,7 @@ enum {
OCRDMA_CMD_ATTACH_MCAST, OCRDMA_CMD_ATTACH_MCAST,
OCRDMA_CMD_DETACH_MCAST, OCRDMA_CMD_DETACH_MCAST,
OCRDMA_CMD_GET_RDMA_STATS,
OCRDMA_CMD_MAX OCRDMA_CMD_MAX
}; };
...@@ -82,12 +83,14 @@ enum { ...@@ -82,12 +83,14 @@ enum {
OCRDMA_CMD_CREATE_CQ = 12, OCRDMA_CMD_CREATE_CQ = 12,
OCRDMA_CMD_CREATE_EQ = 13, OCRDMA_CMD_CREATE_EQ = 13,
OCRDMA_CMD_CREATE_MQ = 21, OCRDMA_CMD_CREATE_MQ = 21,
OCRDMA_CMD_GET_CTRL_ATTRIBUTES = 32,
OCRDMA_CMD_GET_FW_VER = 35, OCRDMA_CMD_GET_FW_VER = 35,
OCRDMA_CMD_DELETE_MQ = 53, OCRDMA_CMD_DELETE_MQ = 53,
OCRDMA_CMD_DELETE_CQ = 54, OCRDMA_CMD_DELETE_CQ = 54,
OCRDMA_CMD_DELETE_EQ = 55, OCRDMA_CMD_DELETE_EQ = 55,
OCRDMA_CMD_GET_FW_CONFIG = 58, OCRDMA_CMD_GET_FW_CONFIG = 58,
OCRDMA_CMD_CREATE_MQ_EXT = 90 OCRDMA_CMD_CREATE_MQ_EXT = 90,
OCRDMA_CMD_PHY_DETAILS = 102
}; };
enum { enum {
...@@ -578,6 +581,30 @@ enum { ...@@ -578,6 +581,30 @@ enum {
OCRDMA_FN_MODE_RDMA = 0x4 OCRDMA_FN_MODE_RDMA = 0x4
}; };
struct ocrdma_get_phy_info_rsp {
struct ocrdma_mqe_hdr hdr;
struct ocrdma_mbx_rsp rsp;
u16 phy_type;
u16 interface_type;
u32 misc_params;
u16 ext_phy_details;
u16 rsvd;
u16 auto_speeds_supported;
u16 fixed_speeds_supported;
u32 future_use[2];
};
enum {
OCRDMA_PHY_SPEED_ZERO = 0x0,
OCRDMA_PHY_SPEED_10MBPS = 0x1,
OCRDMA_PHY_SPEED_100MBPS = 0x2,
OCRDMA_PHY_SPEED_1GBPS = 0x4,
OCRDMA_PHY_SPEED_10GBPS = 0x8,
OCRDMA_PHY_SPEED_40GBPS = 0x20
};
struct ocrdma_get_link_speed_rsp { struct ocrdma_get_link_speed_rsp {
struct ocrdma_mqe_hdr hdr; struct ocrdma_mqe_hdr hdr;
struct ocrdma_mbx_rsp rsp; struct ocrdma_mbx_rsp rsp;
...@@ -1719,4 +1746,208 @@ struct ocrdma_av { ...@@ -1719,4 +1746,208 @@ struct ocrdma_av {
u32 valid; u32 valid;
} __packed; } __packed;
struct ocrdma_rsrc_stats {
u32 dpp_pds;
u32 non_dpp_pds;
u32 rc_dpp_qps;
u32 uc_dpp_qps;
u32 ud_dpp_qps;
u32 rc_non_dpp_qps;
u32 rsvd;
u32 uc_non_dpp_qps;
u32 ud_non_dpp_qps;
u32 rsvd1;
u32 srqs;
u32 rbqs;
u32 r64K_nsmr;
u32 r64K_to_2M_nsmr;
u32 r2M_to_44M_nsmr;
u32 r44M_to_1G_nsmr;
u32 r1G_to_4G_nsmr;
u32 nsmr_count_4G_to_32G;
u32 r32G_to_64G_nsmr;
u32 r64G_to_128G_nsmr;
u32 r128G_to_higher_nsmr;
u32 embedded_nsmr;
u32 frmr;
u32 prefetch_qps;
u32 ondemand_qps;
u32 phy_mr;
u32 mw;
u32 rsvd2[7];
};
struct ocrdma_db_err_stats {
u32 sq_doorbell_errors;
u32 cq_doorbell_errors;
u32 rq_srq_doorbell_errors;
u32 cq_overflow_errors;
u32 rsvd[4];
};
struct ocrdma_wqe_stats {
u32 large_send_rc_wqes_lo;
u32 large_send_rc_wqes_hi;
u32 large_write_rc_wqes_lo;
u32 large_write_rc_wqes_hi;
u32 rsvd[4];
u32 read_wqes_lo;
u32 read_wqes_hi;
u32 frmr_wqes_lo;
u32 frmr_wqes_hi;
u32 mw_bind_wqes_lo;
u32 mw_bind_wqes_hi;
u32 invalidate_wqes_lo;
u32 invalidate_wqes_hi;
u32 rsvd1[2];
u32 dpp_wqe_drops;
u32 rsvd2[5];
};
struct ocrdma_tx_stats {
u32 send_pkts_lo;
u32 send_pkts_hi;
u32 write_pkts_lo;
u32 write_pkts_hi;
u32 read_pkts_lo;
u32 read_pkts_hi;
u32 read_rsp_pkts_lo;
u32 read_rsp_pkts_hi;
u32 ack_pkts_lo;
u32 ack_pkts_hi;
u32 send_bytes_lo;
u32 send_bytes_hi;
u32 write_bytes_lo;
u32 write_bytes_hi;
u32 read_req_bytes_lo;
u32 read_req_bytes_hi;
u32 read_rsp_bytes_lo;
u32 read_rsp_bytes_hi;
u32 ack_timeouts;
u32 rsvd[5];
};
struct ocrdma_tx_qp_err_stats {
u32 local_length_errors;
u32 local_protection_errors;
u32 local_qp_operation_errors;
u32 retry_count_exceeded_errors;
u32 rnr_retry_count_exceeded_errors;
u32 rsvd[3];
};
struct ocrdma_rx_stats {
u32 roce_frame_bytes_lo;
u32 roce_frame_bytes_hi;
u32 roce_frame_icrc_drops;
u32 roce_frame_payload_len_drops;
u32 ud_drops;
u32 qp1_drops;
u32 psn_error_request_packets;
u32 psn_error_resp_packets;
u32 rnr_nak_timeouts;
u32 rnr_nak_receives;
u32 roce_frame_rxmt_drops;
u32 nak_count_psn_sequence_errors;
u32 rc_drop_count_lookup_errors;
u32 rq_rnr_naks;
u32 srq_rnr_naks;
u32 roce_frames_lo;
u32 roce_frames_hi;
u32 rsvd;
};
struct ocrdma_rx_qp_err_stats {
u32 nak_invalid_requst_errors;
u32 nak_remote_operation_errors;
u32 nak_count_remote_access_errors;
u32 local_length_errors;
u32 local_protection_errors;
u32 local_qp_operation_errors;
u32 rsvd[2];
};
struct ocrdma_tx_dbg_stats {
u32 data[100];
};
struct ocrdma_rx_dbg_stats {
u32 data[200];
};
struct ocrdma_rdma_stats_req {
struct ocrdma_mbx_hdr hdr;
u8 reset_stats;
u8 rsvd[3];
} __packed;
struct ocrdma_rdma_stats_resp {
struct ocrdma_mbx_hdr hdr;
struct ocrdma_rsrc_stats act_rsrc_stats;
struct ocrdma_rsrc_stats th_rsrc_stats;
struct ocrdma_db_err_stats db_err_stats;
struct ocrdma_wqe_stats wqe_stats;
struct ocrdma_tx_stats tx_stats;
struct ocrdma_tx_qp_err_stats tx_qp_err_stats;
struct ocrdma_rx_stats rx_stats;
struct ocrdma_rx_qp_err_stats rx_qp_err_stats;
struct ocrdma_tx_dbg_stats tx_dbg_stats;
struct ocrdma_rx_dbg_stats rx_dbg_stats;
} __packed;
struct mgmt_hba_attribs {
u8 flashrom_version_string[32];
u8 manufacturer_name[32];
u32 supported_modes;
u32 rsvd0[3];
u8 ncsi_ver_string[12];
u32 default_extended_timeout;
u8 controller_model_number[32];
u8 controller_description[64];
u8 controller_serial_number[32];
u8 ip_version_string[32];
u8 firmware_version_string[32];
u8 bios_version_string[32];
u8 redboot_version_string[32];
u8 driver_version_string[32];
u8 fw_on_flash_version_string[32];
u32 functionalities_supported;
u16 max_cdblength;
u8 asic_revision;
u8 generational_guid[16];
u8 hba_port_count;
u16 default_link_down_timeout;
u8 iscsi_ver_min_max;
u8 multifunction_device;
u8 cache_valid;
u8 hba_status;
u8 max_domains_supported;
u8 phy_port;
u32 firmware_post_status;
u32 hba_mtu[8];
u32 rsvd1[4];
};
struct mgmt_controller_attrib {
struct mgmt_hba_attribs hba_attribs;
u16 pci_vendor_id;
u16 pci_device_id;
u16 pci_sub_vendor_id;
u16 pci_sub_system_id;
u8 pci_bus_number;
u8 pci_device_number;
u8 pci_function_number;
u8 interface_type;
u64 unique_identifier;
u32 rsvd0[5];
};
struct ocrdma_get_ctrl_attribs_rsp {
struct ocrdma_mbx_hdr hdr;
struct mgmt_controller_attrib ctrl_attribs;
};
#endif /* __OCRDMA_SLI_H__ */ #endif /* __OCRDMA_SLI_H__ */
此差异已折叠。
/*******************************************************************
* This file is part of the Emulex RoCE Device Driver for *
* RoCE (RDMA over Converged Ethernet) adapters. *
* Copyright (C) 2008-2014 Emulex. All rights reserved. *
* EMULEX and SLI are trademarks of Emulex. *
* www.emulex.com *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of version 2 of the GNU General *
* Public License as published by the Free Software Foundation. *
* This program is distributed in the hope that it will be useful. *
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND *
* WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
* DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
* TO BE LEGALLY INVALID. See the GNU General Public License for *
* more details, a copy of which can be found in the file COPYING *
* included with this package. *
*
* Contact Information:
* linux-drivers@emulex.com
*
* Emulex
* 3333 Susan Street
* Costa Mesa, CA 92626
*******************************************************************/
#ifndef __OCRDMA_STATS_H__
#define __OCRDMA_STATS_H__
#include <linux/debugfs.h>
#include "ocrdma.h"
#include "ocrdma_hw.h"
#define OCRDMA_MAX_DBGFS_MEM 4096
enum OCRDMA_STATS_TYPE {
OCRDMA_RSRC_STATS,
OCRDMA_RXSTATS,
OCRDMA_WQESTATS,
OCRDMA_TXSTATS,
OCRDMA_DB_ERRSTATS,
OCRDMA_RXQP_ERRSTATS,
OCRDMA_TXQP_ERRSTATS,
OCRDMA_TX_DBG_STATS,
OCRDMA_RX_DBG_STATS
};
void ocrdma_rem_debugfs(void);
void ocrdma_init_debugfs(void);
void ocrdma_rem_port_stats(struct ocrdma_dev *dev);
void ocrdma_add_port_stats(struct ocrdma_dev *dev);
#endif /* __OCRDMA_STATS_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册