1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2007-2013 Broadcom Corporation.
4 * Eric Davis <edavis@broadcom.com>
5 * David Christensen <davidch@broadcom.com>
6 * Gary Zambrano <zambrano@broadcom.com>
8 * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
9 * Copyright (c) 2015-2018 Cavium Inc.
10 * All rights reserved.
17 #include <sys/types.h>
22 uint32_t brb_truncate;
23 uint32_t flow_ctrl_discard;
24 uint32_t flow_ctrl_octets;
25 uint32_t flow_ctrl_packet;
27 uint32_t mng_octet_inp;
28 uint32_t mng_octet_out;
29 uint32_t mng_packet_inp;
30 uint32_t mng_packet_out;
34 uint32_t egress_mac_pkt0_lo;
35 uint32_t egress_mac_pkt0_hi;
36 uint32_t egress_mac_pkt1_lo;
37 uint32_t egress_mac_pkt1_hi;
41 enum bnx2x_stats_event {
49 enum bnx2x_stats_state {
50 STATS_STATE_DISABLED = 0,
55 struct bnx2x_eth_stats {
56 uint32_t total_bytes_received_hi;
57 uint32_t total_bytes_received_lo;
58 uint32_t total_bytes_transmitted_hi;
59 uint32_t total_bytes_transmitted_lo;
60 uint32_t total_unicast_packets_received_hi;
61 uint32_t total_unicast_packets_received_lo;
62 uint32_t total_multicast_packets_received_hi;
63 uint32_t total_multicast_packets_received_lo;
64 uint32_t total_broadcast_packets_received_hi;
65 uint32_t total_broadcast_packets_received_lo;
66 uint32_t total_unicast_packets_transmitted_hi;
67 uint32_t total_unicast_packets_transmitted_lo;
68 uint32_t total_multicast_packets_transmitted_hi;
69 uint32_t total_multicast_packets_transmitted_lo;
70 uint32_t total_broadcast_packets_transmitted_hi;
71 uint32_t total_broadcast_packets_transmitted_lo;
72 uint32_t valid_bytes_received_hi;
73 uint32_t valid_bytes_received_lo;
75 uint32_t error_bytes_received_hi;
76 uint32_t error_bytes_received_lo;
77 uint32_t etherstatsoverrsizepkts_hi;
78 uint32_t etherstatsoverrsizepkts_lo;
79 uint32_t no_buff_discard_hi;
80 uint32_t no_buff_discard_lo;
82 uint32_t rx_stat_ifhcinbadoctets_hi;
83 uint32_t rx_stat_ifhcinbadoctets_lo;
84 uint32_t tx_stat_ifhcoutbadoctets_hi;
85 uint32_t tx_stat_ifhcoutbadoctets_lo;
86 uint32_t rx_stat_dot3statsfcserrors_hi;
87 uint32_t rx_stat_dot3statsfcserrors_lo;
88 uint32_t rx_stat_dot3statsalignmenterrors_hi;
89 uint32_t rx_stat_dot3statsalignmenterrors_lo;
90 uint32_t rx_stat_dot3statscarriersenseerrors_hi;
91 uint32_t rx_stat_dot3statscarriersenseerrors_lo;
92 uint32_t rx_stat_falsecarriererrors_hi;
93 uint32_t rx_stat_falsecarriererrors_lo;
94 uint32_t rx_stat_etherstatsundersizepkts_hi;
95 uint32_t rx_stat_etherstatsundersizepkts_lo;
96 uint32_t rx_stat_dot3statsframestoolong_hi;
97 uint32_t rx_stat_dot3statsframestoolong_lo;
98 uint32_t rx_stat_etherstatsfragments_hi;
99 uint32_t rx_stat_etherstatsfragments_lo;
100 uint32_t rx_stat_etherstatsjabbers_hi;
101 uint32_t rx_stat_etherstatsjabbers_lo;
102 uint32_t rx_stat_maccontrolframesreceived_hi;
103 uint32_t rx_stat_maccontrolframesreceived_lo;
104 uint32_t rx_stat_bmac_xpf_hi;
105 uint32_t rx_stat_bmac_xpf_lo;
106 uint32_t rx_stat_bmac_xcf_hi;
107 uint32_t rx_stat_bmac_xcf_lo;
108 uint32_t rx_stat_xoffstateentered_hi;
109 uint32_t rx_stat_xoffstateentered_lo;
110 uint32_t rx_stat_xonpauseframesreceived_hi;
111 uint32_t rx_stat_xonpauseframesreceived_lo;
112 uint32_t rx_stat_xoffpauseframesreceived_hi;
113 uint32_t rx_stat_xoffpauseframesreceived_lo;
114 uint32_t tx_stat_outxonsent_hi;
115 uint32_t tx_stat_outxonsent_lo;
116 uint32_t tx_stat_outxoffsent_hi;
117 uint32_t tx_stat_outxoffsent_lo;
118 uint32_t tx_stat_flowcontroldone_hi;
119 uint32_t tx_stat_flowcontroldone_lo;
120 uint32_t tx_stat_etherstatscollisions_hi;
121 uint32_t tx_stat_etherstatscollisions_lo;
122 uint32_t tx_stat_dot3statssinglecollisionframes_hi;
123 uint32_t tx_stat_dot3statssinglecollisionframes_lo;
124 uint32_t tx_stat_dot3statsmultiplecollisionframes_hi;
125 uint32_t tx_stat_dot3statsmultiplecollisionframes_lo;
126 uint32_t tx_stat_dot3statsdeferredtransmissions_hi;
127 uint32_t tx_stat_dot3statsdeferredtransmissions_lo;
128 uint32_t tx_stat_dot3statsexcessivecollisions_hi;
129 uint32_t tx_stat_dot3statsexcessivecollisions_lo;
130 uint32_t tx_stat_dot3statslatecollisions_hi;
131 uint32_t tx_stat_dot3statslatecollisions_lo;
132 uint32_t tx_stat_etherstatspkts64octets_hi;
133 uint32_t tx_stat_etherstatspkts64octets_lo;
134 uint32_t tx_stat_etherstatspkts65octetsto127octets_hi;
135 uint32_t tx_stat_etherstatspkts65octetsto127octets_lo;
136 uint32_t tx_stat_etherstatspkts128octetsto255octets_hi;
137 uint32_t tx_stat_etherstatspkts128octetsto255octets_lo;
138 uint32_t tx_stat_etherstatspkts256octetsto511octets_hi;
139 uint32_t tx_stat_etherstatspkts256octetsto511octets_lo;
140 uint32_t tx_stat_etherstatspkts512octetsto1023octets_hi;
141 uint32_t tx_stat_etherstatspkts512octetsto1023octets_lo;
142 uint32_t tx_stat_etherstatspkts1024octetsto1522octets_hi;
143 uint32_t tx_stat_etherstatspkts1024octetsto1522octets_lo;
144 uint32_t tx_stat_etherstatspktsover1522octets_hi;
145 uint32_t tx_stat_etherstatspktsover1522octets_lo;
146 uint32_t tx_stat_bmac_2047_hi;
147 uint32_t tx_stat_bmac_2047_lo;
148 uint32_t tx_stat_bmac_4095_hi;
149 uint32_t tx_stat_bmac_4095_lo;
150 uint32_t tx_stat_bmac_9216_hi;
151 uint32_t tx_stat_bmac_9216_lo;
152 uint32_t tx_stat_bmac_16383_hi;
153 uint32_t tx_stat_bmac_16383_lo;
154 uint32_t tx_stat_dot3statsinternalmactransmiterrors_hi;
155 uint32_t tx_stat_dot3statsinternalmactransmiterrors_lo;
156 uint32_t tx_stat_bmac_ufl_hi;
157 uint32_t tx_stat_bmac_ufl_lo;
159 uint32_t pause_frames_received_hi;
160 uint32_t pause_frames_received_lo;
161 uint32_t pause_frames_sent_hi;
162 uint32_t pause_frames_sent_lo;
164 uint32_t etherstatspkts1024octetsto1522octets_hi;
165 uint32_t etherstatspkts1024octetsto1522octets_lo;
166 uint32_t etherstatspktsover1522octets_hi;
167 uint32_t etherstatspktsover1522octets_lo;
169 uint32_t brb_drop_hi;
170 uint32_t brb_drop_lo;
171 uint32_t brb_truncate_hi;
172 uint32_t brb_truncate_lo;
174 uint32_t mac_filter_discard;
175 uint32_t mf_tag_discard;
176 uint32_t brb_truncate_discard;
177 uint32_t mac_discard;
179 uint32_t nig_timer_max;
182 uint32_t pfc_frames_received_hi;
183 uint32_t pfc_frames_received_lo;
184 uint32_t pfc_frames_sent_hi;
185 uint32_t pfc_frames_sent_lo;
188 uint32_t recoverable_error;
189 uint32_t unrecoverable_error;
191 /* src: Clear-on-Read register; Will not survive PMF Migration */
194 /* receive path driver statistics */
197 uint32_t rx_soft_errors;
198 uint32_t rx_hw_csum_errors;
199 uint32_t rx_ofld_frames_csum_ip;
200 uint32_t rx_ofld_frames_csum_tcp_udp;
201 uint32_t rx_budget_reached;
203 /* tx path driver statistics */
205 uint32_t tx_soft_errors;
206 uint32_t tx_ofld_frames_csum_ip;
207 uint32_t tx_ofld_frames_csum_tcp;
208 uint32_t tx_ofld_frames_csum_udp;
209 uint32_t tx_encap_failures;
210 uint32_t tx_hw_queue_full;
211 uint32_t tx_hw_max_queue_depth;
212 uint32_t tx_dma_mapping_failure;
213 uint32_t tx_max_drbr_queue_depth;
214 uint32_t tx_window_violation_std;
215 uint32_t tx_chain_lost_mbuf;
216 uint32_t tx_frames_deferred;
217 uint32_t tx_queue_xoff;
219 /* mbuf driver statistics */
220 uint32_t mbuf_defrag_attempts;
221 uint32_t mbuf_defrag_failures;
222 uint32_t mbuf_rx_bd_alloc_failed;
223 uint32_t mbuf_rx_bd_mapping_failed;
225 /* track the number of allocated mbufs */
226 uint32_t mbuf_alloc_tx;
227 uint32_t mbuf_alloc_rx;
231 struct bnx2x_eth_q_stats {
232 uint32_t total_unicast_bytes_received_hi;
233 uint32_t total_unicast_bytes_received_lo;
234 uint32_t total_broadcast_bytes_received_hi;
235 uint32_t total_broadcast_bytes_received_lo;
236 uint32_t total_multicast_bytes_received_hi;
237 uint32_t total_multicast_bytes_received_lo;
238 uint32_t total_bytes_received_hi;
239 uint32_t total_bytes_received_lo;
240 uint32_t total_unicast_bytes_transmitted_hi;
241 uint32_t total_unicast_bytes_transmitted_lo;
242 uint32_t total_broadcast_bytes_transmitted_hi;
243 uint32_t total_broadcast_bytes_transmitted_lo;
244 uint32_t total_multicast_bytes_transmitted_hi;
245 uint32_t total_multicast_bytes_transmitted_lo;
246 uint32_t total_bytes_transmitted_hi;
247 uint32_t total_bytes_transmitted_lo;
248 uint32_t total_unicast_packets_received_hi;
249 uint32_t total_unicast_packets_received_lo;
250 uint32_t total_multicast_packets_received_hi;
251 uint32_t total_multicast_packets_received_lo;
252 uint32_t total_broadcast_packets_received_hi;
253 uint32_t total_broadcast_packets_received_lo;
254 uint32_t total_unicast_packets_transmitted_hi;
255 uint32_t total_unicast_packets_transmitted_lo;
256 uint32_t total_multicast_packets_transmitted_hi;
257 uint32_t total_multicast_packets_transmitted_lo;
258 uint32_t total_broadcast_packets_transmitted_hi;
259 uint32_t total_broadcast_packets_transmitted_lo;
260 uint32_t valid_bytes_received_hi;
261 uint32_t valid_bytes_received_lo;
263 uint32_t etherstatsoverrsizepkts_hi;
264 uint32_t etherstatsoverrsizepkts_lo;
265 uint32_t no_buff_discard_hi;
266 uint32_t no_buff_discard_lo;
268 uint32_t total_packets_received_checksum_discarded_hi;
269 uint32_t total_packets_received_checksum_discarded_lo;
270 uint32_t total_packets_received_ttl0_discarded_hi;
271 uint32_t total_packets_received_ttl0_discarded_lo;
272 uint32_t total_transmitted_dropped_packets_error_hi;
273 uint32_t total_transmitted_dropped_packets_error_lo;
275 /* receive path driver statistics */
278 uint32_t rx_soft_errors;
279 uint32_t rx_hw_csum_errors;
280 uint32_t rx_ofld_frames_csum_ip;
281 uint32_t rx_ofld_frames_csum_tcp_udp;
282 uint32_t rx_budget_reached;
284 /* tx path driver statistics */
286 uint32_t tx_soft_errors;
287 uint32_t tx_ofld_frames_csum_ip;
288 uint32_t tx_ofld_frames_csum_tcp;
289 uint32_t tx_ofld_frames_csum_udp;
290 uint32_t tx_encap_failures;
291 uint32_t tx_hw_queue_full;
292 uint32_t tx_hw_max_queue_depth;
293 uint32_t tx_dma_mapping_failure;
294 uint32_t tx_max_drbr_queue_depth;
295 uint32_t tx_window_violation_std;
296 uint32_t tx_chain_lost_mbuf;
297 uint32_t tx_frames_deferred;
298 uint32_t tx_queue_xoff;
300 /* mbuf driver statistics */
301 uint32_t mbuf_defrag_attempts;
302 uint32_t mbuf_defrag_failures;
303 uint32_t mbuf_rx_bd_alloc_failed;
304 uint32_t mbuf_rx_bd_mapping_failed;
306 /* track the number of allocated mbufs */
307 uint32_t mbuf_alloc_tx;
308 uint32_t mbuf_alloc_rx;
311 struct bnx2x_eth_stats_old {
312 uint32_t rx_stat_dot3statsframestoolong_hi;
313 uint32_t rx_stat_dot3statsframestoolong_lo;
316 struct bnx2x_eth_q_stats_old {
317 /* Fields to perserve over fw reset*/
318 uint32_t total_unicast_bytes_received_hi;
319 uint32_t total_unicast_bytes_received_lo;
320 uint32_t total_broadcast_bytes_received_hi;
321 uint32_t total_broadcast_bytes_received_lo;
322 uint32_t total_multicast_bytes_received_hi;
323 uint32_t total_multicast_bytes_received_lo;
324 uint32_t total_unicast_bytes_transmitted_hi;
325 uint32_t total_unicast_bytes_transmitted_lo;
326 uint32_t total_broadcast_bytes_transmitted_hi;
327 uint32_t total_broadcast_bytes_transmitted_lo;
328 uint32_t total_multicast_bytes_transmitted_hi;
329 uint32_t total_multicast_bytes_transmitted_lo;
331 /* Fields to perserve last of */
332 uint32_t total_bytes_received_hi;
333 uint32_t total_bytes_received_lo;
334 uint32_t total_bytes_transmitted_hi;
335 uint32_t total_bytes_transmitted_lo;
336 uint32_t total_unicast_packets_received_hi;
337 uint32_t total_unicast_packets_received_lo;
338 uint32_t total_multicast_packets_received_hi;
339 uint32_t total_multicast_packets_received_lo;
340 uint32_t total_broadcast_packets_received_hi;
341 uint32_t total_broadcast_packets_received_lo;
342 uint32_t total_unicast_packets_transmitted_hi;
343 uint32_t total_unicast_packets_transmitted_lo;
344 uint32_t total_multicast_packets_transmitted_hi;
345 uint32_t total_multicast_packets_transmitted_lo;
346 uint32_t total_broadcast_packets_transmitted_hi;
347 uint32_t total_broadcast_packets_transmitted_lo;
348 uint32_t valid_bytes_received_hi;
349 uint32_t valid_bytes_received_lo;
351 /* receive path driver statistics */
352 uint32_t rx_calls_old;
353 uint32_t rx_pkts_old;
354 uint32_t rx_soft_errors_old;
355 uint32_t rx_hw_csum_errors_old;
356 uint32_t rx_ofld_frames_csum_ip_old;
357 uint32_t rx_ofld_frames_csum_tcp_udp_old;
358 uint32_t rx_budget_reached_old;
360 /* tx path driver statistics */
361 uint32_t tx_pkts_old;
362 uint32_t tx_soft_errors_old;
363 uint32_t tx_ofld_frames_csum_ip_old;
364 uint32_t tx_ofld_frames_csum_tcp_old;
365 uint32_t tx_ofld_frames_csum_udp_old;
366 uint32_t tx_encap_failures_old;
367 uint32_t tx_hw_queue_full_old;
368 uint32_t tx_hw_max_queue_depth_old;
369 uint32_t tx_dma_mapping_failure_old;
370 uint32_t tx_max_drbr_queue_depth_old;
371 uint32_t tx_window_violation_std_old;
372 uint32_t tx_chain_lost_mbuf_old;
373 uint32_t tx_frames_deferred_old;
374 uint32_t tx_queue_xoff_old;
376 /* mbuf driver statistics */
377 uint32_t mbuf_defrag_attempts_old;
378 uint32_t mbuf_defrag_failures_old;
379 uint32_t mbuf_rx_bd_alloc_failed_old;
380 uint32_t mbuf_rx_bd_mapping_failed_old;
382 /* track the number of allocated mbufs */
383 int mbuf_alloc_tx_old;
384 int mbuf_alloc_rx_old;
387 struct bnx2x_net_stats_old {
391 struct bnx2x_fw_port_stats_old {
392 uint32_t pfc_frames_tx_hi;
393 uint32_t pfc_frames_tx_lo;
394 uint32_t pfc_frames_rx_hi;
395 uint32_t pfc_frames_rx_lo;
397 uint32_t mac_filter_discard;
398 uint32_t mf_tag_discard;
399 uint32_t brb_truncate_discard;
400 uint32_t mac_discard;
403 /* sum[hi:lo] += add[hi:lo] */
404 #define ADD_64(s_hi, a_hi, s_lo, a_lo) \
407 s_hi += a_hi + ((s_lo < a_lo) ? 1 : 0); \
410 #define LE32_0 ((uint32_t) 0)
411 #define LE16_0 ((uint16_t) 0)
413 /* The _force is for cases where high value is 0 */
414 #define ADD_64_LE(s_hi, a_hi_le, s_lo, a_lo_le) \
415 ADD_64(s_hi, le32toh(a_hi_le), \
416 s_lo, le32toh(a_lo_le))
418 #define ADD_64_LE16(s_hi, a_hi_le, s_lo, a_lo_le) \
419 ADD_64(s_hi, le16toh(a_hi_le), \
420 s_lo, le16toh(a_lo_le))
422 /* difference = minuend - subtrahend */
423 #define DIFF_64(d_hi, m_hi, s_hi, d_lo, m_lo, s_lo) \
427 d_hi = m_hi - s_hi; \
429 /* we can 'loan' 1 */ \
431 d_lo = m_lo + (UINT_MAX - s_lo) + 1; \
444 d_hi = m_hi - s_hi; \
445 d_lo = m_lo - s_lo; \
450 #define UPDATE_STAT64(s, t) \
452 DIFF_64(diff.hi, new->s##_hi, pstats->mac_stx[0].t##_hi, \
453 diff.lo, new->s##_lo, pstats->mac_stx[0].t##_lo); \
454 pstats->mac_stx[0].t##_hi = new->s##_hi; \
455 pstats->mac_stx[0].t##_lo = new->s##_lo; \
456 ADD_64(pstats->mac_stx[1].t##_hi, diff.hi, \
457 pstats->mac_stx[1].t##_lo, diff.lo); \
460 #define UPDATE_STAT64_NIG(s, t) \
462 DIFF_64(diff.hi, new->s##_hi, old->s##_hi, \
463 diff.lo, new->s##_lo, old->s##_lo); \
464 ADD_64(estats->t##_hi, diff.hi, \
465 estats->t##_lo, diff.lo); \
468 /* sum[hi:lo] += add */
469 #define ADD_EXTEND_64(s_hi, s_lo, a) \
472 s_hi += (s_lo < a) ? 1 : 0; \
475 #define ADD_STAT64(diff, t) \
477 ADD_64(pstats->mac_stx[1].t##_hi, new->diff##_hi, \
478 pstats->mac_stx[1].t##_lo, new->diff##_lo); \
481 #define UPDATE_EXTEND_STAT(s) \
483 ADD_EXTEND_64(pstats->mac_stx[1].s##_hi, \
484 pstats->mac_stx[1].s##_lo, \
488 #define UPDATE_EXTEND_TSTAT_X(s, t, size) \
490 diff = le##size##toh(tclient->s) - \
491 le##size##toh(old_tclient->s); \
492 old_tclient->s = tclient->s; \
493 ADD_EXTEND_64(qstats->t##_hi, qstats->t##_lo, diff); \
496 #define UPDATE_EXTEND_TSTAT(s, t) UPDATE_EXTEND_TSTAT_X(s, t, 32)
498 #define UPDATE_EXTEND_E_TSTAT(s, t, size) \
500 UPDATE_EXTEND_TSTAT_X(s, t, size); \
501 ADD_EXTEND_64(estats->t##_hi, estats->t##_lo, diff); \
504 #define UPDATE_EXTEND_USTAT(s, t) \
506 diff = le32toh(uclient->s) - le32toh(old_uclient->s); \
507 old_uclient->s = uclient->s; \
508 ADD_EXTEND_64(qstats->t##_hi, qstats->t##_lo, diff); \
511 #define UPDATE_EXTEND_E_USTAT(s, t) \
513 UPDATE_EXTEND_USTAT(s, t); \
514 ADD_EXTEND_64(estats->t##_hi, estats->t##_lo, diff); \
517 #define UPDATE_EXTEND_XSTAT(s, t) \
519 diff = le32toh(xclient->s) - le32toh(old_xclient->s); \
520 old_xclient->s = xclient->s; \
521 ADD_EXTEND_64(qstats->t##_hi, qstats->t##_lo, diff); \
524 #define UPDATE_QSTAT(s, t) \
526 qstats->t##_hi = qstats_old->t##_hi + le32toh(s.hi); \
527 qstats->t##_lo = qstats_old->t##_lo + le32toh(s.lo); \
530 #define UPDATE_QSTAT_OLD(f) \
532 qstats_old->f = qstats->f; \
535 #define UPDATE_ESTAT_QSTAT_64(s) \
537 ADD_64(estats->s##_hi, qstats->s##_hi, \
538 estats->s##_lo, qstats->s##_lo); \
539 SUB_64(estats->s##_hi, qstats_old->s##_hi_old, \
540 estats->s##_lo, qstats_old->s##_lo_old); \
541 qstats_old->s##_hi_old = qstats->s##_hi; \
542 qstats_old->s##_lo_old = qstats->s##_lo; \
545 #define UPDATE_ESTAT_QSTAT(s) \
547 estats->s += qstats->s; \
548 estats->s -= qstats_old->s##_old; \
549 qstats_old->s##_old = qstats->s; \
552 #define UPDATE_FSTAT_QSTAT(s) \
554 ADD_64(fstats->s##_hi, qstats->s##_hi, \
555 fstats->s##_lo, qstats->s##_lo); \
556 SUB_64(fstats->s##_hi, qstats_old->s##_hi, \
557 fstats->s##_lo, qstats_old->s##_lo); \
558 estats->s##_hi = fstats->s##_hi; \
559 estats->s##_lo = fstats->s##_lo; \
560 qstats_old->s##_hi = qstats->s##_hi; \
561 qstats_old->s##_lo = qstats->s##_lo; \
564 #define UPDATE_FW_STAT(s) \
566 estats->s = le32toh(tport->s) + fwstats->s; \
569 #define UPDATE_FW_STAT_OLD(f) \
571 fwstats->f = estats->f; \
574 #define UPDATE_ESTAT(s, t) \
576 SUB_64(estats->s##_hi, estats_old->t##_hi, \
577 estats->s##_lo, estats_old->t##_lo); \
578 ADD_64(estats->s##_hi, estats->t##_hi, \
579 estats->s##_lo, estats->t##_lo); \
580 estats_old->t##_hi = estats->t##_hi; \
581 estats_old->t##_lo = estats->t##_lo; \
584 /* minuend -= subtrahend */
585 #define SUB_64(m_hi, s_hi, m_lo, s_lo) \
587 DIFF_64(m_hi, m_hi, s_hi, m_lo, m_lo, s_lo); \
590 /* minuend[hi:lo] -= subtrahend */
591 #define SUB_EXTEND_64(m_hi, m_lo, s) \
594 SUB_64(m_hi, s_hi, m_lo, s); \
597 #define SUB_EXTEND_USTAT(s, t) \
599 diff = le32toh(uclient->s) - le32toh(old_uclient->s); \
600 SUB_EXTEND_64(qstats->t##_hi, qstats->t##_lo, diff); \
604 void bnx2x_stats_init(struct bnx2x_softc *sc);
605 void bnx2x_stats_handle(struct bnx2x_softc *sc, enum bnx2x_stats_event event);
606 void bnx2x_save_statistics(struct bnx2x_softc *sc);
607 void bnx2x_memset_stats(struct bnx2x_softc *sc);
609 #endif /* BNX2X_STATS_H */