MyFPGA Forum

 找回密码
 注册
搜索
查看: 4629|回复: 0
打印 上一主题 下一主题

altera TSE + nios2 linu为何实际速度如此慢!!!

[复制链接]
跳转到指定楼层
1#
发表于 2015-9-24 10:25:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我的板子是Cyclone III FPGA Development Kit (3C120 board),参考http://rocketboards.org/foswiki/ ... ManualForCycloneIII
nios2 linux能够启动,altera TSE工作正常,的确是工作在1000M full duplex模式,但是和PC Windows之间做测试时,发现网卡的速度奇慢无比,UDP的速度只有40~50Mbps。


有人能指点一下为何速度如此慢?


nios2 linux中我做udp测试的函数如下:


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=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(addr in.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;

}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|MyFPGA

GMT+8, 2024-4-19 11:17 , Processed in 0.038970 second(s), 15 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表