linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hao Zheng <yinhe@linux.alibaba.com>
To: bhelgaas@google.com
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	nanhai.zou@linux.alibaba.com, Hao Zheng <yinhe@linux.alibaba.com>,
	Quan Xu <quan.xu0@linux.alibaba.com>
Subject: [PATCH 1/1] PCI/IOV: fix cfg_size setting for multiple vfio-devices
Date: Fri, 31 May 2019 11:28:02 +0800	[thread overview]
Message-ID: <1559273282-38802-1-git-send-email-yinhe@linux.alibaba.com> (raw)

When there are multiple vfio devices, only the cfg_size of first
vfio device can be correctly set to 4096. The cfg_size of other
vfio devices are incorrectly set to 256.

This will cause an error when live migrating a virtual machine with
vfio devices to multiple destinations. Fix this by setting correct
pcie_cap field before cfg_size initialize.

Signed-off-by: Hao Zheng <yinhe@linux.alibaba.com>
Signed-off-by: Quan Xu <quan.xu0@linux.alibaba.com>
cc: Zou Nanhai <nanhai.zou@linux.alibaba.com>
---
 drivers/pci/iov.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 3aa115e..239fad1 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -133,6 +133,7 @@ static void pci_read_vf_config_common(struct pci_dev *virtfn)
 	pci_read_config_word(virtfn, PCI_SUBSYSTEM_ID,
 			     &physfn->sriov->subsystem_device);
 
+	set_pcie_port_type(virtfn);
 	physfn->sriov->cfg_size = pci_cfg_space_size(virtfn);
 }
 
-- 
1.8.3.1


                 reply	other threads:[~2019-05-31  3:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1559273282-38802-1-git-send-email-yinhe@linux.alibaba.com \
    --to=yinhe@linux.alibaba.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=nanhai.zou@linux.alibaba.com \
    --cc=quan.xu0@linux.alibaba.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;
as well as URLs for NNTP newsgroup(s).