diff options
Diffstat (limited to 'src/v1/pa.c')
-rw-r--r-- | src/v1/pa.c | 304 |
1 files changed, 206 insertions, 98 deletions
diff --git a/src/v1/pa.c b/src/v1/pa.c index a08bf43..7bef36a 100644 --- a/src/v1/pa.c +++ b/src/v1/pa.c | |||
@@ -423,7 +423,57 @@ static int pa_verify_usr_stats(paInst_t *paInst, int32_t cntIndex, int fCache) | |||
423 | } | 423 | } |
424 | return (ret); | 424 | return (ret); |
425 | } /* pa_verify_usr_stats */ | 425 | } /* pa_verify_usr_stats */ |
426 | 426 | ||
427 | /******************************************************************************************* | ||
428 | * FUNCTION PURPOSE: Derive the destination queue Id | ||
429 | ******************************************************************************************* | ||
430 | * DESCRIPTION: This function is used to derive the destination queue Id with the embedded | ||
431 | * control bits based on the input queue Id, the Queue Bounce configuration | ||
432 | * and the traffic class associated with the originated API. | ||
433 | * | ||
434 | * return queueId with embedded control bits | ||
435 | * | ||
436 | ********************************************************************************************/ | ||
437 | static uint16_t pa_convert_queue_id(paInst_t *paInst, int routingClass, uint16_t queue) | ||
438 | { | ||
439 | paQueueBounceConfig_t* pQueueBounceCfg = &paInst->cfg.queueBounceConfig; | ||
440 | uint16_t queueBounceCtrlType = queue >> pa_QUEUE_BOUNCE_CTRL_LOC; | ||
441 | uint16_t queueNum = queue & pa_QUEUE_BOUNCE_QUEUE_MASK; | ||
442 | |||
443 | if (!pQueueBounceCfg->enable) | ||
444 | { | ||
445 | return(queueNum); | ||
446 | } | ||
447 | |||
448 | if ((queueNum >= pQueueBounceCfg->hwQueueBegin) && | ||
449 | (queueNum <= pQueueBounceCfg->hwQueueEnd)) | ||
450 | { | ||
451 | /* It is a hardware queue, queue bounce is not required */ | ||
452 | return(queueNum); | ||
453 | } | ||
454 | |||
455 | if (queueBounceCtrlType == pa_QUEUE_BOUNCE_CTRL_DEFAULT) | ||
456 | { | ||
457 | /* | ||
458 | * Error check is not required here because routingClass is set by internal | ||
459 | * function and the range check of default operation mode has been performed | ||
460 | * at Queue Bounce Configuration time | ||
461 | */ | ||
462 | uint16_t defOp = pQueueBounceCfg->defOp[routingClass]; | ||
463 | |||
464 | return(queueNum | (defOp << pa_QUEUE_BOUNCE_CTRL_LOC)); | ||
465 | } | ||
466 | else if ((queueBounceCtrlType == pa_QUEUE_BOUNCE_CTRL_DDR) || | ||
467 | (queueBounceCtrlType == pa_QUEUE_BOUNCE_CTRL_MSMC)) | ||
468 | { | ||
469 | return(queue); | ||
470 | } | ||
471 | else /* pa_QUEUE_BOUNCE_CTRL_NONE */ | ||
472 | { | ||
473 | return(queueNum); | ||
474 | } | ||
475 | } | ||
476 | |||
427 | /************************************************************************* | 477 | /************************************************************************* |
428 | * FUNCTION PURPOSE: Convert RouteInfo | 478 | * FUNCTION PURPOSE: Convert RouteInfo |
429 | ************************************************************************* | 479 | ************************************************************************* |
@@ -666,7 +716,7 @@ static void pa_format_lut2ParamDesc(paLut2ParamDesc *params, | |||
666 | * firmware forward information | 716 | * firmware forward information |
667 | * Returns FALSE if error occurs | 717 | * Returns FALSE if error occurs |
668 | *************************************************************************/ | 718 | *************************************************************************/ |
669 | static paReturn_t pa_conv_routing_info2 (paInst_t *paInst, pafrmForward_t *fwdInfo, paRouteInfo2_t *routeInfo, int cmdDest, uint16_t failRoute, uint16_t destPdsp, uint8_t paFlags) | 719 | static paReturn_t pa_conv_routing_info2 (paInst_t *paInst, pafrmForward_t *fwdInfo, paRouteInfo2_t *routeInfo, int cmdDest, uint16_t failRoute, uint16_t destPdsp, uint8_t paFlags, int routingClass) |
670 | { | 720 | { |
671 | 721 | ||
672 | /* | 722 | /* |
@@ -680,9 +730,7 @@ static paReturn_t pa_conv_routing_info2 (paInst_t *paInst, pafrmForward_t *fwdIn | |||
680 | uint8_t psFlags = 0; | 730 | uint8_t psFlags = 0; |
681 | uint8_t *pCmd = fwdInfo->u.host.cmd; | 731 | uint8_t *pCmd = fwdInfo->u.host.cmd; |
682 | int fcmdSetNotSupport = FALSE; | 732 | int fcmdSetNotSupport = FALSE; |
683 | 733 | uint16_t queue = routeInfo->queue; | |
684 | fwdInfo->flowId = routeInfo->flowId; | ||
685 | fwdInfo->queue = SWIZ(routeInfo->queue); | ||
686 | 734 | ||
687 | if ((routeInfo->dest == pa_DEST_HOST) || (routeInfo->dest == pa_DEST_EMAC)) { | 735 | if ((routeInfo->dest == pa_DEST_HOST) || (routeInfo->dest == pa_DEST_EMAC)) { |
688 | if (routeInfo->validBitMap & pa_ROUTE_INFO_VALID_PKTTYPE_EMAC) | 736 | if (routeInfo->validBitMap & pa_ROUTE_INFO_VALID_PKTTYPE_EMAC) |
@@ -703,10 +751,12 @@ static paReturn_t pa_conv_routing_info2 (paInst_t *paInst, pafrmForward_t *fwdIn | |||
703 | if(routeInfo->priorityType == pa_ROUTE_PRIORITY_VLAN) | 751 | if(routeInfo->priorityType == pa_ROUTE_PRIORITY_VLAN) |
704 | { | 752 | { |
705 | fwdInfo->u.host.ctrlBitMap |= PAFRM_ROUTING_PRIORITY_VLAN_ENABLE; | 753 | fwdInfo->u.host.ctrlBitMap |= PAFRM_ROUTING_PRIORITY_VLAN_ENABLE; |
754 | routingClass = pa_QUEUE_BOUNCE_ROUTING_CLASS_QoS; | ||
706 | } | 755 | } |
707 | else if(routeInfo->priorityType == pa_ROUTE_PRIORITY_DSCP) | 756 | else if(routeInfo->priorityType == pa_ROUTE_PRIORITY_DSCP) |
708 | { | 757 | { |
709 | fwdInfo->u.host.ctrlBitMap |= PAFRM_ROUTING_PRIORITY_DSCP_ENABLE; | 758 | fwdInfo->u.host.ctrlBitMap |= PAFRM_ROUTING_PRIORITY_DSCP_ENABLE; |
759 | routingClass = pa_QUEUE_BOUNCE_ROUTING_CLASS_QoS; | ||
710 | } | 760 | } |
711 | else if (routeInfo->priorityType == pa_ROUTE_INTF) | 761 | else if (routeInfo->priorityType == pa_ROUTE_INTF) |
712 | { | 762 | { |
@@ -728,6 +778,7 @@ static paReturn_t pa_conv_routing_info2 (paInst_t *paInst, pafrmForward_t *fwdIn | |||
728 | 778 | ||
729 | fwdInfo->u.host.ctrlBitMap |= (PAFRM_ROUTING_IF_DEST_SELECT_ENABLE | | 779 | fwdInfo->u.host.ctrlBitMap |= (PAFRM_ROUTING_IF_DEST_SELECT_ENABLE | |
730 | PAFRM_ROUTING_FLOW_EQOS_IF_ENABLE); | 780 | PAFRM_ROUTING_FLOW_EQOS_IF_ENABLE); |
781 | routingClass = pa_QUEUE_BOUNCE_ROUTING_CLASS_QoS; | ||
731 | } | 782 | } |
732 | else | 783 | else |
733 | { | 784 | { |
@@ -735,6 +786,8 @@ static paReturn_t pa_conv_routing_info2 (paInst_t *paInst, pafrmForward_t *fwdIn | |||
735 | } | 786 | } |
736 | } | 787 | } |
737 | 788 | ||
789 | queue = pa_convert_queue_id(paInst, routingClass, queue); | ||
790 | |||
738 | if (routeInfo->validBitMap & pa_ROUTE_INFO_VALID_MROUTEINDEX) { | 791 | if (routeInfo->validBitMap & pa_ROUTE_INFO_VALID_MROUTEINDEX) { |
739 | if (routeInfo->mRouteIndex >= pa_MAX_MULTI_ROUTE_SETS) { | 792 | if (routeInfo->mRouteIndex >= pa_MAX_MULTI_ROUTE_SETS) { |
740 | return (pa_ERR_CONFIG); | 793 | return (pa_ERR_CONFIG); |
@@ -865,6 +918,9 @@ static paReturn_t pa_conv_routing_info2 (paInst_t *paInst, pafrmForward_t *fwdIn | |||
865 | return (pa_ERR_CONFIG); | 918 | return (pa_ERR_CONFIG); |
866 | } | 919 | } |
867 | 920 | ||
921 | fwdInfo->flowId = routeInfo->flowId; | ||
922 | fwdInfo->queue = SWIZ(queue); | ||
923 | |||
868 | if (pCmd && (routeInfo->validBitMap & pa_ROUTE_INFO_VALID_PCMD)) { | 924 | if (pCmd && (routeInfo->validBitMap & pa_ROUTE_INFO_VALID_PCMD)) { |
869 | 925 | ||
870 | paCmdInfo_t* paCmd = routeInfo->pCmd; | 926 | paCmdInfo_t* paCmd = routeInfo->pCmd; |
@@ -941,13 +997,13 @@ static paReturn_t pa_conv_routing_info2 (paInst_t *paInst, pafrmForward_t *fwdIn | |||
941 | * firmware forward information | 997 | * firmware forward information |
942 | * Returns FALSE if error occurs | 998 | * Returns FALSE if error occurs |
943 | *************************************************************************/ | 999 | *************************************************************************/ |
944 | static paReturn_t pa_conv_routing_info (paInst_t *paInst, pafrmForward_t *fwdInfo, paRouteInfo_t *routeInfo, int cmdDest, uint16_t failRoute, uint16_t destPdsp) | 1000 | static paReturn_t pa_conv_routing_info (paInst_t *paInst, pafrmForward_t *fwdInfo, paRouteInfo_t *routeInfo, int cmdDest, uint16_t failRoute, uint16_t destPdsp, int routingClass) |
945 | { | 1001 | { |
946 | paRouteInfo2_t routeInfo2; | 1002 | paRouteInfo2_t routeInfo2; |
947 | 1003 | ||
948 | pa_convert_routeInfo_to_routeInfo2(routeInfo, &routeInfo2); | 1004 | pa_convert_routeInfo_to_routeInfo2(routeInfo, &routeInfo2); |
949 | 1005 | ||
950 | return(pa_conv_routing_info2(paInst, fwdInfo, &routeInfo2, cmdDest, failRoute, destPdsp, 0)); | 1006 | return(pa_conv_routing_info2(paInst, fwdInfo, &routeInfo2, cmdDest, failRoute, destPdsp, 0, routingClass)); |
951 | 1007 | ||
952 | } /* pa_conv_routing_info */ | 1008 | } /* pa_conv_routing_info */ |
953 | 1009 | ||
@@ -1075,7 +1131,7 @@ static paReturn_t pa_set_emac_port_cfg_frm_cmd( | |||
1075 | { | 1131 | { |
1076 | /* Obtain the information from the configuration */ | 1132 | /* Obtain the information from the configuration */ |
1077 | capturePort = pktCapCfg[i].portToBeCaptured; | 1133 | capturePort = pktCapCfg[i].portToBeCaptured; |
1078 | queue = pktCapCfg[i].queue; | 1134 | queue = pa_convert_queue_id(paInst, pa_QUEUE_BOUNCE_ROUTING_CLASS_CAPTURE, pktCapCfg[i].queue); |
1079 | flow = pktCapCfg[i].flowId; | 1135 | flow = pktCapCfg[i].flowId; |
1080 | swInfo0 = pktCapCfg[i].swInfo0; | 1136 | swInfo0 = pktCapCfg[i].swInfo0; |
1081 | 1137 | ||
@@ -1208,7 +1264,7 @@ static paReturn_t pa_set_emac_port_cfg_frm_cmd( | |||
1208 | /* store multi cast default route information if enabled */ | 1264 | /* store multi cast default route information if enabled */ |
1209 | if (ctrlBitMap & pa_EMAC_IF_DEFAULT_ROUTE_MC_ENABLE) | 1265 | if (ctrlBitMap & pa_EMAC_IF_DEFAULT_ROUTE_MC_ENABLE) |
1210 | { | 1266 | { |
1211 | retCode = pa_conv_routing_info2 (paInst, &pDefRoutefrmCfg->routeCfg[i].dRoute[pa_DROUTE_MULTICAST], &pDefRouteCfg[i].dRouteInfo[pa_DROUTE_MULTICAST], pa_CMD_TX_DEST_0, TRUE, 0, 0); | 1267 | retCode = pa_conv_routing_info2 (paInst, &pDefRoutefrmCfg->routeCfg[i].dRoute[pa_DROUTE_MULTICAST], &pDefRouteCfg[i].dRouteInfo[pa_DROUTE_MULTICAST], pa_CMD_TX_DEST_0, TRUE, 0, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
1212 | /* Error checking */ | 1268 | /* Error checking */ |
1213 | if (retCode != pa_OK) | 1269 | if (retCode != pa_OK) |
1214 | return (retCode); | 1270 | return (retCode); |
@@ -1216,7 +1272,7 @@ static paReturn_t pa_set_emac_port_cfg_frm_cmd( | |||
1216 | /* Store broad cast default route information if enabled */ | 1272 | /* Store broad cast default route information if enabled */ |
1217 | if (ctrlBitMap & pa_EMAC_IF_DEFAULT_ROUTE_BC_ENABLE) | 1273 | if (ctrlBitMap & pa_EMAC_IF_DEFAULT_ROUTE_BC_ENABLE) |
1218 | { | 1274 | { |
1219 | retCode = pa_conv_routing_info2 (paInst, &pDefRoutefrmCfg->routeCfg[i].dRoute[pa_DROUTE_BROADCAST], &pDefRouteCfg[i].dRouteInfo[pa_DROUTE_BROADCAST], pa_CMD_TX_DEST_0, TRUE, 0, 0); | 1275 | retCode = pa_conv_routing_info2 (paInst, &pDefRoutefrmCfg->routeCfg[i].dRoute[pa_DROUTE_BROADCAST], &pDefRouteCfg[i].dRouteInfo[pa_DROUTE_BROADCAST], pa_CMD_TX_DEST_0, TRUE, 0, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
1220 | /* Error checking */ | 1276 | /* Error checking */ |
1221 | if (retCode != pa_OK) | 1277 | if (retCode != pa_OK) |
1222 | return (retCode); | 1278 | return (retCode); |
@@ -1224,7 +1280,7 @@ static paReturn_t pa_set_emac_port_cfg_frm_cmd( | |||
1224 | 1280 | ||
1225 | if (ctrlBitMap & pa_EMAC_IF_DEFAULT_ROUTE_UC_ENABLE) | 1281 | if (ctrlBitMap & pa_EMAC_IF_DEFAULT_ROUTE_UC_ENABLE) |
1226 | { | 1282 | { |
1227 | retCode = pa_conv_routing_info2 (paInst, &pDefRoutefrmCfg->routeCfg[i].dRoute[pa_DROUTE_NO_MATCH], &pDefRouteCfg[i].dRouteInfo[pa_DROUTE_NO_MATCH], pa_CMD_TX_DEST_0, TRUE, 0, 0); | 1283 | retCode = pa_conv_routing_info2 (paInst, &pDefRoutefrmCfg->routeCfg[i].dRoute[pa_DROUTE_NO_MATCH], &pDefRouteCfg[i].dRouteInfo[pa_DROUTE_NO_MATCH], pa_CMD_TX_DEST_0, TRUE, 0, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
1228 | /* Error checking */ | 1284 | /* Error checking */ |
1229 | if (retCode != pa_OK) | 1285 | if (retCode != pa_OK) |
1230 | return (retCode); | 1286 | return (retCode); |
@@ -1315,7 +1371,7 @@ static paReturn_t pa_set_emac_port_cfg_frm_cmd( | |||
1315 | * DESCRIPTION: Clear and construct the firmware command header | 1371 | * DESCRIPTION: Clear and construct the firmware command header |
1316 | * Returns pointer to the firmware command | 1372 | * Returns pointer to the firmware command |
1317 | *************************************************************************/ | 1373 | *************************************************************************/ |
1318 | static pafrmCommand_t* pa_format_fcmd_header (void *pCmd, paCmdReply_t *reply, uint8_t cmd, uint16_t comId, uint8_t firstPdsp, uint16_t cmdSize) | 1374 | static pafrmCommand_t* pa_format_fcmd_header (paInst_t *paInst, void *pCmd, paCmdReply_t *reply, uint8_t cmd, uint16_t comId, uint8_t firstPdsp, uint16_t cmdSize) |
1319 | { | 1375 | { |
1320 | pafrmCommand_t *fcmd = (pafrmCommand_t *) pCmd; | 1376 | pafrmCommand_t *fcmd = (pafrmCommand_t *) pCmd; |
1321 | 1377 | ||
@@ -1327,7 +1383,7 @@ static pafrmCommand_t* pa_format_fcmd_header (void *pCmd, paCmdReply_t *reply, u | |||
1327 | fcmd->magic = PAFRM_CONFIG_COMMAND_SEC_BYTE; | 1383 | fcmd->magic = PAFRM_CONFIG_COMMAND_SEC_BYTE; |
1328 | fcmd->comId = SWIZ(comId); | 1384 | fcmd->comId = SWIZ(comId); |
1329 | fcmd->retContext = SWIZ(reply->replyId); | 1385 | fcmd->retContext = SWIZ(reply->replyId); |
1330 | fcmd->replyQueue = SWIZ(reply->queue); | 1386 | fcmd->replyQueue = SWIZ(pa_convert_queue_id(paInst, pa_QUEUE_BOUNCE_ROUTING_CLASS_CMD_RET, reply->queue)); |
1331 | fcmd->flowId = SWIZ(reply->flowId); | 1387 | fcmd->flowId = SWIZ(reply->flowId); |
1332 | 1388 | ||
1333 | return(fcmd); | 1389 | return(fcmd); |
@@ -2086,7 +2142,7 @@ Pa_addMac2_send_cmd: | |||
2086 | *handle = (paLnkHandle_t)pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,&l2Table[i]); | 2142 | *handle = (paLnkHandle_t)pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,&l2Table[i]); |
2087 | 2143 | ||
2088 | /* Create the command */ | 2144 | /* Create the command */ |
2089 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_L2 | i, 0, csize); | 2145 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_L2 | i, 0, csize); |
2090 | 2146 | ||
2091 | /* Validity of the destination was already checked (HOST), so no other cases | 2147 | /* Validity of the destination was already checked (HOST), so no other cases |
2092 | * must be considered */ | 2148 | * must be considered */ |
@@ -2192,14 +2248,14 @@ Pa_addMac2_send_cmd: | |||
2192 | al1->bitMask = SWIZ(bitMask); | 2248 | al1->bitMask = SWIZ(bitMask); |
2193 | 2249 | ||
2194 | /* Forwarding information */ | 2250 | /* Forwarding information */ |
2195 | ret1 = pa_conv_routing_info2(paInst, &al1->match, routeInfo, pa_CMD_TX_DEST_0, FALSE, 0, 0); | 2251 | ret1 = pa_conv_routing_info2(paInst, &al1->match, routeInfo, pa_CMD_TX_DEST_0, FALSE, 0, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
2196 | if (ret1 != pa_OK) { | 2252 | if (ret1 != pa_OK) { |
2197 | ret = ret1; | 2253 | ret = ret1; |
2198 | goto Pa_addMac2_end; | 2254 | goto Pa_addMac2_end; |
2199 | } | 2255 | } |
2200 | 2256 | ||
2201 | /* Next fail information */ | 2257 | /* Next fail information */ |
2202 | ret1 = pa_conv_routing_info2(paInst, &al1->nextFail, nextRtFail, pa_CMD_TX_DEST_0, TRUE, 0, 0); | 2258 | ret1 = pa_conv_routing_info2(paInst, &al1->nextFail, nextRtFail, pa_CMD_TX_DEST_0, TRUE, 0, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
2203 | if (ret1 != pa_OK) { | 2259 | if (ret1 != pa_OK) { |
2204 | ret = ret1; | 2260 | ret = ret1; |
2205 | goto Pa_addMac2_end; | 2261 | goto Pa_addMac2_end; |
@@ -2500,7 +2556,7 @@ Pa_addSrio_send_cmd: | |||
2500 | *handle = (paHandleL2L3_t)pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,&l2Table[i]); | 2556 | *handle = (paHandleL2L3_t)pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,&l2Table[i]); |
2501 | 2557 | ||
2502 | /* Create the command */ | 2558 | /* Create the command */ |
2503 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_L2 | i, 0, csize); | 2559 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_L2 | i, 0, csize); |
2504 | 2560 | ||
2505 | /* Validity of the destination was already checked (HOST), so no other cases | 2561 | /* Validity of the destination was already checked (HOST), so no other cases |
2506 | * must be considered */ | 2562 | * must be considered */ |
@@ -2574,14 +2630,14 @@ Pa_addSrio_send_cmd: | |||
2574 | al1->bitMask = SWIZ(bitMask); | 2630 | al1->bitMask = SWIZ(bitMask); |
2575 | 2631 | ||
2576 | /* Forwarding information */ | 2632 | /* Forwarding information */ |
2577 | ret1 = pa_conv_routing_info(paInst, &al1->match, routeInfo, pa_CMD_TX_DEST_0, FALSE, 0); | 2633 | ret1 = pa_conv_routing_info(paInst, &al1->match, routeInfo, pa_CMD_TX_DEST_0, FALSE, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
2578 | if (ret1 != pa_OK) { | 2634 | if (ret1 != pa_OK) { |
2579 | ret = ret1; | 2635 | ret = ret1; |
2580 | goto Pa_addSrio_end; | 2636 | goto Pa_addSrio_end; |
2581 | } | 2637 | } |
2582 | 2638 | ||
2583 | /* Next fail information */ | 2639 | /* Next fail information */ |
2584 | ret1 = pa_conv_routing_info(paInst, &al1->nextFail, nextRtFail, pa_CMD_TX_DEST_0, TRUE, 0); | 2640 | ret1 = pa_conv_routing_info(paInst, &al1->nextFail, nextRtFail, pa_CMD_TX_DEST_0, TRUE, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
2585 | if (ret != pa_OK) { | 2641 | if (ret != pa_OK) { |
2586 | ret = ret1; | 2642 | ret = ret1; |
2587 | goto Pa_addSrio_end; | 2643 | goto Pa_addSrio_end; |
@@ -2756,7 +2812,7 @@ paReturn_t Pa_delHandle (Pa_Handle iHandle, | |||
2756 | /* Create the command */ | 2812 | /* Create the command */ |
2757 | if (fDelLnk) | 2813 | if (fDelLnk) |
2758 | { | 2814 | { |
2759 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_MULTI_CMDS, 0, pdsp, csize); | 2815 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_MULTI_CMDS, 0, pdsp, csize); |
2760 | cmdHdr = (pafrmCommandCmdHdr_t *) &(fcmd->cmd); | 2816 | cmdHdr = (pafrmCommandCmdHdr_t *) &(fcmd->cmd); |
2761 | cmdHdr->command = PAFRM_CONFIG_COMMAND_DEL_LUT1; | 2817 | cmdHdr->command = PAFRM_CONFIG_COMMAND_DEL_LUT1; |
2762 | cmdHdr->offset = sizeof(pafrmCommand_t)+sizeof(pafrmCommandDelLut1_t)+sizeof(pafrmCommandCmdHdr_t)-sizeof(uint32_t); | 2818 | cmdHdr->offset = sizeof(pafrmCommand_t)+sizeof(pafrmCommandDelLut1_t)+sizeof(pafrmCommandCmdHdr_t)-sizeof(uint32_t); |
@@ -2768,7 +2824,7 @@ paReturn_t Pa_delHandle (Pa_Handle iHandle, | |||
2768 | } | 2824 | } |
2769 | else | 2825 | else |
2770 | { | 2826 | { |
2771 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_DEL_LUT1, comId, pdsp, csize); | 2827 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_DEL_LUT1, comId, pdsp, csize); |
2772 | del = (pafrmCommandDelLut1_t *)&(fcmd->cmd); | 2828 | del = (pafrmCommandDelLut1_t *)&(fcmd->cmd); |
2773 | del->index = SWIZ((uint16_t)hdr->lutIdx); | 2829 | del->index = SWIZ((uint16_t)hdr->lutIdx); |
2774 | } | 2830 | } |
@@ -2926,7 +2982,7 @@ paReturn_t Pa_delAclHandle (Pa_Handle iHandle, | |||
2926 | } | 2982 | } |
2927 | 2983 | ||
2928 | /* Create the command */ | 2984 | /* Create the command */ |
2929 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_DEL_LUT1, comId, pdsp, csize); | 2985 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_DEL_LUT1, comId, pdsp, csize); |
2930 | del = (pafrmCommandDelLut1_t *)&(fcmd->cmd); | 2986 | del = (pafrmCommandDelLut1_t *)&(fcmd->cmd); |
2931 | del->index = SWIZ((uint16_t) hdr->lutIdx); | 2987 | del->index = SWIZ((uint16_t) hdr->lutIdx); |
2932 | 2988 | ||
@@ -3032,7 +3088,7 @@ paReturn_t Pa_delEoamHandle (Pa_Handle iHandle, | |||
3032 | } | 3088 | } |
3033 | 3089 | ||
3034 | /* Create the command */ | 3090 | /* Create the command */ |
3035 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_DEL_LUT1, comId, pdsp, csize); | 3091 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_DEL_LUT1, comId, pdsp, csize); |
3036 | del = (pafrmCommandDelLut1_t *)&(fcmd->cmd); | 3092 | del = (pafrmCommandDelLut1_t *)&(fcmd->cmd); |
3037 | del->index = SWIZ((uint16_t) hdr->lutIdx); | 3093 | del->index = SWIZ((uint16_t) hdr->lutIdx); |
3038 | 3094 | ||
@@ -3123,7 +3179,7 @@ paReturn_t Pa_delFcHandle (Pa_Handle iHandle, | |||
3123 | *cmdDest = pa_CMD_TX_DEST_6; | 3179 | *cmdDest = pa_CMD_TX_DEST_6; |
3124 | 3180 | ||
3125 | /* Create the command */ | 3181 | /* Create the command */ |
3126 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_DEL_LUT1, comId, 0, csize); | 3182 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_DEL_LUT1, comId, 0, csize); |
3127 | del = (pafrmCommandDelLut1_t *)&(fcmd->cmd); | 3183 | del = (pafrmCommandDelLut1_t *)&(fcmd->cmd); |
3128 | del->index = SWIZ((uint16_t) hdr->lutIdx); | 3184 | del->index = SWIZ((uint16_t) hdr->lutIdx); |
3129 | 3185 | ||
@@ -4111,7 +4167,7 @@ Pa_addIp2_send_cmd: | |||
4111 | /* Create the command */ | 4167 | /* Create the command */ |
4112 | if (fl3Entry2) | 4168 | if (fl3Entry2) |
4113 | { | 4169 | { |
4114 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_MULTI_CMDS, 0, 0, csize); | 4170 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_MULTI_CMDS, 0, 0, csize); |
4115 | cmdHdr = (pafrmCommandCmdHdr_t *) &(fcmd->cmd); | 4171 | cmdHdr = (pafrmCommandCmdHdr_t *) &(fcmd->cmd); |
4116 | cmdHdr->command = PAFRM_CONFIG_COMMAND_ADDREP_LUT1; | 4172 | cmdHdr->command = PAFRM_CONFIG_COMMAND_ADDREP_LUT1; |
4117 | cmdHdr->offset = sizeof(pafrmCommand_t)+sizeof(pafrmCommandAddLut1_t)+sizeof(pafrmCommandCmdHdr_t)-sizeof(uint32_t); | 4173 | cmdHdr->offset = sizeof(pafrmCommand_t)+sizeof(pafrmCommandAddLut1_t)+sizeof(pafrmCommandCmdHdr_t)-sizeof(uint32_t); |
@@ -4123,7 +4179,7 @@ Pa_addIp2_send_cmd: | |||
4123 | } | 4179 | } |
4124 | else | 4180 | else |
4125 | { | 4181 | { |
4126 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_L3 | i, firstPdsp, csize); | 4182 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_L3 | i, firstPdsp, csize); |
4127 | al1 = (pafrmCommandAddLut1_t *) &(fcmd->cmd); | 4183 | al1 = (pafrmCommandAddLut1_t *) &(fcmd->cmd); |
4128 | } | 4184 | } |
4129 | 4185 | ||
@@ -4319,14 +4375,14 @@ Pa_addIp2_send_cmd: | |||
4319 | nfRoute = nextRtFail; | 4375 | nfRoute = nextRtFail; |
4320 | } | 4376 | } |
4321 | 4377 | ||
4322 | ret1 = pa_conv_routing_info2(paInst, &al1->match, mRoute, *cmdDest, FALSE, firstPdsp, 0); | 4378 | ret1 = pa_conv_routing_info2(paInst, &al1->match, mRoute, *cmdDest, FALSE, firstPdsp, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
4323 | if (ret1 != pa_OK) { | 4379 | if (ret1 != pa_OK) { |
4324 | ret = ret1; | 4380 | ret = ret1; |
4325 | goto Pa_addIp2_end; | 4381 | goto Pa_addIp2_end; |
4326 | } | 4382 | } |
4327 | 4383 | ||
4328 | /* Next fail information */ | 4384 | /* Next fail information */ |
4329 | ret1 = pa_conv_routing_info2(paInst, &al1->nextFail, nfRoute, *cmdDest, TRUE, firstPdsp, 0); | 4385 | ret1 = pa_conv_routing_info2(paInst, &al1->nextFail, nfRoute, *cmdDest, TRUE, firstPdsp, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
4330 | if (ret1 != pa_OK) { | 4386 | if (ret1 != pa_OK) { |
4331 | ret = ret1; | 4387 | ret = ret1; |
4332 | goto Pa_addIp2_end; | 4388 | goto Pa_addIp2_end; |
@@ -4395,14 +4451,14 @@ Pa_addIp2_send_cmd: | |||
4395 | al1->CBWords1 = SWIZ(CBWords1); | 4451 | al1->CBWords1 = SWIZ(CBWords1); |
4396 | al1->priority = SWIZ(priority); | 4452 | al1->priority = SWIZ(priority); |
4397 | 4453 | ||
4398 | ret1 = pa_conv_routing_info2(paInst, &al1->match, routeInfo, *cmdDest, FALSE, 1, 0); | 4454 | ret1 = pa_conv_routing_info2(paInst, &al1->match, routeInfo, *cmdDest, FALSE, 1, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
4399 | if (ret1 != pa_OK) { | 4455 | if (ret1 != pa_OK) { |
4400 | ret = ret1; | 4456 | ret = ret1; |
4401 | goto Pa_addIp2_end; | 4457 | goto Pa_addIp2_end; |
4402 | } | 4458 | } |
4403 | 4459 | ||
4404 | /* Next fail information */ | 4460 | /* Next fail information */ |
4405 | ret1 = pa_conv_routing_info2(paInst, &al1->nextFail, nextRtFail, *cmdDest, TRUE, 1, 0); | 4461 | ret1 = pa_conv_routing_info2(paInst, &al1->nextFail, nextRtFail, *cmdDest, TRUE, 1, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
4406 | if (ret1 != pa_OK) { | 4462 | if (ret1 != pa_OK) { |
4407 | ret = ret1; | 4463 | ret = ret1; |
4408 | goto Pa_addIp2_end; | 4464 | goto Pa_addIp2_end; |
@@ -4590,7 +4646,7 @@ Pa_addEoamFlow_send_cmd: | |||
4590 | *handle = (paHandleEoam_t)pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,&eoamTable[i]); | 4646 | *handle = (paHandleEoam_t)pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,&eoamTable[i]); |
4591 | 4647 | ||
4592 | /* Create the command */ | 4648 | /* Create the command */ |
4593 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_EOAM | i, 1, csize); | 4649 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_EOAM | i, 1, csize); |
4594 | 4650 | ||
4595 | /* Validity of the destination was already checked (HOST), so no other cases | 4651 | /* Validity of the destination was already checked (HOST), so no other cases |
4596 | * must be considered */ | 4652 | * must be considered */ |
@@ -5020,7 +5076,7 @@ paReturn_t Pa_addAcl (Pa_Handle iHandle, | |||
5020 | *retHandle = (paHandleAcl_t)pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,&(aclTable[i])); | 5076 | *retHandle = (paHandleAcl_t)pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,&(aclTable[i])); |
5021 | 5077 | ||
5022 | /* Create the command */ | 5078 | /* Create the command */ |
5023 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_ACL | i, firstPdsp, csize); | 5079 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_ACL | i, firstPdsp, csize); |
5024 | al1 = (pafrmCommandAddLut1_t *) &(fcmd->cmd); | 5080 | al1 = (pafrmCommandAddLut1_t *) &(fcmd->cmd); |
5025 | 5081 | ||
5026 | /* Validity of the destination was already checked (HOST), so no other cases | 5082 | /* Validity of the destination was already checked (HOST), so no other cases |
@@ -5210,8 +5266,8 @@ paReturn_t Pa_addAcl (Pa_Handle iHandle, | |||
5210 | } | 5266 | } |
5211 | 5267 | ||
5212 | /* Insert the entry to the Link List */ | 5268 | /* Insert the entry to the Link List */ |
5213 | ret1 = pa_insert_entry(listElemTable, paInst->nAcl, listInfoTable, insertMode, | 5269 | ret1 = pa_insert_entry(listElemTable, paInst->nAcl, listInfoTable, insertMode, |
5214 | (paHandleAcl_t) (nextEntry?pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,nextEntry):0), | 5270 | nextEntry?(paHandleAcl_t)pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,nextEntry):0, |
5215 | i, &priority, *retHandle); | 5271 | i, &priority, *retHandle); |
5216 | 5272 | ||
5217 | if (ret1 != pa_OK) { | 5273 | if (ret1 != pa_OK) { |
@@ -5269,14 +5325,14 @@ paReturn_t Pa_addAcl (Pa_Handle iHandle, | |||
5269 | 5325 | ||
5270 | nfRoute = &pauFailRoute; | 5326 | nfRoute = &pauFailRoute; |
5271 | 5327 | ||
5272 | ret1 = pa_conv_routing_info2(paInst, &al1->match, mRoute, *cmdDest, FALSE, firstPdsp, paFlags); | 5328 | ret1 = pa_conv_routing_info2(paInst, &al1->match, mRoute, *cmdDest, FALSE, firstPdsp, paFlags, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
5273 | if (ret1 != pa_OK) { | 5329 | if (ret1 != pa_OK) { |
5274 | ret = ret1; | 5330 | ret = ret1; |
5275 | goto Pa_addAcl_end; | 5331 | goto Pa_addAcl_end; |
5276 | } | 5332 | } |
5277 | 5333 | ||
5278 | /* Next fail information */ | 5334 | /* Next fail information */ |
5279 | ret1 = pa_conv_routing_info2(paInst, &al1->nextFail, nfRoute, *cmdDest, TRUE, firstPdsp, 0); | 5335 | ret1 = pa_conv_routing_info2(paInst, &al1->nextFail, nfRoute, *cmdDest, TRUE, firstPdsp, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
5280 | if (ret1 != pa_OK) { | 5336 | if (ret1 != pa_OK) { |
5281 | ret = ret1; | 5337 | ret = ret1; |
5282 | goto Pa_addAcl_end; | 5338 | goto Pa_addAcl_end; |
@@ -5538,7 +5594,7 @@ Pa_addFc_send_cmd: | |||
5538 | *retHandle = (paHandleFc_t)pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,&(fcTable[i])); | 5594 | *retHandle = (paHandleFc_t)pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,&(fcTable[i])); |
5539 | 5595 | ||
5540 | /* Create the command */ | 5596 | /* Create the command */ |
5541 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_FC | i, 0, csize); | 5597 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_FC | i, 0, csize); |
5542 | al1 = (pafrmCommandAddLut1_t *) &(fcmd->cmd); | 5598 | al1 = (pafrmCommandAddLut1_t *) &(fcmd->cmd); |
5543 | 5599 | ||
5544 | /* Validity of the destination was already checked (HOST), so no other cases | 5600 | /* Validity of the destination was already checked (HOST), so no other cases |
@@ -5929,7 +5985,7 @@ paReturn_t Pa_addPort2 (Pa_Handle iHandle, | |||
5929 | } | 5985 | } |
5930 | 5986 | ||
5931 | /* Create the command */ | 5987 | /* Create the command */ |
5932 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT2, 0, 1, csize); | 5988 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT2, 0, 1, csize); |
5933 | 5989 | ||
5934 | /* Validity of the destination was already checked (HOST), so no other cases | 5990 | /* Validity of the destination was already checked (HOST), so no other cases |
5935 | * must be considered */ | 5991 | * must be considered */ |
@@ -5981,7 +6037,7 @@ paReturn_t Pa_addPort2 (Pa_Handle iHandle, | |||
5981 | al2->ctrlBitMap = SWIZ(al2->ctrlBitMap); | 6037 | al2->ctrlBitMap = SWIZ(al2->ctrlBitMap); |
5982 | 6038 | ||
5983 | /* Forwarding information */ | 6039 | /* Forwarding information */ |
5984 | ret1 = pa_conv_routing_info2(paInst, &al2->match, routeInfo, pa_CMD_TX_DEST_4, FALSE, 1, 0); | 6040 | ret1 = pa_conv_routing_info2(paInst, &al2->match, routeInfo, pa_CMD_TX_DEST_4, FALSE, 1, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
5985 | if (ret1 != pa_OK) { | 6041 | if (ret1 != pa_OK) { |
5986 | ret = ret1; | 6042 | ret = ret1; |
5987 | goto Pa_addPort_end; | 6043 | goto Pa_addPort_end; |
@@ -6029,6 +6085,8 @@ paReturn_t Pa_setCustomLUT1 ( Pa_Handle iHandle, | |||
6029 | uint16_t csize; | 6085 | uint16_t csize; |
6030 | pafrmCommand_t *fcmd; | 6086 | pafrmCommand_t *fcmd; |
6031 | pafrmCommandSysConfigPa_t *ccfg; | 6087 | pafrmCommandSysConfigPa_t *ccfg; |
6088 | paInst_t *paInst = (paInst_t *) pa_CONV_OFFSET_TO_BASE(paLObj.cfg.instPoolBaseAddr, iHandle); | ||
6089 | uint32_t mtCsKey; | ||
6032 | 6090 | ||
6033 | if((byteMasks == NULL) || (cmd == NULL) || (cmdSize == NULL) || (reply == NULL) || (cmdDest == NULL)) | 6091 | if((byteMasks == NULL) || (cmd == NULL) || (cmdSize == NULL) || (reply == NULL) || (cmdDest == NULL)) |
6034 | { | 6092 | { |
@@ -6054,8 +6112,12 @@ paReturn_t Pa_setCustomLUT1 ( Pa_Handle iHandle, | |||
6054 | if (reply->dest != pa_DEST_HOST) | 6112 | if (reply->dest != pa_DEST_HOST) |
6055 | return (pa_INVALID_CMD_REPLY_DEST); | 6113 | return (pa_INVALID_CMD_REPLY_DEST); |
6056 | 6114 | ||
6115 | /* Refresh PA Instance */ | ||
6116 | Pa_osalMtCsEnter(&mtCsKey); | ||
6117 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); | ||
6118 | |||
6057 | /* Create the command */ | 6119 | /* Create the command */ |
6058 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_SYS_CONFIG, 0, 0, csize); | 6120 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_SYS_CONFIG, 0, 0, csize); |
6059 | 6121 | ||
6060 | /* Validity of the destination was already checked (HOST), so no other cases | 6122 | /* Validity of the destination was already checked (HOST), so no other cases |
6061 | * must be considered */ | 6123 | * must be considered */ |
@@ -6074,6 +6136,9 @@ paReturn_t Pa_setCustomLUT1 ( Pa_Handle iHandle, | |||
6074 | /* Any PDSP can be used to handle the command. POST PDSP0 is chosen | 6136 | /* Any PDSP can be used to handle the command. POST PDSP0 is chosen |
6075 | * since it is typically lightly loaded */ | 6137 | * since it is typically lightly loaded */ |
6076 | *cmdDest = pa_CMD_TX_DEST_5; | 6138 | *cmdDest = pa_CMD_TX_DEST_5; |
6139 | |||
6140 | Pa_osalEndMemAccess (paInst, sizeof(paInst_t)); | ||
6141 | Pa_osalMtCsExit(mtCsKey); | ||
6077 | 6142 | ||
6078 | return (pa_OK); | 6143 | return (pa_OK); |
6079 | 6144 | ||
@@ -6244,7 +6309,7 @@ Pa_addCustomLut1_send_cmd: | |||
6244 | *retHandle = (paHandleL2L3_t)pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,&l3Table[i]); | 6309 | *retHandle = (paHandleL2L3_t)pa_CONV_BASE_TO_OFFSET(paLObj.cfg.instPoolBaseAddr,&l3Table[i]); |
6245 | 6310 | ||
6246 | /* Create the command */ | 6311 | /* Create the command */ |
6247 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_L3 | i, 0, csize); | 6312 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT1, PA_COMID_L3 | i, 0, csize); |
6248 | 6313 | ||
6249 | /* Validity of the destination was already checked (HOST), so no other cases | 6314 | /* Validity of the destination was already checked (HOST), so no other cases |
6250 | * must be considered */ | 6315 | * must be considered */ |
@@ -6326,14 +6391,14 @@ Pa_addCustomLut1_send_cmd: | |||
6326 | } | 6391 | } |
6327 | 6392 | ||
6328 | /* Forwarding information */ | 6393 | /* Forwarding information */ |
6329 | ret1 = pa_conv_routing_info(paInst, &al1->match, routeInfo, *cmdDest, FALSE, 0); | 6394 | ret1 = pa_conv_routing_info(paInst, &al1->match, routeInfo, *cmdDest, FALSE, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
6330 | if (ret1 != pa_OK) { | 6395 | if (ret1 != pa_OK) { |
6331 | ret = ret1; | 6396 | ret = ret1; |
6332 | goto Pa_addCustomLUT1_end; | 6397 | goto Pa_addCustomLUT1_end; |
6333 | } | 6398 | } |
6334 | 6399 | ||
6335 | /* Next fail information */ | 6400 | /* Next fail information */ |
6336 | ret1 = pa_conv_routing_info(paInst, &al1->nextFail, nextRtFail, *cmdDest, TRUE, 0); | 6401 | ret1 = pa_conv_routing_info(paInst, &al1->nextFail, nextRtFail, *cmdDest, TRUE, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
6337 | if (ret1 != pa_OK) { | 6402 | if (ret1 != pa_OK) { |
6338 | ret = ret1; | 6403 | ret = ret1; |
6339 | goto Pa_addCustomLUT1_end; | 6404 | goto Pa_addCustomLUT1_end; |
@@ -6383,6 +6448,8 @@ paReturn_t Pa_setCustomLUT2 ( Pa_Handle iHandle, | |||
6383 | paCmdReply_t *reply, | 6448 | paCmdReply_t *reply, |
6384 | int *cmdDest ) | 6449 | int *cmdDest ) |
6385 | { | 6450 | { |
6451 | paInst_t *paInst = (paInst_t *) pa_CONV_OFFSET_TO_BASE(paLObj.cfg.instPoolBaseAddr, iHandle); | ||
6452 | uint32_t mtCsKey; | ||
6386 | uint16_t csize; | 6453 | uint16_t csize; |
6387 | pafrmCommand_t *fcmd; | 6454 | pafrmCommand_t *fcmd; |
6388 | pafrmCommandSysConfigPa_t *ccfg; | 6455 | pafrmCommandSysConfigPa_t *ccfg; |
@@ -6414,8 +6481,12 @@ paReturn_t Pa_setCustomLUT2 ( Pa_Handle iHandle, | |||
6414 | if (byteOffsets[i] >= byteOffsets[i+1]) | 6481 | if (byteOffsets[i] >= byteOffsets[i+1]) |
6415 | return (pa_ERR_CONFIG); | 6482 | return (pa_ERR_CONFIG); |
6416 | 6483 | ||
6484 | /* Refresh PA Instance */ | ||
6485 | Pa_osalMtCsEnter(&mtCsKey); | ||
6486 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); | ||
6487 | |||
6417 | /* Create the command */ | 6488 | /* Create the command */ |
6418 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_SYS_CONFIG, 0, 1, csize); | 6489 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_SYS_CONFIG, 0, 1, csize); |
6419 | 6490 | ||
6420 | /* Validity of the destination was already checked (HOST), so no other cases | 6491 | /* Validity of the destination was already checked (HOST), so no other cases |
6421 | * must be considered */ | 6492 | * must be considered */ |
@@ -6436,6 +6507,9 @@ paReturn_t Pa_setCustomLUT2 ( Pa_Handle iHandle, | |||
6436 | /* LUT2 resides at Ingress4 PDSP1 */ | 6507 | /* LUT2 resides at Ingress4 PDSP1 */ |
6437 | *cmdDest = pa_CMD_TX_DEST_4; | 6508 | *cmdDest = pa_CMD_TX_DEST_4; |
6438 | 6509 | ||
6510 | Pa_osalEndMemAccess (paInst, sizeof(paInst_t)); | ||
6511 | Pa_osalMtCsExit(mtCsKey); | ||
6512 | |||
6439 | return (pa_OK); | 6513 | return (pa_OK); |
6440 | 6514 | ||
6441 | } /* Pa_setCustomLUT2 */ | 6515 | } /* Pa_setCustomLUT2 */ |
@@ -6541,7 +6615,7 @@ paReturn_t Pa_addCustomLUT2 ( Pa_Handle iHandle, | |||
6541 | hl4->lnk = PAFRM_MK_SRC_VC(hdr->pdspNum, hdr->lutIdx); | 6615 | hl4->lnk = PAFRM_MK_SRC_VC(hdr->pdspNum, hdr->lutIdx); |
6542 | 6616 | ||
6543 | /* Create the command */ | 6617 | /* Create the command */ |
6544 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT2, 0, 1, csize); | 6618 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_ADDREP_LUT2, 0, 1, csize); |
6545 | 6619 | ||
6546 | /* Validity of the destination was already checked (HOST), so no other cases | 6620 | /* Validity of the destination was already checked (HOST), so no other cases |
6547 | * must be considered */ | 6621 | * must be considered */ |
@@ -6571,7 +6645,7 @@ paReturn_t Pa_addCustomLUT2 ( Pa_Handle iHandle, | |||
6571 | al2->ctrlBitMap = SWIZ(al2->ctrlBitMap); | 6645 | al2->ctrlBitMap = SWIZ(al2->ctrlBitMap); |
6572 | 6646 | ||
6573 | /* Forwarding information */ | 6647 | /* Forwarding information */ |
6574 | ret1 = pa_conv_routing_info(paInst, &al2->match, routeInfo, pa_CMD_TX_DEST_4, FALSE, 1); | 6648 | ret1 = pa_conv_routing_info(paInst, &al2->match, routeInfo, pa_CMD_TX_DEST_4, FALSE, 1, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
6575 | if (ret1 != pa_OK) { | 6649 | if (ret1 != pa_OK) { |
6576 | ret = ret1; | 6650 | ret = ret1; |
6577 | goto Pa_addCustomLUT2_end; | 6651 | goto Pa_addCustomLUT2_end; |
@@ -6643,11 +6717,11 @@ paReturn_t Pa_delL4Handle (Pa_Handle iHandle, | |||
6643 | (hl4->lnkType != PA_TABLE_ENTRY_TYPE_NONE)) | 6717 | (hl4->lnkType != PA_TABLE_ENTRY_TYPE_NONE)) |
6644 | return (pa_INVALID_INPUT_HANDLE); | 6718 | return (pa_INVALID_INPUT_HANDLE); |
6645 | 6719 | ||
6646 | if (hl4->lnkType == PA_TABLE_ENTRY_TYPE_L3) { | 6720 | /* Refresh PA Instance */ |
6647 | /* Refresh PA Instance */ | 6721 | Pa_osalMtCsEnter(&mtCsKey); |
6648 | Pa_osalMtCsEnter(&mtCsKey); | 6722 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); |
6649 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); | ||
6650 | 6723 | ||
6724 | if (hl4->lnkType == PA_TABLE_ENTRY_TYPE_L3) { | ||
6651 | /* Inform the host a table entry will be changed */ | 6725 | /* Inform the host a table entry will be changed */ |
6652 | Pa_osalBeginMemAccess ((void *) l3Table, | 6726 | Pa_osalBeginMemAccess ((void *) l3Table, |
6653 | paInst->paBufs[PA_BUFFNUM_L3_TABLE].size); | 6727 | paInst->paBufs[PA_BUFFNUM_L3_TABLE].size); |
@@ -6665,14 +6739,8 @@ paReturn_t Pa_delL4Handle (Pa_Handle iHandle, | |||
6665 | 6739 | ||
6666 | Pa_osalEndMemAccess ((void *) l3Table, | 6740 | Pa_osalEndMemAccess ((void *) l3Table, |
6667 | paInst->paBufs[PA_BUFFNUM_L3_TABLE].size); | 6741 | paInst->paBufs[PA_BUFFNUM_L3_TABLE].size); |
6668 | Pa_osalEndMemAccess (paInst, sizeof(paInst_t)); | ||
6669 | Pa_osalMtCsExit(mtCsKey); | ||
6670 | } | 6742 | } |
6671 | else if (hl4->lnkType == PA_TABLE_ENTRY_TYPE_VL) { | 6743 | else if (hl4->lnkType == PA_TABLE_ENTRY_TYPE_VL) { |
6672 | /* Refresh PA Instance */ | ||
6673 | Pa_osalMtCsEnter(&mtCsKey); | ||
6674 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); | ||
6675 | |||
6676 | /* Inform the host a table entry will be changed */ | 6744 | /* Inform the host a table entry will be changed */ |
6677 | Pa_osalBeginMemAccess ((void *) vlnkTable, | 6745 | Pa_osalBeginMemAccess ((void *) vlnkTable, |
6678 | paInst->paBufs[PA_BUFFNUM_VIRTUAL_LNK_TABLE].size); | 6746 | paInst->paBufs[PA_BUFFNUM_VIRTUAL_LNK_TABLE].size); |
@@ -6690,11 +6758,13 @@ paReturn_t Pa_delL4Handle (Pa_Handle iHandle, | |||
6690 | 6758 | ||
6691 | Pa_osalEndMemAccess ((void *) vlnkTable, | 6759 | Pa_osalEndMemAccess ((void *) vlnkTable, |
6692 | paInst->paBufs[PA_BUFFNUM_VIRTUAL_LNK_TABLE].size); | 6760 | paInst->paBufs[PA_BUFFNUM_VIRTUAL_LNK_TABLE].size); |
6693 | Pa_osalEndMemAccess (paInst, sizeof(paInst_t)); | 6761 | } |
6694 | Pa_osalMtCsExit(mtCsKey); | 6762 | |
6695 | } | 6763 | Pa_osalEndMemAccess (paInst, sizeof(paInst_t)); |
6764 | Pa_osalMtCsExit(mtCsKey); | ||
6765 | |||
6696 | /* Create the command */ | 6766 | /* Create the command */ |
6697 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_DEL_LUT2, 0, 1, csize); | 6767 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_DEL_LUT2, 0, 1, csize); |
6698 | 6768 | ||
6699 | /* Validity of the destination was already checked (HOST), so no other cases | 6769 | /* Validity of the destination was already checked (HOST), so no other cases |
6700 | * must be considered */ | 6770 | * must be considered */ |
@@ -7117,8 +7187,12 @@ paReturn_t Pa_configExceptionRoute2(Pa_Handle iHandle, | |||
7117 | if ((nRoute <= 0) || (nRoute > pa_EROUTE_MAX)) | 7187 | if ((nRoute <= 0) || (nRoute > pa_EROUTE_MAX)) |
7118 | return (pa_ERR_CONFIG); | 7188 | return (pa_ERR_CONFIG); |
7119 | 7189 | ||
7190 | /* Refresh PA Instance */ | ||
7191 | Pa_osalMtCsEnter(&mtCsKey); | ||
7192 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); | ||
7193 | |||
7120 | /* Create the command */ | 7194 | /* Create the command */ |
7121 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_SYS_CONFIG, 0, 0, csize); | 7195 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_SYS_CONFIG, 0, 0, csize); |
7122 | 7196 | ||
7123 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases | 7197 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases |
7124 | * must be considered */ | 7198 | * must be considered */ |
@@ -7133,10 +7207,6 @@ paReturn_t Pa_configExceptionRoute2(Pa_Handle iHandle, | |||
7133 | 7207 | ||
7134 | cpa->u.eroute.routeBitMap = 0; | 7208 | cpa->u.eroute.routeBitMap = 0; |
7135 | 7209 | ||
7136 | /* Refresh PA Instance */ | ||
7137 | Pa_osalMtCsEnter(&mtCsKey); | ||
7138 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); | ||
7139 | |||
7140 | for (i = 0; i < nRoute; i++) { | 7210 | for (i = 0; i < nRoute; i++) { |
7141 | 7211 | ||
7142 | if ( (eRoutes[i].dest != pa_DEST_HOST) && | 7212 | if ( (eRoutes[i].dest != pa_DEST_HOST) && |
@@ -7155,7 +7225,7 @@ paReturn_t Pa_configExceptionRoute2(Pa_Handle iHandle, | |||
7155 | 7225 | ||
7156 | cpa->u.eroute.routeBitMap |= (1 << routeTypes[i]); | 7226 | cpa->u.eroute.routeBitMap |= (1 << routeTypes[i]); |
7157 | 7227 | ||
7158 | retCode = pa_conv_routing_info2 (paInst, &cpa->u.eroute.eRoute[routeTypes[i]], &eRoutes[i], pa_CMD_TX_DEST_5, FALSE, 0, 0); | 7228 | retCode = pa_conv_routing_info2 (paInst, &cpa->u.eroute.eRoute[routeTypes[i]], &eRoutes[i], pa_CMD_TX_DEST_5, FALSE, 0, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
7159 | 7229 | ||
7160 | if(retCode != pa_OK) | 7230 | if(retCode != pa_OK) |
7161 | break; | 7231 | break; |
@@ -7224,8 +7294,12 @@ paReturn_t Pa_configExceptionRouteCommon(Pa_Handle iHandle, | |||
7224 | if (nRoute <= 0) | 7294 | if (nRoute <= 0) |
7225 | return (pa_ERR_CONFIG); | 7295 | return (pa_ERR_CONFIG); |
7226 | 7296 | ||
7297 | /* Refresh PA Instance for read only */ | ||
7298 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); | ||
7299 | Pa_osalEndMemAccess (paInst, sizeof(paInst_t)); | ||
7300 | |||
7227 | /* Create the command */ | 7301 | /* Create the command */ |
7228 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_SYS_CONFIG, 0, 0, csize); | 7302 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_SYS_CONFIG, 0, 0, csize); |
7229 | 7303 | ||
7230 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases | 7304 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases |
7231 | * must be considered */ | 7305 | * must be considered */ |
@@ -7240,10 +7314,6 @@ paReturn_t Pa_configExceptionRouteCommon(Pa_Handle iHandle, | |||
7240 | 7314 | ||
7241 | cpa->u.eroute.routeBitMap = 0; | 7315 | cpa->u.eroute.routeBitMap = 0; |
7242 | 7316 | ||
7243 | /* Refresh PA Instance for read only */ | ||
7244 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); | ||
7245 | Pa_osalEndMemAccess (paInst, sizeof(paInst_t)); | ||
7246 | |||
7247 | for (i = 0; i < nRoute; i++) { | 7317 | for (i = 0; i < nRoute; i++) { |
7248 | 7318 | ||
7249 | if ( (eRoutes[i].dest != pa_DEST_HOST) && | 7319 | if ( (eRoutes[i].dest != pa_DEST_HOST) && |
@@ -7256,7 +7326,7 @@ paReturn_t Pa_configExceptionRouteCommon(Pa_Handle iHandle, | |||
7256 | 7326 | ||
7257 | cpa->u.eroute.routeBitMap |= (1 << routeTypes[i]); | 7327 | cpa->u.eroute.routeBitMap |= (1 << routeTypes[i]); |
7258 | 7328 | ||
7259 | retCode = pa_conv_routing_info (paInst, &cpa->u.eroute.eRoute[routeTypes[i]], &eRoutes[i], dest, FALSE, 0); | 7329 | retCode = pa_conv_routing_info (paInst, &cpa->u.eroute.eRoute[routeTypes[i]], &eRoutes[i], dest, FALSE, 0, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC); |
7260 | if(retCode != pa_OK) | 7330 | if(retCode != pa_OK) |
7261 | return(retCode); | 7331 | return(retCode); |
7262 | 7332 | ||
@@ -7327,6 +7397,8 @@ paReturn_t Pa_configMultiRoute (Pa_Handle iHandle, | |||
7327 | paCmdReply_t *reply, | 7397 | paCmdReply_t *reply, |
7328 | int *cmdDest) | 7398 | int *cmdDest) |
7329 | { | 7399 | { |
7400 | paInst_t *paInst = (paInst_t *) pa_CONV_OFFSET_TO_BASE(paLObj.cfg.instPoolBaseAddr, iHandle); | ||
7401 | uint32_t mtCsKey; | ||
7330 | pafrmCommand_t *fcmd; | 7402 | pafrmCommand_t *fcmd; |
7331 | pafrmCommandMultiRoute_t *mr; | 7403 | pafrmCommandMultiRoute_t *mr; |
7332 | int i; | 7404 | int i; |
@@ -7360,8 +7432,15 @@ paReturn_t Pa_configMultiRoute (Pa_Handle iHandle, | |||
7360 | if((mode != pa_MULTI_ROUTE_MODE_CONFIG) && (mode != pa_MULTI_ROUTE_MODE_RESET)) | 7432 | if((mode != pa_MULTI_ROUTE_MODE_CONFIG) && (mode != pa_MULTI_ROUTE_MODE_RESET)) |
7361 | return (pa_ERR_CONFIG); | 7433 | return (pa_ERR_CONFIG); |
7362 | 7434 | ||
7435 | if ((mode == pa_MULTI_ROUTE_MODE_CONFIG) && (routeEntry == NULL)) | ||
7436 | return (pa_ERR_CONFIG); | ||
7437 | |||
7438 | /* Refresh PA Instance */ | ||
7439 | Pa_osalMtCsEnter(&mtCsKey); | ||
7440 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); | ||
7441 | |||
7363 | /* Create the command */ | 7442 | /* Create the command */ |
7364 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_MULTI_ROUTE, 0, 1, csize); | 7443 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_MULTI_ROUTE, 0, 1, csize); |
7365 | 7444 | ||
7366 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases | 7445 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases |
7367 | * must be considered */ | 7446 | * must be considered */ |
@@ -7378,14 +7457,11 @@ paReturn_t Pa_configMultiRoute (Pa_Handle iHandle, | |||
7378 | mr->mode = PAFRM_COMMAND_MULTI_ROUTE_MODE_ADD; | 7457 | mr->mode = PAFRM_COMMAND_MULTI_ROUTE_MODE_ADD; |
7379 | mr->nRoutes = (uint8_t)nRoute; | 7458 | mr->nRoutes = (uint8_t)nRoute; |
7380 | 7459 | ||
7381 | if(routeEntry == NULL) | ||
7382 | return (pa_INSUFFICIENT_CMD_BUFFER_SIZE); | ||
7383 | |||
7384 | for (i = 0; i < nRoute; i++) { | 7460 | for (i = 0; i < nRoute; i++) { |
7385 | mr->quFl[i].ctrlFlags = routeEntry[i].ctrlBitfield | PAFRM_MULTI_RUOTE_CTRL_ACTIVE; | 7461 | mr->quFl[i].ctrlFlags = routeEntry[i].ctrlBitfield | PAFRM_MULTI_RUOTE_CTRL_ACTIVE; |
7386 | mr->quFl[i].ctrlFlags = SWIZ(mr->quFl[i].ctrlFlags); | 7462 | mr->quFl[i].ctrlFlags = SWIZ(mr->quFl[i].ctrlFlags); |
7387 | mr->quFl[i].flowId = SWIZ(routeEntry[i].flowId); | 7463 | mr->quFl[i].flowId = SWIZ(routeEntry[i].flowId); |
7388 | mr->quFl[i].queue = SWIZ(routeEntry[i].queue); | 7464 | mr->quFl[i].queue = SWIZ(pa_convert_queue_id(paInst, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC, routeEntry[i].queue)); |
7389 | mr->quFl[i].swInfo0 = SWIZ(routeEntry[i].swInfo0); | 7465 | mr->quFl[i].swInfo0 = SWIZ(routeEntry[i].swInfo0); |
7390 | } | 7466 | } |
7391 | } | 7467 | } |
@@ -7396,6 +7472,9 @@ paReturn_t Pa_configMultiRoute (Pa_Handle iHandle, | |||
7396 | /* Multi-route processing PDSP: POST PDSP1 */ | 7472 | /* Multi-route processing PDSP: POST PDSP1 */ |
7397 | *cmdDest = pa_CMD_TX_DEST_5; | 7473 | *cmdDest = pa_CMD_TX_DEST_5; |
7398 | 7474 | ||
7475 | Pa_osalEndMemAccess (paInst, sizeof(paInst_t)); | ||
7476 | Pa_osalMtCsExit(mtCsKey); | ||
7477 | |||
7399 | return (pa_OK); | 7478 | return (pa_OK); |
7400 | 7479 | ||
7401 | } /* Pa_configMultiRoute */ | 7480 | } /* Pa_configMultiRoute */ |
@@ -7561,7 +7640,7 @@ paReturn_t Pa_configCmdSet (Pa_Handle iHandle, | |||
7561 | 64 - offsetof(pafrmCommandCmdSet_t, cmd); | 7640 | 64 - offsetof(pafrmCommandCmdSet_t, cmd); |
7562 | 7641 | ||
7563 | /* Create the command */ | 7642 | /* Create the command */ |
7564 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_CMD_SET, 0, 0, csize); | 7643 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_CMD_SET, 0, 0, csize); |
7565 | 7644 | ||
7566 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases | 7645 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases |
7567 | * must be considered */ | 7646 | * must be considered */ |
@@ -7742,7 +7821,7 @@ paReturn_t Pa_configCmdSet (Pa_Handle iHandle, | |||
7742 | } | 7821 | } |
7743 | pCmdSplit->ctrlFlags = SWIZ(pCmdSplit->ctrlFlags); | 7822 | pCmdSplit->ctrlFlags = SWIZ(pCmdSplit->ctrlFlags); |
7744 | pCmdSplit->flowId = (uint8_t)split->flowId; | 7823 | pCmdSplit->flowId = (uint8_t)split->flowId; |
7745 | pCmdSplit->destQueue = SWIZ(split->destQueue); | 7824 | pCmdSplit->destQueue = SWIZ(pa_convert_queue_id(paInst, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC, split->destQueue)); |
7746 | pCmdSplit->startOffset = (uint8_t)split->startOffset; | 7825 | pCmdSplit->startOffset = (uint8_t)split->startOffset; |
7747 | 7826 | ||
7748 | } | 7827 | } |
@@ -7821,7 +7900,7 @@ paReturn_t Pa_configCmdSet (Pa_Handle iHandle, | |||
7821 | case pa_DEST_HOST: | 7900 | case pa_DEST_HOST: |
7822 | pCmdVerifyPktErr->forwardType = PAFRM_FORWARD_TYPE_HOST; | 7901 | pCmdVerifyPktErr->forwardType = PAFRM_FORWARD_TYPE_HOST; |
7823 | pCmdVerifyPktErr->flowId = SWIZ(verifyPktErr->flowId); | 7902 | pCmdVerifyPktErr->flowId = SWIZ(verifyPktErr->flowId); |
7824 | pCmdVerifyPktErr->queue = SWIZ(verifyPktErr->queue); | 7903 | pCmdVerifyPktErr->queue = SWIZ(pa_convert_queue_id(paInst, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC, verifyPktErr->queue)); |
7825 | pCmdVerifyPktErr->swInfo0 = SWIZ(verifyPktErr->swInfo0); | 7904 | pCmdVerifyPktErr->swInfo0 = SWIZ(verifyPktErr->swInfo0); |
7826 | break; | 7905 | break; |
7827 | 7906 | ||
@@ -7981,7 +8060,7 @@ paReturn_t Pa_configUsrStats (Pa_Handle iHandle, | |||
7981 | memcpy(usrStatsLnkTbl, uslnkTable, paInst->nUsrStats * sizeof(paUsrStatsLnkEntry_t)); | 8060 | memcpy(usrStatsLnkTbl, uslnkTable, paInst->nUsrStats * sizeof(paUsrStatsLnkEntry_t)); |
7982 | 8061 | ||
7983 | /* Create the command */ | 8062 | /* Create the command */ |
7984 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_USR_STATS, 0, 0, csize); | 8063 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_USR_STATS, 0, 0, csize); |
7985 | 8064 | ||
7986 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases | 8065 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases |
7987 | * must be considered */ | 8066 | * must be considered */ |
@@ -8637,8 +8716,11 @@ paReturn_t Pa_control (Pa_Handle iHandle, | |||
8637 | { | 8716 | { |
8638 | pafrmCommandConfigPa_t *cpa; | 8717 | pafrmCommandConfigPa_t *cpa; |
8639 | 8718 | ||
8719 | Pa_osalMtCsEnter(&mtCsKey); | ||
8720 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); | ||
8721 | |||
8640 | /* Create the command */ | 8722 | /* Create the command */ |
8641 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_CONFIG_PA, 0, 0, csize); | 8723 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_CONFIG_PA, 0, 0, csize); |
8642 | 8724 | ||
8643 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases | 8725 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases |
8644 | * must be considered */ | 8726 | * must be considered */ |
@@ -8649,9 +8731,6 @@ paReturn_t Pa_control (Pa_Handle iHandle, | |||
8649 | 8731 | ||
8650 | cpa = (pafrmCommandConfigPa_t *)&(fcmd->cmd); | 8732 | cpa = (pafrmCommandConfigPa_t *)&(fcmd->cmd); |
8651 | 8733 | ||
8652 | Pa_osalMtCsEnter(&mtCsKey); | ||
8653 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); | ||
8654 | |||
8655 | /* Protocol Limitations */ | 8734 | /* Protocol Limitations */ |
8656 | if (cfg->pProtoLimit) | 8735 | if (cfg->pProtoLimit) |
8657 | { | 8736 | { |
@@ -8675,6 +8754,35 @@ paReturn_t Pa_control (Pa_Handle iHandle, | |||
8675 | 8754 | ||
8676 | } | 8755 | } |
8677 | 8756 | ||
8757 | /* Queue Bounce configuration */ | ||
8758 | if (cfg->pQueueBounceConfig) | ||
8759 | { | ||
8760 | int i; | ||
8761 | paQueueBounceConfig_t* pQueueBounceCfg = cfg->pQueueBounceConfig; | ||
8762 | |||
8763 | paInst->cfg.queueBounceConfig = *pQueueBounceCfg; | ||
8764 | |||
8765 | for (i = 0; i < PA_MAX_QUEUE_BOUNCE_ROUTING_CLASSES; i++) | ||
8766 | { | ||
8767 | if (pQueueBounceCfg->defOp[i] > pa_QUEUE_BOUNCE_OP_MAX) | ||
8768 | { | ||
8769 | paInst->cfg.queueBounceConfig.enable = FALSE; | ||
8770 | ret = pa_ERR_CONFIG; | ||
8771 | break; | ||
8772 | } | ||
8773 | } | ||
8774 | |||
8775 | if (ret == pa_OK) | ||
8776 | { | ||
8777 | cpa->validFlag |= PAFRM_COMMAND_CONFIG_VALID_QUEUE_BOUNCE; | ||
8778 | cpa->queueBounce.ddrQueue = SWIZ(pQueueBounceCfg->ddrQueueId); | ||
8779 | cpa->queueBounce.msmcQueue = SWIZ(pQueueBounceCfg->msmcQueueId); | ||
8780 | } | ||
8781 | |||
8782 | /* the return queue may be updated per this configuration */ | ||
8783 | fcmd->replyQueue = SWIZ(pa_convert_queue_id(paInst, pa_QUEUE_BOUNCE_ROUTING_CLASS_CMD_RET, reply->queue)); | ||
8784 | } | ||
8785 | |||
8678 | /* Outer IP configuration */ | 8786 | /* Outer IP configuration */ |
8679 | if (cfg->pOutIpReassmConfig) | 8787 | if (cfg->pOutIpReassmConfig) |
8680 | { | 8788 | { |
@@ -8691,7 +8799,7 @@ paReturn_t Pa_control (Pa_Handle iHandle, | |||
8691 | cpa->validFlag |= PAFRM_COMMAND_CONFIG_VALID_OUT_IP_REASSEM; | 8799 | cpa->validFlag |= PAFRM_COMMAND_CONFIG_VALID_OUT_IP_REASSEM; |
8692 | cpa->outIpReasm.numTrafficFlow = SWIZ(pIpReassmCfg->numTrafficFlow); | 8800 | cpa->outIpReasm.numTrafficFlow = SWIZ(pIpReassmCfg->numTrafficFlow); |
8693 | cpa->outIpReasm.destFlowId = SWIZ(pIpReassmCfg->destFlowId); | 8801 | cpa->outIpReasm.destFlowId = SWIZ(pIpReassmCfg->destFlowId); |
8694 | cpa->outIpReasm.destQueue = SWIZ(pIpReassmCfg->destQueue); | 8802 | cpa->outIpReasm.destQueue = SWIZ(pa_convert_queue_id(paInst, pa_QUEUE_BOUNCE_ROUTING_CLASS_IP_REASSEMBLY, pIpReassmCfg->destQueue)); |
8695 | } | 8803 | } |
8696 | } | 8804 | } |
8697 | 8805 | ||
@@ -8711,7 +8819,7 @@ paReturn_t Pa_control (Pa_Handle iHandle, | |||
8711 | cpa->validFlag |= PAFRM_COMMAND_CONFIG_VALID_IN_IP_REASSEM; | 8819 | cpa->validFlag |= PAFRM_COMMAND_CONFIG_VALID_IN_IP_REASSEM; |
8712 | cpa->inIpReasm.numTrafficFlow = SWIZ(pIpReassmCfg->numTrafficFlow); | 8820 | cpa->inIpReasm.numTrafficFlow = SWIZ(pIpReassmCfg->numTrafficFlow); |
8713 | cpa->inIpReasm.destFlowId = SWIZ(pIpReassmCfg->destFlowId); | 8821 | cpa->inIpReasm.destFlowId = SWIZ(pIpReassmCfg->destFlowId); |
8714 | cpa->inIpReasm.destQueue = SWIZ(pIpReassmCfg->destQueue); | 8822 | cpa->inIpReasm.destQueue = SWIZ(pa_convert_queue_id(paInst, pa_QUEUE_BOUNCE_ROUTING_CLASS_IP_REASSEMBLY, pIpReassmCfg->destQueue)); |
8715 | } | 8823 | } |
8716 | } | 8824 | } |
8717 | 8825 | ||
@@ -8878,7 +8986,7 @@ paReturn_t Pa_control (Pa_Handle iHandle, | |||
8878 | 8986 | ||
8879 | } | 8987 | } |
8880 | cpa->outAcl.destFlowId = SWIZ(pAclCfg->destFlowId); | 8988 | cpa->outAcl.destFlowId = SWIZ(pAclCfg->destFlowId); |
8881 | cpa->outAcl.destQueue = SWIZ(pAclCfg->destQueue); | 8989 | cpa->outAcl.destQueue = SWIZ(pa_convert_queue_id(paInst, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC, pAclCfg->destQueue)); |
8882 | } | 8990 | } |
8883 | } | 8991 | } |
8884 | 8992 | ||
@@ -8923,7 +9031,7 @@ paReturn_t Pa_control (Pa_Handle iHandle, | |||
8923 | 9031 | ||
8924 | } | 9032 | } |
8925 | cpa->inAcl.destFlowId = SWIZ(pAclCfg->destFlowId); | 9033 | cpa->inAcl.destFlowId = SWIZ(pAclCfg->destFlowId); |
8926 | cpa->inAcl.destQueue = SWIZ(pAclCfg->destQueue); | 9034 | cpa->inAcl.destQueue = SWIZ(pa_convert_queue_id(paInst, pa_QUEUE_BOUNCE_ROUTING_CLASS_MISC, pAclCfg->destQueue)); |
8927 | } | 9035 | } |
8928 | } | 9036 | } |
8929 | 9037 | ||
@@ -9073,11 +9181,14 @@ paReturn_t Pa_control (Pa_Handle iHandle, | |||
9073 | else | 9181 | else |
9074 | { | 9182 | { |
9075 | pafrmCommandSysConfigPa_t *ccfg; | 9183 | pafrmCommandSysConfigPa_t *ccfg; |
9184 | |||
9185 | Pa_osalMtCsEnter(&mtCsKey); | ||
9186 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); | ||
9076 | 9187 | ||
9077 | if (csize) | 9188 | if (csize) |
9078 | { | 9189 | { |
9079 | /* Create the command */ | 9190 | /* Create the command */ |
9080 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_SYS_CONFIG, 0, | 9191 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_SYS_CONFIG, 0, |
9081 | ((ctrl->code == pa_CONTROL_802_1ag_CONFIG) || (ctrl->code == pa_CONTROL_EMAC_PORT_CONFIG))?0:1, csize); | 9192 | ((ctrl->code == pa_CONTROL_802_1ag_CONFIG) || (ctrl->code == pa_CONTROL_EMAC_PORT_CONFIG))?0:1, csize); |
9082 | 9193 | ||
9083 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases | 9194 | /* Validity of the destination was already checked (HOST, DISCARD), so no other cases |
@@ -9124,9 +9235,6 @@ paReturn_t Pa_control (Pa_Handle iHandle, | |||
9124 | { | 9235 | { |
9125 | paGtpuConfig_t *gtpuCfg = &ctrl->params.gtpuCfg; | 9236 | paGtpuConfig_t *gtpuCfg = &ctrl->params.gtpuCfg; |
9126 | 9237 | ||
9127 | Pa_osalMtCsEnter(&mtCsKey); | ||
9128 | Pa_osalBeginMemAccess (paInst, sizeof(paInst_t)); | ||
9129 | |||
9130 | ccfg->cfgCode = PAFRM_SYSTEM_CONFIG_CODE_GTPU; | 9238 | ccfg->cfgCode = PAFRM_SYSTEM_CONFIG_CODE_GTPU; |
9131 | 9239 | ||
9132 | if (gtpuCfg->ctrlBitMap & pa_GTPU_CTRL_USE_LINK) | 9240 | if (gtpuCfg->ctrlBitMap & pa_GTPU_CTRL_USE_LINK) |
@@ -9148,8 +9256,6 @@ paReturn_t Pa_control (Pa_Handle iHandle, | |||
9148 | /* GTP-U classification is at Ingress4 PDSP1 only */ | 9256 | /* GTP-U classification is at Ingress4 PDSP1 only */ |
9149 | *cmdDest = pa_CMD_TX_DEST_4; | 9257 | *cmdDest = pa_CMD_TX_DEST_4; |
9150 | 9258 | ||
9151 | Pa_osalEndMemAccess (paInst, sizeof(paInst_t)); | ||
9152 | Pa_osalMtCsExit(mtCsKey); | ||
9153 | break; | 9259 | break; |
9154 | } | 9260 | } |
9155 | 9261 | ||
@@ -9173,8 +9279,6 @@ paReturn_t Pa_control (Pa_Handle iHandle, | |||
9173 | 9279 | ||
9174 | pa_ra_global_cfg(&ctrl->params.raCfg, paLObj.pSysRegs); | 9280 | pa_ra_global_cfg(&ctrl->params.raCfg, paLObj.pSysRegs); |
9175 | 9281 | ||
9176 | Pa_osalEndMemAccess (paInst, sizeof(paInst_t)); | ||
9177 | Pa_osalMtCsExit(mtCsKey); | ||
9178 | break; | 9282 | break; |
9179 | } | 9283 | } |
9180 | 9284 | ||
@@ -9198,6 +9302,10 @@ paReturn_t Pa_control (Pa_Handle iHandle, | |||
9198 | ret = pa_ERR_CONFIG; | 9302 | ret = pa_ERR_CONFIG; |
9199 | break; | 9303 | break; |
9200 | } | 9304 | } |
9305 | |||
9306 | Pa_osalEndMemAccess (paInst, sizeof(paInst_t)); | ||
9307 | Pa_osalMtCsExit(mtCsKey); | ||
9308 | |||
9201 | } | 9309 | } |
9202 | return (ret); | 9310 | return (ret); |
9203 | 9311 | ||
@@ -9240,7 +9348,7 @@ static paReturn_t pa_format_stats_request (paInst_t *paInst, | |||
9240 | return (pa_ERR_CONFIG); | 9348 | return (pa_ERR_CONFIG); |
9241 | 9349 | ||
9242 | /* Form the command */ | 9350 | /* Form the command */ |
9243 | fcmd = pa_format_fcmd_header (cmd, reply, PAFRM_CONFIG_COMMAND_REQ_STATS, 0, 0, csize); | 9351 | fcmd = pa_format_fcmd_header (paInst, cmd, reply, PAFRM_CONFIG_COMMAND_REQ_STATS, 0, 0, csize); |
9244 | 9352 | ||
9245 | /* Validity of the destination was already checked (HOST), so no other cases | 9353 | /* Validity of the destination was already checked (HOST), so no other cases |
9246 | * must be considered */ | 9354 | * must be considered */ |