Altera_Forum
Honored Contributor
13 years agoImprove performance of TSE on Stratix IV GX
Hello,
I'm using the Standard design of Stratix IV on which I put the Nios II Simple Socket Server in order to receive incoming data from my other computer. I managed to establish a TCP/IP connection between my client and the FPGA server. My client application send 40 bytes data with the socket send() command. Everytime my Nios II receive a packet, he aknowledges it by sending back a packet to the client. Everything is fine except the performance of my Nios II which is about 70kbytes/s. I've read the "No free buffers for rx" from kaushal which helped me to instantiate the tighlty coupled memory and I modified the ipport.h file according to the help note of the Ethernet_accel_design. With the AN440 help, I also included the optimization.c and .h file and my ipport.h looks like this: #define ALTERA_MRAM_FOR_PACKETS 1 # define ALTERA_MRAM_ALLOC_BASE PACKET_MEMORY_BASE # define ALTERA_MRAM_ALLOC_SPAN PACKET_MEMORY_SPAN # ifdef ALTERA_TRIPLE_SPEED_MAC char * ncpalloc(unsigned size); void ncpfree(void *ptr); char * ncpballoc(unsigned size); int ncpbfree(char *ptr); # if ALTERA_MRAM_FOR_PACKETS //#include "../net/optimizations.h" # define BB_ALLOC(size) ncpballoc(size) # define BB_FREE(ptr) ncpbfree(ptr) # define LB_ALLOC(size) ncpballoc(size) # define LB_FREE(ptr) ncpbfree(ptr) # else # define BB_ALLOC(size) ncpalloc(size) /* Big packet buffer alloc */ # define BB_FREE(ptr) ncpfree(ptr) # define LB_ALLOC(size) ncpalloc(size) /* Little packet buffer alloc */ # define LB_FREE(ptr) ncpfree(ptr) # endif # else /* Not ALTERA_TRIPLE_SPEED_MAC */ # define BB_ALLOC(size) npalloc(size) /* Big packet buffer alloc */ # define BB_FREE(ptr) npfree(ptr) # define LB_ALLOC(size) npalloc(size) /* Little packet buffer alloc */ # define LB_FREE(ptr) npfree(ptr) # endif /* ALTERA_TRIPLE_SPEED_MAC */ and also: #if ALTERA_MRAM_FOR_PACKETS # define NUMBIGBUFS 30 # define NUMLILBUFS 30 /* some maximum packet buffer numbers */ # define MAXBIGPKTS 30 # define MAXLILPKTS 30 # define MAXPACKETS (MAXLILPKTS+MAXBIGPKTS) # define BIGBUFSIZE 1536 # define LILBUFSIZE 128 Please see my .qsys file and my ipport.h file attached. Except the Hardware checksum calculation, is there is anything I could try in order to improve the Simple Socket Server performance to at least 1Mbytes/s? Do you think that putting my .stack and .heap directly into a 300kbytes onchip memory could help me having better results? Thank you in advance With regards, Michel