Spaces:

arjun.a
range data
5aefcf4
raw
history blame
18.9 kB
Ticket Name: Add source & destination in IP & ports & compare with LUT in NetCP Packet Accelerator
Query Text:
Other Parts Discussed in Thread: AM5K2E04 Hi, We started working Linux Network CoProcessor NetCP Yocto BSP [sdk-06.03.00.106] works on AM5k2E04 board, get driver source available in Kernel 4.4.19. We need to capture Ethernet packets from FTP connection, Add source IP & destination IP, source port & destination port From Packet accelerator driver [drivers/net/ethernet/ti/netcp_pa.c] We able to see pa_add_mac_rule API to compare source & destination mac. We referred Packet accelerator user guide to adding entries & PA API's for TI PDK source packages. Here we want Linux drivers API's for adding IP, Mac, Port & LUT, Comparing with LUT for header extractions. Anyone please provide API for creating Lookup table & add source & destination IP & ports in Linux Kernel PA drivers for NetCP. Regards, Santhana Kumar S
Responses:
Hi, Santhana, You may want to develop your own. These API's will be feature requests to TI PLSDK. I'll keep the thread open to see if there is any contribution from cummunity. Rex
Thanks for your response. Can you please help to let me know from your community.
Hi Rex, Any updates for this thread?
Hi, Santhana, The community I meant is the contribution from non-TI member in the forum. .Any specific kernel APIs will be feature request. It will need to go through business review before it can be implemented. Rex
Hi Rex, I understand for this thread, you are telling non TI member will be support for this thread. So anyone from TI Community member worked in NetCP, Packet Accelerator add this thread for them. still doubt in using netcp.
Hi, Any updates about this thread. Please support this thread for giving me brief explanation of Packet Accelerator driver code to use in NetCP linux BSP. Regards, SanthanaKumarS
Hi, Santhana, Please refer to PA User's Guide: https://www.ti.com/lit/ug/spruhz2/spruhz2.pdf Rex software-dl.ti.com/.../NetCP.html
Sorry, my post content messed up. PA User's Guide: www.ti.com/.../spruhz2.pdf NetCP Guide: software-dl.ti.com/.../NetCP.html Rex
Hi, We are using Yocto BSP for porting NetCP in AM5K2E04 board Can you please detailed explanation of Packet Accelerator code for packages/ti/drv/pa & drivers/net/ethernet/ti/netcp_pa.c Referred PA user guide, For packages PA consists of Pa_addLUT, Pa_addMac, Pa_addIP, Pa_addPort & Firmware API in ti/drv/pa/fw Source Code : NetCP PA : netcp-pa-fw/1_2020.4.16-r0.4/git/ti/drv/pa/ NetCP PA Linux: drivers/net/ethernet/ti/netcp_pa.c We need to use capture Ethernet packets from FTP Connection to adding LUT, MAC, IP & port & compare in to LUT table for adding queues in Yocto BSP Linux side Rex, Please guide me to help on this
Hi, Santhana, Theoretically, Yocto is just a way to build. It shouldn't be any difference in terms of kernel source code. I don't see the netcp_pa.c in PLSDK kernel source code. I'll need to clone it and see what's in that repository. I don't know the answer on top of my head. Rex
Hi, Yocto source is build for Kernel & u-boot images. Here I attached PA driver file. Thanks for your daily update, You provided NetCP & PA user guide, We refer some LLD API's provide for CCS StandAlone Application to interface with NetCP PA. Note: We need Linux side not for CCS StandAlone Application. We need to capture Ethernet packets from FTP connection, Below we are given points to test in Linux AM5k2e04 Keystone SOC board. 1. Enable Packet Accelerator to send & receive FTP data 2. Disable Packet Accelerator to send & receive FTP data In both the cases, We should receive FTP packets from NetCP & Can you please connect mail to Yocto Linux BSP side for worked in NetCP PA. Then we have a good clarity to use NetCP PA in Linux side. Regards, SanthanaKumarS
Hi Rex, We configured Netcp interfaces in K2E EVM board, & we able to run packet accelerator application to run paMCExample.out from given by Packet accelerator provided. Here we attached Log to testing my multicore application to test adding Ip, MAC & port between source & destination packets. For our test results, Application is passing but i can't able to see my packets in Wireshark application from PC. Please check my logs & code to give me solutions for this. Can you please tell me the changes to adding MAC, IP & ports & packet buffer in source code to please mention which source & destination MAC, IP & ports to given in source code Add_MACAddress - paEthInfo_t ethInfo = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* Src mac = dont care */ { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15 }, /* Dest MAC */ 0, /* vlan = dont care */ 0x0800, /* ether type = IPv4 */ 0, /* MPLS tag = dont care */ 0 /* Input EMAC port = dont care */ Add_IP - paIpInfo_t ipInfo = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* IP source = dont care */ { 0xc0, 0xa8, 0x01, 0xa, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },* IP dest */ Add_Port - int16_t ports = {0x5678}; paRouteInfo_t routeInfo = { pa_DEST_HOST, /* Route a match to the host */ 0, /* Flow ID 0 */ 0, /* Destination queue */ -1, /* Multi route disabled */ 0xaaaaaaaa, /* SwInfo 0 */ 0, /* SwInfo 1 is dont care */ 0, /* customType = pa_CUSTOM_TYPE_NONE */ \ 0, /* customIndex: not used */ \ 0, /* pkyType: for SRIO only */ \ NULL /* No commands */ }; SendPacket() - uint8_t pktMatchBuf[PACKET_SIZE] = { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, /* Dest MAC */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, /* Src MAC */ 0x08, 0x00, /* Ethertype = IPv4 */ 0x45, 0x00, 0x00, 0x6c, /* IP version, services, total length */ 0x00, 0x00, 0x00, 0x00, /* IP ID, flags, fragment offset */ 0x05, 0x11, 0x32, 0x26, /* IP ttl, protocol (UDP), header checksum */ 0xc0, 0xa8, 0x01, 0x01, /* Source IP address */ 0xc0, 0xa8, 0x01, 0x0a, /* Destination IP address */ 0x12, 0x34, 0x56, 0x78, /* UDP source port, dest port */ 0x00, 0x58, 0x1d, 0x18, /* UDP len, UDP checksum */ 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, /* 80 bytes of payload data */ 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81 }; Command line testing ================================== # rmServer.out /usr/bin/device/k2e/global-resource-list.dtb /usr/bin/device/k2e/policy_dsp_arm.dtb # paMCExample.out root@AM5K2E04:~# paMCExample_k2e.out No command line given. Forking off 4 tasks ************************************************ *** PA Multi Core Example Started on Core 0 *** ************************************************ ************************************************ ************************************************ *** PA Multi Core Example Started on Core 1 *** *** PA Multi Core Example Started on Core 3 *** ************************************************ ************************************************ Initialized RM_Client0 Waiting for global config (core 1) ... Waiting for global config (core 3) ... ************************************************ *** PA Multi Core Example Started on Core 2 *** ************************************************ Waiting for global config (core 2) ... Initializing Free Descriptors. QMSS successfully initialized Unable to open below cppi tx channels...presuming linux has already enabled it 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 Unable to open below cppi Rx channels...presuming linux has already enabled it 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 6 CPPI successfully initialized PASS successfully initialized Tx setup successfully done Rx setup successfully done Add_MAC successful for corenum:0 Add_IP successful for corenum:0 Destination for the packet Rx queue: 1027 (Core 0) Add_Port successful for corenum:0 PASS setup successfully done Publishing global config Done from SYSINIT Core... Publishing local config done from core num: 0... Waiting for all cores to reach the barrier before transmission starts ... Initialized RM_Client1 Initialized RM_Client3 QMSS Local successfully initialized Initialized RM_Client2 QMSS Local successfully initialized CPPI Local successfully initialized QMSS Local successfully initialized CPPI Local successfully initialized PA Local successfully initialized CPPI Local successfully initialized PA Local successfully initialized PA Local successfully initialized Rx setup successfully done Rx setup successfully done Rx setup successfully done Destination for the packet Rx queue: 1031 (Core 3) Add_Port successful for corenum:3 PASS setup successfully done Publishing local config done from core num: 3... Waiting for all cores to reach the barrier before transmission starts ... Destination for the packet Rx queue: 1032 (Core 1) Add_Port successful for corenum:1 PASS setup successfully done Publishing local config done from core num: 1... Waiting for all cores to reach the barrier before transmission starts ... Destination for the packet Rx queue: 1033 (Core 2) Add_Port successful for corenum:2 PASS setup successfully done Publishing local config done from core num: 2... Waiting for all cores to reach the barrier before transmission starts ... Packet Transmission Start ... core id: 2 Packet Transmission Done. Wait for all packets to be Received ... core num: 2 Core 2: Packets Sent = 10 Core 2: Packets Received = 10 --- PA (2) User-defined STATS --- number of Rx bytes(index = 3): 1220 number of Rx packets (index = 67): 10 Core 2 : CPPI CPDMA closed successfully Core 2 : CPPI exit successful Core 2: exit QMSS Updating the Test Status core: 2, status:TEST_PASSED Done... ********************************************** *** PA Multi Core Example Ended on Core 2 *** ********************************************** Packet Transmission Start ... core id: 0 Packet Transmission Done. Wait for all packets to be Received ... core num: 0 Core 0: Packets Sent = 10 Core 0: Packets Received = 10 Wait for all packets to be Received in all cores... Updating the Test Status core: 0, status:TEST_PASSED Packet Transmission Start ... core id: 3 Packet Transmission Done. Wait for all packets to be Received ... core num: 3 Core 3: Packets Sent = 10 Core 3: Packets Received = 10 --- PA (3) User-defined STATS --- number of Rx bytes(index = 1): 1220 number of Rx packets (index = 65): 10 Packet Transmission Start ... core id: 1 Packet Transmission Done. Wait for all packets to be Received ... core num: 1 Core 1: Packets Sent = 10 Core 1: Packets Received = 10 --- PA (1) User-defined STATS --- number of Rx bytes(index = 2): 1220 number of Rx packets (index = 66): 10 Core 3 : CPPI CPDMA closed successfully Core 3 : CPPI exit successful Core 3: exit QMSS Updating the Test Status core: 3, status:TEST_PASSED Done... ********************************************** *** PA Multi Core Example Ended on Core 3 *** ********************************************** Core 1 : CPPI CPDMA closed successfully Core 1 : CPPI exit successful Core 1: exit QMSS Updating the Test Status core: 1, status:TEST_PASSED Done... ********************************************** *** PA Multi Core Example Ended on Core 1 *** ********************************************** All tests have passed! --- PA (0) User-defined STATS --- number of Rx bytes(index = 0): 1220 number of Rx packets (index = 64): 10 Core 0 : CPPI CPDMA closed successfully Core 0 : CPPI exit successful Core 0: exit QMSS Done... ********************************************** *** PA Multi Core Example Ended on Core 0 *** ********************************************** Waiting for children to exit All children passed
Hi, Santhana, I am not familiar with paMCExample and it doesn't ring any bell. Could you provide more info about it? Rex
Hi Rex, We configured NetCP interfaces & tested Ethernet its working fine. In K2E evm board, there is packet accelerator & Security accelerator components. So we need to use packet accelerator to add Ip, Mac & ports in Lookup table to comparing mac, ip & ports to do some experiment. We are using PA LLD api's Add_MACAddress, Add_IPAddress & Add_Port for adding MAC, IP & ports in Lookup table. Here we using pa/example/multicoreExample/src/pa_mgmt.c , for sent/receive packet to handling packet from source to destination. Mainly we need to use Packet accelerator to handling packets from evm board. We are looking for pa example codes to handling packets from board Ethernet to other Ethernet connection
Hi, Santhana, I'll need to ask the expert who is familiar with PDK PA example to take a look. Are you trying to implement NAT in Linux? Rex
Hi Rex, Thanks for your attention. We need to add our ip,port & mac using PA LLD api's & sending packets from evm board to specific added MAC in PA example codes. We tried to added destination MAC, IP & ports but packets not receiving, & not able to see my IP address Wireshark application . Here we added IP, MAC & ports in PA LLD api's & attched logs. Please talk to your PA LLD experts & let me know the solutions for this. Code : example/multicoreExample/src/local_variables.c ====================================================== 0xe0, 0xd5, 0x5e, 0x37, 0xbc, 0xec,/* Dest MAC */ -------> This is my PC MAC address 0x02, 0x18, 0x31, 0x7e, 0x3e, 0x00, /* Src MAC */ -------> This is my EVM MAC address 0x08, 0x00, /* Ethertype = IPv4 */ 0x45, 0x00, 0x00, 0x6c, /* IP version, services, total length */ 0x00, 0x00, 0x00, 0x00, /* IP ID, flags, fragment offset */ 0x05, 0x11, 0x32, 0x26, /* IP ttl, protocol (UDP), header checksum */ 0xc0, 0xa8, 0x00, 0x7f, /* Source IP address */ -------> This is my EVM IP address 0xc0, 0xa8, 0x00, 0x71, /* Destination IP address */-------> This is my PC IP address 0x5355, 0x631, /* UDP source port, dest port */ -------> EVM port, PC port 0x00, 0x58, 0x1d, 0x18, /* UDP len, UDP checksum */ 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, /* 80 bytes of payload data */ 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81 }; Code : example/multicoreExample/src/pa_mgmt.c ============================================== Add_MACAddress paEthInfo_t ethInfo = {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* Src mac = dont care */ ---> Here we don't changed { 0xe0, 0xd5, 0x5e, 0x37, 0xbc, 0xec, }, /* Dest mac */ ----> 0, /* vlan = dont care */ 0x0800, /* ether type = IPv4 */ 0, /* MPLS tag = dont care */ 0 /* Input EMAC port = dont care */ Add_IPAddress paIpInfo_t ipInfo = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* IP source = dont care */ { 0xc0, 0xa8, 0x00, 0x71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* IP dest */ 0, /* SPI = dont care */ 0, /* flow = dont care */ pa_IPV4, /* IP type */ 0, /* GRE protocol */ 0, /* Ip protocol = dont care (TCP or UDP or anything else) */ 0, /* TOS */ FALSE, /* TOS = dont care (seperate field since TOS=0 is valid */ 0 /* SCTP destination port = dont care */ }; Add_Port int16_t ports = {0x631}; Attached Logs after we added our IP , port & MAC in PA Multicore example code ============================================================================== root@AM5K2E04:~# ./paMCExample.out No command line given. Forking off 4 tasks ************************************************ *** PA Multi Core Example Started on Core 1 *** ************************************************ Waiting for global config (core 1) ... ************************************************ *** PA Multi Core Example Started on Core 0 *** ************************************************ Initialized RM_Client0 ************************************************ *** PA Multi Core Example Started on Core 3 *** ************************************************ Waiting for global config (core 3) ... Initializing Free Descriptors. QMSS successfully initialized Unable to open below cppi tx channels...presuming linux has already enabled it 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 Unable to open below cppi Rx channels...presuming linux has already enabled it 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 6 CPPI successfully initialized PASS successfully initialized Tx setup successfully done Rx setup successfully done Publishing global config Done from SYSINIT Core... Publishing local config done from core num: 0... Waiting for all cores to reach the barrier before transmission starts ... ************************************************ *** PA Multi Core Example Started on Core 2 *** ************************************************ Waiting for global config (core 2) ... Initialized RM_Client2 QMSS Local successfully initialized CPPI Local successfully initialized PA Local successfully initialized Rx setup successfully done Publishing local config done from core num: 2... Waiting for all cores to reach the barrier before transmission starts ... Initialized RM_Client1 QMSS Local successfully initialized CPPI Local successfully initialized Initialized RM_Client3 PA Local successfully initialized QMSS Local successfully initialized CPPI Local successfully initialized PA Local successfully initialized Zumi : RX0Qmss_getQueueNumber 0 Zumi : RX2Qmss_getQueueNumber 0 Rx setup successfully done Publishing local config done from core num: 1... Waiting for all cores to reach the barrier before transmission starts ... Zumi : RX0Qmss_getQueueNumber 0 Zumi : RX2Qmss_getQueueNumber 0 Rx setup successfully done Publishing local config done from core num: 3... Waiting for all cores to reach the barrier before transmission starts ... Packet Transmission Start ... core id: 3 Packet Transmission Done. Wait for all packets to be Received ... core num: 3 Packet Transmission Start ... core id: 0 Packet Transmission Done. Wait for all packets to be Received ... core num: 0 Packet Transmission Start ... core id: 2 Packet Transmission Done. Wait for all packets to be Received ... core num: 2 Packet Transmission Start ... core id: 1 Packet Transmission Done. Wait for all packets to be Received ... core num: 1 Waiting for packet received after that nothing will displayed Please let me know the solutions for this, Regards, SanthanaKumarS
Hi Rex, Please check my updates e2e.ti.com/.../3496118 Regards, SanthanaKumarS