bnx2x_stats.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /* bnx2x_stats.h: Broadcom Everest network driver.
  2. *
  3. * Copyright (c) 2007-2011 Broadcom Corporation
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation.
  8. *
  9. * Maintained by: Eilon Greenstein <eilong@broadcom.com>
  10. * Written by: Eliezer Tamir
  11. * Based on code from Michael Chan's bnx2 driver
  12. * UDP CSUM errata workaround by Arik Gendelman
  13. * Slowpath and fastpath rework by Vladislav Zolotarov
  14. * Statistics and Link management by Yitchak Gertner
  15. *
  16. */
  17. #ifndef BNX2X_STATS_H
  18. #define BNX2X_STATS_H
  19. #include <linux/types.h>
  20. struct bnx2x_eth_q_stats {
  21. u32 total_bytes_received_hi;
  22. u32 total_bytes_received_lo;
  23. u32 total_bytes_transmitted_hi;
  24. u32 total_bytes_transmitted_lo;
  25. u32 total_unicast_packets_received_hi;
  26. u32 total_unicast_packets_received_lo;
  27. u32 total_multicast_packets_received_hi;
  28. u32 total_multicast_packets_received_lo;
  29. u32 total_broadcast_packets_received_hi;
  30. u32 total_broadcast_packets_received_lo;
  31. u32 total_unicast_packets_transmitted_hi;
  32. u32 total_unicast_packets_transmitted_lo;
  33. u32 total_multicast_packets_transmitted_hi;
  34. u32 total_multicast_packets_transmitted_lo;
  35. u32 total_broadcast_packets_transmitted_hi;
  36. u32 total_broadcast_packets_transmitted_lo;
  37. u32 valid_bytes_received_hi;
  38. u32 valid_bytes_received_lo;
  39. u32 error_bytes_received_hi;
  40. u32 error_bytes_received_lo;
  41. u32 etherstatsoverrsizepkts_hi;
  42. u32 etherstatsoverrsizepkts_lo;
  43. u32 no_buff_discard_hi;
  44. u32 no_buff_discard_lo;
  45. u32 driver_xoff;
  46. u32 rx_err_discard_pkt;
  47. u32 rx_skb_alloc_failed;
  48. u32 hw_csum_err;
  49. };
  50. #define Q_STATS_OFFSET32(stat_name) \
  51. (offsetof(struct bnx2x_eth_q_stats, stat_name) / 4)
  52. struct nig_stats {
  53. u32 brb_discard;
  54. u32 brb_packet;
  55. u32 brb_truncate;
  56. u32 flow_ctrl_discard;
  57. u32 flow_ctrl_octets;
  58. u32 flow_ctrl_packet;
  59. u32 mng_discard;
  60. u32 mng_octet_inp;
  61. u32 mng_octet_out;
  62. u32 mng_packet_inp;
  63. u32 mng_packet_out;
  64. u32 pbf_octets;
  65. u32 pbf_packet;
  66. u32 safc_inp;
  67. u32 egress_mac_pkt0_lo;
  68. u32 egress_mac_pkt0_hi;
  69. u32 egress_mac_pkt1_lo;
  70. u32 egress_mac_pkt1_hi;
  71. };
  72. enum bnx2x_stats_event {
  73. STATS_EVENT_PMF = 0,
  74. STATS_EVENT_LINK_UP,
  75. STATS_EVENT_UPDATE,
  76. STATS_EVENT_STOP,
  77. STATS_EVENT_MAX
  78. };
  79. enum bnx2x_stats_state {
  80. STATS_STATE_DISABLED = 0,
  81. STATS_STATE_ENABLED,
  82. STATS_STATE_MAX
  83. };
  84. struct bnx2x_eth_stats {
  85. u32 total_bytes_received_hi;
  86. u32 total_bytes_received_lo;
  87. u32 total_bytes_transmitted_hi;
  88. u32 total_bytes_transmitted_lo;
  89. u32 total_unicast_packets_received_hi;
  90. u32 total_unicast_packets_received_lo;
  91. u32 total_multicast_packets_received_hi;
  92. u32 total_multicast_packets_received_lo;
  93. u32 total_broadcast_packets_received_hi;
  94. u32 total_broadcast_packets_received_lo;
  95. u32 total_unicast_packets_transmitted_hi;
  96. u32 total_unicast_packets_transmitted_lo;
  97. u32 total_multicast_packets_transmitted_hi;
  98. u32 total_multicast_packets_transmitted_lo;
  99. u32 total_broadcast_packets_transmitted_hi;
  100. u32 total_broadcast_packets_transmitted_lo;
  101. u32 valid_bytes_received_hi;
  102. u32 valid_bytes_received_lo;
  103. u32 error_bytes_received_hi;
  104. u32 error_bytes_received_lo;
  105. u32 etherstatsoverrsizepkts_hi;
  106. u32 etherstatsoverrsizepkts_lo;
  107. u32 no_buff_discard_hi;
  108. u32 no_buff_discard_lo;
  109. u32 rx_stat_ifhcinbadoctets_hi;
  110. u32 rx_stat_ifhcinbadoctets_lo;
  111. u32 tx_stat_ifhcoutbadoctets_hi;
  112. u32 tx_stat_ifhcoutbadoctets_lo;
  113. u32 rx_stat_dot3statsfcserrors_hi;
  114. u32 rx_stat_dot3statsfcserrors_lo;
  115. u32 rx_stat_dot3statsalignmenterrors_hi;
  116. u32 rx_stat_dot3statsalignmenterrors_lo;
  117. u32 rx_stat_dot3statscarriersenseerrors_hi;
  118. u32 rx_stat_dot3statscarriersenseerrors_lo;
  119. u32 rx_stat_falsecarriererrors_hi;
  120. u32 rx_stat_falsecarriererrors_lo;
  121. u32 rx_stat_etherstatsundersizepkts_hi;
  122. u32 rx_stat_etherstatsundersizepkts_lo;
  123. u32 rx_stat_dot3statsframestoolong_hi;
  124. u32 rx_stat_dot3statsframestoolong_lo;
  125. u32 rx_stat_etherstatsfragments_hi;
  126. u32 rx_stat_etherstatsfragments_lo;
  127. u32 rx_stat_etherstatsjabbers_hi;
  128. u32 rx_stat_etherstatsjabbers_lo;
  129. u32 rx_stat_maccontrolframesreceived_hi;
  130. u32 rx_stat_maccontrolframesreceived_lo;
  131. u32 rx_stat_bmac_xpf_hi;
  132. u32 rx_stat_bmac_xpf_lo;
  133. u32 rx_stat_bmac_xcf_hi;
  134. u32 rx_stat_bmac_xcf_lo;
  135. u32 rx_stat_xoffstateentered_hi;
  136. u32 rx_stat_xoffstateentered_lo;
  137. u32 rx_stat_xonpauseframesreceived_hi;
  138. u32 rx_stat_xonpauseframesreceived_lo;
  139. u32 rx_stat_xoffpauseframesreceived_hi;
  140. u32 rx_stat_xoffpauseframesreceived_lo;
  141. u32 tx_stat_outxonsent_hi;
  142. u32 tx_stat_outxonsent_lo;
  143. u32 tx_stat_outxoffsent_hi;
  144. u32 tx_stat_outxoffsent_lo;
  145. u32 tx_stat_flowcontroldone_hi;
  146. u32 tx_stat_flowcontroldone_lo;
  147. u32 tx_stat_etherstatscollisions_hi;
  148. u32 tx_stat_etherstatscollisions_lo;
  149. u32 tx_stat_dot3statssinglecollisionframes_hi;
  150. u32 tx_stat_dot3statssinglecollisionframes_lo;
  151. u32 tx_stat_dot3statsmultiplecollisionframes_hi;
  152. u32 tx_stat_dot3statsmultiplecollisionframes_lo;
  153. u32 tx_stat_dot3statsdeferredtransmissions_hi;
  154. u32 tx_stat_dot3statsdeferredtransmissions_lo;
  155. u32 tx_stat_dot3statsexcessivecollisions_hi;
  156. u32 tx_stat_dot3statsexcessivecollisions_lo;
  157. u32 tx_stat_dot3statslatecollisions_hi;
  158. u32 tx_stat_dot3statslatecollisions_lo;
  159. u32 tx_stat_etherstatspkts64octets_hi;
  160. u32 tx_stat_etherstatspkts64octets_lo;
  161. u32 tx_stat_etherstatspkts65octetsto127octets_hi;
  162. u32 tx_stat_etherstatspkts65octetsto127octets_lo;
  163. u32 tx_stat_etherstatspkts128octetsto255octets_hi;
  164. u32 tx_stat_etherstatspkts128octetsto255octets_lo;
  165. u32 tx_stat_etherstatspkts256octetsto511octets_hi;
  166. u32 tx_stat_etherstatspkts256octetsto511octets_lo;
  167. u32 tx_stat_etherstatspkts512octetsto1023octets_hi;
  168. u32 tx_stat_etherstatspkts512octetsto1023octets_lo;
  169. u32 tx_stat_etherstatspkts1024octetsto1522octets_hi;
  170. u32 tx_stat_etherstatspkts1024octetsto1522octets_lo;
  171. u32 tx_stat_etherstatspktsover1522octets_hi;
  172. u32 tx_stat_etherstatspktsover1522octets_lo;
  173. u32 tx_stat_bmac_2047_hi;
  174. u32 tx_stat_bmac_2047_lo;
  175. u32 tx_stat_bmac_4095_hi;
  176. u32 tx_stat_bmac_4095_lo;
  177. u32 tx_stat_bmac_9216_hi;
  178. u32 tx_stat_bmac_9216_lo;
  179. u32 tx_stat_bmac_16383_hi;
  180. u32 tx_stat_bmac_16383_lo;
  181. u32 tx_stat_dot3statsinternalmactransmiterrors_hi;
  182. u32 tx_stat_dot3statsinternalmactransmiterrors_lo;
  183. u32 tx_stat_bmac_ufl_hi;
  184. u32 tx_stat_bmac_ufl_lo;
  185. u32 pause_frames_received_hi;
  186. u32 pause_frames_received_lo;
  187. u32 pause_frames_sent_hi;
  188. u32 pause_frames_sent_lo;
  189. u32 etherstatspkts1024octetsto1522octets_hi;
  190. u32 etherstatspkts1024octetsto1522octets_lo;
  191. u32 etherstatspktsover1522octets_hi;
  192. u32 etherstatspktsover1522octets_lo;
  193. u32 brb_drop_hi;
  194. u32 brb_drop_lo;
  195. u32 brb_truncate_hi;
  196. u32 brb_truncate_lo;
  197. u32 mac_filter_discard;
  198. u32 xxoverflow_discard;
  199. u32 brb_truncate_discard;
  200. u32 mac_discard;
  201. u32 driver_xoff;
  202. u32 rx_err_discard_pkt;
  203. u32 rx_skb_alloc_failed;
  204. u32 hw_csum_err;
  205. u32 nig_timer_max;
  206. };
  207. #define STATS_OFFSET32(stat_name) \
  208. (offsetof(struct bnx2x_eth_stats, stat_name) / 4)
  209. /* Forward declaration */
  210. struct bnx2x;
  211. void bnx2x_stats_init(struct bnx2x *bp);
  212. extern const u32 dmae_reg_go_c[];
  213. #endif /* BNX2X_STATS_H */