[v2,4/5] framework/dut: add longer timeout for loading driver and firmware

Message ID 20230209152717.4057220-5-niklas.soderlund@corigine.com (mailing list archive)
State Accepted
Headers
Series Add initial support for NFP PMD |

Commit Message

Niklas Söderlund Feb. 9, 2023, 3:27 p.m. UTC
  From: Qin Ke <qin.ke@corigine.com>

Nfp NIC may take a long time whiling loading its driver and firmware
at probe time. Add longer timeout to ensure that these operations can
excutes successfully and stably for all NIC.

Signed-off-by: Qin Ke <qin.ke@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 framework/dut.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Patch

diff --git a/framework/dut.py b/framework/dut.py
index 64de28a5fdd8..31c04e4a8044 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -424,9 +424,11 @@  class Dut(Crb):
                 )
                 # bind to linux kernel driver
                 if not self.is_container:
-                    self.send_expect("modprobe %s" % driver, "# ")
+                    self.send_expect("modprobe %s" % driver, "# ", timeout=30)
                 self.send_expect(
-                    "echo %s > /sys/bus/pci/drivers/%s/bind" % (pci_bus, driver), "# "
+                    "echo %s > /sys/bus/pci/drivers/%s/bind" % (pci_bus, driver),
+                    "# ",
+                    timeout=30,
                 )
                 pull_retries = 5
                 itf = "N/A"