test suite reviews and discussions
 help / color / mirror / Atom feed
From: yufengmx <yufengx.mo@intel.com>
To: dts@dpdk.org, lijuan.tu@intel.com
Cc: yufengmx <yufengx.mo@intel.com>
Subject: [dts] [PATCH V1 16/27] framework/pktgen: enable ixNetwork
Date: Mon, 25 Jan 2021 16:44:03 +0800	[thread overview]
Message-ID: <20210125084414.8503-17-yufengx.mo@intel.com> (raw)
In-Reply-To: <20210125084414.8503-1-yufengx.mo@intel.com>


enable pktgen/ixNetwork rfc2544 testing scenario.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 framework/pktgen_base.py | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/framework/pktgen_base.py b/framework/pktgen_base.py
index 81c8830c..f30785d0 100644
--- a/framework/pktgen_base.py
+++ b/framework/pktgen_base.py
@@ -39,7 +39,7 @@ from enum import Enum, unique
 
 from config import PktgenConf
 # packet generator name
-from settings import PKTGEN_DPDK, PKTGEN_TREX, PKTGEN_IXIA, PKTGEN
+from settings import PKTGEN_DPDK, PKTGEN_TREX, PKTGEN_IXIA, PKTGEN_IXIA_NETWORK, PKTGEN
 
 # macro definition
 TRANSMIT_CONT = 'continuous'
@@ -355,6 +355,27 @@ class PacketGenerator(object):
         # In real testing scenario, this method can offer more data than it
         return list(result.values())[0]
 
+    def _measure_rfc2544_ixnet(self, stream_ids=[], options={}):
+        """
+        used for ixNetwork
+        """
+        # main traffic
+        self._prepare_transmission(stream_ids=stream_ids)
+        self._start_transmission(stream_ids, options)
+        self._stop_transmission(None)
+        # parsing test result
+        stats = self._retrieve_port_statistic(stream_ids[0], 'rfc2544')
+        tx_pkts, rx_pkts, pps = stats
+        lost_p = tx_pkts - rx_pkts
+        if tx_pkts <= 0:
+            loss_rate = 0
+        else:
+            loss_rate = float(lost_p) / float(tx_pkts)
+            if loss_rate < 0:
+                loss_rate = 0
+        result = (loss_rate, tx_pkts, rx_pkts, pps)
+        return result
+
     def measure_latency(self, stream_ids=[], options={}):
         """
         Measure latency on each tx/rx ports
@@ -533,6 +554,9 @@ class PacketGenerator(object):
             accuracy :
                 dichotomy algorithm accuracy, default 0.001.
         """
+        if self.pktgen_type == PKTGEN_IXIA_NETWORK:
+            return self._measure_rfc2544_ixnet(stream_ids, options)
+
         max_rate = options.get('max_rate') or 100.0
         min_rate = options.get('min_rate') or 0.0
         accuracy = options.get('accuracy') or 0.001
-- 
2.21.0


  parent reply	other threads:[~2021-01-25  8:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25  8:43 [dts] [PATCH V1 00/27] dts: enable IxNetwork and enhance perf testing yufengmx
2021-01-25  8:43 ` [dts] [PATCH V1 01/27] framework/pktgen: return trex tx stats yufengmx
2021-01-25  8:43 ` [dts] [PATCH V1 02/27] framework/pktgen: return throughput " yufengmx
2021-01-25  8:43 ` [dts] [PATCH V1 03/27] " yufengmx
2021-01-25  8:43 ` [dts] [PATCH V1 04/27] conf/pktgen: enable ixNetwork yufengmx
2021-01-25  8:43 ` [dts] [PATCH V1 05/27] " yufengmx
2021-01-25  8:43 ` [dts] [PATCH V1 06/27] conf/l3fwd: add packet types comment yufengmx
2021-01-25  8:43 ` [dts] [PATCH V1 07/27] conf/testpmd: testpmd perf config yufengmx
2021-01-25  8:43 ` [dts] [PATCH V1 08/27] framework/pktgen: enable ixNetwork yufengmx
2021-01-25  8:43 ` [dts] [PATCH V1 09/27] " yufengmx
2021-01-25  8:43 ` [dts] [PATCH V1 10/27] " yufengmx
2021-01-25  8:43 ` [dts] [PATCH V1 11/27] " yufengmx
2021-01-25  8:43 ` [dts] [PATCH V1 12/27] " yufengmx
2021-01-25  8:44 ` [dts] [PATCH V1 13/27] conf/pktgen: " yufengmx
2021-01-25  8:44 ` [dts] [PATCH V1 14/27] framework/pktgen: " yufengmx
2021-01-25  8:44 ` [dts] [PATCH V1 15/27] " yufengmx
2021-01-25  8:44 ` yufengmx [this message]
2021-01-25  8:44 ` [dts] [PATCH V1 17/27] " yufengmx
2021-01-25  8:44 ` [dts] [PATCH V1 18/27] tests/perf_test: rename l3fwd_base module yufengmx
2021-01-25  8:44 ` [dts] [PATCH V1 19/27] tests/perf_test: cover testpmd testing scenario yufengmx
2021-01-25  8:44 ` [dts] [PATCH V1 20/27] tests/perf_test: save rfc2544 expected throughput yufengmx
2021-01-25  8:44 ` [dts] [PATCH V1 21/27] tests/l3fwd_em: update script yufengmx
2021-01-25  8:44 ` [dts] [PATCH V1 22/27] tests/lpm_ipv4_rfc2544: " yufengmx
2021-01-25  8:44 ` [dts] [PATCH V1 23/27] tests/l3fwd_lpm_ipv4: " yufengmx
2021-01-25  8:44 ` [dts] [PATCH V1 24/27] tests/l3fwd_lpm_ipv6: " yufengmx
2021-01-25  8:44 ` [dts] [PATCH V1 25/27] tests/l3fwd: " yufengmx
2021-01-25  8:44 ` [dts] [PATCH V1 26/27] tests/vf_l3fwd_kernelpf: " yufengmx
2021-01-25  8:44 ` [dts] [PATCH V1 27/27] tests/testpmd_perf: upload script yufengmx
2021-02-19  7:02 ` [dts] [PATCH V1 00/27] dts: enable IxNetwork and enhance perf testing Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210125084414.8503-17-yufengx.mo@intel.com \
    --to=yufengx.mo@intel.com \
    --cc=dts@dpdk.org \
    --cc=lijuan.tu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).