From be271aef854887fce72d821a8589dfd4ebbe8e1d Mon Sep 17 00:00:00 2001
From: Martin Klozik <martinx.klozik@intel.com>
Date: Thu, 1 Mar 2018 09:22:47 +0000
Subject: ixia: Bugfixing and burst type enhancement

A support for proper reporting of "Burst" traffic type was added.
Several bugs were fixed:
* RFC2544 Throughput - end of search condition was moved to avoid
  situation, that another iteration is executed but its results
  dropped
* RFC2544 Throughput - pause after each iteration was added to ensure
  that all frames are cleared from buffers; It improves stability
  of results. Also "received" values are no longer higher then
  "sent" values.
* VSPERF will report also the number of sent and received frames
* VSPERF will correctly process send and received values - they
  were switched on several places

JIRA: VSPERF-149
JIRA: VSPERF-562

Change-Id: I8a5caa6385a1ef86aa4bf4511d2753100ed0ab14
Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Christian Trautman <ctrautma@redhat.com>
Reviewed-by: Sridhar Rao <sridhar.rao@spirent.com>
Reviewed-by: Richard Elias <richardx.elias@intel.com>
---
 3rd_party/ixia/pass_fail.tcl | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

(limited to '3rd_party')

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]
-- 
cgit