Skip to content

Add check and delay after unbinding ports from old driver #188

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

Merged
merged 2 commits into from
Jul 17, 2025

Conversation

yue-fred-gao
Copy link
Contributor

why

Occasionally in azure pretest, we saw below errors from vpp_ports_setup.sh,
2025-07-01T07:42:08.524762+00:00 sonic vpp_ports_setup.sh[1678]: Un-binding port 0000:04:00.0(0000:04:00.0) from driver virtio-pci
2025-07-01T07:42:08.596306+00:00 sonic vpp_ports_setup.sh[1678]: Binding port 0000:04:00.0(0000:04:00.0) to driver uio_pci_generic
2025-07-01T07:42:08.610076+00:00 sonic vpp_ports_setup.sh[1678]: /usr/bin/vpp_ports_setup.sh: line 52: echo: write error: Device or resource busy

I suspect this is due to unbind has not completed yet when bind is called.

what this PR does

Add check to make sure unbind is successful before executing bind.

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -45,6 +45,17 @@ function bind_ports_to_uio()
if [ "$CUR_DRIVER" != "" ] && [ "$CUR_DRIVER" != "$UIO_DRV" ]; then
echo "Un-binding port $port($PCI_ID) from driver $CUR_DRIVER"
echo "$PCI_ID" > /sys/bus/pci/drivers/$CUR_DRIVER/unbind

# Wait until the device is unbound
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix indentation

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yue-fred-gao yue-fred-gao merged commit 43bd63d into sonic-net:main Jul 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants