public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Daniel Wagner <dwagner@suse.de>, Keith Busch <kbusch@kernel.org>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	Christoph Hellwig <hch@lst.de>,
	Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
	Martin Belanger <Martin.Belanger@dell.com>
Subject: Re: [PATCH v1 1/2] nvme/rc: Parse optional arguments in _nvme_connect_subsys()
Date: Tue, 21 Mar 2023 05:16:25 +0000	[thread overview]
Message-ID: <a46e4e5a-69e2-509c-2c20-7ea01bf94f50@nvidia.com> (raw)
In-Reply-To: <20230320173806.12784-2-dwagner@suse.de>

On 3/20/2023 10:38 AM, Daniel Wagner wrote:
> Extend the nvme_connect_subsys() function to parse optional arguments.
> This avoids that all test have to pass in always all arguments.
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
>   tests/nvme/rc | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 46 insertions(+)
> 
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index 210a82aea384..8f4b4601c44e 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -316,6 +316,42 @@ _nvme_disconnect_subsys() {
>   }
>   
>   _nvme_connect_subsys() {
> +	local positional_args=()
> +
> +	local nr_io_queues=""
> +	local nr_write_queues=""
> +	local nr_poll_queues=""
> +
> +	while [[ $# -gt 0 ]]; do
> +		case $1 in
> +			-i|--nr-io-queues)
> +				nr_io_queues="$2"
> +				shift
> +				shift
> +				;;
> +			-W|--nr-write-queues)
> +				nr_write_queues="$2"
> +				shift
> +				shift
> +				;;
> +			-P|--nr-poll-queues)
> +				nr_poll_queues="$2"
> +				shift
> +				shift
> +				;;
> +			-*|--*)
> +				echo "Unknown option $1"
> +				exit 1
> +				;;
> +			*)
> +				positional_args+=("$1")
> +				shift
> +				;;
> +		esac
> +	done
> +
> +	set -- "${positional_args[@]}"
> +
>   	local trtype="$1"
>   	local subsysnqn="$2"
>   	local traddr="${3:-$def_traddr}"

can we please have all variable declarations at the start of the
function then add the actual code instead of adding in between
different variable declarations ??

-ck


  reply	other threads:[~2023-03-21  5:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 14:19 nvme-tcp poll queue crash Daniel Wagner
2023-03-20 14:36 ` Sagi Grimberg
2023-03-20 14:51   ` Daniel Wagner
2023-03-20 15:06     ` Keith Busch
2023-03-20 15:22       ` Daniel Wagner
2023-03-20 17:38         ` [PATCH v1 0/2] Test different queue counts Daniel Wagner
2023-03-20 17:38           ` [PATCH v1 1/2] nvme/rc: Parse optional arguments in _nvme_connect_subsys() Daniel Wagner
2023-03-21  5:16             ` Chaitanya Kulkarni [this message]
2023-03-21  7:20               ` Daniel Wagner
2023-03-22  5:17                 ` Chaitanya Kulkarni
2023-03-20 17:38           ` [PATCH v1 2/2] nvme/047: Test different queue counts Daniel Wagner
2023-03-20 20:00       ` nvme-tcp poll queue crash Sagi Grimberg
2023-03-20 20:01         ` Sagi Grimberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a46e4e5a-69e2-509c-2c20-7ea01bf94f50@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=Martin.Belanger@dell.com \
    --cc=dwagner@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=shinichiro.kawasaki@wdc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox