summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nfvbench/traffic_server.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/nfvbench/traffic_server.py b/nfvbench/traffic_server.py
index c87f8c3..bc79204 100644
--- a/nfvbench/traffic_server.py
+++ b/nfvbench/traffic_server.py
@@ -85,6 +85,15 @@ class TRexTrafficServer(TrafficServer):
def __prepare_config(self, generator_config):
ifs = ",".join([repr(pci) for pci in generator_config.pcis])
+
+ # For consistency and stability reasons, the T-Rex server
+ # should be forciby restarted each time the value of a
+ # parameter, specified as one of the starting command line
+ # arguments, has been modified since the last launch.
+ # Hence we add some extra fields to the config file (nb_cores,
+ # use_vlan) which will serve as a memory between runs -
+ # while being actually ignored by the T-Rex server.
+
result = """# Config generated by NFVbench
- port_limit : 2
version : 2
@@ -92,11 +101,17 @@ class TRexTrafficServer(TrafficServer):
zmq_rpc_port : {zmq_rpc_port}
prefix : {prefix}
limit_memory : {limit_memory}
+ nb_cores : {nb_cores}
+ use_vlan : {use_vlan}
interfaces : [{ifs}]""".format(zmq_pub_port=generator_config.zmq_pub_port,
zmq_rpc_port=generator_config.zmq_rpc_port,
prefix=generator_config.name,
limit_memory=generator_config.limit_memory,
+ nb_cores=generator_config.cores,
+ use_vlan=generator_config.gen_config.get('vtep_vlan')
+ or generator_config.vlan_tagging,
ifs=ifs)
+
if hasattr(generator_config, 'mbuf_64') and generator_config.mbuf_64:
result += """
memory :
@@ -126,7 +141,7 @@ class TRexTrafficServer(TrafficServer):
result += core_result
except (KeyError, AttributeError):
pass
- return result
+ return result + "\n"
def __check_platform_config(self, generator_config):
return hasattr(generator_config.gen_config, 'platform') \