1 /* 2 * SPDX-License-Identifier: BSD-3-Clause 3 * Copyright(c) 2024 Napatech A/S 4 */ 5 6 #ifndef _HW_MOD_FLM_V25_H_ 7 #define _HW_MOD_FLM_V25_H_ 8 9 #include <stdint.h> 10 11 /* SCRUB record constraints */ 12 #define SCRUB_T_MAX 0xEF/* MAX encoded timeout value, approx. 127 years */ 13 #define SCRUB_DEL \ 14 0 /* Indicates if flow should be deleted upon timeout. If DEL=0 then the flow is \ 15 * marked as aged rather than being deleted. \ 16 */ 17 #define SCRUB_INF \ 18 1 /* Indicates if a flow info record should be generated upon timeout. \ 19 * If INF=1 a flow info record will be generated even for a stateless flow. \ 20 */ 21 22 struct flm_v25_control_s { 23 uint32_t enable; 24 uint32_t init; 25 uint32_t lds; 26 uint32_t lfs; 27 uint32_t lis; 28 uint32_t uds; 29 uint32_t uis; 30 uint32_t rds; 31 uint32_t ris; 32 uint32_t pds; 33 uint32_t pis; 34 uint32_t crcwr; 35 uint32_t crcrd; 36 uint32_t rbl; 37 uint32_t eab; 38 uint32_t split_sdram_usage; 39 }; 40 41 struct flm_v25_status_s { 42 uint32_t calib_success; 43 uint32_t calib_fail; 44 uint32_t initdone; 45 uint32_t idle; 46 uint32_t critical; 47 uint32_t panic; 48 uint32_t crcerr; 49 uint32_t eft_bp; 50 uint32_t cache_buf_critical; 51 }; 52 53 struct flm_v25_load_bin_s { 54 uint32_t bin; 55 }; 56 57 struct flm_v25_load_pps_s { 58 uint32_t pps; 59 }; 60 61 struct flm_v25_load_lps_s { 62 uint32_t lps; 63 }; 64 65 struct flm_v25_load_aps_s { 66 uint32_t aps; 67 }; 68 69 struct flm_v25_prio_s { 70 uint32_t limit0; 71 uint32_t ft0; 72 uint32_t limit1; 73 uint32_t ft1; 74 uint32_t limit2; 75 uint32_t ft2; 76 uint32_t limit3; 77 uint32_t ft3; 78 }; 79 80 struct flm_v25_pst_s { 81 uint32_t bp; 82 uint32_t pp; 83 uint32_t tp; 84 }; 85 86 struct flm_v25_rcp_s { 87 uint32_t lookup; 88 uint32_t qw0_dyn; 89 uint32_t qw0_ofs; 90 uint32_t qw0_sel; 91 uint32_t qw4_dyn; 92 uint32_t qw4_ofs; 93 uint32_t sw8_dyn; 94 uint32_t sw8_ofs; 95 uint32_t sw8_sel; 96 uint32_t sw9_dyn; 97 uint32_t sw9_ofs; 98 uint32_t mask[10]; 99 uint32_t kid; 100 uint32_t opn; 101 uint32_t ipn; 102 uint32_t byt_dyn; 103 uint32_t byt_ofs; 104 uint32_t txplm; 105 uint32_t auto_ipv4_mask; 106 }; 107 108 struct flm_v25_buf_ctrl_s { 109 uint32_t lrn_free; 110 uint32_t inf_avail; 111 uint32_t sta_avail; 112 }; 113 114 struct flm_v25_stat_lrn_done_s { 115 uint32_t cnt; 116 }; 117 118 struct flm_v25_stat_lrn_ignore_s { 119 uint32_t cnt; 120 }; 121 122 struct flm_v25_stat_lrn_fail_s { 123 uint32_t cnt; 124 }; 125 126 struct flm_v25_stat_unl_done_s { 127 uint32_t cnt; 128 }; 129 130 struct flm_v25_stat_unl_ignore_s { 131 uint32_t cnt; 132 }; 133 134 struct flm_v25_stat_rel_done_s { 135 uint32_t cnt; 136 }; 137 138 struct flm_v25_stat_rel_ignore_s { 139 uint32_t cnt; 140 }; 141 142 struct flm_v25_stat_aul_done_s { 143 uint32_t cnt; 144 }; 145 146 struct flm_v25_stat_aul_ignore_s { 147 uint32_t cnt; 148 }; 149 150 struct flm_v25_stat_aul_fail_s { 151 uint32_t cnt; 152 }; 153 154 struct flm_v25_stat_tul_done_s { 155 uint32_t cnt; 156 }; 157 158 struct flm_v25_stat_flows_s { 159 uint32_t cnt; 160 }; 161 162 struct flm_v25_stat_prb_done_s { 163 uint32_t cnt; 164 }; 165 166 struct flm_v25_stat_prb_ignore_s { 167 uint32_t cnt; 168 }; 169 170 struct flm_v25_stat_sta_done_s { 171 uint32_t cnt; 172 }; 173 174 struct flm_v25_stat_inf_done_s { 175 uint32_t cnt; 176 }; 177 178 struct flm_v25_stat_inf_skip_s { 179 uint32_t cnt; 180 }; 181 182 struct flm_v25_stat_pck_hit_s { 183 uint32_t cnt; 184 }; 185 186 struct flm_v25_stat_pck_miss_s { 187 uint32_t cnt; 188 }; 189 190 struct flm_v25_stat_pck_unh_s { 191 uint32_t cnt; 192 }; 193 194 struct flm_v25_stat_pck_dis_s { 195 uint32_t cnt; 196 }; 197 198 struct flm_v25_stat_csh_hit_s { 199 uint32_t cnt; 200 }; 201 202 struct flm_v25_stat_csh_miss_s { 203 uint32_t cnt; 204 }; 205 206 struct flm_v25_stat_csh_unh_s { 207 uint32_t cnt; 208 }; 209 210 struct flm_v25_stat_cuc_start_s { 211 uint32_t cnt; 212 }; 213 214 struct flm_v25_stat_cuc_move_s { 215 uint32_t cnt; 216 }; 217 218 struct flm_v25_scan_s { 219 uint32_t i; 220 }; 221 222 struct flm_v25_scrub_s { 223 uint8_t t; 224 uint8_t r; 225 uint8_t del; 226 uint8_t inf; 227 }; 228 229 #pragma pack(1) 230 struct flm_v25_lrn_data_s { 231 uint32_t sw9; /* 31:0 (32) */ 232 uint32_t sw8; /* 63:32 (32) */ 233 uint32_t qw4[4];/* 191:64 (128) */ 234 uint32_t qw0[4];/* 319:192 (128) */ 235 uint8_t prot; /* 327:320 (8) */ 236 uint8_t kid; /* 335:328 (8) */ 237 uint32_t nat_ip;/* 367:336 (32) */ 238 uint32_t teid; /* 399:368 (32) */ 239 uint16_t nat_port; /* 415:400 (16) */ 240 uint16_t rate; /* 431:416 (16) */ 241 uint16_t size; /* 447:432 (16) */ 242 uint32_t color; /* 479:448 (32) */ 243 uint32_t adj; /* 511:480 (32) */ 244 uint32_t id; /* 543:512 (32) */ 245 uint16_t fill; /* 559:544 (16) */ 246 247 /* 248 * Bit fields 249 */ 250 uint64_t ft : 4;/* 563:560 (4) */ 251 uint64_t ft_mbr : 4; /* 567:564 (4) */ 252 uint64_t ft_miss : 4; /* 571:568 (4) */ 253 uint64_t mbr_idx1 : 28; /* 599:572 (28) */ 254 uint64_t mbr_idx2 : 28; /* 627:600 (28) */ 255 uint64_t mbr_idx3 : 28; /* 655:628 (28) */ 256 uint64_t mbr_idx4 : 28; /* 683:656 (28) */ 257 uint64_t vol_idx : 3; /* 686:684 (3) */ 258 uint64_t stat_prof : 4; /* 690:687 (4) */ 259 uint64_t prio : 2; /* 692:691 (2) */ 260 uint64_t ent : 1; /* 693:693 (1) */ 261 uint64_t op : 4;/* 697:694 (4) */ 262 uint64_t dscp : 6; /* 703:698 (6) */ 263 uint64_t qfi : 6; /* 709:704 (6) */ 264 uint64_t rqi : 1; /* 710:710 (1) */ 265 uint64_t nat_en : 1; /* 711:711 (1) */ 266 uint64_t scrub_prof : 4;/* 715:712 (4) */ 267 uint64_t nofi : 1; /* 716:716 (1) */ 268 uint64_t pad : 50; /* 766:717 (50) */ 269 uint64_t eor : 1; /* 767:767 (1) */ 270 }; 271 272 struct flm_v25_inf_data_s { 273 uint64_t bytes; 274 uint64_t packets; 275 uint64_t ts; 276 uint32_t id; 277 uint64_t cause : 3; 278 uint64_t pad : 60; 279 uint64_t eor : 1; 280 }; 281 282 struct flm_v25_sta_data_s { 283 uint32_t id; 284 uint64_t lds : 1; 285 uint64_t lfs : 1; 286 uint64_t lis : 1; 287 uint64_t uds : 1; 288 uint64_t uis : 1; 289 uint64_t rds : 1; 290 uint64_t ris : 1; 291 uint64_t pds : 1; 292 uint64_t pis : 1; 293 uint64_t pad : 54; 294 uint64_t eor : 1; 295 }; 296 #pragma pack() 297 298 struct hw_mod_flm_v25_s { 299 struct flm_v25_control_s *control; 300 struct flm_v25_status_s *status; 301 struct flm_v25_load_bin_s *load_bin; 302 struct flm_v25_load_pps_s *load_pps; 303 struct flm_v25_load_lps_s *load_lps; 304 struct flm_v25_load_aps_s *load_aps; 305 struct flm_v25_prio_s *prio; 306 struct flm_v25_pst_s *pst; 307 struct flm_v25_rcp_s *rcp; 308 struct flm_v25_buf_ctrl_s *buf_ctrl; 309 /* lrn_data is not handled by struct */ 310 /* inf_data is not handled by struct */ 311 /* sta_data is not handled by struct */ 312 struct flm_v25_stat_lrn_done_s *lrn_done; 313 struct flm_v25_stat_lrn_ignore_s *lrn_ignore; 314 struct flm_v25_stat_lrn_fail_s *lrn_fail; 315 struct flm_v25_stat_unl_done_s *unl_done; 316 struct flm_v25_stat_unl_ignore_s *unl_ignore; 317 struct flm_v25_stat_rel_done_s *rel_done; 318 struct flm_v25_stat_rel_ignore_s *rel_ignore; 319 struct flm_v25_stat_aul_done_s *aul_done; 320 struct flm_v25_stat_aul_ignore_s *aul_ignore; 321 struct flm_v25_stat_aul_fail_s *aul_fail; 322 struct flm_v25_stat_tul_done_s *tul_done; 323 struct flm_v25_stat_flows_s *flows; 324 struct flm_v25_stat_prb_done_s *prb_done; 325 struct flm_v25_stat_prb_ignore_s *prb_ignore; 326 struct flm_v25_stat_sta_done_s *sta_done; 327 struct flm_v25_stat_inf_done_s *inf_done; 328 struct flm_v25_stat_inf_skip_s *inf_skip; 329 struct flm_v25_stat_pck_hit_s *pck_hit; 330 struct flm_v25_stat_pck_miss_s *pck_miss; 331 struct flm_v25_stat_pck_unh_s *pck_unh; 332 struct flm_v25_stat_pck_dis_s *pck_dis; 333 struct flm_v25_stat_csh_hit_s *csh_hit; 334 struct flm_v25_stat_csh_miss_s *csh_miss; 335 struct flm_v25_stat_csh_unh_s *csh_unh; 336 struct flm_v25_stat_cuc_start_s *cuc_start; 337 struct flm_v25_stat_cuc_move_s *cuc_move; 338 struct flm_v25_scan_s *scan; 339 struct flm_v25_scrub_s *scrub; 340 }; 341 342 #endif /* _HW_MOD_FLM_V25_H_ */ 343