public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: "Tian, Kevin" <kevin.tian@intel.com>,
	oushixiong <oushixiong@kylinos.cn>,
	Yishai Hadas <yishaih@nvidia.com>,
	Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>,
	Brett Creeley <brett.creeley@amd.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] vfio/pds: Using pci_physfn() to fix a compilation issue
Date: Wed, 13 Sep 2023 12:58:15 -0600	[thread overview]
Message-ID: <20230913125815.3ef654e6.alex.williamson@redhat.com> (raw)
In-Reply-To: <ZP8H0puYJeYF33fn@ziepe.ca>

On Mon, 11 Sep 2023 09:28:02 -0300
Jason Gunthorpe <jgg@ziepe.ca> wrote:

> On Mon, Sep 11, 2023 at 08:25:18AM +0000, Tian, Kevin wrote:
> > > From: oushixiong <oushixiong@kylinos.cn>
> > > Sent: Monday, September 11, 2023 4:08 PM
> > > 
> > > From: Shixiong Ou <oushixiong@kylinos.cn>
> > > 
> > > If PCI_ATS isn't set, then pdev->physfn is not defined.
> > > it causes a compilation issue:
> > > 
> > > ../drivers/vfio/pci/pds/vfio_dev.c:165:30: error: ‘struct pci_dev’ has no
> > > member named ‘physfn’; did you mean ‘is_physfn’?
> > >   165 |   __func__, pci_dev_id(pdev->physfn), pci_id, vf_id,
> > >       |                              ^~~~~~
> > > 
> > > So using pci_physfn() rather than using pdev->physfn directly.
> > > 
> > > Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>  
> > 
> > Reviewed-by: Kevin Tian <kevin.tian@intel.com>  
> 
> Yes, we should do both patches

Sure, but it's sloppy to put both in with the same commit log.  Should
we change this one to something like:

    vfio/pds: Use proper PF device access helper

    The pci_physfn() helper exists to support cases where the physfn
    field may not be compiled into the pci_dev structure.  We've
    declared this driver dependent on PCI_IOV to avoid this problem,
    but regardless we should follow the precedent not to access this
    field directly.

Thanks,
Alex 


      reply	other threads:[~2023-09-13 18:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11  8:08 [PATCH] vfio/pds: Using pci_physfn() to fix a compilation issue oushixiong
2023-09-11  8:25 ` Tian, Kevin
2023-09-11 12:28   ` Jason Gunthorpe
2023-09-13 18:58     ` Alex Williamson [this message]

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=20230913125815.3ef654e6.alex.williamson@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=brett.creeley@amd.com \
    --cc=jgg@ziepe.ca \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oushixiong@kylinos.cn \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=yishaih@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