CN101226515B - Method and apparatus for distributing resource of hot-plug bus interface - Google Patents

Method and apparatus for distributing resource of hot-plug bus interface Download PDF

Info

Publication number
CN101226515B
CN101226515B CN 200810006678 CN200810006678A CN101226515B CN 101226515 B CN101226515 B CN 101226515B CN 200810006678 CN200810006678 CN 200810006678 CN 200810006678 A CN200810006678 A CN 200810006678A CN 101226515 B CN101226515 B CN 101226515B
Authority
CN
Grant status
Grant
Patent type
Prior art keywords
bus interface
resources
bridge
resource
hot swap
Prior art date
Application number
CN 200810006678
Other languages
Chinese (zh)
Other versions
CN101226515A (en )
Inventor
张巍
肖建龙
陈华
Original Assignee
成都市华为赛门铁克科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Grant date

Links

Abstract

The invention discloses a resource distribution method of hot plug bus interface and a relative device, belonging to the computer bus interface technical field, which resolves the defect of prior hot plug bus interface as insufficient preformed resource. The invention comprises when the hot plug bus interface is plugged into device, according to the demand of the device, distributing resource without affected by preformed resource to confirm the normal operation of the device. The invention is mainly used in PCIE interface, with wide application bus interfaces supporting hot plug.

Description

热插拔总线接口的资源分配方法及装置 A resource allocation method and apparatus of the hot swap bus interface

技术领域 FIELD

[0001 ] 本发明涉及计算机的总线接口领域,特别涉及在计算机的总线接口上热插拔相应的外部设备后,操作系统对该外部设备分配资源的方法及装置。 [0001] The field relates to computer bus interfaces of the present invention, in particular the hot-swappable respective external device on the bus interface of the computer, operating system, method and apparatus for allocating resources to the external device is directed.

[0002] 背景技术 [0002] BACKGROUND OF THE INVENTION

[0003] 普遍使用的计算机内部总线主要包括加速图形端口(AcceleratedGraphicsPort,AGP)总线和外部设备互连(Peripheral Component Interconnect,PCI)总线。 [0003] The widespread use of computers an internal bus includes an accelerated graphics port (AcceleratedGraphicsPort, AGP) bus, and Peripheral Component Interconnect (Peripheral Component Interconnect, PCI) bus. 在现有PCI总线的基础上,开发出了新的PCI Express(PCIE)总线,PCIE接口可以从控制PCIE总线的根联合体直接引出,也可以通过PCIE桥(SWITCH)连接到PCIE总线的根联合体;在一个PCIE桥上可以设置多个PCIE接口,以便插接多个外部设备。 On the basis of the conventional PCI bus, the development of a new PCI Express (PCIE) bus, PCIE interface may be drawn directly from the root complex control PCIE bus, may be connected to the root joint PCIE PCIE bus by a bridge (the SWITCH) thereof; PCIE bridge may be provided in a plurality PCIE interface, a plurality of external devices to the plug. 在PCIE规范中定义了PCIE热插拔的标准流程,PCIE热插拔一般是在线更换外部设备时才用到的。 Defines a standard procedure in the PCIE PCIE hot-pluggable specification, PCIE hot swap is generally only used to replace the external device is online. [0004] 为了实现PCIE总线的热插拔功能,在系统初始化时,基本输入输出系统(BasicInput Output System,BIOS)或操作系统(Operating System,OS)为每个没有插接设备的SLOT都预留固定大小的资源,包括地址空间资源,使得系统正常运行过程中,如果在空闲的SLOT中插入设备,系统就会将预留的地址空间资源,分配给这个刚插入的外部设备,以保证不需要重新启动系统就可以正常使用该刚接入的外部设备。 [0004] In order to achieve the PCIE bus hot-swap capability, during system initialization, the basic input output system (BasicInput Output System, BIOS) or OS (Operating System, OS) for each SLOT is no docking device have been reserved fixed size resources including resource address space, such that during normal system operation, if the device is inserted in the idle SLOT, the system resources will be reserved for the address space, assigned to the newly inserted external device does not need to ensure that restart the system can normally use just the external device access.

[0005] 在实现本发明的过程中,发明人经过研究发现: [0005] During the implementation of the present invention, the inventor has found that:

[0006] I、由于现有系统是在PCIE插槽中没有插入设备时,就为该PCIE插槽预留资源,如果系统初始化时,给空闲PCIE插槽预留的资源不够时,就无法提供后插入设备运行所需要的资源,例如:地址空间资源,造成后插入设备无法正常运行。 [0006] I, as the existing system is inserted into the device when not in PCIE slot, PCIE slot to reserve resources for that, if the system is initialized, the PCIE slot reserved for idle resources is not enough, can not provide after inserting the resources needed to run the equipment, such as: address space resources, resulting in the insertion device is not working properly.

[0007] 2、如果将某个PCIE插槽中的设备拔出后,换上其他设备插入到该PCIE插槽,可能会由于后插入的设备和以前的设备所需要的资源不同,使得后插入的设备不能正常运行,无法完成在线更换设备。 [0007] 2, if the device in a pulled PCIE slot, put another device into the PCIE slot, may be due to different resources after inserting the device and the device previously required, such that the inserted the equipment does not function properly, unable to complete the online replacement of equipment.

[0008] 3、一般情况下,由于设备升级后所需要的资源(主要是地址空间资源)会相对增力口,所以现有的PCIE热插拔技术无法支持设备的热升级,必须在设备完成升级后重新启动系统,才能够使得升级后的设备能够使用。 [0008] 3, under normal circumstances, due to the resources needed to upgrade the equipment (mainly address space resources) will be relatively boosting the mouth, so the existing technology can not support hot swap PCIE thermal equipment upgrades, equipment must be completed restart the system after the upgrade to be able to make the upgraded equipment can be used. 例如:网卡的驱动在线升级完成后,系统会提醒用户重启系统或者自动重启系统,才能使用升级后的网卡驱动;如果不重启系统,则只能使用升级之前的网卡驱动。 For example: the driver card online upgrade is complete, the system will automatically alert the user to reboot the system or reboot the system to use the upgraded network card driver; if you do not restart the system, you can only use the network card driver before upgrading.

[0009] 发明内容 [0009] SUMMARY OF THE INVENTION

[0010] 本发明的实施例提供一种热插拔总线接口的资源分配方法及装置,能够按需分配所述热插拔总线接口所插接设备运行的资源。 Example [0010] The present invention provides a hot swap bus interface resource allocation method and apparatus can be run on demand of the hot swap bus interface resource device docked.

[0011] 为达到上述目的,本发明的实施例采用如下技术方案: [0011] To achieve the above object, embodiments of the present invention adopts the following technical solutions:

[0012] 一种热插拔总线接口的资源分配方法,包括: [0012] A resource allocation method for hot swap bus interface, comprising:

[0013] 检测到热插拔总线接口上插入设备; [0013] bus interface detects the hot plug inserted into the apparatus;

[0014] 查找为所述热插拔总线接口预留的资源; [0014] The hot swap bus interface to find the reserved resources;

[0015] 判断所述预留资源是否满足所检测到设备的资源需求; [0015] It is determined whether the reserved resource to satisfy the resource requirements of the detected device;

[0016] 如果所述预留资源不满足所检测到设备的资源需求,则判断所述热插拔总线接口是否通过总线接口桥与根联合体连接; [0016] If the reserved resources do not satisfy the resource requirements of the device detected, it is determined whether or not the hot swap bus interface connected to the root complex through the bus interface bridge;

[0017] 若所述热插拔总线接口通过总线接口桥与根联合体连接,停止所述总线接口桥上的原有设备;并从剩余资源中为所述总线接口桥上的所有设备分配资源; [0017] If the hot swap bus interface and the bridge via the bus interface connected to the root complex, original equipment stops said bus interface bridge; and for all remaining resources from the resources allocated to the bus interface bridge devices ;

[0018] 若所述热插拔总线接口直接与根联合体连接,则从剩余资源中为所检测到的设备分配资源。 [0018] If the hot swap bus interface directly connected to the root complex, from the remaining resources in the resource allocation for device detected.

[0019] 一种热插拔总线接口的资源分配装置,包括: [0019] A hot swap bus interface resource allocation apparatus, comprising:

[0020] 检测模块,用于检测热插拔总线接口上插入设备; [0020] detection means for detecting a hot plug into the device bus interface;

[0021] 资源分配模块,用于为检测到的设备分配资源; [0021] resource allocation module for allocating resources for the device detected;

[0022] 查找模块,用于查找为所述热插拔总线接口预留的资源; [0022] The searching module configured to search for the hot swap bus interface of the reserved resources;

[0023] 判断模块,用于判断所述预留资源是否满足所检测到设备的资源需求; [0023] determination means for determining whether the reserved resources to meet the resource requirements of the device is detected;

[0024] 附图说明 [0024] BRIEF DESCRIPTION OF DRAWINGS

[0025] 如果所述预留资源不满足所检测到设备的资源需求,所述判断模块进一步判断所述热插拔总线接口是否通过总线接口桥与根联合体连接; [0025] If the reserved resource does not meet resource requirements of the detected device, said determination module further determines whether the hot swap bus interface connected via a bus interface to bridge the root complex;

[0026]以及, [0026] and,

[0027]用于在所述热插拔总线接口直接与根联合体连接时从剩余资源中为所检测到的设备分配资源的模块;和, [0027] The module allocation of resources from the remaining resources for the detected device when the hot swap bus interface for connection directly to the root complex; and,

[0028] 用于在所述热插拔总线接口通过总线接口桥与根联合体连接时停止所述总线接口桥上的原有设备,并从剩余资源中为所述总线接口桥上的所有设备分配资源的模块。 All devices [0028] for stopping the hot swap bus interface connected via a bus interface to bridge the root complex device the original bridge bus interface, and from the remaining resources of the bridge bus interface resource allocation module.

[0029] 具体实施方式 [0029] DETAILED DESCRIPTION

[0030] 由上述技术方案所描述的本发明的实施例,在检测到热插拔总线接口上插入设备后,首先要查找为该热插拔总线接口预留的资源,如果预留资源不能够满足所检测到设备的资源需求时,再为该检测到的设备重新分配资源,重新分配的资源是运行该检测到的设备所需的资源,并不限定于系统预留的资源。 [0030] Example embodiments of the present invention by the above described aspect, after detecting the hot swap bus interface into the device, first locate reserved for the hot swap bus interface resources, if the resource can not be reserved is satisfied detected device resource requirements, resource re-allocation of resources for the detected device, the resource reallocation is needed to run the equipment is detected, the system is not limited to the reserved resources. 当系统没有为该热插拔总线接口预留资源,或者系统预留的资源不满足所插接设备的资源需求时,本发明的实施例可以保证热插拔总线接口上插接的设备正常运行,不会导致所插接的设备无法正常运行。 When the system does not reserve resources for the hot swap bus interface, the device or system resource requirements of the reserved resources do not satisfy the plug, embodiments of the present invention can ensure hot-plug connector on the normal operation of the bus interface device will not result in the insertion of the device is not working properly.

[0031] 图I为本发明热插拔总线接口的资源分配方法实施例I的流程图; [0031] FIG. I present hot swap bus interface resource allocation method flow diagram of the embodiment of the invention I;

[0032] 图2为本发明热插拔总线接口的资源分配方法实施例2的流程图; [0032] FIG. 2 Hot Plug bus interface resource allocation method of flowchart 2 embodiment of the invention;

[0033] 图3为通过总线接口桥连接的热插拔总线接口插接框图; [0033] FIG. 3 is a block diagram of the bus interface plug hot plug connected by a bridge bus interface;

[0034] 图4为本发明热插拔总线接口的资源分配装置实施例的原理图。 Principle of an embodiment of a resource allocation apparatus of the hot swap bus interface [0034] FIG. 4 of the present invention.

[0035] 本发明热插拔总线接口的资源分配方法及装置的实施例,在检测到热插拔总线接口插入设备,或者热插拔总线接口上的设备更新后,按照该检测到的设备的运行需求分配资源,以保证热插拔总线接口插入的设备能正常运行,或者热插拔总线接口上的设备更新后能正常运行。 [0035] Example embodiments of a resource allocation method and apparatus of the present invention, hot swap bus interface, upon detecting the hot swap bus interface into the device, or update the hot-plugged device bus interface, according to the detecting device operational requirements allocate resources to guarantee the hot swap bus interface device can operate normally inserted, updated, or the hot-plugged device on the bus interface can operate normally. 下面结合附图,对本发明热插拔总线接口的资源分配方法及装置的实施例进行详细描述,本发明实施例以声卡和网卡为例进行说明。 Below with the accompanying drawings, embodiments of a resource allocation method and apparatus of the hot swap bus interface of the present invention will be described in detail, embodiments of the present invention and a sound card, for example to be described below. 本发明实施例中说明了在计算机中已经有独立声卡的情况下,不关闭计算机插入网卡的实施过程,但是本发明实施例中独立声卡和网卡也可以是其他类型的接口卡。 Embodiments of the present invention described in a computer sound card has standalone case, the computer does not turn off the implementation process of inserting the card, but the embodiment is independent sound card and embodiments of the present invention may be any other type of interface card.

[0036] 实施例I : [0036] Example I:

[0037] 本实施例中以采用PCIE接口(外设组件互连扩展接口)的计算机为例,该计算机的PCIE接口上已经安装了一块独立声卡,再插接一块网卡,由于该PCIE接口支持热插拔,所以本实施例是在计算机正在运行的情况下插入网卡的。 [0037] In the present embodiment uses a PCIE interface (Peripheral Component Interconnect Interface) as an example of a computer, on the computer PCIE interface has been installed a separate sound card, then a card connector, since the thermal interface supports PCIE plug, the present embodiment is a network card inserted in the case where the computer is running. 该插入网卡的过程如图I所示,具体为: The card insertion process shown in FIG. I, in particular:

[0038] 101、在不关闭计算机的情况下,将网卡插到计算机主板上空闲的PCIE接口中。 [0038] 101, without turning off the computer, the card into the motherboard of a computer idle PCIE interface.

[0039] 102、检测到其中一个空闲的PCIE接口上插入了网卡。 [0039] 102, which detects the insertion of the card on a free PCIE interface.

[0040] 103、查找为该PCIE接口预留的资源,包括地址空间资源,如果计算机没有为该PCIE接口预留资源,用预留资源为空来表示。 [0040] 103, to find the resources reserved for the PCIE interface, including address space resources, if the computer does not reserve resources for PCIE interface, using the resources reserved to indicate blank.

[0041] 104、判断预留的地址空间资源是否满足网卡的资源需求;如果所述预留的地址空间资源满足所网卡的资源需求,则执行步骤105 ;如果预留的地址空间资源不满足网卡的资源需求,则执行步骤106。 [0041] 104, determines whether reserved address space resources to meet the resource requirements of the card; if the reserved address space resources to meet the resource requirements of the card, step 105; if the reserved address space resources does not satisfy the card resource requirements, proceed to step 106. 其中没有为PCIE接口预留资源的情况,属于预留的地址空间资源不能满足网卡的资源需求。 None of the resources set aside for the PCIE interface, address space resources belong to the reserved resources can not meet the needs of the network card.

[0042] 105、将预留的资源分配给所述网卡,并控制网卡开始运行,流程结束。 [0042] 105, the reserved resources will be allocated to the card and the control card starts operating, the flow ends.

[0043] 106、为检测到的网卡重新分配运行所需的资源。 [0043] 106, to detect the card reallocation of resources required to run.

[0044] 上述实施例中,如果为PCIE接口预留的资源无法满足插接设备的资源需求,则需要重新为设备分配资源,而不限定于系统预留的资源。 [0044] The above-described embodiment, if the PCIE interface is reserved resources can not meet the resource requirements of the docking device, it is necessary to re-allocate resources to the device, and not limited to the resources reserved by the system. 所以本发明的实施例可以保证PCIE接口上插接的设备正常运行,不会由于系统为该PCIE接口预留的资源不满足所插接设备的资源需求,而导致所插接的设备无法正常运行。 Therefore, embodiments of the present invention can ensure PCIE interface connector on the normal operation, since the resource requirements of the device is not reserved for the system PCIE interface resource does not meet the plug, the resulting plug the device out .

[0045] 实施例2 : [0045] Example 2:

[0046] 本实施例中以采用PCIE接口(外设组件互连扩展接口)的计算机为例,该计算机的PCIE接口上已经安装了一块独立声卡,但没有安装网卡,所以不能接入互联网,为了接入互联网,需要在计算机主板的PCIE接口上插接网卡,通过网卡将该计算机接入互联网。 [0046] In the present embodiment uses a computer PCIE interface (Peripheral Component Interconnect Interface) as an example, the PCIE interface the computer has installed a separate sound card, but the card is not installed, it can not access the Internet, in order access to the Internet, the need to plug in the computer's motherboard card PCIE interface, the computer connected to the Internet through the network card. 由于该PCIE接口支持热插拔,所以本实施例是在计算机正在运行的情况下插入网卡的。 Since the PCIE interface support hot swap, the present embodiment is a network card inserted in the case where the computer is running. 该插入网卡的过程如图2所示,具体为: The card insertion procedure shown in Figure 2, specifically:

[0047] 201、在不关闭计算机的情况下,将网卡插到计算机主板上空闲的PCIE接口中。 [0047] 201, without turning off the computer, the card into the motherboard of a computer idle PCIE interface.

[0048] 202、检测到其中一个空闲的PCIE接口上插入了网卡。 [0048] 202, which detects the insertion of the card on a free PCIE interface.

[0049] 203、查找为该PCIE接口预留的资源,包括地址空间资源,如果计算机没有为该PCIE接口预留资源,用预留资源为空来表示。 [0049] 203, to find the resources reserved for the PCIE interface, including address space resources, if the computer does not reserve resources for PCIE interface, using the resources reserved to indicate blank.

[0050] 204、判断预留的地址空间资源是否满足网卡的资源需求;如果所述预留的地址空间资源满足所网卡的资源需求,则执行步骤205;如果预留的地址空间资源不满足网卡的资源需求,则执行步骤206。 [0050] 204, determines whether reserved address space resources to meet the resource requirements of the card; if the reserved address space resources to meet the resource requirements of the card, step 205; if the reserved address space resources does not satisfy the card resource requirements, step 206 is performed. 其中没有为PCIE接口预留资源的情况,属于预留的地址空间资源不能满足网卡的资源需求。 None of the resources set aside for the PCIE interface, address space resources belong to the reserved resources can not meet the needs of the network card.

[0051] 205、将预留的资源分配给所述网卡,并控制网卡开始运行,流程结束。 [0051] 205, the reserved resources will be allocated to the card and the control card starts operating, the flow ends.

[0052] 206、判断该PCIE接口是否通过PCIE桥连接在根联合体上,如果该PCIE接口直接连接在根联合体上,则执行步骤207 ;如果该PCIE接口通过PCIE桥连接到根联合体上,则执行步骤211。 [0052] 206, it is determined whether or not the PCIE interface is connected to the root complex through PCIE bridge, if the PCIE interface directly connected to the root complex, step 207 is executed; if the interface is connected to the root complex PCIE PCIE bridge through , step 211 is executed.

[0053] 207、假如网卡所插接的PCIE接口直接连接在根联合体上,则要统计当前剩余的资源,包括系统的地址空间资源。 [0053] 207, if the card is inserted PCIE interface directly connected to the root complex, this will have statistical remaining resources, including resources of the system address space.

[0054] 208、判断当前剩余的资源是否满足网卡的资源需求,如果当前剩余的资源不满足网卡的资源需求,则执行步骤209 ;如果当前剩余的资源满足网卡的资源需求,则执行步骤210。 [0054] 208, it is determined whether the current remaining resources to meet the resource requirements of the card, if the current remaining resource does not meet resource requirements of the card, step 209; if the current remaining resources to meet the resource requirements of the card, step 210 is executed. [0055] 209、不为网卡分配资源,并且不启动网卡,本次插入网卡失败,流程结束。 [0055] 209 is not allocated resources for the network card, and does not start the card, the card is inserted into this fails, the process ends.

[0056] 210、根据网卡的资源需求为其分配资源,并且启动网卡,那么该计算机就可以通过该网卡上网了。 [0056] 210, according to the resource allocation of resources for the needs of the network card, network card and start, then the computer can pass the card online.

[0057] 211、如图3所示,假如原有的声卡和刚插入的网卡在同一个PCIE桥下的PCIE接口中,则需要停止该声卡;如果同一个PCIE桥下还有其他的设备,也需要一并停止。 [0057] 211, as shown, if the original card and the card just inserted in the same PCIE PCIE interface under the bridge, you need to stop the card 3; the same PCIE bridge if there are other devices, together we need to stop.

[0058] 212、计算声卡的资源需求和网卡的资源需求。 [0058] 212, resource requirements, resource requirements and the network card to calculate sound card.

[0059] 213、统计计算机当前剩余的资源,包括地址空间资源。 [0059] 213, the remainder of the current statistical computer resources, including the address space resources.

[0060] 214、判断当前剩余的资源是否满足声卡和网卡的资源需求,如果当前剩余的资源不满足声卡和网卡的资源需求,则执行步骤215;如果当前剩余的资源满足声卡和网卡的资源需求,则执行步骤216。 [0060] 214, it is determined whether the current remaining resources to meet the resource requirements of the sound card and, if the current resource remaining resource demand and does not satisfy the sound card, step 215; if the current remaining resource needs and resources to meet sound card , step 216 is executed. [0061] 215、将声卡恢复到运行状态,但不为网卡分配资源,并且不启动网卡,说明本次插入网卡失败,流程结束。 [0061] 215, to restore the operating state to the sound card, but do not assign resources for the card, and does not start the card, the card is inserted into this description fails, the process ends.

[0062] 216、根据声卡和网卡的资源需求为其分配资源,并且启动声卡和网卡,那么该计算机就可以通过该网卡上网了;如果分配资源不成功,则只恢复到运行状态,但不启动网卡,说明本次插入网卡失败,流程结束。 [0062] 216, according to resource needs sound card and network card assigned resources, and initiate a sound card and network card, then the computer can be online by the card; if unsuccessful allocation of resources, only to resume running, but does not start card, insert the card explanation of this failure, the process ends.

[0063] 上述实施例为热插拔总线接口的资源分配方法的具体分配过程,其中206步可以放在202步和203步之间。 [0063] The resource allocation method of Example Hot Plug bus interface specific allocation process, which can be placed between steps 206 and 203 step 202 step.

[0064] 上述实施例中,如果为PCI E接口预留的资源无法满足插接设备的资源需求,则需要重新为设备分配资源,而不限定于系统预留的资源。 [0064] The above-described embodiment, if the interface is a PCI E reserved resources can not meet the resource requirements docking device, it is necessary to re-allocate resources to the device, and not limited to the resources reserved by the system. 所以本发明的实施例可以保证PCIE接口上插接的设备正常运行,不会由于系统为该PCIE接口预留的资源不满足所插接设备的资源需求,而导致所插接的设备无法正常运行。 Therefore, embodiments of the present invention can ensure PCIE interface connector on the normal operation, since the resource requirements of the device is not reserved for the system PCIE interface resource does not meet the plug, the resulting plug the device out .

[0065] 同样本发明实施例还适用于在更换设备和设备升级的情况,例如:将原来的普通网卡更换成无线网卡后,由于无线网卡需要的资源与普通网卡所需的资源不同,所以,在插入无线网卡后,本发明热插拔总线接口的资源分配方法的实施例,在原先资源不能满足无线网卡资源需求的情况下,重新为无线网卡分配资源,以确保无线网卡能正常工作。 [0065] Also the present invention is also applicable to the embodiment of the device and in the case of replacement of equipment upgrades, for example: after the original card replaced the ordinary wireless LAN, since the wireless card resources required common resources and needs of different cards, so that, after the wireless card is inserted, the embodiment of the resource allocation method of the present invention, hot swap bus interface, in a case where the original radio resources can not meet the resource requirements of the card, wireless card reallocate resources, to ensure that the wireless card can work.

[0066] 由于网卡的驱动程序升级时需要暂时将网卡停止,当驱动程序升级后,需要重新启动网卡,这相当于插入网卡的操作,所以,如果将网卡的驱动程序在线升级后,造成该PCIE接口的资源无法满足升级后的网卡的资源需求,本发明的实施例也会重新分配资源。 [0066] due to the network card driver upgrade card will need to temporarily stop, when the driver upgrade, you need to restart the network card, which is equivalent to the operation insert the card, so if the driver for your card online upgrade, causing the PCIE the resource interface card can not meet the resource requirements upgraded, embodiments of the present invention will be re-allocation of resources.

[0067] 实施例3 : [0067] Example 3:

[0068] 本实施例提供了实现热插拔总线接口的资源分配方法的装置,如图4所示,具体包括: [0068] The present embodiment provides an apparatus resource allocation method implemented hot swap bus interface, shown in Figure 4, comprises:

[0069] 检测模块,用于检测热插拔总线接口上插入设备,当网卡插入到PCIE接口中后,该检测模块通过连接到PCIE接口的信号线检测到该网卡。 [0069] detection means for detecting a hot plug into the device bus interface, when the interface card is inserted into the PCIE, the detection module detects the PCIE interface connected to the card via the signal line.

[0070] 查找模块,用于查找为所述热插拔总线接口预留的资源,检测模块检测到网卡后,启动该查找模块查找为该PCIE接口预留的资源。 [0070] searching module, for finding the hot swap bus interface to the reserved resource, the detection module detects the card, start the lookup module looks up resources reserved for the PCIE interface.

[0071] 判断模块,用于判断所述预留资源是否满足网卡的资源需求。 [0071] determination means for determining whether the reserved resources to meet the resource requirements of the card.

[0072] 资源分配模块,用于为检测到的设备分配运行所需的资源,如果预留资源满足网卡的资源需求,则直接为网卡分配资源,并启动网卡,这样就可以通过网卡接入互联网了。 [0072] The resource allocation module for allocating resources needed for the device to run the test, if the reserved resources to meet the resource requirements of the card, the card directly to allocate resources, and starts the card, so the card can access the Internet through the a.

[0073] 如果预留资源不满足网卡的资源需求,则该判断模块还需要分析该网卡所插接的PCIE接口是直接连接在根联合体上,还是通过PCIE桥连接到根联合体上。 [0073] If the reserved resource does not meet resource requirements of the card, the module further determines the need to analyze the PCIE interface card is plugged directly connected to the root complex, or by connecting to the root complex PCIE bridge. 如果计算机没有为该PCIE接口预留资源,用预留资源为空来表示,属于预留的地址空间资源不能满足网卡资源需求的情况。 If the situation did not set aside resources for this computer PCIE interface, with reserve resources for the empty to represent the address space resources belong to the reserved resources can not meet the needs of the network card.

[0074] 如果PCIE接口直接连接在根联合体上,则启动第一计算模块和统计模块。 [0074] If the PCIE interface directly connected to the root complex, a first calculation module and a statistics module is started. 其中,第一计算模块用于计算所插接的设备的资源需求,即计算网卡的资源需求;统计模块用于统计当前剩余的资源。 Wherein the first calculating means for calculating resource requirements docking device, i.e., demand for computing resources card; counting module for counting current remaining resources. 如果当前剩余资源不满足计算出的资源需求,所述资源分配模块不为所插接的设备分配资源;如果当前剩余资源满足计算出的资源需求,则所述资源分配模块根据计算出的资源需求为所插接的设备分配资源。 If the calculated current remaining resource does not meet resource requirements, the resource allocation module of the device is not docked allocate resources; If the available resources to meet the resource requirements calculated, then the resource allocation module according to the calculated resource requirements allocating resources for the device plugged in. 在资源分配完成后,启动网卡,这样就可以通过网卡接入互联网了。 After the allocation of resources is complete, start the card, so that you can access the Internet through the network card.

[0075] 如果PCIE接口通过PCIE桥连接到根联合体上,则启动第二计算模块、控制模块和统计模块。 [0075] If the interface is connected to PCIE PCIE root complex through the bridge, the second calculation module starts, the control module and a statistics module. 控制模块,用于停止所述PCIE桥上的原有设备,在实施例2中是停止声卡的工作。 A control means for stopping the PCIE bridge existing equipment, sound card stop working in Example 2. 第二计算模块,用于计算所述PCIE桥上所有设备的资源需求,即计算声卡和网卡的资源需求。 Second calculating means for calculating the PCIE bridge resource requirements for all devices, i.e., demand for computing resources and sound card. 统计模块,用于统计当前剩余的资源。 Statistics module for the remainder of the current statistical resources.

·[0076] 如果当前剩余的资源不满足声卡和网卡的资源需求,则不为网卡分配资源,但控制模块还需要控制声卡恢复运行。 · [0076] If the current remaining resource does not meet the resource needs sound card and network card, not the card for the allocation of resources, but also need to control the sound control module to resume operation. 如果当前剩余的资源满足声卡和网卡的资源需求,则所述资源分配模块根据计算出的资源需求,为所述总线接口桥上所有设备分配资源;分配资源成功后,所述控制模块根据分配结果控制所述PCIE桥上所有设备运行,即控制声卡和网卡都运行;如果资源分配不成功,所述控制模块控制声卡恢复运行。 If the available resources to meet the resource requirements and the sound card, then the resource allocation module according to the calculated resource requirements for the allocation of resources to all bus interface bridge device; After a successful allocation of resources, according to the allocation result of the control module the PCIE bridge controlling operation of all devices, i.e. the control sound card and running; if resource allocation is not successful, the control module controls the sound card recovery operation.

[0077] 本发明热插拔总线接口的资源分配方法及装置的实施例,主要用在PCIE接口中,也可以用在其他支持热插拔的总线接口中,例如:AGP接口、支持热插拔的PCI接口等。 [0077] Example embodiments of a resource allocation method and apparatus of the present invention, the hot swap bus interface, mainly used in the PCIE interface, can also be used in other hot-swappable bus interfaces, for example: AGP interface, support hot swap the PCI interface.

[0078] 以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。 [0078] The above are only specific embodiments of the present invention, but the scope of the present invention is not limited thereto, any skilled in the art in the art within the technical scope of the present invention is disclosed, variations may readily occur to or alternatively, shall fall within the protection scope of the present invention. 因此,本发明的保护范围应该以权利要求的保护范围为准。 Accordingly, the scope of the present invention should be defined by the scope of the claims.

Claims (8)

  1. 1. 一种热插拔总线接口的资源分配方法,其特征在于包括: 检测到热插拔总线接口上插入设备; 查找为所述热插拔总线接口预留的资源; 判断所述预留资源是否满足所检测到设备的资源需求; 如果所述预留资源不满足所检测到设备的资源需求,则判断所述热插拔总线接口是否通过总线接口桥与根联合体连接; 若所述热插拔总线接口通过总线接口桥与根联合体连接,停止所述总线接口桥上的原有设备;并从剩余资源中为所述总线接口桥上的所有设备分配资源; 若所述热插拔总线接口直接与根联合体连接,则从剩余资源中为所检测到的设备分配资源。 A resource allocation method for hot swap bus interface, comprising: detecting the device is inserted into the hot swap bus interface; the hot swap bus interface to find a resource reservation; determining whether the reserved resources meets the resource requirements of the device is detected; reserved resources if the resource does not meet the needs of the device detected, it is determined whether or not the hot swap bus interface connected via a bus interface to bridge the root complex; if the heat plug bridge bus interface through the bus interface and connected to the root complex, original equipment stops said bus interface bridge; from the remaining resources, and allocating resources for all devices of the bridge bus interface; if the hot swap bus interface directly connected to the root complex from the remaining resources in the resource allocation for device detected.
  2. 2.根据权利要求I所述的热插拔总线接口的资源分配方法,其特征在于,所述从剩余资源中为所检测到的设备分配资源包括: 计算所检测到的设备的资源需求; 统计当前剩余的资源; 如果当前剩余的资源不满足计算出的资源需求,则不为所检测到的设备分配资源; 如果当前剩余的资源满足计算出的资源需求,根据计算出的资源需求为所检测到的设备分配资源。 The resource allocation method of claim I as claimed in claim hot swap bus interface, wherein allocating resources for the device from the remainder of the resources to detect comprises: calculating device detects the resource requirements; Statistics the current remaining resources; if the current remaining resource does not meet the calculated resource requirements, the device is not detected by the allocation of resources; If the available resources to meet the resource requirements calculated, based on the calculated resource demand is detected allocating resources to the device.
  3. 3.根据权利要求I所述的热插拔总线接口的资源分配方法,其特征在于,所述从剩余资源中为所述总线接口桥上的所有设备分配资源包括: 计算所述总线接口桥上所有设备的资源需求; 统计当前剩余的资源; 如果当前剩余的资源不满足计算出的资源需求,则运行所述总线接口桥上的原有设备; 如果当前剩余的资源满足计算出的资源需求,根据计算出的资源需求,为所述总线接口桥上所有设备分配资源。 The resource allocation method of the hot swap bus interface I as claimed in claim, wherein said device is assigned all resources of the bridge bus interface from the remaining resources include: calculating said bus interface bridge the resource requirements of all devices; statistics current remaining resources; if the current remaining resource does not meet the calculated resource requirements, the operation of the original equipment of the bridge bus interface; if the current remaining resources to meet the resource requirements calculated, based on the calculated resource requirements, the bus interface to allocate resources for all the bridge devices.
  4. 4.根据权利要求3所述的热插拔总线接口的资源分配方法,其特征在于,所述从剩余资源中为所述总线接口桥上的所有设备分配资源还包括: 如果分配资源成功,运行所述总线接口桥上所有设备; 如果分配资源不成功,则运行所述总线接口桥上的原有设备。 The hot swap bus interface resource allocation method according to claim 3, wherein the remaining resources from the allocation of resources for all devices in the bridge bus interface further comprising: if the resource allocation is successful, operation the bridge bus interface for all devices; if resource allocation is not successful, the operation of the bus interface bridge of the original equipment.
  5. 5.根据权利要求I至4中任意一项所述的热插拔总线接口的资源分配方法,其特征在于,所述热插拔总线接口为外设组件互连扩展接口,所述总线接口桥为外设组件互连扩展接口桥。 According to any of claims I to hot swap bus interface resource allocation method of one of claims 4, characterized in that the hot swap bus interface is a Peripheral Component Interconnect Interface, said bus interface bridge peripheral component interconnect Interface for the bridge.
  6. 6. 一种热插拔总线接口的资源分配装置,其特征在于包括: 检测模块,用于检测热插拔总线接口上是否插入设备; 资源分配模块,用于为检测到的设备分配资源; 查找模块,用于查找为所述热插拔总线接口预留的资源; 判断模块,用于判断所述预留资源是否满足所检测到设备的资源需求; 如果所述预留资源不满足所检测到设备的资源需求,所述判断模块进一步判断所述热插拔总线接口是否通过总线接口桥与根联合体连接,若所述热插拔总线接口通过总线接口桥与根联合体连接,控制模块停止所述总线接口桥上的原有设备,并且资源分配模块从剩余资源中为所述总线接口桥上的所有设备分配资源, 若所述热插拔总线接口直接与根联合体连接,则资源分配模块从剩余资源中为所检测到的设备分配资源。 A resource allocation apparatus of the hot swap bus interface, comprising: detecting means for detecting whether the hot plug inserted into the device bus interface; resource allocation module for allocating resources detected devices; Find module, for finding said hot swap bus interface resources reserved; determining means for determining whether the reserved resources to meet the resource requirements of the detected device; if the reserved resources do not satisfy detected resource requirements of the apparatus, said determination module further determines whether the hot swap bus interface connected via a bus interface to bridge the root complex, if the hot swap bus interface and the bridge via the bus interface connected to the root complex, the control module stops said bus interface bridge of the original equipment, and remaining resources from a resource allocation module for allocating resources to the bus interface for all devices of the bridge, if the hot swap bus interface connected directly to the root complex resource allocation module detecting apparatus for allocating resources to the remaining resources from.
  7. 7.根据权利要求6所述的热插拔总线接口的资源分配装置,其特征在于: 如果分配资源成功,所述控制模块控制所述总线接口桥上所有设备运行; 如果资源分配不成功,所述控制模块控制所述总线接口桥上的原有设备运行。 The hot swap bus interface resource allocation apparatus according to claim 6, wherein: if the resource allocation is successful, the control module controls the operation of all equipment on the bridge bus interface; if resource allocation is not successful, the said control module controls the bus interface bridge original equipment operation.
  8. 8.根据权利要求6至7中任意一项所述的热插拔总线接口的资源分配装置,其特征在于,所述热插拔总线接口为外设组件互连扩展接口,所述总线接口桥为外设组件互连扩展接口桥。 8. The hot swap bus interface resource allocation apparatus of any one of claims 6 to claim 7, characterized in that the hot swap bus interface is a Peripheral Component Interconnect Interface, said bus interface bridge peripheral component interconnect Interface for the bridge.
CN 200810006678 2008-01-31 2008-01-31 Method and apparatus for distributing resource of hot-plug bus interface CN101226515B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200810006678 CN101226515B (en) 2008-01-31 2008-01-31 Method and apparatus for distributing resource of hot-plug bus interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200810006678 CN101226515B (en) 2008-01-31 2008-01-31 Method and apparatus for distributing resource of hot-plug bus interface

Publications (2)

Publication Number Publication Date
CN101226515A true CN101226515A (en) 2008-07-23
CN101226515B true CN101226515B (en) 2012-10-17

Family

ID=39858520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200810006678 CN101226515B (en) 2008-01-31 2008-01-31 Method and apparatus for distributing resource of hot-plug bus interface

Country Status (1)

Country Link
CN (1) CN101226515B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117259B (en) 2009-12-31 2014-07-09 成都市华为赛门铁克科技有限公司 Method and device for allocating and processing address space resource
CN103281260A (en) * 2013-05-20 2013-09-04 华为技术有限公司 System and device supporting PCIe (peripheral component interface express) and resource allocation method thereof
CN103455379A (en) * 2013-09-05 2013-12-18 华为技术有限公司 Resource allocation method and system
CN104123188B (en) * 2014-06-30 2017-10-24 华为技术有限公司 A resource allocation method and related apparatus
CN105354162A (en) * 2015-11-02 2016-02-24 烽火通信科技股份有限公司 Method and apparatus for implementing hot-plug of PCIE device based on Linux

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6212587B1 (en) 1997-12-10 2001-04-03 Compaq Computer Corp. Device proxy agent for hiding computing devices on a computer bus
CN1740997A (en) 2005-09-21 2006-03-01 杭州华为三康技术有限公司 Network equipment and method for distributing its peripheral device interconnection resources
CN1926521A (en) 2004-03-18 2007-03-07 英特尔公司 Method and device to support booting despite deficient resources

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6212587B1 (en) 1997-12-10 2001-04-03 Compaq Computer Corp. Device proxy agent for hiding computing devices on a computer bus
CN1926521A (en) 2004-03-18 2007-03-07 英特尔公司 Method and device to support booting despite deficient resources
CN1740997A (en) 2005-09-21 2006-03-01 杭州华为三康技术有限公司 Network equipment and method for distributing its peripheral device interconnection resources

Also Published As

Publication number Publication date Type
CN101226515A (en) 2008-07-23 application

Similar Documents

Publication Publication Date Title
US7162560B2 (en) Partitionable multiprocessor system having programmable interrupt controllers
US7117388B2 (en) Dynamic, Non-invasive detection of hot-pluggable problem components and re-active re-allocation of system resources from problem components
US5787019A (en) System and method for handling dynamic changes in device states
US6243774B1 (en) Apparatus program product and method of managing computer resources supporting concurrent maintenance operations
US6282596B1 (en) Method and system for hot-plugging a processor into a data processing system
US20050172164A1 (en) Autonomous fail-over to hot-spare processor using SMI
US6820157B1 (en) Apparatus, program product and method of replacing failed hardware device through concurrent maintenance operation
US6496893B1 (en) Apparatus and method for swapping devices while a computer is running
US20060143498A1 (en) Fail over method through disk take over and computer system having fail over function
US20040215864A1 (en) Non-disruptive, dynamic hot-add and hot-remove of non-symmetric data processing system resources
US20070209035A1 (en) System, method, and computer-readable medium for virtual machine instantiation from an external peripheral device
US20120102491A1 (en) Virtual function boot in single-root and multi-root i/o virtualization environments
US20120137292A1 (en) Virtual machine migrating system and method
US7739487B2 (en) Method for booting a host device from an MMC/SD device, a host device bootable from an MMC/SD device and an MMC/SD device method a host device may booted from
US20080294933A1 (en) Fail-over method, computer system, management server, and backup server setting method
US7313685B2 (en) Unattended BIOS recovery
US20080005370A1 (en) Method and System for Identifying an Operating System Running on a Computer System
US6611912B1 (en) Method and apparatus having a system BIOS write configuration data of a riser card to a controller configuration space when connecting the riser card to a motherboard
US6615288B1 (en) Generating system management interrupt in response to usb controller signal and processing interrupt routine in upper most level of system memory
US7457900B2 (en) Method for discovering and partitioning PCI devices
US20090133028A1 (en) System and method for management of an iov adapter through a virtual intermediary in a hypervisor with functional management in an iov management partition
US20070156942A1 (en) Method and apparatus for independently managing a chipset-integrated bus controller
US20070233928A1 (en) Mechanism and apparatus for dynamically providing required resources for a hot-added PCI express endpoint or hierarchy
US20100199272A1 (en) Updating firmware without disrupting service
US20120246644A1 (en) Virtual computer system and controlling method of virtual computer

Legal Events

Date Code Title Description
C06 Publication
C10 Request of examination as to substance
C41 Transfer of the right of patent application or the patent right
ASS Succession or assignment of patent right

Owner name: CHENGDU CITY HUAWEI SAIMENTEKE SCIENCE CO., LTD.

Free format text: FORMER OWNER: HUAWEI TECHNOLOGY CO., LTD.

Effective date: 20090424

C14 Granted
C56 Change in the name or address of the patentee

Owner name: HUAWEI DIGITAL TECHNOLOGY (CHENGDU) CO., LTD.

Free format text: FORMER NAME: CHENGDU HUAWEI SYMANTEC TECHNOLOGIES CO., LTD.