Lines Matching +full:pa +full:- +full:stats
3 * Copyright (C) 2012-2015 Emulex. All rights reserved.
16 * - Redistributions of source code must retain the above copyright notice,
19 * - Redistributions in binary form must reproduce the above copyright
36 * linux-drivers@emulex.com
59 pr_err("%s: No space in stats buff\n", __func__); in ocrdma_add_stat()
69 struct stats_mem *mem = &dev->stats_mem; in ocrdma_alloc_stats_resources()
71 mutex_init(&dev->stats_lock); in ocrdma_alloc_stats_resources()
73 mem->size = max_t(u32, sizeof(struct ocrdma_rdma_stats_req), in ocrdma_alloc_stats_resources()
76 mem->va = dma_alloc_coherent(&dev->nic_info.pdev->dev, mem->size, in ocrdma_alloc_stats_resources()
77 &mem->pa, GFP_KERNEL); in ocrdma_alloc_stats_resources()
78 if (!mem->va) { in ocrdma_alloc_stats_resources()
79 pr_err("%s: stats mbox allocation failed\n", __func__); in ocrdma_alloc_stats_resources()
84 mem->debugfs_mem = kzalloc(OCRDMA_MAX_DBGFS_MEM, GFP_KERNEL); in ocrdma_alloc_stats_resources()
85 if (!mem->debugfs_mem) in ocrdma_alloc_stats_resources()
93 struct stats_mem *mem = &dev->stats_mem; in ocrdma_release_stats_resources()
95 if (mem->va) in ocrdma_release_stats_resources()
96 dma_free_coherent(&dev->nic_info.pdev->dev, mem->size, in ocrdma_release_stats_resources()
97 mem->va, mem->pa); in ocrdma_release_stats_resources()
98 mem->va = NULL; in ocrdma_release_stats_resources()
99 kfree(mem->debugfs_mem); in ocrdma_release_stats_resources()
104 char *stats = dev->stats_mem.debugfs_mem, *pcur; in ocrdma_resource_stats() local
106 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_resource_stats()
107 struct ocrdma_rsrc_stats *rsrc_stats = &rdma_stats->act_rsrc_stats; in ocrdma_resource_stats()
109 memset(stats, 0, (OCRDMA_MAX_DBGFS_MEM)); in ocrdma_resource_stats()
111 pcur = stats; in ocrdma_resource_stats()
112 pcur += ocrdma_add_stat(stats, pcur, "active_dpp_pds", in ocrdma_resource_stats()
113 (u64)rsrc_stats->dpp_pds); in ocrdma_resource_stats()
114 pcur += ocrdma_add_stat(stats, pcur, "active_non_dpp_pds", in ocrdma_resource_stats()
115 (u64)rsrc_stats->non_dpp_pds); in ocrdma_resource_stats()
116 pcur += ocrdma_add_stat(stats, pcur, "active_rc_dpp_qps", in ocrdma_resource_stats()
117 (u64)rsrc_stats->rc_dpp_qps); in ocrdma_resource_stats()
118 pcur += ocrdma_add_stat(stats, pcur, "active_uc_dpp_qps", in ocrdma_resource_stats()
119 (u64)rsrc_stats->uc_dpp_qps); in ocrdma_resource_stats()
120 pcur += ocrdma_add_stat(stats, pcur, "active_ud_dpp_qps", in ocrdma_resource_stats()
121 (u64)rsrc_stats->ud_dpp_qps); in ocrdma_resource_stats()
122 pcur += ocrdma_add_stat(stats, pcur, "active_rc_non_dpp_qps", in ocrdma_resource_stats()
123 (u64)rsrc_stats->rc_non_dpp_qps); in ocrdma_resource_stats()
124 pcur += ocrdma_add_stat(stats, pcur, "active_uc_non_dpp_qps", in ocrdma_resource_stats()
125 (u64)rsrc_stats->uc_non_dpp_qps); in ocrdma_resource_stats()
126 pcur += ocrdma_add_stat(stats, pcur, "active_ud_non_dpp_qps", in ocrdma_resource_stats()
127 (u64)rsrc_stats->ud_non_dpp_qps); in ocrdma_resource_stats()
128 pcur += ocrdma_add_stat(stats, pcur, "active_srqs", in ocrdma_resource_stats()
129 (u64)rsrc_stats->srqs); in ocrdma_resource_stats()
130 pcur += ocrdma_add_stat(stats, pcur, "active_rbqs", in ocrdma_resource_stats()
131 (u64)rsrc_stats->rbqs); in ocrdma_resource_stats()
132 pcur += ocrdma_add_stat(stats, pcur, "active_64K_nsmr", in ocrdma_resource_stats()
133 (u64)rsrc_stats->r64K_nsmr); in ocrdma_resource_stats()
134 pcur += ocrdma_add_stat(stats, pcur, "active_64K_to_2M_nsmr", in ocrdma_resource_stats()
135 (u64)rsrc_stats->r64K_to_2M_nsmr); in ocrdma_resource_stats()
136 pcur += ocrdma_add_stat(stats, pcur, "active_2M_to_44M_nsmr", in ocrdma_resource_stats()
137 (u64)rsrc_stats->r2M_to_44M_nsmr); in ocrdma_resource_stats()
138 pcur += ocrdma_add_stat(stats, pcur, "active_44M_to_1G_nsmr", in ocrdma_resource_stats()
139 (u64)rsrc_stats->r44M_to_1G_nsmr); in ocrdma_resource_stats()
140 pcur += ocrdma_add_stat(stats, pcur, "active_1G_to_4G_nsmr", in ocrdma_resource_stats()
141 (u64)rsrc_stats->r1G_to_4G_nsmr); in ocrdma_resource_stats()
142 pcur += ocrdma_add_stat(stats, pcur, "active_nsmr_count_4G_to_32G", in ocrdma_resource_stats()
143 (u64)rsrc_stats->nsmr_count_4G_to_32G); in ocrdma_resource_stats()
144 pcur += ocrdma_add_stat(stats, pcur, "active_32G_to_64G_nsmr", in ocrdma_resource_stats()
145 (u64)rsrc_stats->r32G_to_64G_nsmr); in ocrdma_resource_stats()
146 pcur += ocrdma_add_stat(stats, pcur, "active_64G_to_128G_nsmr", in ocrdma_resource_stats()
147 (u64)rsrc_stats->r64G_to_128G_nsmr); in ocrdma_resource_stats()
148 pcur += ocrdma_add_stat(stats, pcur, "active_128G_to_higher_nsmr", in ocrdma_resource_stats()
149 (u64)rsrc_stats->r128G_to_higher_nsmr); in ocrdma_resource_stats()
150 pcur += ocrdma_add_stat(stats, pcur, "active_embedded_nsmr", in ocrdma_resource_stats()
151 (u64)rsrc_stats->embedded_nsmr); in ocrdma_resource_stats()
152 pcur += ocrdma_add_stat(stats, pcur, "active_frmr", in ocrdma_resource_stats()
153 (u64)rsrc_stats->frmr); in ocrdma_resource_stats()
154 pcur += ocrdma_add_stat(stats, pcur, "active_prefetch_qps", in ocrdma_resource_stats()
155 (u64)rsrc_stats->prefetch_qps); in ocrdma_resource_stats()
156 pcur += ocrdma_add_stat(stats, pcur, "active_ondemand_qps", in ocrdma_resource_stats()
157 (u64)rsrc_stats->ondemand_qps); in ocrdma_resource_stats()
158 pcur += ocrdma_add_stat(stats, pcur, "active_phy_mr", in ocrdma_resource_stats()
159 (u64)rsrc_stats->phy_mr); in ocrdma_resource_stats()
160 pcur += ocrdma_add_stat(stats, pcur, "active_mw", in ocrdma_resource_stats()
161 (u64)rsrc_stats->mw); in ocrdma_resource_stats()
163 /* Print the threshold stats */ in ocrdma_resource_stats()
164 rsrc_stats = &rdma_stats->th_rsrc_stats; in ocrdma_resource_stats()
166 pcur += ocrdma_add_stat(stats, pcur, "threshold_dpp_pds", in ocrdma_resource_stats()
167 (u64)rsrc_stats->dpp_pds); in ocrdma_resource_stats()
168 pcur += ocrdma_add_stat(stats, pcur, "threshold_non_dpp_pds", in ocrdma_resource_stats()
169 (u64)rsrc_stats->non_dpp_pds); in ocrdma_resource_stats()
170 pcur += ocrdma_add_stat(stats, pcur, "threshold_rc_dpp_qps", in ocrdma_resource_stats()
171 (u64)rsrc_stats->rc_dpp_qps); in ocrdma_resource_stats()
172 pcur += ocrdma_add_stat(stats, pcur, "threshold_uc_dpp_qps", in ocrdma_resource_stats()
173 (u64)rsrc_stats->uc_dpp_qps); in ocrdma_resource_stats()
174 pcur += ocrdma_add_stat(stats, pcur, "threshold_ud_dpp_qps", in ocrdma_resource_stats()
175 (u64)rsrc_stats->ud_dpp_qps); in ocrdma_resource_stats()
176 pcur += ocrdma_add_stat(stats, pcur, "threshold_rc_non_dpp_qps", in ocrdma_resource_stats()
177 (u64)rsrc_stats->rc_non_dpp_qps); in ocrdma_resource_stats()
178 pcur += ocrdma_add_stat(stats, pcur, "threshold_uc_non_dpp_qps", in ocrdma_resource_stats()
179 (u64)rsrc_stats->uc_non_dpp_qps); in ocrdma_resource_stats()
180 pcur += ocrdma_add_stat(stats, pcur, "threshold_ud_non_dpp_qps", in ocrdma_resource_stats()
181 (u64)rsrc_stats->ud_non_dpp_qps); in ocrdma_resource_stats()
182 pcur += ocrdma_add_stat(stats, pcur, "threshold_srqs", in ocrdma_resource_stats()
183 (u64)rsrc_stats->srqs); in ocrdma_resource_stats()
184 pcur += ocrdma_add_stat(stats, pcur, "threshold_rbqs", in ocrdma_resource_stats()
185 (u64)rsrc_stats->rbqs); in ocrdma_resource_stats()
186 pcur += ocrdma_add_stat(stats, pcur, "threshold_64K_nsmr", in ocrdma_resource_stats()
187 (u64)rsrc_stats->r64K_nsmr); in ocrdma_resource_stats()
188 pcur += ocrdma_add_stat(stats, pcur, "threshold_64K_to_2M_nsmr", in ocrdma_resource_stats()
189 (u64)rsrc_stats->r64K_to_2M_nsmr); in ocrdma_resource_stats()
190 pcur += ocrdma_add_stat(stats, pcur, "threshold_2M_to_44M_nsmr", in ocrdma_resource_stats()
191 (u64)rsrc_stats->r2M_to_44M_nsmr); in ocrdma_resource_stats()
192 pcur += ocrdma_add_stat(stats, pcur, "threshold_44M_to_1G_nsmr", in ocrdma_resource_stats()
193 (u64)rsrc_stats->r44M_to_1G_nsmr); in ocrdma_resource_stats()
194 pcur += ocrdma_add_stat(stats, pcur, "threshold_1G_to_4G_nsmr", in ocrdma_resource_stats()
195 (u64)rsrc_stats->r1G_to_4G_nsmr); in ocrdma_resource_stats()
196 pcur += ocrdma_add_stat(stats, pcur, "threshold_nsmr_count_4G_to_32G", in ocrdma_resource_stats()
197 (u64)rsrc_stats->nsmr_count_4G_to_32G); in ocrdma_resource_stats()
198 pcur += ocrdma_add_stat(stats, pcur, "threshold_32G_to_64G_nsmr", in ocrdma_resource_stats()
199 (u64)rsrc_stats->r32G_to_64G_nsmr); in ocrdma_resource_stats()
200 pcur += ocrdma_add_stat(stats, pcur, "threshold_64G_to_128G_nsmr", in ocrdma_resource_stats()
201 (u64)rsrc_stats->r64G_to_128G_nsmr); in ocrdma_resource_stats()
202 pcur += ocrdma_add_stat(stats, pcur, "threshold_128G_to_higher_nsmr", in ocrdma_resource_stats()
203 (u64)rsrc_stats->r128G_to_higher_nsmr); in ocrdma_resource_stats()
204 pcur += ocrdma_add_stat(stats, pcur, "threshold_embedded_nsmr", in ocrdma_resource_stats()
205 (u64)rsrc_stats->embedded_nsmr); in ocrdma_resource_stats()
206 pcur += ocrdma_add_stat(stats, pcur, "threshold_frmr", in ocrdma_resource_stats()
207 (u64)rsrc_stats->frmr); in ocrdma_resource_stats()
208 pcur += ocrdma_add_stat(stats, pcur, "threshold_prefetch_qps", in ocrdma_resource_stats()
209 (u64)rsrc_stats->prefetch_qps); in ocrdma_resource_stats()
210 pcur += ocrdma_add_stat(stats, pcur, "threshold_ondemand_qps", in ocrdma_resource_stats()
211 (u64)rsrc_stats->ondemand_qps); in ocrdma_resource_stats()
212 pcur += ocrdma_add_stat(stats, pcur, "threshold_phy_mr", in ocrdma_resource_stats()
213 (u64)rsrc_stats->phy_mr); in ocrdma_resource_stats()
214 pcur += ocrdma_add_stat(stats, pcur, "threshold_mw", in ocrdma_resource_stats()
215 (u64)rsrc_stats->mw); in ocrdma_resource_stats()
216 return stats; in ocrdma_resource_stats()
221 char *stats = dev->stats_mem.debugfs_mem, *pcur; in ocrdma_rx_stats() local
223 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_rx_stats()
224 struct ocrdma_rx_stats *rx_stats = &rdma_stats->rx_stats; in ocrdma_rx_stats()
226 memset(stats, 0, (OCRDMA_MAX_DBGFS_MEM)); in ocrdma_rx_stats()
228 pcur = stats; in ocrdma_rx_stats()
230 (stats, pcur, "roce_frame_bytes", in ocrdma_rx_stats()
231 convert_to_64bit(rx_stats->roce_frame_bytes_lo, in ocrdma_rx_stats()
232 rx_stats->roce_frame_bytes_hi)); in ocrdma_rx_stats()
233 pcur += ocrdma_add_stat(stats, pcur, "roce_frame_icrc_drops", in ocrdma_rx_stats()
234 (u64)rx_stats->roce_frame_icrc_drops); in ocrdma_rx_stats()
235 pcur += ocrdma_add_stat(stats, pcur, "roce_frame_payload_len_drops", in ocrdma_rx_stats()
236 (u64)rx_stats->roce_frame_payload_len_drops); in ocrdma_rx_stats()
237 pcur += ocrdma_add_stat(stats, pcur, "ud_drops", in ocrdma_rx_stats()
238 (u64)rx_stats->ud_drops); in ocrdma_rx_stats()
239 pcur += ocrdma_add_stat(stats, pcur, "qp1_drops", in ocrdma_rx_stats()
240 (u64)rx_stats->qp1_drops); in ocrdma_rx_stats()
241 pcur += ocrdma_add_stat(stats, pcur, "psn_error_request_packets", in ocrdma_rx_stats()
242 (u64)rx_stats->psn_error_request_packets); in ocrdma_rx_stats()
243 pcur += ocrdma_add_stat(stats, pcur, "psn_error_resp_packets", in ocrdma_rx_stats()
244 (u64)rx_stats->psn_error_resp_packets); in ocrdma_rx_stats()
245 pcur += ocrdma_add_stat(stats, pcur, "rnr_nak_timeouts", in ocrdma_rx_stats()
246 (u64)rx_stats->rnr_nak_timeouts); in ocrdma_rx_stats()
247 pcur += ocrdma_add_stat(stats, pcur, "rnr_nak_receives", in ocrdma_rx_stats()
248 (u64)rx_stats->rnr_nak_receives); in ocrdma_rx_stats()
249 pcur += ocrdma_add_stat(stats, pcur, "roce_frame_rxmt_drops", in ocrdma_rx_stats()
250 (u64)rx_stats->roce_frame_rxmt_drops); in ocrdma_rx_stats()
251 pcur += ocrdma_add_stat(stats, pcur, "nak_count_psn_sequence_errors", in ocrdma_rx_stats()
252 (u64)rx_stats->nak_count_psn_sequence_errors); in ocrdma_rx_stats()
253 pcur += ocrdma_add_stat(stats, pcur, "rc_drop_count_lookup_errors", in ocrdma_rx_stats()
254 (u64)rx_stats->rc_drop_count_lookup_errors); in ocrdma_rx_stats()
255 pcur += ocrdma_add_stat(stats, pcur, "rq_rnr_naks", in ocrdma_rx_stats()
256 (u64)rx_stats->rq_rnr_naks); in ocrdma_rx_stats()
257 pcur += ocrdma_add_stat(stats, pcur, "srq_rnr_naks", in ocrdma_rx_stats()
258 (u64)rx_stats->srq_rnr_naks); in ocrdma_rx_stats()
259 pcur += ocrdma_add_stat(stats, pcur, "roce_frames", in ocrdma_rx_stats()
260 convert_to_64bit(rx_stats->roce_frames_lo, in ocrdma_rx_stats()
261 rx_stats->roce_frames_hi)); in ocrdma_rx_stats()
263 return stats; in ocrdma_rx_stats()
269 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_sysfs_rcv_pkts()
270 struct ocrdma_rx_stats *rx_stats = &rdma_stats->rx_stats; in ocrdma_sysfs_rcv_pkts()
272 return convert_to_64bit(rx_stats->roce_frames_lo, in ocrdma_sysfs_rcv_pkts()
273 rx_stats->roce_frames_hi) + (u64)rx_stats->roce_frame_icrc_drops in ocrdma_sysfs_rcv_pkts()
274 + (u64)rx_stats->roce_frame_payload_len_drops; in ocrdma_sysfs_rcv_pkts()
280 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_sysfs_rcv_data()
281 struct ocrdma_rx_stats *rx_stats = &rdma_stats->rx_stats; in ocrdma_sysfs_rcv_data()
283 return (convert_to_64bit(rx_stats->roce_frame_bytes_lo, in ocrdma_sysfs_rcv_data()
284 rx_stats->roce_frame_bytes_hi))/4; in ocrdma_sysfs_rcv_data()
289 char *stats = dev->stats_mem.debugfs_mem, *pcur; in ocrdma_tx_stats() local
291 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_tx_stats()
292 struct ocrdma_tx_stats *tx_stats = &rdma_stats->tx_stats; in ocrdma_tx_stats()
294 memset(stats, 0, (OCRDMA_MAX_DBGFS_MEM)); in ocrdma_tx_stats()
296 pcur = stats; in ocrdma_tx_stats()
297 pcur += ocrdma_add_stat(stats, pcur, "send_pkts", in ocrdma_tx_stats()
298 convert_to_64bit(tx_stats->send_pkts_lo, in ocrdma_tx_stats()
299 tx_stats->send_pkts_hi)); in ocrdma_tx_stats()
300 pcur += ocrdma_add_stat(stats, pcur, "write_pkts", in ocrdma_tx_stats()
301 convert_to_64bit(tx_stats->write_pkts_lo, in ocrdma_tx_stats()
302 tx_stats->write_pkts_hi)); in ocrdma_tx_stats()
303 pcur += ocrdma_add_stat(stats, pcur, "read_pkts", in ocrdma_tx_stats()
304 convert_to_64bit(tx_stats->read_pkts_lo, in ocrdma_tx_stats()
305 tx_stats->read_pkts_hi)); in ocrdma_tx_stats()
306 pcur += ocrdma_add_stat(stats, pcur, "read_rsp_pkts", in ocrdma_tx_stats()
307 convert_to_64bit(tx_stats->read_rsp_pkts_lo, in ocrdma_tx_stats()
308 tx_stats->read_rsp_pkts_hi)); in ocrdma_tx_stats()
309 pcur += ocrdma_add_stat(stats, pcur, "ack_pkts", in ocrdma_tx_stats()
310 convert_to_64bit(tx_stats->ack_pkts_lo, in ocrdma_tx_stats()
311 tx_stats->ack_pkts_hi)); in ocrdma_tx_stats()
312 pcur += ocrdma_add_stat(stats, pcur, "send_bytes", in ocrdma_tx_stats()
313 convert_to_64bit(tx_stats->send_bytes_lo, in ocrdma_tx_stats()
314 tx_stats->send_bytes_hi)); in ocrdma_tx_stats()
315 pcur += ocrdma_add_stat(stats, pcur, "write_bytes", in ocrdma_tx_stats()
316 convert_to_64bit(tx_stats->write_bytes_lo, in ocrdma_tx_stats()
317 tx_stats->write_bytes_hi)); in ocrdma_tx_stats()
318 pcur += ocrdma_add_stat(stats, pcur, "read_req_bytes", in ocrdma_tx_stats()
319 convert_to_64bit(tx_stats->read_req_bytes_lo, in ocrdma_tx_stats()
320 tx_stats->read_req_bytes_hi)); in ocrdma_tx_stats()
321 pcur += ocrdma_add_stat(stats, pcur, "read_rsp_bytes", in ocrdma_tx_stats()
322 convert_to_64bit(tx_stats->read_rsp_bytes_lo, in ocrdma_tx_stats()
323 tx_stats->read_rsp_bytes_hi)); in ocrdma_tx_stats()
324 pcur += ocrdma_add_stat(stats, pcur, "ack_timeouts", in ocrdma_tx_stats()
325 (u64)tx_stats->ack_timeouts); in ocrdma_tx_stats()
327 return stats; in ocrdma_tx_stats()
333 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_sysfs_xmit_pkts()
334 struct ocrdma_tx_stats *tx_stats = &rdma_stats->tx_stats; in ocrdma_sysfs_xmit_pkts()
336 return (convert_to_64bit(tx_stats->send_pkts_lo, in ocrdma_sysfs_xmit_pkts()
337 tx_stats->send_pkts_hi) + in ocrdma_sysfs_xmit_pkts()
338 convert_to_64bit(tx_stats->write_pkts_lo, tx_stats->write_pkts_hi) + in ocrdma_sysfs_xmit_pkts()
339 convert_to_64bit(tx_stats->read_pkts_lo, tx_stats->read_pkts_hi) + in ocrdma_sysfs_xmit_pkts()
340 convert_to_64bit(tx_stats->read_rsp_pkts_lo, in ocrdma_sysfs_xmit_pkts()
341 tx_stats->read_rsp_pkts_hi) + in ocrdma_sysfs_xmit_pkts()
342 convert_to_64bit(tx_stats->ack_pkts_lo, tx_stats->ack_pkts_hi)); in ocrdma_sysfs_xmit_pkts()
348 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_sysfs_xmit_data()
349 struct ocrdma_tx_stats *tx_stats = &rdma_stats->tx_stats; in ocrdma_sysfs_xmit_data()
351 return (convert_to_64bit(tx_stats->send_bytes_lo, in ocrdma_sysfs_xmit_data()
352 tx_stats->send_bytes_hi) + in ocrdma_sysfs_xmit_data()
353 convert_to_64bit(tx_stats->write_bytes_lo, in ocrdma_sysfs_xmit_data()
354 tx_stats->write_bytes_hi) + in ocrdma_sysfs_xmit_data()
355 convert_to_64bit(tx_stats->read_req_bytes_lo, in ocrdma_sysfs_xmit_data()
356 tx_stats->read_req_bytes_hi) + in ocrdma_sysfs_xmit_data()
357 convert_to_64bit(tx_stats->read_rsp_bytes_lo, in ocrdma_sysfs_xmit_data()
358 tx_stats->read_rsp_bytes_hi))/4; in ocrdma_sysfs_xmit_data()
363 char *stats = dev->stats_mem.debugfs_mem, *pcur; in ocrdma_wqe_stats() local
365 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_wqe_stats()
366 struct ocrdma_wqe_stats *wqe_stats = &rdma_stats->wqe_stats; in ocrdma_wqe_stats()
368 memset(stats, 0, (OCRDMA_MAX_DBGFS_MEM)); in ocrdma_wqe_stats()
370 pcur = stats; in ocrdma_wqe_stats()
371 pcur += ocrdma_add_stat(stats, pcur, "large_send_rc_wqes", in ocrdma_wqe_stats()
372 convert_to_64bit(wqe_stats->large_send_rc_wqes_lo, in ocrdma_wqe_stats()
373 wqe_stats->large_send_rc_wqes_hi)); in ocrdma_wqe_stats()
374 pcur += ocrdma_add_stat(stats, pcur, "large_write_rc_wqes", in ocrdma_wqe_stats()
375 convert_to_64bit(wqe_stats->large_write_rc_wqes_lo, in ocrdma_wqe_stats()
376 wqe_stats->large_write_rc_wqes_hi)); in ocrdma_wqe_stats()
377 pcur += ocrdma_add_stat(stats, pcur, "read_wqes", in ocrdma_wqe_stats()
378 convert_to_64bit(wqe_stats->read_wqes_lo, in ocrdma_wqe_stats()
379 wqe_stats->read_wqes_hi)); in ocrdma_wqe_stats()
380 pcur += ocrdma_add_stat(stats, pcur, "frmr_wqes", in ocrdma_wqe_stats()
381 convert_to_64bit(wqe_stats->frmr_wqes_lo, in ocrdma_wqe_stats()
382 wqe_stats->frmr_wqes_hi)); in ocrdma_wqe_stats()
383 pcur += ocrdma_add_stat(stats, pcur, "mw_bind_wqes", in ocrdma_wqe_stats()
384 convert_to_64bit(wqe_stats->mw_bind_wqes_lo, in ocrdma_wqe_stats()
385 wqe_stats->mw_bind_wqes_hi)); in ocrdma_wqe_stats()
386 pcur += ocrdma_add_stat(stats, pcur, "invalidate_wqes", in ocrdma_wqe_stats()
387 convert_to_64bit(wqe_stats->invalidate_wqes_lo, in ocrdma_wqe_stats()
388 wqe_stats->invalidate_wqes_hi)); in ocrdma_wqe_stats()
389 pcur += ocrdma_add_stat(stats, pcur, "dpp_wqe_drops", in ocrdma_wqe_stats()
390 (u64)wqe_stats->dpp_wqe_drops); in ocrdma_wqe_stats()
391 return stats; in ocrdma_wqe_stats()
396 char *stats = dev->stats_mem.debugfs_mem, *pcur; in ocrdma_db_errstats() local
398 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_db_errstats()
399 struct ocrdma_db_err_stats *db_err_stats = &rdma_stats->db_err_stats; in ocrdma_db_errstats()
401 memset(stats, 0, (OCRDMA_MAX_DBGFS_MEM)); in ocrdma_db_errstats()
403 pcur = stats; in ocrdma_db_errstats()
404 pcur += ocrdma_add_stat(stats, pcur, "sq_doorbell_errors", in ocrdma_db_errstats()
405 (u64)db_err_stats->sq_doorbell_errors); in ocrdma_db_errstats()
406 pcur += ocrdma_add_stat(stats, pcur, "cq_doorbell_errors", in ocrdma_db_errstats()
407 (u64)db_err_stats->cq_doorbell_errors); in ocrdma_db_errstats()
408 pcur += ocrdma_add_stat(stats, pcur, "rq_srq_doorbell_errors", in ocrdma_db_errstats()
409 (u64)db_err_stats->rq_srq_doorbell_errors); in ocrdma_db_errstats()
410 pcur += ocrdma_add_stat(stats, pcur, "cq_overflow_errors", in ocrdma_db_errstats()
411 (u64)db_err_stats->cq_overflow_errors); in ocrdma_db_errstats()
412 return stats; in ocrdma_db_errstats()
417 char *stats = dev->stats_mem.debugfs_mem, *pcur; in ocrdma_rxqp_errstats() local
419 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_rxqp_errstats()
421 &rdma_stats->rx_qp_err_stats; in ocrdma_rxqp_errstats()
423 memset(stats, 0, (OCRDMA_MAX_DBGFS_MEM)); in ocrdma_rxqp_errstats()
425 pcur = stats; in ocrdma_rxqp_errstats()
426 pcur += ocrdma_add_stat(stats, pcur, "nak_invalid_request_errors", in ocrdma_rxqp_errstats()
427 (u64)rx_qp_err_stats->nak_invalid_request_errors); in ocrdma_rxqp_errstats()
428 pcur += ocrdma_add_stat(stats, pcur, "nak_remote_operation_errors", in ocrdma_rxqp_errstats()
429 (u64)rx_qp_err_stats->nak_remote_operation_errors); in ocrdma_rxqp_errstats()
430 pcur += ocrdma_add_stat(stats, pcur, "nak_count_remote_access_errors", in ocrdma_rxqp_errstats()
431 (u64)rx_qp_err_stats->nak_count_remote_access_errors); in ocrdma_rxqp_errstats()
432 pcur += ocrdma_add_stat(stats, pcur, "local_length_errors", in ocrdma_rxqp_errstats()
433 (u64)rx_qp_err_stats->local_length_errors); in ocrdma_rxqp_errstats()
434 pcur += ocrdma_add_stat(stats, pcur, "local_protection_errors", in ocrdma_rxqp_errstats()
435 (u64)rx_qp_err_stats->local_protection_errors); in ocrdma_rxqp_errstats()
436 pcur += ocrdma_add_stat(stats, pcur, "local_qp_operation_errors", in ocrdma_rxqp_errstats()
437 (u64)rx_qp_err_stats->local_qp_operation_errors); in ocrdma_rxqp_errstats()
438 return stats; in ocrdma_rxqp_errstats()
443 char *stats = dev->stats_mem.debugfs_mem, *pcur; in ocrdma_txqp_errstats() local
445 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_txqp_errstats()
447 &rdma_stats->tx_qp_err_stats; in ocrdma_txqp_errstats()
449 memset(stats, 0, (OCRDMA_MAX_DBGFS_MEM)); in ocrdma_txqp_errstats()
451 pcur = stats; in ocrdma_txqp_errstats()
452 pcur += ocrdma_add_stat(stats, pcur, "local_length_errors", in ocrdma_txqp_errstats()
453 (u64)tx_qp_err_stats->local_length_errors); in ocrdma_txqp_errstats()
454 pcur += ocrdma_add_stat(stats, pcur, "local_protection_errors", in ocrdma_txqp_errstats()
455 (u64)tx_qp_err_stats->local_protection_errors); in ocrdma_txqp_errstats()
456 pcur += ocrdma_add_stat(stats, pcur, "local_qp_operation_errors", in ocrdma_txqp_errstats()
457 (u64)tx_qp_err_stats->local_qp_operation_errors); in ocrdma_txqp_errstats()
458 pcur += ocrdma_add_stat(stats, pcur, "retry_count_exceeded_errors", in ocrdma_txqp_errstats()
459 (u64)tx_qp_err_stats->retry_count_exceeded_errors); in ocrdma_txqp_errstats()
460 pcur += ocrdma_add_stat(stats, pcur, "rnr_retry_count_exceeded_errors", in ocrdma_txqp_errstats()
461 (u64)tx_qp_err_stats->rnr_retry_count_exceeded_errors); in ocrdma_txqp_errstats()
462 return stats; in ocrdma_txqp_errstats()
468 char *pstats = dev->stats_mem.debugfs_mem; in ocrdma_tx_dbg_stats()
470 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_tx_dbg_stats()
472 &rdma_stats->tx_dbg_stats; in ocrdma_tx_dbg_stats()
478 tx_dbg_stats->data[i]); in ocrdma_tx_dbg_stats()
480 return dev->stats_mem.debugfs_mem; in ocrdma_tx_dbg_stats()
486 char *pstats = dev->stats_mem.debugfs_mem; in ocrdma_rx_dbg_stats()
488 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_rx_dbg_stats()
490 &rdma_stats->rx_dbg_stats; in ocrdma_rx_dbg_stats()
496 rx_dbg_stats->data[i]); in ocrdma_rx_dbg_stats()
498 return dev->stats_mem.debugfs_mem; in ocrdma_rx_dbg_stats()
503 char *stats = dev->stats_mem.debugfs_mem, *pcur; in ocrdma_driver_dbg_stats() local
506 memset(stats, 0, (OCRDMA_MAX_DBGFS_MEM)); in ocrdma_driver_dbg_stats()
508 pcur = stats; in ocrdma_driver_dbg_stats()
509 pcur += ocrdma_add_stat(stats, pcur, "async_cq_err", in ocrdma_driver_dbg_stats()
510 (u64)(dev->async_err_stats in ocrdma_driver_dbg_stats()
512 pcur += ocrdma_add_stat(stats, pcur, "async_cq_overrun_err", in ocrdma_driver_dbg_stats()
513 (u64)dev->async_err_stats in ocrdma_driver_dbg_stats()
515 pcur += ocrdma_add_stat(stats, pcur, "async_cq_qpcat_err", in ocrdma_driver_dbg_stats()
516 (u64)dev->async_err_stats in ocrdma_driver_dbg_stats()
518 pcur += ocrdma_add_stat(stats, pcur, "async_qp_access_err", in ocrdma_driver_dbg_stats()
519 (u64)dev->async_err_stats in ocrdma_driver_dbg_stats()
521 pcur += ocrdma_add_stat(stats, pcur, "async_qp_commm_est_evt", in ocrdma_driver_dbg_stats()
522 (u64)dev->async_err_stats in ocrdma_driver_dbg_stats()
524 pcur += ocrdma_add_stat(stats, pcur, "async_sq_drained_evt", in ocrdma_driver_dbg_stats()
525 (u64)dev->async_err_stats in ocrdma_driver_dbg_stats()
527 pcur += ocrdma_add_stat(stats, pcur, "async_dev_fatal_evt", in ocrdma_driver_dbg_stats()
528 (u64)dev->async_err_stats in ocrdma_driver_dbg_stats()
530 pcur += ocrdma_add_stat(stats, pcur, "async_srqcat_err", in ocrdma_driver_dbg_stats()
531 (u64)dev->async_err_stats in ocrdma_driver_dbg_stats()
533 pcur += ocrdma_add_stat(stats, pcur, "async_srq_limit_evt", in ocrdma_driver_dbg_stats()
534 (u64)dev->async_err_stats in ocrdma_driver_dbg_stats()
536 pcur += ocrdma_add_stat(stats, pcur, "async_qp_last_wqe_evt", in ocrdma_driver_dbg_stats()
537 (u64)dev->async_err_stats in ocrdma_driver_dbg_stats()
540 pcur += ocrdma_add_stat(stats, pcur, "cqe_loc_len_err", in ocrdma_driver_dbg_stats()
541 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
543 pcur += ocrdma_add_stat(stats, pcur, "cqe_loc_qp_op_err", in ocrdma_driver_dbg_stats()
544 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
546 pcur += ocrdma_add_stat(stats, pcur, "cqe_loc_eec_op_err", in ocrdma_driver_dbg_stats()
547 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
549 pcur += ocrdma_add_stat(stats, pcur, "cqe_loc_prot_err", in ocrdma_driver_dbg_stats()
550 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
552 pcur += ocrdma_add_stat(stats, pcur, "cqe_wr_flush_err", in ocrdma_driver_dbg_stats()
553 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
555 pcur += ocrdma_add_stat(stats, pcur, "cqe_mw_bind_err", in ocrdma_driver_dbg_stats()
556 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
558 pcur += ocrdma_add_stat(stats, pcur, "cqe_bad_resp_err", in ocrdma_driver_dbg_stats()
559 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
561 pcur += ocrdma_add_stat(stats, pcur, "cqe_loc_access_err", in ocrdma_driver_dbg_stats()
562 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
564 pcur += ocrdma_add_stat(stats, pcur, "cqe_rem_inv_req_err", in ocrdma_driver_dbg_stats()
565 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
567 pcur += ocrdma_add_stat(stats, pcur, "cqe_rem_access_err", in ocrdma_driver_dbg_stats()
568 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
570 pcur += ocrdma_add_stat(stats, pcur, "cqe_rem_op_err", in ocrdma_driver_dbg_stats()
571 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
573 pcur += ocrdma_add_stat(stats, pcur, "cqe_retry_exc_err", in ocrdma_driver_dbg_stats()
574 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
576 pcur += ocrdma_add_stat(stats, pcur, "cqe_rnr_retry_exc_err", in ocrdma_driver_dbg_stats()
577 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
579 pcur += ocrdma_add_stat(stats, pcur, "cqe_loc_rdd_viol_err", in ocrdma_driver_dbg_stats()
580 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
582 pcur += ocrdma_add_stat(stats, pcur, "cqe_rem_inv_rd_req_err", in ocrdma_driver_dbg_stats()
583 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
585 pcur += ocrdma_add_stat(stats, pcur, "cqe_rem_abort_err", in ocrdma_driver_dbg_stats()
586 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
588 pcur += ocrdma_add_stat(stats, pcur, "cqe_inv_eecn_err", in ocrdma_driver_dbg_stats()
589 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
591 pcur += ocrdma_add_stat(stats, pcur, "cqe_inv_eec_state_err", in ocrdma_driver_dbg_stats()
592 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
594 pcur += ocrdma_add_stat(stats, pcur, "cqe_fatal_err", in ocrdma_driver_dbg_stats()
595 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
597 pcur += ocrdma_add_stat(stats, pcur, "cqe_resp_timeout_err", in ocrdma_driver_dbg_stats()
598 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
600 pcur += ocrdma_add_stat(stats, pcur, "cqe_general_err", in ocrdma_driver_dbg_stats()
601 (u64)dev->cqe_err_stats in ocrdma_driver_dbg_stats()
603 return stats; in ocrdma_driver_dbg_stats()
611 (struct ocrdma_rdma_stats_resp *)dev->stats_mem.va; in ocrdma_update_stats()
612 struct ocrdma_rsrc_stats *rsrc_stats = &rdma_stats->act_rsrc_stats; in ocrdma_update_stats()
614 secs = jiffies_to_msecs(now - dev->last_stats_time) / 1000U; in ocrdma_update_stats()
619 pr_err("%s: stats mbox failed with status = %d\n", in ocrdma_update_stats()
622 if (dev->pd_mgr->pd_prealloc_valid) { in ocrdma_update_stats()
623 rsrc_stats->dpp_pds = dev->pd_mgr->pd_dpp_count; in ocrdma_update_stats()
624 rsrc_stats->non_dpp_pds = dev->pd_mgr->pd_norm_count; in ocrdma_update_stats()
626 rsrc_stats = &rdma_stats->th_rsrc_stats; in ocrdma_update_stats()
627 rsrc_stats->dpp_pds = dev->pd_mgr->pd_dpp_thrsh; in ocrdma_update_stats()
628 rsrc_stats->non_dpp_pds = dev->pd_mgr->pd_norm_thrsh; in ocrdma_update_stats()
630 dev->last_stats_time = jiffies; in ocrdma_update_stats()
641 struct ocrdma_stats *pstats = filp->private_data; in ocrdma_dbgfs_ops_write()
642 struct ocrdma_dev *dev = pstats->dev; in ocrdma_dbgfs_ops_write()
650 tmp_str[count-1] = '\0'; in ocrdma_dbgfs_ops_write()
654 switch (pstats->type) { in ocrdma_dbgfs_ops_write()
659 pr_err("Failed to reset stats = %d\n", status); in ocrdma_dbgfs_ops_write()
670 return -EFAULT; in ocrdma_dbgfs_ops_write()
677 pma_cnt = (void *)(out_mad->data + 40); in ocrdma_pma_counters()
680 pma_cnt->port_xmit_data = cpu_to_be32(ocrdma_sysfs_xmit_data(dev)); in ocrdma_pma_counters()
681 pma_cnt->port_rcv_data = cpu_to_be32(ocrdma_sysfs_rcv_data(dev)); in ocrdma_pma_counters()
682 pma_cnt->port_xmit_packets = cpu_to_be32(ocrdma_sysfs_xmit_pkts(dev)); in ocrdma_pma_counters()
683 pma_cnt->port_rcv_packets = cpu_to_be32(ocrdma_sysfs_rcv_pkts(dev)); in ocrdma_pma_counters()
689 struct ocrdma_stats *pstats = filp->private_data; in ocrdma_dbgfs_ops_read()
690 struct ocrdma_dev *dev = pstats->dev; in ocrdma_dbgfs_ops_read()
698 mutex_lock(&dev->stats_lock); in ocrdma_dbgfs_ops_read()
702 switch (pstats->type) { in ocrdma_dbgfs_ops_read()
735 status = -EFAULT; in ocrdma_dbgfs_ops_read()
740 status = -ENOSPC; in ocrdma_dbgfs_ops_read()
747 mutex_unlock(&dev->stats_lock); in ocrdma_dbgfs_ops_read()
760 const struct pci_dev *pdev = dev->nic_info.pdev; in ocrdma_add_port_stats()
765 /* Create post stats base dir */ in ocrdma_add_port_stats()
766 dev->dir = debugfs_create_dir(pci_name(pdev), ocrdma_dbgfs_dir); in ocrdma_add_port_stats()
768 dev->rsrc_stats.type = OCRDMA_RSRC_STATS; in ocrdma_add_port_stats()
769 dev->rsrc_stats.dev = dev; in ocrdma_add_port_stats()
770 debugfs_create_file("resource_stats", S_IRUSR, dev->dir, in ocrdma_add_port_stats()
771 &dev->rsrc_stats, &ocrdma_dbg_ops); in ocrdma_add_port_stats()
773 dev->rx_stats.type = OCRDMA_RXSTATS; in ocrdma_add_port_stats()
774 dev->rx_stats.dev = dev; in ocrdma_add_port_stats()
775 debugfs_create_file("rx_stats", S_IRUSR, dev->dir, &dev->rx_stats, in ocrdma_add_port_stats()
778 dev->wqe_stats.type = OCRDMA_WQESTATS; in ocrdma_add_port_stats()
779 dev->wqe_stats.dev = dev; in ocrdma_add_port_stats()
780 debugfs_create_file("wqe_stats", S_IRUSR, dev->dir, &dev->wqe_stats, in ocrdma_add_port_stats()
783 dev->tx_stats.type = OCRDMA_TXSTATS; in ocrdma_add_port_stats()
784 dev->tx_stats.dev = dev; in ocrdma_add_port_stats()
785 debugfs_create_file("tx_stats", S_IRUSR, dev->dir, &dev->tx_stats, in ocrdma_add_port_stats()
788 dev->db_err_stats.type = OCRDMA_DB_ERRSTATS; in ocrdma_add_port_stats()
789 dev->db_err_stats.dev = dev; in ocrdma_add_port_stats()
790 debugfs_create_file("db_err_stats", S_IRUSR, dev->dir, in ocrdma_add_port_stats()
791 &dev->db_err_stats, &ocrdma_dbg_ops); in ocrdma_add_port_stats()
793 dev->tx_qp_err_stats.type = OCRDMA_TXQP_ERRSTATS; in ocrdma_add_port_stats()
794 dev->tx_qp_err_stats.dev = dev; in ocrdma_add_port_stats()
795 debugfs_create_file("tx_qp_err_stats", S_IRUSR, dev->dir, in ocrdma_add_port_stats()
796 &dev->tx_qp_err_stats, &ocrdma_dbg_ops); in ocrdma_add_port_stats()
798 dev->rx_qp_err_stats.type = OCRDMA_RXQP_ERRSTATS; in ocrdma_add_port_stats()
799 dev->rx_qp_err_stats.dev = dev; in ocrdma_add_port_stats()
800 debugfs_create_file("rx_qp_err_stats", S_IRUSR, dev->dir, in ocrdma_add_port_stats()
801 &dev->rx_qp_err_stats, &ocrdma_dbg_ops); in ocrdma_add_port_stats()
803 dev->tx_dbg_stats.type = OCRDMA_TX_DBG_STATS; in ocrdma_add_port_stats()
804 dev->tx_dbg_stats.dev = dev; in ocrdma_add_port_stats()
805 debugfs_create_file("tx_dbg_stats", S_IRUSR, dev->dir, in ocrdma_add_port_stats()
806 &dev->tx_dbg_stats, &ocrdma_dbg_ops); in ocrdma_add_port_stats()
808 dev->rx_dbg_stats.type = OCRDMA_RX_DBG_STATS; in ocrdma_add_port_stats()
809 dev->rx_dbg_stats.dev = dev; in ocrdma_add_port_stats()
810 debugfs_create_file("rx_dbg_stats", S_IRUSR, dev->dir, in ocrdma_add_port_stats()
811 &dev->rx_dbg_stats, &ocrdma_dbg_ops); in ocrdma_add_port_stats()
813 dev->driver_stats.type = OCRDMA_DRV_STATS; in ocrdma_add_port_stats()
814 dev->driver_stats.dev = dev; in ocrdma_add_port_stats()
815 debugfs_create_file("driver_dbg_stats", S_IRUSR, dev->dir, in ocrdma_add_port_stats()
816 &dev->driver_stats, &ocrdma_dbg_ops); in ocrdma_add_port_stats()
818 dev->reset_stats.type = OCRDMA_RESET_STATS; in ocrdma_add_port_stats()
819 dev->reset_stats.dev = dev; in ocrdma_add_port_stats()
820 debugfs_create_file("reset_stats", 0200, dev->dir, &dev->reset_stats, in ocrdma_add_port_stats()
826 debugfs_remove_recursive(dev->dir); in ocrdma_rem_port_stats()