Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
725 Views

why the altera TSE is so slow in qsys_ghrd_3c120 + nios2 linux

hi, all, 

my hardware is Cyclone III FPGA Development Kit (3C120 board), and the quartus project is qsys_ghrd_3c120 

I have succeed running nios2 linux ( refer to http://rocketboards.org/foswiki/view/documentation/niosiilinuxusermanualforcycloneiii), 

 

the altera TSE is verified to work in 1000M full duplex mode. 

then I test the altera TSE speed between the nios2 linux and the PC Windows with the following function in linux , then I find the udp transaction speed is only about 40~50Mbps,  

 

why so slow?  

 

anyone can tell me what's the problem? and how to get higher speed for altera TSE +nios2 linux? 

 

thanks!! 

 

my udp transaction function is : 

 

 

int udp_handshake( ) 

int ipLen,i,iRet; 

unsigned short udp_marks[8]; 

int net_error; 

 

net_error=0; 

 

printf("now to handshake by udp\n"); 

 

 

m_udp_socket=socket(AF_INET,SOCK_DGRAM,0); 

 

memset(&addrin,0, sizeof(struct sockaddr_in) ); 

addrin.sin_family=AF_INET; 

addrin.sin_port = htons(3500);  

memset(&addrin.sin_zero,0,8); 

 

if(bind(m_udp_socket,(struct sockaddr *)&addrin, sizeof(struct sockaddr_in))) //int bind (int SOCKET, struct sockaddr *ADDR, socklen_t LENGTH) 

printf("can't creat net interface.......\r\n"); 

close(m_udp_socket); 

return 0; 

 

ipLen=sizeof(struct sockaddr_in); 

for(i=0;i<8;i++) 

udp_marks[i]=0; 

iRet=recvfrom(m_udp_socket, (char * )udp_marks, 16, 0,(struct sockaddr *)&addrin, &ipLen); //first recv mark by blocking mode 

 

 

printf("pc IP:%s port:%d\r\n",inet_ntoa(addrin.sin_addr),ntohs(addrin.sin_port) ); 

 

 

addrin.sin_port=htons(3500); ipLen=sizeof(struct sockaddr_in); 

 

//test altera TSE speed with udp sending loop, data_length is from 1 to 32, so 1K to 32K data is sent by one sendto 

for (i=0;i<send_loop;i++)  

iRet=sendto(m_udp_socket, (char *)pData_buff, data_length*1024,0,(struct sockaddr *)&addrin,ipLen); //second send back handshake 

 

if (iRet==-1) 

net_error=1; 

 

 

shutdown(m_udp_socket,2); close(m_udp_socket); 

 

return 1; 

 

}
0 Kudos
2 Replies
Altera_Forum
Honored Contributor I
32 Views

Hi,  

 

I read your thread, because you run the project from Rocketboards (http://rocketboards.org/foswiki/view/documentation/niosiilinuxusermanual (http://rocketboards.org/foswiki/view/documentation/niosiilinuxusermanual)) on the 3c120 board. That's what I want to do too, but it doesn't work so far.  

U-boot is running on my board, but the kernel doesn't boot after it is unpacked. 

 

I am really sorry I can't help you with your problem now. Hopefully I will be able later, when my board is running. 

 

Could you tell me, which versions of U-Boot, Linux kernel and buildroot you used? 

And which "qsys_ghrd_3c120" did you use? There are two (13.0 and 13.1) on this page: https://www.altera.com/support/support-resources/design-examples/intellectual-property/embedded/nios... for the 3c120 board. Or did you use another one? 

 

David
Altera_Forum
Honored Contributor I
32 Views

Hi,  

 

i am working with the manual from rocketboards on the 3c120 board too. But it is not working on my board. 

 

Could you tell me, which versions of u-boot, linux kernel and buildroot you used? 

And which "qsys_ghrd_3c120" did you use? There are two (13.0 and 13.1) on this site: https://www.altera.com/support/support-resources/design-examples/intellectual-property/embedded/nios... (https://www.altera.com/support/support-resources/design-examples/intellectual-property/embedded/nios...

Or did you use another one?