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_MAX_CMD_BUF_SIZE_BYTES
578 * The maximum command buffer size requested when using any PA API call which generates command packet.
579 */
580 #define pa_MAX_CMD_BUF_SIZE_BYTES 2068
582 /* @} */
583 /** @} */
586 /**
587 * @ingroup palld_api_structures
588 * @brief MAC address specification
589 *
590 * @details This type is used to pass MAC addresses (see @ref netlayers) to the module. The most significant byte
591 * of the mac address is placed in array element 0.
592 */
593 #define pa_MAC_ADDR_SIZE 6
594 typedef unsigned char paMacAddr_t[pa_MAC_ADDR_SIZE];
596 /**
597 * @ingroup palld_api_structures
598 * @brief IPv4 address specification
599 *
600 * @details This type is used to pass IPv4 addresses (see @ref netlayers) to the module. The most significant byte
601 * of the IP address is placed in array element 0.
602 */
603 #define pa_IPV4_ADDR_SIZE 4
604 typedef unsigned char paIpv4Addr_t[pa_IPV4_ADDR_SIZE];
606 /**
607 * @ingroup palld_api_structures
608 * @brief IPv6 address specificiation
609 *
610 * @details This type is used to pass IPv6 addresses (see @ref netlayers) to the module. The most significant byte
611 * of the IP address is placed in array element 0.
612 */
613 #define pa_IPV6_ADDR_SIZE 16
614 typedef unsigned char paIpv6Addr_t[pa_IPV6_ADDR_SIZE];
616 /**
617 * @ingroup palld_api_structures
618 * @brief IP address specification
619 *
620 * @details This union is used to specify an IP address to the module. The type in the union is determined
621 * through other parameters passed to the module (see @ref IpValues).
622 */
623 typedef union {
625 paIpv6Addr_t ipv6; /**< IPv6 address */
626 paIpv4Addr_t ipv4; /**< IPv4 address */
628 } paIpAddr_t;
630 /**
631 * @defgroup IpValues IP types
632 * @ingroup palld_api_constants
633 * @{
634 *
635 * @name IP Values
636 * @brief Defines the IP version type used.
637 *
638 * @details The packet accelerator module parses both IPv4 and IPv6 network layer headers (see @ref netlayers).
639 * This group is used to distinguish which type of header will be used.
640 */
641 /* @{ */
642 /**
643 * @def pa_IPV4
644 * IPv4
645 */
646 #define pa_IPV4 4
648 /**
649 * @def pa_IPV6
650 * IPv6
651 */
652 #define pa_IPV6 6
654 /* @} */
655 /** @} */
658 /**
659 * @ingroup palld_api_structures
660 * @brief Specification of Pa_Handle
661 *
662 * The Pa_Handle is used to identify a PA LLD instance
663 */
664 typedef void* Pa_Handle;
666 /**
667 * @ingroup palld_api_structures
668 * @brief PA handle specification for L2 and L3 (LUT1) handles
669 *
670 * @details This type is used to reference L2 and L3 (LUT1) routing information (see @ref netlayers). The module
671 * user is responsible for storing the handle and using it to refer to routing information already
672 * created through calls to @ref Pa_addMac, @ref Pa_addSrio, @ref Pa_addCustomLUT1 and @ref Pa_addIp.
673 */
674 typedef void* paHandleL2L3_t;
676 /**
677 * @ingroup palld_api_structures
678 * @brief PA link handle specification for L2, L3 (LUT1) and virtual link handles
679 *
680 * @details This type is used to reference L2, L3 (LUT1) and virtual link information. The module
681 * user is responsible for storing the handle and using it to refer to L2/L3/Virtual link handle already
682 * created through calls to @ref Pa_addMac, @ref Pa_addSrio, @ref Pa_addCustomLUT1, @ref Pa_addIp and
683 * @ref Pa_addVirtualLink
684 */
685 typedef void* paLnkHandle_t;
687 /**
688 * @ingroup palld_api_structures
689 * @brief PA handle specification for ACL (LUT1) handles
690 *
691 * @details This type is used to reference ACL (LUT1) entry with the ACL table. The module
692 * user is responsible for storing the handle and using it to refer to ACL entry already
693 * created through calls to @ref Pa_addAcl.
694 */
695 typedef void* paHandleAcl_t;
697 /**
698 * @ingroup palld_api_structures
699 * @brief PA handle specification for Flow Cache (LUT1) handles
700 *
701 * @details This type is used to reference Flow Cache (LUT1) entry with the Flow Cache (FC) table. The module
702 * user is responsible for storing the handle and using it to refer to Flow Cache entry already
703 * created through calls to @ref Pa_addFc.
704 */
705 typedef void* paHandleFc_t;
707 /**
708 * @brief The un-linked inner IP handle
709 *
710 * @details This handle value is used to specify an inner IP (tunnel) which the application does not
711 * want to link to an outer IP address.
712 */
713 #define PA_LLD_HANDLE_IP_INNER ((paHandleL2L3_t)1)
715 /**
716 * @ingroup palld_api_structures
717 * @brief PA handle specification for L4 (LUT2) handles
718 *
719 * @details This type is used to reference L4 (LUT2) routing information (see @ref netlayers). The module user
720 * is responsible for storing the handle. It is used again only to delete a created route.
721 *
722 */
723 typedef uint32_t paHandleL4_t[3];
726 /**
727 * @ingroup palld_api_structures
728 * @brief A generic entry handle types
729 *
730 * @details The union of both entry handle types used by the module is used only in function @ref Pa_forwardResult.
731 * The function will return the corresponding entry type and its handle in the command response packets when a LUT1
732 * or LUT2 entry is added into the LUT1/LUT2 table successfully.
733 * The handle entry will be set to zero in all other cases
734 */
735 typedef union {
737 paHandleL2L3_t l2l3Handle; /**< Level 2 or level 3 handle created by @ref Pa_addMac @ref Pa_addSrio, @ref Pa_addCustomLUT1 or @ref Pa_addIp */
738 paHandleAcl_t aclHandle; /**< ACL handle created by @ref Pa_addAcl (Gen2 only) */
739 paHandleFc_t fclHandle; /**< Flow Cache handle created by @ref Pa_addFc (Gen2 only) */
740 paHandleL4_t l4Handle; /**< Level 4 handle created by @ref Pa_addPort or @ref Pa_addCustomLUT2 */
742 } paEntryHandle_t;
744 /**
745 * @ingroup salld_api_constants
746 * @{
747 * @brief The number of bytes available for custom lookup
748 *
749 * @details Custom lookup sizes are fixed by hardware
750 */
751 #define pa_NUM_BYTES_CUSTOM_LUT1 32
752 #define pa_NUM_BYTES_CUSTOM_LUT2 4
753 /** @} */
755 /**
756 * @defgroup HandleTypes Handle Types
757 *
758 * @ingroup palld_api_constants
759 * @{
760 *
761 * @name Handle Types
762 *
763 * @brief These values are used to describe what type of handle is referenced.
764 *
765 * @details These values are used only for function @ref Pa_forwardResult. The function returns with a copy
766 * of the handle, which the module user should already have, along with the type of handle. The
767 * module user can use this information to verify that a particular handle has been fully activated
768 * and can be used for linking reference in calls to @ref Pa_addIp, @ref Pa_addCustomLUT1,
769 * @ref Pa_addCustomLUT2, @ref Pa_addPort or @ref Pa_addAcl.
770 */
771 /* @{ */
772 /**
773 *
774 * @def pa_L2_HANDLE
775 * Level 2 (MAC/SRIO) handle
776 */
777 #define pa_L2_HANDLE 2
779 /**
780 * @def pa_L3_HANDLE
781 * Level 3 (IP, Custom LUT1) handle
782 */
783 #define pa_L3_HANDLE 3
785 /**
786 * @def pa_L4_HANDLE
787 * Level 4 (TCP/UDP/GTP-U/Custom LUT2) handle
788 */
789 #define pa_L4_HANDLE 4
791 /**
792 * @def pa_ACL_HANDLE
793 * ACL (Access Control List) handle
794 */
795 #define pa_ACL_HANDLE 10
797 /**
798 * @def pa_FC_HANDLE
799 * FC (Flow Cache) handle
800 */
801 #define pa_FC_HANDLE 11
803 /**
804 * @def pa_INVALID_HANDLE
805 * Invalid handle type
806 */
807 #define pa_INVALID_HANDLE -1
809 /* @} */
810 /** @} */
813 /**
814 * @defgroup ErouteTypes Exception Route Types
815 * @ingroup palld_api_constants
816 * @{
817 *
818 * @name Exception Route Types
819 *
820 * @brief These values are used to define exception route conditions.
821 *
822 * @details The exception route defines the global routing information when the exception condition such
823 * as LUT1 lookup failure, packet parsing failure, broadcast packet detection and etc. Multiple
824 * exception routes can be configured through @ref Pa_configExceptionRoute. All the exception
825 * routes are disabled by default.
826 */
827 /* @{ */
828 /**
829 *
830 * @def pa_EROUTE_L2L3_FAIL
831 * packet failed to match in L2/L3 (LUT1) table
832 */
833 #define pa_EROUTE_L2L3_FAIL 0
835 /**
836 * @def pa_EROUTE_VLAN_MAX_DEPTH
837 * packet exceeded maximum number of VLAN tags
838 */
839 #define pa_EROUTE_VLAN_MAX_DEPTH 1
841 /**
842 * @def pa_EROUTE_IP_MAX_DEPTH
843 * packet exceeded maximum number of IP headers
844 */
845 #define pa_EROUTE_IP_MAX_DEPTH 2
847 /**
848 * @def pa_EROUTE_MPLS_MAX_DEPTH
849 * packet exceeded maximum number of MPLS headers
850 */
851 #define pa_EROUTE_MPLS_MAX_DEPTH 3
853 /**
854 * @def pa_EROUTE_GRE_MAX_DEPTH
855 * packet exceeded maximum number of GRE headers
856 */
857 #define pa_EROUTE_GRE_MAX_DEPTH 4
859 /**
860 * @def pa_EROUTE_PARSE_FAIL
861 * packet failed to parse
862 */
863 #define pa_EROUTE_PARSE_FAIL 5
865 /**
866 * @def pa_EROUTE_L4_FAIL
867 * packet failed to match in L4 (LUT2) table
868 */
869 #define pa_EROUTE_L4_FAIL 6
871 /**
872 * @def pa_EROUTE_IP_FRAG
873 * IP fragmented packet
874 */
875 #define pa_EROUTE_IP_FRAG 7
877 /**
878 * @def pa_EROUTE_IPV6_OPT_FAIL
879 * Packet failed due to unsupported IPV6 option header
880 */
881 #define pa_EROUTE_IPV6_OPT_FAIL 8
883 /**
884 * @def pa_EROUTE_UDP_LITE_FAIL
885 * UDP lite packet had invalid checksum coverage
886 */
887 #define pa_EROUTE_UDP_LITE_FAIL 9
889 /**
890 * @def pa_EROUTE_ROUTE_OPTION
891 * IP routing had incomplete routes
892 */
893 #define pa_EROUTE_ROUTE_OPTION 10
895 /**
896 * @def pa_EROUTE_SYSTEM_FAIL
897 * Sub-system detected internal error
898 */
899 #define pa_EROUTE_SYSTEM_FAIL 11
901 /**
902 * @def pa_EROUTE_MAC_BROADCAST
903 * MAC broadcast packet which is not specified at the lookup table
904 */
905 #define pa_EROUTE_MAC_BROADCAST 12
907 /**
908 * @def pa_EROUTE_MAC_MULTICAST
909 * MAC multicast packet which is not specified at the lookup table
910 */
911 #define pa_EROUTE_MAC_MULTICAST 13
913 /**
914 * @def pa_EROUTE_IP_BROADCAST
915 * IP broadcast packet which is not specified at the lookup table
916 */
917 #define pa_EROUTE_IP_BROADCAST 14
919 /**
920 * @def pa_EROUTE_IP_MULTICAST
921 * IP multicast packet which is not specified at the lookup table
922 */
923 #define pa_EROUTE_IP_MULTICAST 15
925 /**
926 * @def pa_EROUTE_GTPU_MESSAGE_TYPE_1
927 * GTP-U PING Request packet
928 */
929 #define pa_EROUTE_GTPU_MESSAGE_TYPE_1 16
931 /**
932 * @def pa_EROUTE_GTPU_MESSAGE_TYPE_2
933 * GTP-U PING Response packet
934 */
935 #define pa_EROUTE_GTPU_MESSAGE_TYPE_2 17
937 /**
938 * @def pa_EROUTE_GTPU_MESSAGE_TYPE_26
939 * GTP-U Error Indication packet
940 */
941 #define pa_EROUTE_GTPU_MESSAGE_TYPE_26 18
943 /**
944 * @def pa_EROUTE_GTPU_MESSAGE_TYPE_31
945 * GTP-U Supported Header Notification packet
946 */
947 #define pa_EROUTE_GTPU_MESSAGE_TYPE_31 19
949 /**
950 * @def pa_EROUTE_GTPU_MESSAGE_TYPE_254
951 * GTP-U End Markr packet
952 */
953 #define pa_EROUTE_GTPU_MESSAGE_TYPE_254 20
955 /**
956 * @def pa_EROUTE_GTPU_FAIL
957 * Packet failed due to GTPU parsing error or unsupporte dmessage types
958 */
959 #define pa_EROUTE_GTPU_FAIL 21
961 /**
962 * @def pa_EROUTE_PPPoE_FAIL
963 * Packet failed due to PPPoE session packet parsing error
964 */
965 #define pa_EROUTE_PPPoE_FAIL 22
967 /**
968 * @def pa_EROUTE_PPPoE_CTRL
969 * PPPoE session stage non-IP packets
970 */
971 #define pa_EROUTE_PPPoE_CTRL 23
973 /**
974 * @def pa_EROUTE_802_1ag
975 * 802.1ag Packet
976 */
977 #define pa_EROUTE_802_1ag 24
979 /**
980 * @def pa_EROUTE_IP_FAIL
981 * Packet failed due to invalid IP header
982 */
983 #define pa_EROUTE_IP_FAIL 25
985 /**
986 * @def pa_EROUTE_NAT_T_KEEPALIVE
987 * NAT-T Keep Alive packet where UDP Length = 9, data = 0xFF
988 */
989 #define pa_EROUTE_NAT_T_KEEPALIVE 26
991 /**
992 * @def pa_EROUTE_NAT_T_CTRL
993 * NAT-T control packet where UDP Length > 12 and the first 4 payload bytes are equal to 0
994 */
995 #define pa_EROUTE_NAT_T_CTRL 27
997 /**
998 * @def pa_EROUTE_NAT_T_DATA
999 * NAT-T IPSEC ESP data packet where UDP Length > 12 and the first 4 payload bytes are not equal to 0
1000 */
1001 #define pa_EROUTE_NAT_T_DATA 28
1003 /**
1004 * @def pa_EROUTE_NAT_T_FAIL
1005 * Invalid NAT-T packet
1006 */
1007 #define pa_EROUTE_NAT_T_FAIL 29
1009 /**
1010 * @def pa_EROUTE_GTPU_MATCH_FAIL
1011 * GTPU match failed
1012 */
1013 #define pa_EROUTE_GTPU_MATCH_FAIL 30
1015 /**
1016 * @def pa_EROUTE_MAX
1017 * The maximum number of global route types
1018 */
1019 #define pa_EROUTE_MAX 31
1021 /* @} */
1022 /** @} */
1025 /**
1026 * @defgroup NextHeaderTypes Next Header types
1027 * @ingroup palld_api_constants
1028 * @{
1029 *
1030 * @name Next Header types
1031 *
1032 * @brief These values are used to define the next header (protocol) types for continus parsing after the
1033 * SRIO and custom parsing.
1034 *
1035 * @details The next header type can be derived from the upper layer header in a standard Ethernet packet.
1036 * For SRIO and custom LUT1 lookup, the next header type should be provided by the user in function
1037 * @ref Pa_setCustomLUT1 and @ref Pa_addSrio.
1038 */
1039 /* @{ */
1040 /**
1041 *
1042 * @def pa_HDR_TYPE_MAC
1043 * MAC header
1044 */
1045 #define pa_HDR_TYPE_MAC 0
1047 /**
1048 *
1049 * @def pa_HDR_TYPE_IPV4
1050 * IPv4 header
1051 */
1052 #define pa_HDR_TYPE_IPV4 1
1055 /**
1056 *
1057 * @def pa_HDR_TYPE_IPV6
1058 * IPv6 header
1059 */
1060 #define pa_HDR_TYPE_IPV6 2
1062 /**
1063 *
1064 * @def pa_HDR_TYPE_CUSTOM_LUT1
1065 * Custom LUT1 header
1066 */
1067 #define pa_HDR_TYPE_CUSTOM_LUT1 3
1069 /**
1070 *
1071 * @def pa_HDR_TYPE_UDP
1072 * UDP header
1073 */
1074 #define pa_HDR_TYPE_UDP 4
1076 /**
1077 *
1078 * @def pa_HDR_TYPE_UDP_LITE
1079 */
1080 #define pa_HDR_TYPE_UDP_LITE 5
1082 /**
1083 *
1084 * @def pa_HDR_TYPE_TCP
1085 * TCP header
1086 */
1087 #define pa_HDR_TYPE_TCP 6
1089 /**
1090 *
1091 * @def pa_HDR_TYPE_CUSTOM_LUT2
1092 * Custom LUT2 header
1093 */
1094 #define pa_HDR_TYPE_CUSTOM_LUT2 7
1096 /**
1097 *
1098 * @def pa_HDR_TYPE_UNKNOWN
1099 * next header type is not specified
1100 */
1101 #define pa_HDR_TYPE_UNKNOWN 8
1103 /* @} */
1104 /** @} */
1106 /**
1107 * @ingroup palld_api_structures
1108 * @brief pa RM Handle
1109 */
1110 typedef void * pa_RmHnd;
1112 /**
1113 * @ingroup palld_api_structures
1114 * @brief PA start configuration structure
1115 */
1116 typedef struct
1117 {
1118 pa_RmHnd rmServiceHandle; /**< Resource Manager service handle */
1119 uint32_t baseAddr; /**< Specify the PASS base address */
1120 void* instPoolBaseAddr; /**< Base address of the global shared memory pool from which global
1121 LLD instance & channel instance memory is allocated */
1122 } paStartCfg_t;
1124 /**
1125 * @ingroup palld_api_structures
1126 * @brief Pointer to the buffer where the PASS command is placed
1127 *
1128 * @details Functions in this module produce formatted commands that must be sent to the packet accelerator
1129 * sub-system. These commands are always referred to through this type.
1130 */
1131 typedef void* paCmd_t;
1134 /**
1135 * @ingroup palld_api_structures
1136 * @brief PA Size Configuration Structure
1137 *
1138 * @details The module is configured at run time with a maximum number of handles supported. The module
1139 * maintains a set of handles and links between handles.
1140 */
1141 typedef struct {
1143 int nMaxL2; /**< Maximum number of L2 handles supported */
1144 int nMaxL3; /**< Maximum number of L3 handles supported */
1145 int nUsrStats;/**< Maximum number of user-defined statistics supported (maximum: 512)*/
1146 int nMaxVlnk; /**< Maximum number of virtual links supported */
1147 int nMaxAcl; /**< Maximum number of Stateless ACL handles supported (Gen2 only)*/
1148 int nMaxFc; /**< Maximum number of Flow Cache Hanndles supported (Gen2 only) */
1149 } paSizeInfo_t;
1151 /**
1152 * @ingroup salld_api_constants
1153 * @{
1154 * @brief PA Reassembly Engine related constant definitions
1155 */
1156 #define pa_RA_MAX_HEAP_REGIONS 2 /**< Maxmium number of RA Heap Regions */
1157 #define pa_RA_NUM_GROUPS 2 /**< Number of RA groups */
1159 /**
1160 * @ingroup palld_api_structures
1161 * @brief PA Reassembly Engine global config structure
1162 *
1163 * @details The parameters in this structure are used to configure the Reassembly
1164 * engine with PASS
1165 */
1166 typedef struct {
1167 int ipv4MinPktSize; /**< Specify the minimum packet size in bytes for a fragment of an
1168 Ipv4 packet that is not the last fragment. The deafult value
1169 is 68 byte to contain 60 bytes of IP header including options
1170 plus 8-byte of payload */
1171 int numCxts; /**< Total number of contexts the RA handles. This value affects
1172 the amount of heap memory that needs to be allocated. This
1173 value must be between 0x1 and 0x400 (1k). If set to 0, all
1174 fragments will be discarded. The default value is 0x400. */
1175 int cxtDiscardThresh; /**< Number of concurrent contexts that, once reached, causes the
1176 oldest current context to be forcibly timed out. To prevent
1177 this behavior, this value should be programmed to be equal to
1178 or greater than the Total Contexts. This value must be between
1179 0x1 and 0x400 (1k). The default value is 0x400. */
1180 int nodeDiscardThresh; /**< Number of Nodes that, once reached, causes the oldest current
1181 context to be forcibly timed out. To prevent this behavior,
1182 this value should be programmed to be the maximum value
1183 (there are 4K total nodes). This value must be between 0x1
1184 and 0x1000 (4K). The default value is 0xFFF. */
1185 int cxtTimeout; /**< Amount of time (in ms) after a new context has been allocated until
1186 that context times out. If timeout occurs before a packet is completely
1187 reassembled and the SOP fragment has been received, a packet containing
1188 the IP header and the first 8 bytes of data is forwarded up to the host
1189 that it can respond with an ICPM Time Exceeded message as per RFC 792.
1190 If a context times out and the SOP fragment has not been received,
1191 the packet is discarded and the context freed. */
1192 int clockRate; /**< Clock rate of the Reassembly engine in MHz. */
1193 int heapRegionThresh; /**< Number of contexts handled in Region 0 of the Reassembly Heap. All contexts
1194 in excess of this number are handled in Region 1. If Region 1 is not used,
1195 this value should be set equal to (or higher) than Total Contexts. */
1196 uint64_t heapBase[pa_RA_MAX_HEAP_REGIONS]; /**< Reassembly Heap addresses which should be 64-byte aligned */
1197 } paRaConfig_t;
1200 /**
1201 * @ingroup palld_api_structures
1202 * @brief PA Initialization config structure
1203 *
1204 * @details The parameters in this structure are used to do initial setup
1205 * of the driver including its base address and other default settings.
1206 *
1207 * @note The stream interface switch controls the destination of the traffic
1208 * from the Ethernet switch. The default setting of the streaming
1209 * interface switch is to route all traffic to host queues.
1210 * This module is designed to receive the incoming packets at the PDSP0.
1211 * If the initDeafultRoute is set to TRUE, this module will re-configure
1212 * the stream interface switch to route all traffic to PDSP0. Otherwise,
1213 * it is the module user's reponsibility to deliver incoming packets
1214 * to PDSP0 via the CPPI/QMSS interface.
1215 */
1216 typedef struct {
1217 uint16_t initTable; /**< If True then the L2/L3/ACL tables are initialized */
1218 uint16_t initDefaultRoute; /**< If True then the switch default route is set to PASS PDSP0 */
1219 uint32_t baseAddr; /**< Specify the PASS base address */
1220 void* instPoolBaseAddr; /**< Base address of the global shared memory pool from which global
1221 LLD instance & channel instance memory is allocated */
1222 pa_RmHnd rmServiceHandle; /**< Resource Manager service handle */
1223 paSizeInfo_t* sizeCfg; /**< Pointer to the size configuration information */
1224 paRaConfig_t* raCfg; /**< Pointer to the RA global configuration information (Gen2 only) */
1225 } paConfig_t;
1227 /**
1228 * @ingroup salld_api_constants
1229 * @{
1230 * @brief Protocol Limit related constant definitions
1231 */
1232 #define pa_PROTOCOL_LIMIT_NUM_VLANS_DEF 2 /**< Number of VLAN supported: default value */
1233 #define pa_PROTOCOL_LIMIT_NUM_IP_DEF 2 /**< Number of IP layers supported: default value */
1234 #define pa_PROTOCOL_LIMIT_NUM_GRE_DEF 2 /**< Number of GRE layers supported: default value */
1235 #define pa_PROTOCOL_LIMIT_NUM_VLANS_MAX 3 /**< Number of VLAN supported: maximum value */
1236 #define pa_PROTOCOL_LIMIT_NUM_IP_MAX 7 /**< Number of IP layers supported: maximum value */
1237 #define pa_PROTOCOL_LIMIT_NUM_GRE_MAX 7 /**< Number of GRE layers supported: maximum value */
1239 /** @} */
1241 /**
1242 * @ingroup palld_api_structures
1243 * @brief Protocol-specific Limitations.
1244 *
1245 * @details paProtocolLimit_t is used to defines the protocol-specific restrictions. For example,
1246 * it is necessary to limit the number of protocol layers such as GRE of the input packets
1247 * to prevent the irregular packets take too much processing time.
1248 * The PASS will detect the packets which violate the protocol-specific restrictions and either discard
1249 * or forward the packets to host queues which can be specified through API @ref Pa_configExceptionRoute.
1250 *
1251 * @note The PASS will work when non-default values are used. However, it may limit the supported packet rate
1252 * below wire rate.
1253 */
1254 typedef struct {
1256 uint8_t vlanMax; /**< Maximum number of VLANs supported, default = 2, maximum = 3 */
1257 uint8_t ipMax; /**< Maximum number of IP layers supported, default = 2, maximum = 7 */
1258 uint8_t greMax; /**< Maximum number of GRE layers supported, default = 2, maximum = 7 */
1260 } paProtocolLimit_t;
1262 /**
1263 * @ingroup palld_api_structures
1264 * @brief IP Reassembly Configuration Information.
1265 *
1266 * @details paIpReassmConfig_t is used to configure the PA-assisted IP reassembly operation. Two separate structures are used
1267 * for the outer IP and inner IP respectively. The IP reassembly assistance feature is disabled until
1268 * this information is provided. See section @ref appendix3 for deatiled description.
1269 * @note The maximum number of traffic flows is limited due to processing time and internal memory restriction.
1270 */
1271 typedef struct {
1273 uint8_t numTrafficFlow; /**< Maximum number of IP reassembly traffic flows supported, default = 0, maximum = 32 */
1274 uint8_t destFlowId; /**< CPPI flow which instructs how the link-buffer queues are used for forwarding packets */
1275 uint16_t destQueue; /**< Destination host queue where PASS will deliver the packets which require IP reassembly assistance */
1277 } paIpReassmConfig_t;
1279 /**
1280 * @ingroup palld_api_constants
1281 * @brief Define the maximum number of IP reassembly traffic flows
1282 *
1283 */
1284 #define pa_MAX_IP_REASM_TRAFFIC_FLOWS 32
1286 /**
1287 * @ingroup palld_api_structures
1288 * @brief Command Set Configuration Information.
1289 *
1290 * @details paCmdSetConfig_t defines command set configuration parameters such as the maximum number of command sets.
1291 * The PASS supports either 64 of 64-byte or 32 of 128-byte command sets. The number of command sets should
1292 * be configured at system startup.
1293 */
1294 typedef struct {
1296 uint8_t numCmdSets; /**< Number of command sets supported (32, 64), default = 64
1297 @note If the number of command sets is set to 64, then each command entry will be limited to 64 bytes.
1298 If the number of command sets is set to 32, then each command entry will be limited to 128 bytes */
1299 } paCmdSetConfig_t;
1301 /**
1302 * @ingroup palld_api_structures
1303 * @brief User-defined Statistics Configuration Information.
1304 *
1305 * @details paUsrStatsConfig_t defines the configuration parameters for multi-level hierarchical user-defined statistics
1306 * operation such as the number of user-defined counters. There are up to 512 user-defined statistics consisting of
1307 * some 64-bit counters and some 32-bit counters whereas the total size of all counters cannot exceed 2048 bytes.
1308 * The user-defined statistics feature is disabled until this configuration is invoked through API @ref Pa_control.
1309 *
1310 * - 64-bit Counters index: 0 - (num64bCounters - 1)
1311 * - 32-bit Counters index: num64bCounters - (numCounters - 1)
1312 */
1313 typedef struct {
1315 uint16_t numCounters; /**< Total number of user-defined counters, default = 0, maximum = 512 */
1316 uint16_t num64bCounters; /**< Number of 64-bit user-defined counters, default = 0, maximum = 256 */
1318 } paUsrStatsConfig_t;
1320 /**
1321 * @ingroup salld_api_constants
1322 * @brief Define the maximum number of user-defined statistics the module supports.
1323 *
1324 */
1325 #define pa_USR_STATS_MAX_COUNTERS 512
1327 /**
1328 * @ingroup salld_api_constants
1329 * @brief Define the maximum number of user-defined 64-bit statistics
1330 *
1331 */
1332 #define pa_USR_STATS_MAX_64B_COUNTERS (pa_USR_STATS_MAX_COUNTERS/2)
1333 /**
1334 * @ingroup salld_api_constants
1335 * @brief Define the maximum number of user-defined 32-bit statistics
1336 *
1337 */
1338 #define pa_USR_STATS_MAX_32B_COUNTERS pa_USR_STATS_MAX_COUNTERS
1340 /**
1341 * @defgroup paUsrStatsSizes PA User-defined Ststaistics Counter Sizes
1342 * @ingroup palld_api_constants
1343 * @{
1344 *
1345 * @name User-defined Ststaistics Counter Sizes
1346 *
1347 * Definition of Counter size of the User-defined Statistics
1348 */
1349 /** @ingroup paUsrStatsSizes */
1350 /*@{*/
1351 typedef enum {
1352 pa_USR_STATS_SIZE_32B = 0, /**< 32-bit Counter */
1353 pa_USR_STATS_SIZE_64B /**< 64-bit Counter */
1354 } paUsrStatsSizes_e;
1355 /*@}*/
1356 /** @} */
1359 /**
1360 * @ingroup palld_api_structures
1361 * @brief Queue Diversion Configuration Information.
1362 *
1363 * @details The PASS supports optional queue diversion operation per LUT2 entry replacement.
1364 * paQueueDivertConfigl_t contains configuration information for the atomic queue diversion operation.
1365 * The queue diversion feature is disabled until this configuration is invoked through API @ref Pa_control.
1366 *
1367 */
1368 typedef struct {
1370 uint16_t destQueue; /**< Destination queue where PASS will deliver the LUT2 response packet which contains the
1371 queue diversion information */
1372 uint8_t destFlowId; /**< CPPI flow which instructs how the link-buffer queues are used for forwarding
1373 the LUT2 response packets */
1374 } paQueueDivertConfig_t;
1377 /**
1378 * @defgroup pktControlInfo PA Packet Control Bit Definitions
1379 * @ingroup palld_api_constants
1380 * @{
1381 *
1382 * @name PA Packet Control Bit Definitions
1383 *
1384 * Bitmap definition of the ctrlBitMap in @ref paPacketControlConfig_t.
1385 *
1386 */
1387 /*@{*/
1388 /**
1389 * @def pa_PKT_CTRL_HDR_VERIFY_PPPoE
1390 * Control Info -- Set: Perform enhanced error check of the PPPoE header
1391 * Clear: Perform basic error check of the PPPoE header
1392 */
1393 #define pa_PKT_CTRL_HDR_VERIFY_PPPoE 0x0001
1394 /**
1395 * @def pa_PKT_CTRL_HDR_VERIFY_IP
1396 * Control Info -- Set: Perform enhanced error check of the IP header
1397 * Clear: Perform basic error check of the IP header
1398 */
1399 #define pa_PKT_CTRL_HDR_VERIFY_IP 0x0002
1400 /**
1401 * @def pa_PKT_CTRL_MAC_PADDING_CHK
1402 * Control Info -- Set: Perform MAC (802.3) padding check
1403 * The packet with illegal padding will be dropped
1404 * Clear: Do not perform MAC (802.3) padding check
1405 */
1406 #define pa_PKT_CTRL_MAC_PADDING_CHK 0x0004
1407 /**
1408 * @def pa_PKT_CTRL_IP_FRAGS_TO_EROUTE
1409 * Control Info -- Set: Forward IP Fragments through the exception route regardless of the routing destination
1410 * Clear: Forward IP Fragments through the exception route only if the routing destination is set to SASS or CONTINUE_PARSE
1411 */
1412 #define pa_PKT_CTRL_IP_FRAGS_TO_EROUTE 0x0008
1413 /**
1414 * @def pa_PKT_CTRL_L3OFFSET_TO_INNER_IP
1415 * Control Info -- Set: L3offset of the packet information points to the inner IP header prior to payload
1416 * Clear: L3offset of the packet information points to the outer IP header (default)
1417 */
1418 #define pa_PKT_CTRL_L3OFFSET_TO_INNER_IP 0x0010
1420 /*@}*/
1421 /** @} */
1423 /**
1424 * @ingroup palld_api_structures
1425 * @brief Packet Control Configuration Information.
1426 *
1427 * @details This data structure defines miscellaneous packet control information for some non-default PASS operations.
1428 * For example, PASS always performs basic protocol header verification to ensure that it can continue parsing the
1429 * current and next protocol header. The PASS will perform enhanced error check of protocol headers specified
1430 * by this configuration. For example,
1431 * PPPoE header in session mode:
1432 * - Version = 1
1433 * - Type = 1
1434 * - Code = 0
1435 *
1436 * IPv4 header:
1437 * - Header length >= 20
1438 * - Total length > 20
1439 * - Source address is not broadcast
1440 * - Destination address is not 0
1441 * - TTL is not 0
1442 *
1443 * @note refer to the @ref ErouteTypes for the corresponding exception routes.
1444 */
1445 typedef struct {
1447 uint16_t ctrlBitMap; /**< Packet control bit as defined at @ref pktControlInfo */
1448 uint16_t rxPaddingErrStatsIndex; /**< Specify the user statistics index of Rx padding error counter */
1449 uint16_t txPaddingStatsIndex; /**< Specify the user statistics index of Tx MAC padding counter */
1451 } paPacketControlConfig_t;
1453 /**
1454 * @defgroup paAclActionTypes PA ACL action types
1455 * @ingroup palld_api_constants
1456 * @{
1457 *
1458 * @name PA ACL action types
1459 * @brief Define the ACL action types.
1460 *
1461 * @details Define actions to be taken when an ACL entry is matched
1462 */
1463 /* @{ */
1464 /**
1465 * @def pa_ACL_ACTION_PERMIT
1466 * Allow matched packets to be forwarded to the next stage
1467 */
1468 #define pa_ACL_ACTION_PERMIT 0
1470 /**
1471 * @def pa_ACL_ACTION_DENY
1472 * Matched packets should be dropped
1473 */
1474 #define pa_ACL_ACTION_DENY 1
1476 /**
1477 * @def pa_ACL_ACTION_MARK
1478 * Matched packets should be forwarded with a mark which may be used later by hardware or software
1479 */
1480 #define pa_ACL_ACTION_MARK 2
1482 /**
1483 *
1484 * @def pa_ACL_ACTION_HOST
1485 * The packet should be forwarded to host for further processing
1486 * @note This action is only applicable to default rule
1487 */
1488 #define pa_ACL_ACTION_HOST 3
1490 #define pa_ACL_ACTION_MAX pa_ACL_ACTION_HOST
1492 /* @} */
1493 /** @} */
1495 /**
1496 * @ingroup palld_api_structures
1497 * @brief Stateless ACL Configuration Information.
1498 *
1499 * @details paAclConfig_t is used to configure the default rule of stateless ACL operation. The PASS will follow
1500 * this rule if no matches are found at the ACL table. Two separate structures are used
1501 * for the outer ACL and inner ACL respectively. The default rule is set to packet FORWARDING until
1502 * this information is provided.
1503 */
1504 typedef struct {
1506 int action; /**< Default action (Deny/Permit/Host) as sepcified at @ref paAclActionTypes */
1507 uint8_t destFlowId; /**< CPPI flow which instructs how the link-buffer queues are used for forwarding packets to host.
1508 (valid only if action = pa_ACL_ACTION_HOST) */
1509 uint16_t destQueue; /**< Destination host queue where PASS will deliver the packets if no ACL matches found
1510 (valid only if action = pa_ACL_ACTION_HOST) */
1511 } paAclConfig_t;
1513 /**
1514 * @defgroup paRACtrlInfo PA RA Control Bit Definitions
1515 * @ingroup palld_api_constants
1516 * @{
1517 *
1518 * @name PA RA Control Bit Definitions
1519 *
1520 * Bitmap definition of the ctrlBitMap in @ref paRaGroupConfig_t.
1521 *
1522 */
1523 /*@{*/
1524 /**
1525 * @def pa_RA_CTRL_ENABLE
1526 * Control Info -- Set: Enable Reassembly operation, forward all packets to RA
1527 * Clear: Disable Reassembly operation, bypass RA
1528 */
1529 #define pa_RA_CTRL_ENABLE 0x0001
1530 /*@}*/
1531 /**
1532 * @def pa_RA_CTRL_USE_LOCAL_DMA
1533 * Control Info -- Set: Use NetCP internal DMA to send packets from PASS to RA engine
1534 * Clear: Use global DMA to send packets from PASS to RA engine
1535 */
1536 #define pa_RA_CTRL_USE_LOCAL_DMA 0x0002
1537 /**
1538 * @def pa_RA_CTRL_TO_QUEUE
1539 * Control Info -- Set: Forward RA output packets to the host queue specified by the RA output CPPI flow
1540 * Clear: Forward RA output pakets to the next PASS classification stage
1541 * @note: The lower 8-bit of source tag of the input CPPI flow should be set to the output CPPI flow when this set
1542 * this bit is set and the default queue of the output CPPI flow should be set to the desired destination queue
1543 */
1544 #define pa_RA_CTRL_TO_QUEUE 0x0004
1545 /*@}*/
1546 /** @} */
1548 /**
1549 * @ingroup palld_api_structures
1550 * @brief RA exception Route Information.
1551 *
1552 * @details The reassembly engine is degined to forward packets to host queue specified by user when timwout or other
1553 * error condition occurs. paRaERouteInfo_t contains the routing information required for this operation.
1554 */
1555 typedef struct {
1557 int dest; /**< (TBD:) Packet destination as defined at @ref pktDest */
1558 uint8_t flowId; /**< Specifies CPPI flow which defines free queues are used for receiving packets */
1559 uint16_t queue; /**< Specifies the destination host queue */
1560 } paRaERouteInfo_t;
1562 /**
1563 * @ingroup palld_api_structures
1564 * @brief PA Reassembly Engine Group Configuration Information.
1565 *
1566 * @details paRaGroupConfig_t is used to specify the group specific configuration parameters of the PASS
1567 * reassembly Engine. Two separate structures are used for the outer IP and inner IP reassembly
1568 * respectively.
1569 */
1570 typedef struct {
1571 uint16_t ctrlBitMap; /**< RA control info as defined at @ref paRACtrlInfo */
1572 uint8_t flowId; /**< Specify the RA CPPI flow which defines free queues and other paramters
1573 for sending packets from PASS to RA */
1574 paRaERouteInfo_t timeoutER; /**< Specify exception route for timeout packets */
1575 paRaERouteInfo_t critErrER; /**< Specify exception route for packets with critical error */
1576 paRaERouteInfo_t genErrER; /**< Specify exception route for packets with non-critical error*/
1577 } paRaGroupConfig_t;
1579 /**
1580 * @ingroup palld_api_structures
1581 * @brief PA System Configuration Information structure
1582 *
1583 * @details paSysConfig_t contains pointers to the system-level configuration structures defined above. The null pointer
1584 * indicates the configuration of the corresponding sub-group is not required.
1585 */
1586 typedef struct {
1587 paProtocolLimit_t* pProtoLimit; /**< Pointer to the protocol limit configuration structure */
1588 paIpReassmConfig_t* pOutIpReassmConfig; /**< Pointer to the outer IP PASS-assisted Reassembly configuration structure */
1589 paIpReassmConfig_t* pInIpReassmConfig; /**< Pointer to the inner IP PASS-assisted Reassembly configuration structure */
1590 paCmdSetConfig_t* pCmdSetConfig; /**< Pointer to the command set configuration structure */
1591 paUsrStatsConfig_t* pUsrStatsConfig; /**< Pointer to the user-defined statistics configuration structure */
1592 paQueueDivertConfig_t* pQueueDivertConfig; /**< Pointer to the queue-diversion configuration structure */
1593 paPacketControlConfig_t* pPktControl; /**< Pointer to the packet control configuration structure */
1594 paAclConfig_t* pOutAclConfig; /**< Pointer to the outer ACL configuration structure */
1595 paAclConfig_t* pInAclConfig; /**< Pointer to the inner ACL configuration structure */
1596 paRaGroupConfig_t* pOutIpRaGroupConfig; /**< Poimter to the outer IP Reassembly group configuration structure */
1597 paRaGroupConfig_t* pInIpRaGroupConfig; /**< Poimter to the inner IP Reassembly group configuration structure */
1598 } paSysConfig_t;
1600 /**
1601 * @defgroup pa802p1agDetectInfo PA 802.1ag Detector Control Bit Definitions
1602 * @ingroup palld_api_constants
1603 * @{
1604 *
1605 * @name PA 802.1ag Detector Control Bit Definitions
1606 *
1607 * Bitmap definition of the ctrlBitMap in @ref pa802p1agDetConfig_t.
1608 *
1609 */
1610 /*@{*/
1611 /**
1612 * @def pa_802_1ag_DETECT_ENABLE
1613 * Control Info -- Set: Enable 802.1ag Detector
1614 * Clear: Disable 802.1ag Detector
1615 */
1616 #define pa_802_1ag_DETECT_ENABLE 0x0001
1617 /**
1618 * @def pa_802_1ag_DETECT_STANDARD
1619 * Control Info -- Set: Perform 802.1ag packet detection per 802.1ag formal standard
1620 * Clear: Perform 802.1ag packet detection per 802.1ag draft
1621 */
1622 #define pa_802_1ag_DETECT_STANDARD 0x0002
1623 /*@}*/
1624 /** @} */
1626 /**
1627 * @ingroup palld_api_structures
1628 * @brief 802.1ag Detection Configuration Information.
1629 *
1630 * @details The 802.1ag packet can be recognized with ether type equal to 0x8902 normally. However, the PASS can be
1631 * configured to further qualify the IEEE 802.1ag packet per one of the following criteria:
1632 * - 802.1ag standard: Destion MAC address = 01-80-c2-00-00-3x, Ether type = 0x8902
1633 * - 802.1ag draft: Destion MAC address = 01-80-c2-xx-xx-xx, Ether type = 0x8902
1634 *
1635 * @note The 802.1ag detector is disabled by default.
1636 * @note refer to the @ref ErouteTypes for the corresponding exception routes.
1637 *
1638 */
1639 typedef struct {
1640 uint16_t ctrlBitMap; /**< 802.1ag Detector control info as defined at @ref pa802p1agDetectInfo */
1641 } pa802p1agDetConfig_t;
1644 /**
1645 * @defgroup ipsecNatTCtrlInfo PA IPSEC NAT-T Control Bit Definitions
1646 * @ingroup palld_api_constants
1647 * @{
1648 *
1649 * @name PA IPSEC NAT-T Control Bit Definitions
1650 *
1651 * Bitmap definition of the ctrlBitMap in @ref paIpsecNatTConfig_t.
1652 *
1653 */
1654 /*@{*/
1655 /**
1656 * @def pa_IPSEC_NAT_T_CTRL_ENABLE
1657 * Control Info -- Set: Enable IPSEC NAT-T packet detection
1658 * Clear: Disable IPSEC NAT-T packet detection
1659 */
1660 #define pa_IPSEC_NAT_T_CTRL_ENABLE 0x0001
1661 /**
1662 * @def pa_IPSEC_NAT_T_CTRL_LOC_LUT1
1663 * Control Info -- Set: Perform IPSEC NAT-T packet detection at Ingress 1 (LUT1) stage
1664 * Clear: Perform IPSEC NAT-T packet detection at Ingress 4 (LUT2) stage (default)
1665 *
1666 * @details The IPSEC ESP NAT-T packet detector is implemented at the processing stage (PDSP3) where
1667 * the LUT2 classification occurs at the first generation PASS. The drawback is that the
1668 * detected IPSEC ESP NAT-T packet has to be re-routed into the PASS Outer IP processing
1669 * stage (PDSP1) for continuous processing and this operation reduces the overall throughput.
1670 * In the 2nd generation PASS, the IPSEC NAT-T detector is implemented within Ingress 1
1671 * (Outer IP and IPSEC) processing stage to avoid the re-entry operation. However, the detector
1672 * is also implemented at the Ingress4 (LUT2) stage to maintain backward compatibility.
1673 * It is recommended to set this flag to one to enable the IPSEC ESP NAT-T detector at Ingress 1
1674 * stage to maintain the maxmium PASS throughput.
1675 *
1676 * @note: This feature is only supported by the second generation of PASS and this control bit will be
1677 * ignored at the device which uses the first generation of PASS.
1678 *
1679 */
1680 #define pa_IPSEC_NAT_T_CTRL_LOC_LUT1 0x0002
1681 /*@}*/
1682 /** @} */
1684 /**
1685 * @ingroup palld_api_structures
1686 * @brief IPSEC NAT-T Packet Detection Configuration Information.
1687 *
1688 * @details paIpsecNatTConfig_t is used to configure the IPSEC NAT-T packet detector which is disabled
1689 * until this configuration is invoked through API @ref Pa_control.
1690 *
1691 * @note The IPSEC NAT-T packet detector is disabled by default.
1692 * @note refer to the @ref ErouteTypes for the corresponding exception routes.
1693 *
1694 */
1695 typedef struct {
1697 uint16_t ctrlBitMap; /**< IPSEC NAT-T control info as defined at @ref ipsecNatTCtrlInfo */
1698 uint16_t udpPort; /**< Specify the UDP port number which uniquely identifies the IPSEC NAT-T packets */
1699 } paIpsecNatTConfig_t;
1701 /**
1702 * @defgroup paGtpuCtrlInfo PA GTPU Control Bit Definitions
1703 * @ingroup palld_api_constants
1704 * @{
1705 *
1706 * @name PA GTPU Control Bit Definitions
1707 *
1708 * Bitmap definition of the ctrlBitmap in @ref paGtpuConfig_t.
1709 *
1710 */
1711 /*@{*/
1712 /**
1713 * @def pa_GTPU_CTRL_USE_LINK
1714 * Control Info -- Set: GTU-U classification vector consists of the least significant 24-bit of tunnel ID and 8-bit link
1715 * of previous matching
1716 * Clear: GTU-U classification vector consists of the 32-bit of tunnel ID only (Default)
1717 */
1718 #define pa_GTPU_CTRL_USE_LINK 0x0001
1719 /*@}*/
1720 /** @} */
1722 /**
1723 * @ingroup palld_api_structures
1724 * @brief GTP-U Configuration Information.
1725 *
1726 * @details Due to the LUT2 engine using 32-bit matching parameter, the default GTP-U classification is solely based
1727 * on its 32-bit tunnel ID. However, it is desirable to match the GTP-U tunnel with both tunnel ID and
1728 * previous link information. This configuration can be used to modify GTP-U classification vector by
1729 * combining least significant 24-bit of tunnel ID and an 8-bit previous link. It should be passed to
1730 * @ref Pa_control() API at system startup.
1731 *
1732 * @note GTP-U configuration should be performed at system startup. PASS does not support GTP-U
1733 * reconfiguration at run time.
1734 * @note This configuration is used at the first generation of PASS and it is still supported by the second generation PASS
1735 * for backward compatibility only. It does not have real effect since the advanced LUT2 engine supports GTPU 32-bit
1736 * Tunnel-ID classification with L3 link. It is not necessary to restrict the effective tunnel-ID to 24-bit.
1737 *
1738 */
1739 typedef struct {
1740 uint16_t ctrlBitMap; /**< GTP-U configuration control info as defined at @ref paGtpuCtrlInfo */
1741 } paGtpuConfig_t;
1744 /**
1745 * @defgroup paCtrlCode PA Control Code
1746 * @ingroup palld_api_constants
1747 * @{
1748 *
1749 * @name PA Control Code
1750 *
1751 * @brief Define the PA LLD control code
1752 *
1753 */
1754 /** @ingroup paCtrlCode */
1755 /* @{ */
1756 /**
1757 * @def pa_CONTROL_SYS_CONFIG
1758 * system-level configuration
1759 */
1760 #define pa_CONTROL_SYS_CONFIG 0
1762 /**
1763 * @def pa_CONTROL_802_1ag_CONFIG
1764 * 802.1ag Detector configuration
1765 */
1766 #define pa_CONTROL_802_1ag_CONFIG 1
1768 /**
1769 * @def pa_CONTROL_IPSEC_NAT_T_CONFIG
1770 * IPSEC NAT-T Packet Detector configuration
1771 */
1772 #define pa_CONTROL_IPSEC_NAT_T_CONFIG 2
1774 /**
1775 * @def pa_CONTROL_GTPU_CONFIG
1776 * GTP-U configuration
1777 */
1778 #define pa_CONTROL_GTPU_CONFIG 3
1780 /**
1781 * @def pa_CONTROL_RA_CONFIG
1782 * Global RA_configuration
1783 */
1784 #define pa_CONTROL_RA_CONFIG 4
1786 /* @} */
1787 /** @} */
1790 /**
1791 * @ingroup palld_api_structures
1792 * @brief PA Control Information structure
1793 *
1794 * @details Data structure defines PA control information used by API @ref Pa_control.
1795 *
1796 */
1797 typedef struct {
1798 uint16_t code; /**< Specify the PA control code as defined at @ref paCtrlCode */
1799 union {
1800 paSysConfig_t sysCfg; /**< Specify system-level configuration parameters */
1801 pa802p1agDetConfig_t pa802p1agDetCfg; /**< Specify 802.1ag Detector configuration parameters */
1802 paIpsecNatTConfig_t ipsecNatTDetCfg; /**< Specify IPSEC NAT-T Detector configuration parameters */
1803 paGtpuConfig_t gtpuCfg; /**< Specify GTP-U configuration parameters */
1804 paRaConfig_t raCfg; /**< Specify RA global configuration information (PASS Gen2 only) */
1805 }params; /**< Contain the control operation specific parameters */
1807 } paCtrlInfo_t;
1809 /**
1810 * @ingroup palld_api_structures
1811 * @brief The return type for module functions
1812 *
1813 * @details Function calls to this module return values used to determine if the command was successful or
1814 * the reason for failure (see @ref ReturnValues).
1815 */
1817 typedef int paReturn_t;
1819 /**
1820 * @ingroup palld_api_structures
1821 * @brief paCmdReply_t is used to specify command result (from PASS) routing information
1822 *
1823 * @details Commands sent to packet accelerator sub-system will generate replies. These replies
1824 * can be either discarded by the sub-system or routed to a queue. Command replies that
1825 * must be forwarded back to this module are detailed for each command. The module user
1826 * typically either selects a unique destination queue for command replies, or else supplies
1827 * a unique value for replyId. This value is placed into software info word 0 in the
1828 * packet descriptor for the returned command. The data in the returned packet is not
1829 * typically examined by the module user, but passed directly back to this module through
1830 * API function @ref Pa_forwardResult to examine the results of the command.
1831 */
1832 typedef struct {
1834 int dest; /**< Packet destination, must be pa_DEST_HOST or pa_DEST_DISCARD, see @ref pktDest */
1835 uint32_t replyId; /**< Value placed in swinfo0 in reply packet */
1836 uint16_t queue; /**< Destination queue for destination pa_DEST_HOST */
1837 uint8_t flowId; /**< Flow ID used on command reply from PASS */
1839 } paCmdReply_t;
1841 /**
1842 * @ingroup palld_api_constants
1843 * @brief Define the maximum number of buffers the module can request
1844 *
1845 */
1846 #define pa_N_BUFS_GEN1 5
1847 #define pa_N_BUFS_GEN2 7
1849 #define pa_N_BUFS pa_N_BUFS_GEN2
1851 /**
1852 * @defgroup paBufIndex PA Memory Buffer Index
1853 * @ingroup palld_api_constants
1854 * @{
1855 *
1856 * @name PA Memory Buffer Index
1857 * @brief Define the buffer inedex of the PA LLD memory blocks.
1858 *
1859 */
1860 /* @{ */
1861 /**
1862 * @def pa_BUF_INST
1863 * PA LLD instance buffer
1864 */
1865 #define pa_BUF_INST 0
1866 /**
1867 * @def pa_BUF_L2_TABLE
1868 * PA LLD match table of Layer 2 (MAC/SRIO) entries
1869 */
1870 #define pa_BUF_L2_TABLE 1
1871 /**
1872 * @def pa_BUF_L3_TABLE
1873 * PA LLD match table of Layer 3 (IP/CustomLUT1) entries
1874 */
1875 #define pa_BUF_L3_TABLE 2
1876 /**
1877 * @def pa_BUF_USR_STATS_TABLE
1878 * PA LLD link table of user-defined statistics
1879 */
1880 #define pa_BUF_USR_STATS_TABLE 3
1881 /**
1882 * @def pa_BUF_VLINK_TABLE
1883 * PA LLD match table of virtual link entries
1884 */
1885 #define pa_BUF_VLINK_TABLE 4
1886 /**
1887 * @def pa_BUF_ACL_TABLE
1888 * PA LLD match table of ACL entries
1889 *
1890 * @note This definition is valid for the second generation PASS only.
1891 */
1892 #define pa_BUF_ACL_TABLE 5
1893 /**
1894 * @def pa_BUF_FC_TABLE
1895 * PA LLD match table of Flow Cache entries
1896 *
1897 * @note This definition is valid for the second generation PASS only.
1898 */
1899 #define pa_BUF_FC_TABLE 6
1901 /* @} */
1902 /** @} */
1905 /**
1906 * @ingroup palld_api_functions
1907 * @brief Pa_getBufferReq returns the memory requirements for the PA driver
1908 *
1909 * @details This function returns the memory buffer requirements in term
1910 * of the size and alignment array. The PA LLD requires up to
1911 * four memory blocks as described below:
1912 * - PA Instance: PA instance data
1913 * - L2 Table: Layer-2 (MAC/SRIO) entry information
1914 * - L3 Table: Layer-3 (IP/Custom LUT1) entry information
1915 * - User Statistics Link Table: User-defined Statistics entry information (Optional)
1916 *
1917 * @param[in] sizeCfg Size configuration information
1918 * @param[out] sizes Array of size requirements
1919 * @param[out] aligns Array of alignment requirements
1920 * @retval Value (@ref ReturnValues)
1921 *
1922 * @note This function specifies the minimum memory buffer requirements, it is up to the
1923 * module user to round up the buffer alignemnt and size to the cache line boundary
1924 * to ensure cache coherency if cacheable memory is used.
1925 */
1926 paReturn_t Pa_getBufferReq (paSizeInfo_t *sizeCfg, int sizes[], int aligns[]);
1928 /**
1929 * @ingroup palld_api_functions
1930 * @brief Pa_create creates the PA driver instance
1931 *
1932 * @details This function initializes the PA driver based on user configuration
1933 *
1934 * @param[in] cfg Configuration information
1935 * @param[in] bases Array of the memory buffer base addresses
1936 * @param[out] pHandle Instance handle. This is a pointer to an initialized
1937 * instance structure.
1938 * @retval Value (@ref ReturnValues)
1939 */
1940 paReturn_t Pa_create (paConfig_t *cfg, void* bases[], Pa_Handle *pHandle);
1942 /**
1943 * @ingroup palld_api_functions
1944 * @brief Pa_startCfg Adds PA configuration
1945 * @details This function needs to be called from all cores to initialize PA with
1946 * per core configurations
1947 *
1948 * @param[in] handle The PA LLD instance identifier
1949 * @param[in] startCfg PA start configuration
1950 * @retval None
1951 */
1952 void Pa_startCfg (Pa_Handle handle, paStartCfg_t *startCfg);
1954 /**
1955 * @ingroup palld_api_functions
1956 * @brief Pa_close decativates the PA driver instance
1957 *
1958 * @details This function deactivates the PA driver instance, all the associated
1959 * memory buffers can be freed after this call.
1960 *
1961 * @param[in] handle The PA LLD instance identifier
1962 * @param[out] bases Array of the memory buffer base addresses
1963 * @retval Value (@ref ReturnValues)
1964 */
1965 paReturn_t Pa_close (Pa_Handle handle, void* bases[]);
1967 /**
1968 * @ingroup palld_api_functions
1969 * @brief Pa_control performs system-level control and configuration
1970 *
1971 * @details This function performs PASS control operations including system-level figurations.
1972 * The system-level configurations are divided into several sub-groups which can be configured
1973 * independently. The default configuration will be used until this API is invoked.
1974 *
1975 * On return the command buffer (cmd) contains a formatted command for the sub-system when the cmdSize
1976 * is set to non-zero. The destination for the command is provided in cmdDest. The module user must send
1977 * the formatted command to the sub-system. The sub-system will generate a reply
1978 * and this reply must be sent back to this module through the @ref Pa_forwardResult API.
1979 *
1980 *
1981 * @param[in] handle The PA LLD instance identifier
1982 * @param[in] ctrl Control information
1983 * @param[out] cmd Where the created command is placed
1984 * @param[in,out] cmdSize Input the size of cmd buffer, on output the actual size used. @ref cmdMinBufSize
1985 * @param[in] reply Where the sub-system sends the command reply
1986 * @param[out] cmdDest Value (@ref cmdTxDest)
1987 * @retval Value (@ref ReturnValues)
1988 */
1989 paReturn_t Pa_control (Pa_Handle handle,
1990 paCtrlInfo_t *ctrl,
1991 paCmd_t cmd,
1992 uint16_t *cmdSize,
1993 paCmdReply_t *reply,
1994 int *cmdDest);
1997 /**
1998 * @defgroup pktDest Routed Packet Destinations
1999 * @ingroup palld_api_constants
2000 * @{
2001 *
2002 * @name Routed Packet Destinations
2003 *
2004 * @brief The module user specifies packet destinations for packets exiting the packet accelerator sub-system.
2005 *
2006 * @details The destination of packets that leave the packet accelerator sub-system
2007 * are provided to the module in the @ref paRouteInfo_t structure and passed
2008 * to the module through the @ref Pa_addMac, @ref Pa_addSrio, @ref Pa_addIp, @ref Pa_addCustomLUT1,
2009 * @ref Pa_addCustomLUT2 and @ref Pa_addPort functions
2010 */
2011 /** @ingroup pktDest */
2012 /* @{ */
2014 /**
2015 * @def pa_DEST_DISCARD
2016 * packet is discarded
2017 */
2018 #define pa_DEST_DISCARD 3 /**< Packet is discarded */
2020 /**
2021 * @def pa_DEST_CONTINUE_PARSE_LUT1
2022 * packet remains in PA sub-system for more parsing and LUT1 classification
2023 */
2024 #define pa_DEST_CONTINUE_PARSE_LUT1 4 /**< Packet remains in PA sub-system for more parsing and LUT1 classification */
2026 /**
2027 * @def pa_DEST_CONTINUE_PARSE_LUT2
2028 * packet remains in PA sub-system for more parsing and LUT2 classification.
2029 */
2030 #define pa_DEST_CONTINUE_PARSE_LUT2 5 /**< Packet remains in PA sub-system for more parsing and LUT2 classification */
2032 /**
2033 * @def pa_DEST_HOST
2034 * host thread
2035 */
2036 #define pa_DEST_HOST 6 /**< Packet is routed to host */
2038 /**
2039 * @def pa_DEST_EMAC
2040 * ethernet mac port (of the switch)
2041 */
2042 #define pa_DEST_EMAC 7 /**< Packet is routed to EMAC */
2044 /**
2045 * @def pa_DEST_SASS
2046 * security accelerator destination
2047 */
2048 #define pa_DEST_SASS 8 /**< Packet is routed to SA */
2050 /**
2051 * @def pa_DEST_SASS_LOC_DMA
2052 * security accelerator destination via local DMA
2053 *
2054 * @note This definition is valid for the second generation of PASS only.
2055 */
2056 #define pa_DEST_SASS_LOC_DMA 11 /**< Packet is routed to SA through local DMA */
2058 /**
2059 * @def pa_DEST_SRIO
2060 * SRIO interface
2061 */
2062 #define pa_DEST_SRIO 9 /**< Packet is routed to SRIO */
2064 /**
2065 * @def pa_DEST_CASCADED_FORWARDING_LUT1
2066 * Cascaded forwarding packet remains in PA sub-system for next LUT1 (IP) parsing. Those packets are expected to
2067 * be delivered to QoS queues based on the VLAN/DSCP priority at the next stage so that some PASS actions such
2068 * as IP reassembly and IP fragment exception route will be disabled.
2069 */
2070 #define pa_DEST_CASCADED_FORWARDING_LUT1 10
2072 /**
2073 * @def pa_DEST_EFLOW
2074 * packet remains in PA sub-system for egress flow operation
2075 *
2076 * @note This definition is valid for the second generation of PASS only.
2077 */
2078 #define pa_DEST_EFLOW 12 /**< Packet is routed to Egress Flow Path */
2080 /**
2081 * @def pa_DEST_RES_1
2082 * Reseved destination for internal usage
2083 *
2084 * @note This definition is valid for the second generation of PASS only.
2085 */
2086 #define pa_DEST_RES_1 20
2088 /**
2089 * @def pa_DEST_RES_2
2090 * Reseved destination for internal usage
2091 *
2092 * @note This definition is valid for the second generation of PASS only.
2093 */
2094 #define pa_DEST_RES_2 21
2097 /* @} */
2098 /** @} */
2100 /**
2101 * @defgroup paEmacPort Ethernet MAC port
2102 * @ingroup palld_api_constants
2103 * @{
2104 *
2105 * @name Ethernet MAC port
2106 *
2107 * @brief The module user specifies the Ethernet MAC port of the ingress and egress packets.
2108 *
2109 * @details In the from-network direction, the module user can specify the input port as one of classification parameters.
2110 * In the to-network direction, the module user can force the egress packets to be sent over the specified
2111 * destination Ethernet MAC port of the switch regreless of its states or configurations.
2112 */
2113 /** @ingroup customType */
2114 /* @{ */
2115 /**
2116 * @def pa_EMAC_PORT_NOT_SPECIFIED
2117 * From-Netwprk: Don't care
2118 * To-Network: Use standard switch forwarding
2119 */
2120 #define pa_EMAC_PORT_NOT_SPECIFIED 0
2122 /* @def pa_EMAC_PORT_0
2123 * Use EMAC Port 0
2124 */
2125 #define pa_EMAC_PORT_0 1
2127 /* @def pa_EMAC_PORT_1
2128 * Use EMAC Port 1
2129 */
2130 #define pa_EMAC_PORT_1 2
2132 /* @def pa_EMAC_PORT_2
2133 * Use EMAC Port 2
2134 */
2135 #define pa_EMAC_PORT_2 3
2137 /* @def pa_EMAC_PORT_3
2138 * Use EMAC Port 3
2139 */
2140 #define pa_EMAC_PORT_3 4
2142 /* @def pa_EMAC_PORT_4
2143 * Use EMAC Port 4
2144 */
2145 #define pa_EMAC_PORT_4 5
2147 /* @def pa_EMAC_PORT_5
2148 * Use EMAC Port 5
2149 */
2150 #define pa_EMAC_PORT_5 6
2152 /* @def pa_EMAC_PORT_6
2153 * Use EMAC Port 6
2154 */
2155 #define pa_EMAC_PORT_6 7
2157 /* @def pa_EMAC_PORT_7
2158 * Use EMAC Port 7
2159 */
2160 #define pa_EMAC_PORT_7 8
2162 /* @} */
2163 /** @} */
2165 /**
2166 * @defgroup emcOutputCtrlBits Ethernet MAC Output Control Bit Definitions
2167 * @ingroup palld_api_constants
2168 * @{
2169 *
2170 * @name Ethernet MAC Output Control Bit Definition
2171 *
2172 * Bitmap definition of the emacCtrl at @ref paRouteInfo_t.
2173 *
2174 */
2175 /*@{*/
2176 /**
2177 * @def pa_EMAC_CTRL_PORT_MASK
2178 * Control Info -- EMAC port mask
2179 */
2180 #define pa_EMAC_CTRL_PORT_MASK 0x0F
2181 /**
2182 * @def pa_EMAC_CTRL_CRC_DISABLE
2183 * Control Info -- 0:EMAC port computes and inserts CRC
2184 * 1:EMAC port does not generate CRC
2185 */
2186 #define pa_EMAC_CTRL_CRC_DISABLE 0x80
2188 /* @} */
2189 /** @} */
2191 /**
2192 * @defgroup customType Custom Classification Types
2193 * @ingroup palld_api_constants
2194 * @{
2195 *
2196 * @name Custom Classification Types
2197 *
2198 * @brief The module user specifies the custom classification types.
2199 *
2200 * @details The optional custom classification rule may be used to further parse and calssify the incoming
2201 * packet.
2202 */
2203 /** @ingroup customType */
2204 /* @{ */
2205 /**
2206 * @def pa_CUSTOM_TYPE_NONE
2207 * Use standard classification
2208 */
2209 #define pa_CUSTOM_TYPE_NONE 0
2211 /* @def pa_CUSTOM_TYPE_LUT1
2212 * Custom classification with LUT1
2213 */
2214 #define pa_CUSTOM_TYPE_LUT1 1
2216 /* @def pa_CUSTOM_TYPE_LUT2
2217 * Custom classification with LUT2
2218 */
2219 #define pa_CUSTOM_TYPE_LUT2 2
2221 /* @} */
2222 /** @} */
2224 /**
2225 * @brief The maximum number of LUT1 Custom Types supported
2226 */
2227 #define pa_MAX_CUSTOM_TYPES_LUT1 4
2230 /**
2231 * @brief The maximum number of LUT2 Custom Types supported
2232 */
2233 #define pa_MAX_CUSTOM_TYPES_LUT2 16
2236 /**
2237 * @defgroup cmdTxDestGen1 Command/Transmit Packet Destinations for first generation NSS
2238 * @ingroup palld_api_constants
2239 * @{
2240 *
2241 * @name Command/Transmit Packet Destinations for first generation NSS
2242 *
2243 * @brief These values specify the offsets to the NSS Tx base queue and they are used by the module user to deliver
2244 * the configuration packets to the specific PDSP Cluster within PASS.
2245 *
2246 * @note These values are used by LLD as the return value of cmdDest of PASS configuration APIs. They are defined here
2247 * for reference purpose only.
2248 */
2249 /* @{ */
2250 /**
2251 * @def pa_CMD_TX_DEST_0_GEN1
2252 * Destination PDSP0
2253 */
2254 #define pa_CMD_TX_DEST_0_GEN1 0 /**< Packet is sent to PDSP0 */
2256 /**
2257 * @def pa_CMD_TX_DEST_1_GEN1
2258 * Destination PDSP1
2259 */
2260 #define pa_CMD_TX_DEST_1_GEN1 1 /**< Packet is sent to PDSP1 */
2262 /**
2263 * @def pa_CMD_TX_DEST_2_GEN1
2264 * Destination PDSP2
2265 */
2266 #define pa_CMD_TX_DEST_2_GEN1 2 /**< Packet is sent to PDSP2 */
2268 /**
2269 * @def pa_CMD_TX_DEST_3_GEN1
2270 * Destination PDSP3
2271 */
2272 #define pa_CMD_TX_DEST_3_GEN1 3 /**< Packet is sent to PDSP3 */
2274 /**
2275 * @def pa_CMD_TX_DEST_4_GEN1
2276 * Destination PDSP4
2277 */
2278 #define pa_CMD_TX_DEST_4_GEN1 4 /**< Packet is sent to PDSP4 */
2280 /**
2281 * @def pa_CMD_TX_DEST_5_GEN1
2282 * Destination PDSP5
2283 */
2284 #define pa_CMD_TX_DEST_5_GEN1 5 /**< Packet is sent to PDSP5 */
2286 /* @} */
2287 /** @} */
2289 /**
2290 * @defgroup cmdTxDestGen2 Command/Transmit Packet Destinations for second generation NSS
2291 * @ingroup palld_api_constants
2292 * @{
2293 *
2294 * @name Command/Transmit Packet Destinations for second generation NSS
2295 *
2296 * @brief These values specify the offset to the NSS Tx base queue and they are used by the module user to deliver
2297 * the configuration packets to the specific PDSP Cluster within PASS.
2298 *
2299 * @note These values are used by LLD as the return value of cmdDest of PASS configuration APIs. They are defined here
2300 * for reference purpose only.
2301 */
2302 /* @{ */
2303 /**
2304 * @def pa_CMD_TX_DEST_0_GEN2
2305 * Destination CLUSTER0
2306 */
2307 #define pa_CMD_TX_DEST_0_GEN2 8 /**< Packet is sent to INGRESS0 */
2309 /**
2310 * @def pa_CMD_TX_DEST_1_GEN2
2311 * Destination CLUSTER1
2312 */
2313 #define pa_CMD_TX_DEST_1_GEN2 9 /**< Packet is sent to INGRESS1 */
2315 /**
2316 * @def pa_CMD_TX_DEST_2_GEN2
2317 * Destination CLUSTER2
2318 */
2319 #define pa_CMD_TX_DEST_2_GEN2 10 /**< Packet is sent to INGRESS2 */
2321 /**
2322 * @def pa_CMD_TX_DEST_3_GEN2
2323 * Destination CLUSTER3
2324 */
2325 #define pa_CMD_TX_DEST_3_GEN2 11 /**< Packet is sent to INGRESS3 */
2327 /**
2328 * @def pa_CMD_TX_DEST_4_GEN2
2329 * Destination CLUSTER4
2330 */
2331 #define pa_CMD_TX_DEST_4_GEN2 12 /**< Packet is sent to INGRESS4 */
2333 /**
2334 * @def pa_CMD_TX_DEST_5_GEN2
2335 * Destination CLUSTER5
2336 */
2337 #define pa_CMD_TX_DEST_5_GEN2 13 /**< Packet is sent to POST */
2339 /**
2340 * @def pa_CMD_TX_DEST_6_GEN2
2341 * Destination CLUSTER6
2342 */
2343 #define pa_CMD_TX_DEST_6_GEN2 14 /**< Packet is sent to EGRESS0 */
2345 /**
2346 * @def pa_CMD_TX_DEST_7_GEN2
2347 * Destination CLUSTER7
2348 */
2349 #define pa_CMD_TX_DEST_7_GEN2 15 /**< Packet is sent to EGRESS1 */
2350 /**
2351 * @def pa_CMD_TX_DEST_8_GEN2
2352 * Destination CLUSTER8
2353 */
2354 #define pa_CMD_TX_DEST_8_GEN2 16 /**< Packet is sent to EGRESS2 */
2356 /* @} */
2357 /** @} */
2359 /**
2360 * @defgroup cmdTxDest Command/Transmit Packet Destinations for NSS
2361 * @ingroup palld_api_constants
2362 * @{
2363 *
2364 * @name Command/Transmit Packet Destinations for NSS
2365 *
2366 * @brief Define the command destination based on the compiler switch NSS_GEN2 to cover both @ref cmdTxDestGen1
2367 * and @ref cmdTxDestGen2. These values are used by the LLD only and are not required by the application.
2368 */
2369 /* @{ */
2370 #ifndef NSS_GEN2
2371 #define pa_CMD_TX_DEST_0 pa_CMD_TX_DEST_0_GEN1
2372 #define pa_CMD_TX_DEST_1 pa_CMD_TX_DEST_1_GEN1
2373 #define pa_CMD_TX_DEST_2 pa_CMD_TX_DEST_2_GEN1
2374 #define pa_CMD_TX_DEST_3 pa_CMD_TX_DEST_3_GEN1
2375 #define pa_CMD_TX_DEST_4 pa_CMD_TX_DEST_4_GEN1
2376 #define pa_CMD_TX_DEST_5 pa_CMD_TX_DEST_5_GEN1
2377 #else
2378 #define pa_CMD_TX_DEST_0 pa_CMD_TX_DEST_0_GEN2
2379 #define pa_CMD_TX_DEST_1 pa_CMD_TX_DEST_1_GEN2
2380 #define pa_CMD_TX_DEST_2 pa_CMD_TX_DEST_2_GEN2
2381 #define pa_CMD_TX_DEST_3 pa_CMD_TX_DEST_3_GEN2
2382 #define pa_CMD_TX_DEST_4 pa_CMD_TX_DEST_4_GEN2
2383 #define pa_CMD_TX_DEST_5 pa_CMD_TX_DEST_5_GEN2
2384 #define pa_CMD_TX_DEST_6 pa_CMD_TX_DEST_6_GEN2
2385 #define pa_CMD_TX_DEST_7 pa_CMD_TX_DEST_7_GEN2
2386 #define pa_CMD_TX_DEST_8 pa_CMD_TX_DEST_8_GEN2
2387 #endif
2389 /* @} */
2390 /** @} */
2392 /**
2393 * @defgroup paLut1Inst PA LUT1 Instance Destinations
2394 * @ingroup palld_api_constants
2395 * @{
2396 *
2397 * @name PA LUT1 Instance Destinations
2398 *
2399 * @brief These values are used by the module user to specify the LUT1 table instance used by the specified IP, ACL or customLUT1 entry.
2400 * @note PA LLD will determine the appropriate LUT1 instance to add/configure LUT1 entry based on the types of API and the linking information
2401 * 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,
2402 * to overwrite the default rules.
2403 */
2404 /* @{ */
2405 /**
2406 * @def pa_LUT1_INST_0_0
2407 * LUT1 instance of Ingress0, PDSP0
2408 */
2409 #define pa_LUT1_INST_0_0 0 /**< LUT1 table connected to Ingress0, PDSP0 */
2411 /**
2412 * @def pa_LUT1_INST_0_1
2413 * LUT1 instance of Ingress0, PDSP1
2414 */
2415 #define pa_LUT1_INST_0_1 1 /**< LUT1 table connected to Ingress0, PDSP1 */
2417 /**
2418 * @def pa_LUT1_INST_1_0
2419 * LUT1 instance of Ingress1, PDSP0
2420 */
2421 #define pa_LUT1_INST_1_0 2 /**< LUT1 table connected to Ingress1, PDSP0 */
2423 /**
2424 * @def pa_LUT1_INST_0_1
2425 * LUT1 instance of Ingress1, PDSP1
2426 */
2427 #define pa_LUT1_INST_1_1 3 /**< LUT1 table connected to Ingress1, PDSP1 */
2429 /**
2430 * @def pa_LUT1_INST_2_0
2431 * LUT1 instance of Ingress2, PDSP0
2432 */
2433 #define pa_LUT1_INST_2_0 4 /**< LUT1 table connected to Ingress2, PDSP0 */
2435 /**
2436 * @def pa_LUT1_INST_3_0
2437 * LUT1 instance of Ingress3, PDSP0
2438 */
2439 #define pa_LUT1_INST_3_0 5 /**< LUT1 table connected to Ingress3, PDSP0 */
2441 /**
2442 * @def pa_LUT1_INST_4_0
2443 * LUT1 instance of Ingress4, PDSP0
2444 */
2445 #define pa_LUT1_INST_4_0 6 /**< LUT1 table connected to Ingress4, PDSP0 */
2447 /**
2448 * @def pa_LUT1_INST_5_0
2449 * LUT1 instance of Egress0, PDSP0
2450 */
2451 #define pa_LUT1_INST_5_0 7 /**< LUT1 table connected to Egress0, PDSP0 */
2454 /**< LUT1 instances of First Generation PASS */
2455 #define pa_LUT1_INST_0_GEN1 0 /**< LUT1 table connected to PDSP0 (PASS Gen1)*/
2456 #define pa_LUT1_INST_1_GEN1 1 /**< LUT1 table connected to PDSP1 (PASS Gen1)*/
2457 #define pa_LUT1_INST_2_GEN1 2 /**< LUT1 table connected to PDSP2 (PASS Gen1)*/
2458 #define pa_LUT1_INST_MAX_GEN1 pa_LUT1_INST_2_GEN1
2461 /**< LUT1 instances of Second Generation PASS */
2462 #define pa_LUT1_INST_0_GEN2 pa_LUT1_INST_0_0 /**< LUT1 table equivalent to Netcp 1.0 LUT1_0 (Pass Gen2)*/
2463 #define pa_LUT1_INST_1_GEN2 pa_LUT1_INST_1_0 /**< LUT1 table equivalent to Netcp 1.0 LUT1_1 (Pass Gen2)*/
2464 #define pa_LUT1_INST_2_GEN2 pa_LUT1_INST_4_0 /**< LUT1 table equivalent to Netcp 1.0 LUT1_2 (Pass Gen2)*/
2465 #define pa_LUT1_INST_MAX_GEN2 pa_LUT1_INST_5_0
2467 /**
2468 *
2469 * @name Common LUT1 instance for NSS
2470 *
2471 * @brief Define the LUT1 instance based on the compiler switch NSS_GEN2 to cover both generations of NSS.
2472 * These values are intended to be used by the LLD only. For the application which maintain the LUT1
2473 * tables should either use the LUT1 instance definitions with _GEN1 and _GEN2 suffix or these definitions
2474 * with the compiler switch NSS_GEN2 defined or undefined.
2475 */
2478 #ifndef NSS_GEN2
2479 /**
2480 * @def pa_LUT1_INST_0
2481 * LUT1 instance 0
2482 */
2483 #define pa_LUT1_INST_0 pa_LUT1_INST_0_GEN1 /**< LUT1 Instance 0 for MAC/SRIO */
2485 /**
2486 * @def pa_LUT1_INST_1
2487 * LUT1 instance 1
2488 */
2489 #define pa_LUT1_INST_1 pa_LUT1_INST_1_GEN1 /**< LUT1 instance 1 for Outer IP */
2491 /**
2492 * @def pa_LUT1_INST_2
2493 * LUT1 instance 2
2494 */
2495 #define pa_LUT1_INST_2 pa_LUT1_INST_2_GEN1 /**< LUT1 instance 2 for Inner IP */
2497 /**
2498 * @def pa_LUT1_INST_MAX
2499 * Specify the maximum LUT1 instance
2500 */
2501 #define pa_LUT1_INST_MAX pa_LUT1_INST_MAX_GEN1
2503 #else
2505 /**
2506 * @def pa_LUT1_INST_0
2507 * LUT1 instance 0
2508 */
2509 #define pa_LUT1_INST_0 pa_LUT1_INST_0_GEN2 /**< LUT1 Instance 0 for MAC/SRIO */
2511 /**
2512 * @def pa_LUT1_INST_1
2513 * LUT1 instance 1
2514 */
2515 #define pa_LUT1_INST_1 pa_LUT1_INST_1_GEN2 /**< LUT1 instance 1 for Outer IP */
2517 /**
2518 * @def pa_LUT1_INST_2
2519 * LUT1 instance 2
2520 */
2521 #define pa_LUT1_INST_2 pa_LUT1_INST_2_GEN2 /**< LUT1 Instance 2 for Inner IP */
2523 /**
2524 * @def pa_LUT1_INST_MAX
2525 * Specify the maximum LUT1 instance
2526 */
2527 #define pa_LUT1_INST_MAX pa_LUT1_INST_MAX_GEN2
2529 #endif
2530 /* @} */
2531 /** @} */
2533 /**
2534 * @defgroup paAclInst PA ACL LUT Instance Destinations
2535 * @ingroup palld_api_constants
2536 * @{
2537 *
2538 * @name PA ACL Lut Instance Destinations
2539 *
2540 * @brief These values are used by the module user to specify the ACL Lut instance
2541 *
2542 * @note These definitions are valid for the second generation PASS only.
2543 */
2544 /* @{ */
2546 /**
2547 * @def pa_ACL_INST_OUTER_IP
2548 * LUT1 instance of ACL Table 0 for Outer IP
2549 */
2550 #define pa_ACL_INST_OUTER_IP pa_LUT1_INST_0_1 /**< LUT1 table used for ACL Table 0 */
2553 /**
2554 * @def pa_ACL_INST_INNER_IP
2555 * LUT1 instance of ACL Table 1 for Inner IP
2556 */
2557 #define pa_ACL_INST_INNER_IP pa_LUT1_INST_3_0 /**< LUT1 table used for ACL Table 1 */
2559 /* @} */
2560 /** @} */
2563 /**
2564 * @defgroup paCrcInst PA CRC Engine Instance Destinations
2565 * @ingroup palld_api_constants
2566 * @{
2567 *
2568 * @name PA CRC Engine Instance Destinations
2569 *
2570 * @brief These values are used by the module user to specify the CRC Engine instance
2571 *
2572 * @note These definitions are valid for the second generation PASS only.
2573 */
2574 /* @{ */
2575 /**
2576 * @def pa_CRC_INST_0_0
2577 * CRC instance of Ingress0
2578 */
2579 #define pa_CRC_INST_0_0 0 /**< CRC Engine between Ingress0, CDE0 and CED1 */
2581 /**
2582 * @def pa_CRC_INST_1_0
2583 * CRC instance of Ingress1
2584 */
2585 #define pa_CRC_INST_1_0 1 /**< CRC Engine between Ingress1, CDE0 and CED1 */
2587 /**
2588 * @def pa_CRC_INST_4_0
2589 * LUT1 instance of Ingress4
2590 */
2591 #define pa_CRC_INST_4_0 2 /**< CRC Engine between Ingress4, CDE0 and CED1 */
2593 /**
2594 * @def pa_CRC_INST_5_0
2595 * LUT1 instance of Post
2596 */
2597 #define pa_CRC_INST_5_0 3 /**< CRC Engine between Post, CDE0 and CED1 */
2599 /**
2600 * @def pa_CRC_INST_6_0
2601 * CRC instance 0 of Egress0
2602 */
2603 #define pa_CRC_INST_6_0 4 /**< CRC Engine between Egress0, CDE0 and CED1 */
2605 /**
2606 * @def pa_CRC_INST_6_1
2607 * CRC instance 1 of Egress0
2608 */
2609 #define pa_CRC_INST_6_1 5 /**< CRC Engine between Egress0, CDE1 and CED2 */
2611 /**
2612 * @def pa_CRC_INST_MAX
2613 * Specify the maximum CRC Engine instance
2614 */
2615 #define pa_CRC_INST_MAX pa_CRC_INST_6_1
2617 /* @} */
2618 /** @} */
2620 /**
2621 * @defgroup paRaInst PA RA Instance Destinations
2622 * @ingroup palld_api_constants
2623 * @{
2624 *
2625 * @name PA RA Instance Destinations
2626 *
2627 * @brief These values are used by the module user to specify the RA instance (group)
2628 *
2629 * @note These definitions are valid for the second generation PASS only.
2630 */
2631 /* @{ */
2632 /**
2633 * @def pa_RA_INST_0
2634 * RA instance of Outer IP
2635 */
2636 #define pa_RA_INST_0 0 /**< RA instance to be accessed from Ingress0, PDSP1 for outer IP reassembly */
2639 /**
2640 * @def pa_RA_INST_1
2641 * RA instance of Inner IP
2642 */
2643 #define pa_RA_INST_1 1 /**< RA instance to be accessed from Ingress3, PDSP0 for inner IP reassembly */
2645 /**
2646 * @def pa_RA_INST_MAX
2647 * Specify the maximum RA instance
2648 */
2649 #define pa_RA_INST_MAX pa_RA_INST_1
2651 /* @} */
2652 /** @} */
2654 /**
2655 * @defgroup paCmdCode Command Code
2656 * @ingroup palld_api_constants
2657 * @{
2658 *
2659 * @name PA Command Codes
2660 *
2661 * @brief Define the commands which can be executed in PASS
2662 *
2663 * @details A single command or a set of commands can be executed to support fully-offloaded
2664 * data path in both the transmit (to network) and receive (from network) directions.
2665 * In the to-network direction, the list of commands formatted by the module should
2666 * be stored as the protocol-specific information at the packet descriptor with the
2667 * packet. The commands will be executed in order at PASS and the associated security
2668 * accelerator sub-system (SASS). The executed commands will be removed by PASS and
2669 * SASS so that the output packet will not contain any command.
2670 * In the from-network direction, the list of commands formatted by the module will
2671 * be stored at the PASS as a command set which can be referred to by the command set
2672 * index. A single command including a command set can be executed per the enhanced
2673 * routing information @ref paRouteInfo_t after a LUT1 or LUT2 matches.
2674 *
2675 * @note The packet offset specified at each command of the command list should be strictly
2676 * in ascending order becasue the PASS processes the list of commands in order and it
2677 * can not move backwards. The command violating the order requirement may be detected
2678 * and rejected by the API @ref Pa_formatTxCmd and @ref Pa_configCmdSet. In the case,
2679 * the order constraint can not be validated at the LLD, the violating command will
2680 * be ignored by the PASS.
2681 */
2682 /** @ingroup paCmdCode */
2683 /* @{ */
2684 /**
2685 * @def pa_CMD_NONE
2686 * End of commands
2687 */
2688 #define pa_CMD_NONE 0
2690 /* @def pa_CMD_NEXT_ROUTE
2691 * Specifies next route
2692 */
2693 #define pa_CMD_NEXT_ROUTE 1
2695 /* @def pa_CMD_CRC_OP
2696 * CRC generation or verification
2697 */
2698 #define pa_CMD_CRC_OP 2
2700 /* @def pa_CMD_COPY_DATA_TO_PSINFO
2701 * Copy Data from the packet to the PS Info Area in the packet descriptor
2702 */
2703 #define pa_CMD_COPY_DATA_TO_PSINFO 3
2705 /* @def pa_CMD_PATCH_DATA
2706 * Insert or patch packet data at the specific location
2707 */
2708 #define pa_CMD_PATCH_DATA 4
2710 /* @def pa_CMD_TX_CHECKSUM
2711 * Compute and insert checksum
2712 */
2713 #define pa_CMD_TX_CHECKSUM 5
2715 /* @def pa_CMD_MULTI_ROUTE
2716 * Duplicate packet to multiple destinations
2717 */
2718 #define pa_CMD_MULTI_ROUTE 6
2720 /* @def pa_CMD_REPORT_TX_TIMESTAMP
2721 * Report the tx packet exit time in term of PASS 48-bit timestamp
2722 */
2723 #define pa_CMD_REPORT_TX_TIMESTAMP 7
2725 /* @def pa_CMD_REMOVE_HEADER
2726 * Remove the parsed packet header
2727 * @note It should be the first command in the rx command set
2728 */
2729 #define pa_CMD_REMOVE_HEADER 8
2731 /* @def pa_CMD_REMOVE_TAIL
2732 * Remove the parsed packet tail
2733 *
2734 * @note It should be the last command next to the next route or multi-route command
2735 */
2736 #define pa_CMD_REMOVE_TAIL 9
2739 /* @def pa_CMD_CMDSET
2740 * Specify the command set to be executed
2741 */
2742 #define pa_CMD_CMDSET 10
2744 /* @def pa_CMD_SA_PAYLOAD
2745 * Specify the payload information required by SASS
2746 */
2747 #define pa_CMD_SA_PAYLOAD 11
2749 /* @def pa_CMD_IP_FRAGMENT
2750 * Perform IPv4 fragmentation
2751 */
2752 #define pa_CMD_IP_FRAGMENT 12
2754 /* @def pa_CMD_USR_STATS
2755 * Update the specified user-defined counter and the counters which are linked to this counter
2756 */
2757 #define pa_CMD_USR_STATS 13
2760 /* @def pa_CMD_CMDSET_AND_USR_STATS
2761 * Combination of the CMDSET and USR_STATS commands.
2762 * @note It is only used as a command executed after the last classification per the enhanced routing
2763 * information
2764 */
2765 #define pa_CMD_CMDSET_AND_USR_STATS 14
2767 /* @def pa_CMD_PATCH_MSG_LEN
2768 * Update the message length field within some L2 protocol header such as 802.3 and PPPoE after the
2769 * potential IP fragmentation operation
2770 * @note This command is only used in conjunction with the pa_CMD_IP_FRAGMENT command.
2771 */
2772 #define pa_CMD_PATCH_MSG_LEN 15
2774 /* @def pa_CMD_VERIFY_PKT_ERROR
2775 * Verify the packet error based on the CPPI error flags as specified at @ref Appendix2 and forward
2776 * the error packet to the specified destination
2777 * @note This packet error verification is not applicable to the CRC verification operation within the same
2778 * command set.
2779 * @note This command should be either the last command or the second last to the nextRoute command since
2780 * all commands following this operation will be ignored if packet error is found.
2781 */
2782 #define pa_CMD_VERIFY_PKT_ERROR 16
2785 /* @def pa_CMD_SPLIT
2786 * Split the packet into header and payload portion to be delivered to different queues with
2787 * different CPPI flows
2788 * @note This command is only supported in the from-network direction
2789 * @note This command should be placed ahead of any pa_CMD_PATCH command so that the header size can be adjusted accordingly
2790 * @note The first 8-byte of psInfo area is reserved for this operation, therefore, the destOffset of pa_CMD_COPY_DATA_TO_PSINFO
2791 * commands within the same command set should be 8 or larger.
2792 *
2793 */
2795 #define pa_CMD_SPLIT 17
2797 /* @def pa_CMD_EF_OP
2798 * Egress Flow operation command either triggers flow cache lookup to find the corresponding packet modification records
2799 * or provides those records directly.
2800 * @note This command can not be combined with any other commands
2801 */
2802 #define pa_CMD_EF_OP 18
2805 /* @} */
2806 /** @} */
2808 /**
2809 * @defgroup routeCtrlInfo PA Routing Control Info Bit Definitions
2810 * @ingroup palld_api_constants
2811 * @{
2812 *
2813 * @name PA Routing Control Info Bit Definitions
2814 *
2815 * Bitmap definition of the ctrlBitField in @ref paCmdNextRoute_t.
2816 */
2817 /*@{*/
2818 /**
2819 * @def pa_NEXT_ROUTE_PARAM_PRESENT
2820 * Control Info -- Set: Routing information such as flowId, queue are in command for egress packets
2821 * Clear: Routing information such as flowId, queue are in packet for ingress packets
2822 */
2823 #define pa_NEXT_ROUTE_PARAM_PRESENT 0x0001
2824 /**
2825 * @def pa_NEXT_ROUTE_PROC_NEXT_CMD
2826 * Control Info -- Set: Process the next command prior to forward the packet to its final destination
2827 * Clear: Forward the packet to the next destination without executing any more command
2828 * @note: The data patch command (pa_CMD_PATCH_DATA) is the only one which can follow the next route command.
2829 * @note: This option is only valid in the transmit (to-network) direction
2830 */
2831 #define pa_NEXT_ROUTE_PROC_NEXT_CMD 0x0002
2832 /**
2833 * @def pa_NEXT_ROUTE_PROC_MULTI_ROUTE
2834 * Control Info -- Set: Multi-route is valid, the packet should be forwarded and then perform multi-route
2835 * Clear: Multi-route is invalid
2836 * @note: This option is only valid in the receive (from-network) direction
2837 */
2838 #define pa_NEXT_ROUTE_PROC_MULTI_ROUTE 0x0004
2839 /**
2840 * @def pa_NEXT_ROUTE_TX_L2_PADDING
2841 * Control Info -- Set: Perform MAC padding for packet with size smaller than 60
2842 * Clear: Do not perform MAC padding
2843 * @note: This option is only valid in the transmit (to-network) direction
2844 */
2845 #define pa_NEXT_ROUTE_TX_L2_PADDING 0x0008
2846 /**
2847 * @def pa_NEXT_ROUTE_PROC_USR_STATS
2848 * Control Info -- Set: User-defined statistics index is valid, update the chain of user-defined statistics specified
2849 * by statsIndex
2850 * Clear: User-defined statistics index is invalid
2851 * @note: This option is only valid in the egress (to-network) direction
2852 */
2853 #define pa_NEXT_ROUTE_PROC_USR_STATS 0x0010
2855 /*@}*/
2856 /** @} */
2858 /**
2859 * @ingroup palld_api_structures
2860 * @brief Next Route Command
2861 *
2862 * @details paCmdNextRoute_t defines the final route information
2863 * The next route command can be used in both to-network and from-network directions.
2864 * In the to-network direction, it may be used multiple times to route traffic between PASS and SASS
2865 * before the packet is finally forwarded to the network. For example, the following steps show the
2866 * SRTP over IPSEC AH to-network traffic:
2867 * @verbatim
2868 1. Packet is delivered to SASS for SRTP operation
2869 2. Packet is delivered to PASS for UDP checksum operation
2870 3. Packet is delivered to SASS for IPSEC AH operation
2871 4. Packet is delivered to PASS for AH authentication tag insertion
2872 5. Packet is delivered to the network.
2873 @endverbatim
2874 * The next route commands are required for step 3 and 5. The complete routing information should be provided
2875 * in the to-network direction.
2876 *
2877 * In the from-network direction, the next route command is used only if the multiple routes are required or when
2878 * dest is set to EMAC to forward the ingress packets out to another EMAC port.
2879 * In this case, only the parameter "ctrlBitfield", "multiRouteIndex" and/or "dest" are valid. After all the
2880 * commands in the command set are executed, the PASS will deliver packets to their desired destination based
2881 * on the parameters specified at the routing information upon the LUT1/LUT2 matching.
2882 * If the next route command is specified, it must be the last command within a command set. The commands following
2883 * the next route command will not be executed.
2884 */
2886 typedef struct {
2888 uint16_t ctrlBitfield; /**< Routing control information as defined at @ref routeCtrlInfo */
2889 int dest; /**< Packet destination as defined at @ref pktDest */
2890 uint8_t pktType_emacCtrl;/**< For destination SRIO, specify the 5-bit packet type toward SRIO
2891 For destination HOST, EMAC, specify the EMAC control @ref emcOutputCtrlBits to the network */
2892 uint8_t flowId; /**< For host, SA or SRIO destinations, specifies return free descriptor setup */
2893 uint16_t queue; /**< For host, SA or SRIO destinations, specifies the dest queue */
2894 uint32_t swInfo0; /**< Placed in SwInfo0 for packets to host or SA; Placed in the PS Info for packets to SRIO*/
2895 uint32_t swInfo1; /**< Placed in SwInfo1 for packets to the SA; Placed in the PS Info for packets to SRIO */
2896 uint16_t multiRouteIndex; /**< Multi-route index. It is valid in the from-network direction only */
2897 uint16_t statsIndex; /**< Index of the first user-defined statistics to be updated.
2898 This optional parameter is valid in the to-network direction only */
2899 } paCmdNextRoute_t;
2901 /**
2902 * @defgroup crcFrameTypes CRC Frame types
2903 * @ingroup palld_api_constants
2904 * @{
2905 *
2906 * @name CRC Frame types
2907 *
2908 * @brief Define the frame types which are used to extract and derive the CRC operation parameters such as CRC starting
2909 * offset and CRC payload length from the frame header.
2910 *
2911 * @details Both the payload length and the byte location where CRC calculation begins may vary in some protocl
2912 * frame such as WCDMA FP HS-DSCH Data Frame type 2 and type 3. The CRC Frame type is used for PASS to
2913 * extract and/or derive the CRC starting offset and payload length.
2914 *
2915 * @note Only the following frame types are supported.
2916 */
2917 /* @{ */
2918 /**
2919 *
2920 * @def pa_CRC_OP_FRAME_TYPE_IUB_FP_HS_DSCH_TYPE2
2921 * WCDMA FP HS-DSCH Data Frame Type 2
2922 */
2923 #define pa_CRC_OP_FRAME_TYPE_IUB_FP_HS_DSCH_TYPE2 0
2925 /**
2926 *
2927 * @def pa_CRC_OP_FRAME_TYPE_IUB_FP_HS_DSCH_TYPE3
2928 * WCDMA FP HS-DSCH Data Frame Type 3
2929 */
2930 #define pa_CRC_OP_FRAME_TYPE_IUB_FP_HS_DSCH_TYPE3 1
2932 #define pa_CRC_OP_FRAME_TYPE_MAX pa_CRC_OP_FRAME_TYPE_IUB_FP_HS_DSCH_TYPE3
2935 /* @} */
2936 /** @} */
2939 /**
2940 * @defgroup crcOpCtrlInfo PA CRC Command Control Info Bit Definitions
2941 * @ingroup palld_api_constants
2942 * @{
2943 *
2944 * @name PA CRC Command Control Info Bit Definitions
2945 *
2946 * Bitmap definition of the ctrlBitField in @ref paCmdCrcOp_t.
2947 */
2948 /*@{*/
2949 /**
2950 * @def pa_CRC_OP_CRC_VALIDATE
2951 * Control Info -- Set: CRC Validate
2952 * Clear: CRC Computation
2953 */
2954 #define pa_CRC_OP_CRC_VALIDATE 0x0001
2955 /**
2956 * @def pa_CRC_OP_PAYLOAD_LENGTH_IN_HEADER
2957 * Control Info -- Set: CRC length field in the header
2958 * Clear: CRC length specified in command
2959 */
2960 #define pa_CRC_OP_PAYLOAD_LENGTH_IN_HEADER 0x0002
2961 /**
2962 * @def pa_CRC_OP_PAYLOAD_LENGTH_OFFSET_IS_NEGATIVE
2963 * Control Info -- Set: Payload length field resides prior to the parsed header offset
2964 * length field offset = offset from the current parsed header - lenOffset
2965 * Clear: Payload length field resides after the parsed header offset
2966 * length field offset = offset from the current parsed header + lenOffset
2967 */
2968 #define pa_CRC_OP_PAYLOAD_LENGTH_OFFSET_IS_NEGATIVE 0x0004
2969 /**
2970 * @def pa_CRC_OP_CRC_FRAME_TYPE
2971 * Control Info -- Set: Frame Type is specified
2972 * Clear: Frame Type is not specified, use offset
2973 * parameter
2974 */
2975 #define pa_CRC_OP_CRC_FRAME_TYPE 0x0008
2976 /**
2977 * @def pa_CRC_OP_CRC_RESULT_FOLLOW_PAYLOAD
2978 * Control Info -- Set: CRC field following payload
2979 * Clear: CRC offset specified in command
2980 */
2981 #define pa_CRC_OP_CRC_RESULT_FOLLOW_PAYLOAD 0x0010
2982 /*@}*/
2983 /** @} */
2985 /**
2986 * @ingroup palld_api_structures
2987 * @brief CRC Generation/Verification Command
2988 *
2989 * @details paCmdCrcOp_t is used to create CRC operation command instruct the PASS to
2990 * perform CRC operation in both to-network and from-network directions. The
2991 * module user is responsible for configuring the corresponding CRC engines
2992 * which are used for the specified CRC operation.
2993 *
2994 * In the to-network direction, the payload offset, payload length and CRC offset
2995 * should be available in the command. The generated CRC will be inserted into
2996 * the CRC location in the packet.
2997 *
2998 * In the from-network direction, the payload length is either a constant or
2999 * available in the custom header. The CRC verification will be performed by
3000 * the CRC engine connected to the PDSP where the CRC command is executed.
3001 * The CRC verification result will be indicated by the error flags within
3002 * the CPPI descriptor as described at section table @ref appendix2
3003 */
3005 typedef struct {
3007 uint16_t ctrlBitfield; /**< CRC operation control information as defined at @ref crcOpCtrlInfo */
3008 uint16_t startOffset; /**< Byte location, from SOP/Protocol Header, where the CRC computation begins
3009 if frame type is not specified
3010 Byte location, from SOP/Protocol header, where the specific frame header begins
3011 if frame type is specified
3012 In to-network direction: offset from SOP
3013 In from-network direction: offset from the current parsed header
3014 */
3015 uint16_t len; /**< Number of bytes covered by the CRC computation
3016 valid only if pa_CRC_OP_PAYLOAD_LENGTH_IN_HEADER is clear */
3017 uint16_t lenOffset; /**< Payload length field offset in the custom header */
3018 uint16_t lenMask; /**< Payload length field mask */
3019 uint16_t lenAdjust; /**< Payload length adjustment: valid only if pa_CRC_OP_PAYLOAD_LENGTH_IN_HEADER is set */
3020 uint16_t crcOffset; /**< Offset from CRC computation starting location to the CRC field */
3021 uint16_t crcSize; /**< Size of CRC in bytes (PASS Gen2 only) */
3022 uint16_t frameType; /**< Frame type @ref crcFrameTypes, vaild if pa_CRC_OP_CRC_FRAME_TYPE is set */
3023 uint32_t initValue; /**< CRC initial value (PASS Gen2 only) */
3024 } paCmdCrcOp_t;
3026 /**
3027 * @defgroup splitOpCtrlInfo PA SPLIT Command Control Info Bit Definitions
3028 * @ingroup palld_api_constants
3029 * @{
3030 *
3031 * @name PA SPLIT Command Control Info Bit Definitions
3032 *
3033 * Bitmap definition of the ctrlBitField in @ref paCmdSplitOp_t.
3034 */
3035 /*@{*/
3036 /**
3037 * @def pa_SPLIT_OP_FRAME_TYPE
3038 * Control Info -- Set: Frame Type is specified
3039 * Clear: Frame Type is not specified, use offset
3040 * parameter
3041 */
3042 #define pa_SPLIT_OP_FRAME_TYPE 0x0001
3043 /*@}*/
3044 /** @} */
3046 /**
3047 * @ingroup palld_api_structures
3048 * @brief Split Command
3049 *
3050 * @details paCmdSplitOp_t is used to create Split command to instruct the PASS to
3051 * divide the ingress packet into the header and payload portion and deliver them
3052 * to specified destination queues with specified CPPI flows respectively.
3053 * Where the destination information of the header packet is specified by the
3054 * classification routing information and the destination information of the payload
3055 * packet is specified in this structure.
3056 *
3057 */
3058 typedef struct {
3059 uint16_t ctrlBitfield; /**< Split operation control information as defined at @ref splitOpCtrlInfo */
3060 uint16_t startOffset; /**< Byte location, from Protocol Header, where the payload begins
3061 if frame type is not specified
3062 Byte location, from Protocol header, where the specific frame header begins
3063 if frame type is specified
3064 In from-network direction: offset from the current parsed header
3065 */
3066 uint16_t frameType; /**< Frame type @ref crcFrameTypes, vaild if pa_SPLIT_OP_FRAME_TYPE is set */
3067 uint16_t destQueue; /**< Host queue for the payload packet */
3068 uint16_t flowId; /**< CPPI flow which instructs how link-buffer queues are used for sending payload packets. */
3070 } paCmdSplitOp_t;
3072 /**
3073 * @ingroup palld_api_structures
3074 * @brief Transmit checksum configuration
3075 *
3076 * @details paTxChksum_t is used in the call to @ref Pa_formatTxRoute or @ref Pa_formatTxCmd to create a tx
3077 * command header that instructs the packet accelerator sub-system to generate ones' complement
3078 * checksums into network packets. The checksums are typically used for TCP and UDP payload checksums as
3079 * well as IPv4 header checksums. In the case of TCP and UDP payload checksums the psuedo header
3080 * checksum must be pre-calculated and provided, the sub-system does not calculate it.
3081 */
3082 typedef struct {
3084 uint16_t startOffset; /**< Byte location, from SOP, where the checksum calculation begins */
3085 uint16_t lengthBytes; /**< Number of bytes covered by the checksum. Must be even */
3086 uint16_t resultOffset; /**< Byte offset, from startOffset, to place the resulting checksum */
3087 uint16_t initialSum; /**< Initial value of the checksum */
3088 uint16_t negative0; /**< If TRUE, a computed value of 0 is written as -0 */
3090 } paTxChksum_t;
3093 /**
3094 * @defgroup copyCtrlInfo PA Copy Command Control Info Bit Definitions
3095 * @ingroup palld_api_constants
3096 * @{
3097 *
3098 * @name PA Copy Command Control Info Bit Definitions
3099 *
3100 * Bitmap definition of the ctrlBitField in @ref paCmdCopy_t.
3101 *
3102 */
3103 /*@{*/
3104 /**
3105 * @def pa_COPY_OP_FROM_END
3106 * Control Info -- Set: Copy data from the end of the payload
3107 * Clear: Copy data from the beginning of the payload
3108 */
3109 #define pa_COPY_OP_FROM_END 0x0001
3110 /*@}*/
3111 /** @} */
3113 /**
3114 * @ingroup palld_api_structures
3115 * @brief Copy Command
3116 *
3117 * @details paCmdCopy_t is used to define how to copy number of bytes from the data packet to
3118 * the descriptor. The copy command is used to instruct the PASS to copy up to 8 byte
3119 * from packet to the PS info section in the packet descriptor in the from-network direction.
3120 * If the desired copy area crosses over the packet boundary, then garbage data will be copied.
3121 *
3122 * @note: There are 20-byte packet information stored in the PS Info section. It is recommended to copy
3123 * packet data after the packet information area. Otherwise, the packet information will be
3124 * overwritten. There are upto 12 bytes can be copied with the packet information or upto
3125 * 32 bytes can be copied without the packet information.
3126 */
3128 typedef struct {
3130 uint16_t ctrlBitfield; /**< Copy operation control information as defined at @ref copyCtrlInfo */
3131 uint16_t srcOffset; /**< Offset from the start of current protocol header for the data copy to begin */
3132 uint16_t destOffset; /**< Offset from the top of the PSInfo for the data to be copied to */
3133 uint16_t numBytes; /**< Number of bytes to be copied */
3134 } paCmdCopy_t;
3137 /**
3138 * @ingroup palld_api_structures
3139 * @brief Multi-route Command
3140 *
3141 * @details paCmdMultiRoute_t is used to specify the desired PA multi-route set.
3142 * The multi-route command instructs the PASS to route the packets to multiple
3143 * destinations in the from-network direction only. It must be the last command
3144 * within a command set. The commands following the multi-route command will
3145 * not be executed.
3146 */
3147 typedef struct {
3149 uint16_t index; /**< Multi-route set Index */
3150 } paCmdMultiRoute_t;
3153 /**
3154 * @ingroup palld_api_constants
3155 * @def pa_MAX_CMD_SETS
3156 * The maximum number of command sets supported
3157 */
3158 #define pa_MAX_CMD_SETS 64
3160 /**
3161 * @ingroup palld_api_structures
3162 * @brief Command Set Command
3163 *
3164 * @details paCmdSet_t is used to specify the desired PA command set. The command set command
3165 * instructs the PASS to execute a list of commands after a LUT1 or LUT2 match occurs.
3166 * It is one of the command which can be embedded within the @ref paRouteInfo_t.
3167 */
3168 typedef struct {
3170 uint16_t index; /**< Command Set Index */
3171 } paCmdSet_t;
3173 /**
3174 * @ingroup palld_api_constants
3175 * @def pa_MAX_PATCH_BYTES
3176 * The maximum number of bytes that a patch command can accept
3177 */
3178 #define pa_MAX_PATCH_BYTES 16 /**< PATCH Command in to-netweok direction */
3179 #define pa_MAX_RX_PATCH_BYTES 32 /**< PATCH Command within a command set */
3181 /**
3182 * @defgroup patchCtrlInfo PA Patch Command Control Info Bit Definitions
3183 * @ingroup palld_api_constants
3184 * @{
3185 *
3186 * @name PA Patch Command Control Info Bit Definitions
3187 *
3188 * Bitmap definition of the ctrlBitField in @ref paPatchInfo_t.
3189 *
3190 */
3191 /*@{*/
3192 /**
3193 * @def pa_PATCH_OP_INSERT
3194 * Control Info -- Set: Insert data into the packet
3195 * Clear: Patch data replaces existing packet data
3196 */
3197 #define pa_PATCH_OP_INSERT 0x0001
3198 /**
3199 * @def pa_PATCH_OP_MAC_HDR
3200 * Control Info -- Set: Replace MAC header with patch data
3201 * Clear: Normal Patch/Insert operation
3202 */
3203 #define pa_PATCH_OP_MAC_HDR 0x0002
3204 /**
3205 * @def pa_PATCH_OP_DELETE
3206 * Control Info -- Set: Delete data in the packet
3207 * Clear: Normal Patch/Insert operation
3208 */
3209 #define pa_PATCH_OP_DELETE 0x0004
3210 /*@}*/
3211 /** @} */
3214 /**
3215 * @ingroup palld_api_structures
3216 * @brief Packet patching configuration
3217 *
3218 * @details paPatchInfo_t is used to create data patch command. The patch command is used to patch
3219 * existing data or insert data in the packet in both to-network and from-network directions.
3220 *
3221 * In the to-network direction, it can be used to patch the authentication tag provided by SASS
3222 * into the AH header within the packet. In this case, the patch data is not present at the command
3223 * when it is formatted and it is appended by the SASS. The @ref Pa_formatRoutePatch is used to create
3224 * a command block along with a packet routing command to forward the packet after the patch is complete
3225 *
3226 * In the from-network direction, it can be used to insert up to 32 bytes to the offset location
3227 * as part of the command set to be executed after a LUT1 or LUT2 match.
3228 * This command can be used to patch the entire MAC header for MAC router functionality. It may be further
3229 * enhanced and combined with other commands to support IP forwarding operation in the future.
3230 * A short version of the patch command can be used to insert up to 2 bytes into the current parsing
3231 * location of the packet after a LUT2 match.
3232 */
3234 typedef struct {
3236 uint16_t ctrlBitfield; /**< Patch operation control information as defined at @ref patchCtrlInfo */
3237 uint16_t nPatchBytes; /**< The number of bytes to be patched */
3238 uint16_t totalPatchSize; /**< The number of patch bytes in the patch command, must be >= to nPatchBytes and a multiple of 4 bytes */
3239 uint16_t offset; /**< Offset from the start of the packet for the patch to begin in the to-network direction
3240 Offset from the start of the current header for the patch to begin in the from-network direction */
3241 uint8_t *patchData; /**< Pointer to the patch data */
3243 } paPatchInfo_t;
3247 /**
3248 * @ingroup palld_api_structures
3249 * @brief paPayloadInfo_t defines the packet payload information in the short format.
3250 * It is required by the Security Accelerator sub-system (SASS)
3251 *
3252 * @details paPayloadInfo_t defines the packet parsing information in terms of
3253 * payload offset and payload length as described below
3254 * @li SRTP: offset to the RTP header; RTP payload length including ICV
3255 * @li IPSEC AH: offset to the Outer IP; IP payload length
3256 * @li IPSEC ESP: offset to the ESP header; ESP papload length including ICV
3257 */
3259 typedef struct {
3260 uint16_t offset; /**< The offset to where the SA packet parsing starts */
3261 uint16_t len; /**< The total length of the protocal payload to be processed by SA */
3262 uint32_t supData; /**< Optional supplement data such as the 32-bit CountC for some 3GPP operation modes */
3263 } paPayloadInfo_t;
3266 /**
3267 * @ingroup palld_api_structures
3268 * @brief Tx timestamp reporting information
3269 *
3270 * @details paCmdTxTimestamp_t specifies the tx timestamp reporting information. The report tx timestamp command is used to instruct
3271 * the PASS to report the PA timestamp when the packet is transmitting out of PASS in a return (null) packet to the specified
3272 * host queue. The transmit timestamp may be used for the Precision Timing Protocol (PTP). The reported tx timestamp will be
3273 * a 48 bit value, with the lower 32 bits stored in timestamp field, and the upper 16 bits stored in swInfo1.
3274 *
3275 * @pre API @ref Pa_configTimestamp() should be called to enable PASS system timestamp.
3276 */
3278 typedef struct {
3279 uint16_t destQueue; /**< Host queue for the tx timestamp reporting packet */
3280 uint16_t flowId; /**< CPPI flow which instructs how link-buffer queues are used for sending tx timestamp reporting packets. */
3281 uint32_t swInfo0; /**< lower 32 bit value returned in the descriptor as swInfo0 which can be used as event identifier */
3282 } paCmdTxTimestamp_t;
3284 /**
3285 * @ingroup palld_api_structures
3286 * @brief IP fragmentation information
3287 *
3288 * @details paCmdIpFrag_t is used to create the IPv4 fragment command. The IP fragment command is used to instruct the PASS to
3289 * perform IPv4 fragmentation operation. This operation can be applied to both inner IP prior to IPSEC encapsulation and
3290 * outer IP after IPSEC encapsulation. This command should go with a next route command which provides the destination
3291 * information prior to the fragmentation operation.
3292 *
3293 * For the inner IP fragmentation, follow the following procedure:
3294 * @li Host sends packets with the IP fragment command and the destination queue set to a host queue to PASS PDSP5
3295 * for IP fragmentation operation.
3296 * @li All fragments will be delivered to the specified host queue.
3297 * @li Host adds the outer MAC/IP header, invokes the SA LLD sendData function and then sends the fragments to the SA queue.
3298 * @li Each fragment will be encrypted, authenticated and forwarded to the final destination.
3299 *
3300 * For the outer IP fragmentation, the overall operation is stated below:
3301 * @li Packet is delivered to SASS for IPSEC operation
3302 * @li Packet is delivered to PASS for IP Fragmentation operation
3303 * @li The entire packet or its fragments are delivered to the network.
3304 *
3305 * @note the next route command is required for step 2
3306 * @note The IP fragment command can not be combined with some other tx commands such as checksum and CRC commands since
3307 * those commands may require the PASS operation across multiple fragments. The workaround is to break the tx commands into
3308 * two groups. The first group consists of the checksum, CRC, other commands and a next route command which routes the packet
3309 * back to the same PDSP to execute the second command group which consists of the IP fragment command and the next route
3310 * command which points to the final destination.
3311 *
3312 * The IP fragment command can be combined with a single blind patch command to support the IPSEC AH use case in which the SASS
3313 * passes the IPSEC AH packet with the blind patch command to the PASS so that the autentication tag can be inserted into the AH
3314 * header. The recommended order of the tx commands is as the followings:
3315 * - pa_CMD_IP_FRAGMENT
3316 * - pa_CMD_NEXT_ROUTE with flag pa_NEXT_ROUTE_PROC_NEXT_CMD set
3317 * - pa_CMD_PATCH_DATA
3318 *
3319 * The IP fragment command can be also combined with up to two message length patching commands to support the message length
3320 * field updating for each IP fragment. This operation is required for certain L2 header which contains a length field such as
3321 * 802.3 and PPPoE. The order of tx command is as the followings:
3322 * - pa_CMD_PATCH_MSG_LEN (optional)
3323 * - pa_CMD_PATCH_MSG_LEN (optional)
3324 * - pa_CMD_IP_FRAGMENT
3325 * - pa_CMD_NEXT_ROUTE
3326 */
3328 typedef struct {
3329 uint16_t ipOffset; /**< Offset to the IP header. */
3330 uint16_t mtuSize; /**< Size of the maximum transmission unit (>= 68) */
3331 } paCmdIpFrag_t;
3333 /**
3334 * @ingroup palld_api_structures
3335 * @brief Message length patching configuration
3336 *
3337 * @details paPatchMsgLenInfo_t is used to create message length patch command which is used in conjunction with
3338 * the Ip fragmentation command. This command instruct the PASS to update the message length field within
3339 * some L2 protocol header such as 802.3 and PPPoE after the potential IP fragmentation operation.
3340 *
3341 * The PASS support up to two message length patching operations per IP fragmentation command.
3342 */
3344 typedef struct {
3346 uint8_t msgLenSize; /**< Size of message length field in bytes (@note only 2-byte and 4=byte message length is supported) */
3347 uint8_t offset; /**< Offset from the start of the packet to the message length field */
3348 uint16_t msgLen; /**< Message length excluding the IP header and payload length */
3350 } paPatchMsgLenInfo_t;
3352 /**
3353 * @ingroup palld_api_structures
3354 * @brief User-defined Statistics Command
3355 *
3356 * @details paCmdUsrStats_t is used to specify the desired User-defined counter. The user stats command
3357 * instructs the PASS to update the specified user-defined counter and all the counters which are
3358 * linked to this counter
3359 * It is one of the command which can be embedded within the @ref paRouteInfo_t.
3360 */
3361 typedef struct {
3362 uint16_t index; /**< User-defined statistics index */
3363 } paCmdUsrStats_t;
3365 /**
3366 * @ingroup palld_api_structures
3367 * @brief Command Set plus User-defined Statistics Command
3368 *
3369 * @details paCmdSetUsrStats_t is used to specify the desired PA command set and User-defined counter. This command
3370 * provides the module user a mechanism to specify different user-defined counters with the same command set
3371 * for different LUT entries and vice versa.
3372 * This command instructs the PASS to update the specified user-defined counter and all the counters which are
3373 * linked to this counter and then execute the specified command set.
3374 * It is one of the command which can be embedded within the @ref paRouteInfo_t.
3375 */
3376 typedef struct {
3377 uint16_t setIndex; /**< Commad Set Index */
3378 uint16_t statsIndex; /**< User-defined statistics index */
3379 } paCmdSetUsrStats_t;
3382 /**
3383 * @defgroup pktErrInfo PA Packet Error Info Bit Definitions
3384 * @ingroup palld_api_constants
3385 * @{
3386 *
3387 * @name PA Packet Error Info Bit Definitions
3388 *
3389 * Bitmap definition of the errorBitfield in @ref paCmdVerifyPktErr_t.
3390 *
3391 */
3392 /*@{*/
3393 /**
3394 * @def pa_PKT_ERR_IP_CHECKSUM
3395 * Control Info -- Set: Re-direct packet if IP checksum error occurs
3396 * Clear: Ignore IP checksum Error
3397 */
3398 #define pa_PKT_ERR_IP_CHECKSUM 0x0001
3399 /**
3400 * @def pa_PKT_ERR_L4_CHECKSUM
3401 * Control Info -- Set: Re-direct packet if UDP/TCP checksum error occurs
3402 * Clear: Ignore UDP/TCP checksum Error
3403 */
3404 #define pa_PKT_ERR_L4_CHECKSUM 0x0002
3405 /**
3406 * @def pa_PKT_ERR_CRC
3407 * Control Info -- Set: Re-direct packet if CRC error occurs
3408 * Clear: Ignore CRC Error
3409 */
3410 #define pa_PKT_ERR_CRC 0x0004
3411 /*@}*/
3412 /** @} */
3414 /**
3415 * @ingroup palld_api_structures
3416 * @brief Verify Packet Error Command
3417 *
3418 * @details paCmdVerifyPktErr_t is used to construct the "Verify Packet Error" command. The
3419 * IPv4 header checksum, UDP/TCP checksum and SCTP CRC-32c checksum verification are performed by
3420 * the PASS autonomously while the CRC verification is performed per command. The corresponding error bit
3421 * in the CPPI descriptor will be set and can be verified by the application when packet is delivered
3422 * to the host. This command instructs PASS to examine the specified error flags and forward the error
3423 * packet accordingly.
3424 */
3426 typedef struct {
3428 uint16_t errorBitfield; /**< Packet Error information as defined at @ref pktErrInfo */
3429 uint8_t dest; /**< Packet destination as defined at @ref pktDest */
3430 uint8_t flowId; /**< For host destination, specifies CPPI flow which defines free queues are used for receiving packets */
3431 uint16_t queue; /**< For host destination, specifies the destination queue */
3432 uint32_t swInfo0; /**< Placed in SwInfo0 for packets to host */
3433 } paCmdVerifyPktErr_t;
3435 /**
3436 * @defgroup efOpCtrlInfo PA Egress Flow Command Control Info Bit Definitions
3437 * @ingroup palld_api_constants
3438 * @{
3439 *
3440 * @name PA Egress Flow Command Control Info Bit Definitions
3441 *
3442 * Bitmap definition of the ctrlBitField in @ref paCmdEfOp_t.
3443 */
3444 /*@{*/
3445 /**
3446 * @def pa_EF_OP_CMD_FC_LOOKUP
3447 * Control Info -- Set: Perform flow cache lookup to look for the associated packet modification records per match
3448 * Clear: Skip flow cache lookup and use the packet modification records specified in this command.
3449 */
3450 #define pa_EF_OP_CMD_FC_LOOKUP 0x0001
3451 /**
3452 * @def pa_EF_OP_CMD_VALID_LVL1
3453 * Control Info -- Egress Flow level 1 index is present
3454 */
3455 #define pa_EF_OP_CMD_VALID_LVL1 0x0010
3456 /**
3457 * @def pa_EF_OP_CMD_VALID_LVL2
3458 * Control Info -- Egress Flow level 2 index is present
3459 */
3460 #define pa_EF_OP_CMD_VALID_LVL2 0x0020
3461 /**
3462 * @def pa_EF_OP_CMD_VALID_LVL3
3463 * Control Info -- Egress Flow level 3 index is present
3464 */
3465 #define pa_EF_OP_CMD_VALID_LVL3 0x0040
3466 /**
3467 * @def pa_EF_OP_CMD_VALID_LVL4
3468 * Control Info -- Egress Flow level 4 index is present
3469 */
3470 #define pa_EF_OP_CMD_VALID_LVL4 0x0080
3471 /*@}*/
3472 /** @} */
3474 /**
3475 * @ingroup palld_api_structures
3476 * @brief Egress Flow Operation Command
3477 *
3478 * @details paCmdEfOp_t is used to create Egress Flow operation command which instructs
3479 * the PASS to perform optional flow cache lookup to find the associated
3480 * packet modification records or provides those records in the command. Then
3481 * PASS will execute the specified packet modification records in order to
3482 * perform one or multiple of the following actions:
3483 * - Update inner L3/L4 headers
3484 * - Insert or update outer L3 header
3485 * - Insert IPSEC header and trailer
3486 * - Perform inner and/or outer IP fragmentation
3487 * - Insert or update L2 header
3488 */
3490 typedef struct {
3492 uint16_t ctrlBitfield; /**< Egress Flow operation control information as defined at @ref efOpCtrlInfo */
3493 uint16_t l2Offset; /**< Offset to the layer 2 header from SOP */
3494 uint16_t l3Offset; /**< Offset to the outer IP from SOP */
3495 uint16_t l3Offset2; /**< Offset to the inner IP from SOP, which should be set to L3Offset if there is
3496 only one IP layer */
3497 uint16_t ipsecOffset; /**< Offset to the IPSEC ESP/AH header if the IPSEC header resides in the egress
3498 packets */
3499 uint16_t endOffset; /**< Offset to the end of L4 (UDP/UDPLite/TCP) payload */
3500 uint16_t lvl1Index; /**< Specify egress flow level 1 record index */
3501 uint16_t lvl2Index; /**< Specify egress flow level 2 record index */
3502 uint16_t lvl3Index; /**< Specify egress flow level 3 record index */
3503 uint16_t lvl4Index; /**< Specify egress flow level 4 record index */
3504 } paCmdEfOp_t;
3506 /**
3507 * @ingroup palld_api_structures
3508 * @brief PA Command Information structure
3509 *
3510 * @details Data structure defines PA commands. The PA command can be invoked by the @ref paRouteInfo_t as a simple command.
3511 * They are the building blocks for function @ref Pa_configCmdSet to create a list of commands refered as a command
3512 * set in the from-network direction. They can be used by the function @ref Pa_formatTxCmd to create or update the
3513 * list of tx commands.
3514 *
3515 */
3516 typedef struct {
3517 uint16_t cmd; /**< Specify the PA command code as defined at @ref paCmdCode */
3518 union {
3519 paCmdNextRoute_t route; /**< Specify nextRoute command specific parameters */
3520 paTxChksum_t chksum; /**< Specify Tx Checksum command specific parameters */
3521 paCmdCrcOp_t crcOp; /**< Specify CRC operation command specific parameters */
3522 paCmdCopy_t copy; /**< Specify Copy command specific parameters */
3523 paPatchInfo_t patch; /**< Specify Patch command specific parameters */
3524 paPayloadInfo_t payload; /**< Specify the payload information required by SA */
3525 paCmdSet_t cmdSet; /**< Specify Command Set command specific parameters */
3526 paCmdMultiRoute_t mRoute; /**< Specify Multi-route command specific parameters */
3527 paCmdTxTimestamp_t txTs; /**< Specify Report Tx Timestamp command specific parameters */
3528 paCmdIpFrag_t ipFrag; /**< Specify IP fragmentation command specific parameters */
3529 paCmdUsrStats_t usrStats; /**< Specify User-defined Statistics command specific parameters */
3530 paCmdSetUsrStats_t cmdSetUsrStats; /**< Specify Command Set and User-defined Statistics command specific parameters */
3531 paPatchMsgLenInfo_t patchMsgLen; /**< Specify Patch Message Length command specific parameters */
3532 paCmdVerifyPktErr_t verifyPktErr; /**< Specify Packet error Verification command specific parameters */
3533 paCmdSplitOp_t split; /**< Specify Split command sepcific parameters */
3534 paCmdEfOp_t efOp; /**< Specify Egress Flow operation command specific parameters (PASS Gen2 only) */
3535 }params; /**< Contain the command specific parameters */
3537 } paCmdInfo_t;
3539 /**
3540 * @ingroup palld_api_structures
3541 * @brief IP lookup information
3542 *
3543 * @details paIpInfo_t is used to specifiy the IPv4 or IPv6 parameters used in packet routing.
3544 * With the exception of parameter tos, a value of 0 in any parameter means that that
3545 * field is not used in packet routing. Since a value of 0 is valid for tos, the paramter
3546 * tosCare is used to indicate if the tos field (IPv4) or traffic class (Ipv6) is used
3547 * for packet routing.
3548 */
3549 typedef struct {
3551 paIpAddr_t src; /**< Source IP address */
3552 paIpAddr_t dst; /**< Destination IP address */
3553 uint32_t spi; /**< ESP or AH header Security Parameters Index */
3554 uint32_t flow; /**< IPv6 flow label in 20 lsbs */
3555 int ipType; /**< @ref IpValues */
3556 uint16_t greProto; /**< GRE protocol field */
3557 uint8_t proto; /**< IP Protocol (IPv4) / Next Header (IPv6) */
3558 uint8_t tos; /**< IP Type of Service (IPv4) / Traffic class (IPv6) */
3559 uint16_t tosCare; /**< TRUE if the tos value is used for matching */
3560 uint16_t sctpPort; /**< SCTP Destination Port */
3561 } paIpInfo_t;
3563 /**
3564 * @defgroup paIpInfoValidBits PA IP Info Valid Bit Definitions
3565 * @ingroup palld_api_constants
3566 * @{
3567 *
3568 * @name PA IP Info Valid Bit Definitions
3569 *
3570 * Bitmap definition of the validBitmap in @ref paIpInfo2_t.
3571 */
3572 /*@{*/
3573 /**
3574 * @def pa_IP_INFO_VALID_SRC
3575 * - Source IP address is present
3576 */
3577 #define pa_IP_INFO_VALID_SRC (1<<0)
3579 /**
3580 * @def pa_IP_INFO_VALID_DST
3581 * - Destination IP address is present
3582 */
3583 #define pa_IP_INFO_VALID_DST (1<<1)
3585 /**
3586 * @def pa_IP_INFO_VALID_SPI
3587 * - 32-bit Security Parameters Index of IPSEC ESP/AH is present
3588 */
3589 #define pa_IP_INFO_VALID_SPI (1<<2)
3591 /**
3592 * @def pa_IP_INFO_VALID_FLOW
3593 * - IPv6 flow label is present
3594 */
3595 #define pa_IP_INFO_VALID_FLOW (1<<3)
3597 /**
3598 * @def pa_IP_INFO_VALID_GREPROTO
3599 * - GRE protocol field is present
3600 */
3601 #define pa_IP_INFO_VALID_GREPROTO (1<<4)
3603 /**
3604 * @def pa_IP_INFO_VALID_PROTO
3605 * - IPv4 protocol or IPv6 next header is present
3606 */
3607 #define pa_IP_INFO_VALID_PROTO (1<<5)
3609 /**
3610 * @def pa_IP_INFO_VALID_TOS
3611 * - IPv4 type of service or IPv6 traffic class is present
3612 */
3613 #define pa_IP_INFO_VALID_TOS (1<<6)
3615 /**
3616 * @def pa_IP_INFO_VALID_SCTPPORT
3617 * - SCTP destination port is present
3618 */
3620 #define pa_IP_INFO_VALID_SCTPPORT (1<<7)
3622 /* @} */ /* ingroup */
3623 /** @} */
3625 /**
3626 * @ingroup palld_api_structures
3627 * @brief Enhanced IP lookup information
3628 *
3629 * @details paIpInfo2_t is the upgraded version of paIpInfo_t to support additional IP lookup
3630 * parameters over time while still maintaining backward compatibility. Future feature
3631 * enhancements will be supported through this API data structure only.
3632 *
3633 * Since not all fields are used all the time, validBitmap is used to specify which field
3634 * is used for packet classification.
3635 */
3636 typedef struct {
3637 uint32_t validBitMap;/**< 32-bit valid Bitmap corresponding to each optional field as defined at @ref paIpInfoValidBits */
3638 paIpAddr_t src; /**< Source IP address */
3639 paIpAddr_t dst; /**< Destination IP address */
3640 uint32_t spi; /**< ESP or AH header Security Parameters Index */
3641 uint32_t flow; /**< IPv6 flow label in 20 lsbs */
3642 int ipType; /**< Mandatory if src or dst is valid @ref IpValues */
3643 uint16_t greProto; /**< GRE protocol field */
3644 uint8_t proto; /**< IP Protocol (IPv4) / Next Header (IPv6) */
3645 uint8_t tos; /**< IP Type of Service (IPv4) / Traffic class (IPv6) */
3646 uint16_t sctpPort; /**< SCTP Destination Port */
3647 } paIpInfo2_t;
3649 /**
3650 * @ingroup palld_api_structures
3651 * @brief MAC/Ethernet lookup information
3652 *
3653 * @details paEthInfo_t is used to specify the MAC/Ethernet parameters used in packet classification.
3654 * A value in 0 for any of the fields indicates that the field is not used for
3655 * packet classification.
3656 */
3657 typedef struct {
3658 paMacAddr_t src; /**< Source MAC addresss */
3659 paMacAddr_t dst; /**< Destination MAC address */
3660 uint16_t vlan; /**< VLAN tag VID field, 12 lsbs */
3661 uint16_t ethertype; /**< Ethertype field. */
3662 uint32_t mplsTag; /**< MPLS tag. Only the outer tag is examined */
3663 uint16_t inport; /**< Input EMAC port number as specified by @ref paEmacPort */
3664 } paEthInfo_t;
3666 /**
3667 * @defgroup paEthInfoValidBits PA ETH Info Valid Bit Definitions
3668 * @ingroup palld_api_constants
3669 * @{
3670 *
3671 * @name PA ETH Info Valid Bit Definitions
3672 *
3673 * Bitmap definition of the validBitmap in @ref paEthInfo2_t.
3674 */
3675 /*@{*/
3677 /**
3678 * @def pa_ETH_INFO_VALID_SRC
3679 * - Source MAC is present
3680 */
3681 #define pa_ETH_INFO_VALID_SRC (1<<0)
3683 /**
3684 * @def pa_ETH_INFO_VALID_DST
3685 * - Destination MAC is present
3686 */
3687 #define pa_ETH_INFO_VALID_DST (1<<1)
3689 /**
3690 * @def pa_ETH_INFO_VALID_VLAN
3691 * - VLAN ID is present
3692 */
3693 #define pa_ETH_INFO_VALID_VLAN (1<<2)
3695 /**
3696 * @def pa_ETH_INFO_VALID_ETHERTYPE
3697 * - Ether type is present
3698 */
3699 #define pa_ETH_INFO_VALID_ETHERTYPE (1<<3)
3701 /**
3702 * @def pa_ETH_INFO_VALID_MPLSTAG
3703 * - MPLS tag is present
3704 */
3705 #define pa_ETH_INFO_VALID_MPLSTAG (1<<4)
3707 /**
3708 * @def pa_ETH_INFO_VALID_INPORT
3709 * - Input EMAC port is present
3710 */
3711 #define pa_ETH_INFO_VALID_INPORT (1<<5)
3713 /* @} */ /* ingroup */
3714 /** @} */
3716 /**
3717 * @ingroup palld_api_structures
3718 * @brief Enhanced MAC/Ethernet lookup information
3719 *
3720 * @details paEthInfo2_t is the upgraded version of paEthInfo_t to support additional MAC lookup
3721 * parameters over time while still maintaining backward compatibility. Future feature
3722 * enhancements will be supported through this API data structure only.
3723 *
3724 * Since not all fields are used all the time, validBitmap is used to specify which field
3725 * is used for packet classification.
3726 *
3727 */
3728 typedef struct {
3729 uint32_t validBitMap; /**< 32-bit valid Bitmap corresponding to each optional field as defined at @ref paEthInfoValidBits */
3730 paMacAddr_t src; /**< Source MAC addresss */
3731 paMacAddr_t dst; /**< Destination MAC address */
3732 uint16_t vlan; /**< VLAN tag VID field, 12 lsbs */
3733 uint16_t ethertype; /**< Ethertype field. */
3734 uint32_t mplsTag; /**< MPLS tag. Only the outer tag is examined */
3735 uint16_t inport; /**< Input EMAC port number as specified by @ref paEmacPort */
3736 } paEthInfo2_t;
3738 /**
3739 * @defgroup paAclInfoValidBit PA ACL Matching Info Valid Bit Definitions
3740 * @ingroup palld_api_constants
3741 * @{
3742 *
3743 * @name PA ACL Matching Info Valid Bit Definitions
3744 * Bitmap definition of the validBitfield in paAclInfo_t.
3745 * It allows selective ACL matching parameters
3746 */
3747 /*@{*/
3748 /**
3749 * @def pa_ACL_INFO_VALID_SRC_IP
3750 * srcIp is present
3751 */
3752 #define pa_ACL_INFO_VALID_SRC_IP 0x0001
3753 /**
3754 * @def pa_ACL_INFO_VALID_SRC_IP_MASK
3755 * srcIpMask is present. This flag is valid only if srcIp is present.
3756 * If srcIp is present and this flag is clear, it means all IP address bits are valid.
3757 */
3758 #define pa_ACL_INFO_VALID_SRC_IP_MASK 0x0002
3759 /**
3760 * @def pa_ACL_INFO_VALID_DST_IP
3761 * dstIp is present
3762 */
3763 #define pa_ACL_INFO_VALID_DST_IP 0x0004
3764 /**
3765 * @def pa_ACL_INFO_VALID_DST_IP_MASK
3766 * dstIpMask is present. This flag is valid only if dstIp is present.
3767 * If dstIp is present and this flag is clear, it means all IP address bits are valid.
3768 */
3769 #define pa_ACL_INFO_VALID_DST_IP_MASK 0x0008
3770 /**
3771 * @def pa_ACL_INFO_VALID_CTRL_FLAG
3772 * ctrlFlag and ctrlFlagMask are present
3773 */
3774 #define pa_ACL_INFO_VALID_CTRL_FLAG 0x0010
3775 /**
3776 * @def pa_ACL_INFO_VALID_PROTO
3777 * proto is present
3778 */
3779 #define pa_ACL_INFO_VALID_PROTO 0x0020
3780 /**
3781 * @def pa_ACL_INFO_VALID_DSCP
3782 * dscp is present
3783 */
3784 #define pa_ACL_INFO_VALID_DSCP 0x0040
3785 /**
3786 * @def pa_ACL_INFO_VALID_SRC_PORT
3787 * srcPortBegin and srcPortEnd are present */
3788 #define pa_ACL_INFO_VALID_SRC_PORT 0x0100
3789 /**
3790 * @def pa_ACL_INFO_VALID_DST_PORT
3791 * dstPortBegin and dstPortEnd are present */
3792 #define pa_ACL_INFO_VALID_DST_PORT 0x0200
3794 /*@}*/
3795 /** @} */
3797 /**
3798 * @defgroup paAclInfoCtrlFlags PA ACL Info Control Flag Definitions
3799 * @ingroup palld_api_constants
3800 * @{
3801 *
3802 * @name PA ACL Info Control Flag Definitions
3803 * Bitmap definition of the ctrlFlags and ctrlFlagsMask in paAclnfo_t.
3804 */
3805 /*@{*/
3806 /**
3807 * @def pa_ACL_INFO_CONTROL_FLAG_FRAG
3808 * Flag -- 1: IP fragments
3809 */
3810 #define pa_ACL_INFO_CONTROL_FLAG_FRAG 0x0001
3811 /**
3812 * @def pa_ACL_INFO_CONTROL_FLAG_CONTAIN_L4
3813 * Flag -- 1: Packet or fragment which conatins L4 header
3814 */
3815 #define pa_ACL_INFO_CONTROL_FLAG_CONTAIN_L4 0x0002
3816 /*@}*/
3817 /** @} */
3819 /**
3820 * @ingroup palld_api_structures
3821 * @brief ACL lookup information
3822 *
3823 * @details paAclInfo_t is used to specifiy the ACL matching parameters.
3824 */
3825 typedef struct {
3826 uint16_t validBitMap; /**< Specify valid parameters as defined at @ref paAclInfoValidBit */
3827 uint16_t ctrlFlag; /**< Specify ACL contrl flags as defined at @ref paAclInfoCtrlFlags */
3828 uint16_t ctrlFlagMask; /**< ACL control flag valid masks */
3829 uint16_t ipType; /**< @ref IpValues */
3830 paIpAddr_t srcIp; /**< Source IP address */
3831 paIpAddr_t srcIpMask; /**< Source IP subnet mask*/
3832 paIpAddr_t dstIp; /**< Destination IP address */
3833 paIpAddr_t dstIpMask; /**< Destination IP subnet mask */
3834 uint8_t proto; /**< IP Protocol (IPv4) / Next Header (IPv6) */
3835 uint8_t dscp; /**< DSCP value */
3836 uint16_t srcPortBegin; /**< Minimum Source Port Number */
3837 uint16_t srcPortEnd; /**< Maximum Source Port Number */
3838 uint16_t dstPortBegin; /**< Minimum Destinatio Port Number */
3839 uint16_t dstPortEnd; /**< Maximum Destinatio Port Number */
3840 } paAclInfo_t;
3842 /**
3843 * @ingroup palld_api_structures
3844 * @brief SRIO Type11 header information
3845 *
3846 * @details The structure describes the SRIO type 11 specific Lo-L2 header information.
3847 */
3848 typedef struct paSrioType11Info_s
3849 {
3850 uint16_t mbox; /**< Mail Box */
3851 uint16_t letter; /**< Letter Identifier */
3852 } paSrioType11Info_t;
3854 /**
3855 * @ingroup palld_api_structures
3856 * @brief SRIO Type9 header information
3857 *
3858 * @details The structure describes the SRIO type 9 specific L0-L2 header information.
3859 */
3860 typedef struct paSrioType9Info_s
3861 {
3862 uint16_t streamId; /**< Stream identifier */
3863 uint16_t cos; /**< Class of service */
3864 } paSrioType9Info_t;
3867 /**
3868 * @ingroup palld_api_structures
3869 * @brief Srio message type specific header information
3870 *
3871 * @details This union is used to specify the SRIO type specific header information to the module.
3872 * The type in the union is determined through other parameters passed to the module
3873 * (see @ref srioMessageTypes).
3874 */
3875 typedef union {
3877 paSrioType9Info_t type9; /**< SRIO type 9 specific information */
3878 paSrioType11Info_t type11; /**< SRIO type 11 specific information */
3880 } paSrioTypeInfo_t;
3882 /**
3883 * @defgroup srioMessageTypes SRIO Message types
3884 * @ingroup palld_api_constants
3885 * @{
3886 *
3887 * @name SRIO Type Values
3888 * @brief Defines the SRIO message types.
3889 *
3890 * @details The packet accelerator sub-system parses both SRIO Type 9 and Type 11 message headers (see @ref netlayers).
3891 * This group is used to distinguish which type of header will be used.
3892 */
3893 /* @{ */
3894 /**
3895 * @def pa_SRIO_TYPE_9
3896 * SRIO Message Type 9
3897 */
3898 #define pa_SRIO_TYPE_9 9
3900 /**
3901 * @def pa_SRIO_TYPE_11
3902 * SRIO Message Type 11
3903 */
3904 #define pa_SRIO_TYPE_11 11
3906 /* @} */
3907 /** @} */
3909 /**
3910 * @defgroup srioTransportTypes SRIO Transport types
3911 * @ingroup palld_api_constants
3912 * @{
3913 *
3914 * @name SRIO Transport Type Values
3915 * @brief Defines the SRIO tansport types used.
3916 *
3917 */
3918 /* @{ */
3919 /**
3920 * @def pa_SRIO_TRANSPORT_TYPE_0
3921 * SRIO Transport type 0: 8 bit device identifiers
3922 */
3923 #define pa_SRIO_TRANSPORT_TYPE_0 0
3925 /**
3926 * @def pa_SRIO_TRANSPORT_TYPE_1
3927 * SRIO Transport type 1: 16 bit device identifiers
3928 */
3929 #define pa_SRIO_TRANSPORT_TYPE_1 1
3931 /* @} */
3932 /** @} */
3934 /**
3935 * @defgroup paSrioInfoValidBits PA SRIO Info Valid Bit Definitions
3936 * @ingroup palld_api_constants
3937 * @{
3938 *
3939 * @name PA SRIO Info Valid Bit Definitions
3940 *
3941 * Bitmap definition of the validBitMap in @ref paSrioInfo_t.
3942 */
3943 /*@{*/
3944 /**
3945 * @def pa_SRIO_INFO_VALID_SRC_ID
3946 * - srcId is present
3947 */
3948 #define pa_SRIO_INFO_VALID_SRC_ID 0x0001
3949 /**
3950 * @def pa_SRIO_INFO_VALID_DEST_ID
3951 * - destId is present
3952 */
3953 #define pa_SRIO_INFO_VALID_DEST_ID 0x0002
3954 /**
3955 * @def pa_SRIO_INFO_VALID_ID
3956 * - Id is present
3957 */
3958 #define pa_SRIO_INFO_VALID_ID (pa_SRIO_INFO_VALID_SRC_ID | pa_SRIO_INFO_VALID_DEST_ID)
3960 /**
3961 * @def pa_SRIO_INFO_VALID_CC
3962 * - cc is present
3963 */
3964 #define pa_SRIO_INFO_VALID_CC 0x0004
3965 /**
3966 * @def pa_SRIO_INFO_VALID_PRI
3967 * - pri is present
3968 */
3969 #define pa_SRIO_INFO_VALID_PRI 0x0008
3970 /**
3971 * @def pa_SRIO_INFO_VALID_TYPE_INFO_STREAMID
3972 * - typeInfo.type9.streamId is present
3973 */
3974 #define pa_SRIO_INFO_VALID_TYPE_INFO_STREAMID 0x0010
3975 /**
3976 * @def pa_SRIO_INFO_VALID_TYPE_INFO_COS
3977 * - typeInfo.type9.cos is present
3978 */
3979 #define pa_SRIO_INFO_VALID_TYPE_INFO_COS 0x0020
3980 /**
3981 * @def pa_SRIO_INFO_VALID_TYPE_INFO_MAILBOX
3982 * - typeInfo.type11.mbox is present
3983 */
3984 #define pa_SRIO_INFO_VALID_TYPE_INFO_MAILBOX 0x0010
3985 /**
3986 * @def pa_SRIO_INFO_VALID_TYPE_INFO_LETTER
3987 * - typeInfo.type11.letter is present
3988 */
3989 #define pa_SRIO_INFO_VALID_TYPE_INFO_LETTER 0x0020
3990 /**
3991 * @def pa_SRIO_INFO_VALID_TYPE_INFO
3992 * - typeInfo is present
3993 */
3994 #define pa_SRIO_INFO_VALID_TYPE_INFO (pa_SRIO_INFO_VALID_TYPE_INFO_COS | \
3995 pa_SRIO_INFO_VALID_TYPE_INFO_STREAMID | \
3996 pa_SRIO_INFO_VALID_TYPE_INFO_LETTER | \
3997 pa_SRIO_INFO_VALID_TYPE_INFO_MAILBOX )
3998 /* @} */ /* ingroup */
3999 /** @} */
4001 /**
4002 * @ingroup palld_api_structures
4003 * @brief SRIO lookup information
4004 *
4005 * @details srioIpInfo_t is used to specifiy the SRIO type 9 and type 11 L0-L2 parameters used in packet routing.
4006 * set the corresponding valid bit at validBitmap for the parameters required for SRIO message
4007 * classification.
4008 * Where tt should be provided if srcId or destId is required
4009 * msgType should be provided if typeInfo is required
4010 */
4011 typedef struct {
4013 uint16_t validBitMap; /**< Specify which parameters are valid as defined at @ref paSrioInfoValidBits */
4014 uint16_t srcId; /**< Source ID */
4015 uint16_t destId; /**< Destination ID */
4016 uint16_t tt; /**< Transport Type: 16 bit or 8 bit identifiers as defined at @ref srioTransportTypes */
4017 uint16_t cc; /**< Completion code */
4018 uint16_t pri; /**< 3-bit priority */
4019 uint16_t msgType; /**< Message type as defined at @ref srioMessageTypes */
4020 paSrioTypeInfo_t typeInfo; /**< Message Type specific parameters */
4021 } paSrioInfo_t;
4024 /**
4025 * @ingroup palld_api_structures
4026 * @brief Packet routing configuration
4027 *
4028 * @details paRouteInfo_t is used to specify the physical routing of packets out of the packet accelerator
4029 * sub-system. Not all fields are required for all destinations.
4030 * @li pa_DEST_DISCARD: none
4031 * @li pa_DEST_CONTINUE_PARSE_LUT1:
4032 * @li pa_DEST_CONTINUE_PARSE_LUT2: customType, customIndex
4033 * @li pa_DEST_HOST: flowId, queue, mRoutehandle, swInfo0, cmd
4034 * @li pa_DEST_SASS: flowId, queue, swInfo0, swInfo1, cmd
4035 * @li pa_DEST_ETH: emacCtrl
4036 * @li pa_DEST_SRIO: flowId, queue, swInfo0, swInfo2, pktType
4037 */
4038 typedef struct {
4040 int dest; /**< Packet destination as defined at @ref pktDest */
4041 uint8_t flowId; /**< For host, SA or SRIO destinations, specifies CPPI flow which defines free queues are used for receiving packets */
4042 uint16_t queue; /**< For host, SA or SRIO destinations, specifies the destination queue */
4043 int mRouteIndex; /**< For host, Multi-queue routing index (0 to (@ref pa_MAX_MULTI_ROUTE_SETS - 1))
4044 or @ref pa_NO_MULTI_ROUTE if multi routing not used */
4045 uint32_t swInfo0; /**< Placed in SwInfo0 for packets to host or SA; Placed in the PS Info for packets to SRIO */
4046 uint32_t swInfo1; /**< Placed in SwInfo1 for packets to the SA; Placed in the PS Info for packets to SRIO */
4047 int customType; /**< For CONTINUE_PARSE_LUT1/LUT2 only, specifies the custom type as defined at @ref customType */
4048 uint8_t customIndex; /**< For CONTINUE_PARSE_LUT1/LUT2 only, specifies the custom classification entry index */
4049 uint8_t pktType_emacCtrl; /**< For destination SRIO, specify the 5-bit packet type toward SRIO
4050 For destination HOST, EMAC, specify the EMAC control @ref emcOutputCtrlBits to the network */
4051 paCmdInfo_t *pCmd; /**< Pointer to the Command info to be executed prior to the packet forwarding.
4052 NULL: no commads
4053 @note only the following commands are supported within paRouteInfo_t
4054 - pa_CMD_PATCH_DATA (up to two bytes only) (LUT2 only)
4055 - pa_CMD_CMDSET
4056 - pa_CMD_USR_STATS
4057 - pa_CMD_CMDSET_AND_USR_STATS
4058 */
4059 } paRouteInfo_t;
4061 /**
4062 * @def pa_NO_MULTI_ROUTE
4063 * Multi Route not enabled in this route
4064 */
4065 #define pa_NO_MULTI_ROUTE -1
4067 /**
4068 * @def pa_MAX_MULTI_ROUTE_SETS
4069 * The maximum number of multi-route sets supported
4070 */
4071 #define pa_MAX_MULTI_ROUTE_SETS 32
4073 /**
4074 * @def pa_MAX_MULTI_ROUTE_ENTRIES
4075 * The maximum number of multi-route entries per muli-route set
4076 */
4077 #define pa_MAX_MULTI_ROUTE_ENTRIES 8
4079 /**
4080 * @defgroup paEfOpInfoCtrlFlags PA Egress Flow Operation Info Control Flag Definitions
4081 * @ingroup palld_api_constants
4082 * @{
4083 *
4084 * @name PA Egress Flow Operation Info Control Flag Definitions
4085 * Bitmap definition of the ctrlFlags in @ref paEfOpInfo_t.
4086 */
4087 /*@{*/
4088 /**
4089 * @def pa_EF_OP_CONTROL_FLAG_FC_LOOKUP
4090 * Flag -- 1: Perform Flow Cache lookup
4091 * 0: Do not perform Flow Cache lookup, use the Eflow records specified within @ref paEfOpInfo_t
4092 */
4093 #define pa_EF_OP_CONTROL_FLAG_FC_LOOKUP 0x0001
4094 /*@}*/
4095 /** @} */
4097 /**
4098 * @defgroup paEfOpInfoValidBit PA Egress Flow Operation Info Valid Bit Definitions
4099 * @ingroup palld_api_constants
4100 * @{
4101 *
4102 * @name PA Egress Flow Operation Info Valid Bit Definitions
4103 * Bitmap definition of the validBitfield in @ref paEfOpInfo_t.
4104 * It allows selective Egress Flow opertaion parameters
4105 */
4106 /*@{*/
4107 /**
4108 * @def pa_EF_OP_INFO_VALID_LVL1
4109 * Egress Flow level 1 index is present
4110 */
4111 #define pa_EF_OP_INFO_VALID_LVL1 0x0001
4112 /**
4113 * @def pa_EF_OP_INFO_VALID_LVL2
4114 * Egress Flow level 2 index is present
4115 */
4116 #define pa_EF_OP_INFO_VALID_LVL2 0x0002
4117 /**
4118 * @def pa_EF_OP_INFO_VALID_LVL3
4119 * Egress Flow level 3 index is present
4120 */
4121 #define pa_EF_OP_INFO_VALID_LVL3 0x0004
4122 /**
4123 * @def pa_EF_OP_INFO_VALID_LVL4
4124 * Egress Flow level 4 index is present
4125 */
4126 #define pa_EF_OP_INFO_VALID_LVL4 0x0008
4128 /*@}*/
4129 /** @} */
4131 /**
4132 * @ingroup palld_api_structures
4133 * @brief Egress Flow operation information
4134 *
4135 * @details paEfOpInfo_t is used to specifiy the Egress Flow operation parameters.
4136 * It is used by @ref paRouteInfo2_t in the ingress path for IP forwarding
4137 * operation and API @ref Pa_addFc for Flow Cache operation.
4138 * Refer to @ref appendix4 for deatiled information
4139 */
4140 typedef struct {
4141 uint16_t ctrlFlags; /**< Specify Egress flow control flags as defined at @ref paEfOpInfoCtrlFlags */
4142 uint16_t validBitMap; /**< Specify valid parameters as defined at @ref paEfOpInfoValidBit */
4143 uint16_t lvl1Index; /**< Specify egress flow level 1 record index */
4144 uint16_t lvl2Index; /**< Specify egress flow level 2 record index */
4145 uint16_t lvl3Index; /**< Specify egress flow level 3 record index */
4146 uint16_t lvl4Index; /**< Specify egress flow level 4 record index */
4147 } paEfOpInfo_t;
4150 /**
4151 @defgroup paPriIntfRouteMode Priority-based or Interface-based routing mode
4152 * @ingroup palld_api_constants
4153 * @{
4154 *
4155 * @name Priority-based or Interface-based routing mode
4156 *
4157 * paRoutePriIntf_e is used to specify the mode of priority-based
4158 * or interface-based routing.
4159 * PASS forwards the matched packets to the desired QoS queue which is equal
4160 * to the base queue plus an offset specified by the VLAN priority or DSCP value
4161 * in prority-based routing.
4162 * PASS forwards the matched packets to the desired host queue which is equal
4163 * to the base queue plus an offset as the EMAC port (interface) number with the CPPI
4164 * flow which is equal to the base flow number plus the EMAC port (interface) number
4165 * optionally in interface-based routing.
4166 *
4167 * @note: There is some use cases where output packets from QoS are delivered to
4168 * PASS for pre-routing operation such as tx timestamp report and both
4169 * egress and ingress forwarding packets go through the same QoS. To support
4170 * this use case, the PASS is enhanced to delay the post-classification command
4171 * set execution until the packets re-entering PASS from QoS if Priority-based
4172 * routing is selected.
4173 */
4174 /** @ingroup paPriIntfRouteMode */
4175 /*@{*/
4176 typedef enum {
4177 pa_ROUTE_PRIORITY_VLAN = 1, /**< Route by using VLAN bits as priority */
4178 pa_ROUTE_PRIORITY_DSCP, /**< Route by using DSCP bits as priority */
4179 pa_ROUTE_INTF, /**< Route by using EMAC port (interface) number as destination queue offset */
4180 pa_ROUTE_INTF_W_FLOW /**< Route by using EMAC port (interface) number as both
4181 destination queue and CPPI flow offset */
4182 } paRoutePriIntf_e;
4184 /*@}*/
4185 /** @} */
4187 /**
4188 * @defgroup paRouteInfoValidBits PA Route Info Valid Bit Definitions
4189 * @ingroup palld_api_constants
4190 * @{
4191 *
4192 * @name PA Route Info Valid Bit Definitions
4193 *
4194 * Bitmap definition of the validBitMap in @ref paRouteInfo2_t.
4195 */
4196 /*@{*/
4198 /**
4199 * @def pa_ROUTE_INFO_VALID_MROUTEINDEX
4200 * - Optional parameter mRouteIndex for Host routing is valid
4201 */
4202 #define pa_ROUTE_INFO_VALID_MROUTEINDEX (1<<0)
4204 /**
4205 * @def pa_ROUTE_INFO_VALID_PKTTYPE_EMAC
4206 * - Optional parameter pktType_emacCtrl for Host or EMAC routing is valid
4207 */
4208 #define pa_ROUTE_INFO_VALID_PKTTYPE_EMAC (1<<1)
4210 /**
4211 * @def pa_ROUTE_INFO_VALID_PCMD
4212 * - Optional parameter pCmd is valid
4213 */
4214 #define pa_ROUTE_INFO_VALID_PCMD (1<<2)
4216 /**
4217 * @def pa_ROUTE_INFO_VALID_PRIORITY_TYPE
4218 * - Optional parameter priorityType used for Priority-based or interface-based routing is valid
4219 */
4220 #define pa_ROUTE_INFO_VALID_PRIORITY_TYPE (1<<3)
4222 /* @} */ /* ingroup */
4223 /** @} */
4225 /**
4226 * @ingroup palld_api_structures
4227 * @brief Enhanced Packet routing configuration
4228 *
4229 * @details paRouteInfo2_t is the upgraded version of paRouteInfo_t to support additional routing
4230 * parameters over time while still maintaining backward compatibility. Future feature
4231 * enhancements will be supported through this API data structure only.
4232 *
4233 * The validBitMap is used to specify which field is used for packet routing.
4234 */
4235 typedef struct {
4236 uint32_t validBitMap; /**< 32-bit valid bitmap corresponding to each optional field as defined at @ref paRouteInfoValidBits */
4237 int dest; /**< Packet destination as defined at @ref pktDest */
4238 uint8_t flowId; /**< For host, SA or SRIO destinations, specifies CPPI flow which defines free queues are used for receiving packets */
4239 uint16_t queue; /**< For host, SA or SRIO destinations, specifies the destination queue */
4240 int mRouteIndex; /**< validBitMap[t0] For host, Multi-queue routing index (0 to (@ref pa_MAX_MULTI_ROUTE_SETS - 1) */
4241 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 */
4242 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 */
4243 int customType; /**< For CONTINUE_PARSE_LUT1/LUT2 only, specifies the custom type as defined at @ref customType */
4244 uint8_t customIndex; /**< For CONTINUE_PARSE_LUT1/LUT2 only, specifies the custom classification entry index */
4245 uint8_t pktType_emacCtrl; /**< validBitMap[t1] For destination SRIO, specify the 5-bit packet type toward SRIO
4246 For destination HOST, EMAC, specify the EMAC control @ref emcOutputCtrlBits to the network */
4247 paCmdInfo_t *pCmd; /**< validBitMap[t2] Pointer to the Command info to be executed prior to the packet forwarding.
4248 NULL: no commads
4249 @note only the following commands are supported within paRouteInfo_t and paRouteInfo2_t
4250 for ingress packets
4251 - pa_CMD_PATCH_DATA (up to two bytes only) (LUT2 only)
4252 - pa_CMD_CMDSET
4253 - pa_CMD_USR_STATS
4254 - pa_CMD_CMDSET_AND_USR_STATS
4255 @note the post-classification commands specified by the command set will be executed when the packets re-entering PASS
4256 from the QoS queue if priority-based routing is selected
4257 */
4258 uint8_t priorityType; /**< validBitMap[t3]: For Host only, specify priority-based and/or interfcae-based routing mode as
4259 * defined at @ref paRoutePriIntf_e
4260 */
4261 paEfOpInfo_t *efOpInfo; /**< For EFLOW only, egress flow operation info (PAGG Gen2 only) */
4262 } paRouteInfo2_t;
4264 /**
4265 * @defgroup mrEntryCtrlInfo Multiroute Entry Control Info Bit Definitions
4266 * @ingroup palld_api_constants
4267 * @{
4268 *
4269 * @name Multiroute Entry Control Info Bit Definitions
4270 *
4271 * Bitmap definition of the ctrlBitField in @ref paMultiRouteEntry_t.
4272 */
4273 /*@{*/
4274 /**
4275 * @def pa_MULTI_ROUTE_DESCRIPTOR_ONLY
4276 * Control Info -- Set: Send descriptor without packet to the destination
4277 * Clear: Send both descriptor and the packet to the destination
4278 *
4279 */
4280 #define pa_MULTI_ROUTE_DESCRIPTOR_ONLY 0x01
4281 /*@{*/
4282 /**
4283 * @def pa_MULTI_ROUTE_REPLACE_SWINFO
4284 * Control Info -- Set: Replace the swInfo0 with the value provided here
4285 * Clear: Keep the original swInfo0
4286 *
4287 */
4288 #define pa_MULTI_ROUTE_REPLACE_SWINFO 0x02
4289 /*@}*/
4290 /** @} */
4292 /**
4293 * @ingroup palld_api_structures
4294 * @brief Packet Multi-route entry configuration
4295 *
4296 * @details paMultiRouteEntry_t is used to specify the physical routing of packets per multi-route entry.
4297 * It is only a subset of the Routing information defined at @ref paRouteInfo_t because those common
4298 * parameters such as swInfo0, swInfo1 must be already present in the packet descriptor.
4299 * There is no restriction of the destination as long as it is accessible through PKTDMA queue.
4300 */
4301 typedef struct {
4303 uint8_t ctrlBitfield; /**< Multi-Routing control information as defined at @ref mrEntryCtrlInfo */
4304 uint8_t flowId; /**< For host, specifies the CPPI flow which defines the free queues are used for receiving packets */
4305 uint16_t queue; /**< For host, specifies the destination queue */
4306 uint32_t swInfo0; /**< Placed in SwInfo0 for packets to host */
4308 } paMultiRouteEntry_t;
4310 /**
4311 * @defgroup paMultiRouteModes Multi-route group configuration mode
4312 * @ingroup palld_api_constants
4313 * @{
4314 *
4315 * @name Multi-route group configuration mode
4316 *
4317 * Definition of Multi-route group configuration mode supported in PA sub-system
4318 */
4319 /** @ingroup paMultiRouteModes */
4320 /*@{*/
4321 typedef enum {
4322 pa_MULTI_ROUTE_MODE_CONFIG = 0, /**< Add or reconfigure the multi-route group */
4323 pa_MULTI_ROUTE_MODE_RESET /**< Delete the multi-route group */
4324 } paMultiRouteModes_e;
4325 /*@}*/
4326 /** @} */
4328 /**
4329 * @defgroup paCrcSizes PA CRC Sizes
4330 * @ingroup palld_api_constants
4331 * @{
4332 *
4333 * @name CRC Sizes
4334 *
4335 * Definition of CRC sizes supported in PA sub-system
4336 */
4337 /** @ingroup paCrcSizes */
4338 /*@{*/
4339 typedef enum {
4340 pa_CRC_SIZE_8 = 0, /**< 8-bit CRC */
4341 pa_CRC_SIZE_16, /**< 16-bit CRC */
4342 pa_CRC_SIZE_24, /**< 24-bit CRC */
4343 pa_CRC_SIZE_32 /**< 32-bit CRC */
4344 } paCrcSizes_e;
4345 /*@}*/
4346 /** @} */
4348 /**
4349 * @defgroup crcConfigCtrlInfo CRC Engine Configuration Control Info Bit Definitions
4350 * @ingroup palld_api_constants
4351 * @{
4352 *
4353 * @name CRC Engine Configuration Control Info Bit Definitions
4354 *
4355 * Bitmap definition of the ctrlBitField in @ref paCrcConfig_t.
4356 */
4357 /*@{*/
4358 /**
4359 * @def pa_CRC_CONFIG_RIGHT_SHIFT
4360 * Control Info -- Set: Right shift CRC (b0 to b7)
4361 * Clear: Left shift CRC (b7 to b0)
4362 */
4363 #define pa_CRC_CONFIG_RIGHT_SHIFT 0x0001
4364 /**
4365 * @def pa_CRC_CONFIG_INVERSE_RESULT
4366 * Control Info -- Set: a 'NOT' operation is applied to the final CRC result
4367 */
4368 #define pa_CRC_CONFIG_INVERSE_RESULT 0x0002
4369 /*@}*/
4370 /** @} */
4372 /**
4373 * @ingroup palld_api_structures
4374 * @brief CRC Engine configuration
4375 *
4376 * @details paCrcConfig_t is used to configure the CRC engines within the PA sub-system.
4377 * There are several CRC engines within various processing stages in the PA sub-system.
4378 * The locations of CRC engines are defined and described at @ref paCrcInst.
4379 * The CRC engine is used to perform CRC operation required by some network protocol such as
4380 * SCTP and/or the user-specified CRC command. It only supports one type of CRC
4381 * per configuration.
4382 *
4383 * @note Only one type of CRC calcualtion is supported by one CRC engine per configuration.
4384 * It is the responsibility of the module user to configure the specific CRC engine by
4385 * calling @ref Pa_configCrcEngine.
4386 */
4388 typedef struct {
4390 uint16_t ctrlBitfield; /**< CRC configuration control information as defined at @ref crcConfigCtrlInfo */
4391 paCrcSizes_e size; /**< CRC sizes as defined at @ref paCrcSizes_e (PASS Gen1 only)*/
4392 uint32_t polynomial; /**< Specify the CRC polynomial in the format of 0xabcdefgh. For example,
4393 x32+x28+x27+x26+x25+x23+x22+x20+x19+x18+x14+x13+x11+x10+x9+x8+x6+1
4394 ==> 0x1EDC6F41
4395 x16+x15+x2+1 ==>0x80050000 */
4396 uint32_t initValue; /**< CRC initial value (PASS Gen1 only)*/
4397 } paCrcConfig_t;
4400 /**
4401 * @defgroup timestampScalerFactor Timestamp Scaler Factor
4402 * @ingroup palld_api_constants
4403 * @{
4404 *
4405 * @name Timestamp Scaler Factor
4406 *
4407 * Definition of PA timestamp scaler factor supported in PA sub-system
4408 *
4409 * @note pa_TIMESTAMP_SCALER_FACTOR_1 is not supported. It is defined here
4410 * for reference purpose.
4411 */
4412 /** @ingroup timestampScalerFactor */
4413 /*@{*/
4414 typedef enum {
4415 pa_TIMESTAMP_SCALER_FACTOR_1 = -1,
4416 pa_TIMESTAMP_SCALER_FACTOR_2 = 0,
4417 pa_TIMESTAMP_SCALER_FACTOR_4,
4418 pa_TIMESTAMP_SCALER_FACTOR_8,
4419 pa_TIMESTAMP_SCALER_FACTOR_16,
4420 pa_TIMESTAMP_SCALER_FACTOR_32,
4421 pa_TIMESTAMP_SCALER_FACTOR_64,
4422 pa_TIMESTAMP_SCALER_FACTOR_128,
4423 pa_TIMESTAMP_SCALER_FACTOR_256,
4424 pa_TIMESTAMP_SCALER_FACTOR_512,
4425 pa_TIMESTAMP_SCALER_FACTOR_1024,
4426 pa_TIMESTAMP_SCALER_FACTOR_2048,
4427 pa_TIMESTAMP_SCALER_FACTOR_4096,
4428 pa_TIMESTAMP_SCALER_FACTOR_8192
4429 } paTimestampScalerFactor_e;
4430 /*@}*/
4431 /** @} */
4433 /**
4434 * @ingroup palld_api_structures
4435 * @brief Timestamp configuration
4436 *
4437 * @details paTimestampConfig_t is used to configure the timer which is used to generate timestamp in
4438 * the PA sub-system.
4439 * @verbatim
4440 The 16-bit timer connected to PDSP0 is reserved for timestamp generation.
4441 The timestamp will be 0 until the timer is enabled.
4442 The timestamp unit is equal to (the scaler factor)/350 us.
4443 @endverbatim
4444 *
4445 * @note: The PDSP timer does not support pa_TIMESTAMP_SCALER_FACTOR_1.
4446 * The timer will be disabled if unspported scaler factor is used.
4447 */
4449 typedef struct {
4450 uint16_t enable; /**< Enable/Disable(1/0) the timestamp generation */
4451 paTimestampScalerFactor_e factor; /**< Timestamp scaler factor as defined at @ref timestampScalerFactor */
4452 } paTimestampConfig_t;
4454 /**
4455 * @defgroup paUsrStatsTypes PA User-defined Ststaistics Counter Types
4456 * @ingroup palld_api_constants
4457 * @{
4458 *
4459 * @name User-defined Ststaistics Counter Types
4460 *
4461 * Definition of Counter types of the User-defined Statistics
4462 */
4463 /** @ingroup paUsrStatsTypes */
4464 /*@{*/
4465 typedef enum {
4466 pa_USR_STATS_TYPE_PACKET = 0, /**< Packet Counter */
4467 pa_USR_STATS_TYPE_BYTE, /**< Byte Counter */
4468 pa_USR_STATS_TYPE_DISABLE /**< Counter to be disabled */
4469 } paUsrStatsTypes_e;
4470 /*@}*/
4471 /** @} */
4474 /**
4475 * @ingroup palld_api_structures
4476 * @brief User-defined statistics counter entry configuration information
4477 *
4478 * @details paUsrStatsCounterEntryConfig_t defines the operation parameters of each user-defined statistics.
4479 */
4481 typedef struct {
4482 uint16_t cntIndex; /**< Index of the counter */
4483 uint16_t cntLnk; /**< Index of the next level counter. 0xFFFF: No linking counter */
4484 paUsrStatsTypes_e cntType; /**< Counter type (packet counter */
4485 } paUsrStatsCounterEntryConfig_t;
4487 /**
4488 * @def pa_USR_STATS_LNK_END
4489 * Indicate that there is no next layer counter
4490 */
4491 #define pa_USR_STATS_LNK_END 0xFFFF
4494 /**
4495 * @defgroup usrStatsCounterConfigCtrlInfo User-defined Statistics Counter Configuration Control Info Bit Definitions
4496 * @ingroup palld_api_constants
4497 * @{
4498 *
4499 * @name User-defined Statistics Counter Configuration Control Info Bit Definitions
4500 *
4501 * Bitmap definition of the ctrlBitField in @ref paUsrStatsCounterConfig_t
4502 */
4503 /*@{*/
4504 /**
4505 * @def pa_USR_STATS_CONFIG_RESET
4506 * Control Info -- Set: Reset all counter control blocks to its default setting (packet counter without link to the next layer)
4507 */
4508 #define pa_USR_STATS_CONFIG_RESET 0x0001
4509 /*@}*/
4510 /** @} */
4512 /**
4513 * @ingroup palld_api_structures
4514 * @brief User-defined statistics counter configuration information
4515 *
4516 * @details paUsrStatsCounterConfig_t contains an array of the entry configuration information.
4517 */
4519 typedef struct {
4520 uint16_t ctrlBitfield; /**< User-defined statistics counter configuration control information as defined at @ref usrStatsCounterConfigCtrlInfo */
4521 uint16_t numCnt; /**< Number of counters to be configured */
4522 paUsrStatsCounterEntryConfig_t* cntInfo; /**< Array of counter configuration as specified at @ref paUsrStatsCounterEntryConfig_t */
4523 } paUsrStatsCounterConfig_t;
4525 /**
4526 * @ingroup palld_api_structures
4527 * @brief User-defined statistics configuration information
4528 *
4529 * @details paUsrStatsConfigInfo_t is used to perform user-defined statistics related configuration. It is used by
4530 * API function @ref Pa_configUsrStats.
4531 */
4532 typedef struct {
4533 paUsrStatsCounterConfig_t* pCntCfg; /**< Pointer to the user-defined statistics counter configuration. */
4534 } paUsrStatsConfigInfo_t;
4536 /**
4537 * @defgroup usrStatsAllocCtrlInfo User-defined Statistics Allocation Control Info Bit Definitions
4538 * @ingroup palld_api_constants
4539 * @{
4540 *
4541 * @name User-defined Statistics Allocation Control Info Bit Definitions
4542 *
4543 * Bitmap definition of the ctrlBitField in @ref paUsrStatsAlloc_t
4544 */
4545 /*@{*/
4546 /**
4547 * @def pa_USR_STATS_ALLOC_64B_CNT
4548 * Control Info -- Set: Allocate a 64-bit counter
4549 * Clear: Allocate a 32-bit counter
4550 */
4551 #define pa_USR_STATS_ALLOC_64B_CNT 0x0001
4553 /**
4554 * @def pa_USR_STATS_ALLOC_CNT_PRESENT
4555 * Control Info -- Set: Counter index is provided. Need to verify whether the counter index is valid.
4556 * Clear: Counter index is not present. Need to allocate one.
4557 */
4558 #define pa_USR_STATS_ALLOC_CNT_PRESENT 0x0002
4560 /*@}*/
4561 /** @} */
4564 /**
4565 * @ingroup palld_api_structures
4566 * @brief User-defined statistics Allocation information
4567 *
4568 * @details paUsrStatsAlloc_t defines the user-defined statistic allocation parameters which are used to specify
4569 * the charistics of the counter to be allocated or verified.
4570 */
4572 typedef struct {
4573 uint16_t ctrlBitfield; /**< User-defined statistics allocation control information as defined at @ref usrStatsAllocCtrlInfo */
4574 uint16_t cntIndex; /**< Index of the counter */
4575 } paUsrStatsAlloc_t;
4578 /**
4579 * @defgroup paSubSysStates PA Sub-system Queries and States
4580 * @ingroup palld_api_constants
4581 * @{
4582 *
4583 * @name PA Sub-system Queries and States
4584 *
4585 * PA Sub-system reset state and query arguments used by API function @ref Pa_resetControl
4586 */
4587 /* @{ */
4588 /**
4589 * @def pa_STATE_RESET
4590 * The Sub-system is in reset
4591 */
4592 #define pa_STATE_RESET 0 /**< Sub-system state reset */
4594 /**
4595 * @def pa_STATE_ENABLE
4596 * The Sub-system state is enabled
4597 */
4598 #define pa_STATE_ENABLE 1 /**< Sub-system state enable */
4600 /**
4601 * @def pa_STATE_QUERY
4602 * Query the Sub-system state
4603 */
4604 #define pa_STATE_QUERY 2 /**< Query the Sub-system state */
4606 /**
4607 * @def pa_STATE_INCONSISTENT
4608 * The Sub-system state is partially enabled
4609 */
4610 #define pa_STATE_INCONSISTENT 3 /**< Sub-system is partially enabled */
4612 /**
4613 * @def pa_STATE_INVALID_REQUEST
4614 * Invalid state command to the Sub-system
4615 */
4616 #define pa_STATE_INVALID_REQUEST 4 /**< Invalid state command to the Sub-system */
4618 /**
4619 * @def pa_STATE_ENABLE_FAILED
4620 * The Sub-system did not respond after restart
4621 */
4622 #define pa_STATE_ENABLE_FAILED 5 /**< The Sub-system did not respond after restart */
4624 /**
4625 * @def pa_STATE_RESOURCE_USE_DENIED
4626 * Resource manager denied the firmware use
4627 */
4628 #define pa_STATE_RESOURCE_USE_DENIED 6 /**< Resource manager denied the firmware use */
4630 /* @} */
4631 /** @} */
4634 /**
4635 * @ingroup palld_api_structures
4636 * @brief paSState_t defines the operating state of the packet accelerator sub-system
4637 *
4638 * @details The values in @ref paSubSysStates are used both to set the state of the packet accelerator
4639 * sub-system (pa_STATE_RESET and pa_STATE_ENABLE) as well as show the current state
4640 * of the system (all values).
4641 */
4642 typedef int paSSstate_t;
4644 /**
4645 * @ingroup palld_api_structures
4646 * @brief PA Classify1 Statistics Structure
4647 *
4648 * @details This structures define the PA Classify1-specific statistics provided
4649 * with API function @ref Pa_formatStatsReply ().
4650 */
4651 typedef struct paClassify1Stats_s {
4653 uint32_t nPackets; /**< Number of packets entering Classify1 PDSPs */
4654 uint32_t nIpv4Packets; /**< Number of IPv4 packets */
4655 uint32_t nIpv4PacketsInner; /**< Number of Inner IPv4 packets */
4656 uint32_t nIpv6Packets; /**< Number of IPv6 packets */
4657 uint32_t nIpv6PacketsInner; /**< Number of Inner IPv6 packets */
4658 uint32_t nCustomPackets; /**< Number of custom LUT1 packets */
4659 uint32_t nSrioPackets; /**< Number of SRIO packets */
4660 uint32_t nLlcSnapFail; /**< Number of packets with corrupt LLC Snap */
4661 uint32_t nTableMatch; /**< Number of packets with table match found */
4662 uint32_t nNoTableMatch; /**< Number of packets without table match found */
4663 uint32_t nIpFrag; /**< Number of Ingress fragmented IP packets */
4664 uint32_t nIpDepthOverflow; /**< Number of packets with too many IP layers */
4665 uint32_t nVlanDepthOverflow; /**< Number of packets with too many VLANs */
4666 uint32_t nGreDepthOverflow; /**< Number of packets with too many GREs */
4667 uint32_t nMplsPackets; /**< Number of MPLS packets */
4668 uint32_t nParseFail; /**< Number of packets which can not be parsed */
4669 uint32_t nInvalidIPv6Opt; /**< Number of IPv6 packets which contains invalid IPv6 options */
4670 uint32_t nTxIpFrag; /**< Number of Egress fragmented IP packets */
4671 uint32_t nSilentDiscard; /**< Number of packets dropped */
4672 uint32_t nInvalidControl; /**< Number of packet received with invalid control information */
4673 uint32_t nInvalidState; /**< Number of times the PA detected an illegal state and recovered */
4674 uint32_t nSystemFail; /**< Number of times the PA detected an unrecoverable state and restarted */
4676 } paClassify1Stats_t;
4678 /**
4679 * @ingroup palld_api_structures
4680 * @brief PA Classify2 Statistics Structure
4681 *
4682 * @details This structures define the PA Classify2-specific statistics provided
4683 * with API function @ref Pa_formatStatsReply ().
4684 */
4685 typedef struct paClassify2Stats_s {
4687 uint32_t nPackets; /**< Number of packets entering Classify2 PDSP */
4688 uint32_t nUdp; /**< Number of UDP packets */
4689 uint32_t nTcp; /**< Number of TCP packets */
4690 uint32_t nCustom; /**< Number of custom LUT2 packets */
4691 uint32_t reserved3; /**< Reserved for future use */
4692 uint32_t reserved4; /**< Reserved for future use */
4693 uint32_t nSilentDiscard; /**< Number of packets dropped */
4694 uint32_t nInvalidControl; /**< Number of packet received with invalid control information */
4696 } paClassify2Stats_t;
4698 /**
4699 * @ingroup palld_api_structures
4700 * @brief PA Modifier Statistics Structure
4701 *
4702 * @details This structures define the PA Modifier-specific statistics provided
4703 * with API function @ref Pa_formatStatsReply ().
4704 */
4705 typedef struct paModifyStats_s {
4706 uint32_t nCommandFail; /**< Number of invalid commands */
4708 } paModifyStats_t;
4710 /**
4711 * @ingroup palld_api_structures
4712 * @brief PA Common Statistics Structure
4713 *
4714 * @details This structures define the PA Common statistics provided
4715 * with API function @ref Pa_formatStatsReply ().
4716 */
4717 typedef struct paCommonStats_s {
4719 uint32_t reserved5; /**< Reserved for future use */
4721 } paCommonStats_t;
4723 /**
4724 * @ingroup palld_api_structures
4725 * @brief PA System Statistics Structure
4726 *
4727 * @details This structures define the PA System statistics provided
4728 * with API function @ref Pa_formatStatsReply ().
4729 */
4731 typedef struct paSysStats_s {
4733 paClassify1Stats_t classify1; /**< Classify1-specific statistics */
4734 paClassify2Stats_t classify2; /**< Classify2-specific statistics */
4735 paModifyStats_t modify; /**< Modifier-specific statistics */
4736 paCommonStats_t common; /**< Common statistics */
4738 } paSysStats_t;
4740 /**
4741 * @ingroup palld_api_structures
4742 * @brief PA User-defined Statistics Structure
4743 *
4744 * @details This structures define the PA User-defined statistics provided
4745 * with API function @ref Pa_requestUsrStats ().
4746 */
4748 typedef struct paUsrStats_s {
4750 uint64_t count64[pa_USR_STATS_MAX_64B_COUNTERS]; /**< Array of general purpose 64-bit counters */
4751 uint32_t count32[pa_USR_STATS_MAX_32B_COUNTERS]; /**< Array of general purpose 32-bit counters */
4753 } paUsrStats_t;
4755 /**
4756 * @ingroup palld_api_structures
4757 * @brief PA Reassembly Group Statistics Structure
4758 *
4759 * @details This structures define the PA RA group-specific statistics
4760 */
4761 typedef struct paRaGroupStats_s {
4763 uint32_t nReasmPackets; /**< Number of successfully reassembled packets of Group N*/
4764 uint32_t nFrags; /**< Number of fragmented IP packets of group N*/
4765 uint32_t nPackets; /**< Number of packets of Group N */
4766 uint32_t nCxtTOwSOP; /**< Number of IP packets where contexts associated with Group N time out
4767 before being completely reassembled, the SOP fragment has been received */
4768 uint32_t nCxtTOwSOPBytes; /**< Number of payload bytes of IP packets where contexts associated with Group N
4769 time out before being completely reassembled, the SOP fragment has been received */
4770 uint32_t nCxtTOwoSOP; /**< Number of IP packets where contexts associated with Group N time out before being
4771 completely reassembled, the SOP fragment has not been received */
4772 uint32_t nCxtTOwoSOPBytes; /**< Number of payload bytes of IP packets where contexts associated with Group N time out
4773 before being completely reassembled, the SOP fragment has not been received */
4774 uint32_t nZeroByte; /**< Number of IP fragments with zero-byte payload */
4775 uint32_t reserved2; /**< Reserved for future use */
4776 uint32_t nIpv6Overlap; /**< Number of IPv6 packets which are discarded because a fragment of this
4777 packet arrives that overlaps data previously received in another
4778 fragment for that same packet */
4779 uint32_t nIpv6OverlapBytes; /**< Number of IPv6 payload bytes which are discarded because a fragment of this
4780 packet arrives that overlaps data previously received in another
4781 fragment for that same packet */
4782 uint32_t nLargePackets; /**< Number of IP packets which are discarded because the completely reassembled
4783 packet greater than 64KB */
4784 uint32_t nIpv4TcpErr; /**< Number of IP packets which are discarded due to TCP error, i.e. a fragment is
4785 received that has a protocol of TCP and a fragment offset of 1 */
4786 uint32_t nFragLenErr; /**< Number of IP packets which are discarded due to an incorrect fragment length */
4787 uint32_t nIpv4IllegalIHL; /**< Number of IPv4 fragments which are discarded due to an incorrect IP header length */
4788 uint32_t nSmallFragments; /**< Number of IP fragments which is too small
4789 - IPv4: Packets that are not last fragment and are smaller than minIpv4PktSize
4790 - IPv6: Packets that are not last fragment and are smaller than 56 bytes
4791 - IPV6: Packets that are last fragment and are smaller than 49 bytes */
4792 uint32_t nIllegalFragLen; /**< Number of IP fragments that is not the last fragment, has a length
4793 that is not a multiple of 8 bytes */
4794 uint32_t nCxtCompletedDiscard; /**< Number of IP fragments which are discarded because they are for a context that has
4795 already been completed or timed out */
4796 uint32_t nCxtCompletedDiscardBytes; /**< Total payload bytes of IP fragments which are discarded because they are for a context that has
4797 already been completed or timed out */
4799 } paRaGroupStats_t;
4801 /**
4802 * @ingroup palld_api_structures
4803 * @brief PA RA Statistics Structure
4804 *
4805 * @details This structures define the PA RA statistics provided
4806 * with API function @ref Pa_requestUsrStats ().
4807 */
4809 typedef struct paRaStats_s {
4810 paRaGroupStats_t group[pa_RA_NUM_GROUPS]; /**< array of group-specific RA statistics */
4811 } paRaStats_t;
4813 /**
4814 * @ingroup palld_api_structures
4815 * @brief PA ACL Entry Statistics Structure
4816 *
4817 * @details This structures define the PA ACL per-entry statistics provided
4818 * with API function @ref Pa_queryAclStats ().
4819 */
4821 typedef struct paAclStats_s {
4823 uint32_t nMatchPackets; /**< Number of packets which matchs the ACL rule */
4824 uint32_t nMatchBytes; /**< Total bytes of the matched packets */
4826 } paAclStats_t;
4829 /**
4830 * @ingroup palld_api_structures
4831 * @brief PA Timestamp Structure
4832 *
4833 * This structure defines the 48-bit timestamp provided upon request with @ref Pa_getTimestamp ().
4834 */
4835 typedef struct {
4836 uint32_t hi; /**< Upper 32 bits of the 48-bit PASS timestamp */
4837 uint16_t lo; /**< Lower 16 bits of the 48-bit PASS timestamp */
4838 } paTimestamp_t;
4841 /**
4842 * @defgroup paApiParamValidBits PA API Parameter Valid Bit Definitions
4843 * @ingroup palld_api_constants
4844 * @{
4845 *
4846 * @name PA API Parameter Valid Bit Definitions
4847 *
4848 * Bitmap definition of the validBitMap in @ref paParamDesc.
4849 */
4850 /*@{*/
4852 /**
4853 * @def pa_PARAM_VALID_LUTINST
4854 * - Set: Application specifies the LUT1 instance
4855 * - Clear: LLD determines the LUT1 instance based on other input parameters
4856 */
4857 #define pa_PARAM_VALID_LUTINST (1<<0)
4859 /**
4860 * @def pa_PARAM_VALID_INDEX
4861 * - Set: Application specifies the LUT1 index to insert this entry
4862 * - Clear: PASS determines where in the LUT1 table to insert this entrry
4863 */
4864 #define pa_PARAM_VALID_INDEX (1<<1)
4866 /**
4867 * @def pa_PARAM_VALID_PREVLINK
4868 * - Set: Previous link is valid and it should be used as part of classification criteria
4869 * - Claer: Previous link is inavlid
4870 */
4871 #define pa_PARAM_VALID_PREVLINK (1<<2)
4873 /**
4874 * @def pa_PARAM_VALID_NEXTLINK
4875 * - Set: The specified virtual link in stead of the physical link should be used as part of
4876 * classification criteria at the next stage
4877 * - Clear: Use physical link at the next stage
4878 */
4879 #define pa_PARAM_VALID_NEXTLINK (1<<3)
4881 /* @} */ /* ingroup */
4882 /** @} */
4885 /**
4886 * @ingroup palld_api_structures
4887 * @brief PA API parameters structure
4888 *
4889 * @details This structure define the common parameters of the next generation APIs such as
4890 * @ref Pa_addMac2 and @ref Pa_addIp2. This structure includes a validBitMap of
4891 * optional parameters so that it can evolve while maintaining backward-compatibility.
4892 *
4893 * The parameter validBitMap specifies which optional parameters are valid
4894 * 1: used; 0: not used.
4895 *
4896 */
4897 typedef struct {
4898 uint32_t validBitMap; /**< 32-bit bitmap corresponding to usage of each optional field */
4899 int lutInst; /**< validBitMap[t0] Specify which LUT1 (0-2) should be used. */
4900 int index; /**< validBitMap[t1] Specify the index of the LUT1 entry (0-63).*/
4901 paLnkHandle_t prevLink; /**< validBitMap[t2] An optional L2 or L3 handle, or virtual link handle */
4902 paLnkHandle_t nextLink; /**< validBitMap[t3] An optional virtual link handle */
4903 paRouteInfo2_t *routeInfo; /**< Where to send a packet that matches */
4904 paRouteInfo2_t *nextRtFail; /**< Where to send a packet that matches, but fails to match any entry at the next classification stage */
4905 } paParamDesc;
4907 /**
4908 * @defgroup paLut2ApiParamValidBits PA LUT2 API Parameter Valid Bit Definitions
4909 * @ingroup palld_api_constants
4910 * @{
4911 *
4912 * @name PA LUT2 API Parameter Valid Bit Definitions
4913 *
4914 * Bitmap definition of the validBitmap in @ref paLut2ParamDesc.
4915 */
4916 /*@{*/
4918 /**
4919 * @def pa_LUT2_PARAM_VALID_CTRL_BITMAP
4920 * - Set: ctrlBitMap is valid
4921 * - Clear: ctrlBitMap is not used
4922 */
4923 #define pa_LUT2_PARAM_VALID_CTRL_BITMAP (1<<0)
4925 /**
4926 * @def pa_LUT2_PARAM_VALID_DIVERTQ
4927 * - Set: Divert Queue is specified for Queue Diversion operation
4928 * - Clear: Divert queue is not used
4929 */
4930 #define pa_LUT2_PARAM_VALID_DIVERTQ (1<<1)
4932 /* @} */ /* ingroup */
4933 /** @} */
4935 /**
4936 * @defgroup paLut2ParamCtrlFlags PA LUT2 API Common Parameters Control Flag Definitions
4937 * @ingroup palld_api_constants
4938 * @{
4939 *
4940 * @name PA LUT2 API Common Parameters Control Flag Definitions
4941 * Bitmap definition of the ctrlFlags in paLut2ParamDesc.
4942 */
4943 /*@{*/
4944 /**
4945 * @def pa_LUT2_INFO_CONTROL_FLAG_REPLACE
4946 * Flag -- 1: Replace the existing LUT2 entry
4947 * 0: Add new LUT2 entry
4948 */
4949 #define pa_LUT2_INFO_CONTROL_FLAG_REPLACE (1<<0)
4950 /*@}*/
4951 /** @} */
4953 /**
4954 * @ingroup palld_api_structures
4955 * @brief PA LUT2 API parameters structure
4956 *
4957 * @details This structure defines the common parameters of the next generation LUT2 APIs such as
4958 * @ref Pa_addPort2. This structure includes a validBitmap of optional parameters so that
4959 * it can evolve while maintaining backward-compatibility.
4960 *
4961 * The parameter validBitmap specifies which optional parameters are valid
4962 * 1: used; 0: not used.
4963 *
4964 */
4965 typedef struct {
4966 uint32_t validBitMap; /**< 32-bit Bitmap corresponding to usage of each optional field as specified at @ref paLut2ApiParamValidBits */
4967 uint32_t ctrlFlags; /**< 32-bit control flags as defined at @ref paLut2ParamCtrlFlags */
4968 uint16_t divertQ; /**< The source queue for atomic queue diversion with LUT2 update */
4969 } paLut2ParamDesc;
4971 /**
4972 * @ingroup palld_api_functions
4973 * @brief Pa_addSrio adds a SRIO entry to the L2 table
4974 *
4975 * @details This function is used to add or replace an entry into the L2 table (see @ref netlayers).
4976 * A new entry is added if the SRIO configuration info is unique in the modules handle table.
4977 * If the value is not unique then the routing information for the existing entry is changed to
4978 * the values provided in the function.
4979 *
4980 * On return the command buffer (cmd) contains a formatted command for the sub-system. The
4981 * destination for the command is provided in cmdDest. The module user must send the formatted
4982 * command to the sub-system. The sub-system will generate a reply
4983 * and this reply must be sent back to this module through the API @ref Pa_forwardResult.
4984 *
4985 * This command as well as @ref Pa_addIp operate with a strong dependence on entry order.
4986 * See section table @ref order for a description on the operation of the sub-system and
4987 * table entry ordering.
4988 *
4989 * @param[in] iHandle The driver instance handle
4990 * @param[in] index Specify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
4991 * @param[in] srioInfo Value @ref paSrioInfo_t
4992 * @param[in] nextHdr The next header type to be parsed following the SRIO classification
4993 * Refer to @ref NextHeaderTypes for all supported protocols
4994 * Set to pa_HDR_TYPE_UNKNOWN if no further prasing is required
4995 * @param[in] nextHdrOffset Offset to the next header from the beginning of the packet
4996 * @param[in] routeInfo Match packet routing information
4997 * @param[in] nextRtFail Routing information for subsequent match failures
4998 * @param[out] handle Pointer to L2 Handle
4999 * @param[out] cmd Where the created command is placed
5000 * @param[in,out] cmdSize Input the size of cmd buffer, on output the actual size used. @ref cmdMinBufSize
5001 * @param[in] reply Where the sub-system sends the command reply
5002 * @param[out] cmdDest Value (@ref cmdTxDest)
5003 * @retval Value (@ref ReturnValues)
5004 * @pre A driver instance must be created and tables initialized
5005 *
5006 * @note No table entry validation will be proformed if the LUT1 index is specified at this function
5007 *
5008 */
5010 paReturn_t Pa_addSrio ( Pa_Handle iHandle,
5011 int index,
5012 paSrioInfo_t *srioInfo,
5013 uint16_t nextHdr,
5014 uint16_t nextHdrOffset,
5015 paRouteInfo_t *routeInfo,
5016 paRouteInfo_t *nextRtFail,
5017 paHandleL2L3_t *handle,
5018 paCmd_t cmd,
5019 uint16_t *cmdSize,
5020 paCmdReply_t *reply,
5021 int *cmdDest);
5023 /**
5024 * @ingroup palld_api_functions
5025 * @brief Pa_addMac adds a mac address to the L2 table
5026 *
5027 * @details This function is used to add or replace an entry into the L2 table (see @ref netlayers).
5028 * A new entry is added if the MAC configuration info is unique in the modules handle table. If
5029 * the value is not unique then the routing information for the existing entry is changed to
5030 * the values provided in the function.
5031 *
5032 * L2 values that are not to be used for packet routing are set to 0.
5033 *
5034 * On return the command buffer (cmd) contains a formatted command for the sub-system. The
5035 * destination for the command is provided in cmdDest. The module user must send the formatted
5036 * command to the sub-system. The sub-system will generate a reply
5037 * and this reply must be sent back to this module through the @ref Pa_forwardResult API.
5038 *
5039 * This command as well as @ref Pa_addIp operate with a strong dependence on entry order.
5040 * See section table @ref order for a description on the operation of the sub-system and
5041 * table entry ordering.
5042 *
5043 *
5044 * @param[in] iHandle The driver instance handle
5045 * @param[in] index Specify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
5046 * @param[in] ethInfo Value @ref paEthInfo_t
5047 * @param[in] routeInfo Match packet routing information
5048 * @param[in] nextRtFail Routing information for subsequent match failures
5049 * @param[out] handle Pointer to L2 Handle
5050 * @param[out] cmd Where the created command is placed
5051 * @param[in,out] cmdSize Input the size of cmd buffer, on output the actual size used. @ref cmdMinBufSize
5052 * @param[in] reply Where the sub-system sends the command reply
5053 * @param[out] cmdDest Value (@ref cmdTxDest)
5054 * @retval Value (@ref ReturnValues)
5055 * @pre A driver instance must be created and tables initialized
5056 *
5057 * @note No table entry validation will be proformed if the LUT1 index is specified at this function
5058 *
5059 */
5061 paReturn_t Pa_addMac ( Pa_Handle iHandle,
5062 int index,
5063 paEthInfo_t *ethInfo,
5064 paRouteInfo_t *routeInfo,
5065 paRouteInfo_t *nextRtFail,
5066 paHandleL2L3_t *handle,
5067 paCmd_t cmd,
5068 uint16_t *cmdSize,
5069 paCmdReply_t *reply,
5070 int *cmdDest);
5072 /**
5073 * @ingroup palld_api_functions
5074 * @brief Pa_addMac2 adds a mac address to the L2 table
5075 *
5076 * @details Pa_addMac2 is the next generation of API to replace @ref Pa_addMac eventually. This new API
5077 * covers the entire functionality of Pa_addMac and it is designed to support more features
5078 * while maintain backward-compatibility over time.
5079 *
5080 * @param[in] iHandle The driver instance handle
5081 * @param[in] ethInfo Value @ref paEthInfo2_t
5082 * @param[in] params Common API parameters @ref paParamDesc
5083 * @param[out] retHandle Pointer to L2 Handle
5084 * @param[out] cmd Where the created command is placed
5085 * @param[in,out] cmdSize Input the size of cmd buffer, on output the actual size used. @ref cmdMinBufSize
5086 * @param[in] reply Where the sub-system sends the command reply
5087 * @param[out] cmdDest Value (@ref cmdTxDest)
5088 * @retval Value (@ref ReturnValues)
5089 * @pre A driver instance must be created and tables initialized
5090 *
5091 */
5092 paReturn_t Pa_addMac2 ( Pa_Handle iHandle,
5093 paEthInfo2_t *ethInfo, /**< Value @ref paEthInfo2_t */
5094 paParamDesc *params,
5095 paLnkHandle_t *retHandle, /**< Pointer to the returned L2 handle */
5096 paCmd_t cmd,
5097 uint16_t *cmdSize,
5098 paCmdReply_t *reply,
5099 int *cmdDest
5100 );
5102 /**
5103 * @ingroup palld_api_functions
5104 * @brief Pa_delHandle deletes a MAC/SRIO or IP handle
5105 *
5106 * @details This function is used to remove an entry from the sub-system L2 or L3 (LUT1) lookup (see @ref netlayers).
5107 * When a handle is deleted it can create stale handles. For example, an L3 handle can reference
5108 * an L2 handle, and an L4 handle can reference an L3 handle. The module does not check for
5109 * references to a stale handle, the module user is responsible for maintaining reference coherency.
5110 * It is recommended that the handle should not be deleted if the API function @ref Pa_getHandleRefCount
5111 * returns non-zero reference count.
5112 *
5113 * @param[in] iHandle The driver instance handle
5114 * @param[in] handle Pointer to the l2/l3 handle to delete
5115 * @param[out] cmd Where the created command is placed
5116 * @param[in] cmdSize The size of the cmd buffer
5117 * @param[in] reply Where the sub-system sends the command reply
5118 * @param[out] cmdDest Value (@ref cmdTxDest)
5119 * @retval Value (@ref ReturnValues)
5120 * @pre A driver instance must be created and tables initialized
5121 */
5122 paReturn_t Pa_delHandle (Pa_Handle iHandle,
5123 paHandleL2L3_t *handle,
5124 paCmd_t cmd,
5125 uint16_t *cmdSize,
5126 paCmdReply_t *reply,
5127 int *cmdDest );
5129 /**
5130 * @ingroup palld_api_functions
5131 * @brief Pa_delL4Handle deletes a UDP/TCP/GTPU/CustomLUT2 handle
5132 *
5133 * @details This function is used to remove an entry from the sub-system L4 (LUT2) handle entry.
5134 *
5135 * @param[in] iHandle The driver instance handle
5136 * @param[in, out] handle Pointer to the L4 handle to delete
5137 * @param[out] cmd Where the created command is placed
5138 * @param[in] cmdSize The size of the cmd buffer
5139 * @param[in] reply Where the sub-system sends the reply
5140 * @param[out] cmdDest Value (@ref cmdTxDest)
5141 * @retval Value (@ref ReturnValues)
5142 * @pre A driver instance must be created and tables initialized
5143 */
5144 paReturn_t Pa_delL4Handle (Pa_Handle iHandle,
5145 paHandleL4_t handle,
5146 paCmd_t cmd,
5147 uint16_t *cmdSize,
5148 paCmdReply_t *reply,
5149 int *cmdDest );
5151 /**
5152 * @ingroup palld_api_functions
5153 * @brief Pa_delAclHandle deletes an ACL handle
5154 *
5155 * @details This function is used to remove an entry from the LUT1-ACL lookup
5156 *
5157 * @param[in] iHandle The driver instance handle
5158 * @param[in] handle Pointer to the ACL handle to delete
5159 * @param[out] cmd Where the created command is placed
5160 * @param[in] cmdSize The size of the cmd buffer
5161 * @param[in] reply Where the sub-system sends the command reply
5162 * @param[out] cmdDest Value (@ref cmdTxDest)
5163 * @retval Value (@ref ReturnValues)
5164 * @pre A driver instance must be created and tables initialized
5165 */
5166 paReturn_t Pa_delAclHandle (Pa_Handle iHandle,
5167 paHandleAcl_t *handle,
5168 paCmd_t cmd,
5169 uint16_t *cmdSize,
5170 paCmdReply_t *reply,
5171 int *cmdDest );
5173 /**
5174 * @ingroup palld_api_functions
5175 * @brief Pa_addIp adds an IP address to the L3 table
5176 *
5177 * @details This function is used to add or replace an entry in the L3 table (see @ref netlayers).
5178 * A new entry is added if the IP configuration info is unique in the modules handle table.
5179 * If the value is not unique then the routing information for the existing entry is changed
5180 * to the values provided in the function.
5181 *
5182 * The LLD will determine where this entry is added based on following rules
5183 * - If there is no previous link or the previous link is a L2 (MAC/SRIO) entry, this entry will be
5184 * added into LUT1_1
5185 * - If the previous link is L3 (IP/Custom LUT1), this entry will be added into LUT1_2
5186 *
5187 * The module user can overwrite the default rules by specifying the desired LUT1 instance.
5188 *
5189 * The PASS will determine which entry of the specified LUT1 table is used for this entry based on
5190 * its internal algorithm if the module user does not specify the LUT1 index.
5191 *
5192 * L3 values that are used for packet routing should be set as described in @ref paIpInfo_t.
5193 *
5194 * The @ref paHandleL2L3_t prevLink is used to link this entry to an L2 or L3 entry already made
5195 * by a call to @ref Pa_addMac or Pa_addIp. If the link is enabled then a packet will match the IP
5196 * information provided in ipInfo only if the same packet has already matched at the L2 level as
5197 * described by prevLink. To disable linking the value of prevLink is set to NULL.
5198 *
5199 * On return the command buffer (cmd) contains a formatted command for the sub-system. The
5200 * destination for the command is provided in cmdDest. The module user must send the formatted
5201 * command to the sub-system. The sub-system will generate a reply and this reply must be
5202 * sent back to this module through the API @ref Pa_forwardResult.
5203 *
5204 * This command as well as @ref Pa_addMac operates with a strong dependence on entry order.
5205 * See section table @ref order for a description on the operation of the sub-system and
5206 * table entry ordering.
5207 *
5208 *
5209 *
5210 * @param[in] iHandle The driver instance handle
5211 * @param[in] lutInst Specify which LUT1 (0-2) should be used. Set to pa_LUT_INST_NOT_SPECIFIED if not specified
5212 * @param[in] index Specify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
5213 * @param[in] ipInfo Value @ref paIpInfo_t
5214 * @param[in] prevLink An optional L2 or L3 handle
5215 * @param[in] routeInfo Where to send a packet that matches
5216 * @param[in] nextRtFail Where to send a packet that matches, but later fails
5217 * @param[out] retHandle Pointer to the returned L3 handle
5218 * @param[out] cmd Buffer where the PASS command is created
5219 * @param[in] cmdSize The size of the cmd buffer
5220 * @param[in] reply Where the response to the PASS command is routed
5221 * @param[out] cmdDest Value (@ref cmdTxDest)
5222 * @retval Value (@ref ReturnValues)
5223 * @pre A driver instance must be created and tables initialized
5224 *
5225 * @note No table entry validation will be proformed if the LUT1 index is specified at this function
5226 *
5227 */
5228 paReturn_t Pa_addIp ( Pa_Handle iHandle,
5229 int lutInst,
5230 int index,
5231 paIpInfo_t *ipInfo,
5232 paHandleL2L3_t prevLink,
5233 paRouteInfo_t *routeInfo,
5234 paRouteInfo_t *nextRtFail,
5235 paHandleL2L3_t *retHandle,
5236 paCmd_t cmd,
5237 uint16_t *cmdSize,
5238 paCmdReply_t *reply,
5239 int *cmdDest );
5241 /**
5242 * @ingroup palld_api_functions
5243 * @brief Pa_addIp2 adds an IP address to the L3 table
5244 *
5245 * @details Pa_addIp2 is the next generation of API to replace @ref Pa_addIp eventually. This new API
5246 * covers the entire functionality of Pa_addIP and it is designed to support more features
5247 * while maintain backward-compatibility over time.
5248 *
5249 * @param[in] iHandle The driver instance handle
5250 * @param[in] ipInfo Value @ref paIpInfo2_t
5251 * @param[in] params Common API parameters @ref paParamDesc
5252 * @param[out] retHandle Pointer to L3 Handle
5253 * @param[out] cmd Where the created command is placed
5254 * @param[in,out] cmdSize Input the size of cmd buffer, on output the actual size used. @ref cmdMinBufSize
5255 * @param[in] reply Where the sub-system sends the command reply
5256 * @param[out] cmdDest Value (@ref cmdTxDest)
5257 * @retval Value (@ref ReturnValues)
5258 * @pre A driver instance must be created and tables initialized
5259 */
5260 paReturn_t Pa_addIp2 ( Pa_Handle iHandle,
5261 paIpInfo2_t *ipInfo,
5262 paParamDesc *params,
5263 paLnkHandle_t *retHandle,
5264 paCmd_t cmd,
5265 uint16_t *cmdSize,
5266 paCmdReply_t *reply,
5267 int *cmdDest
5268 );
5270 /**
5271 * @defgroup VirtualLnkType Virtual Link types
5272 * @ingroup palld_api_constants
5273 * @{
5274 *
5275 * @name VirtualLnkTypes
5276 * @brief Defines the virtual link destination type
5277 *
5278 * @note The packet accelerator module supports linking to
5279 * virtual links at OuterIp only at the moment.
5280 *
5281 */
5282 /* @{ */
5283 /**
5284 * @def pa_VIRTUAL_LNK_TYPE_MAC
5285 * MAC
5286 */
5287 #define pa_VIRTUAL_LNK_TYPE_MAC 0
5289 /**
5290 * @def pa_VIRTUAL_LNK_TYPE_OUTER_IP
5291 * Outer IP
5292 */
5293 #define pa_VIRTUAL_LNK_TYPE_OUTER_IP 1
5295 /**
5296 * @def pa_VIRTUAL_LNK_TYPE_INNER_IP
5297 * Inner IP
5298 */
5299 #define pa_VIRTUAL_LNK_TYPE_INNER_IP 2
5301 /* @} */
5302 /** @} */
5304 /**
5305 * @ingroup palld_api_functions
5306 * @brief Pa_addVirtualLink allocates a new virtual link within the PA instance
5307 *
5308 * @details This function is called to request a new virtual link
5309 *
5310 * @param[in] iHandle The driver instance handle
5311 * @param[in,out] vlinkHdl Pointer to virtual link handle
5312 * @param[in] lnkType Value (@ref VirtualLnkType)
5313 * @retval Value (@ref ReturnValues)
5314 * @pre A driver instance must be created and tables initialized
5315 *
5316 */
5317 paReturn_t Pa_addVirtualLink(Pa_Handle iHandle,
5318 paLnkHandle_t *vlinkHdl,
5319 int8_t lnkType
5320 );
5322 /**
5323 * @ingroup palld_api_functions
5324 * @brief Pa_delVirtualLink frees the specified virtual link within the PA instance
5325 *
5326 * @details This function is used to remove a virtual link
5327 *
5328 * @param[in] iHandle The driver instance handle
5329 * @param[in,out] vlinkHdl Pointer to virtual link handle
5330 * @retval Value (@ref ReturnValues)
5331 * @pre A driver instance must be created and tables initialized
5332 *
5333 */
5334 paReturn_t Pa_delVirtualLink(Pa_Handle iHandle,
5335 paLnkHandle_t *vlinkHdl
5336 );
5338 /**
5339 * @ingroup palld_api_functions
5340 * @brief Pa_allocUsrStats allocates or verifies a set of user-defined statistics
5341 *
5342 * @details This function is called to request or verify a number of user-defined statistics.
5343 * The return value pa_RESOURCE_USE_DENIED will be used if there are not enough user-defined
5344 * statistics available or one of the provided counter indexes is not valid.
5345 *
5346 * @param[in] iHandle The driver instance handle
5347 * @param[in, out] pNumCnt In:Number of user-defined statistics requested; Out: Number of user-defined statistics allocated
5348 * @param[in, out] cntList Array of user-defined statistics allocation parameters
5349 * @retval Value (@ref ReturnValues)
5350 * @pre A driver instance must be created and tables initialized
5351 *
5352 * @note: This function is optional when the application owns the entire set of user-defined statistics or uses a set of
5353 * pre-allocated user-defined statistics. However, the PASS will verify the user-defined statistics list and may
5354 * return error code pa_RESOURCE_USE_DENIED if RM is enabled when API @ref Pa_configUsrStats, @ref Pa_requestUsrStatsList
5355 * and etc are invoked.
5356 */
5357 paReturn_t Pa_allocUsrStats(Pa_Handle iHandle,
5358 int *pNumCnt,
5359 paUsrStatsAlloc_t *cntList
5360 );
5362 /**
5363 * @ingroup palld_api_functions
5364 * @brief Pa_freeUsrStats free a set of user-defined statistics
5365 *
5366 * @details This function is called to free a set of user-defined statistics.
5367 *
5368 *
5369 * @param[in] iHandle The driver instance handle
5370 * @param[in] numCnt Number of user-defined statistics to be freed
5371 * @param[in] cntList Pointer to list of user-defined statistics to be freed
5372 * @retval Value (@ref ReturnValues)
5373 * @pre A driver instance must be created and tables initialized
5374 *
5375 * @note: This function is optional when the application owns the entire set of user-defined statistics or uses a set of
5376 * pre-allocated user-defined statistics.
5377 */
5378 paReturn_t Pa_freeUsrStats(Pa_Handle iHandle,
5379 int numCnt,
5380 uint16_t *cntList
5381 );
5383 /**
5384 * @ingroup palld_api_functions
5385 * @brief Pa_addAcl adds an ACL entry to the ACL table
5386 *
5387 * @details This function is used to add an entry in the ACL table.
5388 * The PASS ACL table maintains an ordered list of ACL rules. This function will add ACL entries
5389 * in descending order, i.e. the new rule will be inserted at the bottom of the ACL table unless
5390 * the parameter nextEntry is specified, in this case, the new entry will be added in front of the
5391 * next entry.
5392 *
5393 * The are two ACL (LUT1) tables supported by PASS, one for outer IP and the other for inner IP.
5394 * The ACL instance should be specified by @ref paLut1Inst.
5395 *
5396 * The @ref paHandleL2L3_t prevLink is used to link this entry to an L2 or L3 entry already made
5397 * by a call to @ref Pa_addMac or Pa_addIp. If the link is enabled then a packet will match the ACL
5398 * information provided in aclInfo only if the same packet has already matched at the L2/L3 level as
5399 * described by prevLink. To disable linking the value of prevLink is set to NULL.
5400 *
5401 * On return the command buffer (cmd) contains a formatted command for the sub-system. The
5402 * destination for the command is provided in cmdDest. The module user must send the formatted
5403 * command to the sub-system. The sub-system will generate a reply and this reply must be
5404 * sent back to this module through the API @ref Pa_forwardResult.
5405 *
5406 * @param[in] iHandle The driver instance handle
5407 * @param[in] aclInst Specify which ACL LUT1 (@ref paAclInst) should be used.
5408 * @param[in] aclAction Specify ACL match action as @ref paAclActionTypes
5409 * @param[in] aclInfo Value @ref paAclInfo_t
5410 * @param[in] prevLink An optional L2 or L3 handle
5411 * @param[in] nextEntry An optional ACL handle as the next ACL rule
5412 * @param[out] retHandle Pointer to the returned ACL handle
5413 * @param[out] cmd Buffer where the PASS command is created
5414 * @param[in] cmdSize The size of the cmd buffer
5415 * @param[in] reply Where the response to the PASS command is routed
5416 * @param[out] cmdDest Value (@ref cmdTxDest)
5417 * @retval Value (@ref ReturnValues)
5418 * @pre A driver instance must be created and tables initialized
5419 *
5420 * @note No table entry validation will be proformed if the LUT1 index is specified at this function
5421 * @note To maintain the entry order of the ACL table, the function does not support entry
5422 * replacement with updated action. The application needs to call @ref Pa_delAclHandle at first and
5423 * then call this API to add the replaced entry.
5424 *
5425 */
5426 paReturn_t Pa_addAcl (Pa_Handle iHandle,
5427 int aclInst,
5428 int aclAction,
5429 paAclInfo_t *aclInfo,
5430 paHandleL2L3_t prevLink,
5431 paHandleAcl_t nextEntry,
5432 paHandleAcl_t *retHandle,
5433 paCmd_t cmd,
5434 uint16_t *cmdSize,
5435 paCmdReply_t *reply,
5436 int *cmdDest );
5438 /**
5439 * @defgroup paLut2PortSize LUT2 Port Size Values
5440 * @ingroup palld_api_constants
5441 * @{
5442 *
5443 * @name LUT2 Port Size Values
5444 * @brief Defines the LUT2 port size supported by PA.
5445 *
5446 * @details The PA LUT2 supports both 16-bit and 32-bit entry matching. It can be used to classify
5447 * based on the UDP/IP 16-bit destination port with or without upper layer link or the GTP-U
5448 * 32-bit Tunnel ID. No other Layer 4 or Layer 5 protocol is supported.
5449 */
5450 /* @{ */
5451 /**
5452 * @def pa_LUT2_PORT_SIZE_16
5453 * 16-bit port number such as UDP/TCP port
5454 *
5455 */
5456 #define pa_LUT2_PORT_SIZE_16 0
5458 /**
5459 * @def pa_LUT2_PORT_SIZE_32
5460 * 32-bit port number such as GTP-U Tunnel ID
5461 */
5462 #define pa_LUT2_PORT_SIZE_32 1
5464 /* @} */
5465 /** @} */
5468 /**
5469 * @ingroup palld_api_functions
5470 * @brief Pa_addPort adds a destination port to the L4 (LUT2) table
5471 *
5472 * @details This function is used to add an entry to the L4 (LUT2) table (see @ref netlayers). Only the
5473 * destination port can be set, along with a link to previous L3 handle
5474 * (see @ref Pa_addIp) through linkHandle.
5475 *
5476 * This module does not keep track of the L4 handles, so calling the function
5477 * a second time with the same destination port and link handle will simply replace the
5478 * previous entry. It is recommended to set the replace flag to indicate that this entry is
5479 * already at the LUT2 table. This feature may be used to change the routing information without
5480 * deleting and adding the matching port.
5481 * This API also initiates the atomic queue diversion operation, which means that the QMSS moves
5482 * the entries in the diverted queue to the destination queue, if the divertQ is specified and
5483 * fReplace flag is set. In this case, the PASS will complete the LUT2 update, wait for the queue
5484 * diversion to be complete and then resume processing incoming packets.
5485 * Unlike entries in the L2 and L3 table, the order of entry is not important.
5486 *
5487 * The type of transport header (TCP/UDP) is not specified here. If the type of transport
5488 * is part of the packet routing criteria it is specified in the protocol type field
5489 * in @ref paIpInfo_t in the call to @ref Pa_addIp.
5490 *
5491 * This function supports both 16-bit and 32-bit port specified by the parameter portSize.
5492 * However, there are the following restrictions for 32-bit ports
5493 * @verbatim
5494 1. The link to the previous LUT1 match can not be used so that the destID
5495 should be unique regressless of the previous L3 adddreses
5496 2. The 32-bit LUT2 lookup can not be mixed with the other TCP/UDP or custom LUT2 lookup.
5497 @endverbatim
5498 *
5499 * On return the command buffer (cmd) contains a formatted command for the sub-system.
5500 * The destination for the command is provided in cmdDest. The module user must send the
5501 * formatted command to the sub-system. The sub-system will generate a reply and this reply
5502 * must be sent back to this module through the @ref Pa_forwardResult API.
5503 *
5504 * @param[in] iHandle The driver instance handle
5505 * @param[in] portSize The input port size (@ref paLut2PortSize)
5506 * @param[in] destPort The destination TCP/UDP port
5507 * @param[in] linkHandle An L3 handle that is linked to the destination port
5508 * @param[in] fReplace Flag to indicate whether the entry exists
5509 * @param[in] divertQ The source queue for atomic queue diversion with LUT2 update
5510 * Set to pa_PARAMS_NOT_SPECIFIED if not specified
5511 * @param[in] routeInfo Where to send a packet that matches
5512 * @param[out] retHandle A blank handle where the return handle is placed
5513 * @param[out] cmd Buffer where the PASS command is created
5514 * @param[in] cmdSize The size of the cmd buffer
5515 * @param[out] reply Where the response to the PASS command is routed
5516 * @param[out] cmdDest Value (@ref cmdTxDest)
5517 * @retval Value (@ref ReturnValues)
5518 * @pre A driver instance must be created and tables initialized
5519 *
5520 * @note The linkHandle is mandatory for 16-bit TCP/UDP port or 32-bit GTPU port when pa_GTPU_CTRL_USE_LINK is set.
5521 * The linkHandle will be ignored for 32-bit GTPU port when pa_GTPU_CTRL_USE_LINK is cleared
5522 *
5523 */
5524 paReturn_t Pa_addPort ( Pa_Handle iHandle,
5525 int portSize,
5526 uint32_t destPort,
5527 paHandleL2L3_t linkHandle,
5528 uint16_t fReplace,
5529 uint16_t divertQ,
5530 paRouteInfo_t *routeInfo,
5531 paHandleL4_t retHandle,
5532 paCmd_t cmd,
5533 uint16_t *cmdSize,
5534 paCmdReply_t *reply,
5535 int *cmdDest );
5537 /**
5538 * @ingroup palld_api_functions
5539 * @brief Pa_addPort2 adds a destination port to the L4 (LUT2) table
5540 *
5541 * @details Pa_addPort2 is the next generation of API to replace @ref Pa_addPort eventually. This new API
5542 * covers the entire functionality of Pa_addPort and it is designed to support more features
5543 * while maintain backward-compatibility over time.
5544 *
5545 * @param[in] iHandle The driver instance handle
5546 * @param[in] portSize The input port size (@ref paLut2PortSize)
5547 * @param[in] destPort The destination TCP/UDP port
5548 * @param[in] linkHandle An L3 handle that is linked to the destination port
5549 * @param[in] params Common LUT2 API parameters @ref paLut2ParamDesc
5550 * @param[in] routeInfo Where to send a packet that matches
5551 * @param[out] retHandle A blank handle where the return handle is placed
5552 * @param[out] cmd Buffer where the PASS command is created
5553 * @param[in] cmdSize The size of the cmd buffer
5554 * @param[out] reply Where the response to the PASS command is routed
5555 * @param[out] cmdDest Value (@ref cmdTxDest)
5556 * @retval Value (@ref ReturnValues)
5557 * @pre A driver instance must be created and tables initialized
5558 *
5559 */
5560 paReturn_t Pa_addPort2 (Pa_Handle iHandle,
5561 int portSize,
5562 uint32_t destPort,
5563 paHandleL2L3_t linkHandle,
5564 paLut2ParamDesc *params,
5565 paRouteInfo2_t *routeInfo,
5566 paHandleL4_t retHandle,
5567 paCmd_t cmd,
5568 uint16_t *cmdSize,
5569 paCmdReply_t *reply,
5570 int *cmdDest );
5572 /**
5573 * @ingroup palld_api_functions
5574 * @brief Pa_setCustomLUT1 performs the global configuration for level 3 (LUT1) custom lookups
5575 *
5576 * @details This command is typically issued once per system and is used to configure the
5577 * PA for performing network layer 3 (LUT1) custom lookups.
5578 * It specifies the offset and byte masks which the PA
5579 * subsystem uses for parsing a packet that has entered custom LUT1
5580 * classification directed from the previous match route.
5581 * It also specifies the next header type and offset to be used for continuous
5582 * parsing
5583 *
5584 * On return the command buffer (cmd) contains a formatted command for the sub-system.
5585 * The destination for the command is provided in cmdDest. The module user must send the
5586 * formatted command to the sub-system. The sub-system will generate a reply and this reply
5587 * must be sent back to this module through the @ref Pa_forwardResult API.
5588 *
5589 * @param[in] iHandle The driver instance handle
5590 * @param[in] custIndex The level 3 (LUT1) custom index
5591 * @param[in] parseByteOffset Where the PA begins custom match (relative to the L3 start)
5592 * @param[in] nextHdr The next header type to be parsed following the custom header
5593 * Refer to @ref NextHeaderTypes for all supported protocols
5594 * Set to pa_HDR_TYPE_UNKNOWN if no further prasing is required
5595 * @param[in] nextHdrOffset Offset to the next header from the beginning of the custom header
5596 * @param[in] byteMasks The bitmap of bits in the parse that matter
5597 * @param[out] cmd Buffer where the PASS command is created
5598 * @param[in] cmdSize On entry the size of the cmd buffer, on exit the size of the command
5599 * @param[in] reply Where the response to the PASS command is routed
5600 * @param[out] cmdDest Value (@ref cmdTxDest)
5601 * @retval Value (@ref ReturnValues)
5602 * @pre A driver instance must be created and tables initialized
5603 *
5604 * @note There is up to @ref pa_MAX_CUSTOM_TYPES_LUT1 LUT1 custom types supported by PASS.
5605 */
5606 paReturn_t Pa_setCustomLUT1 ( Pa_Handle iHandle,
5607 uint16_t custIndex,
5608 uint16_t parseByteOffset,
5609 uint16_t nextHdr,
5610 uint16_t nextHdrOffset,
5611 uint8_t byteMasks[pa_NUM_BYTES_CUSTOM_LUT1],
5612 paCmd_t cmd,
5613 uint16_t *cmdSize,
5614 paCmdReply_t *reply,
5615 int *cmdDest );
5617 /**
5618 * @ingroup palld_api_functions
5619 * @brief Pa_AddCustomLUT1 adds a custom lookup entry to the lookup tables (LUT1).
5620 *
5621 * @details This command is called to add a specific match entry to the L3 (LUT1) lookup table. This
5622 * function is called once per desired custom LUT1 match criteria.
5623 *
5624 * The LLD will determine where this entry is added based on following rules
5625 * - If there is no previous link or the previous link is a L2 (MAC/SRIO) entry, this entry will be
5626 * added into LUT1_1
5627 * - If the previous link is L3 (IP/Custom LUT1), this entry will be added into LUT1_2
5628 *
5629 * The module user can overwrite the default rules by specifying the desired LUT1 instance.
5630 *
5631 * The PASS will determine which entry of the specified LUT1 table is used for this entry based on
5632 * its internal algorithm if the module user does not specify the LUT1 index.
5633 *
5634 * On return the command buffer (cmd) contains a formatted command for the sub-system.
5635 * The destination for the command is provided in cmdDest. The module user must send the
5636 * formatted command to the sub-system. The sub-system will generate a reply and this reply
5637 * must be sent back to this module through the @ref Pa_forwardResult API.
5638 *
5639 * @param[in] iHandle The driver instance handle
5640 * @param[in] custIndex The level 3 (LUT1) custom index
5641 * @param[in] lutInst Specify which LUT1 (0-2) should be used. Set to pa_LUT_INST_NOT_SPECIFIED if not specified
5642 * @param[in] index Specify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
5643 * @param[in] match The byte values that describe the match entry
5644 * @param[in] prevLink An optional L2 or L3 handle that links to this lookup
5645 * @param[in] routeInfo Where to send a packet that matches
5646 * @param[in] nextRtFail Where to send a packet that matches here, but fails next parse level
5647 * @param[out] retHandle The returned L3 handle
5648 * @param[out] cmd Buffer where the command is created
5649 * @param[in] cmdSize On entry the size of the cmd buffer, on exit the size of the command
5650 * @param[in] reply Where the response to the PASS command is routed
5651 * @param[out] cmdDest Value (@ref cmdTxDest)
5652 * @retval Value (@ref ReturnValues)
5653 * @pre A driver instance must be created and tables initialized
5654 */
5655 paReturn_t Pa_addCustomLUT1 ( Pa_Handle iHandle,
5656 uint16_t custIndex,
5657 int lutInst,
5658 int index,
5659 uint8_t match[pa_NUM_BYTES_CUSTOM_LUT1],
5660 paHandleL2L3_t prevLink,
5661 paRouteInfo_t *routeInfo,
5662 paRouteInfo_t *nextRtFail,
5663 paHandleL2L3_t *retHandle,
5664 paCmd_t cmd,
5665 uint16_t *cmdSize,
5666 paCmdReply_t *reply,
5667 int *cmdDest );
5669 /**
5670 * @ingroup palld_api_functions
5671 * @brief Pa_setCustomLUT2 performs the global configuration for level 4 (LUT2) custom lookups
5672 *
5673 * @details This command is typically called once per system and is used to configure the
5674 * PA for performing network layer 4 (LUT2) custom lookups.
5675 * If handleLink is true then only 3 bytes and 3 offsets are available
5676 * for matching. The fourth one is used to store the previous match information.
5677 * In this case the first 3 values in the byteOffsets and byteMasks arrays are
5678 * valid.
5679 *
5680 * If setMask is non-zero, it will be ORed with the first byteMask and the match byte.
5681 * It is used to distinguish this custom LUT2 entry from other custom LUT2 and standard
5682 * LUT2 entries.
5683 *
5684 * On return the command buffer (cmd) contains a formatted command for the sub-system.
5685 * The destination for the command is provided in cmdDest. The module user must send the
5686 * formatted command to the sub-system. The sub-system will generate a reply and this reply
5687 * must be sent back to this module through the API @ref Pa_forwardResult.
5688 *
5689 * @param[in] iHandle Driver instance handle
5690 * @param[in] custIndex Level 4 (LUT2) custom index
5691 * @param[in] handleLink Set to TRUE to use one byte of the match to hold previous match info
5692 * @param[in] custHdrSize Size of fixed-length custom header in bytes, which is used to adjust
5693 * location of the next protocol header in case the packet needs to be
5694 * processed by another module such as SASS or host application. This
5695 * parameter should be set to zero for all other types of headers
5696 * @param[in] byteOffsets Array of offsets to the bytes to use in custom matching
5697 * @param[in] byteMasks Array of bits that are valid in the custom matching
5698 * @param[in] setMask Bits to be set at the first match byte
5699 * @param[out] cmd Buffer where the command is created
5700 * @param[in] cmdSize On entry the size of the cmd buffer, on exit the size of the command
5701 * @param[in] reply Where the response to the PASS command is routed
5702 * @param[out] cmdDest Value (@ref cmdTxDest)
5703 * @retval Value (@ref ReturnValues)
5704 * @pre A driver instance must be created and tables initialized
5705 *
5706 * @note There is up to @ref pa_MAX_CUSTOM_TYPES_LUT2 LUT2 custom types supported by PASS.
5707 */
5708 paReturn_t Pa_setCustomLUT2 ( Pa_Handle iHandle,
5709 uint16_t custIndex,
5710 uint16_t handleLink,
5711 uint16_t custHdrSize,
5712 uint16_t byteOffsets[pa_NUM_BYTES_CUSTOM_LUT2],
5713 uint8_t byteMasks[pa_NUM_BYTES_CUSTOM_LUT2],
5714 uint8_t setMask,
5715 paCmd_t cmd,
5716 uint16_t *cmdSize,
5717 paCmdReply_t *reply,
5718 int *cmdDest );
5720 /**
5721 * @ingroup palld_api_functions
5722 * @brief Pa_addCustomLUT2 adds a custom lookup to the LUT2 lookup tables
5723 *
5724 * @details This command is called to add a specific entry to the L4 (LUT2) lookup table. This
5725 * function is called once per desired custom LUT2 match criteria.
5726 * This API also initiates the atomic queue diversion operation, which means that the QMSS moves
5727 * the entries in the diverted queue to the destination queue, if the divertQ is specified and
5728 * fReplace flag is set. In this case, the PASS will complete the LUT2 update, wait for the queue
5729 * diversion to be complete and then resume processing incoming packets.
5730 *
5731 * On return the command buffer (cmd) contains a formatted command for the sub-system.
5732 * The destination for the command is provided in cmdDest. The module user must send the
5733 * formatted command to the sub-system. The sub-system will generate a reply and this reply
5734 * must be sent back to this module through the @ref Pa_forwardResult API.
5735 *
5736 * @param[in] iHandle The driver instance handle
5737 * @param[in] custIndex The level 4 (LUT2) custom index
5738 * @param[in] match The four match values, only 1st three valid if prevLink is non-NULL
5739 * @param[in] prevLink An optional L2 or L3 handle that links to this lookup
5740 * @param[in] divertQ The source queue for atomic queue diversion with LUT2 update
5741 * Set to pa_PARAMS_NOT_SPECIFIED if not specified
5742 * @param[in] fReplace Flag to indicate whether the entry exists
5743 * @param[in] routeInfo Where to send a packet that matches
5744 * @param[out] retHandle The returned L4 handle
5745 * @param[out] cmd The buffer where the command is created
5746 * @param[in] cmdSize On entry the size of the cmd buffer, on exit the size of the command
5747 * @param[in] reply Where the response to the PASS command is routed
5748 * @param[out] cmdDest Value (@ref cmdTxDest)
5749 * @retval Value (@ref ReturnValues)
5750 * @pre A driver instance must be created and tables initialized
5751 */
5752 paReturn_t Pa_addCustomLUT2 ( Pa_Handle iHandle,
5753 uint16_t custIndex,
5754 uint8_t match[pa_NUM_BYTES_CUSTOM_LUT2],
5755 paHandleL2L3_t prevLink,
5756 uint16_t fReplace,
5757 uint16_t divertQ,
5758 paRouteInfo_t *routeInfo,
5759 paHandleL4_t retHandle,
5760 paCmd_t cmd,
5761 uint16_t *cmdSize,
5762 paCmdReply_t *reply,
5763 int *cmdDest );
5765 /**
5766 * @ingroup palld_api_functions
5767 * @brief Pa_forwardResult examines the reply of the sub-system to a command
5768 *
5769 * @details This command is used to pass the sub-system generated replies to commands back to
5770 * this module. Functions @ref Pa_addMac, @ref Pa_addSrio, @ref Pa_addCustomLUT1 and
5771 * @ref Pa_addIp generate replies that must be
5772 * forwarded to this module, or else handle deletion and link are not possible. Other
5773 * commands generate replies that can be sent to this module which will return any
5774 * warnings detected in the sub-system.
5775 *
5776 * @param[in] iHandle The driver instance handle
5777 * @param[in] vresult The command reply packet from the sub-system
5778 * @param[out] retHandle Returns the handle associated with the command
5779 * @param[out] handleType Value @ref HandleTypes
5780 * @param[out] cmdDest Value (@ref cmdTxDest)
5781 * @retval Value (@ref ReturnValues)
5782 * @pre A driver instance must be created and tables initialized
5783 */
5784 paReturn_t Pa_forwardResult (Pa_Handle iHandle, void *vresult, paEntryHandle_t *retHandle, int *handleType, int *cmdDest);
5787 /**
5788 * @ingroup palld_api_functions
5789 * @brief Pa_configExceptionRoute configures the routing of packets based on a exception condition such as
5790 * MAC briadcast, multicast or error packet
5791 *
5792 * @details This function is used to configure the sub-system to route packets that satisfy an exception
5793 * rule or condition (see @ref ErouteTypes). For example,
5794 * - failure to table match
5795 * - parsing error i.e. the sub-system is not able to continuethe parse
5796 * - MAC broadcast packets
5797 * - IP multicast packets
5798 *
5799 * From one to @ref pa_EROUTE_MAX routes can be specified through a single call to this
5800 * function. Parameter nRoute is used to specify how many routes are contained in the
5801 * routeTypes and eRoutes arrays. A value of 0 nRoutes results in no action by the function.
5802 *
5803 * By default when each exception type is detected the packet is discarded silently. Once the
5804 * route is changed through a call to this function it remains in the new state until the
5805 * function is called again to explicitly change that route. The only way to revert back
5806 * to the default of silent discard is to call this function again.
5807 *
5808 * On return the command buffer (cmd) contains a formatted command for the sub-system.
5809 * The destination for the command is provided in cmdDest. The module user must send the
5810 * formatted command to the sub-system. The sub-system will generate a reply and this reply
5811 * must be sent back to this module through the API @ref Pa_forwardResult.
5812 *
5813 * @param[in] iHandle The driver instance handle
5814 * @param[in] nRoute The number of exception routes specified
5815 * @param[in] routeTypes Array of exception routing types (@ref ErouteTypes)
5816 * @param[in] eRoutes Array of exception packet routing configuration
5817 * @param[out] cmd Buffer where the sub-system command is created
5818 * @param[in] cmdSize The size of the passCmd buffer
5819 * @param[in] reply Where the response to the PASS command is routed
5820 * @param[out] cmdDest Value (@ref cmdTxDest)
5821 * @retval Value (@ref ReturnValues)
5822 * @pre A driver instance must be created and tables initialized
5823 */
5824 paReturn_t Pa_configExceptionRoute (Pa_Handle iHandle,
5825 int nRoute,
5826 int *routeTypes,
5827 paRouteInfo_t *eRoutes,
5828 paCmd_t cmd,
5829 uint16_t *cmdSize,
5830 paCmdReply_t *reply,
5831 int *cmdDest);
5833 /**
5834 * @ingroup palld_api_functions
5835 * @brief Pa_configExceptionRoute2 configures the routing of packets based on a exception condition such as
5836 * MAC briadcast, multicast or error packet
5837 *
5838 * @details Pa_configExceptionRoute2 is the next generation of API to replace @ref Pa_configExceptionRoute
5839 * eventually. This new API covers the entire functionality of Pa_configExceptionRoute and it is
5840 * designed to support more features with the more advnced routing information data structure
5841 * while maintain backward-compatibility over time.
5842 *
5843 * @param[in] iHandle The driver instance handle
5844 * @param[in] nRoute The number of exception routes specified
5845 * @param[in] routeTypes Array of exception routing types (@ref ErouteTypes)
5846 * @param[in] eRoutes Array of exception packet routing configuration
5847 * @param[out] cmd Buffer where the sub-system command is created
5848 * @param[in] cmdSize The size of the passCmd buffer
5849 * @param[in] reply Where the response to the PASS command is routed
5850 * @param[out] cmdDest Value (@ref cmdTxDest)
5851 * @retval Value (@ref ReturnValues)
5852 * @pre A driver instance must be created and tables initialized
5853 */
5854 paReturn_t Pa_configExceptionRoute2 (Pa_Handle iHandle,
5855 int nRoute,
5856 int *routeTypes,
5857 paRouteInfo2_t *eRoutes,
5858 paCmd_t cmd,
5859 uint16_t *cmdSize,
5860 paCmdReply_t *reply,
5861 int *cmdDest);
5863 /**
5864 * @ingroup palld_api_functions
5865 * @brief Pa_configCmdSet configures the command set which consists of a list of commands
5866 *
5867 * @details This function is used to configure the sub-system to format and store a list
5868 * of commands which are executed in order when a match occurs and the command set is
5869 * specified by the routing information.
5870 *
5871 * The command set is created and refered to based on the command set index.
5872 * Once the command set is created through a call to this function it remains effective
5873 * until the function is called again to explicitly overwrite its content. It is not
5874 * recommended to update a command set when it is still used by one or more packet
5875 * routes.
5876 * There are @ref pa_MAX_CMD_SETS of command sets supported by the sub-system
5877 *
5878 * The commands within the command set will be executed in order at PDSP4. The module user is
5879 * responsible for placing the commands in such ways that the packet offsets required by commands should
5880 * be in ascending order, otherwise, the unexecutable command will be ignored. The command set
5881 * should be terminated with a pa_CMD_NEXT_ROUTE or pa_CMD_MULTI_ROUTE command. If there is
5882 * no final route command specified, the PASS will use the default next route command. Please note
5883 * that all the commands following the pa_CMD_NEXT_ROUTE or pa_CMD_MULTI_ROUTE command will be ignored.
5884 *
5885 * This API supports the following commands (@ref paCmdCode)
5886 * @li pa_CMD_REMOVE_HEADER
5887 * @li pa_CMD_COPY_DATA_TO_PSINFO
5888 * @li pa_CMD_CRC_OP
5889 * @li pa_CMD_PATCH_DATA
5890 * @li pa_CMD_REMOVE_TAIL
5891 * @li pa_CMD_NEXT_ROUTE
5892 * @li pa_CMD_MULTI_ROUTE
5893 * @li pa_CMD_USR_STATS
5894 * @li pa_CMD_VERIFY_PKT_ERROR
5895 * @li pa_CMD_SPLIT
5896 *
5897 * On return the command buffer (cmd) contains a formatted command for the sub-system.
5898 * The destination for the command is provided in cmdDest. The module user must send the
5899 * formatted command to the sub-system. The sub-system will generate a reply and this reply
5900 * must be sent back to this module through the API @ref Pa_forwardResult.
5901 *
5902 * @param[in] iHandle The driver instance handle
5903 * @param[in] index The command set index
5904 * @param[in] nCmd The number of commands specified
5905 * @param[in] cmdInfo Array of command configuration information
5906 * @param[out] cmd Buffer where the sub-system command is created
5907 * @param[in] cmdSize The size of the passCmd buffer
5908 * @param[in] reply Where the response to the PASS command is routed
5909 * @param[out] cmdDest Value (@ref cmdTxDest)
5910 * @retval Value (@ref ReturnValues)
5911 * @pre A driver instance must be created and tables initialized
5912 */
5913 paReturn_t Pa_configCmdSet (Pa_Handle iHandle,
5914 uint16_t index,
5915 int nCmd,
5916 paCmdInfo_t *cmdInfo,
5917 paCmd_t cmd,
5918 uint16_t *cmdSize,
5919 paCmdReply_t *reply,
5920 int *cmdDest);
5922 /**
5923 * @ingroup palld_api_functions
5924 * @brief Pa_configMultiRouteSet configures the multi-route group which consists of packet multi-route
5925 * entries
5926 *
5927 * @details This function is used to configure the sub-system to format and store a multi-
5928 * route set which contains routing information for up to @ref pa_MAX_MULTI_ROUTE_ENTRIES
5929 * destinations.
5930 *
5931 * The multi-route group is created and refered to based on the multi-route index.
5932 * Once the multi-route group is created through a call to this function it remains effective
5933 * until the function is called again to explicitly overwrite its content. It is not
5934 * recommended to update a mult-route group when it is still used by one or more packet
5935 * routes.
5936 *
5937 * There are @ref pa_MAX_MULTI_ROUTE_SETS of multi-route sets supported by the sub-system
5938 *
5939 * On return the command buffer (cmd) contains a formatted command for the sub-system.
5940 * The destination for the command is provided in cmdDest. The module user must send the
5941 * formatted command to the sub-system. The sub-system will generate a reply and this reply
5942 * must be sent back to this module through the API @ref Pa_forwardResult.
5943 *
5944 * @param[in] iHandle The driver instance handle
5945 * @param[in] mode The operation mode (CONFIG or RESET) refer to @ref paMultiRouteModes_e
5946 * @param[in] index The multi-route index
5947 * @param[in] nRoute The number of routing entries specified
5948 * @param[in] routeEntry Array of routing configuration information
5949 * @param[out] cmd Buffer where the sub-system command is created
5950 * @param[in] cmdSize The size of the passCmd buffer
5951 * @param[in] reply Where the response to the PASS command is routed
5952 * @param[out] cmdDest Value (@ref cmdTxDest)
5953 * @retval Value (@ref ReturnValues)
5954 * @pre A driver instance must be created and tables initialized
5955 */
5956 paReturn_t Pa_configMultiRoute (Pa_Handle iHandle,
5957 paMultiRouteModes_e mode,
5958 uint16_t index,
5959 uint16_t nRoute,
5960 paMultiRouteEntry_t *routeEntry,
5961 paCmd_t cmd,
5962 uint16_t *cmdSize,
5963 paCmdReply_t *reply,
5964 int *cmdDest);
5966 /**
5967 * @ingroup palld_api_functions
5968 * @brief Pa_configCrcEngine configures the specified CRC engine
5969 *
5970 * @details This function is used to configure the specified CRC engine by formating the
5971 * CRC configuration command packet.
5972 *
5973 * There are multiple CRC engines in the PA sun-system. Each CRC engine is connected to its
5974 * corresponding PDSP and its location is defined at @ref paCrcInst. It performs CRC operation
5975 * required by the some network protocol such as SCTP and/or the user-specified CRC command
5976 * for its corresponding PDSP. The CRC engine is referred by the CRC instance number.
5977 *
5978 * On return the command buffer (cmd) contains a formatted command for the sub-system.
5979 * The destination for the command is provided in cmdDest. The module user must send the
5980 * formatted command to the sub-system. The sub-system will generate a reply and this reply
5981 * must be sent back to this module through the @ref Pa_forwardResult API.
5982 *
5983 * @note Each CRC engine only supports one type of CRC per configuration.
5984 * It is up to the module user to configure and use the CRC engine by calling this function
5985 * for the specific use cases. For example, the CRC engine (pa_CRC_INST_4_0), which resides
5986 * between Ingress4 CDE0 and CED1, should be configured to perform CRC-32c checksum for
5987 * SCTP over inner-IP use case.
5988 *
5989 * @param[in] iHandle The driver instance handle
5990 * @param[in] index The CRC engine index
5991 * @param[in] cfgInfo The CRC engine configuration information
5992 * @param[out] cmd Buffer where the sub-system command is created
5993 * @param[in] cmdSize The size of the passCmd buffer
5994 * @param[in] reply Where the response to the PASS command is routed
5995 * @param[out] cmdDest Value (@ref cmdTxDest)
5996 * @retval Value (@ref ReturnValues)
5997 * @pre A driver instance must be created and tables initialized
5998 */
5999 paReturn_t Pa_configCrcEngine (Pa_Handle iHandle,
6000 uint16_t index,
6001 paCrcConfig_t *cfgInfo,
6002 paCmd_t cmd,
6003 uint16_t *cmdSize,
6004 paCmdReply_t *reply,
6005 int *cmdDest);
6007 /**
6008 * @ingroup palld_api_functions
6009 * @brief Pa_configUsrStats configures the user-defined statistics operation
6010 *
6011 * @details This function performs the counter configuration for the multi-level hierarchical user-defined
6012 * statistics. Each counter can be linked to the next level counter. All counters in its linking
6013 * chain will be incremented when the lowest level counter is updated. The module user can specify
6014 * the type of each counter and how the counter is linked to the next level counter.
6015 * It is not recommended to re-configure the user-defined statistics when one or more counters are
6016 * still used by PASS. The command reply routing is optional because this command is always
6017 * processed by the PA sub-system.
6018 *
6019 * On return the command buffer (cmd) contains a formatted command for the sub-system.
6020 * The destination for the command is provided in cmdDest. The module user must send the
6021 * formatted command to the sub-system. The sub-system will generate a reply and this reply
6022 * must be sent back to this module through the @ref Pa_forwardResult API.
6023 *
6024 * @param[in] iHandle The driver instance handle
6025 * @param[in] cfgInfo The user-defined statistics configuration information
6026 * @param[out] cmd Buffer where the sub-system command is created
6027 * @param[in] cmdSize The size of the passCmd buffer
6028 * @param[in] reply Where the response to the PASS command is routed
6029 * @param[out] cmdDest Value (@ref cmdTxDest)
6030 * @retval Value (@ref ReturnValues)
6031 * @pre A driver instance must be created and tables initialized
6032 */
6033 paReturn_t Pa_configUsrStats (Pa_Handle iHandle,
6034 paUsrStatsConfigInfo_t *cfgInfo,
6035 paCmd_t cmd,
6036 uint16_t *cmdSize,
6037 paCmdReply_t *reply,
6038 int *cmdDest);
6039 /**
6040 * @ingroup palld_api_functions
6041 * @brief Pa_configTimestamp configures the PA timer which is used to generate 48-bit timestamp
6042 *
6043 * @details This function is used to configure the 16-bit timer reserved for the 48-bit system
6044 * timestamp. The lower 32-bit of the system timestamp will be inserted into the timestamp
6045 * field in the packet descriptor for all input packets. It can be also inserted into
6046 * the timestamp report packets triggered by the egress packets per tx command.
6047 * The 16-bit timer connected to Ingress0 PDSP0 is reserved for timestamp generation.
6048 *
6049 * @param[in] iHandle The driver instance handle
6050 * @param[in] cfgInfo The timestamp configuration information
6051 * @retval Value (@ref ReturnValues)
6052 * @pre A driver instance must be created and tables initialized
6053 *
6054 */
6055 paReturn_t Pa_configTimestamp (Pa_Handle iHandle,
6056 paTimestampConfig_t *cfgInfo);
6058 /**
6059 * @ingroup palld_api_functions
6060 * @brief Pa_getTimestamp returns the 48-bit system timestamp
6061 *
6062 * @details This function is called to retrieve the current value of 48-bit PASS system timestamp.
6063 *
6064 * @param[in] iHandle The driver instance handle
6065 * @param[out] pTimestamp Pointer to the 48-bit timestamp
6066 * @retval Value (@ref ReturnValues)
6067 * @pre A driver instance must be created and tables initialized
6068 *
6069 */
6070 paReturn_t Pa_getTimestamp (Pa_Handle iHandle,
6071 paTimestamp_t *pTimestamp);
6074 /**
6075 * @ingroup palld_api_functions
6076 * @brief Pa_requestStats requests sub-system statistics (PASS Gen1 only)
6077 *
6078 * @details This function is used to request the operating statistics from the sub-system.
6079 * The statistics can be optionally cleared after reading through the doClear parameter.
6080 * The statistics apply to the entire sub-system, and are not core dependent on multi-core
6081 * devices.
6082 *
6083 * On return the command buffer (cmd) contains a formatted command for the sub-system.
6084 * The destination for the command is provided in cmdDest. The module user must send the
6085 * formatted command to the sub-system. The sub-system will generate a reply and this reply
6086 * must be sent back to this module through the API @ref Pa_formatStatsReply.
6087 *
6088 * @param[in] iHandle The driver instance handle
6089 * @param[in] doClear If TRUE then stats are cleared after being read
6090 * @param[out] cmd Buffer where the sub-system command is created
6091 * @param[in] cmdSize The size of the cmd buffer
6092 * @param[in] reply Where the response of the PASS command is routed
6093 * @param[out] cmdDest Value (@ref cmdTxDest)
6094 * @retval Value (@ref ReturnValues)
6095 * @pre A driver instance must be created and tables initialized
6096 *
6097 * @note: This API is not supported at the second generation PASS
6098 */
6099 paReturn_t Pa_requestStats (Pa_Handle iHandle,
6100 uint16_t doClear,
6101 paCmd_t cmd,
6102 uint16_t *cmdSize,
6103 paCmdReply_t *reply,
6104 int *cmdDest);
6106 /**
6107 * @ingroup palld_api_functions
6108 * @brief Pa_querySysStats requests sub-system statistics (PASS Gen2)
6109 *
6110 * @details This function is used to query the operating statistics from the sub-system.
6111 * The statistics can be optionally cleared after reading through the doClear parameter.
6112 * The statistics apply to the entire sub-system, and are not core dependent on multi-core
6113 * devices.
6114 *
6115 * @param[in] iHandle The driver instance handle
6116 * @param[in] doClear If TRUE then stats are cleared after being read
6117 * @param[out] pSysStats Pointer to the sysStats buffer
6118 * @retval Value (@ref ReturnValues)
6119 * @pre A driver instance must be created and tables initialized
6120 *
6121 * @note: This API is not supported at the first generation PASS
6122 */
6123 paReturn_t Pa_querySysStats (Pa_Handle iHandle,
6124 uint16_t doClear,
6125 paSysStats_t *pSysStats);
6127 /**
6128 * @ingroup palld_api_functions
6129 * @brief Pa_formatStatsReply formats the stats reply from the PA (PASS Gen1 only)
6130 *
6131 * @details This function is used to convert the stats from the sub-system into a format
6132 * useful for the application
6133 *
6134 * @param[in] handle The driver instance handle
6135 * @param[in] cmd The buffer returned with the request stats response from PA
6136 * @retval A pointer to the formatted stats
6137 * @pre A call to @ref Pa_requestStats with output sent to PA and a
6138 * reply generated from PA.
6139 *
6140 * @note: This API is not supported at the second generation PASS
6141 *
6142 */
6143 paSysStats_t* Pa_formatStatsReply (Pa_Handle handle,
6144 paCmd_t cmd);
6146 /**
6147 * @ingroup palld_api_functions
6148 * @brief Pa_requestUsrStats requests user-defined statistics
6149 *
6150 * @details This function is used to request the user-defined statistics from the sub-system.
6151 * If the buffer pointer (pUsrStats) is provided, the statistics will be formatted and
6152 * copied to the buffer. However, the statistics will not be autonomous because some
6153 * related statistics may be updated by the PASS while LLD is reading other statistics.
6154 * To request autonomous statistics query, set the buffer pointer (pUsrStats) to NULL and
6155 * LLD will generate the statistics request command packet to be delivered to PASS regardless
6156 * of doClear setting.
6157 *
6158 * The sub-system statistics can be optionally cleared after query if doClear is set whether
6159 * or not the buffer pointer is provided.
6160 * The command buffer (cmd) contains a formatted command for the sub-system.
6161 * The destination for the command is provided in cmdDest. The module user must send the
6162 * formatted command to the sub-system.
6163 *
6164 * @param[in] iHandle The driver instance handle
6165 * @param[in] doClear If TRUE then stats are cleared after being read
6166 * @param[out] cmd Buffer where the sub-system command is created
6167 * @param[in] cmdSize The size of the cmd buffer
6168 * @param[in] reply Where the response of the PASS command is routed
6169 * @param[out] cmdDest Value (@ref cmdTxDest)
6170 * @param[out] pUsrStats Pointer to the usrStats buffer
6171 * @retval Value (@ref ReturnValues)
6172 * @pre A driver instance must be created and tables initialized
6173 *
6174 * @note This API may be depreciated in the future releases since it can be replaced by API @ref
6175 * Pa_requestUsrStatsList
6176 */
6177 paReturn_t Pa_requestUsrStats (Pa_Handle iHandle,
6178 uint16_t doClear,
6179 paCmd_t cmd,
6180 uint16_t *cmdSize,
6181 paCmdReply_t *reply,
6182 int *cmdDest,
6183 paUsrStats_t *pUsrStats);
6185 /**
6186 * @ingroup salld_api_constants
6187 * @{
6188 * @brief Indicate that the complete set of user-defined statistics should be leared
6189 */
6190 #define pa_USR_STATS_CLEAR_ALL 0 /**< This constant indicates that all user-defined statistics should be cleared */
6192 /**
6193 * @ingroup palld_api_functions
6194 * @brief Pa_requestUsrStatsList is an advanced version of API @ref Pa_requestUsrStats. It requests user-defined
6195 * statistics with option to clear entire or a subset of statistics.
6196 *
6197 * @details This function is used to request the user-defined statistics from the sub-system
6198 * with option to clear entire or a subset of statistics specified by the list of
6199 * counters.
6200 * If the buffer pointer (pUsrStats) is provided, the statistics will be formatted and
6201 * copied to the buffer. However, the statistics will not be autonomous because some
6202 * related statistics may be updated by the PASS while LLD is reading other statistics.
6203 * To request autonomous statistics query, set the buffer pointer (pUsrStats) to NULL and
6204 * LLD will generate the statistics request command packet to be delivered to PASS regardless
6205 * of doClear setting.
6206 *
6207 * The sub-system statistics can be optionally cleared after query if doClear is set. In
6208 * this case the formatted command packet will include the list of counters to be cleared.
6209 * The command buffer (cmd) contains a formatted command for the sub-system.
6210 * The destination for the command is provided in cmdDest. The module user must send the
6211 * formatted command to the sub-system.
6212 *
6213 * @note: This function always returns the entire user-defined statistics and it is up to the caller to pick
6214 * up the interesting ones.
6215 *
6216 * @param[in] iHandle The driver instance handle
6217 * @param[in] doClear If TRUE then stats are cleared after being read
6218 * @param[in] nCnt The number of counters to be cleared
6219 * @param[in] cntIndex Array of counter indexes to be cleared
6220 * @param[out] cmd Buffer where the sub-system command is created
6221 * @param[in] cmdSize The size of the cmd buffer
6222 * @param[in] reply Where the response of the PASS command is routed
6223 * @param[out] cmdDest Value (@ref cmdTxDest)
6224 * @param[out] pUsrStats Pointer to the usrStats buffer
6225 * @retval Value (@ref ReturnValues)
6226 * @pre A driver instance must be created and tables initialized
6227 */
6228 paReturn_t Pa_requestUsrStatsList (Pa_Handle iHandle,
6229 uint16_t doClear,
6230 uint16_t nCnt,
6231 uint16_t *cntIndex,
6232 paCmd_t cmd,
6233 uint16_t *cmdSize,
6234 paCmdReply_t *reply,
6235 int *cmdDest,
6236 paUsrStats_t *pUsrStats);
6238 /**
6239 * @ingroup palld_api_functions
6240 * @brief Pa_formatUsrStatsReply formats the user-defined statistics reply from the PASS
6241 *
6242 * @details This function is used to convert the stats from the sub-system into a format
6243 * useful for the application
6244 *
6245 * @param[in] handle The driver instance handle
6246 * @param[in] cmd The buffer returned with the request stats response from PA
6247 * @param[out] pUsrStats Pointer to the usrStats buffer
6248 * @retval Value (@ref ReturnValues)
6249 * @pre A call to @ref Pa_requestUsrStats or Pa_requestUsrStatsList with
6250 * buffer pointer pUsrStats set to NULL and output sent to PA and a
6251 * reply generated from PA.
6252 */
6253 paReturn_t Pa_formatUsrStatsReply (Pa_Handle handle,
6254 paCmd_t cmd,
6255 paUsrStats_t *pUsrStats);
6257 /**
6258 * @ingroup palld_api_functions
6259 * @brief Pa_queryRaStats queries RA statistics (PASS Gen2 only)
6260 *
6261 * @details This function is used to query the RA statistics from the sub-system.
6262 * The statistics will be formatted and copied to the buffer provided.
6263 * The sub-system statistics can be then optionally cleared if doClear is set.
6264 *
6265 * @param[in] iHandle The driver instance handle
6266 * @param[in] doClear If TRUE then stats are cleared after being read
6267 * @param[out] pRaStats Pointer to the raStats buffer
6268 * @retval Value (@ref ReturnValues)
6269 * @pre A driver instance must be created and tables initialized
6270 *
6271 * @note: This API is not supported at the first generation PASS
6272 */
6273 paReturn_t Pa_queryRaStats (Pa_Handle iHandle,
6274 uint16_t doClear,
6275 paRaStats_t *pRaStats);
6277 /**
6278 * @ingroup palld_api_functions
6279 * @brief Pa_queryAclStats queries ACL per-entry statistics (PASS Gen2 only)
6280 *
6281 * @details This function is used to query the ACL per-entry statistics.
6282 * The statistics can be optionally cleared after reading through the doClear parameter.
6283 *
6284 * @param[in] iHandle The driver instance handle
6285 * @param[in] aclHandle The ACL handle
6286 * @param[in] doClear If TRUE then stats are cleared after being read
6287 * @param[out] pAclStats Pointer to the aclStats buffer
6288 * @retval Value (@ref ReturnValues)
6289 * @pre A driver instance must be created and tables initialized
6290 *
6291 * @note: This API is not supported at the first generation PASS
6292 */
6293 paReturn_t Pa_queryAclStats (Pa_Handle iHandle,
6294 paHandleAcl_t aclHandle,
6295 uint16_t doClear,
6296 paAclStats_t *pAclStats);
6298 /**
6299 * @ingroup palld_api_functions
6300 * @brief Pa_formatTxRoute formats the commands to add checksums and route a Tx packet
6301 *
6302 * @details This function is used to create the command block which is used by the packet accelerator
6303 * sub-system to forward the packet with optional checksum generation.
6304 * The module user can combine this block with other command blocks that control the security
6305 * accelerator. The combined block is then provided for the transmitted packets in the Protocol
6306 * specific section of the packet descriptor. This API needs only to be called once, and the same
6307 * protocol specific section can be used for every packet in the channel. If the length of the
6308 * checksum area changes with each packet, update the command buffer with the macro
6309 * PASS_SET_TX_CHKSUM_LENGTH()
6310 *
6311 * @note The Tx commands can be executed at either PDSP4 or PDSP5. However, it is highly
6312 * recommended to use PDSP5 for load balance since PDSP4 will be used to execute
6313 * multi-routing and from-network command set.
6314 *
6315 * @param[in] chk0 Checksum 0 configuration. NULL if no checksum computation required
6316 * @param[in] chk1 Checksum 1 configuration. NULL if no checksum computation required
6317 * @param[in] route Next packet routing from sub-system
6318 * @param[out] cmdBuffer The routing command is formed in this buffer
6319 * @param[in] cmdSize On entry the size of cmdBuffer. On exit the size of the command
6320 * @retval Value (@ref ReturnValues)
6321 */
6322 paReturn_t Pa_formatTxRoute (paTxChksum_t *chk0,
6323 paTxChksum_t *chk1,
6324 paRouteInfo_t *route,
6325 void *cmdBuffer,
6326 uint16_t *cmdSize );
6328 /**
6329 * @ingroup palld_api_functions
6330 * @brief Pa_formatRoutePatch formats the commands to route a packet and blind patch
6331 *
6332 * @details This function is used to create the command block which is used by the packet accelerator
6333 * sub-system to perform blind patches on the packet. This function user optionally combines
6334 * the generated block with other blocks to create compound commands. The command blocks are
6335 * attached to data packets in the Protocol specific section of the packet descriptor.
6336 *
6337 * @note The Tx commands can be executed at either PDSP4 or PDSP5. However, it is highly
6338 * recommended to use PDSP5 for load balance since PDSP4 will be used to execute
6339 * multi-routing and from-network command set.
6340 *
6341 * @param[in] route Specifies where the packet is sent after the patch is complete
6342 * @param[in] patch The patch information
6343 * @param[out] cmdBuffer The routing command is formed in this buffer
6344 * @param[in] cmdSize On entry this size of cmdBuffer. On exit the amound of cmdBuffer used
6345 * @retval Value (@ref ReturnValues)
6346 */
6348 paReturn_t Pa_formatRoutePatch (paRouteInfo_t *route,
6349 paPatchInfo_t *patch,
6350 void *cmdBuffer,
6351 uint16_t *cmdSize);
6353 /**
6354 * @ingroup palld_api_functions
6355 * @brief Pa_formatTxCmd formats a list of commands to be executed on the packets to be transmitted
6356 * over the network
6357 *
6358 * @details This function is used to create, append and update the list of commands which will be
6359 * executed by the packet accelerator and security accelerator sub-systems to perform a sequence
6360 * of actions on the packet. The command block should be attached to data packets in the
6361 * protocol specific section of the packet descriptor.
6362 *
6363 * This API may be called multiple times to add or update the command block.
6364 * The same protocol specific section can be used for every packet in the channel after the
6365 * command list is constructed. Multiple MACROs may be used to update some parameters
6366 * such as packet length in the command buffer for each packet.
6367 *
6368 * This API supports the following commands (@ref paCmdCode):
6369 * @li pa_CMD_NEXT_ROUTE
6370 * @li pa_CMD_CRC_OP
6371 * @li pa_CMD_PATCH_DATA
6372 * @li pa_CMD_TX_CHECKSUM
6373 * @li pa_CMD_REPORT_TX_TIMESTAMP
6374 * @li pa_CMD_SA_PAYLOAD
6375 * @li pa_CMD_IP_FRAGMENT
6376 * @li pa_CMD_PATCH_MSG_LEN
6377 *
6378 * @note The Tx commands can be executed at either PDSP4 or PDSP5. However, it is highly
6379 * recommended to use PDSP5 for load balance since PDSP4 will be used to execute
6380 * multi-routing and from-network command set.
6381 *
6382 * @param[in] nCmd The number of commands specified
6383 * @param[in] cmdInfo Array of command configuration information
6384 * @param[in] offset The command buffer location where the new commands are inserted
6385 * @param[out] cmdBuffer Buffer where the sub-system command is created
6386 * @param[in] cmdSize On entry this size of cmdBuffer. On exit the amound of cmdBuffer used
6387 * @retval Value (@ref ReturnValues)
6388 *
6389 * @note The command buffer should be 4-byte aligned
6390 */
6392 paReturn_t Pa_formatTxCmd (int nCmd,
6393 paCmdInfo_t *cmdInfo,
6394 uint16_t offset,
6395 void *cmdBuffer,
6396 uint16_t *cmdSize);
6398 /**
6399 * @ingroup palld_api_functions
6400 * @brief Pa_resetControl controls the reset state of the Sub-system
6401 *
6402 * @details This function is used to assert or release reset for the sub-system. Asserting reset does not
6403 * reset any of the sub-system tables (L2, L3 or L4, see @ref netlayers), but only the packet
6404 * processing modules. To achieve a complete system reset the system level reset must be asserted
6405 * through the power controller.
6406 *
6407 * @param[in] iHandle The driver instance handle
6408 * @param[in] newState Value @ref paSubSysStates
6409 * @retval Value @ref paSubSysStates
6410 * @pre None
6411 *
6412 * @note This function will access the PA sub-system registers. It is up to the module user to provide critical
6413 * section protection so that only one core or task should use this function at a time.
6414 */
6415 paSSstate_t Pa_resetControl (Pa_Handle iHandle, paSSstate_t newState);
6418 /**
6419 * @ingroup palld_api_functions
6420 * @brief Pa_downloadImage downloads a PDSP image to a sub-system with the packet processing modules in reset.
6421 *
6422 * @details This function is used to download an executable PDSP image to the specific packet processing module.
6423 * See section table @ref appendix1 for a description of PDSP images provided by this module
6424 *
6425 * @param[in] iHandle The driver instance handle
6426 * @param[in] modId The PDSP number (0-5)
6427 * @param[in] image The image to download
6428 * @param[in] sizeBytes The size of the image
6429 * @retval Value (@ref ReturnValues)
6430 * @pre The packet processing modules must be in reset. See @ref Pa_resetControl.
6431 *
6432 * @note This function will access the PA sub-system registers. It is up to the module user to provide critical
6433 * section protection so that only one core or task should use this function at a time.
6434 */
6435 paReturn_t Pa_downloadImage (Pa_Handle iHandle, int modId, void* image, int sizeBytes);
6437 /**
6438 * @ingroup palld_api_functions
6439 * @brief Pa_getHandleRefCount returns the number of reference channels linked to the LUT1 handle
6440 *
6441 * @details The LLD maintains the reference counter for LUT1 handles: MAC/IP. Given a handle,
6442 * the LLD would return how many references are being used in next header entry by invoking
6443 * the function. For example, Query on MAC handle need to return how many IP handles are
6444 * referencing the MAC handles. Query on IP handle need to return how many next protocol
6445 * entries: IP/UDP are referencing to the IP handle.
6446 * Therefore this function can be used to verify whether the LUT1 entry associated with
6447 * the handle can be reomved.
6448 *
6449 * @param[in] iHandle The driver instance handle
6450 * @param[in] l2l3handle The L2 or L3 handle to be queryed
6451 * @param[out] refCount The number of reference channels
6452 * @retval Value (@ref ReturnValues)
6453 */
6454 paReturn_t Pa_getHandleRefCount ( Pa_Handle iHandle,
6455 paHandleL2L3_t l2l3handle,
6456 uint16_t *refCount );
6458 /**
6459 * @ingroup palld_api_functions
6460 * @brief Pa_getPDSPVersion returns the PA PDSP version information.
6461 *
6462 * @details This function is used to get the PA PDSP version information in 0xAABBCCDD format.
6463 * where Arch (AA); API Changes (BB); Major (CC); Minor (DD
6464 *
6465 * @param[in] iHandle The driver instance handle
6466 * @param[in] modId The PDSP number (0-5)
6467 * @param[out] pVersion The pointer to PDSP version number
6468 * @retval Value (@ref ReturnValues)
6469 * @pre The PDSP image should be downloaded successfully.
6470 *
6471 */
6472 paReturn_t Pa_getPDSPVersion (Pa_Handle iHandle, int modId, uint32_t *pVersion);
6475 /**
6476 * @ingroup palld_api_functions
6477 * @brief Pa_getVersion returns the PA LLD version information
6478 *
6479 * @details This function is used to get the version information of the PA LLD in 0xAABBCCDD format.
6480 * where Arch (AA); API Changes (BB); Major (CC); Minor (DD)
6481 *
6482 * @retval 32-bit version information
6483 */
6484 uint32_t Pa_getVersion (void);
6487 /**
6488 * @ingroup palld_api_functions
6489 * @brief Pa_getVersionStr returns the PA LLD version string
6490 *
6491 * @details This function is used to get the version string of the PA LLD.
6492 *
6493 * @retval Version string
6494 */
6495 const char* Pa_getVersionStr (void);
6497 /**
6498 * @ingroup palld_api_macros
6499 * @brief pa_RESET_SUBSYSTEM is used to reset the Sub-system
6500 *
6501 * @details This macro is used to put the packet processing sub-system into reset. It performs the same function
6502 * as @ref Pa_resetControl, but in macro form. The module user must define the macro SYSTEM_WRITE32.
6503 *
6504 * @pre The module user must define a macro called SYSTEM_WRITE32(address, value) which writes a 32 bit
6505 * value (value) to global address (address).
6506 *
6507 */
6508 #define pa_RESET_SUBSYSTEM() \
6509 { \
6510 CSL_Pa_ssRegs *passRegs = (CSL_Pa_ssRegs *)CSL_NETCP_CFG_REGS; \
6511 \
6512 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[0].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_SOFT_RST_N_MASK)); \
6513 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[1].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_SOFT_RST_N_MASK)); \
6514 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[2].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_SOFT_RST_N_MASK)); \
6515 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[3].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_SOFT_RST_N_MASK)); \
6516 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[4].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_SOFT_RST_N_MASK)); \
6517 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[5].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_SOFT_RST_N_MASK)); \
6518 SYSTEM_WRITE32(&(passRegs->PKT_ID.PKT_ID_SOFT_RESET, 1); \
6519 SYSTEM_WRITE32(&(passRegs->STATS.STATS_SOFT_RESET, 1); \
6520 SYSTEM_WRITE32(&(passRegs->PDSP_TIMER[0].TIMER_CNTRL_REG, 0); \
6521 SYSTEM_WRITE32(&(passRegs->PDSP_TIMER[1].TIMER_CNTRL_REG, 0); \
6522 SYSTEM_WRITE32(&(passRegs->PDSP_TIMER[2].TIMER_CNTRL_REG, 0); \
6523 SYSTEM_WRITE32(&(passRegs->PDSP_TIMER[3].TIMER_CNTRL_REG, 0); \
6524 SYSTEM_WRITE32(&(passRegs->PDSP_TIMER[4].TIMER_CNTRL_REG, 0); \
6525 SYSTEM_WRITE32(&(passRegs->PDSP_TIMER[5].TIMER_CNTRL_REG, 0); \
6526 }
6528 /**
6529 * @ingroup palld_api_macros
6530 * @brief pa_ENABLE_SUBSYSTEM enables the subsystem.
6531 *
6532 * @details This macro is used to release reset from the packet processing sub-system. It performs the same
6533 * function as @ref Pa_resetControl, but in macro from. The module user must define the macro SYSTEM_WRITE32
6534 * and SYSTEM_READ32.
6535 *
6536 * @pre The module user must define the macro SYSTEM_WRITE32(address, value) and SYSTEM_READ32 (address) which
6537 * read and write to global address (address).
6538 */
6539 #define pa_ENABLE_SUBSYSTEM() \
6540 { \
6541 CSL_Pa_ssRegs *passRegs = (CSL_Pa_ssRegs *)CSL_NETCP_CFG_REGS; \
6542 \
6543 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[0].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK)); \
6544 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[1].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK)); \
6545 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[2].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK)); \
6546 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[3].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK)); \
6547 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[4].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK)); \
6548 SYSTEM_WRITE32(&(passRegs->PDSP_CTLSTAT[5].PDSP_CONTROL), (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK)); \
6549 while (SYSTEM_READ32(&(passRegs->MAILBOX[0].MBOX_SLOT[0])) == 0); \
6550 while (SYSTEM_READ32(&(passRegs->MAILBOX[1].MBOX_SLOT[0])) == 0); \
6551 while (SYSTEM_READ32(&(passRegs->MAILBOX[2].MBOX_SLOT[0])) == 0); \
6552 while (SYSTEM_READ32(&(passRegs->MAILBOX[3].MBOX_SLOT[0])) == 0); \
6553 while (SYSTEM_READ32(&(passRegs->MAILBOX[4].MBOX_SLOT[0])) == 0); \
6554 while (SYSTEM_READ32(&(passRegs->MAILBOX[5].MBOX_SLOT[0])) == 0); \
6555 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[1], 1); \
6556 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[0], 0); \
6557 while (SYSTEM_READ32(&(passRegs->MAILBOX[0].MBOX_SLOT[1])) == 1); \
6558 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[1], 0); \
6559 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[2], 0); \
6560 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[3], 0); \
6561 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[4], 0); \
6562 SYSTEM_WRITE32(&(passRegs->MAILBOX[0].MBOX_SLOT[5], 0); \
6563 }
6566 /**
6567 * @ingroup palld_api_macros
6568 * @brief pa_DOWNLOAD_MODULE downloads an image
6569 *
6570 * @details This macro provides the same function as @ref Pa_downloadImage. A single image is downloaded to
6571 * one of the packet processing modules.
6572 *
6573 * @pre The module user must define macro SYSTEM_COPY(dest, src, sizeWords) which copies sizeWords from
6574 * address src to address dst. The packet processing module must have reset asserted.
6575 */
6576 #define pa_DOWNLOAD_MODULE(id,img,size) \
6577 { \
6578 CSL_Pa_ssRegs *passRegs = (CSL_Pa_ssRegs *)CSL_NETCP_CFG_REGS; \
6579 \
6580 SYSTEM_COPY(&(passRegs->PDSP_IRAM[id].PDSP_RAM[0]), img, size); \
6581 }
6583 /**
6584 * @ingroup palld_api_macros
6585 * @brief pa_GET_SYSETM_STATE returns the state of the subsystem
6586 *
6587 * @details This macro provides the same functionality as @ref Pa_resetControl and returns the
6588 * current state in the macro argument.
6589 */
6590 #define pa_GET_SYSTEM_STATE(x) \
6591 { int enable=0; int disable=0; \
6592 CSL_Pa_ssRegs *passRegs = (CSL_Pa_ssRegs *)CSL_NETCP_CFG_REGS; \
6593 if ( (SYSTEM_READ32(&(passRegs->PDSP_CTLSTAT[0].PDSP_CONTROL)) & CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) == \
6594 (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) ) \
6595 enable++; else disable++; \
6596 if ( (SYSTEM_READ32(&(passRegs->PDSP_CTLSTAT[1].PDSP_CONTROL)) & CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) == \
6597 (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) ) \
6598 enable++; else disable++; \
6599 if ( (SYSTEM_READ32(&(passRegs->PDSP_CTLSTAT[2].PDSP_CONTROL)) & CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) == \
6600 (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) ) \
6601 enable++; else disable++; \
6602 if ( (SYSTEM_READ32(&(passRegs->PDSP_CTLSTAT[3].PDSP_CONTROL)) & CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) == \
6603 (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) ) \
6604 enable++; else disable++; \
6605 if ( (SYSTEM_READ32(&(passRegs->PDSP_CTLSTAT[4].PDSP_CONTROL)) & CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) == \
6606 (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) ) \
6607 enable++; else disable++; \
6608 if ( (SYSTEM_READ32(&(passRegs->PDSP_CTLSTAT[5].PDSP_CONTROL)) & CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) == \
6609 (CSL_PA_SS_PDSP_CONTROL_PDSP_ENABLE_MASK) ) \
6610 enable++; else disable++; \
6611 if ( (enable > 0) && (disable > 0) ) (x) = pa_STATE_INCONSISTENT; \
6612 else if (enable > 0) (x) = pa_STATE_ENABLE; \
6613 else (x) = pa_STATE_RESET; \
6614 } (x) = (x)
6617 /**
6618 * @ingroup palld_api_macros
6619 * @brief pa_SET_TX_CHKSUM_LENGTH sets the tx checksum length in a tx route block
6620 *
6621 * @details This macro is used to modify the length of a checksum field in a command packet
6622 * created by a call to @ref Pa_formatTxRoute. In many cases packets in an outbound packet
6623 * stream will have the same source and destination information (see @ref netlayers) but
6624 * differ in the packet length. This macro will change the checksum calculation information
6625 * which is sent to the sub-system. The length fields in L2, L3 and L4 must be changed by
6626 * the module user before sending the packet, they are not changed by this macro. In the
6627 * case of IP L3 and TCP or UDP L4 the psuedo header checksum must also be changed
6628 * to reflect the change in packet length.
6629 */
6630 #define pa_SET_TX_CHKSUM_LENGTH(datap,cnum,len) \
6631 PASAHO_CHKCRC_SET_LEN ((&(((pasahoComChkCrc_t *)datap)[cnum])), len)
6633 /**
6634 * @ingroup palld_api_macros
6635 * @brief pa_SET_TX_INITVAL sets the initial value in a tx route block
6636 *
6637 * @details This macro is used to modify the initial value of a checksum field in a command packet
6638 * created by a call to @ref Pa_formatTxRoute. This macro is used when a single call
6639 * to @ref Pa_formatTxRoute is desired, The application typically follows this with an update
6640 * to the length fields in network headers, either directly or through a blind patch.
6641 * For updates with IPv4 or IPv6 the pseudo header checksum must be updated as well, and this
6642 * macro is used to update the value. Typically the pseudo header checksum will be computed
6643 * with all values except the length, and then updated for each packet with a single ones' complement add.
6644 */
6645 #define pa_SET_TX_CHKSUM_INITVAL(datap,cnum,val) \
6646 PASAHO_CHKCRC_SET_INITVAL ((&(((pasahoComChkCrc_t *)datap)[cnum])), val)
6648 /**
6649 * @page netlayers
6650 *
6651 * Network layers define a hierarchy of services delineated by functionality. Each layer can use the functionality
6652 * of the next layer below, and offers services to the next layer above. The packet accelerator sub-system examines
6653 * and routes packets based on fields in up to three layers of the Ethernet packets or L0-L2 header of the SRIO packets.
6654 *
6655 * In layer 2, the MAC (Media Access Control) layer,
6656 * the sub-system classifies IEEE 802.3 packets based on (optionally) the destination MAC, source MAC, Ethertype, and
6657 * VLAN tags.
6658 *
6659 * In Layer 3, the network layer, IPv4 (Internet Protocol Version 4) and IPv6 (Internet Protocol
6660 * Version 6) packets are routed based (optionally) on source IP address, destination IP address, IPv4 protocol,
6661 * IPv6 next header, IPv4 Type of Service (recently changed to IPv4 differentiated service in RFC 2474), IPv6
6662 * traffic class, and IPv6 flow label. For IP packets with security services the SPI (Security Parameters Index)
6663 * is also included in the classification information. For IP packets with SCTP (Stream Control Transmission Protocol)
6664 * the SCTP destination port is also included in the classification information.
6665 *
6666 * In layer 4, the transport layer, UDP (User Datagram Protocol) and TCP (Transmission Control Protocol) packets
6667 * are routed based on the destination port. However, the GTP-U (GPRS Tunnelling Protocol User Plane) over UDP packets
6668 * are routed based on its 32-bit TEID (Tunnel ID).
6669 *
6670 * For SRIO (Serial RapidIO), L0-L2 header information
6671 * the sub-system classifies SRIO packets based on (optional) the source ID, destination ID, transport type, priority,
6672 * message type, SRIO type 11 mailbox and letter, SRIO type 9 stream ID and class of service.
6673 *
6674 */
6677 /**
6678 * @page cache
6679 *
6680 * The packet accelerator low level driver module will make call backs to the module user when it
6681 * is about to read from one of the two tables provided by the module user. If the module user
6682 * is operating in a multi-core environment with a single set of tables shared by all the cores,
6683 * then this function is used to tell a local core that it must invalidate its cache, without writeback.
6684 * This is necessary if cross core cache coherency is not maintained by the hardware in the device.
6685 *
6686 * Without this it is possible for one core to be operating from a locally cached version of the
6687 * tables which does not reflect any additions or deletions done by other cores.
6688 *
6689 * An alternative is to place the tables into non-cached memory.
6690 *
6691 */
6693 /**
6694 * @page semaphores
6695 *
6696 * The packet accelerator low level driver module will make call backs to the module user when it
6697 * is about to modify from one of the two tables provided by the module user. If the module user
6698 * is operating in a multi-core environment with a single set of tables shared by all the cores,
6699 * then this function is used to tell the application to apply a cross core semaphore.
6700 *
6701 * When table modification is done the module will again make a call back to the module user
6702 * to inform it to release the semaphore.
6703 */
6706 /**
6707 * @page order
6708 *
6709 * The sub-system examines the L2 and L3 (LUT1) information (see @ref netlayers) in packets based on internal
6710 * table location. When function @ref Pa_addMac and @ref Pa_addIp are executed and the resulting packet
6711 * forwarded to the sub-system, the sub-system places the new entries at the highest free
6712 * table location. When incoming packets are examined, the table is searched from lowest entry location
6713 * to highest entry location until the first matching entry is found. That entry is used to route the
6714 * packet.
6715 *
6716 * Because of this it is required that entries into the table be made in order from the most general
6717 * to the most specific. For example, when adding a mac address it is common to want to route the following:
6718 * @li dest mac only - Forward packet to host
6719 * @li dest mac + ethertype - Continue parsing
6720 * @li dest mac + source mac + ethertype - Forward packet to host
6721 *
6722 * To get the desired routing the @ref Pa_addMac commands must be executed and the command packets forwarded
6723 * to the sub-system in the order shown above. If they are entered in the reverse order then every packet
6724 * which has the value dest MAC will be forwarded to the host since it matches the first entry in the list.
6725 *
6726 * The order dependency applies to calls to @ref Pa_addMac and @ref Pa_addIp, but not to calls between these functions.
6727 * So all MAC entries can be made followed by all IP entries, or in the reverse order (provided the IP entries
6728 * do not reference the MAC entries) without changing the operation of the sub-system.
6729 *
6730 */
6732 /**
6733 * @page appendix1 PDSP image
6734 *
6735 * The sub-sustem contains six PDSPs wihich perform the command and packet processing. There are three PDSP
6736 * images provided by the module under the pa/fw directory:
6737 * @li Packet Classifier 1 image: classify1_bin.c for PDSP0, PDSP1 and PDSP2
6738 * @li Packet Classifier 2 image: classify2_bin.c for PDSP3
6739 * @li Packet Modifier image: pam_bin.c for PDSP4 and PDSP5
6740 *
6741 * The PDSP executable images are provided to the module user as c-file contains the binary image. They should
6742 * be included by the application and loaded into the corresponding PASS PDSP by invoking the API
6743 * @ref Pa_downloadImage at system startup.
6744 *
6745 */
6748 /**
6749 * @page appendix2 CPPI Error Flags
6750 *
6751 * The sub-system performs IPv4 header checksum, UDP/TCP checksum and SCTP CRC-32c checksum autonomously.
6752 * The sub-system can also perform the CRC verification for incoming packet as one of the actions specified
6753 * by the post-classification command set.
6754 *
6755 * The checksum and CRC verification results are recorded at the 4-bit error flags in the CPPI packet descriptor
6756 * as described below:
6757 * @li bit 3: IPv4 header checksum error
6758 * @li bit 2: UDP/TCP or SCTP CRC-32c checksum error
6759 * @li bit 1: Custom CRC checksum error
6760 * @li bit 0: reserved
6761 *
6762 */
6764 /**
6765 * @page appendix3 PA-assisted IP Reassembly Operation
6766 *
6767 * The current version of PASS does not support IP reassembly, the IP fragments can be detected by PASS, forwarded to
6768 * and reassembled at host. The reassembled IP packet may be forwarded back to PASS for continuous classification.
6769 * The drawback of this approach is that the order of the incoming packets will not be maintained.
6770 *
6771 * To provide better support for IP reassembly, the PA-assisted IP Reassembly operation is introduced and summarized below:
6772 * @li Array of traffic flows which consist of source IP, destination IP, protocol and counter are maintained at PASS PDSP.
6773 * @li A traffic flow is activated by the PDSP when the first IP fragment with the source and destination IP and protocol is
6774 * detected and forwarded.
6775 * @li The traffic flow is freed when its packet count reaches 0
6776 * @li All packets belong to any active traffic flow will be forwarded to the host so the packet order will be maintained.
6777 * @li IP fragments should be forwarded to host with "not availeable" traffic flow id if no traffic flow is available.
6778 * In this case, the packet order is not guaranteed to be maintained.
6779 * @li PASS supports up to 32 active traffic flows for outer IP (PDSP1) and inner IP (PDSP2) respectively.
6780 * @li The PA-assisted IP Reassembly Operation will be enabled by invoking API @ref Pa_control with the IP reassembly
6781 * configuration @ref paIpReassmConfig_t.
6782 *
6783 * @note The minimum size packet wire rate throughput will not be guaranteed when this feature is enabled and there are active
6784 * traffic flows.
6785 *
6786 * The host IP reassembly module should interact with PASS and perform the full IP reassembly operation. The module user may choose
6787 * to implement a simplified version of IP reassembly algorithm to save CPU cycle in controlled IP environment. A sample reassembly
6788 * module is provided in the PA LLD release package, which demonstrates how to interact with the NetCP to perform the IP reassembly
6789 * operation.
6790 *
6791 * The sample code implements a simplified version of IP reassembly algorithm which supports non-overlapping segments only. The sample
6792 * code performs the following tasks:
6793 * @li Maintain the IP reassembly contexts consist of source IP, destination IP, IP identification, protocol, fragments count and the
6794 * corresponding traffic flow id.
6795 * @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.
6796 * @li For IPSEC inner IP fragments, call SA LLD to perform the post-decryption operation including padding check and IPSEC header
6797 * and authentication tag removal.
6798 * @li Forward the reassembled IP packet with its flow id and fragments count to PA PDSP queue.
6799 * @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.
6800 *
6801 */
6804 #ifdef __cplusplus
6805 }
6806 #endif
6809 #endif /* _PA_H */