public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolin Chen <nicolinc@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "Liu, Yi L" <yi.l.liu@intel.com>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"jgg@nvidia.com" <jgg@nvidia.com>,
	"robin.murphy@arm.com" <robin.murphy@arm.com>,
	"baolu.lu@linux.intel.com" <baolu.lu@linux.intel.com>,
	"cohuck@redhat.com" <cohuck@redhat.com>,
	"eric.auger@redhat.com" <eric.auger@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"mjrosato@linux.ibm.com" <mjrosato@linux.ibm.com>,
	"chao.p.peng@linux.intel.com" <chao.p.peng@linux.intel.com>,
	"yi.y.sun@linux.intel.com" <yi.y.sun@linux.intel.com>,
	"peterx@redhat.com" <peterx@redhat.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"shameerali.kolothum.thodi@huawei.com" 
	<shameerali.kolothum.thodi@huawei.com>,
	"lulu@redhat.com" <lulu@redhat.com>,
	"suravee.suthikulpanit@amd.com" <suravee.suthikulpanit@amd.com>,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>,
	"Duan, Zhenzhong" <zhenzhong.duan@intel.com>
Subject: Re: [PATCH v3 3/4] iommufd: Add IOMMU_DEVICE_GET_HW_INFO
Date: Fri, 19 May 2023 11:30:15 -0700	[thread overview]
Message-ID: <ZGfANz/aJp2WtXSp@Asurada-Nvidia> (raw)
In-Reply-To: <BL1PR11MB527103529CB229A58C2439FF8C7C9@BL1PR11MB5271.namprd11.prod.outlook.com>

Hi Kevin,

On Fri, May 19, 2023 at 08:42:07AM +0000, Tian, Kevin wrote:

> > +};
> > +#define IOMMU_DEVICE_GET_HW_INFO _IO(IOMMUFD_TYPE,
> > IOMMUFD_CMD_DEVICE_GET_HW_INFO)
> >  #endif
> 
> Here we have a naming confusion.
> 
> 'IOMMU' is the prefix of iommufd ioctls.
> 
> 'DEVICE' is the subjective.
> 
> Then "GET_HW_INFO" implies getting hardware info related to
> this device. then it should not be restricted to the iommu info.
> 
> with that it's clearer to call it IOMMU_DEVICE_GET_IOMMU_INFO.

Though the entire ioctl is tied to the input "dev_id", I think
it isn't really about the device corresponding to the dev_id,
similar to the IOMMU_HWPT_ALLOC having a dev_id input too. So,
I think the "IOMMU_DEVICE" here should be interpreted simply
as "an iommu device". We could also highlight this somewhere
in the header.

With that being said, IOMMU_DEVICE_SET/UNSET_DATA should be
renamed to IOMMU_DEVICE_SET/UNSET_DEV_DATA -- "DEVICE" is the
iommu device while the "DEV_DATA" is a given device that's
behind the iommu.

> similarly for struct iommu_hw_info.
> 
> 'iommu' is the prefix for all iommufd ioctl structures.
> 
> then 'hw_info' is too broard.
> 
> iommu_device_iommu_info reads better? though having two
> iommu's in the name is a little bit annoying...

How about:
IOMMU_DEVICE_GET_FEATURES
struct iommu_device_features
?

Thanks
Nic

  reply	other threads:[~2023-05-19 18:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 14:30 [PATCH v3 0/4] iommufd: Add iommu hardware info reporting Yi Liu
2023-05-11 14:30 ` [PATCH v3 1/4] iommu: Move dev_iommu_ops() to private header Yi Liu
2023-05-11 14:30 ` [PATCH v3 2/4] iommu: Add new iommu op to get iommu hardware information Yi Liu
2023-05-11 14:30 ` [PATCH v3 3/4] iommufd: Add IOMMU_DEVICE_GET_HW_INFO Yi Liu
2023-05-12  5:38   ` Baolu Lu
2023-05-15  6:14     ` Liu, Yi L
2023-05-16  1:49       ` Baolu Lu
2023-05-19  8:42   ` Tian, Kevin
2023-05-19 18:30     ` Nicolin Chen [this message]
2023-05-24  5:00       ` Tian, Kevin
2023-05-24  5:19         ` Nicolin Chen
     [not found]   ` <BL1PR11MB527177A3860E10818E9761938C7C9@BL1PR11MB5271.namprd11.prod.outlook.com>
2023-05-19  9:15     ` Tian, Kevin
2023-05-11 14:30 ` [PATCH v3 4/4] iommufd/selftest: Add coverage for IOMMU_DEVICE_GET_HW_INFO ioctl Yi Liu

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=ZGfANz/aJp2WtXSp@Asurada-Nvidia \
    --to=nicolinc@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=cohuck@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=iommu@lists.linux.dev \
    --cc=jasowang@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lulu@redhat.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=peterx@redhat.com \
    --cc=robin.murphy@arm.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=yi.l.liu@intel.com \
    --cc=yi.y.sun@linux.intel.com \
    --cc=zhenzhong.duan@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox