diff --git a/tsbin/mlnx-sf b/tsbin/mlnx-sf index 65af49d..d5a8f89 100755 --- a/tsbin/mlnx-sf +++ b/tsbin/mlnx-sf @@ -46,6 +46,8 @@ DEVLINK = 'devlink' SUPPORTED_ACTIONS=["create", "show", "delete"] RDMA_DEV_TIMEOUT = 120 DEVLINK_DEV_TIMEOUT = 20 +SF_CFG_DRIVER_TIMEOUT = 20 + verbose = False if os.path.exists("/usr/bin/mlxconfig"): @@ -211,6 +213,15 @@ class SF: break time.sleep(0.001) + # Wait for sf_cfg link to be created + start = time.process_time() + while True: + if time.process_time() - start > SF_CFG_DRIVER_TIMEOUT: + break + if os.path.basename(os.readlink("/sys/bus/auxiliary/devices/{}/driver".format(self.aux_dev))) == "mlx5_core.sf_cfg": + break + time.sleep(0.001) + # Unbind the SF from the default config driver and bind the actual SF driver if os.path.basename(os.readlink("/sys/bus/auxiliary/devices/{}/driver".format(self.aux_dev))) == "mlx5_core.sf_cfg": try: