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

iputil: pack and unpack using native byte ordering #406

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

ogayot
Copy link
Contributor

@ogayot ogayot commented Nov 28, 2023

On big-endian architectures (such as s390x), tests defined in test-iputil.py would hang:

 596s test_get_interface (test-iputil.Test.test_get_interface)
   10600s Check that get_interface() returns the right info ...

https://autopkgtest.ubuntu.com/results/autopkgtest-noble/noble/s390x/n/nvme-stas/20231128_021002_94626@/log.gz

Indeed, running the following hangs as well:

from staslib import iputil

iputil.net_if_addrs()

This is an endianness issue that can be fixed by using native byte-ordering when packing and unpacking netlink data structures such as ifaddrmsg.

On big-endian architectures (such as s390x), tests defined in
test-iputil.py would hang:

 > 596s test_get_interface (test-iputil.Test.test_get_interface)
 >   10600s Check that get_interface() returns the right info ...

Indeed, running the following hangs as well:

 > from staslib import iputil
 >
 > iputil.net_if_addrs()

This is an endianness issue that can be fixed by using native
byte-ordering when packing and unpacking netlink data structures such as
ifaddrmsg.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
@martin-belanger martin-belanger merged commit 34a298c into linux-nvme:main Nov 28, 2023
9 checks passed
@martin-belanger
Copy link
Collaborator

Good catch. Thanks for the fix.

@martin-belanger
Copy link
Collaborator

@ogayot - Salut Olivier. What you found is a critical bug for big-endian systems and a new version of nvme-stas (2.3.1) is required. It looks like you're in the middle of testing nvme-stas. So, maybe I should wait until you've completed your testing before I cut a new release (just in case you find more bugs). Please let me know once you're done and I will release version 2.3.1. Thanks!

@ogayot
Copy link
Contributor Author

ogayot commented Nov 28, 2023

Bonjour @martin-belanger. Thanks for the feedback! I think I won't be doing more testing for now. nvme-stas should be ready to migrate in Ubuntu (and in Debian hopefully) with the various patches applied.

There is one more issue that I have encountered (on some esoteric setups) with the udev test-cases. I am going to file another issue. I am not sure it is a valid use-case or if it is critical enough to fix for 2.3.1.

Thanks,
Olivier

@ogayot ogayot deleted the iputil-big-endian branch November 28, 2023 14:51
@martin-belanger
Copy link
Collaborator

@ogayot - Please note that version 2.3.1 has been released.

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.

None yet

2 participants