[dts] [PATCH V1] framework/pktgen_trex: set core_mask length same with ports list length

lihong lihongx.ma at intel.com
Mon Jan 6 02:12:46 CET 2020


Signed-off-by: lihong <lihongx.ma at intel.com>
---
 framework/pktgen_trex.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/framework/pktgen_trex.py b/framework/pktgen_trex.py
index 2ff5894..705d8f5 100644
--- a/framework/pktgen_trex.py
+++ b/framework/pktgen_trex.py
@@ -793,11 +793,13 @@ class TrexPacketGenerator(PacketGenerator):
         try:
             # clear the stats before injecting
             self._conn.clear_stats()
+            # 'core_mask' list must be the same length as 'ports' list
+            core_mask = self.core_mask[:len(self._traffic_ports)]
             # Start traffic on port(s)
             run_opt = {
                 'ports':    self._traffic_ports,
                 'mult':     rate_percent,
-                'core_mask': self.core_mask,
+                'core_mask': core_mask,
                 'force':    True,}
             self.logger.info("begin traffic ......")
             self.logger.debug(run_opt)
-- 
2.7.4



More information about the dts mailing list