[dts] [PATCH 2/6] framework:dut : excluding mellanox NICs from beeing binded
Raslan Darawsheh
rasland at mellanox.com
Tue Oct 27 07:07:51 CET 2015
From: Raslsn Darawsheh <rdarawsheh at asaltech.com>
Signed-off-by: Raslsn Darawsheh <rdarawsheh at asaltech.com>
---
framework/dut.py | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/framework/dut.py b/framework/dut.py
index 70bd146..5776270 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -224,7 +224,7 @@ class Dut(Crb):
pci_id = port['type']
# get device driver
driver = settings.get_nic_driver(pci_id)
- if driver is not None:
+ if driver is not None and self.isMellanox == False:
# unbind device driver
addr_array = pci_bus.split(':')
bus_id = addr_array[0]
@@ -241,7 +241,10 @@ class Dut(Crb):
itf = port.get_interface_name()
self.send_expect("ifconfig %s up" % itf, "# ")
else:
- self.logger.info("NOT FOUND DRIVER FOR PORT (%s|%s)!!!" % (pci_bus, pci_id))
+ if self.isMellanox:
+ self.logger.info("Mellanox Driver Doesn't support unbinding")
+ else:
+ self.logger.info("NOT FOUND DRIVER FOR PORT (%s|%s)!!!" % (pci_bus, pci_id))
def setup_memory(self, hugepages=-1):
"""
@@ -334,7 +337,10 @@ class Dut(Crb):
self.logger.info("Not nic need bind driver: %s" % driver)
return
- self.send_expect('tools/dpdk_nic_bind.py %s' % binding_list, '# ')
+ if self.isMellanox:
+ pass
+ else:
+ self.send_expect('tools/dpdk_nic_bind.py %s' % binding_list, '# ')
def unbind_interfaces_linux(self, nics_to_bind=None):
"""
@@ -358,7 +364,10 @@ class Dut(Crb):
self.logger.info("Not nic need unbind driver")
return
- self.send_expect('tools/dpdk_nic_bind.py %s' % binding_list, '# ', 30)
+ if self.isMellanox:
+ pass
+ else:
+ self.send_expect('tools/dpdk_nic_bind.py %s' % binding_list, '# ', 30)
def get_ports(self, nic_type='any', perf=None, socket=None):
"""
@@ -658,6 +667,9 @@ class Dut(Crb):
port = NetDevice(self, bus_id, devfun_id)
numa = port.socket
# store the port info to port mapping
+ self.check_Mellanox_pci(pci_bus,pci_id)
+ if self.isMellanox and self.mellanoxCardType == "cx3":
+ self.ports_info.append({'port': port,'pci': pci_bus, 'type': pci_id, 'numa': numa})
self.ports_info.append(
{'port': port, 'pci': pci_bus, 'type': pci_id, 'numa': numa})
@@ -780,6 +792,8 @@ class Dut(Crb):
if key in port_cfg:
if key in port and port_cfg[key].lower() != port[key].lower():
self.logger.warning("CONFIGURED %s NOT SAME AS SCANNED!!!" % (key.upper()))
+ if self.isMellanox :
+ continue
port[key] = port_cfg[key].lower()
def map_available_ports(self):
--
1.8.3.1
More information about the dts
mailing list