openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

field.c (97587B)


      1 /*
      2  * 
      3  *
      4  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      5  * 
      6  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      7  */
      8 
      9 #include <soc/defs.h>
     10 #if defined(BCM_GREYHOUND_SUPPORT) && defined(BCM_FIELD_SUPPORT)
     11 
     12 #include <soc/mem.h>
     13 #include <soc/drv.h>
     14 
     15 #include <bcm/error.h>
     16 #include <bcm/l3.h>
     17 #include <bcm/field.h>
     18 #include <bcm/tunnel.h>
     19 
     20 #include <bcm_int/esw_dispatch.h>
     21 
     22 #include <bcm_int/esw/field.h>
     23 #include <bcm_int/esw/l3.h>
     24 #include <bcm_int/esw/firebolt.h>
     25 #include <bcm_int/esw/trx.h>
     26 #include <bcm_int/esw/enduro.h>
     27 #include <bcm_int/esw/triumph.h>
     28 #include <bcm_int/esw/triumph2.h>
     29 #include <bcm_int/esw/hurricane2.h>
     30 #include <bcm_int/esw/greyhound.h>
     31 
     32 
     33 
     34 /* local/static function prototypes */
     35 STATIC void _field_gh_functions_init(_field_funct_t *functions) ;
     36 
     37 /*
     38  * Function:
     39  *     _field_gh_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_gh_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     /* Single wide Fixed */
     74     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGig,
     75                  _bcmFieldSliceSelDisable, 0, 7, 1);
     76     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyForwardingType,
     77                  _bcmFieldSliceSelDisable, 0, 8, 3);
     78     /* SVP_OR_L3IIF no support */
     79     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpType,
     80                  _bcmFieldSliceSelDisable, 0, 12, 4);
     81     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports,
     82                  _bcmFieldSliceSelDisable, 0, 16, 1);
     83     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3Routable,
     84                  _bcmFieldSliceSelDisable, 0, 17, 1);
     85     /* TUNNEL_TYPE_LOOPBACK_TYPE no support */
     86     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDrop,
     87                  _bcmFieldSliceSelDisable, 0, 22, 1);
     88     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMirrorCopy,
     89                  _bcmFieldSliceSelDisable, 0, 23, 1);
     90 
     91     /* FPF3 primary slice single wide. */
     92     /* F3_0 */
     93     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL2,
     94                                _bcmFieldSliceSelFpf3, 0,
     95                                _bcmFieldSliceDstClassSelect, 0, 24, 6);
     96     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL3,
     97                                _bcmFieldSliceSelFpf3, 0,
     98                                _bcmFieldSliceDstClassSelect, 1, 24, 6);
     99     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField,
    100                                _bcmFieldSliceSelFpf3, 0,
    101                                _bcmFieldSliceDstClassSelect, 2, 24, 6);
    102     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField,
    103                                _bcmFieldSliceSelFpf3, 0,
    104                                _bcmFieldSliceDstClassSelect, 3, 24, 6);
    105     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2,
    106                                _bcmFieldSliceSelFpf3, 0,
    107                                _bcmFieldSliceSrcClassSelect, 0, 30, 6);
    108     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3,
    109                                _bcmFieldSliceSelFpf3, 0,
    110                                _bcmFieldSliceSrcClassSelect, 1, 30, 6);
    111     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField,
    112                                _bcmFieldSliceSelFpf3, 0,
    113                                _bcmFieldSliceSrcClassSelect, 2, 30, 6);
    114     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField,
    115                                _bcmFieldSliceSelFpf3, 0,
    116                                _bcmFieldSliceSrcClassSelect, 3, 30, 6);
    117     /* VRF and VFI are not supported in ForwardingField */
    118     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 
    119                                bcmFieldQualifyForwardingVlanId,
    120                                _bcmFieldSliceSelFpf3, 0,
    121                                _bcmFieldSliceFwdFieldSelect, 
    122                                _bcmFieldFwdFieldVlan, 36, 12);
    123     /* SVP and L3IIF are not supported in SVP_L3IIF_OVERLAY */
    124 
    125     /* F3_1 */
    126     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL2,
    127                                _bcmFieldSliceSelFpf3, 1,
    128                                _bcmFieldSliceDstClassSelect, 0, 24, 6);
    129     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL3,
    130                                _bcmFieldSliceSelFpf3, 1,
    131                                _bcmFieldSliceDstClassSelect, 1, 24, 6);
    132     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField,
    133                                _bcmFieldSliceSelFpf3, 1,
    134                                _bcmFieldSliceDstClassSelect, 2, 24, 6);
    135     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField,
    136                                _bcmFieldSliceSelFpf3, 1,
    137                                _bcmFieldSliceDstClassSelect, 3, 24, 6);
    138     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2,
    139                                _bcmFieldSliceSelFpf3, 1,
    140                                _bcmFieldSliceSrcClassSelect, 0, 30, 6);
    141     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3,
    142                                _bcmFieldSliceSelFpf3, 1,
    143                                _bcmFieldSliceSrcClassSelect, 1, 30, 6);
    144     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField,
    145                                _bcmFieldSliceSelFpf3, 1,
    146                                _bcmFieldSliceSrcClassSelect, 2, 30, 6);
    147     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField,
    148                                _bcmFieldSliceSelFpf3, 1,
    149                                _bcmFieldSliceSrcClassSelect, 3, 30, 6);
    150     /* VRF and VFI are not supported in ForwardingField */
    151     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 
    152                                bcmFieldQualifyForwardingVlanId,
    153                                _bcmFieldSliceSelFpf3, 1,
    154                                _bcmFieldSliceFwdFieldSelect, 
    155                                _bcmFieldFwdFieldVlan, 36, 12);
    156     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
    157                  _bcmFieldSliceSelFpf3, 1, 48, 12);
    158 
    159 
    160     /* F3_2 */
    161     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstPort,
    162                                _bcmFieldSliceSelFpf3, 2,
    163                                _bcmFieldSliceDstFwdEntitySelect,
    164                                _bcmFieldFwdEntityGlp, 24, 17);
    165     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstGport,
    166                                _bcmFieldSliceSelFpf3, 2,
    167                                _bcmFieldSliceDstFwdEntitySelect,
    168                                _bcmFieldFwdEntityCommonGport, 24, 17);
    169     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk,
    170                                _bcmFieldSliceSelFpf3, 2,
    171                                _bcmFieldSliceDstFwdEntitySelect,
    172                                _bcmFieldFwdEntityGlp, 24, 17);
    173     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3Egress,
    174                                _bcmFieldSliceSelFpf3, 2,
    175                                _bcmFieldSliceDstFwdEntitySelect,
    176                                _bcmFieldFwdEntityL3Egress, 24, 17);
    177     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3EgressNextHops,
    178                                _bcmFieldSliceSelFpf3, 2,
    179                                _bcmFieldSliceDstFwdEntitySelect,
    180                                _bcmFieldFwdEntityL3Egress, 24, 17);
    181     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMulticastGroup,
    182                                _bcmFieldSliceSelFpf3, 2,
    183                                _bcmFieldSliceDstFwdEntitySelect,
    184                                _bcmFieldFwdEntityMulticastGroup, 24, 17);
    185     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcPort,
    186                                _bcmFieldSliceSelFpf3, 2,
    187                                _bcmFieldSliceSrcEntitySelect,
    188                                _bcmFieldFwdEntityGlp, 41, 15);
    189     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcTrunk,
    190                                _bcmFieldSliceSelFpf3, 2,
    191                                _bcmFieldSliceSrcEntitySelect,
    192                                _bcmFieldFwdEntityGlp, 41, 15);
    193     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcModPortGport,
    194                                _bcmFieldSliceSelFpf3, 2,
    195                                _bcmFieldSliceSrcEntitySelect,
    196                                _bcmFieldFwdEntityModPortGport, 41, 15);
    197     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcModuleGport,
    198                                _bcmFieldSliceSelFpf3, 2,
    199                                _bcmFieldSliceSrcEntitySelect,
    200                                _bcmFieldFwdEntityModPortGport, 47, 8);
    201     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTrunkMemberSourceModuleId,
    202                                _bcmFieldSliceSelFpf3, 2,
    203                                _bcmFieldSliceSrcEntitySelect,
    204                                _bcmFieldFwdEntityModPortGport, 47, 8);
    205     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMHOpcode,
    206                  _bcmFieldSliceSelFpf3, 2, 56, 3);
    207 
    208     /* F3_3 */
    209     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
    210                  _bcmFieldSliceSelFpf3, 3, 24, 16);
    211     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
    212                  _bcmFieldSliceSelFpf3, 3, 24, 12);
    213     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
    214                  _bcmFieldSliceSelFpf3, 3, 36, 1);
    215     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
    216                  _bcmFieldSliceSelFpf3, 3, 37, 3);
    217     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat,
    218                  _bcmFieldSliceSelFpf3, 3, 40, 2);
    219     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2Format,
    220                  _bcmFieldSliceSelFpf3, 3, 42, 2);
    221     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTranslatedVlanFormat,
    222                  _bcmFieldSliceSelFpf3, 3, 44, 2);
    223     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMHOpcode,
    224                  _bcmFieldSliceSelFpf3, 3, 46, 3);
    225     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyPacketRes,
    226                  _bcmFieldSliceSelFpf3, 3, 49, 5);
    227     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpInfo,
    228                  _bcmFieldSliceSelFpf3, 3, 54, 3);
    229 
    230     /* F3_4 */
    231     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
    232                  _bcmFieldSliceSelFpf3, 4, 24, 16);
    233     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
    234                  _bcmFieldSliceSelFpf3, 4, 24, 12);
    235     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
    236                  _bcmFieldSliceSelFpf3, 4, 36, 1);
    237     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
    238                  _bcmFieldSliceSelFpf3, 4, 37, 3);
    239     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlan,
    240                  _bcmFieldSliceSelFpf3, 4, 40, 16);
    241     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId,
    242                  _bcmFieldSliceSelFpf3, 4, 40, 12);
    243     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi,
    244                  _bcmFieldSliceSelFpf3, 4, 52, 1);
    245     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri,
    246                  _bcmFieldSliceSelFpf3, 4, 53, 3);
    247 
    248     /* F3_5 */
    249     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
    250                  _bcmFieldSliceSelFpf3, 5, 24, 16);
    251     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
    252                  _bcmFieldSliceSelFpf3, 5, 24, 12);
    253     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
    254                  _bcmFieldSliceSelFpf3, 5, 36, 1);
    255     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
    256                  _bcmFieldSliceSelFpf3, 5, 37, 3);
    257     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType,
    258                  _bcmFieldSliceSelFpf3, 5, 40, 16);
    259 
    260     /* F3_6 */
    261     /* MPLS Terminated is not supported */
    262     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanTranslationHit,
    263                  _bcmFieldSliceSelFpf3, 6, 25, 1);
    264     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyForwardingVlanValid,
    265                  _bcmFieldSliceSelFpf3, 6, 26, 1);
    266     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIngressStpState,
    267                  _bcmFieldSliceSelFpf3, 6, 27, 2);
    268     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2SrcHit,
    269                  _bcmFieldSliceSelFpf3, 6, 29, 1);
    270     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2SrcStatic,
    271                  _bcmFieldSliceSelFpf3, 6, 30, 1);
    272     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2DestHit,
    273                  _bcmFieldSliceSelFpf3, 6, 31, 1);
    274     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2CacheHit,
    275                  _bcmFieldSliceSelFpf3, 6, 33, 1);
    276     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3SrcHostHit,
    277                  _bcmFieldSliceSelFpf3, 6, 34, 1);
    278     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3DestHostHit,
    279                  _bcmFieldSliceSelFpf3, 6, 35, 1);
    280     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpmcStarGroupHit,
    281                  _bcmFieldSliceSelFpf3, 6, 36, 1);
    282     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3DestRouteHit,
    283                  _bcmFieldSliceSelFpf3, 6, 37, 1);
    284     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2StationMove,
    285                  _bcmFieldSliceSelFpf3, 6, 38, 1);
    286     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDosAttack,
    287                  _bcmFieldSliceSelFpf3, 6, 39, 1);
    288     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlan,
    289                  _bcmFieldSliceSelFpf3, 6, 40, 16);
    290     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId,
    291                  _bcmFieldSliceSelFpf3, 6, 40, 12);
    292     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi,
    293                  _bcmFieldSliceSelFpf3, 6, 52, 1);
    294     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri,
    295                  _bcmFieldSliceSelFpf3, 6, 53, 3);
    296 
    297     /* F3_7 */
    298     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyRangeCheck,
    299                  _bcmFieldSliceSelFpf3, 7, 24, 24);
    300     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, _bcmFieldQualifyRangeCheckBits24_31,
    301                                _bcmFieldSliceSelFpf3, 7,
    302                                _bcmFieldSliceIntfClassSelect, 3, 48, 8);
    303     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort,
    304                                _bcmFieldSliceSelFpf3, 7,
    305                                _bcmFieldSliceIntfClassSelect, 0, 48, 8);
    306     /* bcmFieldQualifyInterfaceClassL3 is not supported */
    307     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassL2,
    308                                _bcmFieldSliceSelFpf3, 7,
    309                                _bcmFieldSliceIntfClassSelect, 2, 48, 8);
    310 
    311     /* F3_8 */
    312     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp6FlowLabel,
    313                  _bcmFieldSliceSelFpf3, 8, 24, 20);
    314     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat,
    315                  _bcmFieldSliceSelFpf3, 8, 44, 2);
    316     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2Format,
    317                  _bcmFieldSliceSelFpf3, 8, 46, 2);
    318     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTranslatedVlanFormat,
    319                  _bcmFieldSliceSelFpf3, 8, 48, 2);
    320     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerTpid,
    321                  _bcmFieldSliceSelFpf3, 8, 50, 2);
    322     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterTpid,
    323                  _bcmFieldSliceSelFpf3, 8, 52, 2);
    324     /* F3_9 */
    325     _FP_QUAL_ADD(unit, stage_fc, _bcmFieldQualifyData3,
    326                  _bcmFieldSliceSelFpf3, 9, 24, 32);
    327     
    328     /* F3_10 */
    329     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstPort,
    330                                _bcmFieldSliceSelFpf3, 10,
    331                                _bcmFieldSliceDstFwdEntitySelect,
    332                                _bcmFieldFwdEntityGlp, 24, 17);
    333     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstGport,
    334                                _bcmFieldSliceSelFpf3, 10,
    335                                _bcmFieldSliceDstFwdEntitySelect,
    336                                _bcmFieldFwdEntityCommonGport, 24, 17);
    337     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk,
    338                                _bcmFieldSliceSelFpf3, 10,
    339                                _bcmFieldSliceDstFwdEntitySelect,
    340                                _bcmFieldFwdEntityGlp, 24, 17);
    341     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3Egress,
    342                                _bcmFieldSliceSelFpf3, 10,
    343                                _bcmFieldSliceDstFwdEntitySelect,
    344                                _bcmFieldFwdEntityL3Egress, 24, 17);
    345     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3EgressNextHops,
    346                                _bcmFieldSliceSelFpf3, 10,
    347                                _bcmFieldSliceDstFwdEntitySelect,
    348                                _bcmFieldFwdEntityL3Egress, 24, 17);
    349     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMulticastGroup,
    350                                _bcmFieldSliceSelFpf3, 10,
    351                                _bcmFieldSliceDstFwdEntitySelect,
    352                                _bcmFieldFwdEntityMulticastGroup, 24, 17);
    353     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstPort,
    354                  _bcmFieldSliceSelFpf3, 10, 41, 14);
    355     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk,
    356                  _bcmFieldSliceSelFpf3, 10, 41, 14);
    357     
    358     /* F3_11 */
    359     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcPort,
    360                  _bcmFieldSliceSelFpf3, 11, 24, 14);
    361     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcTrunk,
    362                  _bcmFieldSliceSelFpf3, 11, 24, 14);
    363     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcModPortGport,
    364                  _bcmFieldSliceSelFpf3, 11, 24, 14);
    365     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcModuleGport,
    366                  _bcmFieldSliceSelFpf3, 11, 30, 7);
    367     
    368     /* F3_12 */
    369     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVnTag,
    370                                _bcmFieldSliceSelFpf3, 12,
    371                                _bcmFieldSliceAuxTag2Select,
    372                                _bcmFieldAuxTagVn, 24, 33);
    373 
    374     /* FPF2 */
    375     /* F2_0 */
    376     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtl,
    377                  _bcmFieldSliceSelFpf2, 0,
    378                  _bcmFieldSliceTtlClassSelect, 0,
    379                  61, 8);
    380     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassZero,
    381                  _bcmFieldSliceSelFpf2, 0,
    382                  _bcmFieldSliceTtlClassSelect, 0,
    383                  61, 8);
    384     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassOne,
    385                  _bcmFieldSliceSelFpf2, 0,
    386                  _bcmFieldSliceTtlClassSelect, 1,
    387                  61, 8);
    388     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl,
    389                  _bcmFieldSliceSelFpf2, 0,
    390                  _bcmFieldSliceTcpClassSelect, 0,
    391                  69, 6);
    392     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpClassZero,
    393                  _bcmFieldSliceSelFpf2, 0,
    394                  _bcmFieldSliceTcpClassSelect, 0,
    395                  69, 6);
    396     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpClassOne,
    397                  _bcmFieldSliceSelFpf2, 0,
    398                  _bcmFieldSliceTcpClassSelect, 1,
    399                  69, 6);
    400     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpFlags,
    401                  _bcmFieldSliceSelFpf2, 0, 75, 2);
    402     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTos,
    403                  _bcmFieldSliceSelFpf2, 0,
    404                  _bcmFieldSliceTosClassSelect, 0,
    405                  77, 8);
    406     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassZero,
    407                  _bcmFieldSliceSelFpf2, 0,
    408                  _bcmFieldSliceTosClassSelect, 0,
    409                  77, 8);
    410     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassOne,
    411                  _bcmFieldSliceSelFpf2, 0,
    412                  _bcmFieldSliceTosClassSelect, 1,
    413                  77, 8);
    414     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort,
    415                  _bcmFieldSliceSelFpf2, 0, 85, 16);
    416     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort,
    417                  _bcmFieldSliceSelFpf2, 0, 101, 16);
    418     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol,
    419                  _bcmFieldSliceSelFpf2, 0, 117, 8);
    420     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp,
    421                  _bcmFieldSliceSelFpf2, 0, 125, 32);
    422     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp,
    423                  _bcmFieldSliceSelFpf2, 0, 157, 32);
    424 
    425     /* F2_1 */
    426     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtl,
    427                  _bcmFieldSliceSelFpf2, 1,
    428                  _bcmFieldSliceTtlClassSelect, 0,
    429                  61, 8);
    430     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassZero,
    431                  _bcmFieldSliceSelFpf2, 1,
    432                  _bcmFieldSliceTtlClassSelect, 0,
    433                  61, 8);
    434     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassOne,
    435                  _bcmFieldSliceSelFpf2, 1,
    436                  _bcmFieldSliceTtlClassSelect, 1,
    437                  61, 8);
    438     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl,
    439                  _bcmFieldSliceSelFpf2, 1,
    440                  _bcmFieldSliceTcpClassSelect, 0,
    441                  69, 6);
    442     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpClassZero,
    443                  _bcmFieldSliceSelFpf2, 1,
    444                  _bcmFieldSliceTcpClassSelect, 0,
    445                  69, 6);
    446     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpClassOne,
    447                  _bcmFieldSliceSelFpf2, 1,
    448                  _bcmFieldSliceTcpClassSelect, 1,
    449                  69, 6);
    450     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpFrag,
    451                  _bcmFieldSliceSelFpf2, 1, 75, 2);
    452     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTos,
    453                  _bcmFieldSliceSelFpf2, 1,
    454                  _bcmFieldSliceTosClassSelect, 0,
    455                  77, 8);
    456     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassZero,
    457                  _bcmFieldSliceSelFpf2, 1,
    458                  _bcmFieldSliceTosClassSelect, 0,
    459                  77, 8);
    460     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassOne,
    461                  _bcmFieldSliceSelFpf2, 1,
    462                  _bcmFieldSliceTosClassSelect, 1,
    463                  77, 8);
    464     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort,
    465                  _bcmFieldSliceSelFpf2, 1, 85, 16);
    466     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort,
    467                  _bcmFieldSliceSelFpf2, 1, 101, 16);
    468     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol,
    469                  _bcmFieldSliceSelFpf2, 1, 117, 8);
    470     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp,
    471                  _bcmFieldSliceSelFpf2, 1, 125, 32);
    472     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp,
    473                  _bcmFieldSliceSelFpf2, 1, 157, 32);
    474 
    475     /* F2_2 */
    476     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp6,
    477                  _bcmFieldSliceSelFpf2, 2, 61, 128);
    478 
    479     /* F2_3 */
    480     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6,
    481                  _bcmFieldSliceSelFpf2, 3, 61, 128);
    482 
    483     /* F2_4 */
    484     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtl,
    485                  _bcmFieldSliceSelFpf2, 4,
    486                  _bcmFieldSliceTtlClassSelect, 0,
    487                  61, 8);
    488     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassZero,
    489                  _bcmFieldSliceSelFpf2, 4,
    490                  _bcmFieldSliceTtlClassSelect, 0,
    491                  61, 8);
    492     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassOne,
    493                  _bcmFieldSliceSelFpf2, 4,
    494                  _bcmFieldSliceTtlClassSelect, 1,
    495                  61, 8);
    496     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl,
    497                  _bcmFieldSliceSelFpf2, 4,
    498                  _bcmFieldSliceTcpClassSelect, 0,
    499                  69, 6);
    500     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpClassZero,
    501                  _bcmFieldSliceSelFpf2, 4,
    502                  _bcmFieldSliceTcpClassSelect, 0,
    503                  69, 6);
    504     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTcpClassOne,
    505                  _bcmFieldSliceSelFpf2, 4,
    506                  _bcmFieldSliceTcpClassSelect, 1,
    507                  69, 6);
    508     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp6FlowLabel,
    509                  _bcmFieldSliceSelFpf2, 4, 75, 20);
    510     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTos,
    511                  _bcmFieldSliceSelFpf2, 4,
    512                  _bcmFieldSliceTosClassSelect, 0,
    513                  95, 8);
    514     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassZero,
    515                  _bcmFieldSliceSelFpf2, 4,
    516                  _bcmFieldSliceTosClassSelect, 0,
    517                  95, 8);
    518     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassOne,
    519                  _bcmFieldSliceSelFpf2, 4,
    520                  _bcmFieldSliceTosClassSelect, 1,
    521                  95, 8);
    522     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol,
    523                  _bcmFieldSliceSelFpf2, 4, 103, 8);
    524     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIntCongestionNotification,
    525                  _bcmFieldSliceSelFpf2, 4, 111, 2);
    526     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6High,
    527                  _bcmFieldSliceSelFpf2, 4, 125, 64);
    528 
    529     /* F2_5 */
    530     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
    531                  _bcmFieldSliceSelFpf2, 5, 61, 16);
    532     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
    533                  _bcmFieldSliceSelFpf2, 5, 61, 12);
    534     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
    535                  _bcmFieldSliceSelFpf2, 5, 73, 1);
    536     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
    537                  _bcmFieldSliceSelFpf2, 5, 74, 3);
    538     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType,
    539                  _bcmFieldSliceSelFpf2, 5, 77, 16);
    540     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMac,
    541                  _bcmFieldSliceSelFpf2, 5, 93, 48);
    542     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMac,
    543                  _bcmFieldSliceSelFpf2, 5, 141, 48);
    544 
    545     /* F2_6 */
    546     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
    547                  _bcmFieldSliceSelFpf2, 6, 61, 16);
    548     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
    549                  _bcmFieldSliceSelFpf2, 6, 61, 12);
    550     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
    551                  _bcmFieldSliceSelFpf2, 6, 73, 1);
    552     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
    553                  _bcmFieldSliceSelFpf2, 6, 74, 3);
    554     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType,
    555                  _bcmFieldSliceSelFpf2, 6, 77, 16);
    556     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMac,
    557                  _bcmFieldSliceSelFpf2, 6, 93, 48);
    558     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp,
    559                  _bcmFieldSliceSelFpf2, 6, 141, 32);
    560 
    561     /* F2_7 */
    562     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
    563                  _bcmFieldSliceSelFpf2, 7, 61, 16);
    564     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
    565                  _bcmFieldSliceSelFpf2, 7, 61, 12);
    566     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
    567                  _bcmFieldSliceSelFpf2, 7, 73, 1);
    568     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
    569                  _bcmFieldSliceSelFpf2, 7, 74, 3);
    570     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType,
    571                  _bcmFieldSliceSelFpf2, 7, 77, 16);
    572     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtl,
    573                  _bcmFieldSliceSelFpf2, 7,
    574                  _bcmFieldSliceTtlClassSelect, 0,
    575                  93, 8);
    576     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassZero,
    577                  _bcmFieldSliceSelFpf2, 7,
    578                  _bcmFieldSliceTtlClassSelect, 0,
    579                  93, 8);
    580     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTtlClassOne,
    581                  _bcmFieldSliceSelFpf2, 7,
    582                  _bcmFieldSliceTtlClassSelect, 1,
    583                  93, 8);
    584     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol,
    585                  _bcmFieldSliceSelFpf2, 7, 101, 8);
    586     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp,
    587                  _bcmFieldSliceSelFpf2, 7, 109, 32);
    588     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMac,
    589                  _bcmFieldSliceSelFpf2, 7, 141, 48);
    590 
    591     /* F2_8 */
    592     _FP_QUAL_ADD(unit, stage_fc, _bcmFieldQualifyData0,
    593                  _bcmFieldSliceSelFpf2, 8, 61, 128);
    594 
    595     /* F2_9 */
    596     _FP_QUAL_ADD(unit, stage_fc, _bcmFieldQualifyData1,
    597                  _bcmFieldSliceSelFpf2, 9, 61, 128);
    598 
    599     /* F2_10 */
    600     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp6High,
    601                  _bcmFieldSliceSelFpf2, 10, 61, 64);
    602     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6High,
    603                  _bcmFieldSliceSelFpf2, 10, 125, 64);
    604 
    605     /* F2_11 */
    606     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMac,
    607                  _bcmFieldSliceSelFpf2, 11, 61, 48);
    608     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMac,
    609                  _bcmFieldSliceSelFpf2, 11, 109, 48);
    610 
    611     /* FPF1 */
    612     /* F1_0 */
    613     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL2,
    614                                _bcmFieldSliceSelFpf1, 0,
    615                                _bcmFieldSliceDstClassSelect, 0, 189, 6);
    616     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL3,
    617                                _bcmFieldSliceSelFpf1, 0,
    618                                _bcmFieldSliceDstClassSelect, 1, 189, 6);
    619     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField,
    620                                _bcmFieldSliceSelFpf1, 0,
    621                                _bcmFieldSliceDstClassSelect, 2, 189, 6);
    622     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField,
    623                                _bcmFieldSliceSelFpf1, 0,
    624                                _bcmFieldSliceSrcClassSelect, 2, 195, 6);
    625     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2,
    626                                _bcmFieldSliceSelFpf1, 0,
    627                                _bcmFieldSliceSrcClassSelect, 0, 195, 6);
    628     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3,
    629                                _bcmFieldSliceSelFpf1, 0,
    630                                _bcmFieldSliceSrcClassSelect, 1, 195, 6);
    631     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField,
    632                                _bcmFieldSliceSelFpf1, 0,
    633                                _bcmFieldSliceSrcClassSelect, 3, 195, 6);
    634     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField,
    635                                _bcmFieldSliceSelFpf1, 0,
    636                                _bcmFieldSliceDstClassSelect, 3, 189, 6);
    637     /* VRF and VFI are not supported in ForwardingField */
    638     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 
    639                                bcmFieldQualifyForwardingVlanId,
    640                                _bcmFieldSliceSelFpf1, 0,
    641                                _bcmFieldSliceFwdFieldSelect, 
    642                                _bcmFieldFwdFieldVlan, 201, 12);
    643     /* SVP and L3IIF are not supported in SVP_L3IIF_OVERLAY */
    644 
    645     /* F1_1 */
    646     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstPort,
    647                                _bcmFieldSliceSelFpf1, 1,
    648                                _bcmFieldSliceDstFwdEntitySelect,
    649                                _bcmFieldFwdEntityGlp, 189, 17);
    650     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstGport,
    651                                _bcmFieldSliceSelFpf1, 1,
    652                                _bcmFieldSliceDstFwdEntitySelect,
    653                                _bcmFieldFwdEntityCommonGport, 189, 17);
    654     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk,
    655                                _bcmFieldSliceSelFpf1, 1,
    656                                _bcmFieldSliceDstFwdEntitySelect,
    657                                _bcmFieldFwdEntityGlp, 189, 17);
    658     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3Egress,
    659                                _bcmFieldSliceSelFpf1, 1,
    660                                _bcmFieldSliceDstFwdEntitySelect,
    661                                _bcmFieldFwdEntityL3Egress, 189, 17);
    662     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3EgressNextHops,
    663                                _bcmFieldSliceSelFpf1, 1,
    664                                _bcmFieldSliceDstFwdEntitySelect,
    665                                _bcmFieldFwdEntityL3Egress, 189, 17);
    666     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMulticastGroup,
    667                                _bcmFieldSliceSelFpf1, 1,
    668                                _bcmFieldSliceDstFwdEntitySelect,
    669                                _bcmFieldFwdEntityMulticastGroup, 189, 17);
    670     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcPort,
    671                                _bcmFieldSliceSelFpf1, 1,
    672                                _bcmFieldSliceSrcEntitySelect,
    673                                _bcmFieldFwdEntityGlp, 206, 15);
    674     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcTrunk,
    675                                _bcmFieldSliceSelFpf1, 1,
    676                                _bcmFieldSliceSrcEntitySelect,
    677                                _bcmFieldFwdEntityGlp, 206, 15);
    678     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcModPortGport,
    679                                _bcmFieldSliceSelFpf1, 1,
    680                                _bcmFieldSliceSrcEntitySelect,
    681                                _bcmFieldFwdEntityModPortGport, 206, 15);
    682     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcModuleGport,
    683                                _bcmFieldSliceSelFpf1, 1,
    684                                _bcmFieldSliceSrcEntitySelect,
    685                                _bcmFieldFwdEntityModPortGport, 212, 8);
    686     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTrunkMemberSourceModuleId,
    687                                _bcmFieldSliceSelFpf1, 1,
    688                                _bcmFieldSliceSrcEntitySelect,
    689                                _bcmFieldFwdEntityModPortGport, 212, 8);
    690     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMHOpcode,
    691                  _bcmFieldSliceSelFpf1, 1, 221, 3);
    692 
    693 
    694     /* F1_2 */
    695     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstPort,
    696                                _bcmFieldSliceSelFpf1, 2,
    697                                _bcmFieldSliceDstFwdEntitySelect,
    698                                _bcmFieldFwdEntityGlp, 189, 17);
    699     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstGport,
    700                                _bcmFieldSliceSelFpf1, 2,
    701                                _bcmFieldSliceDstFwdEntitySelect,
    702                                _bcmFieldFwdEntityCommonGport, 189, 17);
    703     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk,
    704                                _bcmFieldSliceSelFpf1, 2,
    705                                _bcmFieldSliceDstFwdEntitySelect,
    706                                _bcmFieldFwdEntityGlp, 189, 17);
    707     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3Egress,
    708                                _bcmFieldSliceSelFpf1, 2,
    709                                _bcmFieldSliceDstFwdEntitySelect,
    710                                _bcmFieldFwdEntityL3Egress, 189, 17);
    711     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3EgressNextHops,
    712                                _bcmFieldSliceSelFpf1, 2,
    713                                _bcmFieldSliceDstFwdEntitySelect,
    714                                _bcmFieldFwdEntityL3Egress, 189, 17);
    715     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMulticastGroup,
    716                                _bcmFieldSliceSelFpf1, 2,
    717                                _bcmFieldSliceDstFwdEntitySelect,
    718                                _bcmFieldFwdEntityMulticastGroup, 189, 17);
    719     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMHOpcode,
    720                  _bcmFieldSliceSelFpf1, 2, 206, 3);
    721     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL2,
    722                                _bcmFieldSliceSelFpf1, 2,
    723                                _bcmFieldSliceDstClassSelect, 0, 209, 6);
    724     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL3,
    725                                _bcmFieldSliceSelFpf1, 2,
    726                                _bcmFieldSliceDstClassSelect, 1, 209, 6);
    727     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField,
    728                                _bcmFieldSliceSelFpf1, 2,
    729                                _bcmFieldSliceDstClassSelect, 2, 209, 6);
    730     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField,
    731                                _bcmFieldSliceSelFpf1, 2,
    732                                _bcmFieldSliceSrcClassSelect, 2, 215, 6);
    733     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2,
    734                                _bcmFieldSliceSelFpf1, 2,
    735                                _bcmFieldSliceSrcClassSelect, 0, 215, 6);
    736     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3,
    737                                _bcmFieldSliceSelFpf1, 2,
    738                                _bcmFieldSliceSrcClassSelect, 1, 215, 6);
    739     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField,
    740                                _bcmFieldSliceSelFpf1, 2,
    741                                _bcmFieldSliceSrcClassSelect, 3, 215, 6);
    742     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField,
    743                                _bcmFieldSliceSelFpf1, 2,
    744                                _bcmFieldSliceDstClassSelect, 3, 209, 6);
    745 
    746     /* F1_3 */
    747     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
    748                  _bcmFieldSliceSelFpf1, 3, 189, 16);
    749     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
    750                  _bcmFieldSliceSelFpf1, 3, 189, 12);
    751     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
    752                  _bcmFieldSliceSelFpf1, 3, 201, 1);
    753     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
    754                  _bcmFieldSliceSelFpf1, 3, 202, 3);
    755     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlan,
    756                  _bcmFieldSliceSelFpf1, 3, 205, 16);
    757     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId,
    758                  _bcmFieldSliceSelFpf1, 3, 205, 12);
    759     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi,
    760                  _bcmFieldSliceSelFpf1, 3, 217, 1);
    761     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri,
    762                  _bcmFieldSliceSelFpf1, 3, 218, 3);
    763     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterTpid,
    764                  _bcmFieldSliceSelFpf1, 3, 221, 2);
    765 
    766     /* F1_4 */
    767     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
    768                  _bcmFieldSliceSelFpf1, 4, 189, 16);
    769     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
    770                  _bcmFieldSliceSelFpf1, 4, 189, 12);
    771     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
    772                  _bcmFieldSliceSelFpf1, 4, 201, 1);
    773     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
    774                  _bcmFieldSliceSelFpf1, 4, 202, 3);
    775     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType,
    776                  _bcmFieldSliceSelFpf1, 4, 205, 16);
    777 
    778     /* F1_5 */
    779     /* bcmFieldQualifyMplsTerminated is not supported */
    780     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanTranslationHit,
    781                  _bcmFieldSliceSelFpf1, 5, 190, 1);
    782     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyForwardingVlanValid,
    783                  _bcmFieldSliceSelFpf1, 5, 191, 1);
    784     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIngressStpState,
    785                  _bcmFieldSliceSelFpf1, 5, 192, 2);
    786     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2SrcHit,
    787                  _bcmFieldSliceSelFpf1, 5, 194, 1);
    788     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2SrcStatic,
    789                  _bcmFieldSliceSelFpf1, 5, 195, 1);
    790     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2DestHit,
    791                  _bcmFieldSliceSelFpf1, 5, 196, 1);
    792     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2CacheHit,
    793                  _bcmFieldSliceSelFpf1, 5, 198, 1);
    794     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3SrcHostHit,
    795                  _bcmFieldSliceSelFpf1, 5, 199, 1);
    796     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3DestHostHit,
    797                  _bcmFieldSliceSelFpf1, 5, 200, 1);
    798     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpmcStarGroupHit,
    799                  _bcmFieldSliceSelFpf1, 5, 201, 1);
    800     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3DestRouteHit,
    801                  _bcmFieldSliceSelFpf1, 5, 202, 1);
    802     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2StationMove,
    803                  _bcmFieldSliceSelFpf1, 5, 203, 1);
    804     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDosAttack,
    805                  _bcmFieldSliceSelFpf1, 5, 204, 1);
    806     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlan,
    807                  _bcmFieldSliceSelFpf1, 5, 205, 16);
    808     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId,
    809                  _bcmFieldSliceSelFpf1, 5, 205, 12);
    810     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi,
    811                  _bcmFieldSliceSelFpf1, 5, 217, 1);
    812     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri,
    813                  _bcmFieldSliceSelFpf1, 5, 218, 3);
    814     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerTpid,
    815                  _bcmFieldSliceSelFpf1, 5, 221, 2);
    816 
    817     /* F1_6 */
    818     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
    819                  _bcmFieldSliceSelFpf1, 6, 189, 16);
    820     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
    821                  _bcmFieldSliceSelFpf1, 6, 189, 12);
    822     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
    823                  _bcmFieldSliceSelFpf1, 6, 201, 1);
    824     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
    825                  _bcmFieldSliceSelFpf1, 6, 202, 3);
    826     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat,
    827                  _bcmFieldSliceSelFpf1, 6, 205, 2);
    828     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2Format,
    829                  _bcmFieldSliceSelFpf1, 6, 207, 2);
    830     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTranslatedVlanFormat,
    831                  _bcmFieldSliceSelFpf1, 6, 209, 2);
    832     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMHOpcode,
    833                  _bcmFieldSliceSelFpf1, 6, 211, 3);
    834     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyPacketRes,
    835                  _bcmFieldSliceSelFpf1, 6, 214, 5);
    836     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpInfo,
    837                  _bcmFieldSliceSelFpf1, 6, 219, 3);
    838 
    839 
    840     /* F1_7 */
    841     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
    842                  _bcmFieldSliceSelFpf1, 7, 189, 16);
    843     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
    844                  _bcmFieldSliceSelFpf1, 7, 189, 12);
    845     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
    846                  _bcmFieldSliceSelFpf1, 7, 201, 1);
    847     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
    848                  _bcmFieldSliceSelFpf1, 7, 202, 3);
    849     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2,
    850                                _bcmFieldSliceSelFpf1, 7,
    851                                _bcmFieldSliceDstClassSelect, 0, 205, 6);
    852     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3,
    853                                _bcmFieldSliceSelFpf1, 7,
    854                                _bcmFieldSliceDstClassSelect, 1, 205, 6);
    855     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField,
    856                                _bcmFieldSliceSelFpf1, 7,
    857                                _bcmFieldSliceSrcClassSelect, 3, 205, 6);
    858     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField,
    859                                _bcmFieldSliceSelFpf1, 7,
    860                                _bcmFieldSliceSrcClassSelect, 2, 205, 6);
    861     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVrf,
    862                                _bcmFieldSliceSelFpf1, 7,
    863                                _bcmFieldSliceFwdFieldSelect, 
    864                                _bcmFieldFwdFieldVrf, 211, 12);
    865     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVpn,
    866                                _bcmFieldSliceSelFpf1, 7,
    867                                _bcmFieldSliceFwdFieldSelect, 
    868                                _bcmFieldFwdFieldVpn, 211, 12);
    869     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 
    870                                bcmFieldQualifyForwardingVlanId,
    871                                _bcmFieldSliceSelFpf1, 7,
    872                                _bcmFieldSliceFwdFieldSelect, 
    873                                _bcmFieldFwdFieldVlan, 211, 12);
    874 
    875 
    876     /* F1_8 */
    877     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol,
    878                  _bcmFieldSliceSelFpf1, 8, 189, 8);
    879     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTos,
    880                  _bcmFieldSliceSelFpf1, 8,
    881                  _bcmFieldSliceTosClassSelect, 0,
    882                  197, 8);
    883     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassZero,
    884                  _bcmFieldSliceSelFpf1, 8,
    885                  _bcmFieldSliceTosClassSelect, 0,
    886                  197, 8);
    887     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyTosClassOne,
    888                  _bcmFieldSliceSelFpf1, 8,
    889                  _bcmFieldSliceTosClassSelect, 1,
    890                  197, 8);
    891     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2,
    892                                _bcmFieldSliceSelFpf1, 8,
    893                                _bcmFieldSliceDstClassSelect, 0, 205, 6);
    894     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3,
    895                                _bcmFieldSliceSelFpf1, 8,
    896                                _bcmFieldSliceDstClassSelect, 1, 205, 6);
    897     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField,
    898                                _bcmFieldSliceSelFpf1, 8,
    899                                _bcmFieldSliceSrcClassSelect, 3, 205, 6);
    900     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField,
    901                                _bcmFieldSliceSelFpf1, 8,
    902                                _bcmFieldSliceSrcClassSelect, 2, 205, 6);
    903     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, 
    904                                bcmFieldQualifyForwardingVlanId,
    905                                _bcmFieldSliceSelFpf1, 8,
    906                                _bcmFieldSliceFwdFieldSelect, 
    907                                _bcmFieldFwdFieldVlan, 211, 12);
    908     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIntCongestionNotification,
    909                                _bcmFieldSliceSelFpf1, 8, 223, 2);
    910 
    911     /* F1_9 */
    912     _FP_QUAL_ADD(unit, stage_fc, _bcmFieldQualifyData2,
    913                                _bcmFieldSliceSelFpf1, 9, 189, 32);
    914 
    915     /* F1_10 */
    916     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstPort,
    917                                _bcmFieldSliceSelFpf1, 10,
    918                                _bcmFieldSliceDstFwdEntitySelect,
    919                                _bcmFieldFwdEntityGlp, 189, 17);
    920     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstGport,
    921                                _bcmFieldSliceSelFpf1, 10,
    922                                _bcmFieldSliceDstFwdEntitySelect,
    923                                _bcmFieldFwdEntityCommonGport, 189, 17);
    924     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk,
    925                                _bcmFieldSliceSelFpf1, 10,
    926                                _bcmFieldSliceDstFwdEntitySelect,
    927                                _bcmFieldFwdEntityGlp, 189, 17);
    928     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3Egress,
    929                                _bcmFieldSliceSelFpf1, 10,
    930                                _bcmFieldSliceDstFwdEntitySelect,
    931                                _bcmFieldFwdEntityL3Egress, 189, 17);
    932     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstL3EgressNextHops,
    933                                _bcmFieldSliceSelFpf1, 10,
    934                                _bcmFieldSliceDstFwdEntitySelect,
    935                                _bcmFieldFwdEntityL3Egress, 189, 17);
    936     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstMulticastGroup,
    937                                _bcmFieldSliceSelFpf1, 10,
    938                                _bcmFieldSliceDstFwdEntitySelect,
    939                                _bcmFieldFwdEntityMulticastGroup, 189, 17);
    940     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstPort,
    941                  _bcmFieldSliceSelFpf1, 10, 206, 14);
    942     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk,
    943                  _bcmFieldSliceSelFpf1, 10, 206, 14);
    944     
    945     /* F1_11 */
    946     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcPort,
    947                  _bcmFieldSliceSelFpf1, 11, 189, 14);
    948     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcTrunk,
    949                  _bcmFieldSliceSelFpf1, 11, 189, 14);
    950     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcModPortGport,
    951                  _bcmFieldSliceSelFpf1, 11, 189, 14);
    952     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcModuleGport,
    953                  _bcmFieldSliceSelFpf1, 11, 195, 7);
    954     
    955     /* F1_12 */
    956     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
    957                  _bcmFieldSliceSelFpf1, 12, 189, 12);
    958     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL2,
    959                                _bcmFieldSliceSelFpf1, 12,
    960                                _bcmFieldSliceDstClassSelect, 0, 201, 6);
    961     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassL3,
    962                                _bcmFieldSliceSelFpf1, 12,
    963                                _bcmFieldSliceDstClassSelect, 1, 201, 6);
    964     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField,
    965                                _bcmFieldSliceSelFpf1, 12,
    966                                _bcmFieldSliceDstClassSelect, 2, 201, 6);
    967     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField,
    968                                _bcmFieldSliceSelFpf1, 12,
    969                                _bcmFieldSliceDstClassSelect, 3, 201, 6);
    970     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL2,
    971                                _bcmFieldSliceSelFpf1, 12,
    972                                _bcmFieldSliceSrcClassSelect, 0, 207, 6);
    973     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassL3,
    974                                _bcmFieldSliceSelFpf1, 12,
    975                                _bcmFieldSliceSrcClassSelect, 1, 207, 6);
    976     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstClassField,
    977                                _bcmFieldSliceSelFpf1, 12,
    978                                _bcmFieldSliceSrcClassSelect, 2, 207, 6);
    979     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcClassField,
    980                                _bcmFieldSliceSelFpf1, 12,
    981                                _bcmFieldSliceSrcClassSelect, 3, 207, 6);
    982 
    983     /* F1_13 */
    984     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyVnTag,
    985                                _bcmFieldSliceSelFpf1, 13,
    986                                _bcmFieldSliceAuxTag1Select,
    987                                _bcmFieldAuxTagVn, 189, 33);
    988 
    989     /* DWF4 */
    990     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTcpControl,
    991                             _bcmFieldSliceSelFpf4, 1,
    992                             _bcmFieldSliceTcpClassSelect, 0, 0, 6);
    993     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTcpClassZero,
    994                             _bcmFieldSliceSelFpf4, 1,
    995                             _bcmFieldSliceTcpClassSelect, 0, 0, 6);
    996     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTcpClassOne,
    997                             _bcmFieldSliceSelFpf4, 1,
    998                             _bcmFieldSliceTcpClassSelect, 1, 0, 6);
    999 
   1000     /* DWF3 */
   1001     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTos,
   1002                             _bcmFieldSliceSelDisable, 0,
   1003                             _bcmFieldSliceTosClassSelect, 0, 7, 8);
   1004     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTosClassZero,
   1005                             _bcmFieldSliceSelDisable, 0,
   1006                             _bcmFieldSliceTosClassSelect, 0, 7, 8);
   1007     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTosClassOne,
   1008                             _bcmFieldSliceSelDisable, 0,
   1009                             _bcmFieldSliceTosClassSelect, 1, 7, 8);
   1010     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol,
   1011                             _bcmFieldSliceSelDisable, 0,
   1012                             _bcmFieldSliceSelDisable, 0, 15, 8);
   1013     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc,
   1014                             bcmFieldQualifyExtensionHeaderSubCode,
   1015                             _bcmFieldSliceSelDisable, 0,
   1016                             _bcmFieldSliceSelDisable, 0, 23, 8);
   1017     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderType,
   1018                             _bcmFieldSliceSelDisable, 0,
   1019                             _bcmFieldSliceSelDisable, 0, 31, 8);
   1020 
   1021     /* DWF2 */
   1022     /* bcmFieldQualifyMplsTerminated is not supported */
   1023     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyVlanTranslationHit,
   1024                             _bcmFieldSliceSelFpf2, 0,
   1025                             _bcmFieldSliceSelDisable, 0, 56, 1);
   1026     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyForwardingVlanValid,
   1027                             _bcmFieldSliceSelFpf2, 0,
   1028                             _bcmFieldSliceSelDisable, 0, 57, 1);
   1029     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyIngressStpState,
   1030                             _bcmFieldSliceSelFpf2, 0,
   1031                             _bcmFieldSliceSelDisable, 0, 58, 2);
   1032     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL2SrcHit,
   1033                             _bcmFieldSliceSelFpf2, 0,
   1034                             _bcmFieldSliceSelDisable, 0, 60, 1);
   1035     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL2SrcStatic,
   1036                             _bcmFieldSliceSelFpf2, 0,
   1037                             _bcmFieldSliceSelDisable, 0, 61, 1);
   1038     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL2DestHit,
   1039                             _bcmFieldSliceSelFpf2, 0,
   1040                             _bcmFieldSliceSelDisable, 0, 62, 1);
   1041     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL2CacheHit,
   1042                             _bcmFieldSliceSelFpf2, 0,
   1043                             _bcmFieldSliceSelDisable, 0, 64, 1);
   1044     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL3SrcHostHit,
   1045                             _bcmFieldSliceSelFpf2, 0,
   1046                             _bcmFieldSliceSelDisable, 0, 65, 1);
   1047     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL3DestHostHit,
   1048                             _bcmFieldSliceSelFpf2, 0,
   1049                             _bcmFieldSliceSelDisable, 0, 66, 1);
   1050     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyIpmcStarGroupHit,
   1051                             _bcmFieldSliceSelFpf2, 0,
   1052                             _bcmFieldSliceSelDisable, 0, 67, 1);
   1053     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL3DestRouteHit,
   1054                             _bcmFieldSliceSelFpf2, 0,
   1055                             _bcmFieldSliceSelDisable, 0, 68, 1);
   1056     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL2StationMove,
   1057                             _bcmFieldSliceSelFpf2, 0,
   1058                             _bcmFieldSliceSelDisable, 0, 69, 1);
   1059     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyDosAttack,
   1060                             _bcmFieldSliceSelFpf2, 0,
   1061                             _bcmFieldSliceSelDisable, 0, 70, 1);
   1062     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyRangeCheck,
   1063                             _bcmFieldSliceSelFpf2, 0,
   1064                             _bcmFieldSliceSelDisable, 0, 71, 24);
   1065     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, _bcmFieldQualifyRangeCheckBits24_31,
   1066                             _bcmFieldSliceSelFpf2, 0,
   1067                             _bcmFieldSliceIntfClassSelect, 3, 95, 8);
   1068     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort,
   1069                             _bcmFieldSliceSelFpf2, 0,
   1070                             _bcmFieldSliceIntfClassSelect, 0, 95, 8);
   1071     /* bcmFieldQualifyInterfaceClassL3 is not supported */
   1072     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassL2,
   1073                             _bcmFieldSliceSelFpf2, 0,
   1074                             _bcmFieldSliceIntfClassSelect, 2, 95, 8);
   1075     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyDstIp,
   1076                             _bcmFieldSliceSelFpf2, 0,
   1077                             _bcmFieldSliceSelDisable, 0, 103, 32);
   1078     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifySrcIp,
   1079                             _bcmFieldSliceSelFpf2, 0,
   1080                             _bcmFieldSliceSelDisable, 0, 135, 32);
   1081     
   1082     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifySrcIp6,
   1083                             _bcmFieldSliceSelFpf2, 1,
   1084                             _bcmFieldSliceSelDisable, 0, 39, 128);
   1085     
   1086     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyDstIp6,
   1087                             _bcmFieldSliceSelFpf2, 2,
   1088                             _bcmFieldSliceSelDisable, 0, 39, 128);
   1089     
   1090     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, _bcmFieldQualifyData1,
   1091                             _bcmFieldSliceSelFpf2, 3,
   1092                             _bcmFieldSliceSelDisable, 0, 39, 128);
   1093     /* DWF1 */
   1094     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTtl,
   1095                             _bcmFieldSliceSelDisable, 0,
   1096                             _bcmFieldSliceTtlClassSelect, 0, 167, 8);
   1097     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTtlClassZero,
   1098                             _bcmFieldSliceSelDisable, 0,
   1099                             _bcmFieldSliceTtlClassSelect, 0, 167, 8);
   1100     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyTtlClassOne,
   1101                             _bcmFieldSliceSelDisable, 0,
   1102                             _bcmFieldSliceTtlClassSelect, 1, 167, 8);
   1103     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyIpFrag,
   1104                             _bcmFieldSliceSelDisable, 0,
   1105                             _bcmFieldSliceSelDisable, 0, 175, 2);
   1106     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort,
   1107                             _bcmFieldSliceSelDisable, 0,
   1108                             _bcmFieldSliceSelDisable, 0, 177, 16);
   1109     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort,
   1110                             _bcmFieldSliceSelDisable, 0,
   1111                             _bcmFieldSliceSelDisable, 0, 193, 16);
   1112 
   1113     _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstPort,
   1114                      _bcmFieldDevSelDisable, 0,
   1115                      _bcmFieldSliceSelDisable, 0, 
   1116                      _bcmFieldSliceDstFwdEntitySelect, 
   1117                      _bcmFieldFwdEntityGlp, 0x1,
   1118                      209, 17, 0, 0, 0, 0, 0);
   1119     _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstGport,
   1120                      _bcmFieldDevSelDisable, 0,
   1121                      _bcmFieldSliceSelDisable, 0, 
   1122                      _bcmFieldSliceDstFwdEntitySelect, 
   1123                      _bcmFieldFwdEntityCommonGport, 0x1,
   1124                      209, 17, 0, 0, 0, 0, 0);
   1125     _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstTrunk,
   1126                      _bcmFieldDevSelDisable, 0,
   1127                                _bcmFieldSliceSelDisable, 0,
   1128                                _bcmFieldSliceDstFwdEntitySelect,
   1129                      _bcmFieldFwdEntityGlp, 0x1,
   1130                      209, 17, 0, 0, 0, 0, 0);
   1131     _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstL3Egress,
   1132                      _bcmFieldDevSelDisable, 0,
   1133                                _bcmFieldSliceSelDisable, 0,
   1134                                _bcmFieldSliceDstFwdEntitySelect,
   1135                      _bcmFieldFwdEntityL3Egress, 0x1,
   1136                      209, 17, 0, 0, 0, 0, 0);
   1137     _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstL3EgressNextHops,
   1138                      _bcmFieldDevSelDisable, 0,
   1139                                _bcmFieldSliceSelDisable, 0,
   1140                                _bcmFieldSliceDstFwdEntitySelect,
   1141                      _bcmFieldFwdEntityL3Egress, 0x1,
   1142                      209, 17, 0, 0, 0, 0, 0);
   1143     _FP_QUAL_EXT_ADD(unit, stage_fc, bcmFieldQualifyDstMulticastGroup,
   1144                      _bcmFieldDevSelDisable, 0,
   1145                                _bcmFieldSliceSelDisable, 0,
   1146                                _bcmFieldSliceDstFwdEntitySelect,
   1147                      _bcmFieldFwdEntityMulticastGroup, 0x1,
   1148                      209, 17, 0, 0, 0, 0, 0);
   1149     _FP_QUAL_INTRASLICE_ADD(unit, stage_fc, 
   1150                             bcmFieldQualifyIntCongestionNotification,
   1151                             _bcmFieldSliceSelDisable, 0,
   1152                             _bcmFieldSliceSelDisable, 0, 226, 2);
   1153     
   1154     /* DONE DWF */
   1155     return (BCM_E_NONE);
   1156 }
   1157 
   1158 /*
   1159  * Function:
   1160  *     _field_gh_lookup_qualifiers_init
   1161  * Purpose:
   1162  *     Initialize device stage lookup qaualifiers
   1163  *     select codes & offsets
   1164  * Parameters:
   1165  *     unit       - (IN) BCM device number.
   1166  *     stage_fc   - (IN) Field Processor stage control structure.
   1167  *
   1168  * Returns:
   1169  *     BCM_E_NONE
   1170  */
   1171 STATIC int
   1172 _field_gh_lookup_qualifiers_init(int unit, _field_stage_t *stage_fc)
   1173 {
   1174     _FP_QUAL_DECL;
   1175 
   1176     /* Input parameters check. */
   1177     if (NULL == stage_fc) {
   1178         return (BCM_E_PARAM);
   1179     }
   1180 
   1181     /* Enable the overlay of Sender Ethernet Address onto MACSA
   1182      * on ARP/RARP packets.
   1183      */
   1184     BCM_IF_ERROR_RETURN
   1185         (soc_reg_field32_modify(unit, ING_CONFIG_64r, REG_PORT_ANY,
   1186                                 ARP_VALIDATION_ENf, 1));
   1187 
   1188     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyStageLookup,
   1189                  _bcmFieldSliceSelDisable, 0, 0, 0);
   1190     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp4,
   1191                  _bcmFieldSliceSelDisable, 0, 0, 0);
   1192     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp6,
   1193                  _bcmFieldSliceSelDisable, 0, 0, 0);
   1194 
   1195     /* FPF3 */
   1196     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlan,
   1197                  _bcmFieldSliceSelFpf3, 0, 0, 16);
   1198     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId,
   1199                  _bcmFieldSliceSelFpf3, 0, 0, 12);
   1200     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi,
   1201                  _bcmFieldSliceSelFpf3, 0, 12, 1);
   1202     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri,
   1203                  _bcmFieldSliceSelFpf3, 0, 13, 3);
   1204     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType,
   1205                  _bcmFieldSliceSelFpf3, 0, 16, 16);
   1206 
   1207     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort,
   1208                                _bcmFieldSliceSelFpf3, 1, 0, 16);
   1209     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort,
   1210                                _bcmFieldSliceSelFpf3, 1, 16, 16);
   1211     
   1212     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTos,
   1213                                _bcmFieldSliceSelFpf3, 2, 0, 8);
   1214     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol,
   1215                                _bcmFieldSliceSelFpf3, 2, 8, 8);
   1216     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderSubCode,
   1217                  _bcmFieldSliceSelFpf3, 2, 16, 8);
   1218     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderType,
   1219                  _bcmFieldSliceSelFpf3, 2, 24, 8);
   1220 
   1221     /* TUNNEL_CLASSID is not supported */
   1222     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlan,
   1223                  _bcmFieldSliceSelFpf3, 3, 8, 16);
   1224     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId,
   1225                  _bcmFieldSliceSelFpf3, 3, 8, 12);
   1226     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi,
   1227                  _bcmFieldSliceSelFpf3, 3, 20, 1);
   1228     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri,
   1229                  _bcmFieldSliceSelFpf3, 3, 21, 3);
   1230     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcModuleGport,
   1231                  _bcmFieldSliceSelFpf3, 3, 24, 7);
   1232 
   1233     /* FPF2 */
   1234     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTtl,
   1235                                _bcmFieldSliceSelFpf2, 0, 32, 8);
   1236     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl,
   1237                  _bcmFieldSliceSelFpf2, 0, 40, 6);
   1238     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpFrag,
   1239                                _bcmFieldSliceSelFpf2, 0, 46, 2);
   1240     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTos,
   1241                                _bcmFieldSliceSelFpf2, 0, 48, 8);
   1242     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort,
   1243                                _bcmFieldSliceSelFpf2, 0, 56, 16);
   1244     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort,
   1245                                _bcmFieldSliceSelFpf2, 0, 72, 16);
   1246     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol,
   1247                                _bcmFieldSliceSelFpf2, 0, 88, 8);
   1248     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp,
   1249                                _bcmFieldSliceSelFpf2, 0, 96, 32);
   1250     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp,
   1251                                _bcmFieldSliceSelFpf2, 0, 128, 32);
   1252     
   1253     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp6,
   1254                                _bcmFieldSliceSelFpf2, 1, 32, 128);
   1255     
   1256     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6,
   1257                                _bcmFieldSliceSelFpf2, 2, 32, 128);
   1258     
   1259     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType,
   1260                  _bcmFieldSliceSelFpf2, 3, 48, 16);
   1261     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMac,
   1262                  _bcmFieldSliceSelFpf2, 3, 64, 48);
   1263     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMac,
   1264                  _bcmFieldSliceSelFpf2, 3, 112, 48);
   1265     
   1266     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTos,
   1267                                _bcmFieldSliceSelFpf2, 4, 32, 8);
   1268     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol,
   1269                                _bcmFieldSliceSelFpf2, 4, 40, 8);
   1270     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp,
   1271                                _bcmFieldSliceSelFpf2, 4, 48, 32);
   1272     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp,
   1273                                _bcmFieldSliceSelFpf2, 4, 80, 32);
   1274     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMac,
   1275                  _bcmFieldSliceSelFpf2, 4, 112, 48);
   1276 
   1277     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTos,
   1278                                _bcmFieldSliceSelFpf2, 5, 32, 8);
   1279     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol,
   1280                                _bcmFieldSliceSelFpf2, 5, 40, 8);
   1281     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp,
   1282                                _bcmFieldSliceSelFpf2, 5, 48, 32);
   1283     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp,
   1284                                _bcmFieldSliceSelFpf2, 5, 80, 32);
   1285     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMac,
   1286                  _bcmFieldSliceSelFpf2, 5, 112, 48);
   1287     
   1288     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp6High,
   1289                                _bcmFieldSliceSelFpf2, 6, 32, 64);
   1290     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6High,
   1291                                _bcmFieldSliceSelFpf2, 6, 96, 64);
   1292     
   1293     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySnap,
   1294                  _bcmFieldSliceSelFpf2, 7, 96, 40);
   1295     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyLlc,
   1296                  _bcmFieldSliceSelFpf2, 7, 136, 24);
   1297 
   1298     /* FPF1 */
   1299     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocolCommon,
   1300                  _bcmFieldSliceSelFpf1, 0, 160, 3);
   1301     /* bcmFieldQualifyTunnelTerminated is not supported */
   1302     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpInfo,
   1303                  _bcmFieldSliceSelFpf1, 0, 164, 1);
   1304     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerTpid,
   1305                  _bcmFieldSliceSelFpf1, 0, 165, 2);
   1306     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterTpid,
   1307                  _bcmFieldSliceSelFpf1, 0, 167, 2);
   1308     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2Format,
   1309                  _bcmFieldSliceSelFpf1, 0, 169, 2);
   1310     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGigProxy,
   1311                  _bcmFieldSliceSelFpf1, 0, 171, 1);
   1312     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGig,
   1313                  _bcmFieldSliceSelFpf1, 0, 172, 1);
   1314     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
   1315                  _bcmFieldSliceSelFpf1, 0, 173, 16);
   1316     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
   1317                  _bcmFieldSliceSelFpf1, 0, 173, 12);
   1318     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
   1319                  _bcmFieldSliceSelFpf1, 0, 185, 1);
   1320     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
   1321                  _bcmFieldSliceSelFpf1, 0, 186, 3);
   1322     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat,
   1323                  _bcmFieldSliceSelFpf1, 0, 189, 2);
   1324     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInPort,
   1325                  _bcmFieldSliceSelFpf1, 0, 191, 6);
   1326     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort,
   1327                  _bcmFieldSliceSelFpf1, 0, 197, 8);
   1328     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpType,
   1329                                _bcmFieldSliceSelFpf1, 0, 205, 4);
   1330     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports,
   1331                  _bcmFieldSliceSelFpf1, 0, 209, 1);
   1332 
   1333     return (BCM_E_NONE);
   1334 }
   1335 
   1336 
   1337 /*
   1338  * Function:
   1339  *     _field_gh_egress_qualifiers_init
   1340  * Purpose:
   1341  *     Initialize device stage egress qaualifiers
   1342  *     select codes & offsets
   1343  * Parameters:
   1344  *     unit       - (IN) BCM device number.
   1345  *     stage_fc   - (IN) Field Processor stage control structure.
   1346  * 
   1347  * Returns:
   1348  *     BCM_E_NONE
   1349  */
   1350 STATIC int
   1351 _field_gh_egress_qualifiers_init(int unit, _field_stage_t *stage_fc)
   1352 {
   1353     _FP_QUAL_DECL;
   1354     _key_fld_ = KEYf;
   1355 
   1356     /* Input parameters check. */
   1357     if (NULL == stage_fc) {
   1358         return (BCM_E_PARAM);
   1359     }
   1360 
   1361     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyStageEgress,
   1362                  _bcmFieldSliceSelDisable, 0, 0, 0);
   1363 
   1364     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports,
   1365                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 0, 1);
   1366     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIntCongestionNotification,
   1367                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 1, 2);
   1368     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL2Format,
   1369                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 25, 2);
   1370     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyEtherType,
   1371                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 27, 16);
   1372     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcMac,
   1373                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 43, 48);
   1374     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstMac,
   1375                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 91, 48);
   1376     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyCpuQueue,
   1377                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 139, 6);
   1378     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanTranslationHit,
   1379                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 145, 1);
   1380     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGigProxy,
   1381                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 146, 1);
   1382     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGig,
   1383                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 147, 1);
   1384     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanCfi,
   1385                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 148, 1);
   1386     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanPri,
   1387                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 149, 3);
   1388     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId,
   1389                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 152, 12);
   1390     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInPort,
   1391                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 165, 6);
   1392     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3Routable,
   1393                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 171, 1);
   1394     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMirrorCopy,
   1395                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 172, 1);
   1396     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
   1397                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 173, 16);
   1398     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
   1399                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 173, 12);
   1400     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
   1401                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 185, 1);
   1402     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
   1403                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 186, 3);
   1404     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat,
   1405                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 189, 2);
   1406     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstHiGig,
   1407                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 191, 1);
   1408     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort,
   1409                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 192, 8);
   1410     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOutPort,
   1411                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 200, 6);
   1412     /* L3_PKT_TYPE */
   1413     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyIpType,
   1414                                _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4,
   1415                                _bcmFieldSliceSelEgrMdlKey4, 0, 206, 4);
   1416     /* MDL */
   1417     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyOamMdl,
   1418                                _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4,
   1419                                _bcmFieldSliceSelEgrMdlKey4, 1, 206, 3);
   1420     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDrop,
   1421                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY4, 210, 1);
   1422 
   1423      _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports,
   1424                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 0, 1);
   1425     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIntCongestionNotification,
   1426                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 1, 2);
   1427     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpFrag,
   1428                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 14, 2);
   1429     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl,
   1430                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 16, 6);
   1431     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort,
   1432                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 22, 16);
   1433     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort,
   1434                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 38, 16);
   1435     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTtl,
   1436                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 54, 8);
   1437     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol,
   1438                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 62, 8);
   1439     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp,
   1440                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 70, 32);
   1441     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifySrcIp,
   1442                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 102, 32);
   1443     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTos,
   1444                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 134, 8);
   1445     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGigProxy,
   1446                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 142, 1);
   1447     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGig,
   1448                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 143, 1);
   1449     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId,
   1450                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 152, 12);
   1451     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInPort,
   1452                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 165, 6);
   1453     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3Routable,
   1454                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 171, 1);
   1455     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMirrorCopy,
   1456                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 172, 1);
   1457     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
   1458                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 173, 16);
   1459     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
   1460                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 173, 12);
   1461     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
   1462                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 185, 1);
   1463     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
   1464                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 186, 3);
   1465     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat,
   1466                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 189, 2);
   1467     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstHiGig,
   1468                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 191, 1);
   1469     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort,
   1470                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 192, 8);
   1471     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOutPort,
   1472                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 200, 6);
   1473     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpType,
   1474                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 206, 4);
   1475     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDrop,
   1476                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 210, 1);
   1477     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp4,
   1478                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1, 0, 0);
   1479  
   1480    /* KEY1 without v4 specific fields. */
   1481     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports,
   1482                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 0, 1);
   1483     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl,
   1484                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 16, 6);
   1485     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort,
   1486                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 22, 16);
   1487     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort,
   1488                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 38, 16);
   1489     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTtl,
   1490                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 54, 8);
   1491     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol,
   1492                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 62, 8);
   1493     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTos,
   1494                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 134, 8);
   1495     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGigProxy,
   1496                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 142, 1);
   1497     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGig,
   1498                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 143, 1);
   1499     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId,
   1500                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 152, 12);
   1501     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInPort,
   1502                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 165, 6);
   1503     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3Routable,
   1504                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 171, 1);
   1505     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMirrorCopy,
   1506                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 172, 1);
   1507     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
   1508                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 173, 16);
   1509     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
   1510                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 173, 12);
   1511     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
   1512                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 185, 1);
   1513     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
   1514                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 186, 3);
   1515     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat,
   1516                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 189, 2);
   1517     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstHiGig,
   1518                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 191, 1);
   1519     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort,
   1520                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 192, 8);
   1521     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOutPort,
   1522                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 200, 6);
   1523     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpType,
   1524                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 206, 4);
   1525     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDrop,
   1526                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY1_NO_V4, 210, 1);
   1527 
   1528     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports,
   1529                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 0, 1);
   1530     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIntCongestionNotification,
   1531                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 1, 2);
   1532     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpProtocol,
   1533                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 6, 8);
   1534     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcIp6,
   1535                                _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2,
   1536                                _bcmFieldSliceIp6AddrSelect,
   1537                                _BCM_FIELD_EGRESS_SLICE_V6_KEY_MODE_SIP6,
   1538                                14, 128);
   1539     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6,
   1540                                _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2,
   1541                                _bcmFieldSliceIp6AddrSelect,
   1542                                _BCM_FIELD_EGRESS_SLICE_V6_KEY_MODE_DIP6,
   1543                                14, 128);
   1544     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifySrcIp6High,
   1545                                _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2,
   1546                                _bcmFieldSliceIp6AddrSelect,
   1547                                _BCM_FIELD_EGRESS_SLICE_V6_KEY_MODE_SIP_DIP_64,
   1548                                14, 64);
   1549     _FP_QUAL_TWO_SLICE_SEL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6High,
   1550                                _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2,
   1551                                _bcmFieldSliceIp6AddrSelect,
   1552                                _BCM_FIELD_EGRESS_SLICE_V6_KEY_MODE_SIP_DIP_64,
   1553                                78, 64);
   1554     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTos,
   1555                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 142, 8);
   1556     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGigProxy,
   1557                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 150, 1);
   1558     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyHiGig,
   1559                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 151, 1);
   1560     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInnerVlanId,
   1561                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 152, 12);
   1562     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInPort,
   1563                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 165, 6);
   1564     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL3Routable,
   1565                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 171, 1);
   1566     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyMirrorCopy,
   1567                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 172, 1);
   1568     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlan,
   1569                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 173, 16);
   1570     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanId,
   1571                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 173, 12);
   1572     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanCfi,
   1573                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 185, 1);
   1574     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOuterVlanPri,
   1575                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 186, 3);
   1576     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyVlanFormat,
   1577                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 189, 2);
   1578     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstHiGig,
   1579                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 191, 1);
   1580     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyInterfaceClassPort,
   1581                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 192, 8);
   1582     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyOutPort,
   1583                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 200, 6);
   1584     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpType,
   1585                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 206, 4);
   1586     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDrop,
   1587                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 210, 1);
   1588     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp6,
   1589                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY2, 0, 0);
   1590 
   1591     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4Ports,
   1592                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 0, 1);
   1593     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIntCongestionNotification,
   1594                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 1, 2);
   1595     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpFrag,
   1596                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 14, 2);
   1597     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTcpControl,
   1598                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 16, 6);
   1599     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4DstPort,
   1600                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 22, 16);
   1601     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyL4SrcPort,
   1602                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 38, 16);
   1603     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyTtl,
   1604                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 54, 8);
   1605     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDstIp6,
   1606                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 62, 128);
   1607     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderSubCode,
   1608                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 190, 8);
   1609     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyExtensionHeaderType,
   1610                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 198, 8);
   1611     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIpType,
   1612                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 206, 4);
   1613     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyDrop,
   1614                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 210, 1);
   1615     _FP_QUAL_ADD(unit, stage_fc, bcmFieldQualifyIp6,
   1616                  _bcmFieldSliceSelFpf3, _BCM_FIELD_EFP_KEY3, 0, 0);
   1617 
   1618 
   1619     return (BCM_E_NONE);
   1620 }
   1621 
   1622 
   1623 
   1624 /*
   1625  * Function:
   1626  *     _field_gh_qualifiers_init
   1627  * Purpose:
   1628  *     Initialize device qaualifiers select codes & offsets
   1629  * Parameters:
   1630  *     unit       - (IN) BCM device number.
   1631  *     stage_fc   - (IN) Field Processor stage control structure. 
   1632  *
   1633  * Returns:
   1634  *     BCM_E_NONE
   1635  * Notes:
   1636  */
   1637 STATIC int
   1638 _field_gh_qualifiers_init(int unit, _field_stage_t *stage_fc)
   1639 {
   1640     int rv;           /* Operation return status. */
   1641 
   1642     /* Input parameters check. */
   1643     if (NULL == stage_fc) {
   1644         return (BCM_E_PARAM);
   1645     }
   1646 
   1647     /* Allocated stage qualifiers configuration array. */
   1648     _FP_XGS3_ALLOC(stage_fc->f_qual_arr, 
   1649                    (_bcmFieldQualifyCount * sizeof(_bcm_field_qual_info_t *)), 
   1650                    "Field qualifiers");
   1651     if (NULL == stage_fc->f_qual_arr) {
   1652         return (BCM_E_MEMORY);
   1653     }
   1654     
   1655     switch (stage_fc->stage_id) {
   1656       case _BCM_FIELD_STAGE_INGRESS:
   1657           rv = _field_gh_ingress_qualifiers_init(unit, stage_fc);
   1658           break;
   1659       case _BCM_FIELD_STAGE_LOOKUP:
   1660           rv = _field_gh_lookup_qualifiers_init(unit, stage_fc);
   1661           break;
   1662       case _BCM_FIELD_STAGE_EGRESS:
   1663           rv = _field_gh_egress_qualifiers_init(unit, stage_fc);
   1664           break;
   1665       case _BCM_FIELD_STAGE_EXTERNAL:  
   1666       default: 
   1667           sal_free(stage_fc->f_qual_arr);
   1668           return (BCM_E_PARAM);
   1669     }
   1670     return (rv);
   1671 }
   1672 
   1673 
   1674 
   1675 /*
   1676  * Function:
   1677  *     _field_gh_write_slice_map_ingress
   1678  *
   1679  * Purpose:
   1680  *     Write the FP_SLICE_MAP (INGRESS)
   1681  *
   1682  * Parameters:
   1683  *     unit
   1684  *     stage_fc - pointer to stage control block
   1685  *     new_fp_virtual_map - virtual map to be written
   1686  *
   1687  * Returns:
   1688  *     nothing
   1689  *     
   1690  * Notes:
   1691  */
   1692 STATIC int
   1693 _field_gh_write_slice_map_ingress(int unit, _field_stage_t *stage_fc)
   1694 {
   1695     fp_slice_map_entry_t map_entry;  /* HW entry buffer.         */
   1696     soc_field_t field;               /* HW entry fields.         */
   1697     int vmap_size;                   /* Virtual map index count. */
   1698     uint32 value;                    /* Field entry value.       */
   1699     int idx;                         /* Map fields iterator.     */     
   1700     int rv;                          /* Operation return status. */
   1701     uint32 virtual_to_physical_map_gh[8] = {
   1702             VIRTUAL_SLICE_0_PHYSICAL_SLICE_NUMBER_ENTRY_0f,
   1703             VIRTUAL_SLICE_1_PHYSICAL_SLICE_NUMBER_ENTRY_0f,
   1704             VIRTUAL_SLICE_2_PHYSICAL_SLICE_NUMBER_ENTRY_0f,
   1705             VIRTUAL_SLICE_3_PHYSICAL_SLICE_NUMBER_ENTRY_0f,
   1706             VIRTUAL_SLICE_4_PHYSICAL_SLICE_NUMBER_ENTRY_0f,
   1707             VIRTUAL_SLICE_5_PHYSICAL_SLICE_NUMBER_ENTRY_0f,
   1708             VIRTUAL_SLICE_6_PHYSICAL_SLICE_NUMBER_ENTRY_0f,
   1709             VIRTUAL_SLICE_7_PHYSICAL_SLICE_NUMBER_ENTRY_0f
   1710     };
   1711 
   1712     uint32 virtual_to_group_map_gh[8] = {
   1713             VIRTUAL_SLICE_0_VIRTUAL_SLICE_GROUP_ENTRY_0f,
   1714             VIRTUAL_SLICE_1_VIRTUAL_SLICE_GROUP_ENTRY_0f,
   1715             VIRTUAL_SLICE_2_VIRTUAL_SLICE_GROUP_ENTRY_0f,
   1716             VIRTUAL_SLICE_3_VIRTUAL_SLICE_GROUP_ENTRY_0f,
   1717             VIRTUAL_SLICE_4_VIRTUAL_SLICE_GROUP_ENTRY_0f,
   1718             VIRTUAL_SLICE_5_VIRTUAL_SLICE_GROUP_ENTRY_0f,
   1719             VIRTUAL_SLICE_6_VIRTUAL_SLICE_GROUP_ENTRY_0f,
   1720             VIRTUAL_SLICE_7_VIRTUAL_SLICE_GROUP_ENTRY_0f
   1721     };
   1722 
   1723     /* Calculate virtual map size. */
   1724     rv = _bcm_field_virtual_map_size_get(unit, stage_fc, &vmap_size); 
   1725     BCM_IF_ERROR_RETURN(rv);
   1726 
   1727     rv = READ_FP_SLICE_MAPm(unit, MEM_BLOCK_ANY, 0, &map_entry);
   1728     BCM_IF_ERROR_RETURN(rv);
   1729 
   1730     for (idx = 0; idx < vmap_size; idx++) {
   1731         value = (stage_fc->vmap[_FP_DEF_INST][0][idx]).vmap_key;
   1732         field = virtual_to_physical_map_gh[idx];
   1733         soc_FP_SLICE_MAPm_field32_set(unit, &map_entry, field, value);
   1734 
   1735         value = (stage_fc->vmap[_FP_DEF_INST][0][idx]).virtual_group;
   1736         field = virtual_to_group_map_gh[idx];
   1737         soc_FP_SLICE_MAPm_field32_set(unit, &map_entry, field, value);
   1738     }
   1739 
   1740     rv = WRITE_FP_SLICE_MAPm(unit, MEM_BLOCK_ALL, 0, &map_entry);
   1741     return (rv);
   1742 }
   1743 
   1744 
   1745 /*
   1746  * Function:
   1747  *     _bcm_field_gh_write_slice_map
   1748  *
   1749  * Purpose:
   1750  *     Write the FP_SLICE_MAP
   1751  *
   1752  * Parameters:
   1753  *     unit
   1754  *     stage_fc - pointer to stage control block
   1755  *     fg - Reference to Field Group Structure.
   1756  *
   1757  * Returns:
   1758  *     nothing
   1759  *     
   1760  * Notes:
   1761  */
   1762 int
   1763 _bcm_field_gh_write_slice_map(int unit, _field_stage_t *stage_fc,
   1764                               _field_group_t *fg)
   1765 {
   1766     int rv = BCM_E_PARAM;   /* Operation return status. */
   1767 
   1768     if (stage_fc->stage_id == _BCM_FIELD_STAGE_INGRESS) {
   1769         rv = _field_gh_write_slice_map_ingress(unit, stage_fc);
   1770     } else if (stage_fc->stage_id == _BCM_FIELD_STAGE_EGRESS) {
   1771         rv =  _bcm_field_trx_write_slice_map_egress(unit, stage_fc);
   1772     } else if (stage_fc->stage_id == _BCM_FIELD_STAGE_LOOKUP) {
   1773         rv =  _bcm_field_trx_write_slice_map_vfp(unit, stage_fc);
   1774     }
   1775 
   1776     return (rv);
   1777 }
   1778 
   1779 
   1780 
   1781 /*
   1782  * Function:
   1783  *     _bcm_field_gh_init
   1784  * Purpose:
   1785  *     Perform initializations that are specific to BCM53400. This
   1786  *     includes initializing the FP field select bit offset tables for FPF[1-3]
   1787  *     for every stage. 
   1788  * Parameters:
   1789  *     unit       - (IN) BCM device number.
   1790  *     fc         - (IN) Field Processor control structure. 
   1791  *
   1792  * Returns:
   1793  *     BCM_E_NONE
   1794  * Notes:
   1795  */
   1796 int
   1797 _bcm_field_gh_init(int unit, _field_control_t *fc) 
   1798 {
   1799     _field_stage_t *stage_fc; /* Stages iteration pointer */
   1800 
   1801     /* Input parameters check. */
   1802     if (NULL == fc) {
   1803         return (BCM_E_PARAM);
   1804     }
   1805 
   1806     stage_fc = fc->stages;
   1807     while (stage_fc) {
   1808         /* Clear hardware table */
   1809         BCM_IF_ERROR_RETURN(_bcm_field_tr_hw_clear(unit, stage_fc));
   1810 
   1811         /* Initialize qualifiers info. */
   1812         BCM_IF_ERROR_RETURN(_field_gh_qualifiers_init(unit, stage_fc));
   1813 
   1814         if (_BCM_FIELD_STAGE_EXTERNAL == stage_fc->stage_id) {
   1815             _bcm_field_tr_external_init(unit, stage_fc);
   1816             stage_fc = stage_fc->next;
   1817             continue;
   1818         }
   1819 
   1820         /* Goto next stage */
   1821         stage_fc = stage_fc->next;
   1822     }
   1823 
   1824     /* Initialize the TOS_FN, TTL_FN, TCP_FN tables */
   1825     BCM_IF_ERROR_RETURN(_bcm_field_trx_tcp_ttl_tos_init(unit));
   1826     
   1827     if (0 == SOC_WARM_BOOT(unit)) {
   1828         /* Enable filter processor */
   1829         BCM_IF_ERROR_RETURN(_field_port_filter_enable_set(unit, fc, TRUE));
   1830 
   1831         /* Enable meter refresh */
   1832         BCM_IF_ERROR_RETURN(_field_meter_refresh_enable_set(unit, fc, TRUE));
   1833     }
   1834 
   1835     /* Initialize the function pointers */
   1836     _field_gh_functions_init(&fc->functions);;
   1837 
   1838     return (BCM_E_NONE);
   1839 }
   1840 
   1841 
   1842 /*
   1843  * Function:
   1844  *     _field_gh_functions_init
   1845  *
   1846  * Purpose:
   1847  *     Set up functions pointers 
   1848  *
   1849  * Parameters:
   1850  *     stage_fc - (IN/OUT) pointers to stage control block whe the device 
   1851  *                         and stage specific functions will be registered.
   1852  *
   1853  * Returns:
   1854  *     nothing
   1855  * Notes:
   1856  */
   1857 STATIC void
   1858 _field_gh_functions_init(_field_funct_t *functions)
   1859 {
   1860     functions->fp_detach               = _bcm_field_tr_detach;
   1861     functions->fp_group_install        = _bcm_field_fb_group_install;
   1862     functions->fp_selcodes_install     = _bcm_field_hu2_selcodes_install;
   1863     functions->fp_slice_clear          = _bcm_field_hu2_slice_clear;
   1864     functions->fp_entry_remove         = _bcm_field_fb_entry_remove;
   1865     functions->fp_entry_move           = _bcm_field_fb_entry_move;
   1866     functions->fp_selcode_get          = _bcm_field_tr_selcode_get;
   1867     functions->fp_selcode_to_qset      = _bcm_field_selcode_to_qset;
   1868     functions->fp_qual_list_get        = _bcm_field_qual_lists_get;
   1869     functions->fp_tcam_policy_clear    = NULL;
   1870     functions->fp_tcam_policy_install  = _bcm_field_tr_entry_install;
   1871     functions->fp_tcam_policy_reinstall  = _bcm_field_tr_entry_reinstall;
   1872     functions->fp_policer_install      = _bcm_field_trx_policer_install;
   1873 /*    functions->fp_slice_reinit       = NULL; */
   1874     functions->fp_write_slice_map      = _bcm_field_gh_write_slice_map;
   1875     functions->fp_qualify_ip_type      = _bcm_field_trx_qualify_ip_type;
   1876     functions->fp_qualify_ip_type_get  = _bcm_field_trx_qualify_ip_type_get;
   1877     functions->fp_action_support_check = _bcm_field_trx_action_support_check;
   1878     functions->fp_action_conflict_check = _bcm_field_trx_action_conflict_check;
   1879     functions->fp_counter_get          = _bcm_field_tr_counter_get;
   1880     functions->fp_counter_set          = _bcm_field_tr_counter_set;
   1881     functions->fp_stat_index_get       = _bcm_field_trx_stat_index_get;
   1882     functions->fp_action_params_check  = _bcm_field_trx_action_params_check;
   1883     functions->fp_egress_key_match_type_set = 
   1884         _bcm_field_trx_egress_key_match_type_set;
   1885     functions->fp_external_entry_install  = _bcm_field_tr_external_entry_install;
   1886     functions->fp_external_entry_reinstall  = _bcm_field_tr_external_entry_reinstall;
   1887     functions->fp_external_entry_remove   = _bcm_field_tr_external_entry_remove;
   1888     functions->fp_external_entry_prio_set = _bcm_field_tr_external_entry_prio_set;
   1889     functions->fp_data_qualifier_ethertype_add = 
   1890                        _bcm_field_fb_data_qualifier_ethertype_add;
   1891     functions->fp_data_qualifier_ethertype_delete= 
   1892                        _bcm_field_fb_data_qualifier_ethertype_delete;
   1893     functions->fp_data_qualifier_ip_protocol_add = 
   1894                        _bcm_field_fb_data_qualifier_ip_protocol_add;
   1895     functions->fp_data_qualifier_ip_protocol_delete= 
   1896                        _bcm_field_fb_data_qualifier_ip_protocol_delete;
   1897     functions->fp_data_qualifier_packet_format_add= 
   1898                        _bcm_field_fb_data_qualifier_packet_format_add;
   1899     functions->fp_data_qualifier_packet_format_delete=
   1900                        _bcm_field_fb_data_qualifier_packet_format_delete;
   1901     functions->fp_stat_value_get = NULL;
   1902     functions->fp_stat_value_set = NULL;
   1903     functions->fp_control_set = _bcm_field_control_set;
   1904     functions->fp_control_get = _bcm_field_control_get;
   1905     functions->fp_stat_hw_mode_get = _bcm_field_stat_hw_mode_get;
   1906     functions->fp_stat_hw_alloc = _bcm_field_stat_hw_alloc;
   1907     functions->fp_stat_hw_free = _bcm_field_stat_hw_free;
   1908     functions->fp_group_add = NULL;
   1909     functions->fp_qualify_trunk = _bcm_field_qualify_trunk;
   1910     functions->fp_qualify_trunk_get = _bcm_field_qualify_trunk_get;
   1911     functions->fp_qualify_inports = _bcm_field_qualify_InPorts;
   1912     functions->fp_entry_stat_extended_attach = NULL;
   1913     functions->fp_entry_stat_extended_get = NULL;
   1914     functions->fp_entry_stat_detach = _bcm_field_entry_stat_detach;
   1915     functions->fp_class_size_get = NULL;
   1916     functions->fp_qualify_packet_res = _field_qualify_PacketRes;
   1917     functions->fp_qualify_packet_res_get = _field_qualify_PacketRes_get;
   1918 }
   1919 #else /* BCM_GREYHOUND_SUPPORT && BCM_FIELD_SUPPORT */
   1920 int _greyhound_field_not_empty;
   1921 #endif  /* BCM_GREYHOUND_SUPPORT && BCM_FIELD_SUPPORT */