[V1] framework/dut: fix getting nic info failed in FreeBSD

Message ID 20210401073833.26279-1-haiyangx.zhao@intel.com (mailing list archive)
State Accepted
Headers
Series [V1] framework/dut: fix getting nic info failed in FreeBSD |

Commit Message

Zhao, HaiyangX April 1, 2021, 7:38 a.m. UTC
  Getting pci_id will be failed in FreeBSD and it causes get nic name 
and default_driver failed, and will cause many cases failed, fix it 
by assign the pci_id and reget the nic and driver name.

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

Comments

Zhao, HaiyangX April 1, 2021, 7:51 a.m. UTC | #1
> -----Original Message-----
> From: Zhao, HaiyangX <haiyangx.zhao@intel.com>
> Sent: Thursday, April 1, 2021 15:39
> To: dts@dpdk.org
> Cc: Zhao, HaiyangX <haiyangx.zhao@intel.com>
> Subject: [dts][PATCH V1] framework/dut: fix getting nic info failed in
> FreeBSD

Tested-by:  Haiyang Zhao <haiyangx.zhao@intel.com>
  
Tu, Lijuan April 7, 2021, 2:12 a.m. UTC | #2
> Getting pci_id will be failed in FreeBSD and it causes get nic name and
> default_driver failed, and will cause many cases failed, fix it by assign the pci_id
> and reget the nic and driver name.
> 
> Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>

Applied
  

Patch

diff --git a/framework/dut.py b/framework/dut.py
index 6216166d..ca1c9089 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -1061,6 +1061,9 @@  class Dut(Crb):
             bus_id = addr_array[1]
             devfun_id = addr_array[2]
             port = GetNicObj(self, domain_id, bus_id, devfun_id)
+            port.pci_id= pci_id
+            port.name = settings.get_nic_name(pci_id)
+            port.default_driver = settings.get_nic_driver(pci_id)
             intf = port.get_interface_name()
 
             macaddr = port.get_mac_addr()