All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex@shazbot.org>
To: Yi Lai <yi1.lai@intel.com>
Cc: Shuah Khan <shuah@kernel.org>,
	David Matlack <dmatlack@google.com>,
	Raghavendra Rao Ananta <rananta@google.com>,
	Alex Mastro <amastro@fb.com>,
	kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, alex@shazbot.org
Subject: Re: [PATCH v2] vfio: selftests: Support DMR and GNR-D DSA devices
Date: Fri, 20 Mar 2026 15:16:54 -0600	[thread overview]
Message-ID: <20260320151654.60f0cf65@shazbot.org> (raw)
In-Reply-To: <20260320010930.481380-1-yi1.lai@intel.com>

On Fri, 20 Mar 2026 09:09:29 +0800
Yi Lai <yi1.lai@intel.com> wrote:

> Currently, the VFIO DSA driver test only supports the SPR DSA device ID.
> Attempting to run the test on newer platforms like DMR or GNR-D results
> in a "No driver found" error, causing the test to be skipped.
> 
> Refactor dsa_probe() to use a switch statement for checking device IDs.
> This improves maintainability and makes it easier to add new device IDs
> in the future.
> 
> Add the following DSA device IDs to the supported list:
> PCI_DEVICE_ID_INTEL_DSA_DMR  (0x1212)
> PCI_DEVICE_ID_INTEL_DSA_GNRD (0x11fb)
> 
> Signed-off-by: Yi Lai <yi1.lai@intel.com>
> ---
>  .../testing/selftests/vfio/lib/drivers/dsa/dsa.c  | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/vfio/lib/drivers/dsa/dsa.c b/tools/testing/selftests/vfio/lib/drivers/dsa/dsa.c
> index c75045bcab79..19d9630b24c2 100644
> --- a/tools/testing/selftests/vfio/lib/drivers/dsa/dsa.c
> +++ b/tools/testing/selftests/vfio/lib/drivers/dsa/dsa.c
> @@ -65,9 +65,20 @@ static bool dsa_int_handle_request_required(struct vfio_pci_device *device)
>  
>  static int dsa_probe(struct vfio_pci_device *device)
>  {
> -	if (!vfio_pci_device_match(device, PCI_VENDOR_ID_INTEL,
> -				   PCI_DEVICE_ID_INTEL_DSA_SPR0))
> +	const u16 vendor_id = vfio_pci_config_readw(device, PCI_VENDOR_ID);
> +	const u16 device_id = vfio_pci_config_readw(device, PCI_DEVICE_ID);
> +
> +	if (vendor_id != PCI_VENDOR_ID_INTEL)
> +		return -EINVAL;
> +
> +	switch (device_id) {
> +	case PCI_DEVICE_ID_INTEL_DSA_SPR0:
> +	case PCI_DEVICE_ID_INTEL_DSA_DMR:
> +	case PCI_DEVICE_ID_INTEL_DSA_GNRD:
> +		break;
> +	default:
>  		return -EINVAL;
> +	}
>  
>  	if (dsa_int_handle_request_required(device)) {
>  		dev_err(device, "Device requires requesting interrupt handles\n");

Applied to vfio next branch for v7.1.  Thanks,

Alex

      parent reply	other threads:[~2026-03-20 21:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20  1:09 [PATCH v2] vfio: selftests: Support DMR and GNR-D DSA devices Yi Lai
2026-03-20 15:38 ` David Matlack
2026-03-20 21:16 ` Alex Williamson [this message]

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=20260320151654.60f0cf65@shazbot.org \
    --to=alex@shazbot.org \
    --cc=amastro@fb.com \
    --cc=dmatlack@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=rananta@google.com \
    --cc=shuah@kernel.org \
    --cc=yi1.lai@intel.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 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.