netperf tests: test nic_router throughput

Adds two new netperf tests, netperf_lxip_router and netperf_lwip_router
who test the TCP throughput of the NIC router when routed with a tcp-forward
rule and NAT.

Issue #2624
This commit is contained in:
Martin Stein 2017-12-19 15:18:08 +01:00 committed by Norman Feske
parent 02d33e7b28
commit fe46d50ab3
11 changed files with 119 additions and 2 deletions

View File

@ -1,6 +1,7 @@
#
# \brief Test for using netperf
# \author Alexander Boettcher
# \author Martin Stein
# \date 2013-04-18
#
@ -8,6 +9,11 @@ proc gpio_drv { } { if {[have_spec rpi] && [have_spec hw]} { return hw_gpio_drv
if {[have_spec rpi] && [have_spec foc]} { return foc_gpio_drv }
return gpio_drv }
if {[expr $use_nic_bridge && $use_nic_router]} {
puts "Cannot test with both NIC bridge and NIC router.";
exit 0
}
if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"]} {
puts "\nRunning netperf in autopilot on Qemu is not recommended.\n"
exit
@ -86,6 +92,7 @@ append build_components " $netperf_target "
lappend_if $use_nic_driver build_components drivers/nic
lappend_if $use_usb_driver build_components drivers/usb
lappend_if $use_nic_bridge build_components server/nic_bridge
lappend_if $use_nic_router build_components server/nic_router
lappend_if [have_spec gpio] build_components drivers/gpio
append_if $use_wifi_driver build_components {
@ -138,6 +145,42 @@ append_if [have_spec gpio] config "
<config/>
</start>"
append_if $use_nic_router config {
<start name="nic_router">
<resource name="RAM" quantum="5M"/>
<provides><service name="Nic"/></provides>
<config verbose_domain_state="yes">
<policy label_prefix="netserver_genode" domain="server"/>
<domain name="uplink"}
append_if [expr $use_nic_router && [have_spec linux]] config "
interface=\"$lx_ip_addr/24\" gateway=\"10.0.2.1\""
append_if $use_nic_router config {
>
<nat domain="server" tcp-ports="100" />
<tcp-forward port="12864" domain="server" to="10.0.3.2" />
<tcp-forward port="12865" domain="server" to="10.0.3.2" />
</domain>
<domain name="server" interface="10.0.3.1/24">
<dhcp-server ip_first="10.0.3.2"
ip_last="10.0.3.2"
ip_lease_time_sec="600"/>
</domain>
</config>
<route>
<service name="Nic"> }
append_if $use_nic_router config "
<child name=\"$network_driver\"/>"
append_if $use_nic_router config {
</service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
}
append_if $use_nic_bridge config {
<start name="nic_bridge">
<resource name="RAM" quantum="5M"/>
@ -252,7 +295,7 @@ append config {
<arg value="-4"/>
<arg value="-f"/>
<libc tx_buf_size="2M" rx_buf_size="2M"}
append_if [have_spec linux] config " ip_addr=\"$lx_ip_addr\" netmask=\"255.255.255.0\" gateway=\"10.0.2.1\""
append_if [expr [have_spec linux] && !$use_nic_router] config " ip_addr=\"$lx_ip_addr\" netmask=\"255.255.255.0\" gateway=\"10.0.2.1\""
append config {
stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
<vfs>
@ -266,6 +309,11 @@ append_if $use_nic_bridge config {
<service name="Nic"> <child name="nic_bridge"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>}
append_if $use_nic_router config {
<route>
<service name="Nic"> <child name="nic_router"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>}
append config {
</start>
</config>
@ -286,6 +334,7 @@ set boot_modules {
append boot_modules " $netperf_app "
append boot_modules " $netperf_stack "
lappend_if $use_nic_bridge boot_modules nic_bridge
lappend_if $use_nic_router boot_modules nic_router
# platform-specific modules
lappend_if [have_spec gpio] boot_modules [gpio_drv]
@ -324,6 +373,12 @@ append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
append qemu_args " -net user -redir tcp:12865::12865 -redir tcp:49153::49153 "
set force_ports ""
if $use_nic_router {
set ip_match_string "nic_router\\\] \\\[uplink\\\] IP config: interface (\[0-9]{1,3}.\[0-9]{1,3}.\[0-9]{1,3}.\[0-9]{1,3}).*\n"
set force_ports "-P 12864,12864"
}
if {[have_spec linux]} {
run_genode_until {.*family AF_INET.*\n} 60
} else {
@ -332,7 +387,6 @@ if {[have_spec linux]} {
set serial_id [output_spawn_id]
set force_ports ""
if {[have_include "power_on/qemu"]} {
set ip_addr "localhost"
set force_ports "-P 49153,49153"
@ -378,6 +432,7 @@ foreach netperf_test $netperf_tests {
# format output parseable for post proccessing scripts
puts -nonewline "! PERF: $netperf_test"
if {$use_nic_bridge} { puts -nonewline "_bridge" }
if {$use_nic_router} { puts -nonewline "_router" }
if {$use_usb_driver} {
if {![string compare $use_usb_11 "yes"]} { puts -nonewline "_uhci" }
if {![string compare $use_usb_20 "yes"]} { puts -nonewline "_ohci" }

View File

@ -7,6 +7,7 @@
# network configuration
set use_nic_bridge 0
set use_nic_router 0
set use_wifi_driver 0
set use_usb_11 "no"
set use_usb_20 "yes"

View File

@ -17,6 +17,7 @@ if {[have_spec omap4]} {
# network configuration
set use_nic_bridge 1
set use_nic_router 0
set use_wifi_driver 0
set use_usb_11 "no"
set use_usb_20 "no"

View File

@ -0,0 +1,27 @@
#
# \brief Test using netperf with a NIC router and with a native driver or
# if not available for the platform using usb 3.0 by default
# \author Martin Stein
# \date 2017-12-19
#
if {[have_include "power_on/qemu"]} {
puts "\nNetperf running on Qemu with a router is not supported.\n"
exit
}
if {[have_spec omap4]} {
puts stderr "\nTest requires 1 Gbit network interface - not supported for omap4\n"
exit 0
}
# network configuration
set use_nic_bridge 0
set use_nic_router 1
set use_wifi_driver 0
set use_usb_11 "no"
set use_usb_20 "no"
set use_usb_30 "yes"
source ${genode_dir}/repos/ports/run/netperf_lwip.inc
source ${genode_dir}/repos/ports/run/netperf.inc

View File

@ -12,6 +12,7 @@ if {[have_spec omap4]} {
# network configuration
set use_nic_bridge 0
set use_nic_router 0
set use_wifi_driver 0
# force usage of usb for nova, known to work with usb30 network adapter

View File

@ -23,6 +23,7 @@ if {[get_cmd_switch --autopilot] && [have_spec x86_32] && ![have_spec acpi]} {
# network configuration
set use_nic_bridge 0
set use_nic_router 0
set use_wifi_driver 1
set use_usb_11 "no"
set use_usb_20 "no"

View File

@ -7,6 +7,7 @@
# network configuration
set use_nic_bridge 0
set use_nic_router 0
set use_wifi_driver 0
set use_usb_11 "no"
set use_usb_20 "yes"

View File

@ -17,6 +17,7 @@ if {[have_spec omap4]} {
# network configuration
set use_nic_bridge 1
set use_nic_router 0
set use_wifi_driver 0
set use_usb_11 "no"
set use_usb_20 "no"

View File

@ -0,0 +1,27 @@
#
# \brief Test using netperf with a NIC router and with a native driver or
# if not available for the platform using usb 3.0 by default
# \author Martin Stein
# \date 2017-12-19
#
if {[have_include "power_on/qemu"]} {
puts "\nNetperf running on Qemu with a router is not supported.\n"
exit
}
if {[have_spec omap4]} {
puts stderr "\nTest requires 1 Gbit network interface - not supported for omap4\n"
exit 0
}
# network configuration
set use_nic_bridge 0
set use_nic_router 1
set use_wifi_driver 0
set use_usb_11 "no"
set use_usb_20 "no"
set use_usb_30 "yes"
source ${genode_dir}/repos/ports/run/netperf_lxip.inc
source ${genode_dir}/repos/ports/run/netperf.inc

View File

@ -12,6 +12,7 @@ if {[have_spec omap4]} {
# network configuration
set use_nic_bridge 0
set use_nic_router 0
set use_wifi_driver 0
# force usage of usb for nova, known to work with usb30 network adapter

View File

@ -23,6 +23,7 @@ if {[get_cmd_switch --autopilot] && [have_spec x86_32] && ![have_spec acpi]} {
# network configuration
set use_nic_bridge 0
set use_nic_router 0
set use_wifi_driver 1
set use_usb_11 "no"
set use_usb_20 "no"