Perftune ci cd#3323
Draft
vladzcloudius wants to merge 6 commits into
Draft
Conversation
…thtool -l' command for a given interface Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
This method returns rps_cpus file names - not prints them. And also added a missing coma. Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
…g for mlx5 devices Mellanox mlx5e devices had a rather counterintuitive feature in the kernel/driver versions 5.3-6.0 where they were allocating extra netdev Rx queues for XSK purposes effectively doubling the number of Rx queues. In particular, if one was setting the number of combined queues using `ethtool -L <iface> N` command, the driver would allocate Rx queues as follows: * RSS queues: 0..N-1 * XSK queues: N..2*N-1 This was breaking the perftune's assumption that the number of Rx queues under /sys/class/net/<iface>/queues/ matches the number of corresponding RSS IRQ lines. Luckily, this was fixed my mlx5 developers in kernels 6.1 and up however, we still need to support the affected kernels: kernel 5.15 is an LTS kernel of Ubuntu 22.04 for example. This patch adds a custom handling of the case in question by reverse-engineering the driver's logic. Fixes scylladb#3313 Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
6553018 to
a12ba92
Compare
99% code coverage, fully mocked. See tests/perftune/README.md for more details on how to execute the tests. Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
a12ba92 to
ec84557
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a comprehensive unit testing framework for
perftune.py, improves its testability, and adds a new GitHub Actions workflow for automated testing. The main changes include adding dataclass-based parsing forethtooloutput, improving the handling of network queue counts (especially for Mellanox devices), and restructuring the script to support direct import and testing. Additionally, the PR sets up the necessary dependencies and configuration for robust test coverage.Testing infrastructure and configuration:
.github/workflows/perftune-tests.yaml) to automatically run unit tests on changes toperftune.pyand its tests, ensuring continuous integration for performance tuning scripts.pyproject.tomlconfiguration for pytest and coverage, and added arequirements.txtfile specifying all required dependencies for running tests. [1] [2]README.mdinscripts/tests/perftune/with setup, usage instructions, and test layout documentation.Test suite and support:
conftest.pyto safely importperftune.pyas a module for testing, avoiding accidental script execution.ClocksourceManagerclass (test_clocksource.py), covering various scenarios and platform behaviors.Codebase improvements for testability and maintainability:
perftune.pyto use amain()function and guarded script entry withif __name__ == '__main__':, enabling import without side effects. [1] [2]ethtool -loutput, including newLabeledDataclass,EthtoolChannelPropertiesValues, andEthtoolLChannelInfoclasses, to make parsing more robust and testable. [1] [2]These changes collectively provide a solid foundation for reliable, automated testing of
perftune.pyand facilitate future maintenance and enhancements.