Forum Discussion
no free buffers for rx
Hello
How do i increase the receive buffer size.... till now i have done following... 1. increase the receive Depth of TSE Mac... 2. Increase the MAXBIGPKTS from 30 to 512 in "ipport.h" 3. Increase the NUMBIGBUFS in "ipport.h" from 30 to 512 4. putting .heap and .stack in different memory region but till now there is no success. i have a image server who sends 512 UDP packet of size 512....on another end nios based receiver is running his job is to collect all these UDP packet in either internal or external memory...and send serieally to other cyclone device for further processing... currently i am able to receive 4 UDP packets of size 512...not more then that.. regards kaushal52 Replies
- Altera_Forum
Honored Contributor
Hello There,
Please see the Print-Screen of TSE_MAC Option in SOPC builder. 1. I have enable -O3 optimization too but i won't get desire result. 2. i have disabled the unwanted services from ipport.h also in ipport.h there is statement like # define BB_ALLOC(size) npalloc(size) /*Big packet buffer alloc*/ is this define statement the "size" is the same thing which i given to MAXBIGPKTS 512, or something else. by seeing this statemnet it look like it is assigning the memory region for the received/transmit packet. With regards kaushal - Altera_Forum
Honored Contributor
Yes this is the function that is used to allocate the packet buffers for the interniche stack. You can override it with your own functions if you want to use a different memory for that, such as a high speed on-chip RAM block.
- Altera_Forum
Honored Contributor
i am able to receive 460 UDP packets of size 512 out of 512 UDP packet, i have add on-chip memory using sopc builder and then connect it to cpu and tse_mac (please see the attached configuration) and made small changes related to packet memory in ipport.h.
if i add more packet to transmit from server side it start saying again "no free buffer for rx" but i am still running out of 512-460 = 52 UDP packet to get it done . i just wanted to know what is the data flow in this case after adding packet memory, is it something like tse_mac--->packet memory----->TCP/IP_inich----->CPU------>Application or something else so that i can add sufficient memory on desire place with regards kaushal - Altera_Forum
Honored Contributor
I'm not sure I understand how you made your connections to the packet memory. If you are attempting to do as they describe in application note 440 (http://www.altera.com/literature/an/an440.pdf), then the packet memory needs to be connected to the SGDMA's read and write masters (and only them, not the descriptor masters) and to the a CPU data master.
What I would do to get the best performance in to connect the m_read and m_write masters to the packet memory's s1 interface (nothing else from m_read/m_write, and nothing else to s1) and add a tightly coupled data master to the CPU, individually connected to the packet memory's s2 interface. And of course once you do that, modify the ipport.h file so that the memory allocation functions use the packet memory. - Altera_Forum
Honored Contributor
Hello daixiwen,
I have connected my packet memory according to your previous post 1. S1 of packet memory is connected to m_read & m_write of SGDMA 2. S2 is Connected to the data master of CPU by doing so data master bus clash with flash (please see the attached print screen of SOPC) if i remove flash connection , there is no reset vector for CPU as you mentioned in your previous post, please suggest how do i direct the memory allocation function to use packet memory..or what changes do i made in ipport.h..so that the memory allocation functions use the packet memory.? With Regards kaushal - Altera_Forum
Honored Contributor
Did you use the 'reassign base address' menu item? It should move the addresses around to avoid clash between peripherals. Just ensure that both s1 and s2 stay at the same address (if they change, you can put them back to a fixed address and click on the lock next to it, to prevent the 'reassign base address' option to change them).
As for the ipport.h modifications, I don't remember the exact procedure, as it was made a long time ago, but it should be explained in the application note. I think there is just a define to add or to uncomment somewhere to tell the driver to use a specific address instead of allocating the packet memory through malloc(). - Altera_Forum
Honored Contributor
It is also worth checking that the sending side (or a network switch) isn't discarding some of the packets.
The 'traditional' behaviour of UDP sockets is to discard rather than block the application when the app exceeds the number of messages the sending OS is willing to queue. - Altera_Forum
Honored Contributor
hello Daixiwen,
I have add the tightly coupled data master to the CPU, individually connected to the packet memory's s2 interface. and connect the m_read and m_write masters to the packet memory's s1 interface, after that i have assign the base address through menu-->assign base address i have got the two error saying "descripter_memory.s1:appear at more than one address" and "ddr2_bot.s1: apper at more than one address", though i have reassign base address but nothing happen and these two error remain there. please see attached print screen of my sopc builder , am i doing wrong connection ..? - Altera_Forum
Honored Contributor
hello dsl,
when i increase the TSE_MAC, FIFO DEPTH i have got more number of UDP packet, (though i have reach maximum tse_mac fifo depth) so it seems that network switch won't discard any UDP packet. - Altera_Forum
Honored Contributor
If you have some pipeline bridges, try to set their base address to 0 and lock it. It should get rid of the message.