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

dpcreconciler: set MAC and interface rename while interface is DOWN #4193

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

rouming
Copy link
Contributor

@rouming rouming commented Aug 31, 2024

On attempt to set MAC address or rename interface which is UP host returns Device or resource busy. Patch fixes the error by changing the order: first set MAC and rename interface, then bring interface UP.

Patch fixes inability to use host interface, the problem was reproduced on RPI4 board. Presumably any device should be affected.

Fixes: 7a6981b ("Add support for switch network instance with multiple ports")

PS. This PR is not tested. Need some comments from Milan, will do testing next week.

@rouming rouming requested a review from milan-zededa as a code owner August 31, 2024 09:16
@github-actions github-actions bot requested a review from eriknordmark August 31, 2024 09:16
@rouming rouming added the bug Something isn't working label Aug 31, 2024
Copy link

codecov bot commented Aug 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 19.69%. Comparing base (695652b) to head (8e93369).
Report is 50 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4193   +/-   ##
=======================================
  Coverage   19.69%   19.69%           
=======================================
  Files           8        8           
  Lines        2600     2600           
=======================================
  Hits          512      512           
  Misses       1985     1985           
  Partials      103      103           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@OhmSpectator
Copy link
Member

Did we see these errors in the test logs in the last few days? Or how have you noticed it?

Copy link
Contributor

@milan-zededa milan-zededa left a comment

Choose a reason for hiding this comment

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

Thanks for finding this, added some comments.

// Make sure that the interface is UP right after MAC address assignment
// and interface rename. In case of incorrect order operation fails
// with `Device or resource busy`.
if err := netlink.LinkSetUp(link); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to put this at the end (after LinkSetUp(bridge)) and with kernLink as the argument. In the past I saw LinkSetMaster changing the interface status to DOWN.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@rouming rouming force-pushed the mac-addr-while-eth-down branch from 8e93369 to 5d0f018 Compare September 2, 2024 08:03
…le interface is DOWN

On attempt to set MAC address or rename interface which is UP
host returns `Device or resource busy`. Patch fixes the error
by changing the order: first set MAC and rename interface,
then bring interface UP.

Patch fixes inability to use host interface, the problem was
reproduced on RPI4 board. Presumably any device should be
affected.

Signed-off-by: Roman Penyaev <[email protected]>
Fixes: 7a6981b ("Add support for switch network instance with multiple ports")
@rouming rouming force-pushed the mac-addr-while-eth-down branch from 5d0f018 to 52fdb5d Compare September 2, 2024 08:20
Copy link
Contributor

@milan-zededa milan-zededa left a comment

Choose a reason for hiding this comment

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

Starting eden tests. Let us know when you complete testing with the physical device.

@milan-zededa
Copy link
Contributor

@eriknordmark Please do not make EVE release until we merge this.

@rouming
Copy link
Contributor Author

rouming commented Sep 2, 2024

Have just updated the "Radiatore" board (in Berlin-Lab), all good, keth0 appeared.
cc: @rene

@milan-zededa milan-zededa merged commit 6ffa07f into lf-edge:master Sep 2, 2024
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants