Re: [PATCH 1/2] vfio: selftests: Find devices that are compatible with VFIO selftests

From: Josh Hilke

Date: Mon Apr 13 2026 - 19:00:57 EST


On Fri, Apr 10, 2026 at 3:40 PM David Matlack <dmatlack@xxxxxxxxxx> wrote:
> > +# List of devices which have a VFIO selftest driver
> > +DEVICES=(
> > + "8086:0b25" # Intel Data Streaming Accelerator
>
> Please also add the new DMR and GNR-D DSA devices that were added
> recently:
>
> https://github.com/awilliam/linux-vfio/commit/c82cfe15916d33e89c2d2efeeb624e8c9c2c4ca8

Ack. Will do in v3.

> > +function print_supported_devices() {
> > + local vendor_device_id
> > + local id
> > +
> > + for vendor_device_id in "${DEVICES[@]}"; do
> > + read -r id <<< "${vendor_device_id}"
>
> Sashiko seems to think the read here is unecessary.
>
> https://sashiko.dev/#/patchset/20260409015139.2800185-1-jrhilke%40google.com?part=1

Ah yea, the read is a vestige of a different iteration I had of this
script. I'll remove it in v3.

> > + lspci -D -d "${id}" | awk '{ print $1 }'
>
> Let's print the whole line and let the user parse out the BDF with awk.
> That will let the user see which type of device it its rather than just
> raw BDFs.

Will do in v3.

> > + while getopts "ld:" opt; do
> > + case ${opt} in
> > + l)
> > + echo "Supported devices: "
> > + print_supported_devices
> > + exit 0
> > + ;;
>
> nit: Put the echo in print_supported_devices and this can be a one-liner
> like the rest of the options.
>
> while getopts "ld:" opt; do
> case ${opt} in
> l) print_supported_devices; exit 0 ;;
> d) bdf_list+=("${OPTARG}") ;;
> *) usage; exit 1 ;;
> esac
> done

Will do in v3.

> > + d) bdf_list+=("${OPTARG}") ;;
>
> Let's keep the current semantics where the list of BDFs is passed as
> positional arguments. The next commit would just pick a device if there
> are no positional arguments.
>
> This will keep the script backwards compatible with current usage and
> also keep it simple (no need to pass extra -d flag for every BDF):
>
> ./setup.sh BDF1 BDF2 BDF3
> vs.
> ./setup.sh -d BDF1 -d BDF2 -d BDF3

Works for me. Will do in v3.