mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: sathyanarayanan kuppuswamy  <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Keith Busch <kbusch@kernel.org>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org, ashok.raj@intel.com,
	keith.busch@intel.com
Subject: Re: [PATCH v4 2/7] PCI/ATS: Initialize PRI in pci_ats_init()
Date: Thu, 1 Aug 2019 14:21:07 -0700	[thread overview]
Message-ID: <d825feec-f6ca-30b8-3c7f-fb94e2e13499@linux.intel.com> (raw)
In-Reply-To: <20190801210929.GE15795@localhost.localdomain>

Hi Keith,

Thanks for the review.

On 8/1/19 2:09 PM, Keith Busch wrote:
> On Wed, Jul 03, 2019 at 01:46:19PM -0700, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
>> +#ifdef CONFIG_PCI_PRI
>> +static void pci_pri_init(struct pci_dev *pdev)
>> +{
>> +	u32 max_requests;
>> +	int pos;
>> +
>> +	/*
>> +	 * As per PCIe r4.0, sec 9.3.7.11, only PF is permitted to
>> +	 * implement PRI and all associated VFs can only use it.
>> +	 * Since PF already initialized the PRI parameters there is
>> +	 * no need to proceed further.
>> +	 */
>> +	if (pdev->is_virtfn)
>> +		return;
>> +
>> +	pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
>> +	if (!pos)
>> +		return;
>> +
>> +	pci_read_config_dword(pdev, pos + PCI_PRI_MAX_REQ, &max_requests);
>> +
>> +	/*
>> +	 * Since PRI is a shared resource between PF and VF, we must not
>> +	 * configure Outstanding Page Allocation Quota as a per device
>> +	 * resource in pci_enable_pri(). So use maximum value possible
>> +	 * as default value.
>> +	 */
>> +	pci_write_config_dword(pdev, pos + PCI_PRI_ALLOC_REQ, max_requests);
>> +
>> +	pdev->pri_reqs_alloc = max_requests;
>> +	pdev->pri_cap = pos;
>> +}
>> +#endif
>> +
>>   void pci_ats_init(struct pci_dev *dev)
>>   {
>>   	int pos;
>> @@ -28,6 +62,10 @@ void pci_ats_init(struct pci_dev *dev)
>>   		return;
>>   
>>   	dev->ats_cap = pos;
>> +
>> +#ifdef CONFIG_PCI_PRI
>> +	pci_pri_init(dev);
>> +#endif
>>   }
> Rather than surround the call to pci_pri_init() with the #ifdef, you
> should provide an empty function implementation when CONFIG_PCI_PRI is
> not defined. Same thing for the next patch adding PASID.
This function is defined and used in the same file (ats.c). Is there any 
advantage in defining an empty function ? But if this is the recommended 
approach, I can make the necessary changes. Please confirm.
>
-- 
Sathyanarayanan Kuppuswamy
Linux kernel developer


  reply	other threads:[~2019-08-01 21:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 20:46 [PATCH v4 0/7] Fix PF/VF dependency issue sathyanarayanan.kuppuswamy
2019-07-03 20:46 ` [PATCH v4 1/7] PCI/ATS: Fix pci_prg_resp_pasid_required() dependency issues sathyanarayanan.kuppuswamy
2019-07-03 20:46 ` [PATCH v4 2/7] PCI/ATS: Initialize PRI in pci_ats_init() sathyanarayanan.kuppuswamy
2019-08-01 21:09   ` Keith Busch
2019-08-01 21:21     ` sathyanarayanan kuppuswamy [this message]
2019-08-01 21:26       ` Keith Busch
2019-07-03 20:46 ` [PATCH v4 3/7] PCI/ATS: Initialize PASID " sathyanarayanan.kuppuswamy
2019-07-03 20:46 ` [PATCH v4 4/7] PCI/ATS: Add PRI support for PCIe VF devices sathyanarayanan.kuppuswamy
2019-07-03 20:46 ` [PATCH v4 5/7] PCI/ATS: Add PASID " sathyanarayanan.kuppuswamy
2019-07-03 20:46 ` [PATCH v4 6/7] PCI/ATS: Disable PF/VF ATS service independently sathyanarayanan.kuppuswamy
2019-07-03 20:46 ` [PATCH v4 7/7] PCI: Skip Enhanced Allocation (EA) initialization for VF device sathyanarayanan.kuppuswamy

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=d825feec-f6ca-30b8-3c7f-fb94e2e13499@linux.intel.com \
    --to=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=ashok.raj@intel.com \
    --cc=bhelgaas@google.com \
    --cc=kbusch@kernel.org \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /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

Powered by JetHome