[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aEyN0oY/Y8n0gsVb@nvidia.com>
Date: Fri, 13 Jun 2025 13:45:06 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: Jason Gunthorpe <jgg@...dia.com>
CC: <kevin.tian@...el.com>, <will@...nel.org>, <robin.murphy@....com>,
<joro@...tes.org>, <ddutile@...hat.com>, <yi.l.liu@...el.com>,
<peterz@...radead.org>, <jsnitsel@...hat.com>, <praan@...gle.com>,
<linux-arm-kernel@...ts.infradead.org>, <iommu@...ts.linux.dev>,
<linux-kernel@...r.kernel.org>, <patches@...ts.linux.dev>,
<baolu.lu@...ux.intel.com>
Subject: Re: [PATCH v1 05/12] iommu: Introduce get_viommu_size and
viommu_init ops
On Fri, Jun 13, 2025 at 10:41:17AM -0300, Jason Gunthorpe wrote:
> On Mon, Jun 09, 2025 at 10:13:28AM -0700, Nicolin Chen wrote:
> > @@ -654,6 +665,10 @@ struct iommu_ops {
> >
> > int (*def_domain_type)(struct device *dev);
> >
> > + int (*get_viommu_size)(enum iommu_viommu_type viommu_type,
> > + struct device *dev, size_t *viommu_size);
>
> I'd return the size in a size_t instead of using an output
> pointer. Make 0 mean not supported..
Yes. Kevin pointed out the same.
I found that the final version only has EOPNOTSUPP errno (had one
of WIP versions reporting EINVAL). So, yea, doing a ssize_t would
be cleaner and EOPNOTSUPP is probably enough. Will change in v2.
Thanks
Nicolin
Powered by blists - more mailing lists