xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Chao Gao <chao.gao@intel.com>
Cc: "Tim Deegan" <tim@xen.org>, "Kevin Tian" <kevin.tian@intel.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"George Dunlap" <George.Dunlap@eu.citrix.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, "Jan Beulich" <JBeulich@suse.com>,
	"Crawford Eric R" <Eric.R.Crawford@intel.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v10] VT-d: use correct BDF for VF to search VT-d unit
Date: Mon, 28 Aug 2017 15:26:47 +0800	[thread overview]
Message-ID: <20170828072643.GA18720@op-computing> (raw)
In-Reply-To: <59A3ED720200007800174569@prv-mh.provo.novell.com>

On Mon, Aug 28, 2017 at 02:16:18AM -0600, Jan Beulich wrote:
>>>> On 28.08.17 at 04:42, <chao.gao@intel.com> wrote:
>> When SR-IOV is enabled, 'Virtual Functions' of a 'Physical Function'
>> are under the scope of the same VT-d unit as the 'Physical Function'.
>> A 'Physical Function' can be a 'Traditional Function' or an ARI
>> 'Extended Function'. And furthermore, 'Extended Functions' on an
>> endpoint are under the scope of the same VT-d unit as the 'Traditional
>> Functions' on the endpoint. To search VT-d unit for a VF, if its PF
>> isn't an extended function, the BDF of PF should be used. Otherwise
>> the BDF of a traditional function in the same device with the PF
>> should be used.
>> 
>> Current code uses PCI_SLOT() to recognize an ARI 'Extended Funcion'.
>> But it is conceptually wrong w/o checking whether PF is an extended
>> function and would lead to match VFs of a RC integrated PF to a wrong
>> VT-d unit.
>> 
>> This patch overrides VF 'is_extfn' field and uses this field to
>> indicate whether the PF of this VF is an extended function. The field
>> helps to use correct BDF to search VT-d unit.
>> 
>> Reported-by: Crawford, Eric R <Eric.R.Crawford@intel.com>
>> Signed-off-by: Chao Gao <chao.gao@intel.com>
>
>Acked-by: Jan Beulich <jbeulich@suse.com>
>albeit ...
>
>> --- a/xen/drivers/passthrough/vtd/dmar.c
>> +++ b/xen/drivers/passthrough/vtd/dmar.c
>> @@ -211,15 +211,15 @@ struct acpi_drhd_unit *acpi_find_matched_drhd_unit(const struct pci_dev *pdev)
>>      if ( pdev == NULL )
>>          return NULL;
>>  
>> -    if ( pdev->info.is_extfn )
>> +    if ( pdev->info.is_virtfn )
>>      {
>> -        bus = pdev->bus;
>> -        devfn = 0;
>> +        bus = pdev->info.physfn.bus;
>> +        devfn = (!pdev->info.is_extfn) ? pdev->info.physfn.devfn : 0;
>
>... if I end up committing this and if I don't forget, I'll likely take the
>liberty to remove the pointless parentheses here.
>

Hi, Eric.

Could you test this patch again and give your Tested-by if it fixes the
problem you reported?

Thanks
Chao

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-08-28  7:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28  2:42 [PATCH v10] VT-d: use correct BDF for VF to search VT-d unit Chao Gao
2017-08-28  5:56 ` Tian, Kevin
2017-08-28  8:16 ` Jan Beulich
2017-08-28  7:26   ` Chao Gao [this message]
2017-08-31  0:51     ` Crawford, Eric R

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=20170828072643.GA18720@op-computing \
    --to=chao.gao@intel.com \
    --cc=Eric.R.Crawford@intel.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=kevin.tian@intel.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).