public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Zhoujian (jay)" <jianjay.zhou@huawei.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Huangweidong (C)" <weidong.huang@huawei.com>,
	"liujunjie (A)" <liujunjie23@huawei.com>,
	"wangxin (U)" <wangxinxin.wang@huawei.com>,
	"wujing (O)" <wujing42@huawei.com>,
	"dengkai (A)" <dengkai1@huawei.com>
Subject: Re: Question about hotplugging NIC devices to an empty pci-bridge
Date: Thu, 20 Dec 2018 12:09:18 +0000	[thread overview]
Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503F462A65@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <B2D15215269B544CADD246097EACE7473B8E642B@DGGEMM528-MBX.china.huawei.com>

Maybe you can use EFI_PCI_HOT_PLUG_INIT_PROTOCOL to reserve some resource.

See MdePkg\Include\Protocol\PciHotPlugInit.h

Thank you
Yao Jiewen

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Zhoujian (jay)
> Sent: Thursday, December 20, 2018 7:34 PM
> To: edk2-devel@lists.01.org
> Cc: Huangweidong (C) <weidong.huang@huawei.com>; liujunjie (A)
> <liujunjie23@huawei.com>; wangxin (U) <wangxinxin.wang@huawei.com>;
> wujing (O) <wujing42@huawei.com>; dengkai (A) <dengkai1@huawei.com>
> Subject: [edk2] Question about hotplugging NIC devices to an empty
> pci-bridge
> 
> Hi all,
> 
> The issue occurs when I started a virtual machine in UEFI way by libvirt on
> qemu-kvm platform, the vm is configured with 8 pci-bridges on root bus0. I
> hotplug a device like virtual nic to an empty pci-bridge which has no device
> connected. Login the vm, I can see the device by "lspci"", but it didn't show
> by "ifconfig -a". Dmesg shows like below:
> pci 0000:04:01.0: BAR 0: no space for [mem size 0x00010000 64bit pref] pci
> 0000:04:01.0: BAR 0: failed to assign [mem size 0x00010000 64bit pref] pci
> 0000:04:01.0: BAR 3: no space for [mem size 0x00004000 64bit pref] pci
> 0000:04:01.0: BAR 3: failed to assign [mem size 0x00004000 64bit pref]
> 
> Reboot the vm, everything turns back to normal and I can see the new
> hotplugged nic by "ifconfig -a".
> 
> Use the OVMF compiling from latest edk2 source code, the same problem
> arises.
> 
> So, my questions are:
> 1) the generic PCI bus driver in edk2 does not allocate IO and/or MMIO for a
> bridge if there is no device behind the bridge that consume that kind of
> resource?
> 2) What's the purpose of this strategy?
> 3) Why don't allocate resource to all bridges like seabios?
> 4) Is there any switch for me to turn off this constraint so that every
> pci-bridge including empty ones can be assigned IO and memory window?
> Otherwise, each time I hotplug a device to empty pci-bridge, a reboot
> operation should be implemented to use the device?
> 
> Any help will be appreciated, Thanks!
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


  reply	other threads:[~2018-12-20 12:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-20 11:34 Question about hotplugging NIC devices to an empty pci-bridge Zhoujian (jay)
2018-12-20 12:09 ` Yao, Jiewen [this message]
2018-12-20 13:03   ` Zhoujian (jay)
2018-12-21  3:04   ` Zhoujian (jay)
2018-12-21  5:27     ` Yao, Jiewen
2018-12-21 13:50       ` Zhoujian (jay)
2018-12-25 10:18         ` Laszlo Ersek
2018-12-26  6:04           ` Zhoujian (jay)

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-list 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=74D8A39837DF1E4DA445A8C0B3885C503F462A65@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /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