diff mbox series

[blktests,v5,1/4] nvme/rc: Add setter for attr_qid_max

Message ID 20230405154630.16298-2-dwagner@suse.de (mailing list archive)
State New, archived
Headers show
Series test queue count changes on reconnect | expand

Commit Message

Daniel Wagner April 5, 2023, 3:46 p.m. UTC
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 tests/nvme/rc | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Chaitanya Kulkarni April 5, 2023, 6:39 p.m. UTC | #1
On 4/5/23 08:46, Daniel Wagner wrote:
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
>   tests/nvme/rc | 10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index a3c9b42d91e6..ec7678dbe09e 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -617,6 +617,16 @@ _set_nvmet_dhgroup() {
>   	     "${cfs_path}/dhchap_dhgroup"
>   }
>   
> +_set_nvmet_attr_qid_max() {
> +	local nvmet_subsystem="$1"
> +	local qid_max="$2"
> +	local cfs_path="${NVMET_CFS}/subsystems/${nvmet_subsystem}"
> +
> +	if [[ -f "${cfs_path}/attr_qid_max" ]]; then
> +		echo $qid_max > "${cfs_path}/attr_qid_max"
> +	fi
> +}
> +
>

this is only used in the testcase patch #4, until we get a second
user move it to patch #4 ?

in case this was already discussed and decision made to keep it
in rc, please ignore this comment.

-ck
Daniel Wagner April 6, 2023, 6:12 a.m. UTC | #2
On Wed, Apr 05, 2023 at 06:39:43PM +0000, Chaitanya Kulkarni wrote:
> this is only used in the testcase patch #4, until we get a second
> user move it to patch #4 ?
> 
> in case this was already discussed and decision made to keep it
> in rc, please ignore this comment.

There wasn't any decision on this topic. I was not sure if I should put it in rc
but I saw there are already _set_nvmet_*() functions. Thus I came to the
conclusion it makes maintaining these helper function simpler in future because
they are all in one file. If someone touches all _set_nvmet_*() function this
one is not forgotten.

The same goes for the other rc helpers (patch 1-3).

That said, I really do not insit in putiting in rc.
Chaitanya Kulkarni April 6, 2023, 7:05 a.m. UTC | #3
On 4/5/23 23:12, Daniel Wagner wrote:
> On Wed, Apr 05, 2023 at 06:39:43PM +0000, Chaitanya Kulkarni wrote:
>> this is only used in the testcase patch #4, until we get a second
>> user move it to patch #4 ?
>>
>> in case this was already discussed and decision made to keep it
>> in rc, please ignore this comment.
> There wasn't any decision on this topic. I was not sure if I should put it in rc
> but I saw there are already _set_nvmet_*() functions. Thus I came to the
> conclusion it makes maintaining these helper function simpler in future because
> they are all in one file. If someone touches all _set_nvmet_*() function this
> one is not forgotten.
>
> The same goes for the other rc helpers (patch 1-3).
>
> That said, I really do not insit in putiting in rc.

if there are functions in rc which are only testcase specific let's keep
those there, we can always do cleanup later ..

-ck
Daniel Wagner April 6, 2023, 7:32 a.m. UTC | #4
On Thu, Apr 06, 2023 at 07:05:45AM +0000, Chaitanya Kulkarni wrote:
 if there are functions in rc which are only testcase specific let's keep
> those there, we can always do cleanup later ..

Sure, works for me too.
diff mbox series

Patch

diff --git a/tests/nvme/rc b/tests/nvme/rc
index a3c9b42d91e6..ec7678dbe09e 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -617,6 +617,16 @@  _set_nvmet_dhgroup() {
 	     "${cfs_path}/dhchap_dhgroup"
 }
 
+_set_nvmet_attr_qid_max() {
+	local nvmet_subsystem="$1"
+	local qid_max="$2"
+	local cfs_path="${NVMET_CFS}/subsystems/${nvmet_subsystem}"
+
+	if [[ -f "${cfs_path}/attr_qid_max" ]]; then
+		echo $qid_max > "${cfs_path}/attr_qid_max"
+	fi
+}
+
 _find_nvme_dev() {
 	local subsys=$1
 	local subsysnqn