summaryrefslogtreecommitdiffstats
path: root/nfvbench
diff options
context:
space:
mode:
authorYichen Wang <yicwang@cisco.com>2017-12-13 15:01:34 -0800
committerYichen Wang <yicwang@cisco.com>2018-01-02 11:19:28 -0800
commitb481ad4a6c6b98cac760b12e4190f9540869e673 (patch)
treecb772d754ba27d244dadd3c086293784c8acc286 /nfvbench
parentefc678c9d3843dcfd373b5749a88c51228b0b27c (diff)
Multiple bugfixes for NFVbench
[NFVBENCH-52] NFVbench should ignore the port security settings if not available [NFVBENCH-53] NFVbench should support to use software mode for TRex [NFVBENCH-54] NFVbench container should also map kernel sources when available to build KOs [NFVBENCH-55] Documentation enhancements to have better examples for using "$PWD" [NFVBENCH-57] NFVbench should support to build kernel modules on redhat distros Change-Id: Id6792d6711393b07ca59396c276a026bec9f1e86 Signed-off-by: Yichen Wang <yicwang@cisco.com>
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...')