mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: oushixiong <oushixiong@kylinos.cn>
Cc: Jason Gunthorpe <jgg@ziepe.ca>, Yishai Hadas <yishaih@nvidia.com>,
	Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Brett Creeley <brett.creeley@amd.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vfio/pds: Limit Calling dev_dbg function to CONFIG_PCI_ATS
Date: Tue, 5 Sep 2023 08:31:19 -0600	[thread overview]
Message-ID: <20230905083119.27cf3c03.alex.williamson@redhat.com> (raw)
In-Reply-To: <20230905024028.940377-1-oushixiong@kylinos.cn>

On Tue,  5 Sep 2023 10:40:28 +0800
oushixiong <oushixiong@kylinos.cn> wrote:

> From: Shixiong Ou <oushixiong@kylinos.cn>
> 
> If CONFIG_PCI_ATS isn't set, then pdev->physfn is not defined.
> So 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,
>       |                              ^~~~~~
> 
> Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>
> ---
>  drivers/vfio/pci/pds/vfio_dev.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/vfio/pci/pds/vfio_dev.c b/drivers/vfio/pci/pds/vfio_dev.c
> index b46174f5eb09..18b4a6a5bc16 100644
> --- a/drivers/vfio/pci/pds/vfio_dev.c
> +++ b/drivers/vfio/pci/pds/vfio_dev.c
> @@ -160,10 +160,13 @@ static int pds_vfio_init_device(struct vfio_device *vdev)
>  	vdev->log_ops = &pds_vfio_log_ops;
>  
>  	pci_id = PCI_DEVID(pdev->bus->number, pdev->devfn);
> +
> +#ifdef CONFIG_PCI_ATS
>  	dev_dbg(&pdev->dev,
>  		"%s: PF %#04x VF %#04x vf_id %d domain %d pds_vfio %p\n",
>  		__func__, pci_dev_id(pdev->physfn), pci_id, vf_id,
>  		pci_domain_nr(pdev->bus), pds_vfio);
> +#endif
>  
>  	return 0;
>  }

AIUI, this whole driver is dependent on SR-IOV functionality, so perhaps
this should be gated at Kconfig?  Thanks,

Alex


  reply	other threads:[~2023-09-05 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05  2:40 oushixiong
2023-09-05 14:31 ` Alex Williamson [this message]
2023-09-06  1:02   ` Brett Creeley

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=20230905083119.27cf3c03.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

all inboxes | Powered by JetHome®