CN-121996425-A - Bus number resource allocation method and electronic equipment
Abstract
The invention discloses a bus number resource allocation method and electronic equipment, and relates to the technical field of servers. According to the scheme, when bandwidth allocation is executed in an initialization stage, the number of bus numbers corresponding to all ports is determined according to the equipment type of equipment connected with all ports, so that bus number pre-allocation results are generated, average allocation of bus number resources is avoided, the appropriate bus number numbers are allocated for the equipment in combination with the actual type of the equipment, the adaptation requirements of different equipment on the bus numbers are met, stronger equipment compatibility is achieved, finally, all the equipment is enumerated according to the bus number pre-allocation results and corresponding bus numbers are allocated for all the ports based on a driver execution environment stage, on-demand allocation of bus number resources is realized, restarting caused by insufficient bus number resources is avoided, and the competitiveness of products is effectively improved.
Inventors
- ZHU HESONG
- XU SHENGJUN
- YAO FANYI
Assignees
- 苏州元脑智能科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260128
Claims (10)
- 1. A bus number resource allocation method, comprising: When bandwidth allocation is executed in an initialization stage, reading hardware signals of equipment connected with each port, and determining equipment types corresponding to the equipment according to each hardware signal; Determining the number of bus numbers corresponding to the root ports based on the corresponding equipment types to generate a bus number pre-allocation result; Based on a driver execution environment stage, enumerating each device according to the bus number pre-allocation result and allocating the corresponding bus number for each root port.
- 2. The bus number resource allocation method according to claim 1, wherein reading hardware signals of devices connected to each root port, and determining a device type corresponding to the devices according to each hardware signal, comprises: Reading the hardware signals of the equipment connected with each root port through an inter-integrated circuit bus, wherein the hardware signals at least comprise bandwidth allocation information corresponding to the root ports and hardware information of the connected equipment, and the hardware information at least comprises hard disk backboard information, graphic processing unit switcher information and information of a field replaceable unit connected through a transfer card; And determining the equipment type corresponding to the equipment according to the hardware information, wherein the equipment type at least comprises a hard disk backboard, a graphic processing unit switcher and a field replaceable unit.
- 3. The bus number resource allocation method according to claim 2, wherein determining the number of bus numbers corresponding to the root ports based on the corresponding device type to generate a bus number pre-allocation result comprises: When the equipment type is the hard disk backboard, determining the number of the bus numbers corresponding to the root port as a first number; Judging whether the number of the graphic processing units accessed under the graphic processing unit switcher is larger than a first threshold value or not when the equipment type is the graphic processing unit switcher, if the number of the graphic processing units is confirmed not to be larger than the first threshold value, determining the number of the bus numbers corresponding to the root ports to be a second number, and if the number of the graphic processing units is confirmed to be larger than the first threshold value, determining the number of the bus numbers corresponding to the root ports to be a third number; Judging whether the field replaceable unit is a data processing unit or not when the equipment type is the field replaceable unit, determining the number of the bus numbers corresponding to the root ports to be the third number if the field replaceable unit is confirmed to be the data processing unit, and determining the number of the bus numbers corresponding to the root ports to be the first number if the field replaceable unit is confirmed not to be the data processing unit; wherein the first number is less than the second number, and the second number is less than the third number.
- 4. The bus number resource allocation method according to claim 1, further comprising: monitoring operation performance indexes of each device based on a driver execution environment stage, wherein the operation performance indexes at least comprise link throughput, device interrupt request frequency and direct memory access bandwidth utilization rate; Respectively determining a comprehensive performance score of the corresponding equipment according to the link throughput, the equipment interrupt request frequency and the direct memory access bandwidth utilization rate; When the comprehensive performance score is larger than a second threshold value and the corresponding duration time is larger than a preset period, increasing the number of bus numbers corresponding to the root port where the equipment is located; When the comprehensive performance score is smaller than a third threshold value and the corresponding duration time is larger than a preset period, reducing the number of the bus numbers corresponding to the root port where the equipment is located; wherein the second threshold is greater than the third threshold.
- 5. The bus number resource allocation method according to claim 1, further comprising: after the starting is completed and the operating system is entered, monitoring the hot plug event of the equipment of each root port; When the hot plug event of the equipment is monitored, determining idle equipment in an idle state in all the equipment according to the actual use state of all the current bus numbers; Determining the bus number of the idle device corresponding to the root port according to the bus number pre-allocation result; And distributing the bus number of the idle device corresponding to the root port to a target root port where the newly inserted device is located.
- 6. The bus number resource allocation method according to claim 1, further comprising, when performing bandwidth allocation in an initialization phase: judging whether the equipment connected with the root port is target equipment supporting single-root input-output virtualization or not; if yes, determining the function type of the target equipment, wherein the function type comprises a physical function and a virtual function; and when the function type is a virtual function, determining the number of the bus numbers of the root port where the target equipment is located according to the service quality policy of the virtualization tenant associated with the target equipment.
- 7. The bus number resource allocation method according to claim 3, further comprising, when confirming that the field replaceable unit is the data processing unit: acquiring the type of a software function module currently loaded in the data processing unit through an equipment driving interface; Determining the number of the bus numbers of the data processing unit corresponding to the root port according to a first preset mapping table constructed in advance; the first preset mapping table comprises mapping relations between a plurality of different software function modules and corresponding bus number quotas.
- 8. The bus number resource allocation method according to any one of claims 1 to 7, wherein enumerating each of the devices according to the bus number pre-allocation result and allocating the corresponding bus number to each of the root ports based on a driver execution environment stage, comprises: generating a second preset mapping table containing mapping relation between each root port and the number corresponding to the bus number based on the bus number pre-allocation result; And the operating system executes the allocation of the bus numbers according to the second preset mapping table.
- 9. The bus number resource allocation method according to claim 8, further comprising, after enumerating each of the devices according to the bus number pre-allocation result and allocating a corresponding bus number to each of the root ports based on a driver execution environment stage: generating and storing a bus number allocation decision log; The bus number allocation decision log at least comprises the identification of the equipment, the number and the range corresponding to the bus number and the event type triggering allocation.
- 10. An electronic device, comprising: A memory for storing a computer program; processor for implementing the steps of the bus numbered resource allocation method according to any of claims 1 to 9 when executing said computer program.
Description
Bus number resource allocation method and electronic equipment Technical Field The present invention relates to the field of server technologies, and in particular, to a bus number resource allocation method and an electronic device. Background Currently, a Basic Input/Output System (BIOS) performs an average allocation of BUS number (BUS number) resources of each root port (root port) of a central processing unit (Central Processing Unit, CPU) by default, which is because an expedient taken by the downstream high-speed serial computer expansion BUS standard (PERIPHERAL COMPONENT INTERCONNECT EXPRESS, PCIe) device information cannot be known in an early initialization stage. And then in the PCIe enumeration process, readjusting the BUS number range of each port according to the actual requirement of the equipment, storing the data in a variable (variable), and enabling the new allocation to be effective by the system through one-time restarting, thereby completing the equipment enumeration and power-on self-checking starting. However, with the popularity of PCIe devices such as data processing units (Data Processing Unit, DPUs), the number of BUS resources required is up to 40-60 or more, whereas in a multi-CPU configuration, the average allocation makes each root port only about 16 BUS, which is far lower than the DPU requirement, resulting in the need for additional reboot for the first power-up, significantly extending the boot time. In addition, the number of virtual devices of the DPU can be flexibly adjusted through firmware under an operating system, but the fixed BUS number allocation cannot be dynamically adapted when the BIOS is started, and insufficient resources can occur when the number of the virtual devices is increased, so that successful configuration of the DPU is prevented. In view of the above, how to solve the problem that the existing BIOS allocates BUS number evenly, which causes insufficient DPU resources and has to be restarted, and the dynamic adjustment requirement thereof conflicts with the BIOS static allocation is a urgent problem to be solved by those skilled in the art. Disclosure of Invention The invention provides a BUS number resource allocation method and electronic equipment, which at least solve the problems that the DPU resource is insufficient and must be restarted due to the average allocation of BUS numbers by the BIOS at present, and the dynamic adjustment requirement of the DPU resource is in conflict with the static allocation of the BIOS. The invention provides a bus number resource allocation method, which comprises the following steps: when bandwidth allocation is executed in an initialization stage, reading hardware signals of equipment connected with each port, and determining equipment types of corresponding equipment according to each hardware signal; Determining the number of bus numbers corresponding to each port based on the corresponding equipment type so as to generate a bus number pre-allocation result; Based on the execution environment stage of the driver program, enumerating each device according to the bus number pre-allocation result and allocating corresponding bus numbers for each root port. The invention also provides electronic equipment which comprises a memory and a processor, wherein the memory is used for storing a computer program, and the processor is used for realizing any step of the bus number resource allocation method when executing the computer program. The invention also provides a computer readable storage medium, in which a computer program is stored, wherein the computer program when executed by a processor implements the steps of any of the bus number resource allocation methods described above. The invention also provides a computer program product comprising a computer program which when executed by a processor implements the steps of any of the bus number resource allocation methods described above. The method has the advantages that when bandwidth allocation is executed in an initialization stage, the number of bus numbers corresponding to each port is determined according to the equipment type of equipment connected with each port, so that a bus number pre-allocation result is generated, average allocation of bus number resources is avoided, the appropriate number of bus numbers is allocated for the equipment according to the actual type of the equipment, the adaptation requirements of different equipment on the bus numbers are met, stronger equipment compatibility is achieved, finally, the equipment is enumerated according to the bus number pre-allocation result and corresponding bus numbers are allocated for each port based on a driver execution environment stage, the on-demand allocation of the bus number resources is realized, restarting caused by insufficient bus number resources is avoided, and the competitiveness of products is effectively improved. In addition, the invention also provides bus number resource all