test suite reviews and discussions
 help / color / mirror / Atom feed
From: yufengmx <yufengx.mo@intel.com>
To: dts@dpdk.org
Cc: yufengmx <yufengx.mo@intel.com>
Subject: [dts] [PATCH V7 1/1] l3fwd: update rfc2544/throughput json and display
Date: Tue, 11 Aug 2020 11:21:58 +0800	[thread overview]
Message-ID: <20200811032158.19042-2-yufengx.mo@intel.com> (raw)
In-Reply-To: <20200811032158.19042-1-yufengx.mo@intel.com>


update rfc2544/throughput json and display.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 tests/l3fwd_base.py | 36 ++++++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/tests/l3fwd_base.py b/tests/l3fwd_base.py
index a6e26b0..a9170de 100644
--- a/tests/l3fwd_base.py
+++ b/tests/l3fwd_base.py
@@ -719,14 +719,18 @@ class L3fwdBase(object):
 
     def __json_rfc2544(self, value):
         return {"unit": "Mpps", "name": "Rfc2544",
-                "value": value[0], "delta": value[1]}
+                "value": round(value[0], 3),
+                "delta": round(value[1], 3),
+                }
 
     def __json_throughput(self, value):
         return {"unit": "Mpps", "name": "Throughput",
-                "value": value[0], "delta": value[1]}
+                "value": round(value[0], 3),
+                "delta": round(value[1], 3),
+                }
 
     def __json_rate_percent(self, value):
-        return {"unit": "", "name": "% of Line Rate", "value": value}
+        return {"unit": "", "name": "% of Line Rate", "value": round(value, 3)}
 
     def __json_port_config(self, value):
         return {"unit": "", "name": "Number of Cores/Threads/Queues",
@@ -827,11 +831,12 @@ class L3fwdBase(object):
                         expected, pps, round(gap, 2))
                     self.logger.error(msg)
             else:
+                expected = pps
                 msg = ('{0} {1} expected throughput value is not set, '
                        'ignore check').format(config, frame_size)
                 self.logger.warning(msg)
                 status = 'pass'
-            js_results.append([status, [pps, linerate - pps], percentage, config, frame_size])
+            js_results.append([status, [pps, pps - expected], percentage, config, frame_size])
         # save data with json format
         self.__save_throughput_result(self.__cur_case, js_results)
         # display result table
@@ -861,6 +866,7 @@ class L3fwdBase(object):
                 self.__cur_case, {}).get(self.__nic_name, {}).get(
                 config, {}).get(str(frame_size), {})
             zero_loss_rate, tx_pkts, rx_pkts, pps = result if result else [None] * 3
+            zero_loss_rate = zero_loss_rate or 0
             mpps = pps / 1000000.0
             # expected line rate
             _frame_size = self.__get_frame_size(stm_name, frame_size)
@@ -869,33 +875,43 @@ class L3fwdBase(object):
             actual_rate_percent = mpps * 100 / linerate
             # append data for display
             pdr = expected_cfg.get('traffic_opt', {}).get('pdr')
+            expected_rate = float(expected_cfg.get('rate') or 100.0)
             values.append([
                 config, frame_size, mode.upper(),
-                str(linerate),
+                str(linerate * expected_rate /100),
                 str(mpps),
-                str(zero_loss_rate),
+                str(expected_rate),
                 str(actual_rate_percent),
                 str(tx_pkts),
                 str(rx_pkts),
             ])
             # check data with expected values
-            expected_rate = float(expected_cfg.get('rate') or 100.0)
+            gap = 100 * (zero_loss_rate - expected_rate) / expected_rate
             status = 'pass' \
-                if zero_loss_rate and zero_loss_rate > expected_rate \
+                if abs(gap) < bias \
                 else 'failed'
             js_results.append(
                 [status,
-                 [mpps, linerate - mpps], actual_rate_percent,
+                 [mpps, actual_rate_percent - expected_rate], actual_rate_percent,
                  config, frame_size])
         # save data in json file
         self.__save_rfc2544_result(self.__cur_case, js_results)
         # display result table
+        # Total Cores/Threads/Queues per port
+        # Frame Size
+        # Mode: LPM/EM
+        # Expected Throughput (Mpps)  :  Max linerate throughput value *  'Expected LineRate %'
+        # Actual Throughput (Mpps)  :  actual run throughput value on the zero loss rate
+        # Expected LineRate %  :  which config in l3fwd_lpm_ipv4_rfc2544.cfg
+        # Actual LineRate %  :  actual run zero loss rate
+        # tx_pkts :  send pkts num
+        # rx_pkts :  received pkts num
         title = [
             'Total Cores/Threads/Queues per port',
             "Frame Size",
             "Mode",
             'Expected Throughput (Mpps)',
-            'Actual line rate (Mpps) ',
+            'Actual Throughput (Mpps) ',
             '{} Mode config line rate % '.format(mode.upper()),
             '{} Mode actual line rate % '.format(mode.upper()),
             'tx_pkts',
-- 
2.21.0


  reply	other threads:[~2020-08-11  3:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11  3:21 [dts] [PATCH V7 0/1] l3fwd: update " yufengmx
2020-08-11  3:21 ` yufengmx [this message]
2020-08-12  8:10   ` [dts] [PATCH V7 1/1] l3fwd: update rfc2544/throughput " 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=20200811032158.19042-2-yufengx.mo@intel.com \
    --to=yufengx.mo@intel.com \
    --cc=dts@dpdk.org \
    /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).