NFVBENCH-190: Add a 'i40e_mixed' option, trex accepts other i40e driven ports to...
[nfvbench.git] / nfvbench / nfvbench.py
index 7acb783..598247a 100644 (file)
@@ -246,8 +246,7 @@ class NFVBench(object):
             config.cache_size = config.flow_count
 
         # The size must be capped to 10000 (where does this limit come from?)
-        if config.cache_size > 10000:
-            config.cache_size = 10000
+        config.cache_size = min(config.cache_size, 10000)
 
         config.duration_sec = float(config.duration_sec)
         config.interval_sec = float(config.interval_sec)
@@ -531,6 +530,13 @@ def _parse_opts_from_cli():
                              'tagged with given VLAN id(s) or not (given \'no-tag\') '
                              '\'true\': use current vlans; \'false\': disable this mode.')
 
+    parser.add_argument('--i40e-mixed', dest='i40e_mixed',
+                        action='store',
+                        default=None,
+                        metavar='<ignore,check,unbind>',
+                        help='TRex behavior when dealing with a i40e network card driver'
+                             ' [ https://trex-tgn.cisco.com/youtrack/issue/trex-528 ]')
+
     parser.add_argument('--user-info', dest='user_info',
                         action='append',
                         metavar='<data>',
@@ -876,6 +882,8 @@ def main():
                                 config.service_chain_count = len(vlans[0])
             opts.l2_loopback = None
 
+        if config.i40e_mixed is None:
+            config.i40e_mixed = 'ignore'
         if config.use_sriov_middle_net is None:
             config.use_sriov_middle_net = False
         if opts.use_sriov_middle_net is not None: