1 #ifndef _PA_H
2 #define _PA_H
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
8 /* System level header files */
9 #include <stdint.h>
10 #include <stdlib.h>
12 #include <ti/drv/pa/paver.h>
14 /* ============================================================= */
15 /**
16 * @file pa.h
17 *
18 * path ti/drv/pa/pa.h
19 *
20 * @brief Packet Accelerator (PA) sub-system LLD API and Data Definitions
21 *
22 * ============================================================================
23 * Copyright (c) Texas Instruments Incorporated 2009-2013
24 *
25 * Redistribution and use in source and binary forms, with or without
26 * modification, are permitted provided that the following conditions
27 * are met:
28 *
29 * Redistributions of source code must retain the above copyright
30 * notice, this list of conditions and the following disclaimer.
31 *
32 * Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the
35 * distribution.
36 *
37 * Neither the name of Texas Instruments Incorporated nor the names of
38 * its contributors may be used to endorse or promote products derived
39 * from this software without specific prior written permission.
40 *
41 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
42 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
43 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
44 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
45 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
46 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
47 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
48 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
49 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
50 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
51 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52 *
53 */
55 /** @mainpage Packet Accelerator Low Level Driver
56 *
57 * \image html doxydoc.wmf
58 *
59 * @section intro Introduction
60 *
61 * The packet accelerator sub-system (PASS) is designed to provide the input packet classification, checksum/CRC
62 * verification and generation, data manipulation and etc. The first generation PASS consists of the following
63 * resources
64 * - Six PDSPs for packet and command processing
65 * - Three 64-entry LUT1 (connected to PDSP0, PDSP1 and PDSP2) for Layer 2/3 or custom LUT1 lookup
66 * - One 8192-entry LUT2 (connected to PDSP3) for Layer 4/5 or custom LUT2 lookup
67 * - Six programmable CRC engines (connected to each PDSP respectively) for CRC computation and verification
68 * - Six 16-bit general purpose timers
69 *
70 * The packet accelerator low level driver (PA LLD) provides configuration and control of the packet accelerator
71 * sub-system (PASS). The sub-system provides from network packet classification and routing based on
72 * network header information (see @ref netlayers). The packet accelerator low level driver module
73 * (referred to as the module) provides APIs to configure the criteria used for from-network packet
74 * routing.
75 *
76 * The module attempts to abstract the operation of the PASS from the application. The module uses the following rules
77 * when configuring the PASS:
78 * - All received packets from Ethernet and/or SRIO are routed to PDSP0
79 * - PDSP0 does L0-L2 (MAC/SRIO) lookup using LUT1-0. If the packet is IP, it is forwarded to PDSP1
80 * - PDSP1 does the outer IP or Custom LUT1 lookup using LUT1-1
81 * - PDSP2 does any subsequent IP or Custom LUT1 lookup using LUT1-2
82 * - PDSP3 does all TCP/UDP and Custom LUT2 lookup using LUT2
83 * - PDSP4 is used for post-lookup processes such as checksum/CRC result verification.
84 * - PDSP4/5 can be used for pre-transmission operation such as transmit checksum generation.
85 *
86 * With the exception of some initial setup functions, the module does not communicate directly with
87 * the sub-system. The output of the module is a formatted data block along with a destination address.
88 * The module user must send the formatted data to the sub-system. This is typically done by linking the
89 * created data block to a host packet descriptor, and then using the addressing information to send
90 * the created packet to the sub-system through the queue manager and PKTDMA.
91 *
92 * For packets to the network, the sub-system provides ones complement checksum or CRC generation over
93 * a range provided by the module user. The range is not determined by sub-system by parsing the
94 * to-network packet, since it is assumed that the creator of the packet already has the start offset,
95 * length, initial checksum value and etc.
96 *
97 * The low level driver maintains two tables of layer 2 and layer 3 configuration information. The memory
98 * for these tables is provided by the module user at run time. The module maintains ownership of these
99 * tables and the module user must not write to the memory once provided to the module.
100 *
101 * In multi-core devices the module can be used in two different configurations. In independent core
102 * mode each core in a device has a unique set of tables. Although it is legal for any core to
103 * reference handles from other cores, this is not typically done. In this case cache coherency and
104 * cross core semaphores are not implemented by the module user. In common core mode there is only
105 * one set of tables and they are shared by all cores. Each core that uses the module must initialize
106 * it, but each core will provide the exact same buffers to the module. The module user will have
107 * the first core to initialize the module also initialize the table. Other cores will initialize their
108 * internal state but not initialize the table. In this mode @ref cache coherency and cross core @ref semaphores
109 * must be implemented by the module user to insure the integrity of the tables.
110 *
111 * The second generation of the packet accelerator sub-system (PASS) of the new Keystone2 device is enhanced to
112 * support fully-offloaded fast-path operations in both ingress and egress directions. The second generation PASS
113 * provides the following functionalities:
114 * - Ethernet and SRIO packet classification
115 * - Stateless L3/L4 Firewall (ACL)
116 * - Outer and inner IP packet classification
117 * - Outer and inner IP reassembly
118 * - TCP/UDP/GTPU based LUT2 classification
119 * - IPv4 and TCP/UDP checksum generation and verification
120 * - SCTP or custom CRC generation and verification
121 * - Programmable system statistics
122 * - Post-Classification operation such as packet patch, protocol header and/or trailer removal
123 * - Egress or forwarding traffic flow cache operations
124 * - Inner IP L3/L4 patching
125 * - Inner IP fragmentation
126 * - Outer IP insertion/update
127 * - Pre-IPSEC and Post-IPSEC processing
128 * - Outer IP fragmentation
129 * - L2 header insertion/update
130 *
131 * The second generation PASS consists of five ingress stages (Ingress0-4), a post-processing stage (Post)
132 * and three egress stages (Egress 0-2). Each stage has its intended function, which is described briefly in
133 * the sub-sections below. Ingress packets (from the Ethernet Switch through PA to the host) are expected to
134 * follow the flow Ingress 0 -> Ingress 1 -> Ingress 2 -> Ingress 3-> Ingress 4 -> Post -> Host. Egress packets
135 * (from the host through PA out the switch) are expected to follow the flow Egress 0 -> Egress 1 -> Egress 2 ->
136 * Ethernet Switch. Ingress packets can be directly routed to egress path without host intervention. The packets
137 * can also be routed between PASS and SASS (Security Accelerator sub-system) multiple times to perform encryption,
138 * decryption and authentication operation.
139 * - Ingress 0 (2 PDSPs and 2 256-entry LUT1 engines):
140 * - PDSP0 and LUT1_0: SRIO/MAC header parsing and classification
141 * - PDSP1 and LUT1_1: L3/L4 header parsing and pre-IPSEC firewall (ACL) lookup
142 * - Ingress 1 (2 PDSPs and 2 256-entry LUT1 engines):
143 * - PDSP0 and LUT1_0: Outer IP or custom header parsing and classification
144 * - PDSP1 and LUT1_1: IPSEC NAT-T detection, IPSEC header parsing and classification
145 * - Ingress 2 (1 PDSP and 1 256-entry LUT1 engine):
146 * - PDSP0 and LUT1_0: 2nd IPSEC Header parsing and classification
147 * - Ingress 3 (1 PDSP and 1 256-entry LUT1 engine):
148 * - PDSP0 and LUT1_0: L3/L4 hearer parsing and post-IPSEC firewall (ACL) lookup
149 * - Ingress 4 (2 PDSPs, 1 256-entry LUT1 engine and 1 3000-entry LUT2 engine)
150 * - PDSP0 and LUT1_0: Inner IP or custom header parsing and classification
151 * - PDSP1 and LUT2: TCP/UDP/GTPU/Custom header parsing and LUT2 lookup
152 * - Post (2 PDSPs): Post-classification processing
153 * - Egress 0 (3 PDSPs and 1 256-entry LUT1 engine)
154 * - PDSP0: and LUT1_0: Inner L3/L4 header parsing and Flow cache lookup
155 * - PDSP1: Inner L3/L4 Header update and Tx command processing
156 * - PDSP2: Outer IP insertion/update, IPSEC pre-processing, inner IP fragmentation and Tx command processing
157 * - Egress 1 (1 PDSP): NAT-T header insertion or IPSEC pre-processing
158 * - Egress 2 (1 PDSP) L2 header insertion/update and outer IP fragmentation
159 *
160 * The second generation PASS also provides a Reassembly engine (RA) which can be connected from Ingress 0 and Ingress 3
161 * stage to perform outer and inner IP reassembly and the reassembled packets will be delivered to Ingress 1 and Ingress 4
162 * stage respectively. Besides, there is a programmable statistics engine which is used to provide PASS system statistics,
163 * ACL and Flow cache pre-entry statistics and user-defined statistics.
164 *
165 * To maintain backward compatibility, the second generation PASS LLD maintains the same APIs of the first generation LLD.
166 * New APIs are added for the new features such as ACL, Flow Cache and etc only.
167 *
168 */
170 /* Define PALLD Module as a master group in Doxygen format and add all PA LLD API
171 definitions to this group. */
172 /** @defgroup palld_module PA LLD Module API
173 * @{
174 */
175 /** @} */
177 /** @defgroup palld_api_functions PA LLD Functions
178 * @ingroup palld_module
179 */
181 /** @defgroup palld_api_macros PA LLD Macros
182 * @ingroup palld_module
183 */
185 /** @defgroup palld_api_structures PA LLD Data Structures
186 * @ingroup palld_module
187 */
189 /** @defgroup palld_api_constants PA LLD Constants (enum's and define's)
190 * @ingroup palld_module
191 */
193 /**
194 * @def pa_PARAMS_NOT_SPECIFIED
195 * Used for unspecified classification parameters
196 */
197 #define pa_PARAMS_NOT_SPECIFIED 0xFFFF
199 /**
200 * @def pa_LUT_INST_NOT_SPECIFIED
201 * Used if LUT1(or LUT2) instance is not specified
202 * In the case, the PA LLD will decide which LUT instance to use based on the API type and the previous link information
203 */
204 #define pa_LUT_INST_NOT_SPECIFIED -1
206 /**
207 * @def pa_LUT1_INDEX_NOT_SPECIFIED
208 * Used if LUT1 index is not specified
209 * In the case, the PASS will use the first available entry
210 */
211 #define pa_LUT1_INDEX_NOT_SPECIFIED -1
213 /**
214 * @def pa_MAX_NUM_LUT1_ENTRIES
215 * The maximum number of LUT1 entries
216 *
217 * @note These definitions are not used by LLD. They are defined here for reference
218 * purpose only.
219 *
220 */
221 #define pa_MAX_NUM_LUT1_ENTRIES_GEN1 64
222 #define pa_MAX_NUM_LUT1_ENTRIES_GEN2 256
223 #ifndef NSS_GEN2
224 #define pa_MAX_NUM_LUT1_ENTRIES pa_MAX_NUM_LUT1_ENTRIES_GEN1
225 #else
226 #define pa_MAX_NUM_LUT1_ENTRIES pa_MAX_NUM_LUT1_ENTRIES_GEN2
227 #endif
229 /**
230 * @defgroup ReturnValues Function Return Values
231 * @ingroup palld_api_constants
232 * @{
233 *
234 * @name PALLD Function Return Codes
235 *
236 * Error codes returned by PALLD API functions.
237 */
238 /*@{*/
239 /**
240 * @def pa_OK
241 * PA return code -- Function executed successfully
242 */
243 #define pa_OK 0
245 /**
246 * @def pa_ERR_CONFIG
247 * Invalid configuration provided to PA
248 */
249 #define pa_ERR_CONFIG -10
251 /**
252 * @def pa_INSUFFICIENT_CMD_BUFFER_SIZE
253 * The provided buffer was too small to hold the command
254 */
255 #define pa_INSUFFICIENT_CMD_BUFFER_SIZE -11
257 /**
258 * @def pa_INVALID_CMD_REPLY_DEST
259 * An invalid destination was provided for command replies
260 */
261 #define pa_INVALID_CMD_REPLY_DEST -12
263 /**
264 * @def pa_DUP_ENTRY
265 * A duplicate active entry was found in the handle table.
266 * If the module user intends to replace the associate routing
267 * information for the same entry, command packet should be
268 * delivered to the PASS via the PKTDMA sub-system
269 * Otherwise, module user may decide to drop the command packet and
270 * free the buffer.
271 */
272 #define pa_DUP_ENTRY -13
274 /**
275 * @def pa_INVALID_DUP_ENTRY
276 * A duplicate pending entry was found in the handle table
277 * This entry can not be handled until the pending entry
278 * becomes active
279 */
280 #define pa_INVALID_DUP_ENTRY -14
282 /**
283 * @def pa_INVALID_TABLE_MORE_SPECIFIC_ENTRY_PRESENT
284 * A more specific entry was found in the handle table
285 *
286 * @note: This error is depreciated at the next generation keystone device
287 */
288 #define pa_INVALID_TABLE_MORE_SPECIFIC_ENTRY_PRESENT -15
290 /**
291 * @def pa_INVALID_MPLS_LABEL
292 * An MPLS label exceeded 20 bits
293 */
294 #define pa_INVALID_MPLS_LABEL -16
296 /**
297 * @def pa_HANDLE_TABLE_FULL
298 * No room for an entry in the L2 table
299 */
300 #define pa_HANDLE_TABLE_FULL -17
302 /**
303 * @def pa_INVALID_INPUT_HANDLE
304 * Invalid handle provided
305 */
306 #define pa_INVALID_INPUT_HANDLE -18
308 /**
309 * @def pa_HANDLE_INACTIVE
310 * Operation requested on an inactive handle
311 */
312 #define pa_HANDLE_INACTIVE -19
314 /**
315 * @def pa_INVALID_IP_FLOW
316 * A flow label exceeded 20 bits
317 */
318 #define pa_INVALID_IP_FLOW -20
320 /**
321 * @def pa_WARN_ACTIVE_HANDLE_ACKED
322 * Sub-system reported activation of a handle already marked active
323 */
324 #define pa_WARN_ACTIVE_HANDLE_ACKED -21
326 /**
327 * @def pa_LUT_ENTRY_FAILED
328 * Sub-system could not make an entry to the LUT1 table
329 */
330 #define pa_LUT_ENTRY_FAILED -22
333 /**
334 * @def pa_RESUBMIT_COMMAND
335 * Sub-system could not handle the command due to memory. Command must be resubmitted
336 */
337 #define pa_RESUBMIT_COMMAND -23
339 /**
340 * @def pa_SYSTEM_STATE_INVALID
341 * Tried to download an image to a running PDSP
342 */
343 #define pa_SYSTEM_STATE_INVALID -24
345 /**
346 * @def pa_INVALID_LUT1_INDEX
347 * LUT1 index exceeds the LUT1 table range
348 */
349 #define pa_INVALID_LUT1_INDEX -25
351 /**
352 * @def pa_WARN_LNK_CNT_UNSYNC
353 * Warning: Link counter out of sync
354 */
355 #define pa_WARN_LNK_CNT_UNSYNC -26
357 /**
358 * @def pa_CMDSET_TOO_BIG
359 * The total length of commads in the command set exceeds the limit
360 */
361 #define pa_CMDSET_TOO_BIG -27
363 /**
364 * @def pa_INVALID_LUT_INST
365 * The specified LUT1 or LUT2 instance does not exist
366 */
367 #define pa_INVALID_LUT_INST -28
369 /**
370 * @def pa_RESOURCE_INIT_DENIED
371 * The resource initialization permission denied
372 */
373 #define pa_RESOURCE_INIT_DENIED -29
375 /**
376 * @def pa_RESOURCE_USE_DENIED
377 * The resource usage permission denied
378 */
379 #define pa_RESOURCE_USE_DENIED -30
382 /**
383 * @def pa_RESOURCE_FREE_DENIED
384 * The resource free permission denied
385 */
386 #define pa_RESOURCE_FREE_DENIED -31
388 /**
389 * @def pa_FIRMWARE_REVISION_DIFFERENCE
390 * The firmware revision difference
391 */
392 #define pa_FIRMWARE_REVISION_DIFFERENCE -32
394 /**
395 * @def pa_VIRTUAL_LINK_TABLE_FULL
396 * Virtual link table is full
397 */
398 #define pa_VIRTUAL_LINK_TABLE_FULL -33
399 /**
400 * @def pa_INVALID_DUP_ACL_ENTRY
401 * A duplicate ACL entry is found in the ACL table
402 * The ACL entry should be deleted before the same
403 * entry with updated action can be added.
404 *
405 */
406 #define pa_INVALID_DUP_ACL_ENTRY -34
408 /**
409 * @def pa_INVALID_ACL_ACTION
410 * The specified ACL action is not supported
411 */
412 #define pa_INVALID_ACL_ACTION -35
414 /**
415 * @def pa_INVALID_EF_REC_INDEX
416 * The index of Egress Flow record is out of range
417 */
418 #define pa_INVALID_EF_REC_INDEX -36
421 /**
422 * @def pa_EF_REC_CONFIG_ERR
423 * Egress Flow record update is rejected by PASS
424 */
425 #define pa_EF_REC_CONFIG_ERR -37
427 /**
428 * @def pa_PENDING_FC_ENTRY
429 * A pending Flow Cache entry is intended to be replaced
430 * with another entry by invoking API Pa_addFc() while
431 * it is still pending to be added into PASS LUT1 table.
432 * This entry can not be replaced until it becomes active
433 */
434 #define pa_PENDING_FC_ENTRY -38
436 /**
437 * @def pa_API_UNSUPPORTED
438 * The API is not supported by this generation of PASS
439 */
440 #define pa_API_UNSUPPORTED -39
442 /*@}*/
443 /** @} */
446 /**
447 * @defgroup cmdMinBufSize Command buffer minimum size requirements
448 * @ingroup palld_api_constants
449 * @{
450 *
451 * @name Command buffer minimum sizes
452 *
453 * Define command buffer minimum size requirements.
454 */
455 /* @{ */
457 /**
458 * @def pa_ADD_LUT1_MIN_CMD_BUF_SIZE_BYTES
459 * The minimum command buffer size required when using the @ref Pa_addSrio and @ref Pa_addCustomLUT1 function
460 */
461 #define pa_ADD_LUT1_MIN_CMD_BUF_SIZE_BYTES 124
463 /**
464 * @def pa_ADD_MAC_MIN_CMD_BUF_SIZE_BYTES
465 * The minimum command buffer size required when using the @ref Pa_addMac and @ref Pa_addMac2 function
466 */
467 #define pa_ADD_MAC_MIN_CMD_BUF_SIZE_BYTES pa_ADD_LUT1_MIN_CMD_BUF_SIZE_BYTES
469 /**
470 * @def pa_DEL_HANDLE_MIN_CMD_BUF_SIZE_BYTES
471 * The minimum command buffer size required when using the @ref Pa_delHandle function
472 */
473 #define pa_DEL_HANDLE_MIN_CMD_BUF_SIZE_BYTES 32
475 /**
476 * @def pa_DEL_L4_HANDLE_MIN_CMD_BUF_SIZE_BYTES
477 * The minimum command buffer size required when using the @ref Pa_delL4Handle function
478 */
479 #define pa_DEL_L4_HANDLE_MIN_CMD_BUF_SIZE_BYTES 28
481 /**
482 * @def pa_ADD_IP_MIN_CMD_BUF_SIZE_BYTES
483 * The minimum command buffer size required when using the @ref Pa_addIp and @ref Pa_addIp2 functions
484 */
485 #define pa_ADD_IP_MIN_CMD_BUF_SIZE_BYTES 240
487 /**
488 * @def pa_ADD_LUT2_MIN_CMD_BUF_SIZE_BYTES
489 * The minimum command buffer size required when using the @ref Pa_addCustomLUT2 function
490 */
491 #define pa_ADD_LUT2_MIN_CMD_BUF_SIZE_BYTES 48
493 /**
494 * @def pa_ADD_PORT_MIN_CMD_BUF_SIZE_BYTES
495 * The minimum command buffer size required when using the @ref Pa_addPort function
496 */
497 #define pa_ADD_PORT_MIN_CMD_BUF_SIZE_BYTES pa_ADD_LUT2_MIN_CMD_BUF_SIZE_BYTES
499 /**
500 * @def pa_CONFIG_EXCEPTION_ROUTE_MIN_CMD_BUF_SIZE_BYTES
501 * The minimum command buffer size required when using the @ref Pa_configExceptionRoute and @ref Pa_configEflowExceptionRoute function
502 */
503 #define pa_CONFIG_EXCEPTION_ROUTE_MIN_CMD_BUF_SIZE_BYTES 520
505 /**
506 * @def pa_CONFIG_CRC_ENGINE_MIN_CMD_BUF_SIZE_BYTES
507 * The minimum command buffer size required when using the @ref Pa_configCrcEngine function
508 */
509 #define pa_CONFIG_CRC_ENGINE_MIN_CMD_BUF_SIZE_BYTES 88
511 /**
512 * @def pa_CONFIG_MULTI_ROUTE_MIN_CMD_BUF_SIZE_BYTES
513 * The minimum command buffer size required when using the @ref Pa_configMultiRoute function
514 */
515 #define pa_CONFIG_MULTI_ROUTE_MIN_CMD_BUF_SIZE_BYTES 84
517 /**
518 * @def pa_SET_CUSTOM_LUT1_MIN_CMD_BUF_SIZE_BYTES
519 * The minimum command buffer size required when using the @ref Pa_setCustomLUT1 function
520 */
521 #define pa_SET_CUSTOM_LUT1_MIN_CMD_BUF_SIZE_BYTES 60
523 /**
524 * @def pa_SET_CUSTOM_LUT2_MIN_CMD_BUF_SIZE_BYTES
525 * The minimum command buffer size required when using the @ref Pa_setCustomLUT2 function
526 */
527 #define pa_SET_CUSTOM_LUT2_MIN_CMD_BUF_SIZE_BYTES 36
529 /**
530 * @def pa_CONFIG_CMD_SET_MIN_CMD_BUF_SIZE_BYTES
531 * The minimum command buffer size allowed when using the @ref Pa_configCmdSet and @ref Pa_formatTxCmd function
532 */
533 #define pa_CONFIG_CMD_SET_MIN_CMD_BUF_SIZE_BYTES 144
535 /**
536 * @def pa_REQUEST_STATS_MIN_CMD_BUF_SIZE_BYTES
537 * The minimum command buffer size required when using the @ref Pa_requestStats and @ref Pa_requestUsrStats functions
538 */
539 #define pa_REQUEST_STATS_MIN_CMD_BUF_SIZE_BYTES 24
541 /**
542 * @def pa_CONFIG_USR_STATS_MIN_CMD_BUF_SIZE_BYTES
543 * The minmium command buffer size allowed when using the @ref Pa_configUsrStats function with the maximum number of
544 * user-defined statistics. The size of command packet is calculated as 20 + (number of statistic entries) * 4.
545 */
546 #define pa_CONFIG_USR_STATS_MIN_CMD_BUF_SIZE_BYTES 2068
548 /**
549 * @def pa_GLOBAL_CONFIG_MIN_CMD_BUF_SIZE_BYTES
550 * The minmium command buffer size allowed when using the @ref Pa_control (pa_CONTROL_SYS_CONFIG) function to perform PASS
551 * global configuration.
552 */
553 #define pa_GLOBAL_CONFIG_MIN_CMD_BUF_SIZE_BYTES 72
555 /**
556 * @def pa_802_1ag_DET_MIN_CMD_BUF_SIZE_BYTES
557 * The minmium command buffer size allowed when using the @ref Pa_control (pa_CONTROL_802_1ag_CONFIG) function to configure
558 * the 802.1ag packet detector.
559 */
560 #define pa_802_1ag_DET_MIN_CMD_BUF_SIZE_BYTES 24
562 /**
563 * @def pa_IPSEC_NAT_T_DET_MIN_CMD_BUF_SIZE_BYTES
564 * The minmium command buffer size allowed when using the @ref Pa_control (pa_CONTROL_IPSEC_NAT_T_CONFIG) function to configure
565 * the IPSEC NAT-T packet detector.
566 */
567 #define pa_IPSEC_NAT_T_DET_MIN_CMD_BUF_SIZE_BYTES 24
569 /**
570 * @def pa_GTPU_CONFIG_MIN_CMD_BUF_SIZE_BYTES
571 * The minmium command buffer size allowed when using the @ref Pa_control (pa_CONTROL_GTPU_CONFIG) function to configure
572 * the GTUP classification operation.
573 */
574 #define pa_GTPU_CONFIG_MIN_CMD_BUF_SIZE_BYTES 24
576 /**
577 * @def pa_EMAC_PORT_CONFIG_MIN_CMD_BUF_SIZE_BYTES
578 * The minmium command buffer size allowed when using the @ref Pa_control (pa_CONTROL_EMAC_PORT_CONFIG) function to configure
579 * the ethernet port configuration operations.
580 */
581 #define pa_EMAC_PORT_CONFIG_MIN_CMD_BUF_SIZE_BYTES 632
583 /**
584 * @def pa_MAX_CMD_BUF_SIZE_BYTES
585 * The maximum command buffer size requested when using any PA API call which generates command packet.
586 */
587 #define pa_MAX_CMD_BUF_SIZE_BYTES 2068
589 /* @} */
590 /** @} */
593 /**
594 * @ingroup palld_api_structures
595 * @brief MAC address specification
596 *
597 * @details This type is used to pass MAC addresses (see @ref netlayers) to the module. The most significant byte
598 * of the mac address is placed in array element 0.
599 */
600 #define pa_MAC_ADDR_SIZE 6
601 typedef unsigned char paMacAddr_t[pa_MAC_ADDR_SIZE];
603 /**
604 * @ingroup palld_api_structures
605 * @brief IPv4 address specification
606 *
607 * @details This type is used to pass IPv4 addresses (see @ref netlayers) to the module. The most significant byte
608 * of the IP address is placed in array element 0.
609 */
610 #define pa_IPV4_ADDR_SIZE 4
611 typedef unsigned char paIpv4Addr_t[pa_IPV4_ADDR_SIZE];
613 /**
614 * @ingroup palld_api_structures
615 * @brief IPv6 address specificiation
616 *
617 * @details This type is used to pass IPv6 addresses (see @ref netlayers) to the module. The most significant byte
618 * of the IP address is placed in array element 0.
619 */
620 #define pa_IPV6_ADDR_SIZE 16
621 typedef unsigned char paIpv6Addr_t[pa_IPV6_ADDR_SIZE];
623 /**
624 * @ingroup palld_api_structures
625 * @brief IP address specification
626 *
627 * @details This union is used to specify an IP address to the module. The type in the union is determined
628 * through other parameters passed to the module (see @ref IpValues).
629 */
630 typedef union {
632 paIpv6Addr_t ipv6; /**< IPv6 address */
633 paIpv4Addr_t ipv4; /**< IPv4 address */
635 } paIpAddr_t;
637 /**
638 * @defgroup IpValues IP types
639 * @ingroup palld_api_constants
640 * @{
641 *
642 * @name IP Values
643 * @brief Defines the IP version type used.
644 *
645 * @details The packet accelerator module parses both IPv4 and IPv6 network layer headers (see @ref netlayers).
646 * This group is used to distinguish which type of header will be used.
647 */
648 /* @{ */
649 /**
650 * @def pa_IPV4
651 * IPv4
652 */
653 #define pa_IPV4 4
655 /**
656 * @def pa_IPV6
657 * IPv6
658 */
659 #define pa_IPV6 6
661 /* @} */
662 /** @} */
665 /**
666 * @ingroup palld_api_structures
667 * @brief Specification of Pa_Handle
668 *
669 * The Pa_Handle is used to identify a PA LLD instance
670 */
671 typedef void* Pa_Handle;
673 /**
674 * @ingroup palld_api_structures
675 * @brief PA handle specification for L2 and L3 (LUT1) handles
676 *
677 * @details This type is used to reference L2 and L3 (LUT1) routing information (see @ref netlayers). The module
678 * user is responsible for storing the handle and using it to refer to routing information already
679 * created through calls to @ref Pa_addMac, @ref Pa_addSrio, @ref Pa_addCustomLUT1 and @ref Pa_addIp.
680 */
681 typedef void* paHandleL2L3_t;
683 /**
684 * @ingroup palld_api_structures
685 * @brief PA link handle specification for L2, L3 (LUT1) and virtual link handles
686 *
687 * @details This type is used to reference L2, L3 (LUT1) and virtual link information. The module
688 * user is responsible for storing the handle and using it to refer to L2/L3/Virtual link handle already
689 * created through calls to @ref Pa_addMac, @ref Pa_addSrio, @ref Pa_addCustomLUT1, @ref Pa_addIp and
690 * @ref Pa_addVirtualLink
691 */
692 typedef void* paLnkHandle_t;
694 /**
695 * @ingroup palld_api_structures
696 * @brief PA handle specification for ACL (LUT1) handles
697 *
698 * @details This type is used to reference ACL (LUT1) entry with the ACL table. The module
699 * user is responsible for storing the handle and using it to refer to ACL entry already
700 * created through calls to @ref Pa_addAcl.
701 */
702 typedef void* paHandleAcl_t;
704 /**
705 * @ingroup palld_api_structures
706 * @brief PA handle specification for Flow Cache (LUT1) handles
707 *
708 * @details This type is used to reference Flow Cache (LUT1) entry with the Flow Cache (FC) table. The module
709 * user is responsible for storing the handle and using it to refer to Flow Cache entry already
710 * created through calls to @ref Pa_addFc.
711 */
712 typedef void* paHandleFc_t;
714 /**
715 * @brief The un-linked inner IP handle
716 *
717 * @details This handle value is used to specify an inner IP (tunnel) which the application does not
718 * want to link to an outer IP address.
719 */
720 #define PA_LLD_HANDLE_IP_INNER ((paHandleL2L3_t)1)
722 /**
723 * @ingroup palld_api_structures
724 * @brief PA handle specification for L4 (LUT2) handles
725 *
726 * @details This type is used to reference L4 (LUT2) routing information (see @ref netlayers). The module user
727 * is responsible for storing the handle. It is used again only to delete a created route.
728 *
729 */
730 typedef uint32_t paHandleL4_t[3];
733 /**
734 * @ingroup palld_api_structures
735 * @brief A generic entry handle types
736 *
737 * @details The union of both entry handle types used by the module is used only in function @ref Pa_forwardResult.
738 * The function will return the corresponding entry type and its handle in the command response packets when a LUT1
739 * or LUT2 entry is added into the LUT1/LUT2 table successfully.
740 * The handle entry will be set to zero in all other cases
741 */
742 typedef union {
744 paHandleL2L3_t l2l3Handle; /**< Level 2 or level 3 handle created by @ref Pa_addMac @ref Pa_addSrio, @ref Pa_addCustomLUT1 or @ref Pa_addIp */
745 paHandleAcl_t aclHandle; /**< ACL handle created by @ref Pa_addAcl (Gen2 only) */
746 paHandleFc_t fclHandle; /**< Flow Cache handle created by @ref Pa_addFc (Gen2 only) */
747 paHandleL4_t l4Handle; /**< Level 4 handle created by @ref Pa_addPort or @ref Pa_addCustomLUT2 */
749 } paEntryHandle_t;
751 /**
752 * @ingroup palld_api_constants
753 * @{
754 * @brief The number of bytes available for custom lookup
755 *
756 * @details Custom lookup sizes are fixed by hardware
757 */
758 #define pa_NUM_BYTES_CUSTOM_LUT1 32
759 #define pa_NUM_BYTES_CUSTOM_LUT2 4
760 /** @} */
762 /**
763 * @defgroup HandleTypes Handle Types
764 *
765 * @ingroup palld_api_constants
766 * @{
767 *
768 * @name Handle Types
769 *
770 * @brief These values are used to describe what type of handle is referenced.
771 *
772 * @details These values are used only for function @ref Pa_forwardResult. The function returns with a copy
773 * of the handle, which the module user should already have, along with the type of handle. The
774 * module user can use this information to verify that a particular handle has been fully activated
775 * and can be used for linking reference in calls to @ref Pa_addIp, @ref Pa_addCustomLUT1,
776 * @ref Pa_addCustomLUT2, @ref Pa_addPort or @ref Pa_addAcl.
777 */
778 /* @{ */
779 /**
780 *
781 * @def pa_L2_HANDLE
782 * Level 2 (MAC/SRIO) handle
783 */
784 #define pa_L2_HANDLE 2
786 /**
787 * @def pa_L3_HANDLE
788 * Level 3 (IP, Custom LUT1) handle
789 */
790 #define pa_L3_HANDLE 3
792 /**
793 * @def pa_L4_HANDLE
794 * Level 4 (TCP/UDP/GTP-U/Custom LUT2) handle
795 */
796 #define pa_L4_HANDLE 4
798 /**
799 * @def pa_ACL_HANDLE
800 * ACL (Access Control List) handle
801 */
802 #define pa_ACL_HANDLE 10
804 /**
805 * @def pa_FC_HANDLE
806 * FC (Flow Cache) handle
807 */
808 #define pa_FC_HANDLE 11
810 /**
811 * @def pa_INVALID_HANDLE
812 * Invalid handle type
813 */
814 #define pa_INVALID_HANDLE -1
816 /* @} */
817 /** @} */
819 /**
820 * @defgroup ErouteTypes Exception Route Types
821 * @ingroup palld_api_constants
822 * @{
823 *
824 * @name Exception Route Types
825 *
826 * @brief These values are used to define exception route conditions.
827 *
828 * @details The exception route defines the global routing information when the exception condition such
829 * as LUT1 lookup failure, packet parsing failure, broadcast packet detection and etc. Multiple
830 * exception routes can be configured through @ref Pa_configExceptionRoute. All the exception
831 * routes are disabled by default.
832 */
833 /* @{ */
834 /**
835 *
836 * @def pa_EROUTE_L2L3_FAIL
837 * packet failed to match in L2/L3 (LUT1) table
838 */
839 #define pa_EROUTE_L2L3_FAIL 0
841 /**
842 * @def pa_EROUTE_VLAN_MAX_DEPTH
843 * packet exceeded maximum number of VLAN tags
844 */
845 #define pa_EROUTE_VLAN_MAX_DEPTH 1
847 /**
848 * @def pa_EROUTE_IP_MAX_DEPTH
849 * packet exceeded maximum number of IP headers
850 */
851 #define pa_EROUTE_IP_MAX_DEPTH 2
853 /**
854 * @def pa_EROUTE_MPLS_MAX_DEPTH
855 * packet exceeded maximum number of MPLS headers
856 */
857 #define pa_EROUTE_MPLS_MAX_DEPTH 3
859 /**
860 * @def pa_EROUTE_GRE_MAX_DEPTH
861 * packet exceeded maximum number of GRE headers
862 */
863 #define pa_EROUTE_GRE_MAX_DEPTH 4
865 /**
866 * @def pa_EROUTE_PARSE_FAIL
867 * packet failed to parse
868 */
869 #define pa_EROUTE_PARSE_FAIL 5
871 /**
872 * @def pa_EROUTE_L4_FAIL
873 * packet failed to match in L4 (LUT2) table
874 */
875 #define pa_EROUTE_L4_FAIL 6
877 /**
878 * @def pa_EROUTE_IP_FRAG
879 * IP fragmented packet
880 */
881 #define pa_EROUTE_IP_FRAG 7
883 /**
884 * @def pa_EROUTE_IPV6_OPT_FAIL
885 * Packet failed due to unsupported IPV6 option header
886 */
887 #define pa_EROUTE_IPV6_OPT_FAIL 8
889 /**
890 * @def pa_EROUTE_UDP_LITE_FAIL
891 * UDP lite packet had invalid checksum coverage
892 */
893 #define pa_EROUTE_UDP_LITE_FAIL 9
895 /**
896 * @def pa_EROUTE_ROUTE_OPTION
897 * IP routing had incomplete routes
898 */
899 #define pa_EROUTE_ROUTE_OPTION 10
901 /**
902 * @def pa_EROUTE_SYSTEM_FAIL
903 * Sub-system detected internal error
904 */
905 #define pa_EROUTE_SYSTEM_FAIL 11
907 /**
908 * @def pa_EROUTE_MAC_BROADCAST
909 * MAC broadcast packet which is not specified at the lookup table
910 */
911 #define pa_EROUTE_MAC_BROADCAST 12
913 /**
914 * @def pa_EROUTE_MAC_MULTICAST
915 * MAC multicast packet which is not specified at the lookup table
916 */
917 #define pa_EROUTE_MAC_MULTICAST 13
919 /**
920 * @def pa_EROUTE_IP_BROADCAST
921 * IP broadcast packet which is not specified at the lookup table
922 */
923 #define pa_EROUTE_IP_BROADCAST 14
925 /**
926 * @def pa_EROUTE_IP_MULTICAST
927 * IP multicast packet which is not specified at the lookup table
928 */
929 #define pa_EROUTE_IP_MULTICAST 15
931 /**
932 * @def pa_EROUTE_GTPU_MESSAGE_TYPE_1
933 * GTP-U PING Request packet
934 */
935 #define pa_EROUTE_GTPU_MESSAGE_TYPE_1 16
937 /**
938 * @def pa_EROUTE_GTPU_MESSAGE_TYPE_2
939 * GTP-U PING Response packet
940 */
941 #define pa_EROUTE_GTPU_MESSAGE_TYPE_2 17
943 /**
944 * @def pa_EROUTE_GTPU_MESSAGE_TYPE_26
945 * GTP-U Error Indication packet
946 */
947 #define pa_EROUTE_GTPU_MESSAGE_TYPE_26 18
949 /**
950 * @def pa_EROUTE_GTPU_MESSAGE_TYPE_31
951 * GTP-U Supported Header Notification packet
952 */
953 #define pa_EROUTE_GTPU_MESSAGE_TYPE_31 19
955 /**
956 * @def pa_EROUTE_GTPU_MESSAGE_TYPE_254
957 * GTP-U End Markr packet
958 */
959 #define pa_EROUTE_GTPU_MESSAGE_TYPE_254 20
961 /**
962 * @def pa_EROUTE_GTPU_FAIL
963 * Packet failed due to GTPU parsing error or unsupporte dmessage types
964 */
965 #define pa_EROUTE_GTPU_FAIL 21
967 /**
968 * @def pa_EROUTE_PPPoE_FAIL
969 * Packet failed due to PPPoE session packet parsing error
970 */
971 #define pa_EROUTE_PPPoE_FAIL 22
973 /**
974 * @def pa_EROUTE_PPPoE_CTRL
975 * PPPoE session stage non-IP packets
976 */
977 #define pa_EROUTE_PPPoE_CTRL 23
979 /**
980 * @def pa_EROUTE_802_1ag
981 * 802.1ag Packet
982 */
983 #define pa_EROUTE_802_1ag 24
985 /**
986 * @def pa_EROUTE_IP_FAIL
987 * Packet failed due to invalid IP header
988 */
989 #define pa_EROUTE_IP_FAIL 25
991 /**
992 * @def pa_EROUTE_NAT_T_KEEPALIVE
993 * NAT-T Keep Alive packet where UDP Length = 9, data = 0xFF
994 */
995 #define pa_EROUTE_NAT_T_KEEPALIVE 26
997 /**
998 * @def pa_EROUTE_NAT_T_CTRL
999 * NAT-T control packet where UDP Length > 12 and the first 4 payload bytes are equal to 0
1000 */
1001 #define pa_EROUTE_NAT_T_CTRL 27
1003 /**
1004 * @def pa_EROUTE_NAT_T_DATA
1005 * NAT-T IPSEC ESP data packet where UDP Length > 12 and the first 4 payload bytes are not equal to 0
1006 */
1007 #define pa_EROUTE_NAT_T_DATA 28
1009 /**
1010 * @def pa_EROUTE_NAT_T_FAIL
1011 * Invalid NAT-T packet
1012 */
1013 #define pa_EROUTE_NAT_T_FAIL 29
1015 /**
1016 * @def pa_EROUTE_GTPU_MATCH_FAIL
1017 * GTPU match failed
1018 */
1019 #define pa_EROUTE_GTPU_MATCH_FAIL 30
1021 /**
1022 * @def pa_EROUTE_MAX
1023 * The maximum number of global route types
1024 */
1025 #define pa_EROUTE_MAX 31
1027 /* @} */
1028 /** @} */
1031 /**
1032 * @defgroup NextHeaderTypes Next Header types
1033 * @ingroup palld_api_constants
1034 * @{
1035 *
1036 * @name Next Header types
1037 *
1038 * @brief These values are used to define the next header (protocol) types for continus parsing after the
1039 * SRIO and custom parsing.
1040 *
1041 * @details The next header type can be derived from the upper layer header in a standard Ethernet packet.
1042 * For SRIO and custom LUT1 lookup, the next header type should be provided by the user in function
1043 * @ref Pa_setCustomLUT1 and @ref Pa_addSrio.
1044 */
1045 /* @{ */
1046 /**
1047 *
1048 * @def pa_HDR_TYPE_MAC
1049 * MAC header
1050 */
1051 #define pa_HDR_TYPE_MAC 0
1053 /**
1054 *
1055 * @def pa_HDR_TYPE_IPV4
1056 * IPv4 header
1057 */
1058 #define pa_HDR_TYPE_IPV4 1
1061 /**
1062 *
1063 * @def pa_HDR_TYPE_IPV6
1064 * IPv6 header
1065 */
1066 #define pa_HDR_TYPE_IPV6 2
1068 /**
1069 *
1070 * @def pa_HDR_TYPE_CUSTOM_LUT1
1071 * Custom LUT1 header
1072 */
1073 #define pa_HDR_TYPE_CUSTOM_LUT1 3
1075 /**
1076 *
1077 * @def pa_HDR_TYPE_UDP
1078 * UDP header
1079 */
1080 #define pa_HDR_TYPE_UDP 4
1082 /**
1083 *
1084 * @def pa_HDR_TYPE_UDP_LITE
1085 */
1086 #define pa_HDR_TYPE_UDP_LITE 5
1088 /**
1089 *
1090 * @def pa_HDR_TYPE_TCP
1091 * TCP header
1092 */
1093 #define pa_HDR_TYPE_TCP 6
1095 /**
1096 *
1097 * @def pa_HDR_TYPE_CUSTOM_LUT2
1098 * Custom LUT2 header
1099 */
1100 #define pa_HDR_TYPE_CUSTOM_LUT2 7
1102 /**
1103 *
1104 * @def pa_HDR_TYPE_UNKNOWN
1105 * next header type is not specified
1106 */
1107 #define pa_HDR_TYPE_UNKNOWN 8
1109 /* @} */
1110 /** @} */
1112 /**
1113 * @ingroup palld_api_structures
1114 * @brief pa RM Handle
1115 */
1116 typedef void * pa_RmHnd;
1118 /**
1119 * @ingroup palld_api_structures
1120 * @brief PA start configuration structure
1121 */
1122 typedef struct
1123 {
1124 pa_RmHnd rmServiceHandle; /**< Resource Manager service handle */
1125 uint32_t baseAddr; /**< Specify the PASS base address */
1126 void* instPoolBaseAddr; /**< Base address of the global shared memory pool from which global
1127 LLD instance & channel instance memory is allocated */
1128 } paStartCfg_t;
1130 /**
1131 * @ingroup palld_api_structures
1132 * @brief Pointer to the buffer where the PASS command is placed
1133 *
1134 * @details Functions in this module produce formatted commands that must be sent to the packet accelerator
1135 * sub-system. These commands are always referred to through this type.
1136 */
1137 typedef void* paCmd_t;
1139 /**
1140 * @ingroup palld_api_structures
1141 * @brief PA Ip traffic flow information structure
1142 *
1143 * @details Snap shot of the PA Reassembly traffic flow information structure
1144 */
1145 typedef struct
1146 {
1147 int32_t index; /** < active traffic flow index, -1:for inactive traffic flow */
1148 uint32_t srcIp; /** < source IP address: complete IP address for IPv4 OR lower 32 bits in IPv6 */
1149 uint32_t dstIp; /** < destination IP address: complete IP address for IPv4 OR lower 32 bits in IPv6 */
1150 uint16_t proto; /** < protocol field in IP header */
1151 uint16_t count; /** < number of pending fragments and non-fragmented pkts */
1152 } pa_ReassemblyFlow_t;
1154 /**
1155 * @ingroup palld_api_structures
1156 * @brief PA Ip Reassembly control context snap shot Information Structure
1157 *
1158 * @details The PA Reassembly control context structure contains the snap shot of the
1159 * reassembly context information.
1160 */
1161 typedef struct
1162 {
1163 uint16_t numTF; /** < Maximum number of traffic flow entries */
1164 uint16_t numActiveTF; /** < number of active traffic flows */
1165 uint16_t queue; /** < The destination queue where PASS will deliver
1166 the packets which require reassembly assistance */
1167 uint16_t flowId; /** < CPPI Flow which instructs how free queues are used
1168 for receiving the packets */
1169 pa_ReassemblyFlow_t traffic_flow[32]; /**< traffic flow snap shot */
1170 } pa_trafficFlow_t;
1172 typedef struct
1173 {
1174 pa_trafficFlow_t outer; /** < Outer IP traffic flow Reassembly context */
1175 pa_trafficFlow_t inner; /** < Inner IP traffic flow Reassembly context */
1176 } pa_ReassemblyContext_t;
1180 /**
1181 * @defgroup dbgInfoType PA Packet Debug Operation type Definitions
1182 * @ingroup palld_api_constants
1183 * @{
1184 *
1185 * @name PA Packet Debug information type
1186 *
1187 * Debug information type in @ref paSnapShotDebugInfo_t
1188 *
1189 */
1190 /*@{*/
1192 /**
1193 * @def pa_DBG_INFO_TYPE_REASSEMBLY_ENABLE
1194 * Debug Info -- Set: Perform snap shot of reassembly control information
1195 * Clear: Snap shot operation is not performed
1196 */
1197 #define pa_DBG_INFO_TYPE_REASSEMBLY_ENABLE 0x0001
1199 /*@}*/
1200 /** @} */
1202 /**
1203 * @ingroup palld_api_structures
1204 * @brief PA Debug Information Structure
1205 *
1206 * @details The PA debug information structure contains the snap shot of the
1207 * hardware registers sampled at a particular time.
1208 */
1209 typedef struct
1210 {
1211 uint32_t debugInfoType; /**< Debug extract operation control
1212 information as defined at @ref dbgInfoType */
1214 union {
1215 pa_ReassemblyContext_t reassemContext;
1216 } u;
1217 } paSnapShotDebugInfo_t;
1219 /**
1220 * @ingroup palld_api_structures
1221 * @brief PA Size Configuration Structure
1222 *
1223 * @details The module is configured at run time with a maximum number of handles supported. The module
1224 * maintains a set of handles and links between handles.
1225 */
1226 typedef struct {
1228 int nMaxL2; /**< Maximum number of L2 handles supported */
1229 int nMaxL3; /**< Maximum number of L3 handles supported */
1230 int nUsrStats;/**< Maximum number of user-defined statistics supported (maximum: 512)*/
1231 int nMaxVlnk; /**< Maximum number of virtual links supported */
1232 int nMaxAcl; /**< Maximum number of Stateless ACL handles supported (Gen2 only)*/
1233 int nMaxFc; /**< Maximum number of Flow Cache Hanndles supported (Gen2 only) */
1234 } paSizeInfo_t;
1236 /**
1237 * @ingroup salld_api_constants
1238 * @{
1239 * @brief PA Reassembly Engine related constant definitions
1240 */
1241 #define pa_RA_MAX_HEAP_REGIONS 2 /**< Maxmium number of RA Heap Regions */
1242 #define pa_RA_NUM_GROUPS 2 /**< Number of RA groups */
1244 /**
1245 * @ingroup palld_api_structures
1246 * @brief PA Reassembly Engine global config structure
1247 *
1248 * @details The parameters in this structure are used to configure the Reassembly
1249 * engine with PASS
1250 */
1251 typedef struct {
1252 int ipv4MinPktSize; /**< Specify the minimum packet size in bytes for a fragment of an
1253 Ipv4 packet that is not the last fragment. The deafult value
1254 is 68 byte to contain 60 bytes of IP header including options
1255 plus 8-byte of payload */
1256 int numCxts; /**< Total number of contexts the RA handles. This value affects
1257 the amount of heap memory that needs to be allocated. This
1258 value must be between 0x1 and 0x400 (1k). If set to 0, all
1259 fragments will be discarded. The default value is 0x400. */
1260 int cxtDiscardThresh; /**< Number of concurrent contexts that, once reached, causes the
1261 oldest current context to be forcibly timed out. To prevent
1262 this behavior, this value should be programmed to be equal to
1263 or greater than the Total Contexts. This value must be between
1264 0x1 and 0x400 (1k). The default value is 0x400. */
1265 int nodeDiscardThresh; /**< Number of Nodes that, once reached, causes the oldest current
1266 context to be forcibly timed out. To prevent this behavior,
1267 this value should be programmed to be the maximum value
1268 (there are 4K total nodes). This value must be between 0x1
1269 and 0x1000 (4K). The default value is 0xFFF. */
1270 int cxtTimeout; /**< Amount of time (in ms) after a new context has been allocated until
1271 that context times out. If timeout occurs before a packet is completely
1272 reassembled and the SOP fragment has been received, a packet containing
1273 the IP header and the first 8 bytes of data is forwarded up to the host
1274 that it can respond with an ICPM Time Exceeded message as per RFC 792.
1275 If a context times out and the SOP fragment has not been received,
1276 the packet is discarded and the context freed. */
1277 int clockRate; /**< Clock rate of the Reassembly engine in MHz. */
1278 int heapRegionThresh; /**< Number of contexts handled in Region 0 of the Reassembly Heap. All contexts
1279 in excess of this number are handled in Region 1. If Region 1 is not used,
1280 this value should be set equal to (or higher) than Total Contexts. */
1281 uint64_t heapBase[pa_RA_MAX_HEAP_REGIONS]; /**< Reassembly Heap addresses which should be 64-byte aligned */
1282 } paRaConfig_t;
1285 /**
1286 * @ingroup palld_api_structures
1287 * @brief PA Initialization config structure
1288 *
1289 * @details The parameters in this structure are used to do initial setup
1290 * of the driver including its base address and other default settings.
1291 *
1292 * @note The stream interface switch controls the destination of the traffic
1293 * from the Ethernet switch. The default setting of the streaming
1294 * interface switch is to route all traffic to host queues.
1295 * This module is designed to receive the incoming packets at the PDSP0.
1296 * If the initDeafultRoute is set to TRUE, this module will re-configure
1297 * the stream interface switch to route all traffic to PDSP0. Otherwise,
1298 * it is the module user's reponsibility to deliver incoming packets
1299 * to PDSP0 via the CPPI/QMSS interface.
1300 */
1301 typedef struct {
1302 uint16_t initTable; /**< If True then the L2/L3/ACL tables are initialized */
1303 uint16_t initDefaultRoute; /**< If True then the switch default route is set to PASS PDSP0 */
1304 uint32_t baseAddr; /**< Specify the PASS base address */
1305 void* instPoolBaseAddr; /**< Base address of the global shared memory pool from which global
1306 LLD instance & channel instance memory is allocated */
1307 pa_RmHnd rmServiceHandle; /**< Resource Manager service handle */
1308 paSizeInfo_t* sizeCfg; /**< Pointer to the size configuration information */
1309 paRaConfig_t* raCfg; /**< Pointer to the RA global configuration information (Gen2 only) */
1310 } paConfig_t;
1312 /**
1313 * @ingroup salld_api_constants
1314 * @{
1315 * @brief Protocol Limit related constant definitions
1316 */
1317 #define pa_PROTOCOL_LIMIT_NUM_VLANS_DEF 2 /**< Number of VLAN supported: default value */
1318 #define pa_PROTOCOL_LIMIT_NUM_IP_DEF 2 /**< Number of IP layers supported: default value */
1319 #define pa_PROTOCOL_LIMIT_NUM_GRE_DEF 2 /**< Number of GRE layers supported: default value */
1320 #define pa_PROTOCOL_LIMIT_NUM_VLANS_MAX 3 /**< Number of VLAN supported: maximum value */
1321 #define pa_PROTOCOL_LIMIT_NUM_IP_MAX 7 /**< Number of IP layers supported: maximum value */
1322 #define pa_PROTOCOL_LIMIT_NUM_GRE_MAX 7 /**< Number of GRE layers supported: maximum value */
1324 /** @} */
1326 /**
1327 * @ingroup palld_api_structures
1328 * @brief Protocol-specific Limitations.
1329 *
1330 * @details paProtocolLimit_t is used to defines the protocol-specific restrictions. For example,
1331 * it is necessary to limit the number of protocol layers such as GRE of the input packets
1332 * to prevent the irregular packets take too much processing time.
1333 * The PASS will detect the packets which violate the protocol-specific restrictions and either discard
1334 * or forward the packets to host queues which can be specified through API @ref Pa_configExceptionRoute.
1335 *
1336 * @note The PASS will work when non-default values are used. However, it may limit the supported packet rate
1337 * below wire rate.
1338 */
1339 typedef struct {
1341 uint8_t vlanMax; /**< Maximum number of VLANs supported, default = 2, maximum = 3 */
1342 uint8_t ipMax; /**< Maximum number of IP layers supported, default = 2, maximum = 7 */
1343 uint8_t greMax; /**< Maximum number of GRE layers supported, default = 2, maximum = 7 */
1345 } paProtocolLimit_t;
1347 /**
1348 * @ingroup palld_api_structures
1349 * @brief IP Reassembly Configuration Information.
1350 *
1351 * @details paIpReassmConfig_t is used to configure the PA-assisted IP reassembly operation. Two separate structures are used
1352 * for the outer IP and inner IP respectively. The IP reassembly assistance feature is disabled until
1353 * this information is provided. See section @ref appendix3 for deatiled description.
1354 * @note The maximum number of traffic flows is limited due to processing time and internal memory restriction.
1355 */
1356 typedef struct {
1358 uint8_t numTrafficFlow; /**< Maximum number of IP reassembly traffic flows supported, default = 0, maximum = 32 */
1359 uint8_t destFlowId; /**< CPPI flow which instructs how the link-buffer queues are used for forwarding packets */
1360 uint16_t destQueue; /**< Destination host queue where PASS will deliver the packets which require IP reassembly assistance */
1362 } paIpReassmConfig_t;
1364 /**
1365 * @ingroup palld_api_constants
1366 * @brief Define the maximum number of IP reassembly traffic flows
1367 *
1368 */
1369 #define pa_MAX_IP_REASM_TRAFFIC_FLOWS 32
1371 /**
1372 * @ingroup palld_api_structures
1373 * @brief Command Set Configuration Information.
1374 *
1375 * @details paCmdSetConfig_t defines command set configuration parameters such as the maximum number of command sets.
1376 * The PASS supports either 64 of 64-byte or 32 of 128-byte command sets. The number of command sets should
1377 * be configured at system startup.
1378 */
1379 typedef struct {
1381 uint8_t numCmdSets; /**< Number of command sets supported (32, 64), default = 64
1382 @note If the number of command sets is set to 64, then each command entry will be limited to 64 bytes.
1383 If the number of command sets is set to 32, then each command entry will be limited to 128 bytes */
1384 } paCmdSetConfig_t;
1386 /**
1387 * @ingroup palld_api_structures
1388 * @brief User-defined Statistics Configuration Information.
1389 *
1390 * @details paUsrStatsConfig_t defines the configuration parameters for multi-level hierarchical user-defined statistics
1391 * operation such as the number of user-defined counters. There are up to 512 user-defined statistics consisting of
1392 * some 64-bit counters and some 32-bit counters whereas the total size of all counters cannot exceed 2048 bytes.
1393 * The user-defined statistics feature is disabled until this configuration is invoked through API @ref Pa_control.
1394 *
1395 * - 64-bit Counters index: 0 - (num64bCounters - 1)
1396 * - 32-bit Counters index: num64bCounters - (numCounters - 1)
1397 */
1398 typedef struct {
1400 uint16_t numCounters; /**< Total number of user-defined counters, default = 0, maximum = 512 */
1401 uint16_t num64bCounters; /**< Number of 64-bit user-defined counters, default = 0, maximum = 256 */
1403 } paUsrStatsConfig_t;
1405 /**
1406 * @ingroup salld_api_constants
1407 * @brief Define the maximum number of user-defined statistics the module supports.
1408 *
1409 */
1410 #define pa_USR_STATS_MAX_COUNTERS 512
1412 /**
1413 * @ingroup salld_api_constants
1414 * @brief Define the maximum number of user-defined 64-bit statistics
1415 *
1416 */
1417 #define pa_USR_STATS_MAX_64B_COUNTERS (pa_USR_STATS_MAX_COUNTERS/2)
1418 /**
1419 * @ingroup salld_api_constants
1420 * @brief Define the maximum number of user-defined 32-bit statistics
1421 *
1422 */
1423 #define pa_USR_STATS_MAX_32B_COUNTERS pa_USR_STATS_MAX_COUNTERS
1425 /**
1426 * @defgroup paUsrStatsSizes PA User-defined Ststaistics Counter Sizes
1427 * @ingroup palld_api_constants
1428 * @{
1429 *
1430 * @name User-defined Ststaistics Counter Sizes
1431 *
1432 * Definition of Counter size of the User-defined Statistics
1433 */
1434 /** @ingroup paUsrStatsSizes */
1435 /*@{*/
1436 typedef enum {
1437 pa_USR_STATS_SIZE_32B = 0, /**< 32-bit Counter */
1438 pa_USR_STATS_SIZE_64B /**< 64-bit Counter */
1439 } paUsrStatsSizes_e;
1440 /*@}*/
1441 /** @} */
1444 /**
1445 * @ingroup palld_api_structures
1446 * @brief Queue Diversion Configuration Information.
1447 *
1448 * @details The PASS supports optional queue diversion operation per LUT2 entry replacement.
1449 * paQueueDivertConfigl_t contains configuration information for the atomic queue diversion operation.
1450 * The queue diversion feature is disabled until this configuration is invoked through API @ref Pa_control.
1451 *
1452 */
1453 typedef struct {
1455 uint16_t destQueue; /**< Destination queue where PASS will deliver the LUT2 response packet which contains the
1456 queue diversion information */
1457 uint8_t destFlowId; /**< CPPI flow which instructs how the link-buffer queues are used for forwarding
1458 the LUT2 response packets */
1459 } paQueueDivertConfig_t;
1462 /**
1463 * @defgroup paPktControlInfo PA Packet Control Bit Definitions
1464 * @ingroup palld_api_constants
1465 * @{
1466 *
1467 * @name PA Packet Control Bit Definitions
1468 *
1469 * Bitmap definition of the ctrlBitMap in @ref paPacketControlConfig_t
1470 * and @ref paPacketControl2Config_t.
1471 */
1472 /*@{*/
1473 /**
1474 * @def pa_PKT_CTRL_HDR_VERIFY_PPPoE
1475 * Control Info -- Set: Perform enhanced error check of the PPPoE header
1476 * Clear: Perform basic error check of the PPPoE header
1477 */
1478 #define pa_PKT_CTRL_HDR_VERIFY_PPPoE 0x0001
1479 /**
1480 * @def pa_PKT_CTRL_HDR_VERIFY_IP
1481 * Control Info -- Set: Perform enhanced error check of the IP header
1482 * Clear: Perform basic error check of the IP header
1483 */
1484 #define pa_PKT_CTRL_HDR_VERIFY_IP 0x0002
1485 /**
1486 * @def pa_PKT_CTRL_MAC_PADDING_CHK
1487 * Control Info -- Set: Perform MAC (802.3) padding check
1488 * The packet with illegal padding will be dropped
1489 * Clear: Do not perform MAC (802.3) padding check
1490 */
1491 #define pa_PKT_CTRL_MAC_PADDING_CHK 0x0004
1492 /**
1493 * @def pa_PKT_CTRL_IP_FRAGS_TO_EROUTE
1494 * Control Info -- Set: Forward IP Fragments through the exception route regardless of the routing destination
1495 * Clear: Forward IP Fragments through the exception route only if the routing destination is set to SASS or CONTINUE_PARSE
1496 */
1497 #define pa_PKT_CTRL_IP_FRAGS_TO_EROUTE 0x0008
1498 /**
1499 * @def pa_PKT_CTRL_L3OFFSET_TO_INNER_IP
1500 * Control Info -- Set: L3offset of the packet information points to the inner IP header prior to payload
1501 * Clear: L3offset of the packet information points to the outer IP header (default)
1502 */
1503 #define pa_PKT_CTRL_L3OFFSET_TO_INNER_IP 0x0010
1505 /**
1506 * @def pa_PKT_CTRL_EMAC_IF_IGRESS_CLONE
1507 * Control Info -- Set: Enable EMAC interface-based packet capture/mirror for ingress ethernet traffic
1508 * Clear: disable EMAC interface-based packet capture/mirror (default) for ingress ethernet traffic
1509 * @note This definition is only vaild at @ref paPacketControl2Config_t.
1510 */
1511 #define pa_PKT_CTRL_EMAC_IF_IGRESS_CLONE 0x0020
1513 /**
1514 * @def pa_PKT_CTRL_EMAC_IF_EGRESS_CLONE
1515 * Control Info -- Set: Enable EMAC interface-based packet capture/mirror for egress ethernet traffic
1516 * Clear: disable EMAC interface-based packet capture/mirror (default) for egress ethernet traffic
1517 * @note This definition is only vaild at @ref paPacketControl2Config_t.
1518 */
1519 #define pa_PKT_CTRL_EMAC_IF_EGRESS_CLONE 0x0040
1521 /**
1522 * @def pa_PKT_CTRL_EMAC_IF_INGRESS_DEFAULT_ROUTE
1523 * Control Info -- Set: Enable EMAC interface-based ingress packet default route
1524 * Clear: disable EMAC interface-based ingress packet default route
1525 * @note This definition is only vaild at @ref paPacketControl2Config_t.
1526 */
1527 #define pa_PKT_CTRL_EMAC_IF_INGRESS_DEFAULT_ROUTE 0x0080
1529 /**
1530 * @def pa_PKT_CTRL_EMAC_IF_EGRESS_EQoS_MODE
1531 * Control Info -- Set: Enable EMAC interface-based enhanced QoS Mode for egress ethernet traffic
1532 * Clear: Disable EMAC interface-based enhanced QoS Mode for egress ethernet traffic
1533 * @note This definition is only vaild at @ref paPacketControl2Config_t.
1534 */
1535 #define pa_PKT_CTRL_EMAC_IF_EGRESS_EQoS_MODE 0x0100
1537 /*@}*/
1538 /** @} */
1540 /**
1541 * @ingroup palld_api_structures
1542 * @brief Packet Control Configuration Information.
1543 *
1544 * @details This data structure defines miscellaneous packet control information for some non-default PASS operations.
1545 * For example, PASS always performs basic protocol header verification to ensure that it can continue parsing the
1546 * current and next protocol header. The PASS will perform enhanced error check of protocol headers specified
1547 * by this configuration. For example,
1548 * PPPoE header in session mode:
1549 * - Version = 1
1550 * - Type = 1
1551 * - Code = 0
1552 *
1553 * IPv4 header:
1554 * - Header length >= 20
1555 * - Total length > 20
1556 * - Source address is not broadcast
1557 * - Destination address is not 0
1558 * - TTL is not 0
1559 *
1560 * @note refer to the @ref ErouteTypes for the corresponding exception routes.
1561 * @note This data structure will be depreciated and replaced with paPacketControl2Config_t due to its limitation that
1562 * all desired control bits and other parameters must be provided when it is invoked every time.
1563 */
1564 typedef struct {
1566 uint16_t ctrlBitMap; /**< Packet control bit as defined at @ref paPktControlInfo */
1567 uint16_t rxPaddingErrStatsIndex; /**< Specify the user statistics index of Rx padding error counter */
1568 uint16_t txPaddingStatsIndex; /**< Specify the user statistics index of Tx MAC padding counter */
1570 } paPacketControlConfig_t;
1572 /**
1573 * @defgroup paPktControlValidBits PA Packet Control Valid Bit Definitions
1574 * @ingroup palld_api_constants
1575 * @{
1576 *
1577 * @name PA Packet Control Valid Bit Definitions
1578 *
1579 * Bitmap definition of the validBitmap in @ref paPacketControl2Config_t.
1580 */
1581 /*@{*/
1583 /**
1584 * @def pa_PKT_CTRL2_VALID_PPPoE_HDR_CHECK
1585 * - Header check configuration for PPPoE is present in the configuration
1586 */
1587 #define pa_PKT_CTRL2_VALID_PPPoE_HDR_CHECK pa_PKT_CTRL_HDR_VERIFY_PPPoE
1589 /**
1590 * @def pa_PKT_CTRL2_VALID_IP_HDR_CHECK
1591 * - Header check configuration for IP is present in the configuration
1592 */
1593 #define pa_PKT_CTRL2_VALID_IP_HDR_CHECK pa_PKT_CTRL_HDR_VERIFY_IP
1595 /**
1596 * @def pa_PKT_CTRL2_VALID_MAC_PADDING_CHECK
1597 * - MAC padding check configuration is present in the configuration
1598 */
1599 #define pa_PKT_CTRL2_VALID_MAC_PADDING_CHECK pa_PKT_CTRL_MAC_PADDING_CHK
1601 /**
1602 * @def pa_PKT_CTRL2_VALID_IP_FRAGS_TO_EROUTE
1603 * - IP fragmentation exception routing configuration is present in the configuration
1604 */
1605 #define pa_PKT_CTRL2_VALID_IP_FRAGS_TO_EROUTE pa_PKT_CTRL_IP_FRAGS_TO_EROUTE
1607 /**
1608 * @def pa_PKT_CTRL2_VALID_L3_OFFSET
1609 * - L3 offset to inner/outer IP configuration is present in the configuration
1610 */
1611 #define pa_PKT_CTRL2_VALID_L3_OFFSET pa_PKT_CTRL_L3OFFSET_TO_INNER_IP
1613 /**
1614 * @def pa_PKT_CTRL2_VALID_EMAC_IF_IGRESS_CLONE
1615 * - Valid Ingress packet capture/mirror configuration is present in the configuration
1616 */
1617 #define pa_PKT_CTRL2_VALID_EMAC_IF_IGRESS_CLONE pa_PKT_CTRL_EMAC_IF_IGRESS_CLONE
1619 /**
1620 * @def pa_PKT_CTRL2_VALID_EMAC_IF_EGRESS_CLONE
1621 * - Valid Egress packet capture/mirror configuration is present in the configuration
1622 */
1623 #define pa_PKT_CTRL2_VALID_EMAC_IF_EGRESS_CLONE pa_PKT_CTRL_EMAC_IF_EGRESS_CLONE
1624 /**
1625 * @def pa_PKT_CTRL2_VALID_EMAC_IF_INGRESS_DEFAULT_ROUTE
1626 * - Valid emac interface ingress default route configuration is present
1627 */
1628 #define pa_PKT_CTRL2_VALID_EMAC_IF_INGRESS_DEFAULT_ROUTE pa_PKT_CTRL_EMAC_IF_INGRESS_DEFAULT_ROUTE
1630 /**
1631 * @def pa_PKT_CTRL2_VALID_EMAC_IF_EQoS_MODE
1632 * - Valid emac interface egress enhanced QoS mode is present
1633 */
1634 #define pa_PKT_CTRL2_VALID_EMAC_IF_EGRESS_EQoS_MODE pa_PKT_CTRL_EMAC_IF_EGRESS_EQoS_MODE
1636 /**
1637 * @def pa_PKT_CTRL2_VALID_PADDING_STATS_INDEX
1638 * - Valid rxPaddingErrStatsIndex and txPaddingStatsIndex are present
1639 */
1640 #define pa_PKT_CTRL2_VALID_PADDING_STATS_INDEX 0x8000
1644 /* @} */
1645 /** @} */
1647 /**
1648 * @ingroup palld_api_structures
1649 * @brief Packet Control Configuration2 Information.
1650 *
1651 * @brief Enhanced Packet Control configuration structure
1652 *
1653 * @details paPacketControl2Config_t is the upgraded version of paPacketControlConfig_t to support
1654 * individual feature control without affecting the other feature operations. It is achieved
1655 * by introducing the parameter validBitMap where only the valid control bits and their
1656 * associated parameters will be processed by PASS and the other feature operations will
1657 * not be affected.
1658 */
1659 typedef struct {
1661 uint16_t validBitMap; /**< Valid control bits as defined at @ref paPktControlValidBits */
1662 uint16_t ctrlBitMap; /**< Packet control bit as defined at @ref paPktControlInfo */
1663 uint16_t rxPaddingErrStatsIndex; /**< Specify the user statistics index of Rx padding error counter
1664 note This parameter is valid only if pa_PKT_CTRL2_VALID_PADDING_STATS_INDEX is set.*/
1665 uint16_t txPaddingStatsIndex; /**< Specify the user statistics index of Tx MAC padding counter
1666 note This parameter is valid only if pa_PKT_CTRL2_VALID_PADDING_STATS_INDEX is set.*/
1667 uint8_t egressDefPri; /**< Specify the global default priority for untagged non IP egress traffic
1668 for enhanced QoS mode (refer to @ref appendix7)
1669 @note This parameter is valid only if both pa_PKT_CTRL2_VALID_EMAC_IF_EGRESS_EQoS_MODE
1670 and the corresponding enable bit are set. */
1672 } paPacketControl2Config_t;
1675 /**
1676 * @defgroup paAclActionTypes PA ACL action types
1677 * @ingroup palld_api_constants
1678 * @{
1679 *
1680 * @name PA ACL action types
1681 * @brief Define the ACL action types.
1682 *
1683 * @details Define actions to be taken when an ACL entry is matched
1684 */
1685 /* @{ */
1686 /**
1687 * @def pa_ACL_ACTION_PERMIT
1688 * Allow matched packets to be forwarded to the next stage
1689 */
1690 #define pa_ACL_ACTION_PERMIT 0
1692 /**
1693 * @def pa_ACL_ACTION_DENY
1694 * Matched packets should be dropped
1695 */
1696 #define pa_ACL_ACTION_DENY 1
1698 /**
1699 * @def pa_ACL_ACTION_MARK
1700 * Matched packets should be forwarded with a mark which may be used later by hardware or software
1701 */
1702 #define pa_ACL_ACTION_MARK 2
1704 /**
1705 *
1706 * @def pa_ACL_ACTION_HOST
1707 * The packet should be forwarded to host for further processing
1708 * @note This action is only applicable to default rule
1709 */
1710 #define pa_ACL_ACTION_HOST 3
1712 #define pa_ACL_ACTION_MAX pa_ACL_ACTION_HOST
1714 /* @} */
1715 /** @} */
1717 /**
1718 * @ingroup palld_api_structures
1719 * @brief Stateless ACL Configuration Information.
1720 *
1721 * @details paAclConfig_t is used to configure the default rule of stateless ACL operation. The PASS will follow
1722 * this rule if no matches are found at the ACL table. Two separate structures are used
1723 * for the outer ACL and inner ACL respectively. The default rule is set to packet FORWARDING until
1724 * this information is provided.
1725 */
1726 typedef struct {
1728 int action; /**< Default action (Deny/Permit/Host) as sepcified at @ref paAclActionTypes */
1729 uint8_t destFlowId; /**< CPPI flow which instructs how the link-buffer queues are used for forwarding packets to host.
1730 (valid only if action = pa_ACL_ACTION_HOST) */
1731 uint16_t destQueue; /**< Destination host queue where PASS will deliver the packets if no ACL matches found
1732 (valid only if action = pa_ACL_ACTION_HOST) */
1733 } paAclConfig_t;
1735 /**
1736 * @defgroup paRACtrlInfo PA RA Control Bit Definitions
1737 * @ingroup palld_api_constants
1738 * @{
1739 *
1740 * @name PA RA Control Bit Definitions
1741 *
1742 * Bitmap definition of the ctrlBitMap in @ref paRaGroupConfig_t.
1743 *
1744 */
1745 /*@{*/
1746 /**
1747 * @def pa_RA_CTRL_ENABLE
1748 * Control Info -- Set: Enable Reassembly operation, forward all packets to RA
1749 * Clear: Disable Reassembly operation, bypass RA
1750 */
1751 #define pa_RA_CTRL_ENABLE 0x0001
1752 /*@}*/
1753 /**
1754 * @def pa_RA_CTRL_USE_LOCAL_DMA
1755 * Control Info -- Set: Use NetCP internal DMA to send packets from PASS to RA engine
1756 * Clear: Use global DMA to send packets from PASS to RA engine
1757 */
1758 #define pa_RA_CTRL_USE_LOCAL_DMA 0x0002
1759 /**
1760 * @def pa_RA_CTRL_TO_QUEUE
1761 * Control Info -- Set: Forward RA output packets to the host queue specified by the RA output CPPI flow
1762 * Clear: Forward RA output pakets to the next PASS classification stage
1763 * @note: The lower 8-bit of source tag of the input CPPI flow should be set to the output CPPI flow when this set
1764 * this bit is set and the default queue of the output CPPI flow should be set to the desired destination queue
1765 */
1766 #define pa_RA_CTRL_TO_QUEUE 0x0004
1767 /*@}*/
1768 /** @} */
1770 /**
1771 * @ingroup palld_api_structures
1772 * @brief RA exception Route Information.
1773 *
1774 * @details The reassembly engine is degined to forward packets to host queue specified by user when timwout or other
1775 * error condition occurs. paRaERouteInfo_t contains the routing information required for this operation.
1776 */
1777 typedef struct {
1779 int dest; /**< (TBD:) Packet destination as defined at @ref pktDest */
1780 uint8_t flowId; /**< Specifies CPPI flow which defines free queues are used for receiving packets */
1781 uint16_t queue; /**< Specifies the destination host queue */
1782 } paRaERouteInfo_t;
1784 /**
1785 * @ingroup palld_api_structures
1786 * @brief PA Reassembly Engine Group Configuration Information.
1787 *
1788 * @details paRaGroupConfig_t is used to specify the group specific configuration parameters of the PASS
1789 * reassembly Engine. Two separate structures are used for the outer IP and inner IP reassembly
1790 * respectively.
1791 */
1792 typedef struct {
1793 uint16_t ctrlBitMap; /**< RA control info as defined at @ref paRACtrlInfo */
1794 uint8_t flowId; /**< Specify the RA CPPI flow which defines free queues and other paramters
1795 for sending packets from PASS to RA */
1796 paRaERouteInfo_t timeoutER; /**< Specify exception route for timeout packets */
1797 paRaERouteInfo_t critErrER; /**< Specify exception route for packets with critical error */
1798 paRaERouteInfo_t genErrER; /**< Specify exception route for packets with non-critical error*/
1799 } paRaGroupConfig_t;
1801 /**
1802 * @ingroup palld_api_structures
1803 * @brief PA System Configuration Information structure
1804 *
1805 * @details paSysConfig_t contains pointers to the system-level configuration structures defined above. The null pointer
1806 * indicates the configuration of the corresponding sub-group is not required.
1807 */
1808 typedef struct {
1809 paProtocolLimit_t* pProtoLimit; /**< Pointer to the protocol limit configuration structure */
1810 paIpReassmConfig_t* pOutIpReassmConfig; /**< Pointer to the outer IP PASS-assisted Reassembly configuration structure */
1811 paIpReassmConfig_t* pInIpReassmConfig; /**< Pointer to the inner IP PASS-assisted Reassembly configuration structure */
1812 paCmdSetConfig_t* pCmdSetConfig; /**< Pointer to the command set configuration structure */
1813 paUsrStatsConfig_t* pUsrStatsConfig; /**< Pointer to the user-defined statistics configuration structure */
1814 paQueueDivertConfig_t* pQueueDivertConfig; /**< Pointer to the queue-diversion configuration structure */
1815 paPacketControlConfig_t* pPktControl; /**< Pointer to the packet control configuration structure */
1816 paAclConfig_t* pOutAclConfig; /**< Pointer to the outer ACL configuration structure */
1817 paAclConfig_t* pInAclConfig; /**< Pointer to the inner ACL configuration structure */
1818 paRaGroupConfig_t* pOutIpRaGroupConfig; /**< Poimter to the outer IP Reassembly group configuration structure */
1819 paRaGroupConfig_t* pInIpRaGroupConfig; /**< Poimter to the inner IP Reassembly group configuration structure */
1820 paPacketControl2Config_t* pPktControl2; /**< Pointer to the packet control 2 configuration structure */
1821 } paSysConfig_t;
1823 /**
1824 * @defgroup pa802p1agDetectInfo PA 802.1ag Detector Control Bit Definitions
1825 * @ingroup palld_api_constants
1826 * @{
1827 *
1828 * @name PA 802.1ag Detector Control Bit Definitions
1829 *
1830 * Bitmap definition of the ctrlBitMap in @ref pa802p1agDetConfig_t.
1831 *
1832 */
1833 /*@{*/
1834 /**
1835 * @def pa_802_1ag_DETECT_ENABLE
1836 * Control Info -- Set: Enable 802.1ag Detector
1837 * Clear: Disable 802.1ag Detector
1838 */
1839 #define pa_802_1ag_DETECT_ENABLE 0x0001
1840 /**
1841 * @def pa_802_1ag_DETECT_STANDARD
1842 * Control Info -- Set: Perform 802.1ag packet detection per 802.1ag formal standard
1843 * Clear: Perform 802.1ag packet detection per 802.1ag draft
1844 */
1845 #define pa_802_1ag_DETECT_STANDARD 0x0002
1846 /*@}*/
1847 /** @} */
1849 /**
1850 * @ingroup palld_api_structures
1851 * @brief 802.1ag Detection Configuration Information.
1852 *
1853 * @details The 802.1ag packet can be recognized with ether type equal to 0x8902 normally. However, the PASS can be
1854 * configured to further qualify the IEEE 802.1ag packet per one of the following criteria:
1855 * - 802.1ag standard: Destion MAC address = 01-80-c2-00-00-3x, Ether type = 0x8902
1856 * - 802.1ag draft: Destion MAC address = 01-80-c2-xx-xx-xx, Ether type = 0x8902
1857 *
1858 * @note The 802.1ag detector is disabled by default.
1859 * @note refer to the @ref ErouteTypes for the corresponding exception routes.
1860 *
1861 */
1862 typedef struct {
1863 uint16_t ctrlBitMap; /**< 802.1ag Detector control info as defined at @ref pa802p1agDetectInfo */
1864 } pa802p1agDetConfig_t;
1867 /**
1868 * @defgroup ipsecNatTCtrlInfo PA IPSEC NAT-T Control Bit Definitions
1869 * @ingroup palld_api_constants
1870 * @{
1871 *
1872 * @name PA IPSEC NAT-T Control Bit Definitions
1873 *
1874 * Bitmap definition of the ctrlBitMap in @ref paIpsecNatTConfig_t.
1875 *
1876 */
1877 /*@{*/
1878 /**
1879 * @def pa_IPSEC_NAT_T_CTRL_ENABLE
1880 * Control Info -- Set: Enable IPSEC NAT-T packet detection
1881 * Clear: Disable IPSEC NAT-T packet detection
1882 */
1883 #define pa_IPSEC_NAT_T_CTRL_ENABLE 0x0001
1884 /**
1885 * @def pa_IPSEC_NAT_T_CTRL_LOC_LUT1
1886 * Control Info -- Set: Perform IPSEC NAT-T packet detection at Ingress 1 (LUT1) stage
1887 * Clear: Perform IPSEC NAT-T packet detection at Ingress 4 (LUT2) stage (default)
1888 *
1889 * @details The IPSEC ESP NAT-T packet detector is implemented at the processing stage (PDSP3) where
1890 * the LUT2 classification occurs at the first generation PASS. The drawback is that the
1891 * detected IPSEC ESP NAT-T packet has to be re-routed into the PASS Outer IP processing
1892 * stage (PDSP1) for continuous processing and this operation reduces the overall throughput.
1893 * In the 2nd generation PASS, the IPSEC NAT-T detector is implemented within Ingress 1
1894 * (Outer IP and IPSEC) processing stage to avoid the re-entry operation. However, the detector
1895 * is also implemented at the Ingress4 (LUT2) stage to maintain backward compatibility.
1896 * It is recommended to set this flag to one to enable the IPSEC ESP NAT-T detector at Ingress 1
1897 * stage to maintain the maxmium PASS throughput.
1898 *
1899 * @note: This feature is only supported by the second generation of PASS and this control bit will be
1900 * ignored at the device which uses the first generation of PASS.
1901 *
1902 */
1903 #define pa_IPSEC_NAT_T_CTRL_LOC_LUT1 0x0002
1904 /*@}*/
1905 /** @} */
1907 /**
1908 * @ingroup palld_api_structures
1909 * @brief IPSEC NAT-T Packet Detection Configuration Information.
1910 *
1911 * @details paIpsecNatTConfig_t is used to configure the IPSEC NAT-T packet detector which is disabled
1912 * until this configuration is invoked through API @ref Pa_control.
1913 *
1914 * @note The IPSEC NAT-T packet detector is disabled by default.
1915 * @note refer to the @ref ErouteTypes for the corresponding exception routes.
1916 *
1917 */
1918 typedef struct {
1920 uint16_t ctrlBitMap; /**< IPSEC NAT-T control info as defined at @ref ipsecNatTCtrlInfo */
1921 uint16_t udpPort; /**< Specify the UDP port number which uniquely identifies the IPSEC NAT-T packets */
1922 } paIpsecNatTConfig_t;
1924 /**
1925 * @defgroup paGtpuCtrlInfo PA GTPU Control Bit Definitions
1926 * @ingroup palld_api_constants
1927 * @{
1928 *
1929 * @name PA GTPU Control Bit Definitions
1930 *
1931 * Bitmap definition of the ctrlBitmap in @ref paGtpuConfig_t.
1932 *
1933 */
1934 /*@{*/
1935 /**
1936 * @def pa_GTPU_CTRL_USE_LINK
1937 * Control Info -- Set: GTU-U classification vector consists of the least significant 24-bit of tunnel ID and 8-bit link
1938 * of previous matching
1939 * Clear: GTU-U classification vector consists of the 32-bit of tunnel ID only (Default)
1940 */
1941 #define pa_GTPU_CTRL_USE_LINK 0x0001
1942 /*@}*/
1943 /** @} */
1945 /**
1946 * @ingroup palld_api_structures
1947 * @brief GTP-U Configuration Information.
1948 *
1949 * @details Due to the LUT2 engine using 32-bit matching parameter, the default GTP-U classification is solely based
1950 * on its 32-bit tunnel ID. However, it is desirable to match the GTP-U tunnel with both tunnel ID and
1951 * previous link information. This configuration can be used to modify GTP-U classification vector by
1952 * combining least significant 24-bit of tunnel ID and an 8-bit previous link. It should be passed to
1953 * @ref Pa_control() API at system startup.
1954 *
1955 * @note GTP-U configuration should be performed at system startup. PASS does not support GTP-U
1956 * reconfiguration at run time.
1957 * @note This configuration is used at the first generation of PASS and it is still supported by the second generation PASS
1958 * for backward compatibility only. It does not have real effect since the advanced LUT2 engine supports GTPU 32-bit
1959 * Tunnel-ID classification with L3 link. It is not necessary to restrict the effective tunnel-ID to 24-bit.
1960 *
1961 */
1962 typedef struct {
1963 uint16_t ctrlBitMap; /**< GTP-U configuration control info as defined at @ref paGtpuCtrlInfo */
1964 } paGtpuConfig_t;
1966 /**
1967 * @ingroup palld_api_structures
1968 * @brief The return type for module functions
1969 *
1970 * @details Function calls to this module return values used to determine if the command was successful or
1971 * the reason for failure (see @ref ReturnValues).
1972 */
1974 typedef int paReturn_t;
1976 /**
1977 * @ingroup palld_api_structures
1978 * @brief paCmdReply_t is used to specify command result (from PASS) routing information
1979 *
1980 * @details Commands sent to packet accelerator sub-system will generate replies. These replies
1981 * can be either discarded by the sub-system or routed to a queue. Command replies that
1982 * must be forwarded back to this module are detailed for each command. The module user
1983 * typically either selects a unique destination queue for command replies, or else supplies
1984 * a unique value for replyId. This value is placed into software info word 0 in the
1985 * packet descriptor for the returned command. The data in the returned packet is not
1986 * typically examined by the module user, but passed directly back to this module through
1987 * API function @ref Pa_forwardResult to examine the results of the command.
1988 */
1989 typedef struct {
1991 int dest; /**< Packet destination, must be pa_DEST_HOST or pa_DEST_DISCARD, see @ref pktDest */
1992 uint32_t replyId; /**< Value placed in swinfo0 in reply packet */
1993 uint16_t queue; /**< Destination queue for destination pa_DEST_HOST */
1994 uint8_t flowId; /**< Flow ID used on command reply from PASS */
1996 } paCmdReply_t;
1998 /**
1999 * @ingroup palld_api_constants
2000 * @brief Define the maximum number of buffers the module can request
2001 *
2002 */
2003 #define pa_N_BUFS_GEN1 5
2004 #define pa_N_BUFS_GEN2 7
2006 #define pa_N_BUFS pa_N_BUFS_GEN2
2008 /**
2009 * @defgroup paBufIndex PA Memory Buffer Index
2010 * @ingroup palld_api_constants
2011 * @{
2012 *
2013 * @name PA Memory Buffer Index
2014 * @brief Define the buffer inedex of the PA LLD memory blocks.
2015 *
2016 */
2017 /* @{ */
2018 /**
2019 * @def pa_BUF_INST
2020 * PA LLD instance buffer
2021 */
2022 #define pa_BUF_INST 0
2023 /**
2024 * @def pa_BUF_L2_TABLE
2025 * PA LLD match table of Layer 2 (MAC/SRIO) entries
2026 */
2027 #define pa_BUF_L2_TABLE 1
2028 /**
2029 * @def pa_BUF_L3_TABLE
2030 * PA LLD match table of Layer 3 (IP/CustomLUT1) entries
2031 */
2032 #define pa_BUF_L3_TABLE 2
2033 /**
2034 * @def pa_BUF_USR_STATS_TABLE
2035 * PA LLD link table of user-defined statistics
2036 */
2037 #define pa_BUF_USR_STATS_TABLE 3
2038 /**
2039 * @def pa_BUF_VLINK_TABLE
2040 * PA LLD match table of virtual link entries
2041 */
2042 #define pa_BUF_VLINK_TABLE 4
2043 /**
2044 * @def pa_BUF_ACL_TABLE
2045 * PA LLD match table of ACL entries
2046 *
2047 * @note This definition is valid for the second generation PASS only.
2048 */
2049 #define pa_BUF_ACL_TABLE 5
2050 /**
2051 * @def pa_BUF_FC_TABLE
2052 * PA LLD match table of Flow Cache entries
2053 *
2054 * @note This definition is valid for the second generation PASS only.
2055 */
2056 #define pa_BUF_FC_TABLE 6
2058 /* @} */
2059 /** @} */
2062 /**
2063 * @ingroup palld_api_functions
2064 * @brief Pa_getBufferReq returns the memory requirements for the PA driver
2065 *
2066 * @details This function returns the memory buffer requirements in term
2067 * of the size and alignment array. The PA LLD requires up to
2068 * four memory blocks as described below:
2069 * - PA Instance: PA instance data
2070 * - L2 Table: Layer-2 (MAC/SRIO) entry information
2071 * - L3 Table: Layer-3 (IP/Custom LUT1) entry information
2072 * - User Statistics Link Table: User-defined Statistics entry information (Optional)
2073 *
2074 * @param[in] sizeCfg Size configuration information
2075 * @param[out] sizes Array of size requirements
2076 * @param[out] aligns Array of alignment requirements
2077 * @retval Value (@ref ReturnValues)
2078 *
2079 * @note This function specifies the minimum memory buffer requirements, it is up to the
2080 * module user to round up the buffer alignemnt and size to the cache line boundary
2081 * to ensure cache coherency if cacheable memory is used.
2082 */
2083 paReturn_t Pa_getBufferReq (paSizeInfo_t *sizeCfg, int sizes[], int aligns[]);
2085 /**
2086 * @ingroup palld_api_functions
2087 * @brief Pa_create creates the PA driver instance
2088 *
2089 * @details This function initializes the PA driver based on user configuration
2090 *
2091 * @param[in] cfg Configuration information
2092 * @param[in] bases Array of the memory buffer base addresses
2093 * @param[out] pHandle Instance handle. This is a pointer to an initialized
2094 * instance structure.
2095 * @retval Value (@ref ReturnValues)
2096 */
2097 paReturn_t Pa_create (paConfig_t *cfg, void* bases[], Pa_Handle *pHandle);
2099 /**
2100 * @ingroup palld_api_functions
2101 * @brief Pa_startCfg Adds PA configuration
2102 * @details This function needs to be called from all cores to initialize PA with
2103 * per core configurations
2104 *
2105 * @param[in] handle The PA LLD instance identifier
2106 * @param[in] startCfg PA start configuration
2107 * @retval None
2108 */
2109 void Pa_startCfg (Pa_Handle handle, paStartCfg_t *startCfg);
2111 /**
2112 * @ingroup palld_api_functions
2113 * @brief Pa_close decativates the PA driver instance
2114 *
2115 * @details This function deactivates the PA driver instance, all the associated
2116 * memory buffers can be freed after this call.
2117 *
2118 * @param[in] handle The PA LLD instance identifier
2119 * @param[out] bases Array of the memory buffer base addresses
2120 * @retval Value (@ref ReturnValues)
2121 */
2122 paReturn_t Pa_close (Pa_Handle handle, void* bases[]);
2124 /**
2125 * @defgroup pktDest Routed Packet Destinations
2126 * @ingroup palld_api_constants
2127 * @{
2128 *
2129 * @name Routed Packet Destinations
2130 *
2131 * @brief The module user specifies packet destinations for packets exiting the packet accelerator sub-system.
2132 *
2133 * @details The destination of packets that leave the packet accelerator sub-system
2134 * are provided to the module in the @ref paRouteInfo_t structure and passed
2135 * to the module through the @ref Pa_addMac, @ref Pa_addSrio, @ref Pa_addIp, @ref Pa_addCustomLUT1,
2136 * @ref Pa_addCustomLUT2 and @ref Pa_addPort functions
2137 */
2138 /** @ingroup pktDest */
2139 /* @{ */
2141 /**
2142 * @def pa_DEST_DISCARD
2143 * packet is discarded
2144 */
2145 #define pa_DEST_DISCARD 3 /**< Packet is discarded */
2147 /**
2148 * @def pa_DEST_CONTINUE_PARSE_LUT1
2149 * packet remains in PA sub-system for more parsing and LUT1 classification
2150 */
2151 #define pa_DEST_CONTINUE_PARSE_LUT1 4 /**< Packet remains in PA sub-system for more parsing and LUT1 classification */
2153 /**
2154 * @def pa_DEST_CONTINUE_PARSE_LUT2
2155 * packet remains in PA sub-system for more parsing and LUT2 classification.
2156 */
2157 #define pa_DEST_CONTINUE_PARSE_LUT2 5 /**< Packet remains in PA sub-system for more parsing and LUT2 classification */
2159 /**
2160 * @def pa_DEST_HOST
2161 * host thread
2162 */
2163 #define pa_DEST_HOST 6 /**< Packet is routed to host */
2165 /**
2166 * @def pa_DEST_EMAC
2167 * ethernet mac port (of the switch)
2168 */
2169 #define pa_DEST_EMAC 7 /**< Packet is routed to EMAC */
2171 /**
2172 * @def pa_DEST_SASS
2173 * security accelerator destination
2174 */
2175 #define pa_DEST_SASS 8 /**< Packet is routed to SA */
2177 /**
2178 * @def pa_DEST_SASS_LOC_DMA
2179 * security accelerator destination via local DMA
2180 *
2181 * @note This definition is valid for the second generation of PASS only.
2182 */
2183 #define pa_DEST_SASS_LOC_DMA 11 /**< Packet is routed to SA through local DMA */
2185 /**
2186 * @def pa_DEST_SRIO
2187 * SRIO interface
2188 */
2189 #define pa_DEST_SRIO 9 /**< Packet is routed to SRIO */
2191 /**
2192 * @def pa_DEST_CASCADED_FORWARDING_LUT1
2193 * Cascaded forwarding packet remains in PA sub-system for next LUT1 (IP) parsing. Those packets are expected to
2194 * be delivered to QoS queues based on the VLAN/DSCP priority at the next stage so that some PASS actions such
2195 * as IP reassembly and IP fragment exception route will be disabled.
2196 */
2197 #define pa_DEST_CASCADED_FORWARDING_LUT1 10
2199 /**
2200 * @def pa_DEST_EFLOW
2201 * packet remains in PA sub-system for egress flow operation
2202 *
2203 * @note This definition is valid for the second generation of PASS only.
2204 */
2205 #define pa_DEST_EFLOW 12 /**< Packet is routed to Egress Flow Path */
2207 /**
2208 * @def pa_DEST_RES_1
2209 * Reseved destination for internal usage
2210 *
2211 * @note This definition is valid for the second generation of PASS only.
2212 */
2213 #define pa_DEST_RES_1 20
2215 /**
2216 * @def pa_DEST_RES_2
2217 * Reseved destination for internal usage
2218 *
2219 * @note This definition is valid for the second generation of PASS only.
2220 */
2221 #define pa_DEST_RES_2 21
2224 /* @} */
2225 /** @} */
2227 /**
2228 * @defgroup paEmacPort Ethernet MAC port
2229 * @ingroup palld_api_constants
2230 * @{
2231 *
2232 * @name Ethernet MAC port
2233 *
2234 * @brief The module user specifies the Ethernet MAC port of the ingress and egress packets.
2235 *
2236 * @details In the from-network direction, the module user can specify the input port as one of classification parameters.
2237 * In the to-network direction, the module user can force the egress packets to be sent over the specified
2238 * destination Ethernet MAC port of the switch regreless of its states or configurations.
2239 */
2240 /** @ingroup customType */
2241 /* @{ */
2242 /**
2243 * @def pa_EMAC_PORT_NOT_SPECIFIED
2244 * From-Netwprk: Don't care
2245 * To-Network: Use standard switch forwarding
2246 */
2247 #define pa_EMAC_PORT_NOT_SPECIFIED 0
2249 /* @def pa_EMAC_PORT_0
2250 * Use EMAC Port 0
2251 */
2252 #define pa_EMAC_PORT_0 1
2254 /* @def pa_EMAC_PORT_1
2255 * Use EMAC Port 1
2256 */
2257 #define pa_EMAC_PORT_1 2
2259 /* @def pa_EMAC_PORT_2
2260 * Use EMAC Port 2
2261 */
2262 #define pa_EMAC_PORT_2 3
2264 /* @def pa_EMAC_PORT_3
2265 * Use EMAC Port 3
2266 */
2267 #define pa_EMAC_PORT_3 4
2269 /* @def pa_EMAC_PORT_4
2270 * Use EMAC Port 4
2271 */
2272 #define pa_EMAC_PORT_4 5
2274 /* @def pa_EMAC_PORT_5
2275 * Use EMAC Port 5
2276 */
2277 #define pa_EMAC_PORT_5 6
2279 /* @def pa_EMAC_PORT_6
2280 * Use EMAC Port 6
2281 */
2282 #define pa_EMAC_PORT_6 7
2284 /* @def pa_EMAC_PORT_7
2285 * Use EMAC Port 7
2286 */
2287 #define pa_EMAC_PORT_7 8
2289 /* @def pa_CPPI_PORT
2290 * Use CPPI PORT
2291 */
2292 #define pa_CPPI_PORT pa_EMAC_PORT_NOT_SPECIFIED
2294 /* @} */
2295 /** @} */
2297 /**
2298 * @defgroup emcOutputCtrlBits Ethernet MAC Output Control Bit Definitions
2299 * @ingroup palld_api_constants
2300 * @{
2301 *
2302 * @name Ethernet MAC Output Control Bit Definition
2303 *
2304 * Bitmap definition of the emacCtrl at @ref paRouteInfo_t.
2305 *
2306 */
2307 /*@{*/
2308 /**
2309 * @def pa_EMAC_CTRL_PORT_MASK
2310 * Control Info -- EMAC port mask
2311 */
2312 #define pa_EMAC_CTRL_PORT_MASK 0x0F
2313 /**
2314 * @def pa_EMAC_CTRL_CRC_DISABLE
2315 * Control Info -- 0:EMAC port computes and inserts CRC
2316 * 1:EMAC port does not generate CRC
2317 */
2318 #define pa_EMAC_CTRL_CRC_DISABLE 0x80
2320 /* @} */
2321 /** @} */
2323 /**
2324 * @defgroup customType Custom Classification Types
2325 * @ingroup palld_api_constants
2326 * @{
2327 *
2328 * @name Custom Classification Types
2329 *
2330 * @brief The module user specifies the custom classification types.
2331 *
2332 * @details The optional custom classification rule may be used to further parse and calssify the incoming
2333 * packet.
2334 */
2335 /** @ingroup customType */
2336 /* @{ */
2337 /**
2338 * @def pa_CUSTOM_TYPE_NONE
2339 * Use standard classification
2340 */
2341 #define pa_CUSTOM_TYPE_NONE 0
2343 /* @def pa_CUSTOM_TYPE_LUT1
2344 * Custom classification with LUT1
2345 */
2346 #define pa_CUSTOM_TYPE_LUT1 1
2348 /* @def pa_CUSTOM_TYPE_LUT2
2349 * Custom classification with LUT2
2350 */
2351 #define pa_CUSTOM_TYPE_LUT2 2
2353 /* @} */
2354 /** @} */
2356 /**
2357 * @brief The maximum number of LUT1 Custom Types supported
2358 */
2359 #define pa_MAX_CUSTOM_TYPES_LUT1 4
2362 /**
2363 * @brief The maximum number of LUT2 Custom Types supported
2364 */
2365 #define pa_MAX_CUSTOM_TYPES_LUT2 16
2368 /**
2369 * @defgroup cmdTxDestGen1 Command/Transmit Packet Destinations for first generation NSS
2370 * @ingroup palld_api_constants
2371 * @{
2372 *
2373 * @name Command/Transmit Packet Destinations for first generation NSS
2374 *
2375 * @brief These values specify the offsets to the NSS Tx base queue and they are used by the module user to deliver
2376 * the configuration packets to the specific PDSP Cluster within PASS.
2377 *
2378 * @note These values are used by LLD as the return value of cmdDest of PASS configuration APIs. They are defined here
2379 * for reference purpose only.
2380 */
2381 /* @{ */
2382 /**
2383 * @def pa_CMD_TX_DEST_0_GEN1
2384 * Destination PDSP0
2385 */
2386 #define pa_CMD_TX_DEST_0_GEN1 0 /**< Packet is sent to PDSP0 */
2388 /**
2389 * @def pa_CMD_TX_DEST_1_GEN1
2390 * Destination PDSP1
2391 */
2392 #define pa_CMD_TX_DEST_1_GEN1 1 /**< Packet is sent to PDSP1 */
2394 /**
2395 * @def pa_CMD_TX_DEST_2_GEN1
2396 * Destination PDSP2
2397 */
2398 #define pa_CMD_TX_DEST_2_GEN1 2 /**< Packet is sent to PDSP2 */
2400 /**
2401 * @def pa_CMD_TX_DEST_3_GEN1
2402 * Destination PDSP3
2403 */
2404 #define pa_CMD_TX_DEST_3_GEN1 3 /**< Packet is sent to PDSP3 */
2406 /**
2407 * @def pa_CMD_TX_DEST_4_GEN1
2408 * Destination PDSP4
2409 */
2410 #define pa_CMD_TX_DEST_4_GEN1 4 /**< Packet is sent to PDSP4 */
2412 /**
2413 * @def pa_CMD_TX_DEST_5_GEN1
2414 * Destination PDSP5
2415 */
2416 #define pa_CMD_TX_DEST_5_GEN1 5 /**< Packet is sent to PDSP5 */
2418 /* @} */
2419 /** @} */
2421 /**
2422 * @defgroup cmdTxDestGen2 Command/Transmit Packet Destinations for second generation NSS
2423 * @ingroup palld_api_constants
2424 * @{
2425 *
2426 * @name Command/Transmit Packet Destinations for second generation NSS
2427 *
2428 * @brief These values specify the offset to the NSS Tx base queue and they are used by the module user to deliver
2429 * the configuration packets to the specific PDSP Cluster within PASS.
2430 *
2431 * @note These values are used by LLD as the return value of cmdDest of PASS configuration APIs. They are defined here
2432 * for reference purpose only.
2433 */
2434 /* @{ */
2435 /**
2436 * @def pa_CMD_TX_DEST_0_GEN2
2437 * Destination CLUSTER0
2438 */
2439 #define pa_CMD_TX_DEST_0_GEN2 8 /**< Packet is sent to INGRESS0 */
2441 /**
2442 * @def pa_CMD_TX_DEST_1_GEN2
2443 * Destination CLUSTER1
2444 */
2445 #define pa_CMD_TX_DEST_1_GEN2 9 /**< Packet is sent to INGRESS1 */
2447 /**
2448 * @def pa_CMD_TX_DEST_2_GEN2
2449 * Destination CLUSTER2
2450 */
2451 #define pa_CMD_TX_DEST_2_GEN2 10 /**< Packet is sent to INGRESS2 */
2453 /**
2454 * @def pa_CMD_TX_DEST_3_GEN2
2455 * Destination CLUSTER3
2456 */
2457 #define pa_CMD_TX_DEST_3_GEN2 11 /**< Packet is sent to INGRESS3 */
2459 /**
2460 * @def pa_CMD_TX_DEST_4_GEN2
2461 * Destination CLUSTER4
2462 */
2463 #define pa_CMD_TX_DEST_4_GEN2 12 /**< Packet is sent to INGRESS4 */
2465 /**
2466 * @def pa_CMD_TX_DEST_5_GEN2
2467 * Destination CLUSTER5
2468 */
2469 #define pa_CMD_TX_DEST_5_GEN2 13 /**< Packet is sent to POST */
2471 /**
2472 * @def pa_CMD_TX_DEST_6_GEN2
2473 * Destination CLUSTER6
2474 */
2475 #define pa_CMD_TX_DEST_6_GEN2 14 /**< Packet is sent to EGRESS0 */
2477 /**
2478 * @def pa_CMD_TX_DEST_7_GEN2
2479 * Destination CLUSTER7
2480 */
2481 #define pa_CMD_TX_DEST_7_GEN2 15 /**< Packet is sent to EGRESS1 */
2482 /**
2483 * @def pa_CMD_TX_DEST_8_GEN2
2484 * Destination CLUSTER8
2485 */
2486 #define pa_CMD_TX_DEST_8_GEN2 16 /**< Packet is sent to EGRESS2 */
2488 /* @} */
2489 /** @} */
2491 /**
2492 * @defgroup cmdTxDest Command/Transmit Packet Destinations for NSS
2493 * @ingroup palld_api_constants
2494 * @{
2495 *
2496 * @name Command/Transmit Packet Destinations for NSS
2497 *
2498 * @brief Define the command destination based on the compiler switch NSS_GEN2 to cover both @ref cmdTxDestGen1
2499 * and @ref cmdTxDestGen2. These values are used by the LLD only and are not required by the application.
2500 */
2501 /* @{ */
2502 #ifndef NSS_GEN2
2503 #define pa_CMD_TX_DEST_0 pa_CMD_TX_DEST_0_GEN1
2504 #define pa_CMD_TX_DEST_1 pa_CMD_TX_DEST_1_GEN1
2505 #define pa_CMD_TX_DEST_2 pa_CMD_TX_DEST_2_GEN1
2506 #define pa_CMD_TX_DEST_3 pa_CMD_TX_DEST_3_GEN1
2507 #define pa_CMD_TX_DEST_4 pa_CMD_TX_DEST_4_GEN1
2508 #define pa_CMD_TX_DEST_5 pa_CMD_TX_DEST_5_GEN1
2509 #else
2510 #define pa_CMD_TX_DEST_0 pa_CMD_TX_DEST_0_GEN2
2511 #define pa_CMD_TX_DEST_1 pa_CMD_TX_DEST_1_GEN2
2512 #define pa_CMD_TX_DEST_2 pa_CMD_TX_DEST_2_GEN2
2513 #define pa_CMD_TX_DEST_3 pa_CMD_TX_DEST_3_GEN2
2514 #define pa_CMD_TX_DEST_4 pa_CMD_TX_DEST_4_GEN2
2515 #define pa_CMD_TX_DEST_5 pa_CMD_TX_DEST_5_GEN2
2516 #define pa_CMD_TX_DEST_6 pa_CMD_TX_DEST_6_GEN2
2517 #define pa_CMD_TX_DEST_7 pa_CMD_TX_DEST_7_GEN2
2518 #define pa_CMD_TX_DEST_8 pa_CMD_TX_DEST_8_GEN2
2519 #endif
2521 /* @} */
2522 /** @} */
2524 /**
2525 * @defgroup paLut1Inst PA LUT1 Instance Destinations
2526 * @ingroup palld_api_constants
2527 * @{
2528 *
2529 * @name PA LUT1 Instance Destinations
2530 *
2531 * @brief These values are used by the module user to specify the LUT1 table instance used by the specified IP, ACL or customLUT1 entry.
2532 * @note PA LLD will determine the appropriate LUT1 instance to add/configure LUT1 entry based on the types of API and the linking information
2533 * in normal operation, i.e. when lutInst is set to pa_LUT_INST_NOT_SPECIFIED. These values are only used by module users, who want to maintain their own LUT1 tables,
2534 * to overwrite the default rules.
2535 */
2536 /* @{ */
2537 /**
2538 * @def pa_LUT1_INST_0_0
2539 * LUT1 instance of Ingress0, PDSP0
2540 */
2541 #define pa_LUT1_INST_0_0 0 /**< LUT1 table connected to Ingress0, PDSP0 */
2543 /**
2544 * @def pa_LUT1_INST_0_1
2545 * LUT1 instance of Ingress0, PDSP1
2546 */
2547 #define pa_LUT1_INST_0_1 1 /**< LUT1 table connected to Ingress0, PDSP1 */
2549 /**
2550 * @def pa_LUT1_INST_1_0
2551 * LUT1 instance of Ingress1, PDSP0
2552 */
2553 #define pa_LUT1_INST_1_0 2 /**< LUT1 table connected to Ingress1, PDSP0 */
2555 /**
2556 * @def pa_LUT1_INST_0_1
2557 * LUT1 instance of Ingress1, PDSP1
2558 */
2559 #define pa_LUT1_INST_1_1 3 /**< LUT1 table connected to Ingress1, PDSP1 */
2561 /**
2562 * @def pa_LUT1_INST_2_0
2563 * LUT1 instance of Ingress2, PDSP0
2564 */
2565 #define pa_LUT1_INST_2_0 4 /**< LUT1 table connected to Ingress2, PDSP0 */
2567 /**
2568 * @def pa_LUT1_INST_3_0
2569 * LUT1 instance of Ingress3, PDSP0
2570 */
2571 #define pa_LUT1_INST_3_0 5 /**< LUT1 table connected to Ingress3, PDSP0 */
2573 /**
2574 * @def pa_LUT1_INST_4_0
2575 * LUT1 instance of Ingress4, PDSP0
2576 */
2577 #define pa_LUT1_INST_4_0 6 /**< LUT1 table connected to Ingress4, PDSP0 */
2579 /**
2580 * @def pa_LUT1_INST_5_0
2581 * LUT1 instance of Egress0, PDSP0
2582 */
2583 #define pa_LUT1_INST_5_0 7 /**< LUT1 table connected to Egress0, PDSP0 */
2586 /**< LUT1 instances of First Generation PASS */
2587 #define pa_LUT1_INST_0_GEN1 0 /**< LUT1 table connected to PDSP0 (PASS Gen1)*/
2588 #define pa_LUT1_INST_1_GEN1 1 /**< LUT1 table connected to PDSP1 (PASS Gen1)*/
2589 #define pa_LUT1_INST_2_GEN1 2 /**< LUT1 table connected to PDSP2 (PASS Gen1)*/
2590 #define pa_LUT1_INST_MAX_GEN1 pa_LUT1_INST_2_GEN1
2593 /**< LUT1 instances of Second Generation PASS */
2594 #define pa_LUT1_INST_0_GEN2 pa_LUT1_INST_0_0 /**< LUT1 table equivalent to Netcp 1.0 LUT1_0 (Pass Gen2)*/
2595 #define pa_LUT1_INST_1_GEN2 pa_LUT1_INST_1_0 /**< LUT1 table equivalent to Netcp 1.0 LUT1_1 (Pass Gen2)*/
2596 #define pa_LUT1_INST_2_GEN2 pa_LUT1_INST_4_0 /**< LUT1 table equivalent to Netcp 1.0 LUT1_2 (Pass Gen2)*/
2597 #define pa_LUT1_INST_MAX_GEN2 pa_LUT1_INST_5_0
2599 /**
2600 *
2601 * @name Common LUT1 instance for NSS
2602 *
2603 * @brief Define the LUT1 instance based on the compiler switch NSS_GEN2 to cover both generations of NSS.
2604 * These values are intended to be used by the LLD only. For the application which maintain the LUT1
2605 * tables should either use the LUT1 instance definitions with _GEN1 and _GEN2 suffix or these definitions
2606 * with the compiler switch NSS_GEN2 defined or undefined.
2607 */
2610 #ifndef NSS_GEN2
2611 /**
2612 * @def pa_LUT1_INST_0
2613 * LUT1 instance 0
2614 */
2615 #define pa_LUT1_INST_0 pa_LUT1_INST_0_GEN1 /**< LUT1 Instance 0 for MAC/SRIO */
2617 /**
2618 * @def pa_LUT1_INST_1
2619 * LUT1 instance 1
2620 */
2621 #define pa_LUT1_INST_1 pa_LUT1_INST_1_GEN1 /**< LUT1 instance 1 for Outer IP */
2623 /**
2624 * @def pa_LUT1_INST_2
2625 * LUT1 instance 2
2626 */
2627 #define pa_LUT1_INST_2 pa_LUT1_INST_2_GEN1 /**< LUT1 instance 2 for Inner IP */
2629 /**
2630 * @def pa_LUT1_INST_MAX
2631 * Specify the maximum LUT1 instance
2632 */
2633 #define pa_LUT1_INST_MAX pa_LUT1_INST_MAX_GEN1
2635 #else
2637 /**
2638 * @def pa_LUT1_INST_0
2639 * LUT1 instance 0
2640 */
2641 #define pa_LUT1_INST_0 pa_LUT1_INST_0_GEN2 /**< LUT1 Instance 0 for MAC/SRIO */
2643 /**
2644 * @def pa_LUT1_INST_1
2645 * LUT1 instance 1
2646 */
2647 #define pa_LUT1_INST_1 pa_LUT1_INST_1_GEN2 /**< LUT1 instance 1 for Outer IP */
2649 /**
2650 * @def pa_LUT1_INST_2
2651 * LUT1 instance 2
2652 */
2653 #define pa_LUT1_INST_2 pa_LUT1_INST_2_GEN2 /**< LUT1 Instance 2 for Inner IP */
2655 /**
2656 * @def pa_LUT1_INST_MAX
2657 * Specify the maximum LUT1 instance
2658 */
2659 #define pa_LUT1_INST_MAX pa_LUT1_INST_MAX_GEN2
2661 #endif
2662 /* @} */
2663 /** @} */
2665 /**
2666 * @defgroup paAclInst PA ACL LUT Instance Destinations
2667 * @ingroup palld_api_constants
2668 * @{
2669 *
2670 * @name PA ACL Lut Instance Destinations
2671 *
2672 * @brief These values are used by the module user to specify the ACL Lut instance
2673 *
2674 * @note These definitions are valid for the second generation PASS only.
2675 */
2676 /* @{ */
2678 /**
2679 * @def pa_ACL_INST_OUTER_IP
2680 * LUT1 instance of ACL Table 0 for Outer IP
2681 */
2682 #define pa_ACL_INST_OUTER_IP pa_LUT1_INST_0_1 /**< LUT1 table used for ACL Table 0 */
2685 /**
2686 * @def pa_ACL_INST_INNER_IP
2687 * LUT1 instance of ACL Table 1 for Inner IP
2688 */
2689 #define pa_ACL_INST_INNER_IP pa_LUT1_INST_3_0 /**< LUT1 table used for ACL Table 1 */
2691 /* @} */
2692 /** @} */
2695 /**
2696 * @defgroup paCrcInst PA CRC Engine Instance Destinations
2697 * @ingroup palld_api_constants
2698 * @{
2699 *
2700 * @name PA CRC Engine Instance Destinations
2701 *
2702 * @brief These values are used by the module user to specify the CRC Engine instance
2703 *
2704 * @note These definitions are valid for the second generation PASS only.
2705 */
2706 /* @{ */
2707 /**
2708 * @def pa_CRC_INST_0_0
2709 * CRC instance of Ingress0
2710 */
2711 #define pa_CRC_INST_0_0 0 /**< CRC Engine between Ingress0, CDE0 and CED1 */
2713 /**
2714 * @def pa_CRC_INST_1_0
2715 * CRC instance of Ingress1
2716 */
2717 #define pa_CRC_INST_1_0 1 /**< CRC Engine between Ingress1, CDE0 and CED1 */
2719 /**
2720 * @def pa_CRC_INST_4_0
2721 * LUT1 instance of Ingress4
2722 */
2723 #define pa_CRC_INST_4_0 2 /**< CRC Engine between Ingress4, CDE0 and CED1 */
2725 /**
2726 * @def pa_CRC_INST_5_0
2727 * LUT1 instance of Post
2728 */
2729 #define pa_CRC_INST_5_0 3 /**< CRC Engine between Post, CDE0 and CED1 */
2731 /**
2732 * @def pa_CRC_INST_6_0
2733 * CRC instance 0 of Egress0
2734 */
2735 #define pa_CRC_INST_6_0 4 /**< CRC Engine between Egress0, CDE0 and CED1 */
2737 /**
2738 * @def pa_CRC_INST_6_1
2739 * CRC instance 1 of Egress0
2740 */
2741 #define pa_CRC_INST_6_1 5 /**< CRC Engine between Egress0, CDE1 and CED2 */
2743 /**
2744 * @def pa_CRC_INST_MAX
2745 * Specify the maximum CRC Engine instance
2746 */
2747 #define pa_CRC_INST_MAX pa_CRC_INST_6_1
2749 /* @} */
2750 /** @} */
2752 /**
2753 * @defgroup paRaInst PA RA Instance Destinations
2754 * @ingroup palld_api_constants
2755 * @{
2756 *
2757 * @name PA RA Instance Destinations
2758 *
2759 * @brief These values are used by the module user to specify the RA instance (group)
2760 *
2761 * @note These definitions are valid for the second generation PASS only.
2762 */
2763 /* @{ */
2764 /**
2765 * @def pa_RA_INST_0
2766 * RA instance of Outer IP
2767 */
2768 #define pa_RA_INST_0 0 /**< RA instance to be accessed from Ingress0, PDSP1 for outer IP reassembly */
2771 /**
2772 * @def pa_RA_INST_1
2773 * RA instance of Inner IP
2774 */
2775 #define pa_RA_INST_1 1 /**< RA instance to be accessed from Ingress3, PDSP0 for inner IP reassembly */
2777 /**
2778 * @def pa_RA_INST_MAX
2779 * Specify the maximum RA instance
2780 */
2781 #define pa_RA_INST_MAX pa_RA_INST_1
2783 /* @} */
2784 /** @} */
2786 /**
2787 * @defgroup paCmdCode Command Code
2788 * @ingroup palld_api_constants
2789 * @{
2790 *
2791 * @name PA Command Codes
2792 *
2793 * @brief Define the commands which can be executed in PASS
2794 *
2795 * @details A single command or a set of commands can be executed to support fully-offloaded
2796 * data path in both the transmit (to network) and receive (from network) directions.
2797 * In the to-network direction, the list of commands formatted by the module should
2798 * be stored as the protocol-specific information at the packet descriptor with the
2799 * packet. The commands will be executed in order at PASS and the associated security
2800 * accelerator sub-system (SASS). The executed commands will be removed by PASS and
2801 * SASS so that the output packet will not contain any command.
2802 * In the from-network direction, the list of commands formatted by the module will
2803 * be stored at the PASS as a command set which can be referred to by the command set
2804 * index. A single command including a command set can be executed per the enhanced
2805 * routing information @ref paRouteInfo_t after a LUT1 or LUT2 matches.
2806 *
2807 * @note The packet offset specified at each command of the command list should be strictly
2808 * in ascending order becasue the PASS processes the list of commands in order and it
2809 * can not move backwards. The command violating the order requirement may be detected
2810 * and rejected by the API @ref Pa_formatTxCmd and @ref Pa_configCmdSet. In the case,
2811 * the order constraint can not be validated at the LLD, the violating command will
2812 * be ignored by the PASS.
2813 */
2814 /** @ingroup paCmdCode */
2815 /* @{ */
2816 /**
2817 * @def pa_CMD_NONE
2818 * End of commands
2819 */
2820 #define pa_CMD_NONE 0
2822 /* @def pa_CMD_NEXT_ROUTE
2823 * Specifies next route
2824 */
2825 #define pa_CMD_NEXT_ROUTE 1
2827 /* @def pa_CMD_CRC_OP
2828 * CRC generation or verification
2829 */
2830 #define pa_CMD_CRC_OP 2
2832 /* @def pa_CMD_COPY_DATA_TO_PSINFO
2833 * Copy Data from the packet to the PS Info Area in the packet descriptor
2834 */
2835 #define pa_CMD_COPY_DATA_TO_PSINFO 3
2837 /* @def pa_CMD_PATCH_DATA
2838 * Insert or patch packet data at the specific location
2839 */
2840 #define pa_CMD_PATCH_DATA 4
2842 /* @def pa_CMD_TX_CHECKSUM
2843 * Compute and insert checksum
2844 */
2845 #define pa_CMD_TX_CHECKSUM 5
2847 /* @def pa_CMD_MULTI_ROUTE
2848 * Duplicate packet to multiple destinations
2849 */
2850 #define pa_CMD_MULTI_ROUTE 6
2852 /* @def pa_CMD_REPORT_TX_TIMESTAMP
2853 * Report the tx packet exit time in term of PASS 48-bit timestamp
2854 */
2855 #define pa_CMD_REPORT_TX_TIMESTAMP 7
2857 /* @def pa_CMD_REMOVE_HEADER
2858 * Remove the parsed packet header
2859 * @note It should be the first command in the rx command set
2860 */
2861 #define pa_CMD_REMOVE_HEADER 8
2863 /* @def pa_CMD_REMOVE_TAIL
2864 * Remove the parsed packet tail
2865 *
2866 * @note It should be the last command next to the next route or multi-route command
2867 */
2868 #define pa_CMD_REMOVE_TAIL 9
2871 /* @def pa_CMD_CMDSET
2872 * Specify the command set to be executed
2873 */
2874 #define pa_CMD_CMDSET 10
2876 /* @def pa_CMD_SA_PAYLOAD
2877 * Specify the payload information required by SASS
2878 */
2879 #define pa_CMD_SA_PAYLOAD 11
2881 /* @def pa_CMD_IP_FRAGMENT
2882 * Perform IPv4 fragmentation
2883 */
2884 #define pa_CMD_IP_FRAGMENT 12
2886 /* @def pa_CMD_USR_STATS
2887 * Update the specified user-defined counter and the counters which are linked to this counter
2888 */
2889 #define pa_CMD_USR_STATS 13
2892 /* @def pa_CMD_CMDSET_AND_USR_STATS
2893 * Combination of the CMDSET and USR_STATS commands.
2894 * @note It is only used as a command executed after the last classification per the enhanced routing
2895 * information
2896 */
2897 #define pa_CMD_CMDSET_AND_USR_STATS 14
2899 /* @def pa_CMD_PATCH_MSG_LEN
2900 * Update the message length field within some L2 protocol header such as 802.3 and PPPoE after the
2901 * potential IP fragmentation operation
2902 * @note This command is only used in conjunction with the pa_CMD_IP_FRAGMENT command.
2903 */
2904 #define pa_CMD_PATCH_MSG_LEN 15
2906 /* @def pa_CMD_VERIFY_PKT_ERROR
2907 * Verify the packet error based on the CPPI error flags as specified at @ref Appendix2 and forward
2908 * the error packet to the specified destination
2909 * @note This packet error verification is not applicable to the CRC verification operation within the same
2910 * command set.
2911 * @note This command should be either the last command or the second last to the nextRoute command since
2912 * all commands following this operation will be ignored if packet error is found.
2913 */
2914 #define pa_CMD_VERIFY_PKT_ERROR 16
2917 /* @def pa_CMD_SPLIT
2918 * Split the packet into header and payload portion to be delivered to different queues with
2919 * different CPPI flows
2920 * @note This command is only supported in the from-network direction
2921 * @note This command should be placed ahead of any pa_CMD_PATCH command so that the header size can be adjusted accordingly
2922 * @note The first 8-byte of psInfo area is reserved for this operation, therefore, the destOffset of pa_CMD_COPY_DATA_TO_PSINFO
2923 * commands within the same command set should be 8 or larger.
2924 *
2925 */
2927 #define pa_CMD_SPLIT 17
2929 /* @def pa_CMD_EF_OP
2930 * Egress Flow operation command either triggers flow cache lookup to find the corresponding packet modification records
2931 * or provides those records directly.
2932 * @note This command can not be combined with any other commands
2933 */
2934 #define pa_CMD_EF_OP 18
2937 /* @} */
2938 /** @} */
2940 /**
2941 * @defgroup routeCtrlInfo PA Routing Control Info Bit Definitions
2942 * @ingroup palld_api_constants
2943 * @{
2944 *
2945 * @name PA Routing Control Info Bit Definitions
2946 *
2947 * Bitmap definition of the ctrlBitField in @ref paCmdNextRoute_t.
2948 */
2949 /*@{*/
2950 /**
2951 * @def pa_NEXT_ROUTE_PARAM_PRESENT
2952 * Control Info -- Set: Routing information such as flowId, queue are in command for egress packets
2953 * Clear: Routing information such as flowId, queue are in packet for ingress packets
2954 */
2955 #define pa_NEXT_ROUTE_PARAM_PRESENT 0x0001
2956 /**
2957 * @def pa_NEXT_ROUTE_PROC_NEXT_CMD
2958 * Control Info -- Set: Process the next command prior to forward the packet to its final destination
2959 * Clear: Forward the packet to the next destination without executing any more command
2960 * @note: The data patch command (pa_CMD_PATCH_DATA) is the only one which can follow the next route command.
2961 * @note: This option is only valid in the transmit (to-network) direction
2962 */
2963 #define pa_NEXT_ROUTE_PROC_NEXT_CMD 0x0002
2964 /**
2965 * @def pa_NEXT_ROUTE_PROC_MULTI_ROUTE
2966 * Control Info -- Set: Multi-route is valid, the packet should be forwarded and then perform multi-route
2967 * Clear: Multi-route is invalid
2968 * @note: This option is only valid in the receive (from-network) direction
2969 */
2970 #define pa_NEXT_ROUTE_PROC_MULTI_ROUTE 0x0004
2971 /**
2972 * @def pa_NEXT_ROUTE_TX_L2_PADDING
2973 * Control Info -- Set: Perform MAC padding for packet with size smaller than 60
2974 * Clear: Do not perform MAC padding
2975 * @note: This option is only valid in the transmit (to-network) direction
2976 */
2977 #define pa_NEXT_ROUTE_TX_L2_PADDING 0x0008
2978 /**
2979 * @def pa_NEXT_ROUTE_PROC_USR_STATS
2980 * Control Info -- Set: User-defined statistics index is valid, update the chain of user-defined statistics specified
2981 * by statsIndex
2982 * Clear: User-defined statistics index is invalid
2983 * @note: This option is only valid in the egress (to-network) direction
2984 */
2985 #define pa_NEXT_ROUTE_PROC_USR_STATS 0x0010
2987 /*@}*/
2988 /** @} */
2990 /**
2991 * @ingroup palld_api_structures
2992 * @brief Next Route Command
2993 *
2994 * @details paCmdNextRoute_t defines the final route information
2995 * The next route command can be used in both to-network and from-network directions.
2996 * In the to-network direction, it may be used multiple times to route traffic between PASS and SASS
2997 * before the packet is finally forwarded to the network. For example, the following steps show the
2998 * SRTP over IPSEC AH to-network traffic:
2999 * @verbatim
3000 1. Packet is delivered to SASS for SRTP operation
3001 2. Packet is delivered to PASS for UDP checksum operation
3002 3. Packet is delivered to SASS for IPSEC AH operation
3003 4. Packet is delivered to PASS for AH authentication tag insertion
3004 5. Packet is delivered to the network.
3005 @endverbatim
3006 * The next route commands are required for step 3 and 5. The complete routing information should be provided
3007 * in the to-network direction.
3008 *
3009 * In the from-network direction, the next route command is used only if the multiple routes are required or when
3010 * dest is set to EMAC to forward the ingress packets out to another EMAC port.
3011 * In this case, only the parameter "ctrlBitfield", "multiRouteIndex" and/or "dest" are valid. After all the
3012 * commands in the command set are executed, the PASS will deliver packets to their desired destination based
3013 * on the parameters specified at the routing information upon the LUT1/LUT2 matching.
3014 * If the next route command is specified, it must be the last command within a command set. The commands following
3015 * the next route command will not be executed.
3016 */
3018 typedef struct {
3020 uint16_t ctrlBitfield; /**< Routing control information as defined at @ref routeCtrlInfo */
3021 int dest; /**< Packet destination as defined at @ref pktDest */
3022 uint8_t pktType_emacCtrl;/**< For destination SRIO, specify the 5-bit packet type toward SRIO
3023 For destination HOST, EMAC, specify the EMAC control @ref emcOutputCtrlBits to the network */
3024 uint8_t flowId; /**< For host, SA or SRIO destinations, specifies return free descriptor setup */
3025 uint16_t queue; /**< For host, SA or SRIO destinations, specifies the dest queue */
3026 uint32_t swInfo0; /**< Placed in SwInfo0 for packets to host or SA; Placed in the PS Info for packets to SRIO*/
3027 uint32_t swInfo1; /**< Placed in SwInfo1 for packets to the SA; Placed in the PS Info for packets to SRIO */
3028 uint16_t multiRouteIndex; /**< Multi-route index. It is valid in the from-network direction only */
3029 uint16_t statsIndex; /**< Index of the first user-defined statistics to be updated.
3030 This optional parameter is valid in the to-network direction only */
3031 } paCmdNextRoute_t;
3033 /**
3034 * @defgroup crcFrameTypes CRC Frame types
3035 * @ingroup palld_api_constants
3036 * @{
3037 *
3038 * @name CRC Frame types
3039 *
3040 * @brief Define the frame types which are used to extract and derive the CRC operation parameters such as CRC starting
3041 * offset and CRC payload length from the frame header.
3042 *
3043 * @details Both the payload length and the byte location where CRC calculation begins may vary in some protocl
3044 * frame such as WCDMA FP HS-DSCH Data Frame type 2 and type 3. The CRC Frame type is used for PASS to
3045 * extract and/or derive the CRC starting offset and payload length.
3046 *
3047 * @note Only the following frame types are supported.
3048 */
3049 /* @{ */
3050 /**
3051 *
3052 * @def pa_CRC_OP_FRAME_TYPE_IUB_FP_HS_DSCH_TYPE2
3053 * WCDMA FP HS-DSCH Data Frame Type 2
3054 */
3055 #define pa_CRC_OP_FRAME_TYPE_IUB_FP_HS_DSCH_TYPE2 0
3057 /**
3058 *
3059 * @def pa_CRC_OP_FRAME_TYPE_IUB_FP_HS_DSCH_TYPE3
3060 * WCDMA FP HS-DSCH Data Frame Type 3
3061 */
3062 #define pa_CRC_OP_FRAME_TYPE_IUB_FP_HS_DSCH_TYPE3 1
3064 #define pa_CRC_OP_FRAME_TYPE_MAX pa_CRC_OP_FRAME_TYPE_IUB_FP_HS_DSCH_TYPE3
3067 /* @} */
3068 /** @} */
3071 /**
3072 * @defgroup crcOpCtrlInfo PA CRC Command Control Info Bit Definitions
3073 * @ingroup palld_api_constants
3074 * @{
3075 *
3076 * @name PA CRC Command Control Info Bit Definitions
3077 *
3078 * Bitmap definition of the ctrlBitField in @ref paCmdCrcOp_t.
3079 */
3080 /*@{*/
3081 /**
3082 * @def pa_CRC_OP_CRC_VALIDATE
3083 * Control Info -- Set: CRC Validate
3084 * Clear: CRC Computation
3085 */
3086 #define pa_CRC_OP_CRC_VALIDATE 0x0001
3087 /**
3088 * @def pa_CRC_OP_PAYLOAD_LENGTH_IN_HEADER
3089 * Control Info -- Set: CRC length field in the header
3090 * Clear: CRC length specified in command
3091 */
3092 #define pa_CRC_OP_PAYLOAD_LENGTH_IN_HEADER 0x0002
3093 /**
3094 * @def pa_CRC_OP_PAYLOAD_LENGTH_OFFSET_IS_NEGATIVE
3095 * Control Info -- Set: Payload length field resides prior to the parsed header offset
3096 * length field offset = offset from the current parsed header - lenOffset
3097 * Clear: Payload length field resides after the parsed header offset
3098 * length field offset = offset from the current parsed header + lenOffset
3099 */
3100 #define pa_CRC_OP_PAYLOAD_LENGTH_OFFSET_IS_NEGATIVE 0x0004
3101 /**
3102 * @def pa_CRC_OP_CRC_FRAME_TYPE
3103 * Control Info -- Set: Frame Type is specified
3104 * Clear: Frame Type is not specified, use offset
3105 * parameter
3106 */
3107 #define pa_CRC_OP_CRC_FRAME_TYPE 0x0008
3108 /**
3109 * @def pa_CRC_OP_CRC_RESULT_FOLLOW_PAYLOAD
3110 * Control Info -- Set: CRC field following payload
3111 * Clear: CRC offset specified in command
3112 */
3113 #define pa_CRC_OP_CRC_RESULT_FOLLOW_PAYLOAD 0x0010
3114 /*@}*/
3115 /** @} */
3117 /**
3118 * @ingroup palld_api_structures
3119 * @brief CRC Generation/Verification Command
3120 *
3121 * @details paCmdCrcOp_t is used to create CRC operation command instruct the PASS to
3122 * perform CRC operation in both to-network and from-network directions. The
3123 * module user is responsible for configuring the corresponding CRC engines
3124 * which are used for the specified CRC operation.
3125 *
3126 * In the to-network direction, the payload offset, payload length and CRC offset
3127 * should be available in the command. The generated CRC will be inserted into
3128 * the CRC location in the packet.
3129 *
3130 * In the from-network direction, the payload length is either a constant or
3131 * available in the custom header. The CRC verification will be performed by
3132 * the CRC engine connected to the PDSP where the CRC command is executed.
3133 * The CRC verification result will be indicated by the error flags within
3134 * the CPPI descriptor as described at section table @ref appendix2
3135 */
3137 typedef struct {
3139 uint16_t ctrlBitfield; /**< CRC operation control information as defined at @ref crcOpCtrlInfo */
3140 uint16_t startOffset; /**< Byte location, from SOP/Protocol Header, where the CRC computation begins
3141 if frame type is not specified
3142 Byte location, from SOP/Protocol header, where the specific frame header begins
3143 if frame type is specified
3144 In to-network direction: offset from SOP
3145 In from-network direction: offset from the current parsed header
3146 */
3147 uint16_t len; /**< Number of bytes covered by the CRC computation
3148 valid only if pa_CRC_OP_PAYLOAD_LENGTH_IN_HEADER is clear */
3149 uint16_t lenOffset; /**< Payload length field offset in the custom header */
3150 uint16_t lenMask; /**< Payload length field mask */
3151 uint16_t lenAdjust; /**< Payload length adjustment: valid only if pa_CRC_OP_PAYLOAD_LENGTH_IN_HEADER is set */
3152 uint16_t crcOffset; /**< Offset from CRC computation starting location to the CRC field */
3153 uint16_t crcSize; /**< Size of CRC in bytes (PASS Gen2 only) */
3154 uint16_t frameType; /**< Frame type @ref crcFrameTypes, vaild if pa_CRC_OP_CRC_FRAME_TYPE is set */
3155 uint32_t initValue; /**< CRC initial value (PASS Gen2 only) */
3156 } paCmdCrcOp_t;
3158 /**
3159 * @defgroup splitOpCtrlInfo PA SPLIT Command Control Info Bit Definitions
3160 * @ingroup palld_api_constants
3161 * @{
3162 *
3163 * @name PA SPLIT Command Control Info Bit Definitions
3164 *
3165 * Bitmap definition of the ctrlBitField in @ref paCmdSplitOp_t.
3166 */
3167 /*@{*/
3168 /**
3169 * @def pa_SPLIT_OP_FRAME_TYPE
3170 * Control Info -- Set: Frame Type is specified
3171 * Clear: Frame Type is not specified, use offset
3172 * parameter
3173 */
3174 #define pa_SPLIT_OP_FRAME_TYPE 0x0001
3175 /*@}*/
3176 /** @} */
3178 /**
3179 * @ingroup palld_api_structures
3180 * @brief Split Command
3181 *
3182 * @details paCmdSplitOp_t is used to create Split command to instruct the PASS to
3183 * divide the ingress packet into the header and payload portion and deliver them
3184 * to specified destination queues with specified CPPI flows respectively.
3185 * Where the destination information of the header packet is specified by the
3186 * classification routing information and the destination information of the payload
3187 * packet is specified in this structure.
3188 *
3189 */
3190 typedef struct {
3191 uint16_t ctrlBitfield; /**< Split operation control information as defined at @ref splitOpCtrlInfo */
3192 uint16_t startOffset; /**< Byte location, from Protocol Header, where the payload begins
3193 if frame type is not specified
3194 Byte location, from Protocol header, where the specific frame header begins
3195 if frame type is specified
3196 In from-network direction: offset from the current parsed header
3197 */
3198 uint16_t frameType; /**< Frame type @ref crcFrameTypes, vaild if pa_SPLIT_OP_FRAME_TYPE is set */
3199 uint16_t destQueue; /**< Host queue for the payload packet */
3200 uint16_t flowId; /**< CPPI flow which instructs how link-buffer queues are used for sending payload packets. */
3202 } paCmdSplitOp_t;
3204 /**
3205 * @ingroup palld_api_structures
3206 * @brief Transmit checksum configuration
3207 *
3208 * @details paTxChksum_t is used in the call to @ref Pa_formatTxRoute or @ref Pa_formatTxCmd to create a tx
3209 * command header that instructs the packet accelerator sub-system to generate ones' complement
3210 * checksums into network packets. The checksums are typically used for TCP and UDP payload checksums as
3211 * well as IPv4 header checksums. In the case of TCP and UDP payload checksums the psuedo header
3212 * checksum must be pre-calculated and provided, the sub-system does not calculate it.
3213 */
3214 typedef struct {
3216 uint16_t startOffset; /**< Byte location, from SOP, where the checksum calculation begins */
3217 uint16_t lengthBytes; /**< Number of bytes covered by the checksum. Must be even */
3218 uint16_t resultOffset; /**< Byte offset, from startOffset, to place the resulting checksum */
3219 uint16_t initialSum; /**< Initial value of the checksum */
3220 uint16_t negative0; /**< If TRUE, a computed value of 0 is written as -0 */
3222 } paTxChksum_t;
3225 /**
3226 * @defgroup copyCtrlInfo PA Copy Command Control Info Bit Definitions
3227 * @ingroup palld_api_constants
3228 * @{
3229 *
3230 * @name PA Copy Command Control Info Bit Definitions
3231 *
3232 * Bitmap definition of the ctrlBitField in @ref paCmdCopy_t.
3233 *
3234 */
3235 /*@{*/
3236 /**
3237 * @def pa_COPY_OP_FROM_END
3238 * Control Info -- Set: Copy data from the end of the payload
3239 * Clear: Copy data from the beginning of the payload
3240 */
3241 #define pa_COPY_OP_FROM_END 0x0001
3242 /*@}*/
3243 /** @} */
3245 /**
3246 * @ingroup palld_api_structures
3247 * @brief Copy Command
3248 *
3249 * @details paCmdCopy_t is used to define how to copy number of bytes from the data packet to
3250 * the descriptor. The copy command is used to instruct the PASS to copy up to 8 byte
3251 * from packet to the PS info section in the packet descriptor in the from-network direction.
3252 * If the desired copy area crosses over the packet boundary, then garbage data will be copied.
3253 *
3254 * @note: There are 20-byte packet information stored in the PS Info section. It is recommended to copy
3255 * packet data after the packet information area. Otherwise, the packet information will be
3256 * overwritten. There are upto 12 bytes can be copied with the packet information or upto
3257 * 32 bytes can be copied without the packet information.
3258 */
3260 typedef struct {
3262 uint16_t ctrlBitfield; /**< Copy operation control information as defined at @ref copyCtrlInfo */
3263 uint16_t srcOffset; /**< Offset from the start of current protocol header for the data copy to begin */
3264 uint16_t destOffset; /**< Offset from the top of the PSInfo for the data to be copied to */
3265 uint16_t numBytes; /**< Number of bytes to be copied */
3266 } paCmdCopy_t;
3269 /**
3270 * @ingroup palld_api_structures
3271 * @brief Multi-route Command
3272 *
3273 * @details paCmdMultiRoute_t is used to specify the desired PA multi-route set.
3274 * The multi-route command instructs the PASS to route the packets to multiple
3275 * destinations in the from-network direction only. It must be the last command
3276 * within a command set. The commands following the multi-route command will
3277 * not be executed.
3278 */
3279 typedef struct {
3281 uint16_t index; /**< Multi-route set Index */
3282 } paCmdMultiRoute_t;
3285 /**
3286 * @ingroup palld_api_constants
3287 * @def pa_MAX_CMD_SETS
3288 * The maximum number of command sets supported
3289 */
3290 #define pa_MAX_CMD_SETS 64
3292 /**
3293 * @ingroup palld_api_structures
3294 * @brief Command Set Command
3295 *
3296 * @details paCmdSet_t is used to specify the desired PA command set. The command set command
3297 * instructs the PASS to execute a list of commands after a LUT1 or LUT2 match occurs.
3298 * It is one of the command which can be embedded within the @ref paRouteInfo_t.
3299 */
3300 typedef struct {
3302 uint16_t index; /**< Command Set Index */
3303 } paCmdSet_t;
3305 /**
3306 * @ingroup palld_api_constants
3307 * @def pa_MAX_PATCH_BYTES
3308 * The maximum number of bytes that a patch command can accept
3309 */
3310 #define pa_MAX_PATCH_BYTES 16 /**< PATCH Command in to-netweok direction */
3311 #define pa_MAX_RX_PATCH_BYTES 32 /**< PATCH Command within a command set */
3313 /**
3314 * @defgroup patchCtrlInfo PA Patch Command Control Info Bit Definitions
3315 * @ingroup palld_api_constants
3316 * @{
3317 *
3318 * @name PA Patch Command Control Info Bit Definitions
3319 *
3320 * Bitmap definition of the ctrlBitField in @ref paPatchInfo_t.
3321 *
3322 */
3323 /*@{*/
3324 /**
3325 * @def pa_PATCH_OP_INSERT
3326 * Control Info -- Set: Insert data into the packet
3327 * Clear: Patch data replaces existing packet data
3328 */
3329 #define pa_PATCH_OP_INSERT 0x0001
3330 /**
3331 * @def pa_PATCH_OP_MAC_HDR
3332 * Control Info -- Set: Replace MAC header with patch data
3333 * Clear: Normal Patch/Insert operation
3334 */
3335 #define pa_PATCH_OP_MAC_HDR 0x0002
3336 /**
3337 * @def pa_PATCH_OP_DELETE
3338 * Control Info -- Set: Delete data in the packet
3339 * Clear: Normal Patch/Insert operation
3340 */
3341 #define pa_PATCH_OP_DELETE 0x0004
3342 /*@}*/
3343 /** @} */
3346 /**
3347 * @ingroup palld_api_structures
3348 * @brief Packet patching configuration
3349 *
3350 * @details paPatchInfo_t is used to create data patch command. The patch command is used to patch
3351 * existing data or insert data in the packet in both to-network and from-network directions.
3352 *
3353 * In the to-network direction, it can be used to patch the authentication tag provided by SASS
3354 * into the AH header within the packet. In this case, the patch data is not present at the command
3355 * when it is formatted and it is appended by the SASS. The @ref Pa_formatRoutePatch is used to create
3356 * a command block along with a packet routing command to forward the packet after the patch is complete
3357 *
3358 * In the from-network direction, it can be used to insert up to 32 bytes to the offset location
3359 * as part of the command set to be executed after a LUT1 or LUT2 match.
3360 * This command can be used to patch the entire MAC header for MAC router functionality. It may be further
3361 * enhanced and combined with other commands to support IP forwarding operation in the future.
3362 * A short version of the patch command can be used to insert up to 2 bytes into the current parsing
3363 * location of the packet after a LUT2 match.
3364 */
3366 typedef struct {
3368 uint16_t ctrlBitfield; /**< Patch operation control information as defined at @ref patchCtrlInfo */
3369 uint16_t nPatchBytes; /**< The number of bytes to be patched */
3370 uint16_t totalPatchSize; /**< The number of patch bytes in the patch command, must be >= to nPatchBytes and a multiple of 4 bytes */
3371 uint16_t offset; /**< Offset from the start of the packet for the patch to begin in the to-network direction
3372 Offset from the start of the current header for the patch to begin in the from-network direction */
3373 uint8_t *patchData; /**< Pointer to the patch data */
3375 } paPatchInfo_t;
3379 /**
3380 * @ingroup palld_api_structures
3381 * @brief paPayloadInfo_t defines the packet payload information in the short format.
3382 * It is required by the Security Accelerator sub-system (SASS)
3383 *
3384 * @details paPayloadInfo_t defines the packet parsing information in terms of
3385 * payload offset and payload length as described below
3386 * @li SRTP: offset to the RTP header; RTP payload length including ICV
3387 * @li IPSEC AH: offset to the Outer IP; IP payload length
3388 * @li IPSEC ESP: offset to the ESP header; ESP papload length including ICV
3389 */
3391 typedef struct {
3392 uint16_t offset; /**< The offset to where the SA packet parsing starts */
3393 uint16_t len; /**< The total length of the protocal payload to be processed by SA */
3394 uint32_t supData; /**< Optional supplement data such as the 32-bit CountC for some 3GPP operation modes */
3395 } paPayloadInfo_t;
3398 /**
3399 * @ingroup palld_api_structures
3400 * @brief Tx timestamp reporting information
3401 *
3402 * @details paCmdTxTimestamp_t specifies the tx timestamp reporting information. The report tx timestamp command is used to instruct
3403 * the PASS to report the PA timestamp when the packet is transmitting out of PASS in a return (null) packet to the specified
3404 * host queue. The transmit timestamp may be used for the Precision Timing Protocol (PTP). The reported tx timestamp will be
3405 * a 48 bit value, with the lower 32 bits stored in timestamp field, and the upper 16 bits stored in swInfo1.
3406 *
3407 * @pre API @ref Pa_configTimestamp() should be called to enable PASS system timestamp.
3408 */
3410 typedef struct {
3411 uint16_t destQueue; /**< Host queue for the tx timestamp reporting packet */
3412 uint16_t flowId; /**< CPPI flow which instructs how link-buffer queues are used for sending tx timestamp reporting packets. */
3413 uint32_t swInfo0; /**< lower 32 bit value returned in the descriptor as swInfo0 which can be used as event identifier */
3414 } paCmdTxTimestamp_t;
3416 /**
3417 * @ingroup palld_api_structures
3418 * @brief IP fragmentation information
3419 *
3420 * @details paCmdIpFrag_t is used to create the IPv4 fragment command. The IP fragment command is used to instruct the PASS to
3421 * perform IPv4 fragmentation operation. This operation can be applied to both inner IP prior to IPSEC encapsulation and
3422 * outer IP after IPSEC encapsulation. This command should go with a next route command which provides the destination
3423 * information prior to the fragmentation operation.
3424 *
3425 * For the inner IP fragmentation, follow the following procedure:
3426 * @li Host sends packets with the IP fragment command and the destination queue set to a host queue to PASS PDSP5
3427 * for IP fragmentation operation.
3428 * @li All fragments will be delivered to the specified host queue.
3429 * @li Host adds the outer MAC/IP header, invokes the SA LLD sendData function and then sends the fragments to the SA queue.
3430 * @li Each fragment will be encrypted, authenticated and forwarded to the final destination.
3431 *
3432 * For the outer IP fragmentation, the overall operation is stated below:
3433 * @li Packet is delivered to SASS for IPSEC operation
3434 * @li Packet is delivered to PASS for IP Fragmentation operation
3435 * @li The entire packet or its fragments are delivered to the network.
3436 *
3437 * @note the next route command is required for step 2
3438 * @note The IP fragment command can not be combined with some other tx commands such as checksum and CRC commands since
3439 * those commands may require the PASS operation across multiple fragments. The workaround is to break the tx commands into
3440 * two groups. The first group consists of the checksum, CRC, other commands and a next route command which routes the packet
3441 * back to the same PDSP to execute the second command group which consists of the IP fragment command and the next route
3442 * command which points to the final destination.
3443 *
3444 * The IP fragment command can be combined with a single blind patch command to support the IPSEC AH use case in which the SASS
3445 * passes the IPSEC AH packet with the blind patch command to the PASS so that the autentication tag can be inserted into the AH
3446 * header. The recommended order of the tx commands is as the followings:
3447 * - pa_CMD_IP_FRAGMENT
3448 * - pa_CMD_NEXT_ROUTE with flag pa_NEXT_ROUTE_PROC_NEXT_CMD set
3449 * - pa_CMD_PATCH_DATA
3450 *
3451 * The IP fragment command can be also combined with up to two message length patching commands to support the message length
3452 * field updating for each IP fragment. This operation is required for certain L2 header which contains a length field such as
3453 * 802.3 and PPPoE. The order of tx command is as the followings:
3454 * - pa_CMD_PATCH_MSG_LEN (optional)
3455 * - pa_CMD_PATCH_MSG_LEN (optional)
3456 * - pa_CMD_IP_FRAGMENT
3457 * - pa_CMD_NEXT_ROUTE
3458 */
3460 typedef struct {
3461 uint16_t ipOffset; /**< Offset to the IP header. */
3462 uint16_t mtuSize; /**< Size of the maximum transmission unit (>= 68) */
3463 } paCmdIpFrag_t;
3465 /**
3466 * @ingroup palld_api_structures
3467 * @brief Message length patching configuration
3468 *
3469 * @details paPatchMsgLenInfo_t is used to create message length patch command which is used in conjunction with
3470 * the Ip fragmentation command. This command instruct the PASS to update the message length field within
3471 * some L2 protocol header such as 802.3 and PPPoE after the potential IP fragmentation operation.
3472 *
3473 * The PASS support up to two message length patching operations per IP fragmentation command.
3474 */
3476 typedef struct {
3478 uint8_t msgLenSize; /**< Size of message length field in bytes (@note only 2-byte and 4=byte message length is supported) */
3479 uint8_t offset; /**< Offset from the start of the packet to the message length field */
3480 uint16_t msgLen; /**< Message length excluding the IP header and payload length */
3482 } paPatchMsgLenInfo_t;
3484 /**
3485 * @ingroup palld_api_structures
3486 * @brief User-defined Statistics Command
3487 *
3488 * @details paCmdUsrStats_t is used to specify the desired User-defined counter. The user stats command
3489 * instructs the PASS to update the specified user-defined counter and all the counters which are
3490 * linked to this counter
3491 * It is one of the command which can be embedded within the @ref paRouteInfo_t.
3492 */
3493 typedef struct {
3494 uint16_t index; /**< User-defined statistics index */
3495 } paCmdUsrStats_t;
3497 /**
3498 * @ingroup palld_api_structures
3499 * @brief Command Set plus User-defined Statistics Command
3500 *
3501 * @details paCmdSetUsrStats_t is used to specify the desired PA command set and User-defined counter. This command
3502 * provides the module user a mechanism to specify different user-defined counters with the same command set
3503 * for different LUT entries and vice versa.
3504 * This command instructs the PASS to update the specified user-defined counter and all the counters which are
3505 * linked to this counter and then execute the specified command set.
3506 * It is one of the command which can be embedded within the @ref paRouteInfo_t.
3507 */
3508 typedef struct {
3509 uint16_t setIndex; /**< Commad Set Index */
3510 uint16_t statsIndex; /**< User-defined statistics index */
3511 } paCmdSetUsrStats_t;
3514 /**
3515 * @defgroup pktErrInfo PA Packet Error Info Bit Definitions
3516 * @ingroup palld_api_constants
3517 * @{
3518 *
3519 * @name PA Packet Error Info Bit Definitions
3520 *
3521 * Bitmap definition of the errorBitfield in @ref paCmdVerifyPktErr_t.
3522 *
3523 */
3524 /*@{*/
3525 /**
3526 * @def pa_PKT_ERR_IP_CHECKSUM
3527 * Control Info -- Set: Re-direct packet if IP checksum error occurs
3528 * Clear: Ignore IP checksum Error
3529 */
3530 #define pa_PKT_ERR_IP_CHECKSUM 0x0001
3531 /**
3532 * @def pa_PKT_ERR_L4_CHECKSUM
3533 * Control Info -- Set: Re-direct packet if UDP/TCP checksum error occurs
3534 * Clear: Ignore UDP/TCP checksum Error
3535 */
3536 #define pa_PKT_ERR_L4_CHECKSUM 0x0002
3537 /**
3538 * @def pa_PKT_ERR_CRC
3539 * Control Info -- Set: Re-direct packet if CRC error occurs
3540 * Clear: Ignore CRC Error
3541 */
3542 #define pa_PKT_ERR_CRC 0x0004
3543 /*@}*/
3544 /** @} */
3546 /**
3547 * @ingroup palld_api_structures
3548 * @brief Verify Packet Error Command
3549 *
3550 * @details paCmdVerifyPktErr_t is used to construct the "Verify Packet Error" command. The
3551 * IPv4 header checksum, UDP/TCP checksum and SCTP CRC-32c checksum verification are performed by
3552 * the PASS autonomously while the CRC verification is performed per command. The corresponding error bit
3553 * in the CPPI descriptor will be set and can be verified by the application when packet is delivered
3554 * to the host. This command instructs PASS to examine the specified error flags and forward the error
3555 * packet accordingly.
3556 */
3558 typedef struct {
3560 uint16_t errorBitfield; /**< Packet Error information as defined at @ref pktErrInfo */
3561 uint8_t dest; /**< Packet destination as defined at @ref pktDest */
3562 uint8_t flowId; /**< For host destination, specifies CPPI flow which defines free queues are used for receiving packets */
3563 uint16_t queue; /**< For host destination, specifies the destination queue */
3564 uint32_t swInfo0; /**< Placed in SwInfo0 for packets to host */
3565 } paCmdVerifyPktErr_t;
3567 /**
3568 * @defgroup efOpCtrlInfo PA Egress Flow Command Control Info Bit Definitions
3569 * @ingroup palld_api_constants
3570 * @{
3571 *
3572 * @name PA Egress Flow Command Control Info Bit Definitions
3573 *
3574 * Bitmap definition of the ctrlBitField in @ref paCmdEfOp_t.
3575 */
3576 /*@{*/
3577 /**
3578 * @def pa_EF_OP_CMD_FC_LOOKUP
3579 * Control Info -- Set: Perform flow cache lookup to look for the associated packet modification records per match
3580 * Clear: Skip flow cache lookup and use the packet modification records specified in this command.
3581 */
3582 #define pa_EF_OP_CMD_FC_LOOKUP 0x0001
3583 /**
3584 * @def pa_EF_OP_CMD_VALID_LVL1
3585 * Control Info -- Egress Flow level 1 index is present
3586 */
3587 #define pa_EF_OP_CMD_VALID_LVL1 0x0010
3588 /**
3589 * @def pa_EF_OP_CMD_VALID_LVL2
3590 * Control Info -- Egress Flow level 2 index is present
3591 */
3592 #define pa_EF_OP_CMD_VALID_LVL2 0x0020
3593 /**
3594 * @def pa_EF_OP_CMD_VALID_LVL3
3595 * Control Info -- Egress Flow level 3 index is present
3596 */
3597 #define pa_EF_OP_CMD_VALID_LVL3 0x0040
3598 /**
3599 * @def pa_EF_OP_CMD_VALID_LVL4
3600 * Control Info -- Egress Flow level 4 index is present
3601 */
3602 #define pa_EF_OP_CMD_VALID_LVL4 0x0080
3603 /*@}*/
3604 /** @} */
3606 /**
3607 * @ingroup palld_api_structures
3608 * @brief Egress Flow Operation Command
3609 *
3610 * @details paCmdEfOp_t is used to create Egress Flow operation command which instructs
3611 * the PASS to perform optional flow cache lookup to find the associated
3612 * packet modification records or provides those records in the command. Then
3613 * PASS will execute the specified packet modification records in order to
3614 * perform one or multiple of the following actions:
3615 * - Update inner L3/L4 headers
3616 * - Insert or update outer L3 header
3617 * - Insert IPSEC header and trailer
3618 * - Perform inner and/or outer IP fragmentation
3619 * - Insert or update L2 header
3620 */
3622 typedef struct {
3624 uint16_t ctrlBitfield; /**< Egress Flow operation control information as defined at @ref efOpCtrlInfo */
3625 uint16_t l2Offset; /**< Offset to the layer 2 header from SOP */
3626 uint16_t l3Offset; /**< Offset to the outer IP from SOP */
3627 uint16_t l3Offset2; /**< Offset to the inner IP from SOP, which should be set to L3Offset if there is
3628 only one IP layer */
3629 uint16_t ipsecOffset; /**< Offset to the IPSEC ESP/AH header if the IPSEC header resides in the egress
3630 packets */
3631 uint16_t endOffset; /**< Offset to the end of L4 (UDP/UDPLite/TCP) payload */
3632 uint16_t lvl1Index; /**< Specify egress flow level 1 record index */
3633 uint16_t lvl2Index; /**< Specify egress flow level 2 record index */
3634 uint16_t lvl3Index; /**< Specify egress flow level 3 record index */
3635 uint16_t lvl4Index; /**< Specify egress flow level 4 record index */
3636 } paCmdEfOp_t;
3638 /**
3639 * @ingroup palld_api_structures
3640 * @brief PA Command Information structure
3641 *
3642 * @details Data structure defines PA commands. The PA command can be invoked by the @ref paRouteInfo_t as a simple command.
3643 * They are the building blocks for function @ref Pa_configCmdSet to create a list of commands refered as a command
3644 * set in the from-network direction. They can be used by the function @ref Pa_formatTxCmd to create or update the
3645 * list of tx commands.
3646 *
3647 */
3648 typedef struct {
3649 uint16_t cmd; /**< Specify the PA command code as defined at @ref paCmdCode */
3650 union {
3651 paCmdNextRoute_t route; /**< Specify nextRoute command specific parameters */
3652 paTxChksum_t chksum; /**< Specify Tx Checksum command specific parameters */
3653 paCmdCrcOp_t crcOp; /**< Specify CRC operation command specific parameters */
3654 paCmdCopy_t copy; /**< Specify Copy command specific parameters */
3655 paPatchInfo_t patch; /**< Specify Patch command specific parameters */
3656 paPayloadInfo_t payload; /**< Specify the payload information required by SA */
3657 paCmdSet_t cmdSet; /**< Specify Command Set command specific parameters */
3658 paCmdMultiRoute_t mRoute; /**< Specify Multi-route command specific parameters */
3659 paCmdTxTimestamp_t txTs; /**< Specify Report Tx Timestamp command specific parameters */
3660 paCmdIpFrag_t ipFrag; /**< Specify IP fragmentation command specific parameters */
3661 paCmdUsrStats_t usrStats; /**< Specify User-defined Statistics command specific parameters */
3662 paCmdSetUsrStats_t cmdSetUsrStats; /**< Specify Command Set and User-defined Statistics command specific parameters */
3663 paPatchMsgLenInfo_t patchMsgLen; /**< Specify Patch Message Length command specific parameters */
3664 paCmdVerifyPktErr_t verifyPktErr; /**< Specify Packet error Verification command specific parameters */
3665 paCmdSplitOp_t split; /**< Specify Split command sepcific parameters */
3666 paCmdEfOp_t efOp; /**< Specify Egress Flow operation command specific parameters (PASS Gen2 only) */
3667 }params; /**< Contain the command specific parameters */
3669 } paCmdInfo_t;
3671 /**
3672 * @ingroup palld_api_structures
3673 * @brief IP lookup information
3674 *
3675 * @details paIpInfo_t is used to specifiy the IPv4 or IPv6 parameters used in packet routing.
3676 * With the exception of parameter tos, a value of 0 in any parameter means that that
3677 * field is not used in packet routing. Since a value of 0 is valid for tos, the paramter
3678 * tosCare is used to indicate if the tos field (IPv4) or traffic class (Ipv6) is used
3679 * for packet routing.
3680 */
3681 typedef struct {
3683 paIpAddr_t src; /**< Source IP address */
3684 paIpAddr_t dst; /**< Destination IP address */
3685 uint32_t spi; /**< ESP or AH header Security Parameters Index */
3686 uint32_t flow; /**< IPv6 flow label in 20 lsbs */
3687 int ipType; /**< @ref IpValues */
3688 uint16_t greProto; /**< GRE protocol field */
3689 uint8_t proto; /**< IP Protocol (IPv4) / Next Header (IPv6) */
3690 uint8_t tos; /**< IP Type of Service (IPv4) / Traffic class (IPv6) */
3691 uint16_t tosCare; /**< TRUE if the tos value is used for matching */
3692 uint16_t sctpPort; /**< SCTP Destination Port */
3693 } paIpInfo_t;
3695 /**
3696 * @defgroup paIpInfoValidBits PA IP Info Valid Bit Definitions
3697 * @ingroup palld_api_constants
3698 * @{
3699 *
3700 * @name PA IP Info Valid Bit Definitions
3701 *
3702 * Bitmap definition of the validBitmap in @ref paIpInfo2_t.
3703 */
3704 /*@{*/
3705 /**
3706 * @def pa_IP_INFO_VALID_SRC
3707 * - Source IP address is present
3708 */
3709 #define pa_IP_INFO_VALID_SRC (1<<0)
3711 /**
3712 * @def pa_IP_INFO_VALID_DST
3713 * - Destination IP address is present
3714 */
3715 #define pa_IP_INFO_VALID_DST (1<<1)
3717 /**
3718 * @def pa_IP_INFO_VALID_SPI
3719 * - 32-bit Security Parameters Index of IPSEC ESP/AH is present
3720 */
3721 #define pa_IP_INFO_VALID_SPI (1<<2)
3723 /**
3724 * @def pa_IP_INFO_VALID_FLOW
3725 * - IPv6 flow label is present
3726 */
3727 #define pa_IP_INFO_VALID_FLOW (1<<3)
3729 /**
3730 * @def pa_IP_INFO_VALID_GREPROTO
3731 * - GRE protocol field is present
3732 */
3733 #define pa_IP_INFO_VALID_GREPROTO (1<<4)
3735 /**
3736 * @def pa_IP_INFO_VALID_PROTO
3737 * - IPv4 protocol or IPv6 next header is present
3738 */
3739 #define pa_IP_INFO_VALID_PROTO (1<<5)
3741 /**
3742 * @def pa_IP_INFO_VALID_TOS
3743 * - IPv4 type of service or IPv6 traffic class is present
3744 */
3745 #define pa_IP_INFO_VALID_TOS (1<<6)
3747 /**
3748 * @def pa_IP_INFO_VALID_SCTPPORT
3749 * - SCTP destination port is present
3750 */
3752 #define pa_IP_INFO_VALID_SCTPPORT (1<<7)
3754 /* @} */ /* ingroup */
3755 /** @} */
3757 /**
3758 * @ingroup palld_api_structures
3759 * @brief Enhanced IP lookup information
3760 *
3761 * @details paIpInfo2_t is the upgraded version of paIpInfo_t to support additional IP lookup
3762 * parameters over time while still maintaining backward compatibility. Future feature
3763 * enhancements will be supported through this API data structure only.
3764 *
3765 * Since not all fields are used all the time, validBitmap is used to specify which field
3766 * is used for packet classification.
3767 */
3768 typedef struct {
3769 uint32_t validBitMap;/**< 32-bit valid Bitmap corresponding to each optional field as defined at @ref paIpInfoValidBits */
3770 paIpAddr_t src; /**< Source IP address */
3771 paIpAddr_t dst; /**< Destination IP address */
3772 uint32_t spi; /**< ESP or AH header Security Parameters Index */
3773 uint32_t flow; /**< IPv6 flow label in 20 lsbs */
3774 int ipType; /**< Mandatory if src or dst is valid @ref IpValues */
3775 uint16_t greProto; /**< GRE protocol field */
3776 uint8_t proto; /**< IP Protocol (IPv4) / Next Header (IPv6) */
3777 uint8_t tos; /**< IP Type of Service (IPv4) / Traffic class (IPv6) */
3778 uint16_t sctpPort; /**< SCTP Destination Port */
3779 } paIpInfo2_t;
3781 /**
3782 * @ingroup palld_api_structures
3783 * @brief MAC/Ethernet lookup information
3784 *
3785 * @details paEthInfo_t is used to specify the MAC/Ethernet parameters used in packet classification.
3786 * A value in 0 for any of the fields indicates that the field is not used for
3787 * packet classification.
3788 */
3789 typedef struct {
3790 paMacAddr_t src; /**< Source MAC addresss */
3791 paMacAddr_t dst; /**< Destination MAC address */
3792 uint16_t vlan; /**< VLAN tag VID field, 12 lsbs */
3793 uint16_t ethertype; /**< Ethertype field. */
3794 uint32_t mplsTag; /**< MPLS tag. Only the outer tag is examined */
3795 uint16_t inport; /**< Input EMAC port number as specified by @ref paEmacPort */
3796 } paEthInfo_t;
3798 /**
3799 * @defgroup paEthInfoValidBits PA ETH Info Valid Bit Definitions
3800 * @ingroup palld_api_constants
3801 * @{
3802 *
3803 * @name PA ETH Info Valid Bit Definitions
3804 *
3805 * Bitmap definition of the validBitmap in @ref paEthInfo2_t.
3806 */
3807 /*@{*/
3809 /**
3810 * @def pa_ETH_INFO_VALID_SRC
3811 * - Source MAC is present
3812 */
3813 #define pa_ETH_INFO_VALID_SRC (1<<0)
3815 /**
3816 * @def pa_ETH_INFO_VALID_DST
3817 * - Destination MAC is present
3818 */
3819 #define pa_ETH_INFO_VALID_DST (1<<1)
3821 /**
3822 * @def pa_ETH_INFO_VALID_VLAN
3823 * - VLAN ID is present
3824 */
3825 #define pa_ETH_INFO_VALID_VLAN (1<<2)
3827 /**
3828 * @def pa_ETH_INFO_VALID_ETHERTYPE
3829 * - Ether type is present
3830 */
3831 #define pa_ETH_INFO_VALID_ETHERTYPE (1<<3)
3833 /**
3834 * @def pa_ETH_INFO_VALID_MPLSTAG
3835 * - MPLS tag is present
3836 */
3837 #define pa_ETH_INFO_VALID_MPLSTAG (1<<4)
3839 /**
3840 * @def pa_ETH_INFO_VALID_INPORT
3841 * - Input EMAC port is present
3842 */
3843 #define pa_ETH_INFO_VALID_INPORT (1<<5)
3845 /* @} */ /* ingroup */
3846 /** @} */
3848 /**
3849 * @ingroup palld_api_structures
3850 * @brief Enhanced MAC/Ethernet lookup information
3851 *
3852 * @details paEthInfo2_t is the upgraded version of paEthInfo_t to support additional MAC lookup
3853 * parameters over time while still maintaining backward compatibility. Future feature
3854 * enhancements will be supported through this API data structure only.
3855 *
3856 * Since not all fields are used all the time, validBitmap is used to specify which field
3857 * is used for packet classification.
3858 *
3859 */
3860 typedef struct {
3861 uint32_t validBitMap; /**< 32-bit valid Bitmap corresponding to each optional field as defined at @ref paEthInfoValidBits */
3862 paMacAddr_t src; /**< Source MAC addresss */
3863 paMacAddr_t dst; /**< Destination MAC address */
3864 uint16_t vlan; /**< VLAN tag VID field, 12 lsbs */
3865 uint16_t ethertype; /**< Ethertype field. */
3866 uint32_t mplsTag; /**< MPLS tag. Only the outer tag is examined */
3867 uint16_t inport; /**< Input EMAC port number as specified by @ref paEmacPort */
3868 } paEthInfo2_t;
3870 /**
3871 * @defgroup paAclInfoValidBit PA ACL Matching Info Valid Bit Definitions
3872 * @ingroup palld_api_constants
3873 * @{
3874 *
3875 * @name PA ACL Matching Info Valid Bit Definitions
3876 * Bitmap definition of the validBitfield in paAclInfo_t.
3877 * It allows selective ACL matching parameters
3878 */
3879 /*@{*/
3880 /**
3881 * @def pa_ACL_INFO_VALID_SRC_IP
3882 * srcIp is present
3883 */
3884 #define pa_ACL_INFO_VALID_SRC_IP 0x0001
3885 /**
3886 * @def pa_ACL_INFO_VALID_SRC_IP_MASK
3887 * srcIpMask is present. This flag is valid only if srcIp is present.
3888 * If srcIp is present and this flag is clear, it means all IP address bits are valid.
3889 */
3890 #define pa_ACL_INFO_VALID_SRC_IP_MASK 0x0002
3891 /**
3892 * @def pa_ACL_INFO_VALID_DST_IP
3893 * dstIp is present
3894 */
3895 #define pa_ACL_INFO_VALID_DST_IP 0x0004
3896 /**
3897 * @def pa_ACL_INFO_VALID_DST_IP_MASK
3898 * dstIpMask is present. This flag is valid only if dstIp is present.
3899 * If dstIp is present and this flag is clear, it means all IP address bits are valid.
3900 */
3901 #define pa_ACL_INFO_VALID_DST_IP_MASK 0x0008
3902 /**
3903 * @def pa_ACL_INFO_VALID_CTRL_FLAG
3904 * ctrlFlag and ctrlFlagMask are present
3905 */
3906 #define pa_ACL_INFO_VALID_CTRL_FLAG 0x0010
3907 /**
3908 * @def pa_ACL_INFO_VALID_PROTO
3909 * proto is present
3910 */
3911 #define pa_ACL_INFO_VALID_PROTO 0x0020
3912 /**
3913 * @def pa_ACL_INFO_VALID_DSCP
3914 * dscp is present
3915 */
3916 #define pa_ACL_INFO_VALID_DSCP 0x0040
3917 /**
3918 * @def pa_ACL_INFO_VALID_SRC_PORT
3919 * srcPortBegin and srcPortEnd are present */
3920 #define pa_ACL_INFO_VALID_SRC_PORT 0x0100
3921 /**
3922 * @def pa_ACL_INFO_VALID_DST_PORT
3923 * dstPortBegin and dstPortEnd are present */
3924 #define pa_ACL_INFO_VALID_DST_PORT 0x0200
3926 /*@}*/
3927 /** @} */
3929 /**
3930 * @defgroup paAclInfoCtrlFlags PA ACL Info Control Flag Definitions
3931 * @ingroup palld_api_constants
3932 * @{
3933 *
3934 * @name PA ACL Info Control Flag Definitions
3935 * Bitmap definition of the ctrlFlags and ctrlFlagsMask in paAclnfo_t.
3936 */
3937 /*@{*/
3938 /**
3939 * @def pa_ACL_INFO_CONTROL_FLAG_FRAG
3940 * Flag -- 1: IP fragments
3941 */
3942 #define pa_ACL_INFO_CONTROL_FLAG_FRAG 0x0001
3943 /**
3944 * @def pa_ACL_INFO_CONTROL_FLAG_CONTAIN_L4
3945 * Flag -- 1: Packet or fragment which conatins L4 header
3946 */
3947 #define pa_ACL_INFO_CONTROL_FLAG_CONTAIN_L4 0x0002
3948 /*@}*/
3949 /** @} */
3951 /**
3952 * @ingroup palld_api_structures
3953 * @brief ACL lookup information
3954 *
3955 * @details paAclInfo_t is used to specifiy the ACL matching parameters.
3956 */
3957 typedef struct {
3958 uint16_t validBitMap; /**< Specify valid parameters as defined at @ref paAclInfoValidBit */
3959 uint16_t ctrlFlag; /**< Specify ACL contrl flags as defined at @ref paAclInfoCtrlFlags */
3960 uint16_t ctrlFlagMask; /**< ACL control flag valid masks */
3961 uint16_t ipType; /**< @ref IpValues */
3962 paIpAddr_t srcIp; /**< Source IP address */
3963 paIpAddr_t srcIpMask; /**< Source IP subnet mask*/
3964 paIpAddr_t dstIp; /**< Destination IP address */
3965 paIpAddr_t dstIpMask; /**< Destination IP subnet mask */
3966 uint8_t proto; /**< IP Protocol (IPv4) / Next Header (IPv6) */
3967 uint8_t dscp; /**< DSCP value */
3968 uint16_t srcPortBegin; /**< Minimum Source Port Number */
3969 uint16_t srcPortEnd; /**< Maximum Source Port Number */
3970 uint16_t dstPortBegin; /**< Minimum Destinatio Port Number */
3971 uint16_t dstPortEnd; /**< Maximum Destinatio Port Number */
3972 } paAclInfo_t;
3974 /**
3975 * @ingroup palld_api_structures
3976 * @brief SRIO Type11 header information
3977 *
3978 * @details The structure describes the SRIO type 11 specific Lo-L2 header information.
3979 */
3980 typedef struct paSrioType11Info_s
3981 {
3982 uint16_t mbox; /**< Mail Box */
3983 uint16_t letter; /**< Letter Identifier */
3984 } paSrioType11Info_t;
3986 /**
3987 * @ingroup palld_api_structures
3988 * @brief SRIO Type9 header information
3989 *
3990 * @details The structure describes the SRIO type 9 specific L0-L2 header information.
3991 */
3992 typedef struct paSrioType9Info_s
3993 {
3994 uint16_t streamId; /**< Stream identifier */
3995 uint16_t cos; /**< Class of service */
3996 } paSrioType9Info_t;
3999 /**
4000 * @ingroup palld_api_structures
4001 * @brief Srio message type specific header information
4002 *
4003 * @details This union is used to specify the SRIO type specific header information to the module.
4004 * The type in the union is determined through other parameters passed to the module
4005 * (see @ref srioMessageTypes).
4006 */
4007 typedef union {
4009 paSrioType9Info_t type9; /**< SRIO type 9 specific information */
4010 paSrioType11Info_t type11; /**< SRIO type 11 specific information */
4012 } paSrioTypeInfo_t;
4014 /**
4015 * @defgroup srioMessageTypes SRIO Message types
4016 * @ingroup palld_api_constants
4017 * @{
4018 *
4019 * @name SRIO Type Values
4020 * @brief Defines the SRIO message types.
4021 *
4022 * @details The packet accelerator sub-system parses both SRIO Type 9 and Type 11 message headers (see @ref netlayers).
4023 * This group is used to distinguish which type of header will be used.
4024 */
4025 /* @{ */
4026 /**
4027 * @def pa_SRIO_TYPE_9
4028 * SRIO Message Type 9
4029 */
4030 #define pa_SRIO_TYPE_9 9
4032 /**
4033 * @def pa_SRIO_TYPE_11
4034 * SRIO Message Type 11
4035 */
4036 #define pa_SRIO_TYPE_11 11
4038 /* @} */
4039 /** @} */
4041 /**
4042 * @defgroup srioTransportTypes SRIO Transport types
4043 * @ingroup palld_api_constants
4044 * @{
4045 *
4046 * @name SRIO Transport Type Values
4047 * @brief Defines the SRIO tansport types used.
4048 *
4049 */
4050 /* @{ */
4051 /**
4052 * @def pa_SRIO_TRANSPORT_TYPE_0
4053 * SRIO Transport type 0: 8 bit device identifiers
4054 */
4055 #define pa_SRIO_TRANSPORT_TYPE_0 0
4057 /**
4058 * @def pa_SRIO_TRANSPORT_TYPE_1
4059 * SRIO Transport type 1: 16 bit device identifiers
4060 */
4061 #define pa_SRIO_TRANSPORT_TYPE_1 1
4063 /* @} */
4064 /** @} */
4066 /**
4067 * @defgroup paSrioInfoValidBits PA SRIO Info Valid Bit Definitions
4068 * @ingroup palld_api_constants
4069 * @{
4070 *
4071 * @name PA SRIO Info Valid Bit Definitions
4072 *
4073 * Bitmap definition of the validBitMap in @ref paSrioInfo_t.
4074 */
4075 /*@{*/
4076 /**
4077 * @def pa_SRIO_INFO_VALID_SRC_ID
4078 * - srcId is present
4079 */
4080 #define pa_SRIO_INFO_VALID_SRC_ID 0x0001
4081 /**
4082 * @def pa_SRIO_INFO_VALID_DEST_ID
4083 * - destId is present
4084 */
4085 #define pa_SRIO_INFO_VALID_DEST_ID 0x0002
4086 /**
4087 * @def pa_SRIO_INFO_VALID_ID
4088 * - Id is present
4089 */
4090 #define pa_SRIO_INFO_VALID_ID (pa_SRIO_INFO_VALID_SRC_ID | pa_SRIO_INFO_VALID_DEST_ID)
4092 /**
4093 * @def pa_SRIO_INFO_VALID_CC
4094 * - cc is present
4095 */
4096 #define pa_SRIO_INFO_VALID_CC 0x0004
4097 /**
4098 * @def pa_SRIO_INFO_VALID_PRI
4099 * - pri is present
4100 */
4101 #define pa_SRIO_INFO_VALID_PRI 0x0008
4102 /**
4103 * @def pa_SRIO_INFO_VALID_TYPE_INFO_STREAMID
4104 * - typeInfo.type9.streamId is present
4105 */
4106 #define pa_SRIO_INFO_VALID_TYPE_INFO_STREAMID 0x0010
4107 /**
4108 * @def pa_SRIO_INFO_VALID_TYPE_INFO_COS
4109 * - typeInfo.type9.cos is present
4110 */
4111 #define pa_SRIO_INFO_VALID_TYPE_INFO_COS 0x0020
4112 /**
4113 * @def pa_SRIO_INFO_VALID_TYPE_INFO_MAILBOX
4114 * - typeInfo.type11.mbox is present
4115 */
4116 #define pa_SRIO_INFO_VALID_TYPE_INFO_MAILBOX 0x0010
4117 /**
4118 * @def pa_SRIO_INFO_VALID_TYPE_INFO_LETTER
4119 * - typeInfo.type11.letter is present
4120 */
4121 #define pa_SRIO_INFO_VALID_TYPE_INFO_LETTER 0x0020
4122 /**
4123 * @def pa_SRIO_INFO_VALID_TYPE_INFO
4124 * - typeInfo is present
4125 */
4126 #define pa_SRIO_INFO_VALID_TYPE_INFO (pa_SRIO_INFO_VALID_TYPE_INFO_COS | \
4127 pa_SRIO_INFO_VALID_TYPE_INFO_STREAMID | \
4128 pa_SRIO_INFO_VALID_TYPE_INFO_LETTER | \
4129 pa_SRIO_INFO_VALID_TYPE_INFO_MAILBOX )
4130 /* @} */ /* ingroup */
4131 /** @} */
4133 /**
4134 * @ingroup palld_api_structures
4135 * @brief SRIO lookup information
4136 *
4137 * @details srioIpInfo_t is used to specifiy the SRIO type 9 and type 11 L0-L2 parameters used in packet routing.
4138 * set the corresponding valid bit at validBitmap for the parameters required for SRIO message
4139 * classification.
4140 * Where tt should be provided if srcId or destId is required
4141 * msgType should be provided if typeInfo is required
4142 */
4143 typedef struct {
4145 uint16_t validBitMap; /**< Specify which parameters are valid as defined at @ref paSrioInfoValidBits */
4146 uint16_t srcId; /**< Source ID */
4147 uint16_t destId; /**< Destination ID */
4148 uint16_t tt; /**< Transport Type: 16 bit or 8 bit identifiers as defined at @ref srioTransportTypes */
4149 uint16_t cc; /**< Completion code */
4150 uint16_t pri; /**< 3-bit priority */
4151 uint16_t msgType; /**< Message type as defined at @ref srioMessageTypes */
4152 paSrioTypeInfo_t typeInfo; /**< Message Type specific parameters */
4153 } paSrioInfo_t;
4156 /**
4157 * @ingroup palld_api_structures
4158 * @brief Packet routing configuration
4159 *
4160 * @details paRouteInfo_t is used to specify the physical routing of packets out of the packet accelerator
4161 * sub-system. Not all fields are required for all destinations.
4162 * @li pa_DEST_DISCARD: none
4163 * @li pa_DEST_CONTINUE_PARSE_LUT1:
4164 * @li pa_DEST_CONTINUE_PARSE_LUT2: customType, customIndex
4165 * @li pa_DEST_HOST: flowId, queue, mRoutehandle, swInfo0, cmd
4166 * @li pa_DEST_SASS: flowId, queue, swInfo0, swInfo1, cmd
4167 * @li pa_DEST_ETH: emacCtrl
4168 * @li pa_DEST_SRIO: flowId, queue, swInfo0, swInfo2, pktType
4169 */
4170 typedef struct {
4172 int dest; /**< Packet destination as defined at @ref pktDest */
4173 uint8_t flowId; /**< For host, SA or SRIO destinations, specifies CPPI flow which defines free queues are used for receiving packets */
4174 uint16_t queue; /**< For host, SA or SRIO destinations, specifies the destination queue */
4175 int mRouteIndex; /**< For host, Multi-queue routing index (0 to (@ref pa_MAX_MULTI_ROUTE_SETS - 1))
4176 or @ref pa_NO_MULTI_ROUTE if multi routing not used */
4177 uint32_t swInfo0; /**< Placed in SwInfo0 for packets to host or SA; Placed in the PS Info for packets to SRIO */
4178 uint32_t swInfo1; /**< Placed in SwInfo1 for packets to the SA; Placed in the PS Info for packets to SRIO */
4179 int customType; /**< For CONTINUE_PARSE_LUT1/LUT2 only, specifies the custom type as defined at @ref customType */
4180 uint8_t customIndex; /**< For CONTINUE_PARSE_LUT1/LUT2 only, specifies the custom classification entry index */
4181 uint8_t pktType_emacCtrl; /**< For destination SRIO, specify the 5-bit packet type toward SRIO
4182 For destination HOST, EMAC, specify the EMAC control @ref emcOutputCtrlBits to the network */
4183 paCmdInfo_t *pCmd; /**< Pointer to the Command info to be executed prior to the packet forwarding.
4184 NULL: no commads
4185 @note only the following commands are supported within paRouteInfo_t
4186 - pa_CMD_PATCH_DATA (up to two bytes only) (LUT2 only)
4187 - pa_CMD_CMDSET
4188 - pa_CMD_USR_STATS
4189 - pa_CMD_CMDSET_AND_USR_STATS
4190 */
4191 } paRouteInfo_t;
4193 /**
4194 * @def pa_NO_MULTI_ROUTE
4195 * Multi Route not enabled in this route
4196 */
4197 #define pa_NO_MULTI_ROUTE -1
4199 /**
4200 * @def pa_MAX_MULTI_ROUTE_SETS
4201 * The maximum number of multi-route sets supported
4202 */
4203 #define pa_MAX_MULTI_ROUTE_SETS 32
4205 /**
4206 * @def pa_MAX_MULTI_ROUTE_ENTRIES
4207 * The maximum number of multi-route entries per muli-route set
4208 */
4209 #define pa_MAX_MULTI_ROUTE_ENTRIES 8
4211 /**
4212 * @defgroup paEfOpInfoCtrlFlags PA Egress Flow Operation Info Control Flag Definitions
4213 * @ingroup palld_api_constants
4214 * @{
4215 *
4216 * @name PA Egress Flow Operation Info Control Flag Definitions
4217 * Bitmap definition of the ctrlFlags in @ref paEfOpInfo_t.
4218 */
4219 /*@{*/
4220 /**
4221 * @def pa_EF_OP_CONTROL_FLAG_FC_LOOKUP
4222 * Flag -- 1: Perform Flow Cache lookup
4223 * 0: Do not perform Flow Cache lookup, use the Eflow records specified within @ref paEfOpInfo_t
4224 */
4225 #define pa_EF_OP_CONTROL_FLAG_FC_LOOKUP 0x0001
4226 /*@}*/
4227 /** @} */
4229 /**
4230 * @defgroup paEfOpInfoValidBit PA Egress Flow Operation Info Valid Bit Definitions
4231 * @ingroup palld_api_constants
4232 * @{
4233 *
4234 * @name PA Egress Flow Operation Info Valid Bit Definitions
4235 * Bitmap definition of the validBitfield in @ref paEfOpInfo_t.
4236 * It allows selective Egress Flow opertaion parameters
4237 */
4238 /*@{*/
4239 /**
4240 * @def pa_EF_OP_INFO_VALID_LVL1
4241 * Egress Flow level 1 index is present
4242 */
4243 #define pa_EF_OP_INFO_VALID_LVL1 0x0001
4244 /**
4245 * @def pa_EF_OP_INFO_VALID_LVL2
4246 * Egress Flow level 2 index is present
4247 */
4248 #define pa_EF_OP_INFO_VALID_LVL2 0x0002
4249 /**
4250 * @def pa_EF_OP_INFO_VALID_LVL3
4251 * Egress Flow level 3 index is present
4252 */
4253 #define pa_EF_OP_INFO_VALID_LVL3 0x0004
4254 /**
4255 * @def pa_EF_OP_INFO_VALID_LVL4
4256 * Egress Flow level 4 index is present
4257 */
4258 #define pa_EF_OP_INFO_VALID_LVL4 0x0008
4260 /*@}*/
4261 /** @} */
4263 /**
4264 * @ingroup palld_api_structures
4265 * @brief Egress Flow operation information
4266 *
4267 * @details paEfOpInfo_t is used to specifiy the Egress Flow operation parameters.
4268 * It is used by @ref paRouteInfo2_t in the ingress path for IP forwarding
4269 * operation and API @ref Pa_addFc for Flow Cache operation.
4270 * Refer to @ref appendix4 for deatiled information
4271 */
4272 typedef struct {
4273 uint16_t ctrlFlags; /**< Specify Egress flow control flags as defined at @ref paEfOpInfoCtrlFlags */
4274 uint16_t validBitMap; /**< Specify valid parameters as defined at @ref paEfOpInfoValidBit */
4275 uint16_t lvl1Index; /**< Specify egress flow level 1 record index */
4276 uint16_t lvl2Index; /**< Specify egress flow level 2 record index */
4277 uint16_t lvl3Index; /**< Specify egress flow level 3 record index */
4278 uint16_t lvl4Index; /**< Specify egress flow level 4 record index */
4279 } paEfOpInfo_t;
4282 /**
4283 @defgroup paPriIntfRouteMode Priority-based or Interface-based routing mode
4284 * @ingroup palld_api_constants
4285 * @{
4286 *
4287 * @name Priority-based or Interface-based routing mode
4288 *
4289 * paRoutePriIntf_e is used to specify the mode of priority-based
4290 * or interface-based routing.
4291 * PASS forwards the matched packets to the desired QoS queue which is equal
4292 * to the base queue plus an offset specified by the VLAN priority or DSCP value
4293 * in prority-based routing such as pa_ROUTE_PRIORITY_VLAN or pa_ROUTE_PRIORITY_DSCP.
4294 * PASS forwards the matched packets to the desired host queue which is equal
4295 * to the base queue plus an offset as the EMAC port (interface) number with the CPPI
4296 * flow which is equal to the base flow number plus the EMAC port (interface) number
4297 * optionally in interface-based routing such as pa_ROUTE_INTF or pa_ROUTE_INTF_W_FLOW.
4298 * PASS forwards the matched packets to the derived QoS queue with derived CPPI flow
4299 * based on the algorithm specified at @ref appendix6 in EQoS routing
4300 *
4301 * @note: There is some use cases where output packets from QoS are delivered to
4302 * PASS for pre-routing operation such as tx timestamp report and both
4303 * egress and ingress forwarding packets go through the same QoS. To support
4304 * this use case, the PASS is enhanced to delay the post-classification command
4305 * set execution until the packets re-entering PASS from QoS if Priority-based
4306 * routing is selected.
4307 */
4308 /** @ingroup paPriIntfRouteMode */
4309 /*@{*/
4310 typedef enum {
4311 pa_ROUTE_PRIORITY_VLAN = 1, /**< Route by using VLAN P bits as priority */
4312 pa_ROUTE_PRIORITY_DSCP, /**< Route by using DSCP bits as priority */
4313 pa_ROUTE_INTF, /**< Route by using EMAC port (interface) number as destination queue offset */
4314 pa_ROUTE_INTF_W_FLOW, /**< Route by using EMAC port (interface) number as both
4315 destination queue and CPPI flow offset */
4316 pa_ROUTE_EQoS_MODE /**< Route by using priority map for enhanced QoS to support L2 Shapper */
4317 } paRoutePriIntf_e;
4319 /*@}*/
4320 /** @} */
4322 /**
4323 * @defgroup paRouteInfoValidBits PA Route Info Valid Bit Definitions
4324 * @ingroup palld_api_constants
4325 * @{
4326 *
4327 * @name PA Route Info Valid Bit Definitions
4328 *
4329 * Bitmap definition of the validBitMap in @ref paRouteInfo2_t.
4330 */
4331 /*@{*/
4333 /**
4334 * @def pa_ROUTE_INFO_VALID_MROUTEINDEX
4335 * - Optional parameter mRouteIndex for Host routing is valid
4336 */
4337 #define pa_ROUTE_INFO_VALID_MROUTEINDEX (1<<0)
4339 /**
4340 * @def pa_ROUTE_INFO_VALID_PKTTYPE_EMAC
4341 * - Optional parameter pktType_emacCtrl for Host or EMAC routing is valid
4342 */
4343 #define pa_ROUTE_INFO_VALID_PKTTYPE_EMAC (1<<1)
4345 /**
4346 * @def pa_ROUTE_INFO_VALID_PCMD
4347 * - Optional parameter pCmd is valid
4348 */
4349 #define pa_ROUTE_INFO_VALID_PCMD (1<<2)
4351 /**
4352 * @def pa_ROUTE_INFO_VALID_PRIORITY_TYPE
4353 * - Optional parameter priorityType used for Priority-based or interface-based routing is valid
4354 */
4355 #define pa_ROUTE_INFO_VALID_PRIORITY_TYPE (1<<3)
4357 /* @} */ /* ingroup */
4358 /** @} */
4360 /**
4361 * @ingroup palld_api_structures
4362 * @brief Enhanced Packet routing configuration
4363 *
4364 * @details paRouteInfo2_t is the upgraded version of paRouteInfo_t to support additional routing
4365 * parameters over time while still maintaining backward compatibility. Future feature
4366 * enhancements will be supported through this API data structure only.
4367 *
4368 * The validBitMap is used to specify which field is used for packet routing.
4369 */
4370 typedef struct {
4371 uint32_t validBitMap; /**< 32-bit valid bitmap corresponding to each optional field as defined at @ref paRouteInfoValidBits */
4372 int dest; /**< Packet destination as defined at @ref pktDest */
4373 uint8_t flowId; /**< For host, SA or SRIO destinations, specifies CPPI flow which defines free queues are used for receiving packets */
4374 uint16_t queue; /**< For host, SA or SRIO destinations, specifies the destination queue */
4375 int mRouteIndex; /**< validBitMap[t0] For host, Multi-queue routing index (0 to (@ref pa_MAX_MULTI_ROUTE_SETS - 1) */
4376 uint32_t swInfo0; /**< For host, SA or SRIO destinations, placed in SwInfo0 for packets to host or SA; Placed in the PS Info for packets to SRIO */
4377 uint32_t swInfo1; /**< For host, SA or SRIO destinations, placed in SwInfo1 for packets to the SA; Placed in the PS Info for packets to SRIO */
4378 int customType; /**< For CONTINUE_PARSE_LUT1/LUT2 only, specifies the custom type as defined at @ref customType */
4379 uint8_t customIndex; /**< For CONTINUE_PARSE_LUT1/LUT2 only, specifies the custom classification entry index */
4380 uint8_t pktType_emacCtrl; /**< validBitMap[t1] For destination SRIO, specify the 5-bit packet type toward SRIO
4381 For destination HOST, EMAC, specify the EMAC control @ref emcOutputCtrlBits to the network */
4382 paCmdInfo_t *pCmd; /**< validBitMap[t2] Pointer to the Command info to be executed prior to the packet forwarding.
4383 NULL: no commads
4384 @note only the following commands are supported within paRouteInfo_t and paRouteInfo2_t
4385 for ingress packets
4386 - pa_CMD_PATCH_DATA (up to two bytes only) (LUT2 only)
4387 - pa_CMD_CMDSET
4388 - pa_CMD_USR_STATS
4389 - pa_CMD_CMDSET_AND_USR_STATS
4390 @note the post-classification commands specified by the command set will be executed when the packets re-entering PASS
4391 from the QoS queue if priority-based routing is selected
4392 */
4393 uint8_t priorityType; /**< validBitMap[t3]: For Host only, specify priority-based and/or interfcae-based routing mode as
4394 * defined at @ref paRoutePriIntf_e
4395 */
4396 paEfOpInfo_t *efOpInfo; /**< For EFLOW only, egress flow operation info (PASS Gen2 only) */
4397 } paRouteInfo2_t;
4399 /**
4400 * @defgroup paPktCloneCtrlBits PA Packet Capture/Port Mirror Control Bit Definitions
4401 * @ingroup palld_api_constants
4402 * @{
4403 *
4404 * @name PA Packet Capture/Port Mirror Control Bit Definitions
4405 *
4406 * @brief Bitmap definition of the ctrlBitMap in @ref paPortMirrorConfig_t and @ref paPktCaptureConfig_t.
4407 *
4408 */
4409 /* @{ */
4410 /**
4411 * @def pa_PKT_CLONE_ENABLE
4412 * port mirror/packet capture control
4413 * please refer to @ref appendix5 for details about this mode.
4414 */
4415 #define pa_PKT_CLONE_ENABLE 1
4417 /**
4418 * @def pa_PKT_CLONE_INGRESS
4419 * direction configuration
4420 * Set: Ingress direction
4421 * Clear: Egress direction
4422 */
4423 #define pa_PKT_CLONE_INGRESS 2
4425 /* @} */
4426 /** @} */
4429 /**
4430 * @ingroup palld_api_structures
4431 * @brief PA Interface based Port Mirror Configuration Information.
4432 *
4433 * @details paPortMirrorConfig_t is used to specify the port mirror configuration parameters of the PASS.
4434 *
4435 * For the Ingress configuration:
4436 * All the ingress MAC packets entering PDSP0 (Ingress0) will be duplicated and forwarded to the
4437 * specified EMAC port to simulate Ethernet SW port mirroring operation prior to the classification
4438 * (lookup) operation based on the IF based configuration.
4439 *
4440 * For the Egress configuration:
4441 * All the egress packets directed to EMAC port will be duplicated and forwarded
4442 * to specified mirror port to simulate Ethernet SW port mirroring operation
4443 * as part of the nextRoute command processing based on the IF based configuration.
4444 */
4445 typedef struct {
4446 uint32_t ctrlBitMap; /**< Specifies various port mirror control bits as defined in @ref paPktCloneCtrlBits */
4447 uint8_t portToBeMirrored; /**< Specifies port to be mirrored */
4448 uint8_t mirrorPort; /**< The mirror port */
4449 } paPortMirrorConfig_t;
4451 /**
4452 * @ingroup palld_api_structures
4453 * @brief PA Interface based Packet Capture Configuration Information.
4454 *
4455 * @details paPktCaptureConfig_t is used to specify the packet capture configuration parameters of the PASS.
4456 *
4457 * For the Ingress configuration:
4458 * All the ingress MAC packets entering PDSP0 (Ingress0) will be duplicated and forwarded to the
4459 * specified host queue for packet capturing prior to the classification (lookup)
4460 * operation based on the IF based configuration.
4461 *
4462 * For the Egress configuration:
4463 * All the egress packets directed to EMAC port will be duplicated and forwarded
4464 * to the pecified host queue for packet capturing as part of the nextRoute
4465 * command processing based on the IF based configuration.
4466 */
4467 typedef struct {
4468 uint32_t ctrlBitMap; /**< Specifies various packet capture control bits as defined in @ref paPktCloneCtrlBits */
4469 uint8_t portToBeCaptured; /**< Specifies port to be captured */
4470 uint32_t swInfo0; /**< Placed in SwInfo0 for packets to host */
4471 uint8_t flowId; /**< Specifies CPPI flow which defines free queues to be used for receiving packets */
4472 uint16_t queue; /**< Specifies the destination host queue */
4473 } paPktCaptureConfig_t;
4475 /**
4476 * @defgroup paDrouteTypes PA Default Route Types
4477 * @ingroup palld_api_constants
4478 * @{
4479 *
4480 * @name PA Default Route Types
4481 *
4482 * @brief These values are used to define interface-based ingress default route types.
4483 *
4484 * @details The interface-based ingress default route defines the global routing information for the
4485 * packet types such as multicast packet, broadcast packet and non-matched unicast packet.
4486 */
4487 /* @{ */
4488 /**
4489 *
4490 * @def pa_DROUTE_MULTICAST
4491 * Multicast packet default route index
4492 */
4493 #define pa_DROUTE_MULTICAST 0
4495 /**
4496 *
4497 * @def pa_DROUTE_BROADCAST
4498 * Broadcast packet default route index
4499 */
4500 #define pa_DROUTE_BROADCAST 1
4502 /**
4503 *
4504 * @def pa_DROUTE_NO_MATCH
4505 * Non-matched unicast packet default route index
4506 */
4507 #define pa_DROUTE_NO_MATCH 2
4510 /**
4511 * @def pa_DROUTE_MAX
4512 * The maximum number of global default route types
4513 */
4514 #define pa_DROUTE_MAX 3
4516 /* @} */
4517 /** @} */
4519 /**
4520 * @defgroup paDefRouteCtrlBits PA Interface-based Ingress Packet Default Route Control Bit Definitions
4521 * @ingroup palld_api_constants
4522 * @{
4523 *
4524 * @name PA Interface based Ingress Packet Default Route Control Bit Definitions
4525 *
4526 * Bitmap definition of the ctrlBitMap in @ref paDefRouteConfig_t
4527 *
4528 */
4529 /*@{*/
4530 /**
4531 * @def pa_EMAC_IF_DEFAULT_ROUTE_MC_ENABLE
4532 * Control Info -- Set: Multicast default route enable
4533 * Clear: Multicast default route disable
4534 */
4535 #define pa_EMAC_IF_DEFAULT_ROUTE_MC_ENABLE 0x0001
4537 /**
4538 * @def pa_EMAC_IF_DEFAULT_ROUTE_BC_ENABLE
4539 * Control Info -- Set: Broadcast default route enable
4540 * Clear: Broadcast default route disable
4541 */
4542 #define pa_EMAC_IF_DEFAULT_ROUTE_BC_ENABLE 0x0002
4544 /**
4545 * @def pa_EMAC_IF_DEFAULT_ROUTE_UC_ENABLE
4546 * Control Info -- Set: unicast packet no match default route enable
4547 * Clear: unicast packet no match default route disable
4548 */
4549 #define pa_EMAC_IF_DEFAULT_ROUTE_UC_ENABLE 0x0004
4551 /**
4552 * @def pa_EMAC_IF_DEFAULT_ROUTE_MC_PRE_CLASSIFY_ENABLE
4553 * Control Info -- Set: default route for multicast pre classification enable
4554 * Clear: default route for multicast post classification enable
4555 */
4556 #define pa_EMAC_IF_DEFAULT_ROUTE_MC_PRE_CLASSIFY_ENABLE 0x0008
4558 /**
4559 * @def pa_EMAC_IF_DEFAULT_ROUTE_BC_PRE_CLASSIFY_ENABLE
4560 * Control Info -- Set: default route for broadcast pre classification enable
4561 * Clear: default route for broadcast post classification enable
4562 */
4563 #define pa_EMAC_IF_DEFAULT_ROUTE_BC_PRE_CLASSIFY_ENABLE 0x0010
4566 /*@}*/
4567 /** @} */
4569 /**
4570 * @ingroup palld_api_structures
4571 * @brief PA Interface based Ingress default routing information.
4572 *
4573 * @details paDefRouteConfig_t is used to specify the ingress default routing
4574 * configuration parameters of the PASS.
4575 * Refer to @ref appendix6 for details
4576 *
4577 */
4578 typedef struct {
4579 uint32_t ctrlBitMap; /**< Specifies various ingress default route control bits as defined at @ref paDefRouteCtrlBits */
4580 uint8_t port; /**< Specifies the ingress EMAC port number (1-based) */
4581 paRouteInfo2_t dRouteInfo[pa_DROUTE_MAX]; /**< Specifies the default route information for each packet type as defined at @ref paDrouteTypes */
4582 } paDefRouteConfig_t;
4584 /**
4585 * @defgroup paEQoSCtrlBits PA Enhanced QoS Control Bits Definitions
4586 * @ingroup palld_api_constants
4587 * @{
4588 *
4589 * @name PA enhanced QoS Control Bits Definitions
4590 *
4591 * @brief Bitmap definition of the ctrlBitMap in @ref paEQosModeConfig_t
4592 *
4593 */
4594 /* @{ */
4595 /**
4596 * @def pa_IF_EQoS_ROUTE_DP_BIT_MODE
4597 * Control Info -- Set: DP-bit mode
4598 * Clear: DSCP mode
4599 */
4600 #define pa_IF_EQoS_ROUTE_DP_BIT_MODE 0x0001
4602 /**
4603 * @def pa_IF_EQoS_PRIORITY_OVERRIDE_ENABLE
4604 * Control Info -- Set: priority override enable
4605 * Clear: priority override disable
4606 */
4607 #define pa_IF_EQoS_PRIORITY_OVERRIDE_ENABLE 0x0002
4609 /**
4610 * @def pa_IF_EQoS_VLAN_OVERRIDE_ENABLE
4611 * Control Info -- Set: VLAN override enable (for Egress traffic only)
4612 * Clear: VLAN override disable (for Egress traffic only)
4613 */
4614 #define pa_IF_EQoS_VLAN_OVERRIDE_ENABLE 0x0004
4616 /* @} */
4617 /** @} */
4620 /**
4621 * @ingroup palld_api_structures
4622 * @brief Enhanced QoS Mode Route offset information. This is per dscp or priority bits
4623 *
4624 * @details paRouteOffset_t specifies the offset for flow and queue
4625 * with respect to a base CPPI flow and base QoS Queue.
4626 */
4627 typedef struct {
4628 uint8_t flowOffset; /**< Specifies CPPI flow offset */
4629 uint8_t queueOffset; /**< Specifies the destination host queue offset */
4630 } paRouteOffset_t;
4632 /**
4633 * @ingroup palld_api_structures
4634 * @brief PA Interfcae based Enhanced QoS mode information
4635 *
4636 * @details paEQosModeConfig_t is used to specify the EQoS mode global configuration
4637 * parameters of the PASS. Refer to @ref appendix7 for details.
4638 */
4639 typedef struct {
4640 uint32_t ctrlBitMap; /**< Specifies various EQoS mode control bits as defined in @ref paEQoSCtrlBits */
4641 paRouteOffset_t pbitMap[8]; /**< Specifies the Pbit-to-flow/queue offset mapping */
4642 paRouteOffset_t dscpMap[64]; /**< Specifies the DSCP-to-flow/queue offset mapping */
4643 uint8_t port; /**< Specifies the EMAC port number (1-based) for the EQoS configuration*/
4644 uint8_t ingressDefPri; /**< ingress port default priority */
4645 uint16_t vlanId; /**< Specifies the VLAN ID to be used/replaced at the egress packet */
4646 uint8_t flowBase; /**< Specifies the CPPI flow base for egress (SoC generated) packets */
4647 uint16_t queueBase; /**< Specifies the QoS queue base for egress (SoC generated) packets */
4648 } paEQosModeConfig_t;
4650 /**
4651 * @defgroup paEmacPortCfgType PA EMAC Port Configuration Type
4652 * @ingroup palld_api_constants
4653 * @{
4654 *
4655 * @name PA EMAC Port Configuration Type
4656 *
4657 * @brief Define the PA EMAC port configuration types used at @ref paEmacPortConfig_t
4658 *
4659 */
4660 /* @{ */
4661 /**
4662 * @def pa_EMAC_PORT_CFG_MIRROR
4663 * port mirror configuration
4664 * Please refer to @ref appendix5 for details about this operation.
4665 */
4666 #define pa_EMAC_PORT_CFG_MIRROR 0
4668 /**
4669 * @def pa_EMAC_PORT_CFG_PKT_CAPTURE
4670 * packet capture configuration
4671 * Please refer to @ref appendix5 for details about this operation.
4672 */
4673 #define pa_EMAC_PORT_CFG_PKT_CAPTURE 1
4675 /**
4676 * @def pa_EMAC_PORT_CFG_DEFAULT_ROUTE
4677 * ingress packet default route configuration
4678 * Please refer to @ref appendix6 for details about this operation.
4679 */
4680 #define pa_EMAC_PORT_CFG_DEFAULT_ROUTE 2
4682 /**
4683 * @def pa_EMAC_PORT_CFG_EQoS_MODE
4684 * enhanced QoS mode configuration
4685 * please refer to @ref appendix7 for details about this operation.
4686 */
4687 #define pa_EMAC_PORT_CFG_EQoS_MODE 3
4689 /* @} */
4690 /** @} */
4692 /**
4693 * @def pa_MAX_NUM_EMAC_PORT_CONFIG_ENTRIES
4694 * The maximum number of emac port configuration entries for interfcae-based EMAC operations.
4695 * Please note that this number is limited by the PASS internal memory size and therefore it
4696 * may be smaller than the number of available EMAC ports.
4697 */
4698 #define pa_MAX_NUM_EMAC_PORT_CONFIG_ENTRIES 5
4700 /**
4701 * @ingroup palld_api_structures
4702 * @brief PA emac port configuration information.
4703 *
4704 * @details paEmacPortConfig_t is used to specify the interfcae based EMAC port configuration parameters
4705 * for the following operations respectively
4706 * - EMAC Port Mirroring
4707 * - Packet Capture
4708 * - Ingress Default Route
4709 * - Enhanced QoS Mode
4710 *
4711 * Please refer to individual operation as described at @ref appendix5, @ref appendix6 and @ref appendix7 for further details.
4712 */
4713 typedef struct {
4714 uint16_t cfgType; /**< Specify the EMAC port configuration type as defined at @ref paEmacPortCfgType
4715 to specify which structure to use under the union */
4716 uint16_t numEntries; /**< Specify number of port entries to be configured */
4717 union {
4718 paPortMirrorConfig_t *mirrorCfg; /**< pointer to port mirror configuration array */
4719 paPktCaptureConfig_t *pktCapCfg; /**< pointer to packet capture configuration array */
4720 paDefRouteConfig_t *defRouteCfg; /**< pointer to default ingress route configuration array */
4721 paEQosModeConfig_t *eQoSModeCfg; /**< pointer to enhanced QoS Mode configuration arary */
4722 }u; /**< Contain the port configuration specific parameters */
4723 } paEmacPortConfig_t;
4725 /**
4726 * @defgroup paCtrlCode PA Control Code
4727 * @ingroup palld_api_constants
4728 * @{
4729 *
4730 * @name PA Control Code
4731 *
4732 * @brief Define the PA LLD control code
4733 *
4734 */
4735 /** @ingroup paCtrlCode */
4736 /* @{ */
4737 /**
4738 * @def pa_CONTROL_SYS_CONFIG
4739 * system-level configuration
4740 */
4741 #define pa_CONTROL_SYS_CONFIG 0
4743 /**
4744 * @def pa_CONTROL_802_1ag_CONFIG
4745 * 802.1ag Detector configuration
4746 */
4747 #define pa_CONTROL_802_1ag_CONFIG 1
4749 /**
4750 * @def pa_CONTROL_IPSEC_NAT_T_CONFIG
4751 * IPSEC NAT-T Packet Detector configuration
4752 */
4753 #define pa_CONTROL_IPSEC_NAT_T_CONFIG 2
4755 /**
4756 * @def pa_CONTROL_GTPU_CONFIG
4757 * GTP-U configuration
4758 */
4759 #define pa_CONTROL_GTPU_CONFIG 3
4761 /**
4762 * @def pa_CONTROL_EMAC_PORT_CONFIG
4763 * EMAC_PORT_CONFIG configuration
4764 */
4765 #define pa_CONTROL_EMAC_PORT_CONFIG 4
4767 /**
4768 * @def pa_CONTROL_RA_CONFIG
4769 * RA configuration
4770 */
4771 #define pa_CONTROL_RA_CONFIG 5
4773 /**
4774 * @def pa_CONTROL_MAX_CONFIG_GEN1
4775 * Maximum global configuration types on NSS Gen1 devices
4776 */
4777 #define pa_CONTROL_MAX_CONFIG_GEN1 pa_CONTROL_EMAC_PORT_CONFIG
4779 /**
4780 * @def pa_CONTROL_MAX_CONFIG_GEN2
4781 * Maximum global configuration types on NSS Gen2 devices
4782 */
4783 #define pa_CONTROL_MAX_CONFIG_GEN2 pa_CONTROL_RA_CONFIG
4785 /* @} */
4786 /** @} */
4788 /**
4789 * @ingroup palld_api_structures
4790 * @brief PA Control Information structure
4791 *
4792 * @details Data structure defines PA control information used by API @ref Pa_control.
4793 *
4794 */
4795 typedef struct {
4796 uint16_t code; /**< Specify the PA control code as defined at @ref paCtrlCode */
4797 union {
4798 paSysConfig_t sysCfg; /**< Specify system-level configuration parameters */
4799 pa802p1agDetConfig_t pa802p1agDetCfg; /**< Specify 802.1ag Detector configuration parameters */
4800 paIpsecNatTConfig_t ipsecNatTDetCfg; /**< Specify IPSEC NAT-T Detector configuration parameters */
4801 paGtpuConfig_t gtpuCfg; /**< Specify GTP-U configuration parameters */
4802 paRaConfig_t raCfg; /**< Specify RA global configuration information (PASS Gen2 only) */
4803 paEmacPortConfig_t emacPortCfg; /**< Specify interface based port configuration information */
4804 }params; /**< Contain the control operation specific parameters */
4805 } paCtrlInfo_t;
4808 /**
4809 * @defgroup mrEntryCtrlInfo Multiroute Entry Control Info Bit Definitions
4810 * @ingroup palld_api_constants
4811 * @{
4812 *
4813 * @name Multiroute Entry Control Info Bit Definitions
4814 *
4815 * Bitmap definition of the ctrlBitField in @ref paMultiRouteEntry_t.
4816 */
4817 /*@{*/
4818 /**
4819 * @def pa_MULTI_ROUTE_DESCRIPTOR_ONLY
4820 * Control Info -- Set: Send descriptor without packet to the destination
4821 * Clear: Send both descriptor and the packet to the destination
4822 *
4823 */
4824 #define pa_MULTI_ROUTE_DESCRIPTOR_ONLY 0x01
4825 /*@{*/
4826 /**
4827 * @def pa_MULTI_ROUTE_REPLACE_SWINFO
4828 * Control Info -- Set: Replace the swInfo0 with the value provided here
4829 * Clear: Keep the original swInfo0
4830 *
4831 */
4832 #define pa_MULTI_ROUTE_REPLACE_SWINFO 0x02
4833 /*@}*/
4834 /** @} */
4836 /**
4837 * @ingroup palld_api_structures
4838 * @brief Packet Multi-route entry configuration
4839 *
4840 * @details paMultiRouteEntry_t is used to specify the physical routing of packets per multi-route entry.
4841 * It is only a subset of the Routing information defined at @ref paRouteInfo_t because those common
4842 * parameters such as swInfo0, swInfo1 must be already present in the packet descriptor.
4843 * There is no restriction of the destination as long as it is accessible through PKTDMA queue.
4844 */
4845 typedef struct {
4847 uint8_t ctrlBitfield; /**< Multi-Routing control information as defined at @ref mrEntryCtrlInfo */
4848 uint8_t flowId; /**< For host, specifies the CPPI flow which defines the free queues are used for receiving packets */
4849 uint16_t queue; /**< For host, specifies the destination queue */
4850 uint32_t swInfo0; /**< Placed in SwInfo0 for packets to host */
4852 } paMultiRouteEntry_t;
4854 /**
4855 * @defgroup paMultiRouteModes Multi-route group configuration mode
4856 * @ingroup palld_api_constants
4857 * @{
4858 *
4859 * @name Multi-route group configuration mode
4860 *
4861 * Definition of Multi-route group configuration mode supported in PA sub-system
4862 */
4863 /** @ingroup paMultiRouteModes */
4864 /*@{*/
4865 typedef enum {
4866 pa_MULTI_ROUTE_MODE_CONFIG = 0, /**< Add or reconfigure the multi-route group */
4867 pa_MULTI_ROUTE_MODE_RESET /**< Delete the multi-route group */
4868 } paMultiRouteModes_e;
4869 /*@}*/
4870 /** @} */
4872 /**
4873 * @defgroup paCrcSizes PA CRC Sizes
4874 * @ingroup palld_api_constants
4875 * @{
4876 *
4877 * @name CRC Sizes
4878 *
4879 * Definition of CRC sizes supported in PA sub-system
4880 */
4881 /** @ingroup paCrcSizes */
4882 /*@{*/
4883 typedef enum {
4884 pa_CRC_SIZE_8 = 0, /**< 8-bit CRC */
4885 pa_CRC_SIZE_16, /**< 16-bit CRC */
4886 pa_CRC_SIZE_24, /**< 24-bit CRC */
4887 pa_CRC_SIZE_32 /**< 32-bit CRC */
4888 } paCrcSizes_e;
4889 /*@}*/
4890 /** @} */
4892 /**
4893 * @defgroup crcConfigCtrlInfo CRC Engine Configuration Control Info Bit Definitions
4894 * @ingroup palld_api_constants
4895 * @{
4896 *
4897 * @name CRC Engine Configuration Control Info Bit Definitions
4898 *
4899 * Bitmap definition of the ctrlBitField in @ref paCrcConfig_t.
4900 */
4901 /*@{*/
4902 /**
4903 * @def pa_CRC_CONFIG_RIGHT_SHIFT
4904 * Control Info -- Set: Right shift CRC (b0 to b7)
4905 * Clear: Left shift CRC (b7 to b0)
4906 */
4907 #define pa_CRC_CONFIG_RIGHT_SHIFT 0x0001
4908 /**
4909 * @def pa_CRC_CONFIG_INVERSE_RESULT
4910 * Control Info -- Set: a 'NOT' operation is applied to the final CRC result
4911 */
4912 #define pa_CRC_CONFIG_INVERSE_RESULT 0x0002
4913 /*@}*/
4914 /** @} */
4916 /**
4917 * @ingroup palld_api_structures
4918 * @brief CRC Engine configuration
4919 *
4920 * @details paCrcConfig_t is used to configure the CRC engines within the PA sub-system.
4921 * There are several CRC engines within various processing stages in the PA sub-system.
4922 * The locations of CRC engines are defined and described at @ref paCrcInst.
4923 * The CRC engine is used to perform CRC operation required by some network protocol such as
4924 * SCTP and/or the user-specified CRC command. It only supports one type of CRC
4925 * per configuration.
4926 *
4927 * @note Only one type of CRC calcualtion is supported by one CRC engine per configuration.
4928 * It is the responsibility of the module user to configure the specific CRC engine by
4929 * calling @ref Pa_configCrcEngine.
4930 */
4932 typedef struct {
4934 uint16_t ctrlBitfield; /**< CRC configuration control information as defined at @ref crcConfigCtrlInfo */
4935 paCrcSizes_e size; /**< CRC sizes as defined at @ref paCrcSizes_e (PASS Gen1 only)*/
4936 uint32_t polynomial; /**< Specify the CRC polynomial in the format of 0xabcdefgh. For example,
4937 x32+x28+x27+x26+x25+x23+x22+x20+x19+x18+x14+x13+x11+x10+x9+x8+x6+1
4938 ==> 0x1EDC6F41
4939 x16+x15+x2+1 ==>0x80050000 */
4940 uint32_t initValue; /**< CRC initial value (PASS Gen1 only)*/
4941 } paCrcConfig_t;
4944 /**
4945 * @defgroup timestampScalerFactor Timestamp Scaler Factor
4946 * @ingroup palld_api_constants
4947 * @{
4948 *
4949 * @name Timestamp Scaler Factor
4950 *
4951 * Definition of PA timestamp scaler factor supported in PA sub-system
4952 *
4953 * @note pa_TIMESTAMP_SCALER_FACTOR_1 is not supported. It is defined here
4954 * for reference purpose.
4955 */
4956 /** @ingroup timestampScalerFactor */
4957 /*@{*/
4958 typedef enum {
4959 pa_TIMESTAMP_SCALER_FACTOR_1 = -1,
4960 pa_TIMESTAMP_SCALER_FACTOR_2 = 0,
4961 pa_TIMESTAMP_SCALER_FACTOR_4,
4962 pa_TIMESTAMP_SCALER_FACTOR_8,
4963 pa_TIMESTAMP_SCALER_FACTOR_16,
4964 pa_TIMESTAMP_SCALER_FACTOR_32,
4965 pa_TIMESTAMP_SCALER_FACTOR_64,
4966 pa_TIMESTAMP_SCALER_FACTOR_128,
4967 pa_TIMESTAMP_SCALER_FACTOR_256,
4968 pa_TIMESTAMP_SCALER_FACTOR_512,
4969 pa_TIMESTAMP_SCALER_FACTOR_1024,
4970 pa_TIMESTAMP_SCALER_FACTOR_2048,
4971 pa_TIMESTAMP_SCALER_FACTOR_4096,
4972 pa_TIMESTAMP_SCALER_FACTOR_8192
4973 } paTimestampScalerFactor_e;
4974 /*@}*/
4975 /** @} */
4977 /**
4978 * @ingroup palld_api_structures
4979 * @brief Timestamp configuration
4980 *
4981 * @details paTimestampConfig_t is used to configure the timer which is used to generate timestamp in
4982 * the PA sub-system.
4983 * @verbatim
4984 The 16-bit timer connected to PDSP0 is reserved for timestamp generation.
4985 The timestamp will be 0 until the timer is enabled.
4986 The timestamp unit is equal to (the scaler factor)/350 us.
4987 @endverbatim
4988 *
4989 * @note: The PDSP timer does not support pa_TIMESTAMP_SCALER_FACTOR_1.
4990 * The timer will be disabled if unspported scaler factor is used.
4991 */
4993 typedef struct {
4994 uint16_t enable; /**< Enable/Disable(1/0) the timestamp generation */
4995 paTimestampScalerFactor_e factor; /**< Timestamp scaler factor as defined at @ref timestampScalerFactor */
4996 } paTimestampConfig_t;
4998 /**
4999 * @defgroup paUsrStatsTypes PA User-defined Ststaistics Counter Types
5000 * @ingroup palld_api_constants
5001 * @{
5002 *
5003 * @name User-defined Ststaistics Counter Types
5004 *
5005 * Definition of Counter types of the User-defined Statistics
5006 */
5007 /** @ingroup paUsrStatsTypes */
5008 /*@{*/
5009 typedef enum {
5010 pa_USR_STATS_TYPE_PACKET = 0, /**< Packet Counter */
5011 pa_USR_STATS_TYPE_BYTE, /**< Byte Counter */
5012 pa_USR_STATS_TYPE_DISABLE /**< Counter to be disabled */
5013 } paUsrStatsTypes_e;
5014 /*@}*/
5015 /** @} */
5018 /**
5019 * @ingroup palld_api_structures
5020 * @brief User-defined statistics counter entry configuration information
5021 *
5022 * @details paUsrStatsCounterEntryConfig_t defines the operation parameters of each user-defined statistics.
5023 */
5025 typedef struct {
5026 uint16_t cntIndex; /**< Index of the counter */
5027 uint16_t cntLnk; /**< Index of the next level counter. 0xFFFF: No linking counter */
5028 paUsrStatsTypes_e cntType; /**< Counter type (packet counter */
5029 } paUsrStatsCounterEntryConfig_t;
5031 /**
5032 * @def pa_USR_STATS_LNK_END
5033 * Indicate that there is no next layer counter
5034 */
5035 #define pa_USR_STATS_LNK_END 0xFFFF
5038 /**
5039 * @defgroup usrStatsCounterConfigCtrlInfo User-defined Statistics Counter Configuration Control Info Bit Definitions
5040 * @ingroup palld_api_constants
5041 * @{
5042 *
5043 * @name User-defined Statistics Counter Configuration Control Info Bit Definitions
5044 *
5045 * Bitmap definition of the ctrlBitField in @ref paUsrStatsCounterConfig_t
5046 */
5047 /*@{*/
5048 /**
5049 * @def pa_USR_STATS_CONFIG_RESET
5050 * Control Info -- Set: Reset all counter control blocks to its default setting (packet counter without link to the next layer)
5051 */
5052 #define pa_USR_STATS_CONFIG_RESET 0x0001
5053 /*@}*/
5054 /** @} */
5056 /**
5057 * @ingroup palld_api_structures
5058 * @brief User-defined statistics counter configuration information
5059 *
5060 * @details paUsrStatsCounterConfig_t contains an array of the entry configuration information.
5061 */
5063 typedef struct {
5064 uint16_t ctrlBitfield; /**< User-defined statistics counter configuration control information as defined at @ref usrStatsCounterConfigCtrlInfo */
5065 uint16_t numCnt; /**< Number of counters to be configured */
5066 paUsrStatsCounterEntryConfig_t* cntInfo; /**< Array of counter configuration as specified at @ref paUsrStatsCounterEntryConfig_t */
5067 } paUsrStatsCounterConfig_t;
5069 /**
5070 * @ingroup palld_api_structures
5071 * @brief User-defined statistics configuration information
5072 *
5073 * @details paUsrStatsConfigInfo_t is used to perform user-defined statistics related configuration. It is used by
5074 * API function @ref Pa_configUsrStats.
5075 */
5076 typedef struct {
5077 paUsrStatsCounterConfig_t* pCntCfg; /**< Pointer to the user-defined statistics counter configuration. */
5078 } paUsrStatsConfigInfo_t;
5080 /**
5081 * @defgroup usrStatsAllocCtrlInfo User-defined Statistics Allocation Control Info Bit Definitions
5082 * @ingroup palld_api_constants
5083 * @{
5084 *
5085 * @name User-defined Statistics Allocation Control Info Bit Definitions
5086 *
5087 * Bitmap definition of the ctrlBitField in @ref paUsrStatsAlloc_t
5088 */
5089 /*@{*/
5090 /**
5091 * @def pa_USR_STATS_ALLOC_64B_CNT
5092 * Control Info -- Set: Allocate a 64-bit counter
5093 * Clear: Allocate a 32-bit counter
5094 */
5095 #define pa_USR_STATS_ALLOC_64B_CNT 0x0001
5097 /**
5098 * @def pa_USR_STATS_ALLOC_CNT_PRESENT
5099 * Control Info -- Set: Counter index is provided. Need to verify whether the counter index is valid.
5100 * Clear: Counter index is not present. Need to allocate one.
5101 */
5102 #define pa_USR_STATS_ALLOC_CNT_PRESENT 0x0002
5104 /*@}*/
5105 /** @} */
5108 /**
5109 * @ingroup palld_api_structures
5110 * @brief User-defined statistics Allocation information
5111 *
5112 * @details paUsrStatsAlloc_t defines the user-defined statistic allocation parameters which are used to specify
5113 * the charistics of the counter to be allocated or verified.
5114 */
5116 typedef struct {
5117 uint16_t ctrlBitfield; /**< User-defined statistics allocation control information as defined at @ref usrStatsAllocCtrlInfo */
5118 uint16_t cntIndex; /**< Index of the counter */
5119 } paUsrStatsAlloc_t;
5122 /**
5123 * @defgroup paSubSysStates PA Sub-system Queries and States
5124 * @ingroup palld_api_constants
5125 * @{
5126 *
5127 * @name PA Sub-system Queries and States
5128 *
5129 * PA Sub-system reset state and query arguments used by API function @ref Pa_resetControl
5130 */
5131 /* @{ */
5132 /**
5133 * @def pa_STATE_RESET
5134 * The Sub-system is in reset
5135 */
5136 #define pa_STATE_RESET 0 /**< Sub-system state reset */
5138 /**
5139 * @def pa_STATE_ENABLE
5140 * The Sub-system state is enabled
5141 */
5142 #define pa_STATE_ENABLE 1 /**< Sub-system state enable */
5144 /**
5145 * @def pa_STATE_QUERY
5146 * Query the Sub-system state
5147 */
5148 #define pa_STATE_QUERY 2 /**< Query the Sub-system state */
5150 /**
5151 * @def pa_STATE_INCONSISTENT
5152 * The Sub-system state is partially enabled
5153 */
5154 #define pa_STATE_INCONSISTENT 3 /**< Sub-system is partially enabled */
5156 /**
5157 * @def pa_STATE_INVALID_REQUEST
5158 * Invalid state command to the Sub-system
5159 */
5160 #define pa_STATE_INVALID_REQUEST 4 /**< Invalid state command to the Sub-system */
5162 /**
5163 * @def pa_STATE_ENABLE_FAILED
5164 * The Sub-system did not respond after restart
5165 */
5166 #define pa_STATE_ENABLE_FAILED 5 /**< The Sub-system did not respond after restart */
5168 /**
5169 * @def pa_STATE_RESOURCE_USE_DENIED
5170 * Resource manager denied the firmware use
5171 */
5172 #define pa_STATE_RESOURCE_USE_DENIED 6 /**< Resource manager denied the firmware use */
5174 /* @} */
5175 /** @} */
5178 /**
5179 * @ingroup palld_api_structures
5180 * @brief paSState_t defines the operating state of the packet accelerator sub-system
5181 *
5182 * @details The values in @ref paSubSysStates are used both to set the state of the packet accelerator
5183 * sub-system (pa_STATE_RESET and pa_STATE_ENABLE) as well as show the current state
5184 * of the system (all values).
5185 */
5186 typedef int paSSstate_t;
5188 /**
5189 * @ingroup palld_api_structures
5190 * @brief PA Classify1 Statistics Structure
5191 *
5192 * @details This structures define the PA Classify1-specific statistics provided
5193 * with API function @ref Pa_formatStatsReply ().
5194 */
5195 typedef struct paClassify1Stats_s {
5197 uint32_t nPackets; /**< Number of packets entering Classify1 PDSPs */
5198 uint32_t nIpv4Packets; /**< Number of IPv4 packets */
5199 uint32_t nIpv4PacketsInner; /**< Number of Inner IPv4 packets */
5200 uint32_t nIpv6Packets; /**< Number of IPv6 packets */
5201 uint32_t nIpv6PacketsInner; /**< Number of Inner IPv6 packets */
5202 uint32_t nCustomPackets; /**< Number of custom LUT1 packets */
5203 uint32_t nSrioPackets; /**< Number of SRIO packets */
5204 uint32_t nLlcSnapFail; /**< Number of packets with corrupt LLC Snap */
5205 uint32_t nTableMatch; /**< Number of packets with table match found */
5206 uint32_t nNoTableMatch; /**< Number of packets without table match found */
5207 uint32_t nIpFrag; /**< Number of Ingress fragmented IP packets */
5208 uint32_t nIpDepthOverflow; /**< Number of packets with too many IP layers */
5209 uint32_t nVlanDepthOverflow; /**< Number of packets with too many VLANs */
5210 uint32_t nGreDepthOverflow; /**< Number of packets with too many GREs */
5211 uint32_t nMplsPackets; /**< Number of MPLS packets */
5212 uint32_t nParseFail; /**< Number of packets which can not be parsed */
5213 uint32_t nInvalidIPv6Opt; /**< Number of IPv6 packets which contains invalid IPv6 options */
5214 uint32_t nTxIpFrag; /**< Number of Egress fragmented IP packets */
5215 uint32_t nSilentDiscard; /**< Number of packets dropped */
5216 uint32_t nInvalidControl; /**< Number of packet received with invalid control information */
5217 uint32_t nInvalidState; /**< Number of times the PA detected an illegal state and recovered */
5218 uint32_t nSystemFail; /**< Number of times the PA detected an unrecoverable state and restarted */
5220 } paClassify1Stats_t;
5222 /**
5223 * @ingroup palld_api_structures
5224 * @brief PA Classify2 Statistics Structure
5225 *
5226 * @details This structures define the PA Classify2-specific statistics provided
5227 * with API function @ref Pa_formatStatsReply ().
5228 */
5229 typedef struct paClassify2Stats_s {
5231 uint32_t nPackets; /**< Number of packets entering Classify2 PDSP */
5232 uint32_t nUdp; /**< Number of UDP packets */
5233 uint32_t nTcp; /**< Number of TCP packets */
5234 uint32_t nCustom; /**< Number of custom LUT2 packets */
5235 uint32_t reserved3; /**< Reserved for future use */
5236 uint32_t reserved4; /**< Reserved for future use */
5237 uint32_t nSilentDiscard; /**< Number of packets dropped */
5238 uint32_t nInvalidControl; /**< Number of packet received with invalid control information */
5240 } paClassify2Stats_t;
5242 /**
5243 * @ingroup palld_api_structures
5244 * @brief PA Modifier Statistics Structure
5245 *
5246 * @details This structures define the PA Modifier-specific statistics provided
5247 * with API function @ref Pa_formatStatsReply ().
5248 */
5249 typedef struct paModifyStats_s {
5250 uint32_t nCommandFail; /**< Number of invalid commands */
5252 } paModifyStats_t;
5254 /**
5255 * @ingroup palld_api_structures
5256 * @brief PA Common Statistics Structure
5257 *
5258 * @details This structures define the PA Common statistics provided
5259 * with API function @ref Pa_formatStatsReply ().
5260 */
5261 typedef struct paCommonStats_s {
5263 uint32_t reserved5; /**< Reserved for future use */
5265 } paCommonStats_t;
5267 /**
5268 * @ingroup palld_api_structures
5269 * @brief PA System Statistics Structure
5270 *
5271 * @details This structures define the PA System statistics provided
5272 * with API function @ref Pa_formatStatsReply ().
5273 */
5275 typedef struct paSysStats_s {
5277 paClassify1Stats_t classify1; /**< Classify1-specific statistics */
5278 paClassify2Stats_t classify2; /**< Classify2-specific statistics */
5279 paModifyStats_t modify; /**< Modifier-specific statistics */
5280 paCommonStats_t common; /**< Common statistics */
5282 } paSysStats_t;
5284 /**
5285 * @ingroup palld_api_structures
5286 * @brief PA User-defined Statistics Structure
5287 *
5288 * @details This structures define the PA User-defined statistics provided
5289 * with API function @ref Pa_requestUsrStats ().
5290 */
5292 typedef struct paUsrStats_s {
5294 uint64_t count64[pa_USR_STATS_MAX_64B_COUNTERS]; /**< Array of general purpose 64-bit counters */
5295 uint32_t count32[pa_USR_STATS_MAX_32B_COUNTERS]; /**< Array of general purpose 32-bit counters */
5297 } paUsrStats_t;
5299 /**
5300 * @ingroup palld_api_structures
5301 * @brief PA Reassembly Group Statistics Structure
5302 *
5303 * @details This structures define the PA RA group-specific statistics
5304 */
5305 typedef struct paRaGroupStats_s {
5307 uint32_t nReasmPackets; /**< Number of successfully reassembled packets of Group N*/
5308 uint32_t nFrags; /**< Number of fragmented IP packets of group N*/
5309 uint32_t nPackets; /**< Number of packets of Group N */
5310 uint32_t nCxtTOwSOP; /**< Number of IP packets where contexts associated with Group N time out
5311 before being completely reassembled, the SOP fragment has been received */
5312 uint32_t nCxtTOwSOPBytes; /**< Number of payload bytes of IP packets where contexts associated with Group N
5313 time out before being completely reassembled, the SOP fragment has been received */
5314 uint32_t nCxtTOwoSOP; /**< Number of IP packets where contexts associated with Group N time out before being
5315 completely reassembled, the SOP fragment has not been received */
5316 uint32_t nCxtTOwoSOPBytes; /**< Number of payload bytes of IP packets where contexts associated with Group N time out
5317 before being completely reassembled, the SOP fragment has not been received */
5318 uint32_t nZeroByte; /**< Number of IP fragments with zero-byte payload */
5319 uint32_t reserved2; /**< Reserved for future use */
5320 uint32_t nIpv6Overlap; /**< Number of IPv6 packets which are discarded because a fragment of this
5321 packet arrives that overlaps data previously received in another
5322 fragment for that same packet */
5323 uint32_t nIpv6OverlapBytes; /**< Number of IPv6 payload bytes which are discarded because a fragment of this
5324 packet arrives that overlaps data previously received in another
5325 fragment for that same packet */
5326 uint32_t nLargePackets; /**< Number of IP packets which are discarded because the completely reassembled
5327 packet greater than 64KB */
5328 uint32_t nIpv4TcpErr; /**< Number of IP packets which are discarded due to TCP error, i.e. a fragment is
5329 received that has a protocol of TCP and a fragment offset of 1 */
5330 uint32_t nFragLenErr; /**< Number of IP packets which are discarded due to an incorrect fragment length */
5331 uint32_t nIpv4IllegalIHL; /**< Number of IPv4 fragments which are discarded due to an incorrect IP header length */
5332 uint32_t nSmallFragments; /**< Number of IP fragments which is too small
5333 - IPv4: Packets that are not last fragment and are smaller than minIpv4PktSize
5334 - IPv6: Packets that are not last fragment and are smaller than 56 bytes
5335 - IPV6: Packets that are last fragment and are smaller than 49 bytes */
5336 uint32_t nIllegalFragLen; /**< Number of IP fragments that is not the last fragment, has a length
5337 that is not a multiple of 8 bytes */
5338 uint32_t nCxtCompletedDiscard; /**< Number of IP fragments which are discarded because they are for a context that has
5339 already been completed or timed out */
5340 uint32_t nCxtCompletedDiscardBytes; /**< Total payload bytes of IP fragments which are discarded because they are for a context that has
5341 already been completed or timed out */
5343 } paRaGroupStats_t;
5345 /**
5346 * @ingroup palld_api_structures
5347 * @brief PA RA Statistics Structure
5348 *
5349 * @details This structures define the PA RA statistics provided
5350 * with API function @ref Pa_requestUsrStats ().
5351 */
5353 typedef struct paRaStats_s {
5354 paRaGroupStats_t group[pa_RA_NUM_GROUPS]; /**< array of group-specific RA statistics */
5355 } paRaStats_t;
5357 /**
5358 * @ingroup palld_api_structures
5359 * @brief PA ACL Entry Statistics Structure
5360 *
5361 * @details This structures define the PA ACL per-entry statistics provided
5362 * with API function @ref Pa_queryAclStats ().
5363 */
5365 typedef struct paAclStats_s {
5367 uint32_t nMatchPackets; /**< Number of packets which matchs the ACL rule */
5368 uint32_t nMatchBytes; /**< Total bytes of the matched packets */
5370 } paAclStats_t;
5373 /**
5374 * @ingroup palld_api_structures
5375 * @brief PA Timestamp Structure
5376 *
5377 * This structure defines the 48-bit timestamp provided upon request with @ref Pa_getTimestamp ().
5378 */
5379 typedef struct {
5380 uint32_t hi; /**< Upper 32 bits of the 48-bit PASS timestamp */
5381 uint16_t lo; /**< Lower 16 bits of the 48-bit PASS timestamp */
5382 } paTimestamp_t;
5385 /**
5386 * @defgroup paApiParamValidBits PA API Parameter Valid Bit Definitions
5387 * @ingroup palld_api_constants
5388 * @{
5389 *
5390 * @name PA API Parameter Valid Bit Definitions
5391 *
5392 * Bitmap definition of the validBitMap in @ref paParamDesc.
5393 */
5394 /*@{*/
5396 /**
5397 * @def pa_PARAM_VALID_LUTINST
5398 * - Set: Application specifies the LUT1 instance
5399 * - Clear: LLD determines the LUT1 instance based on other input parameters
5400 */
5401 #define pa_PARAM_VALID_LUTINST (1<<0)
5403 /**
5404 * @def pa_PARAM_VALID_INDEX
5405 * - Set: Application specifies the LUT1 index to insert this entry
5406 * - Clear: PASS determines where in the LUT1 table to insert this entrry
5407 */
5408 #define pa_PARAM_VALID_INDEX (1<<1)
5410 /**
5411 * @def pa_PARAM_VALID_PREVLINK
5412 * - Set: Previous link is valid and it should be used as part of classification criteria
5413 * - Claer: Previous link is inavlid
5414 */
5415 #define pa_PARAM_VALID_PREVLINK (1<<2)
5417 /**
5418 * @def pa_PARAM_VALID_NEXTLINK
5419 * - Set: The specified virtual link in stead of the physical link should be used as part of
5420 * classification criteria at the next stage
5421 * - Clear: Use physical link at the next stage
5422 */
5423 #define pa_PARAM_VALID_NEXTLINK (1<<3)
5425 /* @} */ /* ingroup */
5426 /** @} */
5429 /**
5430 * @ingroup palld_api_structures
5431 * @brief PA API parameters structure
5432 *
5433 * @details This structure define the common parameters of the next generation APIs such as
5434 * @ref Pa_addMac2 and @ref Pa_addIp2. This structure includes a validBitMap of
5435 * optional parameters so that it can evolve while maintaining backward-compatibility.
5436 *
5437 * The parameter validBitMap specifies which optional parameters are valid
5438 * 1: used; 0: not used.
5439 *
5440 */
5441 typedef struct {
5442 uint32_t validBitMap; /**< 32-bit bitmap corresponding to usage of each optional field */
5443 int lutInst; /**< validBitMap[t0] Specify which LUT1 (0-2) should be used. */
5444 int index; /**< validBitMap[t1] Specify the index of the LUT1 entry (0-63).*/
5445 paLnkHandle_t prevLink; /**< validBitMap[t2] An optional L2 or L3 handle, or virtual link handle */
5446 paLnkHandle_t nextLink; /**< validBitMap[t3] An optional virtual link handle */
5447 paRouteInfo2_t *routeInfo; /**< Where to send a packet that matches */
5448 paRouteInfo2_t *nextRtFail; /**< Where to send a packet that matches, but fails to match any entry at the next classification stage */
5449 } paParamDesc;
5451 /**
5452 * @defgroup paLut2ApiParamValidBits PA LUT2 API Parameter Valid Bit Definitions
5453 * @ingroup palld_api_constants
5454 * @{
5455 *
5456 * @name PA LUT2 API Parameter Valid Bit Definitions
5457 *
5458 * Bitmap definition of the validBitmap in @ref paLut2ParamDesc.
5459 */
5460 /*@{*/
5462 /**
5463 * @def pa_LUT2_PARAM_VALID_CTRL_BITMAP
5464 * - Set: ctrlBitMap is valid
5465 * - Clear: ctrlBitMap is not used
5466 */
5467 #define pa_LUT2_PARAM_VALID_CTRL_BITMAP (1<<0)
5469 /**
5470 * @def pa_LUT2_PARAM_VALID_DIVERTQ
5471 * - Set: Divert Queue is specified for Queue Diversion operation
5472 * - Clear: Divert queue is not used
5473 */
5474 #define pa_LUT2_PARAM_VALID_DIVERTQ (1<<1)
5476 /* @} */ /* ingroup */
5477 /** @} */
5479 /**
5480 * @defgroup paLut2ParamCtrlFlags PA LUT2 API Common Parameters Control Flag Definitions
5481 * @ingroup palld_api_constants
5482 * @{
5483 *
5484 * @name PA LUT2 API Common Parameters Control Flag Definitions
5485 * Bitmap definition of the ctrlFlags in paLut2ParamDesc.
5486 */
5487 /*@{*/
5488 /**
5489 * @def pa_LUT2_INFO_CONTROL_FLAG_REPLACE
5490 * Flag -- 1: Replace the existing LUT2 entry
5491 * 0: Add new LUT2 entry
5492 */
5493 #define pa_LUT2_INFO_CONTROL_FLAG_REPLACE (1<<0)
5494 /*@}*/
5495 /** @} */
5497 /**
5498 * @ingroup palld_api_functions
5499 * @brief Pa_control performs system-level control and configuration
5500 *
5501 * @details This function performs PASS control operations including system-level figurations.
5502 * The system-level configurations are divided into several sub-groups which can be configured
5503 * independently. The default configuration will be used until this API is invoked.
5504 *
5505 * On return the command buffer (cmd) contains a formatted command for the sub-system when the cmdSize
5506 * is set to non-zero. The destination for the command is provided in cmdDest. The module user must send
5507 * the formatted command to the sub-system. The sub-system will generate a reply
5508 * and this reply must be sent back to this module through the @ref Pa_forwardResult API.
5509 *
5510 *
5511 * @param[in] handle The PA LLD instance identifier
5512 * @param[in] ctrl Control information
5513 * @param[out] cmd Where the created command is placed
5514 * @param[in,out] cmdSize Input the size of cmd buffer, on output the actual size used. @ref cmdMinBufSize
5515 * @param[in] reply Where the sub-system sends the command reply
5516 * @param[out] cmdDest Value (@ref cmdTxDest)
5517 * @retval Value (@ref ReturnValues)
5518 */
5519 paReturn_t Pa_control (Pa_Handle handle,
5520 paCtrlInfo_t *ctrl,
5521 paCmd_t cmd,
5522 uint16_t *cmdSize,
5523 paCmdReply_t *reply,
5524 int *cmdDest);
5526 /**
5527 * @ingroup palld_api_structures
5528 * @brief PA LUT2 API parameters structure
5529 *
5530 * @details This structure defines the common parameters of the next generation LUT2 APIs such as
5531 * @ref Pa_addPort2. This structure includes a validBitmap of optional parameters so that
5532 * it can evolve while maintaining backward-compatibility.
5533 *
5534 * The parameter validBitmap specifies which optional parameters are valid
5535 * 1: used; 0: not used.
5536 *
5537 */
5538 typedef struct {
5539 uint32_t validBitMap; /**< 32-bit Bitmap corresponding to usage of each optional field as specified at @ref paLut2ApiParamValidBits */
5540 uint32_t ctrlFlags; /**< 32-bit control flags as defined at @ref paLut2ParamCtrlFlags */
5541 uint16_t divertQ; /**< The source queue for atomic queue diversion with LUT2 update */
5542 } paLut2ParamDesc;
5544 /**
5545 * @ingroup palld_api_functions
5546 * @brief Pa_addSrio adds a SRIO entry to the L2 table
5547 *
5548 * @details This function is used to add or replace an entry into the L2 table (see @ref netlayers).
5549 * A new entry is added if the SRIO configuration info is unique in the modules handle table.
5550 * If the value is not unique then the routing information for the existing entry is changed to
5551 * the values provided in the function.
5552 *
5553 * On return the command buffer (cmd) contains a formatted command for the sub-system. The
5554 * destination for the command is provided in cmdDest. The module user must send the formatted
5555 * command to the sub-system. The sub-system will generate a reply
5556 * and this reply must be sent back to this module through the API @ref Pa_forwardResult.
5557 *
5558 * This command as well as @ref Pa_addIp operate with a strong dependence on entry order.
5559 * See section table @ref order for a description on the operation of the sub-system and
5560 * table entry ordering.
5561 *
5562 * @param[in] iHandle The driver instance handle
5563 * @param[in] index Specify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
5564 * @param[in] srioInfo Value @ref paSrioInfo_t
5565 * @param[in] nextHdr The next header type to be parsed following the SRIO classification
5566 * Refer to @ref NextHeaderTypes for all supported protocols
5567 * Set to pa_HDR_TYPE_UNKNOWN if no further prasing is required
5568 * @param[in] nextHdrOffset Offset to the next header from the beginning of the packet
5569 * @param[in] routeInfo Match packet routing information
5570 * @param[in] nextRtFail Routing information for subsequent match failures
5571 * @param[out] handle Pointer to L2 Handle
5572 * @param[out] cmd Where the created command is placed
5573 * @param[in,out] cmdSize Input the size of cmd buffer, on output the actual size used. @ref cmdMinBufSize
5574 * @param[in] reply Where the sub-system sends the command reply
5575 * @param[out] cmdDest Value (@ref cmdTxDest)
5576 * @retval Value (@ref ReturnValues)
5577 * @pre A driver instance must be created and tables initialized
5578 *
5579 * @note No table entry validation will be proformed if the LUT1 index is specified at this function
5580 *
5581 */
5583 paReturn_t Pa_addSrio ( Pa_Handle iHandle,
5584 int index,
5585 paSrioInfo_t *srioInfo,
5586 uint16_t nextHdr,
5587 uint16_t nextHdrOffset,
5588 paRouteInfo_t *routeInfo,
5589 paRouteInfo_t *nextRtFail,
5590 paHandleL2L3_t *handle,
5591 paCmd_t cmd,
5592 uint16_t *cmdSize,
5593 paCmdReply_t *reply,
5594 int *cmdDest);
5596 /**
5597 * @ingroup palld_api_functions
5598 * @brief Pa_addMac adds a mac address to the L2 table
5599 *
5600 * @details This function is used to add or replace an entry into the L2 table (see @ref netlayers).
5601 * A new entry is added if the MAC configuration info is unique in the modules handle table. If
5602 * the value is not unique then the routing information for the existing entry is changed to
5603 * the values provided in the function.
5604 *
5605 * L2 values that are not to be used for packet routing are set to 0.
5606 *
5607 * On return the command buffer (cmd) contains a formatted command for the sub-system. The
5608 * destination for the command is provided in cmdDest. The module user must send the formatted
5609 * command to the sub-system. The sub-system will generate a reply
5610 * and this reply must be sent back to this module through the @ref Pa_forwardResult API.
5611 *
5612 * This command as well as @ref Pa_addIp operate with a strong dependence on entry order.
5613 * See section table @ref order for a description on the operation of the sub-system and
5614 * table entry ordering.
5615 *
5616 *
5617 * @param[in] iHandle The driver instance handle
5618 * @param[in] index Specify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
5619 * @param[in] ethInfo Value @ref paEthInfo_t
5620 * @param[in] routeInfo Match packet routing information
5621 * @param[in] nextRtFail Routing information for subsequent match failures
5622 * @param[out] handle Pointer to L2 Handle
5623 * @param[out] cmd Where the created command is placed
5624 * @param[in,out] cmdSize Input the size of cmd buffer, on output the actual size used. @ref cmdMinBufSize
5625 * @param[in] reply Where the sub-system sends the command reply
5626 * @param[out] cmdDest Value (@ref cmdTxDest)
5627 * @retval Value (@ref ReturnValues)
5628 * @pre A driver instance must be created and tables initialized
5629 *
5630 * @note No table entry validation will be proformed if the LUT1 index is specified at this function
5631 *
5632 */
5634 paReturn_t Pa_addMac ( Pa_Handle iHandle,
5635 int index,
5636 paEthInfo_t *ethInfo,
5637 paRouteInfo_t *routeInfo,
5638 paRouteInfo_t *nextRtFail,
5639 paHandleL2L3_t *handle,
5640 paCmd_t cmd,
5641 uint16_t *cmdSize,
5642 paCmdReply_t *reply,
5643 int *cmdDest);
5645 /**
5646 * @ingroup palld_api_functions
5647 * @brief Pa_addMac2 adds a mac address to the L2 table
5648 *
5649 * @details Pa_addMac2 is the next generation of API to replace @ref Pa_addMac eventually. This new API
5650 * covers the entire functionality of Pa_addMac and it is designed to support more features
5651 * while maintain backward-compatibility over time.
5652 *
5653 * @param[in] iHandle The driver instance handle
5654 * @param[in] ethInfo Value @ref paEthInfo2_t
5655 * @param[in] params Common API parameters @ref paParamDesc
5656 * @param[out] retHandle Pointer to L2 Handle
5657 * @param[out] cmd Where the created command is placed
5658 * @param[in,out] cmdSize Input the size of cmd buffer, on output the actual size used. @ref cmdMinBufSize
5659 * @param[in] reply Where the sub-system sends the command reply
5660 * @param[out] cmdDest Value (@ref cmdTxDest)
5661 * @retval Value (@ref ReturnValues)
5662 * @pre A driver instance must be created and tables initialized
5663 *
5664 */
5665 paReturn_t Pa_addMac2 ( Pa_Handle iHandle,
5666 paEthInfo2_t *ethInfo, /**< Value @ref paEthInfo2_t */
5667 paParamDesc *params,
5668 paLnkHandle_t *retHandle, /**< Pointer to the returned L2 handle */
5669 paCmd_t cmd,
5670 uint16_t *cmdSize,
5671 paCmdReply_t *reply,
5672 int *cmdDest
5673 );
5675 /**
5676 * @ingroup palld_api_functions
5677 * @brief Pa_delHandle deletes a MAC/SRIO or IP handle
5678 *
5679 * @details This function is used to remove an entry from the sub-system L2 or L3 (LUT1) lookup (see @ref netlayers).
5680 * When a handle is deleted it can create stale handles. For example, an L3 handle can reference
5681 * an L2 handle, and an L4 handle can reference an L3 handle. The module does not check for
5682 * references to a stale handle, the module user is responsible for maintaining reference coherency.
5683 * It is recommended that the handle should not be deleted if the API function @ref Pa_getHandleRefCount
5684 * returns non-zero reference count.
5685 *
5686 * @param[in] iHandle The driver instance handle
5687 * @param[in] handle Pointer to the l2/l3 handle to delete
5688 * @param[out] cmd Where the created command is placed
5689 * @param[in] cmdSize The size of the cmd buffer
5690 * @param[in] reply Where the sub-system sends the command reply
5691 * @param[out] cmdDest Value (@ref cmdTxDest)
5692 * @retval Value (@ref ReturnValues)
5693 * @pre A driver instance must be created and tables initialized
5694 */
5695 paReturn_t Pa_delHandle (Pa_Handle iHandle,
5696 paHandleL2L3_t *handle,
5697 paCmd_t cmd,
5698 uint16_t *cmdSize,
5699 paCmdReply_t *reply,
5700 int *cmdDest );
5702 /**
5703 * @ingroup palld_api_functions
5704 * @brief Pa_delL4Handle deletes a UDP/TCP/GTPU/CustomLUT2 handle
5705 *
5706 * @details This function is used to remove an entry from the sub-system L4 (LUT2) handle entry.
5707 *
5708 * @param[in] iHandle The driver instance handle
5709 * @param[in, out] handle Pointer to the L4 handle to delete
5710 * @param[out] cmd Where the created command is placed
5711 * @param[in] cmdSize The size of the cmd buffer
5712 * @param[in] reply Where the sub-system sends the reply
5713 * @param[out] cmdDest Value (@ref cmdTxDest)
5714 * @retval Value (@ref ReturnValues)
5715 * @pre A driver instance must be created and tables initialized
5716 */
5717 paReturn_t Pa_delL4Handle (Pa_Handle iHandle,
5718 paHandleL4_t handle,
5719 paCmd_t cmd,
5720 uint16_t *cmdSize,
5721 paCmdReply_t *reply,
5722 int *cmdDest );
5724 /**
5725 * @ingroup palld_api_functions
5726 * @brief Pa_delAclHandle deletes an ACL handle
5727 *
5728 * @details This function is used to remove an entry from the LUT1-ACL lookup
5729 *
5730 * @param[in] iHandle The driver instance handle
5731 * @param[in] handle Pointer to the ACL handle to delete
5732 * @param[out] cmd Where the created command is placed
5733 * @param[in] cmdSize The size of the cmd buffer
5734 * @param[in] reply Where the sub-system sends the command reply
5735 * @param[out] cmdDest Value (@ref cmdTxDest)
5736 * @retval Value (@ref ReturnValues)
5737 * @pre A driver instance must be created and tables initialized
5738 */
5739 paReturn_t Pa_delAclHandle (Pa_Handle iHandle,
5740 paHandleAcl_t *handle,
5741 paCmd_t cmd,
5742 uint16_t *cmdSize,
5743 paCmdReply_t *reply,
5744 int *cmdDest );
5746 /**
5747 * @ingroup palld_api_functions
5748 * @brief Pa_addIp adds an IP address to the L3 table
5749 *
5750 * @details This function is used to add or replace an entry in the L3 table (see @ref netlayers).
5751 * A new entry is added if the IP configuration info is unique in the modules handle table.
5752 * If the value is not unique then the routing information for the existing entry is changed
5753 * to the values provided in the function.
5754 *
5755 * The LLD will determine where this entry is added based on following rules
5756 * - If there is no previous link or the previous link is a L2 (MAC/SRIO) entry, this entry will be
5757 * added into LUT1_1
5758 * - If the previous link is L3 (IP/Custom LUT1), this entry will be added into LUT1_2
5759 *
5760 * The module user can overwrite the default rules by specifying the desired LUT1 instance.
5761 *
5762 * The PASS will determine which entry of the specified LUT1 table is used for this entry based on
5763 * its internal algorithm if the module user does not specify the LUT1 index.
5764 *
5765 * L3 values that are used for packet routing should be set as described in @ref paIpInfo_t.
5766 *
5767 * The @ref paHandleL2L3_t prevLink is used to link this entry to an L2 or L3 entry already made
5768 * by a call to @ref Pa_addMac or Pa_addIp. If the link is enabled then a packet will match the IP
5769 * information provided in ipInfo only if the same packet has already matched at the L2 level as
5770 * described by prevLink. To disable linking the value of prevLink is set to NULL.
5771 *
5772 * On return the command buffer (cmd) contains a formatted command for the sub-system. The
5773 * destination for the command is provided in cmdDest. The module user must send the formatted
5774 * command to the sub-system. The sub-system will generate a reply and this reply must be
5775 * sent back to this module through the API @ref Pa_forwardResult.
5776 *
5777 * This command as well as @ref Pa_addMac operates with a strong dependence on entry order.
5778 * See section table @ref order for a description on the operation of the sub-system and
5779 * table entry ordering.
5780 *
5781 *
5782 *
5783 * @param[in] iHandle The driver instance handle
5784 * @param[in] lutInst Specify which LUT1 (0-2) should be used. Set to pa_LUT_INST_NOT_SPECIFIED if not specified
5785 * @param[in] index Specify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
5786 * @param[in] ipInfo Value @ref paIpInfo_t
5787 * @param[in] prevLink An optional L2 or L3 handle
5788 * @param[in] routeInfo Where to send a packet that matches
5789 * @param[in] nextRtFail Where to send a packet that matches, but later fails
5790 * @param[out] retHandle Pointer to the returned L3 handle
5791 * @param[out] cmd Buffer where the PASS command is created
5792 * @param[in] cmdSize The size of the cmd buffer
5793 * @param[in] reply Where the response to the PASS command is routed
5794 * @param[out] cmdDest Value (@ref cmdTxDest)
5795 * @retval Value (@ref ReturnValues)
5796 * @pre A driver instance must be created and tables initialized
5797 *
5798 * @note No table entry validation will be proformed if the LUT1 index is specified at this function
5799 *
5800 */
5801 paReturn_t Pa_addIp ( Pa_Handle iHandle,
5802 int lutInst,
5803 int index,
5804 paIpInfo_t *ipInfo,
5805 paHandleL2L3_t prevLink,
5806 paRouteInfo_t *routeInfo,
5807 paRouteInfo_t *nextRtFail,
5808 paHandleL2L3_t *retHandle,
5809 paCmd_t cmd,
5810 uint16_t *cmdSize,
5811 paCmdReply_t *reply,
5812 int *cmdDest );
5814 /**
5815 * @ingroup palld_api_functions
5816 * @brief Pa_addIp2 adds an IP address to the L3 table
5817 *
5818 * @details Pa_addIp2 is the next generation of API to replace @ref Pa_addIp eventually. This new API
5819 * covers the entire functionality of Pa_addIP and it is designed to support more features
5820 * while maintain backward-compatibility over time.
5821 *
5822 * @param[in] iHandle The driver instance handle
5823 * @param[in] ipInfo Value @ref paIpInfo2_t
5824 * @param[in] params Common API parameters @ref paParamDesc
5825 * @param[out] retHandle Pointer to L3 Handle
5826 * @param[out] cmd Where the created command is placed
5827 * @param[in,out] cmdSize Input the size of cmd buffer, on output the actual size used. @ref cmdMinBufSize
5828 * @param[in] reply Where the sub-system sends the command reply
5829 * @param[out] cmdDest Value (@ref cmdTxDest)
5830 * @retval Value (@ref ReturnValues)
5831 * @pre A driver instance must be created and tables initialized
5832 */
5833 paReturn_t Pa_addIp2 ( Pa_Handle iHandle,
5834 paIpInfo2_t *ipInfo,
5835 paParamDesc *params,
5836 paLnkHandle_t *retHandle,
5837 paCmd_t cmd,
5838 uint16_t *cmdSize,
5839 paCmdReply_t *reply,
5840 int *cmdDest
5841 );
5843 /**
5844 * @defgroup VirtualLnkType Virtual Link types
5845 * @ingroup palld_api_constants
5846 * @{
5847 *
5848 * @name VirtualLnkTypes
5849 * @brief Defines the virtual link destination type
5850 *
5851 * @note The packet accelerator module supports linking to
5852 * virtual links at OuterIp only at the moment.
5853 *
5854 */
5855 /* @{ */
5856 /**
5857 * @def pa_VIRTUAL_LNK_TYPE_MAC
5858 * MAC
5859 */
5860 #define pa_VIRTUAL_LNK_TYPE_MAC 0
5862 /**
5863 * @def pa_VIRTUAL_LNK_TYPE_OUTER_IP
5864 * Outer IP
5865 */
5866 #define pa_VIRTUAL_LNK_TYPE_OUTER_IP 1
5868 /**
5869 * @def pa_VIRTUAL_LNK_TYPE_INNER_IP
5870 * Inner IP
5871 */
5872 #define pa_VIRTUAL_LNK_TYPE_INNER_IP 2
5874 /* @} */
5875 /** @} */
5877 /**
5878 * @ingroup palld_api_functions
5879 * @brief Pa_addVirtualLink allocates a new virtual link within the PA instance
5880 *
5881 * @details This function is called to request a new virtual link
5882 *
5883 * @param[in] iHandle The driver instance handle
5884 * @param[in,out] vlinkHdl Pointer to virtual link handle
5885 * @param[in] lnkType Value (@ref VirtualLnkType)
5886 * @retval Value (@ref ReturnValues)
5887 * @pre A driver instance must be created and tables initialized
5888 *
5889 */
5890 paReturn_t Pa_addVirtualLink(Pa_Handle iHandle,
5891 paLnkHandle_t *vlinkHdl,
5892 int8_t lnkType
5893 );
5895 /**
5896 * @ingroup palld_api_functions
5897 * @brief Pa_delVirtualLink frees the specified virtual link within the PA instance
5898 *
5899 * @details This function is used to remove a virtual link
5900 *
5901 * @param[in] iHandle The driver instance handle
5902 * @param[in,out] vlinkHdl Pointer to virtual link handle
5903 * @retval Value (@ref ReturnValues)
5904 * @pre A driver instance must be created and tables initialized
5905 *
5906 */
5907 paReturn_t Pa_delVirtualLink(Pa_Handle iHandle,
5908 paLnkHandle_t *vlinkHdl
5909 );
5911 /**
5912 * @ingroup palld_api_functions
5913 * @brief Pa_allocUsrStats allocates or verifies a set of user-defined statistics
5914 *
5915 * @details This function is called to request or verify a number of user-defined statistics.
5916 * The return value pa_RESOURCE_USE_DENIED will be used if there are not enough user-defined
5917 * statistics available or one of the provided counter indexes is not valid.
5918 *
5919 * @param[in] iHandle The driver instance handle
5920 * @param[in, out] pNumCnt In:Number of user-defined statistics requested; Out: Number of user-defined statistics allocated
5921 * @param[in, out] cntList Array of user-defined statistics allocation parameters
5922 * @retval Value (@ref ReturnValues)
5923 * @pre A driver instance must be created and tables initialized
5924 *
5925 * @note: This function is optional when the application owns the entire set of user-defined statistics or uses a set of
5926 * pre-allocated user-defined statistics. However, the PASS will verify the user-defined statistics list and may
5927 * return error code pa_RESOURCE_USE_DENIED if RM is enabled when API @ref Pa_configUsrStats, @ref Pa_requestUsrStatsList
5928 * and etc are invoked.
5929 */
5930 paReturn_t Pa_allocUsrStats(Pa_Handle iHandle,
5931 int *pNumCnt,
5932 paUsrStatsAlloc_t *cntList
5933 );
5935 /**
5936 * @ingroup palld_api_functions
5937 * @brief Pa_freeUsrStats free a set of user-defined statistics
5938 *
5939 * @details This function is called to free a set of user-defined statistics.
5940 *
5941 *
5942 * @param[in] iHandle The driver instance handle
5943 * @param[in] numCnt Number of user-defined statistics to be freed
5944 * @param[in] cntList Pointer to list of user-defined statistics to be freed
5945 * @retval Value (@ref ReturnValues)
5946 * @pre A driver instance must be created and tables initialized
5947 *
5948 * @note: This function is optional when the application owns the entire set of user-defined statistics or uses a set of
5949 * pre-allocated user-defined statistics.
5950 */
5951 paReturn_t Pa_freeUsrStats(Pa_Handle iHandle,
5952 int numCnt,
5953 uint16_t *cntList
5954 );
5956 /**
5957 * @ingroup palld_api_functions
5958 * @brief Pa_addAcl adds an ACL entry to the ACL table
5959 *
5960 * @details This function is used to add an entry in the ACL table.
5961 * The PASS ACL table maintains an ordered list of ACL rules. This function will add ACL entries
5962 * in descending order, i.e. the new rule will be inserted at the bottom of the ACL table unless
5963 * the parameter nextEntry is specified, in this case, the new entry will be added in front of the
5964 * next entry.
5965 *
5966 * The are two ACL (LUT1) tables supported by PASS, one for outer IP and the other for inner IP.
5967 * The ACL instance should be specified by @ref paLut1Inst.
5968 *
5969 * The @ref paHandleL2L3_t prevLink is used to link this entry to an L2 or L3 entry already made
5970 * by a call to @ref Pa_addMac or Pa_addIp. If the link is enabled then a packet will match the ACL
5971 * information provided in aclInfo only if the same packet has already matched at the L2/L3 level as
5972 * described by prevLink. To disable linking the value of prevLink is set to NULL.
5973 *
5974 * On return the command buffer (cmd) contains a formatted command for the sub-system. The
5975 * destination for the command is provided in cmdDest. The module user must send the formatted
5976 * command to the sub-system. The sub-system will generate a reply and this reply must be
5977 * sent back to this module through the API @ref Pa_forwardResult.
5978 *
5979 * @param[in] iHandle The driver instance handle
5980 * @param[in] aclInst Specify which ACL LUT1 (@ref paAclInst) should be used.
5981 * @param[in] aclAction Specify ACL match action as @ref paAclActionTypes
5982 * @param[in] aclInfo Value @ref paAclInfo_t
5983 * @param[in] prevLink An optional L2 or L3 handle
5984 * @param[in] nextEntry An optional ACL handle as the next ACL rule
5985 * @param[out] retHandle Pointer to the returned ACL handle
5986 * @param[out] cmd Buffer where the PASS command is created
5987 * @param[in] cmdSize The size of the cmd buffer
5988 * @param[in] reply Where the response to the PASS command is routed
5989 * @param[out] cmdDest Value (@ref cmdTxDest)
5990 * @retval Value (@ref ReturnValues)
5991 * @pre A driver instance must be created and tables initialized
5992 *
5993 * @note No table entry validation will be proformed if the LUT1 index is specified at this function
5994 * @note To maintain the entry order of the ACL table, the function does not support entry
5995 * replacement with updated action. The application needs to call @ref Pa_delAclHandle at first and
5996 * then call this API to add the replaced entry.
5997 *
5998 */
5999 paReturn_t Pa_addAcl (Pa_Handle iHandle,
6000 int aclInst,
6001 int aclAction,
6002 paAclInfo_t *aclInfo,
6003 paHandleL2L3_t prevLink,
6004 paHandleAcl_t nextEntry,
6005 paHandleAcl_t *retHandle,
6006 paCmd_t cmd,
6007 uint16_t *cmdSize,
6008 paCmdReply_t *reply,
6009 int *cmdDest );
6011 /**
6012 * @defgroup paLut2PortSize LUT2 Port Size Values
6013 * @ingroup palld_api_constants
6014 * @{
6015 *
6016 * @name LUT2 Port Size Values
6017 * @brief Defines the LUT2 port size supported by PA.
6018 *
6019 * @details The PA LUT2 supports both 16-bit and 32-bit entry matching. It can be used to classify
6020 * based on the UDP/IP 16-bit destination port with or without upper layer link or the GTP-U
6021 * 32-bit Tunnel ID. No other Layer 4 or Layer 5 protocol is supported.
6022 */
6023 /* @{ */
6024 /**
6025 * @def pa_LUT2_PORT_SIZE_16
6026 * 16-bit port number such as UDP/TCP port
6027 *
6028 */
6029 #define pa_LUT2_PORT_SIZE_16 0
6031 /**
6032 * @def pa_LUT2_PORT_SIZE_32
6033 * 32-bit port number such as GTP-U Tunnel ID
6034 */
6035 #define pa_LUT2_PORT_SIZE_32 1
6037 /* @} */
6038 /** @} */
6041 /**
6042 * @ingroup palld_api_functions
6043 * @brief Pa_addPort adds a destination port to the L4 (LUT2) table
6044 *
6045 * @details This function is used to add an entry to the L4 (LUT2) table (see @ref netlayers). Only the
6046 * destination port can be set, along with a link to previous L3 handle
6047 * (see @ref Pa_addIp) through linkHandle.
6048 *
6049 * This module does not keep track of the L4 handles, so calling the function
6050 * a second time with the same destination port and link handle will simply replace the
6051 * previous entry. It is recommended to set the replace flag to indicate that this entry is
6052 * already at the LUT2 table. This feature may be used to change the routing information without
6053 * deleting and adding the matching port.
6054 * This API also initiates the atomic queue diversion operation, which means that the QMSS moves
6055 * the entries in the diverted queue to the destination queue, if the divertQ is specified and
6056 * fReplace flag is set. In this case, the PASS will complete the LUT2 update, wait for the queue
6057 * diversion to be complete and then resume processing incoming packets.
6058 * Unlike entries in the L2 and L3 table, the order of entry is not important.
6059 *
6060 * The type of transport header (TCP/UDP) is not specified here. If the type of transport
6061 * is part of the packet routing criteria it is specified in the protocol type field
6062 * in @ref paIpInfo_t in the call to @ref Pa_addIp.
6063 *
6064 * This function supports both 16-bit and 32-bit port specified by the parameter portSize.
6065 * However, there are the following restrictions for 32-bit ports
6066 * @verbatim
6067 1. The link to the previous LUT1 match can not be used so that the destID
6068 should be unique regressless of the previous L3 adddreses
6069 2. The 32-bit LUT2 lookup can not be mixed with the other TCP/UDP or custom LUT2 lookup.
6070 @endverbatim
6071 *
6072 * On return the command buffer (cmd) contains a formatted command for the sub-system.
6073 * The destination for the command is provided in cmdDest. The module user must send the
6074 * formatted command to the sub-system. The sub-system will generate a reply and this reply
6075 * must be sent back to this module through the @ref Pa_forwardResult API.
6076 *
6077 * @param[in] iHandle The driver instance handle
6078 * @param[in] portSize The input port size (@ref paLut2PortSize)
6079 * @param[in] destPort The destination TCP/UDP port
6080 * @param[in] linkHandle An L3 handle that is linked to the destination port
6081 * @param[in] fReplace Flag to indicate whether the entry exists
6082 * @param[in] divertQ The source queue for atomic queue diversion with LUT2 update
6083 * Set to pa_PARAMS_NOT_SPECIFIED if not specified
6084 * @param[in] routeInfo Where to send a packet that matches
6085 * @param[out] retHandle A blank handle where the return handle is placed
6086 * @param[out] cmd Buffer where the PASS command is created
6087 * @param[in] cmdSize The size of the cmd buffer
6088 * @param[out] reply Where the response to the PASS command is routed
6089 * @param[out] cmdDest Value (@ref cmdTxDest)
6090 * @retval Value (@ref ReturnValues)
6091 * @pre A driver instance must be created and tables initialized
6092 *
6093 * @note The linkHandle is mandatory for 16-bit TCP/UDP port or 32-bit GTPU port when pa_GTPU_CTRL_USE_LINK is set.
6094 * The linkHandle will be ignored for 32-bit GTPU port when pa_GTPU_CTRL_USE_LINK is cleared
6095 *
6096 */
6097 paReturn_t Pa_addPort ( Pa_Handle iHandle,
6098 int portSize,
6099 uint32_t destPort,
6100 paHandleL2L3_t linkHandle,
6101 uint16_t fReplace,
6102 uint16_t divertQ,
6103 paRouteInfo_t *routeInfo,
6104 paHandleL4_t retHandle,
6105 paCmd_t cmd,
6106 uint16_t *cmdSize,
6107 paCmdReply_t *reply,
6108 int *cmdDest );
6110 /**
6111 * @ingroup palld_api_functions
6112 * @brief Pa_addPort2 adds a destination port to the L4 (LUT2) table
6113 *
6114 * @details Pa_addPort2 is the next generation of API to replace @ref Pa_addPort eventually. This new API
6115 * covers the entire functionality of Pa_addPort and it is designed to support more features
6116 * while maintain backward-compatibility over time.
6117 *
6118 * @param[in] iHandle The driver instance handle
6119 * @param[in] portSize The input port size (@ref paLut2PortSize)
6120 * @param[in] destPort The destination TCP/UDP port
6121 * @param[in] linkHandle An L3 handle that is linked to the destination port
6122 * @param[in] params Common LUT2 API parameters @ref paLut2ParamDesc
6123 * @param[in] routeInfo Where to send a packet that matches
6124 * @param[out] retHandle A blank handle where the return handle is placed
6125 * @param[out] cmd Buffer where the PASS command is created
6126 * @param[in] cmdSize The size of the cmd buffer
6127 * @param[out] reply Where the response to the PASS command is routed
6128 * @param[out] cmdDest Value (@ref cmdTxDest)
6129 * @retval Value (@ref ReturnValues)
6130 * @pre A driver instance must be created and tables initialized
6131 *
6132 */
6133 paReturn_t Pa_addPort2 (Pa_Handle iHandle,
6134 int portSize,
6135 uint32_t destPort,
6136 paHandleL2L3_t linkHandle,
6137 paLut2ParamDesc *params,
6138 paRouteInfo2_t *routeInfo,
6139 paHandleL4_t retHandle,
6140 paCmd_t cmd,
6141 uint16_t *cmdSize,
6142 paCmdReply_t *reply,
6143 int *cmdDest );
6145 /**
6146 * @ingroup palld_api_functions
6147 * @brief Pa_setCustomLUT1 performs the global configuration for level 3 (LUT1) custom lookups
6148 *
6149 * @details This command is typically issued once per system and is used to configure the
6150 * PA for performing network layer 3 (LUT1) custom lookups.
6151 * It specifies the offset and byte masks which the PA
6152 * subsystem uses for parsing a packet that has entered custom LUT1
6153 * classification directed from the previous match route.
6154 * It also specifies the next header type and offset to be used for continuous
6155 * parsing
6156 *
6157 * On return the command buffer (cmd) contains a formatted command for the sub-system.
6158 * The destination for the command is provided in cmdDest. The module user must send the
6159 * formatted command to the sub-system. The sub-system will generate a reply and this reply
6160 * must be sent back to this module through the @ref Pa_forwardResult API.
6161 *
6162 * @param[in] iHandle The driver instance handle
6163 * @param[in] custIndex The level 3 (LUT1) custom index
6164 * @param[in] parseByteOffset Where the PA begins custom match (relative to the L3 start)
6165 * @param[in] nextHdr The next header type to be parsed following the custom header
6166 * Refer to @ref NextHeaderTypes for all supported protocols
6167 * Set to pa_HDR_TYPE_UNKNOWN if no further prasing is required
6168 * @param[in] nextHdrOffset Offset to the next header from the beginning of the custom header
6169 * @param[in] byteMasks The bitmap of bits in the parse that matter
6170 * @param[out] cmd Buffer where the PASS command is created
6171 * @param[in] cmdSize On entry the size of the cmd buffer, on exit the size of the command
6172 * @param[in] reply Where the response to the PASS command is routed
6173 * @param[out] cmdDest Value (@ref cmdTxDest)
6174 * @retval Value (@ref ReturnValues)
6175 * @pre A driver instance must be created and tables initialized
6176 *
6177 * @note There is up to @ref pa_MAX_CUSTOM_TYPES_LUT1 LUT1 custom types supported by PASS.
6178 */
6179 paReturn_t Pa_setCustomLUT1 ( Pa_Handle iHandle,
6180 uint16_t custIndex,
6181 uint16_t parseByteOffset,
6182 uint16_t nextHdr,
6183 uint16_t nextHdrOffset,
6184 uint8_t byteMasks[pa_NUM_BYTES_CUSTOM_LUT1],
6185 paCmd_t cmd,
6186 uint16_t *cmdSize,
6187 paCmdReply_t *reply,
6188 int *cmdDest );
6190 /**
6191 * @ingroup palld_api_functions
6192 * @brief Pa_AddCustomLUT1 adds a custom lookup entry to the lookup tables (LUT1).
6193 *
6194 * @details This command is called to add a specific match entry to the L3 (LUT1) lookup table. This
6195 * function is called once per desired custom LUT1 match criteria.
6196 *
6197 * The LLD will determine where this entry is added based on following rules
6198 * - If there is no previous link or the previous link is a L2 (MAC/SRIO) entry, this entry will be
6199 * added into LUT1_1
6200 * - If the previous link is L3 (IP/Custom LUT1), this entry will be added into LUT1_2
6201 *
6202 * The module user can overwrite the default rules by specifying the desired LUT1 instance.
6203 *
6204 * The PASS will determine which entry of the specified LUT1 table is used for this entry based on
6205 * its internal algorithm if the module user does not specify the LUT1 index.
6206 *
6207 * On return the command buffer (cmd) contains a formatted command for the sub-system.
6208 * The destination for the command is provided in cmdDest. The module user must send the
6209 * formatted command to the sub-system. The sub-system will generate a reply and this reply
6210 * must be sent back to this module through the @ref Pa_forwardResult API.
6211 *
6212 * @param[in] iHandle The driver instance handle
6213 * @param[in] custIndex The level 3 (LUT1) custom index
6214 * @param[in] lutInst Specify which LUT1 (0-2) should be used. Set to pa_LUT_INST_NOT_SPECIFIED if not specified
6215 * @param[in] index Specify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
6216 * @param[in] match The byte values that describe the match entry
6217 * @param[in] prevLink An optional L2 or L3 handle that links to this lookup
6218 * @param[in] routeInfo Where to send a packet that matches
6219 * @param[in] nextRtFail Where to send a packet that matches here, but fails next parse level
6220 * @param[out] retHandle The returned L3 handle
6221 * @param[out] cmd Buffer where the command is created
6222 * @param[in] cmdSize On entry the size of the cmd buffer, on exit the size of the command
6223 * @param[in] reply Where the response to the PASS command is routed
6224 * @param[out] cmdDest Value (@ref cmdTxDest)
6225 * @retval Value (@ref ReturnValues)
6226 * @pre A driver instance must be created and tables initialized
6227 */
6228 paReturn_t Pa_addCustomLUT1 ( Pa_Handle iHandle,
6229 uint16_t custIndex,
6230 int lutInst,
6231 int index,
6232 uint8_t match[pa_NUM_BYTES_CUSTOM_LUT1],
6233 paHandleL2L3_t prevLink,
6234 paRouteInfo_t *routeInfo,
6235 paRouteInfo_t *nextRtFail,
6236 paHandleL2L3_t *retHandle,
6237 paCmd_t cmd,
6238 uint16_t *cmdSize,
6239 paCmdReply_t *reply,
6240 int *cmdDest );
6242 /**
6243 * @ingroup palld_api_functions
6244 * @brief Pa_setCustomLUT2 performs the global configuration for level 4 (LUT2) custom lookups
6245 *
6246 * @details This command is typically called once per system and is used to configure the
6247 * PA for performing network layer 4 (LUT2) custom lookups.
6248 * If handleLink is true then only 3 bytes and 3 offsets are available
6249 * for matching. The fourth one is used to store the previous match information.
6250 * In this case the first 3 values in the byteOffsets and byteMasks arrays are
6251 * valid.
6252 *
6253 * If setMask is non-zero, it will be ORed with the first byteMask and the match byte.
6254 * It is used to distinguish this custom LUT2 entry from other custom LUT2 and standard
6255 * LUT2 entries.
6256 *
6257 * On return the command buffer (cmd) contains a formatted command for the sub-system.
6258 * The destination for the command is provided in cmdDest. The module user must send the
6259 * formatted command to the sub-system. The sub-system will generate a reply and this reply
6260 * must be sent back to this module through the API @ref Pa_forwardResult.
6261 *
6262 * @param[in] iHandle Driver instance handle
6263 * @param[in] custIndex Level 4 (LUT2) custom index
6264 * @param[in] handleLink Set to TRUE to use one byte of the match to hold previous match info
6265 * @param[in] custHdrSize Size of fixed-length custom header in bytes, which is used to adjust
6266 * location of the next protocol header in case the packet needs to be
6267 * processed by another module such as SASS or host application. This
6268 * parameter should be set to zero for all other types of headers
6269 * @param[in] byteOffsets Array of offsets to the bytes to use in custom matching
6270 * @param[in] byteMasks Array of bits that are valid in the custom matching
6271 * @param[in] setMask Bits to be set at the first match byte
6272 * @param[out] cmd Buffer where the command is created
6273 * @param[in] cmdSize On entry the size of the cmd buffer, on exit the size of the command
6274 * @param[in] reply Where the response to the PASS command is routed
6275 * @param[out] cmdDest Value (@ref cmdTxDest)
6276 * @retval Value (@ref ReturnValues)
6277 * @pre A driver instance must be created and tables initialized
6278 *
6279 * @note There is up to @ref pa_MAX_CUSTOM_TYPES_LUT2 LUT2 custom types supported by PASS.
6280 */
6281 paReturn_t Pa_setCustomLUT2 ( Pa_Handle iHandle,
6282 uint16_t custIndex,
6283 uint16_t handleLink,
6284 uint16_t custHdrSize,
6285 uint16_t byteOffsets[pa_NUM_BYTES_CUSTOM_LUT2],
6286 uint8_t byteMasks[pa_NUM_BYTES_CUSTOM_LUT2],
6287 uint8_t setMask,
6288 paCmd_t cmd,
6289 uint16_t *cmdSize,
6290 paCmdReply_t *reply,
6291 int *cmdDest );
6293 /**
6294 * @ingroup palld_api_functions
6295 * @brief Pa_addCustomLUT2 adds a custom lookup to the LUT2 lookup tables
6296 *
6297 * @details This command is called to add a specific entry to the L4 (LUT2) lookup table. This
6298 * function is called once per desired custom LUT2 match criteria.
6299 * This API also initiates the atomic queue diversion operation, which means that the QMSS moves
6300 * the entries in the diverted queue to the destination queue, if the divertQ is specified and
6301 * fReplace flag is set. In this case, the PASS will complete the LUT2 update, wait for the queue
6302 * diversion to be complete and then resume processing incoming packets.
6303 *
6304 * On return the command buffer (cmd) contains a formatted command for the sub-system.
6305 * The destination for the command is provided in cmdDest. The module user must send the
6306 * formatted command to the sub-system. The sub-system will generate a reply and this reply
6307 * must be sent back to this module through the @ref Pa_forwardResult API.
6308 *
6309 * @param[in] iHandle The driver instance handle
6310 * @param[in] custIndex The level 4 (LUT2) custom index
6311 * @param[in] match The four match values, only 1st three valid if prevLink is non-NULL
6312 * @param[in] prevLink An optional L2 or L3 handle that links to this lookup
6313 * @param[in] divertQ The source queue for atomic queue diversion with LUT2 update
6314 * Set to pa_PARAMS_NOT_SPECIFIED if not specified
6315 * @param[in] fReplace Flag to indicate whether the entry exists
6316 * @param[in] routeInfo Where to send a packet that matches
6317 * @param[out] retHandle The returned L4 handle
6318 * @param[out] cmd The buffer where the command is created
6319 * @param[in] cmdSize On entry the size of the cmd buffer, on exit the size of the command
6320 * @param[in] reply Where the response to the PASS command is routed
6321 * @param[out] cmdDest Value (@ref cmdTxDest)
6322 * @retval Value (@ref ReturnValues)
6323 * @pre A driver instance must be created and tables initialized
6324 */
6325 paReturn_t Pa_addCustomLUT2 ( Pa_Handle iHandle,
6326 uint16_t custIndex,
6327 uint8_t match[pa_NUM_BYTES_CUSTOM_LUT2],
6328 paHandleL2L3_t prevLink,
6329 uint16_t fReplace,
6330 uint16_t divertQ,
6331 paRouteInfo_t *routeInfo,
6332 paHandleL4_t retHandle,
6333 paCmd_t cmd,
6334 uint16_t *cmdSize,
6335 paCmdReply_t *reply,
6336 int *cmdDest );
6338 /**
6339 * @ingroup palld_api_functions
6340 * @brief Pa_forwardResult examines the reply of the sub-system to a command
6341 *
6342 * @details This command is used to pass the sub-system generated replies to commands back to
6343 * this module. Functions @ref Pa_addMac, @ref Pa_addSrio, @ref Pa_addCustomLUT1 and
6344 * @ref Pa_addIp generate replies that must be
6345 * forwarded to this module, or else handle deletion and link are not possible. Other
6346 * commands generate replies that can be sent to this module which will return any
6347 * warnings detected in the sub-system.
6348 *
6349 * @param[in] iHandle The driver instance handle
6350 * @param[in] vresult The command reply packet from the sub-system
6351 * @param[out] retHandle Returns the handle associated with the command
6352 * @param[out] handleType Value @ref HandleTypes
6353 * @param[out] cmdDest Value (@ref cmdTxDest)
6354 * @retval Value (@ref ReturnValues)
6355 * @pre A driver instance must be created and tables initialized
6356 */
6357 paReturn_t Pa_forwardResult (Pa_Handle iHandle, void *vresult, paEntryHandle_t *retHandle, int *handleType, int *cmdDest);
6360 /**
6361 * @ingroup palld_api_functions
6362 * @brief Pa_configExceptionRoute configures the routing of packets based on a exception condition such as
6363 * MAC briadcast, multicast or error packet
6364 *
6365 * @details This function is used to configure the sub-system to route packets that satisfy an exception
6366 * rule or condition (see @ref ErouteTypes). For example,
6367 * - failure to table match
6368 * - parsing error i.e. the sub-system is not able to continuethe parse
6369 * - MAC broadcast packets
6370 * - IP multicast packets
6371 *
6372 * From one to @ref pa_EROUTE_MAX routes can be specified through a single call to this
6373 * function. Parameter nRoute is used to specify how many routes are contained in the
6374 * routeTypes and eRoutes arrays. A value of 0 nRoutes results in no action by the function.
6375 *
6376 * By default when each exception type is detected the packet is discarded silently. Once the
6377 * route is changed through a call to this function it remains in the new state until the
6378 * function is called again to explicitly change that route. The only way to revert back
6379 * to the default of silent discard is to call this function again.
6380 *
6381 * On return the command buffer (cmd) contains a formatted command for the sub-system.
6382 * The destination for the command is provided in cmdDest. The module user must send the
6383 * formatted command to the sub-system. The sub-system will generate a reply and this reply
6384 * must be sent back to this module through the API @ref Pa_forwardResult.
6385 *
6386 * @param[in] iHandle The driver instance handle
6387 * @param[in] nRoute The number of exception routes specified
6388 * @param[in] routeTypes Array of exception routing types (@ref ErouteTypes)
6389 * @param[in] eRoutes Array of exception packet routing configuration
6390 * @param[out] cmd Buffer where the sub-system command is created
6391 * @param[in] cmdSize The size of the passCmd buffer
6392 * @param[in] reply Where the response to the PASS command is routed
6393 * @param[out] cmdDest Value (@ref cmdTxDest)
6394 * @retval Value (@ref ReturnValues)
6395 * @pre A driver instance must be created and tables initialized
6396 */
6397 paReturn_t Pa_configExceptionRoute (Pa_Handle iHandle,
6398 int nRoute,
6399 int *routeTypes,
6400 paRouteInfo_t *eRoutes,
6401 paCmd_t cmd,
6402 uint16_t *cmdSize,
6403 paCmdReply_t *reply,
6404 int *cmdDest);
6406 /**
6407 * @ingroup palld_api_functions
6408 * @brief Pa_configExceptionRoute2 configures the routing of packets based on a exception condition such as
6409 * MAC briadcast, multicast or error packet
6410 *
6411 * @details Pa_configExceptionRoute2 is the next generation of API to replace @ref Pa_configExceptionRoute
6412 * eventually. This new API covers the entire functionality of Pa_configExceptionRoute and it is
6413 * designed to support more features with the more advanced routing information data structure
6414 * while maintain backward-compatibility over time.
6415 *
6416 * @param[in] iHandle The driver instance handle
6417 * @param[in] nRoute The number of exception routes specified
6418 * @param[in] routeTypes Array of exception routing types (@ref ErouteTypes)
6419 * @param[in] eRoutes Array of exception packet routing configuration
6420 * @param[out] cmd Buffer where the sub-system command is created
6421 * @param[in] cmdSize The size of the passCmd buffer
6422 * @param[in] reply Where the response to the PASS command is routed
6423 * @param[out] cmdDest Value (@ref cmdTxDest)
6424 * @retval Value (@ref ReturnValues)
6425 * @pre A driver instance must be created and tables initialized
6426 */
6427 paReturn_t Pa_configExceptionRoute2 (Pa_Handle iHandle,
6428 int nRoute,
6429 int *routeTypes,
6430 paRouteInfo2_t *eRoutes,
6431 paCmd_t cmd,
6432 uint16_t *cmdSize,
6433 paCmdReply_t *reply,
6434 int *cmdDest);
6436 /**
6437 * @ingroup palld_api_functions
6438 * @brief Pa_configCmdSet configures the command set which consists of a list of commands
6439 *
6440 * @details This function is used to configure the sub-system to format and store a list
6441 * of commands which are executed in order when a match occurs and the command set is
6442 * specified by the routing information.
6443 *
6444 * The command set is created and refered to based on the command set index.
6445 * Once the command set is created through a call to this function it remains effective
6446 * until the function is called again to explicitly overwrite its content. It is not
6447 * recommended to update a command set when it is still used by one or more packet
6448 * routes.
6449 * There are @ref pa_MAX_CMD_SETS of command sets supported by the sub-system
6450 *
6451 * The commands within the command set will be executed in order at PDSP4. The module user is
6452 * responsible for placing the commands in such ways that the packet offsets required by commands should
6453 * be in ascending order, otherwise, the unexecutable command will be ignored. The command set
6454 * should be terminated with a pa_CMD_NEXT_ROUTE or pa_CMD_MULTI_ROUTE command. If there is
6455 * no final route command specified, the PASS will use the default next route command. Please note
6456 * that all the commands following the pa_CMD_NEXT_ROUTE or pa_CMD_MULTI_ROUTE command will be ignored.
6457 *
6458 * This API supports the following commands (@ref paCmdCode)
6459 * @li pa_CMD_REMOVE_HEADER
6460 * @li pa_CMD_COPY_DATA_TO_PSINFO
6461 * @li pa_CMD_CRC_OP
6462 * @li pa_CMD_PATCH_DATA
6463 * @li pa_CMD_REMOVE_TAIL
6464 * @li pa_CMD_NEXT_ROUTE
6465 * @li pa_CMD_MULTI_ROUTE
6466 * @li pa_CMD_USR_STATS
6467 * @li pa_CMD_VERIFY_PKT_ERROR
6468 * @li pa_CMD_SPLIT
6469 *
6470 * On return the command buffer (cmd) contains a formatted command for the sub-system.
6471 * The destination for the command is provided in cmdDest. The module user must send the
6472 * formatted command to the sub-system. The sub-system will generate a reply and this reply
6473 * must be sent back to this module through the API @ref Pa_forwardResult.
6474 *
6475 * @param[in] iHandle The driver instance handle
6476 * @param[in] index The command set index
6477 * @param[in] nCmd The number of commands specified
6478 * @param[in] cmdInfo Array of command configuration information
6479 * @param[out] cmd Buffer where the sub-system command is created
6480 * @param[in] cmdSize The size of the passCmd buffer
6481 * @param[in] reply Where the response to the PASS command is routed
6482 * @param[out] cmdDest Value (@ref cmdTxDest)
6483 * @retval Value (@ref ReturnValues)
6484 * @pre A driver instance must be created and tables initialized
6485 */
6486 paReturn_t Pa_configCmdSet (Pa_Handle iHandle,
6487 uint16_t index,
6488 int nCmd,
6489 paCmdInfo_t *cmdInfo,
6490 paCmd_t cmd,
6491 uint16_t *cmdSize,
6492 paCmdReply_t *reply,
6493 int *cmdDest);
6495 /**
6496 * @ingroup palld_api_functions
6497 * @brief Pa_configMultiRouteSet configures the multi-route group which consists of packet multi-route
6498 * entries
6499 *
6500 * @details This function is used to configure the sub-system to format and store a multi-
6501 * route set which contains routing information for up to @ref pa_MAX_MULTI_ROUTE_ENTRIES
6502 * destinations.
6503 *
6504 * The multi-route group is created and refered to based on the multi-route index.
6505 * Once the multi-route group is created through a call to this function it remains effective
6506 * until the function is called again to explicitly overwrite its content. It is not
6507 * recommended to update a mult-route group when it is still used by one or more packet
6508 * routes.
6509 *
6510 * There are @ref pa_MAX_MULTI_ROUTE_SETS of multi-route sets supported by the sub-system
6511 *
6512 * On return the command buffer (cmd) contains a formatted command for the sub-system.
6513 * The destination for the command is provided in cmdDest. The module user must send the
6514 * formatted command to the sub-system. The sub-system will generate a reply and this reply
6515 * must be sent back to this module through the API @ref Pa_forwardResult.
6516 *
6517 * @param[in] iHandle The driver instance handle
6518 * @param[in] mode The operation mode (CONFIG or RESET) refer to @ref paMultiRouteModes_e
6519 * @param[in] index The multi-route index
6520 * @param[in] nRoute The number of routing entries specified
6521 * @param[in] routeEntry Array of routing configuration information
6522 * @param[out] cmd Buffer where the sub-system command is created
6523 * @param[in] cmdSize The size of the passCmd buffer
6524 * @param[in] reply Where the response to the PASS command is routed
6525 * @param[out] cmdDest Value (@ref cmdTxDest)
6526 * @retval Value (@ref ReturnValues)
6527 * @pre A driver instance must be created and tables initialized
6528 */
6529 paReturn_t Pa_configMultiRoute (Pa_Handle iHandle,
6530 paMultiRouteModes_e mode,
6531 uint16_t index,
6532 uint16_t nRoute,
6533 paMultiRouteEntry_t *routeEntry,
6534 paCmd_t cmd,
6535 uint16_t *cmdSize,
6536 paCmdReply_t *reply,
6537 int *cmdDest);
6539 /**
6540 * @ingroup palld_api_functions
6541 * @brief Pa_configCrcEngine configures the specified CRC engine
6542 *
6543 * @details This function is used to configure the specified CRC engine by formating the
6544 * CRC configuration command packet.
6545 *
6546 * There are multiple CRC engines in the PA sun-system. Each CRC engine is connected to its
6547 * corresponding PDSP and its location is defined at @ref paCrcInst. It performs CRC operation
6548 * required by the some network protocol such as SCTP and/or the user-specified CRC command
6549 * for its corresponding PDSP. The CRC engine is referred by the CRC instance number.
6550 *
6551 * On return the command buffer (cmd) contains a formatted command for the sub-system.
6552 * The destination for the command is provided in cmdDest. The module user must send the
6553 * formatted command to the sub-system. The sub-system will generate a reply and this reply
6554 * must be sent back to this module through the @ref Pa_forwardResult API.
6555 *
6556 * @note Each CRC engine only supports one type of CRC per configuration.
6557 * It is up to the module user to configure and use the CRC engine by calling this function
6558 * for the specific use cases. For example, the CRC engine (pa_CRC_INST_4_0), which resides
6559 * between Ingress4 CDE0 and CED1, should be configured to perform CRC-32c checksum for
6560 * SCTP over inner-IP use case.
6561 *
6562 * @param[in] iHandle The driver instance handle
6563 * @param[in] index The CRC engine index
6564 * @param[in] cfgInfo The CRC engine configuration information
6565 * @param[out] cmd Buffer where the sub-system command is created
6566 * @param[in] cmdSize The size of the passCmd buffer
6567 * @param[in] reply Where the response to the PASS command is routed
6568 * @param[out] cmdDest Value (@ref cmdTxDest)
6569 * @retval Value (@ref ReturnValues)
6570 * @pre A driver instance must be created and tables initialized
6571 */
6572 paReturn_t Pa_configCrcEngine (Pa_Handle iHandle,
6573 uint16_t index,
6574 paCrcConfig_t *cfgInfo,
6575 paCmd_t cmd,
6576 uint16_t *cmdSize,
6577 paCmdReply_t *reply,
6578 int *cmdDest);
6580 /**
6581 * @ingroup palld_api_functions
6582 * @brief Pa_configUsrStats configures the user-defined statistics operation
6583 *
6584 * @details This function performs the counter configuration for the multi-level hierarchical user-defined
6585 * statistics. Each counter can be linked to the next level counter. All counters in its linking
6586 * chain will be incremented when the lowest level counter is updated. The module user can specify
6587 * the type of each counter and how the counter is linked to the next level counter.
6588 * It is not recommended to re-configure the user-defined statistics when one or more counters are
6589 * still used by PASS. The command reply routing is optional because this command is always
6590 * processed by the PA sub-system.
6591 *
6592 * On return the command buffer (cmd) contains a formatted command for the sub-system.
6593 * The destination for the command is provided in cmdDest. The module user must send the
6594 * formatted command to the sub-system. The sub-system will generate a reply and this reply
6595 * must be sent back to this module through the @ref Pa_forwardResult API.
6596 *
6597 * @param[in] iHandle The driver instance handle
6598 * @param[in] cfgInfo The user-defined statistics configuration information
6599 * @param[out] cmd Buffer where the sub-system command is created
6600 * @param[in] cmdSize The size of the passCmd buffer
6601 * @param[in] reply Where the response to the PASS command is routed
6602 * @param[out] cmdDest Value (@ref cmdTxDest)
6603 * @retval Value (@ref ReturnValues)
6604 * @pre A driver instance must be created and tables initialized
6605 */
6606 paReturn_t Pa_configUsrStats (Pa_Handle iHandle,
6607 paUsrStatsConfigInfo_t *cfgInfo,
6608 paCmd_t cmd,
6609 uint16_t *cmdSize,
6610 paCmdReply_t *reply,
6611 int *cmdDest);
6612 /**
6613 * @ingroup palld_api_functions
6614 * @brief Pa_configTimestamp configures the PA timer which is used to generate 48-bit timestamp
6615 *
6616 * @details This function is used to configure the 16-bit timer reserved for the 48-bit system
6617 * timestamp. The lower 32-bit of the system timestamp will be inserted into the timestamp
6618 * field in the packet descriptor for all input packets. It can be also inserted into
6619 * the timestamp report packets triggered by the egress packets per tx command.
6620 * The 16-bit timer connected to Ingress0 PDSP0 is reserved for timestamp generation.
6621 *
6622 * @param[in] iHandle The driver instance handle
6623 * @param[in] cfgInfo The timestamp configuration information
6624 * @retval Value (@ref ReturnValues)
6625 * @pre A driver instance must be created and tables initialized
6626 *
6627 */
6628 paReturn_t Pa_configTimestamp (Pa_Handle iHandle,
6629 paTimestampConfig_t *cfgInfo);
6631 /**
6632 * @ingroup palld_api_functions
6633 * @brief Pa_getTimestamp returns the 48-bit system timestamp
6634 *
6635 * @details This function is called to retrieve the current value of 48-bit PASS system timestamp.
6636 *
6637 * @param[in] iHandle The driver instance handle
6638 * @param[out] pTimestamp Pointer to the 48-bit timestamp
6639 * @retval Value (@ref ReturnValues)
6640 * @pre A driver instance must be created and tables initialized
6641 *
6642 */
6643 paReturn_t Pa_getTimestamp (Pa_Handle iHandle,
6644 paTimestamp_t *pTimestamp);
6647 /**
6648 * @ingroup palld_api_functions
6649 * @brief Pa_requestStats requests sub-system statistics (PASS Gen1 only)
6650 *
6651 * @details This function is used to request the operating statistics from the sub-system.
6652 * The statistics can be optionally cleared after reading through the doClear parameter.
6653 * The statistics apply to the entire sub-system, and are not core dependent on multi-core
6654 * devices.
6655 *
6656 * On return the command buffer (cmd) contains a formatted command for the sub-system.
6657 * The destination for the command is provided in cmdDest. The module user must send the
6658 * formatted command to the sub-system. The sub-system will generate a reply and this reply
6659 * must be sent back to this module through the API @ref Pa_formatStatsReply.
6660 *
6661 * @param[in] iHandle The driver instance handle
6662 * @param[in] doClear If TRUE then stats are cleared after being read
6663 * @param[out] cmd Buffer where the sub-system command is created
6664 * @param[in] cmdSize The size of the cmd buffer
6665 * @param[in] reply Where the response of the PASS command is routed
6666 * @param[out] cmdDest Value (@ref cmdTxDest)
6667 * @retval Value (@ref ReturnValues)
6668 * @pre A driver instance must be created and tables initialized
6669 *
6670 * @note: This API is not supported at the second generation PASS
6671 */
6672 paReturn_t Pa_requestStats (Pa_Handle iHandle,
6673 uint16_t doClear,
6674 paCmd_t cmd,
6675 uint16_t *cmdSize,
6676 paCmdReply_t *reply,
6677 int *cmdDest);
6679 /**
6680 * @ingroup palld_api_functions
6681 * @brief Pa_querySysStats requests sub-system statistics (PASS Gen2)
6682 *
6683 * @details This function is used to query the operating statistics from the sub-system.
6684 * The statistics can be optionally cleared after reading through the doClear parameter.
6685 * The statistics apply to the entire sub-system, and are not core dependent on multi-core
6686 * devices.
6687 *
6688 * @param[in] iHandle The driver instance handle
6689 * @param[in] doClear If TRUE then stats are cleared after being read
6690 * @param[out] pSysStats Pointer to the sysStats buffer
6691 * @retval Value (@ref ReturnValues)
6692 * @pre A driver instance must be created and tables initialized
6693 *
6694 * @note: This API is not supported at the first generation PASS
6695 */
6696 paReturn_t Pa_querySysStats (Pa_Handle iHandle,
6697 uint16_t doClear,
6698 paSysStats_t *pSysStats);
6700 /**
6701 * @ingroup palld_api_functions
6702 * @brief Pa_getDbgpInfo provides the snap shot of internal information for debug purpose only
6703 *
6704 * @details This function is used to get the debug information from the sub-system
6705 *
6706 * @param[in] iHandle The driver instance handle
6707 * @param[out] dbgInfo Pointer to the debug info buffer
6708 * @retval Value (@ref ReturnValues)
6709 * @pre A driver instance must be created and tables initialized
6710 *
6711 * @note: This API provides the snap shot information only, the actual values may differ
6712 * after the snap shot
6713 */
6714 paReturn_t Pa_getDbgpInfo(Pa_Handle iHandle, paSnapShotDebugInfo_t *dbgInfo);
6716 /**
6717 * @ingroup palld_api_functions
6718 * @brief Pa_formatStatsReply formats the stats reply from the PA (PASS Gen1 only)
6719 *
6720 * @details This function is used to convert the stats from the sub-system into a format
6721 * useful for the application
6722 *
6723 * @param[in] handle The driver instance handle
6724 * @param[in] cmd The buffer returned with the request stats response from PA
6725 * @retval A pointer to the formatted stats
6726 * @pre A call to @ref Pa_requestStats with output sent to PA and a
6727 * reply generated from PA.
6728 *
6729 * @note: This API is not supported at the second generation PASS
6730 *
6731 */
6732 paSysStats_t* Pa_formatStatsReply (Pa_Handle handle,
6733 paCmd_t cmd);
6735 /**
6736 * @ingroup palld_api_functions
6737 * @brief Pa_requestUsrStats requests user-defined statistics
6738 *
6739 * @details This function is used to request the user-defined statistics from the sub-system.
6740 * If the buffer pointer (pUsrStats) is provided, the statistics will be formatted and
6741 * copied to the buffer. However, the statistics will not be autonomous because some
6742 * related statistics may be updated by the PASS while LLD is reading other statistics.
6743 * To request autonomous statistics query, set the buffer pointer (pUsrStats) to NULL and
6744 * LLD will generate the statistics request command packet to be delivered to PASS regardless
6745 * of doClear setting.
6746 *
6747 * The sub-system statistics can be optionally cleared after query if doClear is set whether
6748 * or not the buffer pointer is provided.
6749 * The command buffer (cmd) contains a formatted command for the sub-system.
6750 * The destination for the command is provided in cmdDest. The module user must send the
6751 * formatted command to the sub-system.
6752 *
6753 * @param[in] iHandle The driver instance handle
6754 * @param[in] doClear If TRUE then stats are cleared after being read
6755 * @param[out] cmd Buffer where the sub-system command is created
6756 * @param[in] cmdSize The size of the cmd buffer
6757 * @param[in] reply Where the response of the PASS command is routed
6758 * @param[out] cmdDest Value (@ref cmdTxDest)
6759 * @param[out] pUsrStats Pointer to the usrStats buffer
6760 * @retval Value (@ref ReturnValues)
6761 * @pre A driver instance must be created and tables initialized
6762 *
6763 * @note This API may be depreciated in the future releases since it can be replaced by API @ref
6764 * Pa_requestUsrStatsList
6765 */
6766 paReturn_t Pa_requestUsrStats (Pa_Handle iHandle,
6767 uint16_t doClear,
6768 paCmd_t cmd,
6769 uint16_t *cmdSize,
6770 paCmdReply_t *reply,
6771 int *cmdDest,
6772 paUsrStats_t *pUsrStats);
6774 /**
6775 * @ingroup salld_api_constants
6776 * @{
6777 * @brief Indicate that the complete set of user-defined statistics should be leared
6778 */
6779 #define pa_USR_STATS_CLEAR_ALL 0 /**< This constant indicates that all user-defined statistics should be cleared */
6781 /**
6782 * @ingroup palld_api_functions
6783 * @brief Pa_requestUsrStatsList is an advanced version of API @ref Pa_requestUsrStats. It requests user-defined
6784 * statistics with option to clear entire or a subset of statistics.
6785 *
6786 * @details This function is used to request the user-defined statistics from the sub-system
6787 * with option to clear entire or a subset of statistics specified by the list of
6788 * counters.
6789 * If the buffer pointer (pUsrStats) is provided, the statistics will be formatted and
6790 * copied to the buffer. However, the statistics will not be autonomous because some
6791 * related statistics may be updated by the PASS while LLD is reading other statistics.
6792 * To request autonomous statistics query, set the buffer pointer (pUsrStats) to NULL and
6793 * LLD will generate the statistics request command packet to be delivered to PASS regardless
6794 * of doClear setting.
6795 *
6796 * The sub-system statistics can be optionally cleared after query if doClear is set. In
6797 * this case the formatted command packet will include the list of counters to be cleared.
6798 * The command buffer (cmd) contains a formatted command for the sub-system.
6799 * The destination for the command is provided in cmdDest. The module user must send the
6800 * formatted command to the sub-system.
6801 *
6802 * @note: This function always returns the entire user-defined statistics and it is up to the caller to pick
6803 * up the interesting ones.
6804 *
6805 * @param[in] iHandle The driver instance handle
6806 * @param[in] doClear If TRUE then stats are cleared after being read
6807 * @param[in] nCnt The number of counters to be cleared
6808 * @param[in] cntIndex Array of counter indexes to be cleared
6809 * @param[out] cmd Buffer where the sub-system command is created
6810 * @param[in] cmdSize The size of the cmd buffer
6811 * @param[in] reply Where the response of the PASS command is routed
6812 * @param[out] cmdDest Value (@ref cmdTxDest)
6813 * @param[out] pUsrStats Pointer to the usrStats buffer
6814 * @retval Value (@ref ReturnValues)
6815 * @pre A driver instance must be created and tables initialized
6816 */
6817 paReturn_t Pa_requestUsrStatsList (Pa_Handle iHandle,
6818 uint16_t doClear,
6819 uint16_t nCnt,
6820 uint16_t *cntIndex,
6821 paCmd_t cmd,
6822 uint16_t *cmdSize,
6823 paCmdReply_t *reply,
6824 int *cmdDest,
6825 paUsrStats_t *pUsrStats);
6827 /**
6828 * @ingroup palld_api_functions
6829 * @brief Pa_formatUsrStatsReply formats the user-defined statistics reply from the PASS
6830 *
6831 * @details This function is used to convert the stats from the sub-system into a format
6832 * useful for the application
6833 *
6834 * @param[in] handle The driver instance handle
6835 * @param[in] cmd The buffer returned with the request stats response from PA
6836 * @param[out] pUsrStats Pointer to the usrStats buffer
6837 * @retval Value (@ref ReturnValues)
6838 * @pre A call to @ref Pa_requestUsrStats or Pa_requestUsrStatsList with
6839 * buffer pointer pUsrStats set to NULL and output sent to PA and a
6840 * reply generated from PA.
6841 */
6842 paReturn_t Pa_formatUsrStatsReply (Pa_Handle handle,
6843 paCmd_t cmd,
6844 paUsrStats_t *pUsrStats);
6846 /**
6847 * @ingroup palld_api_functions
6848 * @brief Pa_queryRaStats queries RA statistics (PASS Gen2 only)
6849 *
6850 * @details This function is used to query the RA statistics from the sub-system.
6851 * The statistics will be formatted and copied to the buffer provided.
6852 * The sub-system statistics can be then optionally cleared if doClear is set.
6853 *
6854 * @param[in] iHandle The driver instance handle
6855 * @param[in] doClear If TRUE then stats are cleared after being read
6856 * @param[out] pRaStats Pointer to the raStats buffer
6857 * @retval Value (@ref ReturnValues)
6858 * @pre A driver instance must be created and tables initialized
6859 *
6860 * @note: This API is not supported at the first generation PASS
6861 */
6862 paReturn_t Pa_queryRaStats (Pa_Handle iHandle,
6863 uint16_t doClear,
6864 paRaStats_t *pRaStats);
6866 /**
6867 * @ingroup palld_api_functions
6868 * @brief Pa_queryAclStats queries ACL per-entry statistics (PASS Gen2 only)
6869 *
6870 * @details This function is used to query the ACL per-entry statistics.
6871 * The statistics can be optionally cleared after reading through the doClear parameter.
6872 *
6873 * @param[in] iHandle The driver instance handle
6874 * @param[in] aclHandle The ACL handle
6875 * @param[in] doClear If TRUE then stats are cleared after being read
6876 * @param[out] pAclStats Pointer to the aclStats buffer
6877 * @retval Value (@ref ReturnValues)
6878 * @pre A driver instance must be created and tables initialized
6879 *
6880 * @note: This API is not supported at the first generation PASS
6881 */
6882 paReturn_t Pa_queryAclStats (Pa_Handle iHandle,
6883 paHandleAcl_t aclHandle,
6884 uint16_t doClear,
6885 paAclStats_t *pAclStats);
6887 /**
6888 * @ingroup palld_api_functions
6889 * @brief Pa_formatTxRoute formats the commands to add checksums and route a Tx packet
6890 *
6891 * @details This function is used to create the command block which is used by the packet accelerator
6892 * sub-system to forward the packet with optional checksum generation.
6893 * The module user can combine this block with other command blocks that control the security
6894 * accelerator. The combined block is then provided for the transmitted packets in the Protocol
6895 * specific section of the packet descriptor. This API needs only to be called once, and the same
6896 * protocol specific section can be used for every packet in the channel. If the length of the
6897 * checksum area changes with each packet, update the command buffer with the macro
6898 * PASS_SET_TX_CHKSUM_LENGTH()
6899 *
6900 * @note The Tx commands can be executed at either PDSP4 or PDSP5. However, it is highly
6901 * recommended to use PDSP5 for load balance since PDSP4 will be used to execute
6902 * multi-routing and from-network command set.
6903 *
6904 * @param[in] chk0 Checksum 0 configuration. NULL if no checksum computation required
6905 * @param[in] chk1 Checksum 1 configuration. NULL if no checksum computation required
6906 * @param[in] route Next packet routing from sub-system
6907 * @param[out] cmdBuffer The routing command is formed in this buffer
6908 * @param[in] cmdSize On entry the size of cmdBuffer. On exit the size of the command
6909 * @retval Value (@ref ReturnValues)
6910 */
6911 paReturn_t Pa_formatTxRoute (paTxChksum_t *chk0,
6912 paTxChksum_t *chk1,
6913 paRouteInfo_t *route,
6914 void *cmdBuffer,
6915 uint16_t *cmdSize );
6917 /**
6918 * @ingroup palld_api_functions
6919 * @brief Pa_formatRoutePatch formats the commands to route a packet and blind patch
6920 *
6921 * @details This function is used to create the command block which is used by the packet accelerator
6922 * sub-system to perform blind patches on the packet. This function user optionally combines
6923 * the generated block with other blocks to create compound commands. The command blocks are
6924 * attached to data packets in the Protocol specific section of the packet descriptor.
6925 *
6926 * @note The Tx commands can be executed at either PDSP4 or PDSP5. However, it is highly
6927 * recommended to use PDSP5 for load balance since PDSP4 will be used to execute
6928 * multi-routing and from-network command set.
6929 *
6930 * @param[in] route Specifies where the packet is sent after the patch is complete
6931 * @param[in] patch The patch information
6932 * @param[out] cmdBuffer The routing command is formed in this buffer
6933 * @param[in] cmdSize On entry this size of cmdBuffer. On exit the amound of cmdBuffer used
6934 * @retval Value (@ref ReturnValues)
6935 */
6937 paReturn_t Pa_formatRoutePatch (paRouteInfo_t *route,
6938 paPatchInfo_t *patch,
6939 void *cmdBuffer,
6940 uint16_t *cmdSize);
6942 /**
6943 * @ingroup palld_api_functions
6944 * @brief Pa_formatTxCmd formats a list of commands to be executed on the packets to be transmitted
6945 * over the network
6946 *
6947 * @details This function is used to create, append and update the list of commands which will be
6948 * executed by the packet accelerator and security accelerator sub-systems to perform a sequence
6949 * of actions on the packet. The command block should be attached to data packets in the
6950 * protocol specific section of the packet descriptor.
6951 *
6952 * This API may be called multiple times to add or update the command block.
6953 * The same protocol specific section can be used for every packet in the channel after the
6954 * command list is constructed. Multiple MACROs may be used to update some parameters
6955 * such as packet length in the command buffer for each packet.
6956 *
6957 * This API supports the following commands (@ref paCmdCode):
6958 * @li pa_CMD_NEXT_ROUTE
6959 * @li pa_CMD_CRC_OP
6960 * @li pa_CMD_PATCH_DATA
6961 * @li pa_CMD_TX_CHECKSUM
6962 * @li pa_CMD_REPORT_TX_TIMESTAMP
6963 * @li pa_CMD_SA_PAYLOAD
6964 * @li pa_CMD_IP_FRAGMENT
6965 * @li pa_CMD_PATCH_MSG_LEN
6966 *
6967 * @note The Tx commands can be executed at either PDSP4 or PDSP5. However, it is highly
6968 * recommended to use PDSP5 for load balance since PDSP4 will be used to execute
6969 * multi-routing and from-network command set.
6970 *
6971 * @param[in] nCmd The number of commands specified
6972 * @param[in] cmdInfo Array of command configuration information
6973 * @param[in] offset The command buffer location where the new commands are inserted
6974 * @param[out] cmdBuffer Buffer where the sub-system command is created
6975 * @param[in] cmdSize On entry this size of cmdBuffer. On exit the amound of cmdBuffer used
6976 * @retval Value (@ref ReturnValues)
6977 *
6978 * @note The command buffer should be 4-byte aligned
6979 */
6981 paReturn_t Pa_formatTxCmd (int nCmd,
6982 paCmdInfo_t *cmdInfo,
6983 uint16_t offset,
6984 void *cmdBuffer,
6985 uint16_t *cmdSize);
6987 /**
6988 * @ingroup palld_api_functions
6989 * @brief Pa_resetControl controls the reset state of the Sub-system
6990 *
6991 * @details This function is used to assert or release reset for the sub-system. Asserting reset does not
6992 * reset any of the sub-system tables (L2, L3 or L4, see @ref netlayers), but only the packet
6993 * processing modules. To achieve a complete system reset the system level reset must be asserted
6994 * through the power controller.
6995 *
6996 * @param[in] iHandle The driver instance handle
6997 * @param[in] newState Value @ref paSubSysStates
6998 * @retval Value @ref paSubSysStates
6999 * @pre None
7000 *
7001 * @note This function will access the PA sub-system registers. It is up to the module user to provide critical
7002 * section protection so that only one core or task should use this function at a time.
7003 */
7004 paSSstate_t Pa_resetControl (Pa_Handle iHandle, paSSstate_t newState);
7007 /**
7008 * @ingroup palld_api_functions
7009 * @brief Pa_downloadImage downloads a PDSP image to a sub-system with the packet processing modules in reset.
7010 *
7011 * @details This function is used to download an executable PDSP image to the specific packet processing module.
7012 * See section table @ref appendix1 for a description of PDSP images provided by this module
7013 *
7014 * @param[in] iHandle The driver instance handle
7015 * @param[in] modId The PDSP number (0-5)
7016 * @param[in] image The image to download
7017 * @param[in] sizeBytes The size of the image
7018 * @retval Value (@ref ReturnValues)
7019 * @pre The packet processing modules must be in reset. See @ref Pa_resetControl.
7020 *
7021 * @note This function will access the PA sub-system registers. It is up to the module user to provide critical
7022 * section protection so that only one core or task should use this function at a time.
7023 */
7024 paReturn_t Pa_downloadImage (Pa_Handle iHandle, int modId, void* image, int sizeBytes);
7026 /**
7027 * @ingroup palld_api_functions
7028 * @brief Pa_getHandleRefCount returns the number of reference channels linked to the LUT1 handle
7029 *
7030 * @details The LLD maintains the reference counter for LUT1 handles: MAC/IP. Given a handle,
7031 * the LLD would return how many references are being used in next header entry by invoking
7032 * the function. For example, Query on MAC handle need to return how many IP handles are
7033 * referencing the MAC handles. Query on IP handle need to return how many next protocol
7034 * entries: IP/UDP are referencing to the IP handle.
7035 * Therefore this function can be used to verify whether the LUT1 entry associated with
7036 * the handle can be reomved.
7037 *
7038 * @param[in] iHandle The driver instance handle
7039 * @param[in] l2l3handle The L2 or L3 handle to be queryed
7040 * @param[out] refCount The number of reference channels
7041 * @retval Value (@ref ReturnValues)
7042 */
7043 paReturn_t Pa_getHandleRefCount ( Pa_Handle iHandle,
7044 paHandleL2L3_t l2l3handle,
7045 uint16_t *refCount );
7047 /**
7048 * @ingroup palld_api_functions
7049 * @brief Pa_getPDSPVersion returns the PA PDSP version information.
7050 *
7051 * @details This function is used to get the PA PDSP version information in 0xAABBCCDD format.
7052 * where Arch (AA); API Changes (BB); Major (CC); Minor (DD
7053 *
7054 * @param[in] iHandle The driver instance handle
7055 * @param[in] modId The PDSP number (0-5)
7056 * @param[out] pVersion The pointer to PDSP version number
7057 * @retval Value (@ref ReturnValues)
7058 * @pre The PDSP image should be downloaded successfully.
7059 *
7060 */
7061 paReturn_t Pa_getPDSPVersion (Pa_Handle iHandle, int modId, uint32_t *pVersion);
7064 /**
7065 * @ingroup palld_api_functions
7066 * @brief Pa_getVersion returns the PA LLD version information
7067 *
7068 * @details This function is used to get the version information of the PA LLD in 0xAABBCCDD format.
7069 * where Arch (AA); API Changes (BB); Major (CC); Minor (DD)
7070 *
7071 * @retval 32-bit version information
7072 */
7073 uint32_t Pa_getVersion (void);
7076 /**
7077 * @ingroup palld_api_functions
7078 * @brief Pa_getVersionStr returns the PA LLD version string
7079 *
7080 * @details This function is used to get the version string of the PA LLD.
7081 *
7082 * @retval Version string
7083 */
7084 const char* Pa_getVersionStr (void);
7086 /**
7087 * @ingroup palld_api_macros
7088 * @brief pa_RESET_SUBSYSTEM is used to reset the Sub-system
7089 *
7090 * @details This macro is used to put the packet processing sub-system into reset. It performs the same function
7091 * as @ref Pa_resetControl, but in macro form. The module user must define the macro SYSTEM_WRITE32.
7092 *
7093 * @pre The module user must define a macro called SYSTEM_WRITE32(address, value) which writes a 32 bit
7094 * value (value) to global address (address).
7095 *
7096 */
7097 #define pa_RESET_SUBSYSTEM() \
7098 { \
7099 CSL_Pa_ssRegs *passRegs = (CSL_Pa_ssRegs *)CSL_NETCP_CFG_REGS; \
7100 \
7101 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[0].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_SOFT_RST_N_MASK)); \
7102 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[1].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_SOFT_RST_N_MASK)); \
7103 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[2].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_SOFT_RST_N_MASK)); \
7104 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[3].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_SOFT_RST_N_MASK)); \
7105 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[4].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_SOFT_RST_N_MASK)); \
7106 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[5].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_SOFT_RST_N_MASK)); \
7107 SYSTEM_WRITE32(&(passRegs->PKT_ID.PKT_ID_SOFT_RESET, 1); \
7108 SYSTEM_WRITE32(&(passRegs->STATS.STATS_SOFT_RESET, 1); \
7109 SYSTEM_WRITE32(&(passRegs->PDSP_TIMER[0].TIMER_CNTRL_REG, 0); \
7110 SYSTEM_WRITE32(&(passRegs->PDSP_TIMER[1].TIMER_CNTRL_REG, 0); \
7111 SYSTEM_WRITE32(&(passRegs->PDSP_TIMER[2].TIMER_CNTRL_REG, 0); \
7112 SYSTEM_WRITE32(&(passRegs->PDSP_TIMER[3].TIMER_CNTRL_REG, 0); \
7113 SYSTEM_WRITE32(&(passRegs->PDSP_TIMER[4].TIMER_CNTRL_REG, 0); \
7114 SYSTEM_WRITE32(&(passRegs->PDSP_TIMER[5].TIMER_CNTRL_REG, 0); \
7115 }
7117 /**
7118 * @ingroup palld_api_macros
7119 * @brief pa_ENABLE_SUBSYSTEM enables the subsystem.
7120 *
7121 * @details This macro is used to release reset from the packet processing sub-system. It performs the same
7122 * function as @ref Pa_resetControl, but in macro from. The module user must define the macro SYSTEM_WRITE32
7123 * and SYSTEM_READ32.
7124 *
7125 * @pre The module user must define the macro SYSTEM_WRITE32(address, value) and SYSTEM_READ32 (address) which
7126 * read and write to global address (address).
7127 */
7128 #define pa_ENABLE_SUBSYSTEM() \
7129 { \
7130 CSL_Pa_ssRegs *passRegs = (CSL_Pa_ssRegs *)CSL_NETCP_CFG_REGS; \
7131 \
7132 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[0].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK)); \
7133 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[1].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK)); \
7134 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[2].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK)); \
7135 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[3].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK)); \
7136 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[4].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK)); \
7137 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[5].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK)); \
7138 while (SYSTEM_READ32(&(passRegs->MAILBOX[0].MBOX_SLOT[0])) == 0); \
7139 while (SYSTEM_READ32(&(passRegs->MAILBOX[1].MBOX_SLOT[0])) == 0); \
7140 while (SYSTEM_READ32(&(passRegs->MAILBOX[2].MBOX_SLOT[0])) == 0); \
7141 while (SYSTEM_READ32(&(passRegs->MAILBOX[3].MBOX_SLOT[0])) == 0); \
7142 while (SYSTEM_READ32(&(passRegs->MAILBOX[4].MBOX_SLOT[0])) == 0); \
7143 while (SYSTEM_READ32(&(passRegs->MAILBOX[5].MBOX_SLOT[0])) == 0); \
7144 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[1], 1); \
7145 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[0], 0); \
7146 while (SYSTEM_READ32(&(passRegs->MAILBOX[0].MBOX_SLOT[1])) == 1); \
7147 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[1], 0); \
7148 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[2], 0); \
7149 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[3], 0); \
7150 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[4], 0); \
7151 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[5], 0); \
7152 }
7155 /**
7156 * @ingroup palld_api_macros
7157 * @brief pa_DOWNLOAD_MODULE downloads an image
7158 *
7159 * @details This macro provides the same function as @ref Pa_downloadImage. A single image is downloaded to
7160 * one of the packet processing modules.
7161 *
7162 * @pre The module user must define macro SYSTEM_COPY(dest, src, sizeWords) which copies sizeWords from
7163 * address src to address dst. The packet processing module must have reset asserted.
7164 */
7165 #define pa_DOWNLOAD_MODULE(id,img,size) \
7166 { \
7167 CSL_Pa_ssRegs *passRegs = (CSL_Pa_ssRegs *)CSL_NETCP_CFG_REGS; \
7168 \
7169 SYSTEM_COPY(&(passRegs->PDSP_IRAM[id].PDSP_RAM[0]), img, size); \
7170 }
7172 /**
7173 * @ingroup palld_api_macros
7174 * @brief pa_GET_SYSETM_STATE returns the state of the subsystem
7175 *
7176 * @details This macro provides the same functionality as @ref Pa_resetControl and returns the
7177 * current state in the macro argument.
7178 */
7179 #define pa_GET_SYSTEM_STATE(x) \
7180 { int enable=0; int disable=0; \
7181 CSL_Pa_ssRegs *passRegs = (CSL_Pa_ssRegs *)CSL_NETCP_CFG_REGS; \
7182 if ( (SYSTEM_READ32(&(passRegs->PDSP_CTLSTAT[0].PDSP_CONTROL)) & CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) == \
7183 (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) ) \
7184 enable++; else disable++; \
7185 if ( (SYSTEM_READ32(&(passRegs->PDSP_CTLSTAT[1].PDSP_CONTROL)) & CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) == \
7186 (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) ) \
7187 enable++; else disable++; \
7188 if ( (SYSTEM_READ32(&(passRegs->PDSP_CTLSTAT[2].PDSP_CONTROL)) & CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) == \
7189 (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) ) \
7190 enable++; else disable++; \
7191 if ( (SYSTEM_READ32(&(passRegs->PDSP_CTLSTAT[3].PDSP_CONTROL)) & CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) == \
7192 (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) ) \
7193 enable++; else disable++; \
7194 if ( (SYSTEM_READ32(&(passRegs->PDSP_CTLSTAT[4].PDSP_CONTROL)) & CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) == \
7195 (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) ) \
7196 enable++; else disable++; \
7197 if ( (SYSTEM_READ32(&(passRegs->PDSP_CTLSTAT[5].PDSP_CONTROL)) & CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) == \
7198 (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) ) \
7199 enable++; else disable++; \
7200 if ( (enable > 0) && (disable > 0) ) (x) = pa_STATE_INCONSISTENT; \
7201 else if (enable > 0) (x) = pa_STATE_ENABLE; \
7202 else (x) = pa_STATE_RESET; \
7203 } (x) = (x)
7206 /**
7207 * @ingroup palld_api_macros
7208 * @brief pa_SET_TX_CHKSUM_LENGTH sets the tx checksum length in a tx route block
7209 *
7210 * @details This macro is used to modify the length of a checksum field in a command packet
7211 * created by a call to @ref Pa_formatTxRoute. In many cases packets in an outbound packet
7212 * stream will have the same source and destination information (see @ref netlayers) but
7213 * differ in the packet length. This macro will change the checksum calculation information
7214 * which is sent to the sub-system. The length fields in L2, L3 and L4 must be changed by
7215 * the module user before sending the packet, they are not changed by this macro. In the
7216 * case of IP L3 and TCP or UDP L4 the psuedo header checksum must also be changed
7217 * to reflect the change in packet length.
7218 */
7219 #define pa_SET_TX_CHKSUM_LENGTH(datap,cnum,len) \
7220 PASAHO_CHKCRC_SET_LEN ((&(((pasahoComChkCrc_t *)datap)[cnum])), len)
7222 /**
7223 * @ingroup palld_api_macros
7224 * @brief pa_SET_TX_INITVAL sets the initial value in a tx route block
7225 *
7226 * @details This macro is used to modify the initial value of a checksum field in a command packet
7227 * created by a call to @ref Pa_formatTxRoute. This macro is used when a single call
7228 * to @ref Pa_formatTxRoute is desired, The application typically follows this with an update
7229 * to the length fields in network headers, either directly or through a blind patch.
7230 * For updates with IPv4 or IPv6 the pseudo header checksum must be updated as well, and this
7231 * macro is used to update the value. Typically the pseudo header checksum will be computed
7232 * with all values except the length, and then updated for each packet with a single ones' complement add.
7233 */
7234 #define pa_SET_TX_CHKSUM_INITVAL(datap,cnum,val) \
7235 PASAHO_CHKCRC_SET_INITVAL ((&(((pasahoComChkCrc_t *)datap)[cnum])), val)
7237 /**
7238 * @page netlayers
7239 *
7240 * Network layers define a hierarchy of services delineated by functionality. Each layer can use the functionality
7241 * of the next layer below, and offers services to the next layer above. The packet accelerator sub-system examines
7242 * and routes packets based on fields in up to three layers of the Ethernet packets or L0-L2 header of the SRIO packets.
7243 *
7244 * In layer 2, the MAC (Media Access Control) layer,
7245 * the sub-system classifies IEEE 802.3 packets based on (optionally) the destination MAC, source MAC, Ethertype, and
7246 * VLAN tags.
7247 *
7248 * In Layer 3, the network layer, IPv4 (Internet Protocol Version 4) and IPv6 (Internet Protocol
7249 * Version 6) packets are routed based (optionally) on source IP address, destination IP address, IPv4 protocol,
7250 * IPv6 next header, IPv4 Type of Service (recently changed to IPv4 differentiated service in RFC 2474), IPv6
7251 * traffic class, and IPv6 flow label. For IP packets with security services the SPI (Security Parameters Index)
7252 * is also included in the classification information. For IP packets with SCTP (Stream Control Transmission Protocol)
7253 * the SCTP destination port is also included in the classification information.
7254 *
7255 * In layer 4, the transport layer, UDP (User Datagram Protocol) and TCP (Transmission Control Protocol) packets
7256 * are routed based on the destination port. However, the GTP-U (GPRS Tunnelling Protocol User Plane) over UDP packets
7257 * are routed based on its 32-bit TEID (Tunnel ID).
7258 *
7259 * For SRIO (Serial RapidIO), L0-L2 header information
7260 * the sub-system classifies SRIO packets based on (optional) the source ID, destination ID, transport type, priority,
7261 * message type, SRIO type 11 mailbox and letter, SRIO type 9 stream ID and class of service.
7262 *
7263 */
7266 /**
7267 * @page cache
7268 *
7269 * The packet accelerator low level driver module will make call backs to the module user when it
7270 * is about to read from one of the two tables provided by the module user. If the module user
7271 * is operating in a multi-core environment with a single set of tables shared by all the cores,
7272 * then this function is used to tell a local core that it must invalidate its cache, without writeback.
7273 * This is necessary if cross core cache coherency is not maintained by the hardware in the device.
7274 *
7275 * Without this it is possible for one core to be operating from a locally cached version of the
7276 * tables which does not reflect any additions or deletions done by other cores.
7277 *
7278 * An alternative is to place the tables into non-cached memory.
7279 *
7280 */
7282 /**
7283 * @page semaphores
7284 *
7285 * The packet accelerator low level driver module will make call backs to the module user when it
7286 * is about to modify from one of the two tables provided by the module user. If the module user
7287 * is operating in a multi-core environment with a single set of tables shared by all the cores,
7288 * then this function is used to tell the application to apply a cross core semaphore.
7289 *
7290 * When table modification is done the module will again make a call back to the module user
7291 * to inform it to release the semaphore.
7292 */
7295 /**
7296 * @page order
7297 *
7298 * The sub-system examines the L2 and L3 (LUT1) information (see @ref netlayers) in packets based on internal
7299 * table location. When function @ref Pa_addMac and @ref Pa_addIp are executed and the resulting packet
7300 * forwarded to the sub-system, the sub-system places the new entries at the highest free
7301 * table location. When incoming packets are examined, the table is searched from lowest entry location
7302 * to highest entry location until the first matching entry is found. That entry is used to route the
7303 * packet.
7304 *
7305 * Because of this it is required that entries into the table be made in order from the most general
7306 * to the most specific. For example, when adding a mac address it is common to want to route the following:
7307 * @li dest mac only - Forward packet to host
7308 * @li dest mac + ethertype - Continue parsing
7309 * @li dest mac + source mac + ethertype - Forward packet to host
7310 *
7311 * To get the desired routing the @ref Pa_addMac commands must be executed and the command packets forwarded
7312 * to the sub-system in the order shown above. If they are entered in the reverse order then every packet
7313 * which has the value dest MAC will be forwarded to the host since it matches the first entry in the list.
7314 *
7315 * The order dependency applies to calls to @ref Pa_addMac and @ref Pa_addIp, but not to calls between these functions.
7316 * So all MAC entries can be made followed by all IP entries, or in the reverse order (provided the IP entries
7317 * do not reference the MAC entries) without changing the operation of the sub-system.
7318 *
7319 */
7321 /**
7322 * @page appendix1 PDSP image
7323 *
7324 * The sub-sustem contains six PDSPs wihich perform the command and packet processing. There are three PDSP
7325 * images provided by the module under the pa/fw directory:
7326 * @li Packet Classifier 1 image: classify1_bin.c for PDSP0, PDSP1 and PDSP2
7327 * @li Packet Classifier 2 image: classify2_bin.c for PDSP3
7328 * @li Packet Modifier image: pam_bin.c for PDSP4 and PDSP5
7329 *
7330 * The PDSP executable images are provided to the module user as c-file contains the binary image. They should
7331 * be included by the application and loaded into the corresponding PASS PDSP by invoking the API
7332 * @ref Pa_downloadImage at system startup.
7333 *
7334 */
7337 /**
7338 * @page appendix2 CPPI Error Flags
7339 *
7340 * The sub-system performs IPv4 header checksum, UDP/TCP checksum and SCTP CRC-32c checksum autonomously.
7341 * The sub-system can also perform the CRC verification for incoming packet as one of the actions specified
7342 * by the post-classification command set.
7343 *
7344 * The checksum and CRC verification results are recorded at the 4-bit error flags in the CPPI packet descriptor
7345 * as described below:
7346 * @li bit 3: IPv4 header checksum error
7347 * @li bit 2: UDP/TCP or SCTP CRC-32c checksum error
7348 * @li bit 1: Custom CRC checksum error
7349 * @li bit 0: reserved
7350 *
7351 */
7353 /**
7354 * @page appendix3 PA-assisted IP Reassembly Operation
7355 *
7356 * The current version of PASS does not support IP reassembly, the IP fragments can be detected by PASS, forwarded to
7357 * and reassembled at host. The reassembled IP packet may be forwarded back to PASS for continuous classification.
7358 * The drawback of this approach is that the order of the incoming packets will not be maintained.
7359 *
7360 * To provide better support for IP reassembly, the PA-assisted IP Reassembly operation is introduced and summarized below:
7361 * @li Array of traffic flows which consist of source IP, destination IP, protocol and counter are maintained at PASS PDSP.
7362 * @li A traffic flow is activated by the PDSP when the first IP fragment with the source and destination IP and protocol is
7363 * detected and forwarded.
7364 * @li The traffic flow is freed when its packet count reaches 0
7365 * @li All packets belong to any active traffic flow will be forwarded to the host so the packet order will be maintained.
7366 * @li IP fragments should be forwarded to host with "not availeable" traffic flow id if no traffic flow is available.
7367 * In this case, the packet order is not guaranteed to be maintained.
7368 * @li PASS supports up to 32 active traffic flows for outer IP (PDSP1) and inner IP (PDSP2) respectively.
7369 * @li The PA-assisted IP Reassembly Operation will be enabled by invoking API @ref Pa_control with the IP reassembly
7370 * configuration @ref paIpReassmConfig_t.
7371 *
7372 * @note The minimum size packet wire rate throughput will not be guaranteed when this feature is enabled and there are active
7373 * traffic flows.
7374 *
7375 * The host IP reassembly module should interact with PASS and perform the full IP reassembly operation. The module user may choose
7376 * to implement a simplified version of IP reassembly algorithm to save CPU cycle in controlled IP environment. A sample reassembly
7377 * module is provided in the PA LLD release package, which demonstrates how to interact with the NetCP to perform the IP reassembly
7378 * operation.
7379 *
7380 * The sample code implements a simplified version of IP reassembly algorithm which supports non-overlapping segments only. The sample
7381 * code performs the following tasks:
7382 * @li Maintain the IP reassembly contexts consist of source IP, destination IP, IP identification, protocol, fragments count and the
7383 * corresponding traffic flow id.
7384 * @li Forward the non-fragmented IP packet with its flow id and count = 1 to PA PDSP queue. This avoids reordering the non-fragmented packets.
7385 * @li For IPSEC inner IP fragments, call SA LLD to perform the post-decryption operation including padding check and IPSEC header
7386 * and authentication tag removal.
7387 * @li Forward the reassembled IP packet with its flow id and fragments count to PA PDSP queue.
7388 * @li Send a null packet with its flow id and fragments count to PA PDSP queue if the fragments are discarded due to timeout or other error.
7389 *
7390 */
7392 /**
7393 * @page appendix5 Port Mirror and Packet Capture Operation
7394 *
7395 * The current version of CPSW within NetCP does not support port mirroring feature. The PA LLD and the PASS firmware have been
7396 * enhnaced to support EMAC port mirroring operation OR EMAC port packet capture feature.
7397 *
7398 * When Port Mirror configuration is enabled, some of the ethernet ports can be configured as mirror ports. Mirror port receives
7399 * and transmits ethernet traffic as normal and other non-mirror ports can be configured to have its traffic mirrored to any
7400 * mirror port. A port that has its traffic mirrored means that all traffic to and/or from this port can also be transmitted
7401 * (mirrored) to its mirror port. PA supports individual ingress and egress control of the EMAC port to be mirrored. The mirror port
7402 * itself can never be mirrored. It is the responsibility of the higher level software to take care of this condition to avoid
7403 * recursion and undesired effects. Packets are mirrored excatly as they are received/transmitted. No additional mac header or
7404 * equivalent is placed on these packets.
7405 *
7406 * In addition, PASS also supports the packet capture feature which is valid only if port mirroring is not in use and if it is enabled
7407 * on an interface. The feature works in a similar fashion to port mirroring except that the captured packet will be copied and sent to
7408 * a configured hardware queue instead of the mirror port.
7409 *
7410 * The host software should enable and configure either the port mirror or packet capture operation on that interface using @ref Pa_control API.
7411 * And global system configuration is required to enable those features system wide.
7412 *
7413 * @note The design assumes that the port mirroring feature is not required when the device is operating with the CPSW switch active
7414 * (i.e., ALE bypass disabled) or in a NETCP bridge or s/w bridge mode.
7415 */
7417 /**
7418 * @page appendix6 Ingress Default Route Operation
7419 * The feature allows the host to configure PASS to send all packets with broadcast bit set (bit 2 of 1st mac header byte) from ingress port X
7420 * to a corresponding route before or after the LUT look up. The ingress default route provides the route configurations for ingress broadcast(BC)
7421 * and multicast(MC) packets and the unicast packets that do not match L2 entries on an EMAC interface as described below.
7422 * - Route BC/MC traffics prior to LUT1 lookup if configured as pre-classification route
7423 * - Route unmatched BC/MC traffics from EMAC port X if configured as post-classification route
7424 * - Route unmatched unicast traffic from EMAC port X if configured
7425 * - This rule precedes the exception route rule.
7426 * - These features can be globally enabled or disabled using @ref paPacketControl2Config_t configuration along with per interface configurations.
7427 *
7428 * @note When this feature is enabled, the exception routes for multicast/broadcast/unicast packets will not be used..
7429 *
7430 */
7432 /**
7433 * @page appendix7 Enhanced QoS Mode Operation
7434 * Enhanced QoS mode is an advanced priority-based routing algorithm where VLAN P-bit, IP DSCP or the EMAC port-based default priority
7435 * is used to determine the destination QoS queue and CPPI flow. This routing algorithm is required to support egress L2 shaper and is
7436 * described in details here.
7437 *
7438 * For each EMAC interface, PASS will be configured for:
7439 * - Base queue (egress only)
7440 * - Base flow (egress only
7441 * - DSCP_MAP[] {one entry (= flow offset /queue offset) for each DSCP value, 64 total}
7442 * - VLAN_PRIORITY_MAP[] { one entry (= flow offset/queue offset) for each P-bit value, 8 total}
7443 * - Default priority to use per the ingress interface
7444 * - Routing mode: P-bit or DSCP
7445 * - PriorityOverride: True/False
7446 *
7447 * Routing algorithm supports two modes and is described as below:
7448 *
7449 * - DP-bit mode:
7450 * - If frame has VLAN tag, use p-bits to lookup shaper input queue # from the VLAN_PRIORITY_MAP[] for the frame's egress port
7451 * - If frame is un-tagged, but is an IP packet, use the DSCP value to lookup the shaper input queue # from the DSCP_MAP[]
7452 * for the frame's egress port unless priority override is set for the egress port (see last bullet below).
7453 * - If frame is un-tagged, and non-ip , then use the default priority for the frame's ingress port to look up the shaper input queue from
7454 * the egress port's VLAN_PRIORITY_MAP[]. For SOC-generated traffic, the default priority is a separate global configuration item.
7455 * - If priority override is set and the packet is IP then do as in un-tagged/non-ip (above bullet).
7456 * - DSCP mode:
7457 * - If frame is an IP packet, use the DSCP value and the DSCP_MAP [] for the egress port as above to determine the L2 shaper queue to use
7458 * - For non-ip packets, use the default priority for the frame's ingress port to look up the shaper input queue from the egress port's
7459 * VLAN_PRIORITY_MAP[]. For SOC-generated traffic, the default priority is a separate global configuration item.
7460 * - Priority override setting is not applicable in this mode.
7461 *
7462 */
7464 #ifdef __cplusplus
7465 }
7466 #endif
7469 #endif /* _PA_H */