Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Nirmal Patel <nirmal.patel@linux.intel.com>
To: <lpieralisi@kernel.org>, <linux-pci@vger.kernel.org>,
	<paul.e.luse@intel.com>
Subject: Re: [PATCH v4] PCI: vmd: Disable MSI remap only for low MSI count
Date: Thu, 25 Apr 2024 14:10:31 -0700	[thread overview]
Message-ID: <20240425141031.000019d4@linux.intel.com> (raw)
In-Reply-To: <20240418153121.291534-1-nirmal.patel@linux.intel.com>

On Thu, 18 Apr 2024 11:31:21 -0400
Nirmal Patel <nirmal.patel@linux.intel.com> wrote:

> VMD MSI remapping is disabled by default for all the CPUs with 28c0
> VMD deviceID. We used to disable remapping because drives supported
> more vectors than the VMD so the performance was better without
> remapping. Now with CPUs that support more than 64 (128 VMD MSIx
> vectors for gen5) we no longer need to disable this feature.
> 
> Note, pci_msix_vec_count() failure is translated to ENODEV per typical
> expectations that drivers may return ENODEV when some driver-known
> fundamental detail of the device is missing.
> 
> Signed-off-by: Nirmal Patel <nirmal.patel@linux.intel.com>
> ---
> v1->v2: Updating commit message.
> v2->v3: Use VMD MSI count instead of cpu count.
> v3->v4: Updating commit message.
> ---
>  drivers/pci/controller/vmd.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/pci/controller/vmd.c
> b/drivers/pci/controller/vmd.c index 769eedeb8802..ba63af70bb63 100644
> --- a/drivers/pci/controller/vmd.c
> +++ b/drivers/pci/controller/vmd.c
> @@ -34,6 +34,8 @@
>  #define MB2_SHADOW_OFFSET	0x2000
>  #define MB2_SHADOW_SIZE		16
>  
> +#define VMD_MIN_MSI_VECTOR_COUNT 64
> +
>  enum vmd_features {
>  	/*
>  	 * Device may contain registers which hint the physical
> location of the @@ -807,13 +809,20 @@ static int
> vmd_enable_domain(struct vmd_dev *vmd, unsigned long features) 
>  	sd->node = pcibus_to_node(vmd->dev->bus);
>  
> +	vmd->msix_count = pci_msix_vec_count(vmd->dev);
> +	if (vmd->msix_count < 0)
> +		return -ENODEV;
> +
>  	/*
>  	 * Currently MSI remapping must be enabled in guest
> passthrough mode
>  	 * due to some missing interrupt remapping plumbing. This is
> probably
>  	 * acceptable because the guest is usually CPU-limited and
> MSI
>  	 * remapping doesn't become a performance bottleneck.
> +	 * Disable MSI remapping only if supported by VMD hardware
> and when
> +	 * VMD MSI count is less than or equal to minimum MSI count.
>  	 */
>  	if (!(features & VMD_FEAT_CAN_BYPASS_MSI_REMAP) ||
> +	    vmd->msix_count > VMD_MIN_MSI_VECTOR_COUNT ||
>  	    offset[0] || offset[1]) {
>  		ret = vmd_alloc_irqs(vmd);
>  		if (ret)

Gentle ping!

Thanks
nirmal

  reply	other threads:[~2024-04-25 21:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18 15:31 [PATCH v4] PCI: vmd: Disable MSI remap only for low MSI count Nirmal Patel
2024-04-25 21:10 ` Nirmal Patel [this message]
2024-04-26 22:39 ` Bjorn Helgaas
2024-05-07  0:39   ` Nirmal Patel
2024-05-08  1:46     ` Bjorn Helgaas

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=20240425141031.000019d4@linux.intel.com \
    --to=nirmal.patel@linux.intel.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=paul.e.luse@intel.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