PA LLD Functions
[PA LLD Module API]

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.

Function Documentation

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).

This command is called to add a specific match entry to the L3 (LUT1) lookup table. This function is called once per desired custom LUT1 match criteria.

The LLD will determine where this entry is added based on following rules

  • If there is no previous link or the previous link is a L2 (MAC/SRIO) entry, this entry will be added into LUT1_1
  • If the previous link is L3 (IP/Custom LUT1), this entry will be added into LUT1_2

The module user can overwrite the default rules by specifying the desired LUT1 instance.

The PASS will determine which entry of the specified LUT1 table is used for this entry based on its internal algorithm if the module user does not specify the LUT1 index.

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the Pa_forwardResult API.

Parameters:
[in] iHandle The driver instance handle
[in] custIndex The level 3 (LUT1) custom index
[in] lutInst Specify which LUT1 (0-2) should be used. Set to pa_LUT_INST_NOT_SPECIFIED if not specified
[in] index Specify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
[in] match The byte values that describe the match entry
[in] prevLink An optional L2 or L3 handle that links to this lookup
[in] routeInfo Where to send a packet that matches
[in] nextRtFail Where to send a packet that matches here, but fails next parse level
[out] retHandle The returned L3 handle
[out] cmd Buffer where the command is created
[in] cmdSize On entry the size of the cmd buffer, on exit the size of the command
[in] reply Where the response to the PASS command is routed
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
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.

This command is called to add a specific entry to the L4 (LUT2) lookup table. This function is called once per desired custom LUT2 match criteria. This API also initiates the atomic queue diversion operation, which means that the QMSS moves the entries in the diverted queue to the destination queue, if the divertQ is specified and fReplace flag is set. In this case, the PASS will complete the LUT2 update, wait for the queue diversion to be complete and then resume processing incoming packets.

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the Pa_forwardResult API.

Parameters:
[in] iHandle The driver instance handle
[in] custIndex The level 4 (LUT2) custom index
[in] match The four match values, only 1st three valid if prevLink is non-NULL
[in] prevLink An optional L2 or L3 handle that links to this lookup
[in] divertQ The source queue for atomic queue diversion with LUT2 update Set to pa_PARAMS_NOT_SPECIFIED if not specified
[in] fReplace Flag to indicate whether the entry exists
[in] routeInfo Where to send a packet that matches
[out] retHandle The returned L4 handle
[out] cmd The buffer where the command is created
[in] cmdSize On entry the size of the cmd buffer, on exit the size of the command
[in] reply Where the response to the PASS command is routed
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
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.

This function is used to add or replace an entry in the L3 table (see netlayers). A new entry is added if the IP configuration info is unique in the modules handle table. If the value is not unique then the routing information for the existing entry is changed to the values provided in the function.

The LLD will determine where this entry is added based on following rules

  • If there is no previous link or the previous link is a L2 (MAC/SRIO) entry, this entry will be added into LUT1_1
  • If the previous link is L3 (IP/Custom LUT1), this entry will be added into LUT1_2

The module user can overwrite the default rules by specifying the desired LUT1 instance.

The PASS will determine which entry of the specified LUT1 table is used for this entry based on its internal algorithm if the module user does not specify the LUT1 index.

L3 values that are used for packet routing should be set as described in paIpInfo_t.

The paHandleL2L3_t prevLink is used to link this entry to an L2 or L3 entry already made by a call to Pa_addMac or Pa_addIp. If the link is enabled then a packet will match the IP information provided in ipInfo only if the same packet has already matched at the L2 level as described by prevLink. To disable linking the value of prevLink is set to NULL.

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the API Pa_forwardResult.

This command as well as Pa_addMac operates with a strong dependence on entry order. See section table order for a description on the operation of the sub-system and table entry ordering.

Parameters:
[in] iHandle The driver instance handle
[in] lutInst Specify which LUT1 (0-2) should be used. Set to pa_LUT_INST_NOT_SPECIFIED if not specified
[in] index Specify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
[in] ipInfo Value paIpInfo_t
[in] prevLink An optional L2 or L3 handle
[in] routeInfo Where to send a packet that matches
[in] nextRtFail Where to send a packet that matches, but later fails
[out] retHandle Pointer to the returned L3 handle
[out] cmd Buffer where the PASS command is created
[in] cmdSize The size of the cmd buffer
[in] reply Where the response to the PASS command is routed
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
Note:
No table entry validation will be proformed if the LUT1 index is specified at this function
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.

This function is used to add or replace an entry into the L2 table (see netlayers). A new entry is added if the MAC configuration info is unique in the modules handle table. If the value is not unique then the routing information for the existing entry is changed to the values provided in the function.

L2 values that are not to be used for packet routing are set to 0.

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the Pa_forwardResult API.

This command as well as Pa_addIp operate with a strong dependence on entry order. See section table order for a description on the operation of the sub-system and table entry ordering.

Parameters:
[in] iHandle The driver instance handle
[in] index Specify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
[in] ethInfo Value paEthInfo_t
[in] routeInfo Match packet routing information
[in] nextRtFail Routing information for subsequent match failures
[out] handle Pointer to L2 Handle
[out] cmd Where the created command is placed
[in,out] cmdSize Input the size of cmd buffer, on output the actual size used. Command buffer minimum size requirements
[in] reply Where the sub-system sends the command reply
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
Note:
No table entry validation will be proformed if the LUT1 index is specified at this function
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.

This function is used to add an entry to the L4 (LUT2) table (see netlayers). Only the destination port can be set, along with an optional link to a previous L3 handle (see Pa_addIp) through linkHandle.

This module does not keep track of the L4 handles, so calling the function a second time with the same destination port and link handle will simply replace the previous entry. It is recommended to set the replace flag to indicate that this entry is already at the LUT2 table. This feature may be used to change the routing information without deleting and adding the matching port. This API also initiates the atomic queue diversion operation, which means that the QMSS moves the entries in the diverted queue to the destination queue, if the divertQ is specified and fReplace flag is set. In this case, the PASS will complete the LUT2 update, wait for the queue diversion to be complete and then resume processing incoming packets. Unlike entries in the L2 and L3 table, the order of entry is not important.

The type of transport header (TCP/UDP) is not specified here. If the type of transport is part of the packet routing criteria it is specified in the protocol type field in paIpInfo_t in the call to Pa_addIp.

This function supports both 16-bit and 32-bit port specified by the parameter portSize. However, there are the following restrictions for 32-bit ports

               1. The optional link to the previous LUT1 match can not be used so that the destID 
                  should be unique regressless of the previous L3 adddreses
               2. The 32-bit LUT2 lookup can not be mixed with the other TCP/UDP or custom LUT2 lookup. 
    

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the Pa_forwardResult API.

Parameters:
[in] iHandle The driver instance handle
[in] portSize The input port size (LUT2 Port Size Values)
[in] destPort The destination TCP/UDP port
[in] linkHandle An L3 handle that is linked to the destination port
[in] fReplace Flag to indicate whether the entry exists
[in] divertQ The source queue for atomic queue diversion with LUT2 update Set to pa_PARAMS_NOT_SPECIFIED if not specified
[in] routeInfo Where to send a packet that matches
[out] retHandle A blank handle where the return handle is placed
[out] cmd Buffer where the PASS command is created
[in] cmdSize The size of the cmd buffer
[out] reply Where the response to the PASS command is routed
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
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.

This function is used to add or replace an entry into the L2 table (see netlayers). A new entry is added if the SRIO configuration info is unique in the modules handle table. If the value is not unique then the routing information for the existing entry is changed to the values provided in the function.

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the API Pa_forwardResult.

This command as well as Pa_addIp operate with a strong dependence on entry order. See section table order for a description on the operation of the sub-system and table entry ordering.

Parameters:
[in] iHandle The driver instance handle
[in] index Specify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
[in] srioInfo Value paSrioInfo_t
[in] nextHdr The next header type to be parsed following the SRIO classification Refer to Next Header types for all supported protocols Set to pa_HDR_TYPE_UNKNOWN if no further prasing is required
[in] nextHdrOffset Offset to the next header from the beginning of the packet
[in] routeInfo Match packet routing information
[in] nextRtFail Routing information for subsequent match failures
[out] handle Pointer to L2 Handle
[out] cmd Where the created command is placed
[in,out] cmdSize Input the size of cmd buffer, on output the actual size used. Command buffer minimum size requirements
[in] reply Where the sub-system sends the command reply
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
Note:
No table entry validation will be proformed if the LUT1 index is specified at this function
paReturn_t Pa_close ( Pa_Handle  handle,
void *  bases[] 
)

Pa_close decativates the PA driver instance.

This function deactivates the PA driver instance, all the associated memory buffers can be freed after this call.

Parameters:
[in] handle The PA LLD instance identifier
[out] bases Array of the memory buffer base addresses
Return values:
Value (Function Return Values)
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.

This function is used to configure the sub-system to format and store a list of commands which are executed in order when a match occurs and the command set is specified by the routing information.

The command set is created and refered to based on the command set index. Once the command set is created through a call to this function it remains effective until the function is called again to explicitly overwrite its content. It is not recommended to update a command set when it is still used by one or more packet routes. There are pa_MAX_CMD_SETS of command sets supported by the sub-system

The commands within the command set will be executed in order at PDSP4. The module user is responsible for placing the commands in such ways that the packet offsets required by commands should be in ascending order, otherwise, the unexecutable command will be ignored. The command set should be terminated with a pa_CMD_NEXT_ROUTE or pa_CMD_MULTI_ROUTE command. If there is no final route command specified, the PASS will use the default next route command. Please note that all the commands following the pa_CMD_NEXT_ROUTE or pa_CMD_MULTI_ROUTE command will be ignored.

This API supports the following commands (Command Code)

  • pa_CMD_REMOVE_HEADER
  • pa_CMD_COPY_DATA_TO_PSINFO
  • pa_CMD_CRC_OP
  • pa_CMD_PATCH_DATA
  • pa_CMD_REMOVE_TAIL
  • pa_CMD_NEXT_ROUTE
  • pa_CMD_MULTI_ROUTE
  • pa_CMD_USR_STATS

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the API Pa_forwardResult.

Parameters:
[in] iHandle The driver instance handle
[in] index The command set index
[in] nCmd The number of commands specified
[in] cmdInfo Array of command configuration information
[out] cmd Buffer where the sub-system command is created
[in] cmdSize The size of the passCmd buffer
[in] reply Where the response to the PASS command is routed
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
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.

This function is used to configure the specified CRC engine by formating the CRC configuration command packet.

There are 6 CRC engines in the PA sun-system. Each CRC engine is connected to its corresponding PDSP. It performs CRC operation required by the some network protocol such as SCTP and/or the user-specified CRC command for its corresponding PDSP. Therefore, it is referred by the PDSP number.

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the Pa_forwardResult API.

Note:
Each CRC engine only supports one type of CRC per configuration. It is up to the module user to configure and use the CRC engine by calling this function for the specific use cases. For example, the CRC engine connected to PDSP2 should be configured to perform CRC-32c checksum for SCTP over inner-IP use case.
Parameters:
[in] iHandle The driver instance handle
[in] index The CRC engine index
[in] cfgInfo The CRC engine configuration information
[out] cmd Buffer where the sub-system command is created
[in] cmdSize The size of the passCmd buffer
[in] reply Where the response to the PASS command is routed
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
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.

This function is used to configure the sub-system to route packets that satisfy an exception rule or condition (see Exception Route Types). For example,

  • failure to table match
  • parsing error i.e. the sub-system is not able to continuethe parse
  • MAC broadcast packets
  • IP multicast packets

From one to pa_EROUTE_MAX routes can be specified through a single call to this function. Parameter nRoute is used to specify how many routes are contained in the routeTypes and eRoutes arrays. A value of 0 nRoutes results in no action by the function.

By default when each exception type is detected the packet is discarded silently. Once the route is changed through a call to this function it remains in the new state until the function is called again to explicitly change that route. The only way to revert back to the default of silent discard is to call this function again.

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the API Pa_forwardResult.

Parameters:
[in] iHandle The driver instance handle
[in] nRoute The number of exception routes specified
[in] routeTypes Array of exception routing types (Exception Route Types)
[in] eRoutes Array of exception packet routing configuration
[out] cmd Buffer where the sub-system command is created
[in] cmdSize The size of the passCmd buffer
[in] reply Where the response to the PASS command is routed
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
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.

This function is used to configure the sub-system to format and store a multi- route set which contains routing information for up to pa_MAX_MULTI_ROUTE_ENTRIES destinations.

The multi-route group is created and refered to based on the multi-route index. Once the multi-route group is created through a call to this function it remains effective until the function is called again to explicitly overwrite its content. It is not recommended to update a mult-route group when it is still used by one or more packet routes.

There are pa_MAX_MULTI_ROUTE_SETS of multi-route sets supported by the sub-system

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the API Pa_forwardResult.

Parameters:
[in] iHandle The driver instance handle
[in] mode The operation mode (CONFIG or RESET) refer to paMultiRouteModes_e
[in] index The multi-route index
[in] nRoute The number of routing entries specified
[in] routeEntry Array of routing configuration information
[out] cmd Buffer where the sub-system command is created
[in] cmdSize The size of the passCmd buffer
[in] reply Where the response to the PASS command is routed
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
paReturn_t Pa_configTimestamp ( Pa_Handle  iHandle,
paTimestampConfig_t cfgInfo 
)

Pa_configTimestamp configures the PA timer which is used to generate 48-bit timestamp.

This function is used to configure the 16-bit timer reserved for the 48-bit system timestamp. The lower 32-bit of the system timestamp will be inserted into the timestamp field in the packet descriptor for all input packets. It can be also inserted into the timestamp report packets triggered by the egress packets per tx command. The 16-bit timer connected to PDSP0 is reserved for timestamp generation.

Parameters:
[in] iHandle The driver instance handle
[in] cfgInfo The timestamp configuration information
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
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.

This function performs the counter configuration for the multi-level hierarchical user-defined statistics which consists of up to 64 64-bit counters and up to 192 32-bit counters. Each counter can be linked to the next level counter. All counters in its linking chain will be incremented when the lowest level counter is updated. The module user can specify the type of each counter and how the counter is linked to the next level counter. It is not recommended to re-configure the user-defined statistics when one or more counters are still used by PASS. The command reply routing is optional because this command is always processed by the PA sub-system.

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the Pa_forwardResult API.

Parameters:
[in] iHandle The driver instance handle
[in] cfgInfo The user-defined statistics configuration information
[out] cmd Buffer where the sub-system command is created
[in] cmdSize The size of the passCmd buffer
[in] reply Where the response to the PASS command is routed
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
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.

This function performs PASS control operations including system-level figurations. The system-level configurations are divided into several sub-groups which can be configured independently. The default configuration will be used until this API is invoked.

On return the command buffer (cmd) contains a formatted command for the sub-system when the cmdSize is set to non-zero. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the Pa_forwardResult API.

Parameters:
[in] handle The PA LLD instance identifier
[in] ctrl Control information
[out] cmd Where the created command is placed
[in,out] cmdSize Input the size of cmd buffer, on output the actual size used. Command buffer minimum size requirements
[in] reply Where the sub-system sends the command reply
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
paReturn_t Pa_create ( paConfig_t cfg,
void *  bases[],
Pa_Handle pHandle 
)

Pa_create creates the PA driver instance.

This function initializes the PA driver based on user configuration

Parameters:
[in] cfg Configuration information
[in] bases Array of the memory buffer base addresses
[out] pHandle Instance handle. This is a pointer to an initialized instance structure.
Return values:
Value (Function Return Values)
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.

This function is used to remove an entry from the sub-system L2 or L3 (LUT1) lookup (see netlayers). When a handle is deleted it can create stale handles. For example, an L3 handle can reference an L2 handle, and an L4 handle can reference an L3 handle. The module does not check for references to a stale handle, the module user is responsible for maintaining reference coherency. It is recommended that the handle should not be deleted if the API function Pa_getHandleRefCount returns non-zero reference count.

Parameters:
[in] iHandle The driver instance handle
[in] handle Pointer to the l2/l3 handle to delete
[out] cmd Where the created command is placed
[in] cmdSize The size of the cmd buffer
[in] reply Where the sub-system sends the command reply
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
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.

This function is used to remove an entry from the sub-system L4 (LUT2) handle entry.

Parameters:
[in] iHandle The driver instance handle
[in,out] handle Pointer to the L4 handle to delete
[out] cmd Where the created command is placed
[in] cmdSize The size of the cmd buffer
[in] reply Where the sub-system sends the reply
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
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.

This function is used to download an executable PDSP image to the specific packet processing module. See section table PDSP image for a description of PDSP images provided by this module

Parameters:
[in] iHandle The driver instance handle
[in] modId The PDSP number (0-5)
[in] image The image to download
[in] sizeBytes The size of the image
Return values:
Value (Function Return Values)
Precondition:
The packet processing modules must be in reset. See Pa_resetControl.
Note:
This function will access the PA sub-system registers. It is up to the module user to provide critical section protection so that only one core or task should use this function at a time.
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.

This function is used to create the command block which is used by the packet accelerator sub-system to perform blind patches on the packet. This function user optionally combines the generated block with other blocks to create compound commands. The command blocks are attached to data packets in the Protocol specific section of the packet descriptor.

Note:
The Tx commands can be executed at either PDSP4 or PDSP5. However, it is highly recommended to use PDSP5 for load balance since PDSP4 will be used to execute multi-routing and from-network command set.
Parameters:
[in] route Specifies where the packet is sent after the patch is complete
[in] patch The patch information
[out] cmdBuffer The routing command is formed in this buffer
[in] cmdSize On entry this size of cmdBuffer. On exit the amound of cmdBuffer used
Return values:
Value (Function Return Values)
paSysStats_t* Pa_formatStatsReply ( Pa_Handle  handle,
paCmd_t  cmd 
)

Pa_formatStatsReply formats the stats reply from the PA.

This function is used to convert the stats from the sub-system into a format useful for the application

Parameters:
[in] handle The driver instance handle
[in] cmd The buffer returned with the request stats response from PA
Return values:
A pointer to the formatted stats
Precondition:
A call to Pa_requestStats with output sent to PA and a reply generated from PA.
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.

This function is used to create, append and update the list of commands which will be executed by the packet accelerator and security accelerator sub-systems to perform a sequence of actions on the packet. The command block should be attached to data packets in the protocol specific section of the packet descriptor.

This API may be called multiple times to add or update the command block. The same protocol specific section can be used for every packet in the channel after the command list is constructed. Multiple MACROs may be used to update some parameters such as packet length in the command buffer for each packet.

This API supports the following commands (Command Code):

  • pa_CMD_NEXT_ROUTE
  • pa_CMD_CRC_OP
  • pa_CMD_PATCH_DATA
  • pa_CMD_TX_CHECKSUM
  • pa_CMD_REPORT_TX_TIMESTAMP
  • pa_CMD_SA_PAYLOAD
  • pa_CMD_IP_FRAGMENT
  • pa_CMD_PATCH_MSG_LEN
Note:
The Tx commands can be executed at either PDSP4 or PDSP5. However, it is highly recommended to use PDSP5 for load balance since PDSP4 will be used to execute multi-routing and from-network command set.
Parameters:
[in] nCmd The number of commands specified
[in] cmdInfo Array of command configuration information
[in] offset The command buffer location where the new commands are inserted
[out] cmdBuffer Buffer where the sub-system command is created
[in] cmdSize On entry this size of cmdBuffer. On exit the amound of cmdBuffer used
Return values:
Value (Function Return Values)
Note:
The command buffer should be 4-byte aligned
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.

This function is used to create the command block which is used by the packet accelerator sub-system to forward the packet with optional checksum generation. The module user can combine this block with other command blocks that control the security accelerator. The combined block is then provided for the transmitted packets in the Protocol specific section of the packet descriptor. This API needs only to be called once, and the same protocol specific section can be used for every packet in the channel. If the length of the checksum area changes with each packet, update the command buffer with the macro PASS_SET_TX_CHKSUM_LENGTH()

Note:
The Tx commands can be executed at either PDSP4 or PDSP5. However, it is highly recommended to use PDSP5 for load balance since PDSP4 will be used to execute multi-routing and from-network command set.
Parameters:
[in] chk0 Checksum 0 configuration. NULL if no checksum computation required
[in] chk1 Checksum 1 configuration. NULL if no checksum computation required
[in] route Next packet routing from sub-system
[out] cmdBuffer The routing command is formed in this buffer
[in] cmdSize On entry the size of cmdBuffer. On exit the size of the command
Return values:
Value (Function Return Values)
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.

This command is used to pass the sub-system generated replies to commands back to this module. Functions Pa_addMac, Pa_addSrio, Pa_addCustomLUT1 and Pa_addIp generate replies that must be forwarded to this module, or else handle deletion and link are not possible. Other commands generate replies that can be sent to this module which will return any warnings detected in the sub-system.

Parameters:
[in] iHandle The driver instance handle
[in] vresult The command reply packet from the sub-system
[out] retHandle Returns the handle associated with the command
[out] handleType Value Handle Types
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
paReturn_t Pa_getBufferReq ( paSizeInfo_t sizeCfg,
int  sizes[],
int  aligns[] 
)

Pa_getBufferReq returns the memory requirements for the PA driver.

This function returns the memory buffer requirements in term of the size and alignment array. The PA LLD requires up to four memory blocks as described below:

  • PA Instance: PA instance data
  • L2 Table: Layer-2 (MAC/SRIO) entry information
  • L3 Table: Layer-3 (IP/Custom LUT1) entry information
  • User Statistics Link Table: User-defined Statistics entry information (Optional)
Parameters:
[in] sizeCfg Size configuration information
[out] sizes Array of size requirements
[out] aligns Array of alignment requirements
Return values:
Value (Function Return Values)
Note:
This function specifies the minimum memory buffer requirements, it is up to the module user to round up the buffer alignemnt and size to the cache line boundary to ensure cache coherency if cacheable memory is used.
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.

The LLD maintains the reference counter for LUT1 handles: MAC/IP. Given a handle, the LLD would return how many references are being used in next header entry by invoking the function. For example, Query on MAC handle need to return how many IP handles are referencing the MAC handles. Query on IP handle need to return how many next protocol entries: IP/UDP are referencing to the IP handle. Therefore this function can be used to verify whether the LUT1 entry associated with the handle can be reomved.

Parameters:
[in] iHandle The driver instance handle
[in] l2l3handle The L2 or L3 handle to be queryed
[out] refCount The number of reference channels
Return values:
Value (Function Return Values)
paReturn_t Pa_getPDSPVersion ( Pa_Handle  iHandle,
int  modId,
uint32_t *  pVersion 
)

Pa_getPDSPVersion returns the PA PDSP version information.

This function is used to get the PA PDSP version information in 0xAABBCCDD format. where Arch (AA); API Changes (BB); Major (CC); Minor (DD

Parameters:
[in] iHandle The driver instance handle
[in] modId The PDSP number (0-5)
[out] pVersion The pointer to PDSP version number
Return values:
Value (Function Return Values)
Precondition:
The PDSP image should be downloaded successfully.
paReturn_t Pa_getTimestamp ( Pa_Handle  iHandle,
paTimestamp_t pTimestamp 
)

Pa_getTimestamp returns the 48-bit system timestamp.

This function is called to retrieve the current value of 48-bit PASS system timestamp.

Parameters:
[in] iHandle The driver instance handle
[out] pTimestamp Pointer to the 48-bit timestamp
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
uint32_t Pa_getVersion ( void   ) 

Pa_getVersion returns the PA LLD version information.

This function is used to get the version information of the PA LLD in 0xAABBCCDD format. where Arch (AA); API Changes (BB); Major (CC); Minor (DD)

Return values:
32-bit version information
const char* Pa_getVersionStr ( void   ) 

Pa_getVersionStr returns the PA LLD version string.

This function is used to get the version string of the PA LLD.

Return values:
Version string
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.

This function is used to request the operating statistics from the sub-system. The statistics can be optionally cleared after reading through the doClear parameter. The statistics apply to the entire sub-system, and are not core dependent on multi-core devices.

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the API Pa_formatStatsReply.

Parameters:
[in] iHandle The driver instance handle
[in] doClear If TRUE then stats are cleared after being read
[out] cmd Buffer where the sub-system command is created
[in] cmdSize The size of the cmd buffer
[in] reply Where the response of the PASS command is routed
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
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.

This function is used to query the user-defined statistics from the sub-system. The statistics will be formatted and copied to the buffer provided. The sub-system statistics can be then optionally cleared if doClear is set. In this case, the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system.

Parameters:
[in] iHandle The driver instance handle
[in] doClear If TRUE then stats are cleared after being read
[out] cmd Buffer where the sub-system command is created
[in] cmdSize The size of the cmd buffer
[in] reply Where the response of the PASS command is routed
[out] cmdDest Value (Command/Transmit Packet Destinations)
[out] pUsrStats Pointer to the usrStats buffer
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
paSSstate_t Pa_resetControl ( Pa_Handle  iHandle,
paSSstate_t  newState 
)

Pa_resetControl controls the reset state of the Sub-system.

This function is used to assert or release reset for the sub-system. Asserting reset does not reset any of the sub-system tables (L2, L3 or L4, see netlayers), but only the packet processing modules. To achieve a complete system reset the system level reset must be asserted through the power controller.

Parameters:
[in] iHandle The driver instance handle
[in] newState Value PA Sub-system Queries and States
Return values:
Value PA Sub-system Queries and States
Precondition:
None
Note:
This function will access the PA sub-system registers. It is up to the module user to provide critical section protection so that only one core or task should use this function at a time.
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.

This command is typically issued once per system and is used to configure the PA for performing network layer 3 (LUT1) custom lookups. It specifies the offset and byte masks which the PA subsystem uses for parsing a packet that has entered custom LUT1 classification directed from the previous match route. It also specifies the next header type and offset to be used for continuous parsing

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the Pa_forwardResult API.

Parameters:
[in] iHandle The driver instance handle
[in] custIndex The level 3 (LUT1) custom index
[in] parseByteOffset Where the PA begins custom match (relative to the L3 start)
[in] nextHdr The next header type to be parsed following the custom header Refer to Next Header types for all supported protocols Set to pa_HDR_TYPE_UNKNOWN if no further prasing is required
[in] nextHdrOffset Offset to the next header from the beginning of the custom header
[in] byteMasks The bitmap of bits in the parse that matter
[out] cmd Buffer where the PASS command is created
[in] cmdSize On entry the size of the cmd buffer, on exit the size of the command
[in] reply Where the response to the PASS command is routed
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
Note:
There is up to pa_MAX_CUSTOM_TYPES_LUT1 LUT1 custom types supported by PASS.
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.

This command is typically called once per system and is used to configure the PA for performing network layer 4 (LUT2) custom lookups. If handleLink is true then only 3 bytes and 3 offsets are available for matching. The fourth one is used to store the previous match information. In this case the first 3 values in the byteOffsets and byteMasks arrays are valid.

If setMask is non-zero, it will be ORed with the first byteMask and the match byte. It is used to distinguish this LUT2 custom lookupo entry from other lUT2 custom lookup and the standard lookup entries.

On return the command buffer (cmd) contains a formatted command for the sub-system. The destination for the command is provided in cmdDest. The module user must send the formatted command to the sub-system. The sub-system will generate a reply and this reply must be sent back to this module through the API Pa_forwardResult.

Parameters:
[in] iHandle The driver instance handle
[in] custIndex The level 4 (LUT2) custom index
[in] handleLink Set to TRUE to use one byte of the match to hold previous match info
[in] byteOffsets The offsets to the bytes to use in custom matching
[in] byteMasks The bits that are valid in the custom matching
[in] setMask The bits to be set at the first match byte
[out] cmd Buffer where the command is created
[in] cmdSize On entry the size of the cmd buffer, on exit the size of the command
[in] reply Where the response to the PASS command is routed
[out] cmdDest Value (Command/Transmit Packet Destinations)
Return values:
Value (Function Return Values)
Precondition:
A driver instance must be created and tables initialized
Note:
There is up to pa_MAX_CUSTOM_TYPES_LUT2 LUT2 custom types supported by PASS.
void Pa_startCfg ( Pa_Handle  handle,
paStartCfg_t startCfg 
)

Pa_startCfg Adds PA configuration.

This function needs to be called from all cores to initialize PA with per core configurations

Parameters:
[in] handle The PA LLD instance identifier
[in] startCfg PA start configuration
Return values:
None 

Copyright 2012, Texas Instruments Incorporated