From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 61715211A459D for ; Thu, 20 Dec 2018 04:09:25 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2018 04:09:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,376,1539673200"; d="scan'208";a="131555116" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 20 Dec 2018 04:09:22 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 20 Dec 2018 04:09:21 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 20 Dec 2018 04:09:21 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.182]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.201]) with mapi id 14.03.0415.000; Thu, 20 Dec 2018 20:09:19 +0800 From: "Yao, Jiewen" To: "Zhoujian (jay)" , "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/IqZQ0GOAvPwlakpvgABN3Nw Date: Thu, 20 Dec 2018 12:09:18 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503F462A65@shsmsx102.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmZhYWViZTktY2M3MC00ODA0LWI3MDktNjk1MjhkMWRmMjk4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiaFZqS3ZucE1ETnpPVlFhc3QxVktFU2ZCSlBuK0c0MWhqQmZLTWJOVUR6M3JENGZrRmNyem9jUnBjY250UGFpYiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: request-justification,no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 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 12:09:25 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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) ; liujunjie (A) > ; wangxin (U) ; > wujing (O) ; dengkai (A) > Subject: [edk2] Question about hotplugging NIC devices to an empty > pci-bridge >=20 > Hi all, >=20 > 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 dev= ice > 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] pc= i > 0000:04:01.0: BAR 0: failed to assign [mem size 0x00010000 64bit pref] pc= i > 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] >=20 > Reboot the vm, everything turns back to normal and I can see the new > hotplugged nic by "ifconfig -a". >=20 > Use the OVMF compiling from latest edk2 source code, the same problem > arises. >=20 > So, my questions are: > 1) the generic PCI bus driver in edk2 does not allocate IO and/or MMIO fo= r 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? >=20 > Any help will be appreciated, Thanks! > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel