xref: /dpdk/drivers/net/dpaa/fmlib/fm_pcd_ext.h (revision 7be78d027918dbc846e502780faf94d5acdf5f75)
12ffc1057SHemant Agrawal /* SPDX-License-Identifier: BSD-3-Clause
22ffc1057SHemant Agrawal  * Copyright 2008-2012 Freescale Semiconductor Inc.
32ffc1057SHemant Agrawal  * Copyright 2017-2020 NXP
42ffc1057SHemant Agrawal  */
52ffc1057SHemant Agrawal 
62ffc1057SHemant Agrawal #ifndef __FM_PCD_EXT_H
72ffc1057SHemant Agrawal #define __FM_PCD_EXT_H
82ffc1057SHemant Agrawal 
92ffc1057SHemant Agrawal #include "ncsw_ext.h"
102ffc1057SHemant Agrawal #include "net_ext.h"
112ffc1057SHemant Agrawal #include "fm_ext.h"
122ffc1057SHemant Agrawal 
132ffc1057SHemant Agrawal /*
142ffc1057SHemant Agrawal  * @Description	  FM PCD ...
152ffc1057SHemant Agrawal  * @Group	  lnx_ioctl_FM_grp Frame Manager Linux IOCTL API
162ffc1057SHemant Agrawal  * @Description	  Frame Manager Linux ioctls definitions and enums
172ffc1057SHemant Agrawal  * @{
182ffc1057SHemant Agrawal  */
192ffc1057SHemant Agrawal 
202ffc1057SHemant Agrawal /*
212ffc1057SHemant Agrawal  * @Group	  lnx_ioctl_FM_PCD_grp FM PCD
222ffc1057SHemant Agrawal  * @Description	  Frame Manager PCD API functions, definitions and enums
232ffc1057SHemant Agrawal  *
242ffc1057SHemant Agrawal  *		  The FM PCD module is responsible for the initialization of all
252ffc1057SHemant Agrawal  *		  global classifying FM modules. This includes the parser
262ffc1057SHemant Agrawal  *		  general and common registers, the key generator global and
272ffc1057SHemant Agrawal  *		  common registers, and the policer global and common registers.
282ffc1057SHemant Agrawal  *		  In addition, the FM PCD SW module will initialize all required
292ffc1057SHemant Agrawal  *		  key generator schemes, coarse classification flows, and
302ffc1057SHemant Agrawal  *		  policer profiles. When an FM module is configured to work with
312ffc1057SHemant Agrawal  *		  one of these entities, it will register to it using the FM
322ffc1057SHemant Agrawal  *		  PORT API. The PCD module will manage the PCD resources - i.e.
332ffc1057SHemant Agrawal  *		  resource management of KeyGen schemes, etc.
342ffc1057SHemant Agrawal  *
352ffc1057SHemant Agrawal  * @{
362ffc1057SHemant Agrawal  */
372ffc1057SHemant Agrawal 
382ffc1057SHemant Agrawal /*
392ffc1057SHemant Agrawal  * @Collection	General PCD defines
402ffc1057SHemant Agrawal  */
412ffc1057SHemant Agrawal #define IOC_FM_PCD_MAX_NUM_OF_PRIVATE_HDRS		2
422ffc1057SHemant Agrawal /**< Number of units/headers saved for user */
432ffc1057SHemant Agrawal 
442ffc1057SHemant Agrawal #define IOC_FM_PCD_PRS_NUM_OF_HDRS			16
452ffc1057SHemant Agrawal /**< Number of headers supported by HW parser */
462ffc1057SHemant Agrawal #define IOC_FM_PCD_MAX_NUM_OF_DISTINCTION_UNITS \
472ffc1057SHemant Agrawal 	(32 - IOC_FM_PCD_MAX_NUM_OF_PRIVATE_HDRS)
482ffc1057SHemant Agrawal /**< Number of distinction units is limited by register size (32 bits) minus
492ffc1057SHemant Agrawal  * reserved bits for private headers.
502ffc1057SHemant Agrawal  */
512ffc1057SHemant Agrawal #define IOC_FM_PCD_MAX_NUM_OF_INTERCHANGEABLE_HDRS	4
522ffc1057SHemant Agrawal /**< Maximum number of interchangeable headers in a distinction unit */
532ffc1057SHemant Agrawal #define IOC_FM_PCD_KG_NUM_OF_GENERIC_REGS		8
542ffc1057SHemant Agrawal /**< Total number of generic KeyGen registers */
552ffc1057SHemant Agrawal #define IOC_FM_PCD_KG_MAX_EXTRACTS_PER_KEY	35
562ffc1057SHemant Agrawal /**< Max number allowed on any configuration; For HW implementation reasons,
572ffc1057SHemant Agrawal  * in most cases less than this will be allowed; The driver will return an
582ffc1057SHemant Agrawal  * initialization error if resource is unavailable.
592ffc1057SHemant Agrawal  */
602ffc1057SHemant Agrawal #define IOC_FM_PCD_KG_NUM_OF_EXTRACT_MASKS		4
612ffc1057SHemant Agrawal /**< Total number of masks allowed on KeyGen extractions. */
622ffc1057SHemant Agrawal #define IOC_FM_PCD_KG_NUM_OF_DEFAULT_GROUPS		16
632ffc1057SHemant Agrawal /**< Number of default value logical groups */
642ffc1057SHemant Agrawal #define IOC_FM_PCD_PRS_NUM_OF_LABELS			32
652ffc1057SHemant Agrawal /**< Maximum number of SW parser labels */
662ffc1057SHemant Agrawal #define IOC_FM_PCD_SW_PRS_SIZE			0x00000800
672ffc1057SHemant Agrawal /**< Total size of SW parser area */
682ffc1057SHemant Agrawal 
692ffc1057SHemant Agrawal #define IOC_FM_PCD_MAX_MANIP_INSRT_TEMPLATE_SIZE	128
702ffc1057SHemant Agrawal /**< Maximum size of insertion template for insert manipulation */
712ffc1057SHemant Agrawal 
722ffc1057SHemant Agrawal #define IOC_FM_PCD_FRM_REPLIC_MAX_NUM_OF_ENTRIES	64
732ffc1057SHemant Agrawal /**< Maximum possible entries for frame replicator group */
742ffc1057SHemant Agrawal /* @} */
752ffc1057SHemant Agrawal 
762ffc1057SHemant Agrawal /*
772ffc1057SHemant Agrawal  * @Group	  lnx_ioctl_FM_PCD_init_grp FM PCD Initialization Unit
782ffc1057SHemant Agrawal  *
792ffc1057SHemant Agrawal  * @Description   Frame Manager PCD Initialization Unit API
802ffc1057SHemant Agrawal  *
812ffc1057SHemant Agrawal  * @{
822ffc1057SHemant Agrawal  */
832ffc1057SHemant Agrawal 
842ffc1057SHemant Agrawal /*
852ffc1057SHemant Agrawal  * @Description   PCD counters
862ffc1057SHemant Agrawal  *		  (must match enum ioc_fm_pcd_counters defined in fm_pcd_ext.h)
872ffc1057SHemant Agrawal  */
882ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_counters {
892ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_COUNTERS_TOTAL,		/**< KeyGen counter */
902ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_COUNTERS_RED,
912ffc1057SHemant Agrawal 	/**< Policer counter - counts the total number of RED packets that exit
922ffc1057SHemant Agrawal 	 * the Policer.
932ffc1057SHemant Agrawal 	 */
942ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_COUNTERS_YELLOW,
952ffc1057SHemant Agrawal 	/**< Policer counter - counts the total number of YELLOW packets that
962ffc1057SHemant Agrawal 	 * exit the Policer.
972ffc1057SHemant Agrawal 	 */
982ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_COUNTERS_RECOLORED_TO_RED,
992ffc1057SHemant Agrawal 	/**< Policer counter - counts the number of packets that changed color
1002ffc1057SHemant Agrawal 	 * to RED by the Policer; This is a subset of
1012ffc1057SHemant Agrawal 	 * e_IOC_FM_PCD_PLCR_COUNTERS_RED packet count, indicating active color
1022ffc1057SHemant Agrawal 	 * changes.
1032ffc1057SHemant Agrawal 	 */
1042ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_COUNTERS_RECOLORED_TO_YELLOW,
1052ffc1057SHemant Agrawal 	/**< Policer counter - counts the number of packets that changed color
1062ffc1057SHemant Agrawal 	 * to YELLOW by the Policer; This is a subset of
1072ffc1057SHemant Agrawal 	 * e_IOC_FM_PCD_PLCR_COUNTERS_YELLOW packet count, indicating active
1082ffc1057SHemant Agrawal 	 * color changes.
1092ffc1057SHemant Agrawal 	 */
1102ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_COUNTERS_TOTAL,
1112ffc1057SHemant Agrawal 	/**< Policer counter - counts the total number of packets passed in the
1122ffc1057SHemant Agrawal 	 * Policer.
1132ffc1057SHemant Agrawal 	 */
1142ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_COUNTERS_LENGTH_MISMATCH,
1152ffc1057SHemant Agrawal 	/**< Policer counter - counts the number of packets with length
1162ffc1057SHemant Agrawal 	 * mismatch.
1172ffc1057SHemant Agrawal 	 */
1182ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_PARSE_DISPATCH,
1192ffc1057SHemant Agrawal 	/**< Parser counter - counts the number of times the parser block is
1202ffc1057SHemant Agrawal 	 * dispatched.
1212ffc1057SHemant Agrawal 	 */
1222ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_L2_PARSE_RESULT_RETURNED,
1232ffc1057SHemant Agrawal 	/**< Parser counter - counts the number of times L2 parse result is
1242ffc1057SHemant Agrawal 	 * returned (including errors).
1252ffc1057SHemant Agrawal 	 */
1262ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_L3_PARSE_RESULT_RETURNED,
1272ffc1057SHemant Agrawal 	/**< Parser counter - counts the number of times L3 parse result is
1282ffc1057SHemant Agrawal 	 * returned (including errors).
1292ffc1057SHemant Agrawal 	 */
1302ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_L4_PARSE_RESULT_RETURNED,
1312ffc1057SHemant Agrawal 	/**< Parser counter - counts the number of times L4 parse result is
1322ffc1057SHemant Agrawal 	 * returned (including errors).
1332ffc1057SHemant Agrawal 	 */
1342ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_SHIM_PARSE_RESULT_RETURNED,
1352ffc1057SHemant Agrawal 	/**< Parser counter - counts the number of times SHIM parse result is
1362ffc1057SHemant Agrawal 	 * returned (including errors).
1372ffc1057SHemant Agrawal 	 */
1382ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_L2_PARSE_RESULT_RETURNED_WITH_ERR,
1392ffc1057SHemant Agrawal 	/**< Parser counter - counts the number of times L2 parse result is
1402ffc1057SHemant Agrawal 	 * returned with errors.
1412ffc1057SHemant Agrawal 	 */
1422ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_L3_PARSE_RESULT_RETURNED_WITH_ERR,
1432ffc1057SHemant Agrawal 	/**< Parser counter - counts the number of times L3 parse result is
1442ffc1057SHemant Agrawal 	 * returned with errors.
1452ffc1057SHemant Agrawal 	 */
1462ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_L4_PARSE_RESULT_RETURNED_WITH_ERR,
1472ffc1057SHemant Agrawal 	/**< Parser counter - counts the number of times L4 parse result is
1482ffc1057SHemant Agrawal 	 * returned with errors.
1492ffc1057SHemant Agrawal 	 */
1502ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_SHIM_PARSE_RESULT_RETURNED_WITH_ERR,
1512ffc1057SHemant Agrawal 	/**< Parser counter - counts the number of times SHIM parse result is
1522ffc1057SHemant Agrawal 	 * returned with errors.
1532ffc1057SHemant Agrawal 	 */
1542ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_SOFT_PRS_CYCLES,
1552ffc1057SHemant Agrawal 	/**< Parser counter - counts the number of cycles spent executing soft
1562ffc1057SHemant Agrawal 	 * parser instruction (including stall cycles).
1572ffc1057SHemant Agrawal 	 */
1582ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_SOFT_PRS_STALL_CYCLES,
1592ffc1057SHemant Agrawal 	/**< Parser counter - counts the number of cycles stalled waiting for
1602ffc1057SHemant Agrawal 	 * parser internal memory reads while executing soft parser instruction.
1612ffc1057SHemant Agrawal 	 */
1622ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_HARD_PRS_CYCLE_INCL_STALL_CYCLES,
1632ffc1057SHemant Agrawal 	/**< Parser counter - counts the number of cycles spent executing hard
1642ffc1057SHemant Agrawal 	 * parser (including stall cycles).
1652ffc1057SHemant Agrawal 	 */
1662ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_MURAM_READ_CYCLES,
1672ffc1057SHemant Agrawal 	/**< MURAM counter - counts the number of cycles while performing FMan
1682ffc1057SHemant Agrawal 	 * Memory read.
1692ffc1057SHemant Agrawal 	 */
1702ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_MURAM_READ_STALL_CYCLES,
1712ffc1057SHemant Agrawal 	/**< MURAM counter - counts the number of cycles stalled while
1722ffc1057SHemant Agrawal 	 * performing FMan Memory read.
1732ffc1057SHemant Agrawal 	 */
1742ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_MURAM_WRITE_CYCLES,
1752ffc1057SHemant Agrawal 	/**< MURAM counter - counts the number of cycles while performing FMan
1762ffc1057SHemant Agrawal 	 * Memory write.
1772ffc1057SHemant Agrawal 	 */
1782ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_MURAM_WRITE_STALL_CYCLES,
1792ffc1057SHemant Agrawal 	/**< MURAM counter - counts the number of cycles stalled while
1802ffc1057SHemant Agrawal 	 * performing FMan Memory write.
1812ffc1057SHemant Agrawal 	 */
1822ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_COUNTERS_FPM_COMMAND_STALL_CYCLES
1832ffc1057SHemant Agrawal 	/**< FPM counter - counts the number of cycles stalled while performing
1842ffc1057SHemant Agrawal 	 * a FPM Command.
1852ffc1057SHemant Agrawal 	 */
1862ffc1057SHemant Agrawal } ioc_fm_pcd_counters;
1872ffc1057SHemant Agrawal 
1882ffc1057SHemant Agrawal /*
1892ffc1057SHemant Agrawal  * @Description   PCD interrupts
1902ffc1057SHemant Agrawal  *		  (must match enum ioc_fm_pcd_exceptions defined in
1912ffc1057SHemant Agrawal  *		  fm_pcd_ext.h)
1922ffc1057SHemant Agrawal  */
1932ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_exceptions {
1942ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_EXCEPTION_DOUBLE_ECC,
1952ffc1057SHemant Agrawal 	/**< KeyGen double-bit ECC error is detected on internal memory read
1962ffc1057SHemant Agrawal 	 * access.
1972ffc1057SHemant Agrawal 	 */
1982ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_EXCEPTION_KEYSIZE_OVERFLOW,
1992ffc1057SHemant Agrawal 	/**< KeyGen scheme configuration error indicating a key size larger than
2002ffc1057SHemant Agrawal 	 * 56 bytes.
2012ffc1057SHemant Agrawal 	 */
2022ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_EXCEPTION_DOUBLE_ECC,
2032ffc1057SHemant Agrawal 	/**< Policer double-bit ECC error has been detected on PRAM read access.
2042ffc1057SHemant Agrawal 	 */
2052ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_EXCEPTION_INIT_ENTRY_ERROR,
2062ffc1057SHemant Agrawal 	/**< Policer access to a non-initialized profile has been detected. */
2072ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_EXCEPTION_PRAM_SELF_INIT_COMPLETE,
2082ffc1057SHemant Agrawal 	/**< Policer RAM self-initialization complete */
2092ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_EXCEPTION_ATOMIC_ACTION_COMPLETE,
2102ffc1057SHemant Agrawal 	/**< Policer atomic action complete */
2112ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_EXCEPTION_DOUBLE_ECC,
2122ffc1057SHemant Agrawal 	/**< Parser double-bit ECC error */
2132ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS_EXCEPTION_SINGLE_ECC
2142ffc1057SHemant Agrawal 	/**< Parser single-bit ECC error */
2152ffc1057SHemant Agrawal } ioc_fm_pcd_exceptions;
2162ffc1057SHemant Agrawal 
2172ffc1057SHemant Agrawal /** @} */ /* end of lnx_ioctl_FM_PCD_init_grp group */
2182ffc1057SHemant Agrawal 
2192ffc1057SHemant Agrawal /*
2202ffc1057SHemant Agrawal  * @Group	  lnx_ioctl_FM_PCD_Runtime_grp FM PCD Runtime Unit
2212ffc1057SHemant Agrawal  *
2222ffc1057SHemant Agrawal  * @Description   Frame Manager PCD Runtime Unit
2232ffc1057SHemant Agrawal  *
2242ffc1057SHemant Agrawal  *		  The runtime control allows creation of PCD infrastructure
2252ffc1057SHemant Agrawal  *		  modules such as Network Environment Characteristics,
2262ffc1057SHemant Agrawal  *		  Classification Plan Groups and Coarse Classification Trees.
2272ffc1057SHemant Agrawal  *		  It also allows on-the-fly initialization, modification and
2282ffc1057SHemant Agrawal  *		  removal of PCD modules such as KeyGen schemes, coarse
2292ffc1057SHemant Agrawal  *		  classification nodes and Policer profiles.
2302ffc1057SHemant Agrawal  *
2312ffc1057SHemant Agrawal  *		  In order to explain the programming model of the PCD driver
2322ffc1057SHemant Agrawal  *		  interface a few terms should be explained, and will be used
2332ffc1057SHemant Agrawal  *		  below.
2342ffc1057SHemant Agrawal  *		  - Distinction Header - One of the 16 protocols supported by
2352ffc1057SHemant Agrawal  *		    the FM parser, or one of the SHIM headers (1 or 2). May be a
2362ffc1057SHemant Agrawal  *		    header with a special option (see below).
2372ffc1057SHemant Agrawal  *		  - Interchangeable Headers Group - This is a group of Headers
2382ffc1057SHemant Agrawal  *		    recognized by either one of them. For example, if in a
2392ffc1057SHemant Agrawal  *		    specific context the user chooses to treat IPv4 and IPV6 in
2402ffc1057SHemant Agrawal  *		    the same way, they may create an interchangeable Headers
2412ffc1057SHemant Agrawal  *		    Unit consisting of these 2 headers.
2422ffc1057SHemant Agrawal  *		  - A Distinction Unit - a Distinction Header or an
2432ffc1057SHemant Agrawal  *		    Interchangeable Headers Group.
2442ffc1057SHemant Agrawal  *		  - Header with special option - applies to Ethernet, MPLS,
2452ffc1057SHemant Agrawal  *		    VLAN, IPv4 and IPv6, includes multicast, broadcast and other
2462ffc1057SHemant Agrawal  *		    protocol specific options. In terms of hardware it relates
2472ffc1057SHemant Agrawal  *		    to the options available in the classification plan.
2482ffc1057SHemant Agrawal  *		  - Network Environment Characteristics - a set of Distinction
2492ffc1057SHemant Agrawal  *		    Units that define the total recognizable header selection
2502ffc1057SHemant Agrawal  *		    for a certain environment. This is NOT the list of all
2512ffc1057SHemant Agrawal  *		    headers that will ever appear in a flow, but rather
2522ffc1057SHemant Agrawal  *		    everything that needs distinction in a flow, where
2532ffc1057SHemant Agrawal  *		    distinction is made by KeyGen schemes and coarse
2542ffc1057SHemant Agrawal  *		    classification action descriptors.
2552ffc1057SHemant Agrawal  *
2562ffc1057SHemant Agrawal  *		  The PCD runtime modules initialization is done in stages. The
2572ffc1057SHemant Agrawal  *		  first stage after initializing the PCD module itself is to
2582ffc1057SHemant Agrawal  *		  establish a Network Flows Environment Definition. The
2592ffc1057SHemant Agrawal  *		  application may choose to establish one or more such
2602ffc1057SHemant Agrawal  *		  environments. Later, when needed, the application will have to
2612ffc1057SHemant Agrawal  *		  state, for some of its modules, to which single environment it
2622ffc1057SHemant Agrawal  *		  belongs.
2632ffc1057SHemant Agrawal  *
2642ffc1057SHemant Agrawal  * @{
2652ffc1057SHemant Agrawal  */
2662ffc1057SHemant Agrawal 
2672ffc1057SHemant Agrawal /*
2682ffc1057SHemant Agrawal  * @Description   structure for FM counters
2692ffc1057SHemant Agrawal  */
2702ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_counters_params_t {
2712ffc1057SHemant Agrawal 	ioc_fm_pcd_counters cnt;	/**< The requested counter */
2722ffc1057SHemant Agrawal 	uint32_t	val;
2732ffc1057SHemant Agrawal 			/**< The requested value to get/set from/into the
2742ffc1057SHemant Agrawal 			 * counter
2752ffc1057SHemant Agrawal 			 */
2762ffc1057SHemant Agrawal } ioc_fm_pcd_counters_params_t;
2772ffc1057SHemant Agrawal 
2782ffc1057SHemant Agrawal /*
279*7be78d02SJosh Soref  * @Description   structure for FM exception definitions
2802ffc1057SHemant Agrawal  */
2812ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_exception_params_t {
2822ffc1057SHemant Agrawal 	ioc_fm_pcd_exceptions exception;	/**< The requested exception */
2832ffc1057SHemant Agrawal 	bool		enable;
2842ffc1057SHemant Agrawal 			/**< TRUE to enable interrupt, FALSE to mask it. */
2852ffc1057SHemant Agrawal } ioc_fm_pcd_exception_params_t;
2862ffc1057SHemant Agrawal 
2872ffc1057SHemant Agrawal /*
2882ffc1057SHemant Agrawal  * @Description   A structure for SW parser labels (must be identical to struct
2892ffc1057SHemant Agrawal  *		  t_fm_pcd_prs_label_params defined in fm_pcd_ext.h)
2902ffc1057SHemant Agrawal  */
2912ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_prs_label_params_t {
2922ffc1057SHemant Agrawal 	uint32_t instruction_offset;
2932ffc1057SHemant Agrawal 		/**< SW parser label instruction offset (2 bytes resolution),
2942ffc1057SHemant Agrawal 		 * relative to Parser RAM
2952ffc1057SHemant Agrawal 		 */
2962ffc1057SHemant Agrawal 	ioc_net_header_type	hdr;
2972ffc1057SHemant Agrawal 		/**< The existence of this header will invoke the SW parser
2982ffc1057SHemant Agrawal 		 * code.
2992ffc1057SHemant Agrawal 		 */
3002ffc1057SHemant Agrawal 	uint8_t	index_per_hdr;
3012ffc1057SHemant Agrawal 		/**< Normally 0, if more than one SW parser attachments for the
3022ffc1057SHemant Agrawal 		 * same header, use this index to distinguish between them.
3032ffc1057SHemant Agrawal 		 */
3042ffc1057SHemant Agrawal } ioc_fm_pcd_prs_label_params_t;
3052ffc1057SHemant Agrawal 
3062ffc1057SHemant Agrawal /*
3072ffc1057SHemant Agrawal  * @Description   A structure for SW parser (Must match struct
3082ffc1057SHemant Agrawal  *		  ioc_fm_pcd_prs_sw_params_t defined in fm_pcd_ext.h)
3092ffc1057SHemant Agrawal  */
3102ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_prs_sw_params_t {
3112ffc1057SHemant Agrawal 	bool		override;
3122ffc1057SHemant Agrawal 			/**< FALSE to invoke a check that nothing else was
3132ffc1057SHemant Agrawal 			 * loaded to this address, including internal patches.
3142ffc1057SHemant Agrawal 			 * TRUE to override any existing code.
3152ffc1057SHemant Agrawal 			 */
3162ffc1057SHemant Agrawal 	uint32_t	size;		/**< SW parser code size */
3172ffc1057SHemant Agrawal 	uint16_t	base;
3182ffc1057SHemant Agrawal 			/**< SW parser base (in instruction counts! must be
3192ffc1057SHemant Agrawal 			 * larger than 0x20)
3202ffc1057SHemant Agrawal 			 */
3212ffc1057SHemant Agrawal 	uint8_t		*p_code;	/**< SW parser code */
3222ffc1057SHemant Agrawal 	uint32_t	sw_prs_data_params[IOC_FM_PCD_PRS_NUM_OF_HDRS];
3232ffc1057SHemant Agrawal 					/**< SW parser data (parameters) */
3242ffc1057SHemant Agrawal 	uint8_t		num_of_labels;	/**< Number of labels for SW parser. */
3252ffc1057SHemant Agrawal 	ioc_fm_pcd_prs_label_params_t
3262ffc1057SHemant Agrawal 			labels_table[IOC_FM_PCD_PRS_NUM_OF_LABELS];
3272ffc1057SHemant Agrawal 			/**< SW parser labels table, containing num_of_labels
3282ffc1057SHemant Agrawal 			 * entries
3292ffc1057SHemant Agrawal 			 */
3302ffc1057SHemant Agrawal } ioc_fm_pcd_prs_sw_params_t;
3312ffc1057SHemant Agrawal 
3322ffc1057SHemant Agrawal /*
3332ffc1057SHemant Agrawal  * @Description   A structure to set the a KeyGen default value
3342ffc1057SHemant Agrawal  */
3352ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_kg_dflt_value_params_t {
3362ffc1057SHemant Agrawal 	uint8_t		value_id;/**< 0,1 - one of 2 global default values */
3372ffc1057SHemant Agrawal 	uint32_t	value;	/**< The requested default value */
3382ffc1057SHemant Agrawal } ioc_fm_pcd_kg_dflt_value_params_t;
3392ffc1057SHemant Agrawal 
3402ffc1057SHemant Agrawal /*
3412ffc1057SHemant Agrawal  * @Function	  fm_pcd_enable
3422ffc1057SHemant Agrawal  *
3432ffc1057SHemant Agrawal  * @Description   This routine should be called after PCD is initialized for
3442ffc1057SHemant Agrawal  *		  enabling all PCD engines according to their existing
3452ffc1057SHemant Agrawal  *		  configuration.
3462ffc1057SHemant Agrawal  *
3472ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
3482ffc1057SHemant Agrawal  *
3492ffc1057SHemant Agrawal  * @Cautions	  Allowed only when PCD is disabled.
3502ffc1057SHemant Agrawal  */
3512ffc1057SHemant Agrawal #define FM_PCD_IOC_ENABLE  _IO(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(1))
3522ffc1057SHemant Agrawal 
3532ffc1057SHemant Agrawal /*
3542ffc1057SHemant Agrawal  * @Function	  fm_pcd_disable
3552ffc1057SHemant Agrawal  *
3562ffc1057SHemant Agrawal  * @Description   This routine may be called when PCD is enabled in order to
3572ffc1057SHemant Agrawal  *		  disable all PCD engines. It may be called only when none of
3582ffc1057SHemant Agrawal  *		  the ports in the system are using the PCD.
3592ffc1057SHemant Agrawal  *
3602ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
3612ffc1057SHemant Agrawal  *
3622ffc1057SHemant Agrawal  * @Cautions	  Allowed only when PCD is enabled.
3632ffc1057SHemant Agrawal  */
3642ffc1057SHemant Agrawal #define FM_PCD_IOC_DISABLE  _IO(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(2))
3652ffc1057SHemant Agrawal 
3662ffc1057SHemant Agrawal /*
3672ffc1057SHemant Agrawal  * @Function	  fm_pcd_prs_load_sw
3682ffc1057SHemant Agrawal  *
3692ffc1057SHemant Agrawal  * @Description   This routine may be called only when all ports in the
3702ffc1057SHemant Agrawal  *		  system are actively using the classification plan scheme.
3712ffc1057SHemant Agrawal  *		  In such cases it is recommended in order to save resources.
3722ffc1057SHemant Agrawal  *		  The driver automatically saves 8 classification plans for
3732ffc1057SHemant Agrawal  *		  ports that do NOT use the classification plan mechanism, to
3742ffc1057SHemant Agrawal  *		  avoid this (in order to save those entries) this routine may
3752ffc1057SHemant Agrawal  *		  be called.
3762ffc1057SHemant Agrawal  *
3772ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_prs_sw_params_t
3782ffc1057SHemant Agrawal  *		  A pointer to the image of the software parser code.
3792ffc1057SHemant Agrawal  *
3802ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
3812ffc1057SHemant Agrawal  *
3822ffc1057SHemant Agrawal  * @Cautions	  Allowed only when PCD is disabled.
3832ffc1057SHemant Agrawal  */
3842ffc1057SHemant Agrawal #define FM_PCD_IOC_PRS_LOAD_SW \
3852ffc1057SHemant Agrawal 	_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(3), ioc_fm_pcd_prs_sw_params_t)
3862ffc1057SHemant Agrawal 
3872ffc1057SHemant Agrawal /*
3882ffc1057SHemant Agrawal  * @Function	  fm_pcd_kg_set_dflt_value
3892ffc1057SHemant Agrawal  *
3902ffc1057SHemant Agrawal  * @Description   Calling this routine sets a global default value to be used
3912ffc1057SHemant Agrawal  *		  by the KeyGen when parser does not recognize a required
3922ffc1057SHemant Agrawal  *		  field/header.
3932ffc1057SHemant Agrawal  *		  default value is 0.
3942ffc1057SHemant Agrawal  *
3952ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_kg_dflt_value_params_t	A pointer to a structure
3962ffc1057SHemant Agrawal  *							with the relevant
3972ffc1057SHemant Agrawal  *							parameters
3982ffc1057SHemant Agrawal  *
3992ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
4002ffc1057SHemant Agrawal  *
4012ffc1057SHemant Agrawal  * @Cautions	  Allowed only when PCD is disabled.
4022ffc1057SHemant Agrawal  */
4032ffc1057SHemant Agrawal #define FM_PCD_IOC_KG_SET_DFLT_VALUE \
4042ffc1057SHemant Agrawal 	_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(6), \
4052ffc1057SHemant Agrawal 	     ioc_fm_pcd_kg_dflt_value_params_t)
4062ffc1057SHemant Agrawal 
4072ffc1057SHemant Agrawal /*
4082ffc1057SHemant Agrawal  * @Function	  fm_pcd_kg_set_additional_data_after_parsing
4092ffc1057SHemant Agrawal  *
4102ffc1057SHemant Agrawal  * @Description   Calling this routine allows the keygen to access data past
4112ffc1057SHemant Agrawal  *		  the parser finishing point.
4122ffc1057SHemant Agrawal  *
4132ffc1057SHemant Agrawal  * @Param[in]	  uint8_t	payload-offset; the number of bytes beyond the
4142ffc1057SHemant Agrawal  *				parser location.
4152ffc1057SHemant Agrawal  *
4162ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
4172ffc1057SHemant Agrawal  *
4182ffc1057SHemant Agrawal  * @Cautions	  Allowed only when PCD is disabled.
4192ffc1057SHemant Agrawal  */
4202ffc1057SHemant Agrawal #define FM_PCD_IOC_KG_SET_ADDITIONAL_DATA_AFTER_PARSING \
4212ffc1057SHemant Agrawal 	_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(7), uint8_t)
4222ffc1057SHemant Agrawal 
4232ffc1057SHemant Agrawal /*
4242ffc1057SHemant Agrawal  * @Function	  fm_pcd_set_exception
4252ffc1057SHemant Agrawal  *
4262ffc1057SHemant Agrawal  * @Description   Calling this routine enables/disables PCD interrupts.
4272ffc1057SHemant Agrawal  *
4282ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_exception_params_t
4292ffc1057SHemant Agrawal  *		  Arguments struct with exception to be enabled/disabled.
4302ffc1057SHemant Agrawal  *
4312ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
4322ffc1057SHemant Agrawal  */
4332ffc1057SHemant Agrawal #define FM_PCD_IOC_SET_EXCEPTION \
4342ffc1057SHemant Agrawal 	_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(8), ioc_fm_pcd_exception_params_t)
4352ffc1057SHemant Agrawal 
4362ffc1057SHemant Agrawal /*
4372ffc1057SHemant Agrawal  * @Function	  fm_pcd_get_counter
4382ffc1057SHemant Agrawal  *
4392ffc1057SHemant Agrawal  * @Description   Reads one of the FM PCD counters.
4402ffc1057SHemant Agrawal  *
4412ffc1057SHemant Agrawal  * @Param[in,out] ioc_fm_pcd_counters_params_t The requested counter parameters.
4422ffc1057SHemant Agrawal  *
4432ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
4442ffc1057SHemant Agrawal  *
4452ffc1057SHemant Agrawal  * @Cautions	  It is user's responsibility to call this routine only
4462ffc1057SHemant Agrawal  *		  for enabled counters, and there will be no indication if a
4472ffc1057SHemant Agrawal  *		  disabled counter is accessed.
4482ffc1057SHemant Agrawal  */
4492ffc1057SHemant Agrawal #define FM_PCD_IOC_GET_COUNTER \
4502ffc1057SHemant Agrawal 	_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(9), ioc_fm_pcd_counters_params_t)
4512ffc1057SHemant Agrawal 
4522ffc1057SHemant Agrawal /*
4532ffc1057SHemant Agrawal  * @Function	  fm_pcd_kg_scheme_get_counter
4542ffc1057SHemant Agrawal  *
4552ffc1057SHemant Agrawal  * @Description   Reads scheme packet counter.
4562ffc1057SHemant Agrawal  *
4572ffc1057SHemant Agrawal  * @Param[in]	  h_scheme	scheme handle as returned by
4582ffc1057SHemant Agrawal  *				fm_pcd_kg_scheme_set().
4592ffc1057SHemant Agrawal  *
4602ffc1057SHemant Agrawal  * @Return	  Counter's current value.
4612ffc1057SHemant Agrawal  *
4622ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init() & fm_pcd_kg_scheme_set().
4632ffc1057SHemant Agrawal  */
4642ffc1057SHemant Agrawal #define FM_PCD_IOC_KG_SCHEME_GET_CNTR \
4652ffc1057SHemant Agrawal 	_IOR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(4), ioc_fm_pcd_kg_scheme_spc_t)
4662ffc1057SHemant Agrawal 
4672ffc1057SHemant Agrawal /*
4682ffc1057SHemant Agrawal  * @Function	  FM_PCD_ForceIntr
4692ffc1057SHemant Agrawal  *
4702ffc1057SHemant Agrawal  * @Description   Causes an interrupt event on the requested source.
4712ffc1057SHemant Agrawal  *
4722ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_exceptions - An exception to be forced.
4732ffc1057SHemant Agrawal  *
4742ffc1057SHemant Agrawal  * @Return	  0 on success; error code if the exception is not enabled,
4752ffc1057SHemant Agrawal  *		  or is not able to create interrupt.
4762ffc1057SHemant Agrawal  */
4772ffc1057SHemant Agrawal #define FM_PCD_IOC_FORCE_INTR \
4782ffc1057SHemant Agrawal 	_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(11), ioc_fm_pcd_exceptions)
4792ffc1057SHemant Agrawal 
4802ffc1057SHemant Agrawal /*
4812ffc1057SHemant Agrawal  * @Collection	Definitions of coarse classification parameters as required by
4822ffc1057SHemant Agrawal  *		KeyGen (when coarse classification is the next engine after this
4832ffc1057SHemant Agrawal  *		scheme).
4842ffc1057SHemant Agrawal  */
4852ffc1057SHemant Agrawal #define IOC_FM_PCD_MAX_NUM_OF_CC_TREES		8
4862ffc1057SHemant Agrawal #define IOC_FM_PCD_MAX_NUM_OF_CC_GROUPS		16
4872ffc1057SHemant Agrawal #define IOC_FM_PCD_MAX_NUM_OF_CC_UNITS		4
4882ffc1057SHemant Agrawal #define IOC_FM_PCD_MAX_NUM_OF_KEYS		256
4892ffc1057SHemant Agrawal #define IOC_FM_PCD_MAX_NUM_OF_FLOWS		(4 * KILOBYTE)
4902ffc1057SHemant Agrawal #define IOC_FM_PCD_MAX_SIZE_OF_KEY		56
4912ffc1057SHemant Agrawal #define IOC_FM_PCD_MAX_CC_ENTRY_IN_GRP		16
4922ffc1057SHemant Agrawal #define IOC_FM_PCD_LAST_KEY_INDEX		0xffff
4932ffc1057SHemant Agrawal #define IOC_FM_PCD_MANIP_DSCP_VALUES		64
4942ffc1057SHemant Agrawal /* @} */
4952ffc1057SHemant Agrawal 
4962ffc1057SHemant Agrawal /*
4972ffc1057SHemant Agrawal  * @Collection	A set of definitions to allow protocol
4982ffc1057SHemant Agrawal  *		special option description.
4992ffc1057SHemant Agrawal  */
5002ffc1057SHemant Agrawal typedef uint32_t		ioc_protocol_opt_t;
5012ffc1057SHemant Agrawal 		/**< A general type to define a protocol option. */
5022ffc1057SHemant Agrawal 
5032ffc1057SHemant Agrawal typedef ioc_protocol_opt_t  ioc_eth_protocol_opt_t;
5042ffc1057SHemant Agrawal 			/**< Ethernet protocol options. */
5052ffc1057SHemant Agrawal #define IOC_ETH_BROADCAST		0x80000000   /**< Ethernet Broadcast. */
5062ffc1057SHemant Agrawal #define IOC_ETH_MULTICAST		0x40000000   /**< Ethernet Multicast. */
5072ffc1057SHemant Agrawal 
5082ffc1057SHemant Agrawal typedef ioc_protocol_opt_t  ioc_vlan_protocol_opt_t;
5092ffc1057SHemant Agrawal 				/**< Vlan protocol options. */
5102ffc1057SHemant Agrawal #define IOC_VLAN_STACKED		0x20000000   /**< Stacked VLAN. */
5112ffc1057SHemant Agrawal 
5122ffc1057SHemant Agrawal typedef ioc_protocol_opt_t  ioc_mpls_protocol_opt_t;
5132ffc1057SHemant Agrawal 				/**< MPLS protocol options. */
5142ffc1057SHemant Agrawal #define IOC_MPLS_STACKED		0x10000000   /**< Stacked MPLS. */
5152ffc1057SHemant Agrawal 
5162ffc1057SHemant Agrawal typedef ioc_protocol_opt_t  ioc_ipv4_protocol_opt_t;
5172ffc1057SHemant Agrawal 			/**< IPv4 protocol options. */
5182ffc1057SHemant Agrawal #define IOC_IPV4_BROADCAST_1		0x08000000   /**< IPv4 Broadcast. */
5192ffc1057SHemant Agrawal #define IOC_IPV4_MULTICAST_1		0x04000000   /**< IPv4 Multicast. */
5202ffc1057SHemant Agrawal #define IOC_IPV4_UNICAST_2		0x02000000
5212ffc1057SHemant Agrawal 					/**< Tunneled IPv4 - Unicast.
5222ffc1057SHemant Agrawal 					 */
5232ffc1057SHemant Agrawal #define IOC_IPV4_MULTICAST_BROADCAST_2  0x01000000
5242ffc1057SHemant Agrawal 					/**< Tunneled IPv4 -
5252ffc1057SHemant Agrawal 					 * Broadcast/Multicast.
5262ffc1057SHemant Agrawal 					 */
5272ffc1057SHemant Agrawal 
5282ffc1057SHemant Agrawal #define IOC_IPV4_FRAG_1		0x00000008
5292ffc1057SHemant Agrawal 				/**< IPV4 reassembly option. IPV4
5302ffc1057SHemant Agrawal 				 * Reassembly manipulation requires network
5312ffc1057SHemant Agrawal 				 * environment with IPV4 header and IPV4_FRAG_1
5322ffc1057SHemant Agrawal 				 * option
5332ffc1057SHemant Agrawal 				 */
5342ffc1057SHemant Agrawal 
5352ffc1057SHemant Agrawal typedef ioc_protocol_opt_t  ioc_ipv6_protocol_opt_t;
5362ffc1057SHemant Agrawal 					/**< IPv6 protocol options. */
5372ffc1057SHemant Agrawal #define IOC_IPV6_MULTICAST_1		0x00800000   /**< IPv6 Multicast. */
5382ffc1057SHemant Agrawal #define IOC_IPV6_UNICAST_2		0x00400000
5392ffc1057SHemant Agrawal 					/**< Tunneled IPv6 - Unicast. */
5402ffc1057SHemant Agrawal #define IOC_IPV6_MULTICAST_2		0x00200000
5412ffc1057SHemant Agrawal 					/**< Tunneled IPv6 - Multicast. */
5422ffc1057SHemant Agrawal 
5432ffc1057SHemant Agrawal #define IOC_IPV6_FRAG_1		0x00000004
5442ffc1057SHemant Agrawal 				/**< IPV6 reassembly option. IPV6 Reassembly
5452ffc1057SHemant Agrawal 				 * manipulation requires network environment
5462ffc1057SHemant Agrawal 				 * with IPV6 header and IPV6_FRAG_1 option
5472ffc1057SHemant Agrawal 				 */
5482ffc1057SHemant Agrawal typedef ioc_protocol_opt_t   ioc_capwap_protocol_opt_t;
5492ffc1057SHemant Agrawal 					/**< CAPWAP protocol options. */
5502ffc1057SHemant Agrawal #define CAPWAP_FRAG_1		0x00000008
5512ffc1057SHemant Agrawal 				/**< CAPWAP reassembly option. CAPWAP Reassembly
5522ffc1057SHemant Agrawal 				 * manipulation requires network environment
5532ffc1057SHemant Agrawal 				 * with CAPWAP header and CAPWAP_FRAG_1 option;
5542ffc1057SHemant Agrawal 				 * in case where fragment found, the
5552ffc1057SHemant Agrawal 				 * fragment-extension offset may be found at
5562ffc1057SHemant Agrawal 				 * 'shim2' (in parser-result).
5572ffc1057SHemant Agrawal 				 */
5582ffc1057SHemant Agrawal 
5592ffc1057SHemant Agrawal /* @} */
5602ffc1057SHemant Agrawal 
5612ffc1057SHemant Agrawal #define IOC_FM_PCD_MANIP_MAX_HDR_SIZE		256
5622ffc1057SHemant Agrawal #define IOC_FM_PCD_MANIP_DSCP_TO_VLAN_TRANS	64
5632ffc1057SHemant Agrawal /**
5642ffc1057SHemant Agrawal  * @Collection	A set of definitions to support Header Manipulation selection.
5652ffc1057SHemant Agrawal  */
5662ffc1057SHemant Agrawal typedef uint32_t			ioc_hdr_manip_flags_t;
5672ffc1057SHemant Agrawal 	/**< A general type to define a HMan update command flags. */
5682ffc1057SHemant Agrawal 
5692ffc1057SHemant Agrawal typedef ioc_hdr_manip_flags_t	ioc_ipv4_hdr_manip_update_flags_t;
5702ffc1057SHemant Agrawal 	/**< IPv4 protocol HMan update command flags. */
5712ffc1057SHemant Agrawal 
5722ffc1057SHemant Agrawal #define IOC_HDR_MANIP_IPV4_TOS	0x80000000
5732ffc1057SHemant Agrawal 			/**< update TOS with the given value ('tos' field of
5742ffc1057SHemant Agrawal 			 * ioc_fm_pcd_manip_hdr_field_update_ipv4_t)
5752ffc1057SHemant Agrawal 			 */
5762ffc1057SHemant Agrawal #define IOC_HDR_MANIP_IPV4_ID	0x40000000
5772ffc1057SHemant Agrawal 			/**< update IP ID with the given value ('id' field of
5782ffc1057SHemant Agrawal 			 * ioc_fm_pcd_manip_hdr_field_update_ipv4_t)
5792ffc1057SHemant Agrawal 			 */
5802ffc1057SHemant Agrawal #define IOC_HDR_MANIP_IPV4_TTL	0x20000000	/**< Decrement TTL by 1 */
5812ffc1057SHemant Agrawal #define IOC_HDR_MANIP_IPV4_SRC	0x10000000
5822ffc1057SHemant Agrawal 		/**< update IP source address with the given value ('src' field
5832ffc1057SHemant Agrawal 		 * of ioc_fm_pcd_manip_hdr_field_update_ipv4_t)
5842ffc1057SHemant Agrawal 		 */
5852ffc1057SHemant Agrawal #define IOC_HDR_MANIP_IPV4_DST	0x08000000
5862ffc1057SHemant Agrawal 		/**< update IP destination address with the given value
5872ffc1057SHemant Agrawal 		 * ('dst' field of ioc_fm_pcd_manip_hdr_field_update_ipv4_t)
5882ffc1057SHemant Agrawal 		 */
5892ffc1057SHemant Agrawal 
5902ffc1057SHemant Agrawal typedef ioc_hdr_manip_flags_t	ioc_ipv6_hdr_manip_update_flags_t;
5912ffc1057SHemant Agrawal 			/**< IPv6 protocol HMan update command flags. */
5922ffc1057SHemant Agrawal 
5932ffc1057SHemant Agrawal #define IOC_HDR_MANIP_IPV6_TC	0x80000000
5942ffc1057SHemant Agrawal 	/**< update Traffic Class address with the given value ('traffic_class'
5952ffc1057SHemant Agrawal 	 * field of ioc_fm_pcd_manip_hdr_field_update_ipv6_t)
5962ffc1057SHemant Agrawal 	 */
5972ffc1057SHemant Agrawal #define IOC_HDR_MANIP_IPV6_HL	0x40000000	/**< Decrement Hop Limit by 1 */
5982ffc1057SHemant Agrawal #define IOC_HDR_MANIP_IPV6_SRC	0x20000000
5992ffc1057SHemant Agrawal 		/**< update IP source address with the given value ('src' field
6002ffc1057SHemant Agrawal 		 * of ioc_fm_pcd_manip_hdr_field_update_ipv6_t)
6012ffc1057SHemant Agrawal 		 */
6022ffc1057SHemant Agrawal #define IOC_HDR_MANIP_IPV6_DST	0x10000000
6032ffc1057SHemant Agrawal 		/**< update IP destination address with the given value ('dst'
6042ffc1057SHemant Agrawal 		 * field of ioc_fm_pcd_manip_hdr_field_update_ipv6_t)
6052ffc1057SHemant Agrawal 		 */
6062ffc1057SHemant Agrawal 
6072ffc1057SHemant Agrawal typedef ioc_hdr_manip_flags_t	ioc_tcp_udp_hdr_manip_update_flags_t;
6082ffc1057SHemant Agrawal 		/**< TCP/UDP protocol HMan update command flags. */
6092ffc1057SHemant Agrawal 
6102ffc1057SHemant Agrawal #define IOC_HDR_MANIP_TCP_UDP_SRC	0x80000000
6112ffc1057SHemant Agrawal 		/**< update TCP/UDP source address with the given value
6122ffc1057SHemant Agrawal 		 * ('src' field of ioc_fm_pcd_manip_hdr_field_update_tcp_udp_t)
6132ffc1057SHemant Agrawal 		 */
6142ffc1057SHemant Agrawal #define IOC_HDR_MANIP_TCP_UDP_DST	0x40000000
6152ffc1057SHemant Agrawal 		/**< update TCP/UDP destination address with the given value
6162ffc1057SHemant Agrawal 		 * ('dst' field of ioc_fm_pcd_manip_hdr_field_update_tcp_udp_t)
6172ffc1057SHemant Agrawal 		 */
6182ffc1057SHemant Agrawal #define IOC_HDR_MANIP_TCP_UDP_CHECKSUM  0x20000000
6192ffc1057SHemant Agrawal 		/**< update TCP/UDP checksum */
6202ffc1057SHemant Agrawal 
6212ffc1057SHemant Agrawal /* @} */
6222ffc1057SHemant Agrawal 
6232ffc1057SHemant Agrawal /*
6242ffc1057SHemant Agrawal  * @Description   A type used for returning the order of the key extraction.
6252ffc1057SHemant Agrawal  *		  each value in this array represents the index of the
6262ffc1057SHemant Agrawal  *		  extraction command as defined by the user in the
6272ffc1057SHemant Agrawal  *		  initialization extraction array. The valid size of this array
6282ffc1057SHemant Agrawal  *		  is the user define number of extractions required (also
6292ffc1057SHemant Agrawal  *		  marked by the second '0' in this array).
6302ffc1057SHemant Agrawal  */
6312ffc1057SHemant Agrawal typedef	uint8_t
6322ffc1057SHemant Agrawal 	ioc_fm_pcd_kg_key_order_t [IOC_FM_PCD_KG_MAX_EXTRACTS_PER_KEY];
6332ffc1057SHemant Agrawal 
6342ffc1057SHemant Agrawal /*
6352ffc1057SHemant Agrawal  *@Description   All PCD engines
6362ffc1057SHemant Agrawal  *		(must match enum e_FmPcdEngine defined in fm_pcd_ext.h)
6372ffc1057SHemant Agrawal  */
6382ffc1057SHemant Agrawal 
6392ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_engine {
6402ffc1057SHemant Agrawal 	e_IOC_FM_PCD_INVALID = 0,   /**< Invalid PCD engine */
6412ffc1057SHemant Agrawal 	e_IOC_FM_PCD_DONE,	/**< No PCD Engine indicated */
6422ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG,		/**< KeyGen */
6432ffc1057SHemant Agrawal 	e_IOC_FM_PCD_CC,		/**< Coarse Classifier */
6442ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR,	/**< Policer */
6452ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PRS,	/**< Parser */
6462ffc1057SHemant Agrawal 	e_IOC_FM_PCD_FR,	/**< Frame Replicator */
6472ffc1057SHemant Agrawal 	e_IOC_FM_PCD_HASH	/**< Hash Table */
6482ffc1057SHemant Agrawal } ioc_fm_pcd_engine;
6492ffc1057SHemant Agrawal 
6502ffc1057SHemant Agrawal /*
6512ffc1057SHemant Agrawal  * @Description   An enum for selecting extraction by header types
6522ffc1057SHemant Agrawal  *		  (Must match enum e_FmPcdExtractByHdrType defined in
6532ffc1057SHemant Agrawal  *		  fm_pcd_ext.h)
6542ffc1057SHemant Agrawal  */
6552ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_extract_by_hdr_type {
6562ffc1057SHemant Agrawal 	e_IOC_FM_PCD_EXTRACT_FROM_HDR,	/**< Extract bytes from header */
6572ffc1057SHemant Agrawal 	e_IOC_FM_PCD_EXTRACT_FROM_FIELD,/**< Extract bytes from header field */
6582ffc1057SHemant Agrawal 	e_IOC_FM_PCD_EXTRACT_FULL_FIELD	/**< Extract a full field */
6592ffc1057SHemant Agrawal } ioc_fm_pcd_extract_by_hdr_type;
6602ffc1057SHemant Agrawal 
6612ffc1057SHemant Agrawal /*
6622ffc1057SHemant Agrawal  * @Description   An enum for selecting extraction source (when it is not the
6632ffc1057SHemant Agrawal  *		  header) (Must match enum e_FmPcdExtractFrom defined in
6642ffc1057SHemant Agrawal  *		  fm_pcd_ext.h)
6652ffc1057SHemant Agrawal  */
6662ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_extract_from {
6672ffc1057SHemant Agrawal 	e_IOC_FM_PCD_EXTRACT_FROM_FRAME_START,
6682ffc1057SHemant Agrawal 			/**< KG & CC: Extract from beginning of frame */
6692ffc1057SHemant Agrawal 	e_IOC_FM_PCD_EXTRACT_FROM_DFLT_VALUE,
6702ffc1057SHemant Agrawal 				/**< KG only: Extract from a default value */
6712ffc1057SHemant Agrawal 	e_IOC_FM_PCD_EXTRACT_FROM_CURR_END_OF_PARSE,
6722ffc1057SHemant Agrawal 			/**< KG only: Extract from the point where parsing had
6732ffc1057SHemant Agrawal 			 * finished
6742ffc1057SHemant Agrawal 			 */
6752ffc1057SHemant Agrawal 	e_IOC_FM_PCD_EXTRACT_FROM_KEY,	/**< CC only: Field where saved KEY */
6762ffc1057SHemant Agrawal 	e_IOC_FM_PCD_EXTRACT_FROM_HASH,	/**< CC only: Field where saved HASH */
6772ffc1057SHemant Agrawal 	e_IOC_FM_PCD_EXTRACT_FROM_PARSE_RESULT,
6782ffc1057SHemant Agrawal 				/**< KG & CC: Extract from the parser result */
6792ffc1057SHemant Agrawal 	e_IOC_FM_PCD_EXTRACT_FROM_ENQ_FQID,
6802ffc1057SHemant Agrawal 				/**< KG & CC: Extract from enqueue FQID */
6812ffc1057SHemant Agrawal 	e_IOC_FM_PCD_EXTRACT_FROM_FLOW_ID
6822ffc1057SHemant Agrawal 				/**< CC only: Field where saved Dequeue FQID */
6832ffc1057SHemant Agrawal } ioc_fm_pcd_extract_from;
6842ffc1057SHemant Agrawal 
6852ffc1057SHemant Agrawal /*
6862ffc1057SHemant Agrawal  * @Description   An enum for selecting extraction type
6872ffc1057SHemant Agrawal  */
6882ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_extract_type {
6892ffc1057SHemant Agrawal 	e_IOC_FM_PCD_EXTRACT_BY_HDR,	/**< Extract according to header */
6902ffc1057SHemant Agrawal 	e_IOC_FM_PCD_EXTRACT_NON_HDR,
6912ffc1057SHemant Agrawal 		/**< Extract from data that is not the header */
6922ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_EXTRACT_PORT_PRIVATE_INFO
6932ffc1057SHemant Agrawal 			/**< Extract private info as specified by user */
6942ffc1057SHemant Agrawal } ioc_fm_pcd_extract_type;
6952ffc1057SHemant Agrawal 
6962ffc1057SHemant Agrawal /*
6972ffc1057SHemant Agrawal  * @Description   An enum for selecting a default
6982ffc1057SHemant Agrawal  */
6992ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_kg_extract_dflt_select {
7002ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_DFLT_GBL_0,
7012ffc1057SHemant Agrawal 		/**< Default selection is KG register 0 */
7022ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_DFLT_GBL_1,
7032ffc1057SHemant Agrawal 		/**< Default selection is KG register 1 */
7042ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_DFLT_PRIVATE_0,
7052ffc1057SHemant Agrawal 		/**< Default selection is a per scheme register 0 */
7062ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_DFLT_PRIVATE_1,
7072ffc1057SHemant Agrawal 		/**< Default selection is a per scheme register 1 */
7082ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_DFLT_ILLEGAL	/**< Illegal selection */
7092ffc1057SHemant Agrawal } ioc_fm_pcd_kg_extract_dflt_select;
7102ffc1057SHemant Agrawal 
7112ffc1057SHemant Agrawal /*
7122ffc1057SHemant Agrawal  * @Description   Enumeration type defining all default groups - each group
7132ffc1057SHemant Agrawal  *		  shares a default value, one of four user-initialized values.
7142ffc1057SHemant Agrawal  */
7152ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_kg_known_fields_dflt_types {
7162ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_MAC_ADDR,		/**< MAC Address */
7172ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_TCI,			/**< TCI field */
7182ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_ENET_TYPE,		/**< ENET Type */
7192ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_PPP_SESSION_ID,		/**< PPP Session id */
7202ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_PPP_PROTOCOL_ID,	/**< PPP Protocol id */
7212ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_MPLS_LABEL,		/**< MPLS label */
7222ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_IP_ADDR,		/**< IP addr */
7232ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_PROTOCOL_TYPE,		/**< Protocol type */
7242ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_IP_TOS_TC,		/**< TOS or TC */
7252ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_IPV6_FLOW_LABEL,	/**< IPV6 flow label */
7262ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_IPSEC_SPI,		/**< IPSEC SPI */
7272ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_L4_PORT,		/**< L4 Port */
7282ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_TCP_FLAG,		/**< TCP Flag */
7292ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_GENERIC_FROM_DATA,
7302ffc1057SHemant Agrawal 		/**< grouping implemented by SW, any data extraction that is not
7312ffc1057SHemant Agrawal 		 * the full field described above
7322ffc1057SHemant Agrawal 		 */
7332ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_GENERIC_FROM_DATA_NO_V,
7342ffc1057SHemant Agrawal 		/**< grouping implemented by SW, any data extraction without
7352ffc1057SHemant Agrawal 		 * validation
7362ffc1057SHemant Agrawal 		 */
7372ffc1057SHemant Agrawal 	e_IOC_FM_PCD_KG_GENERIC_NOT_FROM_DATA
7382ffc1057SHemant Agrawal 		/**< grouping implemented by SW, extraction from parser result
7392ffc1057SHemant Agrawal 		 * or direct use of default value
7402ffc1057SHemant Agrawal 		 */
7412ffc1057SHemant Agrawal } ioc_fm_pcd_kg_known_fields_dflt_types;
7422ffc1057SHemant Agrawal 
7432ffc1057SHemant Agrawal /*
7442ffc1057SHemant Agrawal  * @Description   Enumeration type for defining header index for scenarios with
7452ffc1057SHemant Agrawal  *		  multiple (tunneled) headers
7462ffc1057SHemant Agrawal  */
7472ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_hdr_index {
7482ffc1057SHemant Agrawal 	e_IOC_FM_PCD_HDR_INDEX_NONE	=   0,
7492ffc1057SHemant Agrawal 				/**< used when multiple headers not used, also
7502ffc1057SHemant Agrawal 				 * to specify regular IP (not tunneled).
7512ffc1057SHemant Agrawal 				 */
7522ffc1057SHemant Agrawal 	e_IOC_FM_PCD_HDR_INDEX_1,/**< may be used for VLAN, MPLS, tunneled IP */
7532ffc1057SHemant Agrawal 	e_IOC_FM_PCD_HDR_INDEX_2,/**< may be used for MPLS, tunneled IP */
7542ffc1057SHemant Agrawal 	e_IOC_FM_PCD_HDR_INDEX_3,/**< may be used for MPLS */
7552ffc1057SHemant Agrawal 	e_IOC_FM_PCD_HDR_INDEX_LAST =   0xFF /**< may be used for VLAN, MPLS */
7562ffc1057SHemant Agrawal } ioc_fm_pcd_hdr_index;
7572ffc1057SHemant Agrawal 
7582ffc1057SHemant Agrawal /*
7592ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting the policer profile functional
7602ffc1057SHemant Agrawal  *		  type
7612ffc1057SHemant Agrawal  */
7622ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_profile_type_selection {
7632ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_PORT_PRIVATE,		/**< Port dedicated profile */
7642ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_SHARED
7652ffc1057SHemant Agrawal 			/**< Shared profile (shared within partition) */
7662ffc1057SHemant Agrawal } ioc_fm_pcd_profile_type_selection;
7672ffc1057SHemant Agrawal 
7682ffc1057SHemant Agrawal /*
7692ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting the policer profile algorithm
7702ffc1057SHemant Agrawal  */
7712ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_plcr_algorithm_selection {
7722ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_PASS_THROUGH, /**< Policer pass through */
7732ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_RFC_2698,	/**< Policer algorithm RFC 2698 */
7742ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_RFC_4115	/**< Policer algorithm RFC 4115 */
7752ffc1057SHemant Agrawal } ioc_fm_pcd_plcr_algorithm_selection;
7762ffc1057SHemant Agrawal 
7772ffc1057SHemant Agrawal /*
7782ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting a policer profile color mode
7792ffc1057SHemant Agrawal  */
7802ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_plcr_color_mode {
7812ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_COLOR_BLIND,  /**< Color blind */
7822ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_COLOR_AWARE   /**< Color aware */
7832ffc1057SHemant Agrawal } ioc_fm_pcd_plcr_color_mode;
7842ffc1057SHemant Agrawal 
7852ffc1057SHemant Agrawal /*
7862ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting a policer profile color
7872ffc1057SHemant Agrawal  */
7882ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_plcr_color {
7892ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_GREEN,	/**< Green */
7902ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_YELLOW,	/**< Yellow */
7912ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_RED,		/**< Red */
7922ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_OVERRIDE	/**< Color override */
7932ffc1057SHemant Agrawal } ioc_fm_pcd_plcr_color;
7942ffc1057SHemant Agrawal 
7952ffc1057SHemant Agrawal /*
7962ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting the policer profile packet
7972ffc1057SHemant Agrawal  *		  frame length selector
7982ffc1057SHemant Agrawal  */
7992ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_plcr_frame_length_select {
8002ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_L2_FRM_LEN,	/**< L2 frame length */
8012ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_L3_FRM_LEN,	/**< L3 frame length */
8022ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_L4_FRM_LEN,	/**< L4 frame length */
8032ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_FULL_FRM_LEN	/**< Full frame length */
8042ffc1057SHemant Agrawal } ioc_fm_pcd_plcr_frame_length_select;
8052ffc1057SHemant Agrawal 
8062ffc1057SHemant Agrawal /*
8072ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting roll-back frame
8082ffc1057SHemant Agrawal  */
8092ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_plcr_roll_back_frame_select {
8102ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_ROLLBACK_L2_FRM_LEN,	/**< Rollback L2 frame length */
8112ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_ROLLBACK_FULL_FRM_LEN
8122ffc1057SHemant Agrawal 				/**< Rollback Full frame length */
8132ffc1057SHemant Agrawal } ioc_fm_pcd_plcr_roll_back_frame_select;
8142ffc1057SHemant Agrawal 
8152ffc1057SHemant Agrawal /*
8162ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting the policer profile packet or
8172ffc1057SHemant Agrawal  *		  byte mode
8182ffc1057SHemant Agrawal  */
8192ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_plcr_rate_mode {
8202ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_BYTE_MODE,	/**< Byte mode */
8212ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_PACKET_MODE   /**< Packet mode */
8222ffc1057SHemant Agrawal } ioc_fm_pcd_plcr_rate_mode;
8232ffc1057SHemant Agrawal 
8242ffc1057SHemant Agrawal /*
8252ffc1057SHemant Agrawal  * @Description   Enumeration type for defining action of frame
8262ffc1057SHemant Agrawal  */
8272ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_done_action {
8282ffc1057SHemant Agrawal 	e_IOC_FM_PCD_ENQ_FRAME = 0,	/**< Enqueue frame */
8292ffc1057SHemant Agrawal 	e_IOC_FM_PCD_DROP_FRAME	/**< Drop frame */
8302ffc1057SHemant Agrawal } ioc_fm_pcd_done_action;
8312ffc1057SHemant Agrawal 
8322ffc1057SHemant Agrawal /*
8332ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting the policer counter
8342ffc1057SHemant Agrawal  */
8352ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_plcr_profile_counters {
8362ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_PROFILE_GREEN_PACKET_TOTAL_COUNTER,
8372ffc1057SHemant Agrawal 					/**< Green packets counter */
8382ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_PROFILE_YELLOW_PACKET_TOTAL_COUNTER,
8392ffc1057SHemant Agrawal 					/**< Yellow packets counter */
8402ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_PROFILE_RED_PACKET_TOTAL_COUNTER,
8412ffc1057SHemant Agrawal 					/**< Red packets counter */
8422ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_PROFILE_RECOLOURED_YELLOW_PACKET_TOTAL_COUNTER,
8432ffc1057SHemant Agrawal 					/**< Recolored yellow packets counter */
8442ffc1057SHemant Agrawal 	e_IOC_FM_PCD_PLCR_PROFILE_RECOLOURED_RED_PACKET_TOTAL_COUNTER
8452ffc1057SHemant Agrawal 					/**< Recolored red packets counter */
8462ffc1057SHemant Agrawal } ioc_fm_pcd_plcr_profile_counters;
8472ffc1057SHemant Agrawal 
8482ffc1057SHemant Agrawal /*
8492ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting the PCD action after extraction
8502ffc1057SHemant Agrawal  */
8512ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_action {
8522ffc1057SHemant Agrawal 	e_IOC_FM_PCD_ACTION_NONE,		/**< NONE  */
8532ffc1057SHemant Agrawal 	e_IOC_FM_PCD_ACTION_EXACT_MATCH,
8542ffc1057SHemant Agrawal 		/**< Exact match on the selected extraction */
8552ffc1057SHemant Agrawal 	e_IOC_FM_PCD_ACTION_INDEXED_LOOKUP
8562ffc1057SHemant Agrawal 		/**< Indexed lookup on the selected extraction */
8572ffc1057SHemant Agrawal } ioc_fm_pcd_action;
8582ffc1057SHemant Agrawal 
8592ffc1057SHemant Agrawal /*
8602ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting type of insert manipulation
8612ffc1057SHemant Agrawal  */
8622ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_hdr_insrt_type {
8632ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_INSRT_GENERIC,
8642ffc1057SHemant Agrawal 		/**< Insert according to offset & size */
8652ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_INSRT_BY_HDR,
8662ffc1057SHemant Agrawal 		/**< Insert according to protocol */
8672ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_insrt_type;
8682ffc1057SHemant Agrawal 
8692ffc1057SHemant Agrawal /*
8702ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting type of remove manipulation
8712ffc1057SHemant Agrawal  */
8722ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_hdr_rmv_type {
8732ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_RMV_GENERIC,
8742ffc1057SHemant Agrawal 		/**< Remove according to offset & size */
8752ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_RMV_BY_HDR
8762ffc1057SHemant Agrawal 		/**< Remove according to offset & size */
8772ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_rmv_type;
8782ffc1057SHemant Agrawal 
8792ffc1057SHemant Agrawal /*
8802ffc1057SHemant Agrawal  * @Description   An enum for selecting specific L2 fields removal
8812ffc1057SHemant Agrawal  */
8822ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_hdr_rmv_specific_l2 {
8832ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_RMV_ETHERNET,	/**< Ethernet/802.3 MAC */
8842ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_RMV_STACKED_QTAGS,	/**< stacked QTags */
8852ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_RMV_ETHERNET_AND_MPLS,
886*7be78d02SJosh Soref 			/**< MPLS and Ethernet/802.3 MAC header until the header
8872ffc1057SHemant Agrawal 			 * which follows the MPLS header
8882ffc1057SHemant Agrawal 			 */
8892ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_RMV_MPLS
8902ffc1057SHemant Agrawal 			/**< Remove MPLS header (Unlimited MPLS labels) */
8912ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_rmv_specific_l2;
8922ffc1057SHemant Agrawal 
8932ffc1057SHemant Agrawal /*
8942ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting specific fields updates
8952ffc1057SHemant Agrawal  */
8962ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_hdr_field_update_type {
8972ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_VLAN,	/**< VLAN updates */
8982ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_IPV4,	/**< IPV4 updates */
8992ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_IPV6,	/**< IPV6 updates */
9002ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_TCP_UDP,	/**< TCP_UDP updates */
9012ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_field_update_type;
9022ffc1057SHemant Agrawal 
9032ffc1057SHemant Agrawal /*
9042ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting VLAN updates
9052ffc1057SHemant Agrawal  */
9062ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_hdr_field_update_vlan {
9072ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_VLAN_VPRI,
9082ffc1057SHemant Agrawal 				/**< Replace VPri of outer most VLAN tag. */
9092ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_DSCP_TO_VLAN
9102ffc1057SHemant Agrawal 				/**< DSCP to VLAN priority bits translation */
9112ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_field_update_vlan;
9122ffc1057SHemant Agrawal 
9132ffc1057SHemant Agrawal /*
9142ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting specific L2 fields removal
9152ffc1057SHemant Agrawal  */
9162ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_hdr_insrt_specific_l2 {
9172ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_INSRT_MPLS
9182ffc1057SHemant Agrawal 		/**< Insert MPLS header (Unlimited MPLS labels) */
9192ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_insrt_specific_l2;
9202ffc1057SHemant Agrawal 
9212ffc1057SHemant Agrawal /*
9222ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting QoS mapping mode
9232ffc1057SHemant Agrawal  *
9242ffc1057SHemant Agrawal  *		  Note: In all cases except
9252ffc1057SHemant Agrawal  *		  'e_FM_PCD_MANIP_HDR_QOS_MAPPING_NONE' User should instruct the
9262ffc1057SHemant Agrawal  *		  port to read the parser-result
9272ffc1057SHemant Agrawal  */
9282ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_hdr_qos_mapping_mode {
9292ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_QOS_MAPPING_NONE = 0,
9302ffc1057SHemant Agrawal 			/**< No mapping, QoS field will not be changed */
9312ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_QOS_MAPPING_AS_IS,
9322ffc1057SHemant Agrawal 			/**< QoS field will be overwritten by the last byte in
9332ffc1057SHemant Agrawal 			 * the parser-result.
9342ffc1057SHemant Agrawal 			 */
9352ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_qos_mapping_mode;
9362ffc1057SHemant Agrawal 
9372ffc1057SHemant Agrawal /*
9382ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting QoS source
9392ffc1057SHemant Agrawal  *
9402ffc1057SHemant Agrawal  *		  Note: In all cases except 'e_FM_PCD_MANIP_HDR_QOS_SRC_NONE'
9412ffc1057SHemant Agrawal  *		  User should left room for the parser-result on input/output
9422ffc1057SHemant Agrawal  *		  buffer and instruct the port to read/write the parser-result
9432ffc1057SHemant Agrawal  *		  to the buffer (RPD should be set)
9442ffc1057SHemant Agrawal  */
9452ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_hdr_qos_src {
9462ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_QOS_SRC_NONE = 0,
9472ffc1057SHemant Agrawal 			/**< TODO */
9482ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_QOS_SRC_USER_DEFINED,
9492ffc1057SHemant Agrawal 			/**< QoS will be taken from the last byte in the
9502ffc1057SHemant Agrawal 			 * parser-result.
9512ffc1057SHemant Agrawal 			 */
9522ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_qos_src;
9532ffc1057SHemant Agrawal 
9542ffc1057SHemant Agrawal /*
9552ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting type of header insertion
9562ffc1057SHemant Agrawal  */
9572ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_hdr_insrt_by_hdr_type {
9582ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_INSRT_BY_HDR_SPECIFIC_L2,
9592ffc1057SHemant Agrawal 			/**< Specific L2 fields insertion */
9602ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_INSRT_BY_HDR_IP,		/**< IP insertion */
9612ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_INSRT_BY_HDR_UDP,		/**< UDP insertion */
9622ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_INSRT_BY_HDR_UDP_LITE,
9632ffc1057SHemant Agrawal 			/**< UDP lite insertion */
9642ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_INSRT_BY_HDR_CAPWAP		/**< CAPWAP insertion */
9652ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_insrt_by_hdr_type;
9662ffc1057SHemant Agrawal 
9672ffc1057SHemant Agrawal /*
9682ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting specific custom command
9692ffc1057SHemant Agrawal  */
9702ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_hdr_custom_type {
9712ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_CUSTOM_IP_REPLACE,
9722ffc1057SHemant Agrawal 			/**< Replace IPv4/IPv6 */
9732ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_CUSTOM_GEN_FIELD_REPLACE,
9742ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_custom_type;
9752ffc1057SHemant Agrawal 
9762ffc1057SHemant Agrawal /*
9772ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting specific custom command
9782ffc1057SHemant Agrawal  */
9792ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_hdr_custom_ip_replace {
9802ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_CUSTOM_REPLACE_IPV4_BY_IPV6,
9812ffc1057SHemant Agrawal 					/**< Replace IPv4 by IPv6 */
9822ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR_CUSTOM_REPLACE_IPV6_BY_IPV4
9832ffc1057SHemant Agrawal 					/**< Replace IPv6 by IPv4 */
9842ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_custom_ip_replace;
9852ffc1057SHemant Agrawal 
9862ffc1057SHemant Agrawal /*
9872ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting type of header removal
9882ffc1057SHemant Agrawal  */
9892ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_hdr_rmv_by_hdr_type {
9902ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_RMV_BY_HDR_SPECIFIC_L2 = 0,
9912ffc1057SHemant Agrawal 			/**< Specific L2 fields removal */
9922ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_RMV_BY_HDR_CAPWAP,	/**< CAPWAP removal */
9932ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_RMV_BY_HDR_FROM_START,
9942ffc1057SHemant Agrawal 				/**< Locate from data that is not the header */
9952ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_rmv_by_hdr_type;
9962ffc1057SHemant Agrawal 
9972ffc1057SHemant Agrawal /*
9982ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting type of timeout mode
9992ffc1057SHemant Agrawal  */
10002ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_reassem_time_out_mode {
10012ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_TIME_OUT_BETWEEN_FRAMES,
10022ffc1057SHemant Agrawal 					/**< Limits the time of the reassembly
10032ffc1057SHemant Agrawal 					 * process from the first fragment to
10042ffc1057SHemant Agrawal 					 * the last
10052ffc1057SHemant Agrawal 					 */
10062ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_TIME_OUT_BETWEEN_FRAG
10072ffc1057SHemant Agrawal 					/**< Limits the time of receiving the
10082ffc1057SHemant Agrawal 					 * fragment
10092ffc1057SHemant Agrawal 					 */
10102ffc1057SHemant Agrawal } ioc_fm_pcd_manip_reassem_time_out_mode;
10112ffc1057SHemant Agrawal 
10122ffc1057SHemant Agrawal /*
10132ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting type of WaysNumber mode
10142ffc1057SHemant Agrawal  */
10152ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_reassem_ways_number {
10162ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_ONE_WAY_HASH = 1,	/**< One way hash    */
10172ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_TWO_WAYS_HASH,	/**< Two ways hash   */
10182ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_THREE_WAYS_HASH,	/**< Three ways hash */
10192ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_FOUR_WAYS_HASH,	/**< Four ways hash  */
10202ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_FIVE_WAYS_HASH,	/**< Five ways hash  */
10212ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_SIX_WAYS_HASH,	/**< Six ways hash   */
10222ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_SEVEN_WAYS_HASH,	/**< Seven ways hash */
10232ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_EIGHT_WAYS_HASH	/**< Eight ways hash */
10242ffc1057SHemant Agrawal } ioc_fm_pcd_manip_reassem_ways_number;
10252ffc1057SHemant Agrawal 
10262ffc1057SHemant Agrawal /*
10272ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting manipulation type
10282ffc1057SHemant Agrawal  */
10292ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_type {
10302ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_HDR = 0,		/**< Header manipulation */
10312ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_REASSEM,		/**< Reassembly */
10322ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_FRAG,		/**< Fragmentation */
10332ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_SPECIAL_OFFLOAD	/**< Special Offloading */
10342ffc1057SHemant Agrawal } ioc_fm_pcd_manip_type;
10352ffc1057SHemant Agrawal 
10362ffc1057SHemant Agrawal /*
10372ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting type of statistics mode
10382ffc1057SHemant Agrawal  */
10392ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_cc_stats_mode {
10402ffc1057SHemant Agrawal 	e_IOC_FM_PCD_CC_STATS_MODE_NONE = 0,	/**< No statistics support */
10412ffc1057SHemant Agrawal 	e_IOC_FM_PCD_CC_STATS_MODE_FRAME,	/**< Frame count statistics */
10422ffc1057SHemant Agrawal 	e_IOC_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME,
10432ffc1057SHemant Agrawal 			/**< Byte and frame count statistics */
10442ffc1057SHemant Agrawal 	e_IOC_FM_PCD_CC_STATS_MODE_RMON,
10452ffc1057SHemant Agrawal 			/**< Byte and frame length range count statistics */
10462ffc1057SHemant Agrawal } ioc_fm_pcd_cc_stats_mode;
10472ffc1057SHemant Agrawal 
10482ffc1057SHemant Agrawal /*
10492ffc1057SHemant Agrawal  * @Description   Enumeration type for determining the action in case an IP
10502ffc1057SHemant Agrawal  *		  packet is larger than MTU but its DF (Don't Fragment) bit is
10512ffc1057SHemant Agrawal  *		  set.
10522ffc1057SHemant Agrawal  */
10532ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_donot_frag_action {
10542ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_DISCARD_PACKET = 0,	/**< Discard packet */
10552ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_ENQ_TO_ERR_Q_OR_DISCARD_PACKET =
10562ffc1057SHemant Agrawal 			e_IOC_FM_PCD_MANIP_DISCARD_PACKET,
10572ffc1057SHemant Agrawal 				/**< Obsolete, cannot enqueue to error queue; In
10582ffc1057SHemant Agrawal 				 * practice, selects to discard packets; Will be
10592ffc1057SHemant Agrawal 				 * removed in the future
10602ffc1057SHemant Agrawal 				 */
10612ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_FRAGMENT_PACKECT,
10622ffc1057SHemant Agrawal 				/**< Fragment packet and continue normal
10632ffc1057SHemant Agrawal 				 * processing
10642ffc1057SHemant Agrawal 				 */
10652ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_CONTINUE_WITHOUT_FRAG
10662ffc1057SHemant Agrawal 				/**< Continue normal processing without
10672ffc1057SHemant Agrawal 				 * fragmenting the packet
10682ffc1057SHemant Agrawal 				 */
10692ffc1057SHemant Agrawal } ioc_fm_pcd_manip_donot_frag_action;
10702ffc1057SHemant Agrawal 
10712ffc1057SHemant Agrawal /*
10722ffc1057SHemant Agrawal  * @Description   Enumeration type for selecting type of special offload
10732ffc1057SHemant Agrawal  *		  manipulation
10742ffc1057SHemant Agrawal  */
10752ffc1057SHemant Agrawal typedef enum ioc_fm_pcd_manip_special_offload_type {
10762ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_SPECIAL_OFFLOAD_IPSEC,
10772ffc1057SHemant Agrawal 					/**< IPSec offload manipulation */
10782ffc1057SHemant Agrawal 	e_IOC_FM_PCD_MANIP_SPECIAL_OFFLOAD_CAPWAP
10792ffc1057SHemant Agrawal 					/**< CAPWAP offload manipulation */
10802ffc1057SHemant Agrawal } ioc_fm_pcd_manip_special_offload_type;
10812ffc1057SHemant Agrawal 
10822ffc1057SHemant Agrawal /*
10832ffc1057SHemant Agrawal  * @Description   A union of protocol dependent special options
10842ffc1057SHemant Agrawal  *		  (Must match union u_FmPcdHdrProtocolOpt defined in
10852ffc1057SHemant Agrawal  *		  fm_pcd_ext.h)
10862ffc1057SHemant Agrawal  */
10872ffc1057SHemant Agrawal typedef union ioc_fm_pcd_hdr_protocol_opt_u {
10882ffc1057SHemant Agrawal 	ioc_eth_protocol_opt_t	eth_opt;	/**< Ethernet options */
10892ffc1057SHemant Agrawal 	ioc_vlan_protocol_opt_t   vlan_opt;	/**< Vlan options */
10902ffc1057SHemant Agrawal 	ioc_mpls_protocol_opt_t   mpls_opt;	/**< MPLS options */
10912ffc1057SHemant Agrawal 	ioc_ipv4_protocol_opt_t   ipv4_opt;	/**< IPv4 options */
10922ffc1057SHemant Agrawal 	ioc_ipv6_protocol_opt_t   ipv6_opt;	/**< IPv6 options */
10932ffc1057SHemant Agrawal 	ioc_capwap_protocol_opt_t capwap_opt;  /**< CAPWAP options */
10942ffc1057SHemant Agrawal } ioc_fm_pcd_hdr_protocol_opt_u;
10952ffc1057SHemant Agrawal 
10962ffc1057SHemant Agrawal /*
10972ffc1057SHemant Agrawal  * @Description   A union holding all known protocol fields
10982ffc1057SHemant Agrawal  */
10992ffc1057SHemant Agrawal typedef union ioc_fm_pcd_fields_u {
11002ffc1057SHemant Agrawal 	ioc_header_field_eth_t		eth;		/**< Ethernet*/
11012ffc1057SHemant Agrawal 	ioc_header_field_vlan_t		vlan;		/**< VLAN*/
11022ffc1057SHemant Agrawal 	ioc_header_field_llc_snap_t	llc_snap;	/**< LLC SNAP*/
11032ffc1057SHemant Agrawal 	ioc_header_field_pppoe_t		pppoe;	/**< PPPoE*/
11042ffc1057SHemant Agrawal 	ioc_header_field_mpls_t		mpls;		/**< MPLS*/
11052ffc1057SHemant Agrawal 	ioc_header_field_ip_t		ip;		/**< IP	*/
11062ffc1057SHemant Agrawal 	ioc_header_field_ipv4_t		ipv4;		/**< IPv4*/
11072ffc1057SHemant Agrawal 	ioc_header_field_ipv6_t		ipv6;		/**< IPv6*/
11082ffc1057SHemant Agrawal 	ioc_header_field_udp_t		udp;		/**< UDP	*/
11092ffc1057SHemant Agrawal 	ioc_header_field_udp_lite_t	udp_lite;	/**< UDP_Lite*/
11102ffc1057SHemant Agrawal 	ioc_header_field_tcp_t		tcp;		/**< TCP	*/
11112ffc1057SHemant Agrawal 	ioc_header_field_sctp_t		sctp;		/**< SCTP*/
11122ffc1057SHemant Agrawal 	ioc_header_field_dccp_t		dccp;		/**< DCCP*/
11132ffc1057SHemant Agrawal 	ioc_header_field_gre_t		gre;		/**< GRE	*/
11142ffc1057SHemant Agrawal 	ioc_header_field_minencap_t	minencap;/**< Minimal Encapsulation  */
11152ffc1057SHemant Agrawal 	ioc_header_field_ipsec_ah_t	ipsec_ah;	/**< IPSec AH*/
11162ffc1057SHemant Agrawal 	ioc_header_field_ipsec_esp_t	ipsec_esp;	/**< IPSec ESP*/
11172ffc1057SHemant Agrawal 	ioc_header_field_udp_encap_esp_t	udp_encap_esp;
11182ffc1057SHemant Agrawal 						/**< UDP Encapsulation ESP  */
11192ffc1057SHemant Agrawal } ioc_fm_pcd_fields_u;
11202ffc1057SHemant Agrawal 
11212ffc1057SHemant Agrawal /*
11222ffc1057SHemant Agrawal  * @Description   Parameters for defining header extraction for key generation
11232ffc1057SHemant Agrawal  */
11242ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_from_hdr_t {
11252ffc1057SHemant Agrawal 	uint8_t		size;	/**< Size in byte */
11262ffc1057SHemant Agrawal 	uint8_t		offset;	/**< Byte offset */
11272ffc1057SHemant Agrawal } ioc_fm_pcd_from_hdr_t;
11282ffc1057SHemant Agrawal 
11292ffc1057SHemant Agrawal /*
11302ffc1057SHemant Agrawal  * @Description   Parameters for defining field extraction for key generation
11312ffc1057SHemant Agrawal  */
11322ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_from_field_t {
11332ffc1057SHemant Agrawal 	ioc_fm_pcd_fields_u field;	/**< Field selection */
11342ffc1057SHemant Agrawal 	uint8_t		size;	/**< Size in byte */
11352ffc1057SHemant Agrawal 	uint8_t		offset;	/**< Byte offset */
11362ffc1057SHemant Agrawal } ioc_fm_pcd_from_field_t;
11372ffc1057SHemant Agrawal 
11382ffc1057SHemant Agrawal /*
11392ffc1057SHemant Agrawal  * @Description   Parameters for defining a single network environment unit
11402ffc1057SHemant Agrawal  *		  A distinction unit should be defined if it will later be used
11412ffc1057SHemant Agrawal  *		  by one or more PCD engines to distinguish between flows.
11422ffc1057SHemant Agrawal  *		  (Must match struct t_FmPcdDistinctionUnit defined in
11432ffc1057SHemant Agrawal  *		  fm_pcd_ext.h)
11442ffc1057SHemant Agrawal  */
11452ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_distinction_unit_t {
11462ffc1057SHemant Agrawal 	struct {
11472ffc1057SHemant Agrawal 	ioc_net_header_type	hdr;
11482ffc1057SHemant Agrawal 				/**< One of the headers supported by the FM */
11492ffc1057SHemant Agrawal 	ioc_fm_pcd_hdr_protocol_opt_u  opt;	/**< Select only one option! */
11502ffc1057SHemant Agrawal 	} hdrs[IOC_FM_PCD_MAX_NUM_OF_INTERCHANGEABLE_HDRS];
11512ffc1057SHemant Agrawal } ioc_fm_pcd_distinction_unit_t;
11522ffc1057SHemant Agrawal 
11532ffc1057SHemant Agrawal /*
11542ffc1057SHemant Agrawal  * @Description   Parameters for defining all different distinction units
11552ffc1057SHemant Agrawal  *		  supported by a specific PCD Network Environment
11562ffc1057SHemant Agrawal  *		  Characteristics module.
11572ffc1057SHemant Agrawal  *
11582ffc1057SHemant Agrawal  *		  Each unit represent a protocol or a group of protocols that
11592ffc1057SHemant Agrawal  *		  may be used later by the different PCD engines to distinguish
11602ffc1057SHemant Agrawal  *		  between flows.
11612ffc1057SHemant Agrawal  *		  (Must match struct t_FmPcdNetEnvParams defined in
11622ffc1057SHemant Agrawal  *		  fm_pcd_ext.h)
11632ffc1057SHemant Agrawal  */
11642ffc1057SHemant Agrawal struct fm_pcd_net_env_params_t {
11652ffc1057SHemant Agrawal 	uint8_t num_of_distinction_units;
11662ffc1057SHemant Agrawal 	/**< Number of different units to be identified */
11672ffc1057SHemant Agrawal 	ioc_fm_pcd_distinction_unit_t
11682ffc1057SHemant Agrawal 		units[IOC_FM_PCD_MAX_NUM_OF_DISTINCTION_UNITS];
11692ffc1057SHemant Agrawal 	/**< An array of num_of_distinction_units of the different units to be
11702ffc1057SHemant Agrawal 	 * identified
11712ffc1057SHemant Agrawal 	 */
11722ffc1057SHemant Agrawal };
11732ffc1057SHemant Agrawal 
11742ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_net_env_params_t {
11752ffc1057SHemant Agrawal 	struct fm_pcd_net_env_params_t param;
11762ffc1057SHemant Agrawal 	void				*id;
11772ffc1057SHemant Agrawal 		/**< Output parameter; Returns the net-env Id to be used */
11782ffc1057SHemant Agrawal } ioc_fm_pcd_net_env_params_t;
11792ffc1057SHemant Agrawal 
11802ffc1057SHemant Agrawal /*
11812ffc1057SHemant Agrawal  * @Description   Parameters for defining a single extraction action when
11822ffc1057SHemant Agrawal  *		  creating a key
11832ffc1057SHemant Agrawal  */
11842ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_extract_entry_t {
11852ffc1057SHemant Agrawal 	ioc_fm_pcd_extract_type		type;	/**< Extraction type select */
11862ffc1057SHemant Agrawal 	union {
11872ffc1057SHemant Agrawal 	struct {
11882ffc1057SHemant Agrawal 		ioc_net_header_type	hdr;		/**< Header selection */
11892ffc1057SHemant Agrawal 		bool			ignore_protocol_validation;
11902ffc1057SHemant Agrawal 					/**< Ignore protocol validation */
11912ffc1057SHemant Agrawal 		ioc_fm_pcd_hdr_index	hdr_index;
11922ffc1057SHemant Agrawal 					/**< Relevant only for MPLS, VLAN and
11932ffc1057SHemant Agrawal 					 * tunneled IP. Otherwise should be
11942ffc1057SHemant Agrawal 					 * cleared.
11952ffc1057SHemant Agrawal 					 */
11962ffc1057SHemant Agrawal 		ioc_fm_pcd_extract_by_hdr_type  type;
11972ffc1057SHemant Agrawal 					/**< Header extraction type select */
11982ffc1057SHemant Agrawal 		union {
11992ffc1057SHemant Agrawal 		ioc_fm_pcd_from_hdr_t	from_hdr;
12002ffc1057SHemant Agrawal 					/**< Extract bytes from header
12012ffc1057SHemant Agrawal 					 * parameters
12022ffc1057SHemant Agrawal 					 */
12032ffc1057SHemant Agrawal 		ioc_fm_pcd_from_field_t	from_field;
12042ffc1057SHemant Agrawal 					/**< Extract bytes from field parameters
12052ffc1057SHemant Agrawal 					 */
12062ffc1057SHemant Agrawal 		ioc_fm_pcd_fields_u	full_field;
12072ffc1057SHemant Agrawal 					/**< Extract full field parameters */
12082ffc1057SHemant Agrawal 		} extract_by_hdr_type;
12092ffc1057SHemant Agrawal 	} extract_by_hdr;/**< Used when type = e_IOC_FM_PCD_KG_EXTRACT_BY_HDR */
12102ffc1057SHemant Agrawal 	struct {
12112ffc1057SHemant Agrawal 		ioc_fm_pcd_extract_from	src;
12122ffc1057SHemant Agrawal 					/**< Non-header extraction source */
12132ffc1057SHemant Agrawal 		ioc_fm_pcd_action	action;	/**< Relevant for CC Only */
12142ffc1057SHemant Agrawal 		uint16_t	ic_indx_mask;
12152ffc1057SHemant Agrawal 				/**< Relevant only for CC whenaction =
12162ffc1057SHemant Agrawal 				 * e_IOC_FM_PCD_ACTION_INDEXED_LOOKUP; Note that
12172ffc1057SHemant Agrawal 				 * the number of bits that are set within this
12182ffc1057SHemant Agrawal 				 * mask must be log2 of the CC-node
12192ffc1057SHemant Agrawal 				 * 'num_of_keys'. Note that the mask cannot be
12202ffc1057SHemant Agrawal 				 * set on the lower bits.
12212ffc1057SHemant Agrawal 				 */
12222ffc1057SHemant Agrawal 		uint8_t			offset;	/**< Byte offset */
12232ffc1057SHemant Agrawal 		uint8_t			size;	/**< Size in bytes */
12242ffc1057SHemant Agrawal 	} extract_non_hdr;
12252ffc1057SHemant Agrawal 		/**< Used when type = e_IOC_FM_PCD_KG_EXTRACT_NON_HDR */
12262ffc1057SHemant Agrawal 	} extract_params;
12272ffc1057SHemant Agrawal } ioc_fm_pcd_extract_entry_t;
12282ffc1057SHemant Agrawal 
12292ffc1057SHemant Agrawal /*
12302ffc1057SHemant Agrawal  * @Description   A structure for defining masks for each extracted
12312ffc1057SHemant Agrawal  *		  field in the key.
12322ffc1057SHemant Agrawal  */
12332ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_kg_extract_mask_t {
12342ffc1057SHemant Agrawal 	uint8_t		extract_array_index;
12352ffc1057SHemant Agrawal 				/**< Index in the extraction array, as
12362ffc1057SHemant Agrawal 				 * initialized by user
12372ffc1057SHemant Agrawal 				 */
12382ffc1057SHemant Agrawal 	uint8_t		offset;	/**< Byte offset */
12392ffc1057SHemant Agrawal 	uint8_t		mask;
12402ffc1057SHemant Agrawal 			/**< A byte mask (selected bits will be ignored) */
12412ffc1057SHemant Agrawal } ioc_fm_pcd_kg_extract_mask_t;
12422ffc1057SHemant Agrawal 
12432ffc1057SHemant Agrawal /*
12442ffc1057SHemant Agrawal  * @Description   A structure for defining default selection per groups of
12452ffc1057SHemant Agrawal  *		  fields
12462ffc1057SHemant Agrawal  */
12472ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_kg_extract_dflt_t {
12482ffc1057SHemant Agrawal 	ioc_fm_pcd_kg_known_fields_dflt_types	type;
12492ffc1057SHemant Agrawal 						/**< Default type select */
12502ffc1057SHemant Agrawal 	ioc_fm_pcd_kg_extract_dflt_select	dflt_select;
12512ffc1057SHemant Agrawal 						/**< Default register select */
12522ffc1057SHemant Agrawal } ioc_fm_pcd_kg_extract_dflt_t;
12532ffc1057SHemant Agrawal 
12542ffc1057SHemant Agrawal 
12552ffc1057SHemant Agrawal /*
12562ffc1057SHemant Agrawal  * @Description   A structure for defining all parameters needed for
12572ffc1057SHemant Agrawal  *		  generation a key and using a hash function
12582ffc1057SHemant Agrawal  */
12592ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_kg_key_extract_and_hash_params_t {
12602ffc1057SHemant Agrawal 	uint32_t			private_dflt0;
12612ffc1057SHemant Agrawal 					/**< Scheme default register 0 */
12622ffc1057SHemant Agrawal 	uint32_t			private_dflt1;
12632ffc1057SHemant Agrawal 					/**< Scheme default register 1 */
12642ffc1057SHemant Agrawal 	uint8_t				num_of_used_extracts;
12652ffc1057SHemant Agrawal 					/**< defines the valid size of the
12662ffc1057SHemant Agrawal 					 * following array
12672ffc1057SHemant Agrawal 					 */
12682ffc1057SHemant Agrawal 	ioc_fm_pcd_extract_entry_t
12692ffc1057SHemant Agrawal 			extract_array[IOC_FM_PCD_KG_MAX_EXTRACTS_PER_KEY];
12702ffc1057SHemant Agrawal 					/**< An array of extraction definitions.
12712ffc1057SHemant Agrawal 					 */
12722ffc1057SHemant Agrawal 	uint8_t				num_of_used_dflts;
12732ffc1057SHemant Agrawal 					/**< defines the valid size of the
12742ffc1057SHemant Agrawal 					 * following array
12752ffc1057SHemant Agrawal 					 */
12762ffc1057SHemant Agrawal 	ioc_fm_pcd_kg_extract_dflt_t
12772ffc1057SHemant Agrawal 				dflts[IOC_FM_PCD_KG_NUM_OF_DEFAULT_GROUPS];
12782ffc1057SHemant Agrawal 					/**< For each extraction used in this
12792ffc1057SHemant Agrawal 					 * scheme, specify the required default
12802ffc1057SHemant Agrawal 					 * register to be used when header is
12812ffc1057SHemant Agrawal 					 * not found. types not specified in
12822ffc1057SHemant Agrawal 					 * this array will get undefined value.
12832ffc1057SHemant Agrawal 					 */
12842ffc1057SHemant Agrawal 	uint8_t				num_of_used_masks;
12852ffc1057SHemant Agrawal 					/**< Defines the valid size of the
12862ffc1057SHemant Agrawal 					 * following array
12872ffc1057SHemant Agrawal 					 */
12882ffc1057SHemant Agrawal 	ioc_fm_pcd_kg_extract_mask_t
12892ffc1057SHemant Agrawal 				masks[IOC_FM_PCD_KG_NUM_OF_EXTRACT_MASKS];
12902ffc1057SHemant Agrawal 	uint8_t				hash_shift;
12912ffc1057SHemant Agrawal 					/**< Hash result right shift. Selects
12922ffc1057SHemant Agrawal 					 * the 24 bits out of the 64 hash
12932ffc1057SHemant Agrawal 					 * result. 0 means using the 24 LSB's,
12942ffc1057SHemant Agrawal 					 * otherwise use the 24 LSB's after
12952ffc1057SHemant Agrawal 					 * shifting right.
12962ffc1057SHemant Agrawal 					 */
12972ffc1057SHemant Agrawal 	uint32_t			hash_dist_num_of_fqids;
12982ffc1057SHemant Agrawal 					/**< must be > 1 and a power of 2.
12992ffc1057SHemant Agrawal 					 * Represents the range of queues for
13002ffc1057SHemant Agrawal 					 * the key and hash functionality
13012ffc1057SHemant Agrawal 					 */
13022ffc1057SHemant Agrawal 	uint8_t				hash_distribution_fqids_shift;
13032ffc1057SHemant Agrawal 					/**< selects the FQID bits that will be
13042ffc1057SHemant Agrawal 					 * effected by the hash
13052ffc1057SHemant Agrawal 					 */
13062ffc1057SHemant Agrawal 	bool				symmetric_hash;
13072ffc1057SHemant Agrawal 					/**< TRUE to generate the same hash for
13082ffc1057SHemant Agrawal 					 * frames with swapped source and
13092ffc1057SHemant Agrawal 					 * destination fields on all layers; If
13102ffc1057SHemant Agrawal 					 * TRUE, driver will check that for all
13112ffc1057SHemant Agrawal 					 * layers, if SRC extraction is
13122ffc1057SHemant Agrawal 					 * selected, DST extraction must also be
13132ffc1057SHemant Agrawal 					 * selected, and vice versa.
13142ffc1057SHemant Agrawal 					 */
13152ffc1057SHemant Agrawal } ioc_fm_pcd_kg_key_extract_and_hash_params_t;
13162ffc1057SHemant Agrawal 
13172ffc1057SHemant Agrawal /*
13182ffc1057SHemant Agrawal  * @Description   A structure of parameters for defining a single Qid mask
13192ffc1057SHemant Agrawal  *		  (extracted OR).
13202ffc1057SHemant Agrawal  */
13212ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_kg_extracted_or_params_t {
13222ffc1057SHemant Agrawal 	ioc_fm_pcd_extract_type		type;
13232ffc1057SHemant Agrawal 					/**< Extraction type select */
13242ffc1057SHemant Agrawal 	union {
13252ffc1057SHemant Agrawal 	struct {
13262ffc1057SHemant Agrawal 			/**< used when type = e_IOC_FM_PCD_KG_EXTRACT_BY_HDR */
13272ffc1057SHemant Agrawal 		ioc_net_header_type		hdr;
13282ffc1057SHemant Agrawal 		ioc_fm_pcd_hdr_index		hdr_index;
13292ffc1057SHemant Agrawal 						/**< Relevant only for MPLS,
13302ffc1057SHemant Agrawal 						 * VLAN and tunneled IP.
13312ffc1057SHemant Agrawal 						 * Otherwise should be cleared.
13322ffc1057SHemant Agrawal 						 */
13332ffc1057SHemant Agrawal 		bool				ignore_protocol_validation;
13342ffc1057SHemant Agrawal 
13352ffc1057SHemant Agrawal 	} extract_by_hdr;
13362ffc1057SHemant Agrawal 	ioc_fm_pcd_extract_from		src;
13372ffc1057SHemant Agrawal 					/**< used when type =
13382ffc1057SHemant Agrawal 					 * e_IOC_FM_PCD_KG_EXTRACT_NON_HDR
13392ffc1057SHemant Agrawal 					 */
13402ffc1057SHemant Agrawal 	} extract_params;
13412ffc1057SHemant Agrawal 	uint8_t				extraction_offset;
13422ffc1057SHemant Agrawal 					/**< Offset for extraction */
13432ffc1057SHemant Agrawal 	ioc_fm_pcd_kg_extract_dflt_select	dflt_value;
13442ffc1057SHemant Agrawal 					/**< Select register from which
13452ffc1057SHemant Agrawal 					 * extraction is taken if field not
13462ffc1057SHemant Agrawal 					 * found
13472ffc1057SHemant Agrawal 					 */
13482ffc1057SHemant Agrawal 	uint8_t				mask;
13492ffc1057SHemant Agrawal 					/**< Mask LSB byte of extraction
13502ffc1057SHemant Agrawal 					 * (specified bits are ignored)
13512ffc1057SHemant Agrawal 					 */
13522ffc1057SHemant Agrawal 
13532ffc1057SHemant Agrawal 	uint8_t			bit_offset_in_fqid;
13542ffc1057SHemant Agrawal 		/**< 0-31, Selects which bits of the 24 FQID bits to effect
13552ffc1057SHemant Agrawal 		 * using the extracted byte; Assume byte is placed as the 8
13562ffc1057SHemant Agrawal 		 * MSB's in a 32 bit word where the lower bits are the FQID; i.e
13572ffc1057SHemant Agrawal 		 * if bitOffsetInFqid=1 than its LSB will effect the FQID MSB,
13582ffc1057SHemant Agrawal 		 * if bitOffsetInFqid=24 than the extracted byte will effect the
13592ffc1057SHemant Agrawal 		 * 8 LSB's of the FQID, if bitOffsetInFqid=31 than the byte's
13602ffc1057SHemant Agrawal 		 * MSB will effect the FQID's LSB; 0 means - no effect on FQID;
13612ffc1057SHemant Agrawal 		 * Note that one, and only one of bitOffsetInFqid or
13622ffc1057SHemant Agrawal 		 * bitOffsetInPlcrProfile must be set (i.e, extracted byte must
13632ffc1057SHemant Agrawal 		 * effect either FQID or Policer profile).
13642ffc1057SHemant Agrawal 		 */
13652ffc1057SHemant Agrawal 	uint8_t			bit_offset_in_plcr_profile;
13662ffc1057SHemant Agrawal 		/**< 0-15, Selects which bits of the 8 policer profile id bits
13672ffc1057SHemant Agrawal 		 * to effect using the extracted byte; Assume byte is placed as
13682ffc1057SHemant Agrawal 		 * the 8 MSB's in a 16 bit word where the lower bits are the
13692ffc1057SHemant Agrawal 		 * policer profile id; i.e if bitOffsetInPlcrProfile=1 than its
13702ffc1057SHemant Agrawal 		 * LSB will effect the profile MSB, if bitOffsetInFqid=8 than
13712ffc1057SHemant Agrawal 		 * the extracted byte will effect the whole policer profile id,
13722ffc1057SHemant Agrawal 		 * if bitOffsetInFqid=15 than the byte's MSB will effect the
13732ffc1057SHemant Agrawal 		 * Policer Profile id's LSB; 0 means - no effect on policer
13742ffc1057SHemant Agrawal 		 * profile; Note that one, and only one of bitOffsetInFqid or
13752ffc1057SHemant Agrawal 		 * bitOffsetInPlcrProfile must be set (i.e, extracted byte must
13762ffc1057SHemant Agrawal 		 * effect either FQID or Policer profile).
13772ffc1057SHemant Agrawal 		 */
13782ffc1057SHemant Agrawal } ioc_fm_pcd_kg_extracted_or_params_t;
13792ffc1057SHemant Agrawal 
13802ffc1057SHemant Agrawal /*
13812ffc1057SHemant Agrawal  * @Description   A structure for configuring scheme counter
13822ffc1057SHemant Agrawal  */
13832ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_kg_scheme_counter_t {
13842ffc1057SHemant Agrawal 	bool		update;
13852ffc1057SHemant Agrawal 			/**< FALSE to keep the current counter state and
13862ffc1057SHemant Agrawal 			 * continue from that point, TRUE to update/reset the
13872ffc1057SHemant Agrawal 			 * counter when the scheme is written.
13882ffc1057SHemant Agrawal 			 */
13892ffc1057SHemant Agrawal 	uint32_t	value;
13902ffc1057SHemant Agrawal 			/**< If update=TRUE, this value will be written into the
13912ffc1057SHemant Agrawal 			 * counter; clear this field to reset the counter.
13922ffc1057SHemant Agrawal 			 */
13932ffc1057SHemant Agrawal } ioc_fm_pcd_kg_scheme_counter_t;
13942ffc1057SHemant Agrawal 
13952ffc1057SHemant Agrawal 
13962ffc1057SHemant Agrawal /*
13972ffc1057SHemant Agrawal  * @Description   A structure for retrieving FMKG_SE_SPC
13982ffc1057SHemant Agrawal  */
13992ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_kg_scheme_spc_t {
14002ffc1057SHemant Agrawal 	uint32_t	val;	/**< return value */
14012ffc1057SHemant Agrawal 	void	*id;		/**< scheme handle */
14022ffc1057SHemant Agrawal } ioc_fm_pcd_kg_scheme_spc_t;
14032ffc1057SHemant Agrawal 
14042ffc1057SHemant Agrawal /*
14052ffc1057SHemant Agrawal  * @Description   A structure for defining policer profile parameters as
14062ffc1057SHemant Agrawal  *		  required by keygen (when policer is the next engine after this
14072ffc1057SHemant Agrawal  *		  scheme).
14082ffc1057SHemant Agrawal  *		  (Must match struct t_FmPcdKgPlcrProfile defined in
14092ffc1057SHemant Agrawal  *		  fm_pcd_ext.h)
14102ffc1057SHemant Agrawal  */
14112ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_kg_plcr_profile_t {
14122ffc1057SHemant Agrawal 	bool		shared_profile;
14132ffc1057SHemant Agrawal 			/**< TRUE if this profile is shared between ports (i.e.
14142ffc1057SHemant Agrawal 			 * managed by primary partition) May not be TRUE if
14152ffc1057SHemant Agrawal 			 * profile is after Coarse Classification
14162ffc1057SHemant Agrawal 			 */
14172ffc1057SHemant Agrawal 	bool		direct;
14182ffc1057SHemant Agrawal 			/**< If TRUE, direct_relative_profile_id only selects
14192ffc1057SHemant Agrawal 			 * the profile id, if FALSE
14202ffc1057SHemant Agrawal 			 * fqid_offset_relative_profile_id_base is used together
14212ffc1057SHemant Agrawal 			 * with fqid_offset_shift and num_of_profiles
14222ffc1057SHemant Agrawal 			 * parameters, to define a range of profiles from which
14232ffc1057SHemant Agrawal 			 * the KeyGen result will determine the destination
14242ffc1057SHemant Agrawal 			 * policer profile.
14252ffc1057SHemant Agrawal 			 */
14262ffc1057SHemant Agrawal 	union {
14272ffc1057SHemant Agrawal 	uint16_t	direct_relative_profile_id;
14282ffc1057SHemant Agrawal 			/**< Used if 'direct' is TRUE, to select policer
14292ffc1057SHemant Agrawal 			 * profile. This parameter should indicate the policer
14302ffc1057SHemant Agrawal 			 * profile offset within the port's policer profiles or
14312ffc1057SHemant Agrawal 			 * SHARED window.
14322ffc1057SHemant Agrawal 			 */
14332ffc1057SHemant Agrawal 	struct {
14342ffc1057SHemant Agrawal 		uint8_t	fqid_offset_shift;
14352ffc1057SHemant Agrawal 			/**< Shift of KG results without the qid base */
14362ffc1057SHemant Agrawal 		uint8_t	fqid_offset_relative_profile_id_base;
14372ffc1057SHemant Agrawal 			/**< OR of KG results without the qid base This
14382ffc1057SHemant Agrawal 			 * parameter should indicate the policer profile offset
14392ffc1057SHemant Agrawal 			 * within the port's policer profiles window or SHARED
14402ffc1057SHemant Agrawal 			 * window depends on shared_profile
14412ffc1057SHemant Agrawal 			 */
14422ffc1057SHemant Agrawal 		uint8_t	num_of_profiles;
14432ffc1057SHemant Agrawal 			/**< Range of profiles starting at base */
14442ffc1057SHemant Agrawal 	} indirect_profile;		/**< Indirect profile parameters */
14452ffc1057SHemant Agrawal 	} profile_select;
14462ffc1057SHemant Agrawal 			/**< Direct/indirect profile selection and parameters */
14472ffc1057SHemant Agrawal } ioc_fm_pcd_kg_plcr_profile_t;
14482ffc1057SHemant Agrawal 
14492ffc1057SHemant Agrawal /*
14502ffc1057SHemant Agrawal  * @Description   Parameters for configuring a storage profile for a KeyGen
14512ffc1057SHemant Agrawal  *		  scheme.
14522ffc1057SHemant Agrawal  */
14532ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_kg_storage_profile_t {
14542ffc1057SHemant Agrawal 	bool	direct;
14552ffc1057SHemant Agrawal 		/**< If TRUE, directRelativeProfileId only selects the profile
14562ffc1057SHemant Agrawal 		 * id; If FALSE, fqidOffsetRelativeProfileIdBase is used
14572ffc1057SHemant Agrawal 		 * together with fqidOffsetShift and num_of_profiles parameters
14582ffc1057SHemant Agrawal 		 * to define a range of profiles from which the KeyGen result
14592ffc1057SHemant Agrawal 		 * will determine the destination storage profile.
14602ffc1057SHemant Agrawal 		 */
14612ffc1057SHemant Agrawal 	union {
14622ffc1057SHemant Agrawal 		uint16_t	direct_relative_profile_id;
14632ffc1057SHemant Agrawal 		/**< Used when 'direct' is TRUE, to select a storage profile;
14642ffc1057SHemant Agrawal 		 * should indicate the storage profile offset within the port's
14652ffc1057SHemant Agrawal 		 * storage profiles window.
14662ffc1057SHemant Agrawal 		 */
14672ffc1057SHemant Agrawal 		struct {
14682ffc1057SHemant Agrawal 			uint8_t	fqid_offset_shift;
14692ffc1057SHemant Agrawal 			/**< Shift of KeyGen results without the FQID base */
14702ffc1057SHemant Agrawal 			uint8_t	fqid_offset_relative_profile_id_base;
14712ffc1057SHemant Agrawal 			/**< OR of KeyGen results without the FQID base; should
14722ffc1057SHemant Agrawal 			 * indicate the policer profile offset within the port's
14732ffc1057SHemant Agrawal 			 * storage profiles window.
14742ffc1057SHemant Agrawal 			 */
14752ffc1057SHemant Agrawal 			uint8_t	num_of_profiles;
14762ffc1057SHemant Agrawal 			/**< Range of profiles starting at base. */
14772ffc1057SHemant Agrawal 		} indirect_profile;
14782ffc1057SHemant Agrawal 		/**< Indirect profile parameters. */
14792ffc1057SHemant Agrawal 	} profile_select;
14802ffc1057SHemant Agrawal 	/**< Direct/indirect profile selection and parameters. */
14812ffc1057SHemant Agrawal } ioc_fm_pcd_kg_storage_profile_t;
14822ffc1057SHemant Agrawal 
14832ffc1057SHemant Agrawal /*
14842ffc1057SHemant Agrawal  * @Description   Parameters for defining CC as the next engine after KeyGen
14852ffc1057SHemant Agrawal  *		  (Must match struct t_FmPcdKgCc defined in fm_pcd_ext.h)
14862ffc1057SHemant Agrawal  */
14872ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_kg_cc_t {
14882ffc1057SHemant Agrawal 	void				*tree_id;
14892ffc1057SHemant Agrawal 					/**< CC Tree id */
14902ffc1057SHemant Agrawal 	uint8_t				grp_id;
14912ffc1057SHemant Agrawal 					/**< CC group id within the CC tree */
14922ffc1057SHemant Agrawal 	bool				plcr_next;
14932ffc1057SHemant Agrawal 					/**< TRUE if after CC, in case of data
14942ffc1057SHemant Agrawal 					 * frame, policing is required.
14952ffc1057SHemant Agrawal 					 */
14962ffc1057SHemant Agrawal 	bool				bypass_plcr_profile_generation;
14972ffc1057SHemant Agrawal 					/**< TRUE to bypass KeyGen policer
14982ffc1057SHemant Agrawal 					 * profile generation; selected profile
14992ffc1057SHemant Agrawal 					 * is the one set at port initialization
15002ffc1057SHemant Agrawal 					 */
15012ffc1057SHemant Agrawal 	ioc_fm_pcd_kg_plcr_profile_t	plcr_profile;
15022ffc1057SHemant Agrawal 					/**< Valid only if plcr_next = TRUE and
15032ffc1057SHemant Agrawal 					 * bypass_plcr_profile_generation =
15042ffc1057SHemant Agrawal 					 * FALSE
15052ffc1057SHemant Agrawal 					 */
15062ffc1057SHemant Agrawal } ioc_fm_pcd_kg_cc_t;
15072ffc1057SHemant Agrawal 
15082ffc1057SHemant Agrawal /*
15092ffc1057SHemant Agrawal  * @Description   Parameters for defining initializing a KeyGen scheme (Must
15102ffc1057SHemant Agrawal  *		  match struct t_FmPcdKgSchemeParams defined in fm_pcd_ext.h)
15112ffc1057SHemant Agrawal  */
15122ffc1057SHemant Agrawal struct fm_pcd_kg_scheme_params_t {
15132ffc1057SHemant Agrawal 	bool modify;	/**< TRUE to change an existing scheme */
15142ffc1057SHemant Agrawal 	union {
15152ffc1057SHemant Agrawal 		uint8_t relative_scheme_id;
15162ffc1057SHemant Agrawal 		/**< if modify=FALSE: partition-relative scheme id */
15172ffc1057SHemant Agrawal 		void *scheme_id;
15182ffc1057SHemant Agrawal 		/**< if modify=TRUE: the id of an existing scheme */
15192ffc1057SHemant Agrawal 	} scm_id;
15202ffc1057SHemant Agrawal 	bool always_direct;
15212ffc1057SHemant Agrawal 		/**< This scheme is reached only directly, i.e. no need for
15222ffc1057SHemant Agrawal 		 * match vector; KeyGen will ignore it when matching
15232ffc1057SHemant Agrawal 		 */
15242ffc1057SHemant Agrawal 	struct {
15252ffc1057SHemant Agrawal 		/**< HL relevant only if always_direct=FALSE */
15262ffc1057SHemant Agrawal 		void *net_env_id;
15272ffc1057SHemant Agrawal 		/**< The id of the Network Environment as returned
15282ffc1057SHemant Agrawal 		 * by fm_pcd_net_env_characteristics_set()
15292ffc1057SHemant Agrawal 		 */
15302ffc1057SHemant Agrawal 		uint8_t num_of_distinction_units;
15312ffc1057SHemant Agrawal 		/**< Number of NetEnv units listed in unit_ids array */
15322ffc1057SHemant Agrawal 		uint8_t unit_ids[IOC_FM_PCD_MAX_NUM_OF_DISTINCTION_UNITS];
15332ffc1057SHemant Agrawal 		/**< Indexes as passed to SetNetEnvCharacteristics (?) array */
15342ffc1057SHemant Agrawal 	} net_env_params;
15352ffc1057SHemant Agrawal 	bool use_hash;
15362ffc1057SHemant Agrawal 		/**< use the KG Hash functionality */
15372ffc1057SHemant Agrawal 	ioc_fm_pcd_kg_key_extract_and_hash_params_t key_ext_and_hash;
15382ffc1057SHemant Agrawal 		/**< used only if useHash = TRUE */
15392ffc1057SHemant Agrawal 	bool bypass_fqid_generation;
15402ffc1057SHemant Agrawal 		/**< Normally - FALSE, TRUE to avoid FQID update in the IC; In
15412ffc1057SHemant Agrawal 		 * such a case FQID after KG will be the default FQID defined
15422ffc1057SHemant Agrawal 		 * for the relevant port, or the FQID defined by CC in cases
15432ffc1057SHemant Agrawal 		 * where CC was the previous engine.
15442ffc1057SHemant Agrawal 		 */
15452ffc1057SHemant Agrawal 	uint32_t base_fqid;
15462ffc1057SHemant Agrawal 		/**< Base FQID; Relevant only if bypass_fqid_generation = FALSE;
15472ffc1057SHemant Agrawal 		 * If hash is used and an even distribution is expected
15482ffc1057SHemant Agrawal 		 * according to hash_dist_num_of_fqids, base_fqid must
15492ffc1057SHemant Agrawal 		 * be aligned to hash_dist_num_of_fqids.
15502ffc1057SHemant Agrawal 		 */
15512ffc1057SHemant Agrawal 	uint8_t num_of_used_extracted_ors;
15522ffc1057SHemant Agrawal 		/**< Number of FQID masks listed in extracted_ors array*/
15532ffc1057SHemant Agrawal 	ioc_fm_pcd_kg_extracted_or_params_t
15542ffc1057SHemant Agrawal 		extracted_ors[IOC_FM_PCD_KG_NUM_OF_GENERIC_REGS];
15552ffc1057SHemant Agrawal 		/**< IOC_FM_PCD_KG_NUM_OF_GENERIC_REGS registers are shared
15562ffc1057SHemant Agrawal 		 * between qid_masks functionality and some of the extraction
15572ffc1057SHemant Agrawal 		 * actions; Normally only some will be used for qid_mask. Driver
15582ffc1057SHemant Agrawal 		 * will return error if resource is full at initialization time.
15592ffc1057SHemant Agrawal 		 */
15602ffc1057SHemant Agrawal 	bool override_storage_profile;
15612ffc1057SHemant Agrawal 		/**< TRUE if KeyGen override previously decided storage profile
15622ffc1057SHemant Agrawal 		 */
15632ffc1057SHemant Agrawal 	ioc_fm_pcd_kg_storage_profile_t storage_profile;
15642ffc1057SHemant Agrawal 		/**< Used when override_storage_profile=TRUE */
15652ffc1057SHemant Agrawal 	ioc_fm_pcd_engine next_engine;
15662ffc1057SHemant Agrawal 		/**< may be BMI, PLCR or CC */
15672ffc1057SHemant Agrawal 	union {
15682ffc1057SHemant Agrawal 		/**< depends on nextEngine */
15692ffc1057SHemant Agrawal 		ioc_fm_pcd_done_action done_action;
15702ffc1057SHemant Agrawal 		/**< Used when next engine is BMI (done) */
15712ffc1057SHemant Agrawal 		ioc_fm_pcd_kg_plcr_profile_t plcr_profile;
15722ffc1057SHemant Agrawal 		/**< Used when next engine is PLCR */
15732ffc1057SHemant Agrawal 		ioc_fm_pcd_kg_cc_t cc;
15742ffc1057SHemant Agrawal 		/**< Used when next engine is CC */
15752ffc1057SHemant Agrawal 	} kg_next_engine_params;
15762ffc1057SHemant Agrawal 	ioc_fm_pcd_kg_scheme_counter_t scheme_counter;
15772ffc1057SHemant Agrawal 		/**< A structure of parameters for updating the scheme counter*/
15782ffc1057SHemant Agrawal };
15792ffc1057SHemant Agrawal 
15802ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_kg_scheme_params_t {
15812ffc1057SHemant Agrawal 	struct fm_pcd_kg_scheme_params_t param;
15822ffc1057SHemant Agrawal 	void *id;		/**< Returns the scheme Id to be used */
15832ffc1057SHemant Agrawal } ioc_fm_pcd_kg_scheme_params_t;
15842ffc1057SHemant Agrawal 
15852ffc1057SHemant Agrawal /*
15862ffc1057SHemant Agrawal  * @Collection
15872ffc1057SHemant Agrawal  */
15882ffc1057SHemant Agrawal #define IOC_FM_PCD_CC_STATS_MAX_FLR	10
15892ffc1057SHemant Agrawal 			/* Maximal supported number of frame length ranges */
15902ffc1057SHemant Agrawal #define IOC_FM_PCD_CC_STATS_FLR_SIZE		2
15912ffc1057SHemant Agrawal 			/* Size in bytes of a frame length range limit */
15922ffc1057SHemant Agrawal #define IOC_FM_PCD_CC_STATS_FLR_COUNT_SIZE	4
15932ffc1057SHemant Agrawal 			/* Size in bytes of a frame length range counter */
15942ffc1057SHemant Agrawal /* @} */
15952ffc1057SHemant Agrawal 
15962ffc1057SHemant Agrawal /*
15972ffc1057SHemant Agrawal  * @Description   Parameters for defining CC as the next engine after a CC node.
15982ffc1057SHemant Agrawal  *		  (Must match struct t_FmPcdCcNextCcParams defined in
15992ffc1057SHemant Agrawal  *		  fm_pcd_ext.h)
16002ffc1057SHemant Agrawal  */
16012ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_next_cc_params_t {
16022ffc1057SHemant Agrawal 	void	*cc_node_id;			/**< Id of the next CC node */
16032ffc1057SHemant Agrawal } ioc_fm_pcd_cc_next_cc_params_t;
16042ffc1057SHemant Agrawal 
16052ffc1057SHemant Agrawal /*
16062ffc1057SHemant Agrawal  * @Description   A structure for defining Frame Replicator as the next engine
16072ffc1057SHemant Agrawal  *		  after a CC node. (Must match struct t_FmPcdCcNextFrParams
16082ffc1057SHemant Agrawal  *		  defined in fm_pcd_ext.h)
16092ffc1057SHemant Agrawal  */
16102ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_next_fr_params_t {
16112ffc1057SHemant Agrawal 	void *frm_replic_id;
16122ffc1057SHemant Agrawal 			/**< The id of the next frame replicator group */
16132ffc1057SHemant Agrawal } ioc_fm_pcd_cc_next_fr_params_t;
16142ffc1057SHemant Agrawal 
16152ffc1057SHemant Agrawal /*
16162ffc1057SHemant Agrawal  * @Description   A structure for defining PLCR params when PLCR is the
16172ffc1057SHemant Agrawal  *		  next engine after a CC node
16182ffc1057SHemant Agrawal  *		  (Must match struct t_FmPcdCcNextPlcrParams defined in
16192ffc1057SHemant Agrawal  *		  fm_pcd_ext.h)
16202ffc1057SHemant Agrawal  */
16212ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_next_plcr_params_t {
16222ffc1057SHemant Agrawal 	bool	override_params;
16232ffc1057SHemant Agrawal 		/**< TRUE if CC override previously decided parameters*/
16242ffc1057SHemant Agrawal 	bool	shared_profile;
16252ffc1057SHemant Agrawal 		/**< Relevant only if overrideParams=TRUE: TRUE if this profile
16262ffc1057SHemant Agrawal 		 * is shared between ports
16272ffc1057SHemant Agrawal 		 */
16282ffc1057SHemant Agrawal 	uint16_t	new_relative_profile_id;
16292ffc1057SHemant Agrawal 		/**< Relevant only if overrideParams=TRUE: (otherwise profile id
16302ffc1057SHemant Agrawal 		 * is taken from keygen); This parameter should indicate the
16312ffc1057SHemant Agrawal 		 * policer profile offset within the port's policer profiles or
16322ffc1057SHemant Agrawal 		 * from SHARED window.
16332ffc1057SHemant Agrawal 		 */
16342ffc1057SHemant Agrawal 	uint32_t	new_fqid;
16352ffc1057SHemant Agrawal 		/**< Relevant only if overrideParams=TRUE: FQID for enquing the
16362ffc1057SHemant Agrawal 		 * frame; In earlier chips  if policer next engine is KEYGEN,
16372ffc1057SHemant Agrawal 		 * this parameter can be 0, because the KEYGEN always decides
16382ffc1057SHemant Agrawal 		 * the enqueue FQID.
16392ffc1057SHemant Agrawal 		 */
16402ffc1057SHemant Agrawal 	uint8_t	new_relative_storage_profile_id;
16412ffc1057SHemant Agrawal 		/**< Indicates the relative storage profile offset within the
16422ffc1057SHemant Agrawal 		 * port's storage profiles window; Relevant only if the port was
16432ffc1057SHemant Agrawal 		 * configured with VSP.
16442ffc1057SHemant Agrawal 		 */
16452ffc1057SHemant Agrawal } ioc_fm_pcd_cc_next_plcr_params_t;
16462ffc1057SHemant Agrawal 
16472ffc1057SHemant Agrawal /*
16482ffc1057SHemant Agrawal  * @Description   A structure for defining enqueue params when BMI is the next
16492ffc1057SHemant Agrawal  *		  engine after a CC node (Must match struct
16502ffc1057SHemant Agrawal  *		  t_FmPcdCcNextEnqueueParams defined in fm_pcd_ext.h)
16512ffc1057SHemant Agrawal  */
16522ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_next_enqueue_params_t {
16532ffc1057SHemant Agrawal 	ioc_fm_pcd_done_action  action;
16542ffc1057SHemant Agrawal 				/**< Action - when next engine is BMI (done) */
16552ffc1057SHemant Agrawal 	bool			override_fqid;
16562ffc1057SHemant Agrawal 				/**< TRUE if CC override previously decided fqid
16572ffc1057SHemant Agrawal 				 * and vspid, relevant if action =
16582ffc1057SHemant Agrawal 				 * e_IOC_FM_PCD_ENQ_FRAME
16592ffc1057SHemant Agrawal 				 */
16602ffc1057SHemant Agrawal 	uint32_t		new_fqid;
16612ffc1057SHemant Agrawal 				/**< Valid if overrideFqid=TRUE, FQID for
16622ffc1057SHemant Agrawal 				 * enqueuing the frame (otherwise FQID is taken
16632ffc1057SHemant Agrawal 				 * from KeyGen), relevant if action =
16642ffc1057SHemant Agrawal 				 * e_IOC_FM_PCD_ENQ_FRAME
16652ffc1057SHemant Agrawal 				 */
16662ffc1057SHemant Agrawal 	uint8_t		new_relative_storage_profile_id;
16672ffc1057SHemant Agrawal 			/**< Valid if override_fqid=TRUE, Indicates the relative
16682ffc1057SHemant Agrawal 			 * virtual storage profile offset within the port's
16692ffc1057SHemant Agrawal 			 * storage profiles window; Relevant only if the port
16702ffc1057SHemant Agrawal 			 * was configured with VSP.
16712ffc1057SHemant Agrawal 			 */
16722ffc1057SHemant Agrawal 
16732ffc1057SHemant Agrawal } ioc_fm_pcd_cc_next_enqueue_params_t;
16742ffc1057SHemant Agrawal 
16752ffc1057SHemant Agrawal /*
16762ffc1057SHemant Agrawal  * @Description   A structure for defining KG params when KG is the next engine
16772ffc1057SHemant Agrawal  *		  after a CC node (Must match struct t_FmPcdCcNextKgParams
16782ffc1057SHemant Agrawal  *		  defined in fm_pcd_ext.h)
16792ffc1057SHemant Agrawal  */
16802ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_next_kg_params_t {
16812ffc1057SHemant Agrawal 	bool	override_fqid;
16822ffc1057SHemant Agrawal 		/**< TRUE if CC override previously decided fqid and vspid,
16832ffc1057SHemant Agrawal 		 * Note - this parameters are irrelevant for earlier chips
16842ffc1057SHemant Agrawal 		 */
16852ffc1057SHemant Agrawal 	uint32_t   new_fqid;
16862ffc1057SHemant Agrawal 		/**< Valid if overrideFqid=TRUE, FQID for enqueuing the frame
16872ffc1057SHemant Agrawal 		 * (otherwise FQID is taken from KeyGen),
16882ffc1057SHemant Agrawal 		 * Note - this parameters are irrelevant for earlier chips
16892ffc1057SHemant Agrawal 		 */
16902ffc1057SHemant Agrawal 	uint8_t   new_relative_storage_profile_id;
16912ffc1057SHemant Agrawal 		/**< Valid if override_fqid=TRUE, Indicates the relative virtual
16922ffc1057SHemant Agrawal 		 * storage profile offset within the port's storage profiles
16932ffc1057SHemant Agrawal 		 * window; Relevant only if the port was configured with VSP.
16942ffc1057SHemant Agrawal 		 */
16952ffc1057SHemant Agrawal 	void	*p_direct_scheme;	/**< Direct scheme id to go to. */
16962ffc1057SHemant Agrawal } ioc_fm_pcd_cc_next_kg_params_t;
16972ffc1057SHemant Agrawal 
16982ffc1057SHemant Agrawal /*
16992ffc1057SHemant Agrawal  * @Description   Parameters for defining the next engine after a CC node.
17002ffc1057SHemant Agrawal  *		  (Must match struct ioc_fm_pcd_cc_next_engine_params_t defined
17012ffc1057SHemant Agrawal  *		  in fm_pcd_ext.h)
17022ffc1057SHemant Agrawal  */
17032ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_next_engine_params_t {
17042ffc1057SHemant Agrawal 	ioc_fm_pcd_engine			next_engine;
17052ffc1057SHemant Agrawal 				/**< User has to initialize parameters according
17062ffc1057SHemant Agrawal 				 * to nextEngine definition
17072ffc1057SHemant Agrawal 				 */
17082ffc1057SHemant Agrawal 	union {
17092ffc1057SHemant Agrawal 		ioc_fm_pcd_cc_next_cc_params_t	cc_params;
17102ffc1057SHemant Agrawal 				/**< Parameters in case next engine is CC */
17112ffc1057SHemant Agrawal 		ioc_fm_pcd_cc_next_plcr_params_t	plcr_params;
17122ffc1057SHemant Agrawal 				/**< Parameters in case next engine is PLCR */
17132ffc1057SHemant Agrawal 		ioc_fm_pcd_cc_next_enqueue_params_t enqueue_params;
17142ffc1057SHemant Agrawal 				/**< Parameters in case next engine is BMI */
17152ffc1057SHemant Agrawal 		ioc_fm_pcd_cc_next_kg_params_t	kg_params;
17162ffc1057SHemant Agrawal 				/**< Parameters in case next engine is KG */
17172ffc1057SHemant Agrawal 		ioc_fm_pcd_cc_next_fr_params_t	fr_params;
17182ffc1057SHemant Agrawal 				/**< Parameters in case next engine is FR */
17192ffc1057SHemant Agrawal 	} params;
17202ffc1057SHemant Agrawal 		/**< Union used for all the next-engine parameters options */
17212ffc1057SHemant Agrawal 	void					*manip_id;
17222ffc1057SHemant Agrawal 				/**< Handle to Manipulation object. Relevant if
17232ffc1057SHemant Agrawal 				 * next engine is of type result
17242ffc1057SHemant Agrawal 				 * (e_IOC_FM_PCD_PLCR, e_IOC_FM_PCD_KG,
17252ffc1057SHemant Agrawal 				 * e_IOC_FM_PCD_DONE)
17262ffc1057SHemant Agrawal 				 */
17272ffc1057SHemant Agrawal 	bool					statistics_en;
17282ffc1057SHemant Agrawal 				/**< If TRUE, statistics counters are
17292ffc1057SHemant Agrawal 				 * incremented for each frame passing through
17302ffc1057SHemant Agrawal 				 * this Coarse Classification entry.
17312ffc1057SHemant Agrawal 				 */
17322ffc1057SHemant Agrawal } ioc_fm_pcd_cc_next_engine_params_t;
17332ffc1057SHemant Agrawal 
17342ffc1057SHemant Agrawal /*
17352ffc1057SHemant Agrawal  * @Description   Parameters for defining a single CC key
17362ffc1057SHemant Agrawal  */
17372ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_key_params_t {
17382ffc1057SHemant Agrawal 	uint8_t		*p_key;
17392ffc1057SHemant Agrawal 			/**< pointer to the key of the size defined in key_size
17402ffc1057SHemant Agrawal 			 */
17412ffc1057SHemant Agrawal 	uint8_t		*p_mask;
17422ffc1057SHemant Agrawal 			/**< pointer to the Mask per key of the size defined in
17432ffc1057SHemant Agrawal 			 * key_size. p_key and p_mask (if defined) has to be of
17442ffc1057SHemant Agrawal 			 * the same size defined in the key_size
17452ffc1057SHemant Agrawal 			 */
17462ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_next_engine_params_t  cc_next_engine_params;
17472ffc1057SHemant Agrawal 			/**< parameters for the next for the defined Key in
17482ffc1057SHemant Agrawal 			 * p_key
17492ffc1057SHemant Agrawal 			 */
17502ffc1057SHemant Agrawal 
17512ffc1057SHemant Agrawal } ioc_fm_pcd_cc_key_params_t;
17522ffc1057SHemant Agrawal 
17532ffc1057SHemant Agrawal /*
17542ffc1057SHemant Agrawal  * @Description   Parameters for defining CC keys parameters
17552ffc1057SHemant Agrawal  *		  The driver supports two methods for CC node allocation:
17562ffc1057SHemant Agrawal  *		  dynamic and static. Static mode was created in order to
17572ffc1057SHemant Agrawal  *		  prevent runtime alloc/free of FMan memory (MURAM), which may
17582ffc1057SHemant Agrawal  *		  cause fragmentation; in this mode, the driver automatically
17592ffc1057SHemant Agrawal  *		  allocates the memory according to 'max_num_of_keys' parameter.
17602ffc1057SHemant Agrawal  *		  The driver calculates the maximal memory size that may be used
17612ffc1057SHemant Agrawal  *		  for this CC-Node taking into consideration 'mask_support' and
17622ffc1057SHemant Agrawal  *		  'statistics_mode' parameters. When 'action' =
17632ffc1057SHemant Agrawal  *		  e_IOC_FM_PCD_ACTION_INDEXED_LOOKUP in the extraction
17642ffc1057SHemant Agrawal  *		  parameters of this node, 'max_num_of_keys' must be equal to
17652ffc1057SHemant Agrawal  *		  'num_of_keys'. In dynamic mode, 'max_num_of_keys' must be
17662ffc1057SHemant Agrawal  *		  zero. At initialization, all required structures are allocated
17672ffc1057SHemant Agrawal  *		  according to 'num_of_keys' parameter. During runtime
17682ffc1057SHemant Agrawal  *		  modification, these structures are re-allocated according to
17692ffc1057SHemant Agrawal  *		  the updated number of keys.
17702ffc1057SHemant Agrawal  *		  Please note that 'action' and 'ic_indx_mask' mentioned in the
17712ffc1057SHemant Agrawal  *		  specific parameter explanations are passed in the extraction
17722ffc1057SHemant Agrawal  *		  parameters of the node (fields of
17732ffc1057SHemant Agrawal  *		  extractccparams.extractnonhdr).
17742ffc1057SHemant Agrawal  */
17752ffc1057SHemant Agrawal typedef struct ioc_keys_params_t {
17762ffc1057SHemant Agrawal 	uint16_t		max_num_of_keys;
17772ffc1057SHemant Agrawal 			/**< Maximum number of keys that will (ever) be used in
17782ffc1057SHemant Agrawal 			 * this CC-Node; A value of zero may be used for dynamic
17792ffc1057SHemant Agrawal 			 * memory allocation.
17802ffc1057SHemant Agrawal 			 */
17812ffc1057SHemant Agrawal 	bool			mask_support;
17822ffc1057SHemant Agrawal 			/**< This parameter is relevant only if a node is
17832ffc1057SHemant Agrawal 			 * initialized with action =
17842ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_ACTION_EXACT_MATCH and max_num_of_keys >
17852ffc1057SHemant Agrawal 			 * 0; Should be TRUE to reserve table memory for key
17862ffc1057SHemant Agrawal 			 * masks, even if initial keys do not contain masks, or
17872ffc1057SHemant Agrawal 			 * if the node was initialized as 'empty' (without
17882ffc1057SHemant Agrawal 			 * keys); this will allow user to add keys with masks at
17892ffc1057SHemant Agrawal 			 * runtime.
17902ffc1057SHemant Agrawal 			 */
17912ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_stats_mode	statistics_mode;
17922ffc1057SHemant Agrawal 			/**< Determines the supported statistics mode for all
17932ffc1057SHemant Agrawal 			 * node's keys. To enable statistics gathering,
17942ffc1057SHemant Agrawal 			 * statistics should be enabled per every key, using
17952ffc1057SHemant Agrawal 			 * 'statistics_en' in next engine parameters structure
17962ffc1057SHemant Agrawal 			 * of that key; If 'max_num_of_keys' is set, all
17972ffc1057SHemant Agrawal 			 * required structures will be preallocated for all keys
17982ffc1057SHemant Agrawal 			 */
17992ffc1057SHemant Agrawal 	uint16_t	frame_length_ranges[IOC_FM_PCD_CC_STATS_MAX_FLR];
18002ffc1057SHemant Agrawal 		/**< Relevant only for 'RMON' statistics mode (this feature is
18012ffc1057SHemant Agrawal 		 * supported only on B4860 device); Holds a list of programmable
18022ffc1057SHemant Agrawal 		 * thresholds. For each received frame, its length in bytes is
18032ffc1057SHemant Agrawal 		 * examined against these range thresholds and the appropriate
18042ffc1057SHemant Agrawal 		 * counter is incremented by 1. For example, to belong to range
18052ffc1057SHemant Agrawal 		 * i, the following should hold: range i-1 threshold < frame
18062ffc1057SHemant Agrawal 		 * length <= range i threshold Each range threshold must be
18072ffc1057SHemant Agrawal 		 * larger then its preceding range threshold. Last range
18082ffc1057SHemant Agrawal 		 * threshold must be 0xFFFF.
18092ffc1057SHemant Agrawal 		 */
18102ffc1057SHemant Agrawal 	uint16_t			num_of_keys;
18112ffc1057SHemant Agrawal 		/**< Number of initial keys; Note that in case of 'action' =
18122ffc1057SHemant Agrawal 		 * e_IOC_FM_PCD_ACTION_INDEXED_LOOKUP, this field should be
18132ffc1057SHemant Agrawal 		 * power-of-2 of the number of bits that are set in
18142ffc1057SHemant Agrawal 		 * 'ic_indx_mask'.
18152ffc1057SHemant Agrawal 		 */
18162ffc1057SHemant Agrawal 	uint8_t			key_size;
18172ffc1057SHemant Agrawal 		/**< Size of key - for extraction of type FULL_FIELD, 'key_size'
18182ffc1057SHemant Agrawal 		 * has to be the standard size of the selected key; For other
18192ffc1057SHemant Agrawal 		 * extraction types, 'key_size' has to be as size of extraction;
18202ffc1057SHemant Agrawal 		 * When 'action' = e_IOC_FM_PCD_ACTION_INDEXED_LOOKUP,
18212ffc1057SHemant Agrawal 		 * 'key_size' must be 2.
18222ffc1057SHemant Agrawal 		 */
18232ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_key_params_t  key_params[IOC_FM_PCD_MAX_NUM_OF_KEYS];
18242ffc1057SHemant Agrawal 		/**< An array with 'num_of_keys' entries, each entry specifies
18252ffc1057SHemant Agrawal 		 * the corresponding key parameters; When 'action' =
18262ffc1057SHemant Agrawal 		 * e_IOC_FM_PCD_ACTION_EXACT_MATCH, this value must not exceed
18272ffc1057SHemant Agrawal 		 * 255 (IOC_FM_PCD_MAX_NUM_OF_KEYS-1) as the last entry is saved
18282ffc1057SHemant Agrawal 		 * for the 'miss' entry.
18292ffc1057SHemant Agrawal 		 */
18302ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_next_engine_params_t  cc_next_engine_params_for_miss;
18312ffc1057SHemant Agrawal 		/**< Parameters for defining the next engine when a key is not
18322ffc1057SHemant Agrawal 		 * matched; Not relevant if action =
18332ffc1057SHemant Agrawal 		 * e_IOC_FM_PCD_ACTION_INDEXED_LOOKUP.
18342ffc1057SHemant Agrawal 		 */
18352ffc1057SHemant Agrawal } ioc_keys_params_t;
18362ffc1057SHemant Agrawal 
18372ffc1057SHemant Agrawal /*
18382ffc1057SHemant Agrawal  * @Description   Parameters for defining a CC node
18392ffc1057SHemant Agrawal  */
18402ffc1057SHemant Agrawal struct fm_pcd_cc_node_params_t {
18412ffc1057SHemant Agrawal 	ioc_fm_pcd_extract_entry_t extract_cc_params;
18422ffc1057SHemant Agrawal 	/**< Extraction parameters */
18432ffc1057SHemant Agrawal 	ioc_keys_params_t keys_params;
18442ffc1057SHemant Agrawal 	/**< Keys definition matching the selected extraction */
18452ffc1057SHemant Agrawal };
18462ffc1057SHemant Agrawal 
18472ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_node_params_t {
18482ffc1057SHemant Agrawal 	struct fm_pcd_cc_node_params_t param;
18492ffc1057SHemant Agrawal 	void *id;
18502ffc1057SHemant Agrawal 	/**< Output parameter; returns the CC node Id to be used */
18512ffc1057SHemant Agrawal } ioc_fm_pcd_cc_node_params_t;
18522ffc1057SHemant Agrawal 
18532ffc1057SHemant Agrawal /*
18542ffc1057SHemant Agrawal  * @Description   Parameters for defining a hash table
18552ffc1057SHemant Agrawal  *		  (Must match struct ioc_fm_pcd_hash_table_params_t defined in
18562ffc1057SHemant Agrawal  *		  fm_pcd_ext.h)
18572ffc1057SHemant Agrawal  */
18582ffc1057SHemant Agrawal struct fm_pcd_hash_table_params_t {
18592ffc1057SHemant Agrawal 	uint16_t max_num_of_keys;
18602ffc1057SHemant Agrawal 		/**< Maximum Number Of Keys that will (ever) be used in this
18612ffc1057SHemant Agrawal 		 * Hash-table
18622ffc1057SHemant Agrawal 		 */
18632ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_stats_mode statistics_mode;
18642ffc1057SHemant Agrawal 		/**< If not e_IOC_FM_PCD_CC_STATS_MODE_NONE, the required
18652ffc1057SHemant Agrawal 		 * structures for the requested statistics mode will be
18662ffc1057SHemant Agrawal 		 * allocated according to max_num_of_keys.
18672ffc1057SHemant Agrawal 		 */
18682ffc1057SHemant Agrawal 	uint8_t kg_hash_shift;
18692ffc1057SHemant Agrawal 		/**< KG-Hash-shift as it was configured in the KG-scheme that
18702ffc1057SHemant Agrawal 		 * leads to this hash-table.
18712ffc1057SHemant Agrawal 		 */
18722ffc1057SHemant Agrawal 	uint16_t hash_res_mask;
18732ffc1057SHemant Agrawal 		/**< Mask that will be used on the hash-result; The
18742ffc1057SHemant Agrawal 		 * number-of-sets for this hash will be calculated as (2^(number
18752ffc1057SHemant Agrawal 		 * of bits set in 'hash_res_mask')); The 4 lower bits must be
18762ffc1057SHemant Agrawal 		 * cleared.
18772ffc1057SHemant Agrawal 		 */
18782ffc1057SHemant Agrawal 	uint8_t hash_shift;
18792ffc1057SHemant Agrawal 		/**< Byte offset from the beginning of the KeyGen hash result to
18802ffc1057SHemant Agrawal 		 * the 2-bytes to be used as hash index.
18812ffc1057SHemant Agrawal 		 */
18822ffc1057SHemant Agrawal 	uint8_t match_key_size;
18832ffc1057SHemant Agrawal 		/**< Size of the exact match keys held by the hash buckets */
18842ffc1057SHemant Agrawal 
18852ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_next_engine_params_t cc_next_engine_params_for_miss;
18862ffc1057SHemant Agrawal 		/**< Parameters for defining the next engine when a key is not
18872ffc1057SHemant Agrawal 		 * matched
18882ffc1057SHemant Agrawal 		 */
18892ffc1057SHemant Agrawal };
18902ffc1057SHemant Agrawal 
18912ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_hash_table_params_t {
18922ffc1057SHemant Agrawal 	struct fm_pcd_hash_table_params_t param;
18932ffc1057SHemant Agrawal 	void *id;
18942ffc1057SHemant Agrawal } ioc_fm_pcd_hash_table_params_t;
18952ffc1057SHemant Agrawal 
18962ffc1057SHemant Agrawal /*
18972ffc1057SHemant Agrawal  * @Description   A structure with the arguments for the
18982ffc1057SHemant Agrawal  *		  fm_pcd_hash_table_add_key ioctl() call
18992ffc1057SHemant Agrawal  */
19002ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_hash_table_add_key_params_t {
19012ffc1057SHemant Agrawal 	void			*p_hash_tbl;
19022ffc1057SHemant Agrawal 	uint8_t			key_size;
19032ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_key_params_t  key_params;
19042ffc1057SHemant Agrawal } ioc_fm_pcd_hash_table_add_key_params_t;
19052ffc1057SHemant Agrawal 
19062ffc1057SHemant Agrawal /*
19072ffc1057SHemant Agrawal  * @Description   Parameters for defining a CC tree group.
19082ffc1057SHemant Agrawal  *
19092ffc1057SHemant Agrawal  *		  This structure defines a CC group in terms of NetEnv units and
19102ffc1057SHemant Agrawal  *		  the action to be taken in each case. The unit_ids list must be
19112ffc1057SHemant Agrawal  *		  given in order from low to high indices.
19122ffc1057SHemant Agrawal  *		  ioc_fm_pcd_cc_next_engine_params_t is a list of
19132ffc1057SHemant Agrawal  *		  2^num_of_distinction_units structures where each defines the
19142ffc1057SHemant Agrawal  *		  next action to be taken for each units combination. for
19152ffc1057SHemant Agrawal  *		  example: num_of_distinction_units = 2 unit_ids = {1,3}
19162ffc1057SHemant Agrawal  *		  next_engine_per_entries_in_grp[0] =
19172ffc1057SHemant Agrawal  *		  ioc_fm_pcd_cc_next_engine_params_t for the case that unit 1 -
19182ffc1057SHemant Agrawal  *		  not found; unit 3 - not found;
19192ffc1057SHemant Agrawal  *		  next_engine_per_entries_in_grp[1] =
19202ffc1057SHemant Agrawal  *		  ioc_fm_pcd_cc_next_engine_params_t for the case that unit 1 -
19212ffc1057SHemant Agrawal  *		  not found; unit 3 - found;
19222ffc1057SHemant Agrawal  *		  next_engine_per_entries_in_grp[2] =
19232ffc1057SHemant Agrawal  *		  ioc_fm_pcd_cc_next_engine_params_t for the case that unit 1 -
19242ffc1057SHemant Agrawal  *		  found; unit 3 - not found;
19252ffc1057SHemant Agrawal  *		  next_engine_per_entries_in_grp[3] =
19262ffc1057SHemant Agrawal  *		  ioc_fm_pcd_cc_next_engine_params_t for the case that unit 1 -
19272ffc1057SHemant Agrawal  *		  found; unit 3 - found;
19282ffc1057SHemant Agrawal  */
19292ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_grp_params_t {
19302ffc1057SHemant Agrawal 	uint8_t		num_of_distinction_units;   /**< Up to 4 */
19312ffc1057SHemant Agrawal 	uint8_t		unit_ids[IOC_FM_PCD_MAX_NUM_OF_CC_UNITS];
19322ffc1057SHemant Agrawal 		/**< Indexes of the units as defined in
19332ffc1057SHemant Agrawal 		 * fm_pcd_net_env_characteristics_set()
19342ffc1057SHemant Agrawal 		 */
19352ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_next_engine_params_t
19362ffc1057SHemant Agrawal 		next_engine_per_entries_in_grp[IOC_FM_PCD_MAX_CC_ENTRY_IN_GRP];
19372ffc1057SHemant Agrawal 		/**< Maximum entries per group is 16 */
19382ffc1057SHemant Agrawal } ioc_fm_pcd_cc_grp_params_t;
19392ffc1057SHemant Agrawal 
19402ffc1057SHemant Agrawal /*
19412ffc1057SHemant Agrawal  * @Description   Parameters for defining the CC tree groups
19422ffc1057SHemant Agrawal  *		  (Must match struct ioc_fm_pcd_cc_tree_params_t defined in
19432ffc1057SHemant Agrawal  *		  fm_pcd_ext.h)
19442ffc1057SHemant Agrawal  */
19452ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_tree_params_t {
19462ffc1057SHemant Agrawal 	void		*net_env_id;
19472ffc1057SHemant Agrawal 			/**< Id of the Network Environment as returned
19482ffc1057SHemant Agrawal 			 * by fm_pcd_net_env_characteristics_set()
19492ffc1057SHemant Agrawal 			 */
19502ffc1057SHemant Agrawal 	uint8_t		num_of_groups;
19512ffc1057SHemant Agrawal 			/**< Number of CC groups within the CC tree */
19522ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_grp_params_t
19532ffc1057SHemant Agrawal 			fm_pcd_cc_group_params[IOC_FM_PCD_MAX_NUM_OF_CC_GROUPS];
19542ffc1057SHemant Agrawal 			/**< Parameters for each group. */
19552ffc1057SHemant Agrawal 	void		*id;
19562ffc1057SHemant Agrawal 			/**< Output parameter; Returns the tree Id to be used */
19572ffc1057SHemant Agrawal } ioc_fm_pcd_cc_tree_params_t;
19582ffc1057SHemant Agrawal 
19592ffc1057SHemant Agrawal /*
19602ffc1057SHemant Agrawal  * @Description   Parameters for defining policer byte rate
19612ffc1057SHemant Agrawal  */
19622ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_plcr_byte_rate_mode_param_t {
19632ffc1057SHemant Agrawal 	ioc_fm_pcd_plcr_frame_length_select	frame_length_selection;
19642ffc1057SHemant Agrawal 			/**< Frame length selection */
19652ffc1057SHemant Agrawal 	ioc_fm_pcd_plcr_roll_back_frame_select  roll_back_frame_selection;
19662ffc1057SHemant Agrawal 			/**< relevant option only e_IOC_FM_PCD_PLCR_L2_FRM_LEN,
19672ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_PLCR_FULL_FRM_LEN
19682ffc1057SHemant Agrawal 			 */
19692ffc1057SHemant Agrawal } ioc_fm_pcd_plcr_byte_rate_mode_param_t;
19702ffc1057SHemant Agrawal 
19712ffc1057SHemant Agrawal /*
19722ffc1057SHemant Agrawal  * @Description   Parameters for defining the policer profile (based on
19732ffc1057SHemant Agrawal  *		  RFC-2698 or RFC-4115 attributes).
19742ffc1057SHemant Agrawal  */
19752ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_plcr_non_passthrough_alg_param_t {
19762ffc1057SHemant Agrawal 	ioc_fm_pcd_plcr_rate_mode		rate_mode;
19772ffc1057SHemant Agrawal 			/**< Byte / Packet */
19782ffc1057SHemant Agrawal 	ioc_fm_pcd_plcr_byte_rate_mode_param_t  byte_mode_param;
19792ffc1057SHemant Agrawal 			/**< Valid for Byte NULL for Packet */
19802ffc1057SHemant Agrawal 	uint32_t				committed_info_rate;
19812ffc1057SHemant Agrawal 			/**< KBits/Sec or Packets/Sec */
19822ffc1057SHemant Agrawal 	uint32_t				committed_burst_size;
19832ffc1057SHemant Agrawal 			/**< KBits or Packets */
19842ffc1057SHemant Agrawal 	uint32_t				peak_or_excess_info_rate;
19852ffc1057SHemant Agrawal 			/**< KBits/Sec or Packets/Sec */
19862ffc1057SHemant Agrawal 	uint32_t				peak_or_excess_burst_size;
19872ffc1057SHemant Agrawal 			/**< KBits or Packets */
19882ffc1057SHemant Agrawal } ioc_fm_pcd_plcr_non_passthrough_alg_param_t;
19892ffc1057SHemant Agrawal 
19902ffc1057SHemant Agrawal /*
19912ffc1057SHemant Agrawal  * @Description   Parameters for defining the next engine after policer
19922ffc1057SHemant Agrawal  */
19932ffc1057SHemant Agrawal typedef union ioc_fm_pcd_plcr_next_engine_params_u {
19942ffc1057SHemant Agrawal 	ioc_fm_pcd_done_action	action;
19952ffc1057SHemant Agrawal 				/**< Action - when next engine is BMI (done) */
19962ffc1057SHemant Agrawal 	void			*p_profile;
19972ffc1057SHemant Agrawal 				/**< Policer profile handle -  used when next
19982ffc1057SHemant Agrawal 				 * engine is PLCR, must be a SHARED profile
19992ffc1057SHemant Agrawal 				 */
20002ffc1057SHemant Agrawal 	void			*p_direct_scheme;
20012ffc1057SHemant Agrawal 				/**< Direct scheme select - when next engine is
20022ffc1057SHemant Agrawal 				 * Keygen
20032ffc1057SHemant Agrawal 				 */
20042ffc1057SHemant Agrawal } ioc_fm_pcd_plcr_next_engine_params_u;
20052ffc1057SHemant Agrawal 
20062ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_port_params_t {
20072ffc1057SHemant Agrawal 	ioc_fm_port_type			port_type;
20082ffc1057SHemant Agrawal 				/**< Type of port for this profile */
20092ffc1057SHemant Agrawal 	uint8_t				port_id;
20102ffc1057SHemant Agrawal 				/**< FM-Port id of port for this profile */
20112ffc1057SHemant Agrawal } ioc_fm_pcd_port_params_t;
20122ffc1057SHemant Agrawal 
20132ffc1057SHemant Agrawal /*
20142ffc1057SHemant Agrawal  * @Description   Parameters for defining the policer profile entry
20152ffc1057SHemant Agrawal  *		  (Must match struct ioc_fm_pcd_plcr_profile_params_t defined in
20162ffc1057SHemant Agrawal  *		  fm_pcd_ext.h)
20172ffc1057SHemant Agrawal  */
20182ffc1057SHemant Agrawal struct fm_pcd_plcr_profile_params_t {
20192ffc1057SHemant Agrawal 	bool modify;
20202ffc1057SHemant Agrawal 		/**< TRUE to change an existing profile */
20212ffc1057SHemant Agrawal 	union {
20222ffc1057SHemant Agrawal 		struct {
20232ffc1057SHemant Agrawal 			ioc_fm_pcd_profile_type_selection profile_type;
20242ffc1057SHemant Agrawal 				/**< Type of policer profile */
20252ffc1057SHemant Agrawal 			ioc_fm_pcd_port_params_t *p_fm_port;
20262ffc1057SHemant Agrawal 				/**< Relevant for per-port profiles only */
20272ffc1057SHemant Agrawal 			uint16_t relative_profile_id;
20282ffc1057SHemant Agrawal 				/**< Profile id - relative to shared group or to
20292ffc1057SHemant Agrawal 				 * port
20302ffc1057SHemant Agrawal 				 */
20312ffc1057SHemant Agrawal 		} new_params;
20322ffc1057SHemant Agrawal 			/**< Use it when modify = FALSE */
20332ffc1057SHemant Agrawal 		void *p_profile;
20342ffc1057SHemant Agrawal 			/**< A handle to a profile - use it when modify=TRUE */
20352ffc1057SHemant Agrawal 	} profile_select;
20362ffc1057SHemant Agrawal 	ioc_fm_pcd_plcr_algorithm_selection alg_selection;
20372ffc1057SHemant Agrawal 	/**< Profile Algorithm PASS_THROUGH, RFC_2698, RFC_4115 */
20382ffc1057SHemant Agrawal 	ioc_fm_pcd_plcr_color_mode color_mode;
20392ffc1057SHemant Agrawal 	/**< COLOR_BLIND, COLOR_AWARE */
20402ffc1057SHemant Agrawal 
20412ffc1057SHemant Agrawal 	union {
20422ffc1057SHemant Agrawal 		ioc_fm_pcd_plcr_color dflt_color;
20432ffc1057SHemant Agrawal 		/**< For Color-Blind Pass-Through mode; the policer will
20442ffc1057SHemant Agrawal 		 * re-color any incoming packet with the default value.
20452ffc1057SHemant Agrawal 		 */
20462ffc1057SHemant Agrawal 		ioc_fm_pcd_plcr_color override;
20472ffc1057SHemant Agrawal 		/**< For Color-Aware modes; the profile response to a pre-color
20482ffc1057SHemant Agrawal 		 * value of 2'b11.
20492ffc1057SHemant Agrawal 		 */
20502ffc1057SHemant Agrawal 	} color;
20512ffc1057SHemant Agrawal 
20522ffc1057SHemant Agrawal 	ioc_fm_pcd_plcr_non_passthrough_alg_param_t
20532ffc1057SHemant Agrawal 		non_passthrough_alg_param;
20542ffc1057SHemant Agrawal 		/**< RFC2698 or RFC4115 parameters */
20552ffc1057SHemant Agrawal 
20562ffc1057SHemant Agrawal 	ioc_fm_pcd_engine next_engine_on_green;
20572ffc1057SHemant Agrawal 		/**< Next engine for green-colored frames */
20582ffc1057SHemant Agrawal 	ioc_fm_pcd_plcr_next_engine_params_u params_on_green;
20592ffc1057SHemant Agrawal 		/**< Next engine parameters for green-colored frames */
20602ffc1057SHemant Agrawal 
20612ffc1057SHemant Agrawal 	ioc_fm_pcd_engine next_engine_on_yellow;
20622ffc1057SHemant Agrawal 		/**< Next engine for yellow-colored frames */
20632ffc1057SHemant Agrawal 	ioc_fm_pcd_plcr_next_engine_params_u params_on_yellow;
20642ffc1057SHemant Agrawal 		/**< Next engine parameters for yellow-colored frames */
20652ffc1057SHemant Agrawal 
20662ffc1057SHemant Agrawal 	ioc_fm_pcd_engine next_engine_on_red;
20672ffc1057SHemant Agrawal 		/**< Next engine for red-colored frames */
20682ffc1057SHemant Agrawal 	ioc_fm_pcd_plcr_next_engine_params_u params_on_red;
20692ffc1057SHemant Agrawal 		/**< Next engine parameters for red-colored frames */
20702ffc1057SHemant Agrawal 
20712ffc1057SHemant Agrawal 	bool trap_profile_on_flow_A;
20722ffc1057SHemant Agrawal 		/**< Obsolete - do not use */
20732ffc1057SHemant Agrawal 	bool trap_profile_on_flow_B;
20742ffc1057SHemant Agrawal 		/**< Obsolete - do not use */
20752ffc1057SHemant Agrawal 	bool trap_profile_on_flow_C;
20762ffc1057SHemant Agrawal 		/**< Obsolete - do not use */
20772ffc1057SHemant Agrawal };
20782ffc1057SHemant Agrawal 
20792ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_plcr_profile_params_t {
20802ffc1057SHemant Agrawal 	struct fm_pcd_plcr_profile_params_t param;
20812ffc1057SHemant Agrawal 	void	*id;
20822ffc1057SHemant Agrawal 		/**< output parameter; Returns the profile Id to be used */
20832ffc1057SHemant Agrawal } ioc_fm_pcd_plcr_profile_params_t;
20842ffc1057SHemant Agrawal 
20852ffc1057SHemant Agrawal /*
20862ffc1057SHemant Agrawal  * @Description   A structure for modifying CC tree next engine
20872ffc1057SHemant Agrawal  */
20882ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_tree_modify_next_engine_params_t {
20892ffc1057SHemant Agrawal 	void				*id;
20902ffc1057SHemant Agrawal 			/**< CC tree Id to be used */
20912ffc1057SHemant Agrawal 	uint8_t				grp_indx;
20922ffc1057SHemant Agrawal 			/**< A Group index in the tree */
20932ffc1057SHemant Agrawal 	uint8_t				indx;
20942ffc1057SHemant Agrawal 			/**< Entry index in the group defined by grp_index */
20952ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_next_engine_params_t  cc_next_engine_params;
20962ffc1057SHemant Agrawal 			/**< Parameters for the next for the defined Key in the
20972ffc1057SHemant Agrawal 			 * p_key
20982ffc1057SHemant Agrawal 			 */
20992ffc1057SHemant Agrawal } ioc_fm_pcd_cc_tree_modify_next_engine_params_t;
21002ffc1057SHemant Agrawal 
21012ffc1057SHemant Agrawal /*
21022ffc1057SHemant Agrawal  * @Description   A structure for modifying CC node next engine
21032ffc1057SHemant Agrawal  */
21042ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_node_modify_next_engine_params_t {
21052ffc1057SHemant Agrawal 	void				*id;
21062ffc1057SHemant Agrawal 			/**< CC node Id to be used */
21072ffc1057SHemant Agrawal 	uint16_t				key_indx;
21082ffc1057SHemant Agrawal 			/**< Key index for Next Engine Params modifications;
21092ffc1057SHemant Agrawal 			 * NOTE: This parameter is IGNORED for miss-key!
21102ffc1057SHemant Agrawal 			 */
21112ffc1057SHemant Agrawal 	uint8_t				key_size;
21122ffc1057SHemant Agrawal 			/**< Key size of added key */
21132ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_next_engine_params_t  cc_next_engine_params;
21142ffc1057SHemant Agrawal 			/**< parameters for the next for the defined Key in the
21152ffc1057SHemant Agrawal 			 * p_key
21162ffc1057SHemant Agrawal 			 */
21172ffc1057SHemant Agrawal } ioc_fm_pcd_cc_node_modify_next_engine_params_t;
21182ffc1057SHemant Agrawal 
21192ffc1057SHemant Agrawal /*
21202ffc1057SHemant Agrawal  * @Description   A structure for remove CC node key
21212ffc1057SHemant Agrawal  */
21222ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_node_remove_key_params_t {
21232ffc1057SHemant Agrawal 	void				*id;
21242ffc1057SHemant Agrawal 			/**< CC node Id to be used */
21252ffc1057SHemant Agrawal 	uint16_t				key_indx;
21262ffc1057SHemant Agrawal 			/**< Key index for Next Engine Params modifications;
21272ffc1057SHemant Agrawal 			 * NOTE: This parameter is IGNORED for miss-key!
21282ffc1057SHemant Agrawal 			 */
21292ffc1057SHemant Agrawal } ioc_fm_pcd_cc_node_remove_key_params_t;
21302ffc1057SHemant Agrawal 
21312ffc1057SHemant Agrawal /*
21322ffc1057SHemant Agrawal  * @Description   A structure for modifying CC node key and next engine
21332ffc1057SHemant Agrawal  */
21342ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t {
21352ffc1057SHemant Agrawal 	void				*id;
21362ffc1057SHemant Agrawal 			/**< CC node Id to be used */
21372ffc1057SHemant Agrawal 	uint16_t				key_indx;
21382ffc1057SHemant Agrawal 			/**< Key index for Next Engine Params modifications;
21392ffc1057SHemant Agrawal 			 * NOTE: This parameter is IGNORED for miss-key!
21402ffc1057SHemant Agrawal 			 */
21412ffc1057SHemant Agrawal 	uint8_t				key_size;
21422ffc1057SHemant Agrawal 			/**< Key size of added key */
21432ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_key_params_t	key_params;
21442ffc1057SHemant Agrawal 			/**< it's array with num_of_keys entries each entry in
21452ffc1057SHemant Agrawal 			 * the array of the type ioc_fm_pcd_cc_key_params_t
21462ffc1057SHemant Agrawal 			 */
21472ffc1057SHemant Agrawal } ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t;
21482ffc1057SHemant Agrawal 
21492ffc1057SHemant Agrawal /*
21502ffc1057SHemant Agrawal  * @Description   A structure for modifying CC node key
21512ffc1057SHemant Agrawal  */
21522ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_node_modify_key_params_t {
21532ffc1057SHemant Agrawal 	void				*id;
21542ffc1057SHemant Agrawal 			/**< CC node Id to be used */
21552ffc1057SHemant Agrawal 	uint16_t				key_indx;
21562ffc1057SHemant Agrawal 			/**< Key index for Next Engine Params modifications;
21572ffc1057SHemant Agrawal 			 * NOTE: This parameter is IGNORED for miss-key!
21582ffc1057SHemant Agrawal 			 */
21592ffc1057SHemant Agrawal 	uint8_t				key_size;
21602ffc1057SHemant Agrawal 			/**< Key size of added key */
21612ffc1057SHemant Agrawal 	uint8_t				*p_key;
21622ffc1057SHemant Agrawal 			/**< Pointer to the key of the size defined in key_size
21632ffc1057SHemant Agrawal 			 */
21642ffc1057SHemant Agrawal 	uint8_t				*p_mask;
21652ffc1057SHemant Agrawal 			/**< Pointer to the Mask per key of the size defined in
21662ffc1057SHemant Agrawal 			 * key_size. p_key and p_mask (if defined) have to be of
21672ffc1057SHemant Agrawal 			 * the same size as defined in the key_size
21682ffc1057SHemant Agrawal 			 */
21692ffc1057SHemant Agrawal } ioc_fm_pcd_cc_node_modify_key_params_t;
21702ffc1057SHemant Agrawal 
21712ffc1057SHemant Agrawal /*
21722ffc1057SHemant Agrawal  * @Description   A structure with the arguments for the
21732ffc1057SHemant Agrawal  *		  fm_pcd_hash_table_remove_key ioctl() call
21742ffc1057SHemant Agrawal  */
21752ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_hash_table_remove_key_params_t {
21762ffc1057SHemant Agrawal 	void	*p_hash_tbl;	/**< The id of the hash table */
21772ffc1057SHemant Agrawal 	uint8_t	key_size;	/**< The size of the key to remove */
21782ffc1057SHemant Agrawal 	uint8_t	*p_key;		/**< Pointer to the key to remove */
21792ffc1057SHemant Agrawal } ioc_fm_pcd_hash_table_remove_key_params_t;
21802ffc1057SHemant Agrawal 
21812ffc1057SHemant Agrawal /*
21822ffc1057SHemant Agrawal  * @Description   Parameters for selecting a location for requested manipulation
21832ffc1057SHemant Agrawal  */
21842ffc1057SHemant Agrawal typedef struct ioc_fm_manip_hdr_info_t {
21852ffc1057SHemant Agrawal 	ioc_net_header_type		hdr;		/**< Header selection */
21862ffc1057SHemant Agrawal 	ioc_fm_pcd_hdr_index		hdr_index;
21872ffc1057SHemant Agrawal 			/**< Relevant only for MPLS, VLAN and tunneled IP.
21882ffc1057SHemant Agrawal 			 * Otherwise should be cleared.
21892ffc1057SHemant Agrawal 			 */
21902ffc1057SHemant Agrawal 	bool				by_field;
21912ffc1057SHemant Agrawal 			/**< TRUE if the location of manipulation is according
21922ffc1057SHemant Agrawal 			 * to some field in the specific header
21932ffc1057SHemant Agrawal 			 */
21942ffc1057SHemant Agrawal 	ioc_fm_pcd_fields_u		full_field;
21952ffc1057SHemant Agrawal 			/**< Relevant only when by_field = TRUE: Extract field
21962ffc1057SHemant Agrawal 			 */
21972ffc1057SHemant Agrawal } ioc_fm_manip_hdr_info_t;
21982ffc1057SHemant Agrawal 
21992ffc1057SHemant Agrawal /*
22002ffc1057SHemant Agrawal  * @Description   Parameters for defining header removal by header type
22012ffc1057SHemant Agrawal  */
22022ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_rmv_by_hdr_params_t {
22032ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_rmv_by_hdr_type	type;
22042ffc1057SHemant Agrawal 			/**< Selection of header removal location */
22052ffc1057SHemant Agrawal 	union {
22062ffc1057SHemant Agrawal 	ioc_fm_manip_hdr_info_t		hdr_info;
22072ffc1057SHemant Agrawal 		/**< Relevant when type = e_FM_PCD_MANIP_RMV_BY_HDR_FROM_START
22082ffc1057SHemant Agrawal 		 */
22092ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_rmv_specific_l2	specific_l2;
22102ffc1057SHemant Agrawal 		/**< Relevant when type = e_IOC_FM_PCD_MANIP_BY_HDR_SPECIFIC_L2;
22112ffc1057SHemant Agrawal 		 * Defines which L2 headers to remove.
22122ffc1057SHemant Agrawal 		 */
22132ffc1057SHemant Agrawal 	} u;
22142ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_rmv_by_hdr_params_t;
22152ffc1057SHemant Agrawal 
22162ffc1057SHemant Agrawal /*
22172ffc1057SHemant Agrawal  * @Description   Parameters for configuring IP fragmentation manipulation
22182ffc1057SHemant Agrawal  */
22192ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_frag_ip_params_t {
22202ffc1057SHemant Agrawal 	uint16_t			size_for_fragmentation;
22212ffc1057SHemant Agrawal 		/**< If length of the frame is greater than this value, IP
22222ffc1057SHemant Agrawal 		 * fragmentation will be executed.
22232ffc1057SHemant Agrawal 		 */
22242ffc1057SHemant Agrawal 	bool			sg_bpid_en;
22252ffc1057SHemant Agrawal 		/**< Enable a dedicated buffer pool id for the Scatter/Gather
22262ffc1057SHemant Agrawal 		 * buffer allocation; If disabled, the Scatter/Gather buffer
22272ffc1057SHemant Agrawal 		 * will be allocated from the same pool as the received frame's
22282ffc1057SHemant Agrawal 		 * buffer.
22292ffc1057SHemant Agrawal 		 */
22302ffc1057SHemant Agrawal 	uint8_t			sg_bpid;
22312ffc1057SHemant Agrawal 		/**< Scatter/Gather buffer pool id; This parameter is relevant
22322ffc1057SHemant Agrawal 		 * when 'sg_bpid_en=TRUE'; Same LIODN number is used for these
22332ffc1057SHemant Agrawal 		 * buffers as for the received frames buffers, so buffers of
22342ffc1057SHemant Agrawal 		 * this pool need to be allocated in the same memory area as the
22352ffc1057SHemant Agrawal 		 * received buffers. If the received buffers arrive from
22362ffc1057SHemant Agrawal 		 * different sources, the Scatter/Gather BP id should be mutual
22372ffc1057SHemant Agrawal 		 * to all these sources.
22382ffc1057SHemant Agrawal 		 */
22392ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_donot_frag_action  donot_frag_action;
22402ffc1057SHemant Agrawal 		/**< Don't Fragment Action - If an IP packet is larger than MTU
22412ffc1057SHemant Agrawal 		 * and its DF bit is set, then this field will determine the
22422ffc1057SHemant Agrawal 		 * action to be taken.
22432ffc1057SHemant Agrawal 		 */
22442ffc1057SHemant Agrawal } ioc_fm_pcd_manip_frag_ip_params_t;
22452ffc1057SHemant Agrawal 
22462ffc1057SHemant Agrawal /*
22472ffc1057SHemant Agrawal  * @Description   Parameters for configuring IP reassembly manipulation.
22482ffc1057SHemant Agrawal  *
22492ffc1057SHemant Agrawal  *		  This is a common structure for both IPv4 and IPv6 reassembly
22502ffc1057SHemant Agrawal  *		  manipulation. For reassembly of both IPv4 and IPv6, make sure
22512ffc1057SHemant Agrawal  *		  to set the 'hdr' field in ioc_fm_pcd_manip_reassem_params_t to
22522ffc1057SHemant Agrawal  *		  IOC_header_type_ipv_6.
22532ffc1057SHemant Agrawal  */
22542ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_reassem_ip_params_t {
22552ffc1057SHemant Agrawal 	uint8_t			relative_scheme_id[2];
22562ffc1057SHemant Agrawal 			/**< Partition relative scheme id: relativeSchemeId[0] -
22572ffc1057SHemant Agrawal 			 * Relative scheme ID for IPV4 Reassembly manipulation;
22582ffc1057SHemant Agrawal 			 * relativeSchemeId[1] -  Relative scheme ID for IPV6
22592ffc1057SHemant Agrawal 			 * Reassembly manipulation; NOTE: The following comment
22602ffc1057SHemant Agrawal 			 * is relevant only for FMAN v2 devices: Relative scheme
22612ffc1057SHemant Agrawal 			 * ID for IPv4/IPv6 Reassembly manipulation must be
22622ffc1057SHemant Agrawal 			 * smaller than the user schemes id to ensure that the
22632ffc1057SHemant Agrawal 			 * reassembly's schemes will be first match. The
22642ffc1057SHemant Agrawal 			 * remaining schemes, if defined, should have higher
22652ffc1057SHemant Agrawal 			 * relative scheme ID.
22662ffc1057SHemant Agrawal 			 */
22672ffc1057SHemant Agrawal 	uint32_t			non_consistent_sp_fqid;
22682ffc1057SHemant Agrawal 			/**< In case that other fragments of the frame
22692ffc1057SHemant Agrawal 			 * corresponds to different storage profile than the
22702ffc1057SHemant Agrawal 			 * opening fragment (Non-Consistent-SP state) then one
22712ffc1057SHemant Agrawal 			 * of two possible scenarios occurs: if
22722ffc1057SHemant Agrawal 			 * 'nonConsistentSpFqid != 0', the reassembled frame
22732ffc1057SHemant Agrawal 			 * will be enqueued to this fqid, otherwise a 'Non
22742ffc1057SHemant Agrawal 			 * Consistent SP' bit will be set in the FD[status].
22752ffc1057SHemant Agrawal 			 */
22762ffc1057SHemant Agrawal 	uint8_t				data_mem_id;
22772ffc1057SHemant Agrawal 			/**< Memory partition ID for the IPR's external tables
22782ffc1057SHemant Agrawal 			 * structure
22792ffc1057SHemant Agrawal 			 */
22802ffc1057SHemant Agrawal 	uint16_t			data_liodn_offset;
22812ffc1057SHemant Agrawal 			/**< LIODN offset for access the IPR's external tables
22822ffc1057SHemant Agrawal 			 * structure.
22832ffc1057SHemant Agrawal 			 */
22842ffc1057SHemant Agrawal 	uint16_t			min_frag_size[2];
22852ffc1057SHemant Agrawal 			/**< Minimum fragment size: minFragSize[0] - for ipv4,
22862ffc1057SHemant Agrawal 			 * minFragSize[1] - for ipv6
22872ffc1057SHemant Agrawal 			 */
22882ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_reassem_ways_number   num_of_frames_per_hash_entry[2];
22892ffc1057SHemant Agrawal 			/**< Number of frames per hash entry needed for
22902ffc1057SHemant Agrawal 			 * reassembly process: num_of_frames_per_hash_entry[0] -
22912ffc1057SHemant Agrawal 			 * for ipv4 (max value is
22922ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_MANIP_EIGHT_WAYS_HASH);
22932ffc1057SHemant Agrawal 			 * num_of_frames_per_hash_entry[1] - for ipv6 (max value
22942ffc1057SHemant Agrawal 			 * is e_IOC_FM_PCD_MANIP_SIX_WAYS_HASH).
22952ffc1057SHemant Agrawal 			 */
22962ffc1057SHemant Agrawal 	uint16_t			max_num_frames_in_process;
22972ffc1057SHemant Agrawal 			/**< Number of frames which can be processed by
22982ffc1057SHemant Agrawal 			 * Reassembly in the same time; Must be power of 2; In
22992ffc1057SHemant Agrawal 			 * the case num_of_frames_per_hash_entry ==
23002ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_MANIP_FOUR_WAYS_HASH,
23012ffc1057SHemant Agrawal 			 * max_num_frames_in_process has to be in the range of
23022ffc1057SHemant Agrawal 			 * 4 - 512; In the case num_of_frames_per_hash_entry ==
23032ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_MANIP_EIGHT_WAYS_HASH,
23042ffc1057SHemant Agrawal 			 * max_num_frames_in_process has to be in the range of
23052ffc1057SHemant Agrawal 			 * 8 - 2048.
23062ffc1057SHemant Agrawal 			 */
23072ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_reassem_time_out_mode  time_out_mode;
23082ffc1057SHemant Agrawal 			/**< Expiration delay initialized by Reassembly process
23092ffc1057SHemant Agrawal 			 */
23102ffc1057SHemant Agrawal 	uint32_t			fqid_for_time_out_frames;
23112ffc1057SHemant Agrawal 			/**< FQID in which time out frames will enqueue during
23122ffc1057SHemant Agrawal 			 * Time Out Process
23132ffc1057SHemant Agrawal 			 */
23142ffc1057SHemant Agrawal 	uint32_t			timeout_threshold_for_reassm_process;
23152ffc1057SHemant Agrawal 			/**< Represents the time interval in microseconds which
23162ffc1057SHemant Agrawal 			 * defines if opened frame (at least one fragment was
23172ffc1057SHemant Agrawal 			 * processed but not all the fragments)is found as too
23182ffc1057SHemant Agrawal 			 * old
23192ffc1057SHemant Agrawal 			 */
23202ffc1057SHemant Agrawal } ioc_fm_pcd_manip_reassem_ip_params_t;
23212ffc1057SHemant Agrawal 
23222ffc1057SHemant Agrawal /*
23232ffc1057SHemant Agrawal  * @Description   Parameters for defining IPSEC manipulation
23242ffc1057SHemant Agrawal  */
23252ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_special_offload_ipsec_params_t {
23262ffc1057SHemant Agrawal 	bool	decryption;
23272ffc1057SHemant Agrawal 			/**< TRUE if being used in decryption direction;
23282ffc1057SHemant Agrawal 			 * FALSE if being used in encryption direction.
23292ffc1057SHemant Agrawal 			 */
23302ffc1057SHemant Agrawal 	bool	ecn_copy;
23312ffc1057SHemant Agrawal 			/**< TRUE to copy the ECN bits from inner/outer to
23322ffc1057SHemant Agrawal 			 * outer/inner (direction depends on the 'decryption'
23332ffc1057SHemant Agrawal 			 * field).
23342ffc1057SHemant Agrawal 			 */
23352ffc1057SHemant Agrawal 	bool	dscp_copy;
23362ffc1057SHemant Agrawal 			/**< TRUE to copy the DSCP bits from inner/outer to
23372ffc1057SHemant Agrawal 			 * outer/inner (direction depends on the 'decryption'
23382ffc1057SHemant Agrawal 			 * field).
23392ffc1057SHemant Agrawal 			 */
23402ffc1057SHemant Agrawal 	bool	variable_ip_hdr_len;
23412ffc1057SHemant Agrawal 			/**< TRUE for supporting variable IP header length in
23422ffc1057SHemant Agrawal 			 * decryption.
23432ffc1057SHemant Agrawal 			 */
23442ffc1057SHemant Agrawal 	bool	variable_ip_version;
23452ffc1057SHemant Agrawal 			/**< TRUE for supporting both IP version on the same SA
23462ffc1057SHemant Agrawal 			 * in encryption
23472ffc1057SHemant Agrawal 			 */
23482ffc1057SHemant Agrawal 	uint8_t outer_ip_hdr_len;
23492ffc1057SHemant Agrawal 			/**< If 'variable_ip_version == TRUE' than this field
23502ffc1057SHemant Agrawal 			 * must be set to non-zero value; It is specifies the
23512ffc1057SHemant Agrawal 			 * length of the outer IP header that was configured in
23522ffc1057SHemant Agrawal 			 * the corresponding SA.
23532ffc1057SHemant Agrawal 			 */
23542ffc1057SHemant Agrawal 	uint16_t	arw_size;
23552ffc1057SHemant Agrawal 			/**< if <> '0' then will perform ARW check for this SA;
23562ffc1057SHemant Agrawal 			 * The value must be a multiplication of 16
23572ffc1057SHemant Agrawal 			 */
23582ffc1057SHemant Agrawal 	void	*arw_addr;
23592ffc1057SHemant Agrawal 			/**< if arwSize <> '0' then this field must be set to
23602ffc1057SHemant Agrawal 			 * non-zero value; MUST be allocated from FMAN's MURAM
23612ffc1057SHemant Agrawal 			 * that the post-sec op-port belong Must be 4B aligned.
23622ffc1057SHemant Agrawal 			 * Required MURAM size is
23632ffc1057SHemant Agrawal 			 * '(NEXT_POWER_OF_2(arwSize+32))/8+4' Bytes
23642ffc1057SHemant Agrawal 			 */
23652ffc1057SHemant Agrawal } ioc_fm_pcd_manip_special_offload_ipsec_params_t;
23662ffc1057SHemant Agrawal 
23672ffc1057SHemant Agrawal /*
23682ffc1057SHemant Agrawal  * @Description   Parameters for configuring CAPWAP fragmentation manipulation
23692ffc1057SHemant Agrawal  *
23702ffc1057SHemant Agrawal  *		  Restrictions:
23712ffc1057SHemant Agrawal  *		  - Maximum number of fragments per frame is 16.
23722ffc1057SHemant Agrawal  *		  - Transmit confirmation is not supported.
23732ffc1057SHemant Agrawal  *		  - Fragmentation nodes must be set as the last PCD action (i.e.
23742ffc1057SHemant Agrawal  *		    the corresponding CC node key must have next engine set to
23752ffc1057SHemant Agrawal  *		    e_FM_PCD_DONE).
23762ffc1057SHemant Agrawal  *		  - Only BMan buffers shall be used for frames to be fragmented.
23772ffc1057SHemant Agrawal  *		  - NOTE: The following comment is relevant only for FMAN v3
23782ffc1057SHemant Agrawal  *		    devices: IPF does not support VSP. Therefore, on the same
23792ffc1057SHemant Agrawal  *		    port where we have IPF we cannot support VSP.
23802ffc1057SHemant Agrawal  */
23812ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_frag_capwap_params_t {
23822ffc1057SHemant Agrawal 	uint16_t	size_for_fragmentation;
23832ffc1057SHemant Agrawal 			/**< If length of the frame is greater than this value,
23842ffc1057SHemant Agrawal 			 * CAPWAP fragmentation will be executed.
23852ffc1057SHemant Agrawal 			 */
23862ffc1057SHemant Agrawal 	bool		sg_bpid_en;
23872ffc1057SHemant Agrawal 			/**< Enable a dedicated buffer pool id for the
23882ffc1057SHemant Agrawal 			 * Scatter/Gather buffer allocation; If disabled, the
23892ffc1057SHemant Agrawal 			 * Scatter/Gather buffer will be allocated from the same
23902ffc1057SHemant Agrawal 			 * pool as the received frame's buffer.
23912ffc1057SHemant Agrawal 			 */
23922ffc1057SHemant Agrawal 	uint8_t		sg_bpid;
23932ffc1057SHemant Agrawal 			/**< Scatter/Gather buffer pool id; This parameters is
23942ffc1057SHemant Agrawal 			 * relevant when 'sg_bpidEn=TRUE'; Same LIODN number is
23952ffc1057SHemant Agrawal 			 * used for these buffers as for the received frames
23962ffc1057SHemant Agrawal 			 * buffers, so buffers of this pool need to be allocated
23972ffc1057SHemant Agrawal 			 * in the same memory area as the received buffers. If
23982ffc1057SHemant Agrawal 			 * the received buffers arrive from different sources,
23992ffc1057SHemant Agrawal 			 * the Scatter/Gather BP id should be mutual to all
24002ffc1057SHemant Agrawal 			 * these sources.
24012ffc1057SHemant Agrawal 			 */
24022ffc1057SHemant Agrawal 	bool	compress_mode_en;
24032ffc1057SHemant Agrawal 			/**< CAPWAP Header Options Compress Enable mode; When
24042ffc1057SHemant Agrawal 			 * this mode is enabled then only the first fragment
24052ffc1057SHemant Agrawal 			 * include the CAPWAP header options field (if user
24062ffc1057SHemant Agrawal 			 * provides it in the input frame) and all other
24072ffc1057SHemant Agrawal 			 * fragments exclude the CAPWAP options field (CAPWAP
24082ffc1057SHemant Agrawal 			 * header is updated accordingly).
24092ffc1057SHemant Agrawal 			 */
24102ffc1057SHemant Agrawal } ioc_fm_pcd_manip_frag_capwap_params_t;
24112ffc1057SHemant Agrawal 
24122ffc1057SHemant Agrawal /*
24132ffc1057SHemant Agrawal  * @Description   Parameters for configuring CAPWAP reassembly manipulation.
24142ffc1057SHemant Agrawal  *
24152ffc1057SHemant Agrawal  *		  Restrictions:
24162ffc1057SHemant Agrawal  *		  - Application must define one scheme to catch the reassembled
24172ffc1057SHemant Agrawal  *		    frames.
24182ffc1057SHemant Agrawal  *		  - Maximum number of fragments per frame is 16.
24192ffc1057SHemant Agrawal  */
24202ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_reassem_capwap_params_t {
24212ffc1057SHemant Agrawal 	uint8_t		relative_scheme_id;
24222ffc1057SHemant Agrawal 			/**< Partition relative scheme id; NOTE: this id must be
24232ffc1057SHemant Agrawal 			 * smaller than the user schemes id to ensure that the
24242ffc1057SHemant Agrawal 			 * reassembly scheme will be first match; Rest schemes,
24252ffc1057SHemant Agrawal 			 * if defined, should have higher relative scheme ID.
24262ffc1057SHemant Agrawal 			 */
24272ffc1057SHemant Agrawal 	uint8_t		data_mem_id;
24282ffc1057SHemant Agrawal 			/**< Memory partition ID for the IPR's external tables
24292ffc1057SHemant Agrawal 			 * structure
24302ffc1057SHemant Agrawal 			 */
24312ffc1057SHemant Agrawal 	uint16_t	data_liodn_offset;
24322ffc1057SHemant Agrawal 			/**< LIODN offset for access the IPR's external tables
24332ffc1057SHemant Agrawal 			 * structure.
24342ffc1057SHemant Agrawal 			 */
24352ffc1057SHemant Agrawal 	uint16_t	max_reassembled_frame_length;
24362ffc1057SHemant Agrawal 			/**< The maximum CAPWAP reassembled frame length in
24372ffc1057SHemant Agrawal 			 * bytes; If maxReassembledFrameLength == 0, any
24382ffc1057SHemant Agrawal 			 * successful reassembled frame length is considered as
24392ffc1057SHemant Agrawal 			 * a valid length; if maxReassembledFrameLength > 0, a
24402ffc1057SHemant Agrawal 			 * successful reassembled frame which its length exceeds
24412ffc1057SHemant Agrawal 			 * this value is considered as an error frame (FD
24422ffc1057SHemant Agrawal 			 * status[CRE] bit is set).
24432ffc1057SHemant Agrawal 			 */
24442ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_reassem_ways_number   num_of_frames_per_hash_entry;
24452ffc1057SHemant Agrawal 			/**< Number of frames per hash entry needed for
24462ffc1057SHemant Agrawal 			 * reassembly process
24472ffc1057SHemant Agrawal 			 */
24482ffc1057SHemant Agrawal 	uint16_t	max_num_frames_in_process;
24492ffc1057SHemant Agrawal 			/**< Number of frames which can be processed by
24502ffc1057SHemant Agrawal 			 * reassembly in the same time; Must be power of 2; In
24512ffc1057SHemant Agrawal 			 * the case num_of_frames_per_hash_entry ==
24522ffc1057SHemant Agrawal 			 * e_FM_PCD_MANIP_FOUR_WAYS_HASH,
24532ffc1057SHemant Agrawal 			 * max_num_frames_in_process has to be in the range of
24542ffc1057SHemant Agrawal 			 * 4 - 512; In the case num_of_frames_per_hash_entry ==
24552ffc1057SHemant Agrawal 			 * e_FM_PCD_MANIP_EIGHT_WAYS_HASH,
24562ffc1057SHemant Agrawal 			 * max_num_frames_in_process has to be in the range of
24572ffc1057SHemant Agrawal 			 * 8 - 2048.
24582ffc1057SHemant Agrawal 			 */
24592ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_reassem_time_out_mode  time_out_mode;
24602ffc1057SHemant Agrawal 			/**< Expiration delay initialized by Reassembly process
24612ffc1057SHemant Agrawal 			 */
24622ffc1057SHemant Agrawal 	uint32_t	fqid_for_time_out_frames;
24632ffc1057SHemant Agrawal 			/**< FQID in which time out frames will enqueue during
24642ffc1057SHemant Agrawal 			 * Time Out Process; Recommended value for this field is
24652ffc1057SHemant Agrawal 			 * 0; in this way timed-out frames will be discarded
24662ffc1057SHemant Agrawal 			 */
24672ffc1057SHemant Agrawal 	uint32_t	timeout_threshold_for_reassm_process;
24682ffc1057SHemant Agrawal 			/**< Represents the time interval in microseconds which
24692ffc1057SHemant Agrawal 			 * defines if opened frame (at least one fragment was
24702ffc1057SHemant Agrawal 			 * processed but not all the fragments)is found as too
24712ffc1057SHemant Agrawal 			 * old
24722ffc1057SHemant Agrawal 			 */
24732ffc1057SHemant Agrawal } ioc_fm_pcd_manip_reassem_capwap_params_t;
24742ffc1057SHemant Agrawal 
24752ffc1057SHemant Agrawal /*
24762ffc1057SHemant Agrawal  * @Description   structure for defining CAPWAP manipulation
24772ffc1057SHemant Agrawal  */
24782ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_special_offload_capwap_params_t {
24792ffc1057SHemant Agrawal 	bool			dtls;
24802ffc1057SHemant Agrawal 			/**< TRUE if continue to SEC DTLS encryption */
24812ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_qos_src   qos_src;
24822ffc1057SHemant Agrawal 			/**< TODO */
24832ffc1057SHemant Agrawal } ioc_fm_pcd_manip_special_offload_capwap_params_t;
24842ffc1057SHemant Agrawal 
24852ffc1057SHemant Agrawal /*
24862ffc1057SHemant Agrawal  * @Description   Parameters for defining special offload manipulation
24872ffc1057SHemant Agrawal  */
24882ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_special_offload_params_t {
24892ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_special_offload_type		type;
24902ffc1057SHemant Agrawal 		/**< Type of special offload manipulation */
24912ffc1057SHemant Agrawal 	union {
24922ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_special_offload_ipsec_params_t ipsec;
24932ffc1057SHemant Agrawal 		/**< Parameters for IPSec; Relevant when type =
24942ffc1057SHemant Agrawal 		 * e_IOC_FM_PCD_MANIP_SPECIAL_OFFLOAD_IPSEC
24952ffc1057SHemant Agrawal 		 */
24962ffc1057SHemant Agrawal 
24972ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_special_offload_capwap_params_t capwap;
24982ffc1057SHemant Agrawal 		/**< Parameters for CAPWAP; Relevant when type =
24992ffc1057SHemant Agrawal 		 * e_FM_PCD_MANIP_SPECIAL_OFFLOAD_CAPWAP
25002ffc1057SHemant Agrawal 		 */
25012ffc1057SHemant Agrawal 	} u;
25022ffc1057SHemant Agrawal } ioc_fm_pcd_manip_special_offload_params_t;
25032ffc1057SHemant Agrawal 
25042ffc1057SHemant Agrawal /*
25052ffc1057SHemant Agrawal  * @Description   Parameters for defining generic removal manipulation
25062ffc1057SHemant Agrawal  */
25072ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_rmv_generic_params_t {
25082ffc1057SHemant Agrawal 	uint8_t			offset;
25092ffc1057SHemant Agrawal 		/**< Offset from beginning of header to the start location of
25102ffc1057SHemant Agrawal 		 * the removal
25112ffc1057SHemant Agrawal 		 */
25122ffc1057SHemant Agrawal 	uint8_t			size;	/**< Size of removed section */
25132ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_rmv_generic_params_t;
25142ffc1057SHemant Agrawal 
25152ffc1057SHemant Agrawal /*
25162ffc1057SHemant Agrawal  * @Description   Parameters for defining insertion manipulation
25172ffc1057SHemant Agrawal  */
25182ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_insrt_t {
25192ffc1057SHemant Agrawal 	uint8_t size;		/**< size of inserted section */
25202ffc1057SHemant Agrawal 	uint8_t *p_data;	/**< data to be inserted */
25212ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_insrt_t;
25222ffc1057SHemant Agrawal 
25232ffc1057SHemant Agrawal /*
25242ffc1057SHemant Agrawal  * @Description   Parameters for defining generic insertion manipulation
25252ffc1057SHemant Agrawal  */
25262ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_insrt_generic_params_t {
25272ffc1057SHemant Agrawal 	uint8_t			offset;
25282ffc1057SHemant Agrawal 			/**< Offset from beginning of header to the start
25292ffc1057SHemant Agrawal 			 * location of the insertion
25302ffc1057SHemant Agrawal 			 */
25312ffc1057SHemant Agrawal 	uint8_t			size;	/**< Size of inserted section */
25322ffc1057SHemant Agrawal 	bool			replace;
25332ffc1057SHemant Agrawal 			/**< TRUE to override (replace) existing data at
25342ffc1057SHemant Agrawal 			 * 'offset', FALSE to insert
25352ffc1057SHemant Agrawal 			 */
25362ffc1057SHemant Agrawal 	uint8_t			*p_data;
25372ffc1057SHemant Agrawal 			/**< Pointer to data to be inserted */
25382ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_insrt_generic_params_t;
25392ffc1057SHemant Agrawal 
25402ffc1057SHemant Agrawal /*
25412ffc1057SHemant Agrawal  * @Description   Parameters for defining header manipulation VLAN DSCP To Vpri
25422ffc1057SHemant Agrawal  *		  translation
25432ffc1057SHemant Agrawal  */
25442ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_field_update_vlan_dscp_to_vpri_t {
25452ffc1057SHemant Agrawal 	uint8_t		dscp_to_vpri_table[IOC_FM_PCD_MANIP_DSCP_TO_VLAN_TRANS];
25462ffc1057SHemant Agrawal 		/**< A table of VPri values for each DSCP value; The index is
25472ffc1057SHemant Agrawal 		 * the D_SCP value (0-0x3F) and the value is the corresponding
25482ffc1057SHemant Agrawal 		 * VPRI (0-15).
25492ffc1057SHemant Agrawal 		 */
25502ffc1057SHemant Agrawal 	uint8_t		vpri_def_val;
25512ffc1057SHemant Agrawal 		/**< 0-7, Relevant only if update_type =
25522ffc1057SHemant Agrawal 		 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_DSCP_TO_VLAN, this field
25532ffc1057SHemant Agrawal 		 * is the Q Tag default value if the IP header is not found.
25542ffc1057SHemant Agrawal 		 */
25552ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_field_update_vlan_dscp_to_vpri_t;
25562ffc1057SHemant Agrawal 
25572ffc1057SHemant Agrawal /*
25582ffc1057SHemant Agrawal  * @Description   Parameters for defining header manipulation VLAN fields
25592ffc1057SHemant Agrawal  *		  updates
25602ffc1057SHemant Agrawal  */
25612ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_field_update_vlan_t {
25622ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_field_update_vlan  update_type;
25632ffc1057SHemant Agrawal 		/**< Selects VLAN update type */
25642ffc1057SHemant Agrawal 	union {
25652ffc1057SHemant Agrawal 	uint8_t					vpri;
25662ffc1057SHemant Agrawal 		/**< 0-7, Relevant only if If update_type =
25672ffc1057SHemant Agrawal 		 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_VLAN_PRI, this is the new
25682ffc1057SHemant Agrawal 		 * VLAN pri.
25692ffc1057SHemant Agrawal 		 */
25702ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_field_update_vlan_dscp_to_vpri_t	dscp_to_vpri;
25712ffc1057SHemant Agrawal 		/**<  Parameters structure, Relevant only if update_type =
25722ffc1057SHemant Agrawal 		 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_DSCP_TO_VLAN.
25732ffc1057SHemant Agrawal 		 */
25742ffc1057SHemant Agrawal 	} u;
25752ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_field_update_vlan_t;
25762ffc1057SHemant Agrawal 
25772ffc1057SHemant Agrawal /*
25782ffc1057SHemant Agrawal  * @Description   Parameters for defining header manipulation IPV4 fields
25792ffc1057SHemant Agrawal  *		  updates
25802ffc1057SHemant Agrawal  */
25812ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_field_update_ipv4_t {
25822ffc1057SHemant Agrawal 	ioc_ipv4_hdr_manip_update_flags_t	valid_updates;
25832ffc1057SHemant Agrawal 			/**< ORed flag, selecting the required updates */
25842ffc1057SHemant Agrawal 	uint8_t		tos;
25852ffc1057SHemant Agrawal 			/**< 8 bit New TOS; Relevant if valid_updates contains
25862ffc1057SHemant Agrawal 			 * IOC_HDR_MANIP_IPV4_TOS
25872ffc1057SHemant Agrawal 			 */
25882ffc1057SHemant Agrawal 	uint16_t	id;
25892ffc1057SHemant Agrawal 			/**< 16 bit New IP ID; Relevant only if
25902ffc1057SHemant Agrawal 			 * valid_updates contains IOC_HDR_MANIP_IPV4_ID
25912ffc1057SHemant Agrawal 			 */
25922ffc1057SHemant Agrawal 	uint32_t	src;
25932ffc1057SHemant Agrawal 			/**< 32 bit New IP SRC; Relevant only if
25942ffc1057SHemant Agrawal 			 * valid_updates contains IOC_HDR_MANIP_IPV4_SRC
25952ffc1057SHemant Agrawal 			 */
25962ffc1057SHemant Agrawal 	uint32_t	dst;
25972ffc1057SHemant Agrawal 			/**< 32 bit New IP DST; Relevant only if
25982ffc1057SHemant Agrawal 			 * valid_updates contains IOC_HDR_MANIP_IPV4_DST
25992ffc1057SHemant Agrawal 			 */
26002ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_field_update_ipv4_t;
26012ffc1057SHemant Agrawal 
26022ffc1057SHemant Agrawal /*
26032ffc1057SHemant Agrawal  * @Description   Parameters for defining header manipulation IPV6 fields
26042ffc1057SHemant Agrawal  *		  updates
26052ffc1057SHemant Agrawal  */
26062ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_field_update_ipv6_t {
26072ffc1057SHemant Agrawal 	ioc_ipv6_hdr_manip_update_flags_t	valid_updates;
26082ffc1057SHemant Agrawal 			/**< ORed flag, selecting the required updates */
26092ffc1057SHemant Agrawal 	uint8_t		traffic_class;
26102ffc1057SHemant Agrawal 			/**< 8 bit New Traffic Class; Relevant if valid_updates
26112ffc1057SHemant Agrawal 			 * contains IOC_HDR_MANIP_IPV6_TC
26122ffc1057SHemant Agrawal 			 */
26132ffc1057SHemant Agrawal 	uint8_t		src[ioc_net_hf_ipv6_addr_size];
26142ffc1057SHemant Agrawal 			/**< 16 byte new IP SRC; Relevant only if valid_updates
26152ffc1057SHemant Agrawal 			 * contains IOC_HDR_MANIP_IPV6_SRC
26162ffc1057SHemant Agrawal 			 */
26172ffc1057SHemant Agrawal 	uint8_t		dst[ioc_net_hf_ipv6_addr_size];
26182ffc1057SHemant Agrawal 			/**< 16 byte new IP DST; Relevant only if valid_updates
26192ffc1057SHemant Agrawal 			 * contains IOC_HDR_MANIP_IPV6_DST
26202ffc1057SHemant Agrawal 			 */
26212ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_field_update_ipv6_t;
26222ffc1057SHemant Agrawal 
26232ffc1057SHemant Agrawal /*
26242ffc1057SHemant Agrawal  * @Description   Parameters for defining header manipulation TCP/UDP fields
26252ffc1057SHemant Agrawal  *		  updates
26262ffc1057SHemant Agrawal  */
26272ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_field_update_tcp_udp_t {
26282ffc1057SHemant Agrawal 	ioc_tcp_udp_hdr_manip_update_flags_t	valid_updates;
26292ffc1057SHemant Agrawal 			/**< ORed flag, selecting the required updates */
26302ffc1057SHemant Agrawal 	uint16_t	src;
26312ffc1057SHemant Agrawal 			/**< 16 bit New TCP/UDP SRC; Relevant only if
26322ffc1057SHemant Agrawal 			 * valid_updates contains IOC_HDR_MANIP_TCP_UDP_SRC
26332ffc1057SHemant Agrawal 			 */
26342ffc1057SHemant Agrawal 	uint16_t	dst;
26352ffc1057SHemant Agrawal 			/**< 16 bit New TCP/UDP DST; Relevant only if
26362ffc1057SHemant Agrawal 			 * valid_updates contains IOC_HDR_MANIP_TCP_UDP_DST
26372ffc1057SHemant Agrawal 			 */
26382ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_field_update_tcp_udp_t;
26392ffc1057SHemant Agrawal 
26402ffc1057SHemant Agrawal /*
26412ffc1057SHemant Agrawal  * @Description   Parameters for defining header manipulation fields updates
26422ffc1057SHemant Agrawal  */
26432ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_field_update_params_t {
26442ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_field_update_type	type;
26452ffc1057SHemant Agrawal 			/**< Type of header field update manipulation */
26462ffc1057SHemant Agrawal 	union {
26472ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_field_update_vlan_t	vlan;
26482ffc1057SHemant Agrawal 			/**< Parameters for VLAN update. Relevant when type =
26492ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_VLAN
26502ffc1057SHemant Agrawal 			 */
26512ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_field_update_ipv4_t	ipv4;
26522ffc1057SHemant Agrawal 			/**< Parameters for IPv4 update. Relevant when type =
26532ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_IPV4
26542ffc1057SHemant Agrawal 			 */
26552ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_field_update_ipv6_t	ipv6;
26562ffc1057SHemant Agrawal 			/**< Parameters for IPv6 update. Relevant when type =
26572ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_IPV6
26582ffc1057SHemant Agrawal 			 */
26592ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_field_update_tcp_udp_t tcp_udp;
26602ffc1057SHemant Agrawal 			/**< Parameters for TCP/UDP update. Relevant when type =
26612ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_MANIP_HDR_FIELD_UPDATE_TCP_UDP
26622ffc1057SHemant Agrawal 			 */
26632ffc1057SHemant Agrawal 	} u;
26642ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_field_update_params_t;
26652ffc1057SHemant Agrawal 
26662ffc1057SHemant Agrawal /*
26672ffc1057SHemant Agrawal  * @Description   Parameters for defining custom header manipulation for IP
26682ffc1057SHemant Agrawal  *		  replacement
26692ffc1057SHemant Agrawal  */
26702ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_custom_ip_hdr_replace_t {
26712ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_custom_ip_replace  replace_type;
26722ffc1057SHemant Agrawal 			/**< Selects replace update type */
26732ffc1057SHemant Agrawal 	bool	dec_ttl_hl;
26742ffc1057SHemant Agrawal 			/**< Decrement TTL (IPV4) or Hop limit (IPV6) by 1 */
26752ffc1057SHemant Agrawal 	bool	update_ipv4_id;
26762ffc1057SHemant Agrawal 			/**< Relevant when replace_type =
26772ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_MANIP_HDR_CUSTOM_REPLACE_IPV6_BY_IPV4
26782ffc1057SHemant Agrawal 			 */
26792ffc1057SHemant Agrawal 	uint16_t id;
26802ffc1057SHemant Agrawal 		/**< 16 bit New IP ID; Relevant only if update_ipv4_id = TRUE */
26812ffc1057SHemant Agrawal 	uint8_t	hdr_size;
26822ffc1057SHemant Agrawal 			/**< The size of the new IP header */
26832ffc1057SHemant Agrawal 	uint8_t	hdr[IOC_FM_PCD_MANIP_MAX_HDR_SIZE];
26842ffc1057SHemant Agrawal 			/**< The new IP header */
26852ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_custom_ip_hdr_replace_t;
26862ffc1057SHemant Agrawal 
26872ffc1057SHemant Agrawal /*
26882ffc1057SHemant Agrawal  * @Description   Parameters for defining custom header manipulation
26892ffc1057SHemant Agrawal  */
26902ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_custom_params_t {
26912ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_custom_type		type;
26922ffc1057SHemant Agrawal 			/**< Type of header field update manipulation */
26932ffc1057SHemant Agrawal 	union {
26942ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_custom_ip_hdr_replace_t	ip_hdr_replace;
26952ffc1057SHemant Agrawal 			/**< Parameters IP header replacement */
26962ffc1057SHemant Agrawal 	} u;
26972ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_custom_params_t;
26982ffc1057SHemant Agrawal 
26992ffc1057SHemant Agrawal /*
27002ffc1057SHemant Agrawal  * @Description   Parameters for defining specific L2 insertion manipulation
27012ffc1057SHemant Agrawal  */
27022ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_insrt_specific_l2_params_t {
27032ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_insrt_specific_l2  specific_l2;
27042ffc1057SHemant Agrawal 			/**< Selects which L2 headers to insert */
27052ffc1057SHemant Agrawal 	bool					update;
27062ffc1057SHemant Agrawal 			/**< TRUE to update MPLS header */
27072ffc1057SHemant Agrawal 	uint8_t				size;
27082ffc1057SHemant Agrawal 			/**< size of inserted section */
27092ffc1057SHemant Agrawal 	uint8_t				*p_data;
27102ffc1057SHemant Agrawal 			/**< data to be inserted */
27112ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_insrt_specific_l2_params_t;
27122ffc1057SHemant Agrawal 
27132ffc1057SHemant Agrawal /*
27142ffc1057SHemant Agrawal  * @Description   Parameters for defining IP insertion manipulation
27152ffc1057SHemant Agrawal  */
27162ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_insrt_ip_params_t {
27172ffc1057SHemant Agrawal 	bool	calc_l4_checksum;
27182ffc1057SHemant Agrawal 			/**< Calculate L4 checksum. */
27192ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_qos_mapping_mode   mapping_mode;
27202ffc1057SHemant Agrawal 			/**< TODO */
27212ffc1057SHemant Agrawal 	uint8_t last_pid_offset;
27222ffc1057SHemant Agrawal 			/**< the offset of the last Protocol within the inserted
27232ffc1057SHemant Agrawal 			 * header
27242ffc1057SHemant Agrawal 			 */
27252ffc1057SHemant Agrawal 	uint16_t  id;	/**< 16 bit New IP ID */
27262ffc1057SHemant Agrawal 	bool	donot_frag_overwrite;
27272ffc1057SHemant Agrawal 			/**< IPv4 only. DF is overwritten with the hash-result
27282ffc1057SHemant Agrawal 			 * next-to-last byte. This byte is configured to be
27292ffc1057SHemant Agrawal 			 * overwritten when RPD is set.
27302ffc1057SHemant Agrawal 			 */
27312ffc1057SHemant Agrawal 	uint8_t	last_dst_offset;
27322ffc1057SHemant Agrawal 			/**< IPv6 only. if routing extension exist, user should
27332ffc1057SHemant Agrawal 			 * set the offset of the destination address in order
27342ffc1057SHemant Agrawal 			 * to calculate UDP checksum pseudo header; Otherwise
27352ffc1057SHemant Agrawal 			 * set it to '0'.
27362ffc1057SHemant Agrawal 			 */
27372ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_insrt_t insrt;
27382ffc1057SHemant Agrawal 			/**< size and data to be inserted. */
27392ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_insrt_ip_params_t;
27402ffc1057SHemant Agrawal 
27412ffc1057SHemant Agrawal /*
27422ffc1057SHemant Agrawal  * @Description   Parameters for defining header insertion manipulation by
27432ffc1057SHemant Agrawal  *		  header type
27442ffc1057SHemant Agrawal  */
27452ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_insrt_by_hdr_params_t {
27462ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_insrt_by_hdr_type	type;
27472ffc1057SHemant Agrawal 			/**< Selects manipulation type */
27482ffc1057SHemant Agrawal 	union {
27492ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_insrt_specific_l2_params_t  specific_l2_params;
27502ffc1057SHemant Agrawal 			/**< Used when type =
27512ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_MANIP_INSRT_BY_HDR_SPECIFIC_L2: Selects
27522ffc1057SHemant Agrawal 			 * which L2 headers to remove
27532ffc1057SHemant Agrawal 			 */
27542ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_insrt_ip_params_t	ip_params;
27552ffc1057SHemant Agrawal 			/**< Used when type = e_FM_PCD_MANIP_INSRT_BY_HDR_IP */
27562ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_insrt_t		insrt;
27572ffc1057SHemant Agrawal 			/**< Used when type is one of
27582ffc1057SHemant Agrawal 			 * e_FM_PCD_MANIP_INSRT_BY_HDR_UDP,
27592ffc1057SHemant Agrawal 			 * e_FM_PCD_MANIP_INSRT_BY_HDR_UDP_LITE, or
27602ffc1057SHemant Agrawal 			 * e_FM_PCD_MANIP_INSRT_BY_HDR_CAPWAP
27612ffc1057SHemant Agrawal 			 */
27622ffc1057SHemant Agrawal 	} u;
27632ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_insrt_by_hdr_params_t;
27642ffc1057SHemant Agrawal 
27652ffc1057SHemant Agrawal /*
27662ffc1057SHemant Agrawal  * @Description   Parameters for defining header insertion manipulation
27672ffc1057SHemant Agrawal  */
27682ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_insrt_params_t {
27692ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_insrt_type			type;
27702ffc1057SHemant Agrawal 			/**< Type of insertion manipulation */
27712ffc1057SHemant Agrawal 	union {
27722ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_insrt_by_hdr_params_t	by_hdr;
27732ffc1057SHemant Agrawal 			/**< Parameters for defining header insertion
27742ffc1057SHemant Agrawal 			 * manipulation by header type, relevant if 'type' =
27752ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_MANIP_INSRT_BY_HDR
27762ffc1057SHemant Agrawal 			 */
27772ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_insrt_generic_params_t	generic;
27782ffc1057SHemant Agrawal 			/**< Parameters for defining generic header insertion
27792ffc1057SHemant Agrawal 			 * manipulation, relevant if type =
27802ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_MANIP_INSRT_GENERIC
27812ffc1057SHemant Agrawal 			 */
27822ffc1057SHemant Agrawal 	} u;
27832ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_insrt_params_t;
27842ffc1057SHemant Agrawal 
27852ffc1057SHemant Agrawal /*
27862ffc1057SHemant Agrawal  * @Description   Parameters for defining header removal manipulation
27872ffc1057SHemant Agrawal  */
27882ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_rmv_params_t {
27892ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_rmv_type		type;
27902ffc1057SHemant Agrawal 			/**< Type of header removal manipulation */
27912ffc1057SHemant Agrawal 	union {
27922ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_rmv_by_hdr_params_t   by_hdr;
27932ffc1057SHemant Agrawal 			/**< Parameters for defining header removal manipulation
27942ffc1057SHemant Agrawal 			 * by header type, relevant if type =
27952ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_MANIP_RMV_BY_HDR
27962ffc1057SHemant Agrawal 			 */
27972ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_rmv_generic_params_t  generic;
27982ffc1057SHemant Agrawal 			/**< Parameters for defining generic header removal
27992ffc1057SHemant Agrawal 			 * manipulation, relevant if type =
28002ffc1057SHemant Agrawal 			 * e_IOC_FM_PCD_MANIP_RMV_GENERIC
28012ffc1057SHemant Agrawal 			 */
28022ffc1057SHemant Agrawal 	} u;
28032ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_rmv_params_t;
28042ffc1057SHemant Agrawal 
28052ffc1057SHemant Agrawal /*
28062ffc1057SHemant Agrawal  * @Description   Parameters for defining header manipulation node
28072ffc1057SHemant Agrawal  */
28082ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_params_t {
28092ffc1057SHemant Agrawal 	bool					rmv;
28102ffc1057SHemant Agrawal 			/**< TRUE, to define removal manipulation */
28112ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_rmv_params_t	rmv_params;
28122ffc1057SHemant Agrawal 			/**< Parameters for removal manipulation, relevant if
28132ffc1057SHemant Agrawal 			 * 'rmv' = TRUE
28142ffc1057SHemant Agrawal 			 */
28152ffc1057SHemant Agrawal 
28162ffc1057SHemant Agrawal 	bool					insrt;
28172ffc1057SHemant Agrawal 			/**< TRUE, to define insertion manipulation */
28182ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_insrt_params_t	insrt_params;
28192ffc1057SHemant Agrawal 			/**< Parameters for insertion manipulation, relevant if
28202ffc1057SHemant Agrawal 			 * 'insrt' = TRUE
28212ffc1057SHemant Agrawal 			 */
28222ffc1057SHemant Agrawal 
28232ffc1057SHemant Agrawal 	bool					field_update;
28242ffc1057SHemant Agrawal 			/**< TRUE, to define field update manipulation */
28252ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_field_update_params_t  field_update_params;
28262ffc1057SHemant Agrawal 			/**< Parameters for field update manipulation, relevant
28272ffc1057SHemant Agrawal 			 * if 'fieldUpdate' = TRUE
28282ffc1057SHemant Agrawal 			 */
28292ffc1057SHemant Agrawal 
28302ffc1057SHemant Agrawal 	bool					custom;
28312ffc1057SHemant Agrawal 			/**< TRUE, to define custom manipulation */
28322ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_hdr_custom_params_t	custom_params;
28332ffc1057SHemant Agrawal 			/**< Parameters for custom manipulation, relevant if
28342ffc1057SHemant Agrawal 			 * 'custom' = TRUE
28352ffc1057SHemant Agrawal 			 */
28362ffc1057SHemant Agrawal 
28372ffc1057SHemant Agrawal 	bool				donot_parse_after_manip;
28382ffc1057SHemant Agrawal 			/**< FALSE to activate the parser a second time after
28392ffc1057SHemant Agrawal 			 * completing the manipulation on the frame
28402ffc1057SHemant Agrawal 			 */
28412ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_params_t;
28422ffc1057SHemant Agrawal 
28432ffc1057SHemant Agrawal /*
28442ffc1057SHemant Agrawal  * @Description   structure for defining fragmentation manipulation
28452ffc1057SHemant Agrawal  */
28462ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_frag_params_t {
28472ffc1057SHemant Agrawal 	ioc_net_header_type			hdr;
28482ffc1057SHemant Agrawal 			/**< Header selection */
28492ffc1057SHemant Agrawal 	union {
28502ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_frag_capwap_params_t	capwap_frag;
28512ffc1057SHemant Agrawal 			/**< Parameters for defining CAPWAP fragmentation,
28522ffc1057SHemant Agrawal 			 * relevant if 'hdr' = HEADER_TYPE_CAPWAP
28532ffc1057SHemant Agrawal 			 */
28542ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_frag_ip_params_t   ip_frag;
28552ffc1057SHemant Agrawal 			/**< Parameters for defining IP fragmentation, relevant
28562ffc1057SHemant Agrawal 			 * if 'hdr' = HEADER_TYPE_Ipv4 or HEADER_TYPE_Ipv6
28572ffc1057SHemant Agrawal 			 */
28582ffc1057SHemant Agrawal 	} u;
28592ffc1057SHemant Agrawal } ioc_fm_pcd_manip_frag_params_t;
28602ffc1057SHemant Agrawal 
28612ffc1057SHemant Agrawal /*
28622ffc1057SHemant Agrawal  * @Description   structure for defining reassemble manipulation
28632ffc1057SHemant Agrawal  */
28642ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_reassem_params_t {
28652ffc1057SHemant Agrawal 	ioc_net_header_type			hdr;
28662ffc1057SHemant Agrawal 			/**< Header selection */
28672ffc1057SHemant Agrawal 	union {
28682ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_reassem_capwap_params_t capwap_reassem;
28692ffc1057SHemant Agrawal 			/**< Parameters for defining CAPWAP reassembly, relevant
28702ffc1057SHemant Agrawal 			 * if 'hdr' = HEADER_TYPE_CAPWAP
28712ffc1057SHemant Agrawal 			 */
28722ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_reassem_ip_params_t	ip_reassem;
28732ffc1057SHemant Agrawal 			/**< Parameters for defining IP reassembly, relevant if
28742ffc1057SHemant Agrawal 			 * 'hdr' = HEADER_TYPE_Ipv4 or HEADER_TYPE_Ipv6
28752ffc1057SHemant Agrawal 			 */
28762ffc1057SHemant Agrawal 	} u;
28772ffc1057SHemant Agrawal } ioc_fm_pcd_manip_reassem_params_t;
28782ffc1057SHemant Agrawal 
28792ffc1057SHemant Agrawal /*
28802ffc1057SHemant Agrawal  * @Description   Parameters for defining a manipulation node
28812ffc1057SHemant Agrawal  */
28822ffc1057SHemant Agrawal struct fm_pcd_manip_params_t {
28832ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_type type;
28842ffc1057SHemant Agrawal 		/**< Selects type of manipulation node */
28852ffc1057SHemant Agrawal 	union {
28862ffc1057SHemant Agrawal 		ioc_fm_pcd_manip_hdr_params_t hdr;
28872ffc1057SHemant Agrawal 			/**< Parameters for defining header manipulation node */
28882ffc1057SHemant Agrawal 		ioc_fm_pcd_manip_reassem_params_t reassem;
28892ffc1057SHemant Agrawal 			/**< Parameters for defining reassembly manipulation
28902ffc1057SHemant Agrawal 			 * node
28912ffc1057SHemant Agrawal 			 */
28922ffc1057SHemant Agrawal 		ioc_fm_pcd_manip_frag_params_t frag;
28932ffc1057SHemant Agrawal 			/**< Parameters for defining fragmentation manipulation
28942ffc1057SHemant Agrawal 			 * node
28952ffc1057SHemant Agrawal 			 */
28962ffc1057SHemant Agrawal 		ioc_fm_pcd_manip_special_offload_params_t special_offload;
28972ffc1057SHemant Agrawal 			/**< Parameters for defining special offload
28982ffc1057SHemant Agrawal 			 * manipulation node
28992ffc1057SHemant Agrawal 			 */
29002ffc1057SHemant Agrawal 	} u;
29012ffc1057SHemant Agrawal 	void *p_next_manip;
29022ffc1057SHemant Agrawal 		/**< Handle to another (previously defined) manipulation node;
29032ffc1057SHemant Agrawal 		 * Allows concatenation of manipulation actions. This parameter
29042ffc1057SHemant Agrawal 		 * is optional and may be NULL.
29052ffc1057SHemant Agrawal 		 */
29062ffc1057SHemant Agrawal };
29072ffc1057SHemant Agrawal 
29082ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_params_t {
29092ffc1057SHemant Agrawal 	struct fm_pcd_manip_params_t param;
29102ffc1057SHemant Agrawal 	void *id;
29112ffc1057SHemant Agrawal } ioc_fm_pcd_manip_params_t;
29122ffc1057SHemant Agrawal 
29132ffc1057SHemant Agrawal /*
29142ffc1057SHemant Agrawal  * @Description   Structure for retrieving IP reassembly statistics
29152ffc1057SHemant Agrawal  */
29162ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_reassem_ip_stats_t {
29172ffc1057SHemant Agrawal 	/* common counters for both IPv4 and IPv6 */
29182ffc1057SHemant Agrawal 	uint32_t	timeout;
29192ffc1057SHemant Agrawal 		/**< Counts the number of TimeOut occurrences */
29202ffc1057SHemant Agrawal 	uint32_t	rfd_pool_busy;
29212ffc1057SHemant Agrawal 		/**< Counts the number of failed attempts to allocate a
29222ffc1057SHemant Agrawal 		 * Reassembly Frame Descriptor
29232ffc1057SHemant Agrawal 		 */
29242ffc1057SHemant Agrawal 	uint32_t	internal_buffer_busy;
29252ffc1057SHemant Agrawal 		/**< Counts the number of times an internal buffer busy occurred
29262ffc1057SHemant Agrawal 		 */
29272ffc1057SHemant Agrawal 	uint32_t	external_buffer_busy;
29282ffc1057SHemant Agrawal 		/**< Counts the number of times external buffer busy occurred */
29292ffc1057SHemant Agrawal 	uint32_t	sg_fragments;
29302ffc1057SHemant Agrawal 		/**< Counts the number of Scatter/Gather fragments */
29312ffc1057SHemant Agrawal 	uint32_t	dma_semaphore_depletion;
29322ffc1057SHemant Agrawal 		/**< Counts the number of failed attempts to allocate a DMA
29332ffc1057SHemant Agrawal 		 * semaphore
29342ffc1057SHemant Agrawal 		 */
29352ffc1057SHemant Agrawal 	uint32_t	non_consistent_sp;
29362ffc1057SHemant Agrawal 		/**< Counts the number of Non Consistent Storage Profile events
29372ffc1057SHemant Agrawal 		 * for successfully reassembled frames
29382ffc1057SHemant Agrawal 		 */
29392ffc1057SHemant Agrawal struct {
29402ffc1057SHemant Agrawal 	uint32_t	successfully_reassembled;
29412ffc1057SHemant Agrawal 		/**< Counts the number of successfully reassembled frames */
29422ffc1057SHemant Agrawal 	uint32_t	valid_fragments;
29432ffc1057SHemant Agrawal 		/**< Counts the total number of valid fragments that have been
29442ffc1057SHemant Agrawal 		 * processed for all frames
29452ffc1057SHemant Agrawal 		 */
29462ffc1057SHemant Agrawal 	uint32_t	processed_fragments;
29472ffc1057SHemant Agrawal 		/**< Counts the number of processed fragments (valid and error
29482ffc1057SHemant Agrawal 		 * fragments) for all frames
29492ffc1057SHemant Agrawal 		 */
29502ffc1057SHemant Agrawal 	uint32_t	malformed_fragments;
29512ffc1057SHemant Agrawal 		/**< Counts the number of malformed fragments processed for all
29522ffc1057SHemant Agrawal 		 * frames
29532ffc1057SHemant Agrawal 		 */
29542ffc1057SHemant Agrawal 	uint32_t	discarded_fragments;
29552ffc1057SHemant Agrawal 		/**< Counts the number of fragments discarded by the reassembly
29562ffc1057SHemant Agrawal 		 * process
29572ffc1057SHemant Agrawal 		 */
29582ffc1057SHemant Agrawal 	uint32_t	auto_learn_busy;
29592ffc1057SHemant Agrawal 		/**< Counts the number of times a busy condition occurs when
29602ffc1057SHemant Agrawal 		 * attempting to access an IP-Reassembly Automatic Learning Hash
29612ffc1057SHemant Agrawal 		 * set
29622ffc1057SHemant Agrawal 		 */
29632ffc1057SHemant Agrawal 	uint32_t	more_than16fragments;
29642ffc1057SHemant Agrawal 		/**< Counts the fragment occurrences in which the number of
29652ffc1057SHemant Agrawal 		 * fragments-per-frame exceeds 16
29662ffc1057SHemant Agrawal 		 */
29672ffc1057SHemant Agrawal 	} specific_hdr_statistics[2];
29682ffc1057SHemant Agrawal 		/**< slot '0' is for IPv4, slot '1' is for IPv6 */
29692ffc1057SHemant Agrawal } ioc_fm_pcd_manip_reassem_ip_stats_t;
29702ffc1057SHemant Agrawal 
29712ffc1057SHemant Agrawal /*
29722ffc1057SHemant Agrawal  * @Description   Structure for retrieving IP fragmentation statistics
29732ffc1057SHemant Agrawal  */
29742ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_frag_ip_stats_t {
29752ffc1057SHemant Agrawal 	uint32_t	total_frames;
29762ffc1057SHemant Agrawal 			/**< Number of frames that passed through the
29772ffc1057SHemant Agrawal 			 * manipulation node
29782ffc1057SHemant Agrawal 			 */
29792ffc1057SHemant Agrawal 	uint32_t	fragmented_frames;
29802ffc1057SHemant Agrawal 			/**< Number of frames that were fragmented */
29812ffc1057SHemant Agrawal 	uint32_t	generated_fragments;
29822ffc1057SHemant Agrawal 			/**< Number of fragments that were generated */
29832ffc1057SHemant Agrawal } ioc_fm_pcd_manip_frag_ip_stats_t;
29842ffc1057SHemant Agrawal 
29852ffc1057SHemant Agrawal /*
29862ffc1057SHemant Agrawal  * @Description   Structure for retrieving CAPWAP reassembly statistics
29872ffc1057SHemant Agrawal  */
29882ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_reassem_capwap_stats_t {
29892ffc1057SHemant Agrawal 	uint32_t	timeout;
29902ffc1057SHemant Agrawal 			/**< Counts the number of timeout occurrences */
29912ffc1057SHemant Agrawal 	uint32_t	rfd_pool_busy;
29922ffc1057SHemant Agrawal 			/**< Counts the number of failed attempts to allocate a
29932ffc1057SHemant Agrawal 			 * Reassembly Frame Descriptor
29942ffc1057SHemant Agrawal 			 */
29952ffc1057SHemant Agrawal 	uint32_t	internal_buffer_busy;
29962ffc1057SHemant Agrawal 			/**< Counts the number of times an internal buffer busy
29972ffc1057SHemant Agrawal 			 * occurred
29982ffc1057SHemant Agrawal 			 */
29992ffc1057SHemant Agrawal 	uint32_t	external_buffer_busy;
30002ffc1057SHemant Agrawal 			/**< Counts the number of times external buffer busy
30012ffc1057SHemant Agrawal 			 * occurred
30022ffc1057SHemant Agrawal 			 */
30032ffc1057SHemant Agrawal 	uint32_t	sg_fragments;
30042ffc1057SHemant Agrawal 			/**< Counts the number of Scatter/Gather fragments */
30052ffc1057SHemant Agrawal 	uint32_t	dma_semaphore_depletion;
30062ffc1057SHemant Agrawal 			/**< Counts the number of failed attempts to allocate a
30072ffc1057SHemant Agrawal 			 * DMA semaphore
30082ffc1057SHemant Agrawal 			 */
30092ffc1057SHemant Agrawal 	uint32_t	successfully_reassembled;
30102ffc1057SHemant Agrawal 			/**< Counts the number of successfully reassembled
30112ffc1057SHemant Agrawal 			 * frames
30122ffc1057SHemant Agrawal 			 */
30132ffc1057SHemant Agrawal 	uint32_t	valid_fragments;
30142ffc1057SHemant Agrawal 			/**< Counts the total number of valid fragments that
30152ffc1057SHemant Agrawal 			 * have been processed for all frames
30162ffc1057SHemant Agrawal 			 */
30172ffc1057SHemant Agrawal 	uint32_t	processed_fragments;
30182ffc1057SHemant Agrawal 			/**< Counts the number of processed fragments (valid and
30192ffc1057SHemant Agrawal 			 * error fragments) for all frames
30202ffc1057SHemant Agrawal 			 */
30212ffc1057SHemant Agrawal 	uint32_t	malformed_fragments;
30222ffc1057SHemant Agrawal 			/**< Counts the number of malformed fragments processed
30232ffc1057SHemant Agrawal 			 * for all frames
30242ffc1057SHemant Agrawal 			 */
30252ffc1057SHemant Agrawal 	uint32_t	auto_learn_busy;
30262ffc1057SHemant Agrawal 			/**< Counts the number of times a busy condition occurs
30272ffc1057SHemant Agrawal 			 * when attempting to access an Reassembly Automatic
30282ffc1057SHemant Agrawal 			 * Learning Hash set
30292ffc1057SHemant Agrawal 			 */
30302ffc1057SHemant Agrawal 	uint32_t	discarded_fragments;
30312ffc1057SHemant Agrawal 			/**< Counts the number of fragments discarded by the
30322ffc1057SHemant Agrawal 			 * reassembly process
30332ffc1057SHemant Agrawal 			 */
30342ffc1057SHemant Agrawal 	uint32_t	more_than16fragments;
30352ffc1057SHemant Agrawal 			/**< Counts the fragment occurrences in which the number
30362ffc1057SHemant Agrawal 			 * of fragments-per-frame exceeds 16
30372ffc1057SHemant Agrawal 			 */
30382ffc1057SHemant Agrawal 	uint32_t	exceed_max_reassembly_frame_len;
30392ffc1057SHemant Agrawal 			/**< ounts the number of times that a successful
30402ffc1057SHemant Agrawal 			 * reassembled frame length exceeds
30412ffc1057SHemant Agrawal 			 * MaxReassembledFrameLength value
30422ffc1057SHemant Agrawal 			 */
30432ffc1057SHemant Agrawal } ioc_fm_pcd_manip_reassem_capwap_stats_t;
30442ffc1057SHemant Agrawal 
30452ffc1057SHemant Agrawal /*
30462ffc1057SHemant Agrawal  * @Description   Structure for retrieving CAPWAP fragmentation statistics
30472ffc1057SHemant Agrawal  */
30482ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_frag_capwap_stats_t {
30492ffc1057SHemant Agrawal 	uint32_t	total_frames;
30502ffc1057SHemant Agrawal 			/**< Number of frames that passed through the
30512ffc1057SHemant Agrawal 			 * manipulation node
30522ffc1057SHemant Agrawal 			 */
30532ffc1057SHemant Agrawal 	uint32_t	fragmented_frames;
30542ffc1057SHemant Agrawal 			/**< Number of frames that were fragmented */
30552ffc1057SHemant Agrawal 	uint32_t	generated_fragments;
30562ffc1057SHemant Agrawal 			/**< Number of fragments that were generated */
30572ffc1057SHemant Agrawal #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0))
30582ffc1057SHemant Agrawal 	uint8_t	sg_allocation_failure;
30592ffc1057SHemant Agrawal 			/**< Number of allocation failure of s/g buffers */
30602ffc1057SHemant Agrawal #endif /* (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) */
30612ffc1057SHemant Agrawal } ioc_fm_pcd_manip_frag_capwap_stats_t;
30622ffc1057SHemant Agrawal 
30632ffc1057SHemant Agrawal /*
30642ffc1057SHemant Agrawal  * @Description   Structure for retrieving reassembly statistics
30652ffc1057SHemant Agrawal  */
30662ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_reassem_stats_t {
30672ffc1057SHemant Agrawal 	union {
30682ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_reassem_ip_stats_t  ip_reassem;
30692ffc1057SHemant Agrawal 			/**< Structure for IP reassembly statistics */
30702ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_reassem_capwap_stats_t  capwap_reassem;
30712ffc1057SHemant Agrawal 			/**< Structure for CAPWAP reassembly statistics */
30722ffc1057SHemant Agrawal 	} u;
30732ffc1057SHemant Agrawal } ioc_fm_pcd_manip_reassem_stats_t;
30742ffc1057SHemant Agrawal 
30752ffc1057SHemant Agrawal /*
30762ffc1057SHemant Agrawal  * @Description   structure for retrieving fragmentation statistics
30772ffc1057SHemant Agrawal  */
30782ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_frag_stats_t {
30792ffc1057SHemant Agrawal 	union {
30802ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_frag_ip_stats_t	ip_frag;
30812ffc1057SHemant Agrawal 			/**< Structure for IP fragmentation statistics */
30822ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_frag_capwap_stats_t capwap_frag;
30832ffc1057SHemant Agrawal 			/**< Structure for CAPWAP fragmentation statistics */
30842ffc1057SHemant Agrawal 	} u;
30852ffc1057SHemant Agrawal } ioc_fm_pcd_manip_frag_stats_t;
30862ffc1057SHemant Agrawal 
30872ffc1057SHemant Agrawal /*
30882ffc1057SHemant Agrawal  * @Description   structure for defining manipulation statistics
30892ffc1057SHemant Agrawal  */
30902ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_stats_t {
30912ffc1057SHemant Agrawal 	union {
30922ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_reassem_stats_t  reassem;
30932ffc1057SHemant Agrawal 				/**< Structure for reassembly statistics */
30942ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_frag_stats_t	frag;
30952ffc1057SHemant Agrawal 				/**< Structure for fragmentation statistics */
30962ffc1057SHemant Agrawal 	} u;
30972ffc1057SHemant Agrawal } ioc_fm_pcd_manip_stats_t;
30982ffc1057SHemant Agrawal 
30992ffc1057SHemant Agrawal /*
31002ffc1057SHemant Agrawal  * @Description   Parameters for acquiring manipulation statistics
31012ffc1057SHemant Agrawal  */
31022ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_get_stats_t {
31032ffc1057SHemant Agrawal 	void				*id;
31042ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_stats_t	stats;
31052ffc1057SHemant Agrawal } ioc_fm_pcd_manip_get_stats_t;
31062ffc1057SHemant Agrawal 
31072ffc1057SHemant Agrawal /*
31082ffc1057SHemant Agrawal  * @Description   Parameters for defining frame replicator group and its members
31092ffc1057SHemant Agrawal  */
31102ffc1057SHemant Agrawal struct fm_pcd_frm_replic_group_params_t {
31112ffc1057SHemant Agrawal 	uint8_t			max_num_of_entries;
31122ffc1057SHemant Agrawal 				/**< Maximal number of members in the group -
31132ffc1057SHemant Agrawal 				 * must be at least two
31142ffc1057SHemant Agrawal 				 */
31152ffc1057SHemant Agrawal 	uint8_t			num_of_entries;
31162ffc1057SHemant Agrawal 				/**< Number of members in the group - must be at
31172ffc1057SHemant Agrawal 				 * least 1
31182ffc1057SHemant Agrawal 				 */
31192ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_next_engine_params_t
31202ffc1057SHemant Agrawal 		next_engine_params[IOC_FM_PCD_FRM_REPLIC_MAX_NUM_OF_ENTRIES];
31212ffc1057SHemant Agrawal 				/**< Array of members' parameters */
31222ffc1057SHemant Agrawal };
31232ffc1057SHemant Agrawal 
31242ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_frm_replic_group_params_t {
31252ffc1057SHemant Agrawal 	struct fm_pcd_frm_replic_group_params_t param;
31262ffc1057SHemant Agrawal 	void *id;
31272ffc1057SHemant Agrawal } ioc_fm_pcd_frm_replic_group_params_t;
31282ffc1057SHemant Agrawal 
31292ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_frm_replic_member_t {
31302ffc1057SHemant Agrawal 	void *h_replic_group;
31312ffc1057SHemant Agrawal 	uint16_t member_index;
31322ffc1057SHemant Agrawal } ioc_fm_pcd_frm_replic_member_t;
31332ffc1057SHemant Agrawal 
31342ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_frm_replic_member_params_t {
31352ffc1057SHemant Agrawal 	ioc_fm_pcd_frm_replic_member_t member;
31362ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_next_engine_params_t next_engine_params;
31372ffc1057SHemant Agrawal } ioc_fm_pcd_frm_replic_member_params_t;
31382ffc1057SHemant Agrawal 
31392ffc1057SHemant Agrawal 
31402ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_key_statistics_t {
31412ffc1057SHemant Agrawal 	uint32_t	byte_count;
31422ffc1057SHemant Agrawal 			/**< This counter reflects byte count of frames that
31432ffc1057SHemant Agrawal 			 * were matched by this key.
31442ffc1057SHemant Agrawal 			 */
31452ffc1057SHemant Agrawal 	uint32_t	frame_count;
31462ffc1057SHemant Agrawal 			/**< This counter reflects count of frames that were
31472ffc1057SHemant Agrawal 			 * matched by this key.
31482ffc1057SHemant Agrawal 			 */
31492ffc1057SHemant Agrawal 	uint32_t	frame_length_range_count[IOC_FM_PCD_CC_STATS_MAX_FLR];
31502ffc1057SHemant Agrawal 			/**< These counters reflect how many frames matched this
31512ffc1057SHemant Agrawal 			 * key in 'RMON' statistics mode: Each counter holds the
31522ffc1057SHemant Agrawal 			 * number of frames of a specific frames length range,
31532ffc1057SHemant Agrawal 			 * according to the ranges provided at initialization.
31542ffc1057SHemant Agrawal 			 */
31552ffc1057SHemant Agrawal } ioc_fm_pcd_cc_key_statistics_t;
31562ffc1057SHemant Agrawal 
31572ffc1057SHemant Agrawal 
31582ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_cc_tbl_get_stats_t {
31592ffc1057SHemant Agrawal 	void				*id;
31602ffc1057SHemant Agrawal 	uint16_t			key_index;
31612ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_key_statistics_t  statistics;
31622ffc1057SHemant Agrawal } ioc_fm_pcd_cc_tbl_get_stats_t;
31632ffc1057SHemant Agrawal 
31642ffc1057SHemant Agrawal /*
31652ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_get_key_statistics
31662ffc1057SHemant Agrawal  *
31672ffc1057SHemant Agrawal  * @Description   This routine may be used to get statistics counters of
31682ffc1057SHemant Agrawal  *		  specific key in a CC Node.
31692ffc1057SHemant Agrawal  *
31702ffc1057SHemant Agrawal  *		  If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
31712ffc1057SHemant Agrawal  *		  'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
31722ffc1057SHemant Agrawal  *		  node, these counters reflect how many frames passed that were
31732ffc1057SHemant Agrawal  *		  matched this key; The total frames count will be returned in
31742ffc1057SHemant Agrawal  *		  the counter of the first range (as only one frame length range
31752ffc1057SHemant Agrawal  *		  was defined). If 'e_FM_PCD_CC_STATS_MODE_RMON' was set for
31762ffc1057SHemant Agrawal  *		  this node, the total frame count will be separated to frame
31772ffc1057SHemant Agrawal  *		  length counters, based on provided frame length ranges.
31782ffc1057SHemant Agrawal  *
31792ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node		A handle to the node
31802ffc1057SHemant Agrawal  * @Param[in]	  key_index		Key index for adding
31812ffc1057SHemant Agrawal  * @Param[out]	  p_key_statistics	Key statistics counters
31822ffc1057SHemant Agrawal  *
31832ffc1057SHemant Agrawal  * @Return	  The specific key statistics.
31842ffc1057SHemant Agrawal  *
31852ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set().
31862ffc1057SHemant Agrawal  */
31872ffc1057SHemant Agrawal #define FM_PCD_IOC_MATCH_TABLE_GET_KEY_STAT \
31882ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(12), \
31892ffc1057SHemant Agrawal 		      ioc_fm_pcd_cc_tbl_get_stats_t)
31902ffc1057SHemant Agrawal 
31912ffc1057SHemant Agrawal /*
31922ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_get_miss_statistics
31932ffc1057SHemant Agrawal  *
31942ffc1057SHemant Agrawal  * @Description   This routine may be used to get statistics counters of miss
31952ffc1057SHemant Agrawal  *		  entry in a CC Node.
31962ffc1057SHemant Agrawal  *
31972ffc1057SHemant Agrawal  *		  If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
31982ffc1057SHemant Agrawal  *		  'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
31992ffc1057SHemant Agrawal  *		  node, these counters reflect how many frames were not matched
32002ffc1057SHemant Agrawal  *		  to any existing key and therefore passed through the miss
32012ffc1057SHemant Agrawal  *		  entry; The total frames count will be returned in the counter
32022ffc1057SHemant Agrawal  *		  of the first range (as only one frame length range was
32032ffc1057SHemant Agrawal  *		  defined).
32042ffc1057SHemant Agrawal  *
32052ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node		A handle to the node
32062ffc1057SHemant Agrawal  * @Param[out]	  p_miss_statistics	Statistics counters for 'miss'
32072ffc1057SHemant Agrawal  *
32082ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
32092ffc1057SHemant Agrawal  *
32102ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set().
32112ffc1057SHemant Agrawal  */
32122ffc1057SHemant Agrawal 
32132ffc1057SHemant Agrawal #define FM_PCD_IOC_MATCH_TABLE_GET_MISS_STAT \
32142ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(13), \
32152ffc1057SHemant Agrawal 		      ioc_fm_pcd_cc_tbl_get_stats_t)
32162ffc1057SHemant Agrawal 
32172ffc1057SHemant Agrawal /*
32182ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_get_miss_statistics
32192ffc1057SHemant Agrawal  *
32202ffc1057SHemant Agrawal  * @Description   This routine may be used to get statistics counters of 'miss'
32212ffc1057SHemant Agrawal  *		  entry of the a hash table.
32222ffc1057SHemant Agrawal  *
32232ffc1057SHemant Agrawal  *		  If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
32242ffc1057SHemant Agrawal  *		  'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
32252ffc1057SHemant Agrawal  *		  node, these counters reflect how many frames were not matched
32262ffc1057SHemant Agrawal  *		  to any existing key and therefore passed through the miss
32272ffc1057SHemant Agrawal  *		  entry;
32282ffc1057SHemant Agrawal  *
32292ffc1057SHemant Agrawal  * @Param[in]	  h_hash_tbl		A handle to a hash table
32302ffc1057SHemant Agrawal  * @Param[out]	  p_miss_statistics	Statistics counters for 'miss'
32312ffc1057SHemant Agrawal  *
32322ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
32332ffc1057SHemant Agrawal  *
32342ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_hash_table_set().
32352ffc1057SHemant Agrawal  */
32362ffc1057SHemant Agrawal #define FM_PCD_IOC_HASH_TABLE_GET_MISS_STAT \
32372ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(14), \
32382ffc1057SHemant Agrawal 		      ioc_fm_pcd_cc_tbl_get_stats_t)
32392ffc1057SHemant Agrawal 
32402ffc1057SHemant Agrawal /*
32412ffc1057SHemant Agrawal  * @Function	  fm_pcd_net_env_characteristics_set
32422ffc1057SHemant Agrawal  *
32432ffc1057SHemant Agrawal  * @Description   Define a set of Network Environment Characteristics.
32442ffc1057SHemant Agrawal  *
32452ffc1057SHemant Agrawal  *		  When setting an environment it is important to understand its
32462ffc1057SHemant Agrawal  *		  application. It is not meant to describe the flows that will
32472ffc1057SHemant Agrawal  *		  run on the ports using this environment, but what the user
32482ffc1057SHemant Agrawal  *		  means TO DO with the PCD mechanisms in order to
32492ffc1057SHemant Agrawal  *		  parse-classify-distribute those frames.
32502ffc1057SHemant Agrawal  *		  By specifying a distinction unit, the user means it would use
32512ffc1057SHemant Agrawal  *		  that option for distinction between frames at either a KeyGen
32522ffc1057SHemant Agrawal  *		  scheme or a coarse classification action descriptor. Using
32532ffc1057SHemant Agrawal  *		  interchangeable headers to define a unit means that the user
32542ffc1057SHemant Agrawal  *		  is indifferent to which of the interchangeable headers is
32552ffc1057SHemant Agrawal  *		  present in the frame, and wants the distinction to be based on
32562ffc1057SHemant Agrawal  *		  the presence of either one of them.
32572ffc1057SHemant Agrawal  *
32582ffc1057SHemant Agrawal  *		  Depending on context, there are limitations to the use of
32592ffc1057SHemant Agrawal  *		  environments. A port using the PCD functionality is bound to
32602ffc1057SHemant Agrawal  *		  an environment. Some or even all ports may share an
32612ffc1057SHemant Agrawal  *		  environment but also an environment per port is possible. When
32622ffc1057SHemant Agrawal  *		  initializing a scheme, a classification plan group (see
32632ffc1057SHemant Agrawal  *		  below), or a coarse classification tree, one of the
32642ffc1057SHemant Agrawal  *		  initialized environments must be stated and related to. When a
32652ffc1057SHemant Agrawal  *		  port is bound to a scheme, a classification plan group, or a
32662ffc1057SHemant Agrawal  *		  coarse classification tree, it MUST be bound to the same
32672ffc1057SHemant Agrawal  *		  environment.
32682ffc1057SHemant Agrawal  *
32692ffc1057SHemant Agrawal  *		  The different PCD modules, may relate (for flows definition)
32702ffc1057SHemant Agrawal  *		  ONLY on distinction units as defined by their environment.
32712ffc1057SHemant Agrawal  *		  When initializing a scheme for example, it may not choose to
32722ffc1057SHemant Agrawal  *		  select IPV4 as a match for recognizing flows unless it was
32732ffc1057SHemant Agrawal  *		  defined in the relating environment. In fact, to guide the
32742ffc1057SHemant Agrawal  *		  user through the configuration of the PCD, each module's
32752ffc1057SHemant Agrawal  *		  characterization in terms of flows is not done using protocol
32762ffc1057SHemant Agrawal  *		  names, but using environment indexes.
32772ffc1057SHemant Agrawal  *
32782ffc1057SHemant Agrawal  *		  In terms of HW implementation, the list of distinction units
32792ffc1057SHemant Agrawal  *		  sets the LCV vectors and later used for match vector,
32802ffc1057SHemant Agrawal  *		  classification plan vectors and coarse classification
32812ffc1057SHemant Agrawal  *		  indexing.
32822ffc1057SHemant Agrawal  *
32832ffc1057SHemant Agrawal  * @Param[in,out] ioc_fm_pcd_net_env_params_t	A structure defining the
32842ffc1057SHemant Agrawal  *						distinction units for this
32852ffc1057SHemant Agrawal  *						configuration.
32862ffc1057SHemant Agrawal  *
32872ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
32882ffc1057SHemant Agrawal  */
32892ffc1057SHemant Agrawal #define FM_PCD_IOC_NET_ENV_CHARACTERISTICS_SET \
32902ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(20), \
32912ffc1057SHemant Agrawal 		      ioc_fm_pcd_net_env_params_t)
32922ffc1057SHemant Agrawal 
32932ffc1057SHemant Agrawal /*
32942ffc1057SHemant Agrawal  * @Function	  fm_pcd_net_env_characteristics_delete
32952ffc1057SHemant Agrawal  *
3296*7be78d02SJosh Soref  * @Description   Deletes a set of Network Environment Characteristics.
32972ffc1057SHemant Agrawal  *
32982ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_obj_t		The id of a Network Environment object.
32992ffc1057SHemant Agrawal  *
33002ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
33012ffc1057SHemant Agrawal  */
33022ffc1057SHemant Agrawal #define FM_PCD_IOC_NET_ENV_CHARACTERISTICS_DELETE \
33032ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(21), ioc_fm_obj_t)
33042ffc1057SHemant Agrawal 
33052ffc1057SHemant Agrawal /*
33062ffc1057SHemant Agrawal  * @Function	  fm_pcd_kg_scheme_set
33072ffc1057SHemant Agrawal  *
33082ffc1057SHemant Agrawal  * @Description   Initializing or modifying and enabling a scheme for the
33092ffc1057SHemant Agrawal  *		  KeyGen. This routine should be called for adding or modifying
33102ffc1057SHemant Agrawal  *		  a scheme. When a scheme needs modifying, the API requires that
33112ffc1057SHemant Agrawal  *		  it will be rewritten. In such a case 'modify' should be TRUE.
33122ffc1057SHemant Agrawal  *		  If the routine is called for a valid scheme and 'modify' is
33132ffc1057SHemant Agrawal  *		  FALSE, it will return error.
33142ffc1057SHemant Agrawal  *
33152ffc1057SHemant Agrawal  * @Param[in,out] ioc_fm_pcd_kg_scheme_params_t		A structure of
33162ffc1057SHemant Agrawal  *							parameters for defining
33172ffc1057SHemant Agrawal  *							the scheme
33182ffc1057SHemant Agrawal  *
33192ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
33202ffc1057SHemant Agrawal  */
33212ffc1057SHemant Agrawal #define FM_PCD_IOC_KG_SCHEME_SET \
33222ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(24), \
33232ffc1057SHemant Agrawal 		      ioc_fm_pcd_kg_scheme_params_t)
33242ffc1057SHemant Agrawal 
33252ffc1057SHemant Agrawal /*
33262ffc1057SHemant Agrawal  * @Function	  fm_pcd_kg_scheme_delete
33272ffc1057SHemant Agrawal  *
33282ffc1057SHemant Agrawal  * @Description   Deleting an initialized scheme.
33292ffc1057SHemant Agrawal  *
33302ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_obj_t	scheme id as initialized by application at
33312ffc1057SHemant Agrawal  *				FM_PCD_IOC_KG_SET_SCHEME
33322ffc1057SHemant Agrawal  *
33332ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
33342ffc1057SHemant Agrawal  */
33352ffc1057SHemant Agrawal #define FM_PCD_IOC_KG_SCHEME_DELETE \
33362ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(25), ioc_fm_obj_t)
33372ffc1057SHemant Agrawal 
33382ffc1057SHemant Agrawal /*
33392ffc1057SHemant Agrawal  * @Function	  fm_pcd_cc_root_build
33402ffc1057SHemant Agrawal  *
33412ffc1057SHemant Agrawal  * @Description   This routine must be called to define a complete coarse
33422ffc1057SHemant Agrawal  *		  classification tree. This is the way to define coarse
33432ffc1057SHemant Agrawal  *		  classification to a certain flow - the KeyGen schemes may
33442ffc1057SHemant Agrawal  *		  point only to trees defined in this way.
33452ffc1057SHemant Agrawal  *
33462ffc1057SHemant Agrawal  * @Param[in,out] ioc_fm_pcd_cc_tree_params_t	A structure of parameters to
33472ffc1057SHemant Agrawal  *						define the tree.
33482ffc1057SHemant Agrawal  *
33492ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
33502ffc1057SHemant Agrawal  */
33512ffc1057SHemant Agrawal #define FM_PCD_IOC_CC_ROOT_BUILD \
33522ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(26), void *)
33532ffc1057SHemant Agrawal 		/* workaround ...*/
33542ffc1057SHemant Agrawal 
33552ffc1057SHemant Agrawal /*
33562ffc1057SHemant Agrawal  * @Function	  fm_pcd_cc_root_delete
33572ffc1057SHemant Agrawal  *
33582ffc1057SHemant Agrawal  * @Description   Deleting a built tree.
33592ffc1057SHemant Agrawal  *
33602ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_obj_t - The id of a CC tree.
33612ffc1057SHemant Agrawal  */
33622ffc1057SHemant Agrawal #define FM_PCD_IOC_CC_ROOT_DELETE \
33632ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(27), ioc_fm_obj_t)
33642ffc1057SHemant Agrawal 
33652ffc1057SHemant Agrawal /*
33662ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_set
33672ffc1057SHemant Agrawal  *
33682ffc1057SHemant Agrawal  * @Description   This routine should be called for each CC (coarse
33692ffc1057SHemant Agrawal  *		  classification) node. The whole CC tree should be built bottom
33702ffc1057SHemant Agrawal  *		  up so that each node points to already defined nodes. p_NodeId
33712ffc1057SHemant Agrawal  *		  returns the node Id to be used by other nodes.
33722ffc1057SHemant Agrawal  *
33732ffc1057SHemant Agrawal  * @Param[in,out] ioc_fm_pcd_cc_node_params_t	A structure for defining the CC
33742ffc1057SHemant Agrawal  *						node params
33752ffc1057SHemant Agrawal  *
33762ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
33772ffc1057SHemant Agrawal  */
33782ffc1057SHemant Agrawal #define FM_PCD_IOC_MATCH_TABLE_SET \
33792ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(28), void *)
33802ffc1057SHemant Agrawal 		/* workaround ...*/
33812ffc1057SHemant Agrawal 
33822ffc1057SHemant Agrawal /*
33832ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_delete
33842ffc1057SHemant Agrawal  *
33852ffc1057SHemant Agrawal  * @Description   Deleting a built node.
33862ffc1057SHemant Agrawal  *
33872ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_obj_t - The id of a CC node.
33882ffc1057SHemant Agrawal  *
33892ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
33902ffc1057SHemant Agrawal  */
33912ffc1057SHemant Agrawal #define FM_PCD_IOC_MATCH_TABLE_DELETE \
33922ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(29), ioc_fm_obj_t)
33932ffc1057SHemant Agrawal 
33942ffc1057SHemant Agrawal /*
33952ffc1057SHemant Agrawal  * @Function	  fm_pcd_cc_root_modify_next_engine
33962ffc1057SHemant Agrawal  *
33972ffc1057SHemant Agrawal  * @Description   Modify the Next Engine Parameters in the entry of the tree.
33982ffc1057SHemant Agrawal  *
33992ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_cc_tree_modify_next_engine_params_t
34002ffc1057SHemant Agrawal  *		  Pointer to a structure with the relevant parameters
34012ffc1057SHemant Agrawal  *
34022ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
34032ffc1057SHemant Agrawal  *
34042ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_cc_root_build().
34052ffc1057SHemant Agrawal  */
34062ffc1057SHemant Agrawal #define FM_PCD_IOC_CC_ROOT_MODIFY_NEXT_ENGINE \
34072ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(30), \
34082ffc1057SHemant Agrawal 		     ioc_fm_pcd_cc_tree_modify_next_engine_params_t)
34092ffc1057SHemant Agrawal 
34102ffc1057SHemant Agrawal /*
34112ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_modify_next_engine
34122ffc1057SHemant Agrawal  *
34132ffc1057SHemant Agrawal  * @Description   Modify the Next Engine Parameters in the relevant key entry of
34142ffc1057SHemant Agrawal  *		  the node.
34152ffc1057SHemant Agrawal  *
34162ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_cc_node_modify_next_engine_params_t
34172ffc1057SHemant Agrawal  *		  A pointer to a structure with the relevant parameters
34182ffc1057SHemant Agrawal  *
34192ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
34202ffc1057SHemant Agrawal  *
34212ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set().
34222ffc1057SHemant Agrawal  */
34232ffc1057SHemant Agrawal #define FM_PCD_IOC_MATCH_TABLE_MODIFY_NEXT_ENGINE \
34242ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(31), \
34252ffc1057SHemant Agrawal 		     ioc_fm_pcd_cc_node_modify_next_engine_params_t)
34262ffc1057SHemant Agrawal 
34272ffc1057SHemant Agrawal /*
34282ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_modify_miss_next_engine
34292ffc1057SHemant Agrawal  *
34302ffc1057SHemant Agrawal  * @Description   Modify the Next Engine Parameters of the Miss key case of the
34312ffc1057SHemant Agrawal  *		  node.
34322ffc1057SHemant Agrawal  *
34332ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_cc_node_modify_next_engine_params_t
34342ffc1057SHemant Agrawal  *		  Pointer to a structure with the relevant parameters
34352ffc1057SHemant Agrawal  *
34362ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
34372ffc1057SHemant Agrawal  *
34382ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set().
34392ffc1057SHemant Agrawal  */
34402ffc1057SHemant Agrawal #define FM_PCD_IOC_MATCH_TABLE_MODIFY_MISS_NEXT_ENGINE \
34412ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(32), \
34422ffc1057SHemant Agrawal 		     ioc_fm_pcd_cc_node_modify_next_engine_params_t)
34432ffc1057SHemant Agrawal 
34442ffc1057SHemant Agrawal /*
34452ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_remove_key
34462ffc1057SHemant Agrawal  *
34472ffc1057SHemant Agrawal  * @Description   Remove the key (including next engine parameters of this key)
34482ffc1057SHemant Agrawal  *		  defined by the index of the relevant node.
34492ffc1057SHemant Agrawal  *
34502ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_cc_node_remove_key_params_t
34512ffc1057SHemant Agrawal  *		  A pointer to a structure with the relevant parameters
34522ffc1057SHemant Agrawal  *
34532ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
34542ffc1057SHemant Agrawal  *
34552ffc1057SHemant Agrawal  * @Cautions	  Allowed only after fm_pcd_match_table_set() has been called
34562ffc1057SHemant Agrawal  *		  for this node and for all of the nodes that lead to it.
34572ffc1057SHemant Agrawal  */
34582ffc1057SHemant Agrawal #define FM_PCD_IOC_MATCH_TABLE_REMOVE_KEY \
34592ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(33), \
34602ffc1057SHemant Agrawal 		     ioc_fm_pcd_cc_node_remove_key_params_t)
34612ffc1057SHemant Agrawal 
34622ffc1057SHemant Agrawal /*
34632ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_add_key
34642ffc1057SHemant Agrawal  *
34652ffc1057SHemant Agrawal  * @Description   Add the key (including next engine parameters of this key in
34662ffc1057SHemant Agrawal  *		  the index defined by the key_index. Note that
34672ffc1057SHemant Agrawal  *		  'FM_PCD_LAST_KEY_INDEX' may be used when the user don't care
34682ffc1057SHemant Agrawal  *		  about the position of the key in the table - in that case, the
34692ffc1057SHemant Agrawal  *		  key will be automatically added by the driver in the last
34702ffc1057SHemant Agrawal  *		  available entry.
34712ffc1057SHemant Agrawal  *
34722ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t
34732ffc1057SHemant Agrawal  *		  A pointer to a structure with the relevant parameters
34742ffc1057SHemant Agrawal  *
34752ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
34762ffc1057SHemant Agrawal  *
34772ffc1057SHemant Agrawal  * @Cautions	  Allowed only after fm_pcd_match_table_set() has been called
34782ffc1057SHemant Agrawal  *		  for this node and for all of the nodes that lead to it.
34792ffc1057SHemant Agrawal  */
34802ffc1057SHemant Agrawal #define FM_PCD_IOC_MATCH_TABLE_ADD_KEY \
34812ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(34), \
34822ffc1057SHemant Agrawal 		     ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t)
34832ffc1057SHemant Agrawal 
34842ffc1057SHemant Agrawal /*
34852ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_modify_key_and_next_engine
34862ffc1057SHemant Agrawal  *
34872ffc1057SHemant Agrawal  * @Description   Modify the key and Next Engine Parameters of this key in the
34882ffc1057SHemant Agrawal  *		  index defined by key_index.
34892ffc1057SHemant Agrawal  *
34902ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t
34912ffc1057SHemant Agrawal  *		  A pointer to a structure with the relevant parameters
34922ffc1057SHemant Agrawal  *
34932ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
34942ffc1057SHemant Agrawal  *
34952ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set() not only of
3496*7be78d02SJosh Soref  *		  the relevant node but also the node that points to this node.
34972ffc1057SHemant Agrawal  */
34982ffc1057SHemant Agrawal #define FM_PCD_IOC_MATCH_TABLE_MODIFY_KEY_AND_NEXT_ENGINE \
34992ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(35), \
35002ffc1057SHemant Agrawal 		     ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t)
35012ffc1057SHemant Agrawal 
35022ffc1057SHemant Agrawal /*
35032ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_modify_key
35042ffc1057SHemant Agrawal  *
35052ffc1057SHemant Agrawal  * @Description   Modify the key at the index defined by key_index.
35062ffc1057SHemant Agrawal  *
35072ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_cc_node_modify_key_params_t - Pointer to a
35082ffc1057SHemant Agrawal  * structure with the relevant parameters
35092ffc1057SHemant Agrawal  *
35102ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
35112ffc1057SHemant Agrawal  *
35122ffc1057SHemant Agrawal  * @Cautions	  Allowed only after fm_pcd_match_table_set() has been called
35132ffc1057SHemant Agrawal  *		  for this node and for all of the nodes that lead to it.
35142ffc1057SHemant Agrawal  */
35152ffc1057SHemant Agrawal #define FM_PCD_IOC_MATCH_TABLE_MODIFY_KEY \
35162ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(36), \
35172ffc1057SHemant Agrawal 		     ioc_fm_pcd_cc_node_modify_key_params_t)
35182ffc1057SHemant Agrawal 
35192ffc1057SHemant Agrawal /*
35202ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_set
35212ffc1057SHemant Agrawal  *
35222ffc1057SHemant Agrawal  * @Description   This routine initializes a hash table structure.
35232ffc1057SHemant Agrawal  *		  KeyGen hash result determines the hash bucket.
35242ffc1057SHemant Agrawal  *		  Next, KeyGen key is compared against all keys of this bucket
35252ffc1057SHemant Agrawal  *		  (exact match).
35262ffc1057SHemant Agrawal  *		  Number of sets (number of buckets) of the hash equals to the
35272ffc1057SHemant Agrawal  *		  number of 1-s in 'hash_res_mask' in the provided parameters.
35282ffc1057SHemant Agrawal  *		  Number of hash table ways is then calculated by dividing
35292ffc1057SHemant Agrawal  *		  'max_num_of_keys' equally between the hash sets. This is the
35302ffc1057SHemant Agrawal  *		  maximal number of keys that a hash bucket may hold.
35312ffc1057SHemant Agrawal  *		  The hash table is initialized empty and keys may be added to
35322ffc1057SHemant Agrawal  *		  it following the initialization. Keys masks are not supported
35332ffc1057SHemant Agrawal  *		  in current hash table implementation. The initialized hash
35342ffc1057SHemant Agrawal  *		  table can be integrated as a node in a CC tree.
35352ffc1057SHemant Agrawal  *
35362ffc1057SHemant Agrawal  * @Param[in,out] ioc_fm_pcd_hash_table_params_t	Pointer to a structure
35372ffc1057SHemant Agrawal  *							with the relevant
35382ffc1057SHemant Agrawal  *							parameters.
35392ffc1057SHemant Agrawal  *
35402ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
35412ffc1057SHemant Agrawal  */
35422ffc1057SHemant Agrawal #define FM_PCD_IOC_HASH_TABLE_SET \
35432ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(37), \
35442ffc1057SHemant Agrawal 		      ioc_fm_pcd_hash_table_params_t)
35452ffc1057SHemant Agrawal 
35462ffc1057SHemant Agrawal /*
35472ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_delete
35482ffc1057SHemant Agrawal  *
35492ffc1057SHemant Agrawal  * @Description   This routine deletes the provided hash table and released all
35502ffc1057SHemant Agrawal  *		  its allocated resources.
35512ffc1057SHemant Agrawal  *
35522ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_obj_t		The ID of a hash table.
35532ffc1057SHemant Agrawal  *
35542ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
35552ffc1057SHemant Agrawal  *
35562ffc1057SHemant Agrawal  * @Cautions	Allowed only following fm_pcd_hash_table_set().
35572ffc1057SHemant Agrawal  */
35582ffc1057SHemant Agrawal #define FM_PCD_IOC_HASH_TABLE_DELETE \
35592ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(37), ioc_fm_obj_t)
35602ffc1057SHemant Agrawal 
35612ffc1057SHemant Agrawal /*
35622ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_add_key
35632ffc1057SHemant Agrawal  *
35642ffc1057SHemant Agrawal  * @Description   This routine adds the provided key (including next engine
35652ffc1057SHemant Agrawal  *		  parameters of this key) to the hash table.
35662ffc1057SHemant Agrawal  *		  The key is added as the last key of the bucket that it is
35672ffc1057SHemant Agrawal  *		  mapped to.
35682ffc1057SHemant Agrawal  *
35692ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_hash_table_add_key_params_t
35702ffc1057SHemant Agrawal  *		  Pointer to a structure with the relevant parameters
35712ffc1057SHemant Agrawal  *
35722ffc1057SHemant Agrawal  * @Return	  0 on success; error code otherwise.
35732ffc1057SHemant Agrawal  *
35742ffc1057SHemant Agrawal  * @Cautions	Allowed only following fm_pcd_hash_table_set().
35752ffc1057SHemant Agrawal  */
35762ffc1057SHemant Agrawal #define FM_PCD_IOC_HASH_TABLE_ADD_KEY \
35772ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(39), \
35782ffc1057SHemant Agrawal 		     ioc_fm_pcd_hash_table_add_key_params_t)
35792ffc1057SHemant Agrawal 
35802ffc1057SHemant Agrawal /*
35812ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_remove_key
35822ffc1057SHemant Agrawal  *
35832ffc1057SHemant Agrawal  * @Description   This routine removes the requested key (including next engine
35842ffc1057SHemant Agrawal  *		  parameters of this key) from the hash table.
35852ffc1057SHemant Agrawal  *
35862ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_hash_table_remove_key_params_t - Pointer to a
35872ffc1057SHemant Agrawal  *		  structure with the relevant parameters
35882ffc1057SHemant Agrawal  *
35892ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
35902ffc1057SHemant Agrawal  *
35912ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_hash_table_set().
35922ffc1057SHemant Agrawal  */
35932ffc1057SHemant Agrawal #define FM_PCD_IOC_HASH_TABLE_REMOVE_KEY \
35942ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(40), \
35952ffc1057SHemant Agrawal 		     ioc_fm_pcd_hash_table_remove_key_params_t)
35962ffc1057SHemant Agrawal 
35972ffc1057SHemant Agrawal /*
35982ffc1057SHemant Agrawal  * @Function	  fm_pcd_plcr_profile_set
35992ffc1057SHemant Agrawal  *
36002ffc1057SHemant Agrawal  * @Description   Sets a profile entry in the policer profile table.
36012ffc1057SHemant Agrawal  *		  The routine overrides any existing value.
36022ffc1057SHemant Agrawal  *
36032ffc1057SHemant Agrawal  * @Param[in,out] ioc_fm_pcd_plcr_profile_params_t	A structure of
36042ffc1057SHemant Agrawal  *							parameters for defining
36052ffc1057SHemant Agrawal  *							a policer profile entry.
36062ffc1057SHemant Agrawal  *
36072ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
36082ffc1057SHemant Agrawal  */
36092ffc1057SHemant Agrawal #define FM_PCD_IOC_PLCR_PROFILE_SET \
36102ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(41), \
36112ffc1057SHemant Agrawal 		      ioc_fm_pcd_plcr_profile_params_t)
36122ffc1057SHemant Agrawal 
36132ffc1057SHemant Agrawal /*
36142ffc1057SHemant Agrawal  * @Function	  fm_pcd_plcr_profile_delete
36152ffc1057SHemant Agrawal  *
36162ffc1057SHemant Agrawal  * @Description   Delete a profile entry in the policer profile table.
36172ffc1057SHemant Agrawal  *		  The routine set entry to invalid.
36182ffc1057SHemant Agrawal  *
36192ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_obj_t		The id of a policer profile.
36202ffc1057SHemant Agrawal  *
36212ffc1057SHemant Agrawal  * @Return	  0 on success; Error code otherwise.
36222ffc1057SHemant Agrawal  */
36232ffc1057SHemant Agrawal #define FM_PCD_IOC_PLCR_PROFILE_DELETE  \
36242ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(41), ioc_fm_obj_t)
36252ffc1057SHemant Agrawal 
36262ffc1057SHemant Agrawal /*
36272ffc1057SHemant Agrawal  * @Function	  fm_pcd_manip_node_set
36282ffc1057SHemant Agrawal  *
36292ffc1057SHemant Agrawal  * @Description   This routine should be called for defining a manipulation
36302ffc1057SHemant Agrawal  *		  node. A manipulation node must be defined before the CC node
36312ffc1057SHemant Agrawal  *		  that precedes it.
36322ffc1057SHemant Agrawal  *
36332ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_manip_params_t	A structure of parameters
36342ffc1057SHemant Agrawal  *						defining the manipulation.
36352ffc1057SHemant Agrawal  *
36362ffc1057SHemant Agrawal  * @Return	  A handle to the initialized object on success; NULL code
36372ffc1057SHemant Agrawal  *		  otherwise.
36382ffc1057SHemant Agrawal  */
36392ffc1057SHemant Agrawal #define FM_PCD_IOC_MANIP_NODE_SET \
36402ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(43), \
36412ffc1057SHemant Agrawal 		      ioc_fm_pcd_manip_params_t)
36422ffc1057SHemant Agrawal 
36432ffc1057SHemant Agrawal /*
36442ffc1057SHemant Agrawal  * @Function	  fm_pcd_manip_node_replace
36452ffc1057SHemant Agrawal  *
36462ffc1057SHemant Agrawal  * @Description   Change existing manipulation node to be according to new
36472ffc1057SHemant Agrawal  *		  requirement. (Here, it's implemented as a variant of the same
36482ffc1057SHemant Agrawal  *		  IOCTL as for fm_pcd_manip_node_set(), and one that when
36492ffc1057SHemant Agrawal  *		  called, the 'id' member in its 'ioc_fm_pcd_manip_params_t'
36502ffc1057SHemant Agrawal  *		  argument is set to contain the manip node's handle)
36512ffc1057SHemant Agrawal  *
36522ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_pcd_manip_params_t	A structure of parameters
36532ffc1057SHemant Agrawal  *						defining the manipulation.
36542ffc1057SHemant Agrawal  *
36552ffc1057SHemant Agrawal  * @Return	  0 on success; error code otherwise.
36562ffc1057SHemant Agrawal  *
36572ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_manip_node_set().
36582ffc1057SHemant Agrawal  */
36592ffc1057SHemant Agrawal #define FM_PCD_IOC_MANIP_NODE_REPLACE	FM_PCD_IOC_MANIP_NODE_SET
36602ffc1057SHemant Agrawal 
36612ffc1057SHemant Agrawal /*
36622ffc1057SHemant Agrawal  * @Function	  fm_pcd_manip_node_delete
36632ffc1057SHemant Agrawal  *
36642ffc1057SHemant Agrawal  * @Description   Delete an existing manipulation node.
36652ffc1057SHemant Agrawal  *
36662ffc1057SHemant Agrawal  * @Param[in]	  ioc_fm_obj_t	The id of the manipulation node to delete.
36672ffc1057SHemant Agrawal  *
36682ffc1057SHemant Agrawal  * @Return	  0 on success; error code otherwise.
36692ffc1057SHemant Agrawal  *
36702ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_manip_node_set().
36712ffc1057SHemant Agrawal  */
36722ffc1057SHemant Agrawal #define FM_PCD_IOC_MANIP_NODE_DELETE \
36732ffc1057SHemant Agrawal 		_IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(44), ioc_fm_obj_t)
36742ffc1057SHemant Agrawal 
36752ffc1057SHemant Agrawal /*
36762ffc1057SHemant Agrawal  * @Function	  fm_pcd_manip_get_statistics
36772ffc1057SHemant Agrawal  *
36782ffc1057SHemant Agrawal  * @Description   Retrieve the manipulation statistics.
36792ffc1057SHemant Agrawal  *
36802ffc1057SHemant Agrawal  * @Param[in]	  h_manip_node		A handle to a manipulation node.
36812ffc1057SHemant Agrawal  * @Param[out]	  p_fm_pcd_manip_stats	A structure for retrieving the
36822ffc1057SHemant Agrawal  *					manipulation statistics.
36832ffc1057SHemant Agrawal  *
36842ffc1057SHemant Agrawal  * @Return	E_OK on success; Error code otherwise.
36852ffc1057SHemant Agrawal  *
36862ffc1057SHemant Agrawal  * @Cautions	Allowed only following fm_pcd_manip_node_set().
36872ffc1057SHemant Agrawal  */
36882ffc1057SHemant Agrawal #define FM_PCD_IOC_MANIP_GET_STATS \
36892ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(50), \
36902ffc1057SHemant Agrawal 		      ioc_fm_pcd_manip_get_stats_t)
36912ffc1057SHemant Agrawal 
36922ffc1057SHemant Agrawal /*
36932ffc1057SHemant Agrawal  * @Function	  fm_pcd_set_advanced_offload_support
36942ffc1057SHemant Agrawal  *
36952ffc1057SHemant Agrawal  * @Description   This routine must be called in order to support the following
36962ffc1057SHemant Agrawal  *		  features: IP-fragmentation, IP-reassembly, IPsec,
36972ffc1057SHemant Agrawal  *		  Header-manipulation, frame-replicator.
36982ffc1057SHemant Agrawal  *
36992ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
37002ffc1057SHemant Agrawal  *
37012ffc1057SHemant Agrawal  * @Return	  0 on success; error code otherwise.
37022ffc1057SHemant Agrawal  *
37032ffc1057SHemant Agrawal  * @Cautions	  Allowed only when PCD is disabled.
37042ffc1057SHemant Agrawal  */
37052ffc1057SHemant Agrawal #define FM_PCD_IOC_SET_ADVANCED_OFFLOAD_SUPPORT \
37062ffc1057SHemant Agrawal 		_IO(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(45))
37072ffc1057SHemant Agrawal 
37082ffc1057SHemant Agrawal /*
37092ffc1057SHemant Agrawal  * @Function	  fm_pcd_frm_replic_set_group
37102ffc1057SHemant Agrawal  *
37112ffc1057SHemant Agrawal  * @Description   Initialize a Frame Replicator group.
37122ffc1057SHemant Agrawal  *
37132ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd			FM PCD module descriptor.
37142ffc1057SHemant Agrawal  * @Param[in]	  p_frm_replic_group_param	A structure of parameters for
37152ffc1057SHemant Agrawal  *						the initialization of the frame
37162ffc1057SHemant Agrawal  *						replicator group.
37172ffc1057SHemant Agrawal  *
37182ffc1057SHemant Agrawal  * @Return	  A handle to the initialized object on success; NULL code
37192ffc1057SHemant Agrawal  *		  otherwise.
37202ffc1057SHemant Agrawal  *
37212ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
37222ffc1057SHemant Agrawal  */
37232ffc1057SHemant Agrawal #define FM_PCD_IOC_FRM_REPLIC_GROUP_SET \
37242ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(46), \
37252ffc1057SHemant Agrawal 		      ioc_fm_pcd_frm_replic_group_params_t)
37262ffc1057SHemant Agrawal 
37272ffc1057SHemant Agrawal /*
37282ffc1057SHemant Agrawal  * @Function	  fm_pcd_frm_replic_delete_group
37292ffc1057SHemant Agrawal  *
37302ffc1057SHemant Agrawal  * @Description   Delete a Frame Replicator group.
37312ffc1057SHemant Agrawal  *
37322ffc1057SHemant Agrawal  * @Param[in]	  h_frm_replic_group  A handle to the frame replicator group.
37332ffc1057SHemant Agrawal  *
37342ffc1057SHemant Agrawal  * @Return	  E_OK on success;  Error code otherwise.
37352ffc1057SHemant Agrawal  *
37362ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_frm_replic_set_group().
37372ffc1057SHemant Agrawal  */
37382ffc1057SHemant Agrawal #define FM_PCD_IOC_FRM_REPLIC_GROUP_DELETE \
37392ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(47), ioc_fm_obj_t)
37402ffc1057SHemant Agrawal 
37412ffc1057SHemant Agrawal /*
37422ffc1057SHemant Agrawal  * @Function	  fm_pcd_frm_replic_add_member
37432ffc1057SHemant Agrawal  *
37442ffc1057SHemant Agrawal  * @Description   Add the member in the index defined by the member_index.
37452ffc1057SHemant Agrawal  *
37462ffc1057SHemant Agrawal  * @Param[in]	  h_frm_replic_group	A handle to the frame replicator group.
37472ffc1057SHemant Agrawal  * @Param[in]	  member_index		Member index for adding.
37482ffc1057SHemant Agrawal  * @Param[in]	  p_member_params	A pointer to the new member parameters.
37492ffc1057SHemant Agrawal  *
37502ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
37512ffc1057SHemant Agrawal  *
37522ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_frm_replic_set_group() of this
37532ffc1057SHemant Agrawal  *		  group.
37542ffc1057SHemant Agrawal  */
37552ffc1057SHemant Agrawal #define FM_PCD_IOC_FRM_REPLIC_MEMBER_ADD \
37562ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(48), \
37572ffc1057SHemant Agrawal 			ioc_fm_pcd_frm_replic_member_params_t)
37582ffc1057SHemant Agrawal 
37592ffc1057SHemant Agrawal /*
37602ffc1057SHemant Agrawal  * @Function	  fm_pcd_frm_replic_remove_member
37612ffc1057SHemant Agrawal  *
37622ffc1057SHemant Agrawal  * @Description   Remove the member defined by the index from the relevant group
37632ffc1057SHemant Agrawal  *
37642ffc1057SHemant Agrawal  * @Param[in]	  h_frm_replic_group	A handle to the frame replicator group.
37652ffc1057SHemant Agrawal  * @Param[in]	  member_index		Member index for removing.
37662ffc1057SHemant Agrawal  *
37672ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
37682ffc1057SHemant Agrawal  *
37692ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_frm_replic_set_group() of this
37702ffc1057SHemant Agrawal  *		  group.
37712ffc1057SHemant Agrawal  */
37722ffc1057SHemant Agrawal #define FM_PCD_IOC_FRM_REPLIC_MEMBER_REMOVE \
37732ffc1057SHemant Agrawal 		_IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(49), \
37742ffc1057SHemant Agrawal 		      ioc_fm_pcd_frm_replic_member_t)
37752ffc1057SHemant Agrawal 
37762ffc1057SHemant Agrawal /*
37772ffc1057SHemant Agrawal  * @Group	  FM_grp Frame Manager API
37782ffc1057SHemant Agrawal  *
37792ffc1057SHemant Agrawal  * @Description   Frame Manager Application Programming Interface
37802ffc1057SHemant Agrawal  *
37812ffc1057SHemant Agrawal  * @{
37822ffc1057SHemant Agrawal  */
37832ffc1057SHemant Agrawal 
37842ffc1057SHemant Agrawal /*
37852ffc1057SHemant Agrawal  * @Group	  FM_PCD_grp FM PCD
37862ffc1057SHemant Agrawal  *
37872ffc1057SHemant Agrawal  * @Description   Frame Manager PCD (Parse-Classify-Distribute) API.
37882ffc1057SHemant Agrawal  *
37892ffc1057SHemant Agrawal  *		  The FM PCD module is responsible for the initialization of all
37902ffc1057SHemant Agrawal  *		  global classifying FM modules. This includes the parser
37912ffc1057SHemant Agrawal  *		  general and common registers, the key generator global and
37922ffc1057SHemant Agrawal  *		  common registers, and the policer global and common registers.
37932ffc1057SHemant Agrawal  *		  In addition, the FM PCD SW module will initialize all required
37942ffc1057SHemant Agrawal  *		  key generator schemes, coarse classification flows, and
37952ffc1057SHemant Agrawal  *		  policer profiles. When FM module is configured to work with
37962ffc1057SHemant Agrawal  *		  one of these entities, it will register to it using the FM
37972ffc1057SHemant Agrawal  *		  PORT API. The PCD module will manage the PCD resources - i.e.
37982ffc1057SHemant Agrawal  *		  resource management of KeyGen schemes, etc.
37992ffc1057SHemant Agrawal  *
38002ffc1057SHemant Agrawal  * @{
38012ffc1057SHemant Agrawal  */
38022ffc1057SHemant Agrawal 
38032ffc1057SHemant Agrawal /*
38042ffc1057SHemant Agrawal  * @Collection	  General PCD defines
38052ffc1057SHemant Agrawal  */
38062ffc1057SHemant Agrawal #define FM_PCD_MAX_NUM_OF_PRIVATE_HDRS		2
38072ffc1057SHemant Agrawal /**< Number of units/headers saved for user */
38082ffc1057SHemant Agrawal 
38092ffc1057SHemant Agrawal #define FM_PCD_PRS_NUM_OF_HDRS			16
38102ffc1057SHemant Agrawal /**< Number of headers supported by HW parser */
38112ffc1057SHemant Agrawal #define FM_PCD_MAX_NUM_OF_DISTINCTION_UNITS \
38122ffc1057SHemant Agrawal 		(32 - FM_PCD_MAX_NUM_OF_PRIVATE_HDRS)
38132ffc1057SHemant Agrawal /**< Number of distinction units is limited by register size (32 bits) minus
38142ffc1057SHemant Agrawal  *reserved bits for private headers.
38152ffc1057SHemant Agrawal  */
38162ffc1057SHemant Agrawal #define FM_PCD_MAX_NUM_OF_INTERCHANGEABLE_HDRS	4
38172ffc1057SHemant Agrawal /**< Maximum number of interchangeable headers in a distinction unit */
38182ffc1057SHemant Agrawal #define FM_PCD_KG_NUM_OF_GENERIC_REGS		FM_KG_NUM_OF_GENERIC_REGS
38192ffc1057SHemant Agrawal /**< Total number of generic KeyGen registers */
38202ffc1057SHemant Agrawal #define FM_PCD_KG_MAX_NUM_OF_EXTRACTS_PER_KEY	35
38212ffc1057SHemant Agrawal /**< Max number allowed on any configuration; For HW implementation reasons, in
38222ffc1057SHemant Agrawal  * most cases less than this will be allowed; The driver will return an
38232ffc1057SHemant Agrawal  * initialization error if resource is unavailable.
38242ffc1057SHemant Agrawal  */
38252ffc1057SHemant Agrawal #define FM_PCD_KG_NUM_OF_EXTRACT_MASKS		4
38262ffc1057SHemant Agrawal /**< Total number of masks allowed on KeyGen extractions. */
38272ffc1057SHemant Agrawal #define FM_PCD_KG_NUM_OF_DEFAULT_GROUPS		16
38282ffc1057SHemant Agrawal /**< Number of default value logical groups */
38292ffc1057SHemant Agrawal 
38302ffc1057SHemant Agrawal #define FM_PCD_PRS_NUM_OF_LABELS			32
38312ffc1057SHemant Agrawal /**< Maximum number of SW parser labels */
38322ffc1057SHemant Agrawal #define FM_SW_PRS_MAX_IMAGE_SIZE \
38332ffc1057SHemant Agrawal 	(FM_PCD_SW_PRS_SIZE \
38342ffc1057SHemant Agrawal 	 /*- FM_PCD_PRS_SW_OFFSET -FM_PCD_PRS_SW_TAIL_SIZE*/ \
38352ffc1057SHemant Agrawal 	 - FM_PCD_PRS_SW_PATCHES_SIZE)
38362ffc1057SHemant Agrawal /**< Maximum size of SW parser code */
38372ffc1057SHemant Agrawal 
38382ffc1057SHemant Agrawal #define FM_PCD_MAX_MANIP_INSRT_TEMPLATE_SIZE	128
38392ffc1057SHemant Agrawal /**< Maximum size of insertion template for insert manipulation */
38402ffc1057SHemant Agrawal 
38412ffc1057SHemant Agrawal #define FM_PCD_FRM_REPLIC_MAX_NUM_OF_ENTRIES	64
38422ffc1057SHemant Agrawal /**< Maximum possible entries for frame replicator group */
38432ffc1057SHemant Agrawal /* @} */
38442ffc1057SHemant Agrawal 
38452ffc1057SHemant Agrawal /*
38462ffc1057SHemant Agrawal  * @Group	  FM_PCD_init_grp FM PCD Initialization Unit
38472ffc1057SHemant Agrawal  *
38482ffc1057SHemant Agrawal  * @Description   Frame Manager PCD Initialization Unit API
38492ffc1057SHemant Agrawal  *
38502ffc1057SHemant Agrawal  * @{
38512ffc1057SHemant Agrawal  */
38522ffc1057SHemant Agrawal 
38532ffc1057SHemant Agrawal /*
38542ffc1057SHemant Agrawal  * @Description   Exceptions user callback routine, will be called upon an
38552ffc1057SHemant Agrawal  *		  exception passing the exception identification.
38562ffc1057SHemant Agrawal  *
38572ffc1057SHemant Agrawal  * @Param[in]	  h_app		User's application descriptor.
38582ffc1057SHemant Agrawal  * @Param[in]	  exception	The exception.
38592ffc1057SHemant Agrawal  */
38602ffc1057SHemant Agrawal typedef void (t_fm_pcd_exception_callback) (t_handle h_app,
38612ffc1057SHemant Agrawal 					ioc_fm_pcd_exceptions exception);
38622ffc1057SHemant Agrawal 
38632ffc1057SHemant Agrawal /*
38642ffc1057SHemant Agrawal  * @Description   Exceptions user callback routine, will be called upon an
38652ffc1057SHemant Agrawal  *		  exception passing the exception identification.
38662ffc1057SHemant Agrawal  *
38672ffc1057SHemant Agrawal  * @Param[in]	  h_app		User's application descriptor.
38682ffc1057SHemant Agrawal  * @Param[in]	  exception	The exception.
38692ffc1057SHemant Agrawal  * @Param[in]	  index		id of the relevant source (may be scheme or
38702ffc1057SHemant Agrawal  *				profile id).
38712ffc1057SHemant Agrawal  */
38722ffc1057SHemant Agrawal typedef void (t_fm_pcd_id_exception_callback) (t_handle	h_app,
38732ffc1057SHemant Agrawal 					ioc_fm_pcd_exceptions  exception,
38742ffc1057SHemant Agrawal 					uint16_t	index);
38752ffc1057SHemant Agrawal 
38762ffc1057SHemant Agrawal /*
38772ffc1057SHemant Agrawal  * @Description   A callback for enqueuing frame onto a QM queue.
38782ffc1057SHemant Agrawal  *
38792ffc1057SHemant Agrawal  * @Param[in]	  h_qm_arg	Application's handle passed to QM module on
38802ffc1057SHemant Agrawal  *				enqueue.
38812ffc1057SHemant Agrawal  * @Param[in]	  p_fd		Frame descriptor for the frame.
38822ffc1057SHemant Agrawal  *
38832ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
38842ffc1057SHemant Agrawal  */
38852ffc1057SHemant Agrawal typedef uint32_t (t_fm_pcd_qm_enqueue_callback) (t_handle h_qm_arg, void *p_fd);
38862ffc1057SHemant Agrawal 
38872ffc1057SHemant Agrawal /*
38882ffc1057SHemant Agrawal  * @Description   Host-Command parameters structure.
38892ffc1057SHemant Agrawal  *
38902ffc1057SHemant Agrawal  *		  When using Host command for PCD functionalities, a dedicated
38912ffc1057SHemant Agrawal  *		  port must be used. If this routine is called for a PCD in a
38922ffc1057SHemant Agrawal  *		  single partition environment, or it is the Master partition in
38932ffc1057SHemant Agrawal  *		  a Multi-partition environment, The port will be initialized by
38942ffc1057SHemant Agrawal  *		  the PCD driver initialization routine.
38952ffc1057SHemant Agrawal  */
38962ffc1057SHemant Agrawal typedef struct t_fm_pcd_hc_params {
38972ffc1057SHemant Agrawal 	uintptr_t		port_base_addr;
38982ffc1057SHemant Agrawal 	/**< Virtual Address of Host-Command Port memory mapped registers.*/
38992ffc1057SHemant Agrawal 	uint8_t			port_id;
39002ffc1057SHemant Agrawal 	/**< Port Id (0-6 relative to Host-Command/Offline-Parsing ports);
39012ffc1057SHemant Agrawal 	 * NOTE: When configuring Host Command port for FMANv3 devices
39022ffc1057SHemant Agrawal 	 * (DPAA_VERSION 11 and higher), port_id=0 MUST be used.
39032ffc1057SHemant Agrawal 	 */
39042ffc1057SHemant Agrawal 	uint16_t			liodn_base;
39052ffc1057SHemant Agrawal 	/**< LIODN base for this port, to be used together with LIODN offset
39062ffc1057SHemant Agrawal 	 * (irrelevant for P4080 revision 1.0)
39072ffc1057SHemant Agrawal 	 */
39082ffc1057SHemant Agrawal 	uint32_t			err_fqid;
39092ffc1057SHemant Agrawal 	/**< Host-Command Port error queue Id. */
39102ffc1057SHemant Agrawal 	uint32_t			conf_fqid;
39112ffc1057SHemant Agrawal 	/**< Host-Command Port confirmation queue Id. */
39122ffc1057SHemant Agrawal 	uint32_t			qm_channel;
39132ffc1057SHemant Agrawal 	/**< QM channel dedicated to this Host-Command port; will be used by the
39142ffc1057SHemant Agrawal 	 * FM for dequeue.
39152ffc1057SHemant Agrawal 	 */
39162ffc1057SHemant Agrawal 	t_fm_pcd_qm_enqueue_callback	*f_qm_enqueue;
39172ffc1057SHemant Agrawal 	/**< Callback routine for enqueuing a frame to the QM */
39182ffc1057SHemant Agrawal 	t_handle			h_qm_arg;
39192ffc1057SHemant Agrawal 	/**< Application's handle passed to QM module on enqueue */
39202ffc1057SHemant Agrawal } t_fm_pcd_hc_params;
39212ffc1057SHemant Agrawal 
39222ffc1057SHemant Agrawal /*
39232ffc1057SHemant Agrawal  * @Description   The main structure for PCD initialization
39242ffc1057SHemant Agrawal  */
39252ffc1057SHemant Agrawal typedef struct t_fm_pcd_params {
39262ffc1057SHemant Agrawal 	bool			prs_support;
39272ffc1057SHemant Agrawal 	/**< TRUE if Parser will be used for any of the FM ports. */
39282ffc1057SHemant Agrawal 	bool			cc_support;
39292ffc1057SHemant Agrawal 	/**< TRUE if Coarse Classification will be used for any of the FM ports.
39302ffc1057SHemant Agrawal 	 */
39312ffc1057SHemant Agrawal 	bool			kg_support;
39322ffc1057SHemant Agrawal 	/**< TRUE if KeyGen will be used for any of the FM ports. */
39332ffc1057SHemant Agrawal 	bool			plcr_support;
39342ffc1057SHemant Agrawal 	/**< TRUE if Policer will be used for any of the FM ports. */
39352ffc1057SHemant Agrawal 	t_handle		h_fm;
39362ffc1057SHemant Agrawal 	/**< A handle to the FM module. */
39372ffc1057SHemant Agrawal 	uint8_t			num_schemes;
39382ffc1057SHemant Agrawal 	/**< Number of schemes dedicated to this partition.
39392ffc1057SHemant Agrawal 	 * this parameter is relevant if 'kg_support'=TRUE.
39402ffc1057SHemant Agrawal 	 */
39412ffc1057SHemant Agrawal 	bool			use_host_command;
39422ffc1057SHemant Agrawal 	/**< Optional for single partition, Mandatory for Multi partition */
39432ffc1057SHemant Agrawal 	t_fm_pcd_hc_params		hc;
39442ffc1057SHemant Agrawal 	/**< Host Command parameters, relevant only if 'use_host_command'=TRUE;
39452ffc1057SHemant Agrawal 	 * Relevant when FM not runs in "guest-mode".
39462ffc1057SHemant Agrawal 	 */
39472ffc1057SHemant Agrawal 	t_fm_pcd_exception_callback	*f_exception;
39482ffc1057SHemant Agrawal 	/**< Callback routine for general PCD exceptions; Relevant when FM not
39492ffc1057SHemant Agrawal 	 * runs in "guest-mode".
39502ffc1057SHemant Agrawal 	 */
39512ffc1057SHemant Agrawal 	t_fm_pcd_id_exception_callback	*f_exception_id;
39522ffc1057SHemant Agrawal 	/**< Callback routine for specific KeyGen scheme or Policer profile
39532ffc1057SHemant Agrawal 	 * exceptions; Relevant when FM not runs in "guest-mode".
39542ffc1057SHemant Agrawal 	 */
39552ffc1057SHemant Agrawal 	t_handle		h_app;
39562ffc1057SHemant Agrawal 	/**< A handle to an application layer object; This handle will be passed
39572ffc1057SHemant Agrawal 	 * by the driver upon calling the above callbacks; Relevant when FM not
39582ffc1057SHemant Agrawal 	 * runs in "guest-mode".
39592ffc1057SHemant Agrawal 	 */
39602ffc1057SHemant Agrawal 	uint8_t			part_plcr_profiles_base;
39612ffc1057SHemant Agrawal 	/**< The first policer-profile-id dedicated to this partition. this
39622ffc1057SHemant Agrawal 	 * parameter is relevant if 'plcr_support'=TRUE. NOTE: this parameter
39632ffc1057SHemant Agrawal 	 * relevant only when working with multiple partitions.
39642ffc1057SHemant Agrawal 	 */
39652ffc1057SHemant Agrawal 	uint16_t		part_num_of_plcr_profiles;
39662ffc1057SHemant Agrawal 	/**< Number of policer-profiles dedicated to this partition. This
39672ffc1057SHemant Agrawal 	 * parameter is relevant if 'plcr_support'=TRUE. NOTE: this parameter
39682ffc1057SHemant Agrawal 	 * relevant only when working with multiple partitions.
39692ffc1057SHemant Agrawal 	 */
39702ffc1057SHemant Agrawal } t_fm_pcd_params;
39712ffc1057SHemant Agrawal 
39722ffc1057SHemant Agrawal typedef struct t_fm_pcd_prs_label_params {
39732ffc1057SHemant Agrawal 	uint32_t instruction_offset;
39742ffc1057SHemant Agrawal 	ioc_net_header_type hdr;
39752ffc1057SHemant Agrawal 	uint8_t index_per_hdr;
39762ffc1057SHemant Agrawal } t_fm_pcd_prs_label_params;
39772ffc1057SHemant Agrawal 
39782ffc1057SHemant Agrawal typedef struct t_fm_pcd_prs_sw_params {
39792ffc1057SHemant Agrawal 	bool override;
39802ffc1057SHemant Agrawal 	uint32_t size;
39812ffc1057SHemant Agrawal 	uint16_t base;
39822ffc1057SHemant Agrawal 	uint8_t *p_code;
39832ffc1057SHemant Agrawal 	uint32_t sw_prs_data_params[FM_PCD_PRS_NUM_OF_HDRS];
39842ffc1057SHemant Agrawal 	uint8_t num_of_labels;
39852ffc1057SHemant Agrawal 	t_fm_pcd_prs_label_params labels_table[FM_PCD_PRS_NUM_OF_LABELS];
39862ffc1057SHemant Agrawal } t_fm_pcd_prs_sw_params;
39872ffc1057SHemant Agrawal 
39882ffc1057SHemant Agrawal /*
39892ffc1057SHemant Agrawal  * @Function	  fm_pcd_config
39902ffc1057SHemant Agrawal  *
39912ffc1057SHemant Agrawal  * @Description   Basic configuration of the PCD module.
39922ffc1057SHemant Agrawal  *		  Creates descriptor for the FM PCD module.
39932ffc1057SHemant Agrawal  *
39942ffc1057SHemant Agrawal  * @Param[in]	  p_fm_pcd_params	A structure of parameters for the
39952ffc1057SHemant Agrawal 					initialization of PCD.
39962ffc1057SHemant Agrawal  *
39972ffc1057SHemant Agrawal  * @Return	  A handle to the initialized module.
39982ffc1057SHemant Agrawal  */
39992ffc1057SHemant Agrawal t_handle fm_pcd_config(t_fm_pcd_params *p_fm_pcd_params);
40002ffc1057SHemant Agrawal 
40012ffc1057SHemant Agrawal /*
40022ffc1057SHemant Agrawal  * @Function	  fm_pcd_init
40032ffc1057SHemant Agrawal  *
40042ffc1057SHemant Agrawal  * @Description   Initialization of the PCD module.
40052ffc1057SHemant Agrawal  *
40062ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
40072ffc1057SHemant Agrawal  *
40082ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
40092ffc1057SHemant Agrawal  */
40102ffc1057SHemant Agrawal uint32_t fm_pcd_init(t_handle h_fm_pcd);
40112ffc1057SHemant Agrawal 
40122ffc1057SHemant Agrawal /*
40132ffc1057SHemant Agrawal  * @Function	  fm_pcd_free
40142ffc1057SHemant Agrawal  *
40152ffc1057SHemant Agrawal  * @Description   Frees all resources that were assigned to FM module.
40162ffc1057SHemant Agrawal  *		  Calling this routine invalidates the descriptor.
40172ffc1057SHemant Agrawal  *
40182ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
40192ffc1057SHemant Agrawal  *
40202ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
40212ffc1057SHemant Agrawal  */
40222ffc1057SHemant Agrawal uint32_t fm_pcd_free(t_handle h_fm_pcd);
40232ffc1057SHemant Agrawal 
40242ffc1057SHemant Agrawal /*
40252ffc1057SHemant Agrawal  * @Group	  FM_PCD_advanced_cfg_grp	FM PCD Advanced Configuration
40262ffc1057SHemant Agrawal  *						Unit
40272ffc1057SHemant Agrawal  *
40282ffc1057SHemant Agrawal  * @Description   Frame Manager PCD Advanced Configuration API.
40292ffc1057SHemant Agrawal  *
40302ffc1057SHemant Agrawal  * @{
40312ffc1057SHemant Agrawal  */
40322ffc1057SHemant Agrawal 
40332ffc1057SHemant Agrawal /*
40342ffc1057SHemant Agrawal  * @Function	  fm_pcd_config_exception
40352ffc1057SHemant Agrawal  *
40362ffc1057SHemant Agrawal  * @Description   Calling this routine changes the internal driver data base
40372ffc1057SHemant Agrawal  *		  from its default selection of exceptions enabling.
40382ffc1057SHemant Agrawal  *		  [DEFAULT_num_of_shared_plcr_profiles].
40392ffc1057SHemant Agrawal  *
40402ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
40412ffc1057SHemant Agrawal  * @Param[in]	  exception	The exception to be selected.
40422ffc1057SHemant Agrawal  * @Param[in]	  enable	TRUE to enable interrupt, FALSE to mask it.
40432ffc1057SHemant Agrawal  *
40442ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
40452ffc1057SHemant Agrawal  *
40462ffc1057SHemant Agrawal  * @Cautions	  This routine should NOT be called from guest-partition (i.e.
40472ffc1057SHemant Agrawal  *		  guestId != NCSW_PRIMARY_ID)
40482ffc1057SHemant Agrawal  */
40492ffc1057SHemant Agrawal uint32_t fm_pcd_config_exception(t_handle h_fm_pcd,
40502ffc1057SHemant Agrawal 		ioc_fm_pcd_exceptions exception, bool enable);
40512ffc1057SHemant Agrawal 
40522ffc1057SHemant Agrawal /*
40532ffc1057SHemant Agrawal  * @Function	  fm_pcd_config_hc_frames_data_memory
40542ffc1057SHemant Agrawal  *
40552ffc1057SHemant Agrawal  * @Description   Configures memory-partition-id for FMan-Controller
40562ffc1057SHemant Agrawal  *		  Host-Command frames. Calling this routine changes the internal
40572ffc1057SHemant Agrawal  *		  driver data base from its default configuration [0].
40582ffc1057SHemant Agrawal  *
40592ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
40602ffc1057SHemant Agrawal  * @Param[in]	  mem_id	Memory partition ID.
40612ffc1057SHemant Agrawal  *
40622ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
40632ffc1057SHemant Agrawal  *
40642ffc1057SHemant Agrawal  * @Cautions	  This routine may be called only if 'use_host_command' was TRUE
40652ffc1057SHemant Agrawal  *		  when fm_pcd_config() routine was called.
40662ffc1057SHemant Agrawal  */
40672ffc1057SHemant Agrawal uint32_t fm_pcd_config_hc_frames_data_memory(t_handle h_fm_pcd, uint8_t mem_id);
40682ffc1057SHemant Agrawal 
40692ffc1057SHemant Agrawal /*
40702ffc1057SHemant Agrawal  * @Function	  fm_pcd_config_plcr_num_of_shared_profiles
40712ffc1057SHemant Agrawal  *
40722ffc1057SHemant Agrawal  * @Description   Calling this routine changes the internal driver data base
40732ffc1057SHemant Agrawal  *		  from its default selection of exceptions enablement.
40742ffc1057SHemant Agrawal  *		  [DEFAULT_num_of_shared_plcr_profiles].
40752ffc1057SHemant Agrawal  *
40762ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd			FM PCD module descriptor.
40772ffc1057SHemant Agrawal  * @Param[in]	  num_of_shared_plcr_profiles	Number of profiles to be shared
40782ffc1057SHemant Agrawal  *						between ports on this partition
40792ffc1057SHemant Agrawal  *
40802ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
40812ffc1057SHemant Agrawal  */
40822ffc1057SHemant Agrawal uint32_t fm_pcd_config_plcr_num_of_shared_profiles(t_handle h_fm_pcd,
40832ffc1057SHemant Agrawal 		uint16_t num_of_shared_plcr_profiles);
40842ffc1057SHemant Agrawal 
40852ffc1057SHemant Agrawal /*
40862ffc1057SHemant Agrawal  * @Function	  fm_pcd_config_plcr_auto_refresh_mode
40872ffc1057SHemant Agrawal  *
40882ffc1057SHemant Agrawal  * @Description   Calling this routine changes the internal driver data base
40892ffc1057SHemant Agrawal  *		  from its default selection of exceptions enablement. By
40902ffc1057SHemant Agrawal  *		  default auto-refresh is [DEFAULT_plcrAutoRefresh].
40912ffc1057SHemant Agrawal  *
40922ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
40932ffc1057SHemant Agrawal  * @Param[in]	  enable	TRUE to enable, FALSE to disable
40942ffc1057SHemant Agrawal  *
40952ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
40962ffc1057SHemant Agrawal  *
40972ffc1057SHemant Agrawal  * @Cautions	  This routine should NOT be called from guest-partition
40982ffc1057SHemant Agrawal  *		  (i.e. guestId != NCSW_PRIMARY_ID)
40992ffc1057SHemant Agrawal  */
41002ffc1057SHemant Agrawal uint32_t fm_pcd_config_plcr_auto_refresh_mode(t_handle h_fm_pcd, bool enable);
41012ffc1057SHemant Agrawal 
41022ffc1057SHemant Agrawal /*
41032ffc1057SHemant Agrawal  * @Function	  fm_pcd_config_prs_max_cycle_limit
41042ffc1057SHemant Agrawal  *
41052ffc1057SHemant Agrawal  * @Description   Calling this routine changes the internal data structure for
41062ffc1057SHemant Agrawal  *		  the maximum parsing time from its default value
41072ffc1057SHemant Agrawal  *		  [DEFAULT_MAX_PRS_CYC_LIM].
41082ffc1057SHemant Agrawal  *
41092ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
41102ffc1057SHemant Agrawal  * @Param[in]	  value		0 to disable the mechanism, or new maximum
41112ffc1057SHemant Agrawal  *				parsing time.
41122ffc1057SHemant Agrawal  *
41132ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
41142ffc1057SHemant Agrawal  *
41152ffc1057SHemant Agrawal  * @Cautions	  This routine should NOT be called from guest-partition
41162ffc1057SHemant Agrawal  *		  (i.e. guestId != NCSW_PRIMARY_ID)
41172ffc1057SHemant Agrawal  */
41182ffc1057SHemant Agrawal uint32_t fm_pcd_config_prs_max_cycle_limit(t_handle h_fm_pcd, uint16_t value);
41192ffc1057SHemant Agrawal 
41202ffc1057SHemant Agrawal /** @} */ /* end of FM_PCD_advanced_cfg_grp group */
41212ffc1057SHemant Agrawal /** @} */ /* end of FM_PCD_init_grp group */
41222ffc1057SHemant Agrawal 
41232ffc1057SHemant Agrawal /*
41242ffc1057SHemant Agrawal  * @Group	  FM_PCD_Runtime_grp FM PCD Runtime Unit
41252ffc1057SHemant Agrawal  *
41262ffc1057SHemant Agrawal  * @Description   Frame Manager PCD Runtime Unit API
41272ffc1057SHemant Agrawal  *
41282ffc1057SHemant Agrawal  *		  The runtime control allows creation of PCD infrastructure
41292ffc1057SHemant Agrawal  *		  modules such as Network Environment Characteristics,
41302ffc1057SHemant Agrawal  *		  Classification Plan Groups and Coarse Classification Trees.
41312ffc1057SHemant Agrawal  *		  It also allows on-the-fly initialization, modification and
41322ffc1057SHemant Agrawal  *		  removal of PCD modules such as KeyGen schemes, coarse
41332ffc1057SHemant Agrawal  *		  classification nodes and Policer profiles.
41342ffc1057SHemant Agrawal  *
41352ffc1057SHemant Agrawal  *		  In order to explain the programming model of the PCD driver
41362ffc1057SHemant Agrawal  *		  interface a few terms should be explained, and will be used
41372ffc1057SHemant Agrawal  *		  below.
41382ffc1057SHemant Agrawal  *		  - Distinction Header - One of the 16 protocols supported by
41392ffc1057SHemant Agrawal  *		    the FM parser, or one of the SHIM headers (1 or 2). May be a
41402ffc1057SHemant Agrawal  *		    header with a special option (see below).
41412ffc1057SHemant Agrawal  *		  - Interchangeable Headers Group - This is a group of Headers
41422ffc1057SHemant Agrawal  *		    recognized by either one of them. For example, if in a
41432ffc1057SHemant Agrawal  *		    specific context the user chooses to treat IPv4 and IPV6 in
41442ffc1057SHemant Agrawal  *		    the same way, they may create an interchangeable Headers
41452ffc1057SHemant Agrawal  *		    Unit consisting of these 2 headers.
41462ffc1057SHemant Agrawal  *		  - A Distinction Unit - a Distinction Header or an
41472ffc1057SHemant Agrawal  *		    Interchangeable Headers Group.
41482ffc1057SHemant Agrawal  *		  - Header with special option - applies to Ethernet, MPLS,
41492ffc1057SHemant Agrawal  *		    VLAN, IPv4 and IPv6, includes multicast, broadcast and other
41502ffc1057SHemant Agrawal  *		    protocol specific options. In terms of hardware it relates
41512ffc1057SHemant Agrawal  *		    to the options available in the classification plan.
41522ffc1057SHemant Agrawal  *		  - Network Environment Characteristics - a set of Distinction
41532ffc1057SHemant Agrawal  *		    Units that define the total recognizable header selection
41542ffc1057SHemant Agrawal  *		    for a certain environment. This is NOT the list of all
41552ffc1057SHemant Agrawal  *		    headers that will ever appear in a flow, but rather
41562ffc1057SHemant Agrawal  *		    everything that needs distinction in a flow, where
41572ffc1057SHemant Agrawal  *		    distinction is made by KeyGen schemes and coarse
41582ffc1057SHemant Agrawal  *		    classification action descriptors.
41592ffc1057SHemant Agrawal  *
41602ffc1057SHemant Agrawal  *		  The PCD runtime modules initialization is done in stages. The
41612ffc1057SHemant Agrawal  *		  first stage after initializing the PCD module itself is to
41622ffc1057SHemant Agrawal  *		  establish a Network Flows Environment Definition. The
41632ffc1057SHemant Agrawal  *		  application may choose to establish one or more such
41642ffc1057SHemant Agrawal  *		  environments. Later, when needed, the application will have to
41652ffc1057SHemant Agrawal  *		  state, for some of its modules, to which single environment it
41662ffc1057SHemant Agrawal  *		  belongs.
41672ffc1057SHemant Agrawal  *
41682ffc1057SHemant Agrawal  * @{
41692ffc1057SHemant Agrawal  */
41702ffc1057SHemant Agrawal 
41712ffc1057SHemant Agrawal t_handle fm_pcd_open(t_fm_pcd_params *p_fm_pcd_params);
41722ffc1057SHemant Agrawal void fm_pcd_close(t_handle h_fm_pcd);
41732ffc1057SHemant Agrawal 
41742ffc1057SHemant Agrawal /*
41752ffc1057SHemant Agrawal  * @Function	  fm_pcd_enable
41762ffc1057SHemant Agrawal  *
41772ffc1057SHemant Agrawal  * @Description   This routine should be called after PCD is initialized for
41782ffc1057SHemant Agrawal  *		  enabling all PCD engines according to their existing
41792ffc1057SHemant Agrawal  *		  configuration.
41802ffc1057SHemant Agrawal  *
41812ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
41822ffc1057SHemant Agrawal  *
41832ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
41842ffc1057SHemant Agrawal  *
41852ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init() and when PCD is disabled.
41862ffc1057SHemant Agrawal  */
41872ffc1057SHemant Agrawal uint32_t fm_pcd_enable(t_handle h_fm_pcd);
41882ffc1057SHemant Agrawal 
41892ffc1057SHemant Agrawal /*
41902ffc1057SHemant Agrawal  * @Function	  fm_pcd_disable
41912ffc1057SHemant Agrawal  *
41922ffc1057SHemant Agrawal  * @Description   This routine may be called when PCD is enabled in order to
41932ffc1057SHemant Agrawal  *		  disable all PCD engines. It may be called only when none of
41942ffc1057SHemant Agrawal  *		  the ports in the system are using the PCD.
41952ffc1057SHemant Agrawal  *
41962ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
41972ffc1057SHemant Agrawal  *
41982ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
41992ffc1057SHemant Agrawal  *
42002ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init() and when PCD is enabled.
42012ffc1057SHemant Agrawal  */
42022ffc1057SHemant Agrawal uint32_t fm_pcd_disable(t_handle h_fm_pcd);
42032ffc1057SHemant Agrawal 
42042ffc1057SHemant Agrawal /*
42052ffc1057SHemant Agrawal  * @Function	  fm_pcd_get_counter
42062ffc1057SHemant Agrawal  *
42072ffc1057SHemant Agrawal  * @Description   Reads one of the FM PCD counters.
42082ffc1057SHemant Agrawal  *
42092ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
42102ffc1057SHemant Agrawal  * @Param[in]	  counter	The requested counter.
42112ffc1057SHemant Agrawal  *
42122ffc1057SHemant Agrawal  * @Return	  Counter's current value.
42132ffc1057SHemant Agrawal  *
42142ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
42152ffc1057SHemant Agrawal  *		  Note that it is user's responsibility to call this routine
42162ffc1057SHemant Agrawal  *		  only for enabled counters, and there will be no indication if
42172ffc1057SHemant Agrawal  *		  a disabled counter is accessed.
42182ffc1057SHemant Agrawal  */
42192ffc1057SHemant Agrawal uint32_t fm_pcd_get_counter(t_handle h_fm_pcd, ioc_fm_pcd_counters counter);
42202ffc1057SHemant Agrawal 
42212ffc1057SHemant Agrawal /*
42222ffc1057SHemant Agrawal  * @Function	fm_pcd_prs_load_sw
42232ffc1057SHemant Agrawal  *
42242ffc1057SHemant Agrawal  * @Description	This routine may be called in order to load software parsing
42252ffc1057SHemant Agrawal  *		code.
42262ffc1057SHemant Agrawal  *
42272ffc1057SHemant Agrawal  * @Param[in]	h_fm_pcd	FM PCD module descriptor.
42282ffc1057SHemant Agrawal  * @Param[in]	p_sw_prs	A pointer to a structure of software
42292ffc1057SHemant Agrawal  *				parser parameters, including the software
42302ffc1057SHemant Agrawal  *				parser image.
42312ffc1057SHemant Agrawal  *
42322ffc1057SHemant Agrawal  * @Return	E_OK on success; Error code otherwise.
42332ffc1057SHemant Agrawal  *
42342ffc1057SHemant Agrawal  * @Cautions	Allowed only following fm_pcd_init() and when PCD is disabled.
42352ffc1057SHemant Agrawal  *		This routine should NOT be called from guest-partition
42362ffc1057SHemant Agrawal  *		(i.e. guestId != NCSW_PRIMARY_ID)
42372ffc1057SHemant Agrawal  */
42382ffc1057SHemant Agrawal uint32_t fm_pcd_prs_load_sw(t_handle h_fm_pcd,
42392ffc1057SHemant Agrawal 		ioc_fm_pcd_prs_sw_params_t *p_sw_prs);
42402ffc1057SHemant Agrawal 
42412ffc1057SHemant Agrawal /*
42422ffc1057SHemant Agrawal  * @Function	  fm_pcd_set_advanced_offload_support
42432ffc1057SHemant Agrawal  *
42442ffc1057SHemant Agrawal  * @Description   This routine must be called in order to support the following
42452ffc1057SHemant Agrawal  *		  features: IP-fragmentation, IP-reassembly, IPsec,
42462ffc1057SHemant Agrawal  *		  Header-manipulation, frame-replicator.
42472ffc1057SHemant Agrawal  *
42482ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
42492ffc1057SHemant Agrawal  *
42502ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
42512ffc1057SHemant Agrawal  *
42522ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init() and when PCD is disabled.
42532ffc1057SHemant Agrawal  *		  This routine should NOT be called from guest-partition
42542ffc1057SHemant Agrawal  *		  (i.e. guestId != NCSW_PRIMARY_ID)
42552ffc1057SHemant Agrawal  */
42562ffc1057SHemant Agrawal uint32_t fm_pcd_set_advanced_offload_support(t_handle h_fm_pcd);
42572ffc1057SHemant Agrawal 
42582ffc1057SHemant Agrawal /*
42592ffc1057SHemant Agrawal  * @Function	  fm_pcd_kg_set_dflt_value
42602ffc1057SHemant Agrawal  *
42612ffc1057SHemant Agrawal  * @Description   Calling this routine sets a global default value to be used
42622ffc1057SHemant Agrawal  *		  by the KeyGen when parser does not recognize a required
42632ffc1057SHemant Agrawal  *		  field/header.
42642ffc1057SHemant Agrawal  *		  default value is 0.
42652ffc1057SHemant Agrawal  *
42662ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
42672ffc1057SHemant Agrawal  * @Param[in]	  value_id	0,1 - one of 2 global default values.
42682ffc1057SHemant Agrawal  * @Param[in]	  value		The requested default value.
42692ffc1057SHemant Agrawal  *
42702ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
42712ffc1057SHemant Agrawal  *
42722ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init() and when PCD is disabled.
42732ffc1057SHemant Agrawal  *		  This routine should NOT be called from guest-partition
42742ffc1057SHemant Agrawal  *		  (i.e. guestId != NCSW_PRIMARY_ID)
42752ffc1057SHemant Agrawal  */
42762ffc1057SHemant Agrawal uint32_t fm_pcd_kg_set_dflt_value(t_handle h_fm_pcd,
42772ffc1057SHemant Agrawal 		uint8_t value_id, uint32_t value);
42782ffc1057SHemant Agrawal 
42792ffc1057SHemant Agrawal /*
42802ffc1057SHemant Agrawal  * @Function	  fm_pcd_kg_set_additional_data_after_parsing
42812ffc1057SHemant Agrawal  *
42822ffc1057SHemant Agrawal  * @Description   Calling this routine allows the KeyGen to access data past
42832ffc1057SHemant Agrawal  *		  the parser finishing point.
42842ffc1057SHemant Agrawal  *
42852ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd		FM PCD module descriptor.
42862ffc1057SHemant Agrawal  * @Param[in]	  payload_offset	the number of bytes beyond the parser
42872ffc1057SHemant Agrawal  *					location.
42882ffc1057SHemant Agrawal  *
42892ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
42902ffc1057SHemant Agrawal  *
42912ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init() and when PCD is disabled.
42922ffc1057SHemant Agrawal  *		  This routine should NOT be called from guest-partition (i.e.
42932ffc1057SHemant Agrawal  *		  guestId != NCSW_PRIMARY_ID)
42942ffc1057SHemant Agrawal  */
42952ffc1057SHemant Agrawal uint32_t fm_pcd_kg_set_additional_data_after_parsing(t_handle h_fm_pcd,
42962ffc1057SHemant Agrawal 		uint8_t payload_offset);
42972ffc1057SHemant Agrawal 
42982ffc1057SHemant Agrawal /*
42992ffc1057SHemant Agrawal  * @Function	  fm_pcd_set_exception
43002ffc1057SHemant Agrawal  *
43012ffc1057SHemant Agrawal  * @Description   Calling this routine enables/disables PCD interrupts.
43022ffc1057SHemant Agrawal  *
43032ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
43042ffc1057SHemant Agrawal  * @Param[in]	  exception	The exception to be selected.
43052ffc1057SHemant Agrawal  * @Param[in]	  enable	TRUE to enable interrupt, FALSE to mask it.
43062ffc1057SHemant Agrawal  *
43072ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
43082ffc1057SHemant Agrawal  *
43092ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
43102ffc1057SHemant Agrawal  *		  This routine should NOT be called from guest-partition
43112ffc1057SHemant Agrawal  *		  (i.e. guestId != NCSW_PRIMARY_ID)
43122ffc1057SHemant Agrawal  */
43132ffc1057SHemant Agrawal uint32_t fm_pcd_set_exception(t_handle h_fm_pcd,
43142ffc1057SHemant Agrawal 		ioc_fm_pcd_exceptions exception, bool enable);
43152ffc1057SHemant Agrawal 
43162ffc1057SHemant Agrawal /*
43172ffc1057SHemant Agrawal  * @Function	  fm_pcd_modify_counter
43182ffc1057SHemant Agrawal  *
43192ffc1057SHemant Agrawal  * @Description   Sets a value to an enabled counter. Use "0" to reset the
43202ffc1057SHemant Agrawal  *		  counter.
43212ffc1057SHemant Agrawal  *
43222ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
43232ffc1057SHemant Agrawal  * @Param[in]	  counter	The requested counter.
43242ffc1057SHemant Agrawal  * @Param[in]	  value		The requested value to be written into the
43252ffc1057SHemant Agrawal  *				counter.
43262ffc1057SHemant Agrawal  *
43272ffc1057SHemant Agrawal  * @Return	E_OK on success; Error code otherwise.
43282ffc1057SHemant Agrawal  *
43292ffc1057SHemant Agrawal  * @Cautions	Allowed only following fm_pcd_init().
43302ffc1057SHemant Agrawal  *		This routine should NOT be called from guest-partition
43312ffc1057SHemant Agrawal  *		(i.e. guestId != NCSW_PRIMARY_ID)
43322ffc1057SHemant Agrawal  */
43332ffc1057SHemant Agrawal uint32_t fm_pcd_modify_counter(t_handle h_fm_pcd,
43342ffc1057SHemant Agrawal 		ioc_fm_pcd_counters counter, uint32_t value);
43352ffc1057SHemant Agrawal 
43362ffc1057SHemant Agrawal /*
43372ffc1057SHemant Agrawal  * @Function	  fm_pcd_set_plcr_statistics
43382ffc1057SHemant Agrawal  *
43392ffc1057SHemant Agrawal  * @Description   This routine may be used to enable/disable policer statistics
43402ffc1057SHemant Agrawal  *		  counter. By default the statistics is enabled.
43412ffc1057SHemant Agrawal  *
43422ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor
43432ffc1057SHemant Agrawal  * @Param[in]	  enable	TRUE to enable, FALSE to disable.
43442ffc1057SHemant Agrawal  *
43452ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
43462ffc1057SHemant Agrawal  *
43472ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
43482ffc1057SHemant Agrawal  *		  This routine should NOT be called from guest-partition
43492ffc1057SHemant Agrawal  *		  (i.e. guestId != NCSW_PRIMARY_ID)
43502ffc1057SHemant Agrawal  */
43512ffc1057SHemant Agrawal uint32_t fm_pcd_set_plcr_statistics(t_handle h_fm_pcd, bool enable);
43522ffc1057SHemant Agrawal 
43532ffc1057SHemant Agrawal /*
43542ffc1057SHemant Agrawal  * @Function	  fm_pcd_set_prs_statistics
43552ffc1057SHemant Agrawal  *
43562ffc1057SHemant Agrawal  * @Description   Defines whether to gather parser statistics including all
43572ffc1057SHemant Agrawal  *		  ports.
43582ffc1057SHemant Agrawal  *
43592ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
43602ffc1057SHemant Agrawal  * @Param[in]	  enable	TRUE to enable, FALSE to disable.
43612ffc1057SHemant Agrawal  *
43622ffc1057SHemant Agrawal  * @Return	  None
43632ffc1057SHemant Agrawal  *
43642ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
43652ffc1057SHemant Agrawal  *		  This routine should NOT be called from guest-partition
43662ffc1057SHemant Agrawal  *		  (i.e. guestId != NCSW_PRIMARY_ID)
43672ffc1057SHemant Agrawal  */
43682ffc1057SHemant Agrawal void fm_pcd_set_prs_statistics(t_handle h_fm_pcd, bool enable);
43692ffc1057SHemant Agrawal 
43702ffc1057SHemant Agrawal #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0))
43712ffc1057SHemant Agrawal /*
43722ffc1057SHemant Agrawal  * @Function	  fm_pcd_dump_regs
43732ffc1057SHemant Agrawal  *
43742ffc1057SHemant Agrawal  * @Description   Dumps all PCD registers
43752ffc1057SHemant Agrawal  *
43762ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	A handle to an FM PCD Module.
43772ffc1057SHemant Agrawal  *
43782ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
43792ffc1057SHemant Agrawal  *
43802ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
43812ffc1057SHemant Agrawal  *		  NOTE: this routine may be called only for FM in master mode
43822ffc1057SHemant Agrawal  *		  (i.e. 'guestId'=NCSW_PRIMARY_ID) or in a case that the
43832ffc1057SHemant Agrawal  *		  registers are mapped.
43842ffc1057SHemant Agrawal  */
43852ffc1057SHemant Agrawal uint32_t fm_pcd_dump_regs(t_handle h_fm_pcd);
43862ffc1057SHemant Agrawal 
43872ffc1057SHemant Agrawal /*
43882ffc1057SHemant Agrawal  * @Function	  fm_pcd_kg_dump_regs
43892ffc1057SHemant Agrawal  *
43902ffc1057SHemant Agrawal  * @Description   Dumps all PCD KG registers
43912ffc1057SHemant Agrawal  *
43922ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	A handle to an FM PCD Module.
43932ffc1057SHemant Agrawal  *
43942ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
43952ffc1057SHemant Agrawal  *
43962ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
43972ffc1057SHemant Agrawal  *		  NOTE: this routine may be called only for FM in master mode
43982ffc1057SHemant Agrawal  *		  (i.e. 'guestId'=NCSW_PRIMARY_ID) or in a case that the
43992ffc1057SHemant Agrawal  *		  registers are mapped.
44002ffc1057SHemant Agrawal  */
44012ffc1057SHemant Agrawal uint32_t fm_pcd_kg_dump_regs(t_handle h_fm_pcd);
44022ffc1057SHemant Agrawal 
44032ffc1057SHemant Agrawal /*
44042ffc1057SHemant Agrawal  * @Function	  fm_pcd_plcr_dump_regs
44052ffc1057SHemant Agrawal  *
44062ffc1057SHemant Agrawal  * @Description   Dumps all PCD Policer registers
44072ffc1057SHemant Agrawal  *
44082ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	A handle to an FM PCD Module.
44092ffc1057SHemant Agrawal  *
44102ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
44112ffc1057SHemant Agrawal  *
44122ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
44132ffc1057SHemant Agrawal  *		  NOTE: this routine may be called only for FM in master mode
44142ffc1057SHemant Agrawal  *		  (i.e. 'guestId'=NCSW_PRIMARY_ID) or in a case that the
44152ffc1057SHemant Agrawal  *		  registers are mapped.
44162ffc1057SHemant Agrawal  */
44172ffc1057SHemant Agrawal uint32_t fm_pcd_plcr_dump_regs(t_handle h_fm_pcd);
44182ffc1057SHemant Agrawal 
44192ffc1057SHemant Agrawal /*
44202ffc1057SHemant Agrawal  * @Function	  fm_pcd_plcr_profile_dump_regs
44212ffc1057SHemant Agrawal  *
44222ffc1057SHemant Agrawal  * @Description   Dumps all PCD Policer profile registers
44232ffc1057SHemant Agrawal  *
44242ffc1057SHemant Agrawal  * @Param[in]	  h_profile	A handle to a Policer profile.
44252ffc1057SHemant Agrawal  *
44262ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
44272ffc1057SHemant Agrawal  *
44282ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
44292ffc1057SHemant Agrawal  *		  NOTE: this routine may be called only for FM in master mode
44302ffc1057SHemant Agrawal  *		  (i.e. 'guestId'=NCSW_PRIMARY_ID) or in a case that the
44312ffc1057SHemant Agrawal  *		  registers are mapped.
44322ffc1057SHemant Agrawal  */
44332ffc1057SHemant Agrawal uint32_t fm_pcd_plcr_profile_dump_regs(t_handle h_profile);
44342ffc1057SHemant Agrawal 
44352ffc1057SHemant Agrawal /*
44362ffc1057SHemant Agrawal  * @Function	  fm_pcd_prs_dump_regs
44372ffc1057SHemant Agrawal  *
44382ffc1057SHemant Agrawal  * @Description   Dumps all PCD Parser registers
44392ffc1057SHemant Agrawal  *
44402ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	A handle to an FM PCD Module.
44412ffc1057SHemant Agrawal  *
44422ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
44432ffc1057SHemant Agrawal  *
44442ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
44452ffc1057SHemant Agrawal  *		  NOTE: this routine may be called only for FM in master mode
44462ffc1057SHemant Agrawal  *		  (i.e. 'guestId'=NCSW_PRIMARY_ID) or in a case that the
44472ffc1057SHemant Agrawal  *		  registers are mapped.
44482ffc1057SHemant Agrawal  */
44492ffc1057SHemant Agrawal uint32_t fm_pcd_prs_dump_regs(t_handle h_fm_pcd);
44502ffc1057SHemant Agrawal 
44512ffc1057SHemant Agrawal /*
44522ffc1057SHemant Agrawal  * @Function	  fm_pcd_hc_dump_regs
44532ffc1057SHemant Agrawal  *
44542ffc1057SHemant Agrawal  * @Description   Dumps HC Port registers
44552ffc1057SHemant Agrawal  *
44562ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	A handle to an FM PCD Module.
44572ffc1057SHemant Agrawal  *
44582ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
44592ffc1057SHemant Agrawal  *
44602ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
44612ffc1057SHemant Agrawal  *		  NOTE: this routine may be called only for FM in master mode
44622ffc1057SHemant Agrawal  *		  (i.e. 'guestId'=NCSW_PRIMARY_ID).
44632ffc1057SHemant Agrawal  */
44642ffc1057SHemant Agrawal uint32_t	fm_pcd_hc_dump_regs(t_handle h_fm_pcd);
44652ffc1057SHemant Agrawal #endif /* (defined(DEBUG_ERRORS) && ... */
44662ffc1057SHemant Agrawal 
44672ffc1057SHemant Agrawal 
44682ffc1057SHemant Agrawal /*
44692ffc1057SHemant Agrawal  * KeyGen	  FM_PCD_Runtime_build_grp FM PCD Runtime Building Unit
44702ffc1057SHemant Agrawal  *
44712ffc1057SHemant Agrawal  * @Description   Frame Manager PCD Runtime Building API
44722ffc1057SHemant Agrawal  *
44732ffc1057SHemant Agrawal  *		  This group contains routines for setting, deleting and
44742ffc1057SHemant Agrawal  *		  modifying PCD resources, for defining the total PCD tree.
44752ffc1057SHemant Agrawal  * @{
44762ffc1057SHemant Agrawal  */
44772ffc1057SHemant Agrawal 
44782ffc1057SHemant Agrawal /*
44792ffc1057SHemant Agrawal  * @Collection	  Definitions of coarse classification
44802ffc1057SHemant Agrawal  *		  parameters as required by KeyGen (when coarse classification
44812ffc1057SHemant Agrawal  *		  is the next engine after this scheme).
44822ffc1057SHemant Agrawal  */
44832ffc1057SHemant Agrawal #define FM_PCD_MAX_NUM_OF_CC_TREES		8
44842ffc1057SHemant Agrawal #define FM_PCD_MAX_NUM_OF_CC_GROUPS		16
44852ffc1057SHemant Agrawal #define FM_PCD_MAX_NUM_OF_CC_UNITS		4
44862ffc1057SHemant Agrawal #define FM_PCD_MAX_NUM_OF_KEYS		256
44872ffc1057SHemant Agrawal #define FM_PCD_MAX_NUM_OF_FLOWS		(4 * KILOBYTE)
44882ffc1057SHemant Agrawal #define FM_PCD_MAX_SIZE_OF_KEY		56
44892ffc1057SHemant Agrawal #define FM_PCD_MAX_NUM_OF_CC_ENTRIES_IN_GRP	16
44902ffc1057SHemant Agrawal #define FM_PCD_LAST_KEY_INDEX		0xffff
44912ffc1057SHemant Agrawal 
44922ffc1057SHemant Agrawal #define FM_PCD_MAX_NUM_OF_CC_NODES	255
44932ffc1057SHemant Agrawal 			/* Obsolete, not used - will be removed in the future */
44942ffc1057SHemant Agrawal /* @} */
44952ffc1057SHemant Agrawal 
44962ffc1057SHemant Agrawal /*
44972ffc1057SHemant Agrawal  * @Collection	  A set of definitions to allow protocol
44982ffc1057SHemant Agrawal  *		  special option description.
44992ffc1057SHemant Agrawal  */
45002ffc1057SHemant Agrawal typedef uint32_t	protocol_opt_t;
45012ffc1057SHemant Agrawal 			/**< A general type to define a protocol option. */
45022ffc1057SHemant Agrawal 
45032ffc1057SHemant Agrawal typedef protocol_opt_t   eth_protocol_opt_t;
45042ffc1057SHemant Agrawal 			/**< Ethernet protocol options. */
45052ffc1057SHemant Agrawal #define ETH_BROADCAST		0x80000000  /**< Ethernet Broadcast. */
45062ffc1057SHemant Agrawal #define ETH_MULTICAST		0x40000000  /**< Ethernet Multicast. */
45072ffc1057SHemant Agrawal 
45082ffc1057SHemant Agrawal typedef protocol_opt_t   vlan_protocol_opt_t;	/**< VLAN protocol options. */
45092ffc1057SHemant Agrawal #define VLAN_STACKED		0x20000000  /**< Stacked VLAN. */
45102ffc1057SHemant Agrawal 
45112ffc1057SHemant Agrawal typedef protocol_opt_t   mpls_protocol_opt_t;	/**< MPLS protocol options. */
45122ffc1057SHemant Agrawal #define MPLS_STACKED		0x10000000  /**< Stacked MPLS. */
45132ffc1057SHemant Agrawal 
45142ffc1057SHemant Agrawal typedef protocol_opt_t   ipv_4protocol_opt_t;	/**< IPv4 protocol options. */
45152ffc1057SHemant Agrawal #define IPV4_BROADCAST_1		0x08000000  /**< IPv4 Broadcast. */
45162ffc1057SHemant Agrawal #define IPV4_MULTICAST_1		0x04000000  /**< IPv4 Multicast. */
45172ffc1057SHemant Agrawal #define IPV4_UNICAST_2		0x02000000  /**< Tunneled IPv4 - Unicast. */
45182ffc1057SHemant Agrawal #define IPV4_MULTICAST_BROADCAST_2  0x01000000
45192ffc1057SHemant Agrawal 				/**< Tunneled IPv4 - Broadcast/Multicast. */
45202ffc1057SHemant Agrawal 
45212ffc1057SHemant Agrawal #define IPV4_FRAG_1		0x00000008
45222ffc1057SHemant Agrawal 				/**< IPV4 reassembly option. IPV4 Reassembly
45232ffc1057SHemant Agrawal 				 * manipulation requires network environment
45242ffc1057SHemant Agrawal 				 * with IPV4 header and IPV4_FRAG_1 option
45252ffc1057SHemant Agrawal 				 */
45262ffc1057SHemant Agrawal 
45272ffc1057SHemant Agrawal typedef protocol_opt_t   ipv_6protocol_opt_t;	/**< IPv6 protocol options. */
45282ffc1057SHemant Agrawal #define IPV6_MULTICAST_1	0x00800000  /**< IPv6 Multicast. */
45292ffc1057SHemant Agrawal #define IPV6_UNICAST_2		0x00400000  /**< Tunneled IPv6 - Unicast. */
45302ffc1057SHemant Agrawal #define IPV6_MULTICAST_2	0x00200000  /**< Tunneled IPv6 - Multicast. */
45312ffc1057SHemant Agrawal 
45322ffc1057SHemant Agrawal #define IPV6_FRAG_1		0x00000004
45332ffc1057SHemant Agrawal 				/**< IPV6 reassembly option. IPV6 Reassembly
45342ffc1057SHemant Agrawal 				 * manipulation requires network environment
45352ffc1057SHemant Agrawal 				 * with IPV6 header and IPV6_FRAG_1 option; in
45362ffc1057SHemant Agrawal 				 * case where fragment found, the
45372ffc1057SHemant Agrawal 				 * fragment-extension offset may be found at
45382ffc1057SHemant Agrawal 				 * 'shim2' (in parser-result).
45392ffc1057SHemant Agrawal 				 */
45402ffc1057SHemant Agrawal typedef protocol_opt_t   capwap_protocol_opt_t;	/**< CAPWAP protocol options. */
45412ffc1057SHemant Agrawal #define CAPWAP_FRAG_1		0x00000008
45422ffc1057SHemant Agrawal 				/**< CAPWAP reassembly option. CAPWAP Reassembly
45432ffc1057SHemant Agrawal 				 * manipulation requires network environment
45442ffc1057SHemant Agrawal 				 * with CAPWAP header and CAPWAP_FRAG_1 option;
45452ffc1057SHemant Agrawal 				 * in case where fragment found, the
45462ffc1057SHemant Agrawal 				 * fragment-extension offset may be found at
45472ffc1057SHemant Agrawal 				 * 'shim2' (in parser-result).
45482ffc1057SHemant Agrawal 				 */
45492ffc1057SHemant Agrawal 
45502ffc1057SHemant Agrawal /* @} */
45512ffc1057SHemant Agrawal 
45522ffc1057SHemant Agrawal #define FM_PCD_MANIP_MAX_HDR_SIZE	256
45532ffc1057SHemant Agrawal #define FM_PCD_MANIP_DSCP_TO_VLAN_TRANS	64
45542ffc1057SHemant Agrawal 
45552ffc1057SHemant Agrawal /*
45562ffc1057SHemant Agrawal  * @Collection	  A set of definitions to support Header Manipulation selection.
45572ffc1057SHemant Agrawal  */
45582ffc1057SHemant Agrawal typedef uint32_t		hdr_manip_flags_t;
45592ffc1057SHemant Agrawal 		/**< A general type to define a HMan update command flags. */
45602ffc1057SHemant Agrawal 
45612ffc1057SHemant Agrawal typedef hdr_manip_flags_t	ipv_4hdr_manip_update_flags_t;
45622ffc1057SHemant Agrawal 		/**< IPv4 protocol HMan update command flags. */
45632ffc1057SHemant Agrawal 
45642ffc1057SHemant Agrawal #define HDR_MANIP_IPV4_TOS	0x80000000
45652ffc1057SHemant Agrawal 			/**< update TOS with the given value ('tos' field
45662ffc1057SHemant Agrawal 			 * of t_FmPcdManipHdrFieldUpdateIpv4)
45672ffc1057SHemant Agrawal 			 */
45682ffc1057SHemant Agrawal #define HDR_MANIP_IPV4_ID	0x40000000
45692ffc1057SHemant Agrawal 			/**< update IP ID with the given value ('id' field
45702ffc1057SHemant Agrawal 			 * of t_FmPcdManipHdrFieldUpdateIpv4)
45712ffc1057SHemant Agrawal 			 */
45722ffc1057SHemant Agrawal #define HDR_MANIP_IPV4_TTL	0x20000000
45732ffc1057SHemant Agrawal 			/**< Decrement TTL by 1 */
45742ffc1057SHemant Agrawal #define HDR_MANIP_IPV4_SRC	0x10000000
45752ffc1057SHemant Agrawal 			/**< update IP source address with the given value
45762ffc1057SHemant Agrawal 			 * ('src' field of t_FmPcdManipHdrFieldUpdateIpv4)
45772ffc1057SHemant Agrawal 			 */
45782ffc1057SHemant Agrawal #define HDR_MANIP_IPV4_DST	0x08000000
45792ffc1057SHemant Agrawal 			/**< update IP destination address with the given value
45802ffc1057SHemant Agrawal 			 * ('dst' field of t_FmPcdManipHdrFieldUpdateIpv4)
45812ffc1057SHemant Agrawal 			 */
45822ffc1057SHemant Agrawal 
45832ffc1057SHemant Agrawal typedef hdr_manip_flags_t	ipv_6hdr_manip_update_flags_t;
45842ffc1057SHemant Agrawal 			/**< IPv6 protocol HMan update command flags. */
45852ffc1057SHemant Agrawal 
45862ffc1057SHemant Agrawal #define HDR_MANIP_IPV6_TC	0x80000000
45872ffc1057SHemant Agrawal 			/**< update Traffic Class address with the given value
45882ffc1057SHemant Agrawal 			 * ('trafficClass' field of
45892ffc1057SHemant Agrawal 			 * t_FmPcdManipHdrFieldUpdateIpv6)
45902ffc1057SHemant Agrawal 			 */
45912ffc1057SHemant Agrawal #define HDR_MANIP_IPV6_HL	0x40000000
45922ffc1057SHemant Agrawal 			/**< Decrement Hop Limit by 1 */
45932ffc1057SHemant Agrawal #define HDR_MANIP_IPV6_SRC	0x20000000
45942ffc1057SHemant Agrawal 			/**< update IP source address with the given value
45952ffc1057SHemant Agrawal 			 * ('src' field of t_FmPcdManipHdrFieldUpdateIpv6)
45962ffc1057SHemant Agrawal 			 */
45972ffc1057SHemant Agrawal #define HDR_MANIP_IPV6_DST	0x10000000
45982ffc1057SHemant Agrawal 			/**< update IP destination address with the given value
45992ffc1057SHemant Agrawal 			 * ('dst' field of t_FmPcdManipHdrFieldUpdateIpv6)
46002ffc1057SHemant Agrawal 			 */
46012ffc1057SHemant Agrawal 
46022ffc1057SHemant Agrawal typedef hdr_manip_flags_t	tcp_udp_hdr_manip_update_flags_t;
46032ffc1057SHemant Agrawal 		/**< TCP/UDP protocol HMan update command flags. */
46042ffc1057SHemant Agrawal 
46052ffc1057SHemant Agrawal #define HDR_MANIP_TCP_UDP_SRC	0x80000000
46062ffc1057SHemant Agrawal 		/**< update TCP/UDP source address with the given value
46072ffc1057SHemant Agrawal 		 * ('src' field of t_FmPcdManipHdrFieldUpdateTcpUdp)
46082ffc1057SHemant Agrawal 		 */
46092ffc1057SHemant Agrawal #define HDR_MANIP_TCP_UDP_DST	0x40000000
46102ffc1057SHemant Agrawal 		/**< update TCP/UDP destination address with the given value
46112ffc1057SHemant Agrawal 		 * ('dst' field of t_FmPcdManipHdrFieldUpdateTcpUdp)
46122ffc1057SHemant Agrawal 		 */
46132ffc1057SHemant Agrawal #define HDR_MANIP_TCP_UDP_CHECKSUM  0x20000000
46142ffc1057SHemant Agrawal 		/**< update TCP/UDP checksum */
46152ffc1057SHemant Agrawal 
46162ffc1057SHemant Agrawal /* @} */
46172ffc1057SHemant Agrawal 
46182ffc1057SHemant Agrawal /*
46192ffc1057SHemant Agrawal  * @Description   A type used for returning the order of the key extraction.
46202ffc1057SHemant Agrawal  *		  each value in this array represents the index of the
46212ffc1057SHemant Agrawal  *		  extraction command as defined by the user in the
46222ffc1057SHemant Agrawal  *		  initialization extraction array. The valid size of this array
46232ffc1057SHemant Agrawal  *		  is the user define number of extractions required (also marked
46242ffc1057SHemant Agrawal  *		  by the second '0' in this array).
46252ffc1057SHemant Agrawal  */
46262ffc1057SHemant Agrawal typedef	uint8_t	t_fm_pcd_kg_key_order[FM_PCD_KG_MAX_NUM_OF_EXTRACTS_PER_KEY];
46272ffc1057SHemant Agrawal 
46282ffc1057SHemant Agrawal /*
46292ffc1057SHemant Agrawal  * @Collection	  Definitions for CC statistics
46302ffc1057SHemant Agrawal  */
46312ffc1057SHemant Agrawal #define FM_PCD_CC_STATS_MAX_NUM_OF_FLR	10
46322ffc1057SHemant Agrawal 	/* Maximal supported number of frame length ranges */
46332ffc1057SHemant Agrawal #define FM_PCD_CC_STATS_FLR_SIZE	2
46342ffc1057SHemant Agrawal 	/* Size in bytes of a frame length range limit */
46352ffc1057SHemant Agrawal #define FM_PCD_CC_STATS_COUNTER_SIZE	4
46362ffc1057SHemant Agrawal 	/* Size in bytes of a frame length range counter */
46372ffc1057SHemant Agrawal /* @} */
46382ffc1057SHemant Agrawal 
46392ffc1057SHemant Agrawal /*
46402ffc1057SHemant Agrawal  * @Description   Parameters for defining CC keys parameters
46412ffc1057SHemant Agrawal  *		  The driver supports two methods for CC node allocation:
46422ffc1057SHemant Agrawal  *		  dynamic and static. Static mode was created in order to
46432ffc1057SHemant Agrawal  *		  prevent runtime alloc/free of FMan memory (MURAM), which may
46442ffc1057SHemant Agrawal  *		  cause fragmentation; in this mode, the driver automatically
46452ffc1057SHemant Agrawal  *		  allocates the memory according to 'max_num_of_keys' parameter.
46462ffc1057SHemant Agrawal  *		  The driver calculates the maximal memory size that may be used
46472ffc1057SHemant Agrawal  *		  for this CC-Node taking into consideration 'mask_support' and
46482ffc1057SHemant Agrawal  *		  'statistics_mode' parameters. When 'action' =
46492ffc1057SHemant Agrawal  *		  e_FM_PCD_ACTION_INDEXED_LOOKUP in the extraction parameters of
46502ffc1057SHemant Agrawal  *		  this node, 'max_num_of_keys' must be equal to 'num_of_keys'.
46512ffc1057SHemant Agrawal  *		  In dynamic mode, 'max_num_of_keys' must be zero. At
46522ffc1057SHemant Agrawal  *		  initialization, all required structures are allocated
46532ffc1057SHemant Agrawal  *		  according to 'num_of_keys' parameter. During runtime
46542ffc1057SHemant Agrawal  *		  modification, these structures are re-allocated according to
46552ffc1057SHemant Agrawal  *		  the updated number of keys.
46562ffc1057SHemant Agrawal  *
46572ffc1057SHemant Agrawal  *		  Please note that 'action' and 'icIndxMask' mentioned in the
46582ffc1057SHemant Agrawal  *		  specific parameter explanations are passed in the extraction
46592ffc1057SHemant Agrawal  *		  parameters of the node (fields of
46602ffc1057SHemant Agrawal  *		  extractCcParams.extractNonHdr).
46612ffc1057SHemant Agrawal  */
46622ffc1057SHemant Agrawal typedef struct t_keys_params {
46632ffc1057SHemant Agrawal 	uint16_t	max_num_of_keys;
46642ffc1057SHemant Agrawal 		/**< Maximum number of keys that will (ever) be used in this
46652ffc1057SHemant Agrawal 		 * CC-Node; A value of zero may be used for dynamic memory
46662ffc1057SHemant Agrawal 		 * allocation.
46672ffc1057SHemant Agrawal 		 */
46682ffc1057SHemant Agrawal 	bool		mask_support;
46692ffc1057SHemant Agrawal 		/**< This parameter is relevant only if a node is initialized
46702ffc1057SHemant Agrawal 		 * with 'action' = e_FM_PCD_ACTION_EXACT_MATCH and
46712ffc1057SHemant Agrawal 		 * max_num_of_keys > 0; Should be TRUE to reserve table memory
46722ffc1057SHemant Agrawal 		 * for key masks, even if initial keys do not contain masks, or
46732ffc1057SHemant Agrawal 		 * if the node was initialized as 'empty' (without keys); this
46742ffc1057SHemant Agrawal 		 * will allow user to add keys with masks at runtime.
46752ffc1057SHemant Agrawal 		 * NOTE that if user want to use only global-masks (i.e. one
46762ffc1057SHemant Agrawal 		 * common mask for all the entries within this table, this
46772ffc1057SHemant Agrawal 		 * parameter should set to 'FALSE'.
46782ffc1057SHemant Agrawal 		 */
46792ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_stats_mode	statistics_mode;
46802ffc1057SHemant Agrawal 		/**< Determines the supported statistics mode for all node's
46812ffc1057SHemant Agrawal 		 * keys. To enable statistics gathering, statistics should be
46822ffc1057SHemant Agrawal 		 * enabled per every key, using 'statisticsEn' in next engine
46832ffc1057SHemant Agrawal 		 * parameters structure of that key; If 'max_num_of_keys' is
46842ffc1057SHemant Agrawal 		 * set, all required structures will be preallocated for all
46852ffc1057SHemant Agrawal 		 * keys.
46862ffc1057SHemant Agrawal 		 */
46872ffc1057SHemant Agrawal 	uint16_t	frame_length_ranges[FM_PCD_CC_STATS_MAX_NUM_OF_FLR];
46882ffc1057SHemant Agrawal 		/**< Relevant only for 'RMON' statistics mode (this feature is
46892ffc1057SHemant Agrawal 		 * supported only on B4860 device); Holds a list of programmable
46902ffc1057SHemant Agrawal 		 * thresholds - for each received frame, its length in bytes is
46912ffc1057SHemant Agrawal 		 * examined against these range thresholds and the appropriate
46922ffc1057SHemant Agrawal 		 * counter is incremented by 1 - for example, to belong to range
46932ffc1057SHemant Agrawal 		 * i, the following should hold: range i-1 threshold < frame
46942ffc1057SHemant Agrawal 		 * length <= range i threshold. Each range threshold must be
46952ffc1057SHemant Agrawal 		 * larger then its preceding range threshold, and last range
46962ffc1057SHemant Agrawal 		 * threshold must be 0xFFFF.
46972ffc1057SHemant Agrawal 		 */
46982ffc1057SHemant Agrawal 	uint16_t	num_of_keys;
46992ffc1057SHemant Agrawal 		/**< Number of initial keys; Note that in case of 'action' =
47002ffc1057SHemant Agrawal 		 * e_FM_PCD_ACTION_INDEXED_LOOKUP, this field should be
47012ffc1057SHemant Agrawal 		 * power-of-2 of the number of bits that are set in 'icIndxMask'
47022ffc1057SHemant Agrawal 		 */
47032ffc1057SHemant Agrawal 	uint8_t		key_size;
47042ffc1057SHemant Agrawal 		/**< Size of key - for extraction of type FULL_FIELD, 'key_size'
47052ffc1057SHemant Agrawal 		 * has to be the standard size of the selected key; For other
47062ffc1057SHemant Agrawal 		 * extraction types, 'key_size' has to be as size of extraction;
47072ffc1057SHemant Agrawal 		 * When 'action' = e_FM_PCD_ACTION_INDEXED_LOOKUP, 'key_size'
47082ffc1057SHemant Agrawal 		 * must be 2.
47092ffc1057SHemant Agrawal 		 */
47102ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_key_params_t	key_params[FM_PCD_MAX_NUM_OF_KEYS];
47112ffc1057SHemant Agrawal 		/**< An array with 'num_of_keys' entries, each entry specifies
47122ffc1057SHemant Agrawal 		 * the corresponding key parameters; When 'action' =
47132ffc1057SHemant Agrawal 		 * e_FM_PCD_ACTION_EXACT_MATCH, this value must not exceed 255
47142ffc1057SHemant Agrawal 		 * (FM_PCD_MAX_NUM_OF_KEYS-1) as the last entry is saved for the
47152ffc1057SHemant Agrawal 		 * 'miss' entry.
47162ffc1057SHemant Agrawal 		 */
47172ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_next_engine_params_t   cc_next_engine_params_for_miss;
47182ffc1057SHemant Agrawal 		/**< Parameters for defining the next engine when a key is not
47192ffc1057SHemant Agrawal 		 * matched; Not relevant if action =
47202ffc1057SHemant Agrawal 		 * e_FM_PCD_ACTION_INDEXED_LOOKUP.
47212ffc1057SHemant Agrawal 		 */
47222ffc1057SHemant Agrawal } t_keys_params;
47232ffc1057SHemant Agrawal 
47242ffc1057SHemant Agrawal /*
47252ffc1057SHemant Agrawal  * @Description   Parameters for defining custom header manipulation for generic
47262ffc1057SHemant Agrawal  *		  field replacement
47272ffc1057SHemant Agrawal  */
47282ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_manip_hdr_custom_gen_field_replace {
47292ffc1057SHemant Agrawal 	uint8_t		src_offset;
47302ffc1057SHemant Agrawal 			/**< Location of new data - Offset from Parse Result
47312ffc1057SHemant Agrawal 			 * (>= 16, src_offset+size <= 32, )
47322ffc1057SHemant Agrawal 			 */
47332ffc1057SHemant Agrawal 	uint8_t		dst_offset;
47342ffc1057SHemant Agrawal 			/**< Location of data to be overwritten - Offset from
47352ffc1057SHemant Agrawal 			 * start of frame (dst_offset + size <= 256).
47362ffc1057SHemant Agrawal 			 */
47372ffc1057SHemant Agrawal 	uint8_t		size;
47382ffc1057SHemant Agrawal 			/**< The number of bytes (<=16) to be replaced */
47392ffc1057SHemant Agrawal 	uint8_t		mask;
47402ffc1057SHemant Agrawal 			/**< Optional 1 byte mask. Set to select bits for
47412ffc1057SHemant Agrawal 			 * replacement (1 - bit will be replaced); Clear to use
47422ffc1057SHemant Agrawal 			 * field as is.
47432ffc1057SHemant Agrawal 			 */
47442ffc1057SHemant Agrawal 	uint8_t		mask_offset;
47452ffc1057SHemant Agrawal 			/**< Relevant if mask != 0; Mask offset within the
47462ffc1057SHemant Agrawal 			 * replaces "size"
47472ffc1057SHemant Agrawal 			 */
47482ffc1057SHemant Agrawal } ioc_fm_pcd_manip_hdr_custom_gen_field_replace;
47492ffc1057SHemant Agrawal 
47502ffc1057SHemant Agrawal /*
47512ffc1057SHemant Agrawal  * @Function	  fm_pcd_net_env_characteristics_set
47522ffc1057SHemant Agrawal  *
47532ffc1057SHemant Agrawal  * @Description   Define a set of Network Environment Characteristics.
47542ffc1057SHemant Agrawal  *
47552ffc1057SHemant Agrawal  *		  When setting an environment it is important to understand its
47562ffc1057SHemant Agrawal  *		  application. It is not meant to describe the flows that will
47572ffc1057SHemant Agrawal  *		  run on the ports using this environment, but what the user
47582ffc1057SHemant Agrawal  *		  means TO DO with the PCD mechanisms in order to
47592ffc1057SHemant Agrawal  *		  parse-classify-distribute those frames.
47602ffc1057SHemant Agrawal  *		  By specifying a distinction unit, the user means it would use
47612ffc1057SHemant Agrawal  *		  that option for distinction between frames at either a KeyGen
47622ffc1057SHemant Agrawal  *		  scheme or a coarse classification action descriptor. Using
47632ffc1057SHemant Agrawal  *		  interchangeable headers to define a unit means that the user
47642ffc1057SHemant Agrawal  *		  is indifferent to which of the interchangeable headers is
47652ffc1057SHemant Agrawal  *		  present in the frame, and wants the distinction to be based on
47662ffc1057SHemant Agrawal  *		  the presence of either one of them.
47672ffc1057SHemant Agrawal  *
47682ffc1057SHemant Agrawal  *		  Depending on context, there are limitations to the use of
47692ffc1057SHemant Agrawal  *		  environments. A port using the PCD functionality is bound to
47702ffc1057SHemant Agrawal  *		  an environment. Some or even all ports may share an
47712ffc1057SHemant Agrawal  *		  environment but also an environment per port is possible. When
47722ffc1057SHemant Agrawal  *		  initializing a scheme, a classification plan group (see
47732ffc1057SHemant Agrawal  *		  below), or a coarse classification tree, one of the
47742ffc1057SHemant Agrawal  *		  initialized environments must be stated and related to. When a
47752ffc1057SHemant Agrawal  *		  port is bound to a scheme, a classification plan group, or a
47762ffc1057SHemant Agrawal  *		  coarse classification tree, it MUST be bound to the same
47772ffc1057SHemant Agrawal  *		  environment.
47782ffc1057SHemant Agrawal  *
47792ffc1057SHemant Agrawal  *		  The different PCD modules, may relate (for flows definition)
47802ffc1057SHemant Agrawal  *		  ONLY on distinction units as defined by their environment.
47812ffc1057SHemant Agrawal  *		  When initializing a scheme for example, it may not choose to
47822ffc1057SHemant Agrawal  *		  select IPV4 as a match for recognizing flows unless it was
47832ffc1057SHemant Agrawal  *		  defined in the relating environment. In fact, to guide the
47842ffc1057SHemant Agrawal  *		  user through the configuration of the PCD, each module's
47852ffc1057SHemant Agrawal  *		  characterization in terms of flows is not done using protocol
47862ffc1057SHemant Agrawal  *		  names, but using environment indexes.
47872ffc1057SHemant Agrawal  *
47882ffc1057SHemant Agrawal  *		  In terms of HW implementation, the list of distinction units
47892ffc1057SHemant Agrawal  *		  sets the LCV vectors and later used for match vector,
47902ffc1057SHemant Agrawal  *		  classification plan vectors and coarse classification
47912ffc1057SHemant Agrawal  *		  indexing.
47922ffc1057SHemant Agrawal  *
47932ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd		FM PCD module descriptor.
47942ffc1057SHemant Agrawal  * @Param[in]	  p_netenv_params	A structure of parameters for the
47952ffc1057SHemant Agrawal  *					initialization of the network
47962ffc1057SHemant Agrawal  *					environment.
47972ffc1057SHemant Agrawal  *
47982ffc1057SHemant Agrawal  * @Return	  A handle to the initialized object on success; NULL code
47992ffc1057SHemant Agrawal  *		  otherwise.
48002ffc1057SHemant Agrawal  *
48012ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
48022ffc1057SHemant Agrawal  */
48032ffc1057SHemant Agrawal t_handle fm_pcd_net_env_characteristics_set(t_handle h_fm_pcd,
48042ffc1057SHemant Agrawal 				 ioc_fm_pcd_net_env_params_t *p_netenv_params);
48052ffc1057SHemant Agrawal 
48062ffc1057SHemant Agrawal /*
48072ffc1057SHemant Agrawal  * @Function	  fm_pcd_net_env_characteristics_delete
48082ffc1057SHemant Agrawal  *
48092ffc1057SHemant Agrawal  * @Description   Deletes a set of Network Environment Characteristics.
48102ffc1057SHemant Agrawal  *
48112ffc1057SHemant Agrawal  * @Param[in]	  h_net_env	A handle to the Network environment.
48122ffc1057SHemant Agrawal  *
48132ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
48142ffc1057SHemant Agrawal  */
48152ffc1057SHemant Agrawal uint32_t fm_pcd_net_env_characteristics_delete(t_handle h_net_env);
48162ffc1057SHemant Agrawal 
48172ffc1057SHemant Agrawal /*
48182ffc1057SHemant Agrawal  * @Function	  fm_pcd_kg_scheme_set
48192ffc1057SHemant Agrawal  *
48202ffc1057SHemant Agrawal  * @Description   Initializing or modifying and enabling a scheme for the
48212ffc1057SHemant Agrawal  *		  KeyGen. This routine should be called for adding or modifying
48222ffc1057SHemant Agrawal  *		  a scheme. When a scheme needs modifying, the API requires that
48232ffc1057SHemant Agrawal  *		  it will be rewritten. In such a case 'modify' should be TRUE.
48242ffc1057SHemant Agrawal  *		  If the routine is called for a valid scheme and 'modify' is
48252ffc1057SHemant Agrawal  *		  FALSE, it will return error.
48262ffc1057SHemant Agrawal  *
48272ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd		If this is a new scheme - A handle to an
48282ffc1057SHemant Agrawal  *					FM PCD Module. Otherwise NULL (ignored
48292ffc1057SHemant Agrawal  *					by driver).
48302ffc1057SHemant Agrawal  * @Param[in,out] p_scheme_params	A structure of parameters for defining
48312ffc1057SHemant Agrawal  *					the scheme
48322ffc1057SHemant Agrawal  *
48332ffc1057SHemant Agrawal  * @Return	  A handle to the initialized scheme on success; NULL code
48342ffc1057SHemant Agrawal  *		  otherwise. When used as "modify" (rather than for setting a
48352ffc1057SHemant Agrawal  *		  new scheme), p_scheme_params->id.h_scheme will return NULL if
48362ffc1057SHemant Agrawal  *		  action fails due to scheme BUSY state.
48372ffc1057SHemant Agrawal  *
48382ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
48392ffc1057SHemant Agrawal  */
48402ffc1057SHemant Agrawal t_handle fm_pcd_kg_scheme_set(t_handle h_fm_pcd,
48412ffc1057SHemant Agrawal 			    ioc_fm_pcd_kg_scheme_params_t *p_scheme_params);
48422ffc1057SHemant Agrawal 
48432ffc1057SHemant Agrawal /*
48442ffc1057SHemant Agrawal  * @Function	  fm_pcd_kg_scheme_delete
48452ffc1057SHemant Agrawal  *
48462ffc1057SHemant Agrawal  * @Description   Deleting an initialized scheme.
48472ffc1057SHemant Agrawal  *
48482ffc1057SHemant Agrawal  * @Param[in]	  h_scheme	scheme handle as returned by
48492ffc1057SHemant Agrawal  *				fm_pcd_kg_scheme_set()
48502ffc1057SHemant Agrawal  *
48512ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
48522ffc1057SHemant Agrawal  *
48532ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init() & fm_pcd_kg_scheme_set().
48542ffc1057SHemant Agrawal  */
48552ffc1057SHemant Agrawal uint32_t	fm_pcd_kg_scheme_delete(t_handle h_scheme);
48562ffc1057SHemant Agrawal 
48572ffc1057SHemant Agrawal /*
48582ffc1057SHemant Agrawal  * @Function	  fm_pcd_kg_scheme_get_counter
48592ffc1057SHemant Agrawal  *
48602ffc1057SHemant Agrawal  * @Description   Reads scheme packet counter.
48612ffc1057SHemant Agrawal  *
48622ffc1057SHemant Agrawal  * @Param[in]	  h_scheme	scheme handle as returned by
48632ffc1057SHemant Agrawal  *				fm_pcd_kg_scheme_set().
48642ffc1057SHemant Agrawal  *
48652ffc1057SHemant Agrawal  * @Return	  Counter's current value.
48662ffc1057SHemant Agrawal  *
48672ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init() & fm_pcd_kg_scheme_set().
48682ffc1057SHemant Agrawal  */
48692ffc1057SHemant Agrawal uint32_t  fm_pcd_kg_scheme_get_counter(t_handle h_scheme);
48702ffc1057SHemant Agrawal 
48712ffc1057SHemant Agrawal /*
48722ffc1057SHemant Agrawal  * @Function	  fm_pcd_kg_scheme_set_counter
48732ffc1057SHemant Agrawal  *
48742ffc1057SHemant Agrawal  * @Description   Writes scheme packet counter.
48752ffc1057SHemant Agrawal  *
48762ffc1057SHemant Agrawal  * @Param[in]	  h_scheme	scheme handle as returned by
48772ffc1057SHemant Agrawal  *				fm_pcd_kg_scheme_set().
48782ffc1057SHemant Agrawal  * @Param[in]	  value		New scheme counter value - typically '0' for
48792ffc1057SHemant Agrawal  *				resetting the counter.
48802ffc1057SHemant Agrawal  *
48812ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
48822ffc1057SHemant Agrawal  *
48832ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init() & fm_pcd_kg_scheme_set().
48842ffc1057SHemant Agrawal  */
48852ffc1057SHemant Agrawal uint32_t  fm_pcd_kg_scheme_set_counter(t_handle h_scheme,
48862ffc1057SHemant Agrawal 			uint32_t value);
48872ffc1057SHemant Agrawal 
48882ffc1057SHemant Agrawal /*
48892ffc1057SHemant Agrawal  * @Function	  fm_pcd_plcr_profile_set
48902ffc1057SHemant Agrawal  *
48912ffc1057SHemant Agrawal  * @Description   Sets a profile entry in the policer profile table.
48922ffc1057SHemant Agrawal  *		  The routine overrides any existing value.
48932ffc1057SHemant Agrawal  *
48942ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	A handle to an FM PCD Module.
48952ffc1057SHemant Agrawal  * @Param[in]	  p_profile	A structure of parameters for defining a
48962ffc1057SHemant Agrawal  *				policer profile entry.
48972ffc1057SHemant Agrawal  *
48982ffc1057SHemant Agrawal  * @Return	  A handle to the initialized object on success; NULL code
48992ffc1057SHemant Agrawal  *		  otherwise. When used as "modify" (rather than for setting a
49002ffc1057SHemant Agrawal  *		  new profile), p_profile->id.h_profile will return NULL if
49012ffc1057SHemant Agrawal  *		  action fails due to profile BUSY state.
49022ffc1057SHemant Agrawal  *
49032ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
49042ffc1057SHemant Agrawal  */
49052ffc1057SHemant Agrawal t_handle fm_pcd_plcr_profile_set(t_handle h_fm_pcd,
49062ffc1057SHemant Agrawal 			       ioc_fm_pcd_plcr_profile_params_t  *p_profile);
49072ffc1057SHemant Agrawal 
49082ffc1057SHemant Agrawal /*
49092ffc1057SHemant Agrawal  * @Function	  fm_pcd_plcr_profile_delete
49102ffc1057SHemant Agrawal  *
49112ffc1057SHemant Agrawal  * @Description   Delete a profile entry in the policer profile table.
49122ffc1057SHemant Agrawal  *		  The routine set entry to invalid.
49132ffc1057SHemant Agrawal  *
49142ffc1057SHemant Agrawal  * @Param[in]	  h_profile	A handle to the profile.
49152ffc1057SHemant Agrawal  *
49162ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
49172ffc1057SHemant Agrawal  *
49182ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
49192ffc1057SHemant Agrawal  */
49202ffc1057SHemant Agrawal uint32_t fm_pcd_plcr_profile_delete(t_handle h_profile);
49212ffc1057SHemant Agrawal 
49222ffc1057SHemant Agrawal /*
49232ffc1057SHemant Agrawal  * @Function	  fm_pcd_plcr_profile_get_counter
49242ffc1057SHemant Agrawal  *
49252ffc1057SHemant Agrawal  * @Description   Sets an entry in the classification plan.
49262ffc1057SHemant Agrawal  *		  The routine overrides any existing value.
49272ffc1057SHemant Agrawal  *
49282ffc1057SHemant Agrawal  * @Param[in]	  h_profile	A handle to the profile.
49292ffc1057SHemant Agrawal  * @Param[in]	  counter	Counter selector.
49302ffc1057SHemant Agrawal  *
49312ffc1057SHemant Agrawal  * @Return	  specific counter value.
49322ffc1057SHemant Agrawal  *
49332ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
49342ffc1057SHemant Agrawal  */
49352ffc1057SHemant Agrawal uint32_t fm_pcd_plcr_profile_get_counter(t_handle	h_profile,
49362ffc1057SHemant Agrawal 			ioc_fm_pcd_plcr_profile_counters	counter);
49372ffc1057SHemant Agrawal 
49382ffc1057SHemant Agrawal /*
49392ffc1057SHemant Agrawal  * @Function	  fm_pcd_plcr_profile_set_counter
49402ffc1057SHemant Agrawal  *
49412ffc1057SHemant Agrawal  * @Description   Sets an entry in the classification plan.
49422ffc1057SHemant Agrawal  *		  The routine overrides any existing value.
49432ffc1057SHemant Agrawal  *
49442ffc1057SHemant Agrawal  * @Param[in]	  h_profile	A handle to the profile.
49452ffc1057SHemant Agrawal  * @Param[in]	  counter	Counter selector.
49462ffc1057SHemant Agrawal  * @Param[in]	  value		value to set counter with.
49472ffc1057SHemant Agrawal  *
49482ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
49492ffc1057SHemant Agrawal  *
49502ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
49512ffc1057SHemant Agrawal  */
49522ffc1057SHemant Agrawal uint32_t fm_pcd_plcr_profile_set_counter(t_handle h_profile,
49532ffc1057SHemant Agrawal 				      ioc_fm_pcd_plcr_profile_counters counter,
49542ffc1057SHemant Agrawal 					uint32_t		value);
49552ffc1057SHemant Agrawal 
49562ffc1057SHemant Agrawal /*
49572ffc1057SHemant Agrawal  * @Function	  fm_pcd_cc_root_build
49582ffc1057SHemant Agrawal  *
49592ffc1057SHemant Agrawal  * @Description   This routine must be called to define a complete coarse
49602ffc1057SHemant Agrawal  *		  classification tree. This is the way to define coarse
49612ffc1057SHemant Agrawal  *		  classification to a certain flow - the KeyGen schemes may
49622ffc1057SHemant Agrawal  *		  point only to trees defined in this way.
49632ffc1057SHemant Agrawal  *
49642ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
49652ffc1057SHemant Agrawal  * @Param[in]	  p_params	A structure of parameters to define the tree.
49662ffc1057SHemant Agrawal  *
49672ffc1057SHemant Agrawal  * @Return	  A handle to the initialized object on success; NULL code
49682ffc1057SHemant Agrawal  *		  otherwise.
49692ffc1057SHemant Agrawal  *
49702ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
49712ffc1057SHemant Agrawal  */
49722ffc1057SHemant Agrawal t_handle fm_pcd_cc_root_build(t_handle h_fm_pcd,
49732ffc1057SHemant Agrawal 			     ioc_fm_pcd_cc_tree_params_t  *p_params);
49742ffc1057SHemant Agrawal 
49752ffc1057SHemant Agrawal /*
49762ffc1057SHemant Agrawal  * @Function	  fm_pcd_cc_root_delete
49772ffc1057SHemant Agrawal  *
49782ffc1057SHemant Agrawal  * @Description   Deleting an built tree.
49792ffc1057SHemant Agrawal  *
49802ffc1057SHemant Agrawal  * @Param[in]	  h_cc_tree	A handle to a CC tree.
49812ffc1057SHemant Agrawal  *
49822ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
49832ffc1057SHemant Agrawal  *
49842ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
49852ffc1057SHemant Agrawal  */
49862ffc1057SHemant Agrawal uint32_t fm_pcd_cc_root_delete(t_handle h_cc_tree);
49872ffc1057SHemant Agrawal 
49882ffc1057SHemant Agrawal /*
49892ffc1057SHemant Agrawal  * @Function	  fm_pcd_cc_root_modify_next_engine
49902ffc1057SHemant Agrawal  *
49912ffc1057SHemant Agrawal  * @Description   Modify the Next Engine Parameters in the entry of the tree.
49922ffc1057SHemant Agrawal  *
49932ffc1057SHemant Agrawal  * @Param[in]	  h_cc_tree			A handle to the tree
49942ffc1057SHemant Agrawal  * @Param[in]	  grp_id			A Group index in the tree
49952ffc1057SHemant Agrawal  * @Param[in]	  index				Entry index in the group
49962ffc1057SHemant Agrawal  *						defined by grp_id
49972ffc1057SHemant Agrawal  * @Param[in]	  p_fm_pcd_cc_next_engine	Pointer to new next
49982ffc1057SHemant Agrawal  *						engine parameters
49992ffc1057SHemant Agrawal  *
50002ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
50012ffc1057SHemant Agrawal  *
50022ffc1057SHemant Agrawal  * @Cautions	  Allowed only following FM_PCD_CcBuildTree().
50032ffc1057SHemant Agrawal  */
50042ffc1057SHemant Agrawal uint32_t fm_pcd_cc_root_modify_next_engine(t_handle h_cc_tree,
50052ffc1057SHemant Agrawal 		uint8_t		grp_id,
50062ffc1057SHemant Agrawal 		uint8_t		index,
50072ffc1057SHemant Agrawal 		ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine);
50082ffc1057SHemant Agrawal 
50092ffc1057SHemant Agrawal /*
50102ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_set
50112ffc1057SHemant Agrawal  *
50122ffc1057SHemant Agrawal  * @Description   This routine should be called for each CC (coarse
50132ffc1057SHemant Agrawal  *		  classification) node. The whole CC tree should be built bottom
50142ffc1057SHemant Agrawal  *		  up so that each node points to already defined nodes.
50152ffc1057SHemant Agrawal  *
50162ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
50172ffc1057SHemant Agrawal  * @Param[in]	  p_param	A structure of parameters defining the CC node
50182ffc1057SHemant Agrawal  *
50192ffc1057SHemant Agrawal  * @Return	  A handle to the initialized object on success; NULL code
50202ffc1057SHemant Agrawal  *		  otherwise.
50212ffc1057SHemant Agrawal  *
50222ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
50232ffc1057SHemant Agrawal  */
50242ffc1057SHemant Agrawal t_handle   fm_pcd_match_table_set(t_handle h_fm_pcd,
50252ffc1057SHemant Agrawal 		ioc_fm_pcd_cc_node_params_t *p_param);
50262ffc1057SHemant Agrawal 
50272ffc1057SHemant Agrawal /*
50282ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_delete
50292ffc1057SHemant Agrawal  *
50302ffc1057SHemant Agrawal  * @Description   Deleting an built node.
50312ffc1057SHemant Agrawal  *
50322ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node	A handle to a CC node.
50332ffc1057SHemant Agrawal  *
50342ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
50352ffc1057SHemant Agrawal  *
50362ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
50372ffc1057SHemant Agrawal  */
50382ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_delete(t_handle h_cc_node);
50392ffc1057SHemant Agrawal 
50402ffc1057SHemant Agrawal /*
50412ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_modify_miss_next_engine
50422ffc1057SHemant Agrawal  *
50432ffc1057SHemant Agrawal  * @Description   Modify the Next Engine Parameters of the Miss key case of the
50442ffc1057SHemant Agrawal  *		  node.
50452ffc1057SHemant Agrawal  *
50462ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node				A handle to the node
50472ffc1057SHemant Agrawal  * @Param[in]	  p_fm_pcd_cc_next_engine_params	Parameters for defining
50482ffc1057SHemant Agrawal  *							next engine
50492ffc1057SHemant Agrawal  *
50502ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
50512ffc1057SHemant Agrawal  *
50522ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set(); Not
50532ffc1057SHemant Agrawal  *		  relevant in the case the node is of type 'INDEXED_LOOKUP'.
50542ffc1057SHemant Agrawal  *		  When configuring nextEngine = e_FM_PCD_CC, note that
50552ffc1057SHemant Agrawal  *		  p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
50562ffc1057SHemant Agrawal  *		  different from the currently changed table.
50572ffc1057SHemant Agrawal  *
50582ffc1057SHemant Agrawal  */
50592ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_modify_miss_next_engine(t_handle h_cc_node,
50602ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine_params);
50612ffc1057SHemant Agrawal 
50622ffc1057SHemant Agrawal /*
50632ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_remove_key
50642ffc1057SHemant Agrawal  *
50652ffc1057SHemant Agrawal  * @Description   Remove the key (including next engine parameters of this key)
50662ffc1057SHemant Agrawal  *		  defined by the index of the relevant node.
50672ffc1057SHemant Agrawal  *
50682ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node	A handle to the node
50692ffc1057SHemant Agrawal  * @Param[in]	  key_index	Key index for removing
50702ffc1057SHemant Agrawal  *
50712ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
50722ffc1057SHemant Agrawal  *
50732ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set() was called for
50742ffc1057SHemant Agrawal  *		  this node and the nodes that lead to it.
50752ffc1057SHemant Agrawal  */
50762ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_remove_key(t_handle h_cc_node,
50772ffc1057SHemant Agrawal 			uint16_t key_index);
50782ffc1057SHemant Agrawal 
50792ffc1057SHemant Agrawal /*
50802ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_add_key
50812ffc1057SHemant Agrawal  *
50822ffc1057SHemant Agrawal  * @Description   Add the key (including next engine parameters of this key in
50832ffc1057SHemant Agrawal  *		  the index defined by the key_index. Note that
50842ffc1057SHemant Agrawal  *		  'FM_PCD_LAST_KEY_INDEX' may be used by user that don't care
50852ffc1057SHemant Agrawal  *		  about the position of the key in the table - in that case, the
50862ffc1057SHemant Agrawal  *		  key will be automatically added by the driver in the last
50872ffc1057SHemant Agrawal  *		  available entry.
50882ffc1057SHemant Agrawal  *
50892ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node	A handle to the node
50902ffc1057SHemant Agrawal  * @Param[in]	  key_index	Key index for adding.
50912ffc1057SHemant Agrawal  * @Param[in]	  key_size	Key size of added key
50922ffc1057SHemant Agrawal  * @Param[in]	  p_key_params	A pointer to the parameters includes new key
50932ffc1057SHemant Agrawal  *				with Next Engine Parameters
50942ffc1057SHemant Agrawal  *
50952ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
50962ffc1057SHemant Agrawal  *
50972ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set() was called for
50982ffc1057SHemant Agrawal  *		  this node and the nodes that lead to it.
50992ffc1057SHemant Agrawal  */
51002ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_add_key(t_handle h_cc_node,
51012ffc1057SHemant Agrawal 				uint16_t		key_index,
51022ffc1057SHemant Agrawal 				uint8_t		key_size,
51032ffc1057SHemant Agrawal 				ioc_fm_pcd_cc_key_params_t  *p_key_params);
51042ffc1057SHemant Agrawal 
51052ffc1057SHemant Agrawal /*
51062ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_modify_next_engine
51072ffc1057SHemant Agrawal  *
51082ffc1057SHemant Agrawal  * @Description   Modify the Next Engine Parameters in the relevant key entry of
51092ffc1057SHemant Agrawal  *		  the node.
51102ffc1057SHemant Agrawal  *
51112ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node			A handle to the node
51122ffc1057SHemant Agrawal  * @Param[in]	  key_index			Key index for Next
51132ffc1057SHemant Agrawal  *						Engine modifications
51142ffc1057SHemant Agrawal  * @Param[in]	  p_fm_pcd_cc_next_engine	Parameters for defining
51152ffc1057SHemant Agrawal  *						next engine
51162ffc1057SHemant Agrawal  *
51172ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
51182ffc1057SHemant Agrawal  *
51192ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set(). When
51202ffc1057SHemant Agrawal  *		  configuring nextEngine = e_FM_PCD_CC, note that
51212ffc1057SHemant Agrawal  *		  p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
51222ffc1057SHemant Agrawal  *		  different from the currently changed table.
51232ffc1057SHemant Agrawal  *
51242ffc1057SHemant Agrawal  */
51252ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_modify_next_engine(t_handle h_cc_node,
51262ffc1057SHemant Agrawal 		uint16_t		key_index,
51272ffc1057SHemant Agrawal 		ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine);
51282ffc1057SHemant Agrawal 
51292ffc1057SHemant Agrawal /*
51302ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_modify_key_and_next_engine
51312ffc1057SHemant Agrawal  *
51322ffc1057SHemant Agrawal  * @Description   Modify the key and Next Engine Parameters of this key in the
51332ffc1057SHemant Agrawal  *		  index defined by the key_index.
51342ffc1057SHemant Agrawal  *
51352ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node		A handle to the node
51362ffc1057SHemant Agrawal  * @Param[in]	  key_index		Key index for adding
51372ffc1057SHemant Agrawal  * @Param[in]	  key_size		Key size of added key
51382ffc1057SHemant Agrawal  * @Param[in]	  p_key_params		A pointer to the parameters includes
51392ffc1057SHemant Agrawal  *					modified key and modified Next Engine
51402ffc1057SHemant Agrawal  *					Params
51412ffc1057SHemant Agrawal  *
51422ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
51432ffc1057SHemant Agrawal  *
51442ffc1057SHemant Agrawal  * @Cautions	Allowed only following fm_pcd_match_table_set() was called for
51452ffc1057SHemant Agrawal  *		this node and the nodes that lead to it. When configuring
51462ffc1057SHemant Agrawal  *		nextEngine = e_FM_PCD_CC, note that
51472ffc1057SHemant Agrawal  *		p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
51482ffc1057SHemant Agrawal  *		different from the currently changed table.
51492ffc1057SHemant Agrawal  */
51502ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_modify_key_and_next_engine(t_handle h_cc_node,
51512ffc1057SHemant Agrawal 				uint16_t		key_index,
51522ffc1057SHemant Agrawal 				uint8_t		key_size,
51532ffc1057SHemant Agrawal 				ioc_fm_pcd_cc_key_params_t  *p_key_params);
51542ffc1057SHemant Agrawal 
51552ffc1057SHemant Agrawal /*
51562ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_modify_key
51572ffc1057SHemant Agrawal  *
51582ffc1057SHemant Agrawal  * @Description   Modify the key in the index defined by the key_index.
51592ffc1057SHemant Agrawal  *
51602ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node		A handle to the node
51612ffc1057SHemant Agrawal  * @Param[in]	  key_index		Key index for adding
51622ffc1057SHemant Agrawal  * @Param[in]	  key_size		Key size of added key
51632ffc1057SHemant Agrawal  * @Param[in]	  p_key			A pointer to the new key
51642ffc1057SHemant Agrawal  * @Param[in]	  p_mask		A pointer to the new mask if relevant,
51652ffc1057SHemant Agrawal  *					otherwise pointer to NULL
51662ffc1057SHemant Agrawal  *
51672ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
51682ffc1057SHemant Agrawal  *
51692ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set() was called for
51702ffc1057SHemant Agrawal  *		  this node and the nodes that lead to it.
51712ffc1057SHemant Agrawal  */
51722ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_modify_key(t_handle h_cc_node,
51732ffc1057SHemant Agrawal 				uint16_t key_index,
51742ffc1057SHemant Agrawal 				uint8_t  key_size,
51752ffc1057SHemant Agrawal 				uint8_t  *p_key,
51762ffc1057SHemant Agrawal 				uint8_t  *p_mask);
51772ffc1057SHemant Agrawal 
51782ffc1057SHemant Agrawal /*
51792ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_find_nremove_key
51802ffc1057SHemant Agrawal  *
51812ffc1057SHemant Agrawal  * @Description   Remove the key (including next engine parameters of this key)
51822ffc1057SHemant Agrawal  *		  defined by the key and mask. Note that this routine will
51832ffc1057SHemant Agrawal  *		  search the node to locate the index of the required key
51842ffc1057SHemant Agrawal  *		  (& mask) to remove.
51852ffc1057SHemant Agrawal  *
51862ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node	A handle to the node
51872ffc1057SHemant Agrawal  * @Param[in]	  key_size	Key size of the one to remove.
51882ffc1057SHemant Agrawal  * @Param[in]	  p_key		A pointer to the requested key to remove.
51892ffc1057SHemant Agrawal  * @Param[in]	  p_mask	A pointer to the mask if relevant,
51902ffc1057SHemant Agrawal  *				otherwise pointer to NULL
51912ffc1057SHemant Agrawal  *
51922ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
51932ffc1057SHemant Agrawal  *
51942ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set() was called for
51952ffc1057SHemant Agrawal  *		  this node and the nodes that lead to it.
51962ffc1057SHemant Agrawal  */
51972ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_find_nremove_key(t_handle h_cc_node,
51982ffc1057SHemant Agrawal 					uint8_t  key_size,
51992ffc1057SHemant Agrawal 					uint8_t  *p_key,
52002ffc1057SHemant Agrawal 					uint8_t  *p_mask);
52012ffc1057SHemant Agrawal 
52022ffc1057SHemant Agrawal /*
52032ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_find_nmodify_next_engine
52042ffc1057SHemant Agrawal  *
52052ffc1057SHemant Agrawal  * @Description   Modify the Next Engine Parameters in the relevant key entry of
52062ffc1057SHemant Agrawal  *		  the node. Note that this routine will search the node to
52072ffc1057SHemant Agrawal  *		  locate the index of the required key (& mask) to modify.
52082ffc1057SHemant Agrawal  *
52092ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node		A handle to the node
52102ffc1057SHemant Agrawal  * @Param[in]	  key_size		Key size of the one to modify.
52112ffc1057SHemant Agrawal  * @Param[in]	  p_key			A pointer to the requested key to modify
52122ffc1057SHemant Agrawal  * @Param[in]	  p_mask		A pointer to the mask if relevant,
52132ffc1057SHemant Agrawal  *					otherwise pointer to NULL
52142ffc1057SHemant Agrawal  * @Param[in]	  p_fm_pcd_cc_next_engine	Parameters for defining
52152ffc1057SHemant Agrawal  *							next engine
52162ffc1057SHemant Agrawal  *
52172ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
52182ffc1057SHemant Agrawal  *
52192ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set(). When
52202ffc1057SHemant Agrawal  *		  configuring nextEngine = e_FM_PCD_CC, note that
52212ffc1057SHemant Agrawal  *		  p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
52222ffc1057SHemant Agrawal  *		  different from the currently changed table.
52232ffc1057SHemant Agrawal  */
52242ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_find_nmodify_next_engine(t_handle h_cc_node,
52252ffc1057SHemant Agrawal 		uint8_t		key_size,
52262ffc1057SHemant Agrawal 		uint8_t		*p_key,
52272ffc1057SHemant Agrawal 		uint8_t		*p_mask,
52282ffc1057SHemant Agrawal 		ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine);
52292ffc1057SHemant Agrawal 
52302ffc1057SHemant Agrawal /*
52312ffc1057SHemant Agrawal  * @Function	 fm_pcd_match_table_find_nmodify_key_and_next_engine
52322ffc1057SHemant Agrawal  *
52332ffc1057SHemant Agrawal  * @Description   Modify the key and Next Engine Parameters of this key in the
52342ffc1057SHemant Agrawal  *		  index defined by the key_index. Note that this routine will
52352ffc1057SHemant Agrawal  *		  search the node to locate the index of the required key
52362ffc1057SHemant Agrawal  *		  (& mask) to modify.
52372ffc1057SHemant Agrawal  *
52382ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node		A handle to the node
52392ffc1057SHemant Agrawal  * @Param[in]	  key_size		Key size of the one to modify.
52402ffc1057SHemant Agrawal  * @Param[in]	  p_key			A pointer to the requested key to modify
52412ffc1057SHemant Agrawal  * @Param[in]	  p_mask		A pointer to the mask if relevant,
52422ffc1057SHemant Agrawal  *					otherwise pointer to NULL
52432ffc1057SHemant Agrawal  * @Param[in]	  p_key_params		A pointer to the parameters includes
52442ffc1057SHemant Agrawal  *					modified key and modified Next Engine
52452ffc1057SHemant Agrawal  *					Params
52462ffc1057SHemant Agrawal  *
52472ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
52482ffc1057SHemant Agrawal  *
52492ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set() was called for
52502ffc1057SHemant Agrawal  *		  this node and the nodes that lead to it.
52512ffc1057SHemant Agrawal  *		  When configuring nextEngine = e_FM_PCD_CC, note that
52522ffc1057SHemant Agrawal  *		  p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
52532ffc1057SHemant Agrawal  *		  different from the currently changed table.
52542ffc1057SHemant Agrawal  */
52552ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_find_nmodify_key_and_next_engine(t_handle h_cc_node,
52562ffc1057SHemant Agrawal 				uint8_t key_size,
52572ffc1057SHemant Agrawal 				uint8_t *p_key,
52582ffc1057SHemant Agrawal 				uint8_t *p_mask,
52592ffc1057SHemant Agrawal 				ioc_fm_pcd_cc_key_params_t *p_key_params);
52602ffc1057SHemant Agrawal 
52612ffc1057SHemant Agrawal /*
52622ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_find_nmodify_key
52632ffc1057SHemant Agrawal  *
52642ffc1057SHemant Agrawal  * @Description   Modify the key  in the index defined by the key_index. Note
52652ffc1057SHemant Agrawal  *		  that this routine will search the node to locate the index of
52662ffc1057SHemant Agrawal  *		  the required key (& mask) to modify.
52672ffc1057SHemant Agrawal  *
52682ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node	A handle to the node
52692ffc1057SHemant Agrawal  * @Param[in]	  key_size	Key size of the one to modify.
52702ffc1057SHemant Agrawal  * @Param[in]	  p_key		A pointer to the requested key to modify.
52712ffc1057SHemant Agrawal  * @Param[in]	  p_mask	A pointer to the mask if relevant,
52722ffc1057SHemant Agrawal  *				otherwise pointer to NULL
52732ffc1057SHemant Agrawal  * @Param[in]	  p_new_key	A pointer to the new key
52742ffc1057SHemant Agrawal  * @Param[in]	  p_new_mask	A pointer to the new mask if relevant,
52752ffc1057SHemant Agrawal  *				otherwise pointer to NULL
52762ffc1057SHemant Agrawal  *
52772ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
52782ffc1057SHemant Agrawal  *
52792ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set() was called for
52802ffc1057SHemant Agrawal  *		  this node and the nodes that lead to it.
52812ffc1057SHemant Agrawal  */
52822ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_find_nmodify_key(t_handle h_cc_node,
52832ffc1057SHemant Agrawal 					uint8_t  key_size,
52842ffc1057SHemant Agrawal 					uint8_t  *p_key,
52852ffc1057SHemant Agrawal 					uint8_t  *p_mask,
52862ffc1057SHemant Agrawal 					uint8_t  *p_new_key,
52872ffc1057SHemant Agrawal 					uint8_t  *p_new_mask);
52882ffc1057SHemant Agrawal 
52892ffc1057SHemant Agrawal /*
52902ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_get_key_counter
52912ffc1057SHemant Agrawal  *
52922ffc1057SHemant Agrawal  * @Description   This routine may be used to get a counter of specific key in a
52932ffc1057SHemant Agrawal  *		  CC Node; This counter reflects how many frames passed that
52942ffc1057SHemant Agrawal  *		  were matched this key.
52952ffc1057SHemant Agrawal  *
52962ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node	A handle to the node
52972ffc1057SHemant Agrawal  * @Param[in]	  key_index	Key index for adding
52982ffc1057SHemant Agrawal  *
52992ffc1057SHemant Agrawal  * @Return	  The specific key counter.
53002ffc1057SHemant Agrawal  *
53012ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set().
53022ffc1057SHemant Agrawal  */
53032ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_get_key_counter(t_handle h_cc_node,
53042ffc1057SHemant Agrawal 				uint16_t key_index);
53052ffc1057SHemant Agrawal 
53062ffc1057SHemant Agrawal /*
53072ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_get_key_statistics
53082ffc1057SHemant Agrawal  *
53092ffc1057SHemant Agrawal  * @Description   This routine may be used to get statistics counters of
53102ffc1057SHemant Agrawal  *		  specific key in a CC Node.
53112ffc1057SHemant Agrawal  *
53122ffc1057SHemant Agrawal  *		  If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
53132ffc1057SHemant Agrawal  *		  'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
53142ffc1057SHemant Agrawal  *		  node, these counters reflect how many frames passed that were
53152ffc1057SHemant Agrawal  *		  matched this key; The total frames count will be returned in
53162ffc1057SHemant Agrawal  *		  the counter of the first range (as only one frame length range
53172ffc1057SHemant Agrawal  *		  was defined). If 'e_FM_PCD_CC_STATS_MODE_RMON' was set for
53182ffc1057SHemant Agrawal  *		  this node, the total frame count will be separated to frame
53192ffc1057SHemant Agrawal  *		  length counters, based on provided frame length ranges.
53202ffc1057SHemant Agrawal  *
53212ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node		A handle to the node
53222ffc1057SHemant Agrawal  * @Param[in]	  key_index		Key index for adding
53232ffc1057SHemant Agrawal  * @Param[out]	  p_key_statistics	Key statistics counters
53242ffc1057SHemant Agrawal  *
53252ffc1057SHemant Agrawal  * @Return	  The specific key statistics.
53262ffc1057SHemant Agrawal  *
53272ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set().
53282ffc1057SHemant Agrawal  */
53292ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_get_key_statistics(t_handle h_cc_node,
53302ffc1057SHemant Agrawal 			uint16_t		key_index,
53312ffc1057SHemant Agrawal 			ioc_fm_pcd_cc_key_statistics_t	*p_key_statistics);
53322ffc1057SHemant Agrawal 
53332ffc1057SHemant Agrawal /*
53342ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_get_miss_statistics
53352ffc1057SHemant Agrawal  *
53362ffc1057SHemant Agrawal  * @Description   This routine may be used to get statistics counters of miss
53372ffc1057SHemant Agrawal  *		  entry in a CC Node.
53382ffc1057SHemant Agrawal  *
53392ffc1057SHemant Agrawal  *		  If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
53402ffc1057SHemant Agrawal  *		  'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
53412ffc1057SHemant Agrawal  *		  node, these counters reflect how many frames were not matched
53422ffc1057SHemant Agrawal  *		  to any existing key and therefore passed through the miss
53432ffc1057SHemant Agrawal  *		  entry; The total frames count will be returned in the counter
53442ffc1057SHemant Agrawal  *		  of the first range (as only one frame length range was
53452ffc1057SHemant Agrawal  *		  defined).
53462ffc1057SHemant Agrawal  *
53472ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node		A handle to the node
53482ffc1057SHemant Agrawal  * @Param[out]	  p_miss_statistics	Statistics counters for 'miss'
53492ffc1057SHemant Agrawal  *
53502ffc1057SHemant Agrawal  * @Return	  The statistics for 'miss'.
53512ffc1057SHemant Agrawal  *
53522ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set().
53532ffc1057SHemant Agrawal  */
53542ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_get_miss_statistics(t_handle h_cc_node,
53552ffc1057SHemant Agrawal 		    ioc_fm_pcd_cc_key_statistics_t	*p_miss_statistics);
53562ffc1057SHemant Agrawal 
53572ffc1057SHemant Agrawal /*
53582ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_find_nget_key_statistics
53592ffc1057SHemant Agrawal  *
53602ffc1057SHemant Agrawal  * @Description   This routine may be used to get statistics counters of
53612ffc1057SHemant Agrawal  *		  specific key in a CC Node.
53622ffc1057SHemant Agrawal  *
53632ffc1057SHemant Agrawal  *		  If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
53642ffc1057SHemant Agrawal  *		  'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
53652ffc1057SHemant Agrawal  *		  node, these counters reflect how many frames passed that were
53662ffc1057SHemant Agrawal  *		  matched this key; The total frames count will be returned in
53672ffc1057SHemant Agrawal  *		  the counter of the first range (as only one frame length range
53682ffc1057SHemant Agrawal  *		  was defined). If 'e_FM_PCD_CC_STATS_MODE_RMON' was set for
53692ffc1057SHemant Agrawal  *		  this node, the total frame count will be separated to frame
53702ffc1057SHemant Agrawal  *		  length counters, based on provided frame length ranges.
53712ffc1057SHemant Agrawal  *		  Note that this routine will search the node to locate the
53722ffc1057SHemant Agrawal  *		  index of the required key based on received key parameters.
53732ffc1057SHemant Agrawal  *
53742ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node		A handle to the node
53752ffc1057SHemant Agrawal  * @Param[in]	  key_size		Size of the requested key
53762ffc1057SHemant Agrawal  * @Param[in]	  p_key			A pointer to the requested key
53772ffc1057SHemant Agrawal  * @Param[in]	  p_mask		A pointer to the mask if relevant,
53782ffc1057SHemant Agrawal  *					otherwise pointer to NULL
53792ffc1057SHemant Agrawal  * @Param[out]	  p_key_statistics	Key statistics counters
53802ffc1057SHemant Agrawal  *
53812ffc1057SHemant Agrawal  * @Return	  The specific key statistics.
53822ffc1057SHemant Agrawal  *
53832ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_match_table_set().
53842ffc1057SHemant Agrawal  */
53852ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_find_nget_key_statistics(t_handle h_cc_node,
53862ffc1057SHemant Agrawal 			uint8_t		key_size,
53872ffc1057SHemant Agrawal 			uint8_t		*p_key,
53882ffc1057SHemant Agrawal 			uint8_t		*p_mask,
53892ffc1057SHemant Agrawal 			ioc_fm_pcd_cc_key_statistics_t   *p_key_statistics);
53902ffc1057SHemant Agrawal 
53912ffc1057SHemant Agrawal /*
53922ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_get_next_engine
53932ffc1057SHemant Agrawal  *
53942ffc1057SHemant Agrawal  * @Description   Gets NextEngine of the relevant key_index.
53952ffc1057SHemant Agrawal  *
53962ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node				A handle to the node.
53972ffc1057SHemant Agrawal  * @Param[in]	  key_index				key_index in the
53982ffc1057SHemant Agrawal  *							relevant node.
53992ffc1057SHemant Agrawal  * @Param[out]	  p_fm_pcd_cc_next_engine_params	here updated
54002ffc1057SHemant Agrawal  *							nextEngine parameters
54012ffc1057SHemant Agrawal  *							for the relevant
54022ffc1057SHemant Agrawal  *							key_index of the CC Node
54032ffc1057SHemant Agrawal  *							received as parameter to
54042ffc1057SHemant Agrawal  *							this function
54052ffc1057SHemant Agrawal  *
54062ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
54072ffc1057SHemant Agrawal  *
54082ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
54092ffc1057SHemant Agrawal  */
54102ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_get_next_engine(t_handle	h_cc_node,
54112ffc1057SHemant Agrawal 	uint16_t			key_index,
54122ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine_params);
54132ffc1057SHemant Agrawal 
54142ffc1057SHemant Agrawal /*
54152ffc1057SHemant Agrawal  * @Function	  fm_pcd_match_table_get_indexed_hash_bucket
54162ffc1057SHemant Agrawal  *
54172ffc1057SHemant Agrawal  * @Description   This routine simulates KeyGen operation on the provided key
54182ffc1057SHemant Agrawal  *		  and calculates to which hash bucket it will be mapped.
54192ffc1057SHemant Agrawal  *
54202ffc1057SHemant Agrawal  * @Param[in]	  h_cc_node			A handle to the node.
54212ffc1057SHemant Agrawal  * @Param[in]	  kg_key_size			Key size as it was configured in
54222ffc1057SHemant Agrawal  *						the KG scheme that leads to this
54232ffc1057SHemant Agrawal  *						hash.
54242ffc1057SHemant Agrawal  * @Param[in]	  p_kg_key			Pointer to the key; must be like
54252ffc1057SHemant Agrawal  *						the key that the KG is
54262ffc1057SHemant Agrawal  *						generated, i.e. the same
54272ffc1057SHemant Agrawal  *						extraction and with mask if
54282ffc1057SHemant Agrawal  *						exist.
54292ffc1057SHemant Agrawal  * @Param[in]	  kg_hash_shift			Hash-shift as it was configured
54302ffc1057SHemant Agrawal  *						in the KG scheme that leads to
54312ffc1057SHemant Agrawal  *						this hash.
54322ffc1057SHemant Agrawal  * @Param[out]	  p_cc_node_bucket_handle	Pointer to the bucket of the
54332ffc1057SHemant Agrawal  *						provided key.
54342ffc1057SHemant Agrawal  * @Param[out]	  p_bucket_index		Index to the bucket of the
54352ffc1057SHemant Agrawal  *						provided key
54362ffc1057SHemant Agrawal  * @Param[out]	  p_last_index			Pointer to last index in the
54372ffc1057SHemant Agrawal  *						bucket of the provided key.
54382ffc1057SHemant Agrawal  *
54392ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
54402ffc1057SHemant Agrawal  *
54412ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_hash_table_set()
54422ffc1057SHemant Agrawal  */
54432ffc1057SHemant Agrawal uint32_t fm_pcd_match_table_get_indexed_hash_bucket(t_handle h_cc_node,
54442ffc1057SHemant Agrawal 				uint8_t	kg_key_size,
54452ffc1057SHemant Agrawal 				uint8_t	*p_kg_key,
54462ffc1057SHemant Agrawal 				uint8_t	kg_hash_shift,
54472ffc1057SHemant Agrawal 				t_handle	*p_cc_node_bucket_handle,
54482ffc1057SHemant Agrawal 				uint8_t	*p_bucket_index,
54492ffc1057SHemant Agrawal 				uint16_t	*p_last_index);
54502ffc1057SHemant Agrawal 
54512ffc1057SHemant Agrawal /*
54522ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_set
54532ffc1057SHemant Agrawal  *
54542ffc1057SHemant Agrawal  * @Description   This routine initializes a hash table structure.
54552ffc1057SHemant Agrawal  *		  KeyGen hash result determines the hash bucket.
54562ffc1057SHemant Agrawal  *		  Next, KeyGen key is compared against all keys of this bucket
54572ffc1057SHemant Agrawal  *		  (exact match).
54582ffc1057SHemant Agrawal  *		  Number of sets (number of buckets) of the hash equals to the
54592ffc1057SHemant Agrawal  *		  number of 1-s in 'hashResMask' in the provided parameters.
54602ffc1057SHemant Agrawal  *		  Number of hash table ways is then calculated by dividing
54612ffc1057SHemant Agrawal  *		  'max_num_of_keys' equally between the hash sets. This is the
54622ffc1057SHemant Agrawal  *		  maximal number of keys that a hash bucket may hold.
54632ffc1057SHemant Agrawal  *		  The hash table is initialized empty and keys may be added to
54642ffc1057SHemant Agrawal  *		  it following the initialization. Keys masks are not supported
54652ffc1057SHemant Agrawal  *		  in current hash table implementation.
54662ffc1057SHemant Agrawal  *		  The initialized hash table can be integrated as a node in a CC
54672ffc1057SHemant Agrawal  *		  tree.
54682ffc1057SHemant Agrawal  *
54692ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd	FM PCD module descriptor.
54702ffc1057SHemant Agrawal  * @Param[in]	  p_param	A structure of parameters defining the hash
54712ffc1057SHemant Agrawal  *				table
54722ffc1057SHemant Agrawal  *
54732ffc1057SHemant Agrawal  * @Return	  A handle to the initialized object on success; NULL code
54742ffc1057SHemant Agrawal  *		  otherwise.
54752ffc1057SHemant Agrawal  *
54762ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
54772ffc1057SHemant Agrawal  */
54782ffc1057SHemant Agrawal t_handle fm_pcd_hash_table_set(t_handle h_fm_pcd,
54792ffc1057SHemant Agrawal 	ioc_fm_pcd_hash_table_params_t *p_param);
54802ffc1057SHemant Agrawal 
54812ffc1057SHemant Agrawal /*
54822ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_delete
54832ffc1057SHemant Agrawal  *
54842ffc1057SHemant Agrawal  * @Description   This routine deletes the provided hash table and released all
54852ffc1057SHemant Agrawal  *		  its allocated resources.
54862ffc1057SHemant Agrawal  *
54872ffc1057SHemant Agrawal  * @Param[in]	  h_hash_tbl	A handle to a hash table
54882ffc1057SHemant Agrawal  *
54892ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
54902ffc1057SHemant Agrawal  *
54912ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_hash_table_set().
54922ffc1057SHemant Agrawal  */
54932ffc1057SHemant Agrawal uint32_t fm_pcd_hash_table_delete(t_handle h_hash_tbl);
54942ffc1057SHemant Agrawal 
54952ffc1057SHemant Agrawal /*
54962ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_add_key
54972ffc1057SHemant Agrawal  *
54982ffc1057SHemant Agrawal  * @Description   This routine adds the provided key (including next engine
54992ffc1057SHemant Agrawal  *		  parameters of this key) to the hash table.
55002ffc1057SHemant Agrawal  *		  The key is added as the last key of the bucket that it is
55012ffc1057SHemant Agrawal  *		  mapped to.
55022ffc1057SHemant Agrawal  *
55032ffc1057SHemant Agrawal  * @Param[in]	  h_hash_tbl	A handle to a hash table
55042ffc1057SHemant Agrawal  * @Param[in]	  key_size	Key size of added key
55052ffc1057SHemant Agrawal  * @Param[in]	  p_key_params  A pointer to the parameters includes
55062ffc1057SHemant Agrawal  *				new key with next engine parameters; The pointer
55072ffc1057SHemant Agrawal  *				to the key mask must be NULL, as masks are not
55082ffc1057SHemant Agrawal  *				supported in hash table implementation.
55092ffc1057SHemant Agrawal  *
55102ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
55112ffc1057SHemant Agrawal  *
55122ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_hash_table_set().
55132ffc1057SHemant Agrawal  */
55142ffc1057SHemant Agrawal uint32_t fm_pcd_hash_table_add_key(t_handle h_hash_tbl,
55152ffc1057SHemant Agrawal 				uint8_t		key_size,
55162ffc1057SHemant Agrawal 				ioc_fm_pcd_cc_key_params_t  *p_key_params);
55172ffc1057SHemant Agrawal 
55182ffc1057SHemant Agrawal /*
55192ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_remove_key
55202ffc1057SHemant Agrawal  *
55212ffc1057SHemant Agrawal  * @Description   This routine removes the requested key (including next engine
55222ffc1057SHemant Agrawal  *		  parameters of this key) from the hash table.
55232ffc1057SHemant Agrawal  *
55242ffc1057SHemant Agrawal  * @Param[in]	  h_hash_tbl	A handle to a hash table
55252ffc1057SHemant Agrawal  * @Param[in]	  key_size	Key size of the one to remove.
55262ffc1057SHemant Agrawal  * @Param[in]	  p_key		A pointer to the requested key to remove.
55272ffc1057SHemant Agrawal  *
55282ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
55292ffc1057SHemant Agrawal  *
55302ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_hash_table_set().
55312ffc1057SHemant Agrawal  */
55322ffc1057SHemant Agrawal uint32_t fm_pcd_hash_table_remove_key(t_handle h_hash_tbl,
55332ffc1057SHemant Agrawal 				uint8_t  key_size,
55342ffc1057SHemant Agrawal 				uint8_t  *p_key);
55352ffc1057SHemant Agrawal 
55362ffc1057SHemant Agrawal /*
55372ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_modify_next_engine
55382ffc1057SHemant Agrawal  *
55392ffc1057SHemant Agrawal  * @Description   This routine modifies the next engine for the provided key.
55402ffc1057SHemant Agrawal  *		  The key should be previously added to the hash table.
55412ffc1057SHemant Agrawal  *
55422ffc1057SHemant Agrawal  * @Param[in]	  h_hash_tbl			A handle to a hash table
55432ffc1057SHemant Agrawal  * @Param[in]	  key_size			Key size of the key to modify.
55442ffc1057SHemant Agrawal  * @Param[in]	  p_key				A pointer to the requested key
55452ffc1057SHemant Agrawal  *						to modify.
55462ffc1057SHemant Agrawal  * @Param[in]	  p_fm_pcd_cc_next_engine	A structure for defining
55472ffc1057SHemant Agrawal  *						new next engine parameters.
55482ffc1057SHemant Agrawal  *
55492ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
55502ffc1057SHemant Agrawal  *
55512ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_hash_table_set().
55522ffc1057SHemant Agrawal  *		  When configuring nextEngine = e_FM_PCD_CC, note that
55532ffc1057SHemant Agrawal  *		  p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
55542ffc1057SHemant Agrawal  *		  different from the currently changed table.
55552ffc1057SHemant Agrawal  */
55562ffc1057SHemant Agrawal uint32_t fm_pcd_hash_table_modify_next_engine(t_handle h_hash_tbl,
55572ffc1057SHemant Agrawal 		uint8_t		key_size,
55582ffc1057SHemant Agrawal 		uint8_t		*p_key,
55592ffc1057SHemant Agrawal 		ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine);
55602ffc1057SHemant Agrawal 
55612ffc1057SHemant Agrawal /*
55622ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_modify_miss_next_engine
55632ffc1057SHemant Agrawal  *
55642ffc1057SHemant Agrawal  * @Description   This routine modifies the next engine on key match miss.
55652ffc1057SHemant Agrawal  *
55662ffc1057SHemant Agrawal  * @Param[in]	  h_hash_tbl			A handle to a hash table
55672ffc1057SHemant Agrawal  * @Param[in]	  p_fm_pcd_cc_next_engine	A structure for defining
55682ffc1057SHemant Agrawal  *						new next engine parameters.
55692ffc1057SHemant Agrawal  *
55702ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
55712ffc1057SHemant Agrawal  *
55722ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_hash_table_set().
55732ffc1057SHemant Agrawal  *		  When configuring nextEngine = e_FM_PCD_CC, note that
55742ffc1057SHemant Agrawal  *		  p_fm_pcd_cc_next_engine_params->ccParams.h_cc_node must be
55752ffc1057SHemant Agrawal  *		  different from the currently changed table.
55762ffc1057SHemant Agrawal  */
55772ffc1057SHemant Agrawal uint32_t fm_pcd_hash_table_modify_miss_next_engine(t_handle h_hash_tbl,
55782ffc1057SHemant Agrawal 	      ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine);
55792ffc1057SHemant Agrawal 
55802ffc1057SHemant Agrawal /*
55812ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_get_miss_next_engine
55822ffc1057SHemant Agrawal  *
55832ffc1057SHemant Agrawal  * @Description   Gets NextEngine in case of key match miss.
55842ffc1057SHemant Agrawal  *
55852ffc1057SHemant Agrawal  * @Param[in]	  h_hash_tbl				A handle to a hash table
55862ffc1057SHemant Agrawal  * @Param[out]	  p_fm_pcd_cc_next_engine_params	Next engine parameters
55872ffc1057SHemant Agrawal  *							for the specified hash
55882ffc1057SHemant Agrawal  *							table.
55892ffc1057SHemant Agrawal  *
55902ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
55912ffc1057SHemant Agrawal  *
55922ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_hash_table_set().
55932ffc1057SHemant Agrawal  */
55942ffc1057SHemant Agrawal uint32_t fm_pcd_hash_table_get_miss_next_engine(t_handle	h_hash_tbl,
55952ffc1057SHemant Agrawal 	ioc_fm_pcd_cc_next_engine_params_t *p_fm_pcd_cc_next_engine_params);
55962ffc1057SHemant Agrawal 
55972ffc1057SHemant Agrawal /*
55982ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_find_nget_key_statistics
55992ffc1057SHemant Agrawal  *
56002ffc1057SHemant Agrawal  * @Description   This routine may be used to get statistics counters of
56012ffc1057SHemant Agrawal  *		  specific key in a hash table.
56022ffc1057SHemant Agrawal  *
56032ffc1057SHemant Agrawal  *		  If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
56042ffc1057SHemant Agrawal  *		  'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
56052ffc1057SHemant Agrawal  *		  node, these counters reflect how many frames passed that were
56062ffc1057SHemant Agrawal  *		  matched this key; The total frames count will be returned in
56072ffc1057SHemant Agrawal  *		  the counter of the first range (as only one frame length range
56082ffc1057SHemant Agrawal  *		  was defined). If 'e_FM_PCD_CC_STATS_MODE_RMON' was set for
56092ffc1057SHemant Agrawal  *		  this node, the total frame count will be separated to frame
56102ffc1057SHemant Agrawal  *		  length counters, based on provided frame length ranges. Note
56112ffc1057SHemant Agrawal  *		  that this routine will identify the bucket of this key in the
56122ffc1057SHemant Agrawal  *		  hash table and will search the bucket to locate the index of
56132ffc1057SHemant Agrawal  *		  the required key based on received key parameters.
56142ffc1057SHemant Agrawal  *
56152ffc1057SHemant Agrawal  * @Param[in]	  h_hash_tbl		A handle to a hash table
56162ffc1057SHemant Agrawal  * @Param[in]	  key_size		Size of the requested key
56172ffc1057SHemant Agrawal  * @Param[in]	  p_key			A pointer to the requested key
56182ffc1057SHemant Agrawal  * @Param[out]	  p_key_statistics	Key statistics counters
56192ffc1057SHemant Agrawal  *
56202ffc1057SHemant Agrawal  * @Return	  The specific key statistics.
56212ffc1057SHemant Agrawal  *
56222ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_hash_table_set().
56232ffc1057SHemant Agrawal  */
56242ffc1057SHemant Agrawal uint32_t fm_pcd_hash_table_find_nget_key_statistics(t_handle h_hash_tbl,
56252ffc1057SHemant Agrawal 			uint8_t		key_size,
56262ffc1057SHemant Agrawal 			uint8_t		*p_key,
56272ffc1057SHemant Agrawal 			ioc_fm_pcd_cc_key_statistics_t   *p_key_statistics);
56282ffc1057SHemant Agrawal 
56292ffc1057SHemant Agrawal /*
56302ffc1057SHemant Agrawal  * @Function	  fm_pcd_hash_table_get_miss_statistics
56312ffc1057SHemant Agrawal  *
56322ffc1057SHemant Agrawal  * @Description   This routine may be used to get statistics counters of 'miss'
56332ffc1057SHemant Agrawal  *		  entry of the a hash table.
56342ffc1057SHemant Agrawal  *
56352ffc1057SHemant Agrawal  *		  If 'e_FM_PCD_CC_STATS_MODE_FRAME' and
56362ffc1057SHemant Agrawal  *		  'e_FM_PCD_CC_STATS_MODE_BYTE_AND_FRAME' were set for this
56372ffc1057SHemant Agrawal  *		  node, these counters reflect how many frames were not matched
56382ffc1057SHemant Agrawal  *		  to any existing key and therefore passed through the miss
56392ffc1057SHemant Agrawal  *		  entry;
56402ffc1057SHemant Agrawal  *
56412ffc1057SHemant Agrawal  * @Param[in]	  h_hash_tbl		A handle to a hash table
56422ffc1057SHemant Agrawal  * @Param[out]	  p_miss_statistics	Statistics counters for 'miss'
56432ffc1057SHemant Agrawal  *
56442ffc1057SHemant Agrawal  * @Return	  The statistics for 'miss'.
56452ffc1057SHemant Agrawal  *
56462ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_hash_table_set().
56472ffc1057SHemant Agrawal  */
56482ffc1057SHemant Agrawal uint32_t fm_pcd_hash_table_get_miss_statistics(t_handle	h_hash_tbl,
56492ffc1057SHemant Agrawal 			ioc_fm_pcd_cc_key_statistics_t   *p_miss_statistics);
56502ffc1057SHemant Agrawal 
56512ffc1057SHemant Agrawal /*
56522ffc1057SHemant Agrawal  * @Function	  fm_pcd_manip_node_set
56532ffc1057SHemant Agrawal  *
56542ffc1057SHemant Agrawal  * @Description   This routine should be called for defining a manipulation
56552ffc1057SHemant Agrawal  *		  node. A manipulation node must be defined before the CC node
56562ffc1057SHemant Agrawal  *		  that precedes it.
56572ffc1057SHemant Agrawal  *
56582ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd			FM PCD module descriptor.
56592ffc1057SHemant Agrawal  * @Param[in]	  p_fm_pcd_manip_params		A structure of parameters
56602ffc1057SHemant Agrawal  *						defining the manipulation
56612ffc1057SHemant Agrawal  *
56622ffc1057SHemant Agrawal  * @Return	  A handle to the initialized object on success; NULL code
56632ffc1057SHemant Agrawal  *		  otherwise.
56642ffc1057SHemant Agrawal  *
56652ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
56662ffc1057SHemant Agrawal  */
56672ffc1057SHemant Agrawal t_handle fm_pcd_manip_node_set(t_handle h_fm_pcd,
56682ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_params_t *p_fm_pcd_manip_params);
56692ffc1057SHemant Agrawal 
56702ffc1057SHemant Agrawal /*
56712ffc1057SHemant Agrawal  * @Function	  fm_pcd_manip_node_delete
56722ffc1057SHemant Agrawal  *
56732ffc1057SHemant Agrawal  * @Description   Delete an existing manipulation node.
56742ffc1057SHemant Agrawal  *
56752ffc1057SHemant Agrawal  * @Param[in]	  h_manip_node		A handle to a manipulation node.
56762ffc1057SHemant Agrawal  *
56772ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
56782ffc1057SHemant Agrawal  *
56792ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_manip_node_set().
56802ffc1057SHemant Agrawal  */
56812ffc1057SHemant Agrawal uint32_t  fm_pcd_manip_node_delete(t_handle h_manip_node);
56822ffc1057SHemant Agrawal 
56832ffc1057SHemant Agrawal /*
56842ffc1057SHemant Agrawal  * @Function	  fm_pcd_manip_get_statistics
56852ffc1057SHemant Agrawal  *
56862ffc1057SHemant Agrawal  * @Description   Retrieve the manipulation statistics.
56872ffc1057SHemant Agrawal  *
56882ffc1057SHemant Agrawal  * @Param[in]	  h_manip_node		A handle to a manipulation node.
56892ffc1057SHemant Agrawal  * @Param[out]	  p_fm_pcd_manip_stats	A structure for retrieving the
56902ffc1057SHemant Agrawal  *					manipulation statistics
56912ffc1057SHemant Agrawal  *
56922ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
56932ffc1057SHemant Agrawal  *
56942ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_manip_node_set().
56952ffc1057SHemant Agrawal  */
56962ffc1057SHemant Agrawal uint32_t fm_pcd_manip_get_statistics(t_handle h_manip_node,
56972ffc1057SHemant Agrawal 	ioc_fm_pcd_manip_stats_t *p_fm_pcd_manip_stats);
56982ffc1057SHemant Agrawal 
56992ffc1057SHemant Agrawal /*
57002ffc1057SHemant Agrawal  * @Function	  fm_pcd_manip_node_replace
57012ffc1057SHemant Agrawal  *
57022ffc1057SHemant Agrawal  * @Description   Change existing manipulation node to be according to new
57032ffc1057SHemant Agrawal  *		  requirement.
57042ffc1057SHemant Agrawal  *
57052ffc1057SHemant Agrawal  * @Param[in]	  h_manip_node		A handle to a manipulation node.
57062ffc1057SHemant Agrawal  * @Param[out]	  p_manip_params	A structure of parameters defining the
57072ffc1057SHemant Agrawal  *					change requirement
57082ffc1057SHemant Agrawal  *
57092ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
57102ffc1057SHemant Agrawal  *
57112ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_manip_node_set().
57122ffc1057SHemant Agrawal  */
57132ffc1057SHemant Agrawal uint32_t fm_pcd_manip_node_replace(t_handle h_manip_node,
57142ffc1057SHemant Agrawal ioc_fm_pcd_manip_params_t *p_manip_params);
57152ffc1057SHemant Agrawal 
57162ffc1057SHemant Agrawal /*
57172ffc1057SHemant Agrawal  * @Function	  fm_pcd_frm_replic_set_group
57182ffc1057SHemant Agrawal  *
57192ffc1057SHemant Agrawal  * @Description   Initialize a Frame Replicator group.
57202ffc1057SHemant Agrawal  *
57212ffc1057SHemant Agrawal  * @Param[in]	  h_fm_pcd			FM PCD module descriptor.
57222ffc1057SHemant Agrawal  * @Param[in]	  p_frm_replic_group_param	A structure of parameters for
57232ffc1057SHemant Agrawal  *						the initialization of the frame
57242ffc1057SHemant Agrawal  *						replicator group.
57252ffc1057SHemant Agrawal  *
57262ffc1057SHemant Agrawal  * @Return	  A handle to the initialized object on success; NULL code
57272ffc1057SHemant Agrawal  *		  otherwise.
57282ffc1057SHemant Agrawal  *
57292ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_init().
57302ffc1057SHemant Agrawal  */
57312ffc1057SHemant Agrawal t_handle fm_pcd_frm_replic_set_group(t_handle h_fm_pcd,
57322ffc1057SHemant Agrawal 		ioc_fm_pcd_frm_replic_group_params_t *p_frm_replic_group_param);
57332ffc1057SHemant Agrawal 
57342ffc1057SHemant Agrawal /*
57352ffc1057SHemant Agrawal  * @Function	  fm_pcd_frm_replic_delete_group
57362ffc1057SHemant Agrawal  *
57372ffc1057SHemant Agrawal  * @Description   Delete a Frame Replicator group.
57382ffc1057SHemant Agrawal  *
57392ffc1057SHemant Agrawal  * @Param[in]	  h_frm_replic_group	A handle to the frame replicator group.
57402ffc1057SHemant Agrawal  *
57412ffc1057SHemant Agrawal  * @Return	  E_OK on success;  Error code otherwise.
57422ffc1057SHemant Agrawal  *
57432ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_frm_replic_set_group().
57442ffc1057SHemant Agrawal  */
57452ffc1057SHemant Agrawal uint32_t fm_pcd_frm_replic_delete_group(t_handle h_frm_replic_group);
57462ffc1057SHemant Agrawal 
57472ffc1057SHemant Agrawal /*
57482ffc1057SHemant Agrawal  * @Function	  fm_pcd_frm_replic_add_member
57492ffc1057SHemant Agrawal  *
57502ffc1057SHemant Agrawal  * @Description   Add the member in the index defined by the member_index.
57512ffc1057SHemant Agrawal  *
57522ffc1057SHemant Agrawal  * @Param[in]	  h_frm_replic_group	A handle to the frame replicator group.
57532ffc1057SHemant Agrawal  * @Param[in]	  member_index		member index for adding.
57542ffc1057SHemant Agrawal  * @Param[in]	  p_member_params	A pointer to the new member parameters.
57552ffc1057SHemant Agrawal  *
57562ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
57572ffc1057SHemant Agrawal  *
57582ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_frm_replic_set_group() of this
57592ffc1057SHemant Agrawal  *		  group.
57602ffc1057SHemant Agrawal  */
57612ffc1057SHemant Agrawal uint32_t fm_pcd_frm_replic_add_member(t_handle h_frm_replic_group,
57622ffc1057SHemant Agrawal 			uint16_t		member_index,
57632ffc1057SHemant Agrawal 			ioc_fm_pcd_cc_next_engine_params_t *p_member_params);
57642ffc1057SHemant Agrawal 
57652ffc1057SHemant Agrawal /*
57662ffc1057SHemant Agrawal  * @Function	  fm_pcd_frm_replic_remove_member
57672ffc1057SHemant Agrawal  *
57682ffc1057SHemant Agrawal  * @Description   Remove the member defined by the index from the relevant
57692ffc1057SHemant Agrawal  *		  group.
57702ffc1057SHemant Agrawal  *
57712ffc1057SHemant Agrawal  * @Param[in]	  h_frm_replic_group	A handle to the frame replicator group.
57722ffc1057SHemant Agrawal  * @Param[in]	  member_index		member index for removing.
57732ffc1057SHemant Agrawal  *
57742ffc1057SHemant Agrawal  * @Return	  E_OK on success; Error code otherwise.
57752ffc1057SHemant Agrawal  *
57762ffc1057SHemant Agrawal  * @Cautions	  Allowed only following fm_pcd_frm_replic_set_group() of this
57772ffc1057SHemant Agrawal  * group.
57782ffc1057SHemant Agrawal  */
57792ffc1057SHemant Agrawal uint32_t fm_pcd_frm_replic_remove_member(t_handle h_frm_replic_group,
57802ffc1057SHemant Agrawal 				      uint16_t member_index);
57812ffc1057SHemant Agrawal 
57822ffc1057SHemant Agrawal /** @} */ /* end of FM_PCD_Runtime_build_grp group */
57832ffc1057SHemant Agrawal /** @} */ /* end of FM_PCD_Runtime_grp group */
57842ffc1057SHemant Agrawal /** @} */ /* end of FM_PCD_grp group */
57852ffc1057SHemant Agrawal /** @} */ /* end of FM_grp group */
57862ffc1057SHemant Agrawal 
57872ffc1057SHemant Agrawal #endif /* __FM_PCD_EXT_H */
5788