Resource configuration method, storage medium, electronic device and program product
By reading the device identification information when the server is started and turning on the hot-swap function, the problem of insufficient resource reservation in the smart network card is solved, ensuring the normal use of data processing equipment and improving user experience.
Patent Information
- Application Number
- CN202510725421.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-05-30
AI Technical Summary
When smart network cards contain more devices, the existing technology requires resource reservation in advance, resulting in the inability to effectively allocate resources, and some devices cannot be used, affecting the user experience.
When the server is started, the basic input and output system is used to read the device identification information, determine the memory resource requirements of the data processing device, and enable the hot-swap function of the external interconnection link, and then configure it according to the reserved resources when the operating system enters to avoid repeated allocation.
Ensure that data processing equipment can be used normally at any time, improve user experience, and avoid the problem of equipment failure caused by insufficient resources.
Smart Images

Figure CN120234159B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a resource configuration method, a storage medium, an electronic device, and a program product. Background Art
[0002] The Data Processing Unit Smart Network Interface Card (DPU) is an advanced network interface card (NIC) that integrates the functionality of a data processing unit (DPU). It not only possesses the basic functions of a traditional NIC but also adds powerful data processing capabilities, reducing the burden on the central processing unit (CPU) and improving the overall efficiency and performance of the data center.
[0003] Currently, relevant technologies require that resources be reserved for the smart network card in advance when applying it, and then resources are allocated to all devices in the server according to the reserved resources when the server starts. However, when the smart network card contains a large number of devices, resources cannot be effectively allocated, which in turn causes some devices to be unusable, affecting the user experience. Summary of the Invention
[0004] The present disclosure provides a resource configuration method, storage medium, electronic device, and program product. Its primary purpose is to address the problem that, in related technologies, resources for a smart network card must be reserved in advance when it is used, and then resources are allocated to all devices in the server according to the reserved resources when the server is started. However, when a smart network card contains a large number of devices, this can lead to an inability to effectively allocate resources, resulting in some devices being unusable and affecting the user experience.
[0005] In a first aspect, the present application provides a resource allocation method, comprising:
[0006] In response to the processor entering the basic input and output system, sequentially reading identification information of multiple devices connected to the processor, the identification information being used to determine device types of the multiple devices;
[0007] determining, based on the identification information, a first memory resource required for operation of the data processing device when it is determined that the data processing device exists among the plurality of devices;
[0008] Reserving memory resources for the data processing device according to the first memory resource, and enabling a hot-swap function of a first external interconnection link connected to the data processing device;
[0009] In response to the processor entering the operating system, if it is identified that the hot-plug function of the first external interconnection link is enabled, memory resources of the data processing device are configured according to the memory resources reserved by the basic input and output system.
[0010] In a second aspect, the present application provides a resource configuration device, comprising:
[0011] a reading module configured to, in response to the processor entering the basic input and output system, sequentially read identification information of a plurality of devices connected to the processor, the identification information being used to determine device types of the plurality of devices;
[0012] a determination module configured to determine, based on the identification information, a first memory resource required for the operation of the data processing device when it is determined that the data processing device exists among the multiple devices;
[0013] a reservation module configured to reserve memory resources for the data processing device according to the first memory resource and enable a hot-swap function of a first external interconnection link connected to the data processing device;
[0014] The configuration module is configured to, in response to the processor entering the operating system, configure memory resources of the data processing device according to the memory resources reserved by the basic input and output system if it is recognized that the hot plug function of the first external interconnection link is enabled.
[0015] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the method of the first aspect when the computer program is executed by a processor.
[0016] In a fourth aspect, the present application provides an electronic device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the method of the first aspect when executing the computer program.
[0017] In a fifth aspect, the present application provides a computer program product having a computer program stored thereon, which implements the method of the first aspect when the computer program is executed by a processor.
[0018] The present disclosure provides a resource configuration method, storage medium, electronic device, and program product, wherein the method comprises: in response to a processor entering a basic input / output system, sequentially reading identification information of multiple devices connected to the processor, the identification information being used to determine the device types of the multiple devices; based on the identification information, if it is determined that a data processing device exists among the multiple devices, determining a first memory resource required for the operation of the data processing device; reserving memory resources for the data processing device according to the first memory resource, and enabling a hot-swap function of a first external interconnection link connected to the data processing device; and in response to the processor entering an operating system, if it is identified that the hot-swap function of the first external interconnection link is enabled, configuring memory resources for the data processing device according to the memory resources reserved by the basic input / output system. Compared with related technologies, the present application responds to the processor entering the basic input and output system, sequentially reading the identification information of multiple devices connected to the processor; based on the identification information, if it is determined that a data processing device exists among the multiple devices, determining the first memory resource required for the operation of the data processing device; reserving memory resources for the data processing device according to the first memory resource, and turning on the hot-plug function of the first external interconnection link connected to the data processing device; in response to the processor entering the operating system, if it is identified that the hot-plug function of the first external interconnection link is turned on, then configuring the memory resources of the data processing device according to the memory resources reserved by the basic input and output system. By utilizing the basic input and output system to actively identify the device when the server starts and turning on the hot-plug function of the external interconnection link where the device is located, when the server enters the operating system, the operating system will reallocate the memory resources under the system. Even if the basic input and output system has completed the memory resource allocation, the system will still reallocate the memory resources. Because memory resources are limited and the location information of the data processing device cannot be fixed, according to the function of the parameters, no resources can be allocated to the data processing device identified later because the memory resources have been allocated. However, the external interconnection link with the hot-swap function turned on does not need to reallocate memory resources. Therefore, the basic input and output system needs to turn on the hot-swap function of the external interconnection link where the data processing device is located by default to avoid the system reallocation again causing the data processing device to be unable to be used normally. This can ensure that the data processing device can be used normally at any time, and there is no need to worry about the data processing device being unable to be used due to resource problems, thereby improving the user experience.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] Figure 1 A schematic diagram of a resource configuration method according to an embodiment of the present invention is shown;
[0022] Figure 2 A schematic diagram showing a flow chart of another resource configuration method provided in an embodiment of the present application is shown;
[0023] Figure 3 A schematic structural diagram of an example provided in an embodiment of the present application is shown;
[0024] Figure 4 A schematic structural diagram of an example provided in an embodiment of the present application is shown;
[0025] Figure 5 A schematic diagram of an example process provided by an embodiment of the present application is shown;
[0026] Figure 6 A schematic diagram of the structure of a resource configuration device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0027] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0028] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0029] A Smart Network Interface Card (SmartNIC) is a flexible and programmable network interface card (NIC) designed for use with servers. Because SmartNICs possess computing power, they offload data processing functions unsuitable for CPUs, such as networking, security, and storage, to programmable hardware chips to free up CPU power. This reduces CPU consumption, enables servers to run critical applications and operating systems more efficiently, and optimizes overall business data processing efficiency. The development of SmartNICs has been divided into three phases: the first phase: basic function NICs; the second phase: hardware offload NICs (first-generation SmartNICs (SNICs); and the third phase: data processing unit (DPU) SmartNICs, which fully offload security-related functions (data and control planes). The third-phase DPU is a specialized processor focused on data processing, providing virtualized services for data center infrastructure, including networking, storage, security, and management. It utilizes a computing architecture composed of CPUs based on architectures such as ARM (Advanced RISC Machine) or X86, and specialized hardware acceleration engines such as application-specific integrated circuits (ASICs), network processors (NPs), and field-programmable gate arrays (FPGAs), forming the entity that delivers virtualization capabilities. Based on the basic concepts described above, DPU products are currently widely used in data center servers of various architectures, including but not limited to X86 and ARM architectures. However, regardless of the architecture, SmartNICs require resource reservation in advance when used in servers with SmartNICs. This is because SmartNICs contain multiple devices, such as network ports, virtual network cards, and physical or virtual storage devices like solid-state drives (SSDs). These devices require memory resources, and some memory resources are prioritized. For example, the maximum capacity of 32-bit memory is limited to 4GB. What happens if a 32-bit system runs low on resources? Because SmartNICs require significant 32-bit resources, insufficient resources can result in a black screen when the device boots and enters the operating system. This can also cause a black screen when viewing the system through the remote board management controller (BMC) management interface and the kernel-based virtual machine (KVM). However, normal display output is required for normal use.
[0030] In order to improve the related technology, when applying smart network cards, resources need to be reserved for the smart network cards in advance, and then resources are allocated to all devices in the server according to the reserved resources when the server is started. However, when the smart network card contains many devices, it will lead to the inability to effectively allocate resources, and then some devices cannot be used, affecting the user experience. This embodiment provides a resource configuration method, such as Figure 1 As shown, the method comprises the following steps:
[0031] Step 101 : In response to a processor entering a basic input / output system, identification information of multiple devices connected to the processor is sequentially read.
[0032] The identification information is used to determine the device types of the multiple devices.
[0033] In the embodiments of the present application, the Basic Input / Output System (BIOS) is a firmware interface in a computer. It is the first thing that runs when the computer starts up and is responsible for initializing and testing hardware components and loading the operating system. Specifically, when the computer is powered on, the CPU begins executing BIOS code from a predefined address (usually 0xFFFF0). The BIOS performs hardware detection and initialization operations, searches for bootable devices according to the predefined boot order, and after finding a suitable boot device, the BIOS loads the boot loader in its Master Boot Record (MBR). The boot loader further loads the operating system kernel, and then transfers control to the operating system.
[0034] In some examples, the identification information of multiple devices connected to the processor can specifically be a device identification code (Device ID, DID) and a vendor identification code (Vendor ID, VID). Specifically, the basic input and output system reads the DID and VID of each PCI device during the peripheral component interconnect (PCI) enumeration stage of the driver execution environment (DXE) stage.
[0035] In this embodiment, within the Unified Extensible Firmware Interface (UEFI) framework, the DXE phase is a key part of system initialization, which involves identifying and initializing hardware components, including enumerating PCI devices. This process does involve reading the DID and VID of each PCI device in order to correctly identify and configure these devices.
[0036] It should be noted that by identifying the identification information of the device, the device type can be determined, specifically whether the device is a data processing device or an external interconnection device. Among them, the data processing device can be a data processing unit (DPU) device, and the external interconnection device can be a PCI device.
[0037] Step 102: When it is determined based on the identification information that a data processing device exists among the multiple devices, determine first memory resources required for the operation of the data processing device.
[0038] In the embodiments of this application, the Data Processing Unit (DPU) is a new type of processor unit designed specifically for data centers, designed to optimize data processing tasks within the data center. The DPU not only possesses powerful computing capabilities but also integrates networking, storage, and security functions, significantly reducing the burden on the CPU and improving the overall efficiency and performance of the data center.
[0039] In some examples, the first memory resource may be a memory resource required for the operation of the data processing device.
[0040] Step 103: reserve memory resources for the data processing device according to the first memory resources, and enable the hot-swap function of the first external interconnection link connected to the data processing device.
[0041] In this embodiment, hot swapping (or hot plugging) refers to the ability to add or remove hardware components while a computer system or device is running without shutting down the power. This technology significantly improves system availability and flexibility and is particularly suitable for server and storage environments requiring high availability. Specifically, hot swapping refers to the ability to safely insert or remove devices while the system is running without causing system crashes or other negative effects.
[0042] It should be noted that Smart NIC devices require 32-bit memory addresses, and the server's 32-bit memory address resources are limited, with a maximum capacity of 4GB. Therefore, it is necessary to reserve resources for the Smart NIC in advance. At the same time, when the server starts, the system will allocate resources to all server devices. Resource allocation includes both reserved resources and currently identified device resource allocation. If there are too many devices at startup, some device resources will not be effectively allocated. In other words, 4GB of 32-bit resources cannot meet the total device demand, exceeding the 4GB limit, which will cause some devices to become unusable. If the 32-bit resources occupied by all devices on the current server's PCI link do not exceed the 4GB capacity limit, there is no need to worry about DPU or display issues in the system. However, if the 32-bit resource demand of all devices in the system exceeds 4GB and the reserved resources are insufficient, the system devices will not function properly, especially devices such as the DPU. To address the issue of DPU devices being unusable due to excessive resource reservation, we reallocated resources by adding the pci=realloc parameter to the Grand Unified Bootloader (Grub) configuration file at system startup. At the same time, the BIOS enabled the hotplug feature in the PCI link's PCI configuration space. When the server boots and enters the operating system, the system reallocates the server's entire PCI link's memory-mapped input / output (MMIO) 32 memory resources based on the hotplug feature enabled on the PCI link and the Grub configuration parameter settings.
[0043] Step 104 : In response to the processor entering the operating system, if it is identified that the hot-plug function of the first external interconnection link is enabled, memory resources of the data processing device are configured according to the memory resources reserved by the basic input / output system.
[0044] In the embodiments of the present application, the process of the processor entering the operating system is a key step in the computer startup process, involving the transition from hardware initialization to the operating system taking over system control. This process typically includes BIOS or UEFI firmware initialization, boot loader execution, and operating system loading and initialization.
[0045] In some examples, when the server boots up and enters the operating system, the system reallocates the MMIO 32 memory resources of the entire PCI link of the server based on whether the hotplug function attribute of the PCI link is enabled and the Grub parameter setting.
[0046] Compared to related technologies, this embodiment, in response to a processor entering a basic input / output system (BIOS), sequentially reads identification information of multiple devices connected to the processor; based on the identification information, if it is determined that a data processing device exists among the multiple devices, determines the first memory resource required for the operation of the data processing device; reserves memory resources for the data processing device according to the first memory resource, and enables the hot-swap function of a first external interconnection link connected to the data processing device; in response to the processor entering an operating system, if it is identified that the hot-swap function of the first external interconnection link is enabled, configures memory resources for the data processing device according to the memory resources reserved by the BIOS. By utilizing the BIOS to actively identify devices when the server starts and enabling the hot-swap function of the external interconnection link where the device is located, when the server enters the operating system, the operating system will reallocate memory resources under the system, and even if the BIOS has completed memory resource allocation, the system will still reallocate memory resources. Because memory resources are limited and the location information of the data processing device cannot be fixed, according to the function of the parameters, no resources can be allocated to the data processing device identified later because the memory resources have been allocated. However, the external interconnection link with the hot-swap function turned on does not need to reallocate memory resources. Therefore, the basic input and output system needs to turn on the hot-swap function of the external interconnection link where the data processing device is located by default to avoid the system reallocation again causing the data processing device to be unable to be used normally. This can ensure that the data processing device can be used normally at any time, and there is no need to worry about the data processing device being unable to be used due to resource problems, thereby improving the user experience.
[0047] Furthermore, as a refinement and extension of the above embodiment, the following methods may be used but are not limited to: Figure 2 As shown, the method includes:
[0048] Step 201: In response to a processor entering a basic input / output system, identification information of multiple devices connected to the processor is sequentially read.
[0049] The identification information is used to determine the device types of the multiple devices.
[0050] In the embodiments of this application, Figure 3 The figure shows a physical connection diagram of the devices in the processor. Specifically, the processor may include a CPU, BIOS, BMC, DPU card, etc. Figure 4 Shown is a physical schematic diagram of the DPU.
[0051] For example, when the server starts, the BIOS reads the device identification code and vendor identification code of each PCI device during the PCI enumeration phase of the Driver Execution Environment (DXE) phase, and determines whether the processor includes a DPU device (i.e., the data processing device in the embodiment of the present application) by identifying the device identification code and the vendor identification code.
[0052] Step 202: When it is determined based on the identification information that a data processing device exists among the multiple devices, determine first memory resources required for the operation of the data processing device.
[0053] In some examples, the first memory resource may be a memory resource required for the operation of the data processing device.
[0054] For example, if it is determined in the basic input and output system that the device 1 is a data processing device, it is necessary to determine the memory resources required by the device 1 for running the operating system.
[0055] Step 203: Determine whether the first external interconnection link is connected to an external interconnection device.
[0056] In this embodiment, the first external interconnection link may be a link where the data processing device is located.
[0057] Illustratively, when it is determined that a data processing device exists in the first external interconnection link, it is further determined whether an external interconnection device, ie, a PCI device, is connected to the first external interconnection link.
[0058] Step 204: reserve memory resources for the data processing device according to the first memory resources, and enable the hot-swap function of the first external interconnection link connected to the data processing device.
[0059] Optionally, step 204 may specifically include: when it is determined that the first external interconnection link is not connected to the external interconnection device, determining the first memory resource as the total memory resource corresponding to the first external interconnection link; reserving memory resources for the first external interconnection link based on the total memory resources, and turning on the hot plug function of the first external interconnection link.
[0060] As an optional method, when it is determined that the first external interconnection link is not connected to the external interconnection device, that is, only connected to the data processing device, the first memory resources required for the operation of the data processing device are determined as the total memory resources required for the operation of the first external interconnection link, and the hot plug function of the first external interconnection link is turned on.
[0061] Optionally, step 204 specifically also includes: when it is determined that the first external interconnection link is connected to an external interconnection device, determining the second memory resources required for the operation of the first external interconnection device connected to the first external interconnection link; accumulating the first memory resources and the second memory resources, and determining the accumulation result as the total memory resources; reserving memory resources for the first external interconnection link based on the total memory resources, and turning on the hot plug function of the first external interconnection link.
[0062] Exemplarily, when it is determined that the first external interconnection link is also connected to an external interconnection device, it is necessary to determine the second memory resources required for the operation of the first external interconnection device connected to the first external interconnection link, determine the cumulative value of the first memory resources required for the operation of the data processing device and the second memory resources required for the operation of the external interconnection link as the total memory resources of the first external interconnection link, and enable the hot-swap function of the first external interconnection link.
[0063] As an optional method, when the server starts, the BIOS reads the DID and VID of each PCI device during the PCI enumeration phase of the DXE stage; confirms whether the current device is a DPU device. If not, there is no need to reserve 32-bit memory resources; if it is a DPU device, 32-bit resources are reserved based on the known 32-bit resource size of the DPU; at the same time, the PCI link physically connected to the current DPU accumulates the MMIO 32-bit resources reserved by the DPU when counting the 32-bit resources required by other PCI devices. At the same time, the BIOS enables the hot-plug function of the PCI configuration space of the bridge of the PCI link physically connected to the DPU.
[0064] Step 205 : In response to the processor entering the operating system, if it is identified that the hot-plug function of the first external interconnection link is enabled, memory resources of the data processing device are configured according to the memory resources reserved by the basic input and output system.
[0065] Optionally, step 205 may specifically include: based on the identification information, when it is determined that there is no data processing device among the multiple devices, determining whether there is an external interconnection device among the multiple devices; when it is determined that there is an external interconnection device among the multiple devices, determining a third memory resource required for the operation of a second external interconnection device existing in the multiple devices; reserving memory resources for the second external interconnection device according to the third memory resource, and turning on the hot-swap function of the second external interconnection link connected to the second external interconnection device.
[0066] For this embodiment, if it is determined based on the identification information that there is no data processing device, it is necessary to continue to determine whether there is an external interconnection device among the multiple devices. If there is an external interconnection device, it is necessary to determine the memory resources required for the operation of the existing external interconnection device, that is, the third memory resources required for the operation of the second external interconnection device in the embodiment of the present application. Memory resources are reserved for the second external interconnection device according to the third memory resources, and the hot-swap function of the second external interconnection link connected to the second external interconnection device is turned on.
[0067] Optionally, step 205 specifically further includes: in response to the processor entering the operating system, if it is identified that the hot plug function of the first external interconnection link is enabled, configuring memory resources for the data processing device according to total memory resources.
[0068] For example, in response to the completion of resource reservation in the basic input and output system, the processor enters the operating system, and the operating system adds the PCI=realloc parameter to the boot loader configuration (Grub) parameters by default; at this time, the operating system will reallocate all PCI resources of the server.
[0069] In some examples, pci=realloc is a Linux kernel boot parameter that is mainly used to affect the allocation behavior of PCI device resources. When the system detects that PCI device resources have overlap or conflicts, using this parameter can instruct the kernel to try to reallocate these resources to avoid conflicts and ensure that all devices can work properly.
[0070] For example, after the processor enters the operating system, it is necessary to determine whether the hot-plug function of multiple external interconnection links is enabled. When it is determined that the hot-plug function of the first external interconnection link is enabled, it is necessary to configure the memory resources of the data processing device according to the total memory resources reserved by the basic input and output system.
[0071] Optionally, step 205 specifically also includes: in response to the processor entering the operating system, if it is identified that the hot plug function of the first external interconnection link is turned on, memory resources of the data processing device are configured according to the first memory resources in the total memory resources, and memory resources of the first external interconnection device are configured according to the second memory resources in the total memory resources.
[0072] In this embodiment, after the processor enters the operating system, it is necessary to determine whether the hot-swap function of multiple external interconnection links is enabled. When it is determined that the hot-swap function of the first external interconnection link is enabled, memory resources of the data processing device can be configured according to the first memory resource in the total memory resources reserved for the basic input and output system, and memory resources of the first external interconnection device can be configured according to the second memory resource in the total memory resources reserved for the basic input and output system.
[0073] Optionally, step 205 specifically further includes: in response to the processor entering the operating system, if it is identified that the hot plug function of the second external interconnection link is enabled, configuring memory resources for the second external interconnection device according to the third memory resource.
[0074] For example, after the processor enters the operating system, it is necessary to determine whether the hot-plug function of multiple external interconnection links is turned on. When it is identified that the hot-plug function of the second external interconnection link is turned on, the memory resources of the second external interconnection device can be configured according to the third memory resources reserved by the basic input and output system.
[0075] Optionally, step 205 specifically also includes: in response to the processor entering the operating system, if it is identified that the hot plug function of the third external interconnection link is turned on and the third external interconnection link is not connected to a data processing device or an external interconnection device, memory resources are configured for the third external interconnection link according to a predetermined link resource configuration threshold.
[0076] In some examples, after the processor enters the operating system, it is necessary to determine whether the hot-plug function of multiple external interconnection links is enabled. If it is identified that the hot-plug function of the third external interconnection link is enabled and the third external interconnection link is not connected to a data processing device or an external interconnection device, it is necessary to configure memory resources for the third external interconnection link according to a predetermined link resource configuration threshold.
[0077] Optionally, step 205 specifically further includes: in response to the processor entering the operating system, if it is identified that the hot plug function of the fourth external interconnection link is not enabled, determining whether the fourth external interconnection link is connected to a data processing device and / or an external interconnection device; and if it is determined that the fourth external interconnection link is connected to a data processing device and / or an external interconnection device, determining a fourth memory resource required for the operation of the data processing device and / or the external interconnection device connected to the fourth external interconnection link.
[0078] In some examples, after the processor enters the operating system, it is necessary to determine whether the hot-plug function of multiple external interconnection links is enabled. If it is identified that the hot-plug function of the fourth external interconnection link is not enabled, it is necessary to further determine whether the fourth external interconnection link is connected to a data processing device and / or an external interconnection device; if it is determined that the fourth external interconnection link is connected to a data processing device and / or an external interconnection device, the fourth memory resources required for the operation of the data processing device and / or external interconnection device connected to the fourth external interconnection link are determined.
[0079] Optionally, step 205 specifically further includes: if it is determined that the fourth memory resource is less than or equal to the predetermined resource to be allocated, performing resource configuration on the data processing device and / or external interconnection device connected to the fourth external interconnection link based on the predetermined resource to be allocated.
[0080] Optionally, step 205 specifically further includes: if it is determined that the fourth memory resource is greater than the predetermined to-be-allocated resource, then no resource configuration is performed on the data processing device and / or the external interconnection device connected to the fourth external interconnection link.
[0081] Exemplarily, when reallocating resources under the system, it is necessary to scan the PCI bridge device of each PCI link. Here, only one PCI link is used as an example for explanation; first scan the devices under the current PCI link bridge and determine whether the Hotplug function of the current bridge is turned on. If the hotplug function of the current PCI link bridge is turned on and there is no device, 2M of 32-bit memory resources need to be allocated. If the hotplug function of the current PCI link bridge is turned off and there is no device, there is no need to allocate actual memory resources. If the Hotplug function of the current PCI link bridge is turned off and there is a PCI device and 32-bit 4G memory resources meet the actual needs, 32-bit memory resources are allocated. If the remaining memory resources of the 32-bit 4G memory resources cannot meet the actual needs of the current device, no resources are allocated and the memory resources of this device are isolated, that is, the memory resources are turned off; in this way, the above steps are performed on all PCI links in the system in turn until all PCI bridges and devices have completed memory resource allocation. At this time, the DPU device and its functions can be used normally in the server operating system.
[0082] Optionally, this application also provides the following examples: Figure 5 Shown, including:
[0083] When the server starts, the BIOS reads the DID and VID of each PCI device during the PCI enumeration phase of the DXE stage. It confirms whether the current device is a DPU device. If not, there is no need to reserve 32-bit memory resources. If it is a DPU device, 32-bit resources are reserved based on the known 32-bit resource size of the DPU. At the same time, the PCI link physically connected to the current DPU accumulates the MMIO 32-bit resources reserved by the DPU when counting the 32-bit resources required by other PCI devices. At the same time, the BIOS enables the PCI configuration space hot plug function of the bridge of the PCI link physically connected to the DPU, that is, the hotplug function.
[0084] The server continues to boot and enters the operating system. The operating system adds the PCI=realloc parameter to the Grub parameters by default. At this time, the operating system reallocates all PCI resources of the server. When the system driver detects that the hotplug function of the PCI configuration space of the PCI bridge is enabled, the resources reserved for this device during BIOS startup are retained. If the hotplug function of the PCI configuration space of the PCI bridge is disabled, the operating system reallocates the 32-bit memory resources reserved and allocated by the BIOS during the DXE phase. If there is no device on the downstream port of the PCI bridge of the current PCI link, there is no need to allocate 32-bit memory resources. Only the 32-bit memory resources required by the PCI bridge need to be allocated.
[0085] When reallocating resources in the system, it is necessary to scan the PCI bridge devices of each PCI link. Here, only one PCI link is used as an example. First, scan the devices under the current PCI link bridge and determine whether the Hotplug function of the current bridge is enabled. If the hotplug function of the current PCI link bridge is enabled and there is no device, 2MB of 32-bit memory resources need to be allocated. If the hotplug function of the current PCI link bridge is disabled and there is no device, no actual memory resources need to be allocated. If the hotplug function of the current PCI link bridge is disabled and there is a PCI device and the 32-bit 4GB memory resources meet the actual needs, 32-bit memory resources are allocated. If the remaining memory resources of the 32-bit 4GB memory resources cannot meet the actual needs of the current device, no resources are allocated and the memory resources of this device are isolated, that is, the memory resources are disabled. The above steps are performed for all PCI links in the system in sequence until memory resources are allocated to all PCI bridges and devices. At this point, the DPU device and its functions can be used normally in the server operating system.
[0086] It should be noted that the embodiment of the present application reserves 32-bit memory resources by determining the DID and VID of the PCI device during the DXE phase when the server is booted and confirming that it is a DPU. At the same time, the hotplug function of the PCI link bridge is enabled. For non-DPU devices, whether to allocate memory resources is determined based on whether there is a PCI device in the PCI link. When the server is booted, because the system defaults to enabling and enabling the PCI=realloc parameter, all PCI devices in the system will be reallocated. However, the system has limited 32-bit memory resources, so some devices must be allocated resources. Therefore, the hotplug enabling setting notifies the operating system not to reallocate DPU devices. Therefore, the system can skip resource reallocation for DPU devices, but other devices are actually allocated based on the remaining 32-bit memory resources. If all PCI device resources are met, they are allocated. If not, the PCI devices that do not meet the 32-bit 4G memory resource requirements will not be allocated memory resources and the memory resources will be isolated.
[0087] Compared to related technologies, this embodiment, in response to a processor entering a basic input / output system (BIOS), sequentially reads identification information of multiple devices connected to the processor; based on the identification information, if it is determined that a data processing device exists among the multiple devices, determines the first memory resource required for the operation of the data processing device; reserves memory resources for the data processing device according to the first memory resource, and enables the hot-swap function of a first external interconnection link connected to the data processing device; in response to the processor entering an operating system, if it is identified that the hot-swap function of the first external interconnection link is enabled, configures memory resources for the data processing device according to the memory resources reserved by the BIOS. By utilizing the BIOS to actively identify devices when the server starts and enabling the hot-swap function of the external interconnection link where the device is located, when the server enters the operating system, the operating system will reallocate memory resources under the system, and even if the BIOS has completed memory resource allocation, the system will still reallocate memory resources. Because memory resources are limited and the location information of the data processing device cannot be fixed, according to the function of the parameters, no resources can be allocated to the data processing device identified later because the memory resources have been allocated. However, the external interconnection link with the hot-swap function turned on does not need to reallocate memory resources. Therefore, the basic input and output system needs to turn on the hot-swap function of the external interconnection link where the data processing device is located by default to avoid the system reallocation again causing the data processing device to be unable to be used normally. This can ensure that the data processing device can be used normally at any time, and there is no need to worry about the data processing device being unable to be used due to resource problems, thereby improving the user experience.
[0088] The embodiment of the present application also provides a resource configuration device, such as Figure 6 As shown, the device includes: a reading module 31, a determination module 32, a reservation module 33, and a configuration module 34.
[0089] The reading module 31 is configured to read identification information of multiple devices connected to the processor in sequence in response to the processor entering the basic input and output system, where the identification information is used to determine device types of the multiple devices;
[0090] a determination module 32 configured to determine, based on the identification information, a first memory resource required for the operation of the data processing device when it is determined that the data processing device exists among the multiple devices;
[0091] A reservation module 33 is configured to reserve memory resources for the data processing device according to the first memory resources and enable a hot-swap function of a first external interconnection link connected to the data processing device;
[0092] The configuration module 34 is configured to, in response to the processor entering the operating system, configure memory resources of the data processing device according to the memory resources reserved by the basic input and output system if it is recognized that the hot plug function of the first external interconnection link is enabled.
[0093] In some examples of this embodiment, the determination module 32 is further configured to determine whether the first external interconnection link is connected to an external interconnection device.
[0094] In some examples of this embodiment, the reservation module 33 is further configured to, when it is determined that the first external interconnection link is not connected to the external interconnection device, determine the first memory resource as the total memory resource corresponding to the first external interconnection link; reserve memory resources for the first external interconnection link based on the total memory resources, and enable the hot plug function of the first external interconnection link.
[0095] In some examples of this embodiment, the reservation module 33 is further configured to, when it is determined that the first external interconnection link is connected to an external interconnection device, determine the second memory resources required for the operation of the first external interconnection device connected to the first external interconnection link; accumulate the first memory resources and the second memory resources, and determine the accumulation result as the total memory resources; reserve memory resources for the first external interconnection link based on the total memory resources, and enable the hot plug function of the first external interconnection link.
[0096] In some examples of this embodiment, the configuration module 34 is further configured to determine whether there is an external interconnection device among the multiple devices when it is determined that there is no data processing device among the multiple devices based on the identification information; when it is determined that there is an external interconnection device among the multiple devices, determine a third memory resource required for the operation of a second external interconnection device existing in the multiple devices; reserve memory resources for the second external interconnection device according to the third memory resource, and enable the hot-swap function of the second external interconnection link connected to the second external interconnection device.
[0097] In some examples of this embodiment, the configuration module 34 is specifically configured to, in response to the processor entering the operating system, configure memory resources for the data processing device according to the total memory resources if it is identified that the hot plug function of the first external interconnection link is enabled.
[0098] In some examples of this embodiment, the configuration module 34 is further configured to, in response to the processor entering the operating system, configure memory resources for the data processing device according to the first memory resources in the total memory resources if it is identified that the hot plug function of the first external interconnection link is turned on, and configure memory resources for the first external interconnection device according to the second memory resources in the total memory resources.
[0099] In some examples of this embodiment, the configuration module 34 is further configured to, in response to the processor entering the operating system, configure memory resources for the second external interconnection device according to the third memory resources if it is identified that the hot plug function of the second external interconnection link is turned on.
[0100] In some examples of this embodiment, the configuration module 34 is specifically configured to, in response to the processor entering the operating system, perform memory resource configuration on the third external interconnection link according to a predetermined link resource configuration threshold if it is identified that the hot plug function of the third external interconnection link is enabled and the third external interconnection link is not connected to a data processing device or an external interconnection device.
[0101] In some examples of this embodiment, the configuration module 34 is specifically configured to, in response to the processor entering the operating system, determine whether the fourth external interconnection link is connected to a data processing device and / or an external interconnection device if it is identified that the hot plug function of the fourth external interconnection link is not enabled; and if it is determined that the fourth external interconnection link is connected to a data processing device and / or an external interconnection device, determine the fourth memory resources required for the operation of the data processing device and / or the external interconnection device connected to the fourth external interconnection link.
[0102] In some examples of this embodiment, the configuration module 34 is specifically configured to perform resource configuration on the data processing device and / or external interconnection device connected to the fourth external interconnection link based on the predetermined resources to be allocated if it is determined that the fourth memory resource is less than or equal to the predetermined resources to be allocated.
[0103] In some examples of this embodiment, the configuration module 34 is specifically configured to not perform resource configuration on the data processing device and / or external interconnection device connected to the fourth external interconnection link if it is determined that the fourth memory resource is greater than the predetermined to-be-allocated resource.
[0104] It should be noted that for other corresponding descriptions of the functional units involved in the resource configuration device provided in this embodiment, please refer to Figure 1 The corresponding description in will not be repeated here.
[0105] Based on the above Figure 1 The method shown in FIG. 1 is a method for performing the above-mentioned steps. Accordingly, this embodiment further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program can realize the above-mentioned steps. Figure 1 The method shown.
[0106] Based on the above Figure 1 The method shown in FIG. 1 is a method for performing the above-mentioned operations. Accordingly, this embodiment further provides a computer program product having a computer program stored thereon. When the computer program is executed by a processor, the above-mentioned Figure 1 The method shown.
[0107] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0108] Based on the above Figure 1 The method shown, and Figure 6 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides an electronic device, such as a personal computer or a server, which includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 The method shown.
[0109] In some embodiments, the physical device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a Wi-Fi module, and the like. The user interface may include a display, an input unit such as a keyboard, and the like. Optional user interfaces may also include a USB interface and a card reader interface. In some embodiments, the network interface may include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0110] Those skilled in the art will understand that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different component arrangements.
[0111] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the physical device, supporting the execution of information processing programs and other software and / or programs. The network communication module is used to enable communication between components within the storage medium, as well as with other hardware and software within the physical information processing device.
[0112] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. By applying the solution of this embodiment, compared with the related art, in response to the processor entering the basic input and output system, the present embodiment sequentially reads the identification information of multiple devices connected to the processor; based on the identification information, when it is determined that there is a data processing device among the multiple devices, the first memory resource required for the operation of the data processing device is determined; according to the first memory resource, memory resources are reserved for the data processing device, and the hot plug function of the first external interconnection link connected to the data processing device is turned on; in response to the processor entering the operating system, if it is identified that the hot plug function of the first external interconnection link is turned on, the memory resources of the data processing device are configured according to the memory resources reserved by the basic input and output system. By using the basic input and output system to actively identify the device when the server starts and turn on the hot plug function of the external interconnection link where the device is located, when the server enters the operating system, the operating system will reallocate the memory resources under the system. Even if the basic input and output system has completed the memory resource allocation, the system will still reallocate the memory resources. Because memory resources are limited and the location information of the data processing device cannot be fixed, according to the function of the parameters, no resources can be allocated to the data processing device identified later because the memory resources have been allocated. However, the external interconnection link with the hot-swap function turned on does not need to reallocate memory resources. Therefore, the basic input and output system needs to turn on the hot-swap function of the external interconnection link where the data processing device is located by default to avoid the system reallocation again causing the data processing device to be unable to be used normally. This can ensure that the data processing device can be used normally at any time, and there is no need to worry about the data processing device being unable to be used due to resource problems, thereby improving the user experience.
[0113] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device that includes the element.
[0114] The above are merely specific embodiments of the present application, which are intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments herein, but rather is intended to conform to the widest scope consistent with the principles and novel features of the present application.
Claims
1. A resource configuration method, characterized in that: include: In response to the processor entering the basic input and output system, sequentially reading identification information of a plurality of devices connected to the processor, the identification information being used to determine device types of the plurality of devices; If it is determined based on the identification information that a data processing device exists among the multiple devices, determining a first memory resource required for the operation of the data processing device; Reserving memory resources for the data processing device according to the first memory resources, and enabling a hot-swap function of a first external interconnection link connected to the data processing device; In response to the processor entering the operating system, if it is identified that the hot-swap function of the first external interconnection link is enabled, configuring memory resources for the data processing device according to the memory resources reserved by the basic input and output system; The step of reserving memory resources for the data processing device according to the first memory resources and enabling a hot-swap function of a first external interconnection link connected to the data processing device includes: If it is determined that the first external interconnection link is not connected to an external interconnection device, determining the first memory resource as the total memory resource corresponding to the first external interconnection link; reserving memory resources for the first external interconnection link based on the total memory resource, and enabling a hot-swap function of the first external interconnection link; In a case where it is determined that the first external interconnection link is connected to an external interconnection device, second memory resources required for the operation of the first external interconnection device connected to the first external interconnection link are determined; the first memory resources and the second memory resources are accumulated, and the accumulated result is determined as the total memory resources; memory resources are reserved for the first external interconnection link based on the total memory resources, and a hot-swap function of the first external interconnection link is enabled.
2. The method according to claim 1, characterized in that In the case where it is determined based on the identification information that a data processing device exists among the multiple devices, after determining the first memory resource required for the operation of the data processing device, the method further includes: Determine whether the first external interconnection link is connected to an external interconnection device.
3. The method according to claim 1, characterized in that After reading identification information of a plurality of devices connected to the processor in response to the processor entering the basic input and output system, the method further includes: If it is determined based on the identification information that no data processing device exists among the multiple devices, determining whether there is an external interconnection device among the multiple devices; In the case where it is determined that an external interconnection device exists among the multiple devices, determining a third memory resource required for the operation of a second external interconnection device existing among the multiple devices; Memory resources are reserved for the second external interconnection device according to the third memory resource, and a hot-swap function of a second external interconnection link connected to the second external interconnection device is enabled.
4. The method according to claim 3, characterized in that In response to the processor entering the operating system, if it is recognized that the hot plug function of the first external interconnection link is enabled, configuring memory resources of the data processing device according to the memory resources reserved by the basic input and output system, including: In response to the processor entering the operating system, if it is identified that the hot-plug function of the first external interconnection link is enabled, memory resources of the data processing device are configured according to the total memory resources.
5. The method according to claim 4, characterized in that In response to the processor entering the operating system, if it is recognized that the hot-plug function of the first external interconnection link is enabled, configuring memory resources for the data processing device according to the memory resources reserved by the basic input and output system, further comprising: In response to the processor entering the operating system, if it is identified that the hot plug function of the first external interconnection link is turned on, memory resources of the data processing device are configured according to the first memory resources in the total memory resources, and memory resources of the first external interconnection device are configured according to the second memory resources in the total memory resources.
6. The method according to claim 5, characterized in that The method further comprises: In response to the processor entering the operating system, if it is identified that the hot plug function of the second external interconnection link is enabled, memory resources are configured for the second external interconnection device according to the third memory resource.
7. The method according to claim 6, characterized in that The method further comprises: In response to the processor entering the operating system, if it is identified that the hot plug function of the third external interconnection link is enabled and the third external interconnection link is not connected to a data processing device or an external interconnection device, memory resources are configured for the third external interconnection link according to a predetermined link resource configuration threshold.
8. The method according to claim 5, characterized in that The method further comprises: In response to the processor entering the operating system, if it is identified that the hot-swap function of the fourth external interconnection link is not enabled, determining whether the fourth external interconnection link is connected to a data processing device and / or an external interconnection device; When it is determined that a data processing device and / or an external interconnection device is connected to the fourth external interconnection link, fourth memory resources required for the operation of the data processing device and / or the external interconnection device connected to the fourth external interconnection link are determined.
9. The method according to claim 8, characterized in that After determining the fourth memory resource required for the operation of the data processing device and / or the external interconnection device, the method further includes: If it is determined that the fourth memory resource is less than or equal to the predetermined resource to be allocated, resource configuration is performed on the data processing device and / or external interconnection device connected to the fourth external interconnection link based on the predetermined resource to be allocated.
10. The method according to claim 9, characterized in that The method further comprises: If it is determined that the fourth memory resource is greater than the predetermined to-be-allocated resource, no resource configuration is performed on the data processing device and / or external interconnection device connected to the fourth external interconnection link.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
12. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 10 is implemented.
13. A computer program product having a computer program stored thereon, characterized in that: When the computer program product is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Firmware upgrade effective method and device of PCIe device, storage medium and program product
CN119201187A
Resource allocation method and device for data processing unit, electronic equipment and storage medium
CN119781844A