mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 16:35:28 +00:00
run: add nic_bridge to netperf native test
This commit is contained in:
parent
776a8d3f8c
commit
4c9cee24de
@ -16,24 +16,39 @@ if {![file exists bin/netperf_host]} {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# sanity check that the right version is used
|
||||
spawn bin/netperf_host -V
|
||||
expect {
|
||||
{Netperf version 2.6.0} { }
|
||||
eof { puts "\nError: unsupported netperf version.\n"; exit 1 }
|
||||
}
|
||||
|
||||
# netperf configuration
|
||||
set packet_size 1024
|
||||
set netperf_tests "TCP_STREAM TCP_MAERTS"
|
||||
|
||||
# network configuration
|
||||
set use_nic_bridge 0
|
||||
set use_usb_11 "no"
|
||||
set use_usb_20 "yes"
|
||||
set use_usb_30 "no"
|
||||
|
||||
# start run script generation
|
||||
set use_usb_driver [expr [have_spec omap4] || [have_spec exynos5]]
|
||||
set use_nic_driver [expr !$use_usb_driver]
|
||||
set use_platform_driver [expr $use_usb_driver && [have_spec foc_arndale]]
|
||||
if {$use_usb_driver} { set network_driver "usb_drv" }
|
||||
if {$use_nic_driver} { set network_driver "nic_drv" }
|
||||
|
||||
set build_components {
|
||||
core init
|
||||
drivers/pci drivers/timer drivers/nic
|
||||
app/netperf
|
||||
}
|
||||
|
||||
set use_usb_driver [expr [have_spec omap4] || [have_spec exynos5]]
|
||||
set use_nic_driver [expr !$use_usb_driver]
|
||||
set use_platform_driver [expr $use_usb_driver && [have_spec foc_arndale]]
|
||||
|
||||
lappend_if $use_usb_driver build_components drivers/usb
|
||||
lappend_if $use_platform_driver build_components drivers/platform
|
||||
lappend_if $use_nic_bridge build_components server/nic_bridge
|
||||
lappend_if [have_spec acpi] build_components drivers/acpi
|
||||
lappend_if [have_spec pci] build_components drivers/pci/device_pd
|
||||
|
||||
@ -63,18 +78,10 @@ set config {
|
||||
<default-route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides> <service name="Timer"/> </provides>
|
||||
</start>
|
||||
<start name="netserver_genode">
|
||||
<resource name="RAM" quantum="16M"/>
|
||||
<config>
|
||||
<arg value="netserver"/>
|
||||
<arg value="-D"/>
|
||||
<arg value="-4"/>
|
||||
<arg value="-f"/>
|
||||
</config>
|
||||
</start> }
|
||||
|
||||
append_if $use_platform_driver config {
|
||||
@ -83,13 +90,30 @@ append_if $use_platform_driver config {
|
||||
<provides><service name="Regulator"/></provides>
|
||||
</start>}
|
||||
|
||||
append_if $use_nic_bridge config {
|
||||
<start name="nic_bridge">
|
||||
<resource name="RAM" quantum="2M"/>
|
||||
<provides><service name="Nic"/></provides>
|
||||
<config/>
|
||||
<route>
|
||||
<service name="Nic"> }
|
||||
append_if $use_nic_bridge config "
|
||||
<child name=\"$network_driver\"/>"
|
||||
append_if $use_nic_bridge config {
|
||||
</service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start> }
|
||||
|
||||
append_if $use_usb_driver config {
|
||||
<start name="usb_drv">
|
||||
<resource name="RAM" quantum="12M"/>
|
||||
<provides>
|
||||
<service name="Nic"/>
|
||||
</provides>
|
||||
<config uhci="no" ehci="yes" xhci="no">
|
||||
</provides>}
|
||||
append_if $use_usb_driver config "
|
||||
<config uhci=\"$use_usb_11\" ehci=\"$use_usb_20\" xhci=\"$use_usb_30\">"
|
||||
append_if $use_usb_driver config {
|
||||
<nic mac="2e:60:90:0c:4e:05" />
|
||||
</config>
|
||||
</start>}
|
||||
@ -121,6 +145,21 @@ append_if [expr ![have_spec acpi] && [have_spec pci]] config {
|
||||
</start> }
|
||||
|
||||
append config {
|
||||
<start name="netserver_genode">
|
||||
<resource name="RAM" quantum="16M"/>
|
||||
<config>
|
||||
<arg value="netserver"/>
|
||||
<arg value="-D"/>
|
||||
<arg value="-4"/>
|
||||
<arg value="-f"/>
|
||||
</config>}
|
||||
append_if $use_nic_bridge config {
|
||||
<route>
|
||||
<service name="Nic"> <child name="nic_bridge"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>}
|
||||
append config {
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
|
||||
@ -138,6 +177,8 @@ set boot_modules {
|
||||
netserver_genode
|
||||
}
|
||||
|
||||
lappend_if $use_nic_bridge boot_modules nic_bridge
|
||||
|
||||
# platform-specific modules
|
||||
lappend_if $use_platform_driver boot_modules platform_drv
|
||||
lappend_if [have_spec acpi] boot_modules acpi_drv
|
||||
@ -173,31 +214,44 @@ if [is_qemu_available] {
|
||||
}
|
||||
|
||||
# start netperf client connecting to netperf server running native on Genode
|
||||
set packet_size 1024
|
||||
|
||||
set netperf_tests "TCP_STREAM TCP_MAERTS"
|
||||
|
||||
foreach netperf_test $netperf_tests {
|
||||
puts "\n---------------------------- $netperf_test -----------------------"
|
||||
|
||||
spawn bin/netperf_host -H $ip_addr -P 1 -v 2 -t $netperf_test -c -C -- -m $packet_size -P 49153,49153
|
||||
set netperf_id $spawn_id
|
||||
|
||||
run_genode_until "Segment" 60 $netperf_id
|
||||
|
||||
# format output understandable for post proccessing scripts
|
||||
# get throughput from netperf output
|
||||
set throughput [regexp -all -inline {([0-9]+[ ]+){3}[0-9]+\.[0-9]+[ ]+[0-9]+\.[0-9]+} $output]
|
||||
set throughput [regexp -all -inline {[0-9]+\.[0-9]+} $throughput]
|
||||
puts "! PERF: tcp_stream [lindex $throughput 1] MBit/s ok"
|
||||
|
||||
# calculate packets per second rate and print it
|
||||
# calculate packets per second rate
|
||||
set all_bytes [regexp -all -inline {([0-9]+[ ]+){5}} $output]
|
||||
set all_bytes [lindex $all_bytes 0 4]
|
||||
|
||||
set elapsed_time [regexp -all -inline {([0-9]+[ ]+){3}[0-9]+\.[0-9]+[ ]+} $output]
|
||||
set elapsed_time [lindex $elapsed_time 0 3]
|
||||
set packets_second [expr $all_bytes / $packet_size / $elapsed_time]
|
||||
|
||||
puts "\ncalculation: overall bytes / size per packet / time = packets per second"
|
||||
puts -nonewline " $all_bytes Bytes / $packet_size Bytes / $elapsed_time s = "
|
||||
puts "[format %8.0f [expr $all_bytes / $packet_size / $elapsed_time]] packets/s\n"
|
||||
puts "[format %8.0f $packets_second] packets/s\n"
|
||||
|
||||
# format output parseable for post proccessing scripts
|
||||
foreach i {0 1} {
|
||||
puts -nonewline "! PERF: $netperf_test"
|
||||
if {$use_nic_bridge} { puts -nonewline "_bridge" }
|
||||
if {$use_usb_driver} {
|
||||
if {![string compare $use_usb_11 "yes"]} { puts -nonewline "_uhci" }
|
||||
if {![string compare $use_usb_20 "yes"]} { puts -nonewline "_ohci" }
|
||||
if {![string compare $use_usb_30 "yes"]} { puts -nonewline "_xhci" }
|
||||
}
|
||||
if {$i == 0} { puts -nonewline " [lindex $throughput 1] MBit/s ok" }
|
||||
if {$i == 1} { puts -nonewline "_packet_$packet_size [format %6.0f $packets_second] packets/s ok" }
|
||||
if {$i > 1} { puts -nonewline " 0 unknown err" }
|
||||
puts ""
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user