summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x3rd_party/ixia/pass_fail.tcl28
-rwxr-xr-xtools/pkt_gen/ixia/ixia.py25
2 files changed, 33 insertions, 20 deletions
diff --git a/3rd_party/ixia/pass_fail.tcl b/3rd_party/ixia/pass_fail.tcl
index 0a5a7677..bf1fb556 100755
--- a/3rd_party/ixia/pass_fail.tcl
+++ b/3rd_party/ixia/pass_fail.tcl
@@ -431,7 +431,7 @@ proc sendTraffic { flowSpec trafficSpec } {
if {[udp set $::chassis $::card $::port1]} {
errorMsg "Error setting udp on port $::chassis.$::card.$::port1"
}
- errorMsg "frameSize: $frameSize, packetSize: $packetSize, srcMac: $srcMac, dstMac: $dstMac, srcPort: $srcPort, dstPort: $dstPort"
+ errorMsg "frameSize: $frameSize, packetSize: $packetSize, srcMac: $srcMac, dstMac: $dstMac, srcPort: $srcPort, dstPort: $dstPort, framerate: $frameRate %"
if {[info exists protocolPad]} {
errorMsg "protocolPad: $protocolPad, protocolPadBytes: $protocolPadBytes"
}
@@ -544,8 +544,8 @@ proc sendTraffic { flowSpec trafficSpec } {
} else {
errorMsg "Too many packets for capture."
}
-
- set result [list $framesSent $framesRecv $bytesSent $bytesRecv $payError $seqError]
+ lappend result $payError
+ lappend result $seqError
return $result
} else {
errorMsg "streamtype is not supported: '$streamType'"
@@ -638,6 +638,9 @@ proc stopTraffic {} {
logMsg "Frame Rate Sent: $sendRate"
logMsg "Frame Rate Recv: $recvRate\n"
+ logMsg "Bytes Rate Sent: $sendRateBytes"
+ logMsg "Bytes Rate Recv: $recvRateBytes\n"
+
set result [list $framesSent $framesRecv $bytesSent $bytesRecv $sendRate $recvRate $sendRateBytes $recvRateBytes]
return $result
@@ -728,13 +731,6 @@ proc rfcThroughputTest { testSpec trafficSpec } {
set framesDroppedRate 100
}
- # check if we've already found the rate before 10 iterations, i.e.
- # 'percentRate = idealValue'. This is as accurate as we can get with
- # integer values.
- if {[expr "$max - $min"] <= 0.5 } {
- break
- }
-
# handle 'percentRate <= idealValue' case
if {$framesDroppedRate <= $lossRate} {
logMsg "Frame sendRate of '$sendRate' pps succeeded ('$framesDropped' frames dropped)"
@@ -754,6 +750,18 @@ proc rfcThroughputTest { testSpec trafficSpec } {
set max $percentRate
set percentRate [expr "$percentRate - ([expr "$max - $min"] * 0.5)"]
}
+
+ # check if we've already found the rate before 10 iterations, i.e.
+ # 'percentRate = idealValue'. This is as accurate as we can get with
+ # integer values.
+ if {[expr "$max - $min"] <= 0.5 } {
+ logMsg "End of search condition for framerate is met: $max % - $min % <= 0.5 %"
+ break
+ }
+
+ logMsg "Waiting 2000 ms"
+ # wait to process delayed frames
+ after 2000
}
set bestRate [lindex $result 4]
diff --git a/tools/pkt_gen/ixia/ixia.py b/tools/pkt_gen/ixia/ixia.py
index ffb1f5e3..4e6b57c6 100755
--- a/tools/pkt_gen/ixia/ixia.py
+++ b/tools/pkt_gen/ixia/ixia.py
@@ -254,9 +254,9 @@ class Ixia(trafficgen.ITrafficGenerator):
result = self._send_traffic(flow, traffic)
- assert len(result) == 6 # fail-fast if underlying Tcl code changes
+ assert len(result) == 10 # fail-fast if underlying Tcl code changes
- #NOTE - implement Burst results setting via TrafficgenResults.
+ return Ixia._create_result(result)
def send_cont_traffic(self, traffic=None, duration=30):
"""See ITrafficGenerator for description
@@ -317,20 +317,25 @@ class Ixia(trafficgen.ITrafficGenerator):
:returns: dictionary strings representing results from
traffic generator.
"""
- assert len(result) == 8 # fail-fast if underlying Tcl code changes
+ assert len(result) == 8 or len(result) == 10 # fail-fast if underlying Tcl code changes
+
+ # content of result common for all tests
+ # [framesSent, framesRecv, bytesSent, bytesRecv, sendRate, recvRate, sendRateBytes, recvRateBytes]
+ # burst test has additional two values at the end: payError, seqError
if float(result[0]) == 0:
loss_rate = 100
else:
- loss_rate = (float(result[0]) - float(result[1])) / float(result[0]) * 100
+ loss_rate = round((float(result[0]) - float(result[1])) / float(result[0]) * 100, 5)
result_dict = OrderedDict()
- # drop the first 4 elements as we don't use/need them. In
- # addition, IxExplorer does not support latency or % line rate
+ # IxExplorer does not support latency or % line rate
# metrics so we have to return dummy values for these metrics
- result_dict[ResultsConstants.THROUGHPUT_RX_FPS] = result[4]
- result_dict[ResultsConstants.TX_RATE_FPS] = result[5]
- result_dict[ResultsConstants.THROUGHPUT_RX_MBPS] = str(round(int(result[6]) / 1000000, 3))
- result_dict[ResultsConstants.TX_RATE_MBPS] = str(round(int(result[7]) / 1000000, 3))
+ result_dict[ResultsConstants.TX_FRAMES] = result[0]
+ result_dict[ResultsConstants.RX_FRAMES] = result[1]
+ result_dict[ResultsConstants.TX_RATE_FPS] = result[4]
+ result_dict[ResultsConstants.THROUGHPUT_RX_FPS] = result[5]
+ result_dict[ResultsConstants.TX_RATE_MBPS] = str(round(int(result[6]) * 8 / 1e6, 3))
+ result_dict[ResultsConstants.THROUGHPUT_RX_MBPS] = str(round(int(result[7]) * 8 / 1e6, 3))
result_dict[ResultsConstants.FRAME_LOSS_PERCENT] = loss_rate
result_dict[ResultsConstants.TX_RATE_PERCENT] = \
ResultsConstants.UNKNOWN_VALUE