Repository navigation
testing/mm: more iob test cases and GCC-only kasantest flags - #4136
Open
huojianchaoyy wants to merge 5 commits into
Open
huojianchaoyy wants to merge 5 commits into
huojianchaoyy wants to merge 5 commits into
Conversation
So far the test only copied data in and out of IOBs from a throttled and an unthrottled thread. Add test cases for the rest of the IOB API: allocation and free, copy in and out, queue operations, chains, clone, pack and contig, packet length update, queue concatenation, tailroom, and the chain-end flag that a queue keeps in the low bits of io_flink. Assisted-by: Kiro:claude-opus-5-5 Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Put the statement of the one-line if blocks that free the IOBs after a
failed allocation on its own line in braces ("Statement on same line as
'if'"), and name the function in the comment that codespell reads as a
misspelling of "copying".
Assisted-by: Kiro:claude-opus-5-5
Signed-off-by: huojianchao <huojianchao@xiaomi.com>
iob_add_queue() and iob_concat_queue() cannot fail: the queue links the IOBs through the low bits of io_flink and allocates nothing, and both return 0. Drop the checks of their return value, and free the queue on the error paths that return after it was filled. Assisted-by: Kiro:claude-opus-5-5 Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Enqueue a chain, extend it past one IOB via iob_copyin(), then enqueue another chain and verify neither is truncated. Assisted-by: Kiro:claude-opus-5-5 Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
-Wuse-after-free and -Wstringop-overflow exist only in GCC, so clang warns about the -Wno- forms. Apply them only for GCC toolchains; -Wno-unknown-warning-option is no fix either, as GCC rejects that flag. The other part of the original change, printing tv_sec as intmax_t, is upstream already as f9f59bd. Assisted-by: Kiro:claude-opus-5-5 Signed-off-by: hujun5 <hujun5@xiaomi.com>
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.
Note: Please adhere to Contributing Guidelines.
Summary
IOB test cases and a kasantest build fix from Xiaomi Vela.
io_flink.iob_add_queue()andiob_concat_queue()cannot fail (the queue allocates nothing, both return 0), so the test no longer checks their return value; the error paths free the queue they filled.iob_copyin()after it was enqueued, then another chain enqueued behind it; covers 69c67a58493.-Wno-use-after-freeand-Wno-stringop-overfloware passed only with a GCC toolchain, clang warns about these unknown-Wno-options. The other half of the original change, printingtv_secasintmax_t, is in master already (f9f59bd); the-fno-builtinof master stays.One follow-up commit, right after the commit it fixes: testing/mm/iob: fix the nxstyle and codespell errors, one-line
ifstatements and a comment that codespell reads as a misspelling.Impact
testing/mm/ioband the build flags oftesting/mm/kasantest.CONFIG_IOB_NBUFFERS>= 9. With fewer IOBs (sim:nshhas 8) that case fails to allocate its last chain and the test stops there.sim:citesthas 128.Testing
Host: Ubuntu 22.04 x86_64, GCC 13.4.0 (sim), CMake 3.23 + Ninja 1.10. Base: nuttx-apps master 9cd18a2, nuttx master f284e6d7a75.
./tools/checkpatch.sh -c -u -m -g HEAD~5..HEADpasses.Every commit builds without warnings (CMake, incremental) for
sim:nshwithMM_IOB,TESTING_IOB,IOB_NBUFFERS=64,MM_KASANandTESTING_KASAN; the head also builds with Make. kasantest.c is compiled with-fno-builtin -Wno-error -Wno-array-bounds -Wno-unused-value -Wno-unused-variable -Wno-free-nonheap-object -O0 -Wno-use-after-free -Wno-stringop-overflow, the flags of master.sim:nshas above,iob:With the 8 IOBs of
sim:nshthe run stops at Test 10 (ERROR: Failed to allocate first IOB in chain), see Impact.Not tested: a clang build (no clang toolchain on this host), real hardware.