[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZJWGbsaMzHvqqewi@nvidia.com>
Date: Fri, 23 Jun 2023 08:47:58 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Cédric Le Goater <clegoate@...hat.com>
Cc: ankita@...dia.com, alex.williamson@...hat.com, aniketa@...dia.com,
cjia@...dia.com, kwankhede@...dia.com, targupta@...dia.com,
vsethi@...dia.com, acurrid@...dia.com, apopple@...dia.com,
jhubbard@...dia.com, danw@...dia.com, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/1] vfio/nvgpu: Add vfio pci variant module for grace
hopper
On Fri, Jun 23, 2023 at 08:27:17AM +0200, Cédric Le Goater wrote:
> > + req_len = vma->vm_end - vma->vm_start;
> > + pgoff = vma->vm_pgoff &
> > + ((1U << (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT)) - 1);
> > + if (pgoff >= (nvdev->mem_prop.mem_length >> PAGE_SHIFT))
> > + return -EINVAL;
>
> you cound introduce accessor macros for nvdev->mem_prop.mem_length and
> nvdev->mem_prop.hpa
Accessors are not the usual style..
> > +static const struct pci_device_id nvgpu_vfio_pci_table[] = {
> > + { PCI_DRIVER_OVERRIDE_DEVICE_VFIO(PCI_VENDOR_ID_NVIDIA, 0x2342) },
> > + { PCI_DRIVER_OVERRIDE_DEVICE_VFIO(PCI_VENDOR_ID_NVIDIA, 0x2343) },
> > + { PCI_DRIVER_OVERRIDE_DEVICE_VFIO(PCI_VENDOR_ID_NVIDIA, 0x2345) },
>
> It would be good to add definitions for the PCI IDs.
The common form these days is to have a comment with the marketing
name, we stopped putting constants for every device a while ago.
Jason
Powered by blists - more mailing lists