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

tests: Fix off-by-32 bits in LPM tree #29

Merged
merged 1 commit into from
May 1, 2024

Conversation

javierhonduco
Copy link
Owner

The integration tests started failing starting with kernel 6.8, and after some checks, it pointed to this commit
torvalds/linux@9b75dbe.

The tests fail now because the prefix length we pass is 32 bits higher (see initialiser) than the maximum prefix length. After this commit was introduced, any prefix length that's higher than the key size will return NULL earlier, rather than returning the value with the longest match, even if it's beyond the size the key can encode.

Test Plan

Ran the tests and some profiles on a box running 6.8.7-200 (Fedora) without issues.

Also added an assertion to ensure that the prefix_len is not bigger than the LPM trie key size.

@javierhonduco javierhonduco force-pushed the fix-off-by-32-in-lpm-tree branch from 84b8266 to 712d64f Compare May 1, 2024 14:51
The integration tests started failing starting with kernel 6.8, and
after some checks, it pointed to this commit
torvalds/linux@9b75dbe.

The tests fail now because the prefix length we pass is 32 bits higher
(see initialiser) than the maximum prefix length. After this commit was
introduced, any prefix length that's higher than the key size will
return NULL earlier, rather than returning the value with the longest
match, even if it's beyond the size the key can encode.

Test Plan
=========

Ran the tests and some profiles on a box running 6.8.7-200 (Fedora) without issues.

Also added an assertion to ensure that the prefix_len is not bigger than the LPM trie
key size.
@javierhonduco javierhonduco force-pushed the fix-off-by-32-in-lpm-tree branch from 712d64f to 2eec399 Compare May 1, 2024 14:52
@javierhonduco javierhonduco merged commit 2da1790 into main May 1, 2024
6 checks passed
@javierhonduco javierhonduco deleted the fix-off-by-32-in-lpm-tree branch May 1, 2024 15:00
@javierhonduco
Copy link
Owner Author

Many thanks to @florianl for noting that this was not a kernel regression, but a bug on my code!

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.

1 participant