如转发 请标明出处!
要想测试网卡的传输速度,可以使用UDP或TCP,自己写一段收发程序,实现起来并不复杂。不过,VxWorks6/7里已经封装了一个比较完整的工具 - sockperf
以Vx69为例,在VIP中包含组件INCLUDE_IPSOCKPERF_CMD。启动VxWorks后,使用cmd的命令sockperf查看help信息
-> cmd
[vxWorks *]# sockperf
Network performance tool
usage:
sockperf [options] [address]
-6 use IPv6 (default is IPv4)
-a use passive open (default is active open)
-e echo test pattern on shell
-L <sec> linger time for all sockets (default is 3s)
-l <bytes> number of bytes to write/read in each call (default 8192)
-n <num> number of buffers to write (default 2048)
-P create(transmit) or verify(receive) test pattern
-p <port> socket port (default 7373)
-R socket receive buffer size (default 16384)
-r receive data (not mutually exclusive with -t)
-s <num> number of sockets to use, must be same on both ends (default 1)
-T socket send buffer size (default 32767)
-t transmit data (not mutually exclusive with -r)
如果没有其它合适的OS或者网络测试工具进行配合,可以再启动一个VxWorks的Target,与当前这个Target进行数据收发测试 - 一个使用-r接收,一个使用-t发送 http://mpvideo.qpic.cn/0b2e24abaaaatqaixk6y25rvbv6dcdlqaeaa.f10002.mp4?dis_k=be0fb6339fea16f5df72098bda977643&dis_t=1677398168&play_scene=10400&vid=wxv_2777428589347667974&format_id=10002&support_redirect=0&mmversion=false
sockperf可以指定IP地址、端口号,以及数据包长度、缓存区长度等等