[V1,1/3] framework/dut: add an attribute nic in dut

Message ID 20201211070828.24244-2-haiyangx.zhao@intel.com (mailing list archive)
State Accepted
Headers
Series replace i40evf with iavf in framework |

Commit Message

Zhao, HaiyangX Dec. 11, 2020, 7:08 a.m. UTC
  get the instance of NetDevice from the port_info, 
 and save it in dut as attribute nic.

Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
 framework/dut.py | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/framework/dut.py b/framework/dut.py
index dcf833b4..388fec04 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -81,6 +81,7 @@  class Dut(Crb):
         self.apps_name_conf = {}
         self.apps_name = {}
         self.dpdk_version = ''
+        self.nic = None
 
     def filter_cores_from_crb_cfg(self):
         # get core list from crbs.cfg
@@ -405,6 +406,8 @@  class Dut(Crb):
         # print latest ports_info
         for port_info in self.ports_info:
             self.logger.info(port_info)
+            if self.nic is None:
+                self.nic = port_info['port']
         if self.ports_map is None or len(self.ports_map) == 0:
             self.logger.warning("ports_map should not be empty, please check all links")