vxge-traffic.h 98 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409
  1. /******************************************************************************
  2. * This software may be used and distributed according to the terms of
  3. * the GNU General Public License (GPL), incorporated herein by reference.
  4. * Drivers based on or derived from this code fall under the GPL and must
  5. * retain the authorship, copyright and license notice. This file is not
  6. * a complete program and may only be used when the entire operating
  7. * system is licensed under the GPL.
  8. * See the file COPYING in this distribution for more information.
  9. *
  10. * vxge-traffic.h: Driver for Neterion Inc's X3100 Series 10GbE PCIe I/O
  11. * Virtualized Server Adapter.
  12. * Copyright(c) 2002-2009 Neterion Inc.
  13. ******************************************************************************/
  14. #ifndef VXGE_TRAFFIC_H
  15. #define VXGE_TRAFFIC_H
  16. #include "vxge-reg.h"
  17. #include "vxge-version.h"
  18. #define VXGE_HW_DTR_MAX_T_CODE 16
  19. #define VXGE_HW_ALL_FOXES 0xFFFFFFFFFFFFFFFFULL
  20. #define VXGE_HW_INTR_MASK_ALL 0xFFFFFFFFFFFFFFFFULL
  21. #define VXGE_HW_MAX_VIRTUAL_PATHS 17
  22. #define VXGE_HW_MAC_MAX_MAC_PORT_ID 2
  23. #define VXGE_HW_DEFAULT_32 0xffffffff
  24. /* frames sizes */
  25. #define VXGE_HW_HEADER_802_2_SIZE 3
  26. #define VXGE_HW_HEADER_SNAP_SIZE 5
  27. #define VXGE_HW_HEADER_VLAN_SIZE 4
  28. #define VXGE_HW_MAC_HEADER_MAX_SIZE \
  29. (ETH_HLEN + \
  30. VXGE_HW_HEADER_802_2_SIZE + \
  31. VXGE_HW_HEADER_VLAN_SIZE + \
  32. VXGE_HW_HEADER_SNAP_SIZE)
  33. #define VXGE_HW_TCPIP_HEADER_MAX_SIZE (64 + 64)
  34. /* 32bit alignments */
  35. #define VXGE_HW_HEADER_ETHERNET_II_802_3_ALIGN 2
  36. #define VXGE_HW_HEADER_802_2_SNAP_ALIGN 2
  37. #define VXGE_HW_HEADER_802_2_ALIGN 3
  38. #define VXGE_HW_HEADER_SNAP_ALIGN 1
  39. #define VXGE_HW_L3_CKSUM_OK 0xFFFF
  40. #define VXGE_HW_L4_CKSUM_OK 0xFFFF
  41. /* Forward declarations */
  42. struct __vxge_hw_device;
  43. struct __vxge_hw_vpath_handle;
  44. struct vxge_hw_vp_config;
  45. struct __vxge_hw_virtualpath;
  46. struct __vxge_hw_channel;
  47. struct __vxge_hw_fifo;
  48. struct __vxge_hw_ring;
  49. struct vxge_hw_ring_attr;
  50. struct vxge_hw_mempool;
  51. #ifndef TRUE
  52. #define TRUE 1
  53. #endif
  54. #ifndef FALSE
  55. #define FALSE 0
  56. #endif
  57. /*VXGE_HW_STATUS_H*/
  58. #define VXGE_HW_EVENT_BASE 0
  59. #define VXGE_LL_EVENT_BASE 100
  60. /**
  61. * enum vxge_hw_event- Enumerates slow-path HW events.
  62. * @VXGE_HW_EVENT_UNKNOWN: Unknown (and invalid) event.
  63. * @VXGE_HW_EVENT_SERR: Serious vpath hardware error event.
  64. * @VXGE_HW_EVENT_ECCERR: vpath ECC error event.
  65. * @VXGE_HW_EVENT_VPATH_ERR: Error local to the respective vpath
  66. * @VXGE_HW_EVENT_FIFO_ERR: FIFO Doorbell fifo error.
  67. * @VXGE_HW_EVENT_SRPCIM_SERR: srpcim hardware error event.
  68. * @VXGE_HW_EVENT_MRPCIM_SERR: mrpcim hardware error event.
  69. * @VXGE_HW_EVENT_MRPCIM_ECCERR: mrpcim ecc error event.
  70. * @VXGE_HW_EVENT_RESET_START: Privileged entity is starting device reset
  71. * @VXGE_HW_EVENT_RESET_COMPLETE: Device reset has been completed
  72. * @VXGE_HW_EVENT_SLOT_FREEZE: Slot-freeze event. Driver tries to distinguish
  73. * slot-freeze from the rest critical events (e.g. ECC) when it is
  74. * impossible to PIO read "through" the bus, i.e. when getting all-foxes.
  75. *
  76. * enum vxge_hw_event enumerates slow-path HW eventis.
  77. *
  78. * See also: struct vxge_hw_uld_cbs{}, vxge_uld_link_up_f{},
  79. * vxge_uld_link_down_f{}.
  80. */
  81. enum vxge_hw_event {
  82. VXGE_HW_EVENT_UNKNOWN = 0,
  83. /* HW events */
  84. VXGE_HW_EVENT_RESET_START = VXGE_HW_EVENT_BASE + 1,
  85. VXGE_HW_EVENT_RESET_COMPLETE = VXGE_HW_EVENT_BASE + 2,
  86. VXGE_HW_EVENT_LINK_DOWN = VXGE_HW_EVENT_BASE + 3,
  87. VXGE_HW_EVENT_LINK_UP = VXGE_HW_EVENT_BASE + 4,
  88. VXGE_HW_EVENT_ALARM_CLEARED = VXGE_HW_EVENT_BASE + 5,
  89. VXGE_HW_EVENT_ECCERR = VXGE_HW_EVENT_BASE + 6,
  90. VXGE_HW_EVENT_MRPCIM_ECCERR = VXGE_HW_EVENT_BASE + 7,
  91. VXGE_HW_EVENT_FIFO_ERR = VXGE_HW_EVENT_BASE + 8,
  92. VXGE_HW_EVENT_VPATH_ERR = VXGE_HW_EVENT_BASE + 9,
  93. VXGE_HW_EVENT_CRITICAL_ERR = VXGE_HW_EVENT_BASE + 10,
  94. VXGE_HW_EVENT_SERR = VXGE_HW_EVENT_BASE + 11,
  95. VXGE_HW_EVENT_SRPCIM_SERR = VXGE_HW_EVENT_BASE + 12,
  96. VXGE_HW_EVENT_MRPCIM_SERR = VXGE_HW_EVENT_BASE + 13,
  97. VXGE_HW_EVENT_SLOT_FREEZE = VXGE_HW_EVENT_BASE + 14,
  98. };
  99. #define VXGE_HW_SET_LEVEL(a, b) (((a) > (b)) ? (a) : (b))
  100. /*
  101. * struct vxge_hw_mempool_dma - Represents DMA objects passed to the
  102. caller.
  103. */
  104. struct vxge_hw_mempool_dma {
  105. dma_addr_t addr;
  106. struct pci_dev *handle;
  107. struct pci_dev *acc_handle;
  108. };
  109. /*
  110. * vxge_hw_mempool_item_f - Mempool item alloc/free callback
  111. * @mempoolh: Memory pool handle.
  112. * @memblock: Address of memory block
  113. * @memblock_index: Index of memory block
  114. * @item: Item that gets allocated or freed.
  115. * @index: Item's index in the memory pool.
  116. * @is_last: True, if this item is the last one in the pool; false - otherwise.
  117. * userdata: Per-pool user context.
  118. *
  119. * Memory pool allocation/deallocation callback.
  120. */
  121. /*
  122. * struct vxge_hw_mempool - Memory pool.
  123. */
  124. struct vxge_hw_mempool {
  125. void (*item_func_alloc)(
  126. struct vxge_hw_mempool *mempoolh,
  127. u32 memblock_index,
  128. struct vxge_hw_mempool_dma *dma_object,
  129. u32 index,
  130. u32 is_last);
  131. void *userdata;
  132. void **memblocks_arr;
  133. void **memblocks_priv_arr;
  134. struct vxge_hw_mempool_dma *memblocks_dma_arr;
  135. struct __vxge_hw_device *devh;
  136. u32 memblock_size;
  137. u32 memblocks_max;
  138. u32 memblocks_allocated;
  139. u32 item_size;
  140. u32 items_max;
  141. u32 items_initial;
  142. u32 items_current;
  143. u32 items_per_memblock;
  144. void **items_arr;
  145. u32 items_priv_size;
  146. };
  147. #define VXGE_HW_MAX_INTR_PER_VP 4
  148. #define VXGE_HW_VPATH_INTR_TX 0
  149. #define VXGE_HW_VPATH_INTR_RX 1
  150. #define VXGE_HW_VPATH_INTR_EINTA 2
  151. #define VXGE_HW_VPATH_INTR_BMAP 3
  152. #define VXGE_HW_BLOCK_SIZE 4096
  153. /**
  154. * struct vxge_hw_tim_intr_config - Titan Tim interrupt configuration.
  155. * @intr_enable: Set to 1, if interrupt is enabled.
  156. * @btimer_val: Boundary Timer Initialization value in units of 272 ns.
  157. * @timer_ac_en: Timer Automatic Cancel. 1 : Automatic Canceling Enable: when
  158. * asserted, other interrupt-generating entities will cancel the
  159. * scheduled timer interrupt.
  160. * @timer_ci_en: Timer Continuous Interrupt. 1 : Continuous Interrupting Enable:
  161. * When asserted, an interrupt will be generated every time the
  162. * boundary timer expires, even if no traffic has been transmitted
  163. * on this interrupt.
  164. * @timer_ri_en: Timer Consecutive (Re-) Interrupt 1 : Consecutive
  165. * (Re-) Interrupt Enable: When asserted, an interrupt will be
  166. * generated the next time the timer expires, even if no traffic has
  167. * been transmitted on this interrupt. (This will only happen once
  168. * each time that this value is written to the TIM.) This bit is
  169. * cleared by H/W at the end of the current-timer-interval when
  170. * the interrupt is triggered.
  171. * @rtimer_val: Restriction Timer Initialization value in units of 272 ns.
  172. * @util_sel: Utilization Selector. Selects which of the workload approximations
  173. * to use (e.g. legacy Tx utilization, Tx/Rx utilization, host
  174. * specified utilization etc.), selects one of
  175. * the 17 host configured values.
  176. * 0-Virtual Path 0
  177. * 1-Virtual Path 1
  178. * ...
  179. * 16-Virtual Path 17
  180. * 17-Legacy Tx network utilization, provided by TPA
  181. * 18-Legacy Rx network utilization, provided by FAU
  182. * 19-Average of legacy Rx and Tx utilization calculated from link
  183. * utilization values.
  184. * 20-31-Invalid configurations
  185. * 32-Host utilization for Virtual Path 0
  186. * 33-Host utilization for Virtual Path 1
  187. * ...
  188. * 48-Host utilization for Virtual Path 17
  189. * 49-Legacy Tx network utilization, provided by TPA
  190. * 50-Legacy Rx network utilization, provided by FAU
  191. * 51-Average of legacy Rx and Tx utilization calculated from
  192. * link utilization values.
  193. * 52-63-Invalid configurations
  194. * @ltimer_val: Latency Timer Initialization Value in units of 272 ns.
  195. * @txd_cnt_en: TxD Return Event Count Enable. This configuration bit when set
  196. * to 1 enables counting of TxD0 returns (signalled by PCC's),
  197. * towards utilization event count values.
  198. * @urange_a: Defines the upper limit (in percent) for this utilization range
  199. * to be active. This range is considered active
  200. * if 0 = UTIL = URNG_A
  201. * and the UEC_A field (below) is non-zero.
  202. * @uec_a: Utilization Event Count A. If this range is active, the adapter will
  203. * wait until UEC_A events have occurred on the interrupt before
  204. * generating an interrupt.
  205. * @urange_b: Link utilization range B.
  206. * @uec_b: Utilization Event Count B.
  207. * @urange_c: Link utilization range C.
  208. * @uec_c: Utilization Event Count C.
  209. * @urange_d: Link utilization range D.
  210. * @uec_d: Utilization Event Count D.
  211. * Traffic Interrupt Controller Module interrupt configuration.
  212. */
  213. struct vxge_hw_tim_intr_config {
  214. u32 intr_enable;
  215. #define VXGE_HW_TIM_INTR_ENABLE 1
  216. #define VXGE_HW_TIM_INTR_DISABLE 0
  217. #define VXGE_HW_TIM_INTR_DEFAULT 0
  218. u32 btimer_val;
  219. #define VXGE_HW_MIN_TIM_BTIMER_VAL 0
  220. #define VXGE_HW_MAX_TIM_BTIMER_VAL 67108864
  221. #define VXGE_HW_USE_FLASH_DEFAULT 0xffffffff
  222. u32 timer_ac_en;
  223. #define VXGE_HW_TIM_TIMER_AC_ENABLE 1
  224. #define VXGE_HW_TIM_TIMER_AC_DISABLE 0
  225. u32 timer_ci_en;
  226. #define VXGE_HW_TIM_TIMER_CI_ENABLE 1
  227. #define VXGE_HW_TIM_TIMER_CI_DISABLE 0
  228. u32 timer_ri_en;
  229. #define VXGE_HW_TIM_TIMER_RI_ENABLE 1
  230. #define VXGE_HW_TIM_TIMER_RI_DISABLE 0
  231. u32 rtimer_val;
  232. #define VXGE_HW_MIN_TIM_RTIMER_VAL 0
  233. #define VXGE_HW_MAX_TIM_RTIMER_VAL 67108864
  234. u32 util_sel;
  235. #define VXGE_HW_TIM_UTIL_SEL_LEGACY_TX_NET_UTIL 17
  236. #define VXGE_HW_TIM_UTIL_SEL_LEGACY_RX_NET_UTIL 18
  237. #define VXGE_HW_TIM_UTIL_SEL_LEGACY_TX_RX_AVE_NET_UTIL 19
  238. #define VXGE_HW_TIM_UTIL_SEL_PER_VPATH 63
  239. u32 ltimer_val;
  240. #define VXGE_HW_MIN_TIM_LTIMER_VAL 0
  241. #define VXGE_HW_MAX_TIM_LTIMER_VAL 67108864
  242. /* Line utilization interrupts */
  243. u32 urange_a;
  244. #define VXGE_HW_MIN_TIM_URANGE_A 0
  245. #define VXGE_HW_MAX_TIM_URANGE_A 100
  246. u32 uec_a;
  247. #define VXGE_HW_MIN_TIM_UEC_A 0
  248. #define VXGE_HW_MAX_TIM_UEC_A 65535
  249. u32 urange_b;
  250. #define VXGE_HW_MIN_TIM_URANGE_B 0
  251. #define VXGE_HW_MAX_TIM_URANGE_B 100
  252. u32 uec_b;
  253. #define VXGE_HW_MIN_TIM_UEC_B 0
  254. #define VXGE_HW_MAX_TIM_UEC_B 65535
  255. u32 urange_c;
  256. #define VXGE_HW_MIN_TIM_URANGE_C 0
  257. #define VXGE_HW_MAX_TIM_URANGE_C 100
  258. u32 uec_c;
  259. #define VXGE_HW_MIN_TIM_UEC_C 0
  260. #define VXGE_HW_MAX_TIM_UEC_C 65535
  261. u32 uec_d;
  262. #define VXGE_HW_MIN_TIM_UEC_D 0
  263. #define VXGE_HW_MAX_TIM_UEC_D 65535
  264. };
  265. #define VXGE_HW_STATS_OP_READ 0
  266. #define VXGE_HW_STATS_OP_CLEAR_STAT 1
  267. #define VXGE_HW_STATS_OP_CLEAR_ALL_VPATH_STATS 2
  268. #define VXGE_HW_STATS_OP_CLEAR_ALL_STATS_OF_LOC 2
  269. #define VXGE_HW_STATS_OP_CLEAR_ALL_STATS 3
  270. #define VXGE_HW_STATS_LOC_AGGR 17
  271. #define VXGE_HW_STATS_AGGRn_OFFSET 0x00720
  272. #define VXGE_HW_STATS_VPATH_TX_OFFSET 0x0
  273. #define VXGE_HW_STATS_VPATH_RX_OFFSET 0x00090
  274. #define VXGE_HW_STATS_VPATH_PROG_EVENT_VNUM0_OFFSET (0x001d0 >> 3)
  275. #define VXGE_HW_STATS_GET_VPATH_PROG_EVENT_VNUM0(bits) \
  276. vxge_bVALn(bits, 0, 32)
  277. #define VXGE_HW_STATS_GET_VPATH_PROG_EVENT_VNUM1(bits) \
  278. vxge_bVALn(bits, 32, 32)
  279. #define VXGE_HW_STATS_VPATH_PROG_EVENT_VNUM2_OFFSET (0x001d8 >> 3)
  280. #define VXGE_HW_STATS_GET_VPATH_PROG_EVENT_VNUM2(bits) \
  281. vxge_bVALn(bits, 0, 32)
  282. #define VXGE_HW_STATS_GET_VPATH_PROG_EVENT_VNUM3(bits) \
  283. vxge_bVALn(bits, 32, 32)
  284. /**
  285. * struct vxge_hw_xmac_aggr_stats - Per-Aggregator XMAC Statistics
  286. *
  287. * @tx_frms: Count of data frames transmitted on this Aggregator on all
  288. * its Aggregation ports. Does not include LACPDUs or Marker PDUs.
  289. * However, does include frames discarded by the Distribution
  290. * function.
  291. * @tx_data_octets: Count of data and padding octets of frames transmitted
  292. * on this Aggregator on all its Aggregation ports. Does not include
  293. * octets of LACPDUs or Marker PDUs. However, does include octets of
  294. * frames discarded by the Distribution function.
  295. * @tx_mcast_frms: Count of data frames transmitted (to a group destination
  296. * address other than the broadcast address) on this Aggregator on
  297. * all its Aggregation ports. Does not include LACPDUs or Marker
  298. * PDUs. However, does include frames discarded by the Distribution
  299. * function.
  300. * @tx_bcast_frms: Count of broadcast data frames transmitted on this Aggregator
  301. * on all its Aggregation ports. Does not include LACPDUs or Marker
  302. * PDUs. However, does include frames discarded by the Distribution
  303. * function.
  304. * @tx_discarded_frms: Count of data frames to be transmitted on this Aggregator
  305. * that are discarded by the Distribution function. This occurs when
  306. * conversation are allocated to different ports and have to be
  307. * flushed on old ports
  308. * @tx_errored_frms: Count of data frames transmitted on this Aggregator that
  309. * experience transmission errors on its Aggregation ports.
  310. * @rx_frms: Count of data frames received on this Aggregator on all its
  311. * Aggregation ports. Does not include LACPDUs or Marker PDUs.
  312. * Also, does not include frames discarded by the Collection
  313. * function.
  314. * @rx_data_octets: Count of data and padding octets of frames received on this
  315. * Aggregator on all its Aggregation ports. Does not include octets
  316. * of LACPDUs or Marker PDUs. Also, does not include
  317. * octets of frames
  318. * discarded by the Collection function.
  319. * @rx_mcast_frms: Count of data frames received (from a group destination
  320. * address other than the broadcast address) on this Aggregator on
  321. * all its Aggregation ports. Does not include LACPDUs or Marker
  322. * PDUs. Also, does not include frames discarded by the Collection
  323. * function.
  324. * @rx_bcast_frms: Count of broadcast data frames received on this Aggregator on
  325. * all its Aggregation ports. Does not include LACPDUs or Marker
  326. * PDUs. Also, does not include frames discarded by the Collection
  327. * function.
  328. * @rx_discarded_frms: Count of data frames received on this Aggregator that are
  329. * discarded by the Collection function because the Collection
  330. * function was disabled on the port which the frames are received.
  331. * @rx_errored_frms: Count of data frames received on this Aggregator that are
  332. * discarded by its Aggregation ports, or are discarded by the
  333. * Collection function of the Aggregator, or that are discarded by
  334. * the Aggregator due to detection of an illegal Slow Protocols PDU.
  335. * @rx_unknown_slow_proto_frms: Count of data frames received on this Aggregator
  336. * that are discarded by its Aggregation ports due to detection of
  337. * an unknown Slow Protocols PDU.
  338. *
  339. * Per aggregator XMAC RX statistics.
  340. */
  341. struct vxge_hw_xmac_aggr_stats {
  342. /*0x000*/ u64 tx_frms;
  343. /*0x008*/ u64 tx_data_octets;
  344. /*0x010*/ u64 tx_mcast_frms;
  345. /*0x018*/ u64 tx_bcast_frms;
  346. /*0x020*/ u64 tx_discarded_frms;
  347. /*0x028*/ u64 tx_errored_frms;
  348. /*0x030*/ u64 rx_frms;
  349. /*0x038*/ u64 rx_data_octets;
  350. /*0x040*/ u64 rx_mcast_frms;
  351. /*0x048*/ u64 rx_bcast_frms;
  352. /*0x050*/ u64 rx_discarded_frms;
  353. /*0x058*/ u64 rx_errored_frms;
  354. /*0x060*/ u64 rx_unknown_slow_proto_frms;
  355. } __packed;
  356. /**
  357. * struct vxge_hw_xmac_port_stats - XMAC Port Statistics
  358. *
  359. * @tx_ttl_frms: Count of successfully transmitted MAC frames
  360. * @tx_ttl_octets: Count of total octets of transmitted frames, not including
  361. * framing characters (i.e. less framing bits). To determine the
  362. * total octets of transmitted frames, including framing characters,
  363. * multiply PORTn_TX_TTL_FRMS by 8 and add it to this stat (unless
  364. * otherwise configured, this stat only counts frames that have
  365. * 8 bytes of preamble for each frame). This stat can be configured
  366. * (see XMAC_STATS_GLOBAL_CFG.TTL_FRMS_HANDLING) to count everything
  367. * including the preamble octets.
  368. * @tx_data_octets: Count of data and padding octets of successfully transmitted
  369. * frames.
  370. * @tx_mcast_frms: Count of successfully transmitted frames to a group address
  371. * other than the broadcast address.
  372. * @tx_bcast_frms: Count of successfully transmitted frames to the broadcast
  373. * group address.
  374. * @tx_ucast_frms: Count of transmitted frames containing a unicast address.
  375. * Includes discarded frames that are not sent to the network.
  376. * @tx_tagged_frms: Count of transmitted frames containing a VLAN tag.
  377. * @tx_vld_ip: Count of transmitted IP datagrams that are passed to the network.
  378. * @tx_vld_ip_octets: Count of total octets of transmitted IP datagrams that
  379. * are passed to the network.
  380. * @tx_icmp: Count of transmitted ICMP messages. Includes messages not sent
  381. * due to problems within ICMP.
  382. * @tx_tcp: Count of transmitted TCP segments. Does not include segments
  383. * containing retransmitted octets.
  384. * @tx_rst_tcp: Count of transmitted TCP segments containing the RST flag.
  385. * @tx_udp: Count of transmitted UDP datagrams.
  386. * @tx_parse_error: Increments when the TPA is unable to parse a packet. This
  387. * generally occurs when a packet is corrupt somehow, including
  388. * packets that have IP version mismatches, invalid Layer 2 control
  389. * fields, etc. L3/L4 checksums are not offloaded, but the packet
  390. * is still be transmitted.
  391. * @tx_unknown_protocol: Increments when the TPA encounters an unknown
  392. * protocol, such as a new IPv6 extension header, or an unsupported
  393. * Routing Type. The packet still has a checksum calculated but it
  394. * may be incorrect.
  395. * @tx_pause_ctrl_frms: Count of MAC PAUSE control frames that are transmitted.
  396. * Since, the only control frames supported by this device are
  397. * PAUSE frames, this register is a count of all transmitted MAC
  398. * control frames.
  399. * @tx_marker_pdu_frms: Count of Marker PDUs transmitted
  400. * on this Aggregation port.
  401. * @tx_lacpdu_frms: Count of LACPDUs transmitted on this Aggregation port.
  402. * @tx_drop_ip: Count of transmitted IP datagrams that could not be passed to
  403. * the network. Increments because of:
  404. * 1) An internal processing error
  405. * (such as an uncorrectable ECC error). 2) A frame parsing error
  406. * during IP checksum calculation.
  407. * @tx_marker_resp_pdu_frms: Count of Marker Response PDUs transmitted on this
  408. * Aggregation port.
  409. * @tx_xgmii_char2_match: Maintains a count of the number of transmitted XGMII
  410. * characters that match a pattern that is programmable through
  411. * register XMAC_STATS_TX_XGMII_CHAR_PORTn. By default, the pattern
  412. * is set to /T/ (i.e. the terminate character), thus the statistic
  413. * tracks the number of transmitted Terminate characters.
  414. * @tx_xgmii_char1_match: Maintains a count of the number of transmitted XGMII
  415. * characters that match a pattern that is programmable through
  416. * register XMAC_STATS_TX_XGMII_CHAR_PORTn. By default, the pattern
  417. * is set to /S/ (i.e. the start character),
  418. * thus the statistic tracks
  419. * the number of transmitted Start characters.
  420. * @tx_xgmii_column2_match: Maintains a count of the number of transmitted XGMII
  421. * columns that match a pattern that is programmable through register
  422. * XMAC_STATS_TX_XGMII_COLUMN2_PORTn. By default, the pattern is set
  423. * to 4 x /E/ (i.e. a column containing all error characters), thus
  424. * the statistic tracks the number of Error columns transmitted at
  425. * any time. If XMAC_STATS_TX_XGMII_BEHAV_COLUMN2_PORTn.NEAR_COL1 is
  426. * set to 1, then this stat increments when COLUMN2 is found within
  427. * 'n' clocks after COLUMN1. Here, 'n' is defined by
  428. * XMAC_STATS_TX_XGMII_BEHAV_COLUMN2_PORTn.NUM_COL (if 'n' is set
  429. * to 0, then it means to search anywhere for COLUMN2).
  430. * @tx_xgmii_column1_match: Maintains a count of the number of transmitted XGMII
  431. * columns that match a pattern that is programmable through register
  432. * XMAC_STATS_TX_XGMII_COLUMN1_PORTn. By default, the pattern is set
  433. * to 4 x /I/ (i.e. a column containing all idle characters),
  434. * thus the statistic tracks the number of transmitted Idle columns.
  435. * @tx_any_err_frms: Count of transmitted frames containing any error that
  436. * prevents them from being passed to the network. Increments if
  437. * there is an ECC while reading the frame out of the transmit
  438. * buffer. Also increments if the transmit protocol assist (TPA)
  439. * block determines that the frame should not be sent.
  440. * @tx_drop_frms: Count of frames that could not be sent for no other reason
  441. * than internal MAC processing. Increments once whenever the
  442. * transmit buffer is flushed (due to an ECC error on a memory
  443. * descriptor).
  444. * @rx_ttl_frms: Count of total received MAC frames, including frames received
  445. * with frame-too-long, FCS, or length errors. This stat can be
  446. * configured (see XMAC_STATS_GLOBAL_CFG.TTL_FRMS_HANDLING) to count
  447. * everything, even "frames" as small one byte of preamble.
  448. * @rx_vld_frms: Count of successfully received MAC frames. Does not include
  449. * frames received with frame-too-long, FCS, or length errors.
  450. * @rx_offload_frms: Count of offloaded received frames that are passed to
  451. * the host.
  452. * @rx_ttl_octets: Count of total octets of received frames, not including
  453. * framing characters (i.e. less framing bits). To determine the
  454. * total octets of received frames, including framing characters,
  455. * multiply PORTn_RX_TTL_FRMS by 8 and add it to this stat (unless
  456. * otherwise configured, this stat only counts frames that have 8
  457. * bytes of preamble for each frame). This stat can be configured
  458. * (see XMAC_STATS_GLOBAL_CFG.TTL_FRMS_HANDLING) to count everything,
  459. * even the preamble octets of "frames" as small one byte of preamble
  460. * @rx_data_octets: Count of data and padding octets of successfully received
  461. * frames. Does not include frames received with frame-too-long,
  462. * FCS, or length errors.
  463. * @rx_offload_octets: Count of total octets, not including framing
  464. * characters, of offloaded received frames that are passed
  465. * to the host.
  466. * @rx_vld_mcast_frms: Count of successfully received MAC frames containing a
  467. * nonbroadcast group address. Does not include frames received
  468. * with frame-too-long, FCS, or length errors.
  469. * @rx_vld_bcast_frms: Count of successfully received MAC frames containing
  470. * the broadcast group address. Does not include frames received
  471. * with frame-too-long, FCS, or length errors.
  472. * @rx_accepted_ucast_frms: Count of successfully received frames containing
  473. * a unicast address. Only includes frames that are passed to
  474. * the system.
  475. * @rx_accepted_nucast_frms: Count of successfully received frames containing
  476. * a non-unicast (broadcast or multicast) address. Only includes
  477. * frames that are passed to the system. Could include, for instance,
  478. * non-unicast frames that contain FCS errors if the MAC_ERROR_CFG
  479. * register is set to pass FCS-errored frames to the host.
  480. * @rx_tagged_frms: Count of received frames containing a VLAN tag.
  481. * @rx_long_frms: Count of received frames that are longer than RX_MAX_PYLD_LEN
  482. * + 18 bytes (+ 22 bytes if VLAN-tagged).
  483. * @rx_usized_frms: Count of received frames of length (including FCS, but not
  484. * framing bits) less than 64 octets, that are otherwise well-formed.
  485. * In other words, counts runts.
  486. * @rx_osized_frms: Count of received frames of length (including FCS, but not
  487. * framing bits) more than 1518 octets, that are otherwise
  488. * well-formed. Note: If register XMAC_STATS_GLOBAL_CFG.VLAN_HANDLING
  489. * is set to 1, then "more than 1518 octets" becomes "more than 1518
  490. * (1522 if VLAN-tagged) octets".
  491. * @rx_frag_frms: Count of received frames of length (including FCS, but not
  492. * framing bits) less than 64 octets that had bad FCS. In other
  493. * words, counts fragments.
  494. * @rx_jabber_frms: Count of received frames of length (including FCS, but not
  495. * framing bits) more than 1518 octets that had bad FCS. In other
  496. * words, counts jabbers. Note: If register
  497. * XMAC_STATS_GLOBAL_CFG.VLAN_HANDLING is set to 1, then "more than
  498. * 1518 octets" becomes "more than 1518 (1522 if VLAN-tagged)
  499. * octets".
  500. * @rx_ttl_64_frms: Count of total received MAC frames with length (including
  501. * FCS, but not framing bits) of exactly 64 octets. Includes frames
  502. * received with frame-too-long, FCS, or length errors.
  503. * @rx_ttl_65_127_frms: Count of total received MAC frames with length
  504. * (including FCS, but not framing bits) of between 65 and 127
  505. * octets inclusive. Includes frames received with frame-too-long,
  506. * FCS, or length errors.
  507. * @rx_ttl_128_255_frms: Count of total received MAC frames with length
  508. * (including FCS, but not framing bits) of between 128 and 255
  509. * octets inclusive. Includes frames received with frame-too-long,
  510. * FCS, or length errors.
  511. * @rx_ttl_256_511_frms: Count of total received MAC frames with length
  512. * (including FCS, but not framing bits) of between 256 and 511
  513. * octets inclusive. Includes frames received with frame-too-long,
  514. * FCS, or length errors.
  515. * @rx_ttl_512_1023_frms: Count of total received MAC frames with length
  516. * (including FCS, but not framing bits) of between 512 and 1023
  517. * octets inclusive. Includes frames received with frame-too-long,
  518. * FCS, or length errors.
  519. * @rx_ttl_1024_1518_frms: Count of total received MAC frames with length
  520. * (including FCS, but not framing bits) of between 1024 and 1518
  521. * octets inclusive. Includes frames received with frame-too-long,
  522. * FCS, or length errors.
  523. * @rx_ttl_1519_4095_frms: Count of total received MAC frames with length
  524. * (including FCS, but not framing bits) of between 1519 and 4095
  525. * octets inclusive. Includes frames received with frame-too-long,
  526. * FCS, or length errors.
  527. * @rx_ttl_4096_8191_frms: Count of total received MAC frames with length
  528. * (including FCS, but not framing bits) of between 4096 and 8191
  529. * octets inclusive. Includes frames received with frame-too-long,
  530. * FCS, or length errors.
  531. * @rx_ttl_8192_max_frms: Count of total received MAC frames with length
  532. * (including FCS, but not framing bits) of between 8192 and
  533. * RX_MAX_PYLD_LEN+18 octets inclusive. Includes frames received
  534. * with frame-too-long, FCS, or length errors.
  535. * @rx_ttl_gt_max_frms: Count of total received MAC frames with length
  536. * (including FCS, but not framing bits) exceeding
  537. * RX_MAX_PYLD_LEN+18 (+22 bytes if VLAN-tagged) octets inclusive.
  538. * Includes frames received with frame-too-long,
  539. * FCS, or length errors.
  540. * @rx_ip: Count of received IP datagrams. Includes errored IP datagrams.
  541. * @rx_accepted_ip: Count of received IP datagrams that
  542. * are passed to the system.
  543. * @rx_ip_octets: Count of number of octets in received IP datagrams. Includes
  544. * errored IP datagrams.
  545. * @rx_err_ip: Count of received IP datagrams containing errors. For example,
  546. * bad IP checksum.
  547. * @rx_icmp: Count of received ICMP messages. Includes errored ICMP messages.
  548. * @rx_tcp: Count of received TCP segments. Includes errored TCP segments.
  549. * Note: This stat contains a count of all received TCP segments,
  550. * regardless of whether or not they pertain to an established
  551. * connection.
  552. * @rx_udp: Count of received UDP datagrams.
  553. * @rx_err_tcp: Count of received TCP segments containing errors. For example,
  554. * bad TCP checksum.
  555. * @rx_pause_count: Count of number of pause quanta that the MAC has been in
  556. * the paused state. Recall, one pause quantum equates to 512
  557. * bit times.
  558. * @rx_pause_ctrl_frms: Count of received MAC PAUSE control frames.
  559. * @rx_unsup_ctrl_frms: Count of received MAC control frames that do not
  560. * contain the PAUSE opcode. The sum of RX_PAUSE_CTRL_FRMS and
  561. * this register is a count of all received MAC control frames.
  562. * Note: This stat may be configured to count all layer 2 errors
  563. * (i.e. length errors and FCS errors).
  564. * @rx_fcs_err_frms: Count of received MAC frames that do not pass FCS. Does
  565. * not include frames received with frame-too-long or
  566. * frame-too-short error.
  567. * @rx_in_rng_len_err_frms: Count of received frames with a length/type field
  568. * value between 46 (42 for VLAN-tagged frames) and 1500 (also 1500
  569. * for VLAN-tagged frames), inclusive, that does not match the
  570. * number of data octets (including pad) received. Also contains
  571. * a count of received frames with a length/type field less than
  572. * 46 (42 for VLAN-tagged frames) and the number of data octets
  573. * (including pad) received is greater than 46 (42 for VLAN-tagged
  574. * frames).
  575. * @rx_out_rng_len_err_frms: Count of received frames with length/type field
  576. * between 1501 and 1535 decimal, inclusive.
  577. * @rx_drop_frms: Count of received frames that could not be passed to the host.
  578. * See PORTn_RX_L2_MGMT_DISCARD, PORTn_RX_RPA_DISCARD,
  579. * PORTn_RX_TRASH_DISCARD, PORTn_RX_RTS_DISCARD, PORTn_RX_RED_DISCARD
  580. * for a list of reasons. Because the RMAC drops one frame at a time,
  581. * this stat also indicates the number of drop events.
  582. * @rx_discarded_frms: Count of received frames containing
  583. * any error that prevents
  584. * them from being passed to the system. See PORTn_RX_FCS_DISCARD,
  585. * PORTn_RX_LEN_DISCARD, and PORTn_RX_SWITCH_DISCARD for a list of
  586. * reasons.
  587. * @rx_drop_ip: Count of received IP datagrams that could not be passed to the
  588. * host. See PORTn_RX_DROP_FRMS for a list of reasons.
  589. * @rx_drop_udp: Count of received UDP datagrams that are not delivered to the
  590. * host. See PORTn_RX_DROP_FRMS for a list of reasons.
  591. * @rx_marker_pdu_frms: Count of valid Marker PDUs received on this Aggregation
  592. * port.
  593. * @rx_lacpdu_frms: Count of valid LACPDUs received on this Aggregation port.
  594. * @rx_unknown_pdu_frms: Count of received frames (on this Aggregation port)
  595. * that carry the Slow Protocols EtherType, but contain an unknown
  596. * PDU. Or frames that contain the Slow Protocols group MAC address,
  597. * but do not carry the Slow Protocols EtherType.
  598. * @rx_marker_resp_pdu_frms: Count of valid Marker Response PDUs received on
  599. * this Aggregation port.
  600. * @rx_fcs_discard: Count of received frames that are discarded because the
  601. * FCS check failed.
  602. * @rx_illegal_pdu_frms: Count of received frames (on this Aggregation port)
  603. * that carry the Slow Protocols EtherType, but contain a badly
  604. * formed PDU. Or frames that carry the Slow Protocols EtherType,
  605. * but contain an illegal value of Protocol Subtype.
  606. * @rx_switch_discard: Count of received frames that are discarded by the
  607. * internal switch because they did not have an entry in the
  608. * Filtering Database. This includes frames that had an invalid
  609. * destination MAC address or VLAN ID. It also includes frames are
  610. * discarded because they did not satisfy the length requirements
  611. * of the target VPATH.
  612. * @rx_len_discard: Count of received frames that are discarded because of an
  613. * invalid frame length (includes fragments, oversized frames and
  614. * mismatch between frame length and length/type field). This stat
  615. * can be configured
  616. * (see XMAC_STATS_GLOBAL_CFG.LEN_DISCARD_HANDLING).
  617. * @rx_rpa_discard: Count of received frames that were discarded because the
  618. * receive protocol assist (RPA) discovered and error in the frame
  619. * or was unable to parse the frame.
  620. * @rx_l2_mgmt_discard: Count of Layer 2 management frames (eg. pause frames,
  621. * Link Aggregation Control Protocol (LACP) frames, etc.) that are
  622. * discarded.
  623. * @rx_rts_discard: Count of received frames that are discarded by the receive
  624. * traffic steering (RTS) logic. Includes those frame discarded
  625. * because the SSC response contradicted the switch table, because
  626. * the SSC timed out, or because the target queue could not fit the
  627. * frame.
  628. * @rx_trash_discard: Count of received frames that are discarded because
  629. * receive traffic steering (RTS) steered the frame to the trash
  630. * queue.
  631. * @rx_buff_full_discard: Count of received frames that are discarded because
  632. * internal buffers are full. Includes frames discarded because the
  633. * RTS logic is waiting for an SSC lookup that has no timeout bound.
  634. * Also, includes frames that are dropped because the MAC2FAU buffer
  635. * is nearly full -- this can happen if the external receive buffer
  636. * is full and the receive path is backing up.
  637. * @rx_red_discard: Count of received frames that are discarded because of RED
  638. * (Random Early Discard).
  639. * @rx_xgmii_ctrl_err_cnt: Maintains a count of unexpected or misplaced control
  640. * characters occuring between times of normal data transmission
  641. * (i.e. not included in RX_XGMII_DATA_ERR_CNT). This counter is
  642. * incremented when either -
  643. * 1) The Reconciliation Sublayer (RS) is expecting one control
  644. * character and gets another (i.e. is expecting a Start
  645. * character, but gets another control character).
  646. * 2) Start control character is not in lane 0
  647. * Only increments the count by one for each XGMII column.
  648. * @rx_xgmii_data_err_cnt: Maintains a count of unexpected control characters
  649. * during normal data transmission. If the Reconciliation Sublayer
  650. * (RS) receives a control character, other than a terminate control
  651. * character, during receipt of data octets then this register is
  652. * incremented. Also increments if the start frame delimiter is not
  653. * found in the correct location. Only increments the count by one
  654. * for each XGMII column.
  655. * @rx_xgmii_char1_match: Maintains a count of the number of XGMII characters
  656. * that match a pattern that is programmable through register
  657. * XMAC_STATS_RX_XGMII_CHAR_PORTn. By default, the pattern is set
  658. * to /E/ (i.e. the error character), thus the statistic tracks the
  659. * number of Error characters received at any time.
  660. * @rx_xgmii_err_sym: Count of the number of symbol errors in the received
  661. * XGMII data (i.e. PHY indicates "Receive Error" on the XGMII).
  662. * Only includes symbol errors that are observed between the XGMII
  663. * Start Frame Delimiter and End Frame Delimiter, inclusive. And
  664. * only increments the count by one for each frame.
  665. * @rx_xgmii_column1_match: Maintains a count of the number of XGMII columns
  666. * that match a pattern that is programmable through register
  667. * XMAC_STATS_RX_XGMII_COLUMN1_PORTn. By default, the pattern is set
  668. * to 4 x /E/ (i.e. a column containing all error characters), thus
  669. * the statistic tracks the number of Error columns received at any
  670. * time.
  671. * @rx_xgmii_char2_match: Maintains a count of the number of XGMII characters
  672. * that match a pattern that is programmable through register
  673. * XMAC_STATS_RX_XGMII_CHAR_PORTn. By default, the pattern is set
  674. * to /E/ (i.e. the error character), thus the statistic tracks the
  675. * number of Error characters received at any time.
  676. * @rx_local_fault: Maintains a count of the number of times that link
  677. * transitioned from "up" to "down" due to a local fault.
  678. * @rx_xgmii_column2_match: Maintains a count of the number of XGMII columns
  679. * that match a pattern that is programmable through register
  680. * XMAC_STATS_RX_XGMII_COLUMN2_PORTn. By default, the pattern is set
  681. * to 4 x /E/ (i.e. a column containing all error characters), thus
  682. * the statistic tracks the number of Error columns received at any
  683. * time. If XMAC_STATS_RX_XGMII_BEHAV_COLUMN2_PORTn.NEAR_COL1 is set
  684. * to 1, then this stat increments when COLUMN2 is found within 'n'
  685. * clocks after COLUMN1. Here, 'n' is defined by
  686. * XMAC_STATS_RX_XGMII_BEHAV_COLUMN2_PORTn.NUM_COL (if 'n' is set to
  687. * 0, then it means to search anywhere for COLUMN2).
  688. * @rx_jettison: Count of received frames that are jettisoned because internal
  689. * buffers are full.
  690. * @rx_remote_fault: Maintains a count of the number of times that link
  691. * transitioned from "up" to "down" due to a remote fault.
  692. *
  693. * XMAC Port Statistics.
  694. */
  695. struct vxge_hw_xmac_port_stats {
  696. /*0x000*/ u64 tx_ttl_frms;
  697. /*0x008*/ u64 tx_ttl_octets;
  698. /*0x010*/ u64 tx_data_octets;
  699. /*0x018*/ u64 tx_mcast_frms;
  700. /*0x020*/ u64 tx_bcast_frms;
  701. /*0x028*/ u64 tx_ucast_frms;
  702. /*0x030*/ u64 tx_tagged_frms;
  703. /*0x038*/ u64 tx_vld_ip;
  704. /*0x040*/ u64 tx_vld_ip_octets;
  705. /*0x048*/ u64 tx_icmp;
  706. /*0x050*/ u64 tx_tcp;
  707. /*0x058*/ u64 tx_rst_tcp;
  708. /*0x060*/ u64 tx_udp;
  709. /*0x068*/ u32 tx_parse_error;
  710. /*0x06c*/ u32 tx_unknown_protocol;
  711. /*0x070*/ u64 tx_pause_ctrl_frms;
  712. /*0x078*/ u32 tx_marker_pdu_frms;
  713. /*0x07c*/ u32 tx_lacpdu_frms;
  714. /*0x080*/ u32 tx_drop_ip;
  715. /*0x084*/ u32 tx_marker_resp_pdu_frms;
  716. /*0x088*/ u32 tx_xgmii_char2_match;
  717. /*0x08c*/ u32 tx_xgmii_char1_match;
  718. /*0x090*/ u32 tx_xgmii_column2_match;
  719. /*0x094*/ u32 tx_xgmii_column1_match;
  720. /*0x098*/ u32 unused1;
  721. /*0x09c*/ u16 tx_any_err_frms;
  722. /*0x09e*/ u16 tx_drop_frms;
  723. /*0x0a0*/ u64 rx_ttl_frms;
  724. /*0x0a8*/ u64 rx_vld_frms;
  725. /*0x0b0*/ u64 rx_offload_frms;
  726. /*0x0b8*/ u64 rx_ttl_octets;
  727. /*0x0c0*/ u64 rx_data_octets;
  728. /*0x0c8*/ u64 rx_offload_octets;
  729. /*0x0d0*/ u64 rx_vld_mcast_frms;
  730. /*0x0d8*/ u64 rx_vld_bcast_frms;
  731. /*0x0e0*/ u64 rx_accepted_ucast_frms;
  732. /*0x0e8*/ u64 rx_accepted_nucast_frms;
  733. /*0x0f0*/ u64 rx_tagged_frms;
  734. /*0x0f8*/ u64 rx_long_frms;
  735. /*0x100*/ u64 rx_usized_frms;
  736. /*0x108*/ u64 rx_osized_frms;
  737. /*0x110*/ u64 rx_frag_frms;
  738. /*0x118*/ u64 rx_jabber_frms;
  739. /*0x120*/ u64 rx_ttl_64_frms;
  740. /*0x128*/ u64 rx_ttl_65_127_frms;
  741. /*0x130*/ u64 rx_ttl_128_255_frms;
  742. /*0x138*/ u64 rx_ttl_256_511_frms;
  743. /*0x140*/ u64 rx_ttl_512_1023_frms;
  744. /*0x148*/ u64 rx_ttl_1024_1518_frms;
  745. /*0x150*/ u64 rx_ttl_1519_4095_frms;
  746. /*0x158*/ u64 rx_ttl_4096_8191_frms;
  747. /*0x160*/ u64 rx_ttl_8192_max_frms;
  748. /*0x168*/ u64 rx_ttl_gt_max_frms;
  749. /*0x170*/ u64 rx_ip;
  750. /*0x178*/ u64 rx_accepted_ip;
  751. /*0x180*/ u64 rx_ip_octets;
  752. /*0x188*/ u64 rx_err_ip;
  753. /*0x190*/ u64 rx_icmp;
  754. /*0x198*/ u64 rx_tcp;
  755. /*0x1a0*/ u64 rx_udp;
  756. /*0x1a8*/ u64 rx_err_tcp;
  757. /*0x1b0*/ u64 rx_pause_count;
  758. /*0x1b8*/ u64 rx_pause_ctrl_frms;
  759. /*0x1c0*/ u64 rx_unsup_ctrl_frms;
  760. /*0x1c8*/ u64 rx_fcs_err_frms;
  761. /*0x1d0*/ u64 rx_in_rng_len_err_frms;
  762. /*0x1d8*/ u64 rx_out_rng_len_err_frms;
  763. /*0x1e0*/ u64 rx_drop_frms;
  764. /*0x1e8*/ u64 rx_discarded_frms;
  765. /*0x1f0*/ u64 rx_drop_ip;
  766. /*0x1f8*/ u64 rx_drop_udp;
  767. /*0x200*/ u32 rx_marker_pdu_frms;
  768. /*0x204*/ u32 rx_lacpdu_frms;
  769. /*0x208*/ u32 rx_unknown_pdu_frms;
  770. /*0x20c*/ u32 rx_marker_resp_pdu_frms;
  771. /*0x210*/ u32 rx_fcs_discard;
  772. /*0x214*/ u32 rx_illegal_pdu_frms;
  773. /*0x218*/ u32 rx_switch_discard;
  774. /*0x21c*/ u32 rx_len_discard;
  775. /*0x220*/ u32 rx_rpa_discard;
  776. /*0x224*/ u32 rx_l2_mgmt_discard;
  777. /*0x228*/ u32 rx_rts_discard;
  778. /*0x22c*/ u32 rx_trash_discard;
  779. /*0x230*/ u32 rx_buff_full_discard;
  780. /*0x234*/ u32 rx_red_discard;
  781. /*0x238*/ u32 rx_xgmii_ctrl_err_cnt;
  782. /*0x23c*/ u32 rx_xgmii_data_err_cnt;
  783. /*0x240*/ u32 rx_xgmii_char1_match;
  784. /*0x244*/ u32 rx_xgmii_err_sym;
  785. /*0x248*/ u32 rx_xgmii_column1_match;
  786. /*0x24c*/ u32 rx_xgmii_char2_match;
  787. /*0x250*/ u32 rx_local_fault;
  788. /*0x254*/ u32 rx_xgmii_column2_match;
  789. /*0x258*/ u32 rx_jettison;
  790. /*0x25c*/ u32 rx_remote_fault;
  791. } __packed;
  792. /**
  793. * struct vxge_hw_xmac_vpath_tx_stats - XMAC Vpath Tx Statistics
  794. *
  795. * @tx_ttl_eth_frms: Count of successfully transmitted MAC frames.
  796. * @tx_ttl_eth_octets: Count of total octets of transmitted frames,
  797. * not including framing characters (i.e. less framing bits).
  798. * To determine the total octets of transmitted frames, including
  799. * framing characters, multiply TX_TTL_ETH_FRMS by 8 and add it to
  800. * this stat (the device always prepends 8 bytes of preamble for
  801. * each frame)
  802. * @tx_data_octets: Count of data and padding octets of successfully transmitted
  803. * frames.
  804. * @tx_mcast_frms: Count of successfully transmitted frames to a group address
  805. * other than the broadcast address.
  806. * @tx_bcast_frms: Count of successfully transmitted frames to the broadcast
  807. * group address.
  808. * @tx_ucast_frms: Count of transmitted frames containing a unicast address.
  809. * Includes discarded frames that are not sent to the network.
  810. * @tx_tagged_frms: Count of transmitted frames containing a VLAN tag.
  811. * @tx_vld_ip: Count of transmitted IP datagrams that are passed to the network.
  812. * @tx_vld_ip_octets: Count of total octets of transmitted IP datagrams that
  813. * are passed to the network.
  814. * @tx_icmp: Count of transmitted ICMP messages. Includes messages not sent due
  815. * to problems within ICMP.
  816. * @tx_tcp: Count of transmitted TCP segments. Does not include segments
  817. * containing retransmitted octets.
  818. * @tx_rst_tcp: Count of transmitted TCP segments containing the RST flag.
  819. * @tx_udp: Count of transmitted UDP datagrams.
  820. * @tx_unknown_protocol: Increments when the TPA encounters an unknown protocol,
  821. * such as a new IPv6 extension header, or an unsupported Routing
  822. * Type. The packet still has a checksum calculated but it may be
  823. * incorrect.
  824. * @tx_lost_ip: Count of transmitted IP datagrams that could not be passed
  825. * to the network. Increments because of: 1) An internal processing
  826. * error (such as an uncorrectable ECC error). 2) A frame parsing
  827. * error during IP checksum calculation.
  828. * @tx_parse_error: Increments when the TPA is unable to parse a packet. This
  829. * generally occurs when a packet is corrupt somehow, including
  830. * packets that have IP version mismatches, invalid Layer 2 control
  831. * fields, etc. L3/L4 checksums are not offloaded, but the packet
  832. * is still be transmitted.
  833. * @tx_tcp_offload: For frames belonging to offloaded sessions only, a count
  834. * of transmitted TCP segments. Does not include segments containing
  835. * retransmitted octets.
  836. * @tx_retx_tcp_offload: For frames belonging to offloaded sessions only, the
  837. * total number of segments retransmitted. Retransmitted segments
  838. * that are sourced by the host are counted by the host.
  839. * @tx_lost_ip_offload: For frames belonging to offloaded sessions only, a count
  840. * of transmitted IP datagrams that could not be passed to the
  841. * network.
  842. *
  843. * XMAC Vpath TX Statistics.
  844. */
  845. struct vxge_hw_xmac_vpath_tx_stats {
  846. u64 tx_ttl_eth_frms;
  847. u64 tx_ttl_eth_octets;
  848. u64 tx_data_octets;
  849. u64 tx_mcast_frms;
  850. u64 tx_bcast_frms;
  851. u64 tx_ucast_frms;
  852. u64 tx_tagged_frms;
  853. u64 tx_vld_ip;
  854. u64 tx_vld_ip_octets;
  855. u64 tx_icmp;
  856. u64 tx_tcp;
  857. u64 tx_rst_tcp;
  858. u64 tx_udp;
  859. u32 tx_unknown_protocol;
  860. u32 tx_lost_ip;
  861. u32 unused1;
  862. u32 tx_parse_error;
  863. u64 tx_tcp_offload;
  864. u64 tx_retx_tcp_offload;
  865. u64 tx_lost_ip_offload;
  866. } __packed;
  867. /**
  868. * struct vxge_hw_xmac_vpath_rx_stats - XMAC Vpath RX Statistics
  869. *
  870. * @rx_ttl_eth_frms: Count of successfully received MAC frames.
  871. * @rx_vld_frms: Count of successfully received MAC frames. Does not include
  872. * frames received with frame-too-long, FCS, or length errors.
  873. * @rx_offload_frms: Count of offloaded received frames that are passed to
  874. * the host.
  875. * @rx_ttl_eth_octets: Count of total octets of received frames, not including
  876. * framing characters (i.e. less framing bits). Only counts octets
  877. * of frames that are at least 14 bytes (18 bytes for VLAN-tagged)
  878. * before FCS. To determine the total octets of received frames,
  879. * including framing characters, multiply RX_TTL_ETH_FRMS by 8 and
  880. * add it to this stat (the stat RX_TTL_ETH_FRMS only counts frames
  881. * that have the required 8 bytes of preamble).
  882. * @rx_data_octets: Count of data and padding octets of successfully received
  883. * frames. Does not include frames received with frame-too-long,
  884. * FCS, or length errors.
  885. * @rx_offload_octets: Count of total octets, not including framing characters,
  886. * of offloaded received frames that are passed to the host.
  887. * @rx_vld_mcast_frms: Count of successfully received MAC frames containing a
  888. * nonbroadcast group address. Does not include frames received with
  889. * frame-too-long, FCS, or length errors.
  890. * @rx_vld_bcast_frms: Count of successfully received MAC frames containing the
  891. * broadcast group address. Does not include frames received with
  892. * frame-too-long, FCS, or length errors.
  893. * @rx_accepted_ucast_frms: Count of successfully received frames containing
  894. * a unicast address. Only includes frames that are passed to the
  895. * system.
  896. * @rx_accepted_nucast_frms: Count of successfully received frames containing
  897. * a non-unicast (broadcast or multicast) address. Only includes
  898. * frames that are passed to the system. Could include, for instance,
  899. * non-unicast frames that contain FCS errors if the MAC_ERROR_CFG
  900. * register is set to pass FCS-errored frames to the host.
  901. * @rx_tagged_frms: Count of received frames containing a VLAN tag.
  902. * @rx_long_frms: Count of received frames that are longer than RX_MAX_PYLD_LEN
  903. * + 18 bytes (+ 22 bytes if VLAN-tagged).
  904. * @rx_usized_frms: Count of received frames of length (including FCS, but not
  905. * framing bits) less than 64 octets, that are otherwise well-formed.
  906. * In other words, counts runts.
  907. * @rx_osized_frms: Count of received frames of length (including FCS, but not
  908. * framing bits) more than 1518 octets, that are otherwise
  909. * well-formed.
  910. * @rx_frag_frms: Count of received frames of length (including FCS, but not
  911. * framing bits) less than 64 octets that had bad FCS.
  912. * In other words, counts fragments.
  913. * @rx_jabber_frms: Count of received frames of length (including FCS, but not
  914. * framing bits) more than 1518 octets that had bad FCS. In other
  915. * words, counts jabbers.
  916. * @rx_ttl_64_frms: Count of total received MAC frames with length (including
  917. * FCS, but not framing bits) of exactly 64 octets. Includes frames
  918. * received with frame-too-long, FCS, or length errors.
  919. * @rx_ttl_65_127_frms: Count of total received MAC frames
  920. * with length (including
  921. * FCS, but not framing bits) of between 65 and 127 octets inclusive.
  922. * Includes frames received with frame-too-long, FCS,
  923. * or length errors.
  924. * @rx_ttl_128_255_frms: Count of total received MAC frames with length
  925. * (including FCS, but not framing bits)
  926. * of between 128 and 255 octets
  927. * inclusive. Includes frames received with frame-too-long, FCS,
  928. * or length errors.
  929. * @rx_ttl_256_511_frms: Count of total received MAC frames with length
  930. * (including FCS, but not framing bits)
  931. * of between 256 and 511 octets
  932. * inclusive. Includes frames received with frame-too-long, FCS, or
  933. * length errors.
  934. * @rx_ttl_512_1023_frms: Count of total received MAC frames with length
  935. * (including FCS, but not framing bits) of between 512 and 1023
  936. * octets inclusive. Includes frames received with frame-too-long,
  937. * FCS, or length errors.
  938. * @rx_ttl_1024_1518_frms: Count of total received MAC frames with length
  939. * (including FCS, but not framing bits) of between 1024 and 1518
  940. * octets inclusive. Includes frames received with frame-too-long,
  941. * FCS, or length errors.
  942. * @rx_ttl_1519_4095_frms: Count of total received MAC frames with length
  943. * (including FCS, but not framing bits) of between 1519 and 4095
  944. * octets inclusive. Includes frames received with frame-too-long,
  945. * FCS, or length errors.
  946. * @rx_ttl_4096_8191_frms: Count of total received MAC frames with length
  947. * (including FCS, but not framing bits) of between 4096 and 8191
  948. * octets inclusive. Includes frames received with frame-too-long,
  949. * FCS, or length errors.
  950. * @rx_ttl_8192_max_frms: Count of total received MAC frames with length
  951. * (including FCS, but not framing bits) of between 8192 and
  952. * RX_MAX_PYLD_LEN+18 octets inclusive. Includes frames received
  953. * with frame-too-long, FCS, or length errors.
  954. * @rx_ttl_gt_max_frms: Count of total received MAC frames with length
  955. * (including FCS, but not framing bits) exceeding RX_MAX_PYLD_LEN+18
  956. * (+22 bytes if VLAN-tagged) octets inclusive. Includes frames
  957. * received with frame-too-long, FCS, or length errors.
  958. * @rx_ip: Count of received IP datagrams. Includes errored IP datagrams.
  959. * @rx_accepted_ip: Count of received IP datagrams that
  960. * are passed to the system.
  961. * @rx_ip_octets: Count of number of octets in received IP datagrams.
  962. * Includes errored IP datagrams.
  963. * @rx_err_ip: Count of received IP datagrams containing errors. For example,
  964. * bad IP checksum.
  965. * @rx_icmp: Count of received ICMP messages. Includes errored ICMP messages.
  966. * @rx_tcp: Count of received TCP segments. Includes errored TCP segments.
  967. * Note: This stat contains a count of all received TCP segments,
  968. * regardless of whether or not they pertain to an established
  969. * connection.
  970. * @rx_udp: Count of received UDP datagrams.
  971. * @rx_err_tcp: Count of received TCP segments containing errors. For example,
  972. * bad TCP checksum.
  973. * @rx_lost_frms: Count of received frames that could not be passed to the host.
  974. * See RX_QUEUE_FULL_DISCARD and RX_RED_DISCARD
  975. * for a list of reasons.
  976. * @rx_lost_ip: Count of received IP datagrams that could not be passed to
  977. * the host. See RX_LOST_FRMS for a list of reasons.
  978. * @rx_lost_ip_offload: For frames belonging to offloaded sessions only, a count
  979. * of received IP datagrams that could not be passed to the host.
  980. * See RX_LOST_FRMS for a list of reasons.
  981. * @rx_various_discard: Count of received frames that are discarded because
  982. * the target receive queue is full.
  983. * @rx_sleep_discard: Count of received frames that are discarded because the
  984. * target VPATH is asleep (a Wake-on-LAN magic packet can be used
  985. * to awaken the VPATH).
  986. * @rx_red_discard: Count of received frames that are discarded because of RED
  987. * (Random Early Discard).
  988. * @rx_queue_full_discard: Count of received frames that are discarded because
  989. * the target receive queue is full.
  990. * @rx_mpa_ok_frms: Count of received frames that pass the MPA checks.
  991. *
  992. * XMAC Vpath RX Statistics.
  993. */
  994. struct vxge_hw_xmac_vpath_rx_stats {
  995. u64 rx_ttl_eth_frms;
  996. u64 rx_vld_frms;
  997. u64 rx_offload_frms;
  998. u64 rx_ttl_eth_octets;
  999. u64 rx_data_octets;
  1000. u64 rx_offload_octets;
  1001. u64 rx_vld_mcast_frms;
  1002. u64 rx_vld_bcast_frms;
  1003. u64 rx_accepted_ucast_frms;
  1004. u64 rx_accepted_nucast_frms;
  1005. u64 rx_tagged_frms;
  1006. u64 rx_long_frms;
  1007. u64 rx_usized_frms;
  1008. u64 rx_osized_frms;
  1009. u64 rx_frag_frms;
  1010. u64 rx_jabber_frms;
  1011. u64 rx_ttl_64_frms;
  1012. u64 rx_ttl_65_127_frms;
  1013. u64 rx_ttl_128_255_frms;
  1014. u64 rx_ttl_256_511_frms;
  1015. u64 rx_ttl_512_1023_frms;
  1016. u64 rx_ttl_1024_1518_frms;
  1017. u64 rx_ttl_1519_4095_frms;
  1018. u64 rx_ttl_4096_8191_frms;
  1019. u64 rx_ttl_8192_max_frms;
  1020. u64 rx_ttl_gt_max_frms;
  1021. u64 rx_ip;
  1022. u64 rx_accepted_ip;
  1023. u64 rx_ip_octets;
  1024. u64 rx_err_ip;
  1025. u64 rx_icmp;
  1026. u64 rx_tcp;
  1027. u64 rx_udp;
  1028. u64 rx_err_tcp;
  1029. u64 rx_lost_frms;
  1030. u64 rx_lost_ip;
  1031. u64 rx_lost_ip_offload;
  1032. u16 rx_various_discard;
  1033. u16 rx_sleep_discard;
  1034. u16 rx_red_discard;
  1035. u16 rx_queue_full_discard;
  1036. u64 rx_mpa_ok_frms;
  1037. } __packed;
  1038. /**
  1039. * struct vxge_hw_xmac_stats - XMAC Statistics
  1040. *
  1041. * @aggr_stats: Statistics on aggregate port(port 0, port 1)
  1042. * @port_stats: Staticstics on ports(wire 0, wire 1, lag)
  1043. * @vpath_tx_stats: Per vpath XMAC TX stats
  1044. * @vpath_rx_stats: Per vpath XMAC RX stats
  1045. *
  1046. * XMAC Statistics.
  1047. */
  1048. struct vxge_hw_xmac_stats {
  1049. struct vxge_hw_xmac_aggr_stats
  1050. aggr_stats[VXGE_HW_MAC_MAX_MAC_PORT_ID];
  1051. struct vxge_hw_xmac_port_stats
  1052. port_stats[VXGE_HW_MAC_MAX_MAC_PORT_ID+1];
  1053. struct vxge_hw_xmac_vpath_tx_stats
  1054. vpath_tx_stats[VXGE_HW_MAX_VIRTUAL_PATHS];
  1055. struct vxge_hw_xmac_vpath_rx_stats
  1056. vpath_rx_stats[VXGE_HW_MAX_VIRTUAL_PATHS];
  1057. };
  1058. /**
  1059. * struct vxge_hw_vpath_stats_hw_info - Titan vpath hardware statistics.
  1060. * @ini_num_mwr_sent: The number of PCI memory writes initiated by the PIC block
  1061. * for the given VPATH
  1062. * @ini_num_mrd_sent: The number of PCI memory reads initiated by the PIC block
  1063. * @ini_num_cpl_rcvd: The number of PCI read completions received by the
  1064. * PIC block
  1065. * @ini_num_mwr_byte_sent: The number of PCI memory write bytes sent by the PIC
  1066. * block to the host
  1067. * @ini_num_cpl_byte_rcvd: The number of PCI read completion bytes received by
  1068. * the PIC block
  1069. * @wrcrdtarb_xoff: TBD
  1070. * @rdcrdtarb_xoff: TBD
  1071. * @vpath_genstats_count0: TBD
  1072. * @vpath_genstats_count1: TBD
  1073. * @vpath_genstats_count2: TBD
  1074. * @vpath_genstats_count3: TBD
  1075. * @vpath_genstats_count4: TBD
  1076. * @vpath_gennstats_count5: TBD
  1077. * @tx_stats: Transmit stats
  1078. * @rx_stats: Receive stats
  1079. * @prog_event_vnum1: Programmable statistic. Increments when internal logic
  1080. * detects a certain event. See register
  1081. * XMAC_STATS_CFG.EVENT_VNUM1_CFG for more information.
  1082. * @prog_event_vnum0: Programmable statistic. Increments when internal logic
  1083. * detects a certain event. See register
  1084. * XMAC_STATS_CFG.EVENT_VNUM0_CFG for more information.
  1085. * @prog_event_vnum3: Programmable statistic. Increments when internal logic
  1086. * detects a certain event. See register
  1087. * XMAC_STATS_CFG.EVENT_VNUM3_CFG for more information.
  1088. * @prog_event_vnum2: Programmable statistic. Increments when internal logic
  1089. * detects a certain event. See register
  1090. * XMAC_STATS_CFG.EVENT_VNUM2_CFG for more information.
  1091. * @rx_multi_cast_frame_discard: TBD
  1092. * @rx_frm_transferred: TBD
  1093. * @rxd_returned: TBD
  1094. * @rx_mpa_len_fail_frms: Count of received frames
  1095. * that fail the MPA length check
  1096. * @rx_mpa_mrk_fail_frms: Count of received frames
  1097. * that fail the MPA marker check
  1098. * @rx_mpa_crc_fail_frms: Count of received frames that fail the MPA CRC check
  1099. * @rx_permitted_frms: Count of frames that pass through the FAU and on to the
  1100. * frame buffer (and subsequently to the host).
  1101. * @rx_vp_reset_discarded_frms: Count of receive frames that are discarded
  1102. * because the VPATH is in reset
  1103. * @rx_wol_frms: Count of received "magic packet" frames. Stat increments
  1104. * whenever the received frame matches the VPATH's Wake-on-LAN
  1105. * signature(s) CRC.
  1106. * @tx_vp_reset_discarded_frms: Count of transmit frames that are discarded
  1107. * because the VPATH is in reset. Includes frames that are discarded
  1108. * because the current VPIN does not match that VPIN of the frame
  1109. *
  1110. * Titan vpath hardware statistics.
  1111. */
  1112. struct vxge_hw_vpath_stats_hw_info {
  1113. /*0x000*/ u32 ini_num_mwr_sent;
  1114. /*0x004*/ u32 unused1;
  1115. /*0x008*/ u32 ini_num_mrd_sent;
  1116. /*0x00c*/ u32 unused2;
  1117. /*0x010*/ u32 ini_num_cpl_rcvd;
  1118. /*0x014*/ u32 unused3;
  1119. /*0x018*/ u64 ini_num_mwr_byte_sent;
  1120. /*0x020*/ u64 ini_num_cpl_byte_rcvd;
  1121. /*0x028*/ u32 wrcrdtarb_xoff;
  1122. /*0x02c*/ u32 unused4;
  1123. /*0x030*/ u32 rdcrdtarb_xoff;
  1124. /*0x034*/ u32 unused5;
  1125. /*0x038*/ u32 vpath_genstats_count0;
  1126. /*0x03c*/ u32 vpath_genstats_count1;
  1127. /*0x040*/ u32 vpath_genstats_count2;
  1128. /*0x044*/ u32 vpath_genstats_count3;
  1129. /*0x048*/ u32 vpath_genstats_count4;
  1130. /*0x04c*/ u32 unused6;
  1131. /*0x050*/ u32 vpath_genstats_count5;
  1132. /*0x054*/ u32 unused7;
  1133. /*0x058*/ struct vxge_hw_xmac_vpath_tx_stats tx_stats;
  1134. /*0x0e8*/ struct vxge_hw_xmac_vpath_rx_stats rx_stats;
  1135. /*0x220*/ u64 unused9;
  1136. /*0x228*/ u32 prog_event_vnum1;
  1137. /*0x22c*/ u32 prog_event_vnum0;
  1138. /*0x230*/ u32 prog_event_vnum3;
  1139. /*0x234*/ u32 prog_event_vnum2;
  1140. /*0x238*/ u16 rx_multi_cast_frame_discard;
  1141. /*0x23a*/ u8 unused10[6];
  1142. /*0x240*/ u32 rx_frm_transferred;
  1143. /*0x244*/ u32 unused11;
  1144. /*0x248*/ u16 rxd_returned;
  1145. /*0x24a*/ u8 unused12[6];
  1146. /*0x252*/ u16 rx_mpa_len_fail_frms;
  1147. /*0x254*/ u16 rx_mpa_mrk_fail_frms;
  1148. /*0x256*/ u16 rx_mpa_crc_fail_frms;
  1149. /*0x258*/ u16 rx_permitted_frms;
  1150. /*0x25c*/ u64 rx_vp_reset_discarded_frms;
  1151. /*0x25e*/ u64 rx_wol_frms;
  1152. /*0x260*/ u64 tx_vp_reset_discarded_frms;
  1153. } __packed;
  1154. /**
  1155. * struct vxge_hw_device_stats_mrpcim_info - Titan mrpcim hardware statistics.
  1156. * @pic.ini_rd_drop 0x0000 4 Number of DMA reads initiated
  1157. * by the adapter that were discarded because the VPATH is out of service
  1158. * @pic.ini_wr_drop 0x0004 4 Number of DMA writes initiated by the
  1159. * adapter that were discared because the VPATH is out of service
  1160. * @pic.wrcrdtarb_ph_crdt_depleted[vplane0] 0x0008 4 Number of times
  1161. * the posted header credits for upstream PCI writes were depleted
  1162. * @pic.wrcrdtarb_ph_crdt_depleted[vplane1] 0x0010 4 Number of times
  1163. * the posted header credits for upstream PCI writes were depleted
  1164. * @pic.wrcrdtarb_ph_crdt_depleted[vplane2] 0x0018 4 Number of times
  1165. * the posted header credits for upstream PCI writes were depleted
  1166. * @pic.wrcrdtarb_ph_crdt_depleted[vplane3] 0x0020 4 Number of times
  1167. * the posted header credits for upstream PCI writes were depleted
  1168. * @pic.wrcrdtarb_ph_crdt_depleted[vplane4] 0x0028 4 Number of times
  1169. * the posted header credits for upstream PCI writes were depleted
  1170. * @pic.wrcrdtarb_ph_crdt_depleted[vplane5] 0x0030 4 Number of times
  1171. * the posted header credits for upstream PCI writes were depleted
  1172. * @pic.wrcrdtarb_ph_crdt_depleted[vplane6] 0x0038 4 Number of times
  1173. * the posted header credits for upstream PCI writes were depleted
  1174. * @pic.wrcrdtarb_ph_crdt_depleted[vplane7] 0x0040 4 Number of times
  1175. * the posted header credits for upstream PCI writes were depleted
  1176. * @pic.wrcrdtarb_ph_crdt_depleted[vplane8] 0x0048 4 Number of times
  1177. * the posted header credits for upstream PCI writes were depleted
  1178. * @pic.wrcrdtarb_ph_crdt_depleted[vplane9] 0x0050 4 Number of times
  1179. * the posted header credits for upstream PCI writes were depleted
  1180. * @pic.wrcrdtarb_ph_crdt_depleted[vplane10] 0x0058 4 Number of times
  1181. * the posted header credits for upstream PCI writes were depleted
  1182. * @pic.wrcrdtarb_ph_crdt_depleted[vplane11] 0x0060 4 Number of times
  1183. * the posted header credits for upstream PCI writes were depleted
  1184. * @pic.wrcrdtarb_ph_crdt_depleted[vplane12] 0x0068 4 Number of times
  1185. * the posted header credits for upstream PCI writes were depleted
  1186. * @pic.wrcrdtarb_ph_crdt_depleted[vplane13] 0x0070 4 Number of times
  1187. * the posted header credits for upstream PCI writes were depleted
  1188. * @pic.wrcrdtarb_ph_crdt_depleted[vplane14] 0x0078 4 Number of times
  1189. * the posted header credits for upstream PCI writes were depleted
  1190. * @pic.wrcrdtarb_ph_crdt_depleted[vplane15] 0x0080 4 Number of times
  1191. * the posted header credits for upstream PCI writes were depleted
  1192. * @pic.wrcrdtarb_ph_crdt_depleted[vplane16] 0x0088 4 Number of times
  1193. * the posted header credits for upstream PCI writes were depleted
  1194. * @pic.wrcrdtarb_pd_crdt_depleted[vplane0] 0x0090 4 Number of times
  1195. * the posted data credits for upstream PCI writes were depleted
  1196. * @pic.wrcrdtarb_pd_crdt_depleted[vplane1] 0x0098 4 Number of times
  1197. * the posted data credits for upstream PCI writes were depleted
  1198. * @pic.wrcrdtarb_pd_crdt_depleted[vplane2] 0x00a0 4 Number of times
  1199. * the posted data credits for upstream PCI writes were depleted
  1200. * @pic.wrcrdtarb_pd_crdt_depleted[vplane3] 0x00a8 4 Number of times
  1201. * the posted data credits for upstream PCI writes were depleted
  1202. * @pic.wrcrdtarb_pd_crdt_depleted[vplane4] 0x00b0 4 Number of times
  1203. * the posted data credits for upstream PCI writes were depleted
  1204. * @pic.wrcrdtarb_pd_crdt_depleted[vplane5] 0x00b8 4 Number of times
  1205. * the posted data credits for upstream PCI writes were depleted
  1206. * @pic.wrcrdtarb_pd_crdt_depleted[vplane6] 0x00c0 4 Number of times
  1207. * the posted data credits for upstream PCI writes were depleted
  1208. * @pic.wrcrdtarb_pd_crdt_depleted[vplane7] 0x00c8 4 Number of times
  1209. * the posted data credits for upstream PCI writes were depleted
  1210. * @pic.wrcrdtarb_pd_crdt_depleted[vplane8] 0x00d0 4 Number of times
  1211. * the posted data credits for upstream PCI writes were depleted
  1212. * @pic.wrcrdtarb_pd_crdt_depleted[vplane9] 0x00d8 4 Number of times
  1213. * the posted data credits for upstream PCI writes were depleted
  1214. * @pic.wrcrdtarb_pd_crdt_depleted[vplane10] 0x00e0 4 Number of times
  1215. * the posted data credits for upstream PCI writes were depleted
  1216. * @pic.wrcrdtarb_pd_crdt_depleted[vplane11] 0x00e8 4 Number of times
  1217. * the posted data credits for upstream PCI writes were depleted
  1218. * @pic.wrcrdtarb_pd_crdt_depleted[vplane12] 0x00f0 4 Number of times
  1219. * the posted data credits for upstream PCI writes were depleted
  1220. * @pic.wrcrdtarb_pd_crdt_depleted[vplane13] 0x00f8 4 Number of times
  1221. * the posted data credits for upstream PCI writes were depleted
  1222. * @pic.wrcrdtarb_pd_crdt_depleted[vplane14] 0x0100 4 Number of times
  1223. * the posted data credits for upstream PCI writes were depleted
  1224. * @pic.wrcrdtarb_pd_crdt_depleted[vplane15] 0x0108 4 Number of times
  1225. * the posted data credits for upstream PCI writes were depleted
  1226. * @pic.wrcrdtarb_pd_crdt_depleted[vplane16] 0x0110 4 Number of times
  1227. * the posted data credits for upstream PCI writes were depleted
  1228. * @pic.rdcrdtarb_nph_crdt_depleted[vplane0] 0x0118 4 Number of times
  1229. * the non-posted header credits for upstream PCI reads were depleted
  1230. * @pic.rdcrdtarb_nph_crdt_depleted[vplane1] 0x0120 4 Number of times
  1231. * the non-posted header credits for upstream PCI reads were depleted
  1232. * @pic.rdcrdtarb_nph_crdt_depleted[vplane2] 0x0128 4 Number of times
  1233. * the non-posted header credits for upstream PCI reads were depleted
  1234. * @pic.rdcrdtarb_nph_crdt_depleted[vplane3] 0x0130 4 Number of times
  1235. * the non-posted header credits for upstream PCI reads were depleted
  1236. * @pic.rdcrdtarb_nph_crdt_depleted[vplane4] 0x0138 4 Number of times
  1237. * the non-posted header credits for upstream PCI reads were depleted
  1238. * @pic.rdcrdtarb_nph_crdt_depleted[vplane5] 0x0140 4 Number of times
  1239. * the non-posted header credits for upstream PCI reads were depleted
  1240. * @pic.rdcrdtarb_nph_crdt_depleted[vplane6] 0x0148 4 Number of times
  1241. * the non-posted header credits for upstream PCI reads were depleted
  1242. * @pic.rdcrdtarb_nph_crdt_depleted[vplane7] 0x0150 4 Number of times
  1243. * the non-posted header credits for upstream PCI reads were depleted
  1244. * @pic.rdcrdtarb_nph_crdt_depleted[vplane8] 0x0158 4 Number of times
  1245. * the non-posted header credits for upstream PCI reads were depleted
  1246. * @pic.rdcrdtarb_nph_crdt_depleted[vplane9] 0x0160 4 Number of times
  1247. * the non-posted header credits for upstream PCI reads were depleted
  1248. * @pic.rdcrdtarb_nph_crdt_depleted[vplane10] 0x0168 4 Number of times
  1249. * the non-posted header credits for upstream PCI reads were depleted
  1250. * @pic.rdcrdtarb_nph_crdt_depleted[vplane11] 0x0170 4 Number of times
  1251. * the non-posted header credits for upstream PCI reads were depleted
  1252. * @pic.rdcrdtarb_nph_crdt_depleted[vplane12] 0x0178 4 Number of times
  1253. * the non-posted header credits for upstream PCI reads were depleted
  1254. * @pic.rdcrdtarb_nph_crdt_depleted[vplane13] 0x0180 4 Number of times
  1255. * the non-posted header credits for upstream PCI reads were depleted
  1256. * @pic.rdcrdtarb_nph_crdt_depleted[vplane14] 0x0188 4 Number of times
  1257. * the non-posted header credits for upstream PCI reads were depleted
  1258. * @pic.rdcrdtarb_nph_crdt_depleted[vplane15] 0x0190 4 Number of times
  1259. * the non-posted header credits for upstream PCI reads were depleted
  1260. * @pic.rdcrdtarb_nph_crdt_depleted[vplane16] 0x0198 4 Number of times
  1261. * the non-posted header credits for upstream PCI reads were depleted
  1262. * @pic.ini_rd_vpin_drop 0x01a0 4 Number of DMA reads initiated by
  1263. * the adapter that were discarded because the VPATH instance number does
  1264. * not match
  1265. * @pic.ini_wr_vpin_drop 0x01a4 4 Number of DMA writes initiated
  1266. * by the adapter that were discarded because the VPATH instance number
  1267. * does not match
  1268. * @pic.genstats_count0 0x01a8 4 Configurable statistic #1. Refer
  1269. * to the GENSTATS0_CFG for information on configuring this statistic
  1270. * @pic.genstats_count1 0x01ac 4 Configurable statistic #2. Refer
  1271. * to the GENSTATS1_CFG for information on configuring this statistic
  1272. * @pic.genstats_count2 0x01b0 4 Configurable statistic #3. Refer
  1273. * to the GENSTATS2_CFG for information on configuring this statistic
  1274. * @pic.genstats_count3 0x01b4 4 Configurable statistic #4. Refer
  1275. * to the GENSTATS3_CFG for information on configuring this statistic
  1276. * @pic.genstats_count4 0x01b8 4 Configurable statistic #5. Refer
  1277. * to the GENSTATS4_CFG for information on configuring this statistic
  1278. * @pic.genstats_count5 0x01c0 4 Configurable statistic #6. Refer
  1279. * to the GENSTATS5_CFG for information on configuring this statistic
  1280. * @pci.rstdrop_cpl 0x01c8 4
  1281. * @pci.rstdrop_msg 0x01cc 4
  1282. * @pci.rstdrop_client1 0x01d0 4
  1283. * @pci.rstdrop_client0 0x01d4 4
  1284. * @pci.rstdrop_client2 0x01d8 4
  1285. * @pci.depl_cplh[vplane0] 0x01e2 2 Number of times completion
  1286. * header credits were depleted
  1287. * @pci.depl_nph[vplane0] 0x01e4 2 Number of times non posted
  1288. * header credits were depleted
  1289. * @pci.depl_ph[vplane0] 0x01e6 2 Number of times the posted
  1290. * header credits were depleted
  1291. * @pci.depl_cplh[vplane1] 0x01ea 2
  1292. * @pci.depl_nph[vplane1] 0x01ec 2
  1293. * @pci.depl_ph[vplane1] 0x01ee 2
  1294. * @pci.depl_cplh[vplane2] 0x01f2 2
  1295. * @pci.depl_nph[vplane2] 0x01f4 2
  1296. * @pci.depl_ph[vplane2] 0x01f6 2
  1297. * @pci.depl_cplh[vplane3] 0x01fa 2
  1298. * @pci.depl_nph[vplane3] 0x01fc 2
  1299. * @pci.depl_ph[vplane3] 0x01fe 2
  1300. * @pci.depl_cplh[vplane4] 0x0202 2
  1301. * @pci.depl_nph[vplane4] 0x0204 2
  1302. * @pci.depl_ph[vplane4] 0x0206 2
  1303. * @pci.depl_cplh[vplane5] 0x020a 2
  1304. * @pci.depl_nph[vplane5] 0x020c 2
  1305. * @pci.depl_ph[vplane5] 0x020e 2
  1306. * @pci.depl_cplh[vplane6] 0x0212 2
  1307. * @pci.depl_nph[vplane6] 0x0214 2
  1308. * @pci.depl_ph[vplane6] 0x0216 2
  1309. * @pci.depl_cplh[vplane7] 0x021a 2
  1310. * @pci.depl_nph[vplane7] 0x021c 2
  1311. * @pci.depl_ph[vplane7] 0x021e 2
  1312. * @pci.depl_cplh[vplane8] 0x0222 2
  1313. * @pci.depl_nph[vplane8] 0x0224 2
  1314. * @pci.depl_ph[vplane8] 0x0226 2
  1315. * @pci.depl_cplh[vplane9] 0x022a 2
  1316. * @pci.depl_nph[vplane9] 0x022c 2
  1317. * @pci.depl_ph[vplane9] 0x022e 2
  1318. * @pci.depl_cplh[vplane10] 0x0232 2
  1319. * @pci.depl_nph[vplane10] 0x0234 2
  1320. * @pci.depl_ph[vplane10] 0x0236 2
  1321. * @pci.depl_cplh[vplane11] 0x023a 2
  1322. * @pci.depl_nph[vplane11] 0x023c 2
  1323. * @pci.depl_ph[vplane11] 0x023e 2
  1324. * @pci.depl_cplh[vplane12] 0x0242 2
  1325. * @pci.depl_nph[vplane12] 0x0244 2
  1326. * @pci.depl_ph[vplane12] 0x0246 2
  1327. * @pci.depl_cplh[vplane13] 0x024a 2
  1328. * @pci.depl_nph[vplane13] 0x024c 2
  1329. * @pci.depl_ph[vplane13] 0x024e 2
  1330. * @pci.depl_cplh[vplane14] 0x0252 2
  1331. * @pci.depl_nph[vplane14] 0x0254 2
  1332. * @pci.depl_ph[vplane14] 0x0256 2
  1333. * @pci.depl_cplh[vplane15] 0x025a 2
  1334. * @pci.depl_nph[vplane15] 0x025c 2
  1335. * @pci.depl_ph[vplane15] 0x025e 2
  1336. * @pci.depl_cplh[vplane16] 0x0262 2
  1337. * @pci.depl_nph[vplane16] 0x0264 2
  1338. * @pci.depl_ph[vplane16] 0x0266 2
  1339. * @pci.depl_cpld[vplane0] 0x026a 2 Number of times completion data
  1340. * credits were depleted
  1341. * @pci.depl_npd[vplane0] 0x026c 2 Number of times non posted data
  1342. * credits were depleted
  1343. * @pci.depl_pd[vplane0] 0x026e 2 Number of times the posted data
  1344. * credits were depleted
  1345. * @pci.depl_cpld[vplane1] 0x0272 2
  1346. * @pci.depl_npd[vplane1] 0x0274 2
  1347. * @pci.depl_pd[vplane1] 0x0276 2
  1348. * @pci.depl_cpld[vplane2] 0x027a 2
  1349. * @pci.depl_npd[vplane2] 0x027c 2
  1350. * @pci.depl_pd[vplane2] 0x027e 2
  1351. * @pci.depl_cpld[vplane3] 0x0282 2
  1352. * @pci.depl_npd[vplane3] 0x0284 2
  1353. * @pci.depl_pd[vplane3] 0x0286 2
  1354. * @pci.depl_cpld[vplane4] 0x028a 2
  1355. * @pci.depl_npd[vplane4] 0x028c 2
  1356. * @pci.depl_pd[vplane4] 0x028e 2
  1357. * @pci.depl_cpld[vplane5] 0x0292 2
  1358. * @pci.depl_npd[vplane5] 0x0294 2
  1359. * @pci.depl_pd[vplane5] 0x0296 2
  1360. * @pci.depl_cpld[vplane6] 0x029a 2
  1361. * @pci.depl_npd[vplane6] 0x029c 2
  1362. * @pci.depl_pd[vplane6] 0x029e 2
  1363. * @pci.depl_cpld[vplane7] 0x02a2 2
  1364. * @pci.depl_npd[vplane7] 0x02a4 2
  1365. * @pci.depl_pd[vplane7] 0x02a6 2
  1366. * @pci.depl_cpld[vplane8] 0x02aa 2
  1367. * @pci.depl_npd[vplane8] 0x02ac 2
  1368. * @pci.depl_pd[vplane8] 0x02ae 2
  1369. * @pci.depl_cpld[vplane9] 0x02b2 2
  1370. * @pci.depl_npd[vplane9] 0x02b4 2
  1371. * @pci.depl_pd[vplane9] 0x02b6 2
  1372. * @pci.depl_cpld[vplane10] 0x02ba 2
  1373. * @pci.depl_npd[vplane10] 0x02bc 2
  1374. * @pci.depl_pd[vplane10] 0x02be 2
  1375. * @pci.depl_cpld[vplane11] 0x02c2 2
  1376. * @pci.depl_npd[vplane11] 0x02c4 2
  1377. * @pci.depl_pd[vplane11] 0x02c6 2
  1378. * @pci.depl_cpld[vplane12] 0x02ca 2
  1379. * @pci.depl_npd[vplane12] 0x02cc 2
  1380. * @pci.depl_pd[vplane12] 0x02ce 2
  1381. * @pci.depl_cpld[vplane13] 0x02d2 2
  1382. * @pci.depl_npd[vplane13] 0x02d4 2
  1383. * @pci.depl_pd[vplane13] 0x02d6 2
  1384. * @pci.depl_cpld[vplane14] 0x02da 2
  1385. * @pci.depl_npd[vplane14] 0x02dc 2
  1386. * @pci.depl_pd[vplane14] 0x02de 2
  1387. * @pci.depl_cpld[vplane15] 0x02e2 2
  1388. * @pci.depl_npd[vplane15] 0x02e4 2
  1389. * @pci.depl_pd[vplane15] 0x02e6 2
  1390. * @pci.depl_cpld[vplane16] 0x02ea 2
  1391. * @pci.depl_npd[vplane16] 0x02ec 2
  1392. * @pci.depl_pd[vplane16] 0x02ee 2
  1393. * @xgmac_port[3];
  1394. * @xgmac_aggr[2];
  1395. * @xgmac.global_prog_event_gnum0 0x0ae0 8 Programmable statistic.
  1396. * Increments when internal logic detects a certain event. See register
  1397. * XMAC_STATS_GLOBAL_CFG.EVENT_GNUM0_CFG for more information.
  1398. * @xgmac.global_prog_event_gnum1 0x0ae8 8 Programmable statistic.
  1399. * Increments when internal logic detects a certain event. See register
  1400. * XMAC_STATS_GLOBAL_CFG.EVENT_GNUM1_CFG for more information.
  1401. * @xgmac.orp_lro_events 0x0af8 8
  1402. * @xgmac.orp_bs_events 0x0b00 8
  1403. * @xgmac.orp_iwarp_events 0x0b08 8
  1404. * @xgmac.tx_permitted_frms 0x0b14 4
  1405. * @xgmac.port2_tx_any_frms 0x0b1d 1
  1406. * @xgmac.port1_tx_any_frms 0x0b1e 1
  1407. * @xgmac.port0_tx_any_frms 0x0b1f 1
  1408. * @xgmac.port2_rx_any_frms 0x0b25 1
  1409. * @xgmac.port1_rx_any_frms 0x0b26 1
  1410. * @xgmac.port0_rx_any_frms 0x0b27 1
  1411. *
  1412. * Titan mrpcim hardware statistics.
  1413. */
  1414. struct vxge_hw_device_stats_mrpcim_info {
  1415. /*0x0000*/ u32 pic_ini_rd_drop;
  1416. /*0x0004*/ u32 pic_ini_wr_drop;
  1417. /*0x0008*/ struct {
  1418. /*0x0000*/ u32 pic_wrcrdtarb_ph_crdt_depleted;
  1419. /*0x0004*/ u32 unused1;
  1420. } pic_wrcrdtarb_ph_crdt_depleted_vplane[17];
  1421. /*0x0090*/ struct {
  1422. /*0x0000*/ u32 pic_wrcrdtarb_pd_crdt_depleted;
  1423. /*0x0004*/ u32 unused2;
  1424. } pic_wrcrdtarb_pd_crdt_depleted_vplane[17];
  1425. /*0x0118*/ struct {
  1426. /*0x0000*/ u32 pic_rdcrdtarb_nph_crdt_depleted;
  1427. /*0x0004*/ u32 unused3;
  1428. } pic_rdcrdtarb_nph_crdt_depleted_vplane[17];
  1429. /*0x01a0*/ u32 pic_ini_rd_vpin_drop;
  1430. /*0x01a4*/ u32 pic_ini_wr_vpin_drop;
  1431. /*0x01a8*/ u32 pic_genstats_count0;
  1432. /*0x01ac*/ u32 pic_genstats_count1;
  1433. /*0x01b0*/ u32 pic_genstats_count2;
  1434. /*0x01b4*/ u32 pic_genstats_count3;
  1435. /*0x01b8*/ u32 pic_genstats_count4;
  1436. /*0x01bc*/ u32 unused4;
  1437. /*0x01c0*/ u32 pic_genstats_count5;
  1438. /*0x01c4*/ u32 unused5;
  1439. /*0x01c8*/ u32 pci_rstdrop_cpl;
  1440. /*0x01cc*/ u32 pci_rstdrop_msg;
  1441. /*0x01d0*/ u32 pci_rstdrop_client1;
  1442. /*0x01d4*/ u32 pci_rstdrop_client0;
  1443. /*0x01d8*/ u32 pci_rstdrop_client2;
  1444. /*0x01dc*/ u32 unused6;
  1445. /*0x01e0*/ struct {
  1446. /*0x0000*/ u16 unused7;
  1447. /*0x0002*/ u16 pci_depl_cplh;
  1448. /*0x0004*/ u16 pci_depl_nph;
  1449. /*0x0006*/ u16 pci_depl_ph;
  1450. } pci_depl_h_vplane[17];
  1451. /*0x0268*/ struct {
  1452. /*0x0000*/ u16 unused8;
  1453. /*0x0002*/ u16 pci_depl_cpld;
  1454. /*0x0004*/ u16 pci_depl_npd;
  1455. /*0x0006*/ u16 pci_depl_pd;
  1456. } pci_depl_d_vplane[17];
  1457. /*0x02f0*/ struct vxge_hw_xmac_port_stats xgmac_port[3];
  1458. /*0x0a10*/ struct vxge_hw_xmac_aggr_stats xgmac_aggr[2];
  1459. /*0x0ae0*/ u64 xgmac_global_prog_event_gnum0;
  1460. /*0x0ae8*/ u64 xgmac_global_prog_event_gnum1;
  1461. /*0x0af0*/ u64 unused7;
  1462. /*0x0af8*/ u64 unused8;
  1463. /*0x0b00*/ u64 unused9;
  1464. /*0x0b08*/ u64 unused10;
  1465. /*0x0b10*/ u32 unused11;
  1466. /*0x0b14*/ u32 xgmac_tx_permitted_frms;
  1467. /*0x0b18*/ u32 unused12;
  1468. /*0x0b1c*/ u8 unused13;
  1469. /*0x0b1d*/ u8 xgmac_port2_tx_any_frms;
  1470. /*0x0b1e*/ u8 xgmac_port1_tx_any_frms;
  1471. /*0x0b1f*/ u8 xgmac_port0_tx_any_frms;
  1472. /*0x0b20*/ u32 unused14;
  1473. /*0x0b24*/ u8 unused15;
  1474. /*0x0b25*/ u8 xgmac_port2_rx_any_frms;
  1475. /*0x0b26*/ u8 xgmac_port1_rx_any_frms;
  1476. /*0x0b27*/ u8 xgmac_port0_rx_any_frms;
  1477. } __packed;
  1478. /**
  1479. * struct vxge_hw_device_stats_hw_info - Titan hardware statistics.
  1480. * @vpath_info: VPath statistics
  1481. * @vpath_info_sav: Vpath statistics saved
  1482. *
  1483. * Titan hardware statistics.
  1484. */
  1485. struct vxge_hw_device_stats_hw_info {
  1486. struct vxge_hw_vpath_stats_hw_info
  1487. *vpath_info[VXGE_HW_MAX_VIRTUAL_PATHS];
  1488. struct vxge_hw_vpath_stats_hw_info
  1489. vpath_info_sav[VXGE_HW_MAX_VIRTUAL_PATHS];
  1490. };
  1491. /**
  1492. * struct vxge_hw_vpath_stats_sw_common_info - HW common
  1493. * statistics for queues.
  1494. * @full_cnt: Number of times the queue was full
  1495. * @usage_cnt: usage count.
  1496. * @usage_max: Maximum usage
  1497. * @reserve_free_swaps_cnt: Reserve/free swap counter. Internal usage.
  1498. * @total_compl_cnt: Total descriptor completion count.
  1499. *
  1500. * Hw queue counters
  1501. * See also: struct vxge_hw_vpath_stats_sw_fifo_info{},
  1502. * struct vxge_hw_vpath_stats_sw_ring_info{},
  1503. */
  1504. struct vxge_hw_vpath_stats_sw_common_info {
  1505. u32 full_cnt;
  1506. u32 usage_cnt;
  1507. u32 usage_max;
  1508. u32 reserve_free_swaps_cnt;
  1509. u32 total_compl_cnt;
  1510. };
  1511. /**
  1512. * struct vxge_hw_vpath_stats_sw_fifo_info - HW fifo statistics
  1513. * @common_stats: Common counters for all queues
  1514. * @total_posts: Total number of postings on the queue.
  1515. * @total_buffers: Total number of buffers posted.
  1516. * @txd_t_code_err_cnt: Array of transmit transfer codes. The position
  1517. * (index) in this array reflects the transfer code type, for instance
  1518. * 0xA - "loss of link".
  1519. * Value txd_t_code_err_cnt[i] reflects the
  1520. * number of times the corresponding transfer code was encountered.
  1521. *
  1522. * HW fifo counters
  1523. * See also: struct vxge_hw_vpath_stats_sw_common_info{},
  1524. * struct vxge_hw_vpath_stats_sw_ring_info{},
  1525. */
  1526. struct vxge_hw_vpath_stats_sw_fifo_info {
  1527. struct vxge_hw_vpath_stats_sw_common_info common_stats;
  1528. u32 total_posts;
  1529. u32 total_buffers;
  1530. u32 txd_t_code_err_cnt[VXGE_HW_DTR_MAX_T_CODE];
  1531. };
  1532. /**
  1533. * struct vxge_hw_vpath_stats_sw_ring_info - HW ring statistics
  1534. * @common_stats: Common counters for all queues
  1535. * @rxd_t_code_err_cnt: Array of receive transfer codes. The position
  1536. * (index) in this array reflects the transfer code type,
  1537. * for instance
  1538. * 0x7 - for "invalid receive buffer size", or 0x8 - for ECC.
  1539. * Value rxd_t_code_err_cnt[i] reflects the
  1540. * number of times the corresponding transfer code was encountered.
  1541. *
  1542. * HW ring counters
  1543. * See also: struct vxge_hw_vpath_stats_sw_common_info{},
  1544. * struct vxge_hw_vpath_stats_sw_fifo_info{},
  1545. */
  1546. struct vxge_hw_vpath_stats_sw_ring_info {
  1547. struct vxge_hw_vpath_stats_sw_common_info common_stats;
  1548. u32 rxd_t_code_err_cnt[VXGE_HW_DTR_MAX_T_CODE];
  1549. };
  1550. /**
  1551. * struct vxge_hw_vpath_stats_sw_err - HW vpath error statistics
  1552. * @unknown_alarms:
  1553. * @network_sustained_fault:
  1554. * @network_sustained_ok:
  1555. * @kdfcctl_fifo0_overwrite:
  1556. * @kdfcctl_fifo0_poison:
  1557. * @kdfcctl_fifo0_dma_error:
  1558. * @dblgen_fifo0_overflow:
  1559. * @statsb_pif_chain_error:
  1560. * @statsb_drop_timeout:
  1561. * @target_illegal_access:
  1562. * @ini_serr_det:
  1563. * @prc_ring_bumps:
  1564. * @prc_rxdcm_sc_err:
  1565. * @prc_rxdcm_sc_abort:
  1566. * @prc_quanta_size_err:
  1567. *
  1568. * HW vpath error statistics
  1569. */
  1570. struct vxge_hw_vpath_stats_sw_err {
  1571. u32 unknown_alarms;
  1572. u32 network_sustained_fault;
  1573. u32 network_sustained_ok;
  1574. u32 kdfcctl_fifo0_overwrite;
  1575. u32 kdfcctl_fifo0_poison;
  1576. u32 kdfcctl_fifo0_dma_error;
  1577. u32 dblgen_fifo0_overflow;
  1578. u32 statsb_pif_chain_error;
  1579. u32 statsb_drop_timeout;
  1580. u32 target_illegal_access;
  1581. u32 ini_serr_det;
  1582. u32 prc_ring_bumps;
  1583. u32 prc_rxdcm_sc_err;
  1584. u32 prc_rxdcm_sc_abort;
  1585. u32 prc_quanta_size_err;
  1586. };
  1587. /**
  1588. * struct vxge_hw_vpath_stats_sw_info - HW vpath sw statistics
  1589. * @soft_reset_cnt: Number of times soft reset is done on this vpath.
  1590. * @error_stats: error counters for the vpath
  1591. * @ring_stats: counters for ring belonging to the vpath
  1592. * @fifo_stats: counters for fifo belonging to the vpath
  1593. *
  1594. * HW vpath sw statistics
  1595. * See also: struct vxge_hw_device_info{} }.
  1596. */
  1597. struct vxge_hw_vpath_stats_sw_info {
  1598. u32 soft_reset_cnt;
  1599. struct vxge_hw_vpath_stats_sw_err error_stats;
  1600. struct vxge_hw_vpath_stats_sw_ring_info ring_stats;
  1601. struct vxge_hw_vpath_stats_sw_fifo_info fifo_stats;
  1602. };
  1603. /**
  1604. * struct vxge_hw_device_stats_sw_info - HW own per-device statistics.
  1605. *
  1606. * @not_traffic_intr_cnt: Number of times the host was interrupted
  1607. * without new completions.
  1608. * "Non-traffic interrupt counter".
  1609. * @traffic_intr_cnt: Number of traffic interrupts for the device.
  1610. * @total_intr_cnt: Total number of traffic interrupts for the device.
  1611. * @total_intr_cnt == @traffic_intr_cnt +
  1612. * @not_traffic_intr_cnt
  1613. * @soft_reset_cnt: Number of times soft reset is done on this device.
  1614. * @vpath_info: please see struct vxge_hw_vpath_stats_sw_info{}
  1615. * HW per-device statistics.
  1616. */
  1617. struct vxge_hw_device_stats_sw_info {
  1618. u32 not_traffic_intr_cnt;
  1619. u32 traffic_intr_cnt;
  1620. u32 total_intr_cnt;
  1621. u32 soft_reset_cnt;
  1622. struct vxge_hw_vpath_stats_sw_info
  1623. vpath_info[VXGE_HW_MAX_VIRTUAL_PATHS];
  1624. };
  1625. /**
  1626. * struct vxge_hw_device_stats_sw_err - HW device error statistics.
  1627. * @vpath_alarms: Number of vpath alarms
  1628. *
  1629. * HW Device error stats
  1630. */
  1631. struct vxge_hw_device_stats_sw_err {
  1632. u32 vpath_alarms;
  1633. };
  1634. /**
  1635. * struct vxge_hw_device_stats - Contains HW per-device statistics,
  1636. * including hw.
  1637. * @devh: HW device handle.
  1638. * @dma_addr: DMA addres of the %hw_info. Given to device to fill-in the stats.
  1639. * @hw_info_dmah: DMA handle used to map hw statistics onto the device memory
  1640. * space.
  1641. * @hw_info_dma_acch: One more DMA handle used subsequently to free the
  1642. * DMA object. Note that this and the previous handle have
  1643. * physical meaning for Solaris; on Windows and Linux the
  1644. * corresponding value will be simply pointer to PCI device.
  1645. *
  1646. * @hw_dev_info_stats: Titan statistics maintained by the hardware.
  1647. * @sw_dev_info_stats: HW's "soft" device informational statistics, e.g. number
  1648. * of completions per interrupt.
  1649. * @sw_dev_err_stats: HW's "soft" device error statistics.
  1650. *
  1651. * Structure-container of HW per-device statistics. Note that per-channel
  1652. * statistics are kept in separate structures under HW's fifo and ring
  1653. * channels.
  1654. */
  1655. struct vxge_hw_device_stats {
  1656. /* handles */
  1657. struct __vxge_hw_device *devh;
  1658. /* HW device hardware statistics */
  1659. struct vxge_hw_device_stats_hw_info hw_dev_info_stats;
  1660. /* HW device "soft" stats */
  1661. struct vxge_hw_device_stats_sw_err sw_dev_err_stats;
  1662. struct vxge_hw_device_stats_sw_info sw_dev_info_stats;
  1663. };
  1664. enum vxge_hw_status vxge_hw_device_hw_stats_enable(
  1665. struct __vxge_hw_device *devh);
  1666. enum vxge_hw_status vxge_hw_device_stats_get(
  1667. struct __vxge_hw_device *devh,
  1668. struct vxge_hw_device_stats_hw_info *hw_stats);
  1669. enum vxge_hw_status vxge_hw_driver_stats_get(
  1670. struct __vxge_hw_device *devh,
  1671. struct vxge_hw_device_stats_sw_info *sw_stats);
  1672. enum vxge_hw_status vxge_hw_mrpcim_stats_enable(struct __vxge_hw_device *devh);
  1673. enum vxge_hw_status vxge_hw_mrpcim_stats_disable(struct __vxge_hw_device *devh);
  1674. enum vxge_hw_status
  1675. vxge_hw_mrpcim_stats_access(
  1676. struct __vxge_hw_device *devh,
  1677. u32 operation,
  1678. u32 location,
  1679. u32 offset,
  1680. u64 *stat);
  1681. enum vxge_hw_status
  1682. vxge_hw_device_xmac_aggr_stats_get(struct __vxge_hw_device *devh, u32 port,
  1683. struct vxge_hw_xmac_aggr_stats *aggr_stats);
  1684. enum vxge_hw_status
  1685. vxge_hw_device_xmac_port_stats_get(struct __vxge_hw_device *devh, u32 port,
  1686. struct vxge_hw_xmac_port_stats *port_stats);
  1687. enum vxge_hw_status
  1688. vxge_hw_device_xmac_stats_get(struct __vxge_hw_device *devh,
  1689. struct vxge_hw_xmac_stats *xmac_stats);
  1690. /**
  1691. * enum enum vxge_hw_mgmt_reg_type - Register types.
  1692. *
  1693. * @vxge_hw_mgmt_reg_type_legacy: Legacy registers
  1694. * @vxge_hw_mgmt_reg_type_toc: TOC Registers
  1695. * @vxge_hw_mgmt_reg_type_common: Common Registers
  1696. * @vxge_hw_mgmt_reg_type_mrpcim: mrpcim registers
  1697. * @vxge_hw_mgmt_reg_type_srpcim: srpcim registers
  1698. * @vxge_hw_mgmt_reg_type_vpmgmt: vpath management registers
  1699. * @vxge_hw_mgmt_reg_type_vpath: vpath registers
  1700. *
  1701. * Register type enumaration
  1702. */
  1703. enum vxge_hw_mgmt_reg_type {
  1704. vxge_hw_mgmt_reg_type_legacy = 0,
  1705. vxge_hw_mgmt_reg_type_toc = 1,
  1706. vxge_hw_mgmt_reg_type_common = 2,
  1707. vxge_hw_mgmt_reg_type_mrpcim = 3,
  1708. vxge_hw_mgmt_reg_type_srpcim = 4,
  1709. vxge_hw_mgmt_reg_type_vpmgmt = 5,
  1710. vxge_hw_mgmt_reg_type_vpath = 6
  1711. };
  1712. enum vxge_hw_status
  1713. vxge_hw_mgmt_reg_read(struct __vxge_hw_device *devh,
  1714. enum vxge_hw_mgmt_reg_type type,
  1715. u32 index,
  1716. u32 offset,
  1717. u64 *value);
  1718. enum vxge_hw_status
  1719. vxge_hw_mgmt_reg_write(struct __vxge_hw_device *devh,
  1720. enum vxge_hw_mgmt_reg_type type,
  1721. u32 index,
  1722. u32 offset,
  1723. u64 value);
  1724. /**
  1725. * enum enum vxge_hw_rxd_state - Descriptor (RXD) state.
  1726. * @VXGE_HW_RXD_STATE_NONE: Invalid state.
  1727. * @VXGE_HW_RXD_STATE_AVAIL: Descriptor is available for reservation.
  1728. * @VXGE_HW_RXD_STATE_POSTED: Descriptor is posted for processing by the
  1729. * device.
  1730. * @VXGE_HW_RXD_STATE_FREED: Descriptor is free and can be reused for
  1731. * filling-in and posting later.
  1732. *
  1733. * Titan/HW descriptor states.
  1734. *
  1735. */
  1736. enum vxge_hw_rxd_state {
  1737. VXGE_HW_RXD_STATE_NONE = 0,
  1738. VXGE_HW_RXD_STATE_AVAIL = 1,
  1739. VXGE_HW_RXD_STATE_POSTED = 2,
  1740. VXGE_HW_RXD_STATE_FREED = 3
  1741. };
  1742. /**
  1743. * struct vxge_hw_ring_rxd_info - Extended information associated with a
  1744. * completed ring descriptor.
  1745. * @syn_flag: SYN flag
  1746. * @is_icmp: Is ICMP
  1747. * @fast_path_eligible: Fast Path Eligible flag
  1748. * @l3_cksum: in L3 checksum is valid
  1749. * @l3_cksum: Result of IP checksum check (by Titan hardware).
  1750. * This field containing VXGE_HW_L3_CKSUM_OK would mean that
  1751. * the checksum is correct, otherwise - the datagram is
  1752. * corrupted.
  1753. * @l4_cksum: in L4 checksum is valid
  1754. * @l4_cksum: Result of TCP/UDP checksum check (by Titan hardware).
  1755. * This field containing VXGE_HW_L4_CKSUM_OK would mean that
  1756. * the checksum is correct. Otherwise - the packet is
  1757. * corrupted.
  1758. * @frame: Zero or more of enum vxge_hw_frame_type flags.
  1759. * See enum vxge_hw_frame_type{}.
  1760. * @proto: zero or more of enum vxge_hw_frame_proto flags. Reporting bits for
  1761. * various higher-layer protocols, including (but note restricted to)
  1762. * TCP and UDP. See enum vxge_hw_frame_proto{}.
  1763. * @is_vlan: If vlan tag is valid
  1764. * @vlan: VLAN tag extracted from the received frame.
  1765. * @rth_bucket: RTH bucket
  1766. * @rth_it_hit: Set, If RTH hash value calculated by the Titan hardware
  1767. * has a matching entry in the Indirection table.
  1768. * @rth_spdm_hit: Set, If RTH hash value calculated by the Titan hardware
  1769. * has a matching entry in the Socket Pair Direct Match table.
  1770. * @rth_hash_type: RTH hash code of the function used to calculate the hash.
  1771. * @rth_value: Receive Traffic Hashing(RTH) hash value. Produced by Titan
  1772. * hardware if RTH is enabled.
  1773. */
  1774. struct vxge_hw_ring_rxd_info {
  1775. u32 syn_flag;
  1776. u32 is_icmp;
  1777. u32 fast_path_eligible;
  1778. u32 l3_cksum_valid;
  1779. u32 l3_cksum;
  1780. u32 l4_cksum_valid;
  1781. u32 l4_cksum;
  1782. u32 frame;
  1783. u32 proto;
  1784. u32 is_vlan;
  1785. u32 vlan;
  1786. u32 rth_bucket;
  1787. u32 rth_it_hit;
  1788. u32 rth_spdm_hit;
  1789. u32 rth_hash_type;
  1790. u32 rth_value;
  1791. };
  1792. /**
  1793. * enum enum vxge_hw_ring_hash_type - RTH hash types
  1794. * @VXGE_HW_RING_HASH_TYPE_NONE: No Hash
  1795. * @VXGE_HW_RING_HASH_TYPE_TCP_IPV4: TCP IPv4
  1796. * @VXGE_HW_RING_HASH_TYPE_UDP_IPV4: UDP IPv4
  1797. * @VXGE_HW_RING_HASH_TYPE_IPV4: IPv4
  1798. * @VXGE_HW_RING_HASH_TYPE_TCP_IPV6: TCP IPv6
  1799. * @VXGE_HW_RING_HASH_TYPE_UDP_IPV6: UDP IPv6
  1800. * @VXGE_HW_RING_HASH_TYPE_IPV6: IPv6
  1801. * @VXGE_HW_RING_HASH_TYPE_TCP_IPV6_EX: TCP IPv6 extension
  1802. * @VXGE_HW_RING_HASH_TYPE_UDP_IPV6_EX: UDP IPv6 extension
  1803. * @VXGE_HW_RING_HASH_TYPE_IPV6_EX: IPv6 extension
  1804. *
  1805. * RTH hash types
  1806. */
  1807. enum vxge_hw_ring_hash_type {
  1808. VXGE_HW_RING_HASH_TYPE_NONE = 0x0,
  1809. VXGE_HW_RING_HASH_TYPE_TCP_IPV4 = 0x1,
  1810. VXGE_HW_RING_HASH_TYPE_UDP_IPV4 = 0x2,
  1811. VXGE_HW_RING_HASH_TYPE_IPV4 = 0x3,
  1812. VXGE_HW_RING_HASH_TYPE_TCP_IPV6 = 0x4,
  1813. VXGE_HW_RING_HASH_TYPE_UDP_IPV6 = 0x5,
  1814. VXGE_HW_RING_HASH_TYPE_IPV6 = 0x6,
  1815. VXGE_HW_RING_HASH_TYPE_TCP_IPV6_EX = 0x7,
  1816. VXGE_HW_RING_HASH_TYPE_UDP_IPV6_EX = 0x8,
  1817. VXGE_HW_RING_HASH_TYPE_IPV6_EX = 0x9
  1818. };
  1819. enum vxge_hw_status vxge_hw_ring_rxd_reserve(
  1820. struct __vxge_hw_ring *ring_handle,
  1821. void **rxdh);
  1822. void
  1823. vxge_hw_ring_rxd_pre_post(
  1824. struct __vxge_hw_ring *ring_handle,
  1825. void *rxdh);
  1826. void
  1827. vxge_hw_ring_rxd_post_post(
  1828. struct __vxge_hw_ring *ring_handle,
  1829. void *rxdh);
  1830. enum vxge_hw_status
  1831. vxge_hw_ring_replenish(struct __vxge_hw_ring *ring_handle, u16 min_flag);
  1832. void
  1833. vxge_hw_ring_rxd_post_post_wmb(
  1834. struct __vxge_hw_ring *ring_handle,
  1835. void *rxdh);
  1836. void vxge_hw_ring_rxd_post(
  1837. struct __vxge_hw_ring *ring_handle,
  1838. void *rxdh);
  1839. enum vxge_hw_status vxge_hw_ring_rxd_next_completed(
  1840. struct __vxge_hw_ring *ring_handle,
  1841. void **rxdh,
  1842. u8 *t_code);
  1843. enum vxge_hw_status vxge_hw_ring_handle_tcode(
  1844. struct __vxge_hw_ring *ring_handle,
  1845. void *rxdh,
  1846. u8 t_code);
  1847. void vxge_hw_ring_rxd_free(
  1848. struct __vxge_hw_ring *ring_handle,
  1849. void *rxdh);
  1850. /**
  1851. * enum enum vxge_hw_frame_proto - Higher-layer ethernet protocols.
  1852. * @VXGE_HW_FRAME_PROTO_VLAN_TAGGED: VLAN.
  1853. * @VXGE_HW_FRAME_PROTO_IPV4: IPv4.
  1854. * @VXGE_HW_FRAME_PROTO_IPV6: IPv6.
  1855. * @VXGE_HW_FRAME_PROTO_IP_FRAG: IP fragmented.
  1856. * @VXGE_HW_FRAME_PROTO_TCP: TCP.
  1857. * @VXGE_HW_FRAME_PROTO_UDP: UDP.
  1858. * @VXGE_HW_FRAME_PROTO_TCP_OR_UDP: TCP or UDP.
  1859. *
  1860. * Higher layer ethernet protocols and options.
  1861. */
  1862. enum vxge_hw_frame_proto {
  1863. VXGE_HW_FRAME_PROTO_VLAN_TAGGED = 0x80,
  1864. VXGE_HW_FRAME_PROTO_IPV4 = 0x10,
  1865. VXGE_HW_FRAME_PROTO_IPV6 = 0x08,
  1866. VXGE_HW_FRAME_PROTO_IP_FRAG = 0x04,
  1867. VXGE_HW_FRAME_PROTO_TCP = 0x02,
  1868. VXGE_HW_FRAME_PROTO_UDP = 0x01,
  1869. VXGE_HW_FRAME_PROTO_TCP_OR_UDP = (VXGE_HW_FRAME_PROTO_TCP | \
  1870. VXGE_HW_FRAME_PROTO_UDP)
  1871. };
  1872. /**
  1873. * enum enum vxge_hw_fifo_gather_code - Gather codes used in fifo TxD
  1874. * @VXGE_HW_FIFO_GATHER_CODE_FIRST: First TxDL
  1875. * @VXGE_HW_FIFO_GATHER_CODE_MIDDLE: Middle TxDL
  1876. * @VXGE_HW_FIFO_GATHER_CODE_LAST: Last TxDL
  1877. * @VXGE_HW_FIFO_GATHER_CODE_FIRST_LAST: First and Last TxDL.
  1878. *
  1879. * These gather codes are used to indicate the position of a TxD in a TxD list
  1880. */
  1881. enum vxge_hw_fifo_gather_code {
  1882. VXGE_HW_FIFO_GATHER_CODE_FIRST = 0x2,
  1883. VXGE_HW_FIFO_GATHER_CODE_MIDDLE = 0x0,
  1884. VXGE_HW_FIFO_GATHER_CODE_LAST = 0x1,
  1885. VXGE_HW_FIFO_GATHER_CODE_FIRST_LAST = 0x3
  1886. };
  1887. /**
  1888. * enum enum vxge_hw_fifo_tcode - tcodes used in fifo
  1889. * @VXGE_HW_FIFO_T_CODE_OK: Transfer OK
  1890. * @VXGE_HW_FIFO_T_CODE_PCI_READ_CORRUPT: PCI read transaction (either TxD or
  1891. * frame data) returned with corrupt data.
  1892. * @VXGE_HW_FIFO_T_CODE_PCI_READ_FAIL:PCI read transaction was returned
  1893. * with no data.
  1894. * @VXGE_HW_FIFO_T_CODE_INVALID_MSS: The host attempted to send either a
  1895. * frame or LSO MSS that was too long (>9800B).
  1896. * @VXGE_HW_FIFO_T_CODE_LSO_ERROR: Error detected during TCP/UDP Large Send
  1897. * Offload operation, due to improper header template,
  1898. * unsupported protocol, etc.
  1899. * @VXGE_HW_FIFO_T_CODE_UNUSED: Unused
  1900. * @VXGE_HW_FIFO_T_CODE_MULTI_ERROR: Set to 1 by the adapter if multiple
  1901. * data buffer transfer errors are encountered (see below).
  1902. * Otherwise it is set to 0.
  1903. *
  1904. * These tcodes are returned in various API for TxD status
  1905. */
  1906. enum vxge_hw_fifo_tcode {
  1907. VXGE_HW_FIFO_T_CODE_OK = 0x0,
  1908. VXGE_HW_FIFO_T_CODE_PCI_READ_CORRUPT = 0x1,
  1909. VXGE_HW_FIFO_T_CODE_PCI_READ_FAIL = 0x2,
  1910. VXGE_HW_FIFO_T_CODE_INVALID_MSS = 0x3,
  1911. VXGE_HW_FIFO_T_CODE_LSO_ERROR = 0x4,
  1912. VXGE_HW_FIFO_T_CODE_UNUSED = 0x7,
  1913. VXGE_HW_FIFO_T_CODE_MULTI_ERROR = 0x8
  1914. };
  1915. enum vxge_hw_status vxge_hw_fifo_txdl_reserve(
  1916. struct __vxge_hw_fifo *fifoh,
  1917. void **txdlh,
  1918. void **txdl_priv);
  1919. void vxge_hw_fifo_txdl_buffer_set(
  1920. struct __vxge_hw_fifo *fifo_handle,
  1921. void *txdlh,
  1922. u32 frag_idx,
  1923. dma_addr_t dma_pointer,
  1924. u32 size);
  1925. void vxge_hw_fifo_txdl_post(
  1926. struct __vxge_hw_fifo *fifo_handle,
  1927. void *txdlh);
  1928. u32 vxge_hw_fifo_free_txdl_count_get(
  1929. struct __vxge_hw_fifo *fifo_handle);
  1930. enum vxge_hw_status vxge_hw_fifo_txdl_next_completed(
  1931. struct __vxge_hw_fifo *fifoh,
  1932. void **txdlh,
  1933. enum vxge_hw_fifo_tcode *t_code);
  1934. enum vxge_hw_status vxge_hw_fifo_handle_tcode(
  1935. struct __vxge_hw_fifo *fifoh,
  1936. void *txdlh,
  1937. enum vxge_hw_fifo_tcode t_code);
  1938. void vxge_hw_fifo_txdl_free(
  1939. struct __vxge_hw_fifo *fifoh,
  1940. void *txdlh);
  1941. /*
  1942. * Device
  1943. */
  1944. #define VXGE_HW_RING_NEXT_BLOCK_POINTER_OFFSET (VXGE_HW_BLOCK_SIZE-8)
  1945. #define VXGE_HW_RING_MEMBLOCK_IDX_OFFSET (VXGE_HW_BLOCK_SIZE-16)
  1946. #define VXGE_HW_RING_MIN_BUFF_ALLOCATION 64
  1947. /*
  1948. * struct __vxge_hw_ring_rxd_priv - Receive descriptor HW-private data.
  1949. * @dma_addr: DMA (mapped) address of _this_ descriptor.
  1950. * @dma_handle: DMA handle used to map the descriptor onto device.
  1951. * @dma_offset: Descriptor's offset in the memory block. HW allocates
  1952. * descriptors in memory blocks of %VXGE_HW_BLOCK_SIZE
  1953. * bytes. Each memblock is contiguous DMA-able memory. Each
  1954. * memblock contains 1 or more 4KB RxD blocks visible to the
  1955. * Titan hardware.
  1956. * @dma_object: DMA address and handle of the memory block that contains
  1957. * the descriptor. This member is used only in the "checked"
  1958. * version of the HW (to enforce certain assertions);
  1959. * otherwise it gets compiled out.
  1960. * @allocated: True if the descriptor is reserved, 0 otherwise. Internal usage.
  1961. *
  1962. * Per-receive decsriptor HW-private data. HW uses the space to keep DMA
  1963. * information associated with the descriptor. Note that driver can ask HW
  1964. * to allocate additional per-descriptor space for its own (driver-specific)
  1965. * purposes.
  1966. */
  1967. struct __vxge_hw_ring_rxd_priv {
  1968. dma_addr_t dma_addr;
  1969. struct pci_dev *dma_handle;
  1970. ptrdiff_t dma_offset;
  1971. #ifdef VXGE_DEBUG_ASSERT
  1972. struct vxge_hw_mempool_dma *dma_object;
  1973. #endif
  1974. };
  1975. /* ========================= RING PRIVATE API ============================= */
  1976. u64
  1977. __vxge_hw_ring_first_block_address_get(
  1978. struct __vxge_hw_ring *ringh);
  1979. enum vxge_hw_status
  1980. __vxge_hw_ring_create(
  1981. struct __vxge_hw_vpath_handle *vpath_handle,
  1982. struct vxge_hw_ring_attr *attr);
  1983. enum vxge_hw_status
  1984. __vxge_hw_ring_abort(
  1985. struct __vxge_hw_ring *ringh);
  1986. enum vxge_hw_status
  1987. __vxge_hw_ring_reset(
  1988. struct __vxge_hw_ring *ringh);
  1989. enum vxge_hw_status
  1990. __vxge_hw_ring_delete(
  1991. struct __vxge_hw_vpath_handle *vpath_handle);
  1992. /* ========================= FIFO PRIVATE API ============================= */
  1993. struct vxge_hw_fifo_attr;
  1994. enum vxge_hw_status
  1995. __vxge_hw_fifo_create(
  1996. struct __vxge_hw_vpath_handle *vpath_handle,
  1997. struct vxge_hw_fifo_attr *attr);
  1998. enum vxge_hw_status
  1999. __vxge_hw_fifo_abort(
  2000. struct __vxge_hw_fifo *fifoh);
  2001. enum vxge_hw_status
  2002. __vxge_hw_fifo_reset(
  2003. struct __vxge_hw_fifo *ringh);
  2004. enum vxge_hw_status
  2005. __vxge_hw_fifo_delete(
  2006. struct __vxge_hw_vpath_handle *vpath_handle);
  2007. struct vxge_hw_mempool_cbs {
  2008. void (*item_func_alloc)(
  2009. struct vxge_hw_mempool *mempoolh,
  2010. u32 memblock_index,
  2011. struct vxge_hw_mempool_dma *dma_object,
  2012. u32 index,
  2013. u32 is_last);
  2014. };
  2015. void
  2016. __vxge_hw_mempool_destroy(
  2017. struct vxge_hw_mempool *mempool);
  2018. #define VXGE_HW_VIRTUAL_PATH_HANDLE(vpath) \
  2019. ((struct __vxge_hw_vpath_handle *)(vpath)->vpath_handles.next)
  2020. enum vxge_hw_status
  2021. __vxge_hw_vpath_rts_table_get(
  2022. struct __vxge_hw_vpath_handle *vpath_handle,
  2023. u32 action,
  2024. u32 rts_table,
  2025. u32 offset,
  2026. u64 *data1,
  2027. u64 *data2);
  2028. enum vxge_hw_status
  2029. __vxge_hw_vpath_rts_table_set(
  2030. struct __vxge_hw_vpath_handle *vpath_handle,
  2031. u32 action,
  2032. u32 rts_table,
  2033. u32 offset,
  2034. u64 data1,
  2035. u64 data2);
  2036. enum vxge_hw_status
  2037. __vxge_hw_vpath_reset(
  2038. struct __vxge_hw_device *devh,
  2039. u32 vp_id);
  2040. enum vxge_hw_status
  2041. __vxge_hw_vpath_sw_reset(
  2042. struct __vxge_hw_device *devh,
  2043. u32 vp_id);
  2044. enum vxge_hw_status
  2045. __vxge_hw_vpath_enable(
  2046. struct __vxge_hw_device *devh,
  2047. u32 vp_id);
  2048. void
  2049. __vxge_hw_vpath_prc_configure(
  2050. struct __vxge_hw_device *devh,
  2051. u32 vp_id);
  2052. enum vxge_hw_status
  2053. __vxge_hw_vpath_kdfc_configure(
  2054. struct __vxge_hw_device *devh,
  2055. u32 vp_id);
  2056. enum vxge_hw_status
  2057. __vxge_hw_vpath_mac_configure(
  2058. struct __vxge_hw_device *devh,
  2059. u32 vp_id);
  2060. enum vxge_hw_status
  2061. __vxge_hw_vpath_tim_configure(
  2062. struct __vxge_hw_device *devh,
  2063. u32 vp_id);
  2064. enum vxge_hw_status
  2065. __vxge_hw_vpath_initialize(
  2066. struct __vxge_hw_device *devh,
  2067. u32 vp_id);
  2068. enum vxge_hw_status
  2069. __vxge_hw_vp_initialize(
  2070. struct __vxge_hw_device *devh,
  2071. u32 vp_id,
  2072. struct vxge_hw_vp_config *config);
  2073. void
  2074. __vxge_hw_vp_terminate(
  2075. struct __vxge_hw_device *devh,
  2076. u32 vp_id);
  2077. enum vxge_hw_status
  2078. __vxge_hw_vpath_alarm_process(
  2079. struct __vxge_hw_virtualpath *vpath,
  2080. u32 skip_alarms);
  2081. void vxge_hw_device_intr_enable(
  2082. struct __vxge_hw_device *devh);
  2083. u32 vxge_hw_device_set_intr_type(struct __vxge_hw_device *devh, u32 intr_mode);
  2084. void vxge_hw_device_intr_disable(
  2085. struct __vxge_hw_device *devh);
  2086. void vxge_hw_device_mask_all(
  2087. struct __vxge_hw_device *devh);
  2088. void vxge_hw_device_unmask_all(
  2089. struct __vxge_hw_device *devh);
  2090. enum vxge_hw_status vxge_hw_device_begin_irq(
  2091. struct __vxge_hw_device *devh,
  2092. u32 skip_alarms,
  2093. u64 *reason);
  2094. void vxge_hw_device_clear_tx_rx(
  2095. struct __vxge_hw_device *devh);
  2096. /*
  2097. * Virtual Paths
  2098. */
  2099. u32 vxge_hw_vpath_id(
  2100. struct __vxge_hw_vpath_handle *vpath_handle);
  2101. enum vxge_hw_vpath_mac_addr_add_mode {
  2102. VXGE_HW_VPATH_MAC_ADDR_ADD_DUPLICATE = 0,
  2103. VXGE_HW_VPATH_MAC_ADDR_DISCARD_DUPLICATE = 1,
  2104. VXGE_HW_VPATH_MAC_ADDR_REPLACE_DUPLICATE = 2
  2105. };
  2106. enum vxge_hw_status
  2107. vxge_hw_vpath_mac_addr_add(
  2108. struct __vxge_hw_vpath_handle *vpath_handle,
  2109. u8 (macaddr)[ETH_ALEN],
  2110. u8 (macaddr_mask)[ETH_ALEN],
  2111. enum vxge_hw_vpath_mac_addr_add_mode duplicate_mode);
  2112. enum vxge_hw_status
  2113. vxge_hw_vpath_mac_addr_get(
  2114. struct __vxge_hw_vpath_handle *vpath_handle,
  2115. u8 (macaddr)[ETH_ALEN],
  2116. u8 (macaddr_mask)[ETH_ALEN]);
  2117. enum vxge_hw_status
  2118. vxge_hw_vpath_mac_addr_get_next(
  2119. struct __vxge_hw_vpath_handle *vpath_handle,
  2120. u8 (macaddr)[ETH_ALEN],
  2121. u8 (macaddr_mask)[ETH_ALEN]);
  2122. enum vxge_hw_status
  2123. vxge_hw_vpath_mac_addr_delete(
  2124. struct __vxge_hw_vpath_handle *vpath_handle,
  2125. u8 (macaddr)[ETH_ALEN],
  2126. u8 (macaddr_mask)[ETH_ALEN]);
  2127. enum vxge_hw_status
  2128. vxge_hw_vpath_vid_add(
  2129. struct __vxge_hw_vpath_handle *vpath_handle,
  2130. u64 vid);
  2131. enum vxge_hw_status
  2132. vxge_hw_vpath_vid_get(
  2133. struct __vxge_hw_vpath_handle *vpath_handle,
  2134. u64 *vid);
  2135. enum vxge_hw_status
  2136. vxge_hw_vpath_vid_get_next(
  2137. struct __vxge_hw_vpath_handle *vpath_handle,
  2138. u64 *vid);
  2139. enum vxge_hw_status
  2140. vxge_hw_vpath_vid_delete(
  2141. struct __vxge_hw_vpath_handle *vpath_handle,
  2142. u64 vid);
  2143. enum vxge_hw_status
  2144. vxge_hw_vpath_etype_add(
  2145. struct __vxge_hw_vpath_handle *vpath_handle,
  2146. u64 etype);
  2147. enum vxge_hw_status
  2148. vxge_hw_vpath_etype_get(
  2149. struct __vxge_hw_vpath_handle *vpath_handle,
  2150. u64 *etype);
  2151. enum vxge_hw_status
  2152. vxge_hw_vpath_etype_get_next(
  2153. struct __vxge_hw_vpath_handle *vpath_handle,
  2154. u64 *etype);
  2155. enum vxge_hw_status
  2156. vxge_hw_vpath_etype_delete(
  2157. struct __vxge_hw_vpath_handle *vpath_handle,
  2158. u64 etype);
  2159. enum vxge_hw_status vxge_hw_vpath_promisc_enable(
  2160. struct __vxge_hw_vpath_handle *vpath_handle);
  2161. enum vxge_hw_status vxge_hw_vpath_promisc_disable(
  2162. struct __vxge_hw_vpath_handle *vpath_handle);
  2163. enum vxge_hw_status vxge_hw_vpath_bcast_enable(
  2164. struct __vxge_hw_vpath_handle *vpath_handle);
  2165. enum vxge_hw_status vxge_hw_vpath_mcast_enable(
  2166. struct __vxge_hw_vpath_handle *vpath_handle);
  2167. enum vxge_hw_status vxge_hw_vpath_mcast_disable(
  2168. struct __vxge_hw_vpath_handle *vpath_handle);
  2169. enum vxge_hw_status vxge_hw_vpath_poll_rx(
  2170. struct __vxge_hw_ring *ringh);
  2171. enum vxge_hw_status vxge_hw_vpath_poll_tx(
  2172. struct __vxge_hw_fifo *fifoh,
  2173. void **skb_ptr);
  2174. enum vxge_hw_status vxge_hw_vpath_alarm_process(
  2175. struct __vxge_hw_vpath_handle *vpath_handle,
  2176. u32 skip_alarms);
  2177. enum vxge_hw_status
  2178. vxge_hw_vpath_msix_set(struct __vxge_hw_vpath_handle *vpath_handle,
  2179. int *tim_msix_id, int alarm_msix_id);
  2180. void
  2181. vxge_hw_vpath_msix_mask(struct __vxge_hw_vpath_handle *vpath_handle,
  2182. int msix_id);
  2183. void vxge_hw_device_flush_io(struct __vxge_hw_device *devh);
  2184. void
  2185. vxge_hw_vpath_msix_clear(struct __vxge_hw_vpath_handle *vpath_handle,
  2186. int msix_id);
  2187. void
  2188. vxge_hw_vpath_msix_unmask(struct __vxge_hw_vpath_handle *vpath_handle,
  2189. int msix_id);
  2190. void
  2191. vxge_hw_vpath_msix_mask_all(struct __vxge_hw_vpath_handle *vpath_handle);
  2192. enum vxge_hw_status vxge_hw_vpath_intr_enable(
  2193. struct __vxge_hw_vpath_handle *vpath_handle);
  2194. enum vxge_hw_status vxge_hw_vpath_intr_disable(
  2195. struct __vxge_hw_vpath_handle *vpath_handle);
  2196. void vxge_hw_vpath_inta_mask_tx_rx(
  2197. struct __vxge_hw_vpath_handle *vpath_handle);
  2198. void vxge_hw_vpath_inta_unmask_tx_rx(
  2199. struct __vxge_hw_vpath_handle *vpath_handle);
  2200. void
  2201. vxge_hw_channel_msix_mask(struct __vxge_hw_channel *channelh, int msix_id);
  2202. void
  2203. vxge_hw_channel_msix_unmask(struct __vxge_hw_channel *channelh, int msix_id);
  2204. enum vxge_hw_status
  2205. vxge_hw_channel_dtr_alloc(struct __vxge_hw_channel *channel, void **dtrh);
  2206. void
  2207. vxge_hw_channel_dtr_post(struct __vxge_hw_channel *channel, void *dtrh);
  2208. void
  2209. vxge_hw_channel_dtr_try_complete(struct __vxge_hw_channel *channel,
  2210. void **dtrh);
  2211. void
  2212. vxge_hw_channel_dtr_complete(struct __vxge_hw_channel *channel);
  2213. void
  2214. vxge_hw_channel_dtr_free(struct __vxge_hw_channel *channel, void *dtrh);
  2215. int
  2216. vxge_hw_channel_dtr_count(struct __vxge_hw_channel *channel);
  2217. /* ========================== PRIVATE API ================================= */
  2218. enum vxge_hw_status
  2219. __vxge_hw_device_handle_link_up_ind(struct __vxge_hw_device *hldev);
  2220. enum vxge_hw_status
  2221. __vxge_hw_device_handle_link_down_ind(struct __vxge_hw_device *hldev);
  2222. enum vxge_hw_status
  2223. __vxge_hw_device_handle_error(
  2224. struct __vxge_hw_device *hldev,
  2225. u32 vp_id,
  2226. enum vxge_hw_event type);
  2227. #endif