CN104123188A - Resource allocating method and related devices - Google Patents

Resource allocating method and related devices Download PDF

Info

Publication number
CN104123188A
CN104123188A CN201410309001.4A CN201410309001A CN104123188A CN 104123188 A CN104123188 A CN 104123188A CN 201410309001 A CN201410309001 A CN 201410309001A CN 104123188 A CN104123188 A CN 104123188A
Authority
CN
China
Prior art keywords
terminal equipment
pcie
resource
interchanger
bus
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201410309001.4A
Other languages
Chinese (zh)
Other versions
CN104123188B (en
Inventor
方洪灿
王富
吴沛
彭本华
吴明杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201410309001.4A priority Critical patent/CN104123188B/en
Publication of CN104123188A publication Critical patent/CN104123188A/en
Priority to PCT/CN2015/076989 priority patent/WO2016000475A1/en
Application granted granted Critical
Publication of CN104123188B publication Critical patent/CN104123188B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)
  • Power Sources (AREA)

Abstract

The invention discloses a resource allocating method and related devices. The resource allocating method comprises the steps that when a PCIE server is powered on, whether a PCIE interface is connected with an exchanger or not is detected through a PCIE bus, wherein the exchanger is internally provided with a virtual terminal device; if the exchanger is connected to the PCIE interface, the first resource describing information of the virtual terminal device is acquired; a first resource is allocated to the virtual terminal device according to the first resource describing information; the second resource describing information of a physical terminal device corresponding to the virtual terminal device is received, wherein the second resource describing information is sent by the exchanger, and the physical terminal device is connected to the exchanger after the PCIE server is powered on; whether the first resource is small than the resource described by the second resource describing information or not, and if not, the exchanger is triggered to open the port used for connecting the PCIE server and the physical terminal device, and the second resource in the first resource is allocated to the physical terminal device through the port, wherein the second resource is the resource described in the second resource describing information. By means of the resource allocating method and the related devices, the resource utilization rate can be improved.

Description

A kind of resource allocation methods and relevant apparatus
Technical field
The present invention relates to Internet technical field, be specifically related to a kind of resource allocation methods and relevant apparatus.
Background technology
In server field, hot plug can realize in the situation that not cutting off server power supply, on server, insert or extract terminal device and do not affect the normal work of server, along with Peripheral component interface expansion (Peripheral Component Interface Express, PCIE) development of bus, the hot plug of the PCIE Interface realization terminal device by PCIE server on PCIE server is more and more general.When PCIE server is supported hot plug, when PCIE server powers on, will be PCIE interface assignment resource, when having terminal device to insert this PCIE interface, PCIE server will be distributed to this terminal device for the resource of this PCIE interface assignment.When PCIE server is not supported hot plug, only terminal device is inserted to PCIE interface before PCIE server powers on, PCIE server powers on Shi Caihui for this terminal device Resources allocation, if again terminal device is inserted to PCIE interface after PCIE server powers on, PCIE server will not be this terminal device Resources allocation, so that this terminal device cannot be used, and has reduced resource utilization.
Summary of the invention
The embodiment of the present invention discloses a kind of resource allocation methods and relevant apparatus, for improving resource utilization.
Embodiment of the present invention first aspect discloses a kind of resource allocation methods, comprising:
When PCIE server powers on, by a PCIE bus, detect on PCIE interface whether accessed interchanger, described interchanger is built-in with virtual terminal equipment;
If accessed interchanger, described PCIE server obtains the first resource descriptor of described virtual terminal equipment by a described PCIE bus;
Described PCIE server is described virtual terminal devices allocation first resource according to described first resource descriptor;
Described PCIE server receives described interchanger by the Secondary resource descriptor of the physical terminal equipment corresponding with described virtual terminal equipment of a described PCIE bus transmission, and described physical terminal equipment is the physical terminal equipment of described interchanger that accesses after described PCIE server powers on;
Described PCIE server judges whether described first resource is more than or equal to the described resource of described Secondary resource descriptor, if, triggering described interchanger opens in described interchanger for connecting the port of described PCIE server and described physical terminal equipment, and by described port, the Secondary resource in described first resource is distributed to described physical terminal equipment, described Secondary resource is the described resource of described Secondary resource descriptor.
In conjunction with embodiment of the present invention first aspect, in the possible implementation of the first of embodiment of the present invention first aspect, described first resource descriptor comprises the required bus number of described virtual terminal equipment and memory headroom, and described first resource descriptor carries the function information of described virtual terminal equipment;
Described PCIE server is that described virtual terminal devices allocation first resource comprises according to described first resource descriptor:
Described PCIE server is divided the first storage resources from internal memory, and the storage space of described the first storage resources equals described virtual terminal equipment required memory space;
Described PCIE server judges according to the function information of described virtual terminal equipment whether described virtual terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of described virtual terminal devices allocation, describedly equal the required bus number of described virtual terminal equipment for the bus number of described virtual terminal devices allocation;
The bus that described PCIE server is chosen for described virtual terminal equipment from the bus of described PCIE server, it is the bus number of described virtual terminal devices allocation that the bus number of choosing for described virtual terminal equipment equals described.
In conjunction with the possible implementation of the first of embodiment of the present invention first aspect, in the possible implementation of the second of embodiment of the present invention first aspect, interchanger is opened in described interchanger and is comprised for connecting the port of described PCIE server and described physical terminal equipment described in described PCIE server triggers:
Described PCIE server is given described interchanger by a described PCIE bus transmit port open command, to trigger described interchanger, opens the port that connects described PCIE server and described physical terminal equipment.
In conjunction with the possible implementation of the second of embodiment of the present invention first aspect, in the third possible implementation of embodiment of the present invention first aspect, described Secondary resource descriptor comprises the required bus number of described physical terminal equipment and memory headroom, and described Secondary resource descriptor carries the function information of described physical terminal equipment;
Described PCIE server is distributed to described physical terminal equipment by described port by the Secondary resource in described first resource and is comprised:
Described PCIE server is divided the second storage resources from described the first storage resources, and the storage space of described the second storage resources equals described physical terminal equipment required memory space;
Described PCIE server judges according to the function information of described physical terminal equipment whether described physical terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of described physical terminal devices allocation, the bus number of described physical terminal devices allocation equals the required bus number of described physical terminal equipment;
Described PCIE server is chosen bus for described physical terminal equipment from the bus of choosing for described virtual terminal equipment, and it is the bus number of described physical terminal devices allocation that the bus number of choosing for described physical terminal equipment equals described;
Described PCIE server is the plot of described the second storage resources and storage space, and by described port, is sent to described physical terminal equipment for the numbering of the bus of described physical terminal devices allocation.
Embodiment of the present invention second aspect discloses a kind of resource allocation methods, comprising:
Interchanger receives described PCIE server and obtains request by the first resource descriptor of the virtual terminal equipment of a PCIE bus transmission, described virtual terminal equipment is built in described interchanger, and described interchanger is to access the interchanger on PCIE interface before described PCIE server powers on;
Described interchanger sends to described PCIE server by the first resource descriptor of described virtual terminal equipment by a described PCIE bus;
What described interchanger received that described PCIE server sends by a described PCIE bus be the first resource of described virtual terminal devices allocation, and described first resource is that described PCIE server is according to the resource of described first resource descriptor distribution;
Described interchanger detects whether there is interchanger described in the physical terminal equipment access corresponding with described virtual terminal equipment by the 2nd PCIE bus;
If there is interchanger described in the physical terminal equipment access corresponding with described virtual terminal equipment, described interchanger sends to described PCIE server by the Secondary resource descriptor of the physical terminal equipment corresponding with described virtual terminal equipment by a described PCIE bus;
Described interchanger receives the port open instruction that described PCIE server sends by a described PCIE bus, open the port that connects described PCIE server and described physical terminal equipment, to trigger described PCIE server, by described port, the Secondary resource in described first resource is distributed to described physical terminal equipment, described port open instruction be when described first resource is more than or equal to the described resource of described Secondary resource descriptor described in the instruction that sends over of PCIE server, described Secondary resource is the described resource of described Secondary resource descriptor.
In conjunction with embodiment of the present invention second aspect, in the possible implementation of the first of embodiment of the present invention second aspect, described first resource descriptor comprises the required bus number of described virtual terminal equipment and memory headroom, and described first resource descriptor carries the function information of described virtual terminal equipment.
The embodiment of the present invention third aspect discloses a kind of PCIE server, comprising:
Detecting unit, while powering on for described PCIE server, detects on PCIE interface whether accessed interchanger by a PCIE bus, and described interchanger is built-in with virtual terminal equipment;
Acquiring unit, while having accessed interchanger for detecting when described detecting unit on PCIE interface, obtains the first resource descriptor of described virtual terminal equipment by a described PCIE bus;
The first allocation units are described virtual terminal devices allocation first resource for the first resource descriptor of obtaining according to described acquiring unit;
Receiving element, for receiving described interchanger by the Secondary resource descriptor of the physical terminal equipment corresponding with described virtual terminal equipment of a described PCIE bus transmission, described physical terminal equipment is the physical terminal equipment of described interchanger that accesses after described PCIE server powers on;
Judging unit, for judging whether the first resource that described the first allocation units distribute is more than or equal to the described resource of Secondary resource descriptor that described receiving element receives;
Trigger element, for when judgment result is that of described judging unit is, triggers described interchanger and opens in described interchanger for connecting the port of described PCIE server and described physical terminal equipment;
The second allocation units, the Secondary resource of the first resource described the first allocation units being distributed for the port triggering by described trigger element is distributed to described physical terminal equipment, and described Secondary resource is the described resource of Secondary resource descriptor that described receiving element receives.
In conjunction with the embodiment of the present invention third aspect, in the possible implementation of the first of the embodiment of the present invention third aspect, described first resource descriptor comprises the required bus number of described virtual terminal equipment and memory headroom, and described first resource descriptor carries the function information of described virtual terminal equipment;
Described the first allocation units comprise:
First divides subelement, and for divide the first storage resources from internal memory, the storage space of described the first storage resources equals described virtual terminal equipment required memory space;
The first quantity is determined subelement, for judging according to the function information of described virtual terminal equipment whether described virtual terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of described virtual terminal devices allocation, describedly equal the required bus number of described virtual terminal equipment for the bus number of described virtual terminal devices allocation;
The first bus is determined subelement, for choosing bus from the bus of described PCIE server for described virtual terminal equipment, the bus number of choosing for described virtual terminal equipment equals described the first quantity and determines that definite described of subelement is the bus number of described virtual terminal devices allocation.
In conjunction with the possible implementation of the first of the embodiment of the present invention third aspect, in the possible implementation of the second of the embodiment of the present invention third aspect, described trigger element, specifically for giving described interchanger by a described PCIE bus transmit port open command, to trigger described interchanger, open the port that connects described PCIE server and described physical terminal equipment.
In conjunction with the possible implementation of the second of the embodiment of the present invention third aspect, in the third possible implementation of the embodiment of the present invention third aspect, described Secondary resource descriptor comprises the required bus number of described physical terminal equipment and memory headroom, and described Secondary resource descriptor carries the function information of described physical terminal equipment;
Described the second allocation units comprise:
Second divides subelement, and for dividing the second storage resources from described the first storage resources, the storage space of described the second storage resources equals described physical terminal equipment required memory space;
The second quantity is determined subelement, for judging according to the function information of described physical terminal equipment whether described physical terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of described physical terminal devices allocation, describedly equal the required bus number of described physical terminal equipment for the bus number of described physical terminal devices allocation;
The second bus is determined subelement, for choosing bus from the bus of choosing for described virtual terminal equipment for described physical terminal equipment, the bus number of choosing for described physical terminal equipment equal described the second quantity determine subelement definite be the bus number of described physical terminal devices allocation;
Send subelement, be used for plot and the storage space of the second storage resources of described the second division subelement division, and described the second bus determines that the numbering of the bus for described physical terminal devices allocation that subelement is determined is sent to described physical terminal equipment by described port.
Embodiment of the present invention fourth aspect discloses a kind of interchanger, comprising:
Receiving element, for receiving described PCIE server, by the first resource descriptor of the virtual terminal equipment of a PCIE bus transmission, obtain request, described virtual terminal equipment is built in described interchanger, and described interchanger is the interchanger on access PCIE interface before the electricity on described PCIE server;
Transmitting element, the request of obtaining receiving for responding described receiving element, sends to described PCIE server by the first resource descriptor of described virtual terminal equipment by a described PCIE bus;
Described receiving element, for what receive that described PCIE server sends by a described PCIE bus, be also the first resource of described virtual terminal devices allocation, described first resource is that described PCIE server is according to the resource of described first resource descriptor distribution;
Detecting unit, for detecting whether there is interchanger described in the physical terminal equipment access corresponding with described virtual terminal equipment by the 2nd PCIE bus;
Described transmitting element, also when interchanger being detected described in the physical terminal equipment access corresponding with described virtual terminal equipment when described detecting unit, the Secondary resource descriptor of the physical terminal equipment corresponding with described virtual terminal equipment is sent to described PCIE server by a described PCIE bus;
Described receiving element, the port open instruction also sending by a described PCIE bus for receiving described PCIE server, open the port that connects described PCIE server and described physical terminal equipment, to trigger described PCIE server, by described port, the Secondary resource in described first resource is distributed to described physical terminal equipment, described port open instruction be when described first resource is more than or equal to the described resource of described Secondary resource descriptor described in the instruction that sends over of PCIE server, described Secondary resource is the described resource of described Secondary resource descriptor.
In conjunction with embodiment of the present invention fourth aspect, in the possible implementation of the first of embodiment of the present invention fourth aspect, described first resource descriptor comprises the required bus number of described virtual terminal equipment and memory headroom, and described first resource descriptor carries the function information of described virtual terminal equipment.
In the embodiment of the present invention, before PCIE server powers on, interchanger is accessed on the PCIE interface of PCIE server, when PCIE server powers on, PCIE server is built in the virtual terminal devices allocation resource in interchanger by being, after PCIE server powers on, physical terminal equipment can be realized hot plug by the interchanger being connected with PCIE interface, thereby can improve resource utilization.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, to the accompanying drawing of required use in embodiment be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the process flow diagram of the disclosed a kind of resource allocation methods of the embodiment of the present invention;
Fig. 2 is the process flow diagram of the disclosed another kind of resource allocation methods of the embodiment of the present invention;
Fig. 3 is the process flow diagram of disclosed another resource allocation methods of the embodiment of the present invention;
Fig. 4 is the process flow diagram of disclosed another resource allocation methods of the embodiment of the present invention;
Fig. 5 is the structural drawing of the disclosed a kind of PCIE server of the embodiment of the present invention;
Fig. 6 is the structural drawing of the disclosed another kind of PCIE server of the embodiment of the present invention;
Fig. 7 is the structural drawing of the disclosed a kind of interchanger of the embodiment of the present invention;
Fig. 8 is the structural drawing of the disclosed another kind of interchanger of the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the present invention discloses a kind of resource allocation methods and relevant apparatus, for improving resource utilization.Below be elaborated respectively.
Refer to Fig. 1, Fig. 1 is the process flow diagram of the disclosed a kind of resource allocation methods of the embodiment of the present invention.Resource allocation methods shown in Fig. 1 is to describe from the angle of PCIE server.As described in Figure 1, this resource allocation methods can comprise the following steps.
When S101, PCIE server power on, by a PCIE bus, detect on PCIE interface whether accessed interchanger, interchanger is built-in with virtual terminal equipment.
In the present embodiment, when PCIE server is not supported hot plug, PCIE server only at the Shi Caihui that powers on for having accessed the terminal device Resources allocation on the PCIE interface of PCIE server, therefore, for the hot plug not supporting to realize on the PCIE server of hot plug terminal device, before powering on, PCIE server need on PCIE interface, access the interchanger that is built-in with virtual terminal equipment, when PCIE server powers on, by being, be built in the virtual terminal devices allocation resource in interchanger, after PCIE server powers on, physical terminal equipment can be realized the hot plug on PCIE server by interchanger.
In the present embodiment, PCIE server and interchanger, by a PCIE bus transfer information, therefore, when PCIE server powers on, will detect on PCIE interface whether accessed interchanger by a PCIE bus, and interchanger is built-in with virtual terminal equipment.Interchanger can be connected with PCIE server by PCIE slot or physical cord, between them, by PCIE bus, carries out information interaction, therefore, the interface between physical cord and PCIE server and PCIE slot is referred to as to PCIE interface.PCIE interface on PCIE server can be one, also can be for a plurality of, and the present embodiment is not construed as limiting, and the present embodiment be take a PCIE interface and is described as example.
In the present embodiment, the virtual terminal equipment that interchanger comprises can be for a virtual terminal equipment, also can be a plurality of virtual terminal equipment, the present embodiment is not construed as limiting.In the present embodiment, take and be built-in with a virtual terminal equipment in interchanger and describe as example, virtual terminal equipment is hardware circuit.
If S102 has accessed interchanger, PCIE server obtains the first resource descriptor of virtual terminal equipment by a PCIE bus.
S103, PCIE server are virtual terminal devices allocation first resource according to first resource descriptor.
S104, PCIE server receive interchanger by the Secondary resource descriptor of the physical terminal equipment corresponding with virtual terminal equipment of a PCIE bus transmission, and physical terminal equipment is the physical terminal equipment that accesses interchanger after PCIE server powers on.
In the present embodiment, interchanger has several virtual terminal equipment, to have several external interfaces, these interfaces are interfaces of physical terminal equipment access interchanger, the corresponding external interface of each virtual terminal equipment, the physical terminal equipment corresponding with virtual terminal equipment is by the physical terminal equipment with external interface access interchanger corresponding to virtual terminal equipment.
S105, PCIE server judge whether first resource is more than or equal to the described resource of Secondary resource descriptor, if, triggering interchanger opens in interchanger for connecting the port of PCIE server and physical terminal equipment, and by port, the Secondary resource in first resource is distributed to physical terminal equipment, Secondary resource is the described resource of Secondary resource descriptor.
In the present embodiment, after PCIE server receives the Secondary resource descriptor of the physical terminal equipment corresponding with virtual terminal equipment that interchanger sends, to judge PCIE server is whether the first resource of virtual terminal devices allocation is more than or equal to the described resource of Secondary resource descriptor, when first resource is more than or equal to the described resource of Secondary resource descriptor, owing to there being enough resources, can use for physical terminal equipment, therefore trigger interchanger and open the port that connects PCIE server and physical terminal equipment in interchanger, and by port, the Secondary resource in first resource is distributed to physical terminal equipment, Secondary resource is the described resource of Secondary resource descriptor.
In the described resource allocation methods of Fig. 1, when PCIE server powers on, PCIE server is built in the virtual terminal devices allocation resource in interchanger by being, after PCIE server powers on, physical terminal equipment can be realized hot plug by interchanger, thereby can improve resource utilization.
Refer to Fig. 2, Fig. 2 is the process flow diagram of the disclosed another kind of resource allocation methods of the embodiment of the present invention.Resource allocation methods shown in Fig. 2 is to describe from the angle of PCIE server.As described in Figure 2, this resource allocation methods can comprise the following steps.
When S201, PCIE server power on, by a PCIE bus, detect on PCIE interface whether accessed interchanger, interchanger is built-in with virtual terminal equipment.
In the present embodiment, when PCIE server is not supported hot plug, PCIE server only at the Shi Caihui that powers on for having accessed the terminal device Resources allocation on the PCIE interface of PCIE server, therefore, for the hot plug not supporting to realize on the PCIE server of hot plug terminal device, before powering on, PCIE server need on PCIE interface, access the interchanger that is built-in with virtual terminal equipment, when PCIE server powers on, by being, be built in the virtual terminal devices allocation resource in interchanger, after PCIE server powers on, physical terminal equipment can be realized the hot plug on PCIE server by interchanger.
In the present embodiment, PCIE server and interchanger, by a PCIE bus transfer information, therefore, when PCIE server powers on, will detect on PCIE interface whether accessed interchanger by a PCIE bus, and interchanger is built-in with virtual terminal equipment.Interchanger can be connected with PCIE server by PCIE slot or physical cord, between them, by PCIE bus, carries out information interaction, therefore, the interface between physical cord and PCIE server and PCIE slot is referred to as to PCIE interface.PCIE interface on PCIE server can be one, also can be for a plurality of, and the present embodiment is not construed as limiting, and the present embodiment be take a PCIE interface and is described as example.
In the present embodiment, the virtual terminal equipment that interchanger comprises can be for a virtual terminal equipment, also can be a plurality of virtual terminal equipment, the present embodiment is not construed as limiting.In the present embodiment, take and be built-in with a virtual terminal equipment in interchanger and describe as example, virtual terminal equipment is hardware circuit.
If S202 has accessed interchanger, the first resource descriptor request of obtaining that PCIE server sends virtual terminal equipment by a PCIE bus is to interchanger.
S203, PCIE server receive interchanger by the first resource descriptor of the virtual terminal equipment of a PCIE bus transmission.
As a kind of possible embodiment, first resource descriptor comprises the required bus number of virtual terminal equipment and memory headroom, and first resource descriptor carries the function information of virtual terminal equipment.
In the present embodiment, user wishes that PCIE server, for reserved how many storage resources of certain virtual terminal equipment, can complete by revising the plot of virtual terminal equipment before PCIE server powers on; User wishes that PCIE server is for the reserved several buses of certain virtual terminal equipment, can be before PCIE server powers on by revising the quantity of virtual functions of virtual terminal equipment and the corresponding relation between virtual functions quantity and bus number, completes.Therefore, PCIE server can according to user need to carry out the distribution of resource, improved the dirigibility that resource is distributed.
Illustrate, suppose that user wishes the space for the reserved 1Gb of virtual terminal equipment, it is 1Gb that the plot of revising virtual terminal equipment before PCIE server powers on makes plot space.Suppose that user wishes that the maximum quantity of virtual terminal equipment virtual functions is 10 for two buses of virtual terminal devices allocation, when the corresponding virtual functions of a bus, the quantity of available virtual functions is set to 2; When corresponding two virtual functions of a bus, the quantity of available virtual functions is set to 4.
S204, PCIE server are virtual terminal devices allocation first resource according to first resource descriptor.
As a kind of possible embodiment, PCIE server is that virtual terminal devices allocation first resource can comprise the following steps according to first resource descriptor.
A1, PCIE server are divided the first storage resources from internal memory, and the storage space of the first storage resources equals virtual terminal equipment required memory space.
In the present embodiment, storage space and memory headroom are the size of memory capacity.
Illustrate, the memory size of supposing PCIE server is 1G, virtual terminal equipment required memory capacity is 1M, the storage space that PCIE server can mark off 1M from the internal memory of this 1G is to virtual terminal equipment, determine start address (being plot) and the termination address of this 1M storage space in internal memory, the amount of capacity between termination address and start address is 1M.
A2, PCIE server judge according to the function information of virtual terminal equipment whether virtual terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of virtual terminal devices allocation, for the bus number of virtual terminal devices allocation equals the required bus number of virtual terminal equipment.
In the present embodiment, PCIE server is whether the bus number of virtual terminal devices allocation equals the required bus number of virtual terminal equipment and depend on whether virtual terminal equipment possesses virtual (the Single-Root Input/Output Virtualization of single node input and output, SRIOV) function, when virtual terminal equipment possesses SRIOV function, PCIE server is that the bus number of virtual terminal devices allocation equals the required bus number of virtual terminal equipment.
Correspondingly, when virtual terminal equipment does not possess SRIOV function, PCIE server is that the bus number of virtual terminal devices allocation equals one.
A3, PCIE server are for virtual terminal equipment is chosen bus from the bus of PCIE server, and the bus number of choosing for virtual terminal equipment equals the bus number for virtual terminal devices allocation.
Illustrate, suppose that PCIE server always has 256 buses, every bus has a numbering, for the bus number of virtual terminal devices allocation is 6, from these 256 buses, for virtual terminal equipment selects 6 buses, determines the numbering of these 6 buses.
S205, PCIE server receive interchanger by the Secondary resource descriptor of the physical terminal equipment corresponding with virtual terminal equipment of a PCIE bus transmission, and physical terminal equipment is the physical terminal equipment that accesses interchanger after PCIE server powers on.
In the present embodiment, interchanger has several virtual terminal equipment, to have several external interfaces, these interfaces are interfaces of physical terminal equipment access interchanger, the corresponding external interface of each virtual terminal equipment, the physical terminal equipment corresponding with virtual terminal equipment is by the physical terminal equipment with external interface access interchanger corresponding to virtual terminal equipment.
S206, PCIE server judge whether first resource is more than or equal to the described resource of Secondary resource descriptor, if, triggering interchanger opens in interchanger for connecting the port of PCIE server and physical terminal equipment, and by port, the Secondary resource in first resource is distributed to physical terminal equipment, Secondary resource is the described resource of Secondary resource descriptor.
In the present embodiment after PCIE server receives the Secondary resource descriptor of the physical terminal equipment corresponding with virtual terminal equipment that interchanger sends, to judge PCIE server is whether the first resource of virtual terminal devices allocation is more than or equal to the described resource of Secondary resource descriptor, when first resource is more than or equal to the described resource of Secondary resource descriptor, owing to there being enough resources, can use for physical terminal equipment, therefore, can realize the hot plug of physical terminal equipment.
Correspondingly, when first resource is less than the described resource of Secondary resource descriptor, owing to not having enough resources to use for physical terminal equipment, therefore, cannot realize the hot plug of physical terminal equipment.
As a kind of possible embodiment, PCIE server triggers interchanger is opened in interchanger and is specially for connecting the mode of the port of PCIE server and physical terminal equipment:
PCIE server to interchanger, opens to trigger interchanger the port that connects PCIE server and physical terminal equipment by a PCIE bus transmit port open command.
In the present embodiment, in the time can realizing the hot plug of physical terminal equipment, PCIE server passes through a PCIE bus transmit port open command to interchanger, to trigger interchanger, open the port that connects PCIE server and physical terminal equipment, so that PCIE server can be physical terminal devices allocation resource by port, so that they carry out information interaction.
As a kind of possible embodiment, Secondary resource descriptor comprises the required bus number of physical terminal equipment and memory headroom, and Secondary resource descriptor carries the function information of physical terminal equipment;
PCIE server is distributed to physical terminal equipment by port by the Secondary resource in first resource and can be comprised the following steps.
B1, PCIE server are divided the second storage resources from the first storage resources, and the storage space of the second storage resources equals physical terminal equipment required memory space.
Illustrate, suppose that PCIE server is that the memory size of virtual terminal devices allocation is 1M, physical terminal equipment required memory capacity is 5K, the storage space that PCIE server can mark off 5K from this 1M internal memory is to physical terminal equipment, determine start address (being plot) and the termination address of this 5K storage space in internal memory, the amount of capacity between termination address and start address is 5K.
B2, PCIE server judge according to the function information of physical terminal equipment whether physical terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of physical terminal devices allocation, for the bus number of physical terminal devices allocation equals the required bus number of physical terminal equipment.
In the present embodiment, PCIE server is whether the bus number of physical terminal devices allocation equals the required bus number of physical terminal equipment and depend on whether physical terminal equipment possesses SRIOV function, when physical terminal equipment possesses SRIOV function, PCIE server is that the bus number of physical terminal devices allocation equals the required bus number of physical terminal equipment.
Correspondingly, when physical terminal equipment does not possess SRIOV function, PCIE server is that the bus number of physical terminal devices allocation equals one.
B3, PCIE server are for physical terminal equipment is chosen bus from the bus of choosing for virtual terminal equipment, and the bus number of choosing for physical terminal equipment equals the bus number for physical terminal devices allocation.
Illustrate, 6 buses of supposing that PCIE server has been virtual terminal devices allocation for the bus number of physical terminal devices allocation is 4, select 4 to distribute to physical terminal equipment from these 6 buses, while choosing, preferentially from numbering little starting, choose.
B4, PCIE server be the plot of the second storage resources and storage space, and by port, be sent to physical terminal equipment for the numbering of the bus of physical terminal devices allocation.
In the present embodiment, PCIE server is by the plot of the second storage resources and storage space, and by port, be sent to physical terminal equipment for the numbering of the bus of physical terminal devices allocation, show PCIE server for physical terminal devices allocation resource, show that physical terminal equipment can carry out information interaction with PCIE server.
In the described resource allocation methods of Fig. 2, when PCIE server powers on, PCIE server is built in the virtual terminal devices allocation resource in interchanger by being, after PCIE server powers on, physical terminal equipment can be realized hot plug by interchanger, thereby can improve resource utilization.
Refer to Fig. 3, Fig. 3 is the process flow diagram of disclosed another resource allocation methods of the embodiment of the present invention.Resource allocation methods shown in Fig. 3 is to describe from the angle of interchanger.As shown in Figure 3, this resource allocation methods can comprise the following steps.
S301, interchanger receive PCIE server and obtain request by the first resource descriptor of the virtual terminal equipment of a PCIE bus transmission, virtual terminal equipment is built in interchanger, and interchanger is before PCIE server powers on, to access the interchanger on PCIE interface.
In the present embodiment, when PCIE server is not supported hot plug, PCIE server only at the Shi Caihui that powers on for having accessed the terminal device Resources allocation on the PCIE interface of PCIE server, therefore, for the hot plug not supporting to realize on the PCIE server of hot plug terminal device, before powering on, PCIE server accesses the interchanger that is built-in with virtual terminal equipment on PCIE interface, when PCIE server powers on, interchanger obtains request by receiving PCIE server by the first resource descriptor of the virtual terminal equipment of a PCIE bus transmission.
In the present embodiment, the virtual terminal equipment that interchanger comprises can be for a virtual terminal equipment, also can be a plurality of virtual terminal equipment, the present embodiment is not construed as limiting.In the present embodiment, take and be built-in with a virtual terminal equipment in interchanger and describe as example, virtual terminal equipment is hardware circuit.
S302, interchanger send to PCIE server by the first resource descriptor of virtual terminal equipment by a PCIE bus.
As a kind of possible embodiment, first resource descriptor comprises the required bus number of virtual terminal equipment and memory headroom, and first resource descriptor carries the function information of virtual terminal equipment.
In the present embodiment, user wishes that PCIE server, for reserved how many storage resources of certain virtual terminal equipment, can complete by revising the plot of virtual terminal equipment before PCIE server powers on; User wishes that PCIE server is for the reserved several buses of certain virtual terminal equipment, can be before PCIE server powers on by revising the quantity of virtual functions of virtual terminal equipment and the corresponding relation between virtual functions quantity and bus number, completes.Therefore, PCIE server can according to user need to carry out the distribution of resource, improved the dirigibility that resource is distributed.
Illustrate, suppose that user wishes the space for the reserved 1Gb of virtual terminal equipment, it is 1Gb that the plot of revising virtual terminal equipment before PCIE server powers on makes plot space.Suppose that user wishes that the maximum quantity of virtual terminal equipment virtual functions is 10 for two buses of virtual terminal devices allocation, when the corresponding virtual functions of a bus, the quantity of available virtual functions is set to 2; When corresponding two virtual functions of a bus, the quantity of available virtual functions is set to 4.
What S303, interchanger reception PCIE server sent by a PCIE bus is the first resource of virtual terminal devices allocation, and first resource is the resource that PCIE server distributes according to first resource descriptor.
In the present embodiment, PCIE server is that the first resource of virtual terminal devices allocation comprises storage resources and bus, PCIE server is that the storage resources of virtual terminal devices allocation comprises plot and storage space, plot is the start address of storage resources in PCIE server memory space, storage space is the memory headroom of virtual terminal equipment, is also the termination address of storage resources in PCIE server memory and the amount of capacity between start address.PCIE server is the numbering that the bus of virtual terminal devices allocation comprises bus.
In the present embodiment, PCIE server is whether the bus number of virtual terminal devices allocation equals the required bus number of virtual terminal equipment and depend on whether virtual terminal equipment possesses SRIOV function, when virtual terminal equipment does not possess SRIOV function, PCIE server can only be bus of virtual terminal devices allocation, when virtual terminal equipment possesses SRIOV function, PCIE server can equal for the bus number of virtual terminal devices allocation the required bus number of virtual terminal equipment.
S304, interchanger detect whether there be the physical terminal equipment access interchanger corresponding with virtual terminal equipment by the 2nd PCIE bus.
In the present embodiment, interchanger has several virtual terminal equipment, to have several external interfaces, these interfaces are interfaces of physical terminal equipment access interchanger, the corresponding external interface of each virtual terminal equipment, the physical terminal equipment corresponding with virtual terminal equipment is by the physical terminal equipment with external interface access interchanger corresponding to virtual terminal equipment.
If S305 has the physical terminal equipment access interchanger corresponding with virtual terminal equipment, interchanger sends to PCIE server by the Secondary resource descriptor of the physical terminal equipment corresponding with virtual terminal equipment by a PCIE bus.
In the present embodiment, interchanger sends to PCIE server by the Secondary resource descriptor of physical terminal equipment after the physical terminal equipment access interchanger corresponding with virtual terminal equipment being detected.
S306, interchanger receive the port open instruction that PCIE server sends by a PCIE bus, open the port that connects PCIE server and physical terminal equipment, to trigger PCIE server, by port, the Secondary resource in first resource is distributed to physical terminal equipment, port open instruction is the instruction that PCIE server sends over when first resource is more than or equal to the described resource of Secondary resource descriptor, and Secondary resource is the described resource of Secondary resource descriptor.
In the described resource allocation methods of Fig. 3, when PCIE server powers on, it is the resource that is built in the virtual terminal devices allocation in interchanger that interchanger will receive PCIE server, after PCIE server powers on, physical terminal equipment can be realized hot plug by interchanger, thereby can improve resource utilization.
Refer to Fig. 4, Fig. 4 is the process flow diagram of disclosed another resource allocation methods of the embodiment of the present invention.Resource allocation methods shown in Fig. 4 is to describe from the angle of PCIE server and interchanger.As shown in Figure 4, this resource allocation methods can comprise the following steps.
When S401, PCIE server power on, by a PCIE bus, detect on PCIE interface whether accessed interchanger, interchanger is built-in with virtual terminal equipment.
In the present embodiment, PCIE server and interchanger, by a PCIE bus transfer information, therefore, when PCIE server powers on, will detect on PCIE interface whether accessed interchanger by a PCIE bus, and interchanger must be built-in with virtual terminal equipment.Interchanger can be connected with PCIE server by PCIE slot or physical cord, between them, by PCIE bus, carries out information interaction, therefore, the interface between physical cord and PCIE server and PCIE slot is referred to as to PCIE interface.PCIE interface on PCIE server can be one, also can be for a plurality of, and the present embodiment is not construed as limiting, and the present embodiment be take a PCIE interface and is described as example.
If S402 has accessed interchanger, the first resource descriptor request of obtaining that PCIE server sends virtual terminal equipment by a PCIE bus is to interchanger.
S403, interchanger send to PCIE server by the first resource descriptor of virtual terminal equipment by a PCIE bus.
In the present embodiment, the virtual terminal equipment that interchanger comprises can be for a virtual terminal equipment, also can be a plurality of virtual terminal equipment, the present embodiment is not construed as limiting.In the present embodiment, take and be built-in with a virtual terminal equipment in interchanger and describe as example, virtual terminal equipment is hardware circuit.
S404, PCIE server are virtual terminal devices allocation first resource according to first resource descriptor.
S405, PCIE server send to interchanger by first resource by a PCIE bus.
S406, interchanger detect whether there be the physical terminal equipment access interchanger corresponding with virtual terminal equipment by the 2nd PCIE bus.
In the present embodiment, interchanger has several virtual terminal equipment, to have several external interfaces, these interfaces are interfaces of physical terminal equipment access interchanger, the corresponding external interface of each virtual terminal equipment, the physical terminal equipment corresponding with virtual terminal equipment is by the physical terminal equipment with external interface access interchanger corresponding to virtual terminal equipment.
If S407 has the physical terminal equipment access interchanger corresponding with virtual terminal equipment, interchanger sends to PCIE server by the Secondary resource descriptor of the physical terminal equipment corresponding with virtual terminal equipment by a PCIE bus.
S408, PCIE server judge whether first resource is more than or equal to the described resource of Secondary resource descriptor.
If S409 first resource is more than or equal to the described resource of Secondary resource descriptor, PCIE server passes through a PCIE bus transmit port open command to interchanger.
In the present embodiment after PCIE server receives the Secondary resource descriptor of the physical terminal equipment corresponding with virtual terminal equipment that interchanger sends, to judge PCIE server is whether the first resource of virtual terminal devices allocation is more than or equal to the described resource of Secondary resource descriptor, when first resource is more than or equal to the described resource of Secondary resource descriptor, owing to there being enough resources, can use for physical terminal equipment, therefore, can realize the hot plug of physical terminal equipment.
Correspondingly, when first resource is less than the described resource of Secondary resource descriptor, owing to not having enough resources to use for physical terminal equipment, therefore, cannot realize the hot plug of physical terminal equipment.
S410, interchanger are opened the port that connects PCIE server and physical terminal equipment.
S411, PCIE server are distributed to physical terminal equipment by port by the Secondary resource in first resource, and Secondary resource is the described resource of Secondary resource descriptor.
In the described resource allocation methods of Fig. 4, before PCIE server powers on, interchanger is accessed on the PCIE interface of PCIE server, when PCIE server powers on, PCIE server is built in the virtual terminal devices allocation resource in interchanger by being, after PCIE server powers on, physical terminal equipment can be realized hot plug by the interchanger being connected with PCIE interface, thereby can improve resource utilization.
Refer to Fig. 5, Fig. 5 is the structural drawing of the disclosed a kind of PCIE server of the embodiment of the present invention.As shown in Figure 5, this PCIE server 500 can comprise:
Detecting unit 501, while powering on for PCIE server, detects on PCIE interface whether accessed interchanger by a PCIE bus, and interchanger is built-in with virtual terminal equipment;
Acquiring unit 502, while having accessed interchanger for detecting when detecting unit 501 on PCIE interface, obtains the first resource descriptor of virtual terminal equipment by a PCIE bus;
The first allocation units 503 are virtual terminal devices allocation first resource for the first resource descriptor of obtaining according to acquiring unit 502;
Receiving element 504, for receiving interchanger by the Secondary resource descriptor of the physical terminal equipment corresponding with virtual terminal equipment of a PCIE bus transmission, physical terminal equipment is the physical terminal equipment that accesses interchanger after PCIE server powers on;
Judging unit 505, for judging whether the first resource that the first allocation units 503 distribute is more than or equal to the described resource of Secondary resource descriptor that receiving element 504 receives;
Trigger element 506, for when judgment result is that of judging unit 505 is, triggers interchanger and opens in interchanger for connecting the port of PCIE server and physical terminal equipment;
The second allocation units 507, the Secondary resource of the first resource the first allocation units 503 being distributed for the port triggering by trigger element 506 is distributed to physical terminal equipment, and Secondary resource is the described resource of Secondary resource descriptor that receiving element 504 receives.
As a kind of possible embodiment, first resource descriptor comprises the required bus number of virtual terminal equipment and memory headroom, and first resource descriptor carries the function information of virtual terminal equipment;
The first allocation units 503 can comprise:
First divides subelement, and for divide the first storage resources from internal memory, the storage space of the first storage resources equals virtual terminal equipment required memory space;
The first quantity is determined subelement, for judging according to the function information of virtual terminal equipment whether virtual terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of virtual terminal devices allocation, for the bus number of virtual terminal devices allocation equals the required bus number of virtual terminal equipment;
The first bus is determined subelement, for the bus from PCIE server, chooses bus for virtual terminal equipment, and what the bus number of choosing for virtual terminal equipment equaled that the first quantity determines that subelement determines is the bus number of virtual terminal devices allocation.
As a kind of possible embodiment, trigger element 505, specifically for passing through a PCIE bus transmit port open command to interchanger, opens to trigger interchanger the port that connects PCIE server and physical terminal equipment.
As a kind of possible embodiment, Secondary resource descriptor comprises the required bus number of physical terminal equipment and memory headroom, and Secondary resource descriptor carries the function information of physical terminal equipment;
The second allocation units 507 can comprise:
Second divides subelement, and for dividing the second storage resources from the first storage resources, the storage space of the second storage resources equals physical terminal equipment required memory space;
The second quantity is determined subelement, for judging according to the function information of physical terminal equipment whether physical terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of physical terminal devices allocation, for the bus number of physical terminal devices allocation equals the required bus number of physical terminal equipment;
The second bus is determined subelement, for choosing bus from the bus chosen for virtual terminal equipment for physical terminal equipment, the bus number of choosing for physical terminal equipment equal the second quantity determine subelement definite be the bus number of physical terminal devices allocation;
Send subelement, for plot and the storage space of the second storage resources that the second division subelement is divided, and the second bus determines that the numbering of the bus for physical terminal devices allocation that subelement is determined is sent to physical terminal equipment by port.
In the described PCIE server of Fig. 5, when PCIE server powers on, PCIE server is by for to be built in the virtual terminal devices allocation resource in interchanger, after PCIE server powers on, physical terminal equipment can be realized hot plug by interchanger, thereby can improve resource utilization.
Refer to Fig. 6, Fig. 6 is the structural drawing of the disclosed another kind of PCIE server of the embodiment of the present invention.As shown in Figure 6, this PCIE server 600 can comprise processor 601 and storer 602, stores batch processing code in storer 602, and processor 601 is carried out following operation for calling the program code of storer 602 storages:
When PCIE server powers on, by a PCIE bus, detect on PCIE interface whether accessed interchanger, interchanger is built-in with virtual terminal equipment;
If accessed interchanger, by a PCIE bus, obtain the first resource descriptor of virtual terminal equipment;
According to first resource descriptor, it is virtual terminal devices allocation first resource;
Receive interchanger by the Secondary resource descriptor of the physical terminal equipment corresponding with virtual terminal equipment of a PCIE bus transmission, physical terminal equipment is the physical terminal equipment that accesses interchanger after PCIE server powers on;
Judge whether first resource is more than or equal to the described resource of Secondary resource descriptor, if, triggering interchanger opens in interchanger for connecting the port of PCIE server and physical terminal equipment, and by port, the Secondary resource in first resource is distributed to physical terminal equipment, Secondary resource is the described resource of Secondary resource descriptor.
As a kind of possible embodiment, first resource descriptor comprises the required bus number of virtual terminal equipment and memory headroom, and first resource descriptor carries the function information of virtual terminal equipment;
The mode that processor 601 is virtual terminal devices allocation first resource according to first resource descriptor is specially:
From internal memory, divide the first storage resources, the storage space of the first storage resources equals virtual terminal equipment required memory space;
According to the function information of virtual terminal equipment, judge whether virtual terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of virtual terminal devices allocation, for the bus number of virtual terminal devices allocation equals the required bus number of virtual terminal equipment;
From the bus of PCIE server, for virtual terminal equipment is chosen bus, the bus number of choosing for virtual terminal equipment equals the bus number for virtual terminal devices allocation.
As a kind of possible embodiment, processor 601 triggers in interchanger unlatching interchanger and is specially for connecting the mode of the port of PCIE server and physical terminal equipment:
By a PCIE bus transmit port open command, to interchanger, to trigger interchanger, open the port that connects PCIE server and physical terminal equipment.
As a kind of possible embodiment, Secondary resource descriptor comprises the required bus number of physical terminal equipment and memory headroom, and Secondary resource descriptor carries the function information of physical terminal equipment;
Processor 601 is distributed to described physical terminal equipment by described port by the Secondary resource in described first resource and is comprised:
From the first storage resources, divide the second storage resources, the storage space of the second storage resources equals physical terminal equipment required memory space;
According to the function information of physical terminal equipment, judge whether physical terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of physical terminal devices allocation, for the bus number of physical terminal devices allocation equals the required bus number of physical terminal equipment;
From the bus of choosing for virtual terminal equipment, for physical terminal equipment is chosen bus, the bus number of choosing for physical terminal equipment equals the bus number for physical terminal devices allocation;
By the plot of the second storage resources and storage space, and by port, be sent to physical terminal equipment for the numbering of the bus of physical terminal devices allocation.
In the described PCIE server of Fig. 6, when PCIE server powers on, PCIE server is by for to be built in the virtual terminal devices allocation resource in interchanger, after PCIE server powers on, physical terminal equipment can be realized hot plug by interchanger, thereby can improve resource utilization.
Refer to Fig. 7, Fig. 7 is the structural drawing of the disclosed a kind of interchanger of the embodiment of the present invention.As shown in Figure 7, this interchanger 700 can comprise:
Receiving element 701, for receiving PCIE server, by the first resource descriptor of the virtual terminal equipment of a PCIE bus transmission, obtain request, virtual terminal equipment is built in interchanger, and interchanger is before PCIE server powers on, to access the interchanger on PCIE interface;
Transmitting element 702, the request of obtaining receiving for responding receiving element 701, sends to PCIE server by the first resource descriptor of virtual terminal equipment by a PCIE bus;
Receiving element 701, be also the first resource of virtual terminal devices allocation for what receive that PCIE server sends by a PCIE bus, and first resource is that PCIE server is according to the resource of first resource descriptor distribution;
Detecting unit 703, for detecting whether there be the physical terminal equipment access interchanger corresponding with virtual terminal equipment by the 2nd PCIE bus;
Transmitting element 702, also when the physical terminal equipment access interchanger corresponding with virtual terminal equipment being detected when detecting unit 703, the Secondary resource descriptor of the physical terminal equipment corresponding with virtual terminal equipment is sent to PCIE server by a PCIE bus;
Receiving element 701, the port open instruction also sending by a PCIE bus for receiving PCIE server, open the port that connects PCIE server and physical terminal equipment, to trigger PCIE server, by port, the Secondary resource in first resource is distributed to physical terminal equipment, port open instruction is the instruction that PCIE server sends over when first resource is more than or equal to the described resource of Secondary resource descriptor, and Secondary resource is the described resource of Secondary resource descriptor.
As a kind of possible embodiment, first resource descriptor comprises the required bus number of virtual terminal equipment and memory headroom, and first resource descriptor carries the function information of virtual terminal equipment.
In the described interchanger of Fig. 7, when PCIE server powers on, it is the resource that is built in the virtual terminal devices allocation in interchanger that interchanger will receive PCIE server, after PCIE server powers on, physical terminal equipment can be realized hot plug by interchanger, thereby can improve resource utilization.
Refer to Fig. 8, Fig. 8 is the structural drawing of the disclosed another kind of interchanger of the embodiment of the present invention.As shown in Figure 8, PCIE server 800 can comprise processor 801 and storer 802, stores batch processing code in storer 802, and processor 801 is carried out following operation for calling the program code of storer 802 storages:
Receive PCIE server and obtain request by the first resource descriptor of the virtual terminal equipment of a PCIE bus transmission, virtual terminal equipment is built in interchanger, and interchanger is before PCIE server powers on, to access the interchanger on PCIE interface;
The first resource descriptor of virtual terminal equipment is sent to PCIE server by a PCIE bus;
What reception PCIE server sent by a PCIE bus is the first resource of virtual terminal devices allocation, and first resource is the resource that PCIE server distributes according to first resource descriptor;
By the 2nd PCIE bus, detect whether there be the physical terminal equipment access interchanger corresponding with virtual terminal equipment;
If have the physical terminal equipment access interchanger corresponding with virtual terminal equipment, the Secondary resource descriptor of the physical terminal equipment corresponding with virtual terminal equipment sent to PCIE server by a PCIE bus;
Receive the port open instruction that PCIE server sends by a PCIE bus, open the port that connects PCIE server and physical terminal equipment, to trigger PCIE server, by port, the Secondary resource in first resource is distributed to physical terminal equipment, port open instruction is the instruction that PCIE server sends over when first resource is more than or equal to the described resource of Secondary resource descriptor, and Secondary resource is the described resource of Secondary resource descriptor.
As a kind of possible embodiment, first resource descriptor comprises the required bus number of virtual terminal equipment and memory headroom, and first resource descriptor carries the function information of virtual terminal equipment.
In the described interchanger of Fig. 8, when PCIE server powers on, it is the resource that is built in the virtual terminal devices allocation in interchanger that interchanger will receive PCIE server, after PCIE server powers on, physical terminal equipment can be realized hot plug by interchanger, thereby can improve resource utilization.
The embodiment of the present invention further discloses a kind of computer-readable storage medium, this computer-readable storage medium stores computer program, when the computer program in computer-readable storage medium is read computing machine, can make computing machine complete the Overall Steps of the disclosed resource allocation methods of the embodiment of the present invention.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of above-described embodiment is to come the hardware that instruction is relevant to complete by program, this program can be stored in a computer-readable recording medium, storage medium can comprise: flash disk, ROM (read-only memory) (Read-Only Memory, ROM), random access device (Random Access Memory, RAM), disk or CD etc.
The resource allocation methods and the relevant apparatus that above the embodiment of the present invention are provided are described in detail, applied specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment is just for helping to understand method of the present invention and core concept thereof; , for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention meanwhile.

Claims (12)

1. a resource allocation methods, is characterized in that, comprising:
When PCIE server powers on, by a PCIE bus, detect on PCIE interface whether accessed interchanger, described interchanger is built-in with virtual terminal equipment;
If accessed interchanger, described PCIE server obtains the first resource descriptor of described virtual terminal equipment by a described PCIE bus;
Described PCIE server is described virtual terminal devices allocation first resource according to described first resource descriptor;
Described PCIE server receives described interchanger by the Secondary resource descriptor of the physical terminal equipment corresponding with described virtual terminal equipment of a described PCIE bus transmission, and described physical terminal equipment is the physical terminal equipment of described interchanger that accesses after described PCIE server powers on;
Described PCIE server judges whether described first resource is more than or equal to the described resource of described Secondary resource descriptor, if, triggering described interchanger opens in described interchanger for connecting the port of described PCIE server and described physical terminal equipment, and by described port, the Secondary resource in described first resource is distributed to described physical terminal equipment, described Secondary resource is the described resource of described Secondary resource descriptor.
2. the method for claim 1, is characterized in that, described first resource descriptor comprises the required bus number of described virtual terminal equipment and memory headroom, and described first resource descriptor carries the function information of described virtual terminal equipment;
Described PCIE server is that described virtual terminal devices allocation first resource comprises according to described first resource descriptor:
Described PCIE server is divided the first storage resources from internal memory, and the storage space of described the first storage resources equals described virtual terminal equipment required memory space;
Described PCIE server judges according to the function information of described virtual terminal equipment whether described virtual terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of described virtual terminal devices allocation, describedly equal the required bus number of described virtual terminal equipment for the bus number of described virtual terminal devices allocation;
Described PCIE server is chosen bus for described virtual terminal equipment from the bus of described PCIE server, and it is the bus number of described virtual terminal devices allocation that the bus number of choosing for described virtual terminal equipment equals described.
3. method as claimed in claim 2, is characterized in that, interchanger is opened in described interchanger and comprised for connecting the port of described PCIE server and described physical terminal equipment described in described PCIE server triggers:
Described PCIE server is given described interchanger by a described PCIE bus transmit port open command, to trigger described interchanger, opens the port that connects described PCIE server and described physical terminal equipment.
4. method as claimed in claim 3, is characterized in that, described Secondary resource descriptor comprises the required bus number of described physical terminal equipment and memory headroom, and described Secondary resource descriptor carries the function information of described physical terminal equipment;
Described PCIE server is distributed to described physical terminal equipment by described port by the Secondary resource in described first resource and is comprised:
Described PCIE server is divided the second storage resources from described the first storage resources, and the storage space of described the second storage resources equals described physical terminal equipment required memory space;
Described PCIE server judges according to the function information of described physical terminal equipment whether described physical terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of described physical terminal devices allocation, describedly equal the required bus number of described physical terminal equipment for the bus number of described physical terminal devices allocation;
Described PCIE server is chosen bus for described physical terminal equipment from the bus of choosing for described virtual terminal equipment, and it is the bus number of described physical terminal devices allocation that the bus number of choosing for described physical terminal equipment equals described;
Described PCIE server is the plot of described the second storage resources and storage space, and by described port, is sent to described physical terminal equipment for the numbering of the bus of described physical terminal devices allocation.
5. a resource allocation methods, is characterized in that, comprising:
Interchanger receives described PCIE server and obtains request by the first resource descriptor of the virtual terminal equipment of a PCIE bus transmission, described virtual terminal equipment is built in described interchanger, and described interchanger is to access the interchanger on PCIE interface before described PCIE server powers on;
Described interchanger sends to described PCIE server by the first resource descriptor of described virtual terminal equipment by a described PCIE bus;
What described interchanger received that described PCIE server sends by a described PCIE bus be the first resource of described virtual terminal devices allocation, and described first resource is that described PCIE server is according to the resource of described first resource descriptor distribution;
Described interchanger detects whether there is interchanger described in the physical terminal equipment access corresponding with described virtual terminal equipment by the 2nd PCIE bus;
If there is interchanger described in the physical terminal equipment access corresponding with described virtual terminal equipment, described interchanger sends to described PCIE server by the Secondary resource descriptor of the physical terminal equipment corresponding with described virtual terminal equipment by a described PCIE bus;
Described interchanger receives the port open instruction that described PCIE server sends by a described PCIE bus, open the port that connects described PCIE server and described physical terminal equipment, to trigger described PCIE server, by described port, the Secondary resource in described first resource is distributed to described physical terminal equipment, described port open instruction be when described first resource is more than or equal to the described resource of described Secondary resource descriptor described in the instruction that sends over of PCIE server, described Secondary resource is the described resource of described Secondary resource descriptor.
6. method as claimed in claim 5, is characterized in that, described first resource descriptor comprises the required bus number of described virtual terminal equipment and memory headroom, and described first resource descriptor carries the function information of described virtual terminal equipment.
7. a PCIE server, is characterized in that, comprising:
Detecting unit, while powering on for described PCIE server, detects on PCIE interface whether accessed interchanger by a PCIE bus, and described interchanger is built-in with virtual terminal equipment;
Acquiring unit, while having accessed interchanger for detecting when described detecting unit on PCIE interface, obtains the first resource descriptor of described virtual terminal equipment by a described PCIE bus;
The first allocation units are described virtual terminal devices allocation first resource for the first resource descriptor of obtaining according to described acquiring unit;
Receiving element, for receiving described interchanger by the Secondary resource descriptor of the physical terminal equipment corresponding with described virtual terminal equipment of a described PCIE bus transmission, described physical terminal equipment is the physical terminal equipment of described interchanger that accesses after described PCIE server powers on;
Judging unit, for judging whether the first resource that described the first allocation units distribute is more than or equal to the described resource of Secondary resource descriptor that described receiving element receives;
Trigger element, for when judgment result is that of described judging unit is, triggers described interchanger and opens in described interchanger for connecting the port of described PCIE server and described physical terminal equipment;
The second allocation units, the Secondary resource of the first resource described the first allocation units being distributed for the port triggering by described trigger element is distributed to described physical terminal equipment, and described Secondary resource is the described resource of Secondary resource descriptor that described receiving element receives.
8. PCIE server as claimed in claim 7, is characterized in that, described first resource descriptor comprises the required bus number of described virtual terminal equipment and memory headroom, and described first resource descriptor carries the function information of described virtual terminal equipment;
Described the first allocation units comprise:
First divides subelement, and for divide the first storage resources from internal memory, the storage space of described the first storage resources equals described virtual terminal equipment required memory space;
The first quantity is determined subelement, for judging according to the function information of described virtual terminal equipment whether described virtual terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of described virtual terminal devices allocation, describedly equal the required bus number of described virtual terminal equipment for the bus number of described virtual terminal devices allocation;
The first bus is determined subelement, for choosing bus from the bus of described PCIE server for described virtual terminal equipment, the bus number of choosing for described virtual terminal equipment equals described the first quantity and determines that definite described of subelement is the bus number of described virtual terminal devices allocation.
9. PCIE server as claimed in claim 8, it is characterized in that, described trigger element, specifically for giving described interchanger by a described PCIE bus transmit port open command, opens to trigger described interchanger the port that connects described PCIE server and described physical terminal equipment.
10. PCIE server as claimed in claim 9, is characterized in that, described Secondary resource descriptor comprises the required bus number of described physical terminal equipment and memory headroom, and described Secondary resource descriptor carries the function information of described physical terminal equipment;
Described the second allocation units comprise:
Second divides subelement, and for dividing the second storage resources from described the first storage resources, the storage space of described the second storage resources equals described physical terminal equipment required memory space;
The second quantity is determined subelement, for judging according to the function information of described physical terminal equipment whether described physical terminal equipment comprises single node input and output virtualization information, if comprise, be defined as the bus number of described physical terminal devices allocation, describedly equal the required bus number of described physical terminal equipment for the bus number of described physical terminal devices allocation;
The second bus is determined subelement, for choosing bus from the bus of choosing for described virtual terminal equipment for described physical terminal equipment, the bus number of choosing for described physical terminal equipment equal described the second quantity determine subelement definite be the bus number of described physical terminal devices allocation;
Send subelement, be used for plot and the storage space of the second storage resources of described the second division subelement division, and described the second bus determines that the numbering of the bus for described physical terminal devices allocation that subelement is determined is sent to described physical terminal equipment by described port.
11. 1 kinds of interchangers, is characterized in that, comprising:
Receiving element, for receiving described PCIE server, by the first resource descriptor of the virtual terminal equipment of a PCIE bus transmission, obtain request, described virtual terminal equipment is built in described interchanger, and described interchanger is the interchanger on access PCIE interface before the electricity on described PCIE server;
Transmitting element, the request of obtaining receiving for responding described receiving element, sends to described PCIE server by the first resource descriptor of described virtual terminal equipment by a described PCIE bus;
Described receiving element, for what receive that described PCIE server sends by a described PCIE bus, be also the first resource of described virtual terminal devices allocation, described first resource is that described PCIE server is according to the resource of described first resource descriptor distribution;
Detecting unit, for detecting whether there is interchanger described in the physical terminal equipment access corresponding with described virtual terminal equipment by the 2nd PCIE bus;
Described transmitting element, also when interchanger being detected described in the physical terminal equipment access corresponding with described virtual terminal equipment when described detecting unit, the Secondary resource descriptor of the physical terminal equipment corresponding with described virtual terminal equipment is sent to described PCIE server by a described PCIE bus;
Described receiving element, the port open instruction also sending by a described PCIE bus for receiving described PCIE server, open the port that connects described PCIE server and described physical terminal equipment, to trigger described PCIE server, by described port, the Secondary resource in described first resource is distributed to described physical terminal equipment, described port open instruction be when described first resource is more than or equal to the described resource of described Secondary resource descriptor described in the instruction that sends over of PCIE server, described Secondary resource is the described resource of described Secondary resource descriptor.
12. interchangers as claimed in claim 11, is characterized in that, described first resource descriptor comprises the required bus number of described virtual terminal equipment and memory headroom, and described first resource descriptor carries the function information of described virtual terminal equipment.
CN201410309001.4A 2014-06-30 2014-06-30 A kind of resource allocation methods and relevant apparatus Active CN104123188B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410309001.4A CN104123188B (en) 2014-06-30 2014-06-30 A kind of resource allocation methods and relevant apparatus
PCT/CN2015/076989 WO2016000475A1 (en) 2014-06-30 2015-04-20 Resource allocating method and apparatus related thereto

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410309001.4A CN104123188B (en) 2014-06-30 2014-06-30 A kind of resource allocation methods and relevant apparatus

Publications (2)

Publication Number Publication Date
CN104123188A true CN104123188A (en) 2014-10-29
CN104123188B CN104123188B (en) 2017-10-24

Family

ID=51768609

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410309001.4A Active CN104123188B (en) 2014-06-30 2014-06-30 A kind of resource allocation methods and relevant apparatus

Country Status (2)

Country Link
CN (1) CN104123188B (en)
WO (1) WO2016000475A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016000475A1 (en) * 2014-06-30 2016-01-07 华为技术有限公司 Resource allocating method and apparatus related thereto
CN109684084A (en) * 2018-12-12 2019-04-26 浪潮(北京)电子信息产业有限公司 A kind of distribution method of bus resource, system and associated component
CN112035309A (en) * 2020-09-07 2020-12-04 深圳市亿道信息股份有限公司 Automatic testing method, server and automatic testing system for intelligent terminal function
WO2023221525A1 (en) * 2022-05-19 2023-11-23 华为技术有限公司 Resource allocation method and apparatus of circuit board, circuit board, and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948310B (en) * 2021-03-25 2023-04-14 山东英信计算机技术有限公司 Resource allocation method, device, equipment and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226515A (en) * 2008-01-31 2008-07-23 华为技术有限公司 Method and apparatus for distributing resource of hot-plug bus interface
US7752360B2 (en) * 2007-05-16 2010-07-06 Nuova Systems, Inc. Method and system to map virtual PCIe I/O devices and resources to a standard I/O bus
CN102117259A (en) * 2009-12-31 2011-07-06 成都市华为赛门铁克科技有限公司 Method and device for allocating and processing address space resource
CN102819447A (en) * 2012-05-29 2012-12-12 中国科学院计算技术研究所 Direct I/O virtualization method and device used for multi-root sharing system
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
CN103501242A (en) * 2013-09-18 2014-01-08 华为技术有限公司 Resource management method and multiple-node cluster device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104123188B (en) * 2014-06-30 2017-10-24 华为技术有限公司 A kind of resource allocation methods and relevant apparatus

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7752360B2 (en) * 2007-05-16 2010-07-06 Nuova Systems, Inc. Method and system to map virtual PCIe I/O devices and resources to a standard I/O bus
CN101226515A (en) * 2008-01-31 2008-07-23 华为技术有限公司 Method and apparatus for distributing resource of hot-plug bus interface
CN102117259A (en) * 2009-12-31 2011-07-06 成都市华为赛门铁克科技有限公司 Method and device for allocating and processing address space resource
CN102819447A (en) * 2012-05-29 2012-12-12 中国科学院计算技术研究所 Direct I/O virtualization method and device used for multi-root sharing system
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
CN103501242A (en) * 2013-09-18 2014-01-08 华为技术有限公司 Resource management method and multiple-node cluster device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016000475A1 (en) * 2014-06-30 2016-01-07 华为技术有限公司 Resource allocating method and apparatus related thereto
CN109684084A (en) * 2018-12-12 2019-04-26 浪潮(北京)电子信息产业有限公司 A kind of distribution method of bus resource, system and associated component
CN112035309A (en) * 2020-09-07 2020-12-04 深圳市亿道信息股份有限公司 Automatic testing method, server and automatic testing system for intelligent terminal function
CN112035309B (en) * 2020-09-07 2024-04-09 深圳市亿道信息股份有限公司 Automatic testing method, server and automatic testing system for intelligent terminal function
WO2023221525A1 (en) * 2022-05-19 2023-11-23 华为技术有限公司 Resource allocation method and apparatus of circuit board, circuit board, and storage medium

Also Published As

Publication number Publication date
WO2016000475A1 (en) 2016-01-07
CN104123188B (en) 2017-10-24

Similar Documents

Publication Publication Date Title
CN109766302B (en) Method and device for managing equipment
CN104123188A (en) Resource allocating method and related devices
CN109634720B (en) Method, system and device for sharing FPGA (field programmable Gate array) board card by multiple virtual machines
CN102707991A (en) Multi-root I/O (Input/Output) virtualization sharing method and system
CN109324991B (en) Hot plug device, method, medium and system of PCIE (peripheral component interface express) equipment
CN104363486B (en) A kind of the USB sharing methods and combination tv of combination tv
CN111984557A (en) Data processing method, device and system
CN105893289B (en) Memory maps I/O Address distribution method, device and computer system
WO2018228344A1 (en) Internal memory compaction method and apparatus, electronic device and readable storage medium
CN108228350A (en) A kind of resource allocation methods and device
CN116483740B (en) Memory data migration method and device, storage medium and electronic device
CN109614354B (en) Interface distribution method, board card, equipment and storage medium
CN114153549A (en) Virtual machine creation method and related equipment
CN103475494A (en) CC-NUMA system and starting method thereof
WO2016023276A1 (en) Data processing method and device for storage card
WO2015043175A1 (en) Server system and operation system starting method thereof, and starting management node
CN114637473A (en) Virtual resource allocation method and device, electronic equipment and storage medium
CN114281516A (en) Resource allocation method and device based on NUMA attribute
CN109002347B (en) Virtual machine memory allocation method, device and system
CN107729140B (en) Device and method for realizing command queuing functions of multiple eMMC host interfaces in parallel
EP2017740B1 (en) Method for data transfer between host and device
CN115442239B (en) Bandwidth resource allocation method, PCIe channel switcher and electronic device
CN111949414B (en) Method, system, terminal and storage medium for optimizing performance of storage controller
CN117971135B (en) Storage device access method and device, storage medium and electronic device
US11989420B2 (en) Memory allocation method and apparatus, electronic device, and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant