Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsbin/mlnx-sf: Wait for SF config driver to load #94

Open
wants to merge 1 commit into
base: mlnx_ofed
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tsbin/mlnx-sf
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to issue some error here and maybe exit?

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:
Expand Down