vxge-traffic.h 96 KB

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