All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Aaron Lewis" <aaronlewis@google.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v3 4/4] vfio: selftests: Allow a size for vfio_dma_mapping_perf_test
Date: Thu, 10 Sep 2026 15:41:43 +0000	[thread overview]
Message-ID: <20260910154144.1FEC41F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260910153326.3085937-5-aaronlewis@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Silent failure on invalid or unrecognized command-line options due to missing usage print.
--

commit 6144d66da4643ccf9bc4b7ab3160a7d8485045d3
Author: Aaron Lewis <aaronlewis@google.com>

vfio: selftests: Allow a size for vfio_dma_mapping_perf_test

This commit introduces a mechanism in the selftest harness to parse custom
command-line options. It uses this new functionality to add a '-b' option 
to vfio_dma_mapping_perf_test for specifying the DMA region size.

> diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
> index 29a19bc870846..5065eb7144bce 100644
> --- a/tools/testing/selftests/kselftest_harness.h
> +++ b/tools/testing/selftests/kselftest_harness.h
[ ... ]
> @@ -1118,7 +1156,6 @@ static int test_harness_argv_check(int argc, char **argv)
>  			ksft_debug_enabled = true;
>  			break;
>  		case 'h':
> -		default:
>  			fprintf(stderr,
>  				"Usage: %s [-h|-l|-d] [-t|-T|-v|-V|-f|-F|-r name]\n"
>  				"\t-h       print help\n"
> @@ -1139,7 +1176,14 @@ static int test_harness_argv_check(int argc, char **argv)
>  				"include all tests from variant 'bla'\n"
>  				"but not test 'foo' specify '-T foo -v bla'.\n"
>  				"", argv[0]);
> -			return opt == 'h' ? KSFT_SKIP : KSFT_FAIL;
> +			if (opts && opts->help)
> +				opts->help();
> +			return KSFT_SKIP;
> +		default:
> +			if (opts && opts->handler &&
> +			    opts->handler(opt, optarg) == KSFT_PASS)
> +				break;
> +			return KSFT_FAIL;

[Severity: Medium]
Is it intended to silently fail here in test_harness_argv_check() without 
printing the usage string?

Previously, unrecognized options would fall through to the 'h' case and print
the help text before returning KSFT_FAIL. By removing the default fallthrough
to the 'h' case, passing an invalid option to the test binary now exits
silently, which might make it harder for users to realize they've provided an
invalid flag.

>  		}
>  	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260910153326.3085937-1-aaronlewis@google.com?part=4

  reply	other threads:[~2026-09-10 15:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 15:33 [PATCH v3 0/4] Introduce vfio_dma_mapping_perf_test Aaron Lewis
2026-09-10 15:33 ` [PATCH v3 1/4] vfio: selftests: Assert the region was unmapped in iommu_unmap() Aaron Lewis
2026-09-10 15:33 ` [PATCH v3 2/4] vfio: selftests: Introduce vfio_dma_mapping_perf_test Aaron Lewis
2026-10-08  9:48   ` David Matlack
2026-09-10 15:33 ` [PATCH v3 3/4] vfio: selftests: Add memfd test to vfio_dma_mapping_perf_test Aaron Lewis
2026-10-08 10:03   ` David Matlack
2026-09-10 15:33 ` [PATCH v3 4/4] vfio: selftests: Allow a size for vfio_dma_mapping_perf_test Aaron Lewis
2026-09-10 15:41   ` sashiko-bot [this message]
2026-10-08 10:27   ` David Matlack
2026-10-08 10:30 ` [PATCH v3 0/4] Introduce vfio_dma_mapping_perf_test David Matlack

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=20260910154144.1FEC41F00898@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=aaronlewis@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.