field_map.h (144894B)
1 /** 2 * \file bcm_int/dnx/field/field_map.h 3 * 4 * Field Processor definitions for BCM to DNX qualifier/action translations and fetching DNX params 5 * 6 * Purpose: 7 * 'Field Processor' (FP) Procedures for mapping BCM to DNX qualifiers & actions 8 * Providing info per DNX qualifier/actions 9 */ 10 /* 11 * 12 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 13 * 14 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 15 */ 16 17 #ifndef FIELD_FIELD_MAP_H_INCLUDED 18 /* { */ 19 #define FIELD_FIELD_MAP_H_INCLUDED 20 21 #ifndef BCM_DNX_SUPPORT 22 #error "This file is for use by DNX (JR2) family only!" 23 #endif 24 /* 25 * Include files 26 * { 27 */ 28 #include <shared/utilex/utilex_rhlist.h> 29 #include <bcm_int/dnx/field/field.h> 30 #include <bcm_int/dnx/field/field_entry.h> 31 #include <bcm_int/dnx/field/field_presel.h> 32 #include <bcm_int/dnx/field/field_range.h> 33 #include <bcm_int/dnx/field/tcam/tcam_handler.h> 34 #include <include/bcm_int/dnx/lif/in_lif_profile.h> 35 #include <include/bcm_int/dnx/lif/out_lif_profile.h> 36 #include <soc/dnx/swstate/auto_generated/types/dnx_field_qualifier_types.h> 37 #include <soc/dnx/swstate/auto_generated/types/dnx_field_actions_types.h> 38 #include <soc/dnx/swstate/auto_generated/types/dnx_field_context_types.h> 39 #include <soc/dnx/swstate/auto_generated/types/dnx_field_group_types.h> 40 #include <bcm/field.h> 41 #include <soc/dnx/pp_stage.h> 42 #include <include/soc/dnx/pemladrv/pemladrv_virtual_wires.h> 43 /* 44 * } 45 */ 46 47 /* 48 * Defines 49 * { 50 */ 51 /** 52 * The number of the bit, on output 'offset' (of bcm_field_qualifier_info_get()) 53 * on which we indicate whether the original qualifier was of class 'META2'. 54 * A value of '1' indicates 'META2 offset'. 55 */ 56 #define QUAL_OFFSET_META2_BIT 31 57 /** 58 * Maximum offset value(6b) for DNX_FIELD_INPUT_TYPE_LAYER_RECORDS qualifiers 59 */ 60 #define DNX_INPUT_TYPE_MAX_OFFSET_LAYER_RECORDS 63 61 /** 62 * General purpose invalid value. 63 */ 64 #define DNX_BCM_ID_INVALID -1 65 /** 66 * Position of qualifier class inside dnx qualifier 67 */ 68 #define DNX_QUAL_CLASS_SHIFT 24 69 /** 70 * Represents actual max size of qualifier class - 8b 71 * In spite of the fact that actual type is enum, it will never go beyond 256 values 72 */ 73 #define DNX_QUAL_CLASS_MASK 0xFF 74 75 /** 76 * Position of dnx stage inside dnx qualifier 77 */ 78 #define DNX_QUAL_STAGE_SHIFT 16 79 /** 80 * Represents actual max size of dnx stage - 8b 81 * In spite of the fact that actual type is enum, it will never go beyond 256 values 82 */ 83 #define DNX_QUAL_STAGE_MASK 0xFF 84 /** 85 * Represents actual max size of qualifier id - 16b 86 * In spite of the fact that actual underlying type may different per class, it will never go beyond 87 */ 88 #define DNX_QUAL_INDEX_MASK 0xFFFF 89 90 /** 91 * \brief Calculates BCM qualifier from DNX qualifier id for user defined qualifiers, used only internally 92 * in special cases where DNX qual id value is important 93 * \param [in] dnx_qual_id - user defined dnx qualifier id 94 * \return 95 * bcm_field_qualify_t 96 */ 97 #define DNX_USER_ID_TO_BCM(dnx_qual_id) (dnx_qual_id + dnx_data_field.qual.user_1st_get(unit)) 98 99 /** 100 * \brief Checks if a BCM qualifier is within the range of the user defined qualifiers. 101 * \param [in] unit - Unit ID 102 * \param [in] bcm_qual_id - BCM qual ID 103 * \return 104 * TRUE - If bcm_qual_id is within the range of user defined qualifiers. 105 * FALSE - Otherwise. 106 */ 107 #define DNX_FIELD_BCM_QUAL_IS_USER(unit, bcm_qual_id) \ 108 (((bcm_qual_id >= dnx_data_field.qual.user_1st_get(unit)) \ 109 && (bcm_qual_id < dnx_data_field.qual.user_1st_get(unit) + dnx_data_field.qual.user_nof_get(unit)))) 110 111 /** 112 * \brief Checks if a BCM action is within the range of the user defined actions. 113 * \param [in] unit - Unit ID 114 * \param [in] bcm_action_id - BCM qual ID 115 * \return 116 * TRUE - If bcm_action_id is within the range of user defined actions. 117 * FALSE - Otherwise. 118 */ 119 #define DNX_FIELD_BCM_ACTION_IS_USER(unit, bcm_action_id) \ 120 (((bcm_action_id >= dnx_data_field.action.user_1st_get(unit)) \ 121 && (bcm_action_id < dnx_data_field.action.user_1st_get(unit) + dnx_data_field.action.user_nof_get(unit)))) 122 123 /** 124 * \brief Retrieve Qualifier class from dnx qualifier 125 * \param [in] dnx_field_qual - Encoded DNX qualifier 126 * \return 127 * dnx_field_qual_class_e 128 */ 129 #define DNX_QUAL_CLASS(dnx_field_qual) ((dnx_field_qual >> DNX_QUAL_CLASS_SHIFT) & DNX_QUAL_CLASS_MASK) 130 /** 131 * \brief Retrieve Field Stage from dnx qualifier 132 * \param [in] dnx_field_qual - Encoded DNX qualifier 133 * \return 134 * dnx_field_stage_e 135 */ 136 #define DNX_QUAL_STAGE(dnx_field_qual) ((dnx_field_qual >> DNX_QUAL_STAGE_SHIFT) & DNX_QUAL_STAGE_MASK) 137 /** 138 * \brief Retrieve Qualifier ID from dnx qualifier 139 * \param [in] dnx_field_qual - Encoded DNX qualifier 140 * \return 141 * dnx_field_qual_id_t(16 bit) 142 * \remark 143 * Meaning of ID is different per CLass 144 * DNX_FIELD_QUAL_CLASS_META(2) - per stage metadata enum 145 * DNX_FIELD_QUAL_CLASS_LAYER_RECORD - dnx_field_layer_record_qual_e 146 * DNX_FIELD_QUAL_CLASS_USER - Id provided by user or generated by algo 147 * DNX_FIELD_QUAL_CLASS_HEADER - dnx_field_header_qual_e 148 * DNX_FIELD_QUAL_CLASS_SW - dnx_field_sw_qual_e 149 */ 150 #define DNX_QUAL_ID(dnx_field_qual) (dnx_field_qual & DNX_QUAL_INDEX_MASK) 151 152 /** 153 * \brief Check if 2 qualifier are the same (Little bit strange FMPOV, but whatever ...) 154 * \param [in] dnx_qual1 - Encoded DNX qualifier 155 * \param [in] dnx_qual2 - Encoded DNX qualifier 156 * \return 157 * \retval TRUE - if they are the same 158 * \retval FALSE - if they are different 159 */ 160 #define DNX_QUAL_IS_SAME(dnx_qual1,dnx_qual2) \ 161 (dnx_qual1 == dnx_qual2) || \ 162 ((DNX_QUAL_CLASS(dnx_qual1) == DNX_FIELD_QUAL_CLASS_USER) && \ 163 (DNX_QUAL_CLASS(dnx_qual2) == DNX_FIELD_QUAL_CLASS_USER) && \ 164 (DNX_QUAL_ID(dnx_qual1) == DNX_QUAL_ID(dnx_qual2))) 165 /** 166 * \brief Verify QUAL CLass 167 * \param [in] qual_class - DNX qualifier class encoded in qualifier itself 168 * \return 169 * \retval TRUE - if class is valid one 170 * \retval FALSE - if it is not valid 171 */ 172 #define DNX_QUAL_CLASS_VERIFY(qual_class) \ 173 if((qual_class < DNX_FIELD_QUAL_CLASS_FIRST) || (qual_class >= DNX_FIELD_QUAL_CLASS_NOF)) \ 174 { \ 175 SHR_ERR_EXIT(_SHR_E_PARAM, "Qualifier Class:%d is out of range\n", qual_class); \ 176 } 177 178 /** 179 * MAximum number of dnx actions that may be assigned to one bcm action 180 */ 181 #define MAX_DNX_ACTION_PER_BCM 3 182 183 /** 184 * Position of action class inside dnx qualifier 185 */ 186 #define DNX_ACTION_CLASS_SHIFT 24 187 /** 188 * Represents actual max size of action class - 8b 189 * In spite of the fact that actual type is enum, it will never go beyond 256 values 190 */ 191 #define DNX_ACTION_CLASS_MASK 0xFF 192 193 /** 194 * Position of field stage inside dnx action 195 */ 196 #define DNX_ACTION_STAGE_SHIFT 16 197 /** 198 * Represents actual max size of dnx stage - 8b 199 * In spite of the fact that actual type is enum, it will never go beyond 256 values 200 */ 201 #define DNX_ACTION_STAGE_MASK 0xFF 202 /** 203 * Represents actual max size of action id - 16b 204 * In spite of the fact that actual underlying type may different per class, it will never go beyond 205 */ 206 #define DNX_ACTION_INDEX_MASK 0xFFFF 207 208 /** 209 * \brief Retrieve Qualifier class from dnx action 210 * \param [in] dnx_field_action - Encoded DNX action 211 * \return 212 * dnx_field_action_class_e 213 */ 214 #define DNX_ACTION_CLASS(dnx_field_action) ((dnx_field_action >> DNX_ACTION_CLASS_SHIFT) & DNX_ACTION_CLASS_MASK) 215 /** 216 * \brief Retrieve Field Stage from dnx action 217 * \param [in] dnx_field_action - Encoded DNX action 218 * \return 219 * dnx_field_stage_e 220 */ 221 #define DNX_ACTION_STAGE(dnx_field_action) ((dnx_field_action >> DNX_ACTION_STAGE_SHIFT) & DNX_ACTION_STAGE_MASK) 222 /** 223 * \brief Retrieve Action ID from dnx qualifier 224 * \param [in] dnx_field_action - Encoded DNX action 225 * \return 226 * dnx_field_action_id_t(16 bit) 227 * \remark 228 * Meaning of ID is different per CLass 229 * DNX_FIELD_ACTION_CLASS_STATIC - per stage action enum - action type as unified typedef 230 * DNX_FIELD_ACTION_CLASS_USER - Id provided by user or generated by algo 231 * DNX_FIELD_ACTION_CLASS_SW - dnx_field_sw_action_e 232 */ 233 #define DNX_ACTION_ID(dnx_field_action) (dnx_field_action & DNX_QUAL_INDEX_MASK) 234 235 /** 236 * Invalid DNX qualifier serving as undefined(or initial) value 237 */ 238 #define DNX_FIELD_QUAL_TYPE_INVALID DNX_QUAL(DNX_FIELD_QUAL_CLASS_INVALID, DNX_FIELD_STAGE_INVALID, DNX_FIELD_QUAL_ID_INVALID) 239 240 /** 241 * The maximum number of virtual wire qualifiers. 242 */ 243 #define DNX_FIELD_MAP_MAX_VW_QUAL (100) 244 /** 245 * The maximum number of virtual wire actions. 246 */ 247 #define DNX_FIELD_MAP_MAX_VW_ACTION (100) 248 /** 249 * The maximum number of virtual wires that have field actions associated with them. 250 */ 251 #define DNX_FIELD_MAP_MAX_VW_WITH_ACTION (100) 252 /** 253 * The maximum number of actions per virtual write. 254 * For now every virtual wire uses one mapping only, so we use the maximum actions per mapping. 255 */ 256 #define DNX_FIELD_ACTION_MAX_ACTION_PER_VM (DNX_DATA_MAX_FIELD_VIRTUAL_WIRE_ACTIONS_PER_SIGNAL_NOF) 257 258 typedef enum 259 { 260 DNX_FIELD_IFWD2_QUAL_INVALID = DNX_FIELD_QUAL_ID_INVALID, 261 DNX_FIELD_IFWD2_QUAL_FIRST = DNX_FIELD_QUAL_ID_FIRST, 262 /* 263 * Starts from MS qualifier - taken from pmfSpec.doc 264 */ 265 DNX_FIELD_IFWD2_QUAL_FWD_LAYER_INDEX = DNX_FIELD_IFWD2_QUAL_FIRST, 266 DNX_FIELD_IFWD2_QUAL_RPF_ROUTE_VALID, 267 DNX_FIELD_IFWD2_QUAL_FWD1_PRIORITY_DECODER_FWD_PROFILE, 268 DNX_FIELD_IFWD2_QUAL_FWD1_PRIORITY_DECODER_FWD_RESULT, 269 DNX_FIELD_IFWD2_QUAL_FWD1_PRIORITY_DECODER_RPF_PROFILE, 270 DNX_FIELD_IFWD2_QUAL_FWD1_PRIORITY_DECODER_RPF_RESULT, 271 DNX_FIELD_IFWD2_QUAL_MP_PROFILE_SEL, 272 DNX_FIELD_IFWD2_QUAL_RPF_DEFAULT_ROUTE_FOUND, 273 DNX_FIELD_IFWD2_QUAL_ACL_CONTEXT, 274 DNX_FIELD_IFWD2_QUAL_CONTEXT, 275 DNX_FIELD_IFWD2_QUAL_NASID, 276 DNX_FIELD_IFWD2_QUAL_ENABLE_PP_INJECT, 277 DNX_FIELD_IFWD2_QUAL_EEI, 278 DNX_FIELD_IFWD2_QUAL_EGRESS_LEARN_ENABLE, 279 DNX_FIELD_IFWD2_QUAL_FWD_ACTION_CPU_TRAP_CODE, 280 DNX_FIELD_IFWD2_QUAL_FWD_ACTION_CPU_TRAP_QUAL, 281 DNX_FIELD_IFWD2_QUAL_FWD_ACTION_DESTINATION, 282 DNX_FIELD_IFWD2_QUAL_FWD_ACTION_STRENGTH, 283 DNX_FIELD_IFWD2_QUAL_FWD_DOMAIN, 284 DNX_FIELD_IFWD2_QUAL_FWD_DOMAIN_PROFILE, 285 DNX_FIELD_IFWD2_QUAL_FWD_LAYER_ADDITIONAL_INFO, 286 DNX_FIELD_IFWD2_QUAL_GENERAL_DATA_0, 287 DNX_FIELD_IFWD2_QUAL_GENERAL_DATA_1, 288 DNX_FIELD_IFWD2_QUAL_GENERAL_DATA_2, 289 DNX_FIELD_IFWD2_QUAL_GENERAL_DATA_3, 290 DNX_FIELD_IFWD2_QUAL_IEEE1588_COMMAND, 291 DNX_FIELD_IFWD2_QUAL_IEEE1588_COMPENSATE_TIME_STAMP, 292 DNX_FIELD_IFWD2_QUAL_IEEE1588_ENCAPSULATION, 293 DNX_FIELD_IFWD2_QUAL_IEEE1588_HEADER_OFFSET, 294 DNX_FIELD_IFWD2_QUAL_IN_LIF_PROFILE_0, 295 DNX_FIELD_IFWD2_QUAL_IN_LIF_PROFILE_1, 296 DNX_FIELD_IFWD2_QUAL_GLOB_IN_LIF_0, 297 DNX_FIELD_IFWD2_QUAL_GLOB_IN_LIF_1, 298 DNX_FIELD_IFWD2_QUAL_PP_PORT, 299 DNX_FIELD_IFWD2_QUAL_INCOMING_TAG_STRUCTURE, 300 DNX_FIELD_IFWD2_QUAL_INGRESS_LEARN_ENABLE, 301 DNX_FIELD_IFWD2_QUAL_LEARN_INFO, 302 DNX_FIELD_IFWD2_QUAL_MEM_SOFT_ERR, 303 DNX_FIELD_IFWD2_QUAL_NWK_QOS, 304 DNX_FIELD_IFWD2_QUAL_OAM_OFFSET, 305 DNX_FIELD_IFWD2_QUAL_OAM_STAMP_OFFSET, 306 DNX_FIELD_IFWD2_QUAL_OAM_OPCODE, 307 DNX_FIELD_IFWD2_QUAL_OAM_YOUR_DISCR, 308 DNX_FIELD_IFWD2_QUAL_MY_CFM_MAC, 309 DNX_FIELD_IFWD2_QUAL_PACKET_IS_OAM, 310 DNX_FIELD_IFWD2_QUAL_PACKET_IS_BFD, 311 DNX_FIELD_IFWD2_QUAL_MDL, 312 DNX_FIELD_IFWD2_QUAL_VTT_OAM_LIF_0, 313 DNX_FIELD_IFWD2_QUAL_VTT_OAM_LIF_0_VALID, 314 DNX_FIELD_IFWD2_QUAL_VTT_OAM_LIF_1, 315 DNX_FIELD_IFWD2_QUAL_VTT_OAM_LIF_1_VALID, 316 DNX_FIELD_IFWD2_QUAL_VTT_OAM_LIF_2, 317 DNX_FIELD_IFWD2_QUAL_VTT_OAM_LIF_2_VALID, 318 DNX_FIELD_IFWD2_QUAL_VTT_OAM_PCP_0, 319 DNX_FIELD_IFWD2_QUAL_VTT_OAM_PCP_1, 320 DNX_FIELD_IFWD2_QUAL_VTT_OAM_PCP_2, 321 DNX_FIELD_IFWD2_QUAL_GLOB_OUT_LIF_0, 322 DNX_FIELD_IFWD2_QUAL_GLOB_OUT_LIF_1, 323 DNX_FIELD_IFWD2_QUAL_PRT_QUALIFIER, 324 DNX_FIELD_IFWD2_QUAL_PACKET_HEADER_SIZE, 325 DNX_FIELD_IFWD2_QUAL_PACKET_IS_APPLET, 326 DNX_FIELD_IFWD2_QUAL_PACKET_IS_COMPATIBLE_MC, 327 DNX_FIELD_IFWD2_QUAL_PACKET_IS_IEEE1588, 328 DNX_FIELD_IFWD2_QUAL_DP, 329 DNX_FIELD_IFWD2_QUAL_ECN, 330 DNX_FIELD_IFWD2_QUAL_TC, 331 DNX_FIELD_IFWD2_QUAL_PTC, 332 DNX_FIELD_IFWD2_QUAL_RPF_DST, 333 DNX_FIELD_IFWD2_QUAL_RPF_DST_VALID, 334 DNX_FIELD_IFWD2_QUAL_SNOOP_CODE, 335 DNX_FIELD_IFWD2_QUAL_SNOOP_STRENGTH, 336 DNX_FIELD_IFWD2_QUAL_MIRROR_CODE, 337 DNX_FIELD_IFWD2_QUAL_STATISTICAL_SAMPLING_CODE, 338 DNX_FIELD_IFWD2_QUAL_SRC_SYS_PORT, 339 DNX_FIELD_IFWD2_QUAL_FLP_STATISTICS_ID_0, 340 DNX_FIELD_IFWD2_QUAL_FLP_STATISTICS_ID_1, 341 DNX_FIELD_IFWD2_QUAL_FLP_STATISTICS_ID_2, 342 DNX_FIELD_IFWD2_QUAL_FLP_STATISTICS_ID_3, 343 DNX_FIELD_IFWD2_QUAL_FLP_STATISTICS_ID_4, 344 DNX_FIELD_IFWD2_QUAL_FLP_STATISTICS_ID_5, 345 DNX_FIELD_IFWD2_QUAL_FLP_STATISTICS_ATR_0, 346 DNX_FIELD_IFWD2_QUAL_FLP_STATISTICS_ATR_1, 347 DNX_FIELD_IFWD2_QUAL_FLP_STATISTICS_ATR_2, 348 DNX_FIELD_IFWD2_QUAL_FLP_STATISTICS_ATR_3, 349 DNX_FIELD_IFWD2_QUAL_FLP_STATISTICS_ATR_4, 350 DNX_FIELD_IFWD2_QUAL_FLP_STATISTICS_ATR_5, 351 DNX_FIELD_IFWD2_QUAL_VLAN_EDIT_CMD, 352 DNX_FIELD_IFWD2_QUAL_TRACE_PACKET, 353 DNX_FIELD_IFWD2_QUAL_IN_TTL, 354 DNX_FIELD_IFWD2_QUAL_LIF_OAM_TRAP_PROFILE, 355 DNX_FIELD_IFWD2_QUAL_VISIBILITY_CLEAR, 356 DNX_FIELD_IFWD2_QUAL_VISIBILITY, 357 DNX_FIELD_IFWD2_QUAL_RPF_OUT_LIF, 358 DNX_FIELD_IFWD2_QUAL_ACTION_PROFILE_SA_DROP_INDEX, 359 DNX_FIELD_IFWD2_QUAL_ACTION_PROFILE_SA_NOT_FOUND_INDEX, 360 DNX_FIELD_IFWD2_QUAL_ACTION_PROFILE_DA_NOT_FOUND_INDEX, 361 DNX_FIELD_IFWD2_QUAL_SAVED_CONTEXT_PROFILE, 362 DNX_FIELD_IFWD2_QUAL_IPV4_VERSION_ERROR, 363 DNX_FIELD_IFWD2_QUAL_IPV4_CHECKSUM_ERROR, 364 DNX_FIELD_IFWD2_QUAL_IPV4_TOTAL_LENGTH_ERROR, 365 DNX_FIELD_IFWD2_QUAL_IPV4_OPTIONS_ERROR, 366 DNX_FIELD_IFWD2_QUAL_IPV4_SIP_EQUAL_DIP_ERROR, 367 DNX_FIELD_IFWD2_QUAL_IPV4_DIP_ZERO_ERROR, 368 DNX_FIELD_IFWD2_QUAL_IPV4_SIP_IS_MC_ERROR, 369 DNX_FIELD_IFWD2_QUAL_IPV4_HEADER_LENGTH_ERROR, 370 DNX_FIELD_IFWD2_QUAL_IN_LIF_UNKNOWN_DA_PROFILE, 371 DNX_FIELD_IFWD2_QUAL_NOF_VALID_LM_LIFS, 372 DNX_FIELD_IFWD2_QUAL_IS_IN_LIF_VALID_FOR_LM, 373 DNX_FIELD_IFWD2_QUAL_FWD1_PRIORITY_DECODER_FWD_STRENGTH, 374 DNX_FIELD_IFWD2_QUAL_FWD1_PRIORITY_DECODER_RPF_STRENGTH, 375 DNX_FIELD_IFWD2_QUAL_FWD1_PRIORITY_DECODER_FWD_FOUND, 376 DNX_FIELD_IFWD2_QUAL_FWD1_PRIORITY_DECODER_RPF_FOUND, 377 DNX_FIELD_IFWD2_QUAL_STATISTICS_META_DATA, 378 DNX_FIELD_IFWD2_QUAL_FWD_STAT_ATTRIBUTE_OBJ_CMD, 379 DNX_FIELD_IFWD2_QUAL_FWD_STAT_ATTRIBUTE_OBJ, 380 DNX_FIELD_IFWD2_QUAL_VSI_UNKNOWN_DA_DESTINATION, 381 DNX_FIELD_IFWD2_QUAL_ECMP_LB_KEY_0, 382 DNX_FIELD_IFWD2_QUAL_ECMP_LB_KEY_1, 383 DNX_FIELD_IFWD2_QUAL_ECMP_LB_KEY_2, 384 DNX_FIELD_IFWD2_QUAL_LAG_LB_KEY, 385 DNX_FIELD_IFWD2_QUAL_NWK_LB_KEY, 386 DNX_FIELD_IFWD2_QUAL_CONTEXT_CONSTANTS, 387 DNX_FIELD_IFWD2_QUAL_PMF_ETH_RIF_PROFILE, 388 DNX_FIELD_IFWD2_QUAL_VRF_VALUE, 389 DNX_FIELD_IFWD2_QUAL_UNKNOWN_ADDRESS, 390 DNX_FIELD_IFWD2_QUAL_INGRESS_PROTOCOL_TRAP_IN_LIF_PROFILE, 391 DNX_FIELD_IFWD2_QUAL_AC_IN_LIF_WIDE_DATA, 392 DNX_FIELD_IFWD2_QUAL_VW_VIP_VALID, 393 DNX_FIELD_IFWD2_QUAL_VW_VIP_ID, 394 DNX_FIELD_IFWD2_QUAL_VW_MEMBER_REFERENCE, 395 DNX_FIELD_IFWD2_QUAL_VW_PCC_HIT, 396 DNX_FIELD_IFWD2_QUAL_AC_IN_LIF_WIDE_DATA_EXTENDED, 397 DNX_FIELD_IFWD2_QUAL_MACT_ENTRY_GROUPING, 398 399 DNX_FIELD_IFWD2_QUAL_NOF 400 } dnx_field_ifwd2_qual_e; 401 402 typedef enum 403 { 404 DNX_FIELD_IPMF1_QUAL_INVALID = DNX_FIELD_QUAL_ID_INVALID, 405 DNX_FIELD_IPMF1_QUAL_FIRST = DNX_FIELD_QUAL_ID_FIRST, 406 /* 407 * Starts from MS qualifier - taken from pmfSpec.doc 408 */ 409 DNX_FIELD_IPMF1_QUAL_ALL_ONES = DNX_FIELD_IPMF1_QUAL_FIRST, 410 DNX_FIELD_IPMF1_QUAL_MEM_SOFT_ERR, 411 DNX_FIELD_IPMF1_QUAL_ACL_CONTEXT, 412 DNX_FIELD_IPMF1_QUAL_NASID, 413 DNX_FIELD_IPMF1_QUAL_FWD_CONTEXT, 414 DNX_FIELD_IPMF1_QUAL_RPF_OUT_LIF, 415 DNX_FIELD_IPMF1_QUAL_RPF_DEFAULT_ROUTE_FOUND, 416 DNX_FIELD_IPMF1_QUAL_RPF_ROUTE_VALID, 417 DNX_FIELD_IPMF1_QUAL_PACKET_IS_APPLET, 418 DNX_FIELD_IPMF1_QUAL_GENERAL_DATA_0, 419 DNX_FIELD_IPMF1_QUAL_GENERAL_DATA_1, 420 DNX_FIELD_IPMF1_QUAL_GENERAL_DATA_2, 421 DNX_FIELD_IPMF1_QUAL_FWD_DOMAIN, 422 DNX_FIELD_IPMF1_QUAL_FWD_DOMAIN_PROFILE, 423 DNX_FIELD_IPMF1_QUAL_VLAN_EDIT_VID_2, 424 DNX_FIELD_IPMF1_QUAL_VLAN_EDIT_VID_1, 425 DNX_FIELD_IPMF1_QUAL_VLAN_EDIT_PCP_DEI_2, 426 DNX_FIELD_IPMF1_QUAL_VLAN_EDIT_DEI_2, 427 DNX_FIELD_IPMF1_QUAL_VLAN_EDIT_PCP_2, 428 DNX_FIELD_IPMF1_QUAL_VLAN_EDIT_PCP_DEI_1, 429 DNX_FIELD_IPMF1_QUAL_VLAN_EDIT_DEI_1, 430 DNX_FIELD_IPMF1_QUAL_VLAN_EDIT_PCP_1, 431 DNX_FIELD_IPMF1_QUAL_VLAN_EDIT_CMD_INDEX, 432 DNX_FIELD_IPMF1_QUAL_VLAN_EDIT_CMD, /* Data contains VID1(12), VID2(12), PCP_DEI1(4), PCP_DEI2(4), CMD(7) */ 433 DNX_FIELD_IPMF1_QUAL_SRC_SYS_PORT, 434 DNX_FIELD_IPMF1_QUAL_SNOOP_CODE, 435 DNX_FIELD_IPMF1_QUAL_SNOOP_STRENGTH, 436 DNX_FIELD_IPMF1_QUAL_FWD_LAYER_ADDITIONAL_INFO, 437 DNX_FIELD_IPMF1_QUAL_RPF_DST, 438 DNX_FIELD_IPMF1_QUAL_RPF_DST_VALID, 439 DNX_FIELD_IPMF1_QUAL_PACKET_IS_IEEE1588, 440 DNX_FIELD_IPMF1_QUAL_IEEE1588_COMPENSATE_TIME_STAMP, 441 DNX_FIELD_IPMF1_QUAL_IEEE1588_COMMAND, 442 DNX_FIELD_IPMF1_QUAL_IEEE1588_ENCAPSULATION, 443 DNX_FIELD_IPMF1_QUAL_IEEE1588_HEADER_OFFSET, 444 DNX_FIELD_IPMF1_QUAL_PACKET_IS_COMPATIBLE_MC, 445 DNX_FIELD_IPMF1_QUAL_PRT_QUALIFIER, 446 DNX_FIELD_IPMF1_QUAL_PACKET_HEADER_SIZE, 447 DNX_FIELD_IPMF1_QUAL_OAM_ID, 448 DNX_FIELD_IPMF1_QUAL_OAM_UP_MEP, 449 DNX_FIELD_IPMF1_QUAL_OAM_SUB_TYPE, 450 DNX_FIELD_IPMF1_QUAL_OAM_OFFSET, 451 DNX_FIELD_IPMF1_QUAL_OAM_STAMP_OFFSET, 452 DNX_FIELD_IPMF1_QUAL_MIRROR_CODE, 453 DNX_FIELD_IPMF1_QUAL_VISIBILITY, 454 DNX_FIELD_IPMF1_QUAL_LEARN_INFO, 455 DNX_FIELD_IPMF1_QUAL_INGRESS_LEARN_ENABLE, 456 DNX_FIELD_IPMF1_QUAL_EGRESS_LEARN_ENABLE, 457 DNX_FIELD_IPMF1_QUAL_GLOB_IN_LIF_0, 458 DNX_FIELD_IPMF1_QUAL_GLOB_IN_LIF_1, 459 DNX_FIELD_IPMF1_QUAL_IN_LIF_PROFILE_0, 460 DNX_FIELD_IPMF1_QUAL_IN_LIF_PROFILE_1, 461 DNX_FIELD_IPMF1_QUAL_FWD_ACTION_STRENGTH, 462 DNX_FIELD_IPMF1_QUAL_FWD_ACTION_DESTINATION, 463 DNX_FIELD_IPMF1_QUAL_FWD_ACTION_CPU_TRAP_CODE, 464 DNX_FIELD_IPMF1_QUAL_FWD_ACTION_CPU_TRAP_QUAL, 465 DNX_FIELD_IPMF1_QUAL_EEI, 466 DNX_FIELD_IPMF1_QUAL_ELK_LKP_HIT_7, 467 DNX_FIELD_IPMF1_QUAL_ELK_LKP_HIT_6, 468 DNX_FIELD_IPMF1_QUAL_ELK_LKP_HIT_5, 469 DNX_FIELD_IPMF1_QUAL_ELK_LKP_HIT_4, 470 DNX_FIELD_IPMF1_QUAL_ELK_LKP_HIT_3, 471 DNX_FIELD_IPMF1_QUAL_ELK_LKP_HIT_2, 472 DNX_FIELD_IPMF1_QUAL_ELK_LKP_HIT_1, 473 DNX_FIELD_IPMF1_QUAL_ELK_LKP_HIT_0, 474 /* 475 * Note that DNX_FIELD_IPMF1_QUAL_ELK_LKP_PAYLOAD_ALL_PART_0 and DNX_FIELD_IPMF1_QUAL_ELK_LKP_PAYLOAD_ALL_PART_1 476 * do not represent two different qualifiers, but the 248 bits used for the payload of all six ELK_LKP (KBP) 477 * lookups are larger than the maximum size (160) for a qualifier. 478 */ 479 DNX_FIELD_IPMF1_QUAL_ELK_LKP_PAYLOAD_ALL_PART_1, 480 DNX_FIELD_IPMF1_QUAL_ELK_LKP_PAYLOAD_ALL_PART_0, 481 DNX_FIELD_IPMF1_QUAL_IN_PORT, 482 DNX_FIELD_IPMF1_QUAL_PTC, 483 DNX_FIELD_IPMF1_QUAL_ECMP_LB_KEY_0, 484 DNX_FIELD_IPMF1_QUAL_ECMP_LB_KEY_1, 485 DNX_FIELD_IPMF1_QUAL_ECMP_LB_KEY_2, 486 DNX_FIELD_IPMF1_QUAL_NWK_LB_KEY, 487 DNX_FIELD_IPMF1_QUAL_LAG_LB_KEY, 488 DNX_FIELD_IPMF1_QUAL_GLOB_OUT_LIF_0, 489 DNX_FIELD_IPMF1_QUAL_GLOB_OUT_LIF_1, 490 DNX_FIELD_IPMF1_QUAL_IN_TTL, 491 DNX_FIELD_IPMF1_QUAL_BIER_STR_OFFSET, 492 DNX_FIELD_IPMF1_QUAL_BIER_STR_SIZE, 493 DNX_FIELD_IPMF1_QUAL_PACKET_IS_BIER, 494 DNX_FIELD_IPMF1_QUAL_SAVED_CONTEXT_PROFILE, 495 DNX_FIELD_IPMF1_QUAL_OAM_METER_DISABLE, 496 DNX_FIELD_IPMF1_QUAL_INCOMING_TAG_STRUCTURE, 497 DNX_FIELD_IPMF1_QUAL_TC, 498 DNX_FIELD_IPMF1_QUAL_DP, 499 DNX_FIELD_IPMF1_QUAL_ECN, 500 DNX_FIELD_IPMF1_QUAL_NWK_QOS, 501 DNX_FIELD_IPMF1_QUAL_TRACE_PACKET, 502 DNX_FIELD_IPMF1_QUAL_PACKET_HEADER_SIZE_RANGE, 503 DNX_FIELD_IPMF1_QUAL_IN_PORT_KEY_GEN_VAR, 504 DNX_FIELD_IPMF1_QUAL_IN_PORT_MAPPED_PP_PORT, 505 DNX_FIELD_IPMF1_QUAL_PTC_KEY_GEN_VAR, 506 DNX_FIELD_IPMF1_QUAL_VID_VALID, 507 DNX_FIELD_IPMF1_QUAL_L4OPS, 508 DNX_FIELD_IPMF1_QUAL_STATISTICS_OBJECT10, 509 DNX_FIELD_IPMF1_QUAL_CPU_TRAP_CODE_PROFILE, 510 DNX_FIELD_IPMF1_QUAL_TM_FLOW_ID, 511 DNX_FIELD_IPMF1_QUAL_EXT_STATISTICS_ID_3, 512 DNX_FIELD_IPMF1_QUAL_EXT_STATISTICS_ID_2, 513 DNX_FIELD_IPMF1_QUAL_EXT_STATISTICS_ID_1, 514 DNX_FIELD_IPMF1_QUAL_EXT_STATISTICS_ID_0, 515 DNX_FIELD_IPMF1_QUAL_STATISTICS_ID_9, 516 DNX_FIELD_IPMF1_QUAL_STATISTICS_ID_8, 517 DNX_FIELD_IPMF1_QUAL_STATISTICS_ID_7, 518 DNX_FIELD_IPMF1_QUAL_STATISTICS_ID_6, 519 DNX_FIELD_IPMF1_QUAL_STATISTICS_ID_5, 520 DNX_FIELD_IPMF1_QUAL_STATISTICS_ID_4, 521 DNX_FIELD_IPMF1_QUAL_STATISTICS_ID_3, 522 DNX_FIELD_IPMF1_QUAL_STATISTICS_ID_2, 523 DNX_FIELD_IPMF1_QUAL_STATISTICS_ID_1, 524 DNX_FIELD_IPMF1_QUAL_STATISTICS_ID_0, 525 DNX_FIELD_IPMF1_QUAL_TM_FLOW_ATR, 526 DNX_FIELD_IPMF1_QUAL_EXT_STATISTICS_ATR_3, 527 DNX_FIELD_IPMF1_QUAL_EXT_STATISTICS_ATR_2, 528 DNX_FIELD_IPMF1_QUAL_EXT_STATISTICS_ATR_1, 529 DNX_FIELD_IPMF1_QUAL_EXT_STATISTICS_ATR_0, 530 DNX_FIELD_IPMF1_QUAL_STATISTICS_ATR_9, 531 DNX_FIELD_IPMF1_QUAL_STATISTICS_ATR_8, 532 DNX_FIELD_IPMF1_QUAL_STATISTICS_ATR_7, 533 DNX_FIELD_IPMF1_QUAL_STATISTICS_ATR_6, 534 DNX_FIELD_IPMF1_QUAL_STATISTICS_ATR_5, 535 DNX_FIELD_IPMF1_QUAL_STATISTICS_ATR_4, 536 DNX_FIELD_IPMF1_QUAL_STATISTICS_ATR_3, 537 DNX_FIELD_IPMF1_QUAL_STATISTICS_ATR_2, 538 DNX_FIELD_IPMF1_QUAL_STATISTICS_ATR_1, 539 DNX_FIELD_IPMF1_QUAL_STATISTICS_ATR_0, 540 DNX_FIELD_IPMF1_QUAL_STATISTICS_META_DATA, 541 DNX_FIELD_IPMF1_QUAL_CONTEXT_KEY_GEN_VAR, 542 DNX_FIELD_IPMF1_QUAL_EGRESS_PARSING_INDEX, 543 DNX_FIELD_IPMF1_QUAL_FWD_LAYER_INDEX, 544 DNX_FIELD_IPMF1_QUAL_AC_IN_LIF_WIDE_DATA, 545 DNX_FIELD_IPMF1_QUAL_NATIVE_AC_IN_LIF_WIDE_DATA, 546 DNX_FIELD_IPMF1_QUAL_PP_PORT_PMF_PROFILE, 547 DNX_FIELD_IPMF1_QUAL_TM_PORT_PMF_PROFILE, 548 DNX_FIELD_IPMF1_QUAL_PP_PORT_PMF_GENERAL_DATA, 549 DNX_FIELD_IPMF1_QUAL_PMF_ETH_RIF_PROFILE, 550 DNX_FIELD_IPMF1_QUAL_UNKNOWN_ADDRESS, 551 DNX_FIELD_IPMF1_QUAL_L4OPS_ENCODER0, 552 DNX_FIELD_IPMF1_QUAL_L4OPS_ENCODER1, 553 DNX_FIELD_IPMF1_QUAL_L4OPS_ENCODER2, 554 DNX_FIELD_IPMF1_QUAL_L4OPS_ENCODER3, 555 DNX_FIELD_IPMF1_QUAL_LEARN_SRC_MAC, 556 DNX_FIELD_IPMF1_QUAL_LEARN_VLAN, 557 DNX_FIELD_IPMF1_QUAL_LEARN_VSI, 558 DNX_FIELD_IPMF1_QUAL_LEARN_DATA, 559 DNX_FIELD_IPMF1_QUAL_LEARN_STATION_MOVE, 560 DNX_FIELD_IPMF1_QUAL_LEARN_MATCH, 561 DNX_FIELD_IPMF1_QUAL_LEARN_FOUND, 562 DNX_FIELD_IPMF1_QUAL_LEARN_EXPECTED_WON, 563 DNX_FIELD_IPMF1_QUAL_VRF_VALUE, 564 DNX_FIELD_IPMF1_QUAL_PP_PORT, 565 DNX_FIELD_IPMF1_QUAL_CORE_ID, 566 DNX_FIELD_IPMF1_QUAL_VW_VIP_VALID, 567 DNX_FIELD_IPMF1_QUAL_VW_VIP_ID, 568 DNX_FIELD_IPMF1_QUAL_VW_MEMBER_REFERENCE, 569 DNX_FIELD_IPMF1_QUAL_VW_PCC_HIT, 570 DNX_FIELD_IPMF1_QUAL_AC_IN_LIF_WIDE_DATA_EXTENDED, 571 DNX_FIELD_IPMF1_QUAL_MACT_ENTRY_GROUPING, 572 573 DNX_FIELD_IPMF1_QUAL_NOF 574 } dnx_field_ipmf1_qual_e; 575 576 typedef enum 577 { 578 DNX_FIELD_IPMF2_QUAL_INVALID = DNX_FIELD_QUAL_ID_INVALID, 579 DNX_FIELD_IPMF2_QUAL_FIRST = DNX_FIELD_QUAL_ID_FIRST, 580 /* 581 * Starts from MS qualifier - taken from pmfSpec.doc 582 */ 583 DNX_FIELD_IPMF2_QUAL_PMF1_TCAM_ACTION_0 = DNX_FIELD_IPMF2_QUAL_FIRST, 584 DNX_FIELD_IPMF2_QUAL_PMF1_TCAM_ACTION_1, 585 DNX_FIELD_IPMF2_QUAL_PMF1_TCAM_ACTION_2, 586 DNX_FIELD_IPMF2_QUAL_PMF1_TCAM_ACTION_3, 587 DNX_FIELD_IPMF2_QUAL_PMF1_EXEM_ACTION, 588 DNX_FIELD_IPMF2_QUAL_PMF1_DIRECT_ACTION, 589 DNX_FIELD_IPMF2_QUAL_STATE_ADDRESS, 590 DNX_FIELD_IPMF2_QUAL_STATE_DATA, 591 DNX_FIELD_IPMF2_QUAL_KEY_F_INITIAL, 592 DNX_FIELD_IPMF2_QUAL_KEY_G_INITIAL, 593 DNX_FIELD_IPMF2_QUAL_KEY_H_INITIAL, 594 DNX_FIELD_IPMF2_QUAL_KEY_I_INITIAL, 595 DNX_FIELD_IPMF2_QUAL_KEY_J_INITIAL, 596 DNX_FIELD_IPMF2_QUAL_ECMP_LB_KEY_0, 597 DNX_FIELD_IPMF2_QUAL_ECMP_LB_KEY_1, 598 DNX_FIELD_IPMF2_QUAL_ECMP_LB_KEY_2, 599 DNX_FIELD_IPMF2_QUAL_NWK_LB_KEY, 600 DNX_FIELD_IPMF2_QUAL_LAG_LB_KEY, 601 DNX_FIELD_IPMF2_QUAL_TRJ_HASH, 602 DNX_FIELD_IPMF2_QUAL_CMP_KEY_0_DECODED, 603 DNX_FIELD_IPMF2_QUAL_CMP_KEY_1_DECODED, 604 DNX_FIELD_IPMF2_QUAL_CMP_KEY_TCAM_0_DECODED, 605 DNX_FIELD_IPMF2_QUAL_CMP_KEY_TCAM_1_DECODED, 606 DNX_FIELD_IPMF2_QUAL_NASID, 607 DNX_FIELD_IPMF2_QUAL_STATE_DATA_WRITE, 608 609 DNX_FIELD_IPMF2_QUAL_NOF 610 } dnx_field_ipmf2_qual_e; 611 612 typedef enum 613 { 614 DNX_FIELD_IPMF3_QUAL_INVALID = DNX_FIELD_QUAL_ID_INVALID, 615 DNX_FIELD_IPMF3_QUAL_FIRST = DNX_FIELD_QUAL_ID_FIRST, 616 /* 617 * Starts from MS qualifier - taken from pmBfSpec.doc 618 */ 619 DNX_FIELD_IPMF3_QUAL_ALL_ONES = DNX_FIELD_IPMF3_QUAL_FIRST, 620 DNX_FIELD_IPMF3_QUAL_LEARN_INFO, 621 DNX_FIELD_IPMF3_QUAL_RPF_ECMP_MODE, 622 DNX_FIELD_IPMF3_QUAL_RPF_ECMP_GROUP, 623 DNX_FIELD_IPMF3_QUAL_ADMT_PROFILE, 624 DNX_FIELD_IPMF3_QUAL_BIER_STR_OFFSET, 625 DNX_FIELD_IPMF3_QUAL_BIER_STR_SIZE, 626 DNX_FIELD_IPMF3_QUAL_BYTES_TO_REMOVE, 627 DNX_FIELD_IPMF3_QUAL_WEAK_TM_VALID, 628 DNX_FIELD_IPMF3_QUAL_WEAK_TM_PROFILE, 629 DNX_FIELD_IPMF3_QUAL_STAT_OBJ_LM_READ_INDEX, 630 DNX_FIELD_IPMF3_QUAL_CONGESTION_INFO, 631 DNX_FIELD_IPMF3_QUAL_END_OF_PACKET_EDITING, 632 DNX_FIELD_IPMF3_QUAL_EEI, 633 DNX_FIELD_IPMF3_QUAL_EGRESS_LEARN_ENABLE, 634 DNX_FIELD_IPMF3_QUAL_FWD_ACTION_CPU_TRAP_CODE, 635 DNX_FIELD_IPMF3_QUAL_FWD_ACTION_CPU_TRAP_QUAL, 636 DNX_FIELD_IPMF3_QUAL_FWD_ACTION_DP_METER_COMMAND, 637 DNX_FIELD_IPMF3_QUAL_FWD_ACTION_DP, 638 DNX_FIELD_IPMF3_QUAL_FWD_ACTION_TC, 639 DNX_FIELD_IPMF3_QUAL_FWD_ACTION_DESTINATION, 640 DNX_FIELD_IPMF3_QUAL_FWD_ACTION_STRENGTH, 641 DNX_FIELD_IPMF3_QUAL_FWD_PAYLOAD, 642 DNX_FIELD_IPMF3_QUAL_FWD_DOMAIN, 643 DNX_FIELD_IPMF3_QUAL_FWD_DOMAIN_PROFILE, 644 DNX_FIELD_IPMF3_QUAL_GENERAL_DATA_PMF_CONTAINER, 645 DNX_FIELD_IPMF3_QUAL_GENERAL_DATA, 646 DNX_FIELD_IPMF3_QUAL_IEEE1588_COMMAND, 647 DNX_FIELD_IPMF3_QUAL_IEEE1588_COMPENSATE_TIME_STAMP, 648 DNX_FIELD_IPMF3_QUAL_IEEE1588_ENCAPSULATION, 649 DNX_FIELD_IPMF3_QUAL_IEEE1588_HEADER_OFFSET, 650 DNX_FIELD_IPMF3_QUAL_GLOB_IN_LIF_0, 651 DNX_FIELD_IPMF3_QUAL_GLOB_IN_LIF_1, 652 DNX_FIELD_IPMF3_QUAL_IN_LIF_PROFILE_0, 653 DNX_FIELD_IPMF3_QUAL_IN_LIF_PROFILE_1, 654 DNX_FIELD_IPMF3_QUAL_IN_PORT, 655 DNX_FIELD_IPMF3_QUAL_CORE_ID, 656 DNX_FIELD_IPMF3_QUAL_IN_TTL, 657 DNX_FIELD_IPMF3_QUAL_INGRESS_LEARN_ENABLE, 658 DNX_FIELD_IPMF3_QUAL_ITPP_DELTA, 659 DNX_FIELD_IPMF3_QUAL_LAG_LB_KEY, 660 DNX_FIELD_IPMF3_QUAL_LATENCY_FLOW_ID_VALID, 661 DNX_FIELD_IPMF3_QUAL_LATENCY_FLOW_ID, 662 DNX_FIELD_IPMF3_QUAL_MIRROR_CODE, 663 DNX_FIELD_IPMF3_QUAL_MIRROR_QUALIFIER, 664 DNX_FIELD_IPMF3_QUAL_NWK_LB_KEY, 665 DNX_FIELD_IPMF3_QUAL_NWK_QOS, 666 DNX_FIELD_IPMF3_QUAL_OAM_ID, 667 DNX_FIELD_IPMF3_QUAL_OAM_OFFSET, 668 DNX_FIELD_IPMF3_QUAL_OAM_STAMP_OFFSET, 669 DNX_FIELD_IPMF3_QUAL_OAM_SUB_TYPE, 670 DNX_FIELD_IPMF3_QUAL_OAM_UP_MEP, 671 DNX_FIELD_IPMF3_QUAL_GLOB_OUT_LIF_0, 672 DNX_FIELD_IPMF3_QUAL_GLOB_OUT_LIF_1, 673 DNX_FIELD_IPMF3_QUAL_GLOB_OUT_LIF_2, 674 DNX_FIELD_IPMF3_QUAL_GLOB_OUT_LIF_3, 675 DNX_FIELD_IPMF3_QUAL_PACKET_IS_APPLET, 676 DNX_FIELD_IPMF3_QUAL_NASID, 677 DNX_FIELD_IPMF3_QUAL_PACKET_IS_BIER, 678 DNX_FIELD_IPMF3_QUAL_PACKET_IS_IEEE1588, 679 DNX_FIELD_IPMF3_QUAL_EGRESS_PARSING_INDEX, 680 DNX_FIELD_IPMF3_QUAL_PTC, 681 DNX_FIELD_IPMF3_QUAL_EXT_STATISTICS_VALID, 682 DNX_FIELD_IPMF3_QUAL_PPH_RESERVED, 683 DNX_FIELD_IPMF3_QUAL_PPH_TYPE, 684 DNX_FIELD_IPMF3_QUAL_RPF_DST, 685 DNX_FIELD_IPMF3_QUAL_RPF_DST_VALID, 686 DNX_FIELD_IPMF3_QUAL_SNOOP_CODE, 687 DNX_FIELD_IPMF3_QUAL_SNOOP_STRENGTH, 688 DNX_FIELD_IPMF3_QUAL_SNOOP_QUALIFIER, 689 DNX_FIELD_IPMF3_QUAL_SRC_SYS_PORT, 690 DNX_FIELD_IPMF3_QUAL_ST_VSQ_PTR, 691 DNX_FIELD_IPMF3_QUAL_STATISTICAL_SAMPLING_CODE, 692 DNX_FIELD_IPMF3_QUAL_STATISTICAL_SAMPLING_QUALIFIER, 693 DNX_FIELD_IPMF3_QUAL_STACKING_ROUTE_HISTORY_BITMAP, 694 DNX_FIELD_IPMF3_QUAL_STATISTICS_META_DATA, 695 DNX_FIELD_IPMF3_QUAL_STATISTICS_OBJECT10, 696 DNX_FIELD_IPMF3_QUAL_SYSTEM_HEADER_PROFILE_INDEX, 697 DNX_FIELD_IPMF3_QUAL_TM_PROFILE, 698 DNX_FIELD_IPMF3_QUAL_USER_HEADER_1, 699 DNX_FIELD_IPMF3_QUAL_USER_HEADER_2, 700 DNX_FIELD_IPMF3_QUAL_USER_HEADER_3, 701 DNX_FIELD_IPMF3_QUAL_USER_HEADER_4, 702 DNX_FIELD_IPMF3_QUAL_USER_HEADER_1_TYPE, 703 DNX_FIELD_IPMF3_QUAL_USER_HEADER_2_TYPE, 704 DNX_FIELD_IPMF3_QUAL_USER_HEADER_3_TYPE, 705 DNX_FIELD_IPMF3_QUAL_USER_HEADER_4_TYPE, 706 DNX_FIELD_IPMF3_QUAL_USER_HEADERS_TYPE, 707 DNX_FIELD_IPMF3_QUAL_VISIBILITY, 708 DNX_FIELD_IPMF3_QUAL_VLAN_EDIT_VID_2, 709 DNX_FIELD_IPMF3_QUAL_VLAN_EDIT_VID_1, 710 DNX_FIELD_IPMF3_QUAL_VLAN_EDIT_PCP_DEI_2, 711 DNX_FIELD_IPMF3_QUAL_VLAN_EDIT_DEI_2, 712 DNX_FIELD_IPMF3_QUAL_VLAN_EDIT_PCP_2, 713 DNX_FIELD_IPMF3_QUAL_VLAN_EDIT_PCP_DEI_1, 714 DNX_FIELD_IPMF3_QUAL_VLAN_EDIT_DEI_1, 715 DNX_FIELD_IPMF3_QUAL_VLAN_EDIT_PCP_1, 716 DNX_FIELD_IPMF3_QUAL_VLAN_EDIT_CMD_INDEX, 717 DNX_FIELD_IPMF3_QUAL_VLAN_EDIT_CMD, /* Data contains VID1(12), VID2(12), PCP_DEI1(4), PCP_DEI2(4), CMD(7) */ 718 DNX_FIELD_IPMF3_QUAL_FWD_LAYER_ADDITIONAL_INFO, 719 DNX_FIELD_IPMF3_QUAL_SLB_LEARN_NEEDED, 720 DNX_FIELD_IPMF3_QUAL_SLB_KEY, 721 DNX_FIELD_IPMF3_QUAL_SLB_PAYLOAD, 722 DNX_FIELD_IPMF3_QUAL_PTC_KEY_GEN_VAR, 723 DNX_FIELD_IPMF3_QUAL_IN_PORT_KEY_GEN_VAR, 724 DNX_FIELD_IPMF3_QUAL_IN_PORT_MAPPED_PP_PORT, 725 DNX_FIELD_IPMF3_QUAL_CONTEXT_KEY_GEN_VAR, 726 DNX_FIELD_IPMF3_QUAL_FER_STATISTICS_OBJ, 727 DNX_FIELD_IPMF3_QUAL_FWD_LAYER_INDEX, 728 DNX_FIELD_IPMF3_QUAL_PP_PORT_PMF_PROFILE, 729 DNX_FIELD_IPMF3_QUAL_TM_PORT_PMF_PROFILE, 730 DNX_FIELD_IPMF3_QUAL_PP_PORT_PMF_GENERAL_DATA, 731 DNX_FIELD_IPMF3_QUAL_PMF_ETH_RIF_PROFILE, 732 DNX_FIELD_IPMF3_QUAL_DUAL_QUEUE, 733 DNX_FIELD_IPMF3_QUAL_ELEPHANT_TRAP_INFO, 734 DNX_FIELD_IPMF3_QUAL_ELEPHANT_LEARN_NEEDED, 735 DNX_FIELD_IPMF3_QUAL_PRT_QUALIFIER, 736 DNX_FIELD_IPMF3_QUAL_ECL_VALID, 737 DNX_FIELD_IPMF3_QUAL_BTK_OFFSET_SOP, 738 DNX_FIELD_IPMF3_QUAL_BTC_OFFSET_SOP, 739 DNX_FIELD_IPMF3_QUAL_BTC_MINUS_BTK, 740 DNX_FIELD_IPMF3_QUAL_LEARN_SRC_MAC, 741 DNX_FIELD_IPMF3_QUAL_LEARN_VLAN, 742 DNX_FIELD_IPMF3_QUAL_LEARN_VSI, 743 DNX_FIELD_IPMF3_QUAL_LEARN_DATA, 744 DNX_FIELD_IPMF3_QUAL_LEARN_STATION_MOVE, 745 DNX_FIELD_IPMF3_QUAL_LEARN_MATCH, 746 DNX_FIELD_IPMF3_QUAL_LEARN_FOUND, 747 DNX_FIELD_IPMF3_QUAL_LEARN_EXPECTED_WON, 748 DNX_FIELD_IPMF3_QUAL_VRF_VALUE, 749 DNX_FIELD_IPMF3_QUAL_PP_PORT, 750 751 DNX_FIELD_IPMF3_QUAL_NOF 752 } dnx_field_ipmf3_qual_e; 753 754 typedef enum 755 { 756 DNX_FIELD_EPMF_QUAL_INVALID = DNX_FIELD_QUAL_ID_INVALID, 757 DNX_FIELD_EPMF_QUAL_FIRST = DNX_FIELD_QUAL_ID_FIRST, 758 /* 759 * Starts from MS qualifier - taken from pmBfSpec.doc 760 */ 761 DNX_FIELD_EPMF_QUAL_FTMH_RESERVED = DNX_FIELD_EPMF_QUAL_FIRST, 762 DNX_FIELD_EPMF_QUAL_FTMH_VISIBILITY, 763 DNX_FIELD_EPMF_QUAL_FTMH_TM_PROFILE, 764 DNX_FIELD_EPMF_QUAL_FTMH_ECN_ENABLE, 765 DNX_FIELD_EPMF_QUAL_FTMH_CNI, 766 DNX_FIELD_EPMF_QUAL_FTMH_BIER_BFR_EXT_PRESENT, 767 DNX_FIELD_EPMF_QUAL_FTMH_FLOW_ID_EXT_PRESENT, 768 DNX_FIELD_EPMF_QUAL_FTMH_APPLICATION_SPECIFIC_EXT_PRESENT, 769 DNX_FIELD_EPMF_QUAL_FTMH_TM_DESTINATION_EXT_PRESENT, 770 DNX_FIELD_EPMF_QUAL_FTMH_MCID_OR_OUTLIF_0_OR_MCDB_PTR, 771 DNX_FIELD_EPMF_QUAL_FTMH_TM_ACTION_IS_MC, 772 DNX_FIELD_EPMF_QUAL_FTMH_PPH_PRESENT, 773 DNX_FIELD_EPMF_QUAL_FTMH_TSH_EXT_PRESENT, 774 DNX_FIELD_EPMF_QUAL_FTMH_TM_ACTION_TYPE, 775 DNX_FIELD_EPMF_QUAL_FTMH_DP, 776 DNX_FIELD_EPMF_QUAL_PP_DSP, 777 DNX_FIELD_EPMF_QUAL_FTMH_SRC_SYS_PORT, 778 DNX_FIELD_EPMF_QUAL_FTMH_TC, 779 DNX_FIELD_EPMF_QUAL_FTMH_PACKET_SIZE, 780 DNX_FIELD_EPMF_QUAL_LB_KEY, 781 DNX_FIELD_EPMF_QUAL_NWK_KEY, 782 DNX_FIELD_EPMF_QUAL_STACKING_EXT, 783 DNX_FIELD_EPMF_QUAL_BIER_BFR_EXT, 784 DNX_FIELD_EPMF_QUAL_TM_DESTINATION_EXT, 785 DNX_FIELD_EPMF_QUAL_APPLICATION_SPECIFIC_EXT, 786 DNX_FIELD_EPMF_QUAL_TSH_EXT, 787 DNX_FIELD_EPMF_QUAL_FWD_STRENGTH, 788 DNX_FIELD_EPMF_QUAL_PPH_PARSING_START_TYPE, 789 DNX_FIELD_EPMF_QUAL_PPH_PARSING_START_OFFSET, 790 DNX_FIELD_EPMF_QUAL_PPH_LIF_EXT_TYPE, 791 DNX_FIELD_EPMF_QUAL_PPH_FHEI_SIZE, 792 DNX_FIELD_EPMF_QUAL_PPH_LEARN_EXT_PRESENT, 793 DNX_FIELD_EPMF_QUAL_PPH_TTL, 794 DNX_FIELD_EPMF_QUAL_PPH_NWK_QOS, 795 DNX_FIELD_EPMF_QUAL_PPH_IN_LIF, 796 DNX_FIELD_EPMF_QUAL_PPH_FWD_DOMAIN, 797 DNX_FIELD_EPMF_QUAL_PPH_IN_LIF_PROFILE, 798 DNX_FIELD_EPMF_QUAL_PPH_END_OF_PACKET_EDITING, 799 DNX_FIELD_EPMF_QUAL_PPH_FWD_LAYER_ADDITIONAL_INFO, 800 DNX_FIELD_EPMF_QUAL_PPH_VALUE1, 801 DNX_FIELD_EPMF_QUAL_PPH_VALUE2, 802 DNX_FIELD_EPMF_QUAL_FHEI_EXT, 803 DNX_FIELD_EPMF_QUAL_LEARN_EXT, 804 DNX_FIELD_EPMF_QUAL_LIF_EXT, 805 DNX_FIELD_EPMF_QUAL_USER_HEADER_1, 806 DNX_FIELD_EPMF_QUAL_USER_HEADER_2, 807 DNX_FIELD_EPMF_QUAL_USER_HEADER_3, 808 DNX_FIELD_EPMF_QUAL_USER_HEADER_4, 809 DNX_FIELD_EPMF_QUAL_USER_HEADER_1_TYPE, 810 DNX_FIELD_EPMF_QUAL_USER_HEADER_2_TYPE, 811 DNX_FIELD_EPMF_QUAL_USER_HEADER_3_TYPE, 812 DNX_FIELD_EPMF_QUAL_USER_HEADER_4_TYPE, 813 DNX_FIELD_EPMF_QUAL_IS_TDM, 814 DNX_FIELD_EPMF_QUAL_CUD_OUTLIF_OR_MCDB_PTR, 815 DNX_FIELD_EPMF_QUAL_DISCARD, 816 DNX_FIELD_EPMF_QUAL_OUT_LIF_PROFILE, 817 DNX_FIELD_EPMF_QUAL_PMF_ETH_RIF_PROFILE, 818 DNX_FIELD_EPMF_QUAL_ETH_TAG_FORMAT, 819 DNX_FIELD_EPMF_QUAL_UPDATED_TPIDS_PACKET_DATA, 820 DNX_FIELD_EPMF_QUAL_IVE_BYTES_TO_ADD, 821 DNX_FIELD_EPMF_QUAL_IVE_BYTES_TO_REMOVE, 822 DNX_FIELD_EPMF_QUAL_ETHER_TYPE_CODE, 823 DNX_FIELD_EPMF_QUAL_FABRIC_OR_EGRESS_MC, 824 DNX_FIELD_EPMF_QUAL_ESTIMATED_BTR, 825 DNX_FIELD_EPMF_QUAL_FWD_CONTEXT, 826 DNX_FIELD_EPMF_QUAL_GLOB_OUT_LIF_0, 827 DNX_FIELD_EPMF_QUAL_GLOB_OUT_LIF_1, 828 DNX_FIELD_EPMF_QUAL_GLOB_OUT_LIF_2, 829 DNX_FIELD_EPMF_QUAL_GLOB_OUT_LIF_3, 830 DNX_FIELD_EPMF_QUAL_GLOB_IN_LIF_0, 831 DNX_FIELD_EPMF_QUAL_IN_LIF_PROFILE_0, 832 DNX_FIELD_EPMF_QUAL_IP_MC_ELIGIBLE, 833 DNX_FIELD_EPMF_QUAL_IP_MC_SHOULD_BE_BRIDGED, 834 DNX_FIELD_EPMF_QUAL_LEARN_VALID, 835 DNX_FIELD_EPMF_QUAL_LOCAL_OUT_LIF, 836 DNX_FIELD_EPMF_QUAL_FWD_ACTION_PROFILE_INDEX, 837 DNX_FIELD_EPMF_QUAL_SNOOP_ACTION_PROFILE_INDEX, 838 DNX_FIELD_EPMF_QUAL_SNOOP_STRENGTH, 839 DNX_FIELD_EPMF_QUAL_SYSTEM_HEADERS_SIZE, 840 DNX_FIELD_EPMF_QUAL_DST_SYS_PORT, 841 DNX_FIELD_EPMF_QUAL_OUT_TM_PORT, 842 DNX_FIELD_EPMF_QUAL_OUT_PP_PORT, 843 DNX_FIELD_EPMF_QUAL_PACKET_IS_APPLET, 844 DNX_FIELD_EPMF_QUAL_MEM_SOFT_ERR, 845 DNX_FIELD_EPMF_QUAL_TC_MAP_PROFILE, 846 DNX_FIELD_EPMF_QUAL_L4_PORT_IN_RANGE, 847 DNX_FIELD_EPMF_QUAL_PROGRAM_INDEX, 848 DNX_FIELD_EPMF_QUAL_PER_PORT_TABLE_DATA, 849 DNX_FIELD_EPMF_QUAL_PP_PORT_PMF_PROFILE, 850 DNX_FIELD_EPMF_QUAL_TM_PORT_PMF_PROFILE, 851 DNX_FIELD_EPMF_QUAL_PPH_VRF_VALUE, 852 DNX_FIELD_EPMF_QUAL_LEARN_EXT_DATA, 853 DNX_FIELD_EPMF_QUAL_LEARN_EXT_SRC_MAC, 854 DNX_FIELD_EPMF_QUAL_LEARN_EXT_VSI, 855 DNX_FIELD_EPMF_QUAL_LEARN_EXT_VLAN, 856 857 DNX_FIELD_EPMF_QUAL_NOF 858 } dnx_field_epmf_qual_e; 859 860 typedef enum 861 { 862 DNX_FIELD_L4OPS_QUAL_INVALID = DNX_FIELD_QUAL_ID_INVALID, 863 DNX_FIELD_L4OPS_QUAL_FIRST = DNX_FIELD_QUAL_ID_FIRST, 864 /* 865 * Starts from MS qualifier - taken from pmfSpec.doc 866 */ 867 DNX_FIELD_L4OPS_QUAL_DP = DNX_FIELD_L4OPS_QUAL_FIRST, 868 DNX_FIELD_L4OPS_QUAL_ECN, 869 DNX_FIELD_L4OPS_QUAL_EEI, 870 DNX_FIELD_L4OPS_QUAL_ELK_LKP_HIT_0, 871 DNX_FIELD_L4OPS_QUAL_ELK_LKP_HIT_1, 872 DNX_FIELD_L4OPS_QUAL_ELK_LKP_HIT_2, 873 DNX_FIELD_L4OPS_QUAL_ELK_LKP_HIT_3, 874 DNX_FIELD_L4OPS_QUAL_ELK_LKP_HIT_4, 875 DNX_FIELD_L4OPS_QUAL_ELK_LKP_HIT_5, 876 DNX_FIELD_L4OPS_QUAL_ELK_LKP_HIT_6, 877 DNX_FIELD_L4OPS_QUAL_ELK_LKP_HIT_7, 878 DNX_FIELD_L4OPS_QUAL_ELK_LKP_PAYLOAD_ALL_PART_1, 879 DNX_FIELD_L4OPS_QUAL_ELK_LKP_PAYLOAD_ALL_PART_0, 880 DNX_FIELD_L4OPS_QUAL_FWD_DOMAIN, 881 DNX_FIELD_L4OPS_QUAL_FWD_LAYER_ADDITIONAL_INFO, 882 DNX_FIELD_L4OPS_QUAL_GENERAL_DATA_2, 883 DNX_FIELD_L4OPS_QUAL_GENERAL_DATA_1, 884 DNX_FIELD_L4OPS_QUAL_GENERAL_DATA_0, 885 DNX_FIELD_L4OPS_QUAL_GLOB_IN_LIF_1, 886 DNX_FIELD_L4OPS_QUAL_GLOB_IN_LIF_0, 887 DNX_FIELD_L4OPS_QUAL_NWK_QOS, 888 DNX_FIELD_L4OPS_QUAL_GLOB_OUT_LIF_1, 889 DNX_FIELD_L4OPS_QUAL_GLOB_OUT_LIF_0, 890 DNX_FIELD_L4OPS_QUAL_PRT_QUALIFIER, 891 DNX_FIELD_L4OPS_QUAL_RPF_DST, 892 DNX_FIELD_L4OPS_QUAL_RPF_DST_VALID, 893 DNX_FIELD_L4OPS_QUAL_RPF_OUT_LIF, 894 DNX_FIELD_L4OPS_QUAL_SRC_SYS_PORT, 895 DNX_FIELD_L4OPS_QUAL_STATISTICS_OBJ_12, 896 DNX_FIELD_L4OPS_QUAL_STATISTICS_OBJ_11, 897 DNX_FIELD_L4OPS_QUAL_STATISTICS_OBJ_10, 898 DNX_FIELD_L4OPS_QUAL_STATISTICS_OBJ_9, 899 DNX_FIELD_L4OPS_QUAL_STATISTICS_OBJ_8, 900 DNX_FIELD_L4OPS_QUAL_STATISTICS_OBJ_7, 901 DNX_FIELD_L4OPS_QUAL_STATISTICS_OBJ_6, 902 DNX_FIELD_L4OPS_QUAL_STATISTICS_OBJ_5, 903 DNX_FIELD_L4OPS_QUAL_STATISTICS_OBJ_4, 904 DNX_FIELD_L4OPS_QUAL_STATISTICS_OBJ_3, 905 DNX_FIELD_L4OPS_QUAL_STATISTICS_OBJ_2, 906 DNX_FIELD_L4OPS_QUAL_STATISTICS_OBJ_1, 907 DNX_FIELD_L4OPS_QUAL_STATISTICS_OBJ_0, 908 DNX_FIELD_L4OPS_QUAL_OAM_STATISTICS_OBJ_2, 909 DNX_FIELD_L4OPS_QUAL_OAM_STATISTICS_OBJ_1, 910 DNX_FIELD_L4OPS_QUAL_OAM_STATISTICS_OBJ_0, 911 DNX_FIELD_L4OPS_QUAL_TC, 912 DNX_FIELD_L4OPS_QUAL_CORE_ID, 913 DNX_FIELD_L4OPS_QUAL_IN_PORT, 914 DNX_FIELD_L4OPS_QUAL_FWD_LAYER_INDEX, 915 916 DNX_FIELD_L4OPS_QUAL_NOF 917 } dnx_field_l4ops_qual_e; 918 919 #define BCM_FIELD_HEADER_TYPE_STRINGS \ 920 { \ 921 "Ethernet", \ 922 "Inner Ethernet", \ 923 "VALN", \ 924 "MPLS", \ 925 "IPv4", \ 926 "Inner IPv4", \ 927 "IPv6", \ 928 "Inner IPv6", \ 929 "UDP", \ 930 "Invalid" \ 931 } 932 933 typedef enum 934 { 935 DNX_FIELD_HEADER_QUAL_INVALID = 0, 936 DNX_FIELD_HEADER_QUAL_FIRST = 1, 937 /* 938 * Ethernet Header Qualifiers 939 */ 940 DNX_FIELD_HEADER_QUAL_MAC_DST = DNX_FIELD_HEADER_QUAL_FIRST, 941 DNX_FIELD_HEADER_QUAL_MAC_SRC, 942 DNX_FIELD_HEADER_QUAL_ETHERTYPE, 943 /* 944 * VLAN Header Qualifiers 945 */ 946 DNX_FIELD_HEADER_QUAL_VLAN_TPID, 947 DNX_FIELD_HEADER_QUAL_VLAN_ID, 948 DNX_FIELD_HEADER_QUAL_VLAN_PRI, 949 DNX_FIELD_HEADER_QUAL_VLAN_CFI, 950 DNX_FIELD_HEADER_QUAL_VLAN_PRI_CFI, 951 DNX_FIELD_HEADER_QUAL_VLAN_TCI, 952 /* 953 * MPLS Header Qualifiers 954 */ 955 DNX_FIELD_HEADER_QUAL_MPLS_LABEL, /* Shim Layer header */ 956 DNX_FIELD_HEADER_QUAL_MPLS_LABEL_ID, 957 DNX_FIELD_HEADER_QUAL_MPLS_TC, 958 DNX_FIELD_HEADER_QUAL_MPLS_BOS, 959 DNX_FIELD_HEADER_QUAL_MPLS_TTL, 960 /* 961 * ARP Header Qualifiers 962 */ 963 DNX_FIELD_HEADER_QUAL_ARP_OPCODE, 964 DNX_FIELD_HEADER_QUAL_ARP_SENDER_IP, 965 DNX_FIELD_HEADER_QUAL_ARP_TARGET_IP, 966 /* 967 * IPv4 Header Qualifiers 968 */ 969 DNX_FIELD_HEADER_QUAL_IPV4_TOS, 970 DNX_FIELD_HEADER_QUAL_IPV4_DSCP, 971 DNX_FIELD_HEADER_QUAL_IPV4_ECN, 972 DNX_FIELD_HEADER_QUAL_IPV4_FLAGS, 973 DNX_FIELD_HEADER_QUAL_IPV4_TTL, 974 DNX_FIELD_HEADER_QUAL_IPV4_PROTOCOL, 975 DNX_FIELD_HEADER_QUAL_IPV4_SRC, 976 DNX_FIELD_HEADER_QUAL_IPV4_DST, 977 /* 978 * IPv6 Header Qualifiers 979 */ 980 DNX_FIELD_HEADER_QUAL_IPV6_SIP, 981 DNX_FIELD_HEADER_QUAL_IPV6_DIP, 982 DNX_FIELD_HEADER_QUAL_IPV6_SIP_LOW, 983 DNX_FIELD_HEADER_QUAL_IPV6_SIP_HIGH, 984 DNX_FIELD_HEADER_QUAL_IPV6_DIP_LOW, 985 DNX_FIELD_HEADER_QUAL_IPV6_DIP_HIGH, 986 DNX_FIELD_HEADER_QUAL_IPV6_TC, 987 DNX_FIELD_HEADER_QUAL_IPV6_FLOW_LABEL, 988 DNX_FIELD_HEADER_QUAL_IPV6_NEXT_HEADER, 989 DNX_FIELD_HEADER_QUAL_IPV6_HOP_LIMIT, 990 DNX_FIELD_HEADER_QUAL_IPV6_EXTENSION_HEADER_TYPE, 991 /* 992 * TCP/UDP Common Fields 993 */ 994 DNX_FIELD_HEADER_QUAL_L4_SRC_PORT, 995 DNX_FIELD_HEADER_QUAL_L4_DST_PORT, 996 /* 997 * TCP Requested Fields 998 */ 999 DNX_FIELD_HEADER_QUAL_TCP_CTL, 1000 /* 1001 * Number of types in dnx_field_header_qual_e 1002 */ 1003 DNX_FIELD_HEADER_QUAL_NOF 1004 } dnx_field_header_qual_e; 1005 1006 typedef enum 1007 { 1008 DNX_FIELD_LR_QUAL_INVALID = 0, 1009 DNX_FIELD_LR_QUAL_FIRST = 1, 1010 /* 1011 * Basic Layer Header Qualifiers 1012 */ 1013 DNX_FIELD_LR_QUAL_OFFSET = DNX_FIELD_LR_QUAL_FIRST, 1014 DNX_FIELD_LR_QUAL_PROTOCOL, 1015 DNX_FIELD_LR_QUAL_QUALIFIER, 1016 /* 1017 * Specific fields in relevant Layer Record Qualifiers 1018 */ 1019 DNX_FIELD_LR_QUAL_ETH_IS_DA_MC, 1020 DNX_FIELD_LR_QUAL_ETH_IS_DA_BC, 1021 DNX_FIELD_LR_QUAL_ETH_1ST_TPID_EXIST, 1022 DNX_FIELD_LR_QUAL_ETH_1ST_TPID_INDEX, 1023 DNX_FIELD_LR_QUAL_ETH_2ND_TPID_EXIST, 1024 DNX_FIELD_LR_QUAL_ETH_2ND_TPID_INDEX, 1025 DNX_FIELD_LR_QUAL_ETH_3RD_TPID_EXIST, 1026 DNX_FIELD_LR_QUAL_ETH_3RD_TPID_INDEX, 1027 DNX_FIELD_LR_QUAL_ETH_IS_ETH1, 1028 DNX_FIELD_LR_QUAL_IPV4_IS_MC, 1029 DNX_FIELD_LR_QUAL_IPV4_HAS_OPTION, 1030 DNX_FIELD_LR_QUAL_IPV4_IS_FRAGMENTED, 1031 DNX_FIELD_LR_QUAL_IPV4_IS_1ST_FRAGMENT, 1032 DNX_FIELD_LR_QUAL_IPV4_1ST_ADD_HEADER_EXIST, 1033 DNX_FIELD_LR_QUAL_IPV4_1ST_ADD_HEADER, 1034 DNX_FIELD_LR_QUAL_IPV4_2ND_ADD_HEADER_EXISTS, 1035 DNX_FIELD_LR_QUAL_IPV4_TUNNEL_TYPE, 1036 DNX_FIELD_LR_QUAL_IPV4_TUNNEL_TYPE_RAW, 1037 DNX_FIELD_LR_QUAL_IPV6_IS_MC, 1038 DNX_FIELD_LR_QUAL_IPV6_1ST_ADD_HEADER_EXIST, 1039 DNX_FIELD_LR_QUAL_IPV6_1ST_ADD_HEADER, 1040 DNX_FIELD_LR_QUAL_IPV6_2ND_ADD_HEADER_EXISTS, 1041 DNX_FIELD_LR_QUAL_IPV6_2ND_ADD_HEADER, 1042 DNX_FIELD_LR_QUAL_IPV6_3RD_ADD_HEADER_EXISTS, 1043 DNX_FIELD_LR_QUAL_IPV6_FRAGMENTED_NON_FIRST, 1044 DNX_FIELD_LR_QUAL_SRV6_EP_SEGMENT_LEFT_MINUS_ONE, 1045 DNX_FIELD_LR_QUAL_MPLS_NOF_LABELS, 1046 DNX_FIELD_LR_QUAL_BIER_BITSTRINGLENGTH, 1047 DNX_FIELD_LR_QUAL_FCOE_IS_FIP, 1048 DNX_FIELD_LR_QUAL_FCOE_IS_ENCAP, 1049 DNX_FIELD_LR_QUAL_FCOE_VFT_EXIST, 1050 DNX_FIELD_LR_QUAL_ITMH_PPH_TYPE, 1051 /* 1052 * Number of types in dnx_field_layer_record_qual_e 1053 */ 1054 DNX_FIELD_LR_QUAL_NOF 1055 } dnx_field_layer_record_qual_e; 1056 1057 typedef enum 1058 { 1059 DNX_FIELD_SW_QUAL_INVALID = 0, 1060 DNX_FIELD_SW_QUAL_FIRST = 1, 1061 DNX_FIELD_SW_QUAL_ALL_ZERO = DNX_FIELD_SW_QUAL_FIRST, 1062 /* 1063 * Number of types in dnx_field_sw_qual_e 1064 */ 1065 DNX_FIELD_SW_QUAL_NOF 1066 } dnx_field_sw_qual_e; 1067 1068 typedef enum 1069 { 1070 DNX_FIELD_SW_ACTION_INVALID = 0, 1071 DNX_FIELD_SW_ACTION_FIRST = 1, 1072 DNX_FIELD_SW_ACTION_VOID = DNX_FIELD_SW_ACTION_FIRST, 1073 /* 1074 * Number of types in dnx_field_sw_action_e 1075 */ 1076 DNX_FIELD_SW_ACTION_NOF 1077 } dnx_field_sw_action_e; 1078 1079 /** 1080 * Enum for FFC types, one of the four HW options for each FFC. not every FFC type is available to all FFCs. 1081 */ 1082 typedef enum 1083 { 1084 DNX_FIELD_FFC_TYPE_INVALID = -1, 1085 /** 1086 * Takes information from the header according to a layer relative to the forwarding layer. 1087 */ 1088 DNX_FIELD_FFC_RELATIVE_HEADER = 0, 1089 /** 1090 * Takes information from the header according to a given layer (disregarding the forwarding layer) 1091 */ 1092 DNX_FIELD_FFC_ABSOLUTE_HEADER = 1, 1093 /** 1094 * Takes information from a given offset anywhere in the PBUS. Used to take data from the metadata or 1095 * layer records, when we don't take which layer is the forwarding layer into account. 1096 */ 1097 DNX_FIELD_FFC_LITERALLY = 2, 1098 /** 1099 * Takes information from the layer record, which is information given by the parser about different layers in the 1100 * header, from a layer relative to the forwarding layer. 1101 */ 1102 DNX_FIELD_FFC_LAYER_RECORD = 3, 1103 /** 1104 * Number of enum valid values for FFC types */ 1105 DNX_FIELD_FFC_NOF 1106 } dnx_field_ffc_type_e; 1107 1108 #define DNX_FIELD_FFC_TYPE_VERIFY(type) \ 1109 if((type < 0) || (type >= DNX_FIELD_FFC_NOF)) \ 1110 { \ 1111 SHR_ERR_EXIT(_SHR_E_PARAM, "FFC type:%d is out of range\n", type); \ 1112 } 1113 1114 typedef struct 1115 { 1116 dbal_fields_e field_id; 1117 uint32 value; 1118 } dnx_field_dbal_pair_t; 1119 1120 /** 1121 * \brief - Structure provided to facilitate context parameter setting 1122 */ 1123 typedef struct 1124 { 1125 dbal_tables_e table_id; 1126 dnx_field_dbal_pair_t key_dbal_pair[DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_DBAL_PAIRS]; 1127 dnx_field_dbal_pair_t res_dbal_pair[DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_DBAL_PAIRS]; 1128 } dnx_field_dbal_entry_t; 1129 1130 /** 1131 * \brief - Structure provided to facilitate field range setting 1132 */ 1133 typedef struct 1134 { 1135 dbal_tables_e table_id; 1136 dbal_fields_e range_id_dbal_field; 1137 dbal_fields_e range_min_dbal_field; 1138 dbal_fields_e range_max_dbal_field; 1139 uint8 id_not_bitmap; 1140 } dnx_field_map_range_type_info_t; 1141 1142 struct dnx_field_context_param_e; 1143 /** 1144 * \brief Typedef for context param conversion routine 1145 * \param [in] unit unit id 1146 * \param [in] bcm_data pointer to bcm param data, which is BCM_FIELD_QUAL_WIDTH_IN_WORDS long 1147 * \param [in] dnx_data pointer to dnx param data, which is BCM_FIELD_QUAL_WIDTH_IN_WORDS long 1148 * \return 1149 * \retval _SHR_E_NONE for success 1150 * \retval _SHR_E_PARAM problem with input parameters, usage should be printed 1151 * \retval other errors for other failure type 1152 * \remark automatically frees the list 1153 */ 1154 typedef shr_error_e( 1155 *context_param_conversion_cb) ( 1156 int unit, 1157 dnx_field_stage_e stage, 1158 dnx_field_context_t field_context_id, 1159 uint32 param_value, 1160 struct dnx_field_context_param_e * context_param, 1161 dnx_field_dbal_entry_t * field_dbal_entry); 1162 1163 /** 1164 * \brief - Static mapping for context param set 1165 */ 1166 typedef struct dnx_field_context_param_e 1167 { 1168 dbal_tables_e table_id; 1169 dbal_fields_e key_field_id[DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_DBAL_PAIRS]; 1170 dbal_fields_e res_field_id[DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_DBAL_PAIRS]; 1171 context_param_conversion_cb conversion_cb; 1172 } dnx_field_context_param_t; 1173 1174 /** 1175 * \brief - Static mapping for range set 1176 */ 1177 typedef struct dnx_field_range_map_e 1178 { 1179 /** The name of the range type.*/ 1180 char *name; 1181 /** The DBAL table for setting the range.*/ 1182 dbal_tables_e table_id; 1183 /** The DBAL field of the range ID.*/ 1184 dbal_fields_e range_id_dbal_field; 1185 /** The DBAL field of the minimum value of the range.*/ 1186 dbal_fields_e range_min_dbal_field; 1187 /** The DBAL field of the maximum value of the range.*/ 1188 dbal_fields_e range_max_dbal_field; 1189 /** Indicates if the HW provides the first ID that was hit, or a bitmap of the range IDs and whether they were hit.*/ 1190 uint8 id_not_bitmap; 1191 } dnx_field_range_map_t; 1192 1193 /** 1194 * \brief Typedef for qualifier/action value conversion routine 1195 * \par DIRECT INPUT: 1196 * \param [in] unit unit id 1197 * \param [in] flags 1198 * First flag is marking bare metal support 1199 * \param [in] core - Identifier of core. 1200 * \param [in] bcm_data pointer to bcm qualifier/action value, which is BCM_FIELD_QUAL_WIDTH_IN_WORDS long 1201 * \param [in] dnx_data pointer to dnx qualifier/action value, which is BCM_FIELD_QUAL_WIDTH_IN_WORDS long 1202 * \par DIRECT OUTPUT: 1203 * \retval _SHR_E_NONE for success 1204 * \retval _SHR_E_PARAM problem with input parameters, usage should be printed 1205 * \retval other errors for other failure type 1206 * \remark automatically frees the list 1207 */ 1208 typedef shr_error_e( 1209 *field_data_conversion_cb) ( 1210 int unit, 1211 uint32 flags, 1212 int core, 1213 uint32 *bcm_data, 1214 uint32 *dnx_data); 1215 1216 /** 1217 * \brief Typedef for CS qualifier type conversion routine from BCM to DNX. 1218 * \par DIRECT INPUT: 1219 * \param [in] unit unit id 1220 * \param [in] cs_qual_index The index given by the user for the CS qualifier. 1221 * \param [in] context_id The context ID that uses the qualifier. 1222 * \param [in] bcm_qual The BCM qualifier. 1223 * \param [out] cs_dnx_qual_p The DBAL field representing the DNX qualifier. 1224 * \par DIRECT OUTPUT: 1225 * \retval _SHR_E_NONE for success 1226 * \retval _SHR_E_PARAM problem with input parameters, usage should be printed 1227 * \retval other errors for other failure type 1228 */ 1229 typedef shr_error_e( 1230 *cs_qual_type_bcm_to_dnx_conversion_cb) ( 1231 int unit, 1232 uint32 cs_qual_index, 1233 dnx_field_context_t context_id, 1234 bcm_field_qualify_t bcm_qual, 1235 dbal_fields_e * cs_dnx_qual_p); 1236 1237 /** 1238 * \brief Typedef for CS qualifier type conversion routine from DNX to BCM. 1239 * \par DIRECT INPUT: 1240 * \param [in] unit unit id 1241 * \param [in] context_id The context ID that uses the qualifier. 1242 * \param [in] cs_dnx_qual The DBAL field representing the DNX qualifier. 1243 * \param [out] bcm_qual_p The BCM qualifier. 1244 * \param [out] cs_qual_index_p The index given by the user for the CS qualifier. 1245 * \par DIRECT OUTPUT: 1246 * \retval _SHR_E_NONE for success 1247 * \retval _SHR_E_PARAM problem with input parameters, usage should be printed 1248 * \retval other errors for other failure type 1249 */ 1250 typedef shr_error_e( 1251 *cs_qual_type_dnx_to_bcm_conversion_cb) ( 1252 int unit, 1253 dnx_field_context_t context_id, 1254 dbal_fields_e cs_dnx_qual, 1255 bcm_field_qualify_t * bcm_qual_p, 1256 uint32 *cs_qual_index_p); 1257 1258 /** 1259 * \brief Structure used to create dump list for context selection bcm qualifiers 1260 */ 1261 typedef struct 1262 { 1263 /** 1264 * Mandatory first member for structures added to the rhlist 1265 */ 1266 rhentry_t entry; 1267 /** 1268 * bcm qualifier 1269 */ 1270 bcm_field_qualify_t bcm_qual; 1271 int field_id[DNX_FIELD_STAGE_NOF]; 1272 } cs_dnx_dump_t; 1273 1274 /** 1275 * \brief Structure used to map bcm qualifier to context selection field ID 1276 * map may be regular - 1 bcm qual to 1 dbal field 1277 * or indexed - 1 dbal qualifier to array of dbal fields according to index, which is provided along bcm qual 1278 */ 1279 typedef struct 1280 { 1281 /** 1282 * Number of dbal_fields per bcm qualifier 1283 * 0 - Invalid - bcm qualifier not supported in context selection 1284 * 1 - means regular 1285 */ 1286 int nof; 1287 /** 1288 * In case of (nof == 1) and (qual_type_conversion_cb == NULL) dbal field id is used 1289 */ 1290 dbal_fields_e field_id; 1291 /** 1292 * First flag is marking basic bcm qualifier - the one that will be chosen for dnx to bcm mapping 1293 */ 1294 uint32 flags; 1295 /** 1296 * Pointer to array of dbal fields for specific bcm qual 1297 */ 1298 dbal_fields_e *field_id_array; 1299 /** 1300 * Increase index of qual_arg for certain qualifiers (currently only ForwardingType) 1301 */ 1302 int index_shift; 1303 /* 1304 * Routine that will translate the bcm qualifier to a dnx qualifier for cases when using 1305 * field_id_array is not enough. 1306 */ 1307 cs_qual_type_bcm_to_dnx_conversion_cb qual_type_bcm_to_dnx_conversion_cb; 1308 /* 1309 * Routine that will translate the dnx qualifier back to a bcm qualifier for cases when using 1310 * field_id_array is not enough. 1311 */ 1312 cs_qual_type_dnx_to_bcm_conversion_cb qual_type_dnx_to_bcm_conversion_cb; 1313 /* 1314 * Routine that will translate the qualifier's bcm value into its corresponding dnx value 1315 */ 1316 field_data_conversion_cb conversion_cb; 1317 } dnx_field_cs_qual_map_t; 1318 1319 /** 1320 * \brief Structure describing input type based information for dnx qualifiers 1321 */ 1322 typedef struct 1323 { 1324 /* 1325 * Valid flag serves to mark initialized input types, by default is FALSE(0) 1326 */ 1327 int valid; 1328 /** 1329 * Bitmap that represents for each input type which FFC ranges to use 1330 */ 1331 uint8 ranges; 1332 } dnx_field_qual_input_type_info_t; 1333 1334 /** 1335 * \brief Structure used to store information per SW qualifier 1336 */ 1337 typedef struct 1338 { 1339 /** 1340 * Field ID associated with this qualifier, to be used while configuring TCAM entries 1341 */ 1342 dbal_fields_e field_id; 1343 int size; 1344 /* 1345 * bcm qualifier that is mapped to this dnx one, if 0 no bcm qualifier is mapped to it 1346 */ 1347 bcm_field_qualify_t bcm_qual; 1348 } dnx_field_sw_qual_info_t; 1349 1350 /** 1351 * \brief Structure used to store signal information per qualifier 1352 */ 1353 typedef struct 1354 { 1355 /* 1356 * Name of stage signal comes from, If null any from 1357 * stages will be searched for match. 1358 */ 1359 char *from; 1360 /* 1361 * Name of stage signal goes to, if null any to stage 1362 * will be searched for match. 1363 */ 1364 char *to; 1365 /* 1366 * Name of the signal, which is corresponding to the qualifier. 1367 */ 1368 char *name; 1369 } dnx_field_map_qual_signal_info_t; 1370 1371 /** 1372 * \brief Structure used to store information per metadata qualifier 1373 */ 1374 typedef struct 1375 { 1376 /** 1377 * Field ID associated with this qualifier, to be used while configuring TCAM entries 1378 */ 1379 dbal_fields_e field_id; 1380 /* 1381 * bcm qualifier that is mapped to this dnx one, if 0 no bcm qualifier is mapped to it 1382 */ 1383 bcm_field_qualify_t bcm_qual; 1384 /* 1385 * Info about signal or signals, which are corresponding to the qualifier. 1386 */ 1387 dnx_field_map_qual_signal_info_t signal_info[DNX_DATA_MAX_FIELD_DIAG_NOF_SIGNALS_PER_QUALIFIER]; 1388 } dnx_field_meta_qual_info_t; 1389 1390 /** 1391 * \brief Structure used to store information per virtual wire qualifier 1392 */ 1393 typedef struct 1394 { 1395 /** 1396 * Field ID associated with this qualifier, to be used while configuring TCAM entries 1397 */ 1398 dbal_fields_e field_id; 1399 /** 1400 * The stages the VW is available for. 1401 */ 1402 uint32 stage_bmp; 1403 } dnx_field_vw_qual_info_t; 1404 1405 /** 1406 * \brief Structure used to store information per virtual wire action 1407 */ 1408 typedef struct 1409 { 1410 /** 1411 * Field ID associated with this action, to be used while configuring TCAM entries 1412 * The first field_id has the name of the virtual wire. 1413 */ 1414 dbal_fields_e field_id[DNX_FIELD_ACTION_MAX_ACTION_PER_VM]; 1415 /** 1416 * The number of actions in field_id and action size for each stage 1417 */ 1418 uint8 nof_actions_per_stage[DNX_FIELD_STAGE_NOF]; 1419 /** 1420 * The static action upon which the action is based on for each stage. 1421 */ 1422 dnx_field_action_t base_dnx_action_per_stage[DNX_FIELD_ACTION_MAX_ACTION_PER_VM][DNX_FIELD_STAGE_NOF]; 1423 } dnx_field_per_vw_action_info_t; 1424 1425 /** 1426 * \brief Structure used to store information per virtual wire action 1427 */ 1428 typedef struct 1429 { 1430 /** 1431 * The index in dnx_per_vw_action_info of the VW using this action. 1432 */ 1433 int vw_index; 1434 /** 1435 * The index of the action in the VW info in dnx_per_vw_action_info. 1436 */ 1437 int action_index_within_vw; 1438 } dnx_field_vw_action_info_t; 1439 1440 /** 1441 * \brief Structure used to store information per packet header qualifiers 1442 */ 1443 typedef struct 1444 { 1445 /* 1446 * Name that may be parsed using signal facility 1447 * If the name was not found, use statically defined size and offset (see below) 1448 * If size is 0 and name not found - qualifier will be invalid 1449 * If size is not 0 and field was found, found parameters takes precedence over static with info message 1450 */ 1451 char *name; 1452 /** 1453 * Field ID associated with this qualifier, to be used while configuring TCAM entries 1454 * If field_id is 0, it will be obtained dynamically from DBAL 1455 */ 1456 dbal_fields_e field_id; 1457 /* 1458 * Qualifier Size in bits, if 0 should be filled via name resolution 1459 * Used when qualifier name is not present in NetworkStructures.xml 1460 * On the fly we can decide to overwrite size and offset by XML 1461 */ 1462 int size; 1463 /** 1464 * For packet header - Offset from base - type of base depends on FCC type (in bits), filled together with size 1465 * For layer record - Offset inside layer record 1466 */ 1467 int offset; 1468 /* 1469 * Validity - mark if there was a problem in obtaining header qualifier parameters 1470 */ 1471 int valid; 1472 /* 1473 * bcm qualifier that is mapped to this dnx one, if 0 no bcm qualifier is mapped to it 1474 */ 1475 bcm_field_qualify_t bcm_qual; 1476 /* 1477 * Info about signal or signals, which are corresponding to the qualifier. 1478 */ 1479 dnx_field_map_qual_signal_info_t signal_info[DNX_DATA_MAX_FIELD_DIAG_NOF_SIGNALS_PER_QUALIFIER]; 1480 } dnx_field_header_qual_info_t; 1481 1482 /** 1483 * \brief Structure used to store information per packet layer record qualifiers 1484 */ 1485 typedef struct 1486 { 1487 /** 1488 * DBAL Field ID associated with this qualifier, to be used while configuring TCAM entries 1489 */ 1490 dbal_fields_e dbal_field_id; 1491 /* 1492 * bcm qualifier that is mapped to this dnx one, if 0 no bcm qualifier is mapped to it 1493 */ 1494 bcm_field_qualify_t bcm_qual; 1495 } dnx_field_layer_record_qual_info_t; 1496 1497 /** Structure to hold the in parameters of dnx_field_qualifier_create()*/ 1498 typedef struct 1499 { 1500 /** 1501 * Size of the created qualifier 1502 */ 1503 int size; 1504 /** 1505 * Name of the qualifier. 1506 */ 1507 char name[DBAL_MAX_STRING_LENGTH]; 1508 1509 } dnx_field_qualifier_in_info_t; 1510 1511 /** Flags for BCM to DNX qualifiers/action map */ 1512 #define BCM_TO_DNX_BASIC_OBJECT 0x01 1513 1514 /** 1515 * \brief 1516 * Structure to hold miscellaneous parameters for bcm to dnx mapping process 1517 */ 1518 typedef struct 1519 { 1520 /** 1521 * Encoded dnx qualifier to which bcm one is mapped 1522 */ 1523 dnx_field_qual_t dnx_qual; 1524 /** 1525 * First flag is marking basic bcm qualifier - the one that will be chosen for dnx to bcm mapping 1526 */ 1527 uint32 flags; 1528 /* 1529 * Routine that will translate the qualifier's bcm value into its corresponding dnx value 1530 */ 1531 field_data_conversion_cb conversion_cb; 1532 } dnx_field_qual_map_t; 1533 1534 typedef struct 1535 { 1536 /** 1537 * Encoded dnx action to which bcm one is mapped 1538 */ 1539 dnx_field_action_t dnx_action; 1540 /** 1541 * First flag is marking basic bcm action - the one that will be chosen for dnx to bcm mapping 1542 */ 1543 uint32 flags; 1544 /* 1545 * Routine that will translate the action's bcm value into its corresponding dnx value 1546 */ 1547 field_data_conversion_cb conversion_cb; 1548 } dnx_field_action_map_t; 1549 1550 /** 1551 * Information assigned to each static 'dnx action' 1552 */ 1553 typedef struct 1554 { 1555 /** 1556 * Field ID associated with this action, to be used while configuring TCAM entries 1557 */ 1558 dbal_fields_e field_id; 1559 /** 1560 * Number of bits assigned to this action (1 - 32) 1561 * To serve only SW action - for others size should be obtained dynamically from DBAL 1562 */ 1563 uint32 size_sw; 1564 /** 1565 * BCM action assigned on init 1566 */ 1567 bcm_field_action_t bcm_action; 1568 /** 1569 * Signal or signals, which are corresponding to the action. 1570 */ 1571 char *signal_name[DNX_DATA_MAX_FIELD_DIAG_NOF_SIGNALS_PER_ACTION]; 1572 } dnx_field_base_action_info_t; 1573 1574 /** Structure to hold the in parameters of dnx_field_action_create() 1575 * Action create does not actually create new action just set a different size for existing action 1576 * Hence this struct must indicate what is the base action and the new size 1577 */ 1578 typedef struct 1579 { 1580 /** Field stage the action was created for*/ 1581 dnx_field_stage_e stage; 1582 1583 /** BCM action type we use to configure the action */ 1584 bcm_field_action_t bcm_action; 1585 /** 1586 * Size of the created action 1587 * Cannot exceed the size of the base action. 1588 */ 1589 unsigned int size; 1590 1591 /** 1592 * A constant value that is apended to the MSB each action value that will be given to the action. 1593 * The prefix is not found in the TCAM/MDB payload (or key in direct extraction) and does not waste space there. 1594 * However, we implement it using FES action masks, which are a limited resource. 1595 */ 1596 uint32 prefix; 1597 1598 /** 1599 * The size in bit of the prefix. the sum of 'size'+'prefix_size' cannot exceed the size of the base action. 1600 * If the 'prefix_size' lsb bits of 'prefix' are all zeros, the prefix size will be zero. 1601 * As a safetly measurement, to make sure the user is cognisant of the base action size, the prefix size must fill 1602 * the remaining space in the base action, that is size+prefix_size=base_action_size. 1603 */ 1604 unsigned int prefix_size; 1605 /** 1606 * Name of the action. 1607 */ 1608 char name[DBAL_MAX_STRING_LENGTH]; 1609 1610 } dnx_field_action_in_info_t; 1611 1612 /** 1613 * \brief Structure to keep all stage related pointers and other information 1614 */ 1615 typedef struct 1616 { 1617 /* 1618 * Temporary adding PP_STAGE to be able to reach dnx data 1619 * Once FIELD_STAGE will be replaced by PP_STAGE it wont be needed 1620 */ 1621 dnx_pp_stage_e pp_stage; 1622 /** 1623 * Associated BCM Stage 1624 */ 1625 bcm_field_stage_t bcm_stage; 1626 /** 1627 * Next 3 parameters are to provide information on context selection qualifiers per stage 1628 */ 1629 /** 1630 * DBAL table id for cs qualifiers 1631 */ 1632 dbal_tables_e cs_table_id; 1633 /** 1634 * Number of dnx context selection qualifiers per stage 1635 */ 1636 int cs_qual_nof; 1637 /** 1638 * Pointer to array of dbal fields per dnx context selection qualifier 1639 */ 1640 const dbal_fields_e *cs_qual_info; 1641 /** 1642 * DBAL table id for cs hit indication 1643 */ 1644 dbal_tables_e cs_hit_indication_table_id; 1645 /* 1646 * Mapping arrays from bcm to dnx parameters 1647 */ 1648 /** 1649 * DBAL table id for lookup enabler 1650 */ 1651 dbal_tables_e lookup_enabler_table_id; 1652 /** 1653 * Max ID for metadata qualifier for this stage 1654 */ 1655 int meta_qual_nof; 1656 /** 1657 * Pointer to array of info per metadata dnx qualifier 1658 */ 1659 dnx_field_meta_qual_info_t *meta_qual_info; 1660 /** 1661 * Pointer to array of info per layer record dnx qualifier 1662 */ 1663 dnx_field_layer_record_qual_info_t *layer_qual_info; 1664 /* 1665 * array of ffc type dbal field ids 1666 */ 1667 dbal_fields_e ffc_type_field_a[DNX_FIELD_FFC_NOF]; 1668 dbal_fields_e ffc_instruction; 1669 dbal_fields_e ctx_id; 1670 dbal_fields_e key_field; 1671 dbal_tables_e ffc_table; 1672 /* 1673 * Structured fields to contain all qualifiers and actions per stage 1674 * Used to have an ability to obtain the lists directly from DBAl and field sizes for FP entry 1675 */ 1676 dbal_field_types_defs_e container_qual_field_type; 1677 dbal_field_types_defs_e container_act_field_type; 1678 /** 1679 * Next 3 parameters are to provide information on action per stage 1680 */ 1681 /** 1682 * DBAL field id for action 1683 */ 1684 dbal_fields_e action_field_id; 1685 /** 1686 * Max ID for DBAL action 1687 */ 1688 dnx_field_action_type_t static_action_nof; 1689 /** 1690 * Pointer to array of info per dnx action 1691 */ 1692 dnx_field_base_action_info_t *static_action_info; 1693 /* 1694 * BCM to DNX maps 1695 */ 1696 const dnx_field_cs_qual_map_t *cs_qual_map; 1697 const dnx_field_qual_map_t *meta_qual_map; 1698 const dnx_field_action_map_t *static_action_id_map; 1699 } dnx_field_map_stage_info_t; 1700 1701 /** 1702 * \brief Structure to keep AppType to KBP OPCODE mapping. 1703 */ 1704 typedef struct 1705 { 1706 /* 1707 * The OPCODE_ID to which the static apptype is mapped. 0 means invalid. 1708 */ 1709 dbal_enum_value_field_kbp_fwd_opcode_e opcode_id; 1710 } dnx_field_static_apptype_map_t; 1711 1712 /** 1713 * \brief Structure to keep AppType to KBP OPCODE mapping. 1714 * Also include context selection profile. 1715 */ 1716 typedef struct 1717 { 1718 /* 1719 * The BCM apptype indicating the KBP OPCODE ID. 1720 */ 1721 bcm_field_AppType_t app_type; 1722 /* 1723 * Value to be used for context selection. 1724 */ 1725 uint32 cs_profile_id; 1726 /* 1727 * Indicated if the OPCODE has valid information. 1728 */ 1729 uint8 is_valid; 1730 /* 1731 * Indicated if the OPCODE being used, that is if it has any context associated with it. 1732 */ 1733 uint8 in_use; 1734 } dnx_field_static_opcode_info_t; 1735 1736 /** 1737 * Enum for indicating the port profile type, whether it refers to port or LIF or a RIF. 1738 */ 1739 typedef enum 1740 { 1741 DNX_FIELD_PORT_PROFILE_TYPE_INVALID = 0, 1742 DNX_FIELD_PORT_PROFILE_TYPE_FIRST = 1, 1743 /** 1744 * The profile of a port, whether is be in port or out port, PP port or TM port. 1745 */ 1746 DNX_FIELD_PORT_PROFILE_TYPE_PORT = DNX_FIELD_PORT_PROFILE_TYPE_FIRST, 1747 /** 1748 * An extra profile of a port, whether is be in port or out port, PP port or TM port. 1749 */ 1750 DNX_FIELD_PORT_PROFILE_TYPE_PORT_GENERAL_DATA, 1751 /** 1752 * An extra profile of a port, beyond the first 32 bits, whether is be in port or out port, PP port or TM port. 1753 */ 1754 DNX_FIELD_PORT_PROFILE_TYPE_PORT_GENERAL_DATA_HIGH, 1755 /** 1756 * The profile of an in LIF in the ingress. 1757 */ 1758 DNX_FIELD_PORT_PROFILE_TYPE_IN_LIF_INGRESS, 1759 /** 1760 * The profile of an in RIF in the the ingress. 1761 */ 1762 DNX_FIELD_PORT_PROFILE_TYPE_IN_ETH_RIF_INGRESS, 1763 /** 1764 * The profile of an out LIF in the egress. 1765 */ 1766 DNX_FIELD_PORT_PROFILE_TYPE_OUT_LIF_INGRESS, 1767 /** 1768 * The profile of an out RIF in the the egress. 1769 */ 1770 DNX_FIELD_PORT_PROFILE_TYPE_OUT_ETH_RIF_EGRESS, 1771 /** 1772 * Number of enum valid values for port profile types */ 1773 DNX_FIELD_PORT_PROFILE_TYPE_NOF 1774 } dnx_field_port_porfile_type_e; 1775 1776 /** 1777 * \brief Structure that maps port profile properties 1778 * See dnx_field_port_profile_port_set. 1779 * See dnx_field_port_profile_port_get. 1780 * See dnx_field_map_port_profile_port_info_get. 1781 */ 1782 typedef struct 1783 { 1784 /** 1785 * Whether the port profile refers to a port of a LIF. 1786 */ 1787 dnx_field_port_porfile_type_e port_profile_type; 1788 /** The following attributes are only relevant for profile that are used for PP/TM ports.*/ 1789 /** 1790 * The DBAL table where the port profile is found, relevant only for port profile of type port. 1791 */ 1792 dbal_tables_e dbal_table_id; 1793 /* 1794 * The key field used by the DBAL table, relevant only for port profile of type port. 1795 */ 1796 dbal_fields_e dbal_key_field; 1797 /* 1798 * The result field used by the DBAL table, relevant only for port profile of type port. 1799 */ 1800 dbal_fields_e dbal_result_field; 1801 } dnx_field_map_port_profile_info_t; 1802 1803 /** 1804 * \brief Structure that stores field PP-APP enum to TCAM PP Table mapping. 1805 */ 1806 typedef struct 1807 { 1808 /* 1809 * The Table ID to which the PP-APP enum is mapped. 1810 */ 1811 dbal_tables_e dbal_table_id; 1812 /* 1813 * Specifies whether the entry is valid 1814 */ 1815 uint8 valid; 1816 } dnx_field_pp_app_map_t; 1817 1818 /* 1819 * } 1820 */ 1821 /* 1822 * Globals 1823 * Used by MACROs available for any FP users 1824 * { 1825 */ 1826 extern const dnx_field_map_stage_info_t dnx_field_map_stage_info[DNX_FIELD_STAGE_NOF]; 1827 extern dnx_field_vw_qual_info_t dnx_vw_qual_info[DNX_FIELD_MAP_MAX_VW_QUAL]; 1828 extern dnx_field_per_vw_action_info_t dnx_per_vw_action_info[DNX_FIELD_MAP_MAX_VW_WITH_ACTION]; 1829 extern dnx_field_vw_action_info_t dnx_vw_action_info[DNX_FIELD_MAP_MAX_VW_ACTION]; 1830 extern dnx_field_static_opcode_info_t dnx_field_static_opcode_info[DBAL_NOF_ENUM_KBP_FWD_OPCODE_VALUES]; 1831 extern const dnx_field_static_apptype_map_t dnx_field_standard_1_static_apptype_map[bcmFieldAppTypeCount]; 1832 extern const dnx_field_map_port_profile_info_t dnx_field_map_port_profile_info[bcmPortClassCount]; 1833 extern const dnx_field_pp_app_map_t dnx_field_pp_app_map[bcmFieldAppDbCount]; 1834 1835 /* 1836 * } 1837 */ 1838 1839 /* 1840 * Macros 1841 * { 1842 */ 1843 /* 1844 * Macro to indicate whether specified stage is initialized by FP. 1845 * 'FP' stages are those that have 'name' in stage_info array: 1846 * DNX_FIELD_STAGE_IPMF1, DNX_FIELD_STAGE_IPMF2, 1847 * DNX_FIELD_STAGE_IPMF3, DNX_FIELD_STAGE_EPMF 1848 */ 1849 #define DNX_FIELD_IS_FP_STAGE(stage) (dnx_field_map_stage_info[stage].pp_stage != DNX_PP_STAGE_INVALID) 1850 1851 #define DNX_FIELD_STAGE_ITERATOR(stage) \ 1852 for(stage = DNX_FIELD_STAGE_FIRST; stage < DNX_FIELD_STAGE_NOF; stage++) \ 1853 if(DNX_FIELD_IS_FP_STAGE(stage)) 1854 1855 #define DNX_FIELD_STAGE_CS_QUAL_ITERATOR(stage) \ 1856 for(stage = DNX_FIELD_STAGE_FIRST; stage < DNX_FIELD_STAGE_NOF; stage++) \ 1857 if(dnx_field_map_stage_info[stage].cs_qual_map != NULL) 1858 1859 #define DNX_FIELD_STAGE_QUAL_ITERATOR(stage) \ 1860 for(stage = DNX_FIELD_STAGE_FIRST; stage < DNX_FIELD_STAGE_NOF; stage++) \ 1861 if(dnx_field_map_stage_info[stage].meta_qual_map != NULL) 1862 1863 #define DNX_FIELD_STAGE_LAYER_QUAL_ITERATOR(stage) \ 1864 for(stage = DNX_FIELD_STAGE_FIRST; stage < DNX_FIELD_STAGE_NOF; stage++) \ 1865 if(dnx_field_map_stage_info[stage].layer_qual_info != NULL) 1866 1867 #define DNX_FIELD_STAGE_ACTION_ITERATOR(stage) \ 1868 for(stage = DNX_FIELD_STAGE_FIRST; stage < DNX_FIELD_STAGE_NOF; stage++) \ 1869 if(dnx_field_map_stage_info[stage].static_action_id_map != NULL) 1870 1871 #define DNX_FIELD_KBP_OPCODE_ITERATOR(_opcode_id) \ 1872 for(_opcode_id = 0; _opcode_id < DBAL_NOF_ENUM_KBP_FWD_OPCODE_VALUES; _opcode_id++) \ 1873 if(dnx_field_static_opcode_info[_opcode_id].is_valid) 1874 1875 #define DNX_FIELD_KBP_OPCODE_IN_USE_ITERATOR(_opcode_id) \ 1876 for(_opcode_id = 0; _opcode_id < DBAL_NOF_ENUM_KBP_FWD_OPCODE_VALUES; _opcode_id++) \ 1877 if(dnx_field_static_opcode_info[_opcode_id].is_valid && \ 1878 dnx_field_static_opcode_info[_opcode_id].in_use) 1879 1880 #define DNX_FIELD_KBP_APPTYPE_ITERATOR(_apptype_id) \ 1881 for(_apptype_id = 0; _apptype_id < bcmFieldAppTypeCount; _apptype_id++) \ 1882 if(dnx_field_static_opcode_info[dnx_field_static_apptype_map[_apptype_id].opcode_id].is_valid) 1883 1884 /** 1885 * \brief Return if an Apptype is within the user defined range 1886 * \param [in] unit - Device ID 1887 * \param [in] _tested_apptype - The apptype 1888 * \return 1889 * True if the apptype is within the predefiend range 1890 * \remark 1891 */ 1892 #define DNX_FIELD_APPTYPE_IS_USER_DEF(unit, _tested_apptype) \ 1893 ((_tested_apptype >= dnx_data_field.kbp.apptype_user_1st_get(unit)) && \ 1894 (_tested_apptype < dnx_data_field.kbp.apptype_user_1st_get(unit) + \ 1895 dnx_data_field.kbp.apptype_user_nof_get(unit))) 1896 1897 #define DNX_FIELD_HEADER_QUAL_VERIFY(qual_id) \ 1898 if((qual_id < DNX_FIELD_HEADER_QUAL_FIRST) || (qual_id >= DNX_FIELD_HEADER_QUAL_NOF)) \ 1899 { \ 1900 SHR_ERR_EXIT(_SHR_E_PARAM, "Header qual id:%d is out of range\n", qual_id); \ 1901 } 1902 1903 #define DNX_FIELD_SW_QUAL_VERIFY(qual_id) \ 1904 if((qual_id < DNX_FIELD_SW_QUAL_FIRST) || (qual_id >= DNX_FIELD_SW_QUAL_NOF)) \ 1905 { \ 1906 SHR_ERR_EXIT(_SHR_E_PARAM, "SW qual id:%d is out of range\n", qual_id); \ 1907 } 1908 1909 #define DNX_FIELD_META_QUAL_VERIFY(stage, qual_id) \ 1910 if((qual_id < DNX_FIELD_QUAL_ID_FIRST) || (qual_id >= dnx_field_map_stage_info[stage].meta_qual_nof)) \ 1911 { \ 1912 SHR_ERR_EXIT(_SHR_E_PARAM, "meta qual id:%d is out of range for stage:%s\n", \ 1913 qual_id, dnx_field_stage_text(unit,stage)); \ 1914 } 1915 1916 #define DNX_FIELD_LAYER_QUAL_VERIFY(stage, qual_id) \ 1917 if((qual_id < DNX_FIELD_LR_QUAL_FIRST) || (qual_id >= DNX_FIELD_LR_QUAL_NOF)) \ 1918 { \ 1919 SHR_ERR_EXIT(_SHR_E_PARAM, "layer record qual id:%d is out of range for stage:%s\n",\ 1920 qual_id, dnx_field_stage_text(unit,stage)); \ 1921 } 1922 1923 #define DNX_FIELD_LAYER_INDEX_VERIFY(stage, layer_id) \ 1924 if(dnx_field_map_stage_info[stage].layer_qual_info == NULL) \ 1925 { \ 1926 SHR_ERR_EXIT(_SHR_E_PARAM, "Stage:%s does not support layer record qualifiers\n", \ 1927 dnx_field_stage_text(unit,stage)); \ 1928 } \ 1929 if((layer_id < 0 ) || \ 1930 (layer_id >= dnx_data_field.stage.stage_info_get(unit, stage)->nof_layer_records)) \ 1931 { \ 1932 SHR_ERR_EXIT(_SHR_E_PARAM, "Layer Index:%d is invalid for stage: %s. " \ 1933 "Number of layers available to stage is %d.\n", \ 1934 layer_id, dnx_field_stage_text(unit,stage), \ 1935 dnx_data_field.stage.stage_info_get(unit, stage)->nof_layer_records); \ 1936 } 1937 1938 #define DNX_FIELD_BCM_QUAL_VERIFY(bcm_qual) \ 1939 if((bcm_qual < 0) || (bcm_qual >= bcmFieldQualifyCount)) \ 1940 { \ 1941 SHR_ERR_EXIT(_SHR_E_PARAM, "BCM qualifier:%d is out of range\n", bcm_qual); \ 1942 } 1943 1944 #define DNX_FIELD_BCM_ACTION_VERIFY(bcm_action) \ 1945 if((bcm_action < 0) || (bcm_action >= bcmFieldActionCount)) \ 1946 { \ 1947 SHR_ERR_EXIT(_SHR_E_PARAM, "BCM action:%d is out of range\n", bcm_action); \ 1948 } 1949 1950 #define DNX_FIELD_DBAL_FIELD_ID_VERIFY(dbal_field_id) \ 1951 { \ 1952 if((dbal_field_id <= DBAL_FIELD_EMPTY) || (dbal_field_id >= DBAL_NOF_FIELDS)) \ 1953 { \ 1954 SHR_ERR_EXIT(_SHR_E_PARAM, "Invalid dbal field id:%d\n", dbal_field_id); \ 1955 } \ 1956 } 1957 1958 #define DNX_FIELD_QUAL_SIZE_VERIFY(size) \ 1959 { \ 1960 if((size < 1) || (size > dnx_data_field.qual.max_bits_in_qual_get(unit))) \ 1961 { \ 1962 SHR_ERR_EXIT(_SHR_E_PARAM, "Qualifier size (%d) must be between %d and %d\n", \ 1963 size, 1, dnx_data_field.qual.max_bits_in_qual_get(unit)); \ 1964 } \ 1965 } 1966 1967 #define DNX_FIELD_NCM_PORT_CLASS_VERIFY(bcm_port_class) \ 1968 { \ 1969 if((bcm_port_class < 0) || (bcm_port_class > bcmPortClassCount)) \ 1970 { \ 1971 SHR_ERR_EXIT(_SHR_E_PARAM, "BCM port class:%d is out of range\n", bcm_port_class); \ 1972 } \ 1973 if(dnx_field_map_port_profile_info[bcm_port_class].port_profile_type == DNX_FIELD_PORT_PROFILE_TYPE_INVALID) \ 1974 { \ 1975 SHR_ERR_EXIT(_SHR_E_PARAM, "BCM port class:%d is unsupported for field map.\n", bcm_port_class); \ 1976 } \ 1977 } 1978 1979 #define DNX_FIELD_ACTION_ID_NOF(stage) \ 1980 (dnx_field_map_stage_info[stage].static_action_nof) 1981 1982 #define DNX_FIELD_CS_QUAL_NOF(stage) \ 1983 (dnx_field_map_stage_info[stage].cs_qual_nof) 1984 1985 /* 1986 * } 1987 */ 1988 /** 1989 * \brief 1990 * Init the Sw state of Field Map module 1991 * \param [in] unit - Device id 1992 * \return 1993 * shr_error_e - Error Type 1994 * \remark 1995 * * None 1996 * \see 1997 * * None 1998 */ 1999 shr_error_e dnx_field_map_sw_state_init( 2000 int unit); 2001 2002 /** 2003 * \brief Return name of bcm qualifier 2004 * \param [in] unit - Identifier of HW platform. 2005 * \param [in] bcm_qual - bcm qualifier ID 2006 * \return 2007 * \retval bcmQualifierName - On success 2008 * \retval NULL - ON Failure 2009 * \remark 2010 */ 2011 CONST char *dnx_field_bcm_qual_text( 2012 int unit, 2013 bcm_field_qualify_t bcm_qual); 2014 2015 /** 2016 * \brief Return name of bcm action 2017 * \param [in] unit - Identifier of HW platform. 2018 * \param [in] bcm_action - bcm action ID 2019 * \return 2020 * \retval bcmActionName - On success 2021 * \retval NULL - On Failure 2022 * \remark 2023 */ 2024 CONST char *dnx_field_bcm_action_text( 2025 int unit, 2026 bcm_field_action_t bcm_action); 2027 2028 /** 2029 * \brief Return name of pipeline stage 2030 * \param [in] unit - Identifier of HW platform. 2031 * \param [in] stage - stage ID 2032 * \return 2033 * \retval bcmStageName - On success 2034 * \retval NULL - On Failure 2035 * \remark 2036 */ 2037 char *dnx_field_stage_text( 2038 int unit, 2039 dnx_field_stage_e stage); 2040 2041 /** 2042 * \brief Return name of BCM stage 2043 * \param [in] bcm_stage - BCM stage ID 2044 * \return 2045 * \retval bcmStageName - On success 2046 * \retval NULL - On Failure 2047 * \remark 2048 */ 2049 char *dnx_field_bcm_stage_text( 2050 bcm_field_stage_t bcm_stage); 2051 2052 /** 2053 * \brief Return name of BCM Layer Type 2054 * \param [in] bcm_layer_type - BCM Layer Type ID 2055 * \return 2056 * \retval bcmLayerTypeName - On success 2057 * \retval NULL - On Failure 2058 * \remark 2059 */ 2060 char *dnx_field_bcm_layer_type_text( 2061 bcm_field_layer_type_t bcm_layer_type); 2062 2063 /** 2064 * \brief Return name of dnx qualifier class 2065 * \param [in] qual_class - dnx qualifier class 2066 * \return 2067 * \retval class name - On success 2068 * \retval "Invalid Class" - If invalid class provided 2069 * \retval "Unnamed Class" - If for valid class name was not assigned 2070 * \remark 2071 */ 2072 char *dnx_field_qual_class_text( 2073 dnx_field_qual_class_e qual_class); 2074 2075 /** 2076 * \brief Return name of dnx input type 2077 * \param [in] input_type - qual input type 2078 * \return 2079 * \retval input_type name - On success 2080 * \retval "Invalid Input Type" - If invalid input type provided 2081 * \retval "Unnamed Input Type" - If for valid input type, name was not assigned 2082 * \remark 2083 */ 2084 char *dnx_field_input_type_text( 2085 dnx_field_input_type_e input_type); 2086 2087 /** 2088 * \brief Return name of bcm input type 2089 * \param [in] bcm_input_type - BCM qual input type 2090 * \return 2091 * \retval input_type name - On success 2092 * \retval "Invalid Input Type" - If invalid input type provided 2093 * \retval "Unnamed Input Type" - If for valid input type, name was not assigned 2094 * \remark 2095 */ 2096 char *dnx_field_bcm_input_type_text( 2097 bcm_field_input_types_t bcm_input_type); 2098 2099 /** 2100 * \brief Return name of bcm packet remove layer 2101 * \param [in] bcm_packet_remove_layer - BCM packet remove layer 2102 * \return 2103 * \retval packet_remove_layer name - On success 2104 * \retval "Invalid Packet Remove Layer" - If invalid Packet Remove Layer provided 2105 * \retval "Unnamed Packet Remove Layer" - If for valid Packet Remove Layer, name was not assigned 2106 * \remark 2107 */ 2108 char *dnx_field_bcm_packet_remove_layer_text( 2109 bcm_field_packet_remove_layers_t bcm_packet_remove_layer); 2110 2111 /** 2112 * \brief Return name of bcm tcam bank allocation mode 2113 * \param [in] bcm_tcam_bank_allocation_mode - BCM tcam bank allocation mode 2114 * \return 2115 * \retval input_type name - On success 2116 * \retval "Invalid Input Type" - If invalid input type provided 2117 * \retval "Unnamed Input Type" - If for valid input type, name was not assigned 2118 * \remark 2119 */ 2120 char *dnx_field_bcm_tcam_bank_allocation_mode_text( 2121 bcm_field_tcam_bank_allocation_mode_t bcm_tcam_bank_allocation_mode); 2122 2123 /** 2124 * \brief Return name of bcm Apptype 2125 * \param [in] bcm_apptype - BCM Apptype 2126 * \return 2127 * \retval Apptype name - On success 2128 * \retval "Invalid Apptype Type" - If invalid Apptype provided 2129 * \retval "Unnamed Apptype Type" - If for valid Apptype, name was not assigned 2130 * \remark 2131 */ 2132 char *dnx_field_bcm_apptype_text( 2133 bcm_field_AppType_t bcm_apptype); 2134 2135 /** 2136 * \brief Return name of bcm RangeType 2137 * \param [in] bcm_rangetype - BCM RangeType 2138 * \return 2139 * \retval RangeType name - On success 2140 * \retval "Invalid RangeType Type" - If invalid RangeType provided 2141 * \remark 2142 */ 2143 char *dnx_field_bcm_range_type_text( 2144 bcm_field_range_type_t bcm_rangetype); 2145 2146 /** 2147 * \brief Return name of bcm RangeResultMap 2148 * \param [in] bcm_rangeresultmap - BCM RangeResultMap 2149 * \return 2150 * \retval RangeResultMap name - On success 2151 * \retval "Invalid RangeResultMap Type" - If invalid RangeResultMap provided 2152 * \remark 2153 */ 2154 char *dnx_field_bcm_range_result_map_text( 2155 bcm_switch_range_result_map_t bcm_rangeresultmap); 2156 2157 /** 2158 * \brief Return name of bcm RangeOperator 2159 * \param [in] bcm_rangeoperator - BCM RangeOperator 2160 * \return 2161 * \retval RangeOperator name - On success 2162 * \retval "Invalid RangeOperator Type" - If invalid RangeOperator provided 2163 * \remark 2164 */ 2165 char *dnx_field_bcm_range_operator_text( 2166 bcm_switch_range_operator_t bcm_rangeoperator); 2167 2168 /** 2169 * \brief Return name of dnx action class 2170 * \param [in] action_class - dnx action class 2171 * \return 2172 * \retval class name - On success 2173 * \retval "Invalid Class" - If invalid class provided 2174 * \retval "Unnamed Class" - If for valid class name was not assigned 2175 * \remark 2176 */ 2177 char *dnx_field_action_class_text( 2178 dnx_field_action_class_e action_class); 2179 2180 /** 2181 * \brief Return Name of DNX Action 2182 * \param [in] unit - Identifier of HW platform. 2183 * \param [in] dnx_action - Encoded DNX Action 2184 * \return 2185 * \retval dbal field name - On success 2186 * \retval Invalid DNX Action - When DNX Action is not valid 2187 * \remark 2188 * Name is actually DBAL field name 2189 */ 2190 CONST char *dnx_field_dnx_action_text( 2191 int unit, 2192 dnx_field_action_t dnx_action); 2193 2194 /** 2195 * \brief Return Name of DNX Qualifier 2196 * \param [in] unit - Identifier of HW platform. 2197 * \param [in] dnx_qual - Encoded DNX Qualifier 2198 * \return 2199 * \retval dbal field name - On success 2200 * \retval Invalid DNX Qualifier - When DNX Qualifier is not valid 2201 * \remark 2202 * Name is actually DBAL field name 2203 */ 2204 CONST char *dnx_field_dnx_qual_text( 2205 int unit, 2206 dnx_field_qual_t dnx_qual); 2207 2208 /** 2209 * \brief Return Protocol Name for Header Qualifier 2210 * \param [in] unit - Identifier of HW platform. 2211 * \param [in] dnx_qual - Encoded DNX Qualifier 2212 * \return 2213 * \retval Protocol Stack name - On success 2214 * \retval NULL - if dnx_qual is not Header one or id does not match 2215 * \retval "" - empty string if there is no name for header qualifier 2216 * \remark 2217 * Name is actually DBAL field name 2218 */ 2219 char *dnx_field_header_qual_name( 2220 int unit, 2221 dnx_field_qual_t dnx_qual); 2222 2223 /** 2224 * \brief 2225 * Gets the actions and offsets that write to aspecific VW mapping. 2226 * \param [in] unit - Device ID. 2227 * \param [in] stage - Stage 2228 * \param [in] mapping_info_p - The mapping of VM to a signal. 2229 * \param [out] nof_actions_p - Number of actions mapped to the signal by the VM. 2230 * \param [out] dnx_actions- The list of action ids used by the signal. 2231 * \param [out] offsets- The offsets on the signal of the actions 2232 * \param [out] action_sizes- The sizes of the actions. 2233 * \return 2234 * shr_error_e - Error Type 2235 * \remark 2236 * * None 2237 * \see 2238 * * None 2239 */ 2240 shr_error_e dnx_field_action_vw_single_mapping_actions_offsets( 2241 int unit, 2242 dnx_field_stage_e stage, 2243 VirtualWireMappingInfo * mapping_info_p, 2244 int *nof_actions_p, 2245 dnx_field_action_t dnx_actions[DNX_DATA_MAX_FIELD_VIRTUAL_WIRE_ACTIONS_PER_SIGNAL_NOF], 2246 int offsets[DNX_DATA_MAX_FIELD_VIRTUAL_WIRE_ACTIONS_PER_SIGNAL_NOF], 2247 int action_sizes[DNX_DATA_MAX_FIELD_VIRTUAL_WIRE_ACTIONS_PER_SIGNAL_NOF]); 2248 2249 shr_error_e dnx_field_map_vw_qual_action_init( 2250 int unit); 2251 2252 shr_error_e dnx_field_map_action_init( 2253 int unit); 2254 2255 shr_error_e dnx_field_map_qual_init( 2256 int unit); 2257 2258 shr_error_e dnx_field_map_cs_qual_init( 2259 int unit); 2260 2261 shr_error_e dnx_field_map_init( 2262 int unit); 2263 2264 shr_error_e dnx_field_map_deinit( 2265 int unit); 2266 2267 /** 2268 * \brief Indicade if any mapping exists for a qualifier in the the context selection of a specific stage. 2269 * \param [in] unit - Identifier of HW platform. 2270 * \param [in] stage - Stage identifier 2271 * \param [in] bcm_qual - BCM qualifier id 2272 * \param [out] exists_p - Indicates if the mapping exists 2273 * \return 2274 * \retval _SHR_E_NONE - On success 2275 * \retval Other - Other errors as per shr_error_e 2276 * \remark 2277 */ 2278 shr_error_e dnx_field_map_cs_qual_bcm_mapping_exists( 2279 int unit, 2280 dnx_field_stage_e stage, 2281 bcm_field_qualify_t bcm_qual, 2282 int *exists_p); 2283 2284 /** 2285 * \brief Translate bcm qualifier into CS qualifier, this is one2one conversion 2286 * \param [in] unit - Identifier of HW platform. 2287 * \param [in] stage - Stage identifier 2288 * \param [in] context_id - Context ID of the preselection quals 2289 * \param [in] bcm_qual - BCM qualifier id 2290 * \param [in] cs_qual_index - index for arrayed DNX CS qualifiers, for non arrayed will be ignored (probably best to set at 0) 2291 * \param [out] cs_dnx_qual_p - pointer to dnx cs qualifier - DBAL Field ID 2292 * \return 2293 * \retval _SHR_E_NONE - On success 2294 * \retval _SHR_E_NOT_FOUND - When there is no support for such bcm qualifier in CS 2295 * \retval _SHR_E_PARAM - One of input params is out of range 2296 * \retval Other - Other errors as per shr_error_e 2297 * \remark 2298 */ 2299 shr_error_e dnx_field_map_cs_qual_bcm_to_dnx( 2300 int unit, 2301 dnx_field_stage_e stage, 2302 dnx_field_context_t context_id, 2303 bcm_field_qualify_t bcm_qual, 2304 int cs_qual_index, 2305 dbal_fields_e * cs_dnx_qual_p); 2306 2307 /** 2308 * \brief Translate bcm qualifier into CS qualifier, this is one2one conversion 2309 * \param [in] unit - Identifier of HW platform. 2310 * \param [in] core - Identifier of core. 2311 * \param [in] stage - Stage identifier 2312 * \param [in] context_id - Context ID of the preselection quals 2313 * \param [in] bcm_cs_qual_info - BCM presel qualifier info, source of information here 2314 * \param [in] dnx_cs_qual_info - DNX presel qualifier info, destination here 2315 * \return 2316 * \retval _SHR_E_NONE - On success 2317 * \retval _SHR_E_NOT_FOUND - When there is no support for such bcm qualifier in CS 2318 * \retval _SHR_E_PARAM - One of input params is out of range 2319 * \retval Other - Other errors as per shr_error_e 2320 * \remark 2321 */ 2322 shr_error_e dnx_field_map_cs_qual_info_bcm_to_dnx( 2323 int unit, 2324 bcm_core_t core, 2325 dnx_field_stage_e stage, 2326 dnx_field_context_t context_id, 2327 bcm_field_presel_qualify_data_t * bcm_cs_qual_info, 2328 dnx_field_presel_qual_data_t * dnx_cs_qual_info); 2329 2330 /** 2331 * \brief Translate CS DNX qualifier into BCM qualifier, this 2332 * is one2one conversion 2333 * \param [in] unit - Identifier of HW platform. 2334 * \param [in] stage - Stage identifier 2335 * \param [in] context_id - Context ID of the preselection quals 2336 * \param [in] dnx_cs_qual - DNX qualifier id - DBAL Field ID 2337 * \param [out] bcm_qual_p - pointer to BCM qualifier 2338 * \param [out] cs_qual_index_p - pointer to CS qual index (0 for non-arrayed qualifiers) 2339 * \return 2340 * \retval _SHR_E_NONE - On success 2341 * \retval _SHR_E_NOT_FOUND - When there is no support for such bcm qualifier in CS 2342 * \retval _SHR_E_PARAM - One of input params is out of range 2343 * \retval Other - Other errors as per shr_error_e 2344 * \remark 2345 */ 2346 shr_error_e dnx_field_map_cs_qual_dnx_to_bcm( 2347 int unit, 2348 dnx_field_stage_e stage, 2349 dnx_field_context_t context_id, 2350 dbal_fields_e dnx_cs_qual, 2351 bcm_field_qualify_t * bcm_qual_p, 2352 uint32 *cs_qual_index_p); 2353 2354 /** 2355 * \brief Translate bcm qualifier into the set of DNX qualifiers 2356 * \param [in] unit - Identifier of HW platform. 2357 * \param [in] stage - Stage identifier 2358 * \param [out] cs_table_id_p - pointer to Context Selection qualifiers DBAL table id 2359 * \return 2360 * \retval _SHR_E_NONE - On success 2361 * \retval _SHR_E_PARAM - One of input params is out of range 2362 * \retval Other - Other errors as per shr_error_e 2363 * \remark 2364 */ 2365 shr_error_e dnx_field_map_cs_qual_table_id( 2366 int unit, 2367 dnx_field_stage_e stage, 2368 dbal_tables_e * cs_table_id_p); 2369 2370 /** 2371 * \brief Dump all available mappings from bcm qualifier to cs fields 2372 * \param [in] unit - Identifier of HW platform. 2373 * \param [in,out] cs_dnx_list_p - pointer to the list of dnx cs qualifiers set 2374 * \return 2375 * \retval _SHR_E_NONE - On success 2376 * \retval _SHR_E_NOT_FOUND - When there is no support for such bcm qualifier 2377 * \retval _SHR_E_PARAM - One of input params is out of range 2378 * \retval Other - Other errors as per shr_error_e 2379 * \remark 2380 */ 2381 shr_error_e dnx_field_map_cs_qual_dump( 2382 int unit, 2383 rhlist_t ** cs_dnx_list_p); 2384 2385 /** 2386 * \brief Get all available cs fields for given stage, for all units. 2387 * \param [in] unit - Identifier of HW platform. Only used for error reporting. 2388 * \param [in] stage - Stage identifier 2389 * \param [out] dnx_cs_qual_info_p - pointer to the array of dnx cs quals sets, dbal field ids 2390 * \param [out] dnx_cs_qual_nof_p - pointer to the number of dnx cs quals 2391 * \return 2392 * \retval _SHR_E_NONE - On success 2393 * \retval _SHR_E_PARAM - One of input params is out of range 2394 * \retval Other - Other errors as per shr_error_e 2395 * \remark 2396 */ 2397 shr_error_e dnx_field_map_cs_qual_dnx_get( 2398 int unit, 2399 dnx_field_stage_e stage, 2400 const dbal_fields_e ** dnx_cs_qual_info_p, 2401 int *dnx_cs_qual_nof_p); 2402 2403 /** 2404 * \brief 2405 * Verify input parameters for preselection ID 2406 * \param [in] unit - Device ID 2407 * \param [in] stage - dnx stage identifier 2408 * \param [in,out] cs_nof_lines_p - pointer to number of cs lines to be assigned in the routine 2409 * \return 2410 * shr_error_e - Error Type 2411 * \remark 2412 * * None 2413 * \see 2414 * * None 2415 */ 2416 shr_error_e dnx_field_map_cs_qual_nof_lines( 2417 int unit, 2418 dnx_field_stage_e stage, 2419 uint32 *cs_nof_lines_p); 2420 2421 /** 2422 * \brief 2423 * This function decrement the number fo group reference to that specific qualifier id 2424 * of groups referenced by 2425 * \param [in] unit - Device Id 2426 * \param [in] qual - Dnx Qualifier 2427 * \return 2428 * shr_error_e - Error Type 2429 * \remark 2430 * * None 2431 * \see 2432 * * None 2433 */ 2434 shr_error_e dnx_field_qual_ref_dec( 2435 int unit, 2436 dnx_field_qual_t qual); 2437 2438 /** 2439 * \brief 2440 * This function increment the number fo group reference to that specific qualifier id 2441 * increments the number of groups referenced by 2442 * \param [in] unit - Device Id 2443 * \param [in] qual - Dnx Qualifier 2444 * \return 2445 * shr_error_e - Error Type 2446 * \remark 2447 * * None 2448 * \see 2449 * * None 2450 */ 2451 shr_error_e dnx_field_qual_ref_inc( 2452 int unit, 2453 dnx_field_qual_t qual); 2454 2455 /** 2456 * \brief 2457 * Clear the dnx_field_qualifier_in_info_t, set it to preferred init values 2458 * \param [in] unit - Device ID 2459 * \param [in] qual_info_in_p - Pointer to input structure of qual_info_in_p that needs to be initiated 2460 * \return 2461 * shr_error_e - Error Type 2462 * \remark 2463 * * None 2464 * \see 2465 * * None 2466 */ 2467 shr_error_e dnx_field_qual_in_info_init( 2468 int unit, 2469 dnx_field_qualifier_in_info_t * qual_info_in_p); 2470 2471 /** 2472 * \brief 2473 * Create User qualifier 2474 * \param [in] unit - Device ID 2475 * \param [in] flags - Flags to create the qualifier with 2476 * \param [in] qual_info_p - Qualifier information for creation. 2477 * \param [in,out] bcm_qual_p - For the case with_id bcm_qual will be input, otherwise output 2478 * \return 2479 * shr_error_e - Error Type 2480 * \remark 2481 * * None 2482 * \see 2483 * * None 2484 */ 2485 shr_error_e dnx_field_qual_create( 2486 int unit, 2487 dnx_field_qual_flags_e flags, 2488 dnx_field_qualifier_in_info_t * qual_info_p, 2489 bcm_field_qualify_t * bcm_qual_p); 2490 2491 /** 2492 * \brief 2493 * Destroy User created qualifier 2494 * \param [in] unit - Device ID 2495 * \param [in] bcm_qual - BCM Qualifier to destroy 2496 * \return 2497 * shr_error_e - Error Type 2498 * \remark 2499 * * None 2500 * \see 2501 * * None 2502 */ 2503 shr_error_e dnx_field_qual_destroy( 2504 int unit, 2505 bcm_field_qualify_t bcm_qual); 2506 2507 shr_error_e dnx_field_map_qual_description_get( 2508 int unit, 2509 bcm_field_qualify_t bcm_qual, 2510 char **qual_description); 2511 2512 /** 2513 * \brief 2514 * Gets the info for the qualifier which is relevant to the end user. 2515 * It fills it in qual_in_info_p. 2516 * \param [in] unit - Device ID. 2517 * \param [in] bcm_qual - BCM Qualifier ID. 2518 * \param [out] qual_info_p - holds all relevant info for the action, size, stage and name. 2519 * \return 2520 * shr_error_e - Error Type 2521 * \remark 2522 * * None 2523 * \see 2524 * * None 2525 */ 2526 shr_error_e dnx_field_qual_get( 2527 int unit, 2528 bcm_field_qualify_t bcm_qual, 2529 dnx_field_qualifier_in_info_t * qual_info_p); 2530 2531 /** 2532 * \brief Translate bcm qualifier into the set of DNX qualifiers 2533 * \param [in] unit - Identifier of HW platform. 2534 * \param [in] stage - Stage identifier 2535 * \param [in] print_errors - Bool to decide whether to display the errors 2536 * \param [in] bcm_qual - BCM qualifier id 2537 * \param [in,out] dnx_qual_p - pointer to dnx qualifier array 2538 * \param [out] qual_map_entry_p - place to assign pointer of bcm qual entry ignore if NULL 2539 * \return 2540 * \retval _SHR_E_NONE - On success 2541 * \retval _SHR_E_NOT_FOUND - When there is no support for such bcm qualifier 2542 * \retval _SHR_E_PARAM - One of input params is illegal or out of range 2543 * \retval Other - Other errors as per shr_error_e 2544 * \remark 2545 */ 2546 shr_error_e dnx_field_map_qual_bcm_to_dnx_int( 2547 int unit, 2548 dnx_field_stage_e stage, 2549 uint32 print_errors, 2550 bcm_field_qualify_t bcm_qual, 2551 dnx_field_qual_t * dnx_qual_p, 2552 const dnx_field_qual_map_t ** qual_map_entry_p); 2553 2554 /** 2555 * \brief Translate bcm qualifier into the set of DNX qualifiers 2556 * \param [in] unit - Identifier of HW platform. 2557 * \param [in] stage - Stage identifier 2558 * \param [in] bcm_qual - BCM qualifier id 2559 * \param [in,out] dnx_qual_p - pointer to dnx qualifier array 2560 * \return 2561 * \retval _SHR_E_NONE - On success 2562 * \retval _SHR_E_NOT_FOUND - When there is no support for such bcm qualifier 2563 * \retval _SHR_E_PARAM - One of input params is illegal or out of range 2564 * \retval Other - Other errors as per shr_error_e 2565 * \remark 2566 */ 2567 shr_error_e dnx_field_map_qual_bcm_to_dnx( 2568 int unit, 2569 dnx_field_stage_e stage, 2570 bcm_field_qualify_t bcm_qual, 2571 dnx_field_qual_t * dnx_qual_p); 2572 2573 /** 2574 * \brief Translate bcm qualifier into the set of DNX qualifiers 2575 * \param [in] unit - Identifier of HW platform. 2576 * \param [in] core - Identifier of core. 2577 * \param [in] stage - Stage identifier 2578 * \param [in] bcm_qual_info - pointer to BCM qualifier info 2579 * \param [out] dnx_qual_info - pointer to DNX qualifier array 2580 * \return 2581 * \retval _SHR_E_NONE - On success 2582 * \retval _SHR_E_NOT_FOUND - When there is no support for such bcm qualifier 2583 * \retval _SHR_E_PARAM - One of input params is out of range 2584 * \retval Other - Other errors as per shr_error_e 2585 * \remark 2586 */ 2587 shr_error_e dnx_field_map_qual_info_bcm_to_dnx( 2588 int unit, 2589 bcm_core_t core, 2590 dnx_field_stage_e stage, 2591 bcm_field_entry_qual_t * bcm_qual_info, 2592 dnx_field_entry_qual_t * dnx_qual_info); 2593 2594 /** 2595 * \brief Indicates if the mapping of a qaulifier includes value conversion. 2596 * \param [in] unit - Identifier of HW platform. 2597 * \param [in] bcm_stage - Stage identifier 2598 * \param [in] bcm_qual - The mapped qualifier 2599 * \param [out] has_conversion_p - Indicates if there is a value conversion. 2600 * \return 2601 * \retval _SHR_E_NONE - On success 2602 * \retval _SHR_E_NOT_FOUND - When there is no support for such bcm qualifier 2603 * \retval _SHR_E_PARAM - One of input params is out of range 2604 * \retval Other - Other errors as per shr_error_e 2605 * \remark 2606 */ 2607 shr_error_e dnx_field_map_qual_has_conversion( 2608 int unit, 2609 bcm_field_stage_t bcm_stage, 2610 bcm_field_qualify_t bcm_qual, 2611 int *has_conversion_p); 2612 2613 /** 2614 * \brief Translate dnx qualifier into BCM one 2615 * \param [in] unit - Identifier of HW platform. 2616 * \param [in] stage - Stage identifier 2617 * \param [in] dnx_qual - dnx qualifier 2618 * \param [in] bcm_qual_p - pointer where BCM qualifier id should be placed 2619 * \return 2620 * \retval _SHR_E_NONE - On success 2621 * \retval _SHR_E_NOT_FOUND - When there is no support for such dnx qualifier 2622 * \retval _SHR_E_PARAM - One of input params is out of range 2623 * \retval Other - Other errors as per shr_error_e 2624 * \remark 2625 */ 2626 shr_error_e dnx_field_map_qual_dnx_to_bcm( 2627 int unit, 2628 dnx_field_stage_e stage, 2629 dnx_field_qual_t dnx_qual, 2630 bcm_field_qualify_t * bcm_qual_p); 2631 2632 /** 2633 * \brief Create the list of all available dnx qualifiers per stage 2634 * \param [in] unit - Identifier of HW platform. 2635 * \param [in] stage - Stage identifier 2636 * \param [in,out] dnx_qual_list_p - pointer to the list of dnx qualifiers 2637 * \param [in,out] dnx_qual_num_p - pointer to the number dnx qualifier 2638 * \return 2639 * \retval _SHR_E_NONE - On success 2640 * \retval _SHR_E_PARAM - One of input params is out of range 2641 * \retval Other - Other errors as per shr_error_e 2642 * \remark 2643 */ 2644 shr_error_e dnx_field_map_qual_list( 2645 int unit, 2646 dnx_field_stage_e stage, 2647 dnx_field_qual_t ** dnx_qual_list_p, 2648 int *dnx_qual_num_p); 2649 2650 /** 2651 * \brief Fetch the FFC range associated with a specific class. 2652 * \param [in] unit - Identifier of HW platform. 2653 * \param [in] stage - Stage identifier 2654 * \param [in] input_type - The input type given in attach info. 2655 * \param [in] offset - The offset given in attach info. Relevant only for Metadata. 2656 * \param [in,out] ranges_p - Pointer to the a bitmap indicating legitimate ranges for iPMF1 FFCs 2657 * (or 0 if stage isn't iPMF1 or iPMF2 with non-naive qualifiers). 2658 * \return 2659 * \retval _SHR_E_NONE - On success 2660 * \retval _SHR_E_PARAM - For class out of range or class without FFC mapping info (if the stage is iPMF1, 2661 * or non native qualifiers for iPMF2). 2662 * \retval Other - Other errors as per shr_error_e 2663 * \remark 2664 */ 2665 shr_error_e dnx_field_map_qual_input_type_to_ranges( 2666 int unit, 2667 dnx_field_stage_e stage, 2668 dnx_field_input_type_e input_type, 2669 int offset, 2670 uint8 *ranges_p); 2671 2672 /** 2673 * \brief Fetch the FFC range associated with a specific key. 2674 * \param [in] unit - Identifier of HW platform. 2675 * \param [in] stage - Stage identifier 2676 * \param [in] key_id - The key to use the FFC in 2677 * \param [in,out] ranges_p - Pointer to the a bitmap indicating legitimate ranges for iPMF1 FFCs 2678 * (or all ones if stage isn't iPMF1). 2679 * \return 2680 * \retval _SHR_E_NONE - On success 2681 * \retval Other - Other errors as per shr_error_e 2682 * \remark 2683 */ 2684 shr_error_e dnx_field_map_qual_key_to_ranges( 2685 int unit, 2686 dnx_field_stage_e stage, 2687 dbal_enum_value_field_field_key_e key_id, 2688 uint8 *ranges_p); 2689 2690 /** 2691 * \brief Convert a negative layer index to a positive one (given that layer indices are translated as modulo, 2692 * that would have the same effect). 2693 * \param [in] unit - Identifier of HW platform. 2694 * \param [in] stage - Stage identifier. If iPMF2, assumes that the data is taken from iPMF1. 2695 * \param [in] layer_index_in - absolute number of layer record, which offset is requested 2696 * \param [in,out] layer_index_out - pointer to be filled with positive layer index. 2697 * \return 2698 * \retval _SHR_E_NONE - On success 2699 * \retval _SHR_E_PARAM - For layer index out of range or stage without layer record support 2700 * \retval Other - Other errors as per shr_error_e 2701 * \remark 2702 * At the moment this function doesn't perform modulo, just negative to positive conversion. 2703 * This function is used for relative layer indices (input type FWD). 2704 */ 2705 shr_error_e dnx_field_map_layer_index_modulo( 2706 int unit, 2707 dnx_field_stage_e stage, 2708 int layer_index_in, 2709 int *layer_index_out); 2710 2711 /** 2712 * \brief Fetch the pbus absolute offset of chosen layer record 2713 * \param [in] unit - Identifier of HW platform. 2714 * \param [in] stage - Stage identifier. If iPMF2, assumes that the data is taken from iPMF1. 2715 * \param [in] layer_index - absolute number of layer record, which offset is requested 2716 * \param [in,out] offset_p - pointer to the offset from pbus start 2717 * \return 2718 * \retval _SHR_E_NONE - On success 2719 * \retval _SHR_E_PARAM - For layer index out of range or stage without layer record support 2720 * \retval Other - Other errors as per shr_error_e 2721 * \remark 2722 */ 2723 shr_error_e dnx_field_map_layer_record_offset( 2724 int unit, 2725 dnx_field_stage_e stage, 2726 int layer_index, 2727 int *offset_p); 2728 2729 /** 2730 * \brief 2731 * This function decrement the number fo group reference to that specific action 2732 * of groups referenced by 2733 * \param [in] unit - Device Id 2734 * \param [in] action - Dnx Action 2735 * \return 2736 * shr_error_e - Error Type 2737 * \remark 2738 * * None 2739 * \see 2740 * * None 2741 */ 2742 shr_error_e dnx_field_action_ref_dec( 2743 int unit, 2744 dnx_field_action_t action); 2745 2746 /** 2747 * \brief 2748 * This function increment the number fo group reference to that specific action 2749 * increments the number of groups referenced by 2750 * \param [in] unit - Device Id 2751 * \param [in] action - Dnx Action 2752 * \return 2753 * shr_error_e - Error Type 2754 * \remark 2755 * * None 2756 * \see 2757 * * None 2758 */ 2759 shr_error_e dnx_field_action_ref_inc( 2760 int unit, 2761 dnx_field_action_t action); 2762 2763 /** 2764 * \brief 2765 * Clear the dnx_field_action_in_info_t, set it to preferred init values 2766 * \param [in] unit - Device ID 2767 * \param [in] action_info_in_p - Pointer to input structure of action_info_in_p that needs to be init 2768 * \return 2769 * shr_error_e - Error Type 2770 * \remark 2771 * * None 2772 * \see 2773 * * None 2774 */ 2775 shr_error_e dnx_field_action_in_info_t_init( 2776 int unit, 2777 dnx_field_action_in_info_t * action_info_in_p); 2778 2779 /** 2780 * \brief 2781 * Creates user action based on existing action, i.e. set new size. 2782 * \param [in] unit - Device ID 2783 * \param [in] flags - as per dnx_field_action_flags_e 2784 * \param [in] action_in_info_p - holds all relevant info for the action set-up(creation), size, stage, action and name. 2785 * \param [in,out] bcm_action_p - for with_id, bcm_action is input inside this ptr, otherwise, output created by routine 2786 * must be always provided, NULL will result in ERROR 2787 * \param [in,out] dnx_action_p - created action ID, encoded class is USER 2788 * \return 2789 * shr_error_e - Error Type 2790 * \remark 2791 * * None 2792 * \see 2793 * * None 2794 */ 2795 shr_error_e dnx_field_action_create( 2796 int unit, 2797 dnx_field_action_flags_e flags, 2798 dnx_field_action_in_info_t * action_in_info_p, 2799 bcm_field_action_t * bcm_action_p, 2800 dnx_field_action_t * dnx_action_p); 2801 2802 /** 2803 * \brief 2804 * Destroys an existing user action based . 2805 * \param [in] unit - Device ID 2806 * \param [out] bcm_action - BCM action to be destroyed 2807 * \return 2808 * shr_error_e - Error Type 2809 * \remark 2810 * * None 2811 * \see 2812 * * None 2813 */ 2814 shr_error_e dnx_field_action_destroy( 2815 int unit, 2816 bcm_field_action_t bcm_action); 2817 2818 shr_error_e dnx_field_action_description_get( 2819 int unit, 2820 bcm_field_action_t bcm_action, 2821 char **action_description); 2822 /** 2823 * \brief Translate bcm action into the set of DNX action 2824 * \param [in] unit - Identifier of HW platform. 2825 * \param [in] stage - Stage identifier 2826 * \param [in] print_errors - Bool to decide whether to display the errors 2827 * \param [in] bcm_action - BCM action id 2828 * \param [in,out] dnx_action_p - pointer to dnx action 2829 * \param [out] action_map_entry_p - action map entry should be returned if the pointer is not NULL 2830 * \return * \retval _SHR_E_NONE - On success 2831 * \retval _SHR_E_NOT_FOUND - When there is no support for such bcm action 2832 * \retval _SHR_E_PARAM - One of input params is out of range 2833 * \retval Other - Other errors as per shr_error_e 2834 * \remark 2835 */ 2836 shr_error_e dnx_field_map_action_bcm_to_dnx_int( 2837 int unit, 2838 dnx_field_stage_e stage, 2839 uint32 print_errors, 2840 bcm_field_action_t bcm_action, 2841 dnx_field_action_t * dnx_action_p, 2842 const dnx_field_action_map_t ** action_map_entry_p); 2843 2844 /** 2845 * \brief Translate bcm action into the set of DNX action 2846 * \param [in] unit - Identifier of HW platform. 2847 * \param [in] stage - Stage identifier 2848 * \param [in] bcm_action - BCM action id 2849 * \param [in,out] dnx_action_p - pointer to dnx action 2850 * \return * \retval _SHR_E_NONE - On success 2851 * \retval _SHR_E_NOT_FOUND - When there is no support for such bcm action 2852 * \retval _SHR_E_PARAM - One of input params is out of range 2853 * \retval Other - Other errors as per shr_error_e 2854 * \remark 2855 */ 2856 shr_error_e dnx_field_map_action_bcm_to_dnx( 2857 int unit, 2858 dnx_field_stage_e stage, 2859 bcm_field_action_t bcm_action, 2860 dnx_field_action_t * dnx_action_p); 2861 2862 /** 2863 * \brief Translate bcm action into the set of DNX qualifiers 2864 * \param [in] unit - Identifier of HW platform. 2865 * \param [in] core - Identifier of core. 2866 * \param [in] stage - Stage identifier 2867 * \param [in] bcm_action_info - pointer to BCM qualifier info 2868 * \param [out] dnx_action_info - pointer to DNX action info 2869 * \return 2870 * \retval _SHR_E_NONE - On success 2871 * \retval _SHR_E_NOT_FOUND - When there is no support for such bcm action 2872 * \retval _SHR_E_PARAM - One of input params is out of range 2873 * \retval Other - Other errors as per shr_error_e 2874 * \remark 2875 */ 2876 shr_error_e dnx_field_map_action_info_bcm_to_dnx( 2877 int unit, 2878 bcm_core_t core, 2879 dnx_field_stage_e stage, 2880 bcm_field_entry_action_t * bcm_action_info, 2881 dnx_field_entry_action_t * dnx_action_info); 2882 2883 /** 2884 * \brief Translate dnx action into BCM one 2885 * \param [in] unit - Identifier of HW platform. 2886 * \param [in] stage - Stage identifier 2887 * \param [in] dnx_action - dnx action 2888 * \param [in] bcm_action_p - pointer where BCM action id should be placed 2889 * \return 2890 * \retval _SHR_E_NONE - On success 2891 * \retval _SHR_E_NOT_FOUND - When there is no support for such dnx action 2892 * \retval _SHR_E_PARAM - One of input params is out of range 2893 * \retval Other - Other errors as per shr_error_e 2894 * \remark 2895 */ 2896 shr_error_e dnx_field_map_action_dnx_to_bcm( 2897 int unit, 2898 dnx_field_stage_e stage, 2899 dnx_field_action_t dnx_action, 2900 bcm_field_action_t * bcm_action_p); 2901 2902 /** 2903 * \brief Create list of all available dnx actions per stage 2904 * \param [in] unit - Identifier of HW platform. 2905 * \param [in] stage - Stage identifier 2906 * \param [in,out] dnx_action_list_p - pointer to the array of dnx actions 2907 * \param [in,out] dnx_action_nof_p - pointer to the number of dnx actions 2908 * \return 2909 * \retval _SHR_E_NONE - On success 2910 * \retval _SHR_E_PARAM - One of input params is out of range 2911 * \retval Other - Other errors as per shr_error_e 2912 * \remark 2913 */ 2914 shr_error_e dnx_field_map_action_list( 2915 int unit, 2916 dnx_field_stage_e stage, 2917 dnx_field_action_t ** dnx_action_list_p, 2918 int *dnx_action_nof_p); 2919 2920 /** 2921 * \brief 2922 * Gets all relevant action info that the end user might need and fills it in action_info_in_p. 2923 * \param [in] unit - Device ID 2924 * \param [in] bcm_action - BCM Action ID 2925 * \param [out] action_info_p - holds all relevant info for the action, size, stage, action and name. 2926 * \return 2927 * shr_error_e - Error Type 2928 * \remark 2929 * * None 2930 * \see 2931 * * None 2932 */ 2933 shr_error_e dnx_field_action_get( 2934 int unit, 2935 bcm_field_action_t bcm_action, 2936 dnx_field_action_in_info_t * action_info_p); 2937 2938 /** 2939 * \brief 2940 * Maps the DNX qualifier to DBAL field 2941 * \param [in] unit - Device ID 2942 * \param [in] stage - Stage identifier 2943 * \param [in] dnx_qual - DNX qualifier 2944 * \param [out] dbal_field_p - DBAL field 2945 * \return 2946 * shr_error_e - Error Type 2947 * \remark 2948 * * None 2949 * \see 2950 * * None 2951 */ 2952 shr_error_e dnx_field_map_dnx_to_dbal_qual( 2953 int unit, 2954 dnx_field_stage_e stage, 2955 dnx_field_qual_t dnx_qual, 2956 dbal_fields_e * dbal_field_p); 2957 2958 /** 2959 * \brief 2960 * Maps DNX action to DBAL field 2961 * \param [in] unit - Device ID 2962 * \param [in] stage -Stage identifier 2963 * \param [in] dnx_action - DNX action 2964 * \param [out] dbal_field_p - DBAL field 2965 * \return 2966 * shr_error_e - Error Type 2967 * \remark 2968 * * None 2969 * \see 2970 * * None 2971 */ 2972 shr_error_e dnx_field_map_dnx_to_dbal_action( 2973 int unit, 2974 dnx_field_stage_e stage, 2975 dnx_field_action_t dnx_action, 2976 dbal_fields_e * dbal_field_p); 2977 2978 /** 2979 * \brief 2980 * Maps DNX action to action type 2981 * \param [in] unit - Device ID 2982 * \param [in] stage -Stage identifier 2983 * \param [in] dnx_action - DNX action 2984 * \param [out] action_type_p - action type 2985 * \return 2986 * shr_error_e - Error Type 2987 * \remark 2988 * * None 2989 * \see 2990 * * None 2991 */ 2992 shr_error_e dnx_field_map_dnx_to_action_type( 2993 int unit, 2994 dnx_field_stage_e stage, 2995 dnx_field_action_t dnx_action, 2996 dnx_field_action_type_t * action_type_p); 2997 2998 /** 2999 * \brief 3000 * Retruns if the action is legal for the specific device. 3001 * \param [in] unit - Device ID 3002 * \param [in] stage -Stage identifier 3003 * \param [in] dnx_action - DNX action 3004 * \param [out] action_is_legal_p - if the action type is legal for the device 3005 * \return 3006 * shr_error_e - Error Type 3007 * \remark 3008 * * None 3009 * \see 3010 * * None 3011 */ 3012 shr_error_e dnx_field_map_action_is_legal( 3013 int unit, 3014 dnx_field_stage_e stage, 3015 dnx_field_action_t dnx_action, 3016 int *action_is_legal_p); 3017 3018 /** 3019 * \brief 3020 * Maps DNX action to action type 3021 * \param [in] unit - Device ID 3022 * \param [in] dnx_stage -Stage identifier 3023 * \param [in] action_type - action type, the value to be written to the DBAL ENUM for the action. 3024 * \param [out] dnx_action_p - The static action that uses the action type. 3025 * \return 3026 * shr_error_e - Error Type 3027 * \remark 3028 * * None 3029 * \see 3030 * * None 3031 */ 3032 shr_error_e dnx_field_map_action_type_to_predef_dnx_action( 3033 int unit, 3034 dnx_field_stage_e dnx_stage, 3035 dnx_field_action_type_t action_type, 3036 dnx_field_action_t * dnx_action_p); 3037 3038 /** 3039 * \brief 3040 * Maps the DNX qualifier to its size in bits 3041 * \param [in] unit - Device ID 3042 * \param [in] stage -Stage identifier 3043 * \param [in] dnx_qual - DNX qualifier 3044 * \param [out] qual_size_p - Qualifier size in bits 3045 * \return 3046 * shr_error_e - Error Type 3047 * \remark 3048 * * None 3049 * \see 3050 * * None 3051 */ 3052 shr_error_e dnx_field_map_dnx_qual_size( 3053 int unit, 3054 dnx_field_stage_e stage, 3055 dnx_field_qual_t dnx_qual, 3056 uint32 *qual_size_p); 3057 3058 /** 3059 * \brief 3060 * Maps DNX action to its size 3061 * \param [in] unit - Device ID 3062 * \param [in] stage -Stage identifier 3063 * \param [in] dnx_action - DNX action 3064 * \param [out] action_size_p - action size in bits 3065 * \return 3066 * shr_error_e - Error Type 3067 * \remark 3068 * * None 3069 * \see 3070 * * None 3071 */ 3072 shr_error_e dnx_field_map_dnx_action_size( 3073 int unit, 3074 dnx_field_stage_e stage, 3075 dnx_field_action_t dnx_action, 3076 unsigned int *action_size_p); 3077 3078 /** 3079 * \brief 3080 * Maps DNX action to its size 3081 * \param [in] unit - Device ID 3082 * \param [in] stage - Stage identifier 3083 * \param [in] dnx_action - DNX action 3084 * \param [out] action_signals - Output array, which will store 3085 * all signals, which are relevant for the given action. 3086 * \return 3087 * shr_error_e - Error Type 3088 * \remark 3089 * * None 3090 * \see 3091 * * None 3092 */ 3093 shr_error_e dnx_field_map_dnx_action_signals( 3094 int unit, 3095 dnx_field_stage_e stage, 3096 dnx_field_action_t dnx_action, 3097 char *action_signals[DNX_DATA_MAX_FIELD_DIAG_NOF_SIGNALS_PER_ACTION]); 3098 3099 /** 3100 * \brief 3101 * Finds the prefix and prefix size of a user defined action. 3102 * \param [in] unit - Device ID 3103 * \param [in] stage - Stage identifier. 3104 * \param [in] dnx_action - The user defined action. 3105 * \param [out] prefix_p - The prefix of the user defined action. 3106 * \param [out] prefix_size_p - The size in bits of the prefix of the user defined action. 3107 * \return 3108 * shr_error_e - Error Type 3109 * \remark 3110 * * None 3111 * \see 3112 * * None 3113 */ 3114 shr_error_e dnx_field_map_dnx_action_prefix( 3115 int unit, 3116 dnx_field_stage_e stage, 3117 dnx_field_action_t dnx_action, 3118 uint32 *prefix_p, 3119 unsigned int *prefix_size_p); 3120 3121 /** 3122 * \brief 3123 * Finds the base action of a user defined action, both as DNX actions. 3124 * \param [in] unit - Device ID 3125 * \param [in] stage - Stage identifier 3126 * \param [in] dnx_action - The user defined action. 3127 * \param [out] base_dnx_action_p - The base action of the user defined action. 3128 * shr_error_e - Error Type 3129 * \remark 3130 * * None 3131 * \see 3132 * * None 3133 */ 3134 shr_error_e dnx_field_map_dnx_action_base_action( 3135 int unit, 3136 dnx_field_stage_e stage, 3137 dnx_field_action_t dnx_action, 3138 dnx_field_action_t * base_dnx_action_p); 3139 3140 /** 3141 * \brief 3142 * Finds the base action of a user defined action, both as BCM actions. 3143 * If action is not a user defined action, returns an invalid action. 3144 * \param [in] unit - Device ID 3145 * \param [in] bcm_action - The action. 3146 * \param [out] base_bcm_action_p - The base action of the user defined action or bcmFieldActionCount othereise. 3147 * \return 3148 * shr_error_e - Error Type 3149 * \remark 3150 * * None 3151 * \see 3152 * * None 3153 */ 3154 shr_error_e dnx_field_map_bcm_action_base_action( 3155 int unit, 3156 bcm_field_action_t bcm_action, 3157 bcm_field_action_t * base_bcm_action_p); 3158 3159 /** 3160 * \brief 3161 * Check if the action is the predefined void action or a user defined action based on the predefined void action. 3162 * Void actions are used to write data to payload without automatically performing a FES action on that data. 3163 * \param [in] unit - Device ID 3164 * \param [in] stage - Stage identifier 3165 * \param [in] dnx_action - DNX action 3166 * \param [out] action_is_void_p - Whether the action is a void action. 3167 * \return 3168 * shr_error_e - Error Type 3169 * \remark 3170 * * None 3171 * \see 3172 * * None 3173 */ 3174 shr_error_e dnx_field_map_dnx_action_is_void( 3175 int unit, 3176 dnx_field_stage_e stage, 3177 dnx_field_action_t dnx_action, 3178 int *action_is_void_p); 3179 3180 /** 3181 * \brief 3182 * Get the FFC instructions table name for the required stage 3183 * \param [in] unit - Device ID 3184 * \param [in] stage - Stage identifier 3185 * \param [in] ffc_type - FFC type 3186 * \param [out] ffc_type_field_p - output DBAL field of FFC type 3187 * \return 3188 * shr_error_e - Error Type 3189 * \remark 3190 * * None 3191 * \see 3192 * * None 3193 */ 3194 shr_error_e dnx_field_map_ffc_type_to_field( 3195 int unit, 3196 dnx_field_stage_e stage, 3197 dnx_field_ffc_type_e ffc_type, 3198 dbal_fields_e * ffc_type_field_p); 3199 3200 /** 3201 * \brief 3202 * Get the FFC instructions table name for the required stage 3203 * \param [in] unit - Device ID 3204 * \param [in] stage - Stage identifier 3205 * \param [out] ffc_table_name_p - output ffc instruction table name for current stage 3206 * \return 3207 * shr_error_e - Error Type 3208 * \remark 3209 * * None 3210 * \see 3211 * * None 3212 */ 3213 shr_error_e dnx_field_map_stage_to_ffc_table( 3214 int unit, 3215 dnx_field_stage_e stage, 3216 dbal_tables_e * ffc_table_name_p); 3217 3218 /** 3219 * \brief 3220 * Get the FFC instructions name for the required stage 3221 * \param [in] unit - Device ID 3222 * \param [in] stage - Stage identifier 3223 * \param [out] ffc_instruction_name_p - output ffc instruction name for current stage 3224 * \return 3225 * shr_error_e - Error Type 3226 * \remark 3227 * * None 3228 * \see 3229 * * None 3230 */ 3231 shr_error_e dnx_field_map_stage_to_ffc_instruction( 3232 int unit, 3233 dnx_field_stage_e stage, 3234 dbal_fields_e * ffc_instruction_name_p); 3235 shr_error_e 3236 /** 3237 * \brief 3238 * Get the ctx_id dbal field name for the required stage 3239 * \param [in] unit - Device ID 3240 * \param [in] stage - Stage identifier 3241 * \param [out] dbal_ctx_id - output ctx_id dbal name for current stage 3242 * \return 3243 * shr_error_e - Error Type 3244 * \remark 3245 * * None 3246 * \see 3247 * * None 3248 */ 3249 dnx_field_map_ctx_id_to_field( 3250 int unit, 3251 dnx_field_stage_e stage, 3252 dbal_fields_e * dbal_ctx_id); 3253 3254 /** 3255 * \brief 3256 * Get the key_field dbal field name for the required stage 3257 * \param [in] unit - Device ID 3258 * \param [in] stage - Stage identifier 3259 * \param [out] dbal_key - output key_field dbal name for current stage 3260 * \return 3261 * shr_error_e - Error Type 3262 * \remark 3263 * * None 3264 * \see 3265 * * None 3266 */ 3267 shr_error_e dnx_field_map_key_to_field( 3268 int unit, 3269 dnx_field_stage_e stage, 3270 dbal_fields_e * dbal_key); 3271 3272 /** 3273 * \brief 3274 * Returns the lookup_enabler DBAL table according to the given stage. 3275 * \param [in] unit - Device ID 3276 * \param [in] stage - The stage of the table we want to get 3277 * \param [out] table_id - Table ID for lookup enable DBAL table per given stage 3278 * \return 3279 * shr_error_e - Error Type 3280 * \remark 3281 * * None 3282 * \see 3283 * * dnx_field_key_lookup_change_state 3284 */ 3285 shr_error_e dnx_field_map_lookup_dbal_table_get( 3286 int unit, 3287 dnx_field_stage_e stage, 3288 dbal_tables_e * table_id); 3289 3290 /** 3291 * \brief 3292 * Returns the invalid action id per given stage. 3293 * \param [in] unit - Device ID 3294 * \param [in] stage - The stage of the table we want to get 3295 * \param [out] dnx_action_p - pointer to max dnx_action 3296 * \return 3297 * shr_error_e - Error Type 3298 * \remark 3299 * * None 3300 * \see 3301 * * None 3302 */ 3303 shr_error_e dnx_field_map_get_max_dnx_action( 3304 int unit, 3305 dnx_field_stage_e stage, 3306 dnx_field_action_t * dnx_action_p); 3307 3308 /** 3309 * \brief 3310 * Returns the invalid action id per given stage. 3311 * \param [in] unit - Device ID 3312 * \param [in] stage - The stage of the table we want to get 3313 * \param [out] dnx_action_p - pointer to illegal dnx_action 3314 * \return 3315 * shr_error_e - Error Type 3316 * \remark 3317 * * None 3318 * \see 3319 * * None 3320 */ 3321 shr_error_e dnx_field_map_get_invalid_dnx_action( 3322 int unit, 3323 dnx_field_stage_e stage, 3324 dnx_field_action_t * dnx_action_p); 3325 3326 /** 3327 * \brief 3328 * Returns the invalid action type per given stage. 3329 * \param [in] unit - Device ID 3330 * \param [in] dnx_stage - The stage of the table we want to get 3331 * \param [out] action_type_p - pointer to action type invalid 3332 * \return 3333 * shr_error_e - Error Type 3334 * \remark 3335 * * None 3336 * \see 3337 * * None 3338 */ 3339 shr_error_e dnx_field_map_get_invalid_action_type( 3340 int unit, 3341 dnx_field_stage_e dnx_stage, 3342 dnx_field_action_type_t * action_type_p); 3343 3344 /** 3345 * \brief 3346 * Returns the invalidate next action type per given stage. 3347 * \param [in] unit - Device ID 3348 * \param [in] dnx_stage - The stage of the table we want to get 3349 * \param [out] action_type_p - pointer to action type invalidate next 3350 * \return 3351 * shr_error_e - Error Type 3352 * \remark 3353 * * None 3354 * \see 3355 * * None 3356 */ 3357 shr_error_e dnx_field_map_get_invalidate_next_action_type( 3358 int unit, 3359 dnx_field_stage_e dnx_stage, 3360 dnx_field_action_type_t * action_type_p); 3361 3362 /** 3363 * \brief 3364 * Retrieve the metadata DNX qualifier that is mapped to a certain field ID for a field stage. 3365 * \param [in] unit - Device ID 3366 * \param [in] stage - The stage of the table we want to get 3367 * \param [in] field_id - The field ID used by the DNX action. 3368 * \param [out] dnx_qual_p - pointer to the metadata DNX qualifier 3369 * \return 3370 * shr_error_e - Error Type 3371 * \remark 3372 * * Note that the procedure only searches for metadata qualifiers. other qualifier classes do not change per stage. 3373 * \see 3374 * * None 3375 */ 3376 shr_error_e dnx_field_map_field_id_dnx_qual( 3377 int unit, 3378 dnx_field_stage_e stage, 3379 dbal_fields_e field_id, 3380 dnx_field_qual_t * dnx_qual_p); 3381 3382 /** 3383 * \brief 3384 * Get a BCM qualifier based on its name. 3385 * \param [in] unit - Device ID 3386 * \param [in] name - The qualifier's name. Number of elements DBAL_MAX_STRING_LENGTH. 3387 * \param [out] bcm_qual_p - pointer to BCM qualifier. Return bcmFieldQualifyCount if none found. 3388 * \return 3389 * shr_error_e - Error Type 3390 * \remark 3391 * * None 3392 * \see 3393 * * None 3394 */ 3395 shr_error_e dnx_field_map_name_to_qual( 3396 int unit, 3397 char name[DBAL_MAX_STRING_LENGTH], 3398 bcm_field_qualify_t * bcm_qual_p); 3399 3400 /** 3401 * \brief 3402 * Get a BCM action based on its name. 3403 * \param [in] unit - Device ID 3404 * \param [in] name - The action's name. Number of elements DBAL_MAX_STRING_LENGTH. 3405 * \param [in] nof_actions - The number of actions returned for the name in bcm_action. 3406 * \param [out] bcm_action - Array with DNX_FIELD_ACTION_MAX_ACTION_PER_VM elements. 3407 * List of DNX actions used for the name. 3408 * \return 3409 * shr_error_e - Error Type 3410 * \remark 3411 * * None 3412 * \see 3413 * * None 3414 */ 3415 shr_error_e dnx_field_map_name_to_action( 3416 int unit, 3417 char name[DBAL_MAX_STRING_LENGTH], 3418 int *nof_actions, 3419 bcm_field_action_t bcm_action[DNX_FIELD_ACTION_MAX_ACTION_PER_VM]); 3420 3421 /** 3422 * \brief 3423 * Retrieve the DNX action that is mapped to a certain field ID for a field stage. 3424 * \param [in] unit - Device ID 3425 * \param [in] stage - The stage of the table we want to get 3426 * \param [in] field_id - The field ID used by the DNX action. 3427 * \param [out] dnx_action_p - pointer to the DNX action 3428 * \return 3429 * shr_error_e - Error Type 3430 * \remark 3431 * * None 3432 * \see 3433 * * None 3434 */ 3435 shr_error_e dnx_field_map_field_id_dnx_action( 3436 int unit, 3437 dnx_field_stage_e stage, 3438 dbal_fields_e field_id, 3439 dnx_field_action_t * dnx_action_p); 3440 3441 /** 3442 * \brief 3443 * Maps the DNX qualifier to its offset. 3444 * \param [in] unit - Device ID 3445 * \param [in] stage -Stage identifier 3446 * \param [in] dnx_qual - Qualifier type to check (can be predefined or user-defined/Dataqual) 3447 * \param [out] offset_p - True if the qual is based on ConstZero 3448 * \return 3449 * shr_error_e - Error Type 3450 * \remark 3451 * * User defined qulifiers don't have any offset. As we don't have a definition of an illegal offset, we return 0. 3452 * \see 3453 * * None 3454 */ 3455 shr_error_e dnx_field_map_dnx_qual_offset( 3456 int unit, 3457 dnx_field_stage_e stage, 3458 dnx_field_qual_t dnx_qual, 3459 int *offset_p); 3460 3461 /** 3462 * \brief 3463 * Maps the DNX qualifier to its offset. 3464 * \param [in] unit - Device ID 3465 * \param [in] stage - Stage identifier 3466 * \param [in] dnx_qual - Qualifier type to check (can be predefined or user-defined/Dataqual) 3467 * \param [out] signals_p - Output array, which will store 3468 * all signals and 'from' 'to' information, which are relevant for the given qualifier. 3469 * \return 3470 * shr_error_e - Error Type 3471 * \remark 3472 * * User defined qulifiers don't have any offset. As we don't have a definition of an illegal offset, we return 0. 3473 * \see 3474 * * None 3475 */ 3476 shr_error_e dnx_field_map_dnx_qual_signals( 3477 int unit, 3478 dnx_field_stage_e stage, 3479 dnx_field_qual_t dnx_qual, 3480 dnx_field_map_qual_signal_info_t * signals_p); 3481 3482 /** 3483 * \brief 3484 * Maps BCM field stage to DNX field Stage 3485 * \param [in] unit - Device Id 3486 * \param [in] bcm_stage - BCM field stage 3487 * \param [out] field_stage_p - The mapped DNX field stage 3488 * \return 3489 * shr_error_e - Error Type 3490 * \remark 3491 * * None 3492 * \see 3493 * * None 3494 */ 3495 shr_error_e dnx_field_map_stage_bcm_to_dnx( 3496 int unit, 3497 bcm_field_stage_t bcm_stage, 3498 dnx_field_stage_e * field_stage_p); 3499 3500 /** 3501 * \brief 3502 * Maps DNX field stage to BCM field stage 3503 * \param [in] unit - Device Id 3504 * \param [in] stage - DNX field Stage 3505 * \param [out] bcm_stage_p - The mapped BCM field stage 3506 * \return 3507 * shr_error_e - Error Type 3508 * \remark 3509 * * None 3510 * \see 3511 * * None 3512 */ 3513 shr_error_e dnx_field_map_stage_dnx_to_bcm( 3514 int unit, 3515 dnx_field_stage_e stage, 3516 bcm_field_stage_t * bcm_stage_p); 3517 3518 /** 3519 * \brief 3520 * Maps BCM field group mode to DNX field group type 3521 * \param [in] unit - Device Id 3522 * \param [in] bcm_fg_type - BCM field group mode 3523 * \param [out] dnx_fg_type_p - The mapped DNX field group type 3524 * \return 3525 * shr_error_e - Error Type 3526 * \remark 3527 * * Used by (for example) bcm_dnx_field_group_add 3528 * \see 3529 * * None 3530 */ 3531 shr_error_e dnx_field_map_group_type_bcm_to_dnx( 3532 int unit, 3533 bcm_field_group_type_t bcm_fg_type, 3534 dnx_field_group_type_e * dnx_fg_type_p); 3535 3536 /** 3537 * \brief 3538 * Maps DNX field group type to BCM field group mode 3539 * \param [in] unit - Device Id 3540 * \param [in] dnx_fg_type - DNX field group type 3541 * \param [out] bcm_fg_type_p - The mapped BCM field group mode 3542 * \return 3543 * shr_error_e - Error Type 3544 * \remark 3545 * * Used by (for example) bcm_dnx_field_group_info_get 3546 * \see 3547 * * None 3548 */ 3549 shr_error_e dnx_field_map_group_type_dnx_to_bcm( 3550 int unit, 3551 dnx_field_group_type_e dnx_fg_type, 3552 bcm_field_group_type_t * bcm_fg_type_p); 3553 3554 /** 3555 * \brief 3556 * Maps BCM tcam bank allocation mode to DNX bcm allocation mode 3557 * \param [in] unit - Device Id 3558 * \param [in] bcm_bank_allocation_mode - BCM bank allocation mode 3559 * \param [out] dnx_bank_allocation_mode - DNX bank allocation mode 3560 * \return 3561 * shr_error_e - Error Type 3562 * \remark 3563 * * None 3564 * \see 3565 * * None 3566 */ 3567 shr_error_e dnx_field_map_bank_allocation_mode_bcm_to_dnx( 3568 int unit, 3569 bcm_field_tcam_bank_allocation_mode_t bcm_bank_allocation_mode, 3570 dnx_field_tcam_bank_allocation_mode_e * dnx_bank_allocation_mode); 3571 3572 /** 3573 * \brief 3574 * Maps DNX tcam bank allocation mode to BCM bcm allocation mode 3575 * \param [in] unit - Device Id 3576 * \param [in] dnx_bank_allocation_mode - DNX bank allocation mode 3577 * \param [out] bcm_bank_allocation_mode_p - BCM bank allocation mode 3578 * \return 3579 * shr_error_e - Error Type 3580 * \remark 3581 * * None 3582 * \see 3583 * * None 3584 */ 3585 shr_error_e dnx_field_map_bank_allocation_mode_dnx_to_bcm( 3586 int unit, 3587 dnx_field_tcam_bank_allocation_mode_e dnx_bank_allocation_mode, 3588 bcm_field_tcam_bank_allocation_mode_t * bcm_bank_allocation_mode_p); 3589 3590 /** 3591 * \brief 3592 * Maps BCM field context compare type to 3593 * DNX field context compare mode 3594 * \param [in] unit - 3595 * Device Id 3596 * \param [in] bcm_context_compare_type - 3597 * BCM field context compare type 3598 * \param [out] dnx_context_compare_mode_p - 3599 * The mapped DNX field context compare mode 3600 * \return 3601 * shr_error_e - Error Type 3602 * \remark 3603 * * Used by (for example) bcm_dnx_field_context_create 3604 * \see 3605 * * None 3606 */ 3607 shr_error_e dnx_field_map_context_compare_type_bcm_to_dnx( 3608 int unit, 3609 bcm_field_context_compare_type_t bcm_context_compare_type, 3610 dnx_field_context_compare_mode_e * dnx_context_compare_mode_p); 3611 3612 /** 3613 * \brief 3614 * Maps DNX field context compare mode to 3615 * BCM field context compare type 3616 * \param [in] unit - 3617 * Device Id 3618 * \param [in] dnx_context_compare_mode - 3619 * DNX field context compare mode 3620 * \param [out] bcm_context_compare_type_p - 3621 * The mapped BCM field context compare type 3622 * \return 3623 * shr_error_e - Error Type 3624 * \remark 3625 * * Used by (for example) bcm_dnx_field_context_mode_get 3626 * \see 3627 * * None 3628 */ 3629 shr_error_e dnx_field_map_context_compare_type_dnx_to_bcm( 3630 int unit, 3631 dnx_field_context_compare_mode_e dnx_context_compare_mode, 3632 bcm_field_context_compare_type_t * bcm_context_compare_type_p); 3633 3634 /** 3635 * \brief 3636 * Maps BCM layer type to 3637 * DNX layer type 3638 * \param [in] unit - 3639 * Device Id 3640 * \param [in] bcm_layer_type - 3641 * BCM layer type 3642 * \param [out] dnx_layer_type - 3643 * The mapped DNX layer type 3644 * \return 3645 * shr_error_e - Error Type 3646 * \remark 3647 * * None 3648 * \see 3649 * * None 3650 */ 3651 shr_error_e dnx_field_map_layer_type_bcm_to_dnx( 3652 int unit, 3653 bcm_field_layer_type_t bcm_layer_type, 3654 dbal_enum_value_field_layer_types_e * dnx_layer_type); 3655 3656 /** 3657 * \brief 3658 * Maps BCM tunnel type to 3659 * DNX tunnel type 3660 * \param [in] unit - 3661 * Device Id 3662 * \param [in] flags for conversion 3663 * \param [in] core - Identifier of core. 3664 * \param [in] bcm_data - 3665 * BCM tunnel type 3666 * \param [out] dnx_data - 3667 * The mapped DNX tunnel type 3668 * \return 3669 * shr_error_e - Error Type 3670 * \remark 3671 * * None 3672 * \see 3673 * * None 3674 */ 3675 shr_error_e dnx_field_convert_tunnel_type( 3676 int unit, 3677 uint32 flags, 3678 int core, 3679 uint32 *bcm_data, 3680 uint32 *dnx_data); 3681 /** 3682 * \brief 3683 * Maps DNX layer type to 3684 * BCM layer type 3685 * \param [in] unit - 3686 * Device Id 3687 * \param [in] flags for conversion 3688 * \param [in] core - Identifier of core. 3689 * \param [in] bcm_data - 3690 * BCM layer type 3691 * \param [out] dnx_data - 3692 * The mapped DNX layer type 3693 * \return 3694 * shr_error_e - Error Type 3695 * \remark 3696 * * None 3697 * \see 3698 * * None 3699 */ 3700 shr_error_e dnx_field_convert_forwarding_context( 3701 int unit, 3702 uint32 flags, 3703 int core, 3704 uint32 *bcm_data, 3705 uint32 *dnx_data); 3706 3707 /** 3708 * \brief 3709 * Maps DNX ACE context value to 3710 * BCM ACE context value 3711 * \param [in] unit - 3712 * Device Id 3713 * \param [in] flags for conversion 3714 * \param [in] core - Identifier of core. 3715 * \param [in] bcm_data - 3716 * BCM ACE context value 3717 * \param [out] dnx_data - 3718 * The mapped DNX ACE context value 3719 * \return 3720 * shr_error_e - Error Type 3721 * \remark 3722 * * None 3723 * \see 3724 * * None 3725 */ 3726 shr_error_e dnx_field_convert_ace_context( 3727 int unit, 3728 uint32 flags, 3729 int core, 3730 uint32 *bcm_data, 3731 uint32 *dnx_data); 3732 3733 /** 3734 * \brief 3735 * Maps BCM layer type to 3736 * DNX layer type 3737 * \param [in] unit - 3738 * Device Id 3739 * \param [in] dnx_layer_type - 3740 * DNX layer type 3741 * \param [out] bcm_layer_type_p - 3742 * The mapped BCM layer type 3743 * \return 3744 * shr_error_e - Error Type 3745 * \remark 3746 * * Used by (for example) dnx_field_presel_data_dnx_to_bcm_convert 3747 * \see 3748 * * None 3749 */ 3750 shr_error_e dnx_field_map_layer_type_dnx_to_bcm( 3751 int unit, 3752 dbal_enum_value_field_layer_types_e dnx_layer_type, 3753 bcm_field_layer_type_t * bcm_layer_type_p); 3754 3755 /** 3756 * \brief 3757 * Maps DNX Vlan format to 3758 * BCM vlan format 3759 * \param [in] unit - 3760 * Device Id 3761 * \param [in] dnx_vlan_format - 3762 * DNX vlan format 3763 * \param [out] bcm_vlan_format_p - 3764 * The mapped BCM vlan format 3765 * \return 3766 * shr_error_e - Error Type 3767 * \remark 3768 * * Used by (for example) dnx_field_presel_data_dnx_to_bcm_convert 3769 * \see 3770 * * None 3771 */ 3772 shr_error_e dnx_field_map_vlan_format_dnx_to_bcm( 3773 int unit, 3774 dbal_enum_value_field_incoming_tag_structure_e dnx_vlan_format, 3775 uint32 *bcm_vlan_format_p); 3776 3777 /** 3778 * \brief 3779 * Maps BCM qual input type to 3780 * DNX qual input type 3781 * \param [in] unit - 3782 * Device Id 3783 * \param [in] dnx_input_type - 3784 * DNX qual input type 3785 * \param [out] bcm_input_type_p - 3786 * The mapped BCM qual input type 3787 * \return 3788 * shr_error_e - Error Type 3789 * \see 3790 * * None 3791 */ 3792 shr_error_e dnx_field_map_qual_input_type_dnx_to_bcm( 3793 int unit, 3794 dnx_field_input_type_e dnx_input_type, 3795 bcm_field_input_types_t * bcm_input_type_p); 3796 3797 /** 3798 * \brief 3799 * Maps DNX qual input type to 3800 * BCM qual input type 3801 * \param [in] unit - 3802 * Device Id 3803 * \param [in] bcm_input_type - 3804 * BCM qual input type 3805 * \param [out] dnx_input_type_p - 3806 * The mapped DNX qual input type 3807 * \return 3808 * shr_error_e - Error Type 3809 * \see 3810 * * None 3811 */ 3812 shr_error_e dnx_field_map_qual_input_type_bcm_to_dnx( 3813 int unit, 3814 bcm_field_input_types_t bcm_input_type, 3815 dnx_field_input_type_e * dnx_input_type_p); 3816 /** 3817 * \brief 3818 * Maps BCM compare id input type to 3819 * DNX compare ID type 3820 * \param [in] unit - 3821 * Device Id 3822 * \param [in] compare_id - 3823 * BCM compare ID 3824 * \param [out] dnx_compare_id_p - 3825 * The mapped DNX compare Id 3826 * \return 3827 * shr_error_e - Error Type 3828 * \remark 3829 * * Used by (for example) bcm_dnx_field_group_context_attach 3830 * \see 3831 * * None 3832 */ 3833 shr_error_e dnx_field_map_compare_id_bcm_to_dnx( 3834 int unit, 3835 int compare_id, 3836 dnx_field_group_compare_id_e * dnx_compare_id_p); 3837 3838 /** 3839 * \brief 3840 * Maps BCM context param set to dbal parameters 3841 * \param [in] unit - Device Id 3842 * \param [in] bcm_stage - bcm stage id 3843 * \param [in] context_id - context id 3844 \param [in] bcm_context_param_set_p - pointer to structure containing all details for context parameter setting 3845 \param [out] field_dbal_entry_p - pointer to the structure that should be filled by the routine 3846 * \return 3847 * shr_error_e - Error Type 3848 * \remark 3849 * * Used by (for example) bcm_dnx_field_context_param_set 3850 * \see 3851 * * None 3852 */ 3853 shr_error_e dnx_field_map_context_param_bcm_to_dnx( 3854 int unit, 3855 bcm_field_stage_t bcm_stage, 3856 dnx_field_context_t context_id, 3857 bcm_field_context_param_info_t * bcm_context_param_set_p, 3858 dnx_field_dbal_entry_t * field_dbal_entry_p); 3859 3860 /** 3861 * \brief 3862 * Maps BCM FEM extraction output source type to 3863 * DNX FEM bit format. 3864 * \param [in] unit - 3865 * Device Id 3866 * \param [in] bcm_fem_ext_output_src_type - 3867 * BCM FEM extraction output source type. 3868 * \param [out] dnx_fem_bit_format_p - 3869 * The mapped DNX FEM bit format. 3870 * \return 3871 * shr_error_e - Error Type 3872 * \remark 3873 * * Used by (for example) bcm_dnx_field_fem_action_add() 3874 * \see 3875 * * None 3876 */ 3877 shr_error_e dnx_field_map_fem_ext_output_src_type_bcm_to_dnx( 3878 int unit, 3879 bcm_field_fem_extraction_output_source_type_t bcm_fem_ext_output_src_type, 3880 dnx_field_fem_bit_format_e * dnx_fem_bit_format_p); 3881 3882 /** 3883 * \brief 3884 * Maps DNX FEM bit format to 3885 * BCM FEM extraction output source type. 3886 * \param [in] unit - 3887 * Device Id 3888 * \param [in] dnx_fem_bit_format - 3889 * DNX FEM bit format. 3890 * \param [out] bcm_fem_ext_output_src_type_p - 3891 * The mapped BCM FEM extraction output source type. 3892 * \return 3893 * shr_error_e - Error Type 3894 * \remark 3895 * * Used by (for example) bcm_dnx_field_fem_action_info_get() 3896 * \see 3897 * * None 3898 */ 3899 shr_error_e dnx_field_map_fem_ext_output_src_type_dnx_to_bcm( 3900 int unit, 3901 dnx_field_fem_bit_format_e dnx_fem_bit_format, 3902 bcm_field_fem_extraction_output_source_type_t * bcm_fem_ext_output_src_type_p); 3903 3904 /** 3905 * \brief 3906 * Maps BCM Hash Function to DBAL hash function ENUMS 3907 * \param [in] unit - Device Id. 3908 * \param [in] bcm_hash_func - BCM Hash Function Enum. 3909 * \param [out] dbal_hash_func_p - DBAL Hash Function Enum. 3910 * \return 3911 * shr_error_e - Error Type 3912 * \remark 3913 * * None 3914 * \see 3915 * * None 3916 */ 3917 shr_error_e dnx_field_map_hash_func_bcm_to_dbal( 3918 int unit, 3919 bcm_field_context_hash_function_t bcm_hash_func, 3920 dbal_enum_value_field_context_hash_function_e * dbal_hash_func_p); 3921 3922 /** 3923 * \brief 3924 * Maps DBAL Hash Function to BCM hash function ENUMS 3925 * \param [in] unit - Device Id. 3926 * \param [in] dbal_hash_func - DBAL Hash Function Enum. 3927 * \param [out] bcm_hash_func_p - BCM Hash Function Enum. 3928 * \return 3929 * shr_error_e - Error Type 3930 * \remark 3931 * * None 3932 * \see 3933 * * None 3934 */ 3935 shr_error_e dnx_field_map_hash_func_dbal_to_bcm( 3936 int unit, 3937 dbal_enum_value_field_context_hash_function_e dbal_hash_func, 3938 bcm_field_context_hash_function_t * bcm_hash_func_p); 3939 3940 /** 3941 * \brief 3942 * Maps BCM Hahsing LB key to DBAL Hashing LB key ENUMS 3943 * \param [in] unit - Device Id. 3944 * \param [in] bcm_hash_lb_key - BCM Hashing LB key Enum. 3945 * \param [out] dbal_hash_lb_key_p - DBAL Hashing LB key Enum. 3946 * \return 3947 * shr_error_e - Error Type 3948 * \remark 3949 * * None 3950 * \see 3951 * * None 3952 */ 3953 shr_error_e dnx_field_map_hash_lb_key_bcm_to_dbal( 3954 int unit, 3955 bcm_field_context_hash_action_key_t bcm_hash_lb_key, 3956 dbal_enum_value_field_field_hash_lb_key_e * dbal_hash_lb_key_p); 3957 3958 /** 3959 * \brief 3960 * Maps DBAL Hahsing LB key to BCM Hashing LB key ENUMS 3961 * \param [in] unit - Device Id. 3962 * \param [in] dbal_hash_lb_key - DBAL Hashing LB key Enum. 3963 * \param [out] bcm_hash_lb_key_p - BCM Hashing LB key Enum. 3964 * \return 3965 * shr_error_e - Error Type 3966 * \remark 3967 * * None 3968 * \see 3969 * * None 3970 */ 3971 shr_error_e dnx_field_map_hash_lb_key_dbal_to_bcm( 3972 int unit, 3973 dbal_enum_value_field_field_hash_lb_key_e dbal_hash_lb_key, 3974 bcm_field_context_hash_action_key_t * bcm_hash_lb_key_p); 3975 3976 /** 3977 * \brief 3978 * Maps BCM Hash Action to DNX Hash Action ENUMS 3979 * \param [in] unit - Device Id. 3980 * \param [in] bcm_hash_action - BCM Hash Action Enum. 3981 * \param [out] dbal_hash_action_p - DBAL Hash Action Enum. 3982 * \return 3983 * shr_error_e - Error Type 3984 * \remark 3985 * * None 3986 * \see 3987 * * None 3988 */ 3989 shr_error_e dnx_field_map_hash_action_bcm_to_dbal( 3990 int unit, 3991 bcm_field_context_hash_action_value_t bcm_hash_action, 3992 dbal_enum_value_field_hash_action_e * dbal_hash_action_p); 3993 3994 /** 3995 * \brief 3996 * Maps DBAL Hash Action to BCM Hash Action ENUMS 3997 * \param [in] unit - Device Id. 3998 * \param [in] dbal_hash_action - DBAL Hash Action Enum. 3999 * \param [out] bcm_hash_action_p - BCM Hash Action Enum. 4000 * \return 4001 * shr_error_e - Error Type 4002 * \remark 4003 * * None 4004 * \see 4005 * * None 4006 */ 4007 shr_error_e dnx_field_map_hash_action_dbal_to_bcm( 4008 int unit, 4009 dbal_enum_value_field_hash_action_e dbal_hash_action, 4010 bcm_field_context_hash_action_value_t * bcm_hash_action_p); 4011 4012 /** 4013 * \brief 4014 * Maps CRC Select Action to DBAL CRC Select ENUMS 4015 * \param [in] unit - Device Id. 4016 * \param [in] bcm_crc_select - BCM CRC Select Enum. 4017 * \param [out] dbal_crc_select_p - DBAL CRC Select Enum. 4018 * \return 4019 * shr_error_e - Error Type 4020 * \remark 4021 * * None 4022 * \see 4023 * * None 4024 */ 4025 shr_error_e dnx_field_map_crc_select_bcm_to_dbal( 4026 int unit, 4027 bcm_field_crc_select_t bcm_crc_select, 4028 dbal_enum_value_field_crc_select_e * dbal_crc_select_p); 4029 4030 /** 4031 * \brief 4032 * Maps DBAL CRC Select to BCM CRC Select ENUMS 4033 * \param [in] unit - Device Id. 4034 * \param [in] dbal_crc_select - DBAL CRC Select Enum. 4035 * \param [out] bcm_crc_select_p - BCM CRC Select Enum. 4036 * \return 4037 * shr_error_e - Error Type 4038 * \remark 4039 * * None 4040 * \see 4041 * * None 4042 */ 4043 shr_error_e dnx_field_map_crc_select_dbal_to_bcm( 4044 int unit, 4045 dbal_enum_value_field_crc_select_e dbal_crc_select, 4046 bcm_field_crc_select_t * bcm_crc_select_p); 4047 4048 /** 4049 * \brief 4050 * Maps BCM range info to DNX range info without printing an error message if not found. 4051 * \param [in] unit - 4052 * Device Id 4053 * \param [in] bcm_range_type - 4054 * BCM range type 4055 * \param [out] dnx_range_type_p - 4056 * The mapped DNX range type 4057 * \return 4058 * shr_error_e - Error Type 4059 * \remark 4060 * * Used by (for example) bcm_dnx_field_range_set 4061 * \see 4062 * * None 4063 */ 4064 shr_error_e dnx_field_map_range_type_bcm_to_dnx_int( 4065 int unit, 4066 bcm_field_range_type_t bcm_range_type, 4067 dnx_field_range_type_e * dnx_range_type_p); 4068 4069 /** 4070 * \brief 4071 * Maps BCM range info to 4072 * DNX range info 4073 * \param [in] unit - 4074 * Device Id 4075 * \param [in] bcm_range_type - 4076 * BCM range type 4077 * \param [out] dnx_range_type_p - 4078 * The mapped DNX range type 4079 * \return 4080 * shr_error_e - Error Type 4081 * \remark 4082 * * Used by (for example) bcm_dnx_field_range_set 4083 * \see 4084 * * None 4085 */ 4086 shr_error_e dnx_field_map_range_type_bcm_to_dnx( 4087 int unit, 4088 bcm_field_range_type_t bcm_range_type, 4089 dnx_field_range_type_e * dnx_range_type_p); 4090 /** 4091 * \brief 4092 * Maps DNX range info to 4093 * BCM range info. 4094 * \param [in] unit - 4095 * Device Id 4096 * \param [in] dnx_range_type - 4097 * DNX range type 4098 * \param [out] bcm_range_type_p - 4099 * The mapped BCM range tpe 4100 * \return 4101 * shr_error_e - Error Type 4102 * \remark 4103 * * Used by (for example) bcm_dnx_field_range_info_get 4104 * \see 4105 * * None 4106 */ 4107 shr_error_e dnx_field_map_range_type_dnx_to_bcm( 4108 int unit, 4109 dnx_field_range_type_e dnx_range_type, 4110 bcm_field_range_type_t * bcm_range_type_p); 4111 4112 /** 4113 * \brief 4114 * Provides mapped information about a range type for legacy range types 4115 * \param [in] unit - Device Id. 4116 * \param [in] field_stage - The Field stage. 4117 * \param [in] dnx_range_type - The range type 4118 * \param [out] range_type_info_p - The information about the range type. 4119 * \return 4120 * shr_error_e - Error Type 4121 * \see 4122 * * None 4123 */ 4124 shr_error_e dnx_field_map_range_type_info_legacy( 4125 int unit, 4126 dnx_field_stage_e field_stage, 4127 dnx_field_range_type_e dnx_range_type, 4128 dnx_field_map_range_type_info_t * range_type_info_p); 4129 4130 /** 4131 * \brief 4132 * Maps Apptype (BCM ID) to OPCODE ID (DNX ID). Does not print an error if no such Apptype found, 4133 * just returns E_NOT_FOUND. 4134 * \param [in] unit - Device Id 4135 * \param [in] app_type - AppType 4136 * \param [out] opcode_id_p - KBP OPCODE ID 4137 * \return 4138 * shr_error_e - Error Type 4139 * \remark 4140 * \see 4141 * * None 4142 */ 4143 shr_error_e dnx_field_map_apptype_to_opcode_bcm_to_dnx_int( 4144 int unit, 4145 bcm_field_AppType_t app_type, 4146 dbal_enum_value_field_kbp_fwd_opcode_e * opcode_id_p); 4147 4148 /** 4149 * \brief 4150 * Maps Apptype (BCM ID) to OPCODE ID (DNX ID) 4151 * \param [in] unit - Device Id 4152 * \param [in] app_type - AppType 4153 * \param [out] opcode_id_p - KBP OPCODE ID 4154 * \return 4155 * shr_error_e - Error Type 4156 * \remark 4157 * \see 4158 * * None 4159 */ 4160 shr_error_e dnx_field_map_apptype_to_opcode_bcm_to_dnx( 4161 int unit, 4162 bcm_field_AppType_t app_type, 4163 dbal_enum_value_field_kbp_fwd_opcode_e * opcode_id_p); 4164 4165 /** 4166 * \brief 4167 * Maps OPCODE ID (DNX ID) to Apptype (BCM ID). 4168 * \param [in] unit - Device Id 4169 * \param [in] opcode_id - KBP OPCODE ID 4170 * \param [out] app_type_p - AppType 4171 * \return 4172 * shr_error_e - Error Type 4173 * \remark 4174 * \see 4175 * * None 4176 */ 4177 shr_error_e dnx_field_map_opcode_to_apptype_dnx_to_bcm( 4178 int unit, 4179 dbal_enum_value_field_kbp_fwd_opcode_e opcode_id, 4180 bcm_field_AppType_t * app_type_p); 4181 4182 /** 4183 * \brief Get the CS profile for a certain opcode. 4184 * \param [in] unit - Device Id 4185 * \param [in] opcode_id - KBP OPCODE ID 4186 * \param [out] cs_profile_id_p - FWD context profile Id 4187 * \return 4188 * shr_error_e - Error Type 4189 * \remark 4190 * \see 4191 * * None 4192 */ 4193 shr_error_e dnx_field_map_opcode_to_profile_get( 4194 int unit, 4195 dbal_enum_value_field_kbp_fwd_opcode_e opcode_id, 4196 uint32 *cs_profile_id_p); 4197 4198 /** 4199 * \brief Get the CS profile for a certain Apptype. 4200 * \param [in] unit - Device Id 4201 * \param [in] app_type - KBP Apptype 4202 * \param [out] cs_profile_id_p - FWD context profile Id 4203 * \return 4204 * shr_error_e - Error Type 4205 * \remark 4206 * \see 4207 * * None 4208 */ 4209 shr_error_e dnx_field_map_apptype_to_profile_get( 4210 int unit, 4211 bcm_field_AppType_t app_type, 4212 uint32 *cs_profile_id_p); 4213 4214 /** 4215 * \brief Get the Apptype that uses a certain CS profile 4216 * \param [in] unit - Device Id 4217 * \param [in] cs_profile_id - FWD context profile Id 4218 * \param [out] app_type_p - KBP Apptype 4219 * \return 4220 * shr_error_e - Error Type 4221 * \remark 4222 * \see 4223 * * None 4224 */ 4225 shr_error_e dnx_field_map_profile_to_apptype_get( 4226 int unit, 4227 uint32 cs_profile_id, 4228 bcm_field_AppType_t * app_type_p); 4229 4230 /** 4231 * \brief Get the FWD and ACL contexts used by and Apptype 4232 * \param [in] unit - Device Id 4233 * \param [in] apptype - The Apptype 4234 * \param [out] nof_contexts_p - The number of FWD context used by the apptype. 4235 * \param [out] fwd_contexts - The FWD contexts used by the apptype. 4236 * An array with DNX_DATA_MAX_FIELD_KBP_MAX_FWD_CONTEXT_NUM_FOR_ONE_APPTYPE elements. 4237 * \param [out] acl_contexts - The ACL context corresponding to each FWD context. 4238 * An array with DNX_DATA_MAX_FIELD_KBP_MAX_FWD_CONTEXT_NUM_FOR_ONE_APPTYPE elements. 4239 * \return 4240 * shr_error_e - Error Type 4241 * \remark 4242 * \see 4243 * * None 4244 */ 4245 shr_error_e dnx_field_map_apptype_to_fwd_contexts( 4246 int unit, 4247 bcm_field_AppType_t apptype, 4248 int *nof_contexts_p, 4249 dnx_field_context_t fwd_contexts[DNX_DATA_MAX_FIELD_KBP_MAX_FWD_CONTEXT_NUM_FOR_ONE_APPTYPE], 4250 dnx_field_context_t acl_contexts[DNX_DATA_MAX_FIELD_KBP_MAX_FWD_CONTEXT_NUM_FOR_ONE_APPTYPE]); 4251 4252 /** 4253 * \brief Get the type of a port profile. 4254 * \param [in] unit - Device Id 4255 * \param [in] bcm_port_class - The BCM class of port profile 4256 * \param [out] port_profile_type_p - The DNX type of port profile class 4257 * \return 4258 * shr_error_e - Error Type 4259 * \remark 4260 * \see 4261 * * None 4262 */ 4263 shr_error_e dnx_field_map_port_profile_type_get( 4264 int unit, 4265 bcm_port_class_t bcm_port_class, 4266 dnx_field_port_porfile_type_e * port_profile_type_p); 4267 4268 /** 4269 * \brief Get the properties of a port profile. Only relevant to port types that relate to a TM/PP port. 4270 * \param [in] unit - Device Id 4271 * \param [in] bcm_port_class - The BCM class of port profile 4272 * \param [out] port_profile_info_p - Information regarding the port profile mapping. 4273 * \return 4274 * shr_error_e - Error Type 4275 * \remark 4276 * \see 4277 * * None 4278 */ 4279 shr_error_e dnx_field_map_port_profile_info_get( 4280 int unit, 4281 bcm_port_class_t bcm_port_class, 4282 dnx_field_map_port_profile_info_t * port_profile_info_p); 4283 4284 /** 4285 * \brief Get the DBAL table ID for the given BCM PP APP DB 4286 * \param [in] unit - Device Id 4287 * \param [in] bcm_pp_app - The BCM PP APP DB 4288 * \param [out] dbal_table_id_p - The DBAL table ID for the given PP APP DB 4289 * \return 4290 * shr_error_e - Error Type 4291 * \remark 4292 * \see 4293 * * None 4294 */ 4295 shr_error_e dnx_field_map_pp_app_dbal_table_get( 4296 int unit, 4297 bcm_field_app_db_t bcm_pp_app, 4298 dbal_tables_e * dbal_table_id_p); 4299 4300 /** 4301 * \brief Get the placement of the state table key (or if is is being accressd by ACR). 4302 * \param [in] unit - Device Id 4303 * \param [out] use_acr_p - If TRUE, state table is accress by the state table actions and not by any key. 4304 * \param [out] stage_p - If use_acr_p is FALSE, the stage from which the state tabke is accessed. 4305 * \param [out] key_id_p - If use_acr_p is FALSE, the key from which the state tabke is accessed. 4306 * \param [out] lsb_on_key_p - If use_acr_p is FALSE, the lsb on the key where the state table key is read from. 4307 * \return 4308 * shr_error_e - Error Type 4309 * \remark 4310 * \see 4311 * * None 4312 */ 4313 shr_error_e dnx_field_map_state_table_source_get( 4314 int unit, 4315 int *use_acr_p, 4316 dnx_field_stage_e * stage_p, 4317 dbal_enum_value_field_field_key_e * key_id_p, 4318 int *lsb_on_key_p); 4319 4320 /** 4321 * \brief 4322 * Get the Key-Id for a given compare pair, 4323 * First pair gets F and G keys, 4324 * Second pair gets H and I keys 4325 * \param [in] unit - Device id 4326 * \param [in] compare_pair - First/Second Pair 4327 * \param [out] key_id_1_p - F or H according to First/Second pair 4328 * \param [out] key_id_2_p - G or I according to First/Second pair 4329 * \return 4330 * shr_error_e - Error Type 4331 * \remark 4332 * * None 4333 * \see 4334 * * None 4335 */ 4336 shr_error_e dnx_field_map_compare_key_id_get( 4337 int unit, 4338 dnx_field_context_compare_mode_pair_e compare_pair, 4339 dnx_field_key_id_t *key_id_1_p, 4340 dnx_field_key_id_t *key_id_2_p); 4341 4342 /** 4343 * \brief 4344 * Get the Key-Id used for Hash capability of a context. 4345 * \param [in] unit - Device id 4346 * \param [out] key_id_p - The key/keys used by Compare. 4347 * \return 4348 * shr_error_e - Error Type 4349 * \remark 4350 * * None 4351 * \see 4352 * * None 4353 */ 4354 shr_error_e dnx_field_map_hash_key_id_get( 4355 int unit, 4356 dnx_field_key_id_t *key_id_p); 4357 4358 /** 4359 * \brief 4360 * Get the Key-Id used for State Table capability of a context. 4361 * \param [in] unit - Device id 4362 * \param [out] key_id_p - The key/keys used by State table 4363 * \return 4364 * shr_error_e - Error Type 4365 * \remark 4366 * * None 4367 * \see 4368 * * None 4369 */ 4370 shr_error_e dnx_field_map_state_table_key_id_get( 4371 int unit, 4372 dnx_field_key_id_t *key_id_p); 4373 4374 /* } */ 4375 #endif