2013-07-08 08:58:40 +00:00
|
|
|
#
|
|
|
|
# \brief Test for using netperf
|
|
|
|
# \author Alexander Boettcher
|
2017-12-19 14:18:08 +00:00
|
|
|
# \author Martin Stein
|
2013-07-08 08:58:40 +00:00
|
|
|
# \date 2013-04-18
|
|
|
|
#
|
|
|
|
|
2021-02-17 13:40:11 +00:00
|
|
|
#
|
|
|
|
# To execute this run script on your Linux host you have to do some
|
|
|
|
# preparation:
|
|
|
|
#
|
|
|
|
# 1) Setup a TAP device:
|
|
|
|
# ! export USER=[YOUR_USER_NAME]
|
|
|
|
# ! export FLAVOR=[YOUR_TEST_FLAVOR] # e.g. 'lwip_bridge'
|
|
|
|
# ! export TAP_DEV=tap0
|
|
|
|
# ! sudo ip tuntap add dev $TAP_DEV mode tap user $USER
|
|
|
|
# ! sudo ip address flush dev $TAP_DEV
|
|
|
|
# ! sudo ip address add 10.0.2.1/24 brd 10.0.2.255 dev $TAP_DEV
|
|
|
|
# ! sudo ip link set dev $TAP_DEV addr 02:00:00:ca:fe:01
|
|
|
|
# ! sudo ip link set dev $TAP_DEV up
|
|
|
|
#
|
|
|
|
# 2) Now, start the test:
|
|
|
|
# ! cd build/x86_64
|
|
|
|
# ! make run/netperf_$FLAVOR KERNEL=linux BOARD=linux
|
|
|
|
#
|
|
|
|
# 3) Clean up your Linux when done testing:
|
|
|
|
# ! sudo ip tuntap delete $TAP_DEV mode tap
|
|
|
|
#
|
|
|
|
|
2021-01-08 16:27:24 +00:00
|
|
|
if {[have_include "power_on/qemu"]} {
|
|
|
|
puts "\nRun script does not support Qemu.\n"
|
2019-04-24 13:09:49 +00:00
|
|
|
exit 0
|
2015-05-06 14:13:04 +00:00
|
|
|
}
|
2013-07-11 09:14:57 +00:00
|
|
|
|
2023-09-12 16:08:09 +00:00
|
|
|
if {[have_board imx53_qsb_tz] || [have_board rpi]} {
|
2018-05-02 10:24:40 +00:00
|
|
|
puts "Run script is not supported on this platform."
|
2015-09-29 08:21:08 +00:00
|
|
|
exit 0
|
|
|
|
}
|
2013-07-08 08:58:40 +00:00
|
|
|
|
2021-02-17 13:40:11 +00:00
|
|
|
proc unique_byte_per_platform { } {
|
|
|
|
|
|
|
|
if {[expr ![have_include "power_on/qemu"]]} {
|
|
|
|
if {[have_spec arm_v6]} {
|
|
|
|
if {[have_board rpi]} {
|
|
|
|
if {[have_spec hw]} { return 0; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if {[have_spec arm_v7a]} {
|
|
|
|
if {[have_board imx53_qsb]} {
|
|
|
|
if {[have_spec hw]} { return 1; }
|
|
|
|
}
|
|
|
|
if {[have_board imx6q_sabrelite]} {
|
|
|
|
if {[have_spec hw]} { return 2; }
|
|
|
|
if {[have_spec foc]} { return 3; }
|
|
|
|
if {[have_spec sel4]} { return 4; }
|
|
|
|
}
|
|
|
|
if {[have_board imx7d_sabre]} {
|
|
|
|
if {[have_spec hw]} { return 5; }
|
|
|
|
if {[have_spec foc]} { return 6; }
|
|
|
|
if {[have_spec sel4]} { return 7; }
|
|
|
|
}
|
2023-11-15 06:57:09 +00:00
|
|
|
if {[have_board zynq_usrp_e31x]} {
|
|
|
|
if {[have_spec hw]} { return 8; }
|
|
|
|
}
|
2021-02-17 13:40:11 +00:00
|
|
|
}
|
|
|
|
if {[have_spec arm_v8a]} {
|
|
|
|
if {[have_board imx8q_evk]} {
|
2023-11-15 06:57:09 +00:00
|
|
|
if {[have_spec hw]} { return 20; }
|
2021-02-17 13:40:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if {[have_spec x86_32]} {
|
|
|
|
if {[have_board linux]} {
|
2023-11-15 06:57:09 +00:00
|
|
|
if {[have_spec linux]} { return 40; }
|
2021-02-17 13:40:11 +00:00
|
|
|
}
|
|
|
|
if {[have_board pc]} {
|
2023-11-15 06:57:09 +00:00
|
|
|
if {[have_spec foc]} { return 41; }
|
|
|
|
if {[have_spec sel4]} { return 42; }
|
|
|
|
if {[have_spec nova]} { return 43; }
|
|
|
|
if {[have_spec fiasco]} { return 44; }
|
|
|
|
if {[have_spec okl4]} { return 45; }
|
|
|
|
if {[have_spec pistachio]} { return 46; }
|
2021-02-17 13:40:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if {[have_spec x86_64]} {
|
|
|
|
if {[have_board linux]} {
|
2023-11-15 06:57:09 +00:00
|
|
|
if {[have_spec linux]} { return 60; }
|
2021-02-17 13:40:11 +00:00
|
|
|
}
|
|
|
|
if {[have_board pc]} {
|
2023-11-15 06:57:09 +00:00
|
|
|
if {[have_spec hw]} { return 61; }
|
|
|
|
if {[have_spec foc]} { return 62; }
|
|
|
|
if {[have_spec sel4]} { return 63; }
|
|
|
|
if {[have_spec nova]} { return 64; }
|
2021-02-17 13:40:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
puts "Failed to determine unique byte for target."
|
|
|
|
exit -1
|
|
|
|
}
|
2017-08-25 15:28:43 +00:00
|
|
|
|
2021-02-17 13:40:11 +00:00
|
|
|
proc server_data_port { } {
|
|
|
|
|
|
|
|
return [expr 18000 + [unique_byte_per_platform]];
|
|
|
|
}
|
|
|
|
|
|
|
|
proc server_ctrl_port { } {
|
|
|
|
|
|
|
|
return 12865;
|
2017-08-25 15:28:43 +00:00
|
|
|
}
|
|
|
|
|
2021-02-17 13:40:11 +00:00
|
|
|
set bridge_mac "02:02:02:02:16:00"
|
|
|
|
|
2013-07-08 08:58:40 +00:00
|
|
|
set version "2.6.0"
|
|
|
|
|
|
|
|
# sanity check that the right version is used
|
|
|
|
set wrong_version [catch {
|
|
|
|
spawn netperf-$version -V
|
|
|
|
expect {
|
|
|
|
{Netperf version 2.6.0} { }
|
|
|
|
eof { return }
|
|
|
|
timeout { return }
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
|
|
|
|
if {$wrong_version} {
|
|
|
|
puts -nonewline "\nPlease compile a netperf client of version $version "
|
|
|
|
puts "for your host system."
|
2017-01-30 10:08:37 +00:00
|
|
|
puts "The sources are available in 'contrib/netperf-<hash>' (after you "
|
|
|
|
puts "prepared the port by calling 'tool/ports/prepare_port netperf')."
|
2013-07-08 08:58:40 +00:00
|
|
|
puts "Please name the binary netperf-$version\n"
|
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
# netperf configuration
|
|
|
|
set netperf_tests "TCP_STREAM TCP_MAERTS"
|
|
|
|
|
2019-04-24 13:09:49 +00:00
|
|
|
proc socket_fs_plugin {} {
|
|
|
|
global use_lxip
|
|
|
|
if { $use_lxip } { return lxip }
|
|
|
|
return lwip
|
2013-07-08 08:58:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
2019-04-24 13:09:49 +00:00
|
|
|
set packages "
|
|
|
|
[depot_user]/src/[base_src]
|
|
|
|
[depot_user]/src/init
|
|
|
|
[depot_user]/src/libc
|
|
|
|
[depot_user]/src/posix
|
2022-09-16 11:30:25 +00:00
|
|
|
[depot_user]/src/report_rom
|
2019-04-24 13:09:49 +00:00
|
|
|
[depot_user]/src/vfs
|
2021-01-08 16:27:24 +00:00
|
|
|
[depot_user]/src/nic_router
|
2019-04-24 13:09:49 +00:00
|
|
|
"
|
2022-09-16 11:30:25 +00:00
|
|
|
set use_nic_drv [expr !$use_usb_driver && !$use_wifi_driver]
|
|
|
|
append_if $use_nic_drv packages " [depot_user]/pkg/[drivers_nic_pkg] "
|
|
|
|
append_if [expr !$use_lxip] packages " [depot_user]/src/vfs_lwip "
|
|
|
|
append_if $use_lxip packages " [depot_user]/src/vfs_lxip "
|
|
|
|
append_if $use_nic_bridge packages " [depot_user]/src/nic_bridge "
|
|
|
|
append_if $use_usb_driver packages " [depot_user]/pkg/test_usb_host_drv-[board] "
|
|
|
|
append_if $use_usb_driver packages " [depot_user]/src/usb_net_drv "
|
|
|
|
append_if $use_wifi_driver packages " [depot_user]/src/fs_rom "
|
|
|
|
append_if $use_wifi_driver packages " [depot_user]/src/vfs_import "
|
2023-05-02 16:17:56 +00:00
|
|
|
append_if $use_wifi_driver packages " [depot_user]/pkg/pc_wifi "
|
2022-09-16 11:30:25 +00:00
|
|
|
append_if $use_wifi_driver packages " [depot_user]/src/acpi_drv "
|
|
|
|
append_if $use_wifi_driver packages " [depot_user]/src/pci_decode "
|
|
|
|
append_if $use_wifi_driver packages " [depot_user]/src/platform_drv "
|
2019-04-24 13:09:49 +00:00
|
|
|
|
|
|
|
import_from_depot $packages
|
|
|
|
|
2022-09-16 11:30:25 +00:00
|
|
|
build { app/netperf }
|
2019-04-24 13:09:49 +00:00
|
|
|
|
2013-07-08 08:58:40 +00:00
|
|
|
#
|
|
|
|
# Generate config
|
|
|
|
#
|
|
|
|
|
2013-09-18 14:24:25 +00:00
|
|
|
set lx_ip_addr "10.0.2.55"
|
|
|
|
|
2013-07-08 08:58:40 +00:00
|
|
|
set config {
|
2018-03-28 12:14:42 +00:00
|
|
|
<config verbose="yes" prio_levels="2">
|
2013-07-08 08:58:40 +00:00
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="100"/>
|
2013-07-08 08:58:40 +00:00
|
|
|
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Timer"/> </provides>
|
|
|
|
</start> }
|
|
|
|
|
2019-04-24 13:09:49 +00:00
|
|
|
if { $use_wifi_driver } {
|
|
|
|
append config {
|
2023-01-27 09:10:03 +00:00
|
|
|
<start name="report_rom" caps="100">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
2022-09-16 11:30:25 +00:00
|
|
|
<provides>
|
|
|
|
<service name="ROM" />
|
|
|
|
<service name="Report" />
|
|
|
|
</provides>
|
|
|
|
<config>
|
|
|
|
<policy label="pci_decode -> system" report="acpi_drv -> acpi"/>
|
|
|
|
<policy label="platform_drv -> devices" report="pci_decode -> devices"/>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="acpi_drv" caps="250">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="pci_decode" caps="350">
|
2022-11-18 13:11:38 +00:00
|
|
|
<resource name="RAM" quantum="2M"/>
|
2022-09-16 11:30:25 +00:00
|
|
|
<route>
|
|
|
|
<service name="ROM" label="system"> <child name="report_rom"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="platform_drv" caps="100" managing_system="yes">
|
2023-01-27 09:10:03 +00:00
|
|
|
<resource name="RAM" quantum="2M"/>
|
2022-09-16 11:30:25 +00:00
|
|
|
<provides> <service name="Platform"/> </provides>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="devices"> <child name="report_rom"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
<config>
|
|
|
|
<policy label_prefix="nic_drv" info="yes"> <pci class="WIFI"/> </policy>
|
|
|
|
</config>
|
2015-02-20 12:39:10 +00:00
|
|
|
</start>
|
2019-04-24 13:09:49 +00:00
|
|
|
|
2015-02-20 12:39:10 +00:00
|
|
|
<start name="config_fs">
|
2020-04-20 12:00:57 +00:00
|
|
|
<binary name="vfs"/>
|
2015-02-20 12:39:10 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides> <service name="File_system"/> </provides>
|
|
|
|
<config>
|
2020-04-20 12:00:57 +00:00
|
|
|
<vfs>
|
|
|
|
<ram/>
|
|
|
|
<import>
|
|
|
|
<inline name="wifi_config">
|
2018-09-13 13:13:23 +00:00
|
|
|
<wifi_config connected_scan_interval="0" scan_interval="10" rfkill="no" verbose="no" verbose_state="no">}
|
2019-04-24 13:09:49 +00:00
|
|
|
append config "<network ssid=\"$wifi_ssid\" protection=\"WPA2\" passphrase=\"$wifi_psk\"/>"
|
|
|
|
append config { </wifi_config>
|
2020-04-20 12:00:57 +00:00
|
|
|
</inline>
|
|
|
|
</import>
|
|
|
|
</vfs>
|
|
|
|
<policy label_prefix="config_rom" root="/"/>
|
2015-02-20 12:39:10 +00:00
|
|
|
</config>
|
|
|
|
</start>
|
2019-04-24 13:09:49 +00:00
|
|
|
|
2015-02-20 12:39:10 +00:00
|
|
|
<start name="config_rom">
|
|
|
|
<binary name="fs_rom"/>
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="ROM"/></provides>
|
|
|
|
<route>
|
|
|
|
<service name="File_system"> <child name="config_fs" /> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
2019-04-24 13:09:49 +00:00
|
|
|
|
|
|
|
<start name="nic_drv" caps="300">
|
2023-05-03 15:34:22 +00:00
|
|
|
<binary name="wifi_drv"/>
|
2021-01-08 16:27:24 +00:00
|
|
|
<resource name="RAM" quantum="32M"/>
|
2021-05-26 06:02:03 +00:00
|
|
|
<config>
|
2018-07-31 14:02:07 +00:00
|
|
|
<libc stdout="/dev/null" stderr="/dev/log" rtc="/dev/rtc"/>
|
2017-01-30 10:08:37 +00:00
|
|
|
<vfs>
|
|
|
|
<dir name="dev">
|
2023-07-07 09:46:39 +00:00
|
|
|
<log/> <null/>
|
2017-01-30 10:08:37 +00:00
|
|
|
<jitterentropy name="random"/>
|
|
|
|
<jitterentropy name="urandom"/>
|
2017-12-20 11:11:11 +00:00
|
|
|
<inline name="rtc">2018-01-01 00:01</inline>
|
2017-01-30 10:08:37 +00:00
|
|
|
</dir>
|
2023-05-03 15:34:22 +00:00
|
|
|
<dir name="firmware">
|
|
|
|
<tar name="wifi_firmware.tar"/>
|
|
|
|
</dir>
|
2017-01-30 10:08:37 +00:00
|
|
|
</vfs>
|
2015-02-20 12:39:10 +00:00
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Rtc"> <any-child/> </service>
|
|
|
|
<service name="File_system"> <child name="config_fs"/> </service>
|
2018-07-31 14:02:07 +00:00
|
|
|
<service name="ROM" label="wifi_config"> <child name="config_rom" /> </service>
|
2023-05-02 16:17:56 +00:00
|
|
|
<service name="ROM" label="wifi.lib.so"> <parent label="pc_wifi.lib.so"/> </service>
|
2023-05-03 15:34:22 +00:00
|
|
|
<service name="ROM" label="wifi_firmware.tar"> <parent label="pc_wifi_firmware.tar"/> </service>
|
2015-05-26 18:12:17 +00:00
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
2021-01-08 16:27:24 +00:00
|
|
|
<service name="Uplink"> <child name="nic_router"/> </service>
|
2015-02-20 12:39:10 +00:00
|
|
|
<any-service> <parent/> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>}
|
|
|
|
|
2019-04-24 13:09:49 +00:00
|
|
|
} elseif { $use_usb_driver } {
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2019-04-24 13:09:49 +00:00
|
|
|
append config {
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2022-09-16 11:30:25 +00:00
|
|
|
<start name="usb_drv" caps="1500" managing_system="yes">
|
|
|
|
<binary name="init"/>
|
|
|
|
<resource name="RAM" quantum="32M"/>
|
2021-01-08 16:27:24 +00:00
|
|
|
<provides> <service name="Usb"/> </provides>
|
|
|
|
<route>
|
2022-09-16 11:30:25 +00:00
|
|
|
<service name="ROM" label="config">
|
|
|
|
<parent label="drivers.config"/> </service>
|
2021-01-08 16:27:24 +00:00
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
2022-09-16 11:30:25 +00:00
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<any-service> <parent/> </any-service>
|
2021-01-08 16:27:24 +00:00
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nic_drv" caps="200">
|
|
|
|
<binary name="usb_net_drv"/>
|
|
|
|
<resource name="RAM" quantum="20M"/>
|
2022-04-26 09:24:12 +00:00
|
|
|
<config mac="02:00:00:00:01:01" />
|
2021-01-08 16:27:24 +00:00
|
|
|
<route>
|
|
|
|
<service name="Uplink"><child name="nic_router"/></service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
2019-04-24 13:09:49 +00:00
|
|
|
</start> }
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2019-04-24 13:09:49 +00:00
|
|
|
} else {
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2019-04-24 13:09:49 +00:00
|
|
|
append config {
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2023-07-18 08:17:49 +00:00
|
|
|
<start name="nic_drv" caps="1200" managing_system="yes">
|
2020-07-10 11:04:12 +00:00
|
|
|
<resource name="RAM" quantum="32M"/>
|
2019-04-24 13:09:49 +00:00
|
|
|
<binary name="init"/>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
2021-01-08 16:27:24 +00:00
|
|
|
<service name="Uplink"> <child name="nic_router"/> </service>
|
2019-04-24 13:09:49 +00:00
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start> }
|
|
|
|
}
|
|
|
|
|
2021-01-08 16:27:24 +00:00
|
|
|
append config {
|
|
|
|
|
2020-05-05 12:27:29 +00:00
|
|
|
<start name="nic_router" caps="120">
|
2019-04-24 13:09:49 +00:00
|
|
|
<resource name="RAM" quantum="5M"/>
|
2020-12-07 15:46:15 +00:00
|
|
|
<provides>
|
|
|
|
<service name="Nic"/>
|
|
|
|
<service name="Uplink"/>
|
|
|
|
</provides>
|
2021-01-08 16:27:24 +00:00
|
|
|
<config verbose_domain_state="yes"> }
|
|
|
|
|
|
|
|
if {$use_nic_bridge} { append config {
|
|
|
|
|
|
|
|
<policy label_prefix="nic_bridge" domain="server"/> }
|
|
|
|
|
|
|
|
} else { append config {
|
|
|
|
|
|
|
|
<policy label_prefix="netserver_genode" domain="server"/> }
|
|
|
|
}
|
|
|
|
append config {
|
|
|
|
|
|
|
|
<policy label_prefix="nic_drv" domain="uplink"/>
|
|
|
|
|
|
|
|
<domain name="uplink" }
|
2019-04-24 13:09:49 +00:00
|
|
|
|
2021-01-08 16:27:24 +00:00
|
|
|
append_if [have_spec linux] config "
|
|
|
|
|
|
|
|
interface=\"$lx_ip_addr/24\" gateway=\"10.0.2.1\""
|
|
|
|
|
|
|
|
append config {
|
2019-04-24 13:09:49 +00:00
|
|
|
|
|
|
|
>
|
|
|
|
<nat domain="server" tcp-ports="100" />
|
2021-02-17 13:40:11 +00:00
|
|
|
<tcp-forward port="} [server_data_port] {" domain="server" to="10.0.3.2" />
|
|
|
|
<tcp-forward port="} [server_ctrl_port] {" domain="server" to="10.0.3.2" />
|
2019-04-24 13:09:49 +00:00
|
|
|
</domain>
|
|
|
|
|
2021-01-08 16:27:24 +00:00
|
|
|
<domain name="server" interface="10.0.3.1/24" verbose_packets="no">
|
2019-04-24 13:09:49 +00:00
|
|
|
<dhcp-server ip_first="10.0.3.2"
|
|
|
|
ip_last="10.0.3.2"
|
|
|
|
ip_lease_time_sec="600"/>
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
</config>
|
2021-01-08 16:27:24 +00:00
|
|
|
</start> }
|
2019-04-24 13:09:49 +00:00
|
|
|
|
|
|
|
append_if $use_nic_bridge config {
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2019-04-24 13:09:49 +00:00
|
|
|
<start name="nic_bridge">
|
|
|
|
<resource name="RAM" quantum="5M"/>
|
|
|
|
<provides><service name="Nic"/></provides>
|
2021-01-08 16:27:24 +00:00
|
|
|
<config mac="} $bridge_mac {">
|
2019-04-24 13:09:49 +00:00
|
|
|
<default-policy/>
|
|
|
|
</config>
|
|
|
|
<route>
|
2021-01-08 16:27:24 +00:00
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
2019-04-24 13:09:49 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start> }
|
2013-07-08 08:58:40 +00:00
|
|
|
|
|
|
|
append config {
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2019-02-11 10:00:52 +00:00
|
|
|
<start name="netserver_genode" caps="320" priority="-1">
|
2016-09-18 17:46:54 +00:00
|
|
|
<binary name="netserver"/>
|
2013-11-22 11:39:44 +00:00
|
|
|
<resource name="RAM" quantum="32M"/>
|
2013-07-08 08:58:40 +00:00
|
|
|
<config>
|
|
|
|
<arg value="netserver"/>
|
|
|
|
<arg value="-D"/>
|
|
|
|
<arg value="-4"/>
|
2013-09-23 13:58:45 +00:00
|
|
|
<arg value="-f"/>
|
2016-09-18 17:46:54 +00:00
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" socket="/socket"/>
|
2017-12-20 11:11:11 +00:00
|
|
|
<vfs>
|
|
|
|
<dir name="dev">
|
|
|
|
<log/> <inline name="rtc">2018-01-01 00:01</inline>
|
|
|
|
</dir>
|
2016-09-18 17:46:54 +00:00
|
|
|
<dir name="socket">
|
2021-01-08 16:27:24 +00:00
|
|
|
<} [socket_fs_plugin] { dhcp="yes"/>
|
2016-09-18 17:46:54 +00:00
|
|
|
</dir>
|
2017-12-20 11:11:11 +00:00
|
|
|
</vfs>
|
2021-01-08 16:27:24 +00:00
|
|
|
</config>
|
2017-12-19 14:18:08 +00:00
|
|
|
<route>
|
2021-01-08 16:27:24 +00:00
|
|
|
}
|
|
|
|
if { $use_nic_bridge } {
|
|
|
|
|
|
|
|
append config {
|
|
|
|
|
|
|
|
<service name="Nic"> <child name="nic_bridge"/> </service> }
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
append config {
|
|
|
|
|
|
|
|
<service name="Nic"> <child name="nic_router"/> </service> }
|
|
|
|
}
|
2013-07-08 08:58:40 +00:00
|
|
|
append config {
|
2021-01-08 16:27:24 +00:00
|
|
|
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
2013-07-08 08:58:40 +00:00
|
|
|
</start>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
|
|
|
</config> }
|
2013-07-08 08:58:40 +00:00
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
2022-09-16 11:30:25 +00:00
|
|
|
#
|
|
|
|
# Define USB host controller config
|
|
|
|
#
|
|
|
|
if { $use_usb_driver } {
|
|
|
|
set fd [open [run_dir]/genode/usb_host_drv.config w]
|
|
|
|
append usb_config {<config bios_handoff="yes">}
|
|
|
|
append_if [have_board rpi] usb_config {
|
|
|
|
<policy label_prefix="nic_drv" vendor_id="0x0424" product_id="0xec00"/> }
|
|
|
|
append_if [have_spec x86] usb_config {
|
|
|
|
<policy label_prefix="nic_drv" vendor_id="0x0b95" product_id="0x1790"/> }
|
|
|
|
append usb_config {</config>}
|
|
|
|
puts $fd $usb_config
|
|
|
|
close $fd
|
|
|
|
}
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2023-11-17 15:46:32 +00:00
|
|
|
build_boot_image [build_artifacts]
|
2013-07-08 08:58:40 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Execute test case
|
|
|
|
#
|
|
|
|
|
2021-01-08 16:27:24 +00:00
|
|
|
set ip_match_string "nic_router\\\] \\\[uplink\\\] dynamic IP config: interface (\[0-9]{1,3}.\[0-9]{1,3}.\[0-9]{1,3}.\[0-9]{1,3}).*\n"
|
2021-02-17 13:40:11 +00:00
|
|
|
set force_ports "-P [server_data_port],[server_data_port]"
|
2017-12-19 14:18:08 +00:00
|
|
|
|
2015-03-16 10:18:36 +00:00
|
|
|
if {[have_spec linux]} {
|
|
|
|
run_genode_until {.*family AF_INET.*\n} 60
|
|
|
|
} else {
|
|
|
|
run_genode_until $ip_match_string 60
|
|
|
|
}
|
|
|
|
|
2015-01-08 21:09:08 +00:00
|
|
|
set serial_id [output_spawn_id]
|
2013-07-08 08:58:40 +00:00
|
|
|
|
2021-02-17 13:40:11 +00:00
|
|
|
if [have_spec linux] {
|
2013-09-06 12:49:50 +00:00
|
|
|
set ip_addr $lx_ip_addr
|
2013-07-08 08:58:40 +00:00
|
|
|
} else {
|
2013-11-22 11:39:44 +00:00
|
|
|
regexp $ip_match_string $output all ip_addr
|
2013-07-08 08:58:40 +00:00
|
|
|
puts ""
|
|
|
|
}
|
|
|
|
|
2015-03-16 10:18:36 +00:00
|
|
|
# give the TCP/IP stack some time to settle down
|
|
|
|
sleep 3
|
|
|
|
|
2013-07-08 08:58:40 +00:00
|
|
|
# start netperf client connecting to netperf server running native on Genode
|
|
|
|
foreach netperf_test $netperf_tests {
|
|
|
|
puts "\n---------------------------- $netperf_test -----------------------"
|
|
|
|
|
2022-02-14 17:54:26 +00:00
|
|
|
spawn netperf-$version -4 -H $ip_addr -P 1 -v 2 -f m -t $netperf_test -c -C -- $force_ports \
|
|
|
|
-k THROUGHPUT,THROUGHPUT_UNITS,LOCAL_TRANSPORT_RETRANS,MEAN_LATENCY,REMOTE_SEND_CALLS,REMOTE_RECV_CALLS,ELAPSED_TIME
|
2013-07-08 08:58:40 +00:00
|
|
|
set netperf_id $spawn_id
|
|
|
|
|
2014-06-16 08:13:10 +00:00
|
|
|
set spawn_id_list [list $netperf_id $serial_id]
|
|
|
|
|
2015-06-04 14:17:43 +00:00
|
|
|
# reset output, so that we get on the second run not the result of the first
|
|
|
|
set output ""
|
2022-02-14 17:54:26 +00:00
|
|
|
run_genode_until "ELAPSED_TIME=.*\n" 120 $spawn_id_list
|
|
|
|
|
|
|
|
set units "Mbit/s"
|
2013-07-08 08:58:40 +00:00
|
|
|
|
|
|
|
# get throughput from netperf output
|
2022-02-14 17:54:26 +00:00
|
|
|
regexp {THROUGHPUT=([\d\.]+)} $output dummy throughput
|
|
|
|
|
|
|
|
# get elapsed time from netperf output
|
|
|
|
regexp {ELAPSED_TIME=([\d\.]+)} $output dummy elapsed_time
|
2013-07-08 08:58:40 +00:00
|
|
|
|
2022-02-14 17:54:26 +00:00
|
|
|
# get send calls from netperf output
|
|
|
|
regexp {REMOTE_SEND_CALLS=([\d]+)} $output dummy send_calls
|
2013-07-08 08:58:40 +00:00
|
|
|
|
2022-02-14 17:54:26 +00:00
|
|
|
# get recv calls from netperf output
|
|
|
|
regexp {REMOTE_RECV_CALLS=([\d]+)} $output dummy recv_calls
|
2013-07-08 08:58:40 +00:00
|
|
|
|
2022-02-14 17:54:26 +00:00
|
|
|
set sends_second [expr $send_calls / $elapsed_time]
|
|
|
|
set recvs_second [expr $recv_calls / $elapsed_time]
|
|
|
|
|
|
|
|
puts ""
|
|
|
|
puts "[format %8.0f $sends_second] send()/s"
|
|
|
|
puts "[format %8.0f $recvs_second] recv()/s"
|
2013-07-08 08:58:40 +00:00
|
|
|
|
|
|
|
# format output parseable for post proccessing scripts
|
2013-11-22 08:21:21 +00:00
|
|
|
puts -nonewline "! PERF: $netperf_test"
|
|
|
|
if {$use_nic_bridge} { puts -nonewline "_bridge" }
|
2019-04-24 13:09:49 +00:00
|
|
|
if {$use_usb_driver} { puts -nonewline "_xhci" }
|
2022-02-14 17:54:26 +00:00
|
|
|
puts " $throughput $units ok"
|
2013-07-08 08:58:40 +00:00
|
|
|
}
|