* [dts] [PATCH V2 1/2] [next]conf/pktgen: update option description
2019-08-06 6:03 [dts] [PATCH V2 0/2] [next]dts/pktgen: TREX core mask configuration yufengmx
@ 2019-08-06 6:03 ` yufengmx
2019-08-06 6:13 ` Chen, Zhaoyan
2019-08-06 6:03 ` [dts] [PATCH V2 2/2] [next]framework/pktgen_trex: convert core mask setting to yufengmx
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: yufengmx @ 2019-08-06 6:03 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 | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/conf/pktgen.cfg b/conf/pktgen.cfg
index 667e1e8..14a58f5 100644
--- a/conf/pktgen.cfg
+++ b/conf/pktgen.cfg
@@ -4,7 +4,14 @@
# 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:
+# 1. a list of masks (one core mask per port), sort sequence as
+# <port 0 core mask>,<port 1 core mask>
+# example: core_mask=0x3,0x5
+# 2. CORE_MASK_PIN
+# for each dual ports (a group that shares the same cores), the cores will
+# be divided half pinned for each port.
+# example: core_mask=CORE_MASK_PIN
# 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 +28,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] 7+ messages in thread
* Re: [dts] [PATCH V2 1/2] [next]conf/pktgen: update option description
2019-08-06 6:03 ` [dts] [PATCH V2 1/2] [next]conf/pktgen: update option description yufengmx
@ 2019-08-06 6:13 ` Chen, Zhaoyan
0 siblings, 0 replies; 7+ messages in thread
From: Chen, Zhaoyan @ 2019-08-06 6:13 UTC (permalink / raw)
To: Mo, YufengX, dts; +Cc: Mo, YufengX, Chen, Zhaoyan
Acked-by: Zhaoyan Chen <zhaoyan.chen@intel.com>
Regards,
Zhaoyan Chen
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yufengmx
> Sent: Tuesday, August 6, 2019 2:03 PM
> To: dts@dpdk.org
> Cc: Mo, YufengX <yufengx.mo@intel.com>
> Subject: [dts] [PATCH V2 1/2] [next]conf/pktgen: update option description
>
>
> *. 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 | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/conf/pktgen.cfg b/conf/pktgen.cfg index 667e1e8..14a58f5 100644
> --- a/conf/pktgen.cfg
> +++ b/conf/pktgen.cfg
> @@ -4,7 +4,14 @@
> # 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:
> +# 1. a list of masks (one core mask per port), sort sequence as
> +# <port 0 core mask>,<port 1 core mask>
> +# example: core_mask=0x3,0x5
> +# 2. CORE_MASK_PIN
> +# for each dual ports (a group that shares the same cores), the cores will
> +# be divided half pinned for each port.
> +# example: core_mask=CORE_MASK_PIN
> # 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 +28,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] 7+ messages in thread
* [dts] [PATCH V2 2/2] [next]framework/pktgen_trex: convert core mask setting to
2019-08-06 6:03 [dts] [PATCH V2 0/2] [next]dts/pktgen: TREX core mask configuration yufengmx
2019-08-06 6:03 ` [dts] [PATCH V2 1/2] [next]conf/pktgen: update option description yufengmx
@ 2019-08-06 6:03 ` yufengmx
2019-08-06 6:13 ` Chen, Zhaoyan
2019-08-06 6:13 ` [dts] [PATCH V2 0/2] [next]dts/pktgen: TREX core mask configuration Chen, Zhaoyan
2019-08-07 1:44 ` Tu, Lijuan
3 siblings, 1 reply; 7+ messages in thread
From: yufengmx @ 2019-08-06 6:03 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 | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/framework/pktgen_trex.py b/framework/pktgen_trex.py
index 159750e..c05741b 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")
+ if _core_mask:
+ if '0x' in _core_mask:
+ self.core_mask = \
+ [int(item[2:], 16) for item in _core_mask.split(',')]
+ else:
+ self.core_mask = self.STLClient.CORE_MASK_PIN \
+ if _core_mask.upper() == 'CORE_MASK_PIN' else \
+ None
+ else:
+ self.core_mask = None
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,7 @@ class TrexPacketGenerator(PacketGenerator):
'ports': self._traffic_ports,
'mult': rate_percent,
'duration': duration,
- 'core_mask':core_mask,
+ 'core_mask': self.core_mask,
'force': True,}
self.logger.info("begin traffic ......")
self._conn.start(**run_opt)
--
1.9.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dts] [PATCH V2 2/2] [next]framework/pktgen_trex: convert core mask setting to
2019-08-06 6:03 ` [dts] [PATCH V2 2/2] [next]framework/pktgen_trex: convert core mask setting to yufengmx
@ 2019-08-06 6:13 ` Chen, Zhaoyan
0 siblings, 0 replies; 7+ messages in thread
From: Chen, Zhaoyan @ 2019-08-06 6:13 UTC (permalink / raw)
To: Mo, YufengX, dts; +Cc: Mo, YufengX, Chen, Zhaoyan
Acked-by: Zhaoyan Chen <zhaoyan.chen@intel.com>
Regards,
Zhaoyan Chen
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yufengmx
> Sent: Tuesday, August 6, 2019 2:03 PM
> To: dts@dpdk.org
> Cc: Mo, YufengX <yufengx.mo@intel.com>
> Subject: [dts] [PATCH V2 2/2] [next]framework/pktgen_trex: convert core mask
> setting to
>
> 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 | 26 +++++++++++++++++++++-----
> 1 file changed, 21 insertions(+), 5 deletions(-)
>
> diff --git a/framework/pktgen_trex.py b/framework/pktgen_trex.py index
> 159750e..c05741b 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")
> + if _core_mask:
> + if '0x' in _core_mask:
> + self.core_mask = \
> + [int(item[2:], 16) for item in _core_mask.split(',')]
> + else:
> + self.core_mask = self.STLClient.CORE_MASK_PIN \
> + if _core_mask.upper() == 'CORE_MASK_PIN' else \
> + None
> + else:
> + self.core_mask = None
>
> 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,7 @@ class TrexPacketGenerator(PacketGenerator):
> 'ports': self._traffic_ports,
> 'mult': rate_percent,
> 'duration': duration,
> - 'core_mask':core_mask,
> + 'core_mask': self.core_mask,
> 'force': True,}
> self.logger.info("begin traffic ......")
> self._conn.start(**run_opt)
> --
> 1.9.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dts] [PATCH V2 0/2] [next]dts/pktgen: TREX core mask configuration
2019-08-06 6:03 [dts] [PATCH V2 0/2] [next]dts/pktgen: TREX core mask configuration yufengmx
2019-08-06 6:03 ` [dts] [PATCH V2 1/2] [next]conf/pktgen: update option description yufengmx
2019-08-06 6:03 ` [dts] [PATCH V2 2/2] [next]framework/pktgen_trex: convert core mask setting to yufengmx
@ 2019-08-06 6:13 ` Chen, Zhaoyan
2019-08-07 1:44 ` Tu, Lijuan
3 siblings, 0 replies; 7+ messages in thread
From: Chen, Zhaoyan @ 2019-08-06 6:13 UTC (permalink / raw)
To: Mo, YufengX, dts; +Cc: Mo, YufengX, Chen, Zhaoyan
Acked-by: Zhaoyan Chen <zhaoyan.chen@intel.com>
Regards,
Zhaoyan Chen
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yufengmx
> Sent: Tuesday, August 6, 2019 2:03 PM
> To: dts@dpdk.org
> Cc: Mo, YufengX <yufengx.mo@intel.com>
> Subject: [dts] [PATCH V2 0/2] [next]dts/pktgen: TREX core mask configuration
>
> convert core mask setting to list format.
>
>
> v2:
> - Follow Chen, Zhaoyan review
> - *. remove synchronized option for future
> - *. add CORE_MASK_PIN option value
>
> yufengmx (2):
> [next]conf/pktgen: update option description
> [next]framework/pktgen_trex: convert core mask setting to list format
>
> conf/pktgen.cfg | 11 +++++++++--
> framework/pktgen_trex.py | 26 +++++++++++++++++++++-----
> 2 files changed, 30 insertions(+), 7 deletions(-)
>
> --
> 1.9.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dts] [PATCH V2 0/2] [next]dts/pktgen: TREX core mask configuration
2019-08-06 6:03 [dts] [PATCH V2 0/2] [next]dts/pktgen: TREX core mask configuration yufengmx
` (2 preceding siblings ...)
2019-08-06 6:13 ` [dts] [PATCH V2 0/2] [next]dts/pktgen: TREX core mask configuration Chen, Zhaoyan
@ 2019-08-07 1:44 ` Tu, Lijuan
3 siblings, 0 replies; 7+ messages in thread
From: Tu, Lijuan @ 2019-08-07 1:44 UTC (permalink / raw)
To: Mo, YufengX, dts; +Cc: Mo, YufengX
Applied the series, thanks
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yufengmx
> Sent: Tuesday, August 6, 2019 2:03 PM
> To: dts@dpdk.org
> Cc: Mo, YufengX <yufengx.mo@intel.com>
> Subject: [dts] [PATCH V2 0/2] [next]dts/pktgen: TREX core mask configuration
>
> convert core mask setting to list format.
>
>
> v2:
> - Follow Chen, Zhaoyan review
> - *. remove synchronized option for future
> - *. add CORE_MASK_PIN option value
>
> yufengmx (2):
> [next]conf/pktgen: update option description
> [next]framework/pktgen_trex: convert core mask setting to list format
>
> conf/pktgen.cfg | 11 +++++++++--
> framework/pktgen_trex.py | 26 +++++++++++++++++++++-----
> 2 files changed, 30 insertions(+), 7 deletions(-)
>
> --
> 1.9.3
^ permalink raw reply [flat|nested] 7+ messages in thread