lkml.org 
[lkml]   [2023]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH blktests v1 1/3] nvme/048: Check for queue count check directly
From

>>> +nvmf_wait_for_queue_count() {
>>> + local subsys_name="$1"
>>> + local queue_count="$2"
>>> + local nvmedev
>>> +
>>> + nvmedev=$(_find_nvme_dev "${subsys_name}")
>>> +
>>> + queue_count_file="/sys/class/nvme-fabrics/ctl/${nvmedev}/queue_count"
>>> +
>>> + nvmf_wait_for_state "${subsys_name}" "live" || return 1
>>> +
>>> + queue_count=$((queue_count + 1))
>>> + if grep -q "${queue_count}" "${queue_count_file}"; then
>>> + return 0
>>> + fi
>>> +
>>> + echo "expected queue count ${queue_count} not set"
>>> + return 1
>>> +}
>>> +
>>> set_nvmet_attr_qid_max() {
>>> local nvmet_subsystem="$1"
>>> local qid_max="$2"
>>> @@ -56,10 +76,7 @@ set_qid_max() {
>>> local qid_max="$3"
>>> set_nvmet_attr_qid_max "${subsys_name}" "${qid_max}"
>>> -
>>> - # Setting qid_max forces a disconnect and the reconntect attempt starts
>>> - nvmf_wait_for_state "${subsys_name}" "connecting" || return 1
>>> - nvmf_wait_for_state "${subsys_name}" "live" || return 1
>>> + nvmf_wait_for_queue_count "${subsys_name}" "${qid_max}" || return 1
>>
>> Why not simply wait for live? The connecting is obviously racy...
>
> That is what the new version is doing. It's waiting for the live state and then
> checks the queue count.

Maybe don't fold waiting for live into waiting for queue_count.

\
 
 \ /
  Last update: 2023-06-21 11:52    [W:0.080 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site