Regression: fix configure_basic_filtered_interfaces with vlans 59/5359/1
authorYaroslav Brustinov <[email protected]>
Sat, 14 Jan 2017 07:04:43 +0000 (09:04 +0200)
committerYaroslav Brustinov <[email protected]>
Sat, 14 Jan 2017 07:04:43 +0000 (09:04 +0200)
Regression: speedup load of clean config
dpdk_nic_bind: printing table with interfaces: take info from Linux and not TRex in case of Mellanox
Doc performance: fix time format

Change-Id: I3b022a2406efb058851033acfffc00766d13a1f1
Signed-off-by: Yaroslav Brustinov <[email protected]>
doc/TRexDataAnalysisV2.py
scripts/automation/regression/CPlatform.py
scripts/dpdk_nic_bind.py

index f154efb..e57b701 100755 (executable)
@@ -128,13 +128,19 @@ class Setup:
         self.all_tests_data_table = reduce(lambda x, y: pd.merge(x, y, how='outer'), all_tests_trend_data)\r
 \r
     def plot_trend_graph_all_tests(self, save_path='', file_name='_trend_graph.png'):\r
-        time_format = '%d-%m-%Y-%H:%M'\r
+        time_format1 = '%d-%m-%Y-%H:%M'\r
+        time_format2 = '%Y-%m-%d-%H:%M'\r
         for test in self.tests:\r
             test_data = test.results_df[test.results_df.columns[2]].tolist()\r
             test_time_stamps = test.results_df[test.results_df.columns[3]].tolist()\r
             test_time_stamps.append(self.end_date+'-23:59')\r
             test_data.append(test_data[-1])\r
-            float_test_time_stamps = [matdates.date2num(datetime.strptime(x, time_format)) for x in test_time_stamps]\r
+            float_test_time_stamps = []\r
+            for ts in test_time_stamps:\r
+                try:\r
+                   float_test_time_stamps.append(matdates.date2num(datetime.strptime(ts, time_format1)))\r
+                except:\r
+                   float_test_time_stamps.append(matdates.date2num(datetime.strptime(ts, time_format2)))\r
             plt.plot_date(x=float_test_time_stamps, y=test_data, label=test.name, fmt='-', xdate=True)\r
             plt.legend(fontsize='small', loc='best')\r
         plt.ylabel('MPPS/Core (Norm)')\r
index 79712e7..262dba2 100755 (executable)
@@ -75,19 +75,26 @@ class CPlatform(object):
         self.cmd_link.run_single_command(cache)
         self.config_history['basic_if_config'] = True
 
-    def configure_basic_filtered_interfaces(self, intf_list, mtu = 9050):
+    def configure_basic_filtered_interfaces(self, intf_list, mtu = 9050, vlan = False):
 
         cache = CCommandCache()
         for intf in intf_list:
             if_command_set   = []
+            if_command_set_vlan = []
 
             if_command_set.append ('mac-address {mac}'.format( mac = intf.get_src_mac_addr()) )
             if_command_set.append ('mtu %s' % mtu)
+            ip_commands = ['ip address {ip} 255.255.255.0'.format( ip = intf.get_ipv4_addr() ),
+                           'ipv6 address {ip}/64'.format( ip = intf.get_ipv6_addr() )]
             if vlan:
-                if_command_set.append ('ip address {ip} 255.255.255.0'.format( ip = intf.get_ipv4_addr() ))
-                if_command_set.append ('ipv6 address {ip}/64'.format( ip = intf.get_ipv6_addr() ))
+                if_command_set_vlan.extend(ip_commands)
+            else:
+                if_command_set.extend(ip_commands)
 
             cache.add('IF', if_command_set, intf.get_name())
+            if vlan:
+                if_name = intf.get_name() + '.' + (self.client_vlan if intf.is_client() else self.server_vlan)
+                cache.add('IF', if_command_set_vlan, if_name)
 
         self.cmd_link.run_single_command(cache)
 
@@ -104,6 +111,7 @@ class CPlatform(object):
                 if i < 4:
                     continue
                 raise Exception('Could not load clean config, response: %s' % res)
+            break
 
     def config_pbr (self, mode = 'config', vlan = False):
         idx = 1
@@ -223,7 +231,7 @@ class CPlatform(object):
         if self.config_history['basic_if_config']:
             # in this case, duplicated interfaces will lose its ip address.
             # re-config IPv4 addresses
-            self.configure_basic_filtered_interfaces(self.if_mngr.get_duplicated_if() )
+            self.configure_basic_filtered_interfaces(self.if_mngr.get_duplicated_if(), vlan = vlan)
 
     def config_no_pbr (self, vlan = False):
         self.config_pbr(mode = 'unconfig', vlan = vlan)
@@ -346,7 +354,7 @@ class CPlatform(object):
         if self.config_history['basic_if_config']:
             # in this case, duplicated interfaces will lose its ip address.
             # re-config IPv4 addresses
-            self.configure_basic_filtered_interfaces(self.if_mngr.get_duplicated_if() )
+            self.configure_basic_filtered_interfaces(self.if_mngr.get_duplicated_if(), vlan = vlan)
 
 
     def config_no_static_routing (self, stat_route_obj = None):
index 6dec60c..44d618b 100755 (executable)
@@ -625,7 +625,7 @@ def show_table(get_macs = True):
         get_nic_details()
     dpdk_drv = []
     for d in devices.keys():
-        if devices[d].get("Driver_str") in (dpdk_drivers+dpdk_and_kernel):
+        if devices[d].get("Driver_str") in dpdk_drivers:
             dpdk_drv.append(d)
 
     if get_macs: