Skip to content

Commit

Permalink
intel_mp: fix 1G blast selftest via use of RateLimitedRepeater
Browse files Browse the repository at this point in the history
The lack of backpressure in basic_apps.Repeater caused the testsend.snabb
to predict unpredictable/unbalanced packet distributions, causing test cases on
slower 1G NICs to fail.

This changes testsend.snabb to use lwaftr’s RateLimitedRepeater, and sets an
appropriate rate for the 1G tests.
  • Loading branch information
eugeneia committed Sep 17, 2018
1 parent 33c0912 commit 2bd39ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/apps/intel_mp/test_1g_2q_blast.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
SNABB_SEND_BLAST=true ./testsend.snabb $SNABB_PCI_INTEL1G1 0 source.pcap &
SNABB_SEND_BLAST=true SNABB_SEND_BLAST_RATE=1e9 ./testsend.snabb $SNABB_PCI_INTEL1G1 0 source.pcap &
BLAST=$!

SNABB_RECV_SPINUP=2 SNABB_RECV_DURATION=5 ./testrecv.snabb $SNABB_PCI_INTEL1G0 0 > results.0 &
Expand Down
6 changes: 3 additions & 3 deletions src/apps/intel_mp/test_1g_2q_blast_vmdq_auto.sh
Expand Up @@ -2,7 +2,7 @@
#
# Test VMDq with automatic pool selection

SNABB_SEND_BLAST=true ./testsend.snabb $SNABB_PCI_INTEL1G1 0 source2.pcap &
SNABB_SEND_BLAST=true SNABB_SEND_BLAST_RATE=1e9 ./testsend.snabb $SNABB_PCI_INTEL1G1 0 source2.pcap &
BLAST=$!

SNABB_RECV_SPINUP=2 SNABB_RECV_DURATION=5 ./testvmdqrecv.snabb $SNABB_PCI_INTEL1G0 "90:72:82:78:c9:7a" nil nil nil > results.0 &
Expand All @@ -18,7 +18,7 @@ kill -9 $BLAST

# both queues should see packets
[[ `cat results.* | grep "^GPRC" | awk '{print $2}'` -gt 10000 ]] &&\
[[ `cat results.0 | grep -m 1 bpp | awk '{print $11}'` -gt 0 ]] &&\
[[ `cat results.1 | grep -m 1 bpp | awk '{print $11}'` -gt 0 ]]
[[ `cat results.0 | grep -m 1 fpb | awk '{print $9}'` -gt 0 ]] &&\
[[ `cat results.1 | grep -m 1 fpb | awk '{print $9}'` -gt 0 ]]

exit $?
5 changes: 3 additions & 2 deletions src/apps/intel_mp/testsend.snabb
Expand Up @@ -15,8 +15,9 @@ config.app(c, "nic", intel.Intel,
{pciaddr=pciaddr, txq=qno, wait_for_link=true})

if os.getenv("SNABB_SEND_BLAST") then
local basic = require("apps.basic.basic_apps")
config.app(c, "repeat", basic.Repeater)
local loadgen = require("apps.lwaftr.loadgen")
local rate = tonumber(os.getenv("SNABB_SEND_BLAST_RATE")) or 10e9
config.app(c, "repeat", loadgen.RateLimitedRepeater,{rate=rate})
config.link(c, "pcap.output -> repeat.input")
config.link(c, "repeat.output -> nic.input")
else
Expand Down

0 comments on commit 2bd39ae

Please sign in to comment.