aboutsummaryrefslogtreecommitdiffstats
path: root/nfvbench
diff options
context:
space:
mode:
Diffstat (limited to 'nfvbench')
-rw-r--r--nfvbench/cfg.default.yaml5
-rw-r--r--nfvbench/chain_clients.py19
-rw-r--r--nfvbench/traffic_server.py5
3 files changed, 20 insertions, 9 deletions
diff --git a/nfvbench/cfg.default.yaml b/nfvbench/cfg.default.yaml
index a8bdc2b..bc8921d 100644
--- a/nfvbench/cfg.default.yaml
+++ b/nfvbench/cfg.default.yaml
@@ -167,6 +167,10 @@ traffic_generator:
# `tool`: Traffic generator tool to be used (currently supported is `TRex`).
# `ip`: IP address of the traffic generator.
# `cores`: Specify the number of cores for TRex traffic generator. ONLY applies to trex-local.
+ # `software_mode`: Advice TRex to use software mode which provides the best compability. But
+ # note that TRex will not use any hardware acceleration technology under
+ # software mode, therefore the performance of TRex will be significantly
+ # lower. ONLY applies to trex-local.
# `interfaces`: Configuration of traffic generator interfaces.
# `interfaces.port`: The port of the traffic generator to be used (leave as 0 and 1 resp.)
# `interfaces.switch_port`: Leave empty (reserved for advanced use cases)
@@ -178,6 +182,7 @@ traffic_generator:
tool: TRex
ip: 127.0.0.1
cores: 3
+ software_mode: false
interfaces:
- port: 0
switch_port:
diff --git a/nfvbench/chain_clients.py b/nfvbench/chain_clients.py
index fa21359..7106129 100644
--- a/nfvbench/chain_clients.py
+++ b/nfvbench/chain_clients.py
@@ -346,13 +346,18 @@ class BasicStageClient(object):
for net in self.nets:
for port in self.ports[net['id']]:
if port['device_id'] in vm_ids:
- self.neutron.update_port(port['id'], {
- 'port': {
- 'security_groups': [],
- 'port_security_enabled': False,
- }
- })
- LOG.info('Security disabled on port %s', port['id'])
+ try:
+ self.neutron.update_port(port['id'], {
+ 'port': {
+ 'security_groups': [],
+ 'port_security_enabled': False,
+ }
+ })
+ LOG.info('Security disabled on port %s', port['id'])
+ except Exception:
+ LOG.warning('Failed to disable port security on port %s, ignoring...',
+ port['id'])
+
def get_loop_vm_hostnames(self):
return [getattr(vm, 'OS-EXT-SRV-ATTR:hypervisor_hostname') for vm in self.vms]
diff --git a/nfvbench/traffic_server.py b/nfvbench/traffic_server.py
index b35e78b..fe9edd2 100644
--- a/nfvbench/traffic_server.py
+++ b/nfvbench/traffic_server.py
@@ -43,9 +43,10 @@ class TRexTrafficServer(TrafficServer):
"""
cfg = self.__save_config(traffic_profile, filename)
cores = traffic_profile.cores
+ sw_mode = "--software" if traffic_profile.software_mode else ""
subprocess.Popen(['nohup', '/bin/bash', '-c',
- './t-rex-64 -i -c {} --iom 0 --no-scapy-server --close-at-end --vlan'
- ' --cfg {} &> /tmp/trex.log & disown'.format(cores, cfg)],
+ './t-rex-64 -i -c {} --iom 0 --no-scapy-server --close-at-end {} '
+ '--vlan --cfg {} &> /tmp/trex.log & disown'.format(cores, sw_mode, cfg)],
cwd=self.trex_dir)
LOG.info('TRex server is running...')