From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=45.249.212.255; helo=huawei.com; envelope-from=jianjay.zhou@huawei.com; receiver=edk2-devel@lists.01.org Received: from huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D304D21163248 for ; Thu, 20 Dec 2018 05:03:08 -0800 (PST) Received: from DGGEMM406-HUB.china.huawei.com (unknown [172.30.72.54]) by Forcepoint Email with ESMTP id 70C1ADBE5CC0E for ; Thu, 20 Dec 2018 21:03:05 +0800 (CST) Received: from DGGEMM424-HUB.china.huawei.com (10.1.198.41) by DGGEMM406-HUB.china.huawei.com (10.3.20.214) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 20 Dec 2018 21:03:05 +0800 Received: from DGGEMM528-MBX.china.huawei.com ([169.254.8.187]) by dggemm424-hub.china.huawei.com ([10.1.198.41]) with mapi id 14.03.0415.000; Thu, 20 Dec 2018 21:03:00 +0800 From: "Zhoujian (jay)" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" CC: "Huangweidong (C)" , "liujunjie (A)" , "wangxin (U)" , "wujing (O)" , "dengkai (A)" Thread-Topic: Question about hotplugging NIC devices to an empty pci-bridge Thread-Index: AdSYV9UwZTLM/IqZQ0GOAvPwlakpvgABN3NwAAHVLzA= Date: Thu, 20 Dec 2018 13:03:00 +0000 Message-ID: References: <74D8A39837DF1E4DA445A8C0B3885C503F462A65@shsmsx102.ccr.corp.intel.com> In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503F462A65@shsmsx102.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.177.19.14] MIME-Version: 1.0 X-CFilter-Loop: Reflected Subject: Re: Question about hotplugging NIC devices to an empty pci-bridge X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 13:03:09 -0000 Content-Language: zh-CN Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Jiewen, Thank for your quick response, I'll have a try. Regards, Jay Zhou > -----Original Message----- > From: Yao, Jiewen [mailto:jiewen.yao@intel.com] > Sent: Thursday, December 20, 2018 8:09 PM > To: Zhoujian (jay) ; edk2-devel@lists.01.org > Cc: Huangweidong (C) ; liujunjie (A) > ; wangxin (U) ; wujin= g (O) > ; dengkai (A) > Subject: RE: Question about hotplugging NIC devices to an empty pci-bridg= e >=20 > Maybe you can use EFI_PCI_HOT_PLUG_INIT_PROTOCOL to reserve some resource= . >=20 > See MdePkg\Include\Protocol\PciHotPlugInit.h >=20 > Thank you > Yao Jiewen >=20 > > -----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) ; liujunjie (A) > > ; wangxin (U) ; > > wujing (O) ; dengkai (A) > > 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 li= ke > 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 win= dow? > > 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