All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolin Chen <nicolinc@nvidia.com>
To: Yi Liu <yi.l.liu@intel.com>
Cc: <kevin.tian@intel.com>, <jgg@nvidia.com>, <joro@8bytes.org>,
	<baolu.lu@linux.intel.com>, <iommu@lists.linux.dev>
Subject: Re: [PATCH 1/2] iommufd/selftest: Add a helper to get test device
Date: Wed, 26 Feb 2025 13:45:16 -0800	[thread overview]
Message-ID: <Z7+LbJUNVMvrJzs9@Asurada-Nvidia> (raw)
In-Reply-To: <20250226050130.5814-2-yi.l.liu@intel.com>

On Tue, Feb 25, 2025 at 09:01:29PM -0800, Yi Liu wrote:
> There is need to get the selftest device (sobj->type == TYPE_IDEV) in
> multiple places, so have a helper to for it.
> 
> Signed-off-by: Yi Liu <yi.l.liu@intel.com>

Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>

With two nits below:

> @@ -968,29 +968,39 @@ static int iommufd_test_mock_domain(struct iommufd_ucmd *ucmd,
>  	return rc;
>  }
>  
> -/* Replace the mock domain with a manually allocated hw_pagetable */
> -static int iommufd_test_mock_domain_replace(struct iommufd_ucmd *ucmd,
> -					    unsigned int device_id, u32 pt_id,
> -					    struct iommu_test_cmd *cmd)
> +static struct selftest_obj *
> +iommufd_test_get_self_test_device(struct iommufd_ctx *ictx, u32 id)

Since it wants selftest_obj, maybe just iommufd_test_get_selftest_obj.

> @@ -1000,7 +1010,7 @@ static int iommufd_test_mock_domain_replace(struct iommufd_ucmd *ucmd,
>  	rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd));
>  
>  out_dev_obj:

out_sobj:

> -	iommufd_put_object(ucmd->ictx, dev_obj);
> +	iommufd_put_object(ucmd->ictx, &sobj->obj);
>  	return rc;

Thanks
Nic

  reply	other threads:[~2025-02-26 21:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-26  5:01 [PATCH 0/2] Add an iommufd selftest for replacement between domain and handle Yi Liu
2025-02-26  5:01 ` [PATCH 1/2] iommufd/selftest: Add a helper to get test device Yi Liu
2025-02-26 21:45   ` Nicolin Chen [this message]
2025-02-27  0:41     ` Yi Liu
2025-02-26  5:01 ` [PATCH 2/2] iommufd/selftest: Add coverage for RID replace between handle and non-handle Yi Liu
2025-02-26 21:58   ` Nicolin Chen
2025-02-27  1:24     ` Yi Liu
2025-02-27 20:11   ` Jason Gunthorpe

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=Z7+LbJUNVMvrJzs9@Asurada-Nvidia \
    --to=nicolinc@nvidia.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=yi.l.liu@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.