Skip to content

Commit

Permalink
[bench/nfvconfig] Added benchmark template for cperf.
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneia committed Aug 26, 2014
1 parent c7fc0ba commit f44ec65
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/scripts/cperf/benchmarks/nfvconfig-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# NOTE: Replace <PCIADDR> below with the pci address of an Intel 10G NIC
# and replace <FIXTURE-[X|Y]> which the fixtures you want to benchmark.
#
# There is a reason for this Shell script being so weird
# (by using `set -e' and `echo $out | ...'):
#
# If a benchmark script fails it MUST exit with a non-zero status. Thus
# we make sure that the status returned reflects the benchmarks results
# and NOT the commands that extract the desired portion of the benchmarks
# output. (Last time I checked, even with `set -e ', a plain pipe will
# exit with status 0 even if one of the commands does not).

set -e

out=$(sudo src/snabb src/designs/bench/nfvconfig <PCIADDR> \
src/test_fixtures/nfvconfig/<FIXTURE-X> \
src/test_fixtures/nfvconfig/<FIXTURE-Y> \
64)

# Extract score from output.
echo "$out" | grep "score" | cut -f 2

0 comments on commit f44ec65

Please sign in to comment.