summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAravind Batni2016-10-07 15:42:38 -0500
committerAravind Batni2016-10-07 15:42:38 -0500
commitb84bcffbb61c71af984d477440efbd5083bfd916 (patch)
treedec4b32a891a236892487cc2f64b0ccb0756e65c
parentdca2a281c0c57f3b3018a93fae5485825a33042c (diff)
downloadpa-lld-b84bcffbb61c71af984d477440efbd5083bfd916.tar.gz
pa-lld-b84bcffbb61c71af984d477440efbd5083bfd916.tar.xz
pa-lld-b84bcffbb61c71af984d477440efbd5083bfd916.zip
unit test enhanced to run for multiple iterations, implements PRSDK-1315
Signed-off-by: Aravind Batni <aravindbr@ti.com>
-rw-r--r--[-rwxr-xr-x]test/PAUnitTest/src/armv7/bios/testMain.c9
-rw-r--r--[-rwxr-xr-x]test/PAUnitTest/src/c66x/bios/testMain.c9
-rw-r--r--test/PAUnitTest/src/common/common.c76
-rw-r--r--test/PAUnitTest/src/tests/test10.c34
-rw-r--r--[-rwxr-xr-x]test/PAUnitTest/src/tests/test11.c35
-rw-r--r--test/PAUnitTest/src/tests/test12.c28
-rw-r--r--test/PAUnitTest/src/tests/test15.c39
-rw-r--r--test/PAUnitTest/src/tests/test3.c7
-rw-r--r--test/PAUnitTest/src/tests/test3pkts.h8
-rw-r--r--test/PAUnitTest/src/tests/test5.c85
10 files changed, 275 insertions, 55 deletions
diff --git a/test/PAUnitTest/src/armv7/bios/testMain.c b/test/PAUnitTest/src/armv7/bios/testMain.c
index 863ce5a..0e1b5e1 100755..100644
--- a/test/PAUnitTest/src/armv7/bios/testMain.c
+++ b/test/PAUnitTest/src/armv7/bios/testMain.c
@@ -243,9 +243,7 @@ void topLevelTest (UArg a0, UArg a1)
243 System_flush (); 243 System_flush ();
244 Clock_start(clkh); 244 Clock_start(clkh);
245 } 245 }
246 } 246 }
247 }
248
249 247
250 /* Summarize the test results */ 248 /* Summarize the test results */
251 for (i = passCount = failCount = notRunCount = 0; paTestList[i].testFunction != NULL; i++) { 249 for (i = passCount = failCount = notRunCount = 0; paTestList[i].testFunction != NULL; i++) {
@@ -261,8 +259,11 @@ void topLevelTest (UArg a0, UArg a1)
261 passCount, failCount, notRunCount); 259 passCount, failCount, notRunCount);
262 260
263 if(passCount == PAU_NUM_TESTS) 261 if(passCount == PAU_NUM_TESTS)
264 System_printf ("All tests have passed!"); 262 System_printf ("All tests have passed!\n\n");
265 263
264 if (iteration)
265 System_printf(" during iteration count %d", iteration);
266 }
266 if (clearTestFramework ()) 267 if (clearTestFramework ())
267 System_printf ("\n\n ------- PA Unit Test Clean Failed ---------\n"); 268 System_printf ("\n\n ------- PA Unit Test Clean Failed ---------\n");
268 269
diff --git a/test/PAUnitTest/src/c66x/bios/testMain.c b/test/PAUnitTest/src/c66x/bios/testMain.c
index ed55365..d33ab2d 100755..100644
--- a/test/PAUnitTest/src/c66x/bios/testMain.c
+++ b/test/PAUnitTest/src/c66x/bios/testMain.c
@@ -190,7 +190,6 @@ void topLevelTest (UArg a0, UArg a1)
190 Clock_start(clkh); 190 Clock_start(clkh);
191 } 191 }
192 } 192 }
193 }
194 193
195 194
196 /* Summarize the test results */ 195 /* Summarize the test results */
@@ -207,7 +206,13 @@ void topLevelTest (UArg a0, UArg a1)
207 passCount, failCount, notRunCount); 206 passCount, failCount, notRunCount);
208 207
209 if(passCount == PAU_NUM_TESTS) 208 if(passCount == PAU_NUM_TESTS)
210 System_printf ("All tests have passed!"); 209 System_printf ("All tests have passed!\n\n");
210
211 if (iteration)
212 System_printf(" during iteration count %d \n", iteration);
213
214 }
215
211 216
212 if (clearTestFramework ()) 217 if (clearTestFramework ())
213 System_printf ("\n\n ------- PA Unit Test Clean Failed ---------\n"); 218 System_printf ("\n\n ------- PA Unit Test Clean Failed ---------\n");
diff --git a/test/PAUnitTest/src/common/common.c b/test/PAUnitTest/src/common/common.c
index b2fa58a..d199941 100644
--- a/test/PAUnitTest/src/common/common.c
+++ b/test/PAUnitTest/src/common/common.c
@@ -1729,48 +1729,36 @@ Cppi_HostDesc *testCommonAddAcl (tFramework_t *tf, int aclInst,int action, paAcl
1729 int32_t Qrecycle, int32_t QCmdMem, 1729 int32_t Qrecycle, int32_t QCmdMem,
1730 paCmdReply_t *repInfo, int *cmdDest, uint16_t *cmdSize, paReturn_t *paret) 1730 paCmdReply_t *repInfo, int *cmdDest, uint16_t *cmdSize, paReturn_t *paret)
1731{ 1731{
1732 Cppi_HostDesc *hd;
1733 Qmss_Queue q;
1734 uint32_t psCmd;
1735 uint32_t timeToNextCall = 0;
1732 1736
1733 Cppi_HostDesc *hd; 1737 /* Pop a descriptor with a linked buffer to create the command */
1734 Qmss_Queue q; 1738 hd = (Cppi_HostDesc *)(((uint32_t)Qmss_queuePop (QCmdMem)) & ~15);
1735 uint32_t psCmd; 1739 if (hd == NULL)
1736 uint32_t cnt = 0, timeToNextCall = 0; 1740 return (NULL);
1737
1738 /* Pop a descriptor with a linked buffer to create the command */
1739 hd = (Cppi_HostDesc *)(((uint32_t)Qmss_queuePop (QCmdMem)) & ~15);
1740 if (hd == NULL)
1741 return (NULL);
1742
1743 *cmdSize = hd->origBufferLen;
1744 1741
1745 do { 1742 *cmdSize = hd->origBufferLen;
1746 *paret = Pa_addAcl (tf->passHandle, 1743
1744 *paret = Pa_addAcl (tf->passHandle,
1747 aclInst, 1745 aclInst,
1748 action, 1746 action,
1749 aclInfo, 1747 aclInfo,
1750 linkedHandle, 1748 linkedHandle,
1751 nextHandle, 1749 nextHandle,
1752 aclhandle, 1750 aclhandle,
1753 (paCmd_t) hd->buffPtr, 1751 (paCmd_t) hd->buffPtr,
1754 cmdSize, 1752 cmdSize,
1755 repInfo, 1753 repInfo,
1756 cmdDest, 1754 cmdDest,
1757 &timeToNextCall); 1755 &timeToNextCall);
1758 1756
1759 /* Application can initiate task sleep OR switch task for anything else to come back to this 1757 /* Application can initiate task sleep OR switch task for anything else to come back to this
1760 * again for the next try, here we are using cycle delay for wait */ 1758 * again for the next try */
1761 if (*paret == pa_ACL_BUSY) { 1759 if (*paret == pa_ACL_BUSY) {
1762// System_printf(" Pa_addAcl returned ACL HW busy indication, time to next call is %d micro seconds \n", timeToNextCall);
1763 utilCycleDelay(timeToNextCall * 1000);
1764// System_printf(" Retrying Pa_addAcl after a minimum delay of %d micro seconds \n");
1765 } 1760 }
1766 else if (cnt != 0) {
1767 // System_printf (" Retry successful \n");
1768 }
1769 1761
1770 cnt++;
1771
1772 } while (timeToNextCall != 0);
1773
1774 /* Restore the descriptor and return it on PA failure */ 1762 /* Restore the descriptor and return it on PA failure */
1775 if ((*paret != pa_OK)) { 1763 if ((*paret != pa_OK)) {
1776 hd->buffLen = hd->origBufferLen; 1764 hd->buffLen = hd->origBufferLen;
@@ -4495,19 +4483,35 @@ paTestStatus_t testCommonUsrStatsSetup (tFramework_t *tf, paTest_t *pat, char *t
4495 4483
4496paTestStatus_t testCommonUsrStatsConfigReset (tFramework_t *tf, paTest_t *pat, char *tName, int numStatsGroup, pauUsrStatsSetup_t *usrStatsSetup, uint32_t cmdId, int32_t qSource, int32_t qCmdRecycle, int32_t qCmdReply) 4484paTestStatus_t testCommonUsrStatsConfigReset (tFramework_t *tf, paTest_t *pat, char *tName, int numStatsGroup, pauUsrStatsSetup_t *usrStatsSetup, uint32_t cmdId, int32_t qSource, int32_t qCmdRecycle, int32_t qCmdReply)
4497{ 4485{
4498 int i, j; 4486 int i, j, k = 0;
4499 paUsrStatsCounterConfig_t cntCfg; 4487 paUsrStatsCounterConfig_t cntCfg;
4488 paTestStatus_t ret;
4489 paUsrStatsTypes_e prevVal[pa_USR_STATS_MAX_COUNTERS];
4500 4490
4501 for (i = 0; i < numStatsGroup; i++) { 4491 for (i = 0, k = 0; i < numStatsGroup; i++) {
4502 4492
4503 cntCfg.numCnt = usrStatsSetup[i].nStats; 4493 cntCfg.numCnt = usrStatsSetup[i].nStats;
4504 cntCfg.cntInfo = usrStatsSetup[i].cntEntryTbl; 4494 cntCfg.cntInfo = usrStatsSetup[i].cntEntryTbl;
4505 4495
4506 for (j = 0; j < cntCfg.numCnt; j++) 4496 for (j = 0; j < cntCfg.numCnt; j++) {
4497 prevVal[k++] = cntCfg.cntInfo[j].cntType;
4507 cntCfg.cntInfo[j].cntType = pa_USR_STATS_TYPE_DISABLE; 4498 cntCfg.cntInfo[j].cntType = pa_USR_STATS_TYPE_DISABLE;
4499 }
4508 } 4500 }
4509 4501
4510 return(testCommonUsrStatsSetup(tf, pat, tName, numStatsGroup, usrStatsSetup, cmdId, qSource, qCmdRecycle, qCmdReply, TRUE)); 4502 ret = testCommonUsrStatsSetup(tf, pat, tName, numStatsGroup, usrStatsSetup, cmdId, qSource, qCmdRecycle, qCmdReply, TRUE);
4503
4504 /* Now restore the original control type for restartability */
4505 for (i = 0, k = 0; i < numStatsGroup; i++) {
4506 cntCfg.numCnt = usrStatsSetup[i].nStats;
4507 cntCfg.cntInfo = usrStatsSetup[i].cntEntryTbl;
4508
4509 for (j = 0; j < cntCfg.numCnt; j++) {
4510 cntCfg.cntInfo[j].cntType = prevVal[k++];
4511 }
4512 }
4513
4514 return (ret);
4511} 4515}
4512 4516
4513/* Function used for debugging firmware */ 4517/* Function used for debugging firmware */
diff --git a/test/PAUnitTest/src/tests/test10.c b/test/PAUnitTest/src/tests/test10.c
index 9679ef8..5ba898e 100644
--- a/test/PAUnitTest/src/tests/test10.c
+++ b/test/PAUnitTest/src/tests/test10.c
@@ -1647,6 +1647,37 @@ static int t10ReceiveDataPkts (t10TestEncap_t *tencap, int expCount)
1647 1647
1648int paT10NumTestPkts = T10_NUM_LOCAL_L4_HANDLES; 1648int paT10NumTestPkts = T10_NUM_LOCAL_L4_HANDLES;
1649 1649
1650static void clearEthPrevCmdAck(t10EthSetup_t *setUp, int size)
1651{
1652 int i;
1653 for (i = 0 ; i < size ; i ++)
1654 {
1655 setUp->acked = FALSE;
1656 setUp++;
1657 }
1658}
1659
1660
1661static void clearIpPrevCmdAck(t10IpSetup_t *setUp, int size)
1662{
1663 int i;
1664 for (i = 0 ; i < size ; i ++)
1665 {
1666 setUp->acked = FALSE;
1667 setUp++;
1668 }
1669}
1670
1671static void clearUdpPrevCmdAck(t10UdpSetup_t *setUp, int size)
1672{
1673 int i;
1674 for (i = 0 ; i < size ; i ++)
1675 {
1676 setUp->acked = FALSE;
1677 setUp++;
1678 }
1679}
1680
1650#ifdef __LINUX_USER_SPACE 1681#ifdef __LINUX_USER_SPACE
1651void* paTestIPv4FragReassem (void *args) 1682void* paTestIPv4FragReassem (void *args)
1652{ 1683{
@@ -1749,16 +1780,19 @@ void paTestIPv4FragReassem (UArg a0, UArg a1)
1749 t10Cleanup (&t10Encap, newStatus); /* No return */ 1780 t10Cleanup (&t10Encap, newStatus); /* No return */
1750 1781
1751 /* Burst in the L2 configuraton */ 1782 /* Burst in the L2 configuraton */
1783 clearEthPrevCmdAck(&t10EthSetup[0], T10_NUM_LOCAL_L2_HANDLES);
1752 newStatus = t10OpenL2 (&t10Encap, t10EthSetup, T10_NUM_LOCAL_L2_HANDLES); 1784 newStatus = t10OpenL2 (&t10Encap, t10EthSetup, T10_NUM_LOCAL_L2_HANDLES);
1753 if (newStatus == PA_TEST_FAILED) 1785 if (newStatus == PA_TEST_FAILED)
1754 t10Cleanup (&t10Encap, newStatus); /* No return */ 1786 t10Cleanup (&t10Encap, newStatus); /* No return */
1755 1787
1756 /* Burst in the L3 configuration */ 1788 /* Burst in the L3 configuration */
1789 clearIpPrevCmdAck(&t10IpSetup[0], T10_NUM_LOCAL_L3_HANDLES);
1757 newStatus = t10OpenL3 (&t10Encap, t10IpSetup, T10_NUM_LOCAL_L3_HANDLES); 1790 newStatus = t10OpenL3 (&t10Encap, t10IpSetup, T10_NUM_LOCAL_L3_HANDLES);
1758 if (newStatus == PA_TEST_FAILED) 1791 if (newStatus == PA_TEST_FAILED)
1759 t10Cleanup (&t10Encap, newStatus); 1792 t10Cleanup (&t10Encap, newStatus);
1760 1793
1761 /* Burst in the L3 configuration */ 1794 /* Burst in the L3 configuration */
1795 clearUdpPrevCmdAck(&t10UdpSetup[0], T10_NUM_LOCAL_L4_HANDLES);
1762 newStatus = t10OpenL4 (&t10Encap, t10UdpSetup, T10_NUM_LOCAL_L4_HANDLES); 1796 newStatus = t10OpenL4 (&t10Encap, t10UdpSetup, T10_NUM_LOCAL_L4_HANDLES);
1763 if (newStatus == PA_TEST_FAILED) 1797 if (newStatus == PA_TEST_FAILED)
1764 t10Cleanup (&t10Encap, newStatus); 1798 t10Cleanup (&t10Encap, newStatus);
diff --git a/test/PAUnitTest/src/tests/test11.c b/test/PAUnitTest/src/tests/test11.c
index 0f65ab7..94f55ee 100755..100644
--- a/test/PAUnitTest/src/tests/test11.c
+++ b/test/PAUnitTest/src/tests/test11.c
@@ -1508,6 +1508,38 @@ static int t11ReceiveDataPkts (t11TestEncap_t *tencap, int expCount)
1508 return (0); 1508 return (0);
1509} 1509}
1510 1510
1511
1512static void clearEthPrevCmdAck(t11EthSetup_t *setUp, int size)
1513{
1514 int i;
1515 for (i = 0 ; i < size ; i ++)
1516 {
1517 setUp->acked = FALSE;
1518 setUp++;
1519 }
1520}
1521
1522
1523static void clearIpPrevCmdAck(t11IpSetup_t *setUp, int size)
1524{
1525 int i;
1526 for (i = 0 ; i < size ; i ++)
1527 {
1528 setUp->acked = FALSE;
1529 setUp++;
1530 }
1531}
1532
1533static void clearUdpPrevCmdAck(t11UdpSetup_t *setUp, int size)
1534{
1535 int i;
1536 for (i = 0 ; i < size ; i ++)
1537 {
1538 setUp->acked = FALSE;
1539 setUp++;
1540 }
1541}
1542
1511//int paT11NumTestPkts = T11_NUM_LOCAL_L4_HANDLES; 1543//int paT11NumTestPkts = T11_NUM_LOCAL_L4_HANDLES;
1512#ifndef SIMULATOR_SUPPORT 1544#ifndef SIMULATOR_SUPPORT
1513int paT11NumTestPkts = 4; 1545int paT11NumTestPkts = 4;
@@ -1595,16 +1627,19 @@ void paTestIPv6FragReassem (UArg a0, UArg a1)
1595 t11Cleanup (&t11Encap, newStatus); /* No return */ 1627 t11Cleanup (&t11Encap, newStatus); /* No return */
1596 1628
1597 /* Burst in the L2 configuraton */ 1629 /* Burst in the L2 configuraton */
1630 clearEthPrevCmdAck(&t11EthSetup, T11_NUM_LOCAL_L2_HANDLES);
1598 newStatus = t11OpenL2 (&t11Encap, t11EthSetup, T11_NUM_LOCAL_L2_HANDLES); 1631 newStatus = t11OpenL2 (&t11Encap, t11EthSetup, T11_NUM_LOCAL_L2_HANDLES);
1599 if (newStatus == PA_TEST_FAILED) 1632 if (newStatus == PA_TEST_FAILED)
1600 t11Cleanup (&t11Encap, newStatus); /* No return */ 1633 t11Cleanup (&t11Encap, newStatus); /* No return */
1601 1634
1602 /* Burst in the L3 configuration */ 1635 /* Burst in the L3 configuration */
1636 clearIpPrevCmdAck(&t11IpSetup, T11_NUM_LOCAL_L3_HANDLES);
1603 newStatus = t11OpenL3 (&t11Encap, t11IpSetup, T11_NUM_LOCAL_L3_HANDLES); 1637 newStatus = t11OpenL3 (&t11Encap, t11IpSetup, T11_NUM_LOCAL_L3_HANDLES);
1604 if (newStatus == PA_TEST_FAILED) 1638 if (newStatus == PA_TEST_FAILED)
1605 t11Cleanup (&t11Encap, newStatus); 1639 t11Cleanup (&t11Encap, newStatus);
1606 1640
1607 /* Burst in the L4 configuration */ 1641 /* Burst in the L4 configuration */
1642 clearUdpPrevCmdAck(&t11UdpSetup, T11_NUM_LOCAL_L4_HANDLES);
1608 newStatus = t11OpenL4 (&t11Encap, t11UdpSetup, T11_NUM_LOCAL_L4_HANDLES); 1643 newStatus = t11OpenL4 (&t11Encap, t11UdpSetup, T11_NUM_LOCAL_L4_HANDLES);
1609 if (newStatus == PA_TEST_FAILED) 1644 if (newStatus == PA_TEST_FAILED)
1610 t11Cleanup (&t11Encap, newStatus); 1645 t11Cleanup (&t11Encap, newStatus);
diff --git a/test/PAUnitTest/src/tests/test12.c b/test/PAUnitTest/src/tests/test12.c
index 16da071..3f2d257 100644
--- a/test/PAUnitTest/src/tests/test12.c
+++ b/test/PAUnitTest/src/tests/test12.c
@@ -867,6 +867,28 @@ int t12RxPkts (t12TestEncap_t *tencap, pauFifo_t *fifo)
867 867
868} 868}
869 869
870void t12ClrIpAck(t12IpPaSetup_t *ipSetup, int size)
871{
872 int i;
873
874 for ( i = 0; i < size; i++ )
875 {
876 ipSetup->acked = FALSE;
877 ipSetup ++;
878 }
879}
880
881void t12ClrAclInfo(t12AclPaSetup_t *aclSetup, int size)
882{
883 int i;
884
885 for ( i = 0; i < size; i++ )
886 {
887 aclSetup->acked = FALSE;
888 aclSetup ++;
889 }
890}
891
870#ifdef __LINUX_USER_SPACE 892#ifdef __LINUX_USER_SPACE
871void* paTestACL (void *args) 893void* paTestACL (void *args)
872{ 894{
@@ -981,24 +1003,30 @@ void paTestACL (UArg a0, UArg a1)
981 1003
982 /* Configure Outer IP (which are linked to MAC) */ 1004 /* Configure Outer IP (which are linked to MAC) */
983 n = sizeof (t12OuterIpInfo) / sizeof (t12IpPaSetup_t); 1005 n = sizeof (t12OuterIpInfo) / sizeof (t12IpPaSetup_t);
1006 t12ClrIpAck(&t12OuterIpInfo[0], n);
984 newStatus = t12OpenIp (&t12Encap, t12OuterIpInfo, n, t12Encap.l2Handles, "Outer IP headers"); 1007 newStatus = t12OpenIp (&t12Encap, t12OuterIpInfo, n, t12Encap.l2Handles, "Outer IP headers");
985 if (newStatus == PA_TEST_FAILED) 1008 if (newStatus == PA_TEST_FAILED)
986 t12Cleanup (&t12Encap, newStatus); /* No return */ 1009 t12Cleanup (&t12Encap, newStatus); /* No return */
987 1010
988 /* Repeat for Inner IP (which are linked to outer IP packets) */ 1011 /* Repeat for Inner IP (which are linked to outer IP packets) */
989 n = sizeof (t12InnerIpInfo) / sizeof (t12IpPaSetup_t); 1012 n = sizeof (t12InnerIpInfo) / sizeof (t12IpPaSetup_t);
1013 t12ClrIpAck(&t12InnerIpInfo[0], n);
990 newStatus = t12OpenIp (&t12Encap, t12InnerIpInfo, n, t12Encap.l3Handles, "Inner IP headers"); 1014 newStatus = t12OpenIp (&t12Encap, t12InnerIpInfo, n, t12Encap.l3Handles, "Inner IP headers");
991 if (newStatus == PA_TEST_FAILED) 1015 if (newStatus == PA_TEST_FAILED)
992 t12Cleanup (&t12Encap, newStatus); /* No return */ 1016 t12Cleanup (&t12Encap, newStatus); /* No return */
993 1017
994 /* Configure Outer ACL entries (which may be linked to inner IP) */ 1018 /* Configure Outer ACL entries (which may be linked to inner IP) */
995 n = sizeof (t12OuterAclInfo) / sizeof (t12AclPaSetup_t); 1019 n = sizeof (t12OuterAclInfo) / sizeof (t12AclPaSetup_t);
1020 /* Clear the ACL info set from previous run */
1021 t12ClrAclInfo(&t12OuterAclInfo[0], n);
996 newStatus = t12OpenAcl (&t12Encap, t12OuterAclInfo, n, t12Encap.l2Handles, t12Encap.aclHandles, "Outer ACL setup"); 1022 newStatus = t12OpenAcl (&t12Encap, t12OuterAclInfo, n, t12Encap.l2Handles, t12Encap.aclHandles, "Outer ACL setup");
997 if (newStatus == PA_TEST_FAILED) 1023 if (newStatus == PA_TEST_FAILED)
998 t12Cleanup (&t12Encap, newStatus); /* No return */ 1024 t12Cleanup (&t12Encap, newStatus); /* No return */
999 1025
1000 /* Repeat for Inner ACL entries packets (which may be linked to outer IP) */ 1026 /* Repeat for Inner ACL entries packets (which may be linked to outer IP) */
1001 n = sizeof (t12InnerAclInfo) / sizeof (t12AclPaSetup_t); 1027 n = sizeof (t12InnerAclInfo) / sizeof (t12AclPaSetup_t);
1028 /* Clear the ACL info set from previous run */
1029 t12ClrAclInfo(&t12InnerAclInfo[0], n);
1002 newStatus = t12OpenAcl (&t12Encap, t12InnerAclInfo, n, t12Encap.l3Handles, t12Encap.aclHandles, "Inner ACL setup"); 1030 newStatus = t12OpenAcl (&t12Encap, t12InnerAclInfo, n, t12Encap.l3Handles, t12Encap.aclHandles, "Inner ACL setup");
1003 if (newStatus == PA_TEST_FAILED) 1031 if (newStatus == PA_TEST_FAILED)
1004 t12Cleanup (&t12Encap, newStatus); /* No return */ 1032 t12Cleanup (&t12Encap, newStatus); /* No return */
diff --git a/test/PAUnitTest/src/tests/test15.c b/test/PAUnitTest/src/tests/test15.c
index c9566e7..246a3fc 100644
--- a/test/PAUnitTest/src/tests/test15.c
+++ b/test/PAUnitTest/src/tests/test15.c
@@ -865,12 +865,25 @@ static paTestStatus_t t15OpenAcl (t15TestEncap_t *tencap, t15AclPaSetup_t *aclS
865 tencap->tf->QGen[Q_CMD_RECYCLE], tencap->tf->QLinkedBuf2, 865 tencap->tf->QGen[Q_CMD_RECYCLE], tencap->tf->QLinkedBuf2,
866 &cmdReply, &cmdDest, &cmdSize, &paret); 866 &cmdReply, &cmdDest, &cmdSize, &paret);
867 867
868 if (hd == NULL) { 868 if (paret == pa_ACL_BUSY)
869 System_printf ("%s: (%s:%d): Failure in common addAcl command \n", tfName, __FILE__, __LINE__, id); 869 {
870 t15HandleError (tencap, paret, hd, __LINE__); 870 /* No action during Busy, this is just a check that LLD is returning Busy signal for the application
871 } 871 * Uncomment below System_printf() to see BUSY signal indications getting printed in the unit test
872 872 */
873 Qmss_queuePush (tencap->tf->QPaTx[cmdDest - pa_CMD_TX_DEST_0 + TF_PA_Q_CONFIG_BASE], (Ptr)hd, cmdSize, TF_SIZE_DESC, Qmss_Location_TAIL); 873 // System_printf(" Pa_addAcl returned ACL HW busy indication due to ACL busy indication \n");
874 System_flush();
875 }
876 else if ((hd == NULL) ||
877 (paret != pa_OK)) {
878 System_printf ("%s: (%s:%d): Failure in common addAcl command \n", tfName, __FILE__, __LINE__, id);
879 t15HandleError (tencap, paret, hd, __LINE__);
880 }
881 else {
882 tencap->aclHandles[T15_NUM_LOCAL_ACL_HANDLES-1].state = T15_HANDLE_PENDING_ACK;
883 /* Restore the descriptor and return it */
884 hd->buffLen = hd->origBufferLen;
885 Qmss_queuePush (tencap->tf->QLinkedBuf2, (Ptr)hd, hd->buffLen, TF_SIZE_DESC, Qmss_Location_TAIL);
886 }
874 } 887 }
875#endif 888#endif
876 889
@@ -912,6 +925,7 @@ static void t15InsertAclEntries(int aclInst, int udpPortStart, int rescoreStart,
912 925
913 for ( i = 0; i < numHandles; i++) { 926 for ( i = 0; i < numHandles; i++) {
914 aclPaSetup = t15AclInfoTemplate[0]; 927 aclPaSetup = t15AclInfoTemplate[0];
928 aclPaSetup.acked = FALSE;
915 aclPaSetup.aclInst = aclInst; 929 aclPaSetup.aclInst = aclInst;
916 aclPaSetup.aclInfo.dstPortBegin = udpPortStart; 930 aclPaSetup.aclInfo.dstPortBegin = udpPortStart;
917 aclPaSetup.aclInfo.dstPortEnd = udpPortStart + i; 931 aclPaSetup.aclInfo.dstPortEnd = udpPortStart + i;
@@ -1069,6 +1083,17 @@ int t15RxPkts (t15TestEncap_t *tencap, int outer)
1069 1083
1070} 1084}
1071 1085
1086void t15ClrIpAck(t15IpPaSetup_t *ipSetup, int size)
1087{
1088 int i;
1089
1090 for ( i = 0; i < size; i++ )
1091 {
1092 ipSetup->acked = FALSE;
1093 ipSetup ++;
1094 }
1095}
1096
1072#ifdef __LINUX_USER_SPACE 1097#ifdef __LINUX_USER_SPACE
1073void* paTestACLRescore (void *args) 1098void* paTestACLRescore (void *args)
1074{ 1099{
@@ -1187,12 +1212,14 @@ void paTestACLRescore (UArg a0, UArg a1)
1187 1212
1188 /* Configure Outer IP (which are linked to MAC) */ 1213 /* Configure Outer IP (which are linked to MAC) */
1189 n = sizeof (t15OuterIpInfo) / sizeof (t15IpPaSetup_t); 1214 n = sizeof (t15OuterIpInfo) / sizeof (t15IpPaSetup_t);
1215 t15ClrIpAck(&t15OuterIpInfo[0], n);
1190 newStatus = t15OpenIp (&t15Encap, t15OuterIpInfo, n, t15Encap.l2Handles, "Outer IP headers"); 1216 newStatus = t15OpenIp (&t15Encap, t15OuterIpInfo, n, t15Encap.l2Handles, "Outer IP headers");
1191 if (newStatus == PA_TEST_FAILED) 1217 if (newStatus == PA_TEST_FAILED)
1192 t15Cleanup (&t15Encap, newStatus); /* No return */ 1218 t15Cleanup (&t15Encap, newStatus); /* No return */
1193 1219
1194 /* Repeat for Inner IP (which are linked to outer IP packets) */ 1220 /* Repeat for Inner IP (which are linked to outer IP packets) */
1195 n = sizeof (t15InnerIpInfo) / sizeof (t15IpPaSetup_t); 1221 n = sizeof (t15InnerIpInfo) / sizeof (t15IpPaSetup_t);
1222 t15ClrIpAck(&t15InnerIpInfo[0], n);
1196 newStatus = t15OpenIp (&t15Encap, t15InnerIpInfo, n, t15Encap.l3Handles, "Inner IP headers"); 1223 newStatus = t15OpenIp (&t15Encap, t15InnerIpInfo, n, t15Encap.l3Handles, "Inner IP headers");
1197 if (newStatus == PA_TEST_FAILED) 1224 if (newStatus == PA_TEST_FAILED)
1198 t15Cleanup (&t15Encap, newStatus); /* No return */ 1225 t15Cleanup (&t15Encap, newStatus); /* No return */
diff --git a/test/PAUnitTest/src/tests/test3.c b/test/PAUnitTest/src/tests/test3.c
index 9802076..7d955cf 100644
--- a/test/PAUnitTest/src/tests/test3.c
+++ b/test/PAUnitTest/src/tests/test3.c
@@ -85,7 +85,7 @@ static char *tfName = "paTestTxFormatRoute";
85 85
86static paSysStats_t paTestTxFmtExptStats; /* Expected stats results */ 86static paSysStats_t paTestTxFmtExptStats; /* Expected stats results */
87static uint32_t paT3txCmdBuf[4][128/sizeof(uint32_t)]; 87static uint32_t paT3txCmdBuf[4][128/sizeof(uint32_t)];
88static uint16_t paT3cmdStackSize[4] = {128, 128, 128, 128}; 88static uint16_t paT3cmdStackSize[4];
89 89
90/* 90/*
91 * Format Tx commands for the following two test cases 91 * Format Tx commands for the following two test cases
@@ -1396,6 +1396,11 @@ void paTestTxFmtRt (UArg a0, UArg a1)
1396 cmdReply.queue = (uint16_t) tf->QGen[Q_CMD_REPLY]; 1396 cmdReply.queue = (uint16_t) tf->QGen[Q_CMD_REPLY];
1397 cmdReply.flowId = tf->tfFlowNum[0]; 1397 cmdReply.flowId = tf->tfFlowNum[0];
1398 1398
1399 /* set the t3 command stack size */
1400 paT3cmdStackSize[0] = paT3cmdStackSize[1] = paT3cmdStackSize[2] = paT3cmdStackSize[3] = 128;
1401
1402 /* set the template packet */
1403 memcpy (&t3pkt[0], &t3pkt_template[0], sizeof(t3pkt_template));
1399 1404
1400 /* Zero the expected stats. They are updated as the test progresses */ 1405 /* Zero the expected stats. They are updated as the test progresses */
1401 memset (&paTestTxFmtExptStats, 0, sizeof(paTestTxFmtExptStats)); 1406 memset (&paTestTxFmtExptStats, 0, sizeof(paTestTxFmtExptStats));
diff --git a/test/PAUnitTest/src/tests/test3pkts.h b/test/PAUnitTest/src/tests/test3pkts.h
index d58aff3..ff8ef93 100644
--- a/test/PAUnitTest/src/tests/test3pkts.h
+++ b/test/PAUnitTest/src/tests/test3pkts.h
@@ -39,9 +39,13 @@
39#ifdef _TMS320C6X 39#ifdef _TMS320C6X
40#pragma DATA_SECTION(t3pkt, ".testPkts") 40#pragma DATA_SECTION(t3pkt, ".testPkts")
41#pragma DATA_ALIGN(t3pkt, 8) 41#pragma DATA_ALIGN(t3pkt, 8)
42static uint8_t t3pkt[] = { 42static uint8_t t3pkt[256];
43#pragma DATA_SECTION(t3pkt_template, ".testPkts")
44#pragma DATA_ALIGN(t3pkt_template, 8)
45static uint8_t t3pkt_template[] = {
43#else 46#else
44static uint8_t t3pkt[] __attribute__ ((aligned (8))) = { 47static uint8_t t3pkt[256] __attribute__ ((aligned (8)));
48static uint8_t t3pkt_template[] __attribute__ ((aligned (8))) = {
45#endif 49#endif
46 /* MAC header */ 50 /* MAC header */
47 0x00, 0x01, 0x02, 0x03, 0x04, 0xaa, 51 0x00, 0x01, 0x02, 0x03, 0x04, 0xaa,
diff --git a/test/PAUnitTest/src/tests/test5.c b/test/PAUnitTest/src/tests/test5.c
index f5b8792..320dc5d 100644
--- a/test/PAUnitTest/src/tests/test5.c
+++ b/test/PAUnitTest/src/tests/test5.c
@@ -2874,6 +2874,65 @@ static int setupPktTestInfo2(pktTestInfo2_t* testInfoPkt, int count, char* tfnam
2874 2874
2875#endif 2875#endif
2876 2876
2877void t5ClearL2State(t5EthSetup_t* ethSetup, int num)
2878{
2879 int i;
2880
2881 for ( i = 0; i < num ; i++ )
2882 {
2883 ethSetup->acked = FALSE;
2884 ethSetup++;
2885 }
2886}
2887
2888void t5ClearL3State(t5IpSetup_t* ipSetup, int num)
2889{
2890 int i;
2891
2892 for ( i = 0; i < num ; i++ )
2893 {
2894 ipSetup->acked = FALSE;
2895 ipSetup++;
2896 }
2897}
2898
2899void t5ClearSpiL3State(t5SpiIpSetup_t* spiIpSetup, int num)
2900{
2901 int i;
2902
2903 for ( i = 0; i < num ; i++ )
2904 {
2905 spiIpSetup->acked = FALSE;
2906 spiIpSetup++;
2907 }
2908}
2909#if 0 // For Debug only
2910uint32_t t5UserStatsFifoIndex[300][10];
2911uint32_t testIndex = 0;
2912void t5CopyUserStatsFifoIndex(uint32_t errCode)
2913{
2914 int i;
2915 uint32_t *addr = (uint32_t *) (0x26980000);
2916
2917 if (testIndex >= 300)
2918 {
2919 testIndex = 0;
2920 }
2921
2922 t5UserStatsFifoIndex[testIndex][0] = (uint32_t) ((uint32_t)errCode << 16 | testIndex);
2923 for (i = 1; i < 9; i++ )
2924 {
2925 t5UserStatsFifoIndex[testIndex][i] = *addr;
2926 /* Point to next PDSP */
2927 addr += 0x10;
2928 }
2929
2930 t5UserStatsFifoIndex[testIndex][9] = (uint32_t) ((uint32_t)errCode << 16 | testIndex);
2931
2932 testIndex++;
2933}
2934#endif
2935
2877#ifdef __LINUX_USER_SPACE 2936#ifdef __LINUX_USER_SPACE
2878void* paTestL4Routing (void *args) 2937void* paTestL4Routing (void *args)
2879{ 2938{
@@ -2901,6 +2960,7 @@ void paTestL4Routing (UArg a0, UArg a1)
2901 /* Initialize the test state */ 2960 /* Initialize the test state */
2902 numUsrStatsEntries = sizeof(t5UsrStatsSetup)/sizeof(pauUsrStatsSetup_t); 2961 numUsrStatsEntries = sizeof(t5UsrStatsSetup)/sizeof(pauUsrStatsSetup_t);
2903 2962
2963 t5NumUsrStats = 0;
2904 fifo.data = fifoData; 2964 fifo.data = fifoData;
2905 memset (&t5Encap, 0, sizeof(t5Encap)); 2965 memset (&t5Encap, 0, sizeof(t5Encap));
2906 t5Encap.tf = (tFramework_t *)a0; 2966 t5Encap.tf = (tFramework_t *)a0;
@@ -3010,16 +3070,19 @@ void paTestL4Routing (UArg a0, UArg a1)
3010 } 3070 }
3011#endif 3071#endif
3012 /* Burst in the L2 configuraton */ 3072 /* Burst in the L2 configuraton */
3073 t5ClearL2State(&t5EthSetup[0], T5_NUM_LOCAL_L2_HANDLES);
3013 newStatus = t5OpenL2 (&t5Encap, t5EthSetup, T5_NUM_LOCAL_L2_HANDLES); 3074 newStatus = t5OpenL2 (&t5Encap, t5EthSetup, T5_NUM_LOCAL_L2_HANDLES);
3014 if (newStatus == PA_TEST_FAILED) 3075 if (newStatus == PA_TEST_FAILED)
3015 t5Cleanup (&t5Encap, newStatus); /* No return */ 3076 t5Cleanup (&t5Encap, newStatus); /* No return */
3016 3077
3017 /* Burst in the L3 configuration */ 3078 /* Burst in the L3 configuration */
3079 t5ClearL3State(&t5IpSetup[0], T5_NUM_LOCAL_L3_HANDLES);
3018 newStatus = t5OpenL3 (&t5Encap, t5IpSetup, T5_NUM_LOCAL_L3_HANDLES); 3080 newStatus = t5OpenL3 (&t5Encap, t5IpSetup, T5_NUM_LOCAL_L3_HANDLES);
3019 if (newStatus == PA_TEST_FAILED) 3081 if (newStatus == PA_TEST_FAILED)
3020 t5Cleanup (&t5Encap, newStatus); 3082 t5Cleanup (&t5Encap, newStatus);
3021 3083
3022 /* Burst in the SPI with Link L3 configuration */ 3084 /* Burst in the SPI with Link L3 configuration */
3085 t5ClearSpiL3State(&t5SpiIpSetup[0], T5_NUM_LOCAL_SPI_L3_HANDLES);
3023 newStatus = t5OpenSpiL3 (&t5Encap, t5SpiIpSetup, T5_NUM_LOCAL_SPI_L3_HANDLES); 3086 newStatus = t5OpenSpiL3 (&t5Encap, t5SpiIpSetup, T5_NUM_LOCAL_SPI_L3_HANDLES);
3024 if (newStatus == PA_TEST_FAILED) 3087 if (newStatus == PA_TEST_FAILED)
3025 t5Cleanup (&t5Encap, newStatus); 3088 t5Cleanup (&t5Encap, newStatus);
@@ -3065,7 +3128,7 @@ void paTestL4Routing (UArg a0, UArg a1)
3065 3128
3066 for (j = 0; j < T5_NUM_LOCAL_L4_HANDLES; j += T5_NUM_LOCAL_L3_HANDLES) { 3129 for (j = 0; j < T5_NUM_LOCAL_L4_HANDLES; j += T5_NUM_LOCAL_L3_HANDLES) {
3067 3130
3068 for (i = n = 0; (i < T5_NUM_LOCAL_L3_HANDLES) && (i+j < T5_NUM_LOCAL_L4_HANDLES); i++) { 3131 for (i = n = 0; (i < T5_NUM_LOCAL_L3_HANDLES) && ((i+j) < T5_NUM_LOCAL_L4_HANDLES); i++) {
3069 3132
3070 3133
3071 /* Set the destination TCP/UDP port */ 3134 /* Set the destination TCP/UDP port */
@@ -3093,7 +3156,9 @@ void paTestL4Routing (UArg a0, UArg a1)
3093 Qmss_queuePush (t5Encap.tf->QPaTx[TF_PA_Q_TXCMD], (Ptr)t5Encap.hd[i], t5PktInfo[i].pktLen, TF_SIZE_DESC, Qmss_Location_TAIL); 3156 Qmss_queuePush (t5Encap.tf->QPaTx[TF_PA_Q_TXCMD], (Ptr)t5Encap.hd[i], t5PktInfo[i].pktLen, TF_SIZE_DESC, Qmss_Location_TAIL);
3094 //Qmss_queuePush (t5Encap.tf->QPaTx[TF_PA_Q_INPUT], (Ptr)t5Encap.hd[i], t5PktInfo[i].pktLen, TF_SIZE_DESC, Qmss_Location_TAIL); 3157 //Qmss_queuePush (t5Encap.tf->QPaTx[TF_PA_Q_INPUT], (Ptr)t5Encap.hd[i], t5PktInfo[i].pktLen, TF_SIZE_DESC, Qmss_Location_TAIL);
3095 //if(j == 12)while (mdebugWait); 3158 //if(j == 12)while (mdebugWait);
3096 3159
3160 /* Allow some time for the packet to be processed */
3161 utilCycleDelay (1000);
3097 n += 1; 3162 n += 1;
3098 t5Encap.hd[i] = NULL; 3163 t5Encap.hd[i] = NULL;
3099 3164
@@ -3166,11 +3231,23 @@ void paTestL4Routing (UArg a0, UArg a1)
3166 3231
3167 /* LUT2 Queue Diversion Test */ 3232 /* LUT2 Queue Diversion Test */
3168 t5SendDataPackets(&t5Encap, T5_FIRST_DEST_PORT, 10, 0); 3233 t5SendDataPackets(&t5Encap, T5_FIRST_DEST_PORT, 10, 0);
3169 3234
3235 /* Give some time for all the packets to get through the system */
3236 utilCycleDelay (5000);
3237
3170 newStatus = t5UpdateL4(&t5Encap, T5_FIRST_DEST_PORT); 3238 newStatus = t5UpdateL4(&t5Encap, T5_FIRST_DEST_PORT);
3171 if (newStatus == PA_TEST_FAILED) 3239 if (newStatus == PA_TEST_FAILED)
3172 t5Cleanup (&t5Encap, newStatus); 3240 t5Cleanup (&t5Encap, newStatus);
3173 3241
3242#ifndef SIMULATOR_SUPPORT
3243 /* All packets should have diverted from Q_MATCH to Q_MATCH2, otherwise test fails */
3244 if (Qmss_getQueueEntryCount(t5Encap.tf->QGen[Q_MATCH]) > 0)
3245 {
3246 System_printf(" Did not divert all packets from Queue diversion \n");
3247 System_flush();
3248 t5Cleanup(&t5Encap, PA_TEST_FAILED);
3249 }
3250#endif
3174 t5SendDataPackets(&t5Encap, T5_FIRST_DEST_PORT, 10, 10); 3251 t5SendDataPackets(&t5Encap, T5_FIRST_DEST_PORT, 10, 10);
3175 3252
3176 /* Give some time for all the packets to get through the system */ 3253 /* Give some time for all the packets to get through the system */