netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Stanislav Fomichev <sdf@fomichev.me>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com,
	Mina Almasry <almasrymina@google.com>
Subject: Re: [PATCH net-next v3 10/12] selftests: ncdevmem: Run selftest when none of the -s or -c has been provided
Date: Wed, 9 Oct 2024 21:19:44 -0700	[thread overview]
Message-ID: <ZwdV4OOI27nEVyqU@mini-arch> (raw)
In-Reply-To: <20241009171252.2328284-11-sdf@fomichev.me>

On 10/09, Stanislav Fomichev wrote:
> This will be used as a 'probe' mode in the selftest to check whether
> the device supports the devmem or not. Use hard-coded queue layout
> (two last queues) and prevent user from passing custom -q and/or -t.
> 
> Cc: Mina Almasry <almasrymina@google.com>
> Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
> ---
>  tools/testing/selftests/net/ncdevmem.c | 42 ++++++++++++++++++++------
>  1 file changed, 32 insertions(+), 10 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/ncdevmem.c b/tools/testing/selftests/net/ncdevmem.c
> index 90aacfb3433f..3a456c058241 100644
> --- a/tools/testing/selftests/net/ncdevmem.c
> +++ b/tools/testing/selftests/net/ncdevmem.c
> @@ -64,7 +64,7 @@ static char *client_ip;
>  static char *port;
>  static size_t do_validation;
>  static int start_queue = -1;
> -static int num_queues = 1;
> +static int num_queues = -1;
>  static char *ifname;
>  static unsigned int ifindex;
>  static unsigned int dmabuf_id;
> @@ -706,19 +706,31 @@ int main(int argc, char *argv[])
>  		}
>  	}
>  
> -	if (!server_ip)
> -		error(1, 0, "Missing -s argument\n");
> -
> -	if (!port)
> -		error(1, 0, "Missing -p argument\n");
> -
>  	if (!ifname)
>  		error(1, 0, "Missing -f argument\n");
>  
>  	ifindex = if_nametoindex(ifname);
>  
> -	if (start_queue < 0) {
> -		start_queue = rxq_num(ifindex) - 1;
> +	if (!server_ip && !client_ip) {
> +		if (start_queue < 0 && num_queues < 0) {
> +			num_queues = rxq_num(ifindex);
> +			if (num_queues < 0)
> +				error(1, 0, "couldn't detect number of queues\n");
> +			/* make sure can bind to multiple queues */

[..]

> +			start_queues = num_queues / 2;

Should have been start_queue, not start_queues. Not sure how I missed
that. Also means I haven't run this for real..

  reply	other threads:[~2024-10-10  4:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09 17:12 [PATCH net-next v3 00/12] selftests: ncdevmem: Add ncdevmem to ksft Stanislav Fomichev
2024-10-09 17:12 ` [PATCH net-next v3 01/12] selftests: ncdevmem: Redirect all non-payload output to stderr Stanislav Fomichev
2024-10-09 17:12 ` [PATCH net-next v3 02/12] selftests: ncdevmem: Separate out dmabuf provider Stanislav Fomichev
2024-10-09 17:12 ` [PATCH net-next v3 03/12] selftests: ncdevmem: Unify error handling Stanislav Fomichev
2024-10-09 17:12 ` [PATCH net-next v3 04/12] selftests: ncdevmem: Make client_ip optional Stanislav Fomichev
2024-10-09 17:12 ` [PATCH net-next v3 05/12] selftests: ncdevmem: Remove default arguments Stanislav Fomichev
2024-10-13  3:47   ` Mina Almasry
2024-10-14 14:53     ` Stanislav Fomichev
2024-10-09 17:12 ` [PATCH net-next v3 06/12] selftests: ncdevmem: Switch to AF_INET6 Stanislav Fomichev
2024-10-09 17:12 ` [PATCH net-next v3 07/12] selftests: ncdevmem: Properly reset flow steering Stanislav Fomichev
2024-10-09 17:12 ` [PATCH net-next v3 08/12] selftests: ncdevmem: Use YNL to enable TCP header split Stanislav Fomichev
2024-10-09 17:12 ` [PATCH net-next v3 09/12] selftests: ncdevmem: Remove hard-coded queue numbers Stanislav Fomichev
2024-10-13  3:50   ` Mina Almasry
2024-10-14 14:47     ` Stanislav Fomichev
2024-10-14 22:49       ` Mina Almasry
2024-10-09 17:12 ` [PATCH net-next v3 10/12] selftests: ncdevmem: Run selftest when none of the -s or -c has been provided Stanislav Fomichev
2024-10-10  4:19   ` Stanislav Fomichev [this message]
2024-10-14 22:47   ` Mina Almasry
2024-10-09 17:12 ` [PATCH net-next v3 11/12] selftests: ncdevmem: Move ncdevmem under drivers/net/hw Stanislav Fomichev
2024-10-09 17:12 ` [PATCH net-next v3 12/12] selftests: ncdevmem: Add automated test Stanislav Fomichev

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=ZwdV4OOI27nEVyqU@mini-arch \
    --to=stfomichev@gmail.com \
    --cc=almasrymina@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    /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;
as well as URLs for NNTP newsgroup(s).