mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clegoate@redhat.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: ankita@nvidia.com, alex.williamson@redhat.com,
	aniketa@nvidia.com, cjia@nvidia.com, kwankhede@nvidia.com,
	targupta@nvidia.com, vsethi@nvidia.com, acurrid@nvidia.com,
	apopple@nvidia.com, jhubbard@nvidia.com, danw@nvidia.com,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/1] vfio/nvgpu: Add vfio pci variant module for grace hopper
Date: Fri, 23 Jun 2023 15:04:17 +0200	[thread overview]
Message-ID: <62dcff6b-852d-4a85-dfd4-0ce1f324602e@redhat.com> (raw)
In-Reply-To: <ZJWGbsaMzHvqqewi@nvidia.com>

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.


  reply	other threads:[~2023-06-23 13:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22  3:07 ankita
2023-06-23  6:27 ` Cédric Le Goater
2023-06-23 11:47   ` Jason Gunthorpe
2023-06-23 13:04     ` Cédric Le Goater [this message]
2023-06-23 13:07       ` Jason Gunthorpe
2023-06-23 15:07         ` Cédric Le Goater
2023-06-23 16:38           ` Jason Gunthorpe
2023-06-23 13:26 ` Jason Gunthorpe
2023-06-26 16:06   ` Alex Williamson
2023-06-26 16:23     ` Jason Gunthorpe
2023-06-28 19:00       ` Ankit Agrawal
2023-06-26 16:01 ` Alex Williamson
2023-07-05 18:37   ` Ankit Agrawal
2023-07-05 22:16     ` Alex Williamson

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=62dcff6b-852d-4a85-dfd4-0ce1f324602e@redhat.com \
    --to=clegoate@redhat.com \
    --cc=acurrid@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=aniketa@nvidia.com \
    --cc=ankita@nvidia.com \
    --cc=apopple@nvidia.com \
    --cc=cjia@nvidia.com \
    --cc=danw@nvidia.com \
    --cc=jgg@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=targupta@nvidia.com \
    --cc=vsethi@nvidia.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

all inboxes | Powered by JetHome®