[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f6rvvhgim4nk34onfgbwyfctgvgdbdigwbsugjvizgtli46p57@s7c4gkqrpjqy>
Date: Tue, 20 Jun 2023 19:37:43 +0200
From: Daniel Wagner <dwagner@...e.de>
To: Sagi Grimberg <sagi@...mberg.me>
Cc: linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-block@...r.kernel.org, Chaitanya Kulkarni <kch@...dia.com>,
Shin'ichiro Kawasaki <shinichiro@...tmail.com>,
Hannes Reinecke <hare@...e.de>,
James Smart <jsmart2021@...il.com>,
Martin Belanger <Martin.Belanger@...l.com>
Subject: Re: [PATCH blktests v1 1/3] nvme/048: Check for queue count check
directly
On Tue, Jun 20, 2023 at 04:49:45PM +0300, Sagi Grimberg wrote:
> > +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.
Powered by blists - more mailing lists