1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2008-2012 Freescale Semiconductor Inc.
3 * Copyright 2017-2020 NXP
14 * @Description FM PCD ...
15 * @Group lnx_ioctl_FM_grp Frame Manager Linux IOCTL API
16 * @Description Frame Manager Linux ioctls definitions and enums
21 * @Group lnx_ioctl_FM_PCD_grp FM PCD
22 * @Description Frame Manager PCD API functions, definitions and enums
24 * The FM PCD module is responsible for the initialization of all
25 * global classifying FM modules. This includes the parser
26 * general and common registers, the key generator global and
27 * common registers, and the policer global and common registers.
28 * In addition, the FM PCD SW module will initialize all required
29 * key generator schemes, coarse classification flows, and
30 * policer profiles. When an FM module is configured to work with
31 * one of these entities, it will register to it using the FM
32 * PORT API. The PCD module will manage the PCD resources - i.e.
33 * resource management of KeyGen schemes, etc.
39 * @Collection General PCD defines
41 #define IOC_FM_PCD_MAX_NUM_OF_PRIVATE_HDRS 2
42 /**< Number of units/headers saved for user */
44 #define IOC_FM_PCD_PRS_NUM_OF_HDRS 16
45 /**< Number of headers supported by HW parser */
46 #define IOC_FM_PCD_MAX_NUM_OF_DISTINCTION_UNITS \
47 (32 - IOC_FM_PCD_MAX_NUM_OF_PRIVATE_HDRS)
48 /**< Number of distinction units is limited by register size (32 bits) minus
49 * reserved bits for private headers.
51 #define IOC_FM_PCD_MAX_NUM_OF_INTERCHANGEABLE_HDRS 4
52 /**< Maximum number of interchangeable headers in a distinction unit */
53 #define IOC_FM_PCD_KG_NUM_OF_GENERIC_REGS 8
54 /**< Total number of generic KeyGen registers */
55 #define IOC_FM_PCD_KG_MAX_EXTRACTS_PER_KEY 35
56 /**< Max number allowed on any configuration; For HW implementation reasons,
57 * in most cases less than this will be allowed; The driver will return an
58 * initialization error if resource is unavailable.
60 #define IOC_FM_PCD_KG_NUM_OF_EXTRACT_MASKS 4
61 /**< Total number of masks allowed on KeyGen extractions. */
62 #define IOC_FM_PCD_KG_NUM_OF_DEFAULT_GROUPS 16
63 /**< Number of default value logical groups */
64 #define IOC_FM_PCD_PRS_NUM_OF_LABELS 32
65 /**< Maximum number of SW parser labels */
66 #define IOC_FM_PCD_SW_PRS_SIZE 0x00000800
67 /**< Total size of SW parser area */
69 #define IOC_FM_PCD_MAX_MANIP_INSRT_TEMPLATE_SIZE 128
70 /**< Maximum size of insertion template for insert manipulation */
72 #define IOC_FM_PCD_FRM_REPLIC_MAX_NUM_OF_ENTRIES 64
73 /**< Maximum possible entries for frame replicator group */
77 * @Group lnx_ioctl_FM_PCD_init_grp FM PCD Initialization Unit
79 * @Description Frame Manager PCD Initialization Unit API
85 * @Description PCD counters
86 * (must match enum ioc_fm_pcd_counters defined in fm_pcd_ext.h)
88 typedef enum ioc_fm_pcd_counters {
89 e_IOC_FM_PCD_KG_COUNTERS_TOTAL, /**< KeyGen counter */
90 e_IOC_FM_PCD_PLCR_COUNTERS_RED,
91 /**< Policer counter - counts the total number of RED packets that exit
94 e_IOC_FM_PCD_PLCR_COUNTERS_YELLOW,
95 /**< Policer counter - counts the total number of YELLOW packets that
98 e_IOC_FM_PCD_PLCR_COUNTERS_RECOLORED_TO_RED,
99 /**< Policer counter - counts the number of packets that changed color
100 * to RED by the Policer; This is a subset of
101 * e_IOC_FM_PCD_PLCR_COUNTERS_RED packet count, indicating active color
104 e_IOC_FM_PCD_PLCR_COUNTERS_RECOLORED_TO_YELLOW,
105 /**< Policer counter - counts the number of packets that changed color
106 * to YELLOW by the Policer; This is a subset of
107 * e_IOC_FM_PCD_PLCR_COUNTERS_YELLOW packet count, indicating active
110 e_IOC_FM_PCD_PLCR_COUNTERS_TOTAL,
111 /**< Policer counter - counts the total number of packets passed in the
114 e_IOC_FM_PCD_PLCR_COUNTERS_LENGTH_MISMATCH,
115 /**< Policer counter - counts the number of packets with length
118 e_IOC_FM_PCD_PRS_COUNTERS_PARSE_DISPATCH,
119 /**< Parser counter - counts the number of times the parser block is
122 e_IOC_FM_PCD_PRS_COUNTERS_L2_PARSE_RESULT_RETURNED,
123 /**< Parser counter - counts the number of times L2 parse result is
124 * returned (including errors).
126 e_IOC_FM_PCD_PRS_COUNTERS_L3_PARSE_RESULT_RETURNED,
127 /**< Parser counter - counts the number of times L3 parse result is
128 * returned (including errors).
130 e_IOC_FM_PCD_PRS_COUNTERS_L4_PARSE_RESULT_RETURNED,
131 /**< Parser counter - counts the number of times L4 parse result is
132 * returned (including errors).
134 e_IOC_FM_PCD_PRS_COUNTERS_SHIM_PARSE_RESULT_RETURNED,
135 /**< Parser counter - counts the number of times SHIM parse result is
136 * returned (including errors).
138 e_IOC_FM_PCD_PRS_COUNTERS_L2_PARSE_RESULT_RETURNED_WITH_ERR,
139 /**< Parser counter - counts the number of times L2 parse result is
140 * returned with errors.
142 e_IOC_FM_PCD_PRS_COUNTERS_L3_PARSE_RESULT_RETURNED_WITH_ERR,
143 /**< Parser counter - counts the number of times L3 parse result is
144 * returned with errors.
146 e_IOC_FM_PCD_PRS_COUNTERS_L4_PARSE_RESULT_RETURNED_WITH_ERR,
147 /**< Parser counter - counts the number of times L4 parse result is
148 * returned with errors.
150 e_IOC_FM_PCD_PRS_COUNTERS_SHIM_PARSE_RESULT_RETURNED_WITH_ERR,
151 /**< Parser counter - counts the number of times SHIM parse result is
152 * returned with errors.
154 e_IOC_FM_PCD_PRS_COUNTERS_SOFT_PRS_CYCLES,
155 /**< Parser counter - counts the number of cycles spent executing soft
156 * parser instruction (including stall cycles).
158 e_IOC_FM_PCD_PRS_COUNTERS_SOFT_PRS_STALL_CYCLES,
159 /**< Parser counter - counts the number of cycles stalled waiting for
160 * parser internal memory reads while executing soft parser instruction.
162 e_IOC_FM_PCD_PRS_COUNTERS_HARD_PRS_CYCLE_INCL_STALL_CYCLES,
163 /**< Parser counter - counts the number of cycles spent executing hard
164 * parser (including stall cycles).
166 e_IOC_FM_PCD_PRS_COUNTERS_MURAM_READ_CYCLES,
167 /**< MURAM counter - counts the number of cycles while performing FMan
170 e_IOC_FM_PCD_PRS_COUNTERS_MURAM_READ_STALL_CYCLES,
171 /**< MURAM counter - counts the number of cycles stalled while
172 * performing FMan Memory read.
174 e_IOC_FM_PCD_PRS_COUNTERS_MURAM_WRITE_CYCLES,
175 /**< MURAM counter - counts the number of cycles while performing FMan
178 e_IOC_FM_PCD_PRS_COUNTERS_MURAM_WRITE_STALL_CYCLES,
179 /**< MURAM counter - counts the number of cycles stalled while
180 * performing FMan Memory write.
182 e_IOC_FM_PCD_PRS_COUNTERS_FPM_COMMAND_STALL_CYCLES
183 /**< FPM counter - counts the number of cycles stalled while performing
186 } ioc_fm_pcd_counters;
189 * @Description PCD interrupts
190 * (must match enum ioc_fm_pcd_exceptions defined in
193 typedef enum ioc_fm_pcd_exceptions {
194 e_IOC_FM_PCD_KG_EXCEPTION_DOUBLE_ECC,
195 /**< KeyGen double-bit ECC error is detected on internal memory read
198 e_IOC_FM_PCD_KG_EXCEPTION_KEYSIZE_OVERFLOW,
199 /**< KeyGen scheme configuration error indicating a key size larger than
202 e_IOC_FM_PCD_PLCR_EXCEPTION_DOUBLE_ECC,
203 /**< Policer double-bit ECC error has been detected on PRAM read access.
205 e_IOC_FM_PCD_PLCR_EXCEPTION_INIT_ENTRY_ERROR,
206 /**< Policer access to a non-initialized profile has been detected. */
207 e_IOC_FM_PCD_PLCR_EXCEPTION_PRAM_SELF_INIT_COMPLETE,
208 /**< Policer RAM self-initialization complete */
209 e_IOC_FM_PCD_PLCR_EXCEPTION_ATOMIC_ACTION_COMPLETE,
210 /**< Policer atomic action complete */
211 e_IOC_FM_PCD_PRS_EXCEPTION_DOUBLE_ECC,
212 /**< Parser double-bit ECC error */
213 e_IOC_FM_PCD_PRS_EXCEPTION_SINGLE_ECC
214 /**< Parser single-bit ECC error */
215 } ioc_fm_pcd_exceptions;
217 /** @} */ /* end of lnx_ioctl_FM_PCD_init_grp group */
220 * @Group lnx_ioctl_FM_PCD_Runtime_grp FM PCD Runtime Unit
222 * @Description Frame Manager PCD Runtime Unit
224 * The runtime control allows creation of PCD infrastructure
225 * modules such as Network Environment Characteristics,
226 * Classification Plan Groups and Coarse Classification Trees.
227 * It also allows on-the-fly initialization, modification and
228 * removal of PCD modules such as KeyGen schemes, coarse
229 * classification nodes and Policer profiles.
231 * In order to explain the programming model of the PCD driver
232 * interface a few terms should be explained, and will be used
234 * - Distinction Header - One of the 16 protocols supported by
235 * the FM parser, or one of the SHIM headers (1 or 2). May be a
236 * header with a special option (see below).
237 * - Interchangeable Headers Group - This is a group of Headers
238 * recognized by either one of them. For example, if in a
239 * specific context the user chooses to treat IPv4 and IPV6 in
240 * the same way, they may create an interchangeable Headers
241 * Unit consisting of these 2 headers.
242 * - A Distinction Unit - a Distinction Header or an
243 * Interchangeable Headers Group.
244 * - Header with special option - applies to Ethernet, MPLS,
245 * VLAN, IPv4 and IPv6, includes multicast, broadcast and other
246 * protocol specific options. In terms of hardware it relates
247 * to the options available in the classification plan.
248 * - Network Environment Characteristics - a set of Distinction
249 * Units that define the total recognizable header selection
250 * for a certain environment. This is NOT the list of all
251 * headers that will ever appear in a flow, but rather
252 * everything that needs distinction in a flow, where
253 * distinction is made by KeyGen schemes and coarse
254 * classification action descriptors.
256 * The PCD runtime modules initialization is done in stages. The
257 * first stage after initializing the PCD module itself is to
258 * establish a Network Flows Environment Definition. The
259 * application may choose to establish one or more such
260 * environments. Later, when needed, the application will have to
261 * state, for some of its modules, to which single environment it
268 * @Description structure for FM counters
270 typedef struct ioc_fm_pcd_counters_params_t {
271 ioc_fm_pcd_counters cnt; /**< The requested counter */
273 /**< The requested value to get/set from/into the
276 } ioc_fm_pcd_counters_params_t;
279 * @Description structure for FM exception definitios
281 typedef struct ioc_fm_pcd_exception_params_t {
282 ioc_fm_pcd_exceptions exception; /**< The requested exception */
284 /**< TRUE to enable interrupt, FALSE to mask it. */
285 } ioc_fm_pcd_exception_params_t;
288 * @Description A structure for SW parser labels (must be identical to struct
289 * t_fm_pcd_prs_label_params defined in fm_pcd_ext.h)
291 typedef struct ioc_fm_pcd_prs_label_params_t {
292 uint32_t instruction_offset;
293 /**< SW parser label instruction offset (2 bytes resolution),
294 * relative to Parser RAM
296 ioc_net_header_type hdr;
297 /**< The existence of this header will invoke the SW parser
300 uint8_t index_per_hdr;
301 /**< Normally 0, if more than one SW parser attachments for the
302 * same header, use this index to distinguish between them.
304 } ioc_fm_pcd_prs_label_params_t;
307 * @Description A structure for SW parser (Must match struct
308 * ioc_fm_pcd_prs_sw_params_t defined in fm_pcd_ext.h)
310 typedef struct ioc_fm_pcd_prs_sw_params_t {
312 /**< FALSE to invoke a check that nothing else was
313 * loaded to this address, including internal patches.
314 * TRUE to override any existing code.
316 uint32_t size; /**< SW parser code size */
318 /**< SW parser base (in instruction counts! must be
321 uint8_t *p_code; /**< SW parser code */
322 uint32_t sw_prs_data_params[IOC_FM_PCD_PRS_NUM_OF_HDRS];
323 /**< SW parser data (parameters) */
324 uint8_t num_of_labels; /**< Number of labels for SW parser. */
325 ioc_fm_pcd_prs_label_params_t
326 labels_table[IOC_FM_PCD_PRS_NUM_OF_LABELS];
327 /**< SW parser labels table, containing num_of_labels
330 } ioc_fm_pcd_prs_sw_params_t;
333 * @Description A structure to set the a KeyGen default value
335 typedef struct ioc_fm_pcd_kg_dflt_value_params_t {
336 uint8_t value_id;/**< 0,1 - one of 2 global default values */
337 uint32_t value; /**< The requested default value */
338 } ioc_fm_pcd_kg_dflt_value_params_t;
341 * @Function fm_pcd_enable
343 * @Description This routine should be called after PCD is initialized for
344 * enabling all PCD engines according to their existing
347 * @Return 0 on success; Error code otherwise.
349 * @Cautions Allowed only when PCD is disabled.
351 #define FM_PCD_IOC_ENABLE _IO(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(1))
354 * @Function fm_pcd_disable
356 * @Description This routine may be called when PCD is enabled in order to
357 * disable all PCD engines. It may be called only when none of
358 * the ports in the system are using the PCD.
360 * @Return 0 on success; Error code otherwise.
362 * @Cautions Allowed only when PCD is enabled.
364 #define FM_PCD_IOC_DISABLE _IO(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(2))
367 * @Function fm_pcd_prs_load_sw
369 * @Description This routine may be called only when all ports in the
370 * system are actively using the classification plan scheme.
371 * In such cases it is recommended in order to save resources.
372 * The driver automatically saves 8 classification plans for
373 * ports that do NOT use the classification plan mechanism, to
374 * avoid this (in order to save those entries) this routine may
377 * @Param[in] ioc_fm_pcd_prs_sw_params_t
378 * A pointer to the image of the software parser code.
380 * @Return 0 on success; Error code otherwise.
382 * @Cautions Allowed only when PCD is disabled.
384 #define FM_PCD_IOC_PRS_LOAD_SW \
385 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(3), ioc_fm_pcd_prs_sw_params_t)
388 * @Function fm_pcd_kg_set_dflt_value
390 * @Description Calling this routine sets a global default value to be used
391 * by the KeyGen when parser does not recognize a required
393 * default value is 0.
395 * @Param[in] ioc_fm_pcd_kg_dflt_value_params_t A pointer to a structure
399 * @Return 0 on success; Error code otherwise.
401 * @Cautions Allowed only when PCD is disabled.
403 #define FM_PCD_IOC_KG_SET_DFLT_VALUE \
404 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(6), \
405 ioc_fm_pcd_kg_dflt_value_params_t)
408 * @Function fm_pcd_kg_set_additional_data_after_parsing
410 * @Description Calling this routine allows the keygen to access data past
411 * the parser finishing point.
413 * @Param[in] uint8_t payload-offset; the number of bytes beyond the
416 * @Return 0 on success; Error code otherwise.
418 * @Cautions Allowed only when PCD is disabled.
420 #define FM_PCD_IOC_KG_SET_ADDITIONAL_DATA_AFTER_PARSING \
421 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(7), uint8_t)
424 * @Function fm_pcd_set_exception
426 * @Description Calling this routine enables/disables PCD interrupts.
428 * @Param[in] ioc_fm_pcd_exception_params_t
429 * Arguments struct with exception to be enabled/disabled.
431 * @Return 0 on success; Error code otherwise.
433 #define FM_PCD_IOC_SET_EXCEPTION \
434 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(8), ioc_fm_pcd_exception_params_t)
437 * @Function fm_pcd_get_counter
439 * @Description Reads one of the FM PCD counters.
441 * @Param[in,out] ioc_fm_pcd_counters_params_t The requested counter parameters.
443 * @Return 0 on success; Error code otherwise.
445 * @Cautions It is user's responsibility to call this routine only
446 * for enabled counters, and there will be no indication if a
447 * disabled counter is accessed.
449 #define FM_PCD_IOC_GET_COUNTER \
450 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(9), ioc_fm_pcd_counters_params_t)
453 * @Function fm_pcd_kg_scheme_get_counter
455 * @Description Reads scheme packet counter.
457 * @Param[in] h_scheme scheme handle as returned by
458 * fm_pcd_kg_scheme_set().
460 * @Return Counter's current value.
462 * @Cautions Allowed only following fm_pcd_init() & fm_pcd_kg_scheme_set().
464 #define FM_PCD_IOC_KG_SCHEME_GET_CNTR \
465 _IOR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(4), ioc_fm_pcd_kg_scheme_spc_t)
468 * @Function FM_PCD_ForceIntr
470 * @Description Causes an interrupt event on the requested source.
472 * @Param[in] ioc_fm_pcd_exceptions - An exception to be forced.
474 * @Return 0 on success; error code if the exception is not enabled,
475 * or is not able to create interrupt.
477 #define FM_PCD_IOC_FORCE_INTR \
478 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(11), ioc_fm_pcd_exceptions)
481 * @Collection Definitions of coarse classification parameters as required by
482 * KeyGen (when coarse classification is the next engine after this
485 #define IOC_FM_PCD_MAX_NUM_OF_CC_TREES 8
486 #define IOC_FM_PCD_MAX_NUM_OF_CC_GROUPS 16
487 #define IOC_FM_PCD_MAX_NUM_OF_CC_UNITS 4
488 #define IOC_FM_PCD_MAX_NUM_OF_KEYS 256
489 #define IOC_FM_PCD_MAX_NUM_OF_FLOWS (4 * KILOBYTE)
490 #define IOC_FM_PCD_MAX_SIZE_OF_KEY 56
491 #define IOC_FM_PCD_MAX_CC_ENTRY_IN_GRP 16
492 #define IOC_FM_PCD_LAST_KEY_INDEX 0xffff
493 #define IOC_FM_PCD_MANIP_DSCP_VALUES 64
497 * @Collection A set of definitions to allow protocol
498 * special option description.
500 typedef uint32_t ioc_protocol_opt_t;
501 /**< A general type to define a protocol option. */
503 typedef ioc_protocol_opt_t ioc_eth_protocol_opt_t;
504 /**< Ethernet protocol options. */
505 #define IOC_ETH_BROADCAST 0x80000000 /**< Ethernet Broadcast. */
506 #define IOC_ETH_MULTICAST 0x40000000 /**< Ethernet Multicast. */
508 typedef ioc_protocol_opt_t ioc_vlan_protocol_opt_t;
509 /**< Vlan protocol options. */
510 #define IOC_VLAN_STACKED 0x20000000 /**< Stacked VLAN. */
512 typedef ioc_protocol_opt_t ioc_mpls_protocol_opt_t;
513 /**< MPLS protocol options. */
514 #define IOC_MPLS_STACKED 0x10000000 /**< Stacked MPLS. */
516 typedef ioc_protocol_opt_t ioc_ipv4_protocol_opt_t;
517 /**< IPv4 protocol options. */
518 #define IOC_IPV4_BROADCAST_1 0x08000000 /**< IPv4 Broadcast. */
519 #define IOC_IPV4_MULTICAST_1 0x04000000 /**< IPv4 Multicast. */
520 #define IOC_IPV4_UNICAST_2 0x02000000
521 /**< Tunneled IPv4 - Unicast.
523 #define IOC_IPV4_MULTICAST_BROADCAST_2 0x01000000
525 * Broadcast/Multicast.
528 #define IOC_IPV4_FRAG_1 0x00000008
529 /**< IPV4 reassembly option. IPV4
530 * Reassembly manipulation requires network
531 * environment with IPV4 header and IPV4_FRAG_1
535 typedef ioc_protocol_opt_t ioc_ipv6_protocol_opt_t;
536 /**< IPv6 protocol options. */
537 #define IOC_IPV6_MULTICAST_1 0x00800000 /**< IPv6 Multicast. */
538 #define IOC_IPV6_UNICAST_2 0x00400000
539 /**< Tunneled IPv6 - Unicast. */
540 #define IOC_IPV6_MULTICAST_2 0x00200000
541 /**< Tunneled IPv6 - Multicast. */
543 #define IOC_IPV6_FRAG_1 0x00000004
544 /**< IPV6 reassembly option. IPV6 Reassembly
545 * manipulation requires network environment
546 * with IPV6 header and IPV6_FRAG_1 option
548 typedef ioc_protocol_opt_t ioc_capwap_protocol_opt_t;
549 /**< CAPWAP protocol options. */
550 #define CAPWAP_FRAG_1 0x00000008
551 /**< CAPWAP reassembly option. CAPWAP Reassembly
552 * manipulation requires network environment
553 * with CAPWAP header and CAPWAP_FRAG_1 option;
554 * in case where fragment found, the
555 * fragment-extension offset may be found at
556 * 'shim2' (in parser-result).
561 #define IOC_FM_PCD_MANIP_MAX_HDR_SIZE 256
562 #define IOC_FM_PCD_MANIP_DSCP_TO_VLAN_TRANS 64
564 * @Collection A set of definitions to support Header Manipulation selection.
566 typedef uint32_t ioc_hdr_manip_flags_t;
567 /**< A general type to define a HMan update command flags. */
569 typedef ioc_hdr_manip_flags_t ioc_ipv4_hdr_manip_update_flags_t;
570 /**< IPv4 protocol HMan update command flags. */
572 #define IOC_HDR_MANIP_IPV4_TOS 0x80000000
573 /**< update TOS with the given value ('tos' field of
574 * ioc_fm_pcd_manip_hdr_field_update_ipv4_t)
576 #define IOC_HDR_MANIP_IPV4_ID 0x40000000
577 /**< update IP ID with the given value ('id' field of
578 * ioc_fm_pcd_manip_hdr_field_update_ipv4_t)
580 #define IOC_HDR_MANIP_IPV4_TTL 0x20000000 /**< Decrement TTL by 1 */
581 #define IOC_HDR_MANIP_IPV4_SRC 0x10000000
582 /**< update IP source address with the given value ('src' field
583 * of ioc_fm_pcd_manip_hdr_field_update_ipv4_t)
585 #define IOC_HDR_MANIP_IPV4_DST 0x08000000
586 /**< update IP destination address with the given value
587 * ('dst' field of ioc_fm_pcd_manip_hdr_field_update_ipv4_t)
590 typedef ioc_hdr_manip_flags_t ioc_ipv6_hdr_manip_update_flags_t;
591 /**< IPv6 protocol HMan update command flags. */
593 #define IOC_HDR_MANIP_IPV6_TC 0x80000000
594 /**< update Traffic Class address with the given value ('traffic_class'
595 * field of ioc_fm_pcd_manip_hdr_field_update_ipv6_t)
597 #define IOC_HDR_MANIP_IPV6_HL 0x40000000 /**< Decrement Hop Limit by 1 */
598 #define IOC_HDR_MANIP_IPV6_SRC 0x20000000
599 /**< update IP source address with the given value ('src' field
600 * of ioc_fm_pcd_manip_hdr_field_update_ipv6_t)
602 #define IOC_HDR_MANIP_IPV6_DST 0x10000000
603 /**< update IP destination address with the given value ('dst'
604 * field of ioc_fm_pcd_manip_hdr_field_update_ipv6_t)
607 typedef ioc_hdr_manip_flags_t ioc_tcp_udp_hdr_manip_update_flags_t;
608 /**< TCP/UDP protocol HMan update command flags. */
610 #define IOC_HDR_MANIP_TCP_UDP_SRC 0x80000000
611 /**< update TCP/UDP source address with the given value
612 * ('src' field of ioc_fm_pcd_manip_hdr_field_update_tcp_udp_t)
614 #define IOC_HDR_MANIP_TCP_UDP_DST 0x40000000
615 /**< update TCP/UDP destination address with the given value
616 * ('dst' field of ioc_fm_pcd_manip_hdr_field_update_tcp_udp_t)
618 #define IOC_HDR_MANIP_TCP_UDP_CHECKSUM 0x20000000
619 /**< update TCP/UDP checksum */
624 * @Description A type used for returning the order of the key extraction.
625 * each value in this array represents the index of the
626 * extraction command as defined by the user in the
627 * initialization extraction array. The valid size of this array
628 * is the user define number of extractions required (also
629 * marked by the second '0' in this array).
632 ioc_fm_pcd_kg_key_order_t [IOC_FM_PCD_KG_MAX_EXTRACTS_PER_KEY];
635 *@Description All PCD engines
636 * (must match enum e_FmPcdEngine defined in fm_pcd_ext.h)
639 typedef enum ioc_fm_pcd_engine {
640 e_IOC_FM_PCD_INVALID = 0, /**< Invalid PCD engine */
641 e_IOC_FM_PCD_DONE, /**< No PCD Engine indicated */
642 e_IOC_FM_PCD_KG, /**< KeyGen */
643 e_IOC_FM_PCD_CC, /**< Coarse Classifier */
644 e_IOC_FM_PCD_PLCR, /**< Policer */
645 e_IOC_FM_PCD_PRS, /**< Parser */
646 e_IOC_FM_PCD_FR, /**< Frame Replicator */
647 e_IOC_FM_PCD_HASH /**< Hash Table */
651 * @Description An enum for selecting extraction by header types
652 * (Must match enum e_FmPcdExtractByHdrType defined in
655 typedef enum ioc_fm_pcd_extract_by_hdr_type {
656 e_IOC_FM_PCD_EXTRACT_FROM_HDR, /**< Extract bytes from header */
657 e_IOC_FM_PCD_EXTRACT_FROM_FIELD,/**< Extract bytes from header field */
658 e_IOC_FM_PCD_EXTRACT_FULL_FIELD /**< Extract a full field */
659 } ioc_fm_pcd_extract_by_hdr_type;
662 * @Description An enum for selecting extraction source (when it is not the
663 * header) (Must match enum e_FmPcdExtractFrom defined in
666 typedef enum ioc_fm_pcd_extract_from {
667 e_IOC_FM_PCD_EXTRACT_FROM_FRAME_START,
668 /**< KG & CC: Extract from beginning of frame */
669 e_IOC_FM_PCD_EXTRACT_FROM_DFLT_VALUE,
670 /**< KG only: Extract from a default value */
671 e_IOC_FM_PCD_EXTRACT_FROM_CURR_END_OF_PARSE,
672 /**< KG only: Extract from the point where parsing had
675 e_IOC_FM_PCD_EXTRACT_FROM_KEY, /**< CC only: Field where saved KEY */
676 e_IOC_FM_PCD_EXTRACT_FROM_HASH, /**< CC only: Field where saved HASH */
677 e_IOC_FM_PCD_EXTRACT_FROM_PARSE_RESULT,
678 /**< KG & CC: Extract from the parser result */
679 e_IOC_FM_PCD_EXTRACT_FROM_ENQ_FQID,
680 /**< KG & CC: Extract from enqueue FQID */
681 e_IOC_FM_PCD_EXTRACT_FROM_FLOW_ID
682 /**< CC only: Field where saved Dequeue FQID */
683 } ioc_fm_pcd_extract_from;
686 * @Description An enum for selecting extraction type
688 typedef enum ioc_fm_pcd_extract_type {
689 e_IOC_FM_PCD_EXTRACT_BY_HDR, /**< Extract according to header */
690 e_IOC_FM_PCD_EXTRACT_NON_HDR,
691 /**< Extract from data that is not the header */
692 e_IOC_FM_PCD_KG_EXTRACT_PORT_PRIVATE_INFO
693 /**< Extract private info as specified by user */
694 } ioc_fm_pcd_extract_type;
697 * @Description An enum for selecting a default
699 typedef enum ioc_fm_pcd_kg_extract_dflt_select {
700 e_IOC_FM_PCD_KG_DFLT_GBL_0,
701 /**< Default selection is KG register 0 */
702 e_IOC_FM_PCD_KG_DFLT_GBL_1,
703 /**< Default selection is KG register 1 */
704 e_IOC_FM_PCD_KG_DFLT_PRIVATE_0,
705 /**< Default selection is a per scheme register 0 */
706 e_IOC_FM_PCD_KG_DFLT_PRIVATE_1,
707 /**< Default selection is a per scheme register 1 */
708 e_IOC_FM_PCD_KG_DFLT_ILLEGAL /**< Illegal selection */
709 } ioc_fm_pcd_kg_extract_dflt_select;
712 * @Description Enumeration type defining all default groups - each group
713 * shares a default value, one of four user-initialized values.
715 typedef enum ioc_fm_pcd_kg_known_fields_dflt_types {
716 e_IOC_FM_PCD_KG_MAC_ADDR, /**< MAC Address */
717 e_IOC_FM_PCD_KG_TCI, /**< TCI field */
718 e_IOC_FM_PCD_KG_ENET_TYPE, /**< ENET Type */
719 e_IOC_FM_PCD_KG_PPP_SESSION_ID, /**< PPP Session id */
720 e_IOC_FM_PCD_KG_PPP_PROTOCOL_ID, /**< PPP Protocol id */
721 e_IOC_FM_PCD_KG_MPLS_LABEL, /**< MPLS label */
722 e_IOC_FM_PCD_KG_IP_ADDR, /**< IP addr */
723 e_IOC_FM_PCD_KG_PROTOCOL_TYPE, /**< Protocol type */
724 e_IOC_FM_PCD_KG_IP_TOS_TC, /**< TOS or TC */
725 e_IOC_FM_PCD_KG_IPV6_FLOW_LABEL, /**< IPV6 flow label */
726 e_IOC_FM_PCD_KG_IPSEC_SPI, /**< IPSEC SPI */
727 e_IOC_FM_PCD_KG_L4_PORT, /**< L4 Port */
728 e_IOC_FM_PCD_KG_TCP_FLAG, /**< TCP Flag */
729 e_IOC_FM_PCD_KG_GENERIC_FROM_DATA,
730 /**< grouping implemented by SW, any data extraction that is not
731 * the full field described above
733 e_IOC_FM_PCD_KG_GENERIC_FROM_DATA_NO_V,
734 /**< grouping implemented by SW, any data extraction without
737 e_IOC_FM_PCD_KG_GENERIC_NOT_FROM_DATA
738 /**< grouping implemented by SW, extraction from parser result
739 * or direct use of default value
741 } ioc_fm_pcd_kg_known_fields_dflt_types;
744 * @Description Enumeration type for defining header index for scenarios with
745 * multiple (tunneled) headers
747 typedef enum ioc_fm_pcd_hdr_index {
748 e_IOC_FM_PCD_HDR_INDEX_NONE = 0,
749 /**< used when multiple headers not used, also
750 * to specify regular IP (not tunneled).
752 e_IOC_FM_PCD_HDR_INDEX_1,/**< may be used for VLAN, MPLS, tunneled IP */
753 e_IOC_FM_PCD_HDR_INDEX_2,/**< may be used for MPLS, tunneled IP */
754 e_IOC_FM_PCD_HDR_INDEX_3,/**< may be used for MPLS */
755 e_IOC_FM_PCD_HDR_INDEX_LAST = 0xFF /**< may be used for VLAN, MPLS */
756 } ioc_fm_pcd_hdr_index;
759 * @Description Enumeration type for selecting the policer profile functional
762 typedef enum ioc_fm_pcd_profile_type_selection {
763 e_IOC_FM_PCD_PLCR_PORT_PRIVATE, /**< Port dedicated profile */
764 e_IOC_FM_PCD_PLCR_SHARED
765 /**< Shared profile (shared within partition) */
766 } ioc_fm_pcd_profile_type_selection;
769 * @Description Enumeration type for selecting the policer profile algorithm
771 typedef enum ioc_fm_pcd_plcr_algorithm_selection {
772 e_IOC_FM_PCD_PLCR_PASS_THROUGH, /**< Policer pass through */
773 e_IOC_FM_PCD_PLCR_RFC_2698, /**< Policer algorithm RFC 2698 */
774 e_IOC_FM_PCD_PLCR_RFC_4115 /**< Policer algorithm RFC 4115 */
775 } ioc_fm_pcd_plcr_algorithm_selection;
778 * @Description Enumeration type for selecting a policer profile color mode
780 typedef enum ioc_fm_pcd_plcr_color_mode {
781 e_IOC_FM_PCD_PLCR_COLOR_BLIND, /**< Color blind */
782 e_IOC_FM_PCD_PLCR_COLOR_AWARE /**< Color aware */
783 } ioc_fm_pcd_plcr_color_mode;
786 * @Description Enumeration type for selecting a policer profile color
788 typedef enum ioc_fm_pcd_plcr_color {
789 e_IOC_FM_PCD_PLCR_GREEN, /**< Green */
790 e_IOC_FM_PCD_PLCR_YELLOW, /**< Yellow */
791 e_IOC_FM_PCD_PLCR_RED, /**< Red */
792 e_IOC_FM_PCD_PLCR_OVERRIDE /**< Color override */
793 } ioc_fm_pcd_plcr_color;
796 * @Description Enumeration type for selecting the policer profile packet
797 * frame length selector
799 typedef enum ioc_fm_pcd_plcr_frame_length_select {
800 e_IOC_FM_PCD_PLCR_L2_FRM_LEN, /**< L2 frame length */
801 e_IOC_FM_PCD_PLCR_L3_FRM_LEN, /**< L3 frame length */
802 e_IOC_FM_PCD_PLCR_L4_FRM_LEN, /**< L4 frame length */
803 e_IOC_FM_PCD_PLCR_FULL_FRM_LEN /**< Full frame length */
804 } ioc_fm_pcd_plcr_frame_length_select;
807 * @Description Enumeration type for selecting roll-back frame
809 typedef enum ioc_fm_pcd_plcr_roll_back_frame_select {
810 e_IOC_FM_PCD_PLCR_ROLLBACK_L2_FRM_LEN, /**< Rollback L2 frame length */
811 e_IOC_FM_PCD_PLCR_ROLLBACK_FULL_FRM_LEN
812 /**< Rollback Full frame length */
813 } ioc_fm_pcd_plcr_roll_back_frame_select;
816 * @Description Enumeration type for selecting the policer profile packet or
819 typedef enum ioc_fm_pcd_plcr_rate_mode {
820 e_IOC_FM_PCD_PLCR_BYTE_MODE, /**< Byte mode */
821 e_IOC_FM_PCD_PLCR_PACKET_MODE /**< Packet mode */
822 } ioc_fm_pcd_plcr_rate_mode;
825 * @Description Enumeration type for defining action of frame
827 typedef enum ioc_fm_pcd_done_action {
828 e_IOC_FM_PCD_ENQ_FRAME = 0, /**< Enqueue frame */
829 e_IOC_FM_PCD_DROP_FRAME /**< Drop frame */
830 } ioc_fm_pcd_done_action;
833 * @Description Enumeration type for selecting the policer counter
835 typedef enum ioc_fm_pcd_plcr_profile_counters {
836 e_IOC_FM_PCD_PLCR_PROFILE_GREEN_PACKET_TOTAL_COUNTER,
837 /**< Green packets counter */
838 e_IOC_FM_PCD_PLCR_PROFILE_YELLOW_PACKET_TOTAL_COUNTER,
839 /**< Yellow packets counter */
840 e_IOC_FM_PCD_PLCR_PROFILE_RED_PACKET_TOTAL_COUNTER,
841 /**< Red packets counter */
842 e_IOC_FM_PCD_PLCR_PROFILE_RECOLOURED_YELLOW_PACKET_TOTAL_COUNTER,
843 /**< Recolored yellow packets counter */
844 e_IOC_FM_PCD_PLCR_PROFILE_RECOLOURED_RED_PACKET_TOTAL_COUNTER
845 /**< Recolored red packets counter */
846 } ioc_fm_pcd_plcr_profile_counters;
849 * @Description Enumeration type for selecting the PCD action after extraction
851 typedef enum ioc_fm_pcd_action {
852 e_IOC_FM_PCD_ACTION_NONE, /**< NONE */
853 e_IOC_FM_PCD_ACTION_EXACT_MATCH,
854 /**< Exact match on the selected extraction */
855 e_IOC_FM_PCD_ACTION_INDEXED_LOOKUP
856 /**< Indexed lookup on the selected extraction */
860 * @Description Enumeration type for selecting type of insert manipulation
862 typedef enum ioc_fm_pcd_manip_hdr_insrt_type {
863 e_IOC_FM_PCD_MANIP_INSRT_GENERIC,
864 /**< Insert according to offset & size */
865 e_IOC_FM_PCD_MANIP_INSRT_BY_HDR,
866 /**< Insert according to protocol */
867 } ioc_fm_pcd_manip_hdr_insrt_type;
870 * @Description Enumeration type for selecting type of remove manipulation
872 typedef enum ioc_fm_pcd_manip_hdr_rmv_type {
873 e_IOC_FM_PCD_MANIP_RMV_GENERIC,
874 /**< Remove according to offset & size */
875 e_IOC_FM_PCD_MANIP_RMV_BY_HDR
876 /**< Remove according to offset & size */
877 } ioc_fm_pcd_manip_hdr_rmv_type;
880 * @Description An enum for selecting specific L2 fields removal
882 typedef enum ioc_fm_pcd_manip_hdr_rmv_specific_l2 {
883 e_IOC_FM_PCD_MANIP_HDR_RMV_ETHERNET, /**< Ethernet/802.3 MAC */
884 e_IOC_FM_PCD_MANIP_HDR_RMV_STACKED_QTAGS, /**< stacked QTags */
885 e_IOC_FM_PCD_MANIP_HDR_RMV_ETHERNET_AND_MPLS,
886 /**< MPLS and Ethernet/802.3 MAC header unitl the header
887 * which follows the MPLS header
889 e_IOC_FM_PCD_MANIP_HDR_RMV_MPLS
890 /**< Remove MPLS header (Unlimited MPLS labels) */
891 } ioc_fm_pcd_manip_hdr_rmv_specific_l2;
894 * @Description Enumeration type for selecting specific fields updates
896 typedef enum ioc_fm_pcd_manip_hdr_field_update_type {
897 e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_VLAN, /**< VLAN updates */
898 e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_IPV4, /**< IPV4 updates */
899 e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_IPV6, /**< IPV6 updates */
900 e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_TCP_UDP, /**< TCP_UDP updates */
901 } ioc_fm_pcd_manip_hdr_field_update_type;
904 * @Description Enumeration type for selecting VLAN updates
906 typedef enum ioc_fm_pcd_manip_hdr_field_update_vlan {
907 e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_VLAN_VPRI,
908 /**< Replace VPri of outer most VLAN tag. */
909 e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_DSCP_TO_VLAN
910 /**< DSCP to VLAN priority bits translation */
911 } ioc_fm_pcd_manip_hdr_field_update_vlan;
914 * @Description Enumeration type for selecting specific L2 fields removal
916 typedef enum ioc_fm_pcd_manip_hdr_insrt_specific_l2 {
917 e_IOC_FM_PCD_MANIP_HDR_INSRT_MPLS
918 /**< Insert MPLS header (Unlimited MPLS labels) */
919 } ioc_fm_pcd_manip_hdr_insrt_specific_l2;
922 * @Description Enumeration type for selecting QoS mapping mode
924 * Note: In all cases except
925 * 'e_FM_PCD_MANIP_HDR_QOS_MAPPING_NONE' User should instruct the
926 * port to read the parser-result
928 typedef enum ioc_fm_pcd_manip_hdr_qos_mapping_mode {
929 e_IOC_FM_PCD_MANIP_HDR_QOS_MAPPING_NONE = 0,
930 /**< No mapping, QoS field will not be changed */
931 e_IOC_FM_PCD_MANIP_HDR_QOS_MAPPING_AS_IS,
932 /**< QoS field will be overwritten by the last byte in
935 } ioc_fm_pcd_manip_hdr_qos_mapping_mode;
938 * @Description Enumeration type for selecting QoS source
940 * Note: In all cases except 'e_FM_PCD_MANIP_HDR_QOS_SRC_NONE'
941 * User should left room for the parser-result on input/output
942 * buffer and instruct the port to read/write the parser-result
943 * to the buffer (RPD should be set)
945 typedef enum ioc_fm_pcd_manip_hdr_qos_src {
946 e_IOC_FM_PCD_MANIP_HDR_QOS_SRC_NONE = 0,
948 e_IOC_FM_PCD_MANIP_HDR_QOS_SRC_USER_DEFINED,
949 /**< QoS will be taken from the last byte in the
952 } ioc_fm_pcd_manip_hdr_qos_src;
955 * @Description Enumeration type for selecting type of header insertion
957 typedef enum ioc_fm_pcd_manip_hdr_insrt_by_hdr_type {
958 e_IOC_FM_PCD_MANIP_INSRT_BY_HDR_SPECIFIC_L2,
959 /**< Specific L2 fields insertion */
960 e_IOC_FM_PCD_MANIP_INSRT_BY_HDR_IP, /**< IP insertion */
961 e_IOC_FM_PCD_MANIP_INSRT_BY_HDR_UDP, /**< UDP insertion */
962 e_IOC_FM_PCD_MANIP_INSRT_BY_HDR_UDP_LITE,
963 /**< UDP lite insertion */
964 e_IOC_FM_PCD_MANIP_INSRT_BY_HDR_CAPWAP /**< CAPWAP insertion */
965 } ioc_fm_pcd_manip_hdr_insrt_by_hdr_type;
968 * @Description Enumeration type for selecting specific custom command
970 typedef enum ioc_fm_pcd_manip_hdr_custom_type {
971 e_IOC_FM_PCD_MANIP_HDR_CUSTOM_IP_REPLACE,
972 /**< Replace IPv4/IPv6 */
973 e_IOC_FM_PCD_MANIP_HDR_CUSTOM_GEN_FIELD_REPLACE,
974 } ioc_fm_pcd_manip_hdr_custom_type;
977 * @Description Enumeration type for selecting specific custom command
979 typedef enum ioc_fm_pcd_manip_hdr_custom_ip_replace {
980 e_IOC_FM_PCD_MANIP_HDR_CUSTOM_REPLACE_IPV4_BY_IPV6,
981 /**< Replace IPv4 by IPv6 */
982 e_IOC_FM_PCD_MANIP_HDR_CUSTOM_REPLACE_IPV6_BY_IPV4
983 /**< Replace IPv6 by IPv4 */
984 } ioc_fm_pcd_manip_hdr_custom_ip_replace;
987 * @Description Enumeration type for selecting type of header removal
989 typedef enum ioc_fm_pcd_manip_hdr_rmv_by_hdr_type {
990 e_IOC_FM_PCD_MANIP_RMV_BY_HDR_SPECIFIC_L2 = 0,
991 /**< Specific L2 fields removal */
992 e_IOC_FM_PCD_MANIP_RMV_BY_HDR_CAPWAP, /**< CAPWAP removal */
993 e_IOC_FM_PCD_MANIP_RMV_BY_HDR_FROM_START,
994 /**< Locate from data that is not the header */
995 } ioc_fm_pcd_manip_hdr_rmv_by_hdr_type;
998 * @Description Enumeration type for selecting type of timeout mode
1000 typedef enum ioc_fm_pcd_manip_reassem_time_out_mode {
1001 e_IOC_FM_PCD_MANIP_TIME_OUT_BETWEEN_FRAMES,
1002 /**< Limits the time of the reassembly
1003 * process from the first fragment to
1006 e_IOC_FM_PCD_MANIP_TIME_OUT_BETWEEN_FRAG
1007 /**< Limits the time of receiving the
1010 } ioc_fm_pcd_manip_reassem_time_out_mode;
1013 * @Description Enumeration type for selecting type of WaysNumber mode
1015 typedef enum ioc_fm_pcd_manip_reassem_ways_number {
1016 e_IOC_FM_PCD_MANIP_ONE_WAY_HASH = 1, /**< One way hash */
1017 e_IOC_FM_PCD_MANIP_TWO_WAYS_HASH, /**< Two ways hash */
1018 e_IOC_FM_PCD_MANIP_THREE_WAYS_HASH, /**< Three ways hash */
1019 e_IOC_FM_PCD_MANIP_FOUR_WAYS_HASH, /**< Four ways hash */
1020 e_IOC_FM_PCD_MANIP_FIVE_WAYS_HASH, /**< Five ways hash */
1021 e_IOC_FM_PCD_MANIP_SIX_WAYS_HASH, /**< Six ways hash */
1022 e_IOC_FM_PCD_MANIP_SEVEN_WAYS_HASH, /**< Seven ways hash */
1023 e_IOC_FM_PCD_MANIP_EIGHT_WAYS_HASH /**< Eight ways hash */
1024 } ioc_fm_pcd_manip_reassem_ways_number;
1027 * @Description Enumeration type for selecting manipulation type
1029 typedef enum ioc_fm_pcd_manip_type {
1030 e_IOC_FM_PCD_MANIP_HDR = 0, /**< Header manipulation */
1031 e_IOC_FM_PCD_MANIP_REASSEM, /**< Reassembly */
1032 e_IOC_FM_PCD_MANIP_FRAG, /**< Fragmentation */
1033 e_IOC_FM_PCD_MANIP_SPECIAL_OFFLOAD /**< Special Offloading */
1034 } ioc_fm_pcd_manip_type;
1037 * @Description Enumeration type for selecting type of statistics mode
1039 typedef enum ioc_fm_pcd_cc_stats_mode {
1040 e_IOC_FM_PCD_CC_STATS_MODE_NONE = 0, /**< No statistics support */
1041 e_IOC_FM_PCD_CC_STATS_MODE_FRAME, /**< Frame count statistics */
1042 e_IOC_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME,
1043 /**< Byte and frame count statistics */
1044 e_IOC_FM_PCD_CC_STATS_MODE_RMON,
1045 /**< Byte and frame length range count statistics */
1046 } ioc_fm_pcd_cc_stats_mode;
1049 * @Description Enumeration type for determining the action in case an IP
1050 * packet is larger than MTU but its DF (Don't Fragment) bit is
1053 typedef enum ioc_fm_pcd_manip_donot_frag_action {
1054 e_IOC_FM_PCD_MANIP_DISCARD_PACKET = 0, /**< Discard packet */
1055 e_IOC_FM_PCD_MANIP_ENQ_TO_ERR_Q_OR_DISCARD_PACKET =
1056 e_IOC_FM_PCD_MANIP_DISCARD_PACKET,
1057 /**< Obsolete, cannot enqueue to error queue; In
1058 * practice, selects to discard packets; Will be
1059 * removed in the future
1061 e_IOC_FM_PCD_MANIP_FRAGMENT_PACKECT,
1062 /**< Fragment packet and continue normal
1065 e_IOC_FM_PCD_MANIP_CONTINUE_WITHOUT_FRAG
1066 /**< Continue normal processing without
1067 * fragmenting the packet
1069 } ioc_fm_pcd_manip_donot_frag_action;
1072 * @Description Enumeration type for selecting type of special offload
1075 typedef enum ioc_fm_pcd_manip_special_offload_type {
1076 e_IOC_FM_PCD_MANIP_SPECIAL_OFFLOAD_IPSEC,
1077 /**< IPSec offload manipulation */
1078 e_IOC_FM_PCD_MANIP_SPECIAL_OFFLOAD_CAPWAP
1079 /**< CAPWAP offload manipulation */
1080 } ioc_fm_pcd_manip_special_offload_type;
1083 * @Description A union of protocol dependent special options
1084 * (Must match union u_FmPcdHdrProtocolOpt defined in
1087 typedef union ioc_fm_pcd_hdr_protocol_opt_u {
1088 ioc_eth_protocol_opt_t eth_opt; /**< Ethernet options */
1089 ioc_vlan_protocol_opt_t vlan_opt; /**< Vlan options */
1090 ioc_mpls_protocol_opt_t mpls_opt; /**< MPLS options */
1091 ioc_ipv4_protocol_opt_t ipv4_opt; /**< IPv4 options */
1092 ioc_ipv6_protocol_opt_t ipv6_opt; /**< IPv6 options */
1093 ioc_capwap_protocol_opt_t capwap_opt; /**< CAPWAP options */
1094 } ioc_fm_pcd_hdr_protocol_opt_u;
1097 * @Description A union holding all known protocol fields
1099 typedef union ioc_fm_pcd_fields_u {
1100 ioc_header_field_eth_t eth; /**< Ethernet*/
1101 ioc_header_field_vlan_t vlan; /**< VLAN*/
1102 ioc_header_field_llc_snap_t llc_snap; /**< LLC SNAP*/
1103 ioc_header_field_pppoe_t pppoe; /**< PPPoE*/
1104 ioc_header_field_mpls_t mpls; /**< MPLS*/
1105 ioc_header_field_ip_t ip; /**< IP */
1106 ioc_header_field_ipv4_t ipv4; /**< IPv4*/
1107 ioc_header_field_ipv6_t ipv6; /**< IPv6*/
1108 ioc_header_field_udp_t udp; /**< UDP */
1109 ioc_header_field_udp_lite_t udp_lite; /**< UDP_Lite*/
1110 ioc_header_field_tcp_t tcp; /**< TCP */
1111 ioc_header_field_sctp_t sctp; /**< SCTP*/
1112 ioc_header_field_dccp_t dccp; /**< DCCP*/
1113 ioc_header_field_gre_t gre; /**< GRE */
1114 ioc_header_field_minencap_t minencap;/**< Minimal Encapsulation */
1115 ioc_header_field_ipsec_ah_t ipsec_ah; /**< IPSec AH*/
1116 ioc_header_field_ipsec_esp_t ipsec_esp; /**< IPSec ESP*/
1117 ioc_header_field_udp_encap_esp_t udp_encap_esp;
1118 /**< UDP Encapsulation ESP */
1119 } ioc_fm_pcd_fields_u;
1122 * @Description Parameters for defining header extraction for key generation
1124 typedef struct ioc_fm_pcd_from_hdr_t {
1125 uint8_t size; /**< Size in byte */
1126 uint8_t offset; /**< Byte offset */
1127 } ioc_fm_pcd_from_hdr_t;
1130 * @Description Parameters for defining field extraction for key generation
1132 typedef struct ioc_fm_pcd_from_field_t {
1133 ioc_fm_pcd_fields_u field; /**< Field selection */
1134 uint8_t size; /**< Size in byte */
1135 uint8_t offset; /**< Byte offset */
1136 } ioc_fm_pcd_from_field_t;
1139 * @Description Parameters for defining a single network environment unit
1140 * A distinction unit should be defined if it will later be used
1141 * by one or more PCD engines to distinguish between flows.
1142 * (Must match struct t_FmPcdDistinctionUnit defined in
1145 typedef struct ioc_fm_pcd_distinction_unit_t {
1147 ioc_net_header_type hdr;
1148 /**< One of the headers supported by the FM */
1149 ioc_fm_pcd_hdr_protocol_opt_u opt; /**< Select only one option! */
1150 } hdrs[IOC_FM_PCD_MAX_NUM_OF_INTERCHANGEABLE_HDRS];
1151 } ioc_fm_pcd_distinction_unit_t;
1154 * @Description Parameters for defining all different distinction units
1155 * supported by a specific PCD Network Environment
1156 * Characteristics module.
1158 * Each unit represent a protocol or a group of protocols that
1159 * may be used later by the different PCD engines to distinguish
1161 * (Must match struct t_FmPcdNetEnvParams defined in
1164 struct fm_pcd_net_env_params_t {
1165 uint8_t num_of_distinction_units;
1166 /**< Number of different units to be identified */
1167 ioc_fm_pcd_distinction_unit_t
1168 units[IOC_FM_PCD_MAX_NUM_OF_DISTINCTION_UNITS];
1169 /**< An array of num_of_distinction_units of the different units to be
1174 typedef struct ioc_fm_pcd_net_env_params_t {
1175 struct fm_pcd_net_env_params_t param;
1177 /**< Output parameter; Returns the net-env Id to be used */
1178 } ioc_fm_pcd_net_env_params_t;
1181 * @Description Parameters for defining a single extraction action when
1184 typedef struct ioc_fm_pcd_extract_entry_t {
1185 ioc_fm_pcd_extract_type type; /**< Extraction type select */
1188 ioc_net_header_type hdr; /**< Header selection */
1189 bool ignore_protocol_validation;
1190 /**< Ignore protocol validation */
1191 ioc_fm_pcd_hdr_index hdr_index;
1192 /**< Relevant only for MPLS, VLAN and
1193 * tunneled IP. Otherwise should be
1196 ioc_fm_pcd_extract_by_hdr_type type;
1197 /**< Header extraction type select */
1199 ioc_fm_pcd_from_hdr_t from_hdr;
1200 /**< Extract bytes from header
1203 ioc_fm_pcd_from_field_t from_field;
1204 /**< Extract bytes from field parameters
1206 ioc_fm_pcd_fields_u full_field;
1207 /**< Extract full field parameters */
1208 } extract_by_hdr_type;
1209 } extract_by_hdr;/**< Used when type = e_IOC_FM_PCD_KG_EXTRACT_BY_HDR */
1211 ioc_fm_pcd_extract_from src;
1212 /**< Non-header extraction source */
1213 ioc_fm_pcd_action action; /**< Relevant for CC Only */
1214 uint16_t ic_indx_mask;
1215 /**< Relevant only for CC whenaction =
1216 * e_IOC_FM_PCD_ACTION_INDEXED_LOOKUP; Note that
1217 * the number of bits that are set within this
1218 * mask must be log2 of the CC-node
1219 * 'num_of_keys'. Note that the mask cannot be
1220 * set on the lower bits.
1222 uint8_t offset; /**< Byte offset */
1223 uint8_t size; /**< Size in bytes */
1225 /**< Used when type = e_IOC_FM_PCD_KG_EXTRACT_NON_HDR */
1227 } ioc_fm_pcd_extract_entry_t;
1230 * @Description A structure for defining masks for each extracted
1233 typedef struct ioc_fm_pcd_kg_extract_mask_t {
1234 uint8_t extract_array_index;
1235 /**< Index in the extraction array, as
1236 * initialized by user
1238 uint8_t offset; /**< Byte offset */
1240 /**< A byte mask (selected bits will be ignored) */
1241 } ioc_fm_pcd_kg_extract_mask_t;
1244 * @Description A structure for defining default selection per groups of
1247 typedef struct ioc_fm_pcd_kg_extract_dflt_t {
1248 ioc_fm_pcd_kg_known_fields_dflt_types type;
1249 /**< Default type select */
1250 ioc_fm_pcd_kg_extract_dflt_select dflt_select;
1251 /**< Default register select */
1252 } ioc_fm_pcd_kg_extract_dflt_t;
1256 * @Description A structure for defining all parameters needed for
1257 * generation a key and using a hash function
1259 typedef struct ioc_fm_pcd_kg_key_extract_and_hash_params_t {
1260 uint32_t private_dflt0;
1261 /**< Scheme default register 0 */
1262 uint32_t private_dflt1;
1263 /**< Scheme default register 1 */
1264 uint8_t num_of_used_extracts;
1265 /**< defines the valid size of the
1268 ioc_fm_pcd_extract_entry_t
1269 extract_array[IOC_FM_PCD_KG_MAX_EXTRACTS_PER_KEY];
1270 /**< An array of extraction definitions.
1272 uint8_t num_of_used_dflts;
1273 /**< defines the valid size of the
1276 ioc_fm_pcd_kg_extract_dflt_t
1277 dflts[IOC_FM_PCD_KG_NUM_OF_DEFAULT_GROUPS];
1278 /**< For each extraction used in this
1279 * scheme, specify the required default
1280 * register to be used when header is
1281 * not found. types not specified in
1282 * this array will get undefined value.
1284 uint8_t num_of_used_masks;
1285 /**< Defines the valid size of the
1288 ioc_fm_pcd_kg_extract_mask_t
1289 masks[IOC_FM_PCD_KG_NUM_OF_EXTRACT_MASKS];
1291 /**< Hash result right shift. Selects
1292 * the 24 bits out of the 64 hash
1293 * result. 0 means using the 24 LSB's,
1294 * otherwise use the 24 LSB's after
1297 uint32_t hash_dist_num_of_fqids;
1298 /**< must be > 1 and a power of 2.
1299 * Represents the range of queues for
1300 * the key and hash functionality
1302 uint8_t hash_distribution_fqids_shift;
1303 /**< selects the FQID bits that will be
1304 * effected by the hash
1306 bool symmetric_hash;
1307 /**< TRUE to generate the same hash for
1308 * frames with swapped source and
1309 * destination fields on all layers; If
1310 * TRUE, driver will check that for all
1311 * layers, if SRC extraction is
1312 * selected, DST extraction must also be
1313 * selected, and vice versa.
1315 } ioc_fm_pcd_kg_key_extract_and_hash_params_t;
1318 * @Description A structure of parameters for defining a single Qid mask
1321 typedef struct ioc_fm_pcd_kg_extracted_or_params_t {
1322 ioc_fm_pcd_extract_type type;
1323 /**< Extraction type select */
1326 /**< used when type = e_IOC_FM_PCD_KG_EXTRACT_BY_HDR */
1327 ioc_net_header_type hdr;
1328 ioc_fm_pcd_hdr_index hdr_index;
1329 /**< Relevant only for MPLS,
1330 * VLAN and tunneled IP.
1331 * Otherwise should be cleared.
1333 bool ignore_protocol_validation;
1336 ioc_fm_pcd_extract_from src;
1337 /**< used when type =
1338 * e_IOC_FM_PCD_KG_EXTRACT_NON_HDR
1341 uint8_t extraction_offset;
1342 /**< Offset for extraction */
1343 ioc_fm_pcd_kg_extract_dflt_select dflt_value;
1344 /**< Select register from which
1345 * extraction is taken if field not
1349 /**< Mask LSB byte of extraction
1350 * (specified bits are ignored)
1353 uint8_t bit_offset_in_fqid;
1354 /**< 0-31, Selects which bits of the 24 FQID bits to effect
1355 * using the extracted byte; Assume byte is placed as the 8
1356 * MSB's in a 32 bit word where the lower bits are the FQID; i.e
1357 * if bitOffsetInFqid=1 than its LSB will effect the FQID MSB,
1358 * if bitOffsetInFqid=24 than the extracted byte will effect the
1359 * 8 LSB's of the FQID, if bitOffsetInFqid=31 than the byte's
1360 * MSB will effect the FQID's LSB; 0 means - no effect on FQID;
1361 * Note that one, and only one of bitOffsetInFqid or
1362 * bitOffsetInPlcrProfile must be set (i.e, extracted byte must
1363 * effect either FQID or Policer profile).
1365 uint8_t bit_offset_in_plcr_profile;
1366 /**< 0-15, Selects which bits of the 8 policer profile id bits
1367 * to effect using the extracted byte; Assume byte is placed as
1368 * the 8 MSB's in a 16 bit word where the lower bits are the
1369 * policer profile id; i.e if bitOffsetInPlcrProfile=1 than its
1370 * LSB will effect the profile MSB, if bitOffsetInFqid=8 than
1371 * the extracted byte will effect the whole policer profile id,
1372 * if bitOffsetInFqid=15 than the byte's MSB will effect the
1373 * Policer Profile id's LSB; 0 means - no effect on policer
1374 * profile; Note that one, and only one of bitOffsetInFqid or
1375 * bitOffsetInPlcrProfile must be set (i.e, extracted byte must
1376 * effect either FQID or Policer profile).
1378 } ioc_fm_pcd_kg_extracted_or_params_t;
1381 * @Description A structure for configuring scheme counter
1383 typedef struct ioc_fm_pcd_kg_scheme_counter_t {
1385 /**< FALSE to keep the current counter state and
1386 * continue from that point, TRUE to update/reset the
1387 * counter when the scheme is written.
1390 /**< If update=TRUE, this value will be written into the
1391 * counter; clear this field to reset the counter.
1393 } ioc_fm_pcd_kg_scheme_counter_t;
1397 * @Description A structure for retrieving FMKG_SE_SPC
1399 typedef struct ioc_fm_pcd_kg_scheme_spc_t {
1400 uint32_t val; /**< return value */
1401 void *id; /**< scheme handle */
1402 } ioc_fm_pcd_kg_scheme_spc_t;
1405 * @Description A structure for defining policer profile parameters as
1406 * required by keygen (when policer is the next engine after this
1408 * (Must match struct t_FmPcdKgPlcrProfile defined in
1411 typedef struct ioc_fm_pcd_kg_plcr_profile_t {
1412 bool shared_profile;
1413 /**< TRUE if this profile is shared between ports (i.e.
1414 * managed by primary partition) May not be TRUE if
1415 * profile is after Coarse Classification
1418 /**< If TRUE, direct_relative_profile_id only selects
1419 * the profile id, if FALSE
1420 * fqid_offset_relative_profile_id_base is used together
1421 * with fqid_offset_shift and num_of_profiles
1422 * parameters, to define a range of profiles from which
1423 * the KeyGen result will determine the destination
1427 uint16_t direct_relative_profile_id;
1428 /**< Used if 'direct' is TRUE, to select policer
1429 * profile. This parameter should indicate the policer
1430 * profile offset within the port's policer profiles or
1434 uint8_t fqid_offset_shift;
1435 /**< Shift of KG results without the qid base */
1436 uint8_t fqid_offset_relative_profile_id_base;
1437 /**< OR of KG results without the qid base This
1438 * parameter should indicate the policer profile offset
1439 * within the port's policer profiles window or SHARED
1440 * window depends on shared_profile
1442 uint8_t num_of_profiles;
1443 /**< Range of profiles starting at base */
1444 } indirect_profile; /**< Indirect profile parameters */
1446 /**< Direct/indirect profile selection and parameters */
1447 } ioc_fm_pcd_kg_plcr_profile_t;
1450 * @Description Parameters for configuring a storage profile for a KeyGen
1453 typedef struct ioc_fm_pcd_kg_storage_profile_t {
1455 /**< If TRUE, directRelativeProfileId only selects the profile
1456 * id; If FALSE, fqidOffsetRelativeProfileIdBase is used
1457 * together with fqidOffsetShift and num_of_profiles parameters
1458 * to define a range of profiles from which the KeyGen result
1459 * will determine the destination storage profile.
1462 uint16_t direct_relative_profile_id;
1463 /**< Used when 'direct' is TRUE, to select a storage profile;
1464 * should indicate the storage profile offset within the port's
1465 * storage profiles window.
1468 uint8_t fqid_offset_shift;
1469 /**< Shift of KeyGen results without the FQID base */
1470 uint8_t fqid_offset_relative_profile_id_base;
1471 /**< OR of KeyGen results without the FQID base; should
1472 * indicate the policer profile offset within the port's
1473 * storage profiles window.
1475 uint8_t num_of_profiles;
1476 /**< Range of profiles starting at base. */
1478 /**< Indirect profile parameters. */
1480 /**< Direct/indirect profile selection and parameters. */
1481 } ioc_fm_pcd_kg_storage_profile_t;
1484 * @Description Parameters for defining CC as the next engine after KeyGen
1485 * (Must match struct t_FmPcdKgCc defined in fm_pcd_ext.h)
1487 typedef struct ioc_fm_pcd_kg_cc_t {
1491 /**< CC group id within the CC tree */
1493 /**< TRUE if after CC, in case of data
1494 * frame, policing is required.
1496 bool bypass_plcr_profile_generation;
1497 /**< TRUE to bypass KeyGen policer
1498 * profile generation; selected profile
1499 * is the one set at port initialization
1501 ioc_fm_pcd_kg_plcr_profile_t plcr_profile;
1502 /**< Valid only if plcr_next = TRUE and
1503 * bypass_plcr_profile_generation =
1506 } ioc_fm_pcd_kg_cc_t;
1509 * @Description Parameters for defining initializing a KeyGen scheme (Must
1510 * match struct t_FmPcdKgSchemeParams defined in fm_pcd_ext.h)
1512 struct fm_pcd_kg_scheme_params_t {
1513 bool modify; /**< TRUE to change an existing scheme */
1515 uint8_t relative_scheme_id;
1516 /**< if modify=FALSE: partition-relative scheme id */
1518 /**< if modify=TRUE: the id of an existing scheme */
1521 /**< This scheme is reached only directly, i.e. no need for
1522 * match vector; KeyGen will ignore it when matching
1525 /**< HL relevant only if always_direct=FALSE */
1527 /**< The id of the Network Environment as returned
1528 * by fm_pcd_net_env_characteristics_set()
1530 uint8_t num_of_distinction_units;
1531 /**< Number of NetEnv units listed in unit_ids array */
1532 uint8_t unit_ids[IOC_FM_PCD_MAX_NUM_OF_DISTINCTION_UNITS];
1533 /**< Indexes as passed to SetNetEnvCharacteristics (?) array */
1536 /**< use the KG Hash functionality */
1537 ioc_fm_pcd_kg_key_extract_and_hash_params_t key_ext_and_hash;
1538 /**< used only if useHash = TRUE */
1539 bool bypass_fqid_generation;
1540 /**< Normally - FALSE, TRUE to avoid FQID update in the IC; In
1541 * such a case FQID after KG will be the default FQID defined
1542 * for the relevant port, or the FQID defined by CC in cases
1543 * where CC was the previous engine.
1546 /**< Base FQID; Relevant only if bypass_fqid_generation = FALSE;
1547 * If hash is used and an even distribution is expected
1548 * according to hash_dist_num_of_fqids, base_fqid must
1549 * be aligned to hash_dist_num_of_fqids.
1551 uint8_t num_of_used_extracted_ors;
1552 /**< Number of FQID masks listed in extracted_ors array*/
1553 ioc_fm_pcd_kg_extracted_or_params_t
1554 extracted_ors[IOC_FM_PCD_KG_NUM_OF_GENERIC_REGS];
1555 /**< IOC_FM_PCD_KG_NUM_OF_GENERIC_REGS registers are shared
1556 * between qid_masks functionality and some of the extraction
1557 * actions; Normally only some will be used for qid_mask. Driver
1558 * will return error if resource is full at initialization time.
1560 bool override_storage_profile;
1561 /**< TRUE if KeyGen override previously decided storage profile
1563 ioc_fm_pcd_kg_storage_profile_t storage_profile;
1564 /**< Used when override_storage_profile=TRUE */
1565 ioc_fm_pcd_engine next_engine;
1566 /**< may be BMI, PLCR or CC */
1568 /**< depends on nextEngine */
1569 ioc_fm_pcd_done_action done_action;
1570 /**< Used when next engine is BMI (done) */
1571 ioc_fm_pcd_kg_plcr_profile_t plcr_profile;
1572 /**< Used when next engine is PLCR */
1573 ioc_fm_pcd_kg_cc_t cc;
1574 /**< Used when next engine is CC */
1575 } kg_next_engine_params;
1576 ioc_fm_pcd_kg_scheme_counter_t scheme_counter;
1577 /**< A structure of parameters for updating the scheme counter*/
1580 typedef struct ioc_fm_pcd_kg_scheme_params_t {
1581 struct fm_pcd_kg_scheme_params_t param;
1582 void *id; /**< Returns the scheme Id to be used */
1583 } ioc_fm_pcd_kg_scheme_params_t;
1588 #define IOC_FM_PCD_CC_STATS_MAX_FLR 10
1589 /* Maximal supported number of frame length ranges */
1590 #define IOC_FM_PCD_CC_STATS_FLR_SIZE 2
1591 /* Size in bytes of a frame length range limit */
1592 #define IOC_FM_PCD_CC_STATS_FLR_COUNT_SIZE 4
1593 /* Size in bytes of a frame length range counter */
1597 * @Description Parameters for defining CC as the next engine after a CC node.
1598 * (Must match struct t_FmPcdCcNextCcParams defined in
1601 typedef struct ioc_fm_pcd_cc_next_cc_params_t {
1602 void *cc_node_id; /**< Id of the next CC node */
1603 } ioc_fm_pcd_cc_next_cc_params_t;
1606 * @Description A structure for defining Frame Replicator as the next engine
1607 * after a CC node. (Must match struct t_FmPcdCcNextFrParams
1608 * defined in fm_pcd_ext.h)
1610 typedef struct ioc_fm_pcd_cc_next_fr_params_t {
1611 void *frm_replic_id;
1612 /**< The id of the next frame replicator group */
1613 } ioc_fm_pcd_cc_next_fr_params_t;
1616 * @Description A structure for defining PLCR params when PLCR is the
1617 * next engine after a CC node
1618 * (Must match struct t_FmPcdCcNextPlcrParams defined in
1621 typedef struct ioc_fm_pcd_cc_next_plcr_params_t {
1622 bool override_params;
1623 /**< TRUE if CC override previously decided parameters*/
1624 bool shared_profile;
1625 /**< Relevant only if overrideParams=TRUE: TRUE if this profile
1626 * is shared between ports
1628 uint16_t new_relative_profile_id;
1629 /**< Relevant only if overrideParams=TRUE: (otherwise profile id
1630 * is taken from keygen); This parameter should indicate the
1631 * policer profile offset within the port's policer profiles or
1632 * from SHARED window.
1635 /**< Relevant only if overrideParams=TRUE: FQID for enquing the
1636 * frame; In earlier chips if policer next engine is KEYGEN,
1637 * this parameter can be 0, because the KEYGEN always decides
1640 uint8_t new_relative_storage_profile_id;
1641 /**< Indicates the relative storage profile offset within the
1642 * port's storage profiles window; Relevant only if the port was
1643 * configured with VSP.
1645 } ioc_fm_pcd_cc_next_plcr_params_t;
1648 * @Description A structure for defining enqueue params when BMI is the next
1649 * engine after a CC node (Must match struct
1650 * t_FmPcdCcNextEnqueueParams defined in fm_pcd_ext.h)
1652 typedef struct ioc_fm_pcd_cc_next_enqueue_params_t {
1653 ioc_fm_pcd_done_action action;
1654 /**< Action - when next engine is BMI (done) */
1656 /**< TRUE if CC override previously decided fqid
1657 * and vspid, relevant if action =
1658 * e_IOC_FM_PCD_ENQ_FRAME
1661 /**< Valid if overrideFqid=TRUE, FQID for
1662 * enqueuing the frame (otherwise FQID is taken
1663 * from KeyGen), relevant if action =
1664 * e_IOC_FM_PCD_ENQ_FRAME
1666 uint8_t new_relative_storage_profile_id;
1667 /**< Valid if override_fqid=TRUE, Indicates the relative
1668 * virtual storage profile offset within the port's
1669 * storage profiles window; Relevant only if the port
1670 * was configured with VSP.
1673 } ioc_fm_pcd_cc_next_enqueue_params_t;
1676 * @Description A structure for defining KG params when KG is the next engine
1677 * after a CC node (Must match struct t_FmPcdCcNextKgParams
1678 * defined in fm_pcd_ext.h)
1680 typedef struct ioc_fm_pcd_cc_next_kg_params_t {
1682 /**< TRUE if CC override previously decided fqid and vspid,
1683 * Note - this parameters are irrelevant for earlier chips
1686 /**< Valid if overrideFqid=TRUE, FQID for enqueuing the frame
1687 * (otherwise FQID is taken from KeyGen),
1688 * Note - this parameters are irrelevant for earlier chips
1690 uint8_t new_relative_storage_profile_id;
1691 /**< Valid if override_fqid=TRUE, Indicates the relative virtual
1692 * storage profile offset within the port's storage profiles
1693 * window; Relevant only if the port was configured with VSP.
1695 void *p_direct_scheme; /**< Direct scheme id to go to. */
1696 } ioc_fm_pcd_cc_next_kg_params_t;
1699 * @Description Parameters for defining the next engine after a CC node.
1700 * (Must match struct ioc_fm_pcd_cc_next_engine_params_t defined
1703 typedef struct ioc_fm_pcd_cc_next_engine_params_t {
1704 ioc_fm_pcd_engine next_engine;
1705 /**< User has to initialize parameters according
1706 * to nextEngine definition
1709 ioc_fm_pcd_cc_next_cc_params_t cc_params;
1710 /**< Parameters in case next engine is CC */
1711 ioc_fm_pcd_cc_next_plcr_params_t plcr_params;
1712 /**< Parameters in case next engine is PLCR */
1713 ioc_fm_pcd_cc_next_enqueue_params_t enqueue_params;
1714 /**< Parameters in case next engine is BMI */
1715 ioc_fm_pcd_cc_next_kg_params_t kg_params;
1716 /**< Parameters in case next engine is KG */
1717 ioc_fm_pcd_cc_next_fr_params_t fr_params;
1718 /**< Parameters in case next engine is FR */
1720 /**< Union used for all the next-engine parameters options */
1722 /**< Handle to Manipulation object. Relevant if
1723 * next engine is of type result
1724 * (e_IOC_FM_PCD_PLCR, e_IOC_FM_PCD_KG,
1725 * e_IOC_FM_PCD_DONE)
1728 /**< If TRUE, statistics counters are
1729 * incremented for each frame passing through
1730 * this Coarse Classification entry.
1732 } ioc_fm_pcd_cc_next_engine_params_t;
1735 * @Description Parameters for defining a single CC key
1737 typedef struct ioc_fm_pcd_cc_key_params_t {
1739 /**< pointer to the key of the size defined in key_size
1742 /**< pointer to the Mask per key of the size defined in
1743 * key_size. p_key and p_mask (if defined) has to be of
1744 * the same size defined in the key_size
1746 ioc_fm_pcd_cc_next_engine_params_t cc_next_engine_params;
1747 /**< parameters for the next for the defined Key in
1751 } ioc_fm_pcd_cc_key_params_t;
1754 * @Description Parameters for defining CC keys parameters
1755 * The driver supports two methods for CC node allocation:
1756 * dynamic and static. Static mode was created in order to
1757 * prevent runtime alloc/free of FMan memory (MURAM), which may
1758 * cause fragmentation; in this mode, the driver automatically
1759 * allocates the memory according to 'max_num_of_keys' parameter.
1760 * The driver calculates the maximal memory size that may be used
1761 * for this CC-Node taking into consideration 'mask_support' and
1762 * 'statistics_mode' parameters. When 'action' =
1763 * e_IOC_FM_PCD_ACTION_INDEXED_LOOKUP in the extraction
1764 * parameters of this node, 'max_num_of_keys' must be equal to
1765 * 'num_of_keys'. In dynamic mode, 'max_num_of_keys' must be
1766 * zero. At initialization, all required structures are allocated
1767 * according to 'num_of_keys' parameter. During runtime
1768 * modification, these structures are re-allocated according to
1769 * the updated number of keys.
1770 * Please note that 'action' and 'ic_indx_mask' mentioned in the
1771 * specific parameter explanations are passed in the extraction
1772 * parameters of the node (fields of
1773 * extractccparams.extractnonhdr).
1775 typedef struct ioc_keys_params_t {
1776 uint16_t max_num_of_keys;
1777 /**< Maximum number of keys that will (ever) be used in
1778 * this CC-Node; A value of zero may be used for dynamic
1779 * memory allocation.
1782 /**< This parameter is relevant only if a node is
1783 * initialized with action =
1784 * e_IOC_FM_PCD_ACTION_EXACT_MATCH and max_num_of_keys >
1785 * 0; Should be TRUE to reserve table memory for key
1786 * masks, even if initial keys do not contain masks, or
1787 * if the node was initialized as 'empty' (without
1788 * keys); this will allow user to add keys with masks at
1791 ioc_fm_pcd_cc_stats_mode statistics_mode;
1792 /**< Determines the supported statistics mode for all
1793 * node's keys. To enable statistics gathering,
1794 * statistics should be enabled per every key, using
1795 * 'statistics_en' in next engine parameters structure
1796 * of that key; If 'max_num_of_keys' is set, all
1797 * required structures will be preallocated for all keys
1799 uint16_t frame_length_ranges[IOC_FM_PCD_CC_STATS_MAX_FLR];
1800 /**< Relevant only for 'RMON' statistics mode (this feature is
1801 * supported only on B4860 device); Holds a list of programmable
1802 * thresholds. For each received frame, its length in bytes is
1803 * examined against these range thresholds and the appropriate
1804 * counter is incremented by 1. For example, to belong to range
1805 * i, the following should hold: range i-1 threshold < frame
1806 * length <= range i threshold Each range threshold must be
1807 * larger then its preceding range threshold. Last range
1808 * threshold must be 0xFFFF.
1810 uint16_t num_of_keys;
1811 /**< Number of initial keys; Note that in case of 'action' =
1812 * e_IOC_FM_PCD_ACTION_INDEXED_LOOKUP, this field should be
1813 * power-of-2 of the number of bits that are set in
1817 /**< Size of key - for extraction of type FULL_FIELD, 'key_size'
1818 * has to be the standard size of the selected key; For other
1819 * extraction types, 'key_size' has to be as size of extraction;
1820 * When 'action' = e_IOC_FM_PCD_ACTION_INDEXED_LOOKUP,
1821 * 'key_size' must be 2.
1823 ioc_fm_pcd_cc_key_params_t key_params[IOC_FM_PCD_MAX_NUM_OF_KEYS];
1824 /**< An array with 'num_of_keys' entries, each entry specifies
1825 * the corresponding key parameters; When 'action' =
1826 * e_IOC_FM_PCD_ACTION_EXACT_MATCH, this value must not exceed
1827 * 255 (IOC_FM_PCD_MAX_NUM_OF_KEYS-1) as the last entry is saved
1828 * for the 'miss' entry.
1830 ioc_fm_pcd_cc_next_engine_params_t cc_next_engine_params_for_miss;
1831 /**< Parameters for defining the next engine when a key is not
1832 * matched; Not relevant if action =
1833 * e_IOC_FM_PCD_ACTION_INDEXED_LOOKUP.
1835 } ioc_keys_params_t;
1838 * @Description Parameters for defining a CC node
1840 struct fm_pcd_cc_node_params_t {
1841 ioc_fm_pcd_extract_entry_t extract_cc_params;
1842 /**< Extraction parameters */
1843 ioc_keys_params_t keys_params;
1844 /**< Keys definition matching the selected extraction */
1847 typedef struct ioc_fm_pcd_cc_node_params_t {
1848 struct fm_pcd_cc_node_params_t param;
1850 /**< Output parameter; returns the CC node Id to be used */
1851 } ioc_fm_pcd_cc_node_params_t;
1854 * @Description Parameters for defining a hash table
1855 * (Must match struct ioc_fm_pcd_hash_table_params_t defined in
1858 struct fm_pcd_hash_table_params_t {
1859 uint16_t max_num_of_keys;
1860 /**< Maximum Number Of Keys that will (ever) be used in this
1863 ioc_fm_pcd_cc_stats_mode statistics_mode;
1864 /**< If not e_IOC_FM_PCD_CC_STATS_MODE_NONE, the required
1865 * structures for the requested statistics mode will be
1866 * allocated according to max_num_of_keys.
1868 uint8_t kg_hash_shift;
1869 /**< KG-Hash-shift as it was configured in the KG-scheme that
1870 * leads to this hash-table.
1872 uint16_t hash_res_mask;
1873 /**< Mask that will be used on the hash-result; The
1874 * number-of-sets for this hash will be calculated as (2^(number
1875 * of bits set in 'hash_res_mask')); The 4 lower bits must be
1879 /**< Byte offset from the beginning of the KeyGen hash result to
1880 * the 2-bytes to be used as hash index.
1882 uint8_t match_key_size;
1883 /**< Size of the exact match keys held by the hash buckets */
1885 ioc_fm_pcd_cc_next_engine_params_t cc_next_engine_params_for_miss;
1886 /**< Parameters for defining the next engine when a key is not
1891 typedef struct ioc_fm_pcd_hash_table_params_t {
1892 struct fm_pcd_hash_table_params_t param;
1894 } ioc_fm_pcd_hash_table_params_t;
1897 * @Description A structure with the arguments for the
1898 * fm_pcd_hash_table_add_key ioctl() call
1900 typedef struct ioc_fm_pcd_hash_table_add_key_params_t {
1903 ioc_fm_pcd_cc_key_params_t key_params;
1904 } ioc_fm_pcd_hash_table_add_key_params_t;
1907 * @Description Parameters for defining a CC tree group.
1909 * This structure defines a CC group in terms of NetEnv units and
1910 * the action to be taken in each case. The unit_ids list must be
1911 * given in order from low to high indices.
1912 * ioc_fm_pcd_cc_next_engine_params_t is a list of
1913 * 2^num_of_distinction_units structures where each defines the
1914 * next action to be taken for each units combination. for
1915 * example: num_of_distinction_units = 2 unit_ids = {1,3}
1916 * next_engine_per_entries_in_grp[0] =
1917 * ioc_fm_pcd_cc_next_engine_params_t for the case that unit 1 -
1918 * not found; unit 3 - not found;
1919 * next_engine_per_entries_in_grp[1] =
1920 * ioc_fm_pcd_cc_next_engine_params_t for the case that unit 1 -
1921 * not found; unit 3 - found;
1922 * next_engine_per_entries_in_grp[2] =
1923 * ioc_fm_pcd_cc_next_engine_params_t for the case that unit 1 -
1924 * found; unit 3 - not found;
1925 * next_engine_per_entries_in_grp[3] =
1926 * ioc_fm_pcd_cc_next_engine_params_t for the case that unit 1 -
1927 * found; unit 3 - found;
1929 typedef struct ioc_fm_pcd_cc_grp_params_t {
1930 uint8_t num_of_distinction_units; /**< Up to 4 */
1931 uint8_t unit_ids[IOC_FM_PCD_MAX_NUM_OF_CC_UNITS];
1932 /**< Indexes of the units as defined in
1933 * fm_pcd_net_env_characteristics_set()
1935 ioc_fm_pcd_cc_next_engine_params_t
1936 next_engine_per_entries_in_grp[IOC_FM_PCD_MAX_CC_ENTRY_IN_GRP];
1937 /**< Maximum entries per group is 16 */
1938 } ioc_fm_pcd_cc_grp_params_t;
1941 * @Description Parameters for defining the CC tree groups
1942 * (Must match struct ioc_fm_pcd_cc_tree_params_t defined in
1945 typedef struct ioc_fm_pcd_cc_tree_params_t {
1947 /**< Id of the Network Environment as returned
1948 * by fm_pcd_net_env_characteristics_set()
1950 uint8_t num_of_groups;
1951 /**< Number of CC groups within the CC tree */
1952 ioc_fm_pcd_cc_grp_params_t
1953 fm_pcd_cc_group_params[IOC_FM_PCD_MAX_NUM_OF_CC_GROUPS];
1954 /**< Parameters for each group. */
1956 /**< Output parameter; Returns the tree Id to be used */
1957 } ioc_fm_pcd_cc_tree_params_t;
1960 * @Description Parameters for defining policer byte rate
1962 typedef struct ioc_fm_pcd_plcr_byte_rate_mode_param_t {
1963 ioc_fm_pcd_plcr_frame_length_select frame_length_selection;
1964 /**< Frame length selection */
1965 ioc_fm_pcd_plcr_roll_back_frame_select roll_back_frame_selection;
1966 /**< relevant option only e_IOC_FM_PCD_PLCR_L2_FRM_LEN,
1967 * e_IOC_FM_PCD_PLCR_FULL_FRM_LEN
1969 } ioc_fm_pcd_plcr_byte_rate_mode_param_t;
1972 * @Description Parameters for defining the policer profile (based on
1973 * RFC-2698 or RFC-4115 attributes).
1975 typedef struct ioc_fm_pcd_plcr_non_passthrough_alg_param_t {
1976 ioc_fm_pcd_plcr_rate_mode rate_mode;
1977 /**< Byte / Packet */
1978 ioc_fm_pcd_plcr_byte_rate_mode_param_t byte_mode_param;
1979 /**< Valid for Byte NULL for Packet */
1980 uint32_t committed_info_rate;
1981 /**< KBits/Sec or Packets/Sec */
1982 uint32_t committed_burst_size;
1983 /**< KBits or Packets */
1984 uint32_t peak_or_excess_info_rate;
1985 /**< KBits/Sec or Packets/Sec */
1986 uint32_t peak_or_excess_burst_size;
1987 /**< KBits or Packets */
1988 } ioc_fm_pcd_plcr_non_passthrough_alg_param_t;
1991 * @Description Parameters for defining the next engine after policer
1993 typedef union ioc_fm_pcd_plcr_next_engine_params_u {
1994 ioc_fm_pcd_done_action action;
1995 /**< Action - when next engine is BMI (done) */
1997 /**< Policer profile handle - used when next
1998 * engine is PLCR, must be a SHARED profile
2000 void *p_direct_scheme;
2001 /**< Direct scheme select - when next engine is
2004 } ioc_fm_pcd_plcr_next_engine_params_u;
2006 typedef struct ioc_fm_pcd_port_params_t {
2007 ioc_fm_port_type port_type;
2008 /**< Type of port for this profile */
2010 /**< FM-Port id of port for this profile */
2011 } ioc_fm_pcd_port_params_t;
2014 * @Description Parameters for defining the policer profile entry
2015 * (Must match struct ioc_fm_pcd_plcr_profile_params_t defined in
2018 struct fm_pcd_plcr_profile_params_t {
2020 /**< TRUE to change an existing profile */
2023 ioc_fm_pcd_profile_type_selection profile_type;
2024 /**< Type of policer profile */
2025 ioc_fm_pcd_port_params_t *p_fm_port;
2026 /**< Relevant for per-port profiles only */
2027 uint16_t relative_profile_id;
2028 /**< Profile id - relative to shared group or to
2032 /**< Use it when modify = FALSE */
2034 /**< A handle to a profile - use it when modify=TRUE */
2036 ioc_fm_pcd_plcr_algorithm_selection alg_selection;
2037 /**< Profile Algorithm PASS_THROUGH, RFC_2698, RFC_4115 */
2038 ioc_fm_pcd_plcr_color_mode color_mode;
2039 /**< COLOR_BLIND, COLOR_AWARE */
2042 ioc_fm_pcd_plcr_color dflt_color;
2043 /**< For Color-Blind Pass-Through mode; the policer will
2044 * re-color any incoming packet with the default value.
2046 ioc_fm_pcd_plcr_color override;
2047 /**< For Color-Aware modes; the profile response to a pre-color
2052 ioc_fm_pcd_plcr_non_passthrough_alg_param_t
2053 non_passthrough_alg_param;
2054 /**< RFC2698 or RFC4115 parameters */
2056 ioc_fm_pcd_engine next_engine_on_green;
2057 /**< Next engine for green-colored frames */
2058 ioc_fm_pcd_plcr_next_engine_params_u params_on_green;
2059 /**< Next engine parameters for green-colored frames */
2061 ioc_fm_pcd_engine next_engine_on_yellow;
2062 /**< Next engine for yellow-colored frames */
2063 ioc_fm_pcd_plcr_next_engine_params_u params_on_yellow;
2064 /**< Next engine parameters for yellow-colored frames */
2066 ioc_fm_pcd_engine next_engine_on_red;
2067 /**< Next engine for red-colored frames */
2068 ioc_fm_pcd_plcr_next_engine_params_u params_on_red;
2069 /**< Next engine parameters for red-colored frames */
2071 bool trap_profile_on_flow_A;
2072 /**< Obsolete - do not use */
2073 bool trap_profile_on_flow_B;
2074 /**< Obsolete - do not use */
2075 bool trap_profile_on_flow_C;
2076 /**< Obsolete - do not use */
2079 typedef struct ioc_fm_pcd_plcr_profile_params_t {
2080 struct fm_pcd_plcr_profile_params_t param;
2082 /**< output parameter; Returns the profile Id to be used */
2083 } ioc_fm_pcd_plcr_profile_params_t;
2086 * @Description A structure for modifying CC tree next engine
2088 typedef struct ioc_fm_pcd_cc_tree_modify_next_engine_params_t {
2090 /**< CC tree Id to be used */
2092 /**< A Group index in the tree */
2094 /**< Entry index in the group defined by grp_index */
2095 ioc_fm_pcd_cc_next_engine_params_t cc_next_engine_params;
2096 /**< Parameters for the next for the defined Key in the
2099 } ioc_fm_pcd_cc_tree_modify_next_engine_params_t;
2102 * @Description A structure for modifying CC node next engine
2104 typedef struct ioc_fm_pcd_cc_node_modify_next_engine_params_t {
2106 /**< CC node Id to be used */
2108 /**< Key index for Next Engine Params modifications;
2109 * NOTE: This parameter is IGNORED for miss-key!
2112 /**< Key size of added key */
2113 ioc_fm_pcd_cc_next_engine_params_t cc_next_engine_params;
2114 /**< parameters for the next for the defined Key in the
2117 } ioc_fm_pcd_cc_node_modify_next_engine_params_t;
2120 * @Description A structure for remove CC node key
2122 typedef struct ioc_fm_pcd_cc_node_remove_key_params_t {
2124 /**< CC node Id to be used */
2126 /**< Key index for Next Engine Params modifications;
2127 * NOTE: This parameter is IGNORED for miss-key!
2129 } ioc_fm_pcd_cc_node_remove_key_params_t;
2132 * @Description A structure for modifying CC node key and next engine
2134 typedef struct ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t {
2136 /**< CC node Id to be used */
2138 /**< Key index for Next Engine Params modifications;
2139 * NOTE: This parameter is IGNORED for miss-key!
2142 /**< Key size of added key */
2143 ioc_fm_pcd_cc_key_params_t key_params;
2144 /**< it's array with num_of_keys entries each entry in
2145 * the array of the type ioc_fm_pcd_cc_key_params_t
2147 } ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t;
2150 * @Description A structure for modifying CC node key
2152 typedef struct ioc_fm_pcd_cc_node_modify_key_params_t {
2154 /**< CC node Id to be used */
2156 /**< Key index for Next Engine Params modifications;
2157 * NOTE: This parameter is IGNORED for miss-key!
2160 /**< Key size of added key */
2162 /**< Pointer to the key of the size defined in key_size
2165 /**< Pointer to the Mask per key of the size defined in
2166 * key_size. p_key and p_mask (if defined) have to be of
2167 * the same size as defined in the key_size
2169 } ioc_fm_pcd_cc_node_modify_key_params_t;
2172 * @Description A structure with the arguments for the
2173 * fm_pcd_hash_table_remove_key ioctl() call
2175 typedef struct ioc_fm_pcd_hash_table_remove_key_params_t {
2176 void *p_hash_tbl; /**< The id of the hash table */
2177 uint8_t key_size; /**< The size of the key to remove */
2178 uint8_t *p_key; /**< Pointer to the key to remove */
2179 } ioc_fm_pcd_hash_table_remove_key_params_t;
2182 * @Description Parameters for selecting a location for requested manipulation
2184 typedef struct ioc_fm_manip_hdr_info_t {
2185 ioc_net_header_type hdr; /**< Header selection */
2186 ioc_fm_pcd_hdr_index hdr_index;
2187 /**< Relevant only for MPLS, VLAN and tunneled IP.
2188 * Otherwise should be cleared.
2191 /**< TRUE if the location of manipulation is according
2192 * to some field in the specific header
2194 ioc_fm_pcd_fields_u full_field;
2195 /**< Relevant only when by_field = TRUE: Extract field
2197 } ioc_fm_manip_hdr_info_t;
2200 * @Description Parameters for defining header removal by header type
2202 typedef struct ioc_fm_pcd_manip_hdr_rmv_by_hdr_params_t {
2203 ioc_fm_pcd_manip_hdr_rmv_by_hdr_type type;
2204 /**< Selection of header removal location */
2206 ioc_fm_manip_hdr_info_t hdr_info;
2207 /**< Relevant when type = e_FM_PCD_MANIP_RMV_BY_HDR_FROM_START
2209 ioc_fm_pcd_manip_hdr_rmv_specific_l2 specific_l2;
2210 /**< Relevant when type = e_IOC_FM_PCD_MANIP_BY_HDR_SPECIFIC_L2;
2211 * Defines which L2 headers to remove.
2214 } ioc_fm_pcd_manip_hdr_rmv_by_hdr_params_t;
2217 * @Description Parameters for configuring IP fragmentation manipulation
2219 typedef struct ioc_fm_pcd_manip_frag_ip_params_t {
2220 uint16_t size_for_fragmentation;
2221 /**< If length of the frame is greater than this value, IP
2222 * fragmentation will be executed.
2225 /**< Enable a dedicated buffer pool id for the Scatter/Gather
2226 * buffer allocation; If disabled, the Scatter/Gather buffer
2227 * will be allocated from the same pool as the received frame's
2231 /**< Scatter/Gather buffer pool id; This parameter is relevant
2232 * when 'sg_bpid_en=TRUE'; Same LIODN number is used for these
2233 * buffers as for the received frames buffers, so buffers of
2234 * this pool need to be allocated in the same memory area as the
2235 * received buffers. If the received buffers arrive from
2236 * different sources, the Scatter/Gather BP id should be mutual
2237 * to all these sources.
2239 ioc_fm_pcd_manip_donot_frag_action donot_frag_action;
2240 /**< Don't Fragment Action - If an IP packet is larger than MTU
2241 * and its DF bit is set, then this field will determine the
2242 * action to be taken.
2244 } ioc_fm_pcd_manip_frag_ip_params_t;
2247 * @Description Parameters for configuring IP reassembly manipulation.
2249 * This is a common structure for both IPv4 and IPv6 reassembly
2250 * manipulation. For reassembly of both IPv4 and IPv6, make sure
2251 * to set the 'hdr' field in ioc_fm_pcd_manip_reassem_params_t to
2252 * IOC_header_type_ipv_6.
2254 typedef struct ioc_fm_pcd_manip_reassem_ip_params_t {
2255 uint8_t relative_scheme_id[2];
2256 /**< Partition relative scheme id: relativeSchemeId[0] -
2257 * Relative scheme ID for IPV4 Reassembly manipulation;
2258 * relativeSchemeId[1] - Relative scheme ID for IPV6
2259 * Reassembly manipulation; NOTE: The following comment
2260 * is relevant only for FMAN v2 devices: Relative scheme
2261 * ID for IPv4/IPv6 Reassembly manipulation must be
2262 * smaller than the user schemes id to ensure that the
2263 * reassembly's schemes will be first match. The
2264 * remaining schemes, if defined, should have higher
2265 * relative scheme ID.
2267 uint32_t non_consistent_sp_fqid;
2268 /**< In case that other fragments of the frame
2269 * corresponds to different storage profile than the
2270 * opening fragment (Non-Consistent-SP state) then one
2271 * of two possible scenarios occurs: if
2272 * 'nonConsistentSpFqid != 0', the reassembled frame
2273 * will be enqueued to this fqid, otherwise a 'Non
2274 * Consistent SP' bit will be set in the FD[status].
2276 uint8_t data_mem_id;
2277 /**< Memory partition ID for the IPR's external tables
2280 uint16_t data_liodn_offset;
2281 /**< LIODN offset for access the IPR's external tables
2284 uint16_t min_frag_size[2];
2285 /**< Minimum fragment size: minFragSize[0] - for ipv4,
2286 * minFragSize[1] - for ipv6
2288 ioc_fm_pcd_manip_reassem_ways_number num_of_frames_per_hash_entry[2];
2289 /**< Number of frames per hash entry needed for
2290 * reassembly process: num_of_frames_per_hash_entry[0] -
2291 * for ipv4 (max value is
2292 * e_IOC_FM_PCD_MANIP_EIGHT_WAYS_HASH);
2293 * num_of_frames_per_hash_entry[1] - for ipv6 (max value
2294 * is e_IOC_FM_PCD_MANIP_SIX_WAYS_HASH).
2296 uint16_t max_num_frames_in_process;
2297 /**< Number of frames which can be processed by
2298 * Reassembly in the same time; Must be power of 2; In
2299 * the case num_of_frames_per_hash_entry ==
2300 * e_IOC_FM_PCD_MANIP_FOUR_WAYS_HASH,
2301 * max_num_frames_in_process has to be in the range of
2302 * 4 - 512; In the case num_of_frames_per_hash_entry ==
2303 * e_IOC_FM_PCD_MANIP_EIGHT_WAYS_HASH,
2304 * max_num_frames_in_process has to be in the range of
2307 ioc_fm_pcd_manip_reassem_time_out_mode time_out_mode;
2308 /**< Expiration delay initialized by Reassembly process
2310 uint32_t fqid_for_time_out_frames;
2311 /**< FQID in which time out frames will enqueue during
2314 uint32_t timeout_threshold_for_reassm_process;
2315 /**< Represents the time interval in microseconds which
2316 * defines if opened frame (at least one fragment was
2317 * processed but not all the fragments)is found as too
2320 } ioc_fm_pcd_manip_reassem_ip_params_t;
2323 * @Description Parameters for defining IPSEC manipulation
2325 typedef struct ioc_fm_pcd_manip_special_offload_ipsec_params_t {
2327 /**< TRUE if being used in decryption direction;
2328 * FALSE if being used in encryption direction.
2331 /**< TRUE to copy the ECN bits from inner/outer to
2332 * outer/inner (direction depends on the 'decryption'
2336 /**< TRUE to copy the DSCP bits from inner/outer to
2337 * outer/inner (direction depends on the 'decryption'
2340 bool variable_ip_hdr_len;
2341 /**< TRUE for supporting variable IP header length in
2344 bool variable_ip_version;
2345 /**< TRUE for supporting both IP version on the same SA
2348 uint8_t outer_ip_hdr_len;
2349 /**< If 'variable_ip_version == TRUE' than this field
2350 * must be set to non-zero value; It is specifies the
2351 * length of the outer IP header that was configured in
2352 * the corresponding SA.
2355 /**< if <> '0' then will perform ARW check for this SA;
2356 * The value must be a multiplication of 16
2359 /**< if arwSize <> '0' then this field must be set to
2360 * non-zero value; MUST be allocated from FMAN's MURAM
2361 * that the post-sec op-port belong Must be 4B aligned.
2362 * Required MURAM size is
2363 * '(NEXT_POWER_OF_2(arwSize+32))/8+4' Bytes
2365 } ioc_fm_pcd_manip_special_offload_ipsec_params_t;
2368 * @Description Parameters for configuring CAPWAP fragmentation manipulation
2371 * - Maximum number of fragments per frame is 16.
2372 * - Transmit confirmation is not supported.
2373 * - Fragmentation nodes must be set as the last PCD action (i.e.
2374 * the corresponding CC node key must have next engine set to
2376 * - Only BMan buffers shall be used for frames to be fragmented.
2377 * - NOTE: The following comment is relevant only for FMAN v3
2378 * devices: IPF does not support VSP. Therefore, on the same
2379 * port where we have IPF we cannot support VSP.
2381 typedef struct ioc_fm_pcd_manip_frag_capwap_params_t {
2382 uint16_t size_for_fragmentation;
2383 /**< If length of the frame is greater than this value,
2384 * CAPWAP fragmentation will be executed.
2387 /**< Enable a dedicated buffer pool id for the
2388 * Scatter/Gather buffer allocation; If disabled, the
2389 * Scatter/Gather buffer will be allocated from the same
2390 * pool as the received frame's buffer.
2393 /**< Scatter/Gather buffer pool id; This parameters is
2394 * relevant when 'sg_bpidEn=TRUE'; Same LIODN number is
2395 * used for these buffers as for the received frames
2396 * buffers, so buffers of this pool need to be allocated
2397 * in the same memory area as the received buffers. If
2398 * the received buffers arrive from different sources,
2399 * the Scatter/Gather BP id should be mutual to all
2402 bool compress_mode_en;
2403 /**< CAPWAP Header Options Compress Enable mode; When
2404 * this mode is enabled then only the first fragment
2405 * include the CAPWAP header options field (if user
2406 * provides it in the input frame) and all other
2407 * fragments exclude the CAPWAP options field (CAPWAP
2408 * header is updated accordingly).
2410 } ioc_fm_pcd_manip_frag_capwap_params_t;
2413 * @Description Parameters for configuring CAPWAP reassembly manipulation.
2416 * - Application must define one scheme to catch the reassembled
2418 * - Maximum number of fragments per frame is 16.
2420 typedef struct ioc_fm_pcd_manip_reassem_capwap_params_t {
2421 uint8_t relative_scheme_id;
2422 /**< Partition relative scheme id; NOTE: this id must be
2423 * smaller than the user schemes id to ensure that the
2424 * reassembly scheme will be first match; Rest schemes,
2425 * if defined, should have higher relative scheme ID.
2427 uint8_t data_mem_id;
2428 /**< Memory partition ID for the IPR's external tables
2431 uint16_t data_liodn_offset;
2432 /**< LIODN offset for access the IPR's external tables
2435 uint16_t max_reassembled_frame_length;
2436 /**< The maximum CAPWAP reassembled frame length in
2437 * bytes; If maxReassembledFrameLength == 0, any
2438 * successful reassembled frame length is considered as
2439 * a valid length; if maxReassembledFrameLength > 0, a
2440 * successful reassembled frame which its length exceeds
2441 * this value is considered as an error frame (FD
2442 * status[CRE] bit is set).
2444 ioc_fm_pcd_manip_reassem_ways_number num_of_frames_per_hash_entry;
2445 /**< Number of frames per hash entry needed for
2446 * reassembly process
2448 uint16_t max_num_frames_in_process;
2449 /**< Number of frames which can be processed by
2450 * reassembly in the same time; Must be power of 2; In
2451 * the case num_of_frames_per_hash_entry ==
2452 * e_FM_PCD_MANIP_FOUR_WAYS_HASH,
2453 * max_num_frames_in_process has to be in the range of
2454 * 4 - 512; In the case num_of_frames_per_hash_entry ==
2455 * e_FM_PCD_MANIP_EIGHT_WAYS_HASH,
2456 * max_num_frames_in_process has to be in the range of
2459 ioc_fm_pcd_manip_reassem_time_out_mode time_out_mode;
2460 /**< Expiration delay initialized by Reassembly process
2462 uint32_t fqid_for_time_out_frames;
2463 /**< FQID in which time out frames will enqueue during
2464 * Time Out Process; Recommended value for this field is
2465 * 0; in this way timed-out frames will be discarded
2467 uint32_t timeout_threshold_for_reassm_process;
2468 /**< Represents the time interval in microseconds which
2469 * defines if opened frame (at least one fragment was
2470 * processed but not all the fragments)is found as too
2473 } ioc_fm_pcd_manip_reassem_capwap_params_t;
2476 * @Description structure for defining CAPWAP manipulation
2478 typedef struct ioc_fm_pcd_manip_special_offload_capwap_params_t {
2480 /**< TRUE if continue to SEC DTLS encryption */
2481 ioc_fm_pcd_manip_hdr_qos_src qos_src;
2483 } ioc_fm_pcd_manip_special_offload_capwap_params_t;
2486 * @Description Parameters for defining special offload manipulation
2488 typedef struct ioc_fm_pcd_manip_special_offload_params_t {
2489 ioc_fm_pcd_manip_special_offload_type type;
2490 /**< Type of special offload manipulation */
2492 ioc_fm_pcd_manip_special_offload_ipsec_params_t ipsec;
2493 /**< Parameters for IPSec; Relevant when type =
2494 * e_IOC_FM_PCD_MANIP_SPECIAL_OFFLOAD_IPSEC
2497 ioc_fm_pcd_manip_special_offload_capwap_params_t capwap;
2498 /**< Parameters for CAPWAP; Relevant when type =
2499 * e_FM_PCD_MANIP_SPECIAL_OFFLOAD_CAPWAP
2502 } ioc_fm_pcd_manip_special_offload_params_t;
2505 * @Description Parameters for defining generic removal manipulation
2507 typedef struct ioc_fm_pcd_manip_hdr_rmv_generic_params_t {
2509 /**< Offset from beginning of header to the start location of
2512 uint8_t size; /**< Size of removed section */
2513 } ioc_fm_pcd_manip_hdr_rmv_generic_params_t;
2516 * @Description Parameters for defining insertion manipulation
2518 typedef struct ioc_fm_pcd_manip_hdr_insrt_t {
2519 uint8_t size; /**< size of inserted section */
2520 uint8_t *p_data; /**< data to be inserted */
2521 } ioc_fm_pcd_manip_hdr_insrt_t;
2524 * @Description Parameters for defining generic insertion manipulation
2526 typedef struct ioc_fm_pcd_manip_hdr_insrt_generic_params_t {
2528 /**< Offset from beginning of header to the start
2529 * location of the insertion
2531 uint8_t size; /**< Size of inserted section */
2533 /**< TRUE to override (replace) existing data at
2534 * 'offset', FALSE to insert
2537 /**< Pointer to data to be inserted */
2538 } ioc_fm_pcd_manip_hdr_insrt_generic_params_t;
2541 * @Description Parameters for defining header manipulation VLAN DSCP To Vpri
2544 typedef struct ioc_fm_pcd_manip_hdr_field_update_vlan_dscp_to_vpri_t {
2545 uint8_t dscp_to_vpri_table[IOC_FM_PCD_MANIP_DSCP_TO_VLAN_TRANS];
2546 /**< A table of VPri values for each DSCP value; The index is
2547 * the D_SCP value (0-0x3F) and the value is the corresponding
2550 uint8_t vpri_def_val;
2551 /**< 0-7, Relevant only if update_type =
2552 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_DSCP_TO_VLAN, this field
2553 * is the Q Tag default value if the IP header is not found.
2555 } ioc_fm_pcd_manip_hdr_field_update_vlan_dscp_to_vpri_t;
2558 * @Description Parameters for defining header manipulation VLAN fields
2561 typedef struct ioc_fm_pcd_manip_hdr_field_update_vlan_t {
2562 ioc_fm_pcd_manip_hdr_field_update_vlan update_type;
2563 /**< Selects VLAN update type */
2566 /**< 0-7, Relevant only if If update_type =
2567 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_VLAN_PRI, this is the new
2570 ioc_fm_pcd_manip_hdr_field_update_vlan_dscp_to_vpri_t dscp_to_vpri;
2571 /**< Parameters structure, Relevant only if update_type =
2572 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_DSCP_TO_VLAN.
2575 } ioc_fm_pcd_manip_hdr_field_update_vlan_t;
2578 * @Description Parameters for defining header manipulation IPV4 fields
2581 typedef struct ioc_fm_pcd_manip_hdr_field_update_ipv4_t {
2582 ioc_ipv4_hdr_manip_update_flags_t valid_updates;
2583 /**< ORed flag, selecting the required updates */
2585 /**< 8 bit New TOS; Relevant if valid_updates contains
2586 * IOC_HDR_MANIP_IPV4_TOS
2589 /**< 16 bit New IP ID; Relevant only if
2590 * valid_updates contains IOC_HDR_MANIP_IPV4_ID
2593 /**< 32 bit New IP SRC; Relevant only if
2594 * valid_updates contains IOC_HDR_MANIP_IPV4_SRC
2597 /**< 32 bit New IP DST; Relevant only if
2598 * valid_updates contains IOC_HDR_MANIP_IPV4_DST
2600 } ioc_fm_pcd_manip_hdr_field_update_ipv4_t;
2603 * @Description Parameters for defining header manipulation IPV6 fields
2606 typedef struct ioc_fm_pcd_manip_hdr_field_update_ipv6_t {
2607 ioc_ipv6_hdr_manip_update_flags_t valid_updates;
2608 /**< ORed flag, selecting the required updates */
2609 uint8_t traffic_class;
2610 /**< 8 bit New Traffic Class; Relevant if valid_updates
2611 * contains IOC_HDR_MANIP_IPV6_TC
2613 uint8_t src[ioc_net_hf_ipv6_addr_size];
2614 /**< 16 byte new IP SRC; Relevant only if valid_updates
2615 * contains IOC_HDR_MANIP_IPV6_SRC
2617 uint8_t dst[ioc_net_hf_ipv6_addr_size];
2618 /**< 16 byte new IP DST; Relevant only if valid_updates
2619 * contains IOC_HDR_MANIP_IPV6_DST
2621 } ioc_fm_pcd_manip_hdr_field_update_ipv6_t;
2624 * @Description Parameters for defining header manipulation TCP/UDP fields
2627 typedef struct ioc_fm_pcd_manip_hdr_field_update_tcp_udp_t {
2628 ioc_tcp_udp_hdr_manip_update_flags_t valid_updates;
2629 /**< ORed flag, selecting the required updates */
2631 /**< 16 bit New TCP/UDP SRC; Relevant only if
2632 * valid_updates contains IOC_HDR_MANIP_TCP_UDP_SRC
2635 /**< 16 bit New TCP/UDP DST; Relevant only if
2636 * valid_updates contains IOC_HDR_MANIP_TCP_UDP_DST
2638 } ioc_fm_pcd_manip_hdr_field_update_tcp_udp_t;
2641 * @Description Parameters for defining header manipulation fields updates
2643 typedef struct ioc_fm_pcd_manip_hdr_field_update_params_t {
2644 ioc_fm_pcd_manip_hdr_field_update_type type;
2645 /**< Type of header field update manipulation */
2647 ioc_fm_pcd_manip_hdr_field_update_vlan_t vlan;
2648 /**< Parameters for VLAN update. Relevant when type =
2649 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_VLAN
2651 ioc_fm_pcd_manip_hdr_field_update_ipv4_t ipv4;
2652 /**< Parameters for IPv4 update. Relevant when type =
2653 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_IPV4
2655 ioc_fm_pcd_manip_hdr_field_update_ipv6_t ipv6;
2656 /**< Parameters for IPv6 update. Relevant when type =
2657 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_IPV6
2659 ioc_fm_pcd_manip_hdr_field_update_tcp_udp_t tcp_udp;
2660 /**< Parameters for TCP/UDP update. Relevant when type =
2661 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_TCP_UDP
2664 } ioc_fm_pcd_manip_hdr_field_update_params_t;
2667 * @Description Parameters for defining custom header manipulation for IP
2670 typedef struct ioc_fm_pcd_manip_hdr_custom_ip_hdr_replace_t {
2671 ioc_fm_pcd_manip_hdr_custom_ip_replace replace_type;
2672 /**< Selects replace update type */
2674 /**< Decrement TTL (IPV4) or Hop limit (IPV6) by 1 */
2675 bool update_ipv4_id;
2676 /**< Relevant when replace_type =
2677 * e_IOC_FM_PCD_MANIP_HDR_CUSTOM_REPLACE_IPV6_BY_IPV4
2680 /**< 16 bit New IP ID; Relevant only if update_ipv4_id = TRUE */
2682 /**< The size of the new IP header */
2683 uint8_t hdr[IOC_FM_PCD_MANIP_MAX_HDR_SIZE];
2684 /**< The new IP header */
2685 } ioc_fm_pcd_manip_hdr_custom_ip_hdr_replace_t;
2688 * @Description Parameters for defining custom header manipulation
2690 typedef struct ioc_fm_pcd_manip_hdr_custom_params_t {
2691 ioc_fm_pcd_manip_hdr_custom_type type;
2692 /**< Type of header field update manipulation */
2694 ioc_fm_pcd_manip_hdr_custom_ip_hdr_replace_t ip_hdr_replace;
2695 /**< Parameters IP header replacement */
2697 } ioc_fm_pcd_manip_hdr_custom_params_t;
2700 * @Description Parameters for defining specific L2 insertion manipulation
2702 typedef struct ioc_fm_pcd_manip_hdr_insrt_specific_l2_params_t {
2703 ioc_fm_pcd_manip_hdr_insrt_specific_l2 specific_l2;
2704 /**< Selects which L2 headers to insert */
2706 /**< TRUE to update MPLS header */
2708 /**< size of inserted section */
2710 /**< data to be inserted */
2711 } ioc_fm_pcd_manip_hdr_insrt_specific_l2_params_t;
2714 * @Description Parameters for defining IP insertion manipulation
2716 typedef struct ioc_fm_pcd_manip_hdr_insrt_ip_params_t {
2717 bool calc_l4_checksum;
2718 /**< Calculate L4 checksum. */
2719 ioc_fm_pcd_manip_hdr_qos_mapping_mode mapping_mode;
2721 uint8_t last_pid_offset;
2722 /**< the offset of the last Protocol within the inserted
2725 uint16_t id; /**< 16 bit New IP ID */
2726 bool donot_frag_overwrite;
2727 /**< IPv4 only. DF is overwritten with the hash-result
2728 * next-to-last byte. This byte is configured to be
2729 * overwritten when RPD is set.
2731 uint8_t last_dst_offset;
2732 /**< IPv6 only. if routing extension exist, user should
2733 * set the offset of the destination address in order
2734 * to calculate UDP checksum pseudo header; Otherwise
2737 ioc_fm_pcd_manip_hdr_insrt_t insrt;
2738 /**< size and data to be inserted. */
2739 } ioc_fm_pcd_manip_hdr_insrt_ip_params_t;
2742 * @Description Parameters for defining header insertion manipulation by
2745 typedef struct ioc_fm_pcd_manip_hdr_insrt_by_hdr_params_t {
2746 ioc_fm_pcd_manip_hdr_insrt_by_hdr_type type;
2747 /**< Selects manipulation type */
2749 ioc_fm_pcd_manip_hdr_insrt_specific_l2_params_t specific_l2_params;
2750 /**< Used when type =
2751 * e_IOC_FM_PCD_MANIP_INSRT_BY_HDR_SPECIFIC_L2: Selects
2752 * which L2 headers to remove
2754 ioc_fm_pcd_manip_hdr_insrt_ip_params_t ip_params;
2755 /**< Used when type = e_FM_PCD_MANIP_INSRT_BY_HDR_IP */
2756 ioc_fm_pcd_manip_hdr_insrt_t insrt;
2757 /**< Used when type is one of
2758 * e_FM_PCD_MANIP_INSRT_BY_HDR_UDP,
2759 * e_FM_PCD_MANIP_INSRT_BY_HDR_UDP_LITE, or
2760 * e_FM_PCD_MANIP_INSRT_BY_HDR_CAPWAP
2763 } ioc_fm_pcd_manip_hdr_insrt_by_hdr_params_t;
2766 * @Description Parameters for defining header insertion manipulation
2768 typedef struct ioc_fm_pcd_manip_hdr_insrt_params_t {
2769 ioc_fm_pcd_manip_hdr_insrt_type type;
2770 /**< Type of insertion manipulation */
2772 ioc_fm_pcd_manip_hdr_insrt_by_hdr_params_t by_hdr;
2773 /**< Parameters for defining header insertion
2774 * manipulation by header type, relevant if 'type' =
2775 * e_IOC_FM_PCD_MANIP_INSRT_BY_HDR
2777 ioc_fm_pcd_manip_hdr_insrt_generic_params_t generic;
2778 /**< Parameters for defining generic header insertion
2779 * manipulation, relevant if type =
2780 * e_IOC_FM_PCD_MANIP_INSRT_GENERIC
2783 } ioc_fm_pcd_manip_hdr_insrt_params_t;
2786 * @Description Parameters for defining header removal manipulation
2788 typedef struct ioc_fm_pcd_manip_hdr_rmv_params_t {
2789 ioc_fm_pcd_manip_hdr_rmv_type type;
2790 /**< Type of header removal manipulation */
2792 ioc_fm_pcd_manip_hdr_rmv_by_hdr_params_t by_hdr;
2793 /**< Parameters for defining header removal manipulation
2794 * by header type, relevant if type =
2795 * e_IOC_FM_PCD_MANIP_RMV_BY_HDR
2797 ioc_fm_pcd_manip_hdr_rmv_generic_params_t generic;
2798 /**< Parameters for defining generic header removal
2799 * manipulation, relevant if type =
2800 * e_IOC_FM_PCD_MANIP_RMV_GENERIC
2803 } ioc_fm_pcd_manip_hdr_rmv_params_t;
2806 * @Description Parameters for defining header manipulation node
2808 typedef struct ioc_fm_pcd_manip_hdr_params_t {
2810 /**< TRUE, to define removal manipulation */
2811 ioc_fm_pcd_manip_hdr_rmv_params_t rmv_params;
2812 /**< Parameters for removal manipulation, relevant if
2817 /**< TRUE, to define insertion manipulation */
2818 ioc_fm_pcd_manip_hdr_insrt_params_t insrt_params;
2819 /**< Parameters for insertion manipulation, relevant if
2824 /**< TRUE, to define field update manipulation */
2825 ioc_fm_pcd_manip_hdr_field_update_params_t field_update_params;
2826 /**< Parameters for field update manipulation, relevant
2827 * if 'fieldUpdate' = TRUE
2831 /**< TRUE, to define custom manipulation */
2832 ioc_fm_pcd_manip_hdr_custom_params_t custom_params;
2833 /**< Parameters for custom manipulation, relevant if
2837 bool donot_parse_after_manip;
2838 /**< FALSE to activate the parser a second time after
2839 * completing the manipulation on the frame
2841 } ioc_fm_pcd_manip_hdr_params_t;
2844 * @Description structure for defining fragmentation manipulation
2846 typedef struct ioc_fm_pcd_manip_frag_params_t {
2847 ioc_net_header_type hdr;
2848 /**< Header selection */
2850 ioc_fm_pcd_manip_frag_capwap_params_t capwap_frag;
2851 /**< Parameters for defining CAPWAP fragmentation,
2852 * relevant if 'hdr' = HEADER_TYPE_CAPWAP
2854 ioc_fm_pcd_manip_frag_ip_params_t ip_frag;
2855 /**< Parameters for defining IP fragmentation, relevant
2856 * if 'hdr' = HEADER_TYPE_Ipv4 or HEADER_TYPE_Ipv6
2859 } ioc_fm_pcd_manip_frag_params_t;
2862 * @Description structure for defining reassemble manipulation
2864 typedef struct ioc_fm_pcd_manip_reassem_params_t {
2865 ioc_net_header_type hdr;
2866 /**< Header selection */
2868 ioc_fm_pcd_manip_reassem_capwap_params_t capwap_reassem;
2869 /**< Parameters for defining CAPWAP reassembly, relevant
2870 * if 'hdr' = HEADER_TYPE_CAPWAP
2872 ioc_fm_pcd_manip_reassem_ip_params_t ip_reassem;
2873 /**< Parameters for defining IP reassembly, relevant if
2874 * 'hdr' = HEADER_TYPE_Ipv4 or HEADER_TYPE_Ipv6
2877 } ioc_fm_pcd_manip_reassem_params_t;
2880 * @Description Parameters for defining a manipulation node
2882 struct fm_pcd_manip_params_t {
2883 ioc_fm_pcd_manip_type type;
2884 /**< Selects type of manipulation node */
2886 ioc_fm_pcd_manip_hdr_params_t hdr;
2887 /**< Parameters for defining header manipulation node */
2888 ioc_fm_pcd_manip_reassem_params_t reassem;
2889 /**< Parameters for defining reassembly manipulation
2892 ioc_fm_pcd_manip_frag_params_t frag;
2893 /**< Parameters for defining fragmentation manipulation
2896 ioc_fm_pcd_manip_special_offload_params_t special_offload;
2897 /**< Parameters for defining special offload
2902 /**< Handle to another (previously defined) manipulation node;
2903 * Allows concatenation of manipulation actions. This parameter
2904 * is optional and may be NULL.
2908 typedef struct ioc_fm_pcd_manip_params_t {
2909 struct fm_pcd_manip_params_t param;
2911 } ioc_fm_pcd_manip_params_t;
2914 * @Description Structure for retrieving IP reassembly statistics
2916 typedef struct ioc_fm_pcd_manip_reassem_ip_stats_t {
2917 /* common counters for both IPv4 and IPv6 */
2919 /**< Counts the number of TimeOut occurrences */
2920 uint32_t rfd_pool_busy;
2921 /**< Counts the number of failed attempts to allocate a
2922 * Reassembly Frame Descriptor
2924 uint32_t internal_buffer_busy;
2925 /**< Counts the number of times an internal buffer busy occurred
2927 uint32_t external_buffer_busy;
2928 /**< Counts the number of times external buffer busy occurred */
2929 uint32_t sg_fragments;
2930 /**< Counts the number of Scatter/Gather fragments */
2931 uint32_t dma_semaphore_depletion;
2932 /**< Counts the number of failed attempts to allocate a DMA
2935 uint32_t non_consistent_sp;
2936 /**< Counts the number of Non Consistent Storage Profile events
2937 * for successfully reassembled frames
2940 uint32_t successfully_reassembled;
2941 /**< Counts the number of successfully reassembled frames */
2942 uint32_t valid_fragments;
2943 /**< Counts the total number of valid fragments that have been
2944 * processed for all frames
2946 uint32_t processed_fragments;
2947 /**< Counts the number of processed fragments (valid and error
2948 * fragments) for all frames
2950 uint32_t malformed_fragments;
2951 /**< Counts the number of malformed fragments processed for all
2954 uint32_t discarded_fragments;
2955 /**< Counts the number of fragments discarded by the reassembly
2958 uint32_t auto_learn_busy;
2959 /**< Counts the number of times a busy condition occurs when
2960 * attempting to access an IP-Reassembly Automatic Learning Hash
2963 uint32_t more_than16fragments;
2964 /**< Counts the fragment occurrences in which the number of
2965 * fragments-per-frame exceeds 16
2967 } specific_hdr_statistics[2];
2968 /**< slot '0' is for IPv4, slot '1' is for IPv6 */
2969 } ioc_fm_pcd_manip_reassem_ip_stats_t;
2972 * @Description Structure for retrieving IP fragmentation statistics
2974 typedef struct ioc_fm_pcd_manip_frag_ip_stats_t {
2975 uint32_t total_frames;
2976 /**< Number of frames that passed through the
2979 uint32_t fragmented_frames;
2980 /**< Number of frames that were fragmented */
2981 uint32_t generated_fragments;
2982 /**< Number of fragments that were generated */
2983 } ioc_fm_pcd_manip_frag_ip_stats_t;
2986 * @Description Structure for retrieving CAPWAP reassembly statistics
2988 typedef struct ioc_fm_pcd_manip_reassem_capwap_stats_t {
2990 /**< Counts the number of timeout occurrences */
2991 uint32_t rfd_pool_busy;
2992 /**< Counts the number of failed attempts to allocate a
2993 * Reassembly Frame Descriptor
2995 uint32_t internal_buffer_busy;
2996 /**< Counts the number of times an internal buffer busy
2999 uint32_t external_buffer_busy;
3000 /**< Counts the number of times external buffer busy
3003 uint32_t sg_fragments;
3004 /**< Counts the number of Scatter/Gather fragments */
3005 uint32_t dma_semaphore_depletion;
3006 /**< Counts the number of failed attempts to allocate a
3009 uint32_t successfully_reassembled;
3010 /**< Counts the number of successfully reassembled
3013 uint32_t valid_fragments;
3014 /**< Counts the total number of valid fragments that
3015 * have been processed for all frames
3017 uint32_t processed_fragments;
3018 /**< Counts the number of processed fragments (valid and
3019 * error fragments) for all frames
3021 uint32_t malformed_fragments;
3022 /**< Counts the number of malformed fragments processed
3025 uint32_t auto_learn_busy;
3026 /**< Counts the number of times a busy condition occurs
3027 * when attempting to access an Reassembly Automatic
3030 uint32_t discarded_fragments;
3031 /**< Counts the number of fragments discarded by the
3032 * reassembly process
3034 uint32_t more_than16fragments;
3035 /**< Counts the fragment occurrences in which the number
3036 * of fragments-per-frame exceeds 16
3038 uint32_t exceed_max_reassembly_frame_len;
3039 /**< ounts the number of times that a successful
3040 * reassembled frame length exceeds
3041 * MaxReassembledFrameLength value
3043 } ioc_fm_pcd_manip_reassem_capwap_stats_t;
3046 * @Description Structure for retrieving CAPWAP fragmentation statistics
3048 typedef struct ioc_fm_pcd_manip_frag_capwap_stats_t {
3049 uint32_t total_frames;
3050 /**< Number of frames that passed through the
3053 uint32_t fragmented_frames;
3054 /**< Number of frames that were fragmented */
3055 uint32_t generated_fragments;
3056 /**< Number of fragments that were generated */
3057 #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0))
3058 uint8_t sg_allocation_failure;
3059 /**< Number of allocation failure of s/g buffers */
3060 #endif /* (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) */
3061 } ioc_fm_pcd_manip_frag_capwap_stats_t;
3064 * @Description Structure for retrieving reassembly statistics
3066 typedef struct ioc_fm_pcd_manip_reassem_stats_t {
3068 ioc_fm_pcd_manip_reassem_ip_stats_t ip_reassem;
3069 /**< Structure for IP reassembly statistics */
3070 ioc_fm_pcd_manip_reassem_capwap_stats_t capwap_reassem;
3071 /**< Structure for CAPWAP reassembly statistics */
3073 } ioc_fm_pcd_manip_reassem_stats_t;
3076 * @Description structure for retrieving fragmentation statistics
3078 typedef struct ioc_fm_pcd_manip_frag_stats_t {
3080 ioc_fm_pcd_manip_frag_ip_stats_t ip_frag;
3081 /**< Structure for IP fragmentation statistics */
3082 ioc_fm_pcd_manip_frag_capwap_stats_t capwap_frag;
3083 /**< Structure for CAPWAP fragmentation statistics */
3085 } ioc_fm_pcd_manip_frag_stats_t;
3088 * @Description structure for defining manipulation statistics
3090 typedef struct ioc_fm_pcd_manip_stats_t {
3092 ioc_fm_pcd_manip_reassem_stats_t reassem;
3093 /**< Structure for reassembly statistics */
3094 ioc_fm_pcd_manip_frag_stats_t frag;
3095 /**< Structure for fragmentation statistics */
3097 } ioc_fm_pcd_manip_stats_t;
3100 * @Description Parameters for acquiring manipulation statistics
3102 typedef struct ioc_fm_pcd_manip_get_stats_t {
3104 ioc_fm_pcd_manip_stats_t stats;
3105 } ioc_fm_pcd_manip_get_stats_t;
3108 * @Description Parameters for defining frame replicator group and its members
3110 struct fm_pcd_frm_replic_group_params_t {
3111 uint8_t max_num_of_entries;
3112 /**< Maximal number of members in the group -
3113 * must be at least two
3115 uint8_t num_of_entries;
3116 /**< Number of members in the group - must be at
3119 ioc_fm_pcd_cc_next_engine_params_t
3120 next_engine_params[IOC_FM_PCD_FRM_REPLIC_MAX_NUM_OF_ENTRIES];
3121 /**< Array of members' parameters */
3124 typedef struct ioc_fm_pcd_frm_replic_group_params_t {
3125 struct fm_pcd_frm_replic_group_params_t param;
3127 } ioc_fm_pcd_frm_replic_group_params_t;
3129 typedef struct ioc_fm_pcd_frm_replic_member_t {
3130 void *h_replic_group;
3131 uint16_t member_index;
3132 } ioc_fm_pcd_frm_replic_member_t;
3134 typedef struct ioc_fm_pcd_frm_replic_member_params_t {
3135 ioc_fm_pcd_frm_replic_member_t member;
3136 ioc_fm_pcd_cc_next_engine_params_t next_engine_params;
3137 } ioc_fm_pcd_frm_replic_member_params_t;
3140 typedef struct ioc_fm_pcd_cc_key_statistics_t {
3141 uint32_t byte_count;
3142 /**< This counter reflects byte count of frames that
3143 * were matched by this key.
3145 uint32_t frame_count;
3146 /**< This counter reflects count of frames that were
3147 * matched by this key.
3149 uint32_t frame_length_range_count[IOC_FM_PCD_CC_STATS_MAX_FLR];
3150 /**< These counters reflect how many frames matched this
3151 * key in 'RMON' statistics mode: Each counter holds the
3152 * number of frames of a specific frames length range,
3153 * according to the ranges provided at initialization.
3155 } ioc_fm_pcd_cc_key_statistics_t;
3158 typedef struct ioc_fm_pcd_cc_tbl_get_stats_t {
3161 ioc_fm_pcd_cc_key_statistics_t statistics;
3162 } ioc_fm_pcd_cc_tbl_get_stats_t;
3165 * @Function fm_pcd_match_table_get_key_statistics
3167 * @Description This routine may be used to get statistics counters of
3168 * specific key in a CC Node.
3170 * If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
3171 * 'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
3172 * node, these counters reflect how many frames passed that were
3173 * matched this key; The total frames count will be returned in
3174 * the counter of the first range (as only one frame length range
3175 * was defined). If 'e_FM_PCD_CC_STATS_MODE_RMON' was set for
3176 * this node, the total frame count will be separated to frame
3177 * length counters, based on provided frame length ranges.
3179 * @Param[in] h_cc_node A handle to the node
3180 * @Param[in] key_index Key index for adding
3181 * @Param[out] p_key_statistics Key statistics counters
3183 * @Return The specific key statistics.
3185 * @Cautions Allowed only following fm_pcd_match_table_set().
3187 #define FM_PCD_IOC_MATCH_TABLE_GET_KEY_STAT \
3188 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(12), \
3189 ioc_fm_pcd_cc_tbl_get_stats_t)
3192 * @Function fm_pcd_match_table_get_miss_statistics
3194 * @Description This routine may be used to get statistics counters of miss
3195 * entry in a CC Node.
3197 * If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
3198 * 'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
3199 * node, these counters reflect how many frames were not matched
3200 * to any existing key and therefore passed through the miss
3201 * entry; The total frames count will be returned in the counter
3202 * of the first range (as only one frame length range was
3205 * @Param[in] h_cc_node A handle to the node
3206 * @Param[out] p_miss_statistics Statistics counters for 'miss'
3208 * @Return E_OK on success; Error code otherwise.
3210 * @Cautions Allowed only following fm_pcd_match_table_set().
3213 #define FM_PCD_IOC_MATCH_TABLE_GET_MISS_STAT \
3214 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(13), \
3215 ioc_fm_pcd_cc_tbl_get_stats_t)
3218 * @Function fm_pcd_hash_table_get_miss_statistics
3220 * @Description This routine may be used to get statistics counters of 'miss'
3221 * entry of the a hash table.
3223 * If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
3224 * 'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
3225 * node, these counters reflect how many frames were not matched
3226 * to any existing key and therefore passed through the miss
3229 * @Param[in] h_hash_tbl A handle to a hash table
3230 * @Param[out] p_miss_statistics Statistics counters for 'miss'
3232 * @Return E_OK on success; Error code otherwise.
3234 * @Cautions Allowed only following fm_pcd_hash_table_set().
3236 #define FM_PCD_IOC_HASH_TABLE_GET_MISS_STAT \
3237 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(14), \
3238 ioc_fm_pcd_cc_tbl_get_stats_t)
3241 * @Function fm_pcd_net_env_characteristics_set
3243 * @Description Define a set of Network Environment Characteristics.
3245 * When setting an environment it is important to understand its
3246 * application. It is not meant to describe the flows that will
3247 * run on the ports using this environment, but what the user
3248 * means TO DO with the PCD mechanisms in order to
3249 * parse-classify-distribute those frames.
3250 * By specifying a distinction unit, the user means it would use
3251 * that option for distinction between frames at either a KeyGen
3252 * scheme or a coarse classification action descriptor. Using
3253 * interchangeable headers to define a unit means that the user
3254 * is indifferent to which of the interchangeable headers is
3255 * present in the frame, and wants the distinction to be based on
3256 * the presence of either one of them.
3258 * Depending on context, there are limitations to the use of
3259 * environments. A port using the PCD functionality is bound to
3260 * an environment. Some or even all ports may share an
3261 * environment but also an environment per port is possible. When
3262 * initializing a scheme, a classification plan group (see
3263 * below), or a coarse classification tree, one of the
3264 * initialized environments must be stated and related to. When a
3265 * port is bound to a scheme, a classification plan group, or a
3266 * coarse classification tree, it MUST be bound to the same
3269 * The different PCD modules, may relate (for flows definition)
3270 * ONLY on distinction units as defined by their environment.
3271 * When initializing a scheme for example, it may not choose to
3272 * select IPV4 as a match for recognizing flows unless it was
3273 * defined in the relating environment. In fact, to guide the
3274 * user through the configuration of the PCD, each module's
3275 * characterization in terms of flows is not done using protocol
3276 * names, but using environment indexes.
3278 * In terms of HW implementation, the list of distinction units
3279 * sets the LCV vectors and later used for match vector,
3280 * classification plan vectors and coarse classification
3283 * @Param[in,out] ioc_fm_pcd_net_env_params_t A structure defining the
3284 * distinction units for this
3287 * @Return 0 on success; Error code otherwise.
3289 #define FM_PCD_IOC_NET_ENV_CHARACTERISTICS_SET \
3290 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(20), \
3291 ioc_fm_pcd_net_env_params_t)
3294 * @Function fm_pcd_net_env_characteristics_delete
3296 * @Description Deletes a set of Network Environment Charecteristics.
3298 * @Param[in] ioc_fm_obj_t The id of a Network Environment object.
3300 * @Return 0 on success; Error code otherwise.
3302 #define FM_PCD_IOC_NET_ENV_CHARACTERISTICS_DELETE \
3303 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(21), ioc_fm_obj_t)
3306 * @Function fm_pcd_kg_scheme_set
3308 * @Description Initializing or modifying and enabling a scheme for the
3309 * KeyGen. This routine should be called for adding or modifying
3310 * a scheme. When a scheme needs modifying, the API requires that
3311 * it will be rewritten. In such a case 'modify' should be TRUE.
3312 * If the routine is called for a valid scheme and 'modify' is
3313 * FALSE, it will return error.
3315 * @Param[in,out] ioc_fm_pcd_kg_scheme_params_t A structure of
3316 * parameters for defining
3319 * @Return 0 on success; Error code otherwise.
3321 #define FM_PCD_IOC_KG_SCHEME_SET \
3322 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(24), \
3323 ioc_fm_pcd_kg_scheme_params_t)
3326 * @Function fm_pcd_kg_scheme_delete
3328 * @Description Deleting an initialized scheme.
3330 * @Param[in] ioc_fm_obj_t scheme id as initialized by application at
3331 * FM_PCD_IOC_KG_SET_SCHEME
3333 * @Return 0 on success; Error code otherwise.
3335 #define FM_PCD_IOC_KG_SCHEME_DELETE \
3336 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(25), ioc_fm_obj_t)
3339 * @Function fm_pcd_cc_root_build
3341 * @Description This routine must be called to define a complete coarse
3342 * classification tree. This is the way to define coarse
3343 * classification to a certain flow - the KeyGen schemes may
3344 * point only to trees defined in this way.
3346 * @Param[in,out] ioc_fm_pcd_cc_tree_params_t A structure of parameters to
3349 * @Return 0 on success; Error code otherwise.
3351 #define FM_PCD_IOC_CC_ROOT_BUILD \
3352 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(26), void *)
3356 * @Function fm_pcd_cc_root_delete
3358 * @Description Deleting a built tree.
3360 * @Param[in] ioc_fm_obj_t - The id of a CC tree.
3362 #define FM_PCD_IOC_CC_ROOT_DELETE \
3363 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(27), ioc_fm_obj_t)
3366 * @Function fm_pcd_match_table_set
3368 * @Description This routine should be called for each CC (coarse
3369 * classification) node. The whole CC tree should be built bottom
3370 * up so that each node points to already defined nodes. p_NodeId
3371 * returns the node Id to be used by other nodes.
3373 * @Param[in,out] ioc_fm_pcd_cc_node_params_t A structure for defining the CC
3376 * @Return 0 on success; Error code otherwise.
3378 #define FM_PCD_IOC_MATCH_TABLE_SET \
3379 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(28), void *)
3383 * @Function fm_pcd_match_table_delete
3385 * @Description Deleting a built node.
3387 * @Param[in] ioc_fm_obj_t - The id of a CC node.
3389 * @Return 0 on success; Error code otherwise.
3391 #define FM_PCD_IOC_MATCH_TABLE_DELETE \
3392 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(29), ioc_fm_obj_t)
3395 * @Function fm_pcd_cc_root_modify_next_engine
3397 * @Description Modify the Next Engine Parameters in the entry of the tree.
3399 * @Param[in] ioc_fm_pcd_cc_tree_modify_next_engine_params_t
3400 * Pointer to a structure with the relevant parameters
3402 * @Return 0 on success; Error code otherwise.
3404 * @Cautions Allowed only following fm_pcd_cc_root_build().
3406 #define FM_PCD_IOC_CC_ROOT_MODIFY_NEXT_ENGINE \
3407 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(30), \
3408 ioc_fm_pcd_cc_tree_modify_next_engine_params_t)
3411 * @Function fm_pcd_match_table_modify_next_engine
3413 * @Description Modify the Next Engine Parameters in the relevant key entry of
3416 * @Param[in] ioc_fm_pcd_cc_node_modify_next_engine_params_t
3417 * A pointer to a structure with the relevant parameters
3419 * @Return 0 on success; Error code otherwise.
3421 * @Cautions Allowed only following fm_pcd_match_table_set().
3423 #define FM_PCD_IOC_MATCH_TABLE_MODIFY_NEXT_ENGINE \
3424 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(31), \
3425 ioc_fm_pcd_cc_node_modify_next_engine_params_t)
3428 * @Function fm_pcd_match_table_modify_miss_next_engine
3430 * @Description Modify the Next Engine Parameters of the Miss key case of the
3433 * @Param[in] ioc_fm_pcd_cc_node_modify_next_engine_params_t
3434 * Pointer to a structure with the relevant parameters
3436 * @Return 0 on success; Error code otherwise.
3438 * @Cautions Allowed only following fm_pcd_match_table_set().
3440 #define FM_PCD_IOC_MATCH_TABLE_MODIFY_MISS_NEXT_ENGINE \
3441 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(32), \
3442 ioc_fm_pcd_cc_node_modify_next_engine_params_t)
3445 * @Function fm_pcd_match_table_remove_key
3447 * @Description Remove the key (including next engine parameters of this key)
3448 * defined by the index of the relevant node.
3450 * @Param[in] ioc_fm_pcd_cc_node_remove_key_params_t
3451 * A pointer to a structure with the relevant parameters
3453 * @Return 0 on success; Error code otherwise.
3455 * @Cautions Allowed only after fm_pcd_match_table_set() has been called
3456 * for this node and for all of the nodes that lead to it.
3458 #define FM_PCD_IOC_MATCH_TABLE_REMOVE_KEY \
3459 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(33), \
3460 ioc_fm_pcd_cc_node_remove_key_params_t)
3463 * @Function fm_pcd_match_table_add_key
3465 * @Description Add the key (including next engine parameters of this key in
3466 * the index defined by the key_index. Note that
3467 * 'FM_PCD_LAST_KEY_INDEX' may be used when the user don't care
3468 * about the position of the key in the table - in that case, the
3469 * key will be automatically added by the driver in the last
3472 * @Param[in] ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t
3473 * A pointer to a structure with the relevant parameters
3475 * @Return 0 on success; Error code otherwise.
3477 * @Cautions Allowed only after fm_pcd_match_table_set() has been called
3478 * for this node and for all of the nodes that lead to it.
3480 #define FM_PCD_IOC_MATCH_TABLE_ADD_KEY \
3481 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(34), \
3482 ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t)
3485 * @Function fm_pcd_match_table_modify_key_and_next_engine
3487 * @Description Modify the key and Next Engine Parameters of this key in the
3488 * index defined by key_index.
3490 * @Param[in] ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t
3491 * A pointer to a structure with the relevant parameters
3493 * @Return 0 on success; Error code otherwise.
3495 * @Cautions Allowed only following fm_pcd_match_table_set() not only of
3496 * the relevnt node but also the node that points to this node.
3498 #define FM_PCD_IOC_MATCH_TABLE_MODIFY_KEY_AND_NEXT_ENGINE \
3499 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(35), \
3500 ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t)
3503 * @Function fm_pcd_match_table_modify_key
3505 * @Description Modify the key at the index defined by key_index.
3507 * @Param[in] ioc_fm_pcd_cc_node_modify_key_params_t - Pointer to a
3508 * structure with the relevant parameters
3510 * @Return 0 on success; Error code otherwise.
3512 * @Cautions Allowed only after fm_pcd_match_table_set() has been called
3513 * for this node and for all of the nodes that lead to it.
3515 #define FM_PCD_IOC_MATCH_TABLE_MODIFY_KEY \
3516 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(36), \
3517 ioc_fm_pcd_cc_node_modify_key_params_t)
3520 * @Function fm_pcd_hash_table_set
3522 * @Description This routine initializes a hash table structure.
3523 * KeyGen hash result determines the hash bucket.
3524 * Next, KeyGen key is compared against all keys of this bucket
3526 * Number of sets (number of buckets) of the hash equals to the
3527 * number of 1-s in 'hash_res_mask' in the provided parameters.
3528 * Number of hash table ways is then calculated by dividing
3529 * 'max_num_of_keys' equally between the hash sets. This is the
3530 * maximal number of keys that a hash bucket may hold.
3531 * The hash table is initialized empty and keys may be added to
3532 * it following the initialization. Keys masks are not supported
3533 * in current hash table implementation. The initialized hash
3534 * table can be integrated as a node in a CC tree.
3536 * @Param[in,out] ioc_fm_pcd_hash_table_params_t Pointer to a structure
3540 * @Return 0 on success; Error code otherwise.
3542 #define FM_PCD_IOC_HASH_TABLE_SET \
3543 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(37), \
3544 ioc_fm_pcd_hash_table_params_t)
3547 * @Function fm_pcd_hash_table_delete
3549 * @Description This routine deletes the provided hash table and released all
3550 * its allocated resources.
3552 * @Param[in] ioc_fm_obj_t The ID of a hash table.
3554 * @Return 0 on success; Error code otherwise.
3556 * @Cautions Allowed only following fm_pcd_hash_table_set().
3558 #define FM_PCD_IOC_HASH_TABLE_DELETE \
3559 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(37), ioc_fm_obj_t)
3562 * @Function fm_pcd_hash_table_add_key
3564 * @Description This routine adds the provided key (including next engine
3565 * parameters of this key) to the hash table.
3566 * The key is added as the last key of the bucket that it is
3569 * @Param[in] ioc_fm_pcd_hash_table_add_key_params_t
3570 * Pointer to a structure with the relevant parameters
3572 * @Return 0 on success; error code otherwise.
3574 * @Cautions Allowed only following fm_pcd_hash_table_set().
3576 #define FM_PCD_IOC_HASH_TABLE_ADD_KEY \
3577 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(39), \
3578 ioc_fm_pcd_hash_table_add_key_params_t)
3581 * @Function fm_pcd_hash_table_remove_key
3583 * @Description This routine removes the requested key (including next engine
3584 * parameters of this key) from the hash table.
3586 * @Param[in] ioc_fm_pcd_hash_table_remove_key_params_t - Pointer to a
3587 * structure with the relevant parameters
3589 * @Return 0 on success; Error code otherwise.
3591 * @Cautions Allowed only following fm_pcd_hash_table_set().
3593 #define FM_PCD_IOC_HASH_TABLE_REMOVE_KEY \
3594 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(40), \
3595 ioc_fm_pcd_hash_table_remove_key_params_t)
3598 * @Function fm_pcd_plcr_profile_set
3600 * @Description Sets a profile entry in the policer profile table.
3601 * The routine overrides any existing value.
3603 * @Param[in,out] ioc_fm_pcd_plcr_profile_params_t A structure of
3604 * parameters for defining
3605 * a policer profile entry.
3607 * @Return 0 on success; Error code otherwise.
3609 #define FM_PCD_IOC_PLCR_PROFILE_SET \
3610 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(41), \
3611 ioc_fm_pcd_plcr_profile_params_t)
3614 * @Function fm_pcd_plcr_profile_delete
3616 * @Description Delete a profile entry in the policer profile table.
3617 * The routine set entry to invalid.
3619 * @Param[in] ioc_fm_obj_t The id of a policer profile.
3621 * @Return 0 on success; Error code otherwise.
3623 #define FM_PCD_IOC_PLCR_PROFILE_DELETE \
3624 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(41), ioc_fm_obj_t)
3627 * @Function fm_pcd_manip_node_set
3629 * @Description This routine should be called for defining a manipulation
3630 * node. A manipulation node must be defined before the CC node
3633 * @Param[in] ioc_fm_pcd_manip_params_t A structure of parameters
3634 * defining the manipulation.
3636 * @Return A handle to the initialized object on success; NULL code
3639 #define FM_PCD_IOC_MANIP_NODE_SET \
3640 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(43), \
3641 ioc_fm_pcd_manip_params_t)
3644 * @Function fm_pcd_manip_node_replace
3646 * @Description Change existing manipulation node to be according to new
3647 * requirement. (Here, it's implemented as a variant of the same
3648 * IOCTL as for fm_pcd_manip_node_set(), and one that when
3649 * called, the 'id' member in its 'ioc_fm_pcd_manip_params_t'
3650 * argument is set to contain the manip node's handle)
3652 * @Param[in] ioc_fm_pcd_manip_params_t A structure of parameters
3653 * defining the manipulation.
3655 * @Return 0 on success; error code otherwise.
3657 * @Cautions Allowed only following fm_pcd_manip_node_set().
3659 #define FM_PCD_IOC_MANIP_NODE_REPLACE FM_PCD_IOC_MANIP_NODE_SET
3662 * @Function fm_pcd_manip_node_delete
3664 * @Description Delete an existing manipulation node.
3666 * @Param[in] ioc_fm_obj_t The id of the manipulation node to delete.
3668 * @Return 0 on success; error code otherwise.
3670 * @Cautions Allowed only following fm_pcd_manip_node_set().
3672 #define FM_PCD_IOC_MANIP_NODE_DELETE \
3673 _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(44), ioc_fm_obj_t)
3676 * @Function fm_pcd_manip_get_statistics
3678 * @Description Retrieve the manipulation statistics.
3680 * @Param[in] h_manip_node A handle to a manipulation node.
3681 * @Param[out] p_fm_pcd_manip_stats A structure for retrieving the
3682 * manipulation statistics.
3684 * @Return E_OK on success; Error code otherwise.
3686 * @Cautions Allowed only following fm_pcd_manip_node_set().
3688 #define FM_PCD_IOC_MANIP_GET_STATS \
3689 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(50), \
3690 ioc_fm_pcd_manip_get_stats_t)
3693 * @Function fm_pcd_set_advanced_offload_support
3695 * @Description This routine must be called in order to support the following
3696 * features: IP-fragmentation, IP-reassembly, IPsec,
3697 * Header-manipulation, frame-replicator.
3699 * @Param[in] h_fm_pcd FM PCD module descriptor.
3701 * @Return 0 on success; error code otherwise.
3703 * @Cautions Allowed only when PCD is disabled.
3705 #define FM_PCD_IOC_SET_ADVANCED_OFFLOAD_SUPPORT \
3706 _IO(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(45))
3709 * @Function fm_pcd_frm_replic_set_group
3711 * @Description Initialize a Frame Replicator group.
3713 * @Param[in] h_fm_pcd FM PCD module descriptor.
3714 * @Param[in] p_frm_replic_group_param A structure of parameters for
3715 * the initialization of the frame
3718 * @Return A handle to the initialized object on success; NULL code
3721 * @Cautions Allowed only following fm_pcd_init().
3723 #define FM_PCD_IOC_FRM_REPLIC_GROUP_SET \
3724 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(46), \
3725 ioc_fm_pcd_frm_replic_group_params_t)
3728 * @Function fm_pcd_frm_replic_delete_group
3730 * @Description Delete a Frame Replicator group.
3732 * @Param[in] h_frm_replic_group A handle to the frame replicator group.
3734 * @Return E_OK on success; Error code otherwise.
3736 * @Cautions Allowed only following fm_pcd_frm_replic_set_group().
3738 #define FM_PCD_IOC_FRM_REPLIC_GROUP_DELETE \
3739 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(47), ioc_fm_obj_t)
3742 * @Function fm_pcd_frm_replic_add_member
3744 * @Description Add the member in the index defined by the member_index.
3746 * @Param[in] h_frm_replic_group A handle to the frame replicator group.
3747 * @Param[in] member_index Member index for adding.
3748 * @Param[in] p_member_params A pointer to the new member parameters.
3750 * @Return E_OK on success; Error code otherwise.
3752 * @Cautions Allowed only following fm_pcd_frm_replic_set_group() of this
3755 #define FM_PCD_IOC_FRM_REPLIC_MEMBER_ADD \
3756 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(48), \
3757 ioc_fm_pcd_frm_replic_member_params_t)
3760 * @Function fm_pcd_frm_replic_remove_member
3762 * @Description Remove the member defined by the index from the relevant group
3764 * @Param[in] h_frm_replic_group A handle to the frame replicator group.
3765 * @Param[in] member_index Member index for removing.
3767 * @Return E_OK on success; Error code otherwise.
3769 * @Cautions Allowed only following fm_pcd_frm_replic_set_group() of this
3772 #define FM_PCD_IOC_FRM_REPLIC_MEMBER_REMOVE \
3773 _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(49), \
3774 ioc_fm_pcd_frm_replic_member_t)
3777 * @Group FM_grp Frame Manager API
3779 * @Description Frame Manager Application Programming Interface
3785 * @Group FM_PCD_grp FM PCD
3787 * @Description Frame Manager PCD (Parse-Classify-Distribute) API.
3789 * The FM PCD module is responsible for the initialization of all
3790 * global classifying FM modules. This includes the parser
3791 * general and common registers, the key generator global and
3792 * common registers, and the policer global and common registers.
3793 * In addition, the FM PCD SW module will initialize all required
3794 * key generator schemes, coarse classification flows, and
3795 * policer profiles. When FM module is configured to work with
3796 * one of these entities, it will register to it using the FM
3797 * PORT API. The PCD module will manage the PCD resources - i.e.
3798 * resource management of KeyGen schemes, etc.
3804 * @Collection General PCD defines
3806 #define FM_PCD_MAX_NUM_OF_PRIVATE_HDRS 2
3807 /**< Number of units/headers saved for user */
3809 #define FM_PCD_PRS_NUM_OF_HDRS 16
3810 /**< Number of headers supported by HW parser */
3811 #define FM_PCD_MAX_NUM_OF_DISTINCTION_UNITS \
3812 (32 - FM_PCD_MAX_NUM_OF_PRIVATE_HDRS)
3813 /**< Number of distinction units is limited by register size (32 bits) minus
3814 *reserved bits for private headers.
3816 #define FM_PCD_MAX_NUM_OF_INTERCHANGEABLE_HDRS 4
3817 /**< Maximum number of interchangeable headers in a distinction unit */
3818 #define FM_PCD_KG_NUM_OF_GENERIC_REGS FM_KG_NUM_OF_GENERIC_REGS
3819 /**< Total number of generic KeyGen registers */
3820 #define FM_PCD_KG_MAX_NUM_OF_EXTRACTS_PER_KEY 35
3821 /**< Max number allowed on any configuration; For HW implementation reasons, in
3822 * most cases less than this will be allowed; The driver will return an
3823 * initialization error if resource is unavailable.
3825 #define FM_PCD_KG_NUM_OF_EXTRACT_MASKS 4
3826 /**< Total number of masks allowed on KeyGen extractions. */
3827 #define FM_PCD_KG_NUM_OF_DEFAULT_GROUPS 16
3828 /**< Number of default value logical groups */
3830 #define FM_PCD_PRS_NUM_OF_LABELS 32
3831 /**< Maximum number of SW parser labels */
3832 #define FM_SW_PRS_MAX_IMAGE_SIZE \
3833 (FM_PCD_SW_PRS_SIZE \
3834 /*- FM_PCD_PRS_SW_OFFSET -FM_PCD_PRS_SW_TAIL_SIZE*/ \
3835 - FM_PCD_PRS_SW_PATCHES_SIZE)
3836 /**< Maximum size of SW parser code */
3838 #define FM_PCD_MAX_MANIP_INSRT_TEMPLATE_SIZE 128
3839 /**< Maximum size of insertion template for insert manipulation */
3841 #define FM_PCD_FRM_REPLIC_MAX_NUM_OF_ENTRIES 64
3842 /**< Maximum possible entries for frame replicator group */
3846 * @Group FM_PCD_init_grp FM PCD Initialization Unit
3848 * @Description Frame Manager PCD Initialization Unit API
3854 * @Description Exceptions user callback routine, will be called upon an
3855 * exception passing the exception identification.
3857 * @Param[in] h_app User's application descriptor.
3858 * @Param[in] exception The exception.
3860 typedef void (t_fm_pcd_exception_callback) (t_handle h_app,
3861 ioc_fm_pcd_exceptions exception);
3864 * @Description Exceptions user callback routine, will be called upon an
3865 * exception passing the exception identification.
3867 * @Param[in] h_app User's application descriptor.
3868 * @Param[in] exception The exception.
3869 * @Param[in] index id of the relevant source (may be scheme or
3872 typedef void (t_fm_pcd_id_exception_callback) (t_handle h_app,
3873 ioc_fm_pcd_exceptions exception,
3877 * @Description A callback for enqueuing frame onto a QM queue.
3879 * @Param[in] h_qm_arg Application's handle passed to QM module on
3881 * @Param[in] p_fd Frame descriptor for the frame.
3883 * @Return E_OK on success; Error code otherwise.
3885 typedef uint32_t (t_fm_pcd_qm_enqueue_callback) (t_handle h_qm_arg, void *p_fd);
3888 * @Description Host-Command parameters structure.
3890 * When using Host command for PCD functionalities, a dedicated
3891 * port must be used. If this routine is called for a PCD in a
3892 * single partition environment, or it is the Master partition in
3893 * a Multi-partition environment, The port will be initialized by
3894 * the PCD driver initialization routine.
3896 typedef struct t_fm_pcd_hc_params {
3897 uintptr_t port_base_addr;
3898 /**< Virtual Address of Host-Command Port memory mapped registers.*/
3900 /**< Port Id (0-6 relative to Host-Command/Offline-Parsing ports);
3901 * NOTE: When configuring Host Command port for FMANv3 devices
3902 * (DPAA_VERSION 11 and higher), port_id=0 MUST be used.
3904 uint16_t liodn_base;
3905 /**< LIODN base for this port, to be used together with LIODN offset
3906 * (irrelevant for P4080 revision 1.0)
3909 /**< Host-Command Port error queue Id. */
3911 /**< Host-Command Port confirmation queue Id. */
3912 uint32_t qm_channel;
3913 /**< QM channel dedicated to this Host-Command port; will be used by the
3916 t_fm_pcd_qm_enqueue_callback *f_qm_enqueue;
3917 /**< Callback routine for enqueuing a frame to the QM */
3919 /**< Application's handle passed to QM module on enqueue */
3920 } t_fm_pcd_hc_params;
3923 * @Description The main structure for PCD initialization
3925 typedef struct t_fm_pcd_params {
3927 /**< TRUE if Parser will be used for any of the FM ports. */
3929 /**< TRUE if Coarse Classification will be used for any of the FM ports.
3932 /**< TRUE if KeyGen will be used for any of the FM ports. */
3934 /**< TRUE if Policer will be used for any of the FM ports. */
3936 /**< A handle to the FM module. */
3937 uint8_t num_schemes;
3938 /**< Number of schemes dedicated to this partition.
3939 * this parameter is relevant if 'kg_support'=TRUE.
3941 bool use_host_command;
3942 /**< Optional for single partition, Mandatory for Multi partition */
3943 t_fm_pcd_hc_params hc;
3944 /**< Host Command parameters, relevant only if 'use_host_command'=TRUE;
3945 * Relevant when FM not runs in "guest-mode".
3947 t_fm_pcd_exception_callback *f_exception;
3948 /**< Callback routine for general PCD exceptions; Relevant when FM not
3949 * runs in "guest-mode".
3951 t_fm_pcd_id_exception_callback *f_exception_id;
3952 /**< Callback routine for specific KeyGen scheme or Policer profile
3953 * exceptions; Relevant when FM not runs in "guest-mode".
3956 /**< A handle to an application layer object; This handle will be passed
3957 * by the driver upon calling the above callbacks; Relevant when FM not
3958 * runs in "guest-mode".
3960 uint8_t part_plcr_profiles_base;
3961 /**< The first policer-profile-id dedicated to this partition. this
3962 * parameter is relevant if 'plcr_support'=TRUE. NOTE: this parameter
3963 * relevant only when working with multiple partitions.
3965 uint16_t part_num_of_plcr_profiles;
3966 /**< Number of policer-profiles dedicated to this partition. This
3967 * parameter is relevant if 'plcr_support'=TRUE. NOTE: this parameter
3968 * relevant only when working with multiple partitions.
3972 typedef struct t_fm_pcd_prs_label_params {
3973 uint32_t instruction_offset;
3974 ioc_net_header_type hdr;
3975 uint8_t index_per_hdr;
3976 } t_fm_pcd_prs_label_params;
3978 typedef struct t_fm_pcd_prs_sw_params {
3983 uint32_t sw_prs_data_params[FM_PCD_PRS_NUM_OF_HDRS];
3984 uint8_t num_of_labels;
3985 t_fm_pcd_prs_label_params labels_table[FM_PCD_PRS_NUM_OF_LABELS];
3986 } t_fm_pcd_prs_sw_params;
3989 * @Function fm_pcd_config
3991 * @Description Basic configuration of the PCD module.
3992 * Creates descriptor for the FM PCD module.
3994 * @Param[in] p_fm_pcd_params A structure of parameters for the
3995 initialization of PCD.
3997 * @Return A handle to the initialized module.
3999 t_handle fm_pcd_config(t_fm_pcd_params *p_fm_pcd_params);
4002 * @Function fm_pcd_init
4004 * @Description Initialization of the PCD module.
4006 * @Param[in] h_fm_pcd FM PCD module descriptor.
4008 * @Return E_OK on success; Error code otherwise.
4010 uint32_t fm_pcd_init(t_handle h_fm_pcd);
4013 * @Function fm_pcd_free
4015 * @Description Frees all resources that were assigned to FM module.
4016 * Calling this routine invalidates the descriptor.
4018 * @Param[in] h_fm_pcd FM PCD module descriptor.
4020 * @Return E_OK on success; Error code otherwise.
4022 uint32_t fm_pcd_free(t_handle h_fm_pcd);
4025 * @Group FM_PCD_advanced_cfg_grp FM PCD Advanced Configuration
4028 * @Description Frame Manager PCD Advanced Configuration API.
4034 * @Function fm_pcd_config_exception
4036 * @Description Calling this routine changes the internal driver data base
4037 * from its default selection of exceptions enabling.
4038 * [DEFAULT_num_of_shared_plcr_profiles].
4040 * @Param[in] h_fm_pcd FM PCD module descriptor.
4041 * @Param[in] exception The exception to be selected.
4042 * @Param[in] enable TRUE to enable interrupt, FALSE to mask it.
4044 * @Return E_OK on success; Error code otherwise.
4046 * @Cautions This routine should NOT be called from guest-partition (i.e.
4047 * guestId != NCSW_PRIMARY_ID)
4049 uint32_t fm_pcd_config_exception(t_handle h_fm_pcd,
4050 ioc_fm_pcd_exceptions exception, bool enable);
4053 * @Function fm_pcd_config_hc_frames_data_memory
4055 * @Description Configures memory-partition-id for FMan-Controller
4056 * Host-Command frames. Calling this routine changes the internal
4057 * driver data base from its default configuration [0].
4059 * @Param[in] h_fm_pcd FM PCD module descriptor.
4060 * @Param[in] mem_id Memory partition ID.
4062 * @Return E_OK on success; Error code otherwise.
4064 * @Cautions This routine may be called only if 'use_host_command' was TRUE
4065 * when fm_pcd_config() routine was called.
4067 uint32_t fm_pcd_config_hc_frames_data_memory(t_handle h_fm_pcd, uint8_t mem_id);
4070 * @Function fm_pcd_config_plcr_num_of_shared_profiles
4072 * @Description Calling this routine changes the internal driver data base
4073 * from its default selection of exceptions enablement.
4074 * [DEFAULT_num_of_shared_plcr_profiles].
4076 * @Param[in] h_fm_pcd FM PCD module descriptor.
4077 * @Param[in] num_of_shared_plcr_profiles Number of profiles to be shared
4078 * between ports on this partition
4080 * @Return E_OK on success; Error code otherwise.
4082 uint32_t fm_pcd_config_plcr_num_of_shared_profiles(t_handle h_fm_pcd,
4083 uint16_t num_of_shared_plcr_profiles);
4086 * @Function fm_pcd_config_plcr_auto_refresh_mode
4088 * @Description Calling this routine changes the internal driver data base
4089 * from its default selection of exceptions enablement. By
4090 * default auto-refresh is [DEFAULT_plcrAutoRefresh].
4092 * @Param[in] h_fm_pcd FM PCD module descriptor.
4093 * @Param[in] enable TRUE to enable, FALSE to disable
4095 * @Return E_OK on success; Error code otherwise.
4097 * @Cautions This routine should NOT be called from guest-partition
4098 * (i.e. guestId != NCSW_PRIMARY_ID)
4100 uint32_t fm_pcd_config_plcr_auto_refresh_mode(t_handle h_fm_pcd, bool enable);
4103 * @Function fm_pcd_config_prs_max_cycle_limit
4105 * @Description Calling this routine changes the internal data structure for
4106 * the maximum parsing time from its default value
4107 * [DEFAULT_MAX_PRS_CYC_LIM].
4109 * @Param[in] h_fm_pcd FM PCD module descriptor.
4110 * @Param[in] value 0 to disable the mechanism, or new maximum
4113 * @Return E_OK on success; Error code otherwise.
4115 * @Cautions This routine should NOT be called from guest-partition
4116 * (i.e. guestId != NCSW_PRIMARY_ID)
4118 uint32_t fm_pcd_config_prs_max_cycle_limit(t_handle h_fm_pcd, uint16_t value);
4120 /** @} */ /* end of FM_PCD_advanced_cfg_grp group */
4121 /** @} */ /* end of FM_PCD_init_grp group */
4124 * @Group FM_PCD_Runtime_grp FM PCD Runtime Unit
4126 * @Description Frame Manager PCD Runtime Unit API
4128 * The runtime control allows creation of PCD infrastructure
4129 * modules such as Network Environment Characteristics,
4130 * Classification Plan Groups and Coarse Classification Trees.
4131 * It also allows on-the-fly initialization, modification and
4132 * removal of PCD modules such as KeyGen schemes, coarse
4133 * classification nodes and Policer profiles.
4135 * In order to explain the programming model of the PCD driver
4136 * interface a few terms should be explained, and will be used
4138 * - Distinction Header - One of the 16 protocols supported by
4139 * the FM parser, or one of the SHIM headers (1 or 2). May be a
4140 * header with a special option (see below).
4141 * - Interchangeable Headers Group - This is a group of Headers
4142 * recognized by either one of them. For example, if in a
4143 * specific context the user chooses to treat IPv4 and IPV6 in
4144 * the same way, they may create an interchangeable Headers
4145 * Unit consisting of these 2 headers.
4146 * - A Distinction Unit - a Distinction Header or an
4147 * Interchangeable Headers Group.
4148 * - Header with special option - applies to Ethernet, MPLS,
4149 * VLAN, IPv4 and IPv6, includes multicast, broadcast and other
4150 * protocol specific options. In terms of hardware it relates
4151 * to the options available in the classification plan.
4152 * - Network Environment Characteristics - a set of Distinction
4153 * Units that define the total recognizable header selection
4154 * for a certain environment. This is NOT the list of all
4155 * headers that will ever appear in a flow, but rather
4156 * everything that needs distinction in a flow, where
4157 * distinction is made by KeyGen schemes and coarse
4158 * classification action descriptors.
4160 * The PCD runtime modules initialization is done in stages. The
4161 * first stage after initializing the PCD module itself is to
4162 * establish a Network Flows Environment Definition. The
4163 * application may choose to establish one or more such
4164 * environments. Later, when needed, the application will have to
4165 * state, for some of its modules, to which single environment it
4171 t_handle fm_pcd_open(t_fm_pcd_params *p_fm_pcd_params);
4172 void fm_pcd_close(t_handle h_fm_pcd);
4175 * @Function fm_pcd_enable
4177 * @Description This routine should be called after PCD is initialized for
4178 * enabling all PCD engines according to their existing
4181 * @Param[in] h_fm_pcd FM PCD module descriptor.
4183 * @Return E_OK on success; Error code otherwise.
4185 * @Cautions Allowed only following fm_pcd_init() and when PCD is disabled.
4187 uint32_t fm_pcd_enable(t_handle h_fm_pcd);
4190 * @Function fm_pcd_disable
4192 * @Description This routine may be called when PCD is enabled in order to
4193 * disable all PCD engines. It may be called only when none of
4194 * the ports in the system are using the PCD.
4196 * @Param[in] h_fm_pcd FM PCD module descriptor.
4198 * @Return E_OK on success; Error code otherwise.
4200 * @Cautions Allowed only following fm_pcd_init() and when PCD is enabled.
4202 uint32_t fm_pcd_disable(t_handle h_fm_pcd);
4205 * @Function fm_pcd_get_counter
4207 * @Description Reads one of the FM PCD counters.
4209 * @Param[in] h_fm_pcd FM PCD module descriptor.
4210 * @Param[in] counter The requested counter.
4212 * @Return Counter's current value.
4214 * @Cautions Allowed only following fm_pcd_init().
4215 * Note that it is user's responsibility to call this routine
4216 * only for enabled counters, and there will be no indication if
4217 * a disabled counter is accessed.
4219 uint32_t fm_pcd_get_counter(t_handle h_fm_pcd, ioc_fm_pcd_counters counter);
4222 * @Function fm_pcd_prs_load_sw
4224 * @Description This routine may be called in order to load software parsing
4227 * @Param[in] h_fm_pcd FM PCD module descriptor.
4228 * @Param[in] p_sw_prs A pointer to a structure of software
4229 * parser parameters, including the software
4232 * @Return E_OK on success; Error code otherwise.
4234 * @Cautions Allowed only following fm_pcd_init() and when PCD is disabled.
4235 * This routine should NOT be called from guest-partition
4236 * (i.e. guestId != NCSW_PRIMARY_ID)
4238 uint32_t fm_pcd_prs_load_sw(t_handle h_fm_pcd,
4239 ioc_fm_pcd_prs_sw_params_t *p_sw_prs);
4242 * @Function fm_pcd_set_advanced_offload_support
4244 * @Description This routine must be called in order to support the following
4245 * features: IP-fragmentation, IP-reassembly, IPsec,
4246 * Header-manipulation, frame-replicator.
4248 * @Param[in] h_fm_pcd FM PCD module descriptor.
4250 * @Return E_OK on success; Error code otherwise.
4252 * @Cautions Allowed only following fm_pcd_init() and when PCD is disabled.
4253 * This routine should NOT be called from guest-partition
4254 * (i.e. guestId != NCSW_PRIMARY_ID)
4256 uint32_t fm_pcd_set_advanced_offload_support(t_handle h_fm_pcd);
4259 * @Function fm_pcd_kg_set_dflt_value
4261 * @Description Calling this routine sets a global default value to be used
4262 * by the KeyGen when parser does not recognize a required
4264 * default value is 0.
4266 * @Param[in] h_fm_pcd FM PCD module descriptor.
4267 * @Param[in] value_id 0,1 - one of 2 global default values.
4268 * @Param[in] value The requested default value.
4270 * @Return E_OK on success; Error code otherwise.
4272 * @Cautions Allowed only following fm_pcd_init() and when PCD is disabled.
4273 * This routine should NOT be called from guest-partition
4274 * (i.e. guestId != NCSW_PRIMARY_ID)
4276 uint32_t fm_pcd_kg_set_dflt_value(t_handle h_fm_pcd,
4277 uint8_t value_id, uint32_t value);
4280 * @Function fm_pcd_kg_set_additional_data_after_parsing
4282 * @Description Calling this routine allows the KeyGen to access data past
4283 * the parser finishing point.
4285 * @Param[in] h_fm_pcd FM PCD module descriptor.
4286 * @Param[in] payload_offset the number of bytes beyond the parser
4289 * @Return E_OK on success; Error code otherwise.
4291 * @Cautions Allowed only following fm_pcd_init() and when PCD is disabled.
4292 * This routine should NOT be called from guest-partition (i.e.
4293 * guestId != NCSW_PRIMARY_ID)
4295 uint32_t fm_pcd_kg_set_additional_data_after_parsing(t_handle h_fm_pcd,
4296 uint8_t payload_offset);
4299 * @Function fm_pcd_set_exception
4301 * @Description Calling this routine enables/disables PCD interrupts.
4303 * @Param[in] h_fm_pcd FM PCD module descriptor.
4304 * @Param[in] exception The exception to be selected.
4305 * @Param[in] enable TRUE to enable interrupt, FALSE to mask it.
4307 * @Return E_OK on success; Error code otherwise.
4309 * @Cautions Allowed only following fm_pcd_init().
4310 * This routine should NOT be called from guest-partition
4311 * (i.e. guestId != NCSW_PRIMARY_ID)
4313 uint32_t fm_pcd_set_exception(t_handle h_fm_pcd,
4314 ioc_fm_pcd_exceptions exception, bool enable);
4317 * @Function fm_pcd_modify_counter
4319 * @Description Sets a value to an enabled counter. Use "0" to reset the
4322 * @Param[in] h_fm_pcd FM PCD module descriptor.
4323 * @Param[in] counter The requested counter.
4324 * @Param[in] value The requested value to be written into the
4327 * @Return E_OK on success; Error code otherwise.
4329 * @Cautions Allowed only following fm_pcd_init().
4330 * This routine should NOT be called from guest-partition
4331 * (i.e. guestId != NCSW_PRIMARY_ID)
4333 uint32_t fm_pcd_modify_counter(t_handle h_fm_pcd,
4334 ioc_fm_pcd_counters counter, uint32_t value);
4337 * @Function fm_pcd_set_plcr_statistics
4339 * @Description This routine may be used to enable/disable policer statistics
4340 * counter. By default the statistics is enabled.
4342 * @Param[in] h_fm_pcd FM PCD module descriptor
4343 * @Param[in] enable TRUE to enable, FALSE to disable.
4345 * @Return E_OK on success; Error code otherwise.
4347 * @Cautions Allowed only following fm_pcd_init().
4348 * This routine should NOT be called from guest-partition
4349 * (i.e. guestId != NCSW_PRIMARY_ID)
4351 uint32_t fm_pcd_set_plcr_statistics(t_handle h_fm_pcd, bool enable);
4354 * @Function fm_pcd_set_prs_statistics
4356 * @Description Defines whether to gather parser statistics including all
4359 * @Param[in] h_fm_pcd FM PCD module descriptor.
4360 * @Param[in] enable TRUE to enable, FALSE to disable.
4364 * @Cautions Allowed only following fm_pcd_init().
4365 * This routine should NOT be called from guest-partition
4366 * (i.e. guestId != NCSW_PRIMARY_ID)
4368 void fm_pcd_set_prs_statistics(t_handle h_fm_pcd, bool enable);
4370 #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0))
4372 * @Function fm_pcd_dump_regs
4374 * @Description Dumps all PCD registers
4376 * @Param[in] h_fm_pcd A handle to an FM PCD Module.
4378 * @Return E_OK on success; Error code otherwise.
4380 * @Cautions Allowed only following fm_pcd_init().
4381 * NOTE: this routine may be called only for FM in master mode
4382 * (i.e. 'guestId'=NCSW_PRIMARY_ID) or in a case that the
4383 * registers are mapped.
4385 uint32_t fm_pcd_dump_regs(t_handle h_fm_pcd);
4388 * @Function fm_pcd_kg_dump_regs
4390 * @Description Dumps all PCD KG registers
4392 * @Param[in] h_fm_pcd A handle to an FM PCD Module.
4394 * @Return E_OK on success; Error code otherwise.
4396 * @Cautions Allowed only following fm_pcd_init().
4397 * NOTE: this routine may be called only for FM in master mode
4398 * (i.e. 'guestId'=NCSW_PRIMARY_ID) or in a case that the
4399 * registers are mapped.
4401 uint32_t fm_pcd_kg_dump_regs(t_handle h_fm_pcd);
4404 * @Function fm_pcd_plcr_dump_regs
4406 * @Description Dumps all PCD Policer registers
4408 * @Param[in] h_fm_pcd A handle to an FM PCD Module.
4410 * @Return E_OK on success; Error code otherwise.
4412 * @Cautions Allowed only following fm_pcd_init().
4413 * NOTE: this routine may be called only for FM in master mode
4414 * (i.e. 'guestId'=NCSW_PRIMARY_ID) or in a case that the
4415 * registers are mapped.
4417 uint32_t fm_pcd_plcr_dump_regs(t_handle h_fm_pcd);
4420 * @Function fm_pcd_plcr_profile_dump_regs
4422 * @Description Dumps all PCD Policer profile registers
4424 * @Param[in] h_profile A handle to a Policer profile.
4426 * @Return E_OK on success; Error code otherwise.
4428 * @Cautions Allowed only following fm_pcd_init().
4429 * NOTE: this routine may be called only for FM in master mode
4430 * (i.e. 'guestId'=NCSW_PRIMARY_ID) or in a case that the
4431 * registers are mapped.
4433 uint32_t fm_pcd_plcr_profile_dump_regs(t_handle h_profile);
4436 * @Function fm_pcd_prs_dump_regs
4438 * @Description Dumps all PCD Parser registers
4440 * @Param[in] h_fm_pcd A handle to an FM PCD Module.
4442 * @Return E_OK on success; Error code otherwise.
4444 * @Cautions Allowed only following fm_pcd_init().
4445 * NOTE: this routine may be called only for FM in master mode
4446 * (i.e. 'guestId'=NCSW_PRIMARY_ID) or in a case that the
4447 * registers are mapped.
4449 uint32_t fm_pcd_prs_dump_regs(t_handle h_fm_pcd);
4452 * @Function fm_pcd_hc_dump_regs
4454 * @Description Dumps HC Port registers
4456 * @Param[in] h_fm_pcd A handle to an FM PCD Module.
4458 * @Return E_OK on success; Error code otherwise.
4460 * @Cautions Allowed only following fm_pcd_init().
4461 * NOTE: this routine may be called only for FM in master mode
4462 * (i.e. 'guestId'=NCSW_PRIMARY_ID).
4464 uint32_t fm_pcd_hc_dump_regs(t_handle h_fm_pcd);
4465 #endif /* (defined(DEBUG_ERRORS) && ... */
4469 * KeyGen FM_PCD_Runtime_build_grp FM PCD Runtime Building Unit
4471 * @Description Frame Manager PCD Runtime Building API
4473 * This group contains routines for setting, deleting and
4474 * modifying PCD resources, for defining the total PCD tree.
4479 * @Collection Definitions of coarse classification
4480 * parameters as required by KeyGen (when coarse classification
4481 * is the next engine after this scheme).
4483 #define FM_PCD_MAX_NUM_OF_CC_TREES 8
4484 #define FM_PCD_MAX_NUM_OF_CC_GROUPS 16
4485 #define FM_PCD_MAX_NUM_OF_CC_UNITS 4
4486 #define FM_PCD_MAX_NUM_OF_KEYS 256
4487 #define FM_PCD_MAX_NUM_OF_FLOWS (4 * KILOBYTE)
4488 #define FM_PCD_MAX_SIZE_OF_KEY 56
4489 #define FM_PCD_MAX_NUM_OF_CC_ENTRIES_IN_GRP 16
4490 #define FM_PCD_LAST_KEY_INDEX 0xffff
4492 #define FM_PCD_MAX_NUM_OF_CC_NODES 255
4493 /* Obsolete, not used - will be removed in the future */
4497 * @Collection A set of definitions to allow protocol
4498 * special option description.
4500 typedef uint32_t protocol_opt_t;
4501 /**< A general type to define a protocol option. */
4503 typedef protocol_opt_t eth_protocol_opt_t;
4504 /**< Ethernet protocol options. */
4505 #define ETH_BROADCAST 0x80000000 /**< Ethernet Broadcast. */
4506 #define ETH_MULTICAST 0x40000000 /**< Ethernet Multicast. */
4508 typedef protocol_opt_t vlan_protocol_opt_t; /**< VLAN protocol options. */
4509 #define VLAN_STACKED 0x20000000 /**< Stacked VLAN. */
4511 typedef protocol_opt_t mpls_protocol_opt_t; /**< MPLS protocol options. */
4512 #define MPLS_STACKED 0x10000000 /**< Stacked MPLS. */
4514 typedef protocol_opt_t ipv_4protocol_opt_t; /**< IPv4 protocol options. */
4515 #define IPV4_BROADCAST_1 0x08000000 /**< IPv4 Broadcast. */
4516 #define IPV4_MULTICAST_1 0x04000000 /**< IPv4 Multicast. */
4517 #define IPV4_UNICAST_2 0x02000000 /**< Tunneled IPv4 - Unicast. */
4518 #define IPV4_MULTICAST_BROADCAST_2 0x01000000
4519 /**< Tunneled IPv4 - Broadcast/Multicast. */
4521 #define IPV4_FRAG_1 0x00000008
4522 /**< IPV4 reassembly option. IPV4 Reassembly
4523 * manipulation requires network environment
4524 * with IPV4 header and IPV4_FRAG_1 option
4527 typedef protocol_opt_t ipv_6protocol_opt_t; /**< IPv6 protocol options. */
4528 #define IPV6_MULTICAST_1 0x00800000 /**< IPv6 Multicast. */
4529 #define IPV6_UNICAST_2 0x00400000 /**< Tunneled IPv6 - Unicast. */
4530 #define IPV6_MULTICAST_2 0x00200000 /**< Tunneled IPv6 - Multicast. */
4532 #define IPV6_FRAG_1 0x00000004
4533 /**< IPV6 reassembly option. IPV6 Reassembly
4534 * manipulation requires network environment
4535 * with IPV6 header and IPV6_FRAG_1 option; in
4536 * case where fragment found, the
4537 * fragment-extension offset may be found at
4538 * 'shim2' (in parser-result).
4540 typedef protocol_opt_t capwap_protocol_opt_t; /**< CAPWAP protocol options. */
4541 #define CAPWAP_FRAG_1 0x00000008
4542 /**< CAPWAP reassembly option. CAPWAP Reassembly
4543 * manipulation requires network environment
4544 * with CAPWAP header and CAPWAP_FRAG_1 option;
4545 * in case where fragment found, the
4546 * fragment-extension offset may be found at
4547 * 'shim2' (in parser-result).
4552 #define FM_PCD_MANIP_MAX_HDR_SIZE 256
4553 #define FM_PCD_MANIP_DSCP_TO_VLAN_TRANS 64
4556 * @Collection A set of definitions to support Header Manipulation selection.
4558 typedef uint32_t hdr_manip_flags_t;
4559 /**< A general type to define a HMan update command flags. */
4561 typedef hdr_manip_flags_t ipv_4hdr_manip_update_flags_t;
4562 /**< IPv4 protocol HMan update command flags. */
4564 #define HDR_MANIP_IPV4_TOS 0x80000000
4565 /**< update TOS with the given value ('tos' field
4566 * of t_FmPcdManipHdrFieldUpdateIpv4)
4568 #define HDR_MANIP_IPV4_ID 0x40000000
4569 /**< update IP ID with the given value ('id' field
4570 * of t_FmPcdManipHdrFieldUpdateIpv4)
4572 #define HDR_MANIP_IPV4_TTL 0x20000000
4573 /**< Decrement TTL by 1 */
4574 #define HDR_MANIP_IPV4_SRC 0x10000000
4575 /**< update IP source address with the given value
4576 * ('src' field of t_FmPcdManipHdrFieldUpdateIpv4)
4578 #define HDR_MANIP_IPV4_DST 0x08000000
4579 /**< update IP destination address with the given value
4580 * ('dst' field of t_FmPcdManipHdrFieldUpdateIpv4)
4583 typedef hdr_manip_flags_t ipv_6hdr_manip_update_flags_t;
4584 /**< IPv6 protocol HMan update command flags. */
4586 #define HDR_MANIP_IPV6_TC 0x80000000
4587 /**< update Traffic Class address with the given value
4588 * ('trafficClass' field of
4589 * t_FmPcdManipHdrFieldUpdateIpv6)
4591 #define HDR_MANIP_IPV6_HL 0x40000000
4592 /**< Decrement Hop Limit by 1 */
4593 #define HDR_MANIP_IPV6_SRC 0x20000000
4594 /**< update IP source address with the given value
4595 * ('src' field of t_FmPcdManipHdrFieldUpdateIpv6)
4597 #define HDR_MANIP_IPV6_DST 0x10000000
4598 /**< update IP destination address with the given value
4599 * ('dst' field of t_FmPcdManipHdrFieldUpdateIpv6)
4602 typedef hdr_manip_flags_t tcp_udp_hdr_manip_update_flags_t;
4603 /**< TCP/UDP protocol HMan update command flags. */
4605 #define HDR_MANIP_TCP_UDP_SRC 0x80000000
4606 /**< update TCP/UDP source address with the given value
4607 * ('src' field of t_FmPcdManipHdrFieldUpdateTcpUdp)
4609 #define HDR_MANIP_TCP_UDP_DST 0x40000000
4610 /**< update TCP/UDP destination address with the given value
4611 * ('dst' field of t_FmPcdManipHdrFieldUpdateTcpUdp)
4613 #define HDR_MANIP_TCP_UDP_CHECKSUM 0x20000000
4614 /**< update TCP/UDP checksum */
4619 * @Description A type used for returning the order of the key extraction.
4620 * each value in this array represents the index of the
4621 * extraction command as defined by the user in the
4622 * initialization extraction array. The valid size of this array
4623 * is the user define number of extractions required (also marked
4624 * by the second '0' in this array).
4626 typedef uint8_t t_fm_pcd_kg_key_order[FM_PCD_KG_MAX_NUM_OF_EXTRACTS_PER_KEY];
4629 * @Collection Definitions for CC statistics
4631 #define FM_PCD_CC_STATS_MAX_NUM_OF_FLR 10
4632 /* Maximal supported number of frame length ranges */
4633 #define FM_PCD_CC_STATS_FLR_SIZE 2
4634 /* Size in bytes of a frame length range limit */
4635 #define FM_PCD_CC_STATS_COUNTER_SIZE 4
4636 /* Size in bytes of a frame length range counter */
4640 * @Description Parameters for defining CC keys parameters
4641 * The driver supports two methods for CC node allocation:
4642 * dynamic and static. Static mode was created in order to
4643 * prevent runtime alloc/free of FMan memory (MURAM), which may
4644 * cause fragmentation; in this mode, the driver automatically
4645 * allocates the memory according to 'max_num_of_keys' parameter.
4646 * The driver calculates the maximal memory size that may be used
4647 * for this CC-Node taking into consideration 'mask_support' and
4648 * 'statistics_mode' parameters. When 'action' =
4649 * e_FM_PCD_ACTION_INDEXED_LOOKUP in the extraction parameters of
4650 * this node, 'max_num_of_keys' must be equal to 'num_of_keys'.
4651 * In dynamic mode, 'max_num_of_keys' must be zero. At
4652 * initialization, all required structures are allocated
4653 * according to 'num_of_keys' parameter. During runtime
4654 * modification, these structures are re-allocated according to
4655 * the updated number of keys.
4657 * Please note that 'action' and 'icIndxMask' mentioned in the
4658 * specific parameter explanations are passed in the extraction
4659 * parameters of the node (fields of
4660 * extractCcParams.extractNonHdr).
4662 typedef struct t_keys_params {
4663 uint16_t max_num_of_keys;
4664 /**< Maximum number of keys that will (ever) be used in this
4665 * CC-Node; A value of zero may be used for dynamic memory
4669 /**< This parameter is relevant only if a node is initialized
4670 * with 'action' = e_FM_PCD_ACTION_EXACT_MATCH and
4671 * max_num_of_keys > 0; Should be TRUE to reserve table memory
4672 * for key masks, even if initial keys do not contain masks, or
4673 * if the node was initialized as 'empty' (without keys); this
4674 * will allow user to add keys with masks at runtime.
4675 * NOTE that if user want to use only global-masks (i.e. one
4676 * common mask for all the entries within this table, this
4677 * parameter should set to 'FALSE'.
4679 ioc_fm_pcd_cc_stats_mode statistics_mode;
4680 /**< Determines the supported statistics mode for all node's
4681 * keys. To enable statistics gathering, statistics should be
4682 * enabled per every key, using 'statisticsEn' in next engine
4683 * parameters structure of that key; If 'max_num_of_keys' is
4684 * set, all required structures will be preallocated for all
4687 uint16_t frame_length_ranges[FM_PCD_CC_STATS_MAX_NUM_OF_FLR];
4688 /**< Relevant only for 'RMON' statistics mode (this feature is
4689 * supported only on B4860 device); Holds a list of programmable
4690 * thresholds - for each received frame, its length in bytes is
4691 * examined against these range thresholds and the appropriate
4692 * counter is incremented by 1 - for example, to belong to range
4693 * i, the following should hold: range i-1 threshold < frame
4694 * length <= range i threshold. Each range threshold must be
4695 * larger then its preceding range threshold, and last range
4696 * threshold must be 0xFFFF.
4698 uint16_t num_of_keys;
4699 /**< Number of initial keys; Note that in case of 'action' =
4700 * e_FM_PCD_ACTION_INDEXED_LOOKUP, this field should be
4701 * power-of-2 of the number of bits that are set in 'icIndxMask'
4704 /**< Size of key - for extraction of type FULL_FIELD, 'key_size'
4705 * has to be the standard size of the selected key; For other
4706 * extraction types, 'key_size' has to be as size of extraction;
4707 * When 'action' = e_FM_PCD_ACTION_INDEXED_LOOKUP, 'key_size'
4710 ioc_fm_pcd_cc_key_params_t key_params[FM_PCD_MAX_NUM_OF_KEYS];
4711 /**< An array with 'num_of_keys' entries, each entry specifies
4712 * the corresponding key parameters; When 'action' =
4713 * e_FM_PCD_ACTION_EXACT_MATCH, this value must not exceed 255
4714 * (FM_PCD_MAX_NUM_OF_KEYS-1) as the last entry is saved for the
4717 ioc_fm_pcd_cc_next_engine_params_t cc_next_engine_params_for_miss;
4718 /**< Parameters for defining the next engine when a key is not
4719 * matched; Not relevant if action =
4720 * e_FM_PCD_ACTION_INDEXED_LOOKUP.
4725 * @Description Parameters for defining custom header manipulation for generic
4728 typedef struct ioc_fm_pcd_manip_hdr_custom_gen_field_replace {
4730 /**< Location of new data - Offset from Parse Result
4731 * (>= 16, src_offset+size <= 32, )
4734 /**< Location of data to be overwritten - Offset from
4735 * start of frame (dst_offset + size <= 256).
4738 /**< The number of bytes (<=16) to be replaced */
4740 /**< Optional 1 byte mask. Set to select bits for
4741 * replacement (1 - bit will be replaced); Clear to use
4744 uint8_t mask_offset;
4745 /**< Relevant if mask != 0; Mask offset within the
4748 } ioc_fm_pcd_manip_hdr_custom_gen_field_replace;
4751 * @Function fm_pcd_net_env_characteristics_set
4753 * @Description Define a set of Network Environment Characteristics.
4755 * When setting an environment it is important to understand its
4756 * application. It is not meant to describe the flows that will
4757 * run on the ports using this environment, but what the user
4758 * means TO DO with the PCD mechanisms in order to
4759 * parse-classify-distribute those frames.
4760 * By specifying a distinction unit, the user means it would use
4761 * that option for distinction between frames at either a KeyGen
4762 * scheme or a coarse classification action descriptor. Using
4763 * interchangeable headers to define a unit means that the user
4764 * is indifferent to which of the interchangeable headers is
4765 * present in the frame, and wants the distinction to be based on
4766 * the presence of either one of them.
4768 * Depending on context, there are limitations to the use of
4769 * environments. A port using the PCD functionality is bound to
4770 * an environment. Some or even all ports may share an
4771 * environment but also an environment per port is possible. When
4772 * initializing a scheme, a classification plan group (see
4773 * below), or a coarse classification tree, one of the
4774 * initialized environments must be stated and related to. When a
4775 * port is bound to a scheme, a classification plan group, or a
4776 * coarse classification tree, it MUST be bound to the same
4779 * The different PCD modules, may relate (for flows definition)
4780 * ONLY on distinction units as defined by their environment.
4781 * When initializing a scheme for example, it may not choose to
4782 * select IPV4 as a match for recognizing flows unless it was
4783 * defined in the relating environment. In fact, to guide the
4784 * user through the configuration of the PCD, each module's
4785 * characterization in terms of flows is not done using protocol
4786 * names, but using environment indexes.
4788 * In terms of HW implementation, the list of distinction units
4789 * sets the LCV vectors and later used for match vector,
4790 * classification plan vectors and coarse classification
4793 * @Param[in] h_fm_pcd FM PCD module descriptor.
4794 * @Param[in] p_netenv_params A structure of parameters for the
4795 * initialization of the network
4798 * @Return A handle to the initialized object on success; NULL code
4801 * @Cautions Allowed only following fm_pcd_init().
4803 t_handle fm_pcd_net_env_characteristics_set(t_handle h_fm_pcd,
4804 ioc_fm_pcd_net_env_params_t *p_netenv_params);
4807 * @Function fm_pcd_net_env_characteristics_delete
4809 * @Description Deletes a set of Network Environment Characteristics.
4811 * @Param[in] h_net_env A handle to the Network environment.
4813 * @Return E_OK on success; Error code otherwise.
4815 uint32_t fm_pcd_net_env_characteristics_delete(t_handle h_net_env);
4818 * @Function fm_pcd_kg_scheme_set
4820 * @Description Initializing or modifying and enabling a scheme for the
4821 * KeyGen. This routine should be called for adding or modifying
4822 * a scheme. When a scheme needs modifying, the API requires that
4823 * it will be rewritten. In such a case 'modify' should be TRUE.
4824 * If the routine is called for a valid scheme and 'modify' is
4825 * FALSE, it will return error.
4827 * @Param[in] h_fm_pcd If this is a new scheme - A handle to an
4828 * FM PCD Module. Otherwise NULL (ignored
4830 * @Param[in,out] p_scheme_params A structure of parameters for defining
4833 * @Return A handle to the initialized scheme on success; NULL code
4834 * otherwise. When used as "modify" (rather than for setting a
4835 * new scheme), p_scheme_params->id.h_scheme will return NULL if
4836 * action fails due to scheme BUSY state.
4838 * @Cautions Allowed only following fm_pcd_init().
4840 t_handle fm_pcd_kg_scheme_set(t_handle h_fm_pcd,
4841 ioc_fm_pcd_kg_scheme_params_t *p_scheme_params);
4844 * @Function fm_pcd_kg_scheme_delete
4846 * @Description Deleting an initialized scheme.
4848 * @Param[in] h_scheme scheme handle as returned by
4849 * fm_pcd_kg_scheme_set()
4851 * @Return E_OK on success; Error code otherwise.
4853 * @Cautions Allowed only following fm_pcd_init() & fm_pcd_kg_scheme_set().
4855 uint32_t fm_pcd_kg_scheme_delete(t_handle h_scheme);
4858 * @Function fm_pcd_kg_scheme_get_counter
4860 * @Description Reads scheme packet counter.
4862 * @Param[in] h_scheme scheme handle as returned by
4863 * fm_pcd_kg_scheme_set().
4865 * @Return Counter's current value.
4867 * @Cautions Allowed only following fm_pcd_init() & fm_pcd_kg_scheme_set().
4869 uint32_t fm_pcd_kg_scheme_get_counter(t_handle h_scheme);
4872 * @Function fm_pcd_kg_scheme_set_counter
4874 * @Description Writes scheme packet counter.
4876 * @Param[in] h_scheme scheme handle as returned by
4877 * fm_pcd_kg_scheme_set().
4878 * @Param[in] value New scheme counter value - typically '0' for
4879 * resetting the counter.
4881 * @Return E_OK on success; Error code otherwise.
4883 * @Cautions Allowed only following fm_pcd_init() & fm_pcd_kg_scheme_set().
4885 uint32_t fm_pcd_kg_scheme_set_counter(t_handle h_scheme,
4889 * @Function fm_pcd_plcr_profile_set
4891 * @Description Sets a profile entry in the policer profile table.
4892 * The routine overrides any existing value.
4894 * @Param[in] h_fm_pcd A handle to an FM PCD Module.
4895 * @Param[in] p_profile A structure of parameters for defining a
4896 * policer profile entry.
4898 * @Return A handle to the initialized object on success; NULL code
4899 * otherwise. When used as "modify" (rather than for setting a
4900 * new profile), p_profile->id.h_profile will return NULL if
4901 * action fails due to profile BUSY state.
4903 * @Cautions Allowed only following fm_pcd_init().
4905 t_handle fm_pcd_plcr_profile_set(t_handle h_fm_pcd,
4906 ioc_fm_pcd_plcr_profile_params_t *p_profile);
4909 * @Function fm_pcd_plcr_profile_delete
4911 * @Description Delete a profile entry in the policer profile table.
4912 * The routine set entry to invalid.
4914 * @Param[in] h_profile A handle to the profile.
4916 * @Return E_OK on success; Error code otherwise.
4918 * @Cautions Allowed only following fm_pcd_init().
4920 uint32_t fm_pcd_plcr_profile_delete(t_handle h_profile);
4923 * @Function fm_pcd_plcr_profile_get_counter
4925 * @Description Sets an entry in the classification plan.
4926 * The routine overrides any existing value.
4928 * @Param[in] h_profile A handle to the profile.
4929 * @Param[in] counter Counter selector.
4931 * @Return specific counter value.
4933 * @Cautions Allowed only following fm_pcd_init().
4935 uint32_t fm_pcd_plcr_profile_get_counter(t_handle h_profile,
4936 ioc_fm_pcd_plcr_profile_counters counter);
4939 * @Function fm_pcd_plcr_profile_set_counter
4941 * @Description Sets an entry in the classification plan.
4942 * The routine overrides any existing value.
4944 * @Param[in] h_profile A handle to the profile.
4945 * @Param[in] counter Counter selector.
4946 * @Param[in] value value to set counter with.
4948 * @Return E_OK on success; Error code otherwise.
4950 * @Cautions Allowed only following fm_pcd_init().
4952 uint32_t fm_pcd_plcr_profile_set_counter(t_handle h_profile,
4953 ioc_fm_pcd_plcr_profile_counters counter,
4957 * @Function fm_pcd_cc_root_build
4959 * @Description This routine must be called to define a complete coarse
4960 * classification tree. This is the way to define coarse
4961 * classification to a certain flow - the KeyGen schemes may
4962 * point only to trees defined in this way.
4964 * @Param[in] h_fm_pcd FM PCD module descriptor.
4965 * @Param[in] p_params A structure of parameters to define the tree.
4967 * @Return A handle to the initialized object on success; NULL code
4970 * @Cautions Allowed only following fm_pcd_init().
4972 t_handle fm_pcd_cc_root_build(t_handle h_fm_pcd,
4973 ioc_fm_pcd_cc_tree_params_t *p_params);
4976 * @Function fm_pcd_cc_root_delete
4978 * @Description Deleting an built tree.
4980 * @Param[in] h_cc_tree A handle to a CC tree.
4982 * @Return E_OK on success; Error code otherwise.
4984 * @Cautions Allowed only following fm_pcd_init().
4986 uint32_t fm_pcd_cc_root_delete(t_handle h_cc_tree);
4989 * @Function fm_pcd_cc_root_modify_next_engine
4991 * @Description Modify the Next Engine Parameters in the entry of the tree.
4993 * @Param[in] h_cc_tree A handle to the tree
4994 * @Param[in] grp_id A Group index in the tree
4995 * @Param[in] index Entry index in the group
4997 * @Param[in] p_fm_pcd_cc_next_engine Pointer to new next
5000 * @Return E_OK on success; Error code otherwise.
5002 * @Cautions Allowed only following FM_PCD_CcBuildTree().
5004 uint32_t fm_pcd_cc_root_modify_next_engine(t_handle h_cc_tree,
5007 ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine);
5010 * @Function fm_pcd_match_table_set
5012 * @Description This routine should be called for each CC (coarse
5013 * classification) node. The whole CC tree should be built bottom
5014 * up so that each node points to already defined nodes.
5016 * @Param[in] h_fm_pcd FM PCD module descriptor.
5017 * @Param[in] p_param A structure of parameters defining the CC node
5019 * @Return A handle to the initialized object on success; NULL code
5022 * @Cautions Allowed only following fm_pcd_init().
5024 t_handle fm_pcd_match_table_set(t_handle h_fm_pcd,
5025 ioc_fm_pcd_cc_node_params_t *p_param);
5028 * @Function fm_pcd_match_table_delete
5030 * @Description Deleting an built node.
5032 * @Param[in] h_cc_node A handle to a CC node.
5034 * @Return E_OK on success; Error code otherwise.
5036 * @Cautions Allowed only following fm_pcd_init().
5038 uint32_t fm_pcd_match_table_delete(t_handle h_cc_node);
5041 * @Function fm_pcd_match_table_modify_miss_next_engine
5043 * @Description Modify the Next Engine Parameters of the Miss key case of the
5046 * @Param[in] h_cc_node A handle to the node
5047 * @Param[in] p_fm_pcd_cc_next_engine_params Parameters for defining
5050 * @Return E_OK on success; Error code otherwise.
5052 * @Cautions Allowed only following fm_pcd_match_table_set(); Not
5053 * relevant in the case the node is of type 'INDEXED_LOOKUP'.
5054 * When configuring nextEngine = e_FM_PCD_CC, note that
5055 * p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
5056 * different from the currently changed table.
5059 uint32_t fm_pcd_match_table_modify_miss_next_engine(t_handle h_cc_node,
5060 ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine_params);
5063 * @Function fm_pcd_match_table_remove_key
5065 * @Description Remove the key (including next engine parameters of this key)
5066 * defined by the index of the relevant node.
5068 * @Param[in] h_cc_node A handle to the node
5069 * @Param[in] key_index Key index for removing
5071 * @Return E_OK on success; Error code otherwise.
5073 * @Cautions Allowed only following fm_pcd_match_table_set() was called for
5074 * this node and the nodes that lead to it.
5076 uint32_t fm_pcd_match_table_remove_key(t_handle h_cc_node,
5077 uint16_t key_index);
5080 * @Function fm_pcd_match_table_add_key
5082 * @Description Add the key (including next engine parameters of this key in
5083 * the index defined by the key_index. Note that
5084 * 'FM_PCD_LAST_KEY_INDEX' may be used by user that don't care
5085 * about the position of the key in the table - in that case, the
5086 * key will be automatically added by the driver in the last
5089 * @Param[in] h_cc_node A handle to the node
5090 * @Param[in] key_index Key index for adding.
5091 * @Param[in] key_size Key size of added key
5092 * @Param[in] p_key_params A pointer to the parameters includes new key
5093 * with Next Engine Parameters
5095 * @Return E_OK on success; Error code otherwise.
5097 * @Cautions Allowed only following fm_pcd_match_table_set() was called for
5098 * this node and the nodes that lead to it.
5100 uint32_t fm_pcd_match_table_add_key(t_handle h_cc_node,
5103 ioc_fm_pcd_cc_key_params_t *p_key_params);
5106 * @Function fm_pcd_match_table_modify_next_engine
5108 * @Description Modify the Next Engine Parameters in the relevant key entry of
5111 * @Param[in] h_cc_node A handle to the node
5112 * @Param[in] key_index Key index for Next
5113 * Engine modifications
5114 * @Param[in] p_fm_pcd_cc_next_engine Parameters for defining
5117 * @Return E_OK on success; Error code otherwise.
5119 * @Cautions Allowed only following fm_pcd_match_table_set(). When
5120 * configuring nextEngine = e_FM_PCD_CC, note that
5121 * p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
5122 * different from the currently changed table.
5125 uint32_t fm_pcd_match_table_modify_next_engine(t_handle h_cc_node,
5127 ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine);
5130 * @Function fm_pcd_match_table_modify_key_and_next_engine
5132 * @Description Modify the key and Next Engine Parameters of this key in the
5133 * index defined by the key_index.
5135 * @Param[in] h_cc_node A handle to the node
5136 * @Param[in] key_index Key index for adding
5137 * @Param[in] key_size Key size of added key
5138 * @Param[in] p_key_params A pointer to the parameters includes
5139 * modified key and modified Next Engine
5142 * @Return E_OK on success; Error code otherwise.
5144 * @Cautions Allowed only following fm_pcd_match_table_set() was called for
5145 * this node and the nodes that lead to it. When configuring
5146 * nextEngine = e_FM_PCD_CC, note that
5147 * p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
5148 * different from the currently changed table.
5150 uint32_t fm_pcd_match_table_modify_key_and_next_engine(t_handle h_cc_node,
5153 ioc_fm_pcd_cc_key_params_t *p_key_params);
5156 * @Function fm_pcd_match_table_modify_key
5158 * @Description Modify the key in the index defined by the key_index.
5160 * @Param[in] h_cc_node A handle to the node
5161 * @Param[in] key_index Key index for adding
5162 * @Param[in] key_size Key size of added key
5163 * @Param[in] p_key A pointer to the new key
5164 * @Param[in] p_mask A pointer to the new mask if relevant,
5165 * otherwise pointer to NULL
5167 * @Return E_OK on success; Error code otherwise.
5169 * @Cautions Allowed only following fm_pcd_match_table_set() was called for
5170 * this node and the nodes that lead to it.
5172 uint32_t fm_pcd_match_table_modify_key(t_handle h_cc_node,
5179 * @Function fm_pcd_match_table_find_nremove_key
5181 * @Description Remove the key (including next engine parameters of this key)
5182 * defined by the key and mask. Note that this routine will
5183 * search the node to locate the index of the required key
5184 * (& mask) to remove.
5186 * @Param[in] h_cc_node A handle to the node
5187 * @Param[in] key_size Key size of the one to remove.
5188 * @Param[in] p_key A pointer to the requested key to remove.
5189 * @Param[in] p_mask A pointer to the mask if relevant,
5190 * otherwise pointer to NULL
5192 * @Return E_OK on success; Error code otherwise.
5194 * @Cautions Allowed only following fm_pcd_match_table_set() was called for
5195 * this node and the nodes that lead to it.
5197 uint32_t fm_pcd_match_table_find_nremove_key(t_handle h_cc_node,
5203 * @Function fm_pcd_match_table_find_nmodify_next_engine
5205 * @Description Modify the Next Engine Parameters in the relevant key entry of
5206 * the node. Note that this routine will search the node to
5207 * locate the index of the required key (& mask) to modify.
5209 * @Param[in] h_cc_node A handle to the node
5210 * @Param[in] key_size Key size of the one to modify.
5211 * @Param[in] p_key A pointer to the requested key to modify
5212 * @Param[in] p_mask A pointer to the mask if relevant,
5213 * otherwise pointer to NULL
5214 * @Param[in] p_fm_pcd_cc_next_engine Parameters for defining
5217 * @Return E_OK on success; Error code otherwise.
5219 * @Cautions Allowed only following fm_pcd_match_table_set(). When
5220 * configuring nextEngine = e_FM_PCD_CC, note that
5221 * p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
5222 * different from the currently changed table.
5224 uint32_t fm_pcd_match_table_find_nmodify_next_engine(t_handle h_cc_node,
5228 ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine);
5231 * @Function fm_pcd_match_table_find_nmodify_key_and_next_engine
5233 * @Description Modify the key and Next Engine Parameters of this key in the
5234 * index defined by the key_index. Note that this routine will
5235 * search the node to locate the index of the required key
5236 * (& mask) to modify.
5238 * @Param[in] h_cc_node A handle to the node
5239 * @Param[in] key_size Key size of the one to modify.
5240 * @Param[in] p_key A pointer to the requested key to modify
5241 * @Param[in] p_mask A pointer to the mask if relevant,
5242 * otherwise pointer to NULL
5243 * @Param[in] p_key_params A pointer to the parameters includes
5244 * modified key and modified Next Engine
5247 * @Return E_OK on success; Error code otherwise.
5249 * @Cautions Allowed only following fm_pcd_match_table_set() was called for
5250 * this node and the nodes that lead to it.
5251 * When configuring nextEngine = e_FM_PCD_CC, note that
5252 * p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
5253 * different from the currently changed table.
5255 uint32_t fm_pcd_match_table_find_nmodify_key_and_next_engine(t_handle h_cc_node,
5259 ioc_fm_pcd_cc_key_params_t *p_key_params);
5262 * @Function fm_pcd_match_table_find_nmodify_key
5264 * @Description Modify the key in the index defined by the key_index. Note
5265 * that this routine will search the node to locate the index of
5266 * the required key (& mask) to modify.
5268 * @Param[in] h_cc_node A handle to the node
5269 * @Param[in] key_size Key size of the one to modify.
5270 * @Param[in] p_key A pointer to the requested key to modify.
5271 * @Param[in] p_mask A pointer to the mask if relevant,
5272 * otherwise pointer to NULL
5273 * @Param[in] p_new_key A pointer to the new key
5274 * @Param[in] p_new_mask A pointer to the new mask if relevant,
5275 * otherwise pointer to NULL
5277 * @Return E_OK on success; Error code otherwise.
5279 * @Cautions Allowed only following fm_pcd_match_table_set() was called for
5280 * this node and the nodes that lead to it.
5282 uint32_t fm_pcd_match_table_find_nmodify_key(t_handle h_cc_node,
5287 uint8_t *p_new_mask);
5290 * @Function fm_pcd_match_table_get_key_counter
5292 * @Description This routine may be used to get a counter of specific key in a
5293 * CC Node; This counter reflects how many frames passed that
5294 * were matched this key.
5296 * @Param[in] h_cc_node A handle to the node
5297 * @Param[in] key_index Key index for adding
5299 * @Return The specific key counter.
5301 * @Cautions Allowed only following fm_pcd_match_table_set().
5303 uint32_t fm_pcd_match_table_get_key_counter(t_handle h_cc_node,
5304 uint16_t key_index);
5307 * @Function fm_pcd_match_table_get_key_statistics
5309 * @Description This routine may be used to get statistics counters of
5310 * specific key in a CC Node.
5312 * If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
5313 * 'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
5314 * node, these counters reflect how many frames passed that were
5315 * matched this key; The total frames count will be returned in
5316 * the counter of the first range (as only one frame length range
5317 * was defined). If 'e_FM_PCD_CC_STATS_MODE_RMON' was set for
5318 * this node, the total frame count will be separated to frame
5319 * length counters, based on provided frame length ranges.
5321 * @Param[in] h_cc_node A handle to the node
5322 * @Param[in] key_index Key index for adding
5323 * @Param[out] p_key_statistics Key statistics counters
5325 * @Return The specific key statistics.
5327 * @Cautions Allowed only following fm_pcd_match_table_set().
5329 uint32_t fm_pcd_match_table_get_key_statistics(t_handle h_cc_node,
5331 ioc_fm_pcd_cc_key_statistics_t *p_key_statistics);
5334 * @Function fm_pcd_match_table_get_miss_statistics
5336 * @Description This routine may be used to get statistics counters of miss
5337 * entry in a CC Node.
5339 * If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
5340 * 'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
5341 * node, these counters reflect how many frames were not matched
5342 * to any existing key and therefore passed through the miss
5343 * entry; The total frames count will be returned in the counter
5344 * of the first range (as only one frame length range was
5347 * @Param[in] h_cc_node A handle to the node
5348 * @Param[out] p_miss_statistics Statistics counters for 'miss'
5350 * @Return The statistics for 'miss'.
5352 * @Cautions Allowed only following fm_pcd_match_table_set().
5354 uint32_t fm_pcd_match_table_get_miss_statistics(t_handle h_cc_node,
5355 ioc_fm_pcd_cc_key_statistics_t *p_miss_statistics);
5358 * @Function fm_pcd_match_table_find_nget_key_statistics
5360 * @Description This routine may be used to get statistics counters of
5361 * specific key in a CC Node.
5363 * If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
5364 * 'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
5365 * node, these counters reflect how many frames passed that were
5366 * matched this key; The total frames count will be returned in
5367 * the counter of the first range (as only one frame length range
5368 * was defined). If 'e_FM_PCD_CC_STATS_MODE_RMON' was set for
5369 * this node, the total frame count will be separated to frame
5370 * length counters, based on provided frame length ranges.
5371 * Note that this routine will search the node to locate the
5372 * index of the required key based on received key parameters.
5374 * @Param[in] h_cc_node A handle to the node
5375 * @Param[in] key_size Size of the requested key
5376 * @Param[in] p_key A pointer to the requested key
5377 * @Param[in] p_mask A pointer to the mask if relevant,
5378 * otherwise pointer to NULL
5379 * @Param[out] p_key_statistics Key statistics counters
5381 * @Return The specific key statistics.
5383 * @Cautions Allowed only following fm_pcd_match_table_set().
5385 uint32_t fm_pcd_match_table_find_nget_key_statistics(t_handle h_cc_node,
5389 ioc_fm_pcd_cc_key_statistics_t *p_key_statistics);
5392 * @Function fm_pcd_match_table_get_next_engine
5394 * @Description Gets NextEngine of the relevant key_index.
5396 * @Param[in] h_cc_node A handle to the node.
5397 * @Param[in] key_index key_index in the
5399 * @Param[out] p_fm_pcd_cc_next_engine_params here updated
5400 * nextEngine parameters
5402 * key_index of the CC Node
5403 * received as parameter to
5406 * @Return E_OK on success; Error code otherwise.
5408 * @Cautions Allowed only following fm_pcd_init().
5410 uint32_t fm_pcd_match_table_get_next_engine(t_handle h_cc_node,
5412 ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine_params);
5415 * @Function fm_pcd_match_table_get_indexed_hash_bucket
5417 * @Description This routine simulates KeyGen operation on the provided key
5418 * and calculates to which hash bucket it will be mapped.
5420 * @Param[in] h_cc_node A handle to the node.
5421 * @Param[in] kg_key_size Key size as it was configured in
5422 * the KG scheme that leads to this
5424 * @Param[in] p_kg_key Pointer to the key; must be like
5425 * the key that the KG is
5426 * generated, i.e. the same
5427 * extraction and with mask if
5429 * @Param[in] kg_hash_shift Hash-shift as it was configured
5430 * in the KG scheme that leads to
5432 * @Param[out] p_cc_node_bucket_handle Pointer to the bucket of the
5434 * @Param[out] p_bucket_index Index to the bucket of the
5436 * @Param[out] p_last_index Pointer to last index in the
5437 * bucket of the provided key.
5439 * @Return E_OK on success; Error code otherwise.
5441 * @Cautions Allowed only following fm_pcd_hash_table_set()
5443 uint32_t fm_pcd_match_table_get_indexed_hash_bucket(t_handle h_cc_node,
5444 uint8_t kg_key_size,
5446 uint8_t kg_hash_shift,
5447 t_handle *p_cc_node_bucket_handle,
5448 uint8_t *p_bucket_index,
5449 uint16_t *p_last_index);
5452 * @Function fm_pcd_hash_table_set
5454 * @Description This routine initializes a hash table structure.
5455 * KeyGen hash result determines the hash bucket.
5456 * Next, KeyGen key is compared against all keys of this bucket
5458 * Number of sets (number of buckets) of the hash equals to the
5459 * number of 1-s in 'hashResMask' in the provided parameters.
5460 * Number of hash table ways is then calculated by dividing
5461 * 'max_num_of_keys' equally between the hash sets. This is the
5462 * maximal number of keys that a hash bucket may hold.
5463 * The hash table is initialized empty and keys may be added to
5464 * it following the initialization. Keys masks are not supported
5465 * in current hash table implementation.
5466 * The initialized hash table can be integrated as a node in a CC
5469 * @Param[in] h_fm_pcd FM PCD module descriptor.
5470 * @Param[in] p_param A structure of parameters defining the hash
5473 * @Return A handle to the initialized object on success; NULL code
5476 * @Cautions Allowed only following fm_pcd_init().
5478 t_handle fm_pcd_hash_table_set(t_handle h_fm_pcd,
5479 ioc_fm_pcd_hash_table_params_t *p_param);
5482 * @Function fm_pcd_hash_table_delete
5484 * @Description This routine deletes the provided hash table and released all
5485 * its allocated resources.
5487 * @Param[in] h_hash_tbl A handle to a hash table
5489 * @Return E_OK on success; Error code otherwise.
5491 * @Cautions Allowed only following fm_pcd_hash_table_set().
5493 uint32_t fm_pcd_hash_table_delete(t_handle h_hash_tbl);
5496 * @Function fm_pcd_hash_table_add_key
5498 * @Description This routine adds the provided key (including next engine
5499 * parameters of this key) to the hash table.
5500 * The key is added as the last key of the bucket that it is
5503 * @Param[in] h_hash_tbl A handle to a hash table
5504 * @Param[in] key_size Key size of added key
5505 * @Param[in] p_key_params A pointer to the parameters includes
5506 * new key with next engine parameters; The pointer
5507 * to the key mask must be NULL, as masks are not
5508 * supported in hash table implementation.
5510 * @Return E_OK on success; Error code otherwise.
5512 * @Cautions Allowed only following fm_pcd_hash_table_set().
5514 uint32_t fm_pcd_hash_table_add_key(t_handle h_hash_tbl,
5516 ioc_fm_pcd_cc_key_params_t *p_key_params);
5519 * @Function fm_pcd_hash_table_remove_key
5521 * @Description This routine removes the requested key (including next engine
5522 * parameters of this key) from the hash table.
5524 * @Param[in] h_hash_tbl A handle to a hash table
5525 * @Param[in] key_size Key size of the one to remove.
5526 * @Param[in] p_key A pointer to the requested key to remove.
5528 * @Return E_OK on success; Error code otherwise.
5530 * @Cautions Allowed only following fm_pcd_hash_table_set().
5532 uint32_t fm_pcd_hash_table_remove_key(t_handle h_hash_tbl,
5537 * @Function fm_pcd_hash_table_modify_next_engine
5539 * @Description This routine modifies the next engine for the provided key.
5540 * The key should be previously added to the hash table.
5542 * @Param[in] h_hash_tbl A handle to a hash table
5543 * @Param[in] key_size Key size of the key to modify.
5544 * @Param[in] p_key A pointer to the requested key
5546 * @Param[in] p_fm_pcd_cc_next_engine A structure for defining
5547 * new next engine parameters.
5549 * @Return E_OK on success; Error code otherwise.
5551 * @Cautions Allowed only following fm_pcd_hash_table_set().
5552 * When configuring nextEngine = e_FM_PCD_CC, note that
5553 * p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
5554 * different from the currently changed table.
5556 uint32_t fm_pcd_hash_table_modify_next_engine(t_handle h_hash_tbl,
5559 ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine);
5562 * @Function fm_pcd_hash_table_modify_miss_next_engine
5564 * @Description This routine modifies the next engine on key match miss.
5566 * @Param[in] h_hash_tbl A handle to a hash table
5567 * @Param[in] p_fm_pcd_cc_next_engine A structure for defining
5568 * new next engine parameters.
5570 * @Return E_OK on success; Error code otherwise.
5572 * @Cautions Allowed only following fm_pcd_hash_table_set().
5573 * When configuring nextEngine = e_FM_PCD_CC, note that
5574 * p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
5575 * different from the currently changed table.
5577 uint32_t fm_pcd_hash_table_modify_miss_next_engine(t_handle h_hash_tbl,
5578 ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine);
5581 * @Function fm_pcd_hash_table_get_miss_next_engine
5583 * @Description Gets NextEngine in case of key match miss.
5585 * @Param[in] h_hash_tbl A handle to a hash table
5586 * @Param[out] p_fm_pcd_cc_next_engine_params Next engine parameters
5587 * for the specified hash
5590 * @Return E_OK on success; Error code otherwise.
5592 * @Cautions Allowed only following fm_pcd_hash_table_set().
5594 uint32_t fm_pcd_hash_table_get_miss_next_engine(t_handle h_hash_tbl,
5595 ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine_params);
5598 * @Function fm_pcd_hash_table_find_nget_key_statistics
5600 * @Description This routine may be used to get statistics counters of
5601 * specific key in a hash table.
5603 * If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
5604 * 'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
5605 * node, these counters reflect how many frames passed that were
5606 * matched this key; The total frames count will be returned in
5607 * the counter of the first range (as only one frame length range
5608 * was defined). If 'e_FM_PCD_CC_STATS_MODE_RMON' was set for
5609 * this node, the total frame count will be separated to frame
5610 * length counters, based on provided frame length ranges. Note
5611 * that this routine will identify the bucket of this key in the
5612 * hash table and will search the bucket to locate the index of
5613 * the required key based on received key parameters.
5615 * @Param[in] h_hash_tbl A handle to a hash table
5616 * @Param[in] key_size Size of the requested key
5617 * @Param[in] p_key A pointer to the requested key
5618 * @Param[out] p_key_statistics Key statistics counters
5620 * @Return The specific key statistics.
5622 * @Cautions Allowed only following fm_pcd_hash_table_set().
5624 uint32_t fm_pcd_hash_table_find_nget_key_statistics(t_handle h_hash_tbl,
5627 ioc_fm_pcd_cc_key_statistics_t *p_key_statistics);
5630 * @Function fm_pcd_hash_table_get_miss_statistics
5632 * @Description This routine may be used to get statistics counters of 'miss'
5633 * entry of the a hash table.
5635 * If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
5636 * 'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
5637 * node, these counters reflect how many frames were not matched
5638 * to any existing key and therefore passed through the miss
5641 * @Param[in] h_hash_tbl A handle to a hash table
5642 * @Param[out] p_miss_statistics Statistics counters for 'miss'
5644 * @Return The statistics for 'miss'.
5646 * @Cautions Allowed only following fm_pcd_hash_table_set().
5648 uint32_t fm_pcd_hash_table_get_miss_statistics(t_handle h_hash_tbl,
5649 ioc_fm_pcd_cc_key_statistics_t *p_miss_statistics);
5652 * @Function fm_pcd_manip_node_set
5654 * @Description This routine should be called for defining a manipulation
5655 * node. A manipulation node must be defined before the CC node
5658 * @Param[in] h_fm_pcd FM PCD module descriptor.
5659 * @Param[in] p_fm_pcd_manip_params A structure of parameters
5660 * defining the manipulation
5662 * @Return A handle to the initialized object on success; NULL code
5665 * @Cautions Allowed only following fm_pcd_init().
5667 t_handle fm_pcd_manip_node_set(t_handle h_fm_pcd,
5668 ioc_fm_pcd_manip_params_t *p_fm_pcd_manip_params);
5671 * @Function fm_pcd_manip_node_delete
5673 * @Description Delete an existing manipulation node.
5675 * @Param[in] h_manip_node A handle to a manipulation node.
5677 * @Return E_OK on success; Error code otherwise.
5679 * @Cautions Allowed only following fm_pcd_manip_node_set().
5681 uint32_t fm_pcd_manip_node_delete(t_handle h_manip_node);
5684 * @Function fm_pcd_manip_get_statistics
5686 * @Description Retrieve the manipulation statistics.
5688 * @Param[in] h_manip_node A handle to a manipulation node.
5689 * @Param[out] p_fm_pcd_manip_stats A structure for retrieving the
5690 * manipulation statistics
5692 * @Return E_OK on success; Error code otherwise.
5694 * @Cautions Allowed only following fm_pcd_manip_node_set().
5696 uint32_t fm_pcd_manip_get_statistics(t_handle h_manip_node,
5697 ioc_fm_pcd_manip_stats_t *p_fm_pcd_manip_stats);
5700 * @Function fm_pcd_manip_node_replace
5702 * @Description Change existing manipulation node to be according to new
5705 * @Param[in] h_manip_node A handle to a manipulation node.
5706 * @Param[out] p_manip_params A structure of parameters defining the
5707 * change requirement
5709 * @Return E_OK on success; Error code otherwise.
5711 * @Cautions Allowed only following fm_pcd_manip_node_set().
5713 uint32_t fm_pcd_manip_node_replace(t_handle h_manip_node,
5714 ioc_fm_pcd_manip_params_t *p_manip_params);
5717 * @Function fm_pcd_frm_replic_set_group
5719 * @Description Initialize a Frame Replicator group.
5721 * @Param[in] h_fm_pcd FM PCD module descriptor.
5722 * @Param[in] p_frm_replic_group_param A structure of parameters for
5723 * the initialization of the frame
5726 * @Return A handle to the initialized object on success; NULL code
5729 * @Cautions Allowed only following fm_pcd_init().
5731 t_handle fm_pcd_frm_replic_set_group(t_handle h_fm_pcd,
5732 ioc_fm_pcd_frm_replic_group_params_t *p_frm_replic_group_param);
5735 * @Function fm_pcd_frm_replic_delete_group
5737 * @Description Delete a Frame Replicator group.
5739 * @Param[in] h_frm_replic_group A handle to the frame replicator group.
5741 * @Return E_OK on success; Error code otherwise.
5743 * @Cautions Allowed only following fm_pcd_frm_replic_set_group().
5745 uint32_t fm_pcd_frm_replic_delete_group(t_handle h_frm_replic_group);
5748 * @Function fm_pcd_frm_replic_add_member
5750 * @Description Add the member in the index defined by the member_index.
5752 * @Param[in] h_frm_replic_group A handle to the frame replicator group.
5753 * @Param[in] member_index member index for adding.
5754 * @Param[in] p_member_params A pointer to the new member parameters.
5756 * @Return E_OK on success; Error code otherwise.
5758 * @Cautions Allowed only following fm_pcd_frm_replic_set_group() of this
5761 uint32_t fm_pcd_frm_replic_add_member(t_handle h_frm_replic_group,
5762 uint16_t member_index,
5763 ioc_fm_pcd_cc_next_engine_params_t *p_member_params);
5766 * @Function fm_pcd_frm_replic_remove_member
5768 * @Description Remove the member defined by the index from the relevant
5771 * @Param[in] h_frm_replic_group A handle to the frame replicator group.
5772 * @Param[in] member_index member index for removing.
5774 * @Return E_OK on success; Error code otherwise.
5776 * @Cautions Allowed only following fm_pcd_frm_replic_set_group() of this
5779 uint32_t fm_pcd_frm_replic_remove_member(t_handle h_frm_replic_group,
5780 uint16_t member_index);
5782 /** @} */ /* end of FM_PCD_Runtime_build_grp group */
5783 /** @} */ /* end of FM_PCD_Runtime_grp group */
5784 /** @} */ /* end of FM_PCD_grp group */
5785 /** @} */ /* end of FM_grp group */
5787 #endif /* __FM_PCD_EXT_H */