test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1 0/2] [next]dts/pktgen: TREX core mask configuration
@ 2019-08-06  2:42 yufengmx
  2019-08-06  2:42 ` [dts] [PATCH V1 1/2] [next]conf/pktgen: update option description yufengmx
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: yufengmx @ 2019-08-06  2:42 UTC (permalink / raw)
  To: dts; +Cc: yufengmx

convert core mask setting to list format. 

yufengmx (2):
  [next]conf/pktgen: update option description
  [next]framework/pktgen_trex: convert core mask setting to list format

 conf/pktgen.cfg          | 16 ++++++++++++++--
 framework/pktgen_trex.py | 27 ++++++++++++++++++++++-----
 2 files changed, 36 insertions(+), 7 deletions(-)

-- 
1.9.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dts] [PATCH V1 1/2] [next]conf/pktgen: update option description
  2019-08-06  2:42 [dts] [PATCH V1 0/2] [next]dts/pktgen: TREX core mask configuration yufengmx
@ 2019-08-06  2:42 ` yufengmx
  2019-08-06  2:42 ` [dts] [PATCH V1 2/2] [next]framework/pktgen_trex: convert core mask setting to yufengmx
  2019-08-08  5:40 ` [dts] [PATCH V1 0/2] [next]dts/pktgen: TREX core mask configuration Tu, Lijuan
  2 siblings, 0 replies; 4+ messages in thread
From: yufengmx @ 2019-08-06  2:42 UTC (permalink / raw)
  To: dts; +Cc: yufengmx


*. change core mask to list format in pktgen.cfg and add description for core mask.
*. add synchronized option and its description in pktgen.cfg.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 conf/pktgen.cfg | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/conf/pktgen.cfg b/conf/pktgen.cfg
index 667e1e8..90cf670 100644
--- a/conf/pktgen.cfg
+++ b/conf/pktgen.cfg
@@ -4,7 +4,19 @@
 #    trex server binary file is under this directory.
 # trex_lib_path(optional): trex stateless client libs directory, it is optional.
 #    If it is not set, use a default relative directory.
-# coremask -c: A hexadecimal bitmask of cores to run on
+# coremask:
+#    a list of masks (one core mask per port)
+#      0x3,0x5
+# synchronized:
+#    If coremask and synchronized are not set or None, trex will set core mask
+#    to:
+#       CORE_MASK_SPLIT
+#           In CORE_MASK_SPLIT all the traffic will be divided equally between all
+#           the cores, associated with each port
+#    If coremask is not set and synchronized is set to True, trex will set core 
+#    mask to:
+#       CORE_MASK_SINGLE
+            Only use one core for all ports
 # num -n: Number of memory channels
 # proc_type --proc-type: Type of this process
 # pci_blacklist --pci-blacklist, -b: Add a PCI device in black list.
@@ -21,7 +33,7 @@ config_file=/etc/trex_cfg.yaml
 server=10.67.111.143
 pcap_file=/opt/trex-core-2.26/scripts/stl/sample.pcap
 core_num=4
-#core_mask=0x3
+core_mask=0x3,0x5
 ip_src=16.0.0.1
 ip_dst=10.0.0.1
 warmup=15
-- 
1.9.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dts] [PATCH V1 2/2] [next]framework/pktgen_trex: convert core mask setting to
  2019-08-06  2:42 [dts] [PATCH V1 0/2] [next]dts/pktgen: TREX core mask configuration yufengmx
  2019-08-06  2:42 ` [dts] [PATCH V1 1/2] [next]conf/pktgen: update option description yufengmx
@ 2019-08-06  2:42 ` yufengmx
  2019-08-08  5:40 ` [dts] [PATCH V1 0/2] [next]dts/pktgen: TREX core mask configuration Tu, Lijuan
  2 siblings, 0 replies; 4+ messages in thread
From: yufengmx @ 2019-08-06  2:42 UTC (permalink / raw)
  To: dts; +Cc: yufengmx

 list format

*. convert core mask setting to list format.
*. create _get_traffic_option to convert pktgen.cfg setting value to traffic start options.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 framework/pktgen_trex.py | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/framework/pktgen_trex.py b/framework/pktgen_trex.py
index 159750e..9044682 100644
--- a/framework/pktgen_trex.py
+++ b/framework/pktgen_trex.py
@@ -451,6 +451,23 @@ class TrexPacketGenerator(PacketGenerator):
         from trex_stl_lib.api import STLClient
         # set trex class
         self.STLClient = STLClient
+        # get configuration from pktgen config file
+        self._get_traffic_option()
+
+    def _get_traffic_option(self):
+        ''' get configuration from pktgen config file '''
+        # set trex coremask
+        _core_mask = self.conf.get("core_mask")
+        self.core_mask = \
+            [int(item[2:], 16) for item in _core_mask.split(',')] \
+            if _core_mask and '0x' in _core_mask else \
+            None
+        # In case of several ports, ensure their transmitting time is
+        # synchronized. 
+        _synchronized = self.conf.get("synchronized")
+        self.sync = True \
+                    if _synchronized and _synchronized.lower() == 'true' else \
+                    False
 
     def _connect(self):
         self._conn = self.STLClient(server=self.conf["server"])
@@ -792,10 +809,9 @@ class TrexPacketGenerator(PacketGenerator):
         warmup = int(self.conf["warmup"]) if self.conf.has_key("warmup") \
                                           else 25
         # set trex coremask
-        wait_interval, core_mask = (
-                        warmup+30, int(self.conf["core_mask"], 16)) \
-                            if self.conf.has_key("core_mask") \
-                            else (warmup+5, 0x3)
+        wait_interval = warmup+30 \
+                        if self.conf.has_key("core_mask") \
+                        else warmup+5
 
         try:
             ###########################################
@@ -806,7 +822,8 @@ class TrexPacketGenerator(PacketGenerator):
                 'ports':    self._traffic_ports,
                 'mult':     rate_percent,
                 'duration': duration,
-                'core_mask':core_mask,
+                'core_mask': self.core_mask,
+                'synchronized': self.sync,
                 'force':    True,}
             self.logger.info("begin traffic ......")
             self._conn.start(**run_opt)
-- 
1.9.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH V1 0/2] [next]dts/pktgen: TREX core mask configuration
  2019-08-06  2:42 [dts] [PATCH V1 0/2] [next]dts/pktgen: TREX core mask configuration yufengmx
  2019-08-06  2:42 ` [dts] [PATCH V1 1/2] [next]conf/pktgen: update option description yufengmx
  2019-08-06  2:42 ` [dts] [PATCH V1 2/2] [next]framework/pktgen_trex: convert core mask setting to yufengmx
@ 2019-08-08  5:40 ` Tu, Lijuan
  2 siblings, 0 replies; 4+ messages in thread
From: Tu, Lijuan @ 2019-08-08  5:40 UTC (permalink / raw)
  To: Mo, YufengX, dts; +Cc: Mo, YufengX

Applied the series.

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yufengmx
> Sent: Tuesday, August 6, 2019 10:43 AM
> To: dts@dpdk.org
> Cc: Mo, YufengX <yufengx.mo@intel.com>
> Subject: [dts] [PATCH V1 0/2] [next]dts/pktgen: TREX core mask configuration
> 
> convert core mask setting to list format.
> 
> yufengmx (2):
>   [next]conf/pktgen: update option description
>   [next]framework/pktgen_trex: convert core mask setting to list format
> 
>  conf/pktgen.cfg          | 16 ++++++++++++++--
>  framework/pktgen_trex.py | 27 ++++++++++++++++++++++-----
>  2 files changed, 36 insertions(+), 7 deletions(-)
> 
> --
> 1.9.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-08  5:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06  2:42 [dts] [PATCH V1 0/2] [next]dts/pktgen: TREX core mask configuration yufengmx
2019-08-06  2:42 ` [dts] [PATCH V1 1/2] [next]conf/pktgen: update option description yufengmx
2019-08-06  2:42 ` [dts] [PATCH V1 2/2] [next]framework/pktgen_trex: convert core mask setting to yufengmx
2019-08-08  5:40 ` [dts] [PATCH V1 0/2] [next]dts/pktgen: TREX core mask configuration Tu, Lijuan

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).