Skip to content

nvme/080: Test nvmet configurable tbkas - #272

Closed
Mr-Bossman wants to merge 1 commit into
linux-blktests:masterfrom
Mr-Bossman:dev/jesse/tbkas
Closed

Mr-Bossman wants to merge 1 commit into
linux-blktests:masterfrom
Mr-Bossman:dev/jesse/tbkas

Conversation

@Mr-Bossman

Copy link
Copy Markdown
Contributor

Test nvmet configurable traffic based keep-alive (tbkas). Uses dynamic debug to monitor the keep-alive messages produced by the traffic based keep-alive or admin keep-alive messages. Checks that the messages are made by the correct controller and that the messages are not sent by another nvmet device.

Comment thread tests/nvme/072 Resolved
@Mr-Bossman

Copy link
Copy Markdown
Contributor Author

@igaw bump

@Mr-Bossman Mr-Bossman changed the title nvme/072: Test nvmet configurable tbkas nvme/075: Test nvmet configurable tbkas Oct 29, 2026
Comment thread tests/nvme/075 Resolved
Comment thread tests/nvme/075 Resolved
@Mr-Bossman
Mr-Bossman force-pushed the dev/jesse/tbkas branch 2 times, most recently from 752868d to b9ac353 Compare October 30, 2026 16:08
@Mr-Bossman
Mr-Bossman requested a review from igaw October 30, 2026 16:11
@igaw

igaw commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Looks good to me! Thanks!

Reviewed-by: Daniel Wagner dwagner@suse.de

@kawasaki kawasaki left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Mr-Bossman Thanks for this PR. When I ran this new test case in my environment with the kernel at Linux master branch tip (git hash e98e45e9465b), it failed. Is this failure expected?

nvme/076 (tr=loop) (Test nvmet configurable traffic based keep-alive (tbkas)) [failed]
    runtime    ...  15.138s
    --- tests/nvme/076.out      2026-11-01 15:30:32.963606124 +0900
    +++ /home/shin/Blktests/blktests/results/nodev_tr_loop/nvme/076.out.bad     2026-11-01 15:43:40.574338336 +0900
    @@ -1,4 +1,4 @@
     Running nvme/076
     TBKAS message found in dmesg: pass
    -Admin keep-alive message found in dmesg: pass
    +Failed to find ctrl number
     Test complete

I assume that this test case depends on the kernel commit e98e45e9465b ("nvmet: Add traffic based keep alive support to configfs"). I suggest to mention it in the commit message and the test case head comment block.

Thank you for bumping up the test case numbers (The old test case nvme/075 is still left in the commit message, though). Test case numbers conflict often, so contributors do not need to bump up the test case number alwayas I can bump up the test case number when I apply the new test case. Said that, if you do that, it reduces my chore. So I still appreciate it.

Comment thread tests/nvme/076 Resolved
Comment thread tests/nvme/076 Resolved
Comment thread tests/nvme/076 Resolved
Comment thread tests/nvme/076 Resolved
Comment thread tests/nvme/076 Resolved
@Mr-Bossman

Copy link
Copy Markdown
Contributor Author

I think this is the same issue I had last time with the reconnect time being faster on my test machine than yours. Basically its expecting a ctrl in the nvmet debugfs but didn't find one. I'll keep note if this issue so it doesn't have again.

@Mr-Bossman Mr-Bossman changed the title nvme/075: Test nvmet configurable tbkas nvme/076: Test nvmet configurable tbkas Nov 2, 2026
@Mr-Bossman
Mr-Bossman requested a review from kawasaki November 2, 2026 18:15
@kawasaki

Copy link
Copy Markdown
Collaborator

Hi @Mr-Bossman thank you for updating the patch. I ran the modified test case on the kernel v7.4-fc3, and still observe the failure.

The retry logic in get_ctrl_timeout() doesn't look working as expected. With the patch below, the test case passes for rdma, tcp and fc transports.

diff --git a/tests/nvme/080 b/tests/nvme/080
index 51e9a39..cda140d 100755
--- a/tests/nvme/080
+++ b/tests/nvme/080
@@ -63,10 +63,14 @@ get_ctrl_num() {
 get_ctrl_num_timeout() {
        local -i TIMEOUT="${1:-$def_check_timeout}"
        local -i time_passed=0
+       local num

        for (( time_passed=0; time_passed < TIMEOUT; time_passed++ )); do
-               get_ctrl_num
-               [ -n "${ctrl_num}" ] && return
+               num=$(get_ctrl_num)
+               if [[ -n "${num}" ]]; then
+                       echo "${num}"
+                       return
+               fi
                sleep 1
        done
 }

However, still the test case fails with the loop transport:

nvme/080 (tr=loop) (Test nvmet configurable traffic based keep-alive (tbkas)) [failed]
    runtime  32.508s  ...  32.515s
    --- tests/nvme/080.out	2026-11-16 13:53:34.351000000 +0900
    +++ /home/shin/Blktests/blktests/results/nodev_tr_loop/nvme/080.out.bad	2026-11-16 15:37:13.750000000 +0900
    @@ -1,4 +1,4 @@
     Running nvme/080
     TBKAS message found in dmesg: pass
    -Admin keep-alive message found in dmesg: pass
    +Failed to find ctrl number
     Test complete

With some debug prints, it looks like the controller is deleted when a value is written to attr_tbkas, then no controller comes back. It this expected for loop transport? If so, the test case doesn't work and the test case should "_require_nvme_trtype tcp rdma fc" instead of "_require_nvme_trtype_is_fabrics".

@Mr-Bossman

Copy link
Copy Markdown
Contributor Author

With some debug prints, it looks like the controller is deleted when a value is written to attr_tbkas, then no controller comes back. It this expected for loop transport? If so, the test case doesn't work and the test case should "_require_nvme_trtype tcp rdma fc" instead of "_require_nvme_trtype_is_fabrics".

It won't work for loop I'm not sure why/how I missed that bc I remember adding "_require_nvme_trtype tcp rdma fc" but i guess I never committed it. Thanks for the check though. I will fix that.

Test nvmet configurable traffic based keep-alive (tbkas).
Uses dynamic debug to monitor the keep-alive messages produced by
the traffic based keep-alive or admin keep-alive messages.
Checks that the messages are made by the correct controller
and that the messages are not sent by another nvmet device.

Signed-off-by: Jesse Taube <jtaubepe@redhat.com>
@Mr-Bossman

Copy link
Copy Markdown
Contributor Author

Hi @Mr-Bossman thank you for updating the patch. I ran the modified test case on the kernel v7.4-fc3, and still observe the failure.

The retry logic in get_ctrl_timeout() doesn't look working as expected.

Very sorry about that i'm not sure how/why I did that and clearly didn't test either.

@Mr-Bossman Mr-Bossman changed the title nvme/076: Test nvmet configurable tbkas nvme/080: Test nvmet configurable tbkas Nov 16, 2026
kawasaki pushed a commit that referenced this pull request Nov 19, 2026
Test nvmet configurable traffic based keep-alive (tbkas).
Uses dynamic debug to monitor the keep-alive messages produced by
the traffic based keep-alive or admin keep-alive messages.
Checks that the messages are made by the correct controller
and that the messages are not sent by another nvmet device.

Link: #272
Signed-off-by: Jesse Taube <jtaubepe@redhat.com>
[Shin'ichiro: renumbered to nvme/081]
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
@kawasaki

Copy link
Copy Markdown
Collaborator

No worries, and thanks for the update! I have renumbered the test case and applied to the master branch manually. Let me close this PR.

@kawasaki kawasaki closed this Nov 19, 2026
@Mr-Bossman
Mr-Bossman deleted the dev/jesse/tbkas branch November 20, 2026 14:11
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.

3 participants