lkml.org 
[lkml]   [2023]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 1/1] vfio/nvgpu: Add vfio pci variant module for grace hopper
From
On 6/23/23 13:47, Jason Gunthorpe wrote:
> 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..

I meant something like

#define nvgpu_mem_size(nvdev) (nvdev)->mem_prop.mem_length
#define nvgpu_mem_pa_base(nvdev) (nvdev)->mem_prop.hpa

This is minor.

>
>>> +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.

OK then.

Thanks,

C.

\
 
 \ /
  Last update: 2023-06-23 15:05    [W:0.147 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site