NFVBENCH-136 Add support for multiqueue for PVP/PVVP chains
[nfvbench.git] / nfvbench / nfvbench.py
index bb73d68..b2163ba 100644 (file)
@@ -203,6 +203,9 @@ class NFVBench(object):
 
         if config.openrc_file:
             config.openrc_file = os.path.expanduser(config.openrc_file)
+            if config.flavor.vcpus < 2:
+                raise Exception("Flavor vcpus must be >= 2")
+
 
         config.ndr_run = (not config.no_traffic and
                           'ndr' in config.rate.strip().lower().split('_'))
@@ -224,6 +227,11 @@ class NFVBench(object):
                 raise Exception('Please provide existing path for storing results in JSON file. '
                                 'Path used: {path}'.format(path=config.std_json_path))
 
+        # Check that multiqueue is between 1 and 8 (8 is the max allowed by libvirt/qemu)
+        if config.vif_multiqueue_size < 1 or config.vif_multiqueue_size > 8:
+            raise Exception('vif_multiqueue_size (%d) must be in [1..8]' %
+                            config.vif_multiqueue_size)
+
         # VxLAN sanity checks
         if config.vxlan:
             if config.vlan_tagging:
@@ -354,6 +362,11 @@ def _parse_opts_from_cli():
                         action='store_true',
                         help='Cleanup NFVbench resources (do not prompt)')
 
+    parser.add_argument('--restart', dest='restart',
+                        default=None,
+                        action='store_true',
+                        help='Restart TRex server')
+
     parser.add_argument('--json', dest='json',
                         action='store',
                         help='store results in json format file',
@@ -552,7 +565,8 @@ def main():
             config.compute_nodes = opts.hypervisor
         if opts.vxlan:
             config.vxlan = True
-
+        if opts.restart:
+            config.restart = True
         # port to port loopback (direct or through switch)
         if opts.l2_loopback:
             config.l2_loopback = True