Hi to all
i try to classify packet using PA . i run PA_multicore example (from PDK 2_1_2_6) successfully on c6678 EVM and received packet classified based on MAC, IP , Port and each 8 core receive specified packet
but when i boot Linux c6x on core 0 and run modified version of PA_multicore (sys/bios application) on core 1 , PA PDSP not response to command packet and code report "Timeout waiting for reply from PA to Pa_addMac command"
QMSS,cppi initialized correctly and when i remove Setup_PASS () function, sys/bios send packet correctly and Linux c6x work without problem (PA_multicore send packet without using PA and QMSS forward packets from host to switch directly)
this is my Add_MACAddress function (changed line specified by //EA:2):
Int32 Add_MACAddress (Void) { Int32 j; UInt16 cmdSize; Qmss_Queue cmdReplyQInfo; paEthInfo_t ethInfo = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* Src mac = dont care */ { 0x00, 0x17, 0xea, 0xd0, 0x18, 0x9c }, /*EA:2 Dest mac */ 0, /* vlan = dont care */ 0x0800, /* ether type = IPv4 */ 0, /* MPLS tag = dont care */ 0 /* Input EMAC port = dont care */ }; paRouteInfo_t routeInfo = { pa_DEST_CONTINUE_PARSE_LUT1, /* Continue parsing */ 0, /* Flow Id = dont care */ 0, /* queue = dont care */ 0, /* multi route = dont care */ 0, /* swinfo0 = dont care */ 0, /* SwInfo 1 is dont care */ 0, /* customType = pa_CUSTOM_TYPE_NONE */ \ 0, /* customIndex: not used */ \ 0, /* pkyType: for SRIO only */ \ NULL /* No commands */ }; paRouteInfo_t nFailInfo = { pa_DEST_DISCARD, /* Toss the packet */ 0, /* Flow Id = dont care */ 0, /* queue = dont care */ 0, /* mutli route = dont care */ 0, /* swinfo0 = dont care */ 0, /* SwInfo 1 is dont care */ 0, /* customType = pa_CUSTOM_TYPE_NONE */ \ 0, /* customIndex: not used */ \ 0, /* pkyType: for SRIO only */ \ NULL /* No commands */ }; paCmdReply_t cmdReplyInfo = { pa_DEST_HOST, /* Replies go to the host */ 0, /* User chosen ID to go to swinfo0 */ 0, /* Destination queue */ 0 /* Flow ID */ }; paReturn_t retVal; paEntryHandle_t retHandle; Int32 handleType, cmdDest; UInt32 psCmd = ((UInt32)(4 << 5) << 24); UInt32 myswinfo[] = {0x11112222, 0x33334444}; Cppi_HostDesc* pHostDesc; /* Get a Tx free descriptor to send a command to the PA PDSP */ if ((pHostDesc = Qmss_queuePop (gTxFreeQHnd)) == NULL) { System_printf ("Error obtaining a Tx free descriptor \n"); return -1; } /* The descriptor address returned from the hardware has the * descriptor size appended to the address in the last 4 bits. * * To get the true descriptor pointer, always mask off the last * 4 bits of the address. */ pHostDesc = (Ptr) ((UInt32) pHostDesc & 0xFFFFFFF0); CSL_XMC_invalidatePrefetchBuffer(); SYS_CACHE_INV (pHostDesc, SIZE_HOST_DESC, CACHE_FENCE_WAIT); SYS_CACHE_INV ((Ptr)pHostDesc->buffPtr, pHostDesc->buffLen, CACHE_FENCE_WAIT); pHostDesc->buffLen = pHostDesc->origBufferLen; cmdSize = pHostDesc->buffLen; cmdReplyInfo.replyId = 0x55550000; /* unique for each add mac command */ /* Get the PA response queue number and populate the destination queue number * in the PA response configuration. */ cmdReplyQInfo = Qmss_getQueueNumber (gPaCfgCmdRespQHnd); cmdReplyInfo.queue = cmdReplyQInfo.qNum; cmdReplyInfo.flowId = (uint8_t)Cppi_getFlowId(gRxFlowHnd); retVal = Pa_addMac (gPAInstHnd, 10,//EA:2 pa_LUT1_INDEX_NOT_SPECIFIED, ðInfo, &routeInfo, &nFailInfo, &gPaL2Handles[0], (paCmd_t) pHostDesc->buffPtr, &cmdSize, &cmdReplyInfo, &cmdDest); if (retVal != pa_OK) { System_printf ("Pa_addMac returned error %d\n", retVal); return -1; } /* This sets the extended info for descriptors, and this is required so PS info * goes to the right spot */ Cppi_setSoftwareInfo (Cppi_DescType_HOST, (Cppi_Desc *)pHostDesc, (UInt8 *)myswinfo); /* Set the buffer length to the size used. It will be restored when the descriptor * is returned */ Cppi_setPacketLen (Cppi_DescType_HOST, (Cppi_Desc *)pHostDesc, cmdSize); pHostDesc->buffLen = cmdSize; /* Mark the packet as a configuration packet */ Cppi_setPSData (Cppi_DescType_HOST, (Cppi_Desc *)pHostDesc, (UInt8 *)&psCmd, 4); /* Send the command to the PA and wait for the return */ SYS_CACHE_WB (pHostDesc, SIZE_HOST_DESC, CACHE_FENCE_WAIT); SYS_CACHE_WB ((Ptr)pHostDesc->buffPtr, pHostDesc->buffLen, CACHE_FENCE_WAIT); Qmss_queuePush (gPaTxQHnd[cmdDest - pa_CMD_TX_DEST_0], pHostDesc, pHostDesc->buffLen, SIZE_HOST_DESC, Qmss_Location_TAIL ); /* Poll on the PA response queue to see if response from PA has come */ for (j = 0; j < 1000; j++)//EA:2 { CycleDelay (1000); if (Qmss_getQueueEntryCount (gPaCfgCmdRespQHnd) > 0) { /* We have a response from PA PDSP for the command we submitted earlier for * MAC address addition. */ pHostDesc = Qmss_queuePop (gPaCfgCmdRespQHnd); /* Clear the size bytes */ pHostDesc = (Ptr) ((UInt32) pHostDesc & 0xFFFFFFF0); SYS_CACHE_INV (pHostDesc, SIZE_HOST_DESC, CACHE_FENCE_WAIT); SYS_CACHE_INV ((Ptr)pHostDesc->buffPtr, pHostDesc->buffLen, CACHE_FENCE_WAIT); if (pHostDesc->softwareInfo0 != cmdReplyInfo.replyId) { System_printf ("Add_MACAddress: Found an entry in PA response queue with swinfo0 = 0x%08x, expected 0x%08x\n", pHostDesc->softwareInfo0, cmdReplyInfo.replyId); pHostDesc->buffLen = pHostDesc->origBufferLen; SYS_CACHE_WB (pHostDesc, SIZE_HOST_DESC, CACHE_FENCE_WAIT); Qmss_queuePush (gRxFreeQHnd, pHostDesc, pHostDesc->buffLen, SIZE_HOST_DESC, Qmss_Location_TAIL); return -1; } retVal = Pa_forwardResult (gPAInstHnd, (Ptr)pHostDesc->buffPtr, &retHandle, &handleType, &cmdDest); if (retVal != pa_OK) { System_printf ("PA sub-system rejected Pa_addMac command\n"); return -1; } /* Reset the buffer lenght and put the descriptor back on the Tx free queue */ pHostDesc->buffLen = pHostDesc->origBufferLen; SYS_CACHE_WB (pHostDesc, SIZE_HOST_DESC, CACHE_FENCE_WAIT); Qmss_queuePush (gRxFreeQHnd, pHostDesc, pHostDesc->buffLen, SIZE_HOST_DESC, Qmss_Location_TAIL); break; } } if (j == 1000)//EA:2 { System_printf ("Timeout waiting for reply from PA to Pa_addMac command\n"); return -1; } return 0; }
"Linux statically takes several indexes in PA entries which the example should avoid"
i change index in PA_addMac "pa_LUT1_INDEX_NOT_SPECIFIED" to 10
i see some E2E post with similar problem (all of this post Not Answered)
"Timeout waiting for reply from PA to Pa_addMac command"
Pa_addMAC fails when integrating with SRIO
PA PDSP designed to multiple classify and route packets.any body can help me to add multiple route in my multicore applications ?
thanks for reading
Ebi