[V1,08/10] framework/project_dpdk: optimize code
Commit Message
Optimizing functions to prevent errors when testing with mev
Signed-off-by: Jin Ling <jin.ling@intel.com>
---
framework/project_dpdk.py | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
@@ -98,9 +98,14 @@ class DPDKdut(Dut):
"echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode",
"#",
)
- out = self.send_expect("ls /sys/module|grep vfio_pci", "#")
- assert "vfio_pci" in out, "load vfio_pci failed"
-
+ # out = self.send_expect("ls /sys/module|grep vfio_pci", "#")
+ # assert "vfio_pci" in out, "load vfio_pci failed"
+ if "mev" not in self.nic.name:
+ out = self.send_expect("ls /sys/module|grep vfio_pci", "#")
+ assert "vfio_pci" in out , "load vfio_pci failed"
+
+
+
elif drivername == "uio_pci_generic":
self.send_expect("modprobe uio", "#", 70)
self.send_expect("modprobe uio_pci_generic", "#", 70)
@@ -415,9 +420,13 @@ class DPDKdut(Dut):
current_nic = 0
for port_info in self.ports_info:
- if nics_to_bind is None or current_nic in nics_to_bind:
- binding_list += "%s " % (port_info["pci"])
- current_nic += 1
+ # if nics_to_bind is None or current_nic in nics_to_bind:
+ # binding_list += "%s " % (port_info["pci"])
+ if port_info["pci"] not in binding_list:
+ if nics_to_bind is None or current_nic in nics_to_bind:
+ binding_list += "%s " % (port_info["pci"])
+ current_nic += 1
+ # current_nic += 1
bind_script_path = self.get_dpdk_bind_script()
return self.send_expect(