field.c (153058B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 * 7 * File: field.c 8 * Purpose: BCM56230 Field Processor installation functions. 9 */ 10 11 #include <soc/defs.h> 12 #if defined(BCM_KATANA_SUPPORT) && defined(BCM_FIELD_SUPPORT) 13 #include <shared/bsl.h> 14 15 #include <soc/mem.h> 16 #include <soc/drv.h> 17 18 #include <bcm/error.h> 19 #include <bcm/l3.h> 20 #include <bcm/field.h> 21 #include <bcm/tunnel.h> 22 23 #include <bcm_int/esw_dispatch.h> 24 25 #include <bcm_int/esw/field.h> 26 #include <bcm_int/esw/l3.h> 27 #include <bcm_int/esw/firebolt.h> 28 #include <bcm_int/esw/trx.h> 29 #include <bcm_int/esw/katana.h> 30 #include <bcm_int/esw/triumph.h> 31 #include <bcm_int/esw/triumph2.h> 32 33 34 /* local/static function prototypes */ 35 STATIC void _field_katana_functions_init(_field_funct_t *functions) ; 36 37 /* 38 * Function: 39 * _field_katana_ingress_qualifiers_init 40 * Purpose: 41 * Initialize device stage ingress qaualifiers 42 * select codes & offsets 43 * Parameters: 44 * unit - (IN) BCM device number. 45 * stage_fc - (IN) Field Processor stage control structure. 46 * 47 * Returns: 48 * BCM_E_NONE 49 */ 50 STATIC int 51 _field_katana_ingress_qualifiers_init(int unit, _field_stage_t *stage_fc) 52 { 53 _FP_QUAL_DECL; 54 55 /* Input parameters check. */ 56 if (NULL == stage_fc) { 57 return (BCM_E_PARAM); 58 } 59 60 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyStage, 61 _bcmFieldSliceSelDisable, 0, 0, 0); 62 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyStageIngress, 63 _bcmFieldSliceSelDisable, 0, 0, 0); 64 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp4, 65 _bcmFieldSliceSelDisable, 0, 0, 0); 66 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp6, 67 _bcmFieldSliceSelDisable, 0, 0, 0); 68 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInPort, 69 _bcmFieldSliceSelDisable, 0, 0, 0); 70 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInPorts, 71 _bcmFieldSliceSelDisable, 0, 0, 0); 72 73 74 /* IFP single wide Fixed */ 75 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGig, 76 _bcmFieldSliceSelDisable, 0, 8, 1); 77 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyForwardingType, 78 _bcmFieldSliceSelDisable, 0, 9, 3); 79 _FP_QUAL_ADD(unit, stage_fc, _bcmFieldQualifySvpValid, 80 _bcmFieldSliceSelDisable, 0, 12, 1); 81 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpType, 82 _bcmFieldSliceSelDisable, 0, 13, 4); 83 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports, 84 _bcmFieldSliceSelDisable, 0, 17, 1); 85 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3Routable, 86 _bcmFieldSliceSelDisable, 0, 18, 1); 87 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyLoopback, 88 _bcmFieldSliceSelDisable, 0, 89 _bcmFieldSliceLoopbackTypeSelect, 0, 22, 1); 90 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyLoopbackType, 91 _bcmFieldSliceSelDisable, 0, 92 _bcmFieldSliceLoopbackTypeSelect, 0, 19, 4); 93 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTunnelType, 94 _bcmFieldSliceSelDisable, 0, 95 _bcmFieldSliceLoopbackTypeSelect, 1, 19, 4); 96 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyMplsTerminated, 97 _bcmFieldSliceSelDisable, 0, 98 _bcmFieldSliceLoopbackTypeSelect, 2, 19, 4); 99 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDrop, 100 _bcmFieldSliceSelDisable, 0, 23, 1); 101 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMirrorCopy, 102 _bcmFieldSliceSelDisable, 0, 24, 1); 103 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMyStationHit, 104 _bcmFieldSliceSelDisable, 0, 25, 1); 105 106 /* FPF3 primary slice single wide. 107 * IFP single wide F3_0 */ 108 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL2, 109 _bcmFieldSliceSelFpf3, 0, 110 _bcmFieldSliceDstClassSelect, 0, 26, 6); 111 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL3, 112 _bcmFieldSliceSelFpf3, 0, 113 _bcmFieldSliceDstClassSelect, 1, 26, 6); 114 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField, 115 _bcmFieldSliceSelFpf3, 0, 116 _bcmFieldSliceDstClassSelect, 2, 26, 6); 117 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField, 118 _bcmFieldSliceSelFpf3, 0, 119 _bcmFieldSliceSrcClassSelect, 2, 32, 6); 120 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2, 121 _bcmFieldSliceSelFpf3, 0, 122 _bcmFieldSliceSrcClassSelect, 0, 32, 6); 123 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3, 124 _bcmFieldSliceSelFpf3, 0, 125 _bcmFieldSliceSrcClassSelect, 1, 32, 6); 126 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField, 127 _bcmFieldSliceSelFpf3, 0, 128 _bcmFieldSliceSrcClassSelect, 3, 32, 6); 129 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField, 130 _bcmFieldSliceSelFpf3, 0, 131 _bcmFieldSliceSrcClassSelect, 3, 26, 6); 132 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVrf, 133 _bcmFieldSliceSelFpf3, 0, 134 _bcmFieldSliceFwdFieldSelect, 135 _bcmFieldFwdFieldVrf, 38, 12); 136 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVpn, 137 _bcmFieldSliceSelFpf3, 0, 138 _bcmFieldSliceFwdFieldSelect, 139 _bcmFieldFwdFieldVpn, 38, 12); 140 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 141 bcmFieldQualifyForwardingVlanId, 142 _bcmFieldSliceSelFpf3, 0, 143 _bcmFieldSliceFwdFieldSelect, 144 _bcmFieldFwdFieldVlan, 38, 12); 145 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcMplsGport, 146 _bcmFieldSliceSelFpf3, 0, 147 _bcmFieldSliceIngressEntitySelect, 148 _bcmFieldFwdEntityMplsGport, 50, 13); 149 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcVlanGport, 150 _bcmFieldSliceSelFpf3, 0, 151 _bcmFieldSliceIngressEntitySelect, 152 _bcmFieldFwdEntityVlanGport, 50, 13); 153 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcMimGport, 154 _bcmFieldSliceSelFpf3, 0, 155 _bcmFieldSliceIngressEntitySelect, 156 _bcmFieldFwdEntityMimGport, 50, 13); 157 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyL3Ingress, 158 _bcmFieldSliceSelFpf3, 0, 159 _bcmFieldSliceIngressEntitySelect, 160 _bcmFieldFwdEntityL3Egress, 50, 13); 161 /* IFP single wide F3_1 */ 162 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL2, 163 _bcmFieldSliceSelFpf3, 1, 164 _bcmFieldSliceDstClassSelect, 0, 26, 6); 165 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL3, 166 _bcmFieldSliceSelFpf3, 1, 167 _bcmFieldSliceDstClassSelect, 1, 26, 6); 168 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField, 169 _bcmFieldSliceSelFpf3, 1, 170 _bcmFieldSliceDstClassSelect, 2, 26, 6); 171 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField, 172 _bcmFieldSliceSelFpf3, 1, 173 _bcmFieldSliceSrcClassSelect, 2, 32, 6); 174 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2, 175 _bcmFieldSliceSelFpf3, 1, 176 _bcmFieldSliceSrcClassSelect, 0, 32, 6); 177 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3, 178 _bcmFieldSliceSelFpf3, 1, 179 _bcmFieldSliceSrcClassSelect, 1, 32, 6); 180 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField, 181 _bcmFieldSliceSelFpf3, 1, 182 _bcmFieldSliceSrcClassSelect, 3, 32, 6); 183 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField, 184 _bcmFieldSliceSelFpf3, 1, 185 _bcmFieldSliceSrcClassSelect, 3, 26, 6); 186 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVrf, 187 _bcmFieldSliceSelFpf3, 1, 188 _bcmFieldSliceFwdFieldSelect, 189 _bcmFieldFwdFieldVrf, 38, 12); 190 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVpn, 191 _bcmFieldSliceSelFpf3, 1, 192 _bcmFieldSliceFwdFieldSelect, 193 _bcmFieldFwdFieldVpn, 38, 12); 194 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 195 bcmFieldQualifyForwardingVlanId, 196 _bcmFieldSliceSelFpf3, 1, 197 _bcmFieldSliceFwdFieldSelect, 198 _bcmFieldFwdFieldVlan, 38, 12); 199 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 200 _bcmFieldSliceSelFpf3, 1, 50, 12); 201 202 /* IFP single wide F3_2 */ 203 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstPort, 204 _bcmFieldSliceSelFpf3, 2, 205 _bcmFieldSliceDstFwdEntitySelect, 206 _bcmFieldFwdEntityGlp, 26, 19); 207 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstGport, 208 _bcmFieldSliceSelFpf3, 2, 209 _bcmFieldSliceDstFwdEntitySelect, 210 _bcmFieldFwdEntityCommonGport, 26, 19); 211 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk, 212 _bcmFieldSliceSelFpf3, 2, 213 _bcmFieldSliceDstFwdEntitySelect, 214 _bcmFieldFwdEntityGlp, 26, 19); 215 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMplsGport, 216 _bcmFieldSliceSelFpf3, 2, 217 _bcmFieldSliceDstFwdEntitySelect, 218 _bcmFieldFwdEntityMplsGport, 26, 19); 219 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstVlanGport, 220 _bcmFieldSliceSelFpf3, 2, 221 _bcmFieldSliceDstFwdEntitySelect, 222 _bcmFieldFwdEntityVlanGport, 26, 19); 223 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMimGport, 224 _bcmFieldSliceSelFpf3, 2, 225 _bcmFieldSliceDstFwdEntitySelect, 226 _bcmFieldFwdEntityMimGport, 26, 19); 227 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3Egress, 228 _bcmFieldSliceSelFpf3, 2, 229 _bcmFieldSliceDstFwdEntitySelect, 230 _bcmFieldFwdEntityL3Egress, 26, 19); 231 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3EgressNextHops, 232 _bcmFieldSliceSelFpf3, 2, 233 _bcmFieldSliceDstFwdEntitySelect, 234 _bcmFieldFwdEntityL3Egress, 26, 19); 235 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMulticastGroup, 236 _bcmFieldSliceSelFpf3, 2, 237 _bcmFieldSliceDstFwdEntitySelect, 238 _bcmFieldFwdEntityMulticastGroup, 26, 19); 239 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMultipath, 240 _bcmFieldSliceSelFpf3, 2, 241 _bcmFieldSliceDstFwdEntitySelect, 242 _bcmFieldFwdEntityMultipath, 26, 19); 243 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcPort, 244 _bcmFieldSliceSelFpf3, 2, 245 _bcmFieldSliceSrcEntitySelect, 246 _bcmFieldFwdEntityGlp, 45, 17); 247 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcTrunk, 248 _bcmFieldSliceSelFpf3, 2, 249 _bcmFieldSliceSrcEntitySelect, 250 _bcmFieldFwdEntityGlp, 45, 17); 251 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcMplsGport, 252 _bcmFieldSliceSelFpf3, 2, 253 _bcmFieldSliceSrcEntitySelect, 254 _bcmFieldFwdEntityMplsGport, 45, 17); 255 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcVlanGport, 256 _bcmFieldSliceSelFpf3, 2, 257 _bcmFieldSliceSrcEntitySelect, 258 _bcmFieldFwdEntityVlanGport, 45, 17); 259 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcMimGport, 260 _bcmFieldSliceSelFpf3, 2, 261 _bcmFieldSliceSrcEntitySelect, 262 _bcmFieldFwdEntityMimGport, 45, 17); 263 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcModPortGport, 264 _bcmFieldSliceSelFpf3, 2, 265 _bcmFieldSliceSrcEntitySelect, 266 _bcmFieldFwdEntityModPortGport, 45, 17); 267 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcTrunkMemberGport, 268 _bcmFieldSliceSelFpf3, 2, 269 _bcmFieldSliceSrcEntitySelect, 270 _bcmFieldFwdEntityModPortGport, 45, 17); 271 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcModuleGport, 272 _bcmFieldSliceSelFpf3, 2, 273 _bcmFieldSliceSrcEntitySelect, 274 _bcmFieldFwdEntityModPortGport, 52, 10); 275 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTrunkMemberSourceModuleId, 276 _bcmFieldSliceSelFpf3, 2, 277 _bcmFieldSliceSrcEntitySelect, 278 _bcmFieldFwdEntityModPortGport, 52, 8); 279 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcGport, 280 _bcmFieldSliceSelFpf3, 2, 281 _bcmFieldSliceSrcEntitySelect, 282 _bcmFieldFwdEntityCommonGport, 45, 17); 283 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcVirtualPortValid, 284 _bcmFieldSliceSelFpf3, 2, 61, 1); 285 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMHOpcode, 286 _bcmFieldSliceSelFpf3, 2, 62, 3); 287 288 /* IFP single wide F3_3 */ 289 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 290 _bcmFieldSliceSelFpf3, 3, 26, 16); 291 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 292 _bcmFieldSliceSelFpf3, 3, 26, 12); 293 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 294 _bcmFieldSliceSelFpf3, 3, 38, 1); 295 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 296 _bcmFieldSliceSelFpf3, 3, 39, 3); 297 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat, 298 _bcmFieldSliceSelFpf3, 3, 42, 2); 299 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2Format, 300 _bcmFieldSliceSelFpf3, 3, 44, 2); 301 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTranslatedVlanFormat, 302 _bcmFieldSliceSelFpf3, 3, 46, 2); 303 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMHOpcode, 304 _bcmFieldSliceSelFpf3, 3, 48, 3); 305 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyPacketRes, 306 _bcmFieldSliceSelFpf3, 3, 51, 5); 307 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpInfo, 308 _bcmFieldSliceSelFpf3, 3, 56, 3); 309 310 /* IFP single wide F3_4 */ 311 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 312 _bcmFieldSliceSelFpf3, 4, 26, 16); 313 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 314 _bcmFieldSliceSelFpf3, 4, 26, 12); 315 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 316 _bcmFieldSliceSelFpf3, 4, 38, 1); 317 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 318 _bcmFieldSliceSelFpf3, 4, 39, 3); 319 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlan, 320 _bcmFieldSliceSelFpf3, 4, 42, 16); 321 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId, 322 _bcmFieldSliceSelFpf3, 4, 42, 12); 323 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi, 324 _bcmFieldSliceSelFpf3, 4, 54, 1); 325 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri, 326 _bcmFieldSliceSelFpf3, 4, 55, 3); 327 328 /* IFP single wide F3_5 */ 329 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 330 _bcmFieldSliceSelFpf3, 5, 26, 16); 331 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 332 _bcmFieldSliceSelFpf3, 5, 26, 12); 333 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 334 _bcmFieldSliceSelFpf3, 5, 38, 1); 335 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 336 _bcmFieldSliceSelFpf3, 5, 39, 3); 337 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType, 338 _bcmFieldSliceSelFpf3, 5, 42, 16); 339 340 /* IFP single wide F3_6 */ 341 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMplsTerminated, 342 _bcmFieldSliceSelFpf3, 6, 26, 1); 343 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanTranslationHit, 344 _bcmFieldSliceSelFpf3, 6, 27, 1); 345 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyForwardingVlanValid, 346 _bcmFieldSliceSelFpf3, 6, 28, 1); 347 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIngressStpState, 348 _bcmFieldSliceSelFpf3, 6, 29, 2); 349 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2SrcHit, 350 _bcmFieldSliceSelFpf3, 6, 31, 1); 351 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2SrcStatic, 352 _bcmFieldSliceSelFpf3, 6, 32, 1); 353 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2DestHit, 354 _bcmFieldSliceSelFpf3, 6, 33, 1); 355 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2CacheHit, 356 _bcmFieldSliceSelFpf3, 6, 35, 1); 357 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3SrcHostHit, 358 _bcmFieldSliceSelFpf3, 6, 36, 1); 359 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3DestHostHit, 360 _bcmFieldSliceSelFpf3, 6, 37, 1); 361 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpmcStarGroupHit, 362 _bcmFieldSliceSelFpf3, 6, 38, 1); 363 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3DestRouteHit, 364 _bcmFieldSliceSelFpf3, 6, 39, 1); 365 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2StationMove, 366 _bcmFieldSliceSelFpf3, 6, 40, 1); 367 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDosAttack, 368 _bcmFieldSliceSelFpf3, 6, 41, 1); 369 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlan, 370 _bcmFieldSliceSelFpf3, 6, 42, 16); 371 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId, 372 _bcmFieldSliceSelFpf3, 6, 42, 12); 373 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi, 374 _bcmFieldSliceSelFpf3, 6, 54, 1); 375 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri, 376 _bcmFieldSliceSelFpf3, 6, 55, 3); 377 378 /* IFP single wide F3_7 */ 379 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyRangeCheck, 380 _bcmFieldSliceSelFpf3, 7, 26, 24); 381 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, _bcmFieldQualifyRangeCheckBits24_31, 382 _bcmFieldSliceSelFpf3, 7, 383 _bcmFieldSliceIntfClassSelect, 3, 50, 8); 384 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort, 385 _bcmFieldSliceSelFpf3, 7, 386 _bcmFieldSliceIntfClassSelect, 0, 50, 8); 387 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassL3, 388 _bcmFieldSliceSelFpf3, 7, 389 _bcmFieldSliceIntfClassSelect, 1, 50, 8); 390 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassL2, 391 _bcmFieldSliceSelFpf3, 7, 392 _bcmFieldSliceIntfClassSelect, 2, 50, 8); 393 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp6FlowLabel, 394 _bcmFieldSliceSelFpf3, 8, 26, 20); 395 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat, 396 _bcmFieldSliceSelFpf3, 8, 46, 2); 397 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2Format, 398 _bcmFieldSliceSelFpf3, 8, 48, 2); 399 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTranslatedVlanFormat, 400 _bcmFieldSliceSelFpf3, 8, 50, 2); 401 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerTpid, 402 _bcmFieldSliceSelFpf3, 8, 52, 2); 403 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterTpid, 404 _bcmFieldSliceSelFpf3, 8, 54, 2); 405 /* IFP single wide F3_9 */ 406 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMplsOuterLabelPop, 407 _bcmFieldSliceSelFpf3, 9, 58, 1); 408 _FP_QUAL_ADD(unit, stage_fc, 409 bcmFieldQualifyMplsStationHitTunnelUnterminated, 410 _bcmFieldSliceSelFpf3, 9, 59, 1); 411 _FP_QUAL_ADD(unit, stage_fc, _bcmFieldQualifyData3, 412 _bcmFieldSliceSelFpf3, 9, 26, 32); 413 /* IFP single wide F3_10 */ 414 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstPort, 415 _bcmFieldSliceSelFpf3, 10, 416 _bcmFieldSliceDstFwdEntitySelect, 417 _bcmFieldFwdEntityGlp, 26, 19); 418 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstGport, 419 _bcmFieldSliceSelFpf3, 10, 420 _bcmFieldSliceDstFwdEntitySelect, 421 _bcmFieldFwdEntityCommonGport, 26, 19); 422 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk, 423 _bcmFieldSliceSelFpf3, 10, 424 _bcmFieldSliceDstFwdEntitySelect, 425 _bcmFieldFwdEntityGlp, 26, 19); 426 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMplsGport, 427 _bcmFieldSliceSelFpf3, 10, 428 _bcmFieldSliceDstFwdEntitySelect, 429 _bcmFieldFwdEntityMplsGport, 26, 19); 430 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstVlanGport, 431 _bcmFieldSliceSelFpf3, 10, 432 _bcmFieldSliceDstFwdEntitySelect, 433 _bcmFieldFwdEntityVlanGport, 26, 19); 434 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMimGport, 435 _bcmFieldSliceSelFpf3, 10, 436 _bcmFieldSliceDstFwdEntitySelect, 437 _bcmFieldFwdEntityMimGport, 26, 19); 438 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3Egress, 439 _bcmFieldSliceSelFpf3, 10, 440 _bcmFieldSliceDstFwdEntitySelect, 441 _bcmFieldFwdEntityL3Egress, 26, 19); 442 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3EgressNextHops, 443 _bcmFieldSliceSelFpf3, 10, 444 _bcmFieldSliceDstFwdEntitySelect, 445 _bcmFieldFwdEntityL3Egress, 26, 19); 446 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMulticastGroup, 447 _bcmFieldSliceSelFpf3, 10, 448 _bcmFieldSliceDstFwdEntitySelect, 449 _bcmFieldFwdEntityMulticastGroup, 26, 19); 450 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMultipath, 451 _bcmFieldSliceSelFpf3, 10, 452 _bcmFieldSliceDstFwdEntitySelect, 453 _bcmFieldFwdEntityMultipath, 26, 19); 454 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstPort, 455 _bcmFieldSliceSelFpf3, 10, 45, 16); 456 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk, 457 _bcmFieldSliceSelFpf3, 10, 45, 16); 458 /* IFP single wide F3_11 */ 459 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcTrunk, 460 _bcmFieldSliceSelFpf3, 11, 26, 16); 461 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcModPortGport, 462 _bcmFieldSliceSelFpf3, 11, 26, 16); 463 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcModuleGport, 464 _bcmFieldSliceSelFpf3, 11, 33, 9); 465 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMplsGport, 466 _bcmFieldSliceSelFpf3, 11, 42, 14); 467 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcVlanGport, 468 _bcmFieldSliceSelFpf3, 11, 42, 14); 469 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMimGport, 470 _bcmFieldSliceSelFpf3, 11, 42, 14); 471 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcVirtualPortValid, 472 _bcmFieldSliceSelFpf3, 11, 56, 1); 473 474 /* IFP single wide F3_12 */ 475 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVnTag, 476 _bcmFieldSliceSelFpf3, 12, 477 _bcmFieldSliceAuxTag2Select, 478 _bcmFieldAuxTagVn, 26, 33); 479 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyCnTag, 480 _bcmFieldSliceSelFpf3, 12, 481 _bcmFieldSliceAuxTag2Select, 482 _bcmFieldAuxTagCn, 26, 33); 483 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyFabricQueueTag, 484 _bcmFieldSliceSelFpf3, 12, 485 _bcmFieldSliceAuxTag2Select, 486 _bcmFieldAuxTagFabricQueue, 26, 33); 487 488 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTos, 489 _bcmFieldSliceSelFpf3, 13, 490 _bcmFieldSliceTosClassSelect, 0, 491 26, 8); 492 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassZero, 493 _bcmFieldSliceSelFpf3, 13, 494 _bcmFieldSliceTosClassSelect, 0, 495 26, 8); 496 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassOne, 497 _bcmFieldSliceSelFpf3, 13, 498 _bcmFieldSliceTosClassSelect, 1, 499 26, 8); 500 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeader2Type, 501 _bcmFieldSliceSelFpf3, 13, 34, 8); 502 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderSubCode, 503 _bcmFieldSliceSelFpf3, 13, 42, 8); 504 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderType, 505 _bcmFieldSliceSelFpf3, 13, 50, 8); 506 507 /* IFP single wide F2_0 */ 508 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtl, 509 _bcmFieldSliceSelFpf2, 0, 510 _bcmFieldSliceTtlClassSelect, 0, 511 65, 8); 512 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassZero, 513 _bcmFieldSliceSelFpf2, 0, 514 _bcmFieldSliceTtlClassSelect, 0, 515 65, 8); 516 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassOne, 517 _bcmFieldSliceSelFpf2, 0, 518 _bcmFieldSliceTtlClassSelect, 1, 519 65, 8); 520 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl, 521 _bcmFieldSliceSelFpf2, 0, 522 _bcmFieldSliceTcpClassSelect, 0, 523 73, 6); 524 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpClassZero, 525 _bcmFieldSliceSelFpf2, 0, 526 _bcmFieldSliceTcpClassSelect, 0, 527 73, 6); 528 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpClassOne, 529 _bcmFieldSliceSelFpf2, 0, 530 _bcmFieldSliceTcpClassSelect, 1, 531 73, 6); 532 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpFlags, 533 _bcmFieldSliceSelFpf2, 0, 79, 2); 534 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTos, 535 _bcmFieldSliceSelFpf2, 0, 536 _bcmFieldSliceTosClassSelect, 0, 537 81, 8); 538 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassZero, 539 _bcmFieldSliceSelFpf2, 0, 540 _bcmFieldSliceTosClassSelect, 0, 541 81, 8); 542 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassOne, 543 _bcmFieldSliceSelFpf2, 0, 544 _bcmFieldSliceTosClassSelect, 1, 545 81, 8); 546 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort, 547 _bcmFieldSliceSelFpf2, 0, 89, 16); 548 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort, 549 _bcmFieldSliceSelFpf2, 0, 105, 16); 550 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIcmpTypeCode, 551 _bcmFieldSliceSelFpf2, 0, 105, 16); 552 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 553 _bcmFieldSliceSelFpf2, 0, 121, 8); 554 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp, 555 _bcmFieldSliceSelFpf2, 0, 129, 32); 556 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp, 557 _bcmFieldSliceSelFpf2, 0, 161, 32); 558 559 /* IFP single wide F2_1 */ 560 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtl, 561 _bcmFieldSliceSelFpf2, 1, 562 _bcmFieldSliceTtlClassSelect, 0, 563 65, 8); 564 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassZero, 565 _bcmFieldSliceSelFpf2, 1, 566 _bcmFieldSliceTtlClassSelect, 0, 567 65, 8); 568 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassOne, 569 _bcmFieldSliceSelFpf2, 1, 570 _bcmFieldSliceTtlClassSelect, 1, 571 65, 8); 572 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl, 573 _bcmFieldSliceSelFpf2, 1, 574 _bcmFieldSliceTcpClassSelect, 0, 575 73, 6); 576 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpClassZero, 577 _bcmFieldSliceSelFpf2, 1, 578 _bcmFieldSliceTcpClassSelect, 0, 579 73, 6); 580 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpClassOne, 581 _bcmFieldSliceSelFpf2, 1, 582 _bcmFieldSliceTcpClassSelect, 1, 583 73, 6); 584 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpFrag, 585 _bcmFieldSliceSelFpf2, 1, 79, 2); 586 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTos, 587 _bcmFieldSliceSelFpf2, 1, 588 _bcmFieldSliceTosClassSelect, 0, 589 81, 8); 590 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassZero, 591 _bcmFieldSliceSelFpf2, 1, 592 _bcmFieldSliceTosClassSelect, 0, 593 81, 8); 594 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassOne, 595 _bcmFieldSliceSelFpf2, 1, 596 _bcmFieldSliceTosClassSelect, 1, 597 81, 8); 598 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort, 599 _bcmFieldSliceSelFpf2, 1, 89, 16); 600 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort, 601 _bcmFieldSliceSelFpf2, 1, 105, 16); 602 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIcmpTypeCode, 603 _bcmFieldSliceSelFpf2, 1, 105, 16); 604 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 605 _bcmFieldSliceSelFpf2, 1, 121, 8); 606 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp, 607 _bcmFieldSliceSelFpf2, 1, 129, 32); 608 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp, 609 _bcmFieldSliceSelFpf2, 1, 161, 32); 610 /* IFP single wide F2_2 */ 611 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp6, 612 _bcmFieldSliceSelFpf2, 2, 65, 128); 613 /* IFP single wide F2_3 */ 614 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6, 615 _bcmFieldSliceSelFpf2, 3, 65, 128); 616 /* IFP single wide F2_4 */ 617 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtl, 618 _bcmFieldSliceSelFpf2, 4, 619 _bcmFieldSliceTtlClassSelect, 0, 620 65, 8); 621 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassZero, 622 _bcmFieldSliceSelFpf2, 4, 623 _bcmFieldSliceTtlClassSelect, 0, 624 65, 8); 625 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassOne, 626 _bcmFieldSliceSelFpf2, 4, 627 _bcmFieldSliceTtlClassSelect, 1, 628 65, 8); 629 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl, 630 _bcmFieldSliceSelFpf2, 4, 631 _bcmFieldSliceTcpClassSelect, 0, 632 73, 6); 633 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpClassZero, 634 _bcmFieldSliceSelFpf2, 4, 635 _bcmFieldSliceTcpClassSelect, 0, 636 73, 6); 637 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpClassOne, 638 _bcmFieldSliceSelFpf2, 4, 639 _bcmFieldSliceTcpClassSelect, 1, 640 73, 6); 641 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp6FlowLabel, 642 _bcmFieldSliceSelFpf2, 4, 79, 20); 643 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTos, 644 _bcmFieldSliceSelFpf2, 4, 645 _bcmFieldSliceTosClassSelect, 0, 646 99, 8); 647 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassZero, 648 _bcmFieldSliceSelFpf2, 4, 649 _bcmFieldSliceTosClassSelect, 0, 650 99, 8); 651 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassOne, 652 _bcmFieldSliceSelFpf2, 4, 653 _bcmFieldSliceTosClassSelect, 1, 654 99, 8); 655 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 656 _bcmFieldSliceSelFpf2, 4, 107, 8); 657 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6High, 658 _bcmFieldSliceSelFpf2, 4, 129, 64); 659 /* IFP single wide F2_5 */ 660 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 661 _bcmFieldSliceSelFpf2, 5, 65, 16); 662 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 663 _bcmFieldSliceSelFpf2, 5, 65, 12); 664 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 665 _bcmFieldSliceSelFpf2, 5, 77, 1); 666 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 667 _bcmFieldSliceSelFpf2, 5, 78, 3); 668 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType, 669 _bcmFieldSliceSelFpf2, 5, 81,16); 670 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMac, 671 _bcmFieldSliceSelFpf2, 5, 97, 48); 672 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMac, 673 _bcmFieldSliceSelFpf2, 5, 145, 48); 674 /* IFP single wide F2_6 */ 675 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 676 _bcmFieldSliceSelFpf2, 6, 65, 16); 677 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 678 _bcmFieldSliceSelFpf2, 6, 65, 12); 679 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 680 _bcmFieldSliceSelFpf2, 6, 77, 1); 681 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 682 _bcmFieldSliceSelFpf2, 6, 78, 3); 683 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType, 684 _bcmFieldSliceSelFpf2, 6, 81, 16); 685 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMac, 686 _bcmFieldSliceSelFpf2, 6, 97, 48); 687 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp, 688 _bcmFieldSliceSelFpf2, 6, 145, 32); 689 /* IFP single wide F2_7 */ 690 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 691 _bcmFieldSliceSelFpf2, 7, 65, 16); 692 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 693 _bcmFieldSliceSelFpf2, 7, 65, 12); 694 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 695 _bcmFieldSliceSelFpf2, 7, 77, 1); 696 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 697 _bcmFieldSliceSelFpf2, 7, 78, 3); 698 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType, 699 _bcmFieldSliceSelFpf2, 7, 81, 16); 700 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtl, 701 _bcmFieldSliceSelFpf2, 7, 702 _bcmFieldSliceTtlClassSelect, 0, 703 97, 8); 704 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassZero, 705 _bcmFieldSliceSelFpf2, 7, 706 _bcmFieldSliceTtlClassSelect, 0, 707 97, 8); 708 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassOne, 709 _bcmFieldSliceSelFpf2, 7, 710 _bcmFieldSliceTtlClassSelect, 1, 711 97, 8); 712 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 713 _bcmFieldSliceSelFpf2, 7, 105, 8); 714 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp, 715 _bcmFieldSliceSelFpf2, 7, 113, 32); 716 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMac, 717 _bcmFieldSliceSelFpf2, 7, 145, 48); 718 /* IFP single wide F2_8 */ 719 _FP_QUAL_ADD(unit, stage_fc, _bcmFieldQualifyData0, 720 _bcmFieldSliceSelFpf2, 8, 65, 128); 721 /* IFP single wide F2_9 */ 722 _FP_QUAL_ADD(unit, stage_fc, _bcmFieldQualifyData1, 723 _bcmFieldSliceSelFpf2, 9, 65, 128); 724 /* IFP single wide F2_10 */ 725 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp6High, 726 _bcmFieldSliceSelFpf2, 10, 65, 64); 727 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6High, 728 _bcmFieldSliceSelFpf2, 10, 129, 64); 729 /* IFP single wide F2_11 */ 730 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMac, 731 _bcmFieldSliceSelFpf2, 11, 97, 48); 732 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMac, 733 _bcmFieldSliceSelFpf2, 11, 145, 48); 734 /* IFP single wide F1_0 */ 735 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL2, 736 _bcmFieldSliceSelFpf1, 0, 737 _bcmFieldSliceDstClassSelect, 0, 193, 6); 738 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL3, 739 _bcmFieldSliceSelFpf1, 0, 740 _bcmFieldSliceDstClassSelect, 1, 193, 6); 741 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField, 742 _bcmFieldSliceSelFpf1, 0, 743 _bcmFieldSliceDstClassSelect, 2, 193, 6); 744 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField, 745 _bcmFieldSliceSelFpf1, 0, 746 _bcmFieldSliceSrcClassSelect, 2, 199, 6); 747 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2, 748 _bcmFieldSliceSelFpf1, 0, 749 _bcmFieldSliceSrcClassSelect, 0, 199, 6); 750 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3, 751 _bcmFieldSliceSelFpf1, 0, 752 _bcmFieldSliceSrcClassSelect, 1, 199, 6); 753 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField, 754 _bcmFieldSliceSelFpf1, 0, 755 _bcmFieldSliceSrcClassSelect, 3, 199, 6); 756 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField, 757 _bcmFieldSliceSelFpf1, 0, 758 _bcmFieldSliceSrcClassSelect, 3, 193, 6); 759 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVrf, 760 _bcmFieldSliceSelFpf1, 0, 761 _bcmFieldSliceFwdFieldSelect, 762 _bcmFieldFwdFieldVrf, 205, 12); 763 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVpn, 764 _bcmFieldSliceSelFpf1, 0, 765 _bcmFieldSliceFwdFieldSelect, 766 _bcmFieldFwdFieldVpn, 205, 12); 767 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 768 bcmFieldQualifyForwardingVlanId, 769 _bcmFieldSliceSelFpf1, 0, 770 _bcmFieldSliceFwdFieldSelect, 771 _bcmFieldFwdFieldVlan, 205, 12); 772 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcMplsGport, 773 _bcmFieldSliceSelFpf1, 0, 774 _bcmFieldSliceIngressEntitySelect, 775 _bcmFieldFwdEntityMplsGport, 217, 13); 776 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcVlanGport, 777 _bcmFieldSliceSelFpf1, 0, 778 _bcmFieldSliceIngressEntitySelect, 779 _bcmFieldFwdEntityVlanGport, 217, 13); 780 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcMimGport, 781 _bcmFieldSliceSelFpf1, 0, 782 _bcmFieldSliceIngressEntitySelect, 783 _bcmFieldFwdEntityMimGport, 217, 13); 784 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyL3Ingress, 785 _bcmFieldSliceSelFpf1, 0, 786 _bcmFieldSliceIngressEntitySelect, 787 _bcmFieldFwdEntityL3Egress, 217, 13); 788 /* IFP single wide F1_1 */ 789 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstPort, 790 _bcmFieldSliceSelFpf1, 1, 791 _bcmFieldSliceDstFwdEntitySelect, 792 _bcmFieldFwdEntityGlp, 193, 19); 793 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstGport, 794 _bcmFieldSliceSelFpf1, 1, 795 _bcmFieldSliceDstFwdEntitySelect, 796 _bcmFieldFwdEntityCommonGport, 193, 19); 797 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk, 798 _bcmFieldSliceSelFpf1, 1, 799 _bcmFieldSliceDstFwdEntitySelect, 800 _bcmFieldFwdEntityGlp, 193, 19); 801 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMplsGport, 802 _bcmFieldSliceSelFpf1, 1, 803 _bcmFieldSliceDstFwdEntitySelect, 804 _bcmFieldFwdEntityMplsGport, 193, 19); 805 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstVlanGport, 806 _bcmFieldSliceSelFpf1, 1, 807 _bcmFieldSliceDstFwdEntitySelect, 808 _bcmFieldFwdEntityVlanGport, 193, 19); 809 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMimGport, 810 _bcmFieldSliceSelFpf1, 1, 811 _bcmFieldSliceDstFwdEntitySelect, 812 _bcmFieldFwdEntityMimGport, 193, 19); 813 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3Egress, 814 _bcmFieldSliceSelFpf1, 1, 815 _bcmFieldSliceDstFwdEntitySelect, 816 _bcmFieldFwdEntityL3Egress, 193, 19); 817 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3EgressNextHops, 818 _bcmFieldSliceSelFpf1, 1, 819 _bcmFieldSliceDstFwdEntitySelect, 820 _bcmFieldFwdEntityL3Egress, 193, 19); 821 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMulticastGroup, 822 _bcmFieldSliceSelFpf1, 1, 823 _bcmFieldSliceDstFwdEntitySelect, 824 _bcmFieldFwdEntityMulticastGroup, 193, 19); 825 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMultipath, 826 _bcmFieldSliceSelFpf1, 1, 827 _bcmFieldSliceDstFwdEntitySelect, 828 _bcmFieldFwdEntityMultipath, 93, 19); 829 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcPort, 830 _bcmFieldSliceSelFpf1, 1, 831 _bcmFieldSliceSrcEntitySelect, 832 _bcmFieldFwdEntityGlp, 212, 17); 833 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcTrunk, 834 _bcmFieldSliceSelFpf1, 1, 835 _bcmFieldSliceSrcEntitySelect, 836 _bcmFieldFwdEntityGlp, 212, 17); 837 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcMplsGport, 838 _bcmFieldSliceSelFpf1, 1, 839 _bcmFieldSliceSrcEntitySelect, 840 _bcmFieldFwdEntityMplsGport, 212, 17); 841 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcVlanGport, 842 _bcmFieldSliceSelFpf1, 1, 843 _bcmFieldSliceSrcEntitySelect, 844 _bcmFieldFwdEntityVlanGport, 212, 17); 845 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcMimGport, 846 _bcmFieldSliceSelFpf1, 1, 847 _bcmFieldSliceSrcEntitySelect, 848 _bcmFieldFwdEntityMimGport, 212, 17); 849 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcModPortGport, 850 _bcmFieldSliceSelFpf1, 1, 851 _bcmFieldSliceSrcEntitySelect, 852 _bcmFieldFwdEntityModPortGport, 212, 17); 853 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcTrunkMemberGport, 854 _bcmFieldSliceSelFpf1, 1, 855 _bcmFieldSliceSrcEntitySelect, 856 _bcmFieldFwdEntityModPortGport, 212, 17); 857 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcModuleGport, 858 _bcmFieldSliceSelFpf1, 1, 859 _bcmFieldSliceSrcEntitySelect, 860 _bcmFieldFwdEntityModPortGport, 219, 10); 861 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTrunkMemberSourceModuleId, 862 _bcmFieldSliceSelFpf1, 1, 863 _bcmFieldSliceSrcEntitySelect, 864 _bcmFieldFwdEntityModPortGport, 219, 8); 865 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcGport, 866 _bcmFieldSliceSelFpf1, 1, 867 _bcmFieldSliceSrcEntitySelect, 868 _bcmFieldFwdEntityCommonGport, 212, 17); 869 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcVirtualPortValid, 870 _bcmFieldSliceSelFpf1, 1, 228, 1); 871 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMHOpcode, 872 _bcmFieldSliceSelFpf1, 1, 229, 3); 873 874 /* IFP single wide F1_2 */ 875 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstPort, 876 _bcmFieldSliceSelFpf1, 2, 877 _bcmFieldSliceDstFwdEntitySelect, 878 _bcmFieldFwdEntityGlp, 193, 19); 879 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstGport, 880 _bcmFieldSliceSelFpf1, 2, 881 _bcmFieldSliceDstFwdEntitySelect, 882 _bcmFieldFwdEntityCommonGport, 193, 19); 883 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk, 884 _bcmFieldSliceSelFpf1, 2, 885 _bcmFieldSliceDstFwdEntitySelect, 886 _bcmFieldFwdEntityGlp, 193, 19); 887 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMplsGport, 888 _bcmFieldSliceSelFpf1, 2, 889 _bcmFieldSliceDstFwdEntitySelect, 890 _bcmFieldFwdEntityMplsGport, 193, 19); 891 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstVlanGport, 892 _bcmFieldSliceSelFpf1, 2, 893 _bcmFieldSliceDstFwdEntitySelect, 894 _bcmFieldFwdEntityVlanGport, 193, 19); 895 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMimGport, 896 _bcmFieldSliceSelFpf1, 2, 897 _bcmFieldSliceDstFwdEntitySelect, 898 _bcmFieldFwdEntityMimGport, 193, 19); 899 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3Egress, 900 _bcmFieldSliceSelFpf1, 2, 901 _bcmFieldSliceDstFwdEntitySelect, 902 _bcmFieldFwdEntityL3Egress, 193, 19); 903 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3EgressNextHops, 904 _bcmFieldSliceSelFpf1, 2, 905 _bcmFieldSliceDstFwdEntitySelect, 906 _bcmFieldFwdEntityL3Egress, 193, 19); 907 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMulticastGroup, 908 _bcmFieldSliceSelFpf1, 2, 909 _bcmFieldSliceDstFwdEntitySelect, 910 _bcmFieldFwdEntityMulticastGroup, 193, 19); 911 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMultipath, 912 _bcmFieldSliceSelFpf1, 2, 913 _bcmFieldSliceDstFwdEntitySelect, 914 _bcmFieldFwdEntityMultipath, 193, 19); 915 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMHOpcode, 916 _bcmFieldSliceSelFpf1, 2, 212, 3); 917 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL2, 918 _bcmFieldSliceSelFpf1, 2, 919 _bcmFieldSliceDstClassSelect, 0, 215, 6); 920 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL3, 921 _bcmFieldSliceSelFpf1, 2, 922 _bcmFieldSliceDstClassSelect, 1, 215, 6); 923 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField, 924 _bcmFieldSliceSelFpf1, 2, 925 _bcmFieldSliceDstClassSelect, 2, 215, 6); 926 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField, 927 _bcmFieldSliceSelFpf1, 2, 928 _bcmFieldSliceSrcClassSelect, 2, 221, 6); 929 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2, 930 _bcmFieldSliceSelFpf1, 2, 931 _bcmFieldSliceSrcClassSelect, 0, 221, 6); 932 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3, 933 _bcmFieldSliceSelFpf1, 2, 934 _bcmFieldSliceSrcClassSelect, 1, 221, 6); 935 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField, 936 _bcmFieldSliceSelFpf1, 2, 937 _bcmFieldSliceSrcClassSelect, 3, 221, 6); 938 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField, 939 _bcmFieldSliceSelFpf1, 2, 940 _bcmFieldSliceSrcClassSelect, 3, 215, 6); 941 942 /* IFP single wide F1_3 */ 943 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 944 _bcmFieldSliceSelFpf1, 3, 193, 16); 945 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 946 _bcmFieldSliceSelFpf1, 3, 193, 12); 947 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 948 _bcmFieldSliceSelFpf1, 3, 205, 1); 949 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 950 _bcmFieldSliceSelFpf1, 3, 206, 3); 951 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlan, 952 _bcmFieldSliceSelFpf1, 3, 209, 16); 953 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId, 954 _bcmFieldSliceSelFpf1, 3, 209, 12); 955 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi, 956 _bcmFieldSliceSelFpf1, 3, 221, 1); 957 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri, 958 _bcmFieldSliceSelFpf1, 3, 222, 3); 959 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterTpid, 960 _bcmFieldSliceSelFpf1, 3, 225, 2); 961 962 /* IFP single wide F1_4 */ 963 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 964 _bcmFieldSliceSelFpf1, 4, 193, 16); 965 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 966 _bcmFieldSliceSelFpf1, 4, 193, 12); 967 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 968 _bcmFieldSliceSelFpf1, 4, 205, 1); 969 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 970 _bcmFieldSliceSelFpf1, 4, 206, 3); 971 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType, 972 _bcmFieldSliceSelFpf1, 4, 209, 16); 973 974 /* IFP single wide F1_5 */ 975 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMplsTerminated, 976 _bcmFieldSliceSelFpf1, 5, 193, 1); 977 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanTranslationHit, 978 _bcmFieldSliceSelFpf1, 5, 194, 1); 979 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyForwardingVlanValid, 980 _bcmFieldSliceSelFpf1, 5, 195, 1); 981 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIngressStpState, 982 _bcmFieldSliceSelFpf1, 5, 196, 2); 983 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2SrcHit, 984 _bcmFieldSliceSelFpf1, 5, 198, 1); 985 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2SrcStatic, 986 _bcmFieldSliceSelFpf1, 5, 199, 1); 987 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2DestHit, 988 _bcmFieldSliceSelFpf1, 5, 200, 1); 989 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2CacheHit, 990 _bcmFieldSliceSelFpf1, 5, 202, 1); 991 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3SrcHostHit, 992 _bcmFieldSliceSelFpf1, 5, 202, 1); 993 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3DestHostHit, 994 _bcmFieldSliceSelFpf1, 5, 204, 1); 995 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpmcStarGroupHit, 996 _bcmFieldSliceSelFpf1, 5, 205, 1); 997 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3DestRouteHit, 998 _bcmFieldSliceSelFpf1, 5, 206, 1); 999 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2StationMove, 1000 _bcmFieldSliceSelFpf1, 5, 207, 1); 1001 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDosAttack, 1002 _bcmFieldSliceSelFpf1, 5, 208, 1); 1003 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlan, 1004 _bcmFieldSliceSelFpf1, 5, 209, 16); 1005 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId, 1006 _bcmFieldSliceSelFpf1, 5, 209, 12); 1007 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi, 1008 _bcmFieldSliceSelFpf1, 5, 221, 1); 1009 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri, 1010 _bcmFieldSliceSelFpf1, 5, 222, 3); 1011 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerTpid, 1012 _bcmFieldSliceSelFpf1, 5, 225, 2); 1013 1014 /* IFP single wide F1_6 */ 1015 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 1016 _bcmFieldSliceSelFpf1, 6, 193, 16); 1017 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 1018 _bcmFieldSliceSelFpf1, 6, 193, 12); 1019 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 1020 _bcmFieldSliceSelFpf1, 6, 205, 1); 1021 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 1022 _bcmFieldSliceSelFpf1, 6, 206, 3); 1023 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat, 1024 _bcmFieldSliceSelFpf1, 6, 209, 2); 1025 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2Format, 1026 _bcmFieldSliceSelFpf1, 6, 211, 2); 1027 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTranslatedVlanFormat, 1028 _bcmFieldSliceSelFpf1, 6, 213, 2); 1029 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMHOpcode, 1030 _bcmFieldSliceSelFpf1, 6, 215, 3); 1031 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyPacketRes, 1032 _bcmFieldSliceSelFpf1, 6, 218, 5); 1033 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpInfo, 1034 _bcmFieldSliceSelFpf1, 6, 223, 3); 1035 1036 /* IFP single wide F1_7 */ 1037 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 1038 _bcmFieldSliceSelFpf1, 7, 193, 16); 1039 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 1040 _bcmFieldSliceSelFpf1, 7, 193, 12); 1041 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 1042 _bcmFieldSliceSelFpf1, 7, 205, 1); 1043 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 1044 _bcmFieldSliceSelFpf1, 7, 206, 3); 1045 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2, 1046 _bcmFieldSliceSelFpf1, 7, 1047 _bcmFieldSliceSrcClassSelect, 0, 209, 6); 1048 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3, 1049 _bcmFieldSliceSelFpf1, 7, 1050 _bcmFieldSliceSrcClassSelect, 1, 209, 6); 1051 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField, 1052 _bcmFieldSliceSelFpf1, 7, 1053 _bcmFieldSliceSrcClassSelect, 3, 209, 6); 1054 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField, 1055 _bcmFieldSliceSelFpf1, 7, 1056 _bcmFieldSliceSrcClassSelect, 2, 209, 6); 1057 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVrf, 1058 _bcmFieldSliceSelFpf1, 7, 1059 _bcmFieldSliceFwdFieldSelect, 1060 _bcmFieldFwdFieldVrf, 215, 12); 1061 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVpn, 1062 _bcmFieldSliceSelFpf1, 7, 1063 _bcmFieldSliceFwdFieldSelect, 1064 _bcmFieldFwdFieldVpn, 215, 12); 1065 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1066 bcmFieldQualifyForwardingVlanId, 1067 _bcmFieldSliceSelFpf1, 7, 1068 _bcmFieldSliceFwdFieldSelect, 1069 _bcmFieldFwdFieldVlan, 215, 12); 1070 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMplsOuterLabelPop, 1071 _bcmFieldSliceSelFpf1, 7, 227, 1); 1072 _FP_QUAL_ADD(unit, stage_fc, 1073 bcmFieldQualifyMplsStationHitTunnelUnterminated, 1074 _bcmFieldSliceSelFpf1, 7, 228, 1); 1075 1076 /* IFP single wide F1_8 */ 1077 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 1078 _bcmFieldSliceSelFpf1, 8, 193, 8); 1079 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTos, 1080 _bcmFieldSliceSelFpf1, 8, 1081 _bcmFieldSliceTosClassSelect, 0, 1082 201, 8); 1083 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassZero, 1084 _bcmFieldSliceSelFpf1, 8, 1085 _bcmFieldSliceTosClassSelect, 0, 1086 201, 8); 1087 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassOne, 1088 _bcmFieldSliceSelFpf1, 8, 1089 _bcmFieldSliceTosClassSelect, 1, 1090 201, 8); 1091 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2, 1092 _bcmFieldSliceSelFpf1, 8, 1093 _bcmFieldSliceSrcClassSelect, 0, 209, 6); 1094 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3, 1095 _bcmFieldSliceSelFpf1, 8, 1096 _bcmFieldSliceSrcClassSelect, 1, 209, 6); 1097 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField, 1098 _bcmFieldSliceSelFpf1, 8, 1099 _bcmFieldSliceSrcClassSelect, 3, 209, 6); 1100 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField, 1101 _bcmFieldSliceSelFpf1, 8, 1102 _bcmFieldSliceSrcClassSelect, 2, 209, 6); 1103 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVrf, 1104 _bcmFieldSliceSelFpf1, 8, 1105 _bcmFieldSliceFwdFieldSelect, 1106 _bcmFieldFwdFieldVrf, 215, 12); 1107 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVpn, 1108 _bcmFieldSliceSelFpf1, 8, 1109 _bcmFieldSliceFwdFieldSelect, 1110 _bcmFieldFwdFieldVpn, 215, 12); 1111 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1112 bcmFieldQualifyForwardingVlanId, 1113 _bcmFieldSliceSelFpf1, 8, 1114 _bcmFieldSliceFwdFieldSelect, 1115 _bcmFieldFwdFieldVlan, 215, 12); 1116 /* IFP single wide F1_9 */ 1117 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMplsOuterLabelPop, 1118 _bcmFieldSliceSelFpf1, 9, 225, 1); 1119 _FP_QUAL_ADD(unit, stage_fc, 1120 bcmFieldQualifyMplsStationHitTunnelUnterminated, 1121 _bcmFieldSliceSelFpf1, 9, 226, 1); 1122 _FP_QUAL_ADD(unit, stage_fc, _bcmFieldQualifyData2, 1123 _bcmFieldSliceSelFpf1, 9, 193, 32); 1124 /* IFP single wide F1_10 */ 1125 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstPort, 1126 _bcmFieldSliceSelFpf1, 10, 1127 _bcmFieldSliceDstFwdEntitySelect, 1128 _bcmFieldFwdEntityGlp, 193, 19); 1129 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstGport, 1130 _bcmFieldSliceSelFpf1, 10, 1131 _bcmFieldSliceDstFwdEntitySelect, 1132 _bcmFieldFwdEntityCommonGport, 193, 19); 1133 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk, 1134 _bcmFieldSliceSelFpf1, 10, 1135 _bcmFieldSliceDstFwdEntitySelect, 1136 _bcmFieldFwdEntityGlp, 193, 19); 1137 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMplsGport, 1138 _bcmFieldSliceSelFpf1, 10, 1139 _bcmFieldSliceDstFwdEntitySelect, 1140 _bcmFieldFwdEntityMplsGport, 193, 19); 1141 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstVlanGport, 1142 _bcmFieldSliceSelFpf1, 10, 1143 _bcmFieldSliceDstFwdEntitySelect, 1144 _bcmFieldFwdEntityVlanGport, 193, 19); 1145 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMimGport, 1146 _bcmFieldSliceSelFpf1, 10, 1147 _bcmFieldSliceDstFwdEntitySelect, 1148 _bcmFieldFwdEntityMimGport, 193, 19); 1149 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3Egress, 1150 _bcmFieldSliceSelFpf1, 10, 1151 _bcmFieldSliceDstFwdEntitySelect, 1152 _bcmFieldFwdEntityL3Egress, 193, 19); 1153 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3EgressNextHops, 1154 _bcmFieldSliceSelFpf1, 10, 1155 _bcmFieldSliceDstFwdEntitySelect, 1156 _bcmFieldFwdEntityL3Egress, 193, 19); 1157 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMulticastGroup, 1158 _bcmFieldSliceSelFpf1, 10, 1159 _bcmFieldSliceDstFwdEntitySelect, 1160 _bcmFieldFwdEntityMulticastGroup, 193, 19); 1161 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMultipath, 1162 _bcmFieldSliceSelFpf1, 10, 1163 _bcmFieldSliceDstFwdEntitySelect, 1164 _bcmFieldFwdEntityMultipath, 193, 19); 1165 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstPort, 1166 _bcmFieldSliceSelFpf1, 10, 212, 16); 1167 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk, 1168 _bcmFieldSliceSelFpf1, 10, 212, 16); 1169 1170 /* IFP single wide F1_11 */ 1171 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcTrunk, 1172 _bcmFieldSliceSelFpf1, 11, 193, 16); 1173 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcModPortGport, 1174 _bcmFieldSliceSelFpf1, 11, 193, 16); 1175 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcModuleGport, 1176 _bcmFieldSliceSelFpf1, 11, 200, 9); 1177 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMplsGport, 1178 _bcmFieldSliceSelFpf1, 11, 209, 14); 1179 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcVlanGport, 1180 _bcmFieldSliceSelFpf1, 11, 209, 14); 1181 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMimGport, 1182 _bcmFieldSliceSelFpf1, 11, 209, 14); 1183 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcVirtualPortValid, 1184 _bcmFieldSliceSelFpf1, 11, 222, 1); 1185 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyColor, 1186 _bcmFieldSliceSelFpf1, 11, 223, 2); 1187 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIntPriority, 1188 _bcmFieldSliceSelFpf1, 11, 225, 4); 1189 1190 /* IFP single wide F1_12 */ 1191 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 1192 _bcmFieldSliceSelFpf1, 12, 193, 12); 1193 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL2, 1194 _bcmFieldSliceSelFpf1, 12, 1195 _bcmFieldSliceDstClassSelect, 0, 205, 6); 1196 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL3, 1197 _bcmFieldSliceSelFpf1, 12, 1198 _bcmFieldSliceDstClassSelect, 1, 205, 6); 1199 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField, 1200 _bcmFieldSliceSelFpf1, 12, 1201 _bcmFieldSliceDstClassSelect, 2, 205, 6); 1202 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField, 1203 _bcmFieldSliceSelFpf1, 12, 1204 _bcmFieldSliceDstClassSelect, 3, 205, 6); 1205 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2, 1206 _bcmFieldSliceSelFpf1, 12, 1207 _bcmFieldSliceSrcClassSelect, 0, 211, 6); 1208 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3, 1209 _bcmFieldSliceSelFpf1, 12, 1210 _bcmFieldSliceSrcClassSelect, 1, 211, 6); 1211 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField, 1212 _bcmFieldSliceSelFpf1, 12, 1213 _bcmFieldSliceSrcClassSelect, 2, 211, 6); 1214 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField, 1215 _bcmFieldSliceSelFpf1, 12, 1216 _bcmFieldSliceSrcClassSelect, 3, 211, 6); 1217 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcMplsGport, 1218 _bcmFieldSliceSelFpf1, 12, 1219 _bcmFieldSliceIngressEntitySelect, 1220 _bcmFieldFwdEntityMplsGport, 217, 13); 1221 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcVlanGport, 1222 _bcmFieldSliceSelFpf1, 12, 1223 _bcmFieldSliceIngressEntitySelect, 1224 _bcmFieldFwdEntityVlanGport, 217, 13); 1225 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcMimGport, 1226 _bcmFieldSliceSelFpf1, 12, 1227 _bcmFieldSliceIngressEntitySelect, 1228 _bcmFieldFwdEntityMimGport, 217, 13); 1229 1230 /* IFP single wide F1_13 */ 1231 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVnTag, 1232 _bcmFieldSliceSelFpf1, 13, 1233 _bcmFieldSliceAuxTag1Select, 1234 _bcmFieldAuxTagVn, 193, 33); 1235 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyCnTag, 1236 _bcmFieldSliceSelFpf1, 13, 1237 _bcmFieldSliceAuxTag1Select, 1238 _bcmFieldAuxTagCn, 193, 33); 1239 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyFabricQueueTag, 1240 _bcmFieldSliceSelFpf1, 13, 1241 _bcmFieldSliceAuxTag1Select, 1242 _bcmFieldAuxTagFabricQueue, 193, 33); 1243 1244 /* IFP DWF4 */ 1245 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTcpControl, 1246 _bcmFieldSliceSelFpf4, 1, 1247 _bcmFieldSliceTcpClassSelect, 0, 1, 6); 1248 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTcpClassZero, 1249 _bcmFieldSliceSelFpf4, 1, 1250 _bcmFieldSliceTcpClassSelect, 0, 1, 6); 1251 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTcpClassOne, 1252 _bcmFieldSliceSelFpf4, 1, 1253 _bcmFieldSliceTcpClassSelect, 1, 1, 6); 1254 1255 /* IFP DWF3 */ 1256 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTos, 1257 _bcmFieldSliceSelDisable, 0, 1258 _bcmFieldSliceTosClassSelect, 0, 8, 8); 1259 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTosClassZero, 1260 _bcmFieldSliceSelDisable, 0, 1261 _bcmFieldSliceTosClassSelect, 0, 8, 8); 1262 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTosClassOne, 1263 _bcmFieldSliceSelDisable, 0, 1264 _bcmFieldSliceTosClassSelect, 1, 8, 8); 1265 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 1266 _bcmFieldSliceSelDisable, 0, 1267 _bcmFieldSliceSelDisable, 0, 16, 8); 1268 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, 1269 bcmFieldQualifyExtensionHeaderSubCode, 1270 _bcmFieldSliceSelDisable, 0, 1271 _bcmFieldSliceSelDisable, 0, 24, 8); 1272 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderType, 1273 _bcmFieldSliceSelDisable, 0, 1274 _bcmFieldSliceSelDisable, 0, 32, 8); 1275 1276 /* IFP DWF2 */ 1277 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyMplsTerminated, 1278 _bcmFieldSliceSelFpf2, 0, 1279 _bcmFieldSliceSelDisable, 0, 56, 1); 1280 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyVlanTranslationHit, 1281 _bcmFieldSliceSelFpf2, 0, 1282 _bcmFieldSliceSelDisable, 0, 57, 1); 1283 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyForwardingVlanValid, 1284 _bcmFieldSliceSelFpf2, 0, 1285 _bcmFieldSliceSelDisable, 0, 58, 1); 1286 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyIngressStpState, 1287 _bcmFieldSliceSelFpf2, 0, 1288 _bcmFieldSliceSelDisable, 0, 59, 2); 1289 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL2SrcHit, 1290 _bcmFieldSliceSelFpf2, 0, 1291 _bcmFieldSliceSelDisable, 0, 61, 1); 1292 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL2SrcStatic, 1293 _bcmFieldSliceSelFpf2, 0, 1294 _bcmFieldSliceSelDisable, 0, 62, 1); 1295 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL2DestHit, 1296 _bcmFieldSliceSelFpf2, 0, 1297 _bcmFieldSliceSelDisable, 0, 63, 1); 1298 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL2CacheHit, 1299 _bcmFieldSliceSelFpf2, 0, 1300 _bcmFieldSliceSelDisable, 0, 65, 1); 1301 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL3SrcHostHit, 1302 _bcmFieldSliceSelFpf2, 0, 1303 _bcmFieldSliceSelDisable, 0, 66, 1); 1304 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL3DestHostHit, 1305 _bcmFieldSliceSelFpf2, 0, 1306 _bcmFieldSliceSelDisable, 0, 67, 1); 1307 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyIpmcStarGroupHit, 1308 _bcmFieldSliceSelFpf2, 0, 1309 _bcmFieldSliceSelDisable, 0, 68, 1); 1310 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL3DestRouteHit, 1311 _bcmFieldSliceSelFpf2, 0, 1312 _bcmFieldSliceSelDisable, 0, 69, 1); 1313 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL2StationMove, 1314 _bcmFieldSliceSelFpf2, 0, 1315 _bcmFieldSliceSelDisable, 0, 70, 1); 1316 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyDosAttack, 1317 _bcmFieldSliceSelFpf2, 0, 1318 _bcmFieldSliceSelDisable, 0, 71, 1); 1319 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyRangeCheck, 1320 _bcmFieldSliceSelFpf2, 0, 1321 _bcmFieldSliceSelDisable, 0, 72, 24); 1322 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, _bcmFieldQualifyRangeCheckBits24_31, 1323 _bcmFieldSliceSelFpf2, 0, 1324 _bcmFieldSliceIntfClassSelect, 3, 96, 8); 1325 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort, 1326 _bcmFieldSliceSelFpf2, 0, 1327 _bcmFieldSliceIntfClassSelect, 0, 96, 8); 1328 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassL3, 1329 _bcmFieldSliceSelFpf2, 0, 1330 _bcmFieldSliceIntfClassSelect, 1, 96, 8); 1331 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassL2, 1332 _bcmFieldSliceSelFpf2, 0, 1333 _bcmFieldSliceIntfClassSelect, 2, 96, 8); 1334 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyDstIp, 1335 _bcmFieldSliceSelFpf2, 0, 1336 _bcmFieldSliceSelDisable, 0, 104, 32); 1337 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifySrcIp, 1338 _bcmFieldSliceSelFpf2, 0, 1339 _bcmFieldSliceSelDisable, 0, 136, 32); 1340 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifySrcIp6, 1341 _bcmFieldSliceSelFpf2, 1, 1342 _bcmFieldSliceSelDisable, 0, 40, 128); 1343 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyDstIp6, 1344 _bcmFieldSliceSelFpf2, 2, 1345 _bcmFieldSliceSelDisable, 0, 40, 128); 1346 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, _bcmFieldQualifyData1, 1347 _bcmFieldSliceSelFpf2, 3, 1348 _bcmFieldSliceSelDisable, 0, 40, 128); 1349 /* DWF1 */ 1350 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTtl, 1351 _bcmFieldSliceSelDisable, 0, 1352 _bcmFieldSliceTtlClassSelect, 0, 168, 8); 1353 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTtlClassZero, 1354 _bcmFieldSliceSelDisable, 0, 1355 _bcmFieldSliceTtlClassSelect, 0, 168, 8); 1356 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTtlClassOne, 1357 _bcmFieldSliceSelDisable, 0, 1358 _bcmFieldSliceTtlClassSelect, 1, 168, 8); 1359 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyIpFrag, 1360 _bcmFieldSliceSelDisable, 0, 1361 _bcmFieldSliceSelDisable, 0, 176, 2); 1362 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort, 1363 _bcmFieldSliceSelDisable, 0, 1364 _bcmFieldSliceSelDisable, 0, 178, 16); 1365 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort, 1366 _bcmFieldSliceSelDisable, 0, 1367 _bcmFieldSliceSelDisable, 0, 194, 16); 1368 1369 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstPort, 1370 _bcmFieldDevSelDisable, 0, 1371 _bcmFieldSliceSelDisable, 0, 1372 _bcmFieldSliceDstFwdEntitySelect, 1373 _bcmFieldFwdEntityGlp, 0x1, 1374 210, 19, 0, 0, 0, 0, 0); 1375 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstGport, 1376 _bcmFieldDevSelDisable, 0, 1377 _bcmFieldSliceSelDisable, 0, 1378 _bcmFieldSliceDstFwdEntitySelect, 1379 _bcmFieldFwdEntityCommonGport, 0x1, 1380 210, 19, 0, 0, 0, 0, 0); 1381 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk, 1382 _bcmFieldDevSelDisable, 0, 1383 _bcmFieldSliceSelDisable, 0, 1384 _bcmFieldSliceDstFwdEntitySelect, 1385 _bcmFieldFwdEntityGlp, 0x1, 1386 210, 19, 0, 0, 0, 0, 0); 1387 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstMplsGport, 1388 _bcmFieldDevSelDisable, 0, 1389 _bcmFieldSliceSelDisable, 0, 1390 _bcmFieldSliceDstFwdEntitySelect, 1391 _bcmFieldFwdEntityMplsGport, 0x1, 1392 210, 19, 0, 0, 0, 0, 0); 1393 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstVlanGport, 1394 _bcmFieldDevSelDisable, 0, 1395 _bcmFieldSliceSelDisable, 0, 1396 _bcmFieldSliceDstFwdEntitySelect, 1397 _bcmFieldFwdEntityVlanGport, 0x1, 1398 210, 19, 0, 0, 0, 0, 0); 1399 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstMimGport, 1400 _bcmFieldDevSelDisable, 0, 1401 _bcmFieldSliceSelDisable, 0, 1402 _bcmFieldSliceDstFwdEntitySelect, 1403 _bcmFieldFwdEntityMimGport, 0x1, 1404 210, 19, 0, 0, 0, 0, 0); 1405 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstL3Egress, 1406 _bcmFieldDevSelDisable, 0, 1407 _bcmFieldSliceSelDisable, 0, 1408 _bcmFieldSliceDstFwdEntitySelect, 1409 _bcmFieldFwdEntityL3Egress, 0x1, 1410 210, 19, 0, 0, 0, 0, 0); 1411 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstMulticastGroup, 1412 _bcmFieldDevSelDisable, 0, 1413 _bcmFieldSliceSelDisable, 0, 1414 _bcmFieldSliceDstFwdEntitySelect, 1415 _bcmFieldFwdEntityMulticastGroup, 0x1, 1416 210, 19, 0, 0, 0, 0, 0); 1417 1418 /* IPBM OVERLAY qualifiers for Katana */ 1419 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstPort, 1420 _bcmFieldDevSelDisable, 0, 1421 _bcmFieldSliceSelDisable, 0, 1422 _bcmFieldSliceSelDisable, 0, 1423 1, 1424 0, 16, 1425 0, 0, 1426 0, 0, 1427 1); 1428 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk, 1429 _bcmFieldDevSelDisable, 0, 1430 _bcmFieldSliceSelDisable, 0, 1431 _bcmFieldSliceSelDisable, 0, 1432 1, 1433 0, 16, 1434 0, 0, 1435 0, 0, 1436 1); 1437 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifySrcPort, 1438 _bcmFieldDevSelDisable, 0, 1439 _bcmFieldSliceSelDisable, 0, 1440 _bcmFieldSliceSrcEntitySelect, _bcmFieldFwdEntityGlp, 1441 1, 1442 16, 16, 1443 0, 0, 1444 0, 0, 1445 1); 1446 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifySrcTrunk, 1447 _bcmFieldDevSelDisable, 0, 1448 _bcmFieldSliceSelDisable, 0, 1449 _bcmFieldSliceSrcEntitySelect, _bcmFieldFwdEntityGlp, 1450 1, 1451 16, 16, 1452 0, 0, 1453 0, 0, 1454 1); 1455 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifySrcModPortGport, 1456 _bcmFieldDevSelDisable, 0, 1457 _bcmFieldSliceSelDisable, 0, 1458 _bcmFieldSliceSrcEntitySelect, _bcmFieldFwdEntityModPortGport, 1459 1, 1460 16, 16, 1461 0, 0, 1462 0, 0, 1463 1); 1464 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifySrcModuleGport, 1465 _bcmFieldDevSelDisable, 0, 1466 _bcmFieldSliceSelDisable, 0, 1467 _bcmFieldSliceSrcEntitySelect, _bcmFieldFwdEntityModPortGport, 1468 1, 1469 23, 8, 1470 0, 0, 1471 0, 0, 1472 1); 1473 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyTrunkMemberSourceModuleId, 1474 _bcmFieldDevSelDisable, 0, 1475 _bcmFieldSliceSelDisable, 0, 1476 _bcmFieldSliceSrcEntitySelect, _bcmFieldFwdEntityModPortGport, 1477 1, 1478 23, 8, 1479 0, 0, 1480 0, 0, 1481 1); 1482 1483 /* DONE DWF */ 1484 return (BCM_E_NONE); 1485 } 1486 1487 /* 1488 * Function: 1489 * _field_katana_lookup_qualifiers_init 1490 * Purpose: 1491 * Initialize device stage lookup qaualifiers 1492 * select codes & offsets 1493 * Parameters: 1494 * unit - (IN) BCM device number. 1495 * stage_fc - (IN) Field Processor stage control structure. 1496 * 1497 * Returns: 1498 * BCM_E_NONE 1499 */ 1500 STATIC int 1501 _field_katana_lookup_qualifiers_init(int unit, _field_stage_t *stage_fc) 1502 { 1503 _FP_QUAL_DECL; 1504 1505 /* Input parameters check. */ 1506 if (NULL == stage_fc) { 1507 return (BCM_E_PARAM); 1508 } 1509 1510 /* Enable the overlay of Sender Ethernet Address onto MACSA 1511 * on ARP/RARP packets. 1512 */ 1513 BCM_IF_ERROR_RETURN 1514 (soc_reg_field32_modify(unit, ING_CONFIG_64r, REG_PORT_ANY, 1515 ARP_VALIDATION_ENf, 1)); 1516 1517 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyStageLookup, 1518 _bcmFieldSliceSelDisable, 0, 0, 0); 1519 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp4, 1520 _bcmFieldSliceSelDisable, 0, 0, 0); 1521 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp6, 1522 _bcmFieldSliceSelDisable, 0, 0, 0); 1523 1524 /* FPF3 */ 1525 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlan, 1526 _bcmFieldSliceSelFpf3, 0, 0, 16); 1527 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId, 1528 _bcmFieldSliceSelFpf3, 0, 0, 12); 1529 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi, 1530 _bcmFieldSliceSelFpf3, 0, 12, 1); 1531 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri, 1532 _bcmFieldSliceSelFpf3, 0, 13, 3); 1533 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType, 1534 _bcmFieldSliceSelFpf3, 0, 16, 16); 1535 1536 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyInnerL4DstPort, 1537 _bcmFieldSliceSelFpf3, 1, 1538 _bcmFieldSliceIpHeaderSelect, 1, 0, 16); 1539 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort, 1540 _bcmFieldSliceSelFpf3, 1, 1541 _bcmFieldSliceIpHeaderSelect, 0, 0, 16); 1542 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyInnerL4SrcPort, 1543 _bcmFieldSliceSelFpf3, 1, 1544 _bcmFieldSliceIpHeaderSelect, 1, 16, 16); 1545 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort, 1546 _bcmFieldSliceSelFpf3, 1, 1547 _bcmFieldSliceIpHeaderSelect, 0, 16, 16); 1548 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1549 bcmFieldQualifyInnerTos, 1550 _bcmFieldSliceSelFpf3, 2, 1551 _bcmFieldSliceIpHeaderSelect, 1, 0, 8); 1552 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTos, 1553 _bcmFieldSliceSelFpf3, 2, 1554 _bcmFieldSliceIpHeaderSelect, 0, 0, 8); 1555 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1556 bcmFieldQualifyInnerIpProtocol, 1557 _bcmFieldSliceSelFpf3, 2, 1558 _bcmFieldSliceIpHeaderSelect, 1, 8, 8); 1559 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 1560 _bcmFieldSliceSelFpf3, 2, 1561 _bcmFieldSliceIpHeaderSelect, 0, 8, 8); 1562 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderSubCode, 1563 _bcmFieldSliceSelFpf3, 2, 16, 8); 1564 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderType, 1565 _bcmFieldSliceSelFpf3, 2, 24, 8); 1566 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassL3, 1567 _bcmFieldSliceSelFpf3, 3, 0, 8); 1568 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlan, 1569 _bcmFieldSliceSelFpf3, 3, 8, 16); 1570 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId, 1571 _bcmFieldSliceSelFpf3, 3, 8, 12); 1572 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi, 1573 _bcmFieldSliceSelFpf3, 3, 20, 1); 1574 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri, 1575 _bcmFieldSliceSelFpf3, 3, 21, 3); 1576 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcModuleGport, 1577 _bcmFieldSliceSelFpf3, 3, 24, 8); 1578 1579 /* FPF2 */ 1580 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1581 bcmFieldQualifyInnerTtl, 1582 _bcmFieldSliceSelFpf2, 0, 1583 _bcmFieldSliceIpHeaderSelect, 1, 32, 8); 1584 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtl, 1585 _bcmFieldSliceSelFpf2, 0, 1586 _bcmFieldSliceIpHeaderSelect, 0, 32, 8); 1587 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl, 1588 _bcmFieldSliceSelFpf2, 0, 40, 6); 1589 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1590 bcmFieldQualifyInnerIpFrag, 1591 _bcmFieldSliceSelFpf2, 0, 1592 _bcmFieldSliceIpHeaderSelect, 1, 46, 2); 1593 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyIpFrag, 1594 _bcmFieldSliceSelFpf2, 0, 1595 _bcmFieldSliceIpHeaderSelect, 0, 46, 2); 1596 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1597 bcmFieldQualifyInnerTos, 1598 _bcmFieldSliceSelFpf2, 0, 1599 _bcmFieldSliceIpHeaderSelect, 1, 48, 8); 1600 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTos, 1601 _bcmFieldSliceSelFpf2, 0, 1602 _bcmFieldSliceIpHeaderSelect, 0, 48, 8); 1603 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyInnerL4DstPort, 1604 _bcmFieldSliceSelFpf2, 0, 1605 _bcmFieldSliceIpHeaderSelect, 1, 56, 16); 1606 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort, 1607 _bcmFieldSliceSelFpf2, 0, 1608 _bcmFieldSliceIpHeaderSelect, 0, 56, 16); 1609 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyInnerL4SrcPort, 1610 _bcmFieldSliceSelFpf2, 0, 1611 _bcmFieldSliceIpHeaderSelect, 1, 72, 16); 1612 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort, 1613 _bcmFieldSliceSelFpf2, 0, 1614 _bcmFieldSliceIpHeaderSelect, 0, 72, 16); 1615 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1616 bcmFieldQualifyInnerIpProtocol, 1617 _bcmFieldSliceSelFpf2, 0, 1618 _bcmFieldSliceIpHeaderSelect, 1, 88, 8); 1619 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 1620 _bcmFieldSliceSelFpf2, 0, 1621 _bcmFieldSliceIpHeaderSelect, 0, 88, 8); 1622 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1623 bcmFieldQualifyInnerDstIp, 1624 _bcmFieldSliceSelFpf2, 0, 1625 _bcmFieldSliceIpHeaderSelect, 1, 96, 32); 1626 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstIp, 1627 _bcmFieldSliceSelFpf2, 0, 1628 _bcmFieldSliceIpHeaderSelect, 0, 96, 32); 1629 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1630 bcmFieldQualifyInnerSrcIp, 1631 _bcmFieldSliceSelFpf2, 0, 1632 _bcmFieldSliceIpHeaderSelect, 1, 128, 32); 1633 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcIp, 1634 _bcmFieldSliceSelFpf2, 0, 1635 _bcmFieldSliceIpHeaderSelect, 0, 128, 32); 1636 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1637 bcmFieldQualifyInnerSrcIp6, 1638 _bcmFieldSliceSelFpf2, 1, 1639 _bcmFieldSliceIpHeaderSelect, 1, 32, 128); 1640 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcIp6, 1641 _bcmFieldSliceSelFpf2, 1, 1642 _bcmFieldSliceIpHeaderSelect, 0, 32, 128); 1643 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1644 bcmFieldQualifyInnerDstIp6, 1645 _bcmFieldSliceSelFpf2, 2, 1646 _bcmFieldSliceIpHeaderSelect, 1, 32, 128); 1647 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6, 1648 _bcmFieldSliceSelFpf2, 2, 1649 _bcmFieldSliceIpHeaderSelect, 0, 32, 128); 1650 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType, 1651 _bcmFieldSliceSelFpf2, 3, 48, 16); 1652 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMac, 1653 _bcmFieldSliceSelFpf2, 3, 64, 48); 1654 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMac, 1655 _bcmFieldSliceSelFpf2, 3, 112, 48); 1656 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1657 bcmFieldQualifyInnerTos, 1658 _bcmFieldSliceSelFpf2, 4, 1659 _bcmFieldSliceIpHeaderSelect, 1, 32, 8); 1660 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTos, 1661 _bcmFieldSliceSelFpf2, 4, 1662 _bcmFieldSliceIpHeaderSelect, 0, 32, 8); 1663 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1664 bcmFieldQualifyInnerIpProtocol, 1665 _bcmFieldSliceSelFpf2, 4, 1666 _bcmFieldSliceIpHeaderSelect, 1, 40, 8); 1667 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 1668 _bcmFieldSliceSelFpf2, 4, 1669 _bcmFieldSliceIpHeaderSelect, 0, 40, 8); 1670 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1671 bcmFieldQualifyInnerDstIp, 1672 _bcmFieldSliceSelFpf2, 4, 1673 _bcmFieldSliceIpHeaderSelect, 1, 48, 32); 1674 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstIp, 1675 _bcmFieldSliceSelFpf2, 4, 1676 _bcmFieldSliceIpHeaderSelect, 0, 48, 32); 1677 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1678 bcmFieldQualifyInnerSrcIp, 1679 _bcmFieldSliceSelFpf2, 4, 1680 _bcmFieldSliceIpHeaderSelect, 1, 80, 32); 1681 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcIp, 1682 _bcmFieldSliceSelFpf2, 4, 1683 _bcmFieldSliceIpHeaderSelect, 0, 80, 32); 1684 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMac, 1685 _bcmFieldSliceSelFpf2, 4, 112, 48); 1686 1687 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1688 bcmFieldQualifyInnerTos, 1689 _bcmFieldSliceSelFpf2, 5, 1690 _bcmFieldSliceIpHeaderSelect, 1, 32, 8); 1691 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTos, 1692 _bcmFieldSliceSelFpf2, 5, 1693 _bcmFieldSliceIpHeaderSelect, 0, 32, 8); 1694 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1695 bcmFieldQualifyInnerIpProtocol, 1696 _bcmFieldSliceSelFpf2, 5, 1697 _bcmFieldSliceIpHeaderSelect, 1, 40, 8); 1698 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 1699 _bcmFieldSliceSelFpf2, 5, 1700 _bcmFieldSliceIpHeaderSelect, 0, 40, 8); 1701 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1702 bcmFieldQualifyInnerDstIp, 1703 _bcmFieldSliceSelFpf2, 5, 1704 _bcmFieldSliceIpHeaderSelect, 1, 48, 32); 1705 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstIp, 1706 _bcmFieldSliceSelFpf2, 5, 1707 _bcmFieldSliceIpHeaderSelect, 0, 48, 32); 1708 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1709 bcmFieldQualifyInnerSrcIp, 1710 _bcmFieldSliceSelFpf2, 5, 1711 _bcmFieldSliceIpHeaderSelect, 1, 80, 32); 1712 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcIp, 1713 _bcmFieldSliceSelFpf2, 5, 1714 _bcmFieldSliceIpHeaderSelect, 0, 80, 32); 1715 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMac, 1716 _bcmFieldSliceSelFpf2, 5, 112, 48); 1717 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1718 bcmFieldQualifyInnerSrcIp6High, 1719 _bcmFieldSliceSelFpf2, 6, 1720 _bcmFieldSliceIpHeaderSelect, 1, 32, 64); 1721 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcIp6High, 1722 _bcmFieldSliceSelFpf2, 6, 1723 _bcmFieldSliceIpHeaderSelect, 0, 32, 64); 1724 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1725 bcmFieldQualifyInnerDstIp6High, 1726 _bcmFieldSliceSelFpf2, 6, 1727 _bcmFieldSliceIpHeaderSelect, 1, 96, 64); 1728 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6High, 1729 _bcmFieldSliceSelFpf2, 6, 1730 _bcmFieldSliceIpHeaderSelect, 0, 96, 64); 1731 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySnap, 1732 _bcmFieldSliceSelFpf2, 7, 96, 40); 1733 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyLlc, 1734 _bcmFieldSliceSelFpf2, 7, 136, 24); 1735 1736 /* FPF1 */ 1737 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1738 bcmFieldQualifyInnerIpProtocolCommon, 1739 _bcmFieldSliceSelFpf1, 0, 1740 _bcmFieldSliceIpHeaderSelect, 1, 160, 3); 1741 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocolCommon, 1742 _bcmFieldSliceSelFpf1, 0, 1743 _bcmFieldSliceIpHeaderSelect, 0, 160, 3); 1744 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTunnelTerminated, 1745 _bcmFieldSliceSelFpf1, 0, 163, 1); 1746 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerTpid, 1747 _bcmFieldSliceSelFpf1, 0, 165, 2); 1748 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterTpid, 1749 _bcmFieldSliceSelFpf1, 0, 167, 2); 1750 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2Format, 1751 _bcmFieldSliceSelFpf1, 0, 169, 2); 1752 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGigProxy, 1753 _bcmFieldSliceSelFpf1, 0, 171, 1); 1754 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGig, 1755 _bcmFieldSliceSelFpf1, 0, 172, 1); 1756 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 1757 _bcmFieldSliceSelFpf1, 0, 173, 16); 1758 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 1759 _bcmFieldSliceSelFpf1, 0, 173, 12); 1760 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 1761 _bcmFieldSliceSelFpf1, 0, 185, 1); 1762 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 1763 _bcmFieldSliceSelFpf1, 0, 186, 3); 1764 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat, 1765 _bcmFieldSliceSelFpf1, 0, 189, 2); 1766 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyInPort, 1767 _bcmFieldDevSelDisable, 0, 1768 _bcmFieldSliceSelFpf1, 0, 1769 _bcmFieldSliceSrcEntitySelect, _bcmFieldFwdEntityPortGroupNum, 1770 0, 1771 191, 7, 1772 0, 0, 1773 0, 0, 1774 0 1775 ); 1776 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort, 1777 _bcmFieldDevSelDisable, 0, 1778 _bcmFieldSliceSelFpf1, 0, 1779 _bcmFieldSliceSrcEntitySelect, _bcmFieldFwdEntityPortGroupNum, 1780 0, 1781 198, 8, 1782 0, 0, 1783 0, 0, 1784 0 1785 ); 1786 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifySrcPort, 1787 _bcmFieldDevSelDisable, 0, 1788 _bcmFieldSliceSelFpf1, 0, 1789 _bcmFieldSliceSrcEntitySelect, _bcmFieldFwdEntityGlp, 1790 0, 1791 191, 15, /* SOURCE_FIELD (MODID, PORT) */ 1792 211, 1, /* SOURCE_TYPE (Trunk-bit should be 0) */ 1793 0, 0, 1794 0 1795 ); 1796 _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifySrcTrunk, 1797 _bcmFieldDevSelDisable, 0, 1798 _bcmFieldSliceSelFpf1, 0, 1799 _bcmFieldSliceSrcEntitySelect, _bcmFieldFwdEntityGlp, 1800 0, 1801 191, 15, /* SOURCE_FIELD (MODID, PORT) */ 1802 211, 1, /* SOURCE_TYPE (Trunk-bit should be 1) */ 1803 0, 0, 1804 0 1805 ); 1806 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 1807 bcmFieldQualifyInnerIpType, 1808 _bcmFieldSliceSelFpf1, 0, 1809 _bcmFieldSliceIpHeaderSelect, 1, 206, 4); 1810 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyIpType, 1811 _bcmFieldSliceSelFpf1, 0, 1812 _bcmFieldSliceIpHeaderSelect, 0, 206, 4); 1813 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports, 1814 _bcmFieldSliceSelFpf1, 0, 210, 1); 1815 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpInfo, 1816 _bcmFieldSliceSelFpf1, 0, 4, 1); 1817 1818 /* DWF3 */ 1819 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInnerTos, 1820 _bcmFieldSliceSelFpf3, 0, 1821 _bcmFieldSliceIpHeaderSelect, 1, 0, 8); 1822 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTos, 1823 _bcmFieldSliceSelFpf3, 0, 1824 _bcmFieldSliceIpHeaderSelect, 0, 0, 8); 1825 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInnerTtl, 1826 _bcmFieldSliceSelFpf3, 0, 1827 _bcmFieldSliceIpHeaderSelect, 1, 8, 8); 1828 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTtl, 1829 _bcmFieldSliceSelFpf3, 0, 1830 _bcmFieldSliceIpHeaderSelect, 0, 8, 8); 1831 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTcpControl, 1832 _bcmFieldSliceSelFpf3, 0, 1833 _bcmFieldSliceIpHeaderSelect, 0, 16, 6); 1834 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInnerIpFrag, 1835 _bcmFieldSliceSelFpf3, 0, 1836 _bcmFieldSliceIpHeaderSelect, 1, 22, 2); 1837 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyIpFrag, 1838 _bcmFieldSliceSelFpf3, 0, 1839 _bcmFieldSliceIpHeaderSelect, 0, 22, 2); 1840 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 1841 _bcmFieldSliceSelFpf3, 0, 1842 _bcmFieldSliceIpHeaderSelect, 0, 24, 8); 1843 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInnerIpProtocol, 1844 _bcmFieldSliceSelFpf3, 0, 1845 _bcmFieldSliceIpHeaderSelect, 1, 24, 8); 1846 /* DWF2 */ 1847 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInnerTtl, 1848 _bcmFieldSliceSelFpf2, 0, 1849 _bcmFieldSliceIpHeaderSelect, 1, 32, 8); 1850 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTtl, 1851 _bcmFieldSliceSelFpf2, 0, 1852 _bcmFieldSliceIpHeaderSelect, 0, 32, 8); 1853 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTcpControl, 1854 _bcmFieldSliceSelFpf2, 0, 1855 _bcmFieldSliceIpHeaderSelect, 0, 40, 6); 1856 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInnerIpFrag, 1857 _bcmFieldSliceSelFpf2, 0, 1858 _bcmFieldSliceIpHeaderSelect, 1, 46, 2); 1859 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyIpFrag, 1860 _bcmFieldSliceSelFpf2, 0, 1861 _bcmFieldSliceIpHeaderSelect, 0, 46, 2); 1862 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInnerTos, 1863 _bcmFieldSliceSelFpf2, 0, 1864 _bcmFieldSliceIpHeaderSelect, 1, 48, 8); 1865 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTos, 1866 _bcmFieldSliceSelFpf2, 0, 1867 _bcmFieldSliceIpHeaderSelect, 0, 48, 8); 1868 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInnerL4DstPort, 1869 _bcmFieldSliceSelFpf2, 0, 1870 _bcmFieldSliceIpHeaderSelect, 1, 56, 16); 1871 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort, 1872 _bcmFieldSliceSelFpf2, 0, 1873 _bcmFieldSliceIpHeaderSelect, 0, 56, 16); 1874 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInnerL4SrcPort, 1875 _bcmFieldSliceSelFpf2, 0, 1876 _bcmFieldSliceIpHeaderSelect, 1, 72, 16); 1877 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort, 1878 _bcmFieldSliceSelFpf2, 0, 1879 _bcmFieldSliceIpHeaderSelect, 0, 72, 16); 1880 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInnerIpProtocol, 1881 _bcmFieldSliceSelFpf2, 0, 1882 _bcmFieldSliceIpHeaderSelect, 1, 88, 8); 1883 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 1884 _bcmFieldSliceSelFpf2, 0, 1885 _bcmFieldSliceIpHeaderSelect, 0, 88, 8); 1886 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInnerDstIp, 1887 _bcmFieldSliceSelFpf2, 0, 1888 _bcmFieldSliceIpHeaderSelect, 1, 96, 32); 1889 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyDstIp, 1890 _bcmFieldSliceSelFpf2, 0, 1891 _bcmFieldSliceIpHeaderSelect, 0, 96, 32); 1892 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInnerSrcIp, 1893 _bcmFieldSliceSelFpf2, 0, 1894 _bcmFieldSliceIpHeaderSelect, 1, 128, 32); 1895 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifySrcIp, 1896 _bcmFieldSliceSelFpf2, 0, 1897 _bcmFieldSliceIpHeaderSelect, 0, 128, 32); 1898 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInnerSrcIp6, 1899 _bcmFieldSliceSelFpf2, 1, 1900 _bcmFieldSliceIpHeaderSelect, 1, 32, 128); 1901 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifySrcIp6, 1902 _bcmFieldSliceSelFpf2, 1, 1903 _bcmFieldSliceIpHeaderSelect, 0, 32, 128); 1904 /* FPF1 */ 1905 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderSubCode, 1906 _bcmFieldSliceSelFpf1, 0, 1907 _bcmFieldSliceIpHeaderSelect, 0, 160, 8); 1908 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderType, 1909 _bcmFieldSliceSelFpf1, 0, 1910 _bcmFieldSliceIpHeaderSelect, 0, 168, 8); 1911 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassL3, 1912 _bcmFieldSliceSelFpf1, 0, 1913 _bcmFieldSliceIpHeaderSelect, 0, 176, 8); 1914 _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyEtherType, 1915 _bcmFieldSliceSelFpf1, 0, 1916 _bcmFieldSliceIpHeaderSelect, 0, 184, 16); 1917 return (BCM_E_NONE); 1918 } 1919 1920 1921 /* 1922 * Function: 1923 * _field_katana_egress_qualifiers_init 1924 * Purpose: 1925 * Initialize device stage egress qaualifiers 1926 * select codes & offsets 1927 * Parameters: 1928 * unit - (IN) BCM device number. 1929 * stage_fc - (IN) Field Processor stage control structure. 1930 * 1931 * Returns: 1932 * BCM_E_NONE 1933 */ 1934 STATIC int 1935 _field_katana_egress_qualifiers_init(int unit, _field_stage_t *stage_fc) 1936 { 1937 _FP_QUAL_DECL; 1938 _key_fld_ = KEYf; 1939 1940 /* Input parameters check. */ 1941 if (NULL == stage_fc) { 1942 return (BCM_E_PARAM); 1943 } 1944 1945 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyStageEgress, 1946 _bcmFieldSliceSelDisable, 0, 0, 0); 1947 1948 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports, 1949 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 0, 1); 1950 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMplsGport, 1951 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 1, 14); 1952 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstVlanGport, 1953 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 1, 14); 1954 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMimGport, 1955 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 1, 14); 1956 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIntPriority, 1957 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 17, 4); 1958 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyColor, 1959 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 21, 2); 1960 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2Format, 1961 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 23, 2); 1962 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType, 1963 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 25, 16); 1964 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMac, 1965 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 41, 48); 1966 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMac, 1967 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 89, 48); 1968 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyCpuQueue, 1969 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 137, 6); 1970 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanTranslationHit, 1971 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 143, 1); 1972 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGigProxy, 1973 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 144, 1); 1974 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGig, 1975 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 145, 1); 1976 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi, 1977 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 146, 1); 1978 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri, 1979 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 147, 3); 1980 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId, 1981 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 150, 12); 1982 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInPort, 1983 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 163, 6); 1984 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3Routable, 1985 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 170, 1); 1986 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMirrorCopy, 1987 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 171, 1); 1988 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 1989 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 172, 16); 1990 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 1991 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 172, 12); 1992 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 1993 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 184, 1); 1994 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 1995 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 185, 3); 1996 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat, 1997 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 188, 2); 1998 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstHiGig, 1999 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 190, 1); 2000 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort, 2001 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 191, 8); 2002 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOutPort, 2003 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 199, 6); 2004 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpType, 2005 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 206, 4); 2006 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDrop, 2007 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 210, 1); 2008 2009 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports, 2010 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 0, 1); 2011 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIntPriority, 2012 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 8, 4); 2013 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyColor, 2014 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 12, 2); 2015 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpFrag, 2016 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 14, 2); 2017 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl, 2018 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 16, 6); 2019 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort, 2020 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 22, 16); 2021 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort, 2022 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 38, 16); 2023 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTtl, 2024 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 54, 8); 2025 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 2026 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 62, 8); 2027 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp, 2028 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 70, 32); 2029 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp, 2030 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 102, 32); 2031 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTos, 2032 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 134, 8); 2033 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGigProxy, 2034 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 142, 1); 2035 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGig, 2036 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 143, 1); 2037 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId, 2038 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 150, 12); 2039 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInPort, 2040 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 163, 6); 2041 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3Routable, 2042 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 170, 1); 2043 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMirrorCopy, 2044 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 171, 1); 2045 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 2046 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 172, 16); 2047 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 2048 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 172, 12); 2049 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 2050 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 184, 1); 2051 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 2052 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 185, 3); 2053 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat, 2054 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 188, 2); 2055 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstHiGig, 2056 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 190, 1); 2057 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort, 2058 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 191, 8); 2059 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOutPort, 2060 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 199, 6); 2061 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpType, 2062 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 206, 4); 2063 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDrop, 2064 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 210, 1); 2065 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp4, 2066 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 0, 0); 2067 2068 /* KEY1 without v4 specific fields. */ 2069 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports, 2070 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 0, 1); 2071 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl, 2072 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 16, 6); 2073 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort, 2074 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 22, 16); 2075 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort, 2076 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 38, 16); 2077 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTtl, 2078 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 54, 8); 2079 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 2080 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 62, 8); 2081 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTos, 2082 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 134, 8); 2083 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGigProxy, 2084 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 142, 1); 2085 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGig, 2086 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 143, 1); 2087 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId, 2088 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 150, 12); 2089 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInPort, 2090 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 163, 6); 2091 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3Routable, 2092 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 170, 1); 2093 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMirrorCopy, 2094 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 171, 1); 2095 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 2096 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 172, 16); 2097 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 2098 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 172, 12); 2099 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 2100 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 184, 1); 2101 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 2102 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 185, 3); 2103 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat, 2104 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 188, 2); 2105 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstHiGig, 2106 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 190, 1); 2107 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort, 2108 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 191, 8); 2109 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOutPort, 2110 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 199, 6); 2111 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpType, 2112 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 206, 4); 2113 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDrop, 2114 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 210, 1); 2115 2116 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports, 2117 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 0, 1); 2118 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol, 2119 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 4, 8); 2120 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcIp6, 2121 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 2122 _bcmFieldSliceIp6AddrSelect, 2123 _BCM_FIELD_EGRESS_SLICE_V6_KEY_MODE_SIP6, 2124 12, 128); 2125 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6, 2126 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 2127 _bcmFieldSliceIp6AddrSelect, 2128 _BCM_FIELD_EGRESS_SLICE_V6_KEY_MODE_DIP6, 2129 12, 128); 2130 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcIp6High, 2131 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 2132 _bcmFieldSliceIp6AddrSelect, 2133 _BCM_FIELD_EGRESS_SLICE_V6_KEY_MODE_SIP_DIP_64, 2134 12, 64); 2135 _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6High, 2136 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 2137 _bcmFieldSliceIp6AddrSelect, 2138 _BCM_FIELD_EGRESS_SLICE_V6_KEY_MODE_SIP_DIP_64, 2139 76, 64); 2140 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTos, 2141 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 140, 8); 2142 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGigProxy, 2143 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 148, 1); 2144 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGig, 2145 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 149, 1); 2146 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId, 2147 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 150, 12); 2148 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInPort, 2149 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 163, 6); 2150 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3Routable, 2151 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 170, 1); 2152 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMirrorCopy, 2153 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 171, 1); 2154 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan, 2155 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 172, 16); 2156 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId, 2157 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 172, 12); 2158 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi, 2159 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 184, 1); 2160 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri, 2161 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 185, 3); 2162 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat, 2163 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 188, 2); 2164 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstHiGig, 2165 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 190, 1); 2166 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort, 2167 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 191, 8); 2168 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOutPort, 2169 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 199, 6); 2170 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpType, 2171 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 206, 4); 2172 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDrop, 2173 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 210, 1); 2174 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp6, 2175 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 0, 0); 2176 2177 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports, 2178 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 0, 1); 2179 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIntPriority, 2180 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 8, 4); 2181 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyColor, 2182 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 12, 2); 2183 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpFrag, 2184 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 14, 2); 2185 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl, 2186 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 16, 6); 2187 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort, 2188 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 22, 16); 2189 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort, 2190 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 38, 16); 2191 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTtl, 2192 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 54, 8); 2193 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6, 2194 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 62, 128); 2195 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderSubCode, 2196 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 190, 8); 2197 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderType, 2198 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 198, 8); 2199 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpType, 2200 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 206, 4); 2201 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDrop, 2202 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 210, 1); 2203 _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp6, 2204 _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 0, 0); 2205 2206 return (BCM_E_NONE); 2207 } 2208 2209 /* 2210 * Function: 2211 * _field_katana_qualifiers_init 2212 * Purpose: 2213 * Initialize device qaualifiers select codes & offsets 2214 * Parameters: 2215 * unit - (IN) BCM device number. 2216 * stage_fc - (IN) Field Processor stage control structure. 2217 * 2218 * Returns: 2219 * BCM_E_NONE 2220 * Notes: 2221 */ 2222 STATIC int 2223 _field_katana_qualifiers_init(int unit, _field_stage_t *stage_fc) 2224 { 2225 int rv; /* Operation return status. */ 2226 2227 /* Input parameters check. */ 2228 if (NULL == stage_fc) { 2229 return (BCM_E_PARAM); 2230 } 2231 2232 /* Allocated stage qualifiers configuration array. */ 2233 _FP_XGS3_ALLOC(stage_fc->f_qual_arr, 2234 (_bcmFieldQualifyCount * sizeof(_bcm_field_qual_info_t *)), 2235 "Field qualifiers"); 2236 if (NULL == stage_fc->f_qual_arr) { 2237 return (BCM_E_MEMORY); 2238 } 2239 2240 switch (stage_fc->stage_id) { 2241 case _BCM_FIELD_STAGE_INGRESS: 2242 rv = _field_katana_ingress_qualifiers_init(unit, stage_fc); 2243 break; 2244 case _BCM_FIELD_STAGE_LOOKUP: 2245 rv = _field_katana_lookup_qualifiers_init(unit, stage_fc); 2246 break; 2247 case _BCM_FIELD_STAGE_EGRESS: 2248 rv = _field_katana_egress_qualifiers_init(unit, stage_fc); 2249 break; 2250 case _BCM_FIELD_STAGE_EXTERNAL: 2251 default: 2252 sal_free(stage_fc->f_qual_arr); 2253 return (BCM_E_PARAM); 2254 } 2255 return (rv); 2256 } 2257 2258 /* 2259 * Function: 2260 * _bcm_field_katana_init 2261 2262 * Purpose: 2263 * Perform initializations that are specific to BCM56230. This 2264 * includes initializing the FP field select bit offset tables for FPF[1-3] 2265 * for every stage. 2266 * Parameters: 2267 * unit - (IN) BCM device number. 2268 * fc - (IN) Field Processor control structure. 2269 * 2270 * Returns: 2271 * BCM_E_NONE 2272 * Notes: 2273 */ 2274 int 2275 _bcm_field_katana_init(int unit, _field_control_t *fc) 2276 { 2277 _field_stage_t *stage_fc; /* Stages iteration pointer */ 2278 2279 /* Input parameters check. */ 2280 if (NULL == fc) { 2281 return (BCM_E_PARAM); 2282 } 2283 2284 stage_fc = fc->stages; 2285 while (stage_fc) { 2286 /* Clear hardware table */ 2287 BCM_IF_ERROR_RETURN(_bcm_field_tr_hw_clear(unit, stage_fc)); 2288 2289 /* Initialize qualifiers info. */ 2290 BCM_IF_ERROR_RETURN(_field_katana_qualifiers_init(unit, stage_fc)); 2291 2292 if (_BCM_FIELD_STAGE_EXTERNAL == stage_fc->stage_id) { 2293 _bcm_field_tr_external_init(unit, stage_fc); 2294 stage_fc = stage_fc->next; 2295 continue; 2296 } 2297 2298 /* Goto next stage */ 2299 stage_fc = stage_fc->next; 2300 } 2301 2302 /* Initialize the TOS_FN, TTL_FN, TCP_FN tables */ 2303 BCM_IF_ERROR_RETURN(_bcm_field_trx_tcp_ttl_tos_init(unit)); 2304 2305 if (0 == SOC_WARM_BOOT(unit)) { 2306 /* Enable filter processor */ 2307 BCM_IF_ERROR_RETURN(_field_port_filter_enable_set(unit, fc, TRUE)); 2308 2309 /* Enable meter refresh */ 2310 BCM_IF_ERROR_RETURN(_field_meter_refresh_enable_set(unit, fc, TRUE)); 2311 } 2312 2313 /* Initialize the function pointers */ 2314 _field_katana_functions_init(&fc->functions);; 2315 2316 return (BCM_E_NONE); 2317 } 2318 2319 /* FP_RESOLUTION packet field values for Katana */ 2320 static const struct { 2321 uint8 api, hw; 2322 } pkt_res_xlate_tbl[] = { 2323 { BCM_FIELD_PKT_RES_UNKNOWN, 0x00 }, /* 0 */ 2324 { BCM_FIELD_PKT_RES_CONTROL, 0x01 }, /* 1 */ 2325 { BCM_FIELD_PKT_RES_BPDU, 0x02 }, /* 2 */ 2326 { BCM_FIELD_PKT_RES_L2BC, 0x03 }, /* 3 */ 2327 { BCM_FIELD_PKT_RES_L2UC, 0x04 }, /* 4 */ 2328 { BCM_FIELD_PKT_RES_L2UNKNOWN, 0x05 }, /* 5 */ 2329 { BCM_FIELD_PKT_RES_L3MCUNKNOWN, 0x06 }, /* 6 */ 2330 { BCM_FIELD_PKT_RES_L3MCKNOWN, 0x07 }, /* 7 */ 2331 { BCM_FIELD_PKT_RES_L2MCKNOWN, 0x08 }, /* 8 */ 2332 { BCM_FIELD_PKT_RES_L2MCUNKNOWN, 0x09 }, /* 9 */ 2333 { BCM_FIELD_PKT_RES_L3UCKNOWN, 0x0a }, /* 10 */ 2334 { BCM_FIELD_PKT_RES_L3UCUNKNOWN, 0x0b }, /* 11 */ 2335 { BCM_FIELD_PKT_RES_MPLSKNOWN, 0x0c }, /* 12 */ 2336 { BCM_FIELD_PKT_RES_MPLSL3KNOWN, 0x0d }, /* 13 */ 2337 { BCM_FIELD_PKT_RES_MPLSL2KNOWN, 0x0e }, /* 14 */ 2338 { BCM_FIELD_PKT_RES_MPLSUNKNOWN, 0x0f }, /* 15 */ 2339 { BCM_FIELD_PKT_RES_MIMKNOWN, 0x10 }, /* 16 */ 2340 { BCM_FIELD_PKT_RES_MIMUNKNOWN, 0x11 }, /* 17 */ 2341 { BCM_FIELD_PKT_RES_MPLSMCKNOWN, 0x12 } /* 18 */ 2342 }; 2343 2344 int 2345 _bcm_field_kt_qualify_PacketRes(int unit, 2346 bcm_field_entry_t entry, 2347 uint32 *data, 2348 uint32 *mask 2349 ) 2350 { 2351 uint32 i; 2352 uint8 mark = 0; 2353 2354 /* Check for valid data mask combinations */ 2355 if ((*mask != *data) && (!((*mask & 0x3f) == 0x3f))) { 2356 return (BCM_E_PARAM); 2357 } 2358 2359 /* Translate data #defines to hardware encodings */ 2360 2361 for (i = 0; i < COUNTOF(pkt_res_xlate_tbl); ++i) { 2362 if (*data == pkt_res_xlate_tbl[i].api) { 2363 *data = pkt_res_xlate_tbl[i].hw; 2364 mark = 1; 2365 break; 2366 } 2367 } 2368 /* Translate mask #defines to hardware encodings */ 2369 2370 for (i = 0; i < COUNTOF(pkt_res_xlate_tbl); ++i) { 2371 if (*mask == pkt_res_xlate_tbl[i].api) { 2372 *mask = pkt_res_xlate_tbl[i].hw; 2373 break; 2374 } 2375 } 2376 if (mark == 1) { 2377 return (BCM_E_NONE); 2378 } else { 2379 return (BCM_E_INTERNAL); 2380 } 2381 } 2382 /* 2383 * Function: 2384 * _bcm_field_fabricQueue_action_node_increment_ref_Count 2385 * Purpose: 2386 * Increment the referecne count of the fabric node if it is existing 2387 * Parameters: 2388 * unit - (IN) BCM device number 2389 * queue_index - (IN) cosq queue index 2390 * profile_indexx - (IN) QoS map profile index 2391 * Returns: 2392 * BCM_E_XXX 2393 */ 2394 int _bcm_field_fabricQueue_action_node_increment_ref_Count (int unit, 2395 uint32 queue_index, uint32 profile_index) 2396 { 2397 int rv = BCM_E_NONE; /* Return status */ 2398 _field_fabricQueue_action_t *fabric_queue_node_temp; 2399 2400 _field_control_t *fc; 2401 int mask = 0; 2402 2403 rv = _field_control_get(unit, &fc); 2404 if (BCM_FAILURE(rv)) { 2405 return rv; 2406 } 2407 mask = (1 << soc_mem_field_length( 2408 unit, ING_QUEUE_MAPm, QUEUE_OFFSET_PROFILE_INDEXf)) - 1; 2409 fabric_queue_node_temp = fc->field_fabricQueue_action_list; 2410 while (fabric_queue_node_temp != NULL) { 2411 if(fabric_queue_node_temp->queue_index == queue_index) { 2412 if(fabric_queue_node_temp->profile_index == 2413 (profile_index & mask)) { 2414 fabric_queue_node_temp->reference_count = 2415 fabric_queue_node_temp->reference_count + 1; 2416 } else { 2417 LOG_DEBUG(BSL_LS_BCM_FP,(BSL_META_U(unit, 2418 "Error: Cannot have multiple profile index[%d]" 2419 "for a same Queue ID[%d]\n\r"), 2420 profile_index, queue_index)); 2421 rv = BCM_E_PARAM; 2422 } 2423 return rv; 2424 } 2425 fabric_queue_node_temp = fabric_queue_node_temp->next; 2426 } 2427 rv = BCM_E_NOT_FOUND; 2428 return rv; 2429 } 2430 2431 /* 2432 * Function: 2433 * _bcm_field_fabricQueue_action_node_add 2434 * Purpose: 2435 * add the fabric node to the linked list 2436 * Parameters: 2437 * unit - (IN) BCM device number 2438 * queue_index - (IN) cosq queue index 2439 * profile_indexx - (IN) QoS map profile index 2440 * Returns: 2441 * BCM_E_XXX 2442 */ 2443 int _bcm_field_fabricQueue_action_node_add (int unit, 2444 uint32 queue_index, uint32 profile_index) 2445 { 2446 int rv = BCM_E_NONE; /* Return status */ 2447 _field_fabricQueue_action_t *fabric_queue_node_temp; 2448 2449 _field_control_t *fc; 2450 int mask; 2451 2452 rv = _field_control_get(unit, &fc); 2453 if (BCM_FAILURE(rv)) { 2454 return rv; 2455 } 2456 2457 /*add the node */ 2458 fabric_queue_node_temp = NULL; 2459 _FP_XGS3_ALLOC (fabric_queue_node_temp, 2460 sizeof (_field_fabricQueue_action_t), 2461 "Field fabricQueueAction"); 2462 if (NULL == fabric_queue_node_temp) { 2463 return BCM_E_MEMORY; 2464 } 2465 mask = (1 << soc_mem_field_length( 2466 unit, ING_QUEUE_MAPm, QUEUE_OFFSET_PROFILE_INDEXf)) - 1; 2467 fabric_queue_node_temp->queue_index = queue_index; 2468 fabric_queue_node_temp->profile_index = profile_index & mask; 2469 fabric_queue_node_temp->reference_count = 1; 2470 2471 fabric_queue_node_temp->next = fc->field_fabricQueue_action_list; 2472 fc->field_fabricQueue_action_list = fabric_queue_node_temp; 2473 2474 return rv; 2475 } 2476 /* 2477 * Function: 2478 * _bcm_field_fabricQueue_action_node_delete 2479 * Purpose: 2480 * delete the node from linkedlist if reference count is 2481 * 1. else decrement the reference count. 2482 * Parameters: 2483 * unit - (IN) BCM device number 2484 * queue_index - (IN) cosq queue index 2485 * profile_indexx - (IN) QoS map profile index 2486 * referenceCount - (OUT) reference count of the node 2487 * Returns: 2488 * BCM_E_XXX 2489 */ 2490 2491 int _bcm_field_fabricQueue_action_node_delete (int unit, 2492 uint32 queue_index, uint32 profile_index, 2493 int *referenceCount) 2494 { 2495 int rv = BCM_E_NONE; /* Return status */ 2496 _field_fabricQueue_action_t *currentNode, *prevNode, *nextNode; 2497 int mask; 2498 _field_control_t *fc; 2499 2500 prevNode = nextNode = NULL; 2501 *referenceCount = 0; 2502 2503 rv = _field_control_get(unit, &fc); 2504 if (BCM_FAILURE(rv)) { 2505 return rv; 2506 } 2507 2508 mask = (1 << soc_mem_field_length( 2509 unit, ING_QUEUE_MAPm, QUEUE_OFFSET_PROFILE_INDEXf)) - 1; 2510 2511 currentNode = fc->field_fabricQueue_action_list; 2512 while (currentNode != NULL) { 2513 if((currentNode->queue_index == queue_index) && 2514 (currentNode->profile_index == (profile_index & mask)) ) { 2515 if(currentNode->reference_count == 1) { 2516 nextNode = currentNode->next; 2517 if(prevNode == NULL) { 2518 fc->field_fabricQueue_action_list = nextNode; 2519 } else { 2520 prevNode->next = nextNode; 2521 } 2522 sal_free(currentNode); 2523 currentNode = NULL; 2524 *referenceCount = 0; 2525 2526 } else { 2527 currentNode->reference_count = 2528 currentNode->reference_count - 1; 2529 *referenceCount = currentNode->reference_count; 2530 } 2531 return rv; 2532 } 2533 prevNode = currentNode; 2534 currentNode = currentNode->next; 2535 } 2536 rv = BCM_E_NOT_FOUND; 2537 return rv; 2538 } 2539 2540 int 2541 _bcm_field_kt_qualify_PacketRes_get(int unit, 2542 bcm_field_entry_t entry, 2543 uint32 *data, 2544 uint32 *mask 2545 ) 2546 { 2547 uint32 i; 2548 uint8 mark = 0; 2549 /* Translate data #defines from hardware encodings */ 2550 2551 for (i = 0; i < COUNTOF(pkt_res_xlate_tbl); ++i) { 2552 if (*data == pkt_res_xlate_tbl[i].hw) { 2553 *data = pkt_res_xlate_tbl[i].api; 2554 mark = 1; 2555 break; 2556 } 2557 } 2558 /* Translate mask #defines to hardware encodings */ 2559 2560 for (i = 0; i < COUNTOF(pkt_res_xlate_tbl); ++i) { 2561 if (*mask == pkt_res_xlate_tbl[i].hw) { 2562 *mask = pkt_res_xlate_tbl[i].api; 2563 break; 2564 } 2565 } 2566 if (mark == 1) { 2567 return (BCM_E_NONE); 2568 } else { 2569 return (BCM_E_INTERNAL); 2570 } 2571 } 2572 /* 2573 * Function: 2574 * _field_ka_write_slice_map_ingress 2575 * Purpose: 2576 * Write FP_SLICE_MAP 2577 * Parameters: 2578 * unit - (IN) BCM device number 2579 * stage_fc - (IN) stage control structure 2580 * Returns: 2581 * BCM_E_XXX 2582 */ 2583 STATIC int 2584 _field_ka_write_slice_map_ingress(int unit, _field_stage_t *stage_fc) 2585 { 2586 fp_slice_map_entry_t entry; 2587 soc_field_t field; 2588 uint32 value; 2589 int vmap_size; 2590 int index; 2591 static const soc_field_t physical_slice[] = { 2592 VIRTUAL_SLICE_0_PHYSICAL_SLICE_NUMBER_ENTRY_0f, 2593 VIRTUAL_SLICE_1_PHYSICAL_SLICE_NUMBER_ENTRY_0f, 2594 VIRTUAL_SLICE_2_PHYSICAL_SLICE_NUMBER_ENTRY_0f, 2595 VIRTUAL_SLICE_3_PHYSICAL_SLICE_NUMBER_ENTRY_0f, 2596 VIRTUAL_SLICE_4_PHYSICAL_SLICE_NUMBER_ENTRY_0f, 2597 VIRTUAL_SLICE_5_PHYSICAL_SLICE_NUMBER_ENTRY_0f, 2598 VIRTUAL_SLICE_6_PHYSICAL_SLICE_NUMBER_ENTRY_0f, 2599 VIRTUAL_SLICE_7_PHYSICAL_SLICE_NUMBER_ENTRY_0f, 2600 VIRTUAL_SLICE_8_PHYSICAL_SLICE_NUMBER_ENTRY_0f, 2601 VIRTUAL_SLICE_9_PHYSICAL_SLICE_NUMBER_ENTRY_0f, 2602 VIRTUAL_SLICE_10_PHYSICAL_SLICE_NUMBER_ENTRY_0f, 2603 VIRTUAL_SLICE_11_PHYSICAL_SLICE_NUMBER_ENTRY_0f 2604 }; 2605 static const soc_field_t slice_group[] = { 2606 VIRTUAL_SLICE_0_VIRTUAL_SLICE_GROUP_ENTRY_0f, 2607 VIRTUAL_SLICE_1_VIRTUAL_SLICE_GROUP_ENTRY_0f, 2608 VIRTUAL_SLICE_2_VIRTUAL_SLICE_GROUP_ENTRY_0f, 2609 VIRTUAL_SLICE_3_VIRTUAL_SLICE_GROUP_ENTRY_0f, 2610 VIRTUAL_SLICE_4_VIRTUAL_SLICE_GROUP_ENTRY_0f, 2611 VIRTUAL_SLICE_5_VIRTUAL_SLICE_GROUP_ENTRY_0f, 2612 VIRTUAL_SLICE_6_VIRTUAL_SLICE_GROUP_ENTRY_0f, 2613 VIRTUAL_SLICE_7_VIRTUAL_SLICE_GROUP_ENTRY_0f, 2614 VIRTUAL_SLICE_8_VIRTUAL_SLICE_GROUP_ENTRY_0f, 2615 VIRTUAL_SLICE_9_VIRTUAL_SLICE_GROUP_ENTRY_0f, 2616 VIRTUAL_SLICE_10_VIRTUAL_SLICE_GROUP_ENTRY_0f, 2617 VIRTUAL_SLICE_11_VIRTUAL_SLICE_GROUP_ENTRY_0f 2618 }; 2619 2620 /* Calculate virtual map size. */ 2621 BCM_IF_ERROR_RETURN 2622 (_bcm_field_virtual_map_size_get(unit, stage_fc, &vmap_size)); 2623 2624 SOC_IF_ERROR_RETURN(READ_FP_SLICE_MAPm(unit, MEM_BLOCK_ANY, 0, &entry)); 2625 2626 for (index = 0; index < vmap_size; index++) { 2627 value = stage_fc->vmap[_FP_DEF_INST][_FP_VMAP_DEFAULT][index].vmap_key; 2628 field = physical_slice[index]; 2629 soc_FP_SLICE_MAPm_field32_set(unit, &entry, field, value); 2630 2631 value = stage_fc->vmap[_FP_DEF_INST][_FP_VMAP_DEFAULT][index].virtual_group; 2632 field = slice_group[index]; 2633 soc_FP_SLICE_MAPm_field32_set(unit, &entry, field, value); 2634 } 2635 2636 return WRITE_FP_SLICE_MAPm(unit, MEM_BLOCK_ALL, 0, &entry); 2637 } 2638 2639 /* 2640 * Function: 2641 * _bcm_field_ka_write_slice_map 2642 * Purpose: 2643 * Write FP_SLICE_MAP, EFP_SLICE_MAP, VFP_SLICE_MAP 2644 * Parameters: 2645 * unit - (IN) BCM device number 2646 * stage_fc - (IN) stage control structure 2647 * fg - (IN) reference to field group structure. 2648 * Returns: 2649 * BCM_E_XXX 2650 */ 2651 int 2652 _bcm_field_ka_write_slice_map(int unit, _field_stage_t *stage_fc, 2653 _field_group_t *fg) 2654 { 2655 if (stage_fc->stage_id == _BCM_FIELD_STAGE_INGRESS) { 2656 return _field_ka_write_slice_map_ingress(unit, stage_fc); 2657 } else if (stage_fc->stage_id == _BCM_FIELD_STAGE_EGRESS) { 2658 return _bcm_field_trx_write_slice_map_egress(unit, stage_fc); 2659 } else if (stage_fc->stage_id == _BCM_FIELD_STAGE_LOOKUP) { 2660 return _bcm_field_trx_write_slice_map_vfp(unit, stage_fc); 2661 } 2662 2663 return BCM_E_INTERNAL; 2664 } 2665 2666 /* 2667 * Function: 2668 * _bcm_field_ka_counter_write 2669 * Purpose: 2670 * Write accumulated sw & hw counters 2671 * Parameters: 2672 * unit - (IN) BCM device number 2673 * stage_fc - (IN) Stage field control 2674 * counter_x_mem - (IN) Memory name for X pipe FP counter 2675 * mem_x_buf - (IN) Memory table entry for X pipe FP counter 2676 * counter_y_mem - (IN) Memory name for Y pipe FP counter 2677 * mem_y_buf - (IN) Memory table entry for Y pipe FP counter 2678 * idx - (IN) Counter index 2679 * packet_count - (IN) Packet counter value 2680 * byte_count - (IN) Byte counter value 2681 * Returns: 2682 * BCM_E_XXX 2683 */ 2684 STATIC int 2685 _bcm_field_ka_counter_write(int unit, soc_mem_t mem, int idx, uint32 *buf, 2686 _field_counter32_collect_t *cntrs32_buf, 2687 _field_counter64_collect_t *cntrs64_buf, 2688 uint64 *packet_count, uint64 *byte_count) 2689 { 2690 uint32 hw_val[2]; /* Parsed field counter value.*/ 2691 int len = 0; /* Field length */ 2692 2693 /* Set byte count in the memory */ 2694 if (NULL != byte_count) { 2695 COMPILER_64_ZERO(cntrs64_buf->accumulated_counter); 2696 COMPILER_64_OR(cntrs64_buf->accumulated_counter, (*byte_count)); 2697 len = soc_mem_field_length(unit, mem, BYTE_COUNTERf); 2698 if (len <= 32) { 2699 return BCM_E_INTERNAL; 2700 } 2701 COMPILER_64_SET(cntrs64_buf->last_hw_value, 2702 COMPILER_64_HI(*byte_count) & ((1 << (len - 32)) - 1), 2703 COMPILER_64_LO(*byte_count)); 2704 hw_val[0] = COMPILER_64_LO(cntrs64_buf->last_hw_value); 2705 hw_val[1] = COMPILER_64_HI(cntrs64_buf->last_hw_value); 2706 soc_mem_field_set(unit, mem, buf, BYTE_COUNTERf, hw_val); 2707 } 2708 /* Set packet count in the memory */ 2709 if (NULL != packet_count) { 2710 COMPILER_64_ZERO(cntrs32_buf->accumulated_counter); 2711 COMPILER_64_OR(cntrs32_buf->accumulated_counter, 2712 (*packet_count)); 2713 cntrs32_buf->last_hw_value = 2714 (COMPILER_64_LO(*packet_count) & 0x1fffffff); 2715 hw_val[0] = cntrs32_buf->last_hw_value; 2716 hw_val[1] = 0; 2717 soc_mem_field_set(unit, mem, buf, PACKET_COUNTERf, hw_val); 2718 } 2719 2720 return soc_mem_write(unit, mem, MEM_BLOCK_ALL, idx, buf); 2721 } 2722 2723 /* 2724 * Function: 2725 * _bcm_field_ka_counter_set 2726 * Purpose: 2727 * Write accumulated sw and hw counters 2728 * Parameters: 2729 * unit - (IN) BCM device number 2730 * stage_fc - (IN) Stage field control 2731 * counter_x_mem - (IN) Memory name for X pipe FP counter 2732 * mem_x_buf - (IN) Memory table entry for X pipe FP counter 2733 * counter_y_mem - (IN) Memory name for Y pipe FP counter 2734 * mem_y_buf - (IN) Memory table entry for Y pipe FP counter 2735 * idx - (IN) Counter index 2736 * packet_count - (IN) Packet counter value 2737 * byte_count - (IN) Byte counter value 2738 * Returns: 2739 * BCM_E_XXX 2740 */ 2741 STATIC int 2742 _bcm_field_ka_counter_set(int unit, _field_stage_t *stage_fc, 2743 soc_mem_t counter_x_mem, uint32 *mem_x_buf, 2744 soc_mem_t counter_y_mem, uint32 *mem_y_buf, 2745 int idx, uint64 *packet_count, uint64 *byte_count) 2746 { 2747 _field_counter32_collect_t *cntrs32_buf; /* Sw packet counter value */ 2748 _field_counter64_collect_t *cntrs64_buf; /* Sw byte counter value */ 2749 2750 /* Input parameters check. */ 2751 if (NULL == stage_fc) { 2752 return BCM_E_PARAM; 2753 } 2754 2755 /* Write X pipeline counter value. */ 2756 if (NULL != mem_x_buf) { 2757 cntrs64_buf = &stage_fc->_field_x64_counters[idx]; 2758 cntrs32_buf = &stage_fc->_field_x32_counters[idx]; 2759 BCM_IF_ERROR_RETURN 2760 (_bcm_field_ka_counter_write(unit, counter_x_mem, idx, mem_x_buf, 2761 cntrs32_buf, cntrs64_buf, 2762 packet_count, byte_count)); 2763 } 2764 2765 /* Write 0 to Y pipeline counter value. */ 2766 if (NULL != packet_count) { 2767 COMPILER_64_ZERO(*packet_count); 2768 } 2769 2770 if (NULL != byte_count) { 2771 COMPILER_64_ZERO(*byte_count); 2772 } 2773 2774 /* Write Y pipeline counter value. */ 2775 if (NULL != mem_y_buf) { 2776 cntrs64_buf = &stage_fc->_field_y64_counters[idx]; 2777 cntrs32_buf = &stage_fc->_field_y32_counters[idx]; 2778 BCM_IF_ERROR_RETURN 2779 (_bcm_field_ka_counter_write(unit, counter_y_mem, idx, mem_y_buf, 2780 cntrs32_buf, cntrs64_buf, 2781 packet_count, byte_count)); 2782 } 2783 2784 return BCM_E_NONE; 2785 } 2786 2787 /* 2788 * Function: 2789 * _bcm_field_ka_counter_read 2790 * Purpose: 2791 * Update accumulated sw counter and return current counter value. 2792 * Parameters: 2793 * unit - (IN) BCM device number 2794 * stage_fc - (IN) Stage field control 2795 * counter_x_mem - (IN) Memory name for X pipe FP counter 2796 * mem_x_buf - (IN) Memory table entry for X pipe FP counter 2797 * counter_y_mem - (IN) Memory name for Y pipe FP counter 2798 * mem_y_buf - (IN) Memory table entry for Y pipe FP counter 2799 * idx - (IN) Counter index 2800 * packet_count - (OUT) Packet counter value 2801 * byte_count - (OUT) Byte counter value 2802 * Returns: 2803 * BCM_E_XXX 2804 */ 2805 STATIC int 2806 _bcm_field_ka_counter_read(int unit, _field_stage_t *stage_fc, 2807 soc_memacc_t *memacc_byte, 2808 soc_memacc_t *memacc_pkt,uint32 *buf, 2809 _field_counter32_collect_t *cntrs32_buf, 2810 _field_counter64_collect_t *cntrs64_buf, 2811 uint64 *packet_count, uint64 *byte_count) 2812 { 2813 uint32 hw_val[2]; /* Parsed field counter value.*/ 2814 2815 /* Input parameters check. */ 2816 if (NULL == stage_fc) { 2817 return BCM_E_PARAM; 2818 } 2819 2820 /* Byte counter. */ 2821 hw_val[0] = hw_val[1] = 0; 2822 soc_memacc_field_get(memacc_byte, buf, hw_val); 2823 2824 if (stage_fc->stage_id == _BCM_FIELD_STAGE_EGRESS) { 2825 /* EFP supports 36 bits Byte Counter. */ 2826 _bcm_field_36bit_counter_update(unit, hw_val, cntrs64_buf); 2827 } 2828 else { 2829 _bcm_field_35bit_counter_update(unit, hw_val, cntrs64_buf); 2830 } 2831 2832 if (NULL != byte_count) { 2833 COMPILER_64_ADD_64(*byte_count, cntrs64_buf->accumulated_counter); 2834 } 2835 2836 /* Packet counter. */ 2837 hw_val[0] = hw_val[1] = 0; 2838 soc_memacc_field_get(memacc_pkt, buf, hw_val); 2839 _bcm_field_29bit_counter_update(unit, hw_val, cntrs32_buf); 2840 if (NULL != packet_count) { 2841 COMPILER_64_ADD_64(*packet_count, cntrs32_buf->accumulated_counter); 2842 } 2843 2844 return BCM_E_NONE; 2845 } 2846 2847 2848 /* 2849 * Function: 2850 * _bcm_field_ka_counter_get 2851 * Purpose: 2852 * Update accumulated sw counter and return current counter value. 2853 * Parameters: 2854 * unit - (IN) BCM device number 2855 * stage_fc - (IN) Stage field control 2856 * counter_x_mem - (IN) Memory name for X pipe FP counter 2857 * mem_x_buf - (IN) Memory table entry for X pipe FP counter 2858 * counter_y_mem - (IN) Memory name for Y pipe FP counter 2859 * mem_y_buf - (IN) Memory table entry for Y pipe FP counter 2860 * idx - (IN) Counter index 2861 * packet_count - (OUT) Packet counter value 2862 * byte_count - (OUT) Byte counter value 2863 * Returns: 2864 * BCM_E_XXX 2865 */ 2866 STATIC int 2867 _bcm_field_ka_counter_get(int unit, _field_stage_t *stage_fc, 2868 soc_mem_t counter_x_mem, uint32 *mem_x_buf, 2869 soc_mem_t counter_y_mem, uint32 *mem_y_buf, 2870 int idx, uint64 *packet_count, uint64 *byte_count) 2871 { 2872 _field_counter32_collect_t *cntrs32_buf; /* Sw packet counter value */ 2873 _field_counter64_collect_t *cntrs64_buf; /* Sw byte counter value */ 2874 soc_memacc_t *memacc_pkt_x, *memacc_byte_x; /* Memory access cache. */ 2875 soc_memacc_t *memacc_pkt_y, *memacc_byte_y; /* Memory access cache. */ 2876 2877 /* Input parameters check. */ 2878 if (NULL == stage_fc) { 2879 return BCM_E_PARAM; 2880 } 2881 2882 /* Extract X pipeline counter value. */ 2883 if (NULL != mem_x_buf) { 2884 cntrs64_buf = &stage_fc->_field_x64_counters[idx]; 2885 cntrs32_buf = &stage_fc->_field_x32_counters[idx]; 2886 memacc_byte_x = 2887 &(stage_fc->_field_memacc_counters[_FIELD_COUNTER_MEMACC_BYTE]); 2888 memacc_pkt_x = 2889 &(stage_fc->_field_memacc_counters[_FIELD_COUNTER_MEMACC_PACKET]); 2890 SOC_IF_ERROR_RETURN 2891 (_bcm_field_ka_counter_read(unit, stage_fc, memacc_byte_x, memacc_pkt_x, 2892 mem_x_buf, 2893 cntrs32_buf, cntrs64_buf, 2894 packet_count, byte_count)); 2895 } 2896 2897 /* Extract Y pipeline counter value. */ 2898 if (NULL != mem_y_buf) { 2899 cntrs64_buf = &stage_fc->_field_y64_counters[idx]; 2900 cntrs32_buf = &stage_fc->_field_y32_counters[idx]; 2901 memacc_byte_y = 2902 &(stage_fc->_field_memacc_counters[_FIELD_COUNTER_MEMACC_BYTE_Y]); 2903 memacc_pkt_y = 2904 &(stage_fc->_field_memacc_counters[_FIELD_COUNTER_MEMACC_PACKET_Y]); 2905 SOC_IF_ERROR_RETURN 2906 (_bcm_field_ka_counter_read(unit, stage_fc, memacc_byte_y, memacc_pkt_y, 2907 mem_y_buf, 2908 cntrs32_buf, cntrs64_buf, 2909 packet_count, byte_count)); 2910 } 2911 2912 return BCM_E_NONE; 2913 } 2914 2915 /* 2916 * Function: 2917 * _field_katana_functions_init 2918 * 2919 * Purpose: 2920 * Set up functions pointers 2921 * 2922 * Parameters: 2923 * stage_fc - (IN/OUT) pointers to stage control block whe the device 2924 * and stage specific functions will be registered. 2925 * 2926 * Returns: 2927 * nothing 2928 * Notes: 2929 */ 2930 STATIC void 2931 _field_katana_functions_init(_field_funct_t *functions) 2932 { 2933 functions->fp_detach = _bcm_field_tr_detach; 2934 functions->fp_group_install = _bcm_field_fb_group_install; 2935 functions->fp_selcodes_install = _bcm_field_trx_selcodes_install; 2936 functions->fp_slice_clear = _bcm_field_trx_slice_clear; 2937 functions->fp_entry_remove = _bcm_field_fb_entry_remove; 2938 functions->fp_entry_move = _bcm_field_fb_entry_move; 2939 functions->fp_selcode_get = _bcm_field_tr_selcode_get; 2940 functions->fp_selcode_to_qset = _bcm_field_selcode_to_qset; 2941 functions->fp_qual_list_get = _bcm_field_qual_lists_get; 2942 functions->fp_tcam_policy_clear = NULL; 2943 functions->fp_tcam_policy_install = _bcm_field_tr_entry_install; 2944 functions->fp_tcam_policy_reinstall = _bcm_field_tr_entry_reinstall; 2945 functions->fp_policer_install = _bcm_field_trx_policer_install; 2946 functions->fp_write_slice_map = _bcm_field_ka_write_slice_map; 2947 functions->fp_qualify_ip_type = _bcm_field_trx_qualify_ip_type; 2948 functions->fp_qualify_ip_type_get = _bcm_field_trx_qualify_ip_type_get; 2949 functions->fp_action_support_check = _bcm_field_trx_action_support_check; 2950 functions->fp_action_conflict_check = _bcm_field_trx_action_conflict_check; 2951 functions->fp_counter_get = _bcm_field_ka_counter_get; 2952 functions->fp_counter_set = _bcm_field_ka_counter_set; 2953 functions->fp_stat_index_get = _bcm_field_trx_stat_index_get; 2954 functions->fp_action_params_check = _bcm_field_trx_action_params_check; 2955 functions->fp_egress_key_match_type_set = 2956 _bcm_field_trx_egress_key_match_type_set; 2957 functions->fp_external_entry_install = _bcm_field_tr_external_entry_install; 2958 functions->fp_external_entry_reinstall =_bcm_field_tr_external_entry_reinstall; 2959 functions->fp_external_entry_remove = _bcm_field_tr_external_entry_remove; 2960 functions->fp_external_entry_prio_set = _bcm_field_tr_external_entry_prio_set; 2961 functions->fp_data_qualifier_ethertype_add = 2962 _bcm_field_trx2_data_qualifier_ethertype_add; 2963 functions->fp_data_qualifier_ethertype_delete= 2964 _bcm_field_trx2_data_qualifier_ethertype_delete; 2965 functions->fp_data_qualifier_ip_protocol_add = 2966 _bcm_field_trx2_data_qualifier_ip_protocol_add; 2967 functions->fp_data_qualifier_ip_protocol_delete= 2968 _bcm_field_trx2_data_qualifier_ip_protocol_delete; 2969 functions->fp_data_qualifier_packet_format_add= 2970 _bcm_field_trx2_data_qualifier_packet_format_add; 2971 functions->fp_data_qualifier_packet_format_delete= 2972 _bcm_field_trx2_data_qualifier_packet_format_delete; 2973 functions->fp_stat_value_get = NULL; 2974 functions->fp_stat_value_set = NULL; 2975 functions->fp_control_set = _bcm_field_control_set; 2976 functions->fp_control_get = _bcm_field_control_get; 2977 functions->fp_stat_hw_mode_get = _bcm_field_stat_hw_mode_get; 2978 functions->fp_stat_hw_alloc = _bcm_field_stat_hw_alloc; 2979 functions->fp_stat_hw_free = _bcm_field_stat_hw_free; 2980 functions->fp_group_add = NULL; 2981 functions->fp_qualify_trunk = _bcm_field_qualify_trunk; 2982 functions->fp_qualify_trunk_get = _bcm_field_qualify_trunk_get; 2983 functions->fp_qualify_inports = _bcm_field_qualify_InPorts; 2984 functions->fp_entry_stat_extended_attach = NULL; 2985 functions->fp_entry_stat_extended_get = NULL; 2986 functions->fp_entry_stat_detach = _bcm_field_entry_stat_detach; 2987 functions->fp_class_size_get = NULL; 2988 functions->fp_qualify_packet_res = _bcm_field_kt_qualify_PacketRes; 2989 functions->fp_qualify_packet_res_get = _bcm_field_kt_qualify_PacketRes_get; 2990 } 2991 #else /* BCM_KATANA_SUPPORT && BCM_FIELD_SUPPORT */ 2992 int _katana_field_not_empty; 2993 #endif /* BCM_KATANA_SUPPORT && BCM_FIELD_SUPPORT */