Functions
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_addMac2 (Pa_Handle iHandle, paEthInfo2_t *ethInfo, paParamDesc *params, paLnkHandle_t *retHandle, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_addMac2 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_addIp2 (Pa_Handle iHandle, paIpInfo2_t *ipInfo, paParamDesc *params, paLnkHandle_t *retHandle, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_addIp2 adds an IP address to the L3 table.
paReturn_t Pa_addVirtualLink (Pa_Handle iHandle, paLnkHandle_t *vlinkHdl, int8_t lnkType)
 Pa_addVirtualLink allocates a new virtual link within the PA instance.
paReturn_t Pa_delVirtualLink (Pa_Handle iHandle, paLnkHandle_t *vlinkHdl)
 Pa_delVirtualLink frees the specified virtual link within the PA instance.
paReturn_t Pa_allocUsrStats (Pa_Handle iHandle, int *pNumCnt, paUsrStatsAlloc_t *cntList)
 Pa_allocUsrStats allocates or verifies a set of user-defined statistics.
paReturn_t Pa_freeUsrStats (Pa_Handle iHandle, int numCnt, uint16_t *cntList)
 Pa_freeUsrStats free a set of user-defined statistics.
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 custHdrSize, 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_configExceptionRoute2 (Pa_Handle iHandle, int nRoute, int *routeTypes, paRouteInfo2_t *eRoutes, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest)
 Pa_configExceptionRoute2 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 PASS.
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 requests user-defined statistics.
paReturn_t Pa_requestUsrStatsList (Pa_Handle iHandle, uint16_t doClear, uint16_t nCnt, uint16_t *cntIndex, paCmd_t cmd, uint16_t *cmdSize, paCmdReply_t *reply, int *cmdDest, paUsrStats_t *pUsrStats)
 Pa_requestUsrStatsList is an advanced version of API Pa_requestUsrStats. It requests user-defined statistics with option to clear entire or a subset of statistics.
paReturn_t Pa_formatUsrStatsReply (Pa_Handle handle, paCmd_t cmd, paUsrStats_t *pUsrStats)
 Pa_formatUsrStatsReply formats the user-defined statistics reply from the PASS.
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]iHandleThe driver instance handle
[in]custIndexThe level 3 (LUT1) custom index
[in]lutInstSpecify which LUT1 (0-2) should be used. Set to pa_LUT_INST_NOT_SPECIFIED if not specified
[in]indexSpecify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
[in]matchThe byte values that describe the match entry
[in]prevLinkAn optional L2 or L3 handle that links to this lookup
[in]routeInfoWhere to send a packet that matches
[in]nextRtFailWhere to send a packet that matches here, but fails next parse level
[out]retHandleThe returned L3 handle
[out]cmdBuffer where the command is created
[in]cmdSizeOn entry the size of the cmd buffer, on exit the size of the command
[in]replyWhere the response to the PASS command is routed
[out]cmdDestValue (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]iHandleThe driver instance handle
[in]custIndexThe level 4 (LUT2) custom index
[in]matchThe four match values, only 1st three valid if prevLink is non-NULL
[in]prevLinkAn optional L2 or L3 handle that links to this lookup
[in]divertQThe source queue for atomic queue diversion with LUT2 update Set to pa_PARAMS_NOT_SPECIFIED if not specified
[in]fReplaceFlag to indicate whether the entry exists
[in]routeInfoWhere to send a packet that matches
[out]retHandleThe returned L4 handle
[out]cmdThe buffer where the command is created
[in]cmdSizeOn entry the size of the cmd buffer, on exit the size of the command
[in]replyWhere the response to the PASS command is routed
[out]cmdDestValue (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]iHandleThe driver instance handle
[in]lutInstSpecify which LUT1 (0-2) should be used. Set to pa_LUT_INST_NOT_SPECIFIED if not specified
[in]indexSpecify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
[in]ipInfoValue paIpInfo_t
[in]prevLinkAn optional L2 or L3 handle
[in]routeInfoWhere to send a packet that matches
[in]nextRtFailWhere to send a packet that matches, but later fails
[out]retHandlePointer to the returned L3 handle
[out]cmdBuffer where the PASS command is created
[in]cmdSizeThe size of the cmd buffer
[in]replyWhere the response to the PASS command is routed
[out]cmdDestValue (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_addIp2 ( Pa_Handle  iHandle,
paIpInfo2_t ipInfo,
paParamDesc params,
paLnkHandle_t retHandle,
paCmd_t  cmd,
uint16_t *  cmdSize,
paCmdReply_t reply,
int *  cmdDest 
)

Pa_addIp2 adds an IP address to the L3 table.

Pa_addIp2 is the next generation of API to replace Pa_addIp eventually. This new API covers the entire functionality of Pa_addIP and it is designed to support more features while maintain backward-compatibility over time.

Parameters:
[in]iHandleThe driver instance handle
[in]ipInfoValue paIpInfo2_t
[in]paramsCommon API parameters paParamDesc
[out]retHandlePointer to L3 Handle
[out]cmdWhere the created command is placed
[in,out]cmdSizeInput the size of cmd buffer, on output the actual size used. Command buffer minimum size requirements
[in]replyWhere the sub-system sends the command reply
[out]cmdDestValue (Command/Transmit Packet Destinations)
Return values:
Value(Function Return Values)
Precondition:
A driver instance must be created and tables initialized
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]iHandleThe driver instance handle
[in]indexSpecify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
[in]ethInfoValue paEthInfo_t
[in]routeInfoMatch packet routing information
[in]nextRtFailRouting information for subsequent match failures
[out]handlePointer to L2 Handle
[out]cmdWhere the created command is placed
[in,out]cmdSizeInput the size of cmd buffer, on output the actual size used. Command buffer minimum size requirements
[in]replyWhere the sub-system sends the command reply
[out]cmdDestValue (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_addMac2 ( Pa_Handle  iHandle,
paEthInfo2_t ethInfo,
paParamDesc params,
paLnkHandle_t retHandle,
paCmd_t  cmd,
uint16_t *  cmdSize,
paCmdReply_t reply,
int *  cmdDest 
)

Pa_addMac2 adds a mac address to the L2 table.

Pa_addMac2 is the next generation of API to replace Pa_addMac eventually. This new API covers the entire functionality of Pa_addMac and it is designed to support more features while maintain backward-compatibility over time.

Parameters:
[in]iHandleThe driver instance handle
[in]ethInfoValue paEthInfo2_t
[in]paramsCommon API parameters paParamDesc
[out]retHandlePointer to L2 Handle
[out]cmdWhere the created command is placed
[in,out]cmdSizeInput the size of cmd buffer, on output the actual size used. Command buffer minimum size requirements
[in]replyWhere the sub-system sends the command reply
[out]cmdDestValue (Command/Transmit Packet Destinations)
Return values:
Value(Function Return Values)
Precondition:
A driver instance must be created and tables initialized
Parameters:
ethInfoValue paEthInfo2_t
retHandlePointer to the returned L2 handle
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 a link to 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 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]iHandleThe driver instance handle
[in]portSizeThe input port size (LUT2 Port Size Values)
[in]destPortThe destination TCP/UDP port
[in]linkHandleAn L3 handle that is linked to the destination port
[in]fReplaceFlag to indicate whether the entry exists
[in]divertQThe source queue for atomic queue diversion with LUT2 update Set to pa_PARAMS_NOT_SPECIFIED if not specified
[in]routeInfoWhere to send a packet that matches
[out]retHandleA blank handle where the return handle is placed
[out]cmdBuffer where the PASS command is created
[in]cmdSizeThe size of the cmd buffer
[out]replyWhere the response to the PASS command is routed
[out]cmdDestValue (Command/Transmit Packet Destinations)
Return values:
Value(Function Return Values)
Precondition:
A driver instance must be created and tables initialized
Note:
The linkHandle is mandatory for 16-bit TCP/UDP port or 32-bit GTPU port when pa_GTPU_CTRL_USE_LINK is set. The linkHandle will be ignored for 32-bit GTPU port when pa_GTPU_CTRL_USE_LINK is cleared
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]iHandleThe driver instance handle
[in]indexSpecify the index of the LUT1 entry (0-63). Set to pa_LUT1_INDEX_NOT_SPECIFIED if not specified
[in]srioInfoValue paSrioInfo_t
[in]nextHdrThe 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]nextHdrOffsetOffset to the next header from the beginning of the packet
[in]routeInfoMatch packet routing information
[in]nextRtFailRouting information for subsequent match failures
[out]handlePointer to L2 Handle
[out]cmdWhere the created command is placed
[in,out]cmdSizeInput the size of cmd buffer, on output the actual size used. Command buffer minimum size requirements
[in]replyWhere the sub-system sends the command reply
[out]cmdDestValue (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_addVirtualLink ( Pa_Handle  iHandle,
paLnkHandle_t vlinkHdl,
int8_t  lnkType 
)

Pa_addVirtualLink allocates a new virtual link within the PA instance.

This function is called to request a new virtual link

Parameters:
[in]iHandleThe driver instance handle
[in,out]vlinkHdlPointer to virtual link handle
[in]lnkTypeValue (Virtual Link types)
Return values:
Value(Function Return Values)
Precondition:
A driver instance must be created and tables initialized
paReturn_t Pa_allocUsrStats ( Pa_Handle  iHandle,
int *  pNumCnt,
paUsrStatsAlloc_t cntList 
)

Pa_allocUsrStats allocates or verifies a set of user-defined statistics.

This function is called to request or verify a number of user-defined statistics. The return value pa_RESOURCE_USE_DENIED will be used if there are not enough user-defined statistics available or one of the provided counter indexes is not valid.

Parameters:
[in]iHandleThe driver instance handle
[in,out]pNumCntIn:Number of user-defined statistics requested; Out: Number of user-defined statistics allocated
[in,out]cntListArray of user-defined statistics allocation parameters
Return values:
Value(Function Return Values)
Precondition:
A driver instance must be created and tables initialized
Note:
: This function is optional when the application owns the entire set of user-defined statistics or uses a set of pre-allocated user-defined statistics. However, the PASS will verify the user-defined statistics list and may return error code pa_RESOURCE_USE_DENIED if RM is enabled when API Pa_configUsrStats, Pa_requestUsrStatsList and etc are invoked.
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]handleThe PA LLD instance identifier
[out]basesArray 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
  • pa_CMD_VERIFY_PKT_ERROR
  • pa_CMD_SPLIT

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]iHandleThe driver instance handle
[in]indexThe command set index
[in]nCmdThe number of commands specified
[in]cmdInfoArray of command configuration information
[out]cmdBuffer where the sub-system command is created
[in]cmdSizeThe size of the passCmd buffer
[in]replyWhere the response to the PASS command is routed
[out]cmdDestValue (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]iHandleThe driver instance handle
[in]indexThe CRC engine index
[in]cfgInfoThe CRC engine configuration information
[out]cmdBuffer where the sub-system command is created
[in]cmdSizeThe size of the passCmd buffer
[in]replyWhere the response to the PASS command is routed
[out]cmdDestValue (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]iHandleThe driver instance handle
[in]nRouteThe number of exception routes specified
[in]routeTypesArray of exception routing types (Exception Route Types)
[in]eRoutesArray of exception packet routing configuration
[out]cmdBuffer where the sub-system command is created
[in]cmdSizeThe size of the passCmd buffer
[in]replyWhere the response to the PASS command is routed
[out]cmdDestValue (Command/Transmit Packet Destinations)
Return values:
Value(Function Return Values)
Precondition:
A driver instance must be created and tables initialized
paReturn_t Pa_configExceptionRoute2 ( Pa_Handle  iHandle,
int  nRoute,
int *  routeTypes,
paRouteInfo2_t eRoutes,
paCmd_t  cmd,
uint16_t *  cmdSize,
paCmdReply_t reply,
int *  cmdDest 
)

Pa_configExceptionRoute2 configures the routing of packets based on a exception condition such as MAC briadcast, multicast or error packet.

Pa_configExceptionRoute2 is the next generation of API to replace Pa_configExceptionRoute eventually. This new API covers the entire functionality of Pa_configExceptionRoute and it is designed to support more features with the more advnced routing information data structure while maintain backward-compatibility over time.

Parameters:
[in]iHandleThe driver instance handle
[in]nRouteThe number of exception routes specified
[in]routeTypesArray of exception routing types (Exception Route Types)
[in]eRoutesArray of exception packet routing configuration
[out]cmdBuffer where the sub-system command is created
[in]cmdSizeThe size of the passCmd buffer
[in]replyWhere the response to the PASS command is routed
[out]cmdDestValue (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]iHandleThe driver instance handle
[in]modeThe operation mode (CONFIG or RESET) refer to paMultiRouteModes_e
[in]indexThe multi-route index
[in]nRouteThe number of routing entries specified
[in]routeEntryArray of routing configuration information
[out]cmdBuffer where the sub-system command is created
[in]cmdSizeThe size of the passCmd buffer
[in]replyWhere the response to the PASS command is routed
[out]cmdDestValue (Command/Transmit Packet Destinations)
Return values:
Value(Function Return Values)
Precondition:
A driver instance must be created and tables initialized

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]iHandleThe driver instance handle
[in]cfgInfoThe 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. 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]iHandleThe driver instance handle
[in]cfgInfoThe user-defined statistics configuration information
[out]cmdBuffer where the sub-system command is created
[in]cmdSizeThe size of the passCmd buffer
[in]replyWhere the response to the PASS command is routed
[out]cmdDestValue (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]handleThe PA LLD instance identifier
[in]ctrlControl information
[out]cmdWhere the created command is placed
[in,out]cmdSizeInput the size of cmd buffer, on output the actual size used. Command buffer minimum size requirements
[in]replyWhere the sub-system sends the command reply
[out]cmdDestValue (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]cfgConfiguration information
[in]basesArray of the memory buffer base addresses
[out]pHandleInstance 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]iHandleThe driver instance handle
[in]handlePointer to the l2/l3 handle to delete
[out]cmdWhere the created command is placed
[in]cmdSizeThe size of the cmd buffer
[in]replyWhere the sub-system sends the command reply
[out]cmdDestValue (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]iHandleThe driver instance handle
[in,out]handlePointer to the L4 handle to delete
[out]cmdWhere the created command is placed
[in]cmdSizeThe size of the cmd buffer
[in]replyWhere the sub-system sends the reply
[out]cmdDestValue (Command/Transmit Packet Destinations)
Return values:
Value(Function Return Values)
Precondition:
A driver instance must be created and tables initialized
paReturn_t Pa_delVirtualLink ( Pa_Handle  iHandle,
paLnkHandle_t vlinkHdl 
)

Pa_delVirtualLink frees the specified virtual link within the PA instance.

This function is used to remove a virtual link

Parameters:
[in]iHandleThe driver instance handle
[in,out]vlinkHdlPointer to virtual link handle
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]iHandleThe driver instance handle
[in]modIdThe PDSP number (0-5)
[in]imageThe image to download
[in]sizeBytesThe 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]routeSpecifies where the packet is sent after the patch is complete
[in]patchThe patch information
[out]cmdBufferThe routing command is formed in this buffer
[in]cmdSizeOn entry this size of cmdBuffer. On exit the amound of cmdBuffer used
Return values:
Value(Function Return Values)

Pa_formatStatsReply formats the stats reply from the PASS.

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

Parameters:
[in]handleThe driver instance handle
[in]cmdThe buffer returned with the request stats response from PA
Return values:
Apointer 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]nCmdThe number of commands specified
[in]cmdInfoArray of command configuration information
[in]offsetThe command buffer location where the new commands are inserted
[out]cmdBufferBuffer where the sub-system command is created
[in]cmdSizeOn 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]chk0Checksum 0 configuration. NULL if no checksum computation required
[in]chk1Checksum 1 configuration. NULL if no checksum computation required
[in]routeNext packet routing from sub-system
[out]cmdBufferThe routing command is formed in this buffer
[in]cmdSizeOn entry the size of cmdBuffer. On exit the size of the command
Return values:
Value(Function Return Values)
paReturn_t Pa_formatUsrStatsReply ( Pa_Handle  handle,
paCmd_t  cmd,
paUsrStats_t pUsrStats 
)

Pa_formatUsrStatsReply formats the user-defined statistics reply from the PASS.

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

Parameters:
[in]handleThe driver instance handle
[in]cmdThe buffer returned with the request stats response from PA
[out]pUsrStatsPointer to the usrStats buffer
Return values:
Value(Function Return Values)
Precondition:
A call to Pa_requestUsrStats or Pa_requestUsrStatsList with buffer pointer pUsrStats set to NULL and output sent to PA and a reply generated from PA.
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]iHandleThe driver instance handle
[in]vresultThe command reply packet from the sub-system
[out]retHandleReturns the handle associated with the command
[out]handleTypeValue Handle Types
[out]cmdDestValue (Command/Transmit Packet Destinations)
Return values:
Value(Function Return Values)
Precondition:
A driver instance must be created and tables initialized
paReturn_t Pa_freeUsrStats ( Pa_Handle  iHandle,
int  numCnt,
uint16_t *  cntList 
)

Pa_freeUsrStats free a set of user-defined statistics.

This function is called to free a set of user-defined statistics.

Parameters:
[in]iHandleThe driver instance handle
[in]numCntNumber of user-defined statistics to be freed
[in]cntListPointer to list of user-defined statistics to be freed
Return values:
Value(Function Return Values)
Precondition:
A driver instance must be created and tables initialized
Note:
: This function is optional when the application owns the entire set of user-defined statistics or uses a set of pre-allocated user-defined statistics.
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]sizeCfgSize configuration information
[out]sizesArray of size requirements
[out]alignsArray 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]iHandleThe driver instance handle
[in]l2l3handleThe L2 or L3 handle to be queryed
[out]refCountThe 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]iHandleThe driver instance handle
[in]modIdThe PDSP number (0-5)
[out]pVersionThe 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]iHandleThe driver instance handle
[out]pTimestampPointer 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-bitversion 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:
Versionstring
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]iHandleThe driver instance handle
[in]doClearIf TRUE then stats are cleared after being read
[out]cmdBuffer where the sub-system command is created
[in]cmdSizeThe size of the cmd buffer
[in]replyWhere the response of the PASS command is routed
[out]cmdDestValue (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 requests user-defined statistics.

This function is used to request the user-defined statistics from the sub-system. If the buffer pointer (pUsrStats) is provided, the statistics will be formatted and copied to the buffer. However, the statistics will not be autonomous because some related statistics may be updated by the PASS while LLD is reading other statistics. To request autonomous statistics query, set the buffer pointer (pUsrStats) to NULL and LLD will generate the statistics request command packet to be delivered to PASS regardless of doClear setting.

The sub-system statistics can be optionally cleared after query if doClear is set whether or not the buffer pointer is provided. 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]iHandleThe driver instance handle
[in]doClearIf TRUE then stats are cleared after being read
[out]cmdBuffer where the sub-system command is created
[in]cmdSizeThe size of the cmd buffer
[in]replyWhere the response of the PASS command is routed
[out]cmdDestValue (Command/Transmit Packet Destinations)
[out]pUsrStatsPointer to the usrStats buffer
Return values:
Value(Function Return Values)
Precondition:
A driver instance must be created and tables initialized
Note:
This API may be depreciated in the future releases since it can be replaced by API Pa_requestUsrStatsList
paReturn_t Pa_requestUsrStatsList ( Pa_Handle  iHandle,
uint16_t  doClear,
uint16_t  nCnt,
uint16_t *  cntIndex,
paCmd_t  cmd,
uint16_t *  cmdSize,
paCmdReply_t reply,
int *  cmdDest,
paUsrStats_t pUsrStats 
)

Pa_requestUsrStatsList is an advanced version of API Pa_requestUsrStats. It requests user-defined statistics with option to clear entire or a subset of statistics.

This function is used to request the user-defined statistics from the sub-system with option to clear entire or a subset of statistics specified by the list of counters. If the buffer pointer (pUsrStats) is provided, the statistics will be formatted and copied to the buffer. However, the statistics will not be autonomous because some related statistics may be updated by the PASS while LLD is reading other statistics. To request autonomous statistics query, set the buffer pointer (pUsrStats) to NULL and LLD will generate the statistics request command packet to be delivered to PASS regardless of doClear setting.

The sub-system statistics can be optionally cleared after query if doClear is set. In this case the formatted command packet will include the list of counters to be cleared. 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.

Note:
: This function always returns the entire user-defined statistics and it is up to the caller to pick up the interesting ones.
Parameters:
[in]iHandleThe driver instance handle
[in]doClearIf TRUE then stats are cleared after being read
[in]nCntThe number of counters to be cleared
[in]cntIndexArray of counter indexes to be cleared
[out]cmdBuffer where the sub-system command is created
[in]cmdSizeThe size of the cmd buffer
[in]replyWhere the response of the PASS command is routed
[out]cmdDestValue (Command/Transmit Packet Destinations)
[out]pUsrStatsPointer 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]iHandleThe driver instance handle
[in]newStateValue PA Sub-system Queries and States
Return values:
ValuePA 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]iHandleThe driver instance handle
[in]custIndexThe level 3 (LUT1) custom index
[in]parseByteOffsetWhere the PA begins custom match (relative to the L3 start)
[in]nextHdrThe 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]nextHdrOffsetOffset to the next header from the beginning of the custom header
[in]byteMasksThe bitmap of bits in the parse that matter
[out]cmdBuffer where the PASS command is created
[in]cmdSizeOn entry the size of the cmd buffer, on exit the size of the command
[in]replyWhere the response to the PASS command is routed
[out]cmdDestValue (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  custHdrSize,
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 custom LUT2 entry from other custom LUT2 and standard LUT2 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]iHandleDriver instance handle
[in]custIndexLevel 4 (LUT2) custom index
[in]handleLinkSet to TRUE to use one byte of the match to hold previous match info
[in]custHdrSizeSize of fixed-length custom header in bytes, which is used to adjust location of the next protocol header in case the packet needs to be processed by another module such as SASS or host application. This parameter should be set to zero for all other types of headers
[in]byteOffsetsArray of offsets to the bytes to use in custom matching
[in]byteMasksArray of bits that are valid in the custom matching
[in]setMaskBits to be set at the first match byte
[out]cmdBuffer where the command is created
[in]cmdSizeOn entry the size of the cmd buffer, on exit the size of the command
[in]replyWhere the response to the PASS command is routed
[out]cmdDestValue (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]handleThe PA LLD instance identifier
[in]startCfgPA start configuration
Return values:
None

Copyright 2014, Texas Instruments Incorporated