pa.h File Reference

Packet Accelerator (PA) sub-system LLD API and Data Definitions. More...

#include <stdint.h>
#include <stdlib.h>
#include <ti/drv/pa/paver.h>

Data Structures

union  paIpAddr_t
 IP address specification. More...
union  paEntryHandle_t
 A generic entry handle types. More...
struct  paStartCfg_t
 PA start configuration structure. More...
struct  paSizeInfo_t
 PA Size Configuration Structure. More...
struct  paConfig_t
 PA Initialization config structure. More...
struct  paProtocolLimit_t
 Protocol-specific Limitations. More...
struct  paIpReassmConfig_t
 IP Reassembly Configuration Information. More...
struct  paCmdSetConfig_t
 Command Set Configuration Information. More...
struct  paUsrStatsConfig_t
 User-defined Statistics Configuration Information. More...
struct  paQueueDivertConfig_t
 Queue Diversion Configuration Information. More...
struct  paPacketControlConfig_t
 Packet Control Configuration Information. More...
struct  paSysConfig_t
 PA System Configuration Information structure. More...
struct  pa802p1agDetConfig_t
 802.1ag Detection Configuration Information. More...
struct  paIpsecNatTConfig_t
 IPSEC NAT-T Packet Detection Configuration Information. More...
struct  paCtrlInfo_t
 PA Control Information structure. More...
struct  paCmdReply_t
 paCmdReply_t is used to specify command result (from PASS) routing information More...
struct  paCmdNextRoute_t
 Next Route Command. More...
struct  paCmdCrcOp_t
 CRC Generation/Verification Command. More...
struct  paCmdSplitOp_t
 Split Command. More...
struct  paTxChksum_t
 Transmit checksum configuration. More...
struct  paCmdCopy_t
 Copy Command. More...
struct  paCmdMultiRoute_t
 Multi-route Command. More...
struct  paCmdSet_t
 Command Set Command. More...
struct  paPatchInfo_t
 Packet patching configuration. More...
struct  paPayloadInfo_t
 paPayloadInfo_t defines the packet payload information in the short format. It is required by the Security Accelerator sub-system (SASS) More...
struct  paCmdTxTimestamp_t
 Tx timestamp reporting information. More...
struct  paCmdIpFrag_t
 IP fragmentation information. More...
struct  paPatchMsgLenInfo_t
 Message length patching configuration. More...
struct  paCmdUsrStats_t
 User-defined Statistics Command. More...
struct  paCmdSetUsrStats_t
 Command Set plus User-defined Statistics Command. More...
struct  paCmdVerifyPktErr_t
 Verify Packet Error Command. More...
struct  paCmdInfo_t
 PA Command Information structure. More...
struct  paIpInfo_t
 IP lookup information. More...
struct  paEthInfo_t
 MAC/Ethernet lookup information. More...
struct  paSrioType11Info_s
 SRIO Type11 header information. More...
struct  paSrioType9Info_s
 SRIO Type9 header information. More...
union  paSrioTypeInfo_t
 Srio message type specific header information. More...
struct  paSrioInfo_t
 SRIO lookup information. More...
struct  paRouteInfo_t
 Packet routing configuration. More...
struct  paMultiRouteEntry_t
 Packet Multi-route entry configuration. More...
struct  paCrcConfig_t
 CRC Engine configuration. More...
struct  paTimestampConfig_t
 Timestamp configuration. More...
struct  paUsrStatsCounterEntryConfig_t
 User-defined statistics counter entry configuration information. More...
struct  paUsrStatsCounterConfig_t
 User-defined statistics counter configuration information. More...
struct  paUsrStatsConfigInfo_t
 User-defined statistics configuration information. More...
struct  paClassify1Stats_s
 PA Classify1 Statistics Structure. More...
struct  paClassify2Stats_s
 PA Classify2 Statistics Structure. More...
struct  paModifyStats_s
 PA Modifier Statistics Structure. More...
struct  paCommonStats_s
 PA Common Statistics Structure. More...
struct  paSysStats_s
 PA System Statistics Structure. More...
struct  paUsrStats_s
 PA User-defined Statistics Structure. More...
struct  paTimestamp_t
 PA Timestamp Structure. More...

Defines

#define pa_PARAMS_NOT_SPECIFIED   0xFFFF
#define pa_LUT_INST_NOT_SPECIFIED   -1
#define pa_LUT1_INDEX_NOT_SPECIFIED   -1
#define pa_MAX_NUM_LUT1_ENTRIES   64
#define pa_MAC_ADDR_SIZE   6
 MAC address specification.
#define pa_IPV4_ADDR_SIZE   4
 IPv4 address specification.
#define pa_IPV6_ADDR_SIZE   16
 IPv6 address specificiation.
#define PA_LLD_HANDLE_IP_INNER   ((paHandleL2L3_t)1)
 The un-linked inner IP handle.
#define pa_MAX_IP_REASM_TRAFFIC_FLOWS   32
 Define the maximum number of IP reassembly traffic flows.
#define pa_USR_STATS_MAX_COUNTERS   512
 Define the maximum number of user-defined statistics the module supports.
#define pa_USR_STATS_MAX_64B_COUNTERS   (pa_USR_STATS_MAX_COUNTERS/2)
 Define the maximum number of user-defined 64-bit statistics.
#define pa_USR_STATS_MAX_32B_COUNTERS   pa_USR_STATS_MAX_COUNTERS
 Define the maximum number of user-defined 32-bit statistics.
#define pa_N_BUFS   4
 Define the maximum number of buffers the module can request.
#define pa_MAX_CUSTOM_TYPES_LUT1   4
 The maximum number of LUT1 Custom Types supported.
#define pa_MAX_CUSTOM_TYPES_LUT2   16
 The maximum number of LUT2 Custom Types supported.
#define pa_MAX_CMD_SETS   64
#define pa_MAX_PATCH_BYTES   16
#define pa_MAX_RX_PATCH_BYTES   32
#define pa_NO_MULTI_ROUTE   -1
#define pa_MAX_MULTI_ROUTE_SETS   32
#define pa_MAX_MULTI_ROUTE_ENTRIES   8
#define pa_USR_STATS_LNK_END   0xFFFF
#define pa_RESET_SUBSYSTEM()
 pa_RESET_SUBSYSTEM is used to reset the Sub-system
#define pa_ENABLE_SUBSYSTEM()
 pa_ENABLE_SUBSYSTEM enables the subsystem.
#define pa_DOWNLOAD_MODULE(id, img, size)
 pa_DOWNLOAD_MODULE downloads an image
#define pa_GET_SYSTEM_STATE(x)
 pa_GET_SYSETM_STATE returns the state of the subsystem
#define pa_SET_TX_CHKSUM_LENGTH(datap, cnum, len)   PASAHO_CHKCRC_SET_LEN ((&(((pasahoComChkCrc_t *)datap)[cnum])), len)
 pa_SET_TX_CHKSUM_LENGTH sets the tx checksum length in a tx route block
#define pa_SET_TX_CHKSUM_INITVAL(datap, cnum, val)   PASAHO_CHKCRC_SET_INITVAL ((&(((pasahoComChkCrc_t *)datap)[cnum])), val)
 pa_SET_TX_INITVAL sets the initial value in a tx route block
PALLD Function Return Codes

Error codes returned by PALLD API functions.

#define pa_OK   0
#define pa_ERR_CONFIG   -10
#define pa_INSUFFICIENT_CMD_BUFFER_SIZE   -11
#define pa_INVALID_CMD_REPLY_DEST   -12
#define pa_DUP_ENTRY   -13
#define pa_INVALID_DUP_ENTRY   -14
#define pa_INVALID_TABLE_MORE_SPECIFIC_ENTRY_PRESENT   -15
#define pa_INVALID_MPLS_LABEL   -16
#define pa_HANDLE_TABLE_FULL   -17
#define pa_INVALID_INPUT_HANDLE   -18
#define pa_HANDLE_INACTIVE   -19
#define pa_INVALID_IP_FLOW   -20
#define pa_WARN_ACTIVE_HANDLE_ACKED   -21
#define pa_LUT_ENTRY_FAILED   -22
#define pa_RESUBMIT_COMMAND   -23
#define pa_SYSTEM_STATE_INVALID   -24
#define pa_INVALID_LUT1_INDEX   -25
#define pa_WARN_LNK_CNT_UNSYNC   -26
#define pa_CMDSET_TOO_BIG   -27
#define pa_INVALID_LUT_INST   -28
#define pa_RESOURCE_INIT_DENIED   -29
#define pa_RESOURCE_USE_DENIED   -30
#define pa_FIRMWARE_REVISION_DIFFERENCE   -31
Command buffer minimum sizes

Define command buffer minimum size requirements.

#define pa_ADD_LUT1_MIN_CMD_BUF_SIZE_BYTES   120
#define pa_ADD_MAC_MIN_CMD_BUF_SIZE_BYTES   pa_ADD_LUT1_MIN_CMD_BUF_SIZE_BYTES
#define pa_DEL_HANDLE_MIN_CMD_BUF_SIZE_BYTES   20
#define pa_DEL_L4_HANDLE_MIN_CMD_BUF_SIZE_BYTES   24
#define pa_ADD_IP_MIN_CMD_BUF_SIZE_BYTES   pa_ADD_LUT1_MIN_CMD_BUF_SIZE_BYTES
#define pa_ADD_LUT2_MIN_CMD_BUF_SIZE_BYTES   44
#define pa_ADD_PORT_MIN_CMD_BUF_SIZE_BYTES   pa_ADD_LUT2_MIN_CMD_BUF_SIZE_BYTES
#define pa_CONFIG_EXCEPTION_ROUTE_MIN_CMD_BUF_SIZE_BYTES   504
#define pa_CONFIG_CRC_ENGINE_MIN_CMD_BUF_SIZE_BYTES   88
#define pa_CONFIG_MULTI_ROUTE_MIN_CMD_BUF_SIZE_BYTES   84
#define pa_SET_CUSTOM_LUT1_MIN_CMD_BUF_SIZE_BYTES   60
#define pa_SET_CUSTOM_LUT2_MIN_CMD_BUF_SIZE_BYTES   36
#define pa_CONFIG_CMD_SET_MIN_CMD_BUF_SIZE_BYTES   144
#define pa_REQUEST_STATS_MIN_CMD_BUF_SIZE_BYTES   24
#define pa_CONFIG_USR_STATS_MIN_CMD_BUF_SIZE_BYTES   2068
#define pa_GLOBAL_CONFIG_MIN_CMD_BUF_SIZE_BYTES   56
#define pa_802_1ag_DET_MIN_CMD_BUF_SIZE_BYTES   24
#define pa_IPSEC_NAT_T_DET_MIN_CMD_BUF_SIZE_BYTES   24
#define pa_MAX_CMD_BUF_SIZE_BYTES   2068
IP Values

Defines the IP version type used.

The packet accelerator module parses both IPv4 and IPv6 network layer headers (see netlayers). This group is used to distinguish which type of header will be used.

#define pa_IPV4   4
#define pa_IPV6   6

#define pa_NUM_BYTES_CUSTOM_LUT1   32
 The number of bytes available for custom lookup.
Handle Types

These values are used to describe what type of handle is referenced.

These values are used only for function Pa_forwardResult. The function returns with a copy of the handle, which the module user should already have, along with the type of handle. The module user can use this information to verify that a particular handle has been fully activated and can be used for linking reference in calls to Pa_addIp, Pa_addCustomLUT1, Pa_addCustomLUT2 or Pa_addPort.

#define pa_L2_HANDLE   2
#define pa_L3_HANDLE   3
#define pa_L4_HANDLE   4
#define pa_INVALID_HANDLE   -1
Exception Route Types

These values are used to define exception route conditions.

The exception route defines the global routing information when the exception condition such as LUT1 lookup failure, packet parsing failure, broadcast packet detection and etc. Multiple exception routes can be configured through Pa_configExceptionRoute. All the exception routes are disabled by default.

#define pa_EROUTE_L2L3_FAIL   0
#define pa_EROUTE_VLAN_MAX_DEPTH   1
#define pa_EROUTE_IP_MAX_DEPTH   2
#define pa_EROUTE_MPLS_MAX_DEPTH   3
#define pa_EROUTE_GRE_MAX_DEPTH   4
#define pa_EROUTE_PARSE_FAIL   5
#define pa_EROUTE_L4_FAIL   6
#define pa_EROUTE_IP_FRAG   7
#define pa_EROUTE_IPV6_OPT_FAIL   8
#define pa_EROUTE_UDP_LITE_FAIL   9
#define pa_EROUTE_ROUTE_OPTION   10
#define pa_EROUTE_SYSTEM_FAIL   11
#define pa_EROUTE_MAC_BROADCAST   12
#define pa_EROUTE_MAC_MULTICAST   13
#define pa_EROUTE_IP_BROADCAST   14
#define pa_EROUTE_IP_MULTICAST   15
#define pa_EROUTE_GTPU_MESSAGE_TYPE_1   16
#define pa_EROUTE_GTPU_MESSAGE_TYPE_2   17
#define pa_EROUTE_GTPU_MESSAGE_TYPE_26   18
#define pa_EROUTE_GTPU_MESSAGE_TYPE_31   19
#define pa_EROUTE_GTPU_MESSAGE_TYPE_254   20
#define pa_EROUTE_GTPU_FAIL   21
#define pa_EROUTE_PPPoE_FAIL   22
#define pa_EROUTE_PPPoE_CTRL   23
#define pa_EROUTE_802_1ag   24
#define pa_EROUTE_IP_FAIL   25
#define pa_EROUTE_NAT_T_KEEPALIVE   26
#define pa_EROUTE_NAT_T_CTRL   27
#define pa_EROUTE_NAT_T_DATA   28
#define pa_EROUTE_NAT_T_FAIL   29
#define pa_EROUTE_MAX   30
Next Header types

These values are used to define the next header (protocol) types for continus parsing after the SRIO and custom parsing.

The next header type can be derived from the upper layer header in a standard Ethernet packet. For SRIO and custom LUT1 lookup, the next header type should be provided by the user in function Pa_setCustomLUT1 and Pa_addSrio.

#define pa_HDR_TYPE_MAC   0
#define pa_HDR_TYPE_IPV4   1
#define pa_HDR_TYPE_IPV6   2
#define pa_HDR_TYPE_CUSTOM_LUT1   3
#define pa_HDR_TYPE_UDP   4
#define pa_HDR_TYPE_UDP_LITE   5
#define pa_HDR_TYPE_TCP   6
#define pa_HDR_TYPE_CUSTOM_LUT2   7
#define pa_HDR_TYPE_UNKNOWN   8

#define pa_PROTOCOL_LIMIT_NUM_VLANS_DEF   2
 Protocol Limit related constant definitions.
#define pa_PROTOCOL_LIMIT_NUM_IP_DEF   2
#define pa_PROTOCOL_LIMIT_NUM_GRE_DEF   2
#define pa_PROTOCOL_LIMIT_NUM_VLANS_MAX   3
#define pa_PROTOCOL_LIMIT_NUM_IP_MAX   7
#define pa_PROTOCOL_LIMIT_NUM_GRE_MAX   7
PA Packet Control Bit Definitions

Bitmap definition of the ctrlBitMap in paPacketControlConfig_t.

#define pa_PKT_CTRL_HDR_VERIFY_PPPoE   0x0001
#define pa_PKT_CTRL_HDR_VERIFY_IP   0x0002
#define pa_PKT_CTRL_MAC_PADDING_CHK   0x0004
#define pa_PKT_CTRL_IP_FRAGS_TO_EROUTE   0x0008
PA 802.1ag Detector Control Bit Definitions

Bitmap definition of the ctrlBitMap in pa802p1agDetConfig_t.

#define pa_802_1ag_DETECT_ENABLE   0x0001
#define pa_802_1ag_DETECT_STANDARD   0x0002
PA IPSEC NAT-T Control Bit Definitions

Bitmap definition of the ctrlBitMap in pa802p1agDetConfig_t.

#define pa_IPSEC_NAT_T_CTRL_ENABLE   0x0001
PA Control Code

Define the PA LLD control code

#define pa_CONTROL_SYS_CONFIG   0
#define pa_CONTROL_802_1ag_CONFIG   1
#define pa_CONTROL_IPSEC_NAT_T_CONFIG   2
PA Memory Buffer Index

Define the buffer inedex of the PA LLD memory blocks.

#define pa_BUF_INST   0
#define pa_BUF_L2_TABLE   1
#define pa_BUF_L3_TABLE   2
#define pa_BUF_USR_STATS_TABLE   3
Routed Packet Destinations

The module user specifies packet destinations for packets exiting the packet accelerator sub-system.

The destination of packets that leave the packet accelerator sub-system are provided to the module in the paRouteInfo_t structure and passed to the module through the Pa_addMac, Pa_addSrio, Pa_addIp, Pa_addCustomLUT1, Pa_addCustomLUT2 and Pa_addPort functions

#define pa_DEST_DISCARD   3
#define pa_DEST_CONTINUE_PARSE_LUT1   4
#define pa_DEST_CONTINUE_PARSE_LUT2   5
#define pa_DEST_HOST   6
#define pa_DEST_EMAC   7
#define pa_DEST_SASS   8
#define pa_DEST_SRIO   9
Ethernet MAC port

The module user specifies the Ethernet MAC port of the ingress and egress packets.

In the from-network direction, the module user can specify the input port as one of classification parameters. In the to-network direction, the module user can force the egress packets to be sent over the specified destination Ethernet MAC port of the switch regreless of its states or configurations.

#define pa_EMAC_PORT_NOT_SPECIFIED   0
#define pa_EMAC_PORT_0   1
#define pa_EMAC_PORT_1   2
Ethernet MAC Output Control Bit Definition

Bitmap definition of the emacCtrl at paRouteInfo_t.

#define pa_EMAC_CTRL_PORT_MASK   0x0F
#define pa_EMAC_CTRL_CRC_DISABLE   0x80
Custom Classification Types

The module user specifies the custom classification types.

The optional custom classification rule may be used to further parse and calssify the incoming packet.

#define pa_CUSTOM_TYPE_NONE   0
#define pa_CUSTOM_TYPE_LUT1   1
#define pa_CUSTOM_TYPE_LUT2   2
Command/Transmit Packet Destinations

These values are used by the module user to deliver the configuration packets to the specific PDSP within PASS.

#define pa_CMD_TX_DEST_0   0
#define pa_CMD_TX_DEST_1   1
#define pa_CMD_TX_DEST_2   2
#define pa_CMD_TX_DEST_3   3
#define pa_CMD_TX_DEST_4   4
#define pa_CMD_TX_DEST_5   5
PA LUT1 Instance Destinations

These values are used by the module user to specify the LUT1 table instance used by the specified IP or customLUT1 entry

#define pa_LUT1_INST_0   0
#define pa_LUT1_INST_1   1
#define pa_LUT1_INST_2   2
#define pa_LUT1_INST_MAX   pa_LUT1_INST_2
PA Command Codes

Define the commands which can be executed in PASS

A single command or a set of commands can be executed to support fully-offloaded data path in both the transmit (to network) and receive (from network) directions. In the to-network direction, the list of commands formatted by the module should be stored as the protocol-specific information at the packet descriptor with the packet. The commands will be executed in order at PASS and the associated security accelerator sub-system (SASS). The executed commands will be removed by PASS and SASS so that the output packet will not contain any command. In the from-network direction, the list of commands formatted by the module will be stored at the PASS as a command set which can be referred to by the command set index. A single command including a command set can be executed per the enhanced routing information paRouteInfo_t after a LUT1 or LUT2 matches.

Note:
The packet offset specified at each command of the command list should be strictly in ascending order becasue the PASS processes the list of commands in order and it can not move backwards. The command violating the order requirement may be detected and rejected by the API Pa_formatTxCmd and Pa_configCmdSet. In the case, the order constraint can not be validated at the LLD, the violating command will be ignored by the PASS.
#define pa_CMD_NONE   0
#define pa_CMD_NEXT_ROUTE   1
#define pa_CMD_CRC_OP   2
#define pa_CMD_COPY_DATA_TO_PSINFO   3
#define pa_CMD_PATCH_DATA   4
#define pa_CMD_TX_CHECKSUM   5
#define pa_CMD_MULTI_ROUTE   6
#define pa_CMD_REPORT_TX_TIMESTAMP   7
#define pa_CMD_REMOVE_HEADER   8
#define pa_CMD_REMOVE_TAIL   9
#define pa_CMD_CMDSET   10
#define pa_CMD_SA_PAYLOAD   11
#define pa_CMD_IP_FRAGMENT   12
#define pa_CMD_USR_STATS   13
#define pa_CMD_CMDSET_AND_USR_STATS   14
#define pa_CMD_PATCH_MSG_LEN   15
#define pa_CMD_VERIFY_PKT_ERROR   16
#define pa_CMD_SPLIT   17
PA Routing Control Info Bit Definitions

Bitmap definition of the ctrlBitField in paCmdNextRoute_t.

#define pa_NEXT_ROUTE_PARAM_PRESENT   0x0001
#define pa_NEXT_ROUTE_PROC_NEXT_CMD   0x0002
#define pa_NEXT_ROUTE_PROC_MULTI_ROUTE   0x0004
#define pa_NEXT_ROUTE_TX_L2_PADDING   0x0008
CRC Frame types

Define the frame types which are used to extract and derive the CRC operation parameters such as CRC starting offset and CRC payload length from the frame header.

Both the payload length and the byte location where CRC calculation begins may vary in some protocl frame such as WCDMA FP HS-DSCH Data Frame type 2 and type 3. The CRC Frame type is used for PASS to extract and/or derive the CRC starting offset and payload length.

Note:
Only the following frame types are supported.
#define pa_CRC_OP_FRAME_TYPE_IUB_FP_HS_DSCH_TYPE2   0
#define pa_CRC_OP_FRAME_TYPE_IUB_FP_HS_DSCH_TYPE3   1
#define pa_CRC_OP_FRAME_TYPE_MAX   pa_CRC_OP_FRAME_TYPE_IUB_FP_HS_DSCH_TYPE3
PA CRC Command Control Info Bit Definitions

Bitmap definition of the ctrlBitField in paCmdCrcOp_t.

#define pa_CRC_OP_CRC_VALIDATE   0x0001
#define pa_CRC_OP_PAYLOAD_LENGTH_IN_HEADER   0x0002
#define pa_CRC_OP_PAYLOAD_LENGTH_OFFSET_IS_NEGATIVE   0x0004
#define pa_CRC_OP_CRC_FRAME_TYPE   0x0008
#define pa_CRC_OP_CRC_RESULT_FOLLOW_PAYLOAD   0x0010
PA SPLIT Command Control Info Bit Definitions

Bitmap definition of the ctrlBitField in paCmdSplitOp_t.

#define pa_SPLIT_OP_FRAME_TYPE   0x0001
PA Copy Command Control Info Bit Definitions

Bitmap definition of the ctrlBitField in paCmdCopy_t.

#define pa_COPY_OP_FROM_END   0x0001
PA Patch Command Control Info Bit Definitions

Bitmap definition of the ctrlBitField in paPatchInfo_t.

#define pa_PATCH_OP_INSERT   0x0001
#define pa_PATCH_OP_MAC_HDR   0x0002
#define pa_PATCH_OP_DELETE   0x0004
PA Packet Error Info Bit Definitions

Bitmap definition of the errorBitfield in paCmdVerifyPktErr_t.

#define pa_PKT_ERR_IP_CHECKSUM   0x0001
#define pa_PKT_ERR_L4_CHECKSUM   0x0002
#define pa_PKT_ERR_CRC   0x0004
SRIO Type Values

Defines the SRIO message types.

The packet accelerator sub-system parses both SRIO Type 9 and Type 11 message headers (see netlayers). This group is used to distinguish which type of header will be used.

#define pa_SRIO_TYPE_9   9
#define pa_SRIO_TYPE_11   11
SRIO Transport Type Values

Defines the SRIO tansport types used.

#define pa_SRIO_TRANSPORT_TYPE_0   0
#define pa_SRIO_TRANSPORT_TYPE_1   1
PA SRIO Info Valid Bit Definitions

Bitmap definition of the validBitMap in paSrioInfo_t.

#define pa_SRIO_INFO_VALID_SRC_ID   0x0001
#define pa_SRIO_INFO_VALID_DEST_ID   0x0002
#define pa_SRIO_INFO_VALID_ID   (pa_SRIO_INFO_VALID_SRC_ID | pa_SRIO_INFO_VALID_DEST_ID)
#define pa_SRIO_INFO_VALID_CC   0x0004
#define pa_SRIO_INFO_VALID_PRI   0x0008
#define pa_SRIO_INFO_VALID_TYPE_INFO_STREAMID   0x0010
#define pa_SRIO_INFO_VALID_TYPE_INFO_COS   0x0020
#define pa_SRIO_INFO_VALID_TYPE_INFO_MAILBOX   0x0010
#define pa_SRIO_INFO_VALID_TYPE_INFO_LETTER   0x0020
#define pa_SRIO_INFO_VALID_TYPE_INFO
Multiroute Entry Control Info Bit Definitions

Bitmap definition of the ctrlBitField in paMultiRouteEntry_t.

#define pa_MULTI_ROUTE_DESCRIPTOR_ONLY   0x01
#define pa_MULTI_ROUTE_REPLACE_SWINFO   0x02
CRC Engine Configuration Control Info Bit Definitions

Bitmap definition of the ctrlBitField in paCrcConfig_t.

#define pa_CRC_CONFIG_RIGHT_SHIFT   0x0001
#define pa_CRC_CONFIG_INVERSE_RESULT   0x0002
User-defined Statistics Counter Configuration Control Info Bit Definitions

Bitmap definition of the ctrlBitField in paUsrStatsCounterConfig_t

#define pa_USR_STATS_CONFIG_RESET   0x0001
PA Sub-system Queries and States

PA Sub-system reset state and query arguments used by API function Pa_resetControl

#define pa_STATE_RESET   0
#define pa_STATE_ENABLE   1
#define pa_STATE_QUERY   2
#define pa_STATE_INCONSISTENT   3
#define pa_STATE_INVALID_REQUEST   4
#define pa_STATE_ENABLE_FAILED   5
LUT2 Port Size Values

Defines the LUT2 port size supported by PA.

The PA LUT2 supports both 16-bit and 32-bit entry matching. It can be used to classify based on the UDP/IP 16-bit destination port with or without upper layer link or the GTP-U 32-bit Tunnel ID. No other Layer 4 or Layer 5 protocol is supported.

#define pa_LUT2_PORT_SIZE_16   0
#define pa_LUT2_PORT_SIZE_32   1

Typedefs

typedef void * Pa_Handle
 Specification of Pa_Handle.
typedef void * paHandleL2L3_t
 PA handle specification for L2 and L3 (LUT1) handles.
typedef uint32_t paHandleL4_t [2]
 PA handle specification for L4 (LUT2) handles.
typedef void * pa_RmHnd
 pa RM Handle
typedef void * paCmd_t
 Pointer to the buffer where the PASS command is placed.
typedef int paReturn_t
 The return type for module functions.
typedef struct paSrioType11Info_s paSrioType11Info_t
 SRIO Type11 header information.
typedef struct paSrioType9Info_s paSrioType9Info_t
 SRIO Type9 header information.
typedef int paSSstate_t
 paSState_t defines the operating state of the packet accelerator sub-system
typedef struct paClassify1Stats_s paClassify1Stats_t
 PA Classify1 Statistics Structure.
typedef struct paClassify2Stats_s paClassify2Stats_t
 PA Classify2 Statistics Structure.
typedef struct paModifyStats_s paModifyStats_t
 PA Modifier Statistics Structure.
typedef struct paCommonStats_s paCommonStats_t
 PA Common Statistics Structure.
typedef struct paSysStats_s paSysStats_t
 PA System Statistics Structure.
typedef struct paUsrStats_s paUsrStats_t
 PA User-defined Statistics Structure.

Enumerations

Multi-route group configuration mode

Definition of Multi-route group configuration mode supported in PA sub-system

enum  paMultiRouteModes_e { pa_MULTI_ROUTE_MODE_CONFIG = 0, pa_MULTI_ROUTE_MODE_RESET }
CRC Sizes

Definition of CRC sizes supported in PA sub-system

enum  paCrcSizes_e { pa_CRC_SIZE_8 = 0, pa_CRC_SIZE_16, pa_CRC_SIZE_24, pa_CRC_SIZE_32 }
Timestamp Scaler Factor

Definition of PA timestamp scaler factor supported in PA sub-system

Note:
pa_TIMESTAMP_SCALER_FACTOR_1 is not supported. It is defined here for reference purpose.
enum  paTimestampScalerFactor_e
User-defined Ststaistics Counter Types

Definition of Counter types of the User-defined Statistics

enum  paUsrStatsTypes_e { pa_USR_STATS_TYPE_PACKET = 0, pa_USR_STATS_TYPE_BYTE }

Functions

paReturn_t Pa_getBufferReq (paSizeInfo_t *sizeCfg, int sizes[], int aligns[])
 Pa_getBufferReq returns the memory requirements for the PA driver.
paReturn_t Pa_create (paConfig_t *cfg, void *bases[], Pa_Handle *pHandle)
 Pa_create creates the PA driver instance.
void Pa_startCfg (Pa_Handle handle, paStartCfg_t *startCfg)
 Pa_startCfg Adds PA configuration.
paReturn_t Pa_close (Pa_Handle handle, void *bases[])
 Pa_close decativates the PA driver instance.
paReturn_t Pa_control (Pa_Handle handle, paCtrlInfo_t *ctrl, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_control performs system-level control and configuration.
paReturn_t Pa_addSrio (Pa_Handle iHandle, int index, paSrioInfo_t *srioInfo, uint16_t nextHdr, uint16_t nextHdrOffset, paRouteInfo_t *routeInfo, paRouteInfo_t *nextRtFail, paHandleL2L3_t *handle, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_addSrio adds a SRIO entry to the L2 table.
paReturn_t Pa_addMac (Pa_Handle iHandle, int index, paEthInfo_t *ethInfo, paRouteInfo_t *routeInfo, paRouteInfo_t *nextRtFail, paHandleL2L3_t *handle, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_addMac adds a mac address to the L2 table.
paReturn_t Pa_delHandle (Pa_Handle iHandle, paHandleL2L3_t *handle, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_delHandle deletes a MAC/SRIO or IP handle.
paReturn_t Pa_delL4Handle (Pa_Handle iHandle, paHandleL4_t handle, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_delL4Handle deletes a UDP/TCP/GTPU/CustomLUT2 handle.
paReturn_t Pa_addIp (Pa_Handle iHandle, int lutInst, int index, paIpInfo_t *ipInfo, paHandleL2L3_t prevLink, paRouteInfo_t *routeInfo, paRouteInfo_t *nextRtFail, paHandleL2L3_t *retHandle, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_addIp adds an IP address to the L3 table.
paReturn_t Pa_addPort (Pa_Handle iHandle, int portSize, uint32_t destPort, paHandleL2L3_t linkHandle, uint16_t fReplace, uint16_t divertQ, paRouteInfo_t *routeInfo, paHandleL4_t retHandle, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_addPort adds a destination port to the L4 (LUT2) table.
paReturn_t Pa_setCustomLUT1 (Pa_Handle iHandle, uint16_t custIndex, uint16_t parseByteOffset, uint16_t nextHdr, uint16_t nextHdrOffset, uint8_t byteMasks[pa_NUM_BYTES_CUSTOM_LUT1], paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_setCustomLUT1 performs the global configuration for level 3 (LUT1) custom lookups.
paReturn_t Pa_addCustomLUT1 (Pa_Handle iHandle, uint16_t custIndex, int lutInst, int index, uint8_t match[pa_NUM_BYTES_CUSTOM_LUT1], paHandleL2L3_t prevLink, paRouteInfo_t *routeInfo, paRouteInfo_t *nextRtFail, paHandleL2L3_t *retHandle, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_AddCustomLUT1 adds a custom lookup entry to the lookup tables (LUT1).
paReturn_t Pa_setCustomLUT2 (Pa_Handle iHandle, uint16_t custIndex, uint16_t handleLink, uint16_t byteOffsets[pa_NUM_BYTES_CUSTOM_LUT2], uint8_t byteMasks[pa_NUM_BYTES_CUSTOM_LUT2], uint8_t setMask, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_setCustomLUT2 performs the global configuration for level 4 (LUT2) custom lookups.
paReturn_t Pa_addCustomLUT2 (Pa_Handle iHandle, uint16_t custIndex, uint8_t match[pa_NUM_BYTES_CUSTOM_LUT2], paHandleL2L3_t prevLink, uint16_t fReplace, uint16_t divertQ, paRouteInfo_t *routeInfo, paHandleL4_t retHandle, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_addCustomLUT2 adds a custom lookup to the LUT2 lookup tables.
paReturn_t Pa_forwardResult (Pa_Handle iHandle, void *vresult, paEntryHandle_t *retHandle, int *handleType, int *cmdDest)
 Pa_forwardResult examines the reply of the sub-system to a command.
paReturn_t Pa_configExceptionRoute (Pa_Handle iHandle, int nRoute, int *routeTypes, paRouteInfo_t *eRoutes, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_configExceptionRoute configures the routing of packets based on a exception condition such as MAC briadcast, multicast or error packet.
paReturn_t Pa_configCmdSet (Pa_Handle iHandle, uint16_t index, int nCmd, paCmdInfo_t *cmdInfo, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_configCmdSet configures the command set which consists of a list of commands.
paReturn_t Pa_configMultiRoute (Pa_Handle iHandle, paMultiRouteModes_e mode, uint16_t index, uint16_t nRoute, paMultiRouteEntry_t *routeEntry, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_configMultiRouteSet configures the multi-route group which consists of packet multi-route entries.
paReturn_t Pa_configCrcEngine (Pa_Handle iHandle, uint16_t index, paCrcConfig_t *cfgInfo, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_configCrcEngine configures the specified CRC engine.
paReturn_t Pa_configUsrStats (Pa_Handle iHandle, paUsrStatsConfigInfo_t *cfgInfo, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_configUsrStats configures the user-defined statistics operation.
paReturn_t Pa_configTimestamp (Pa_Handle iHandle, paTimestampConfig_t *cfgInfo)
 Pa_configTimestamp configures the PA timer which is used to generate 48-bit timestamp.
paReturn_t Pa_getTimestamp (Pa_Handle iHandle, paTimestamp_t *pTimestamp)
 Pa_getTimestamp returns the 48-bit system timestamp.
paReturn_t Pa_requestStats (Pa_Handle iHandle, uint16_t doClear, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_requestStats requests sub-system statistics.
paSysStats_tPa_formatStatsReply (Pa_Handle handle, paCmd_t cmd)
 Pa_formatStatsReply formats the stats reply from the PA.
paReturn_t Pa_requestUsrStats (Pa_Handle iHandle, uint16_t doClear, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest, paUsrStats_t *pUsrStats)
 Pa_requestUsrStats queries user-defined statistics.
paReturn_t Pa_formatTxRoute (paTxChksum_t *chk0, paTxChksum_t *chk1, paRouteInfo_t *route, void *cmdBuffer, uint16_t *cmdSize)
 Pa_formatTxRoute formats the commands to add checksums and route a Tx packet.
paReturn_t Pa_formatRoutePatch (paRouteInfo_t *route, paPatchInfo_t *patch, void *cmdBuffer, uint16_t *cmdSize)
 Pa_formatRoutePatch formats the commands to route a packet and blind patch.
paReturn_t Pa_formatTxCmd (int nCmd, paCmdInfo_t *cmdInfo, uint16_t offset, void *cmdBuffer, uint16_t *cmdSize)
 Pa_formatTxCmd formats a list of commands to be executed on the packets to be transmitted over the network.
paSSstate_t Pa_resetControl (Pa_Handle iHandle, paSSstate_t newState)
 Pa_resetControl controls the reset state of the Sub-system.
paReturn_t Pa_downloadImage (Pa_Handle iHandle, int modId, void *image, int sizeBytes)
 Pa_downloadImage downloads a PDSP image to a sub-system with the packet processing modules in reset.
paReturn_t Pa_getHandleRefCount (Pa_Handle iHandle, paHandleL2L3_t l2l3handle, uint16_t *refCount)
 Pa_getHandleRefCount returns the number of reference channels linked to the LUT1 handle.
paReturn_t Pa_getPDSPVersion (Pa_Handle iHandle, int modId, uint32_t *pVersion)
 Pa_getPDSPVersion returns the PA PDSP version information.
uint32_t Pa_getVersion (void)
 Pa_getVersion returns the PA LLD version information.
const char * Pa_getVersionStr (void)
 Pa_getVersionStr returns the PA LLD version string.

Detailed Description

Packet Accelerator (PA) sub-system LLD API and Data Definitions.

path ti/drv/pa/pa.h

============================================================================ Copyright (c) Texas Instruments Incorporated 2009-2012

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Define Documentation

#define PA_LLD_HANDLE_IP_INNER   ((paHandleL2L3_t)1)

The un-linked inner IP handle.

This handle value is used to specify an inner IP (tunnel) which the application does not want to link to an outer IP address.

#define pa_LUT1_INDEX_NOT_SPECIFIED   -1

Used if LUT1 index is not specified In the case, the PASS will use the first available entry

#define pa_LUT_INST_NOT_SPECIFIED   -1

Used if LUT1(or LUT2) instance is not specified In the case, the PA LLD will decide which LUT instance to use based on the API type and the previous link information

#define pa_MAX_CMD_SETS   64

The maximum number of command sets supported

#define pa_MAX_MULTI_ROUTE_ENTRIES   8

The maximum number of multi-route entries per muli-route set

#define pa_MAX_MULTI_ROUTE_SETS   32

The maximum number of multi-route sets supported

#define pa_MAX_NUM_LUT1_ENTRIES   64

The maximum number of LUT1 entries

#define pa_MAX_PATCH_BYTES   16

The maximum number of bytes that a patch command can accept

PATCH Command in to-netweok direction

#define pa_MAX_RX_PATCH_BYTES   32

PATCH Command within a command set

#define pa_NO_MULTI_ROUTE   -1

Multi Route not enabled in this route

#define pa_NUM_BYTES_CUSTOM_LUT1   32

The number of bytes available for custom lookup.

Custom lookup sizes are fixed by hardware

#define pa_PARAMS_NOT_SPECIFIED   0xFFFF

Used for unspecified classification parameters

#define pa_PROTOCOL_LIMIT_NUM_GRE_DEF   2

Number of GRE layers supported: default value

#define pa_PROTOCOL_LIMIT_NUM_GRE_MAX   7

Number of GRE layers supported: maximum value

#define pa_PROTOCOL_LIMIT_NUM_IP_DEF   2

Number of IP layers supported: default value

#define pa_PROTOCOL_LIMIT_NUM_IP_MAX   7

Number of IP layers supported: maximum value

#define pa_PROTOCOL_LIMIT_NUM_VLANS_DEF   2

Protocol Limit related constant definitions.

Number of VLAN supported: default value

#define pa_PROTOCOL_LIMIT_NUM_VLANS_MAX   3

Number of VLAN supported: maximum value

#define pa_USR_STATS_LNK_END   0xFFFF

Indicate that there is no next layer counter


Copyright 2012, Texas Instruments Incorporated