Parameter adaptive configuration method and device based on PCIe topology

By identifying the topology connection type of PCIe devices and configuring matching parameters, the problem of abnormalities caused by forcing the same parameters to be configured for PCIe devices of the same category was resolved, thus improving device performance and operation and maintenance efficiency.

CN121907684APending Publication Date: 2026-04-21XINHUASAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XINHUASAN INFORMATION TECH CO LTD
Filing Date
2026-01-19
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In servers, PCIe devices of the same category are forced to be configured with the same underlying driver parameters, which can cause device malfunctions such as disconnections and lag, affecting performance.

Method used

By detecting newly launched PCIe devices, identifying their topology connection type on the server, and configuring corresponding parameters for the devices based on the parameter configuration strategy that matches the type, the system avoids using the same underlying driver parameters for PCIe devices of the same type.

Benefits of technology

It effectively avoids PCIe device malfunctions, improves performance, and enables automated configuration of PCIe devices and data center operation and maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121907684A_ABST
    Figure CN121907684A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a parameter adaptive configuration method and device based on PCIe topology. In the embodiment of the invention, when the newly online PCIe equipment is detected on the server, the topological connection type of the PCIe equipment on the server is identified, so that the PCIe equipment configuration is subjected to parameter configuration based on the parameter configuration strategy matched with the topological connection type; in this way, different parameter configuration strategies are adopted for the PCIe devices of different topological connection types under the same category, the situation that the PCIe devices of the same category are forcibly configured with the same bottom layer driving parameters in the prior art is avoided, the problems such as PCIe device abnormities such as PCIe device offline and jamming can be obviously avoided, and the performance of the PCIe devices is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data center networks, and in particular to a method and apparatus for adaptive parameter configuration based on PCIe topology. Background Technology

[0002] With the continuous development of technology, in order to meet the extremely high input / output (I / O) transmission requirements, servers deploy multiple PCIe devices of the same type. These PCIe devices of different types may include network cards, GPUs, etc. GPU stands for Graphics Processing Unit; PCIe stands for Peripheral Component Interconnect Express.

[0003] Currently, in practical applications, PCIe devices of the same category in a server are forced to be configured with the same underlying driver parameters. However, the physical connection topologies of different PCIe devices of the same category in a server are different at the hardware level. If PCIe devices of the same category are forced to be configured with the same underlying driver parameters, it will cause some PCIe devices to malfunction, such as PCIe devices dropping out or lag, thereby affecting the performance of PCIe devices. Summary of the Invention

[0004] In view of this, this application provides a parameter adaptive configuration method and apparatus based on PCIe topology to avoid PCIe device malfunctions.

[0005] This application provides a parameter adaptive configuration method based on PCIe topology, the method comprising: When a newly connected PCIe device is detected on the server, the location of the PCIe device is located from the current PCIe device topology; the current PCIe device topology is the topological connection structure of each PCIe device on the server. By analyzing the optimal path from the location of the PCIe device to the root complex, the current topology connection type of the PCIe device on the server is determined; the topology connection type is either directly connected to the root complex or connected via a PCIe switch. Based on a parameter configuration strategy that matches the topology connection type, the corresponding parameters are configured for the PCIe device.

[0006] This application also provides a parameter adaptive configuration device based on PCIe topology, the device comprising: The positioning module is used to locate the position of a newly connected PCIe device from the current PCIe device topology when a new PCIe device is detected on the server; the current PCIe device topology is the topological connection structure of each PCIe device on the server. The analysis module is used to determine the current topology connection type of the PCIe device on the server by analyzing the optimal path between the location of the PCIe device and the root complex; the topology connection type is either directly connected to the root complex or connected via a PCIe switch. The configuration module is used to configure corresponding parameters for the PCIe device based on a parameter configuration strategy that matches the topology connection type.

[0007] This application also provides an electronic device, which includes: Processor; and A computer-readable storage medium storing computer program instructions that, when executed by a processor, cause the processor to perform the steps of the method described above.

[0008] This application also provides a computer-readable storage medium storing computer program instructions that, when executed by a processor, cause the processor to perform the steps in the above method.

[0009] As can be seen from the above technical solutions, in this embodiment of the application, when a newly online PCIe device is detected on the server, the current topology connection type of the PCIe device on the server is identified, and the parameters of the PCIe device are configured based on the parameter configuration strategy that matches the topology connection type. In this way, PCIe devices of different topology connection types under the same category adopt different parameter configuration strategies, instead of forcing all PCIe devices of the same category to be configured with the same underlying driver parameters in the existing method. Obviously, this can avoid PCIe device abnormalities such as PCIe device disconnection and lag, and improve the performance of PCIe devices. Attached Figure Description

[0010] The accompanying drawings, which are incorporated in and form part of this application, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0011] Figure 1 This is a flowchart illustrating a parameter adaptive configuration method based on PCIe topology provided in an embodiment of this application.

[0012] Figure 2 This is a schematic diagram illustrating the implementation of PCIe topology-based adaptive parameter configuration in an embodiment of this application.

[0013] Figure 3 This is a flowchart illustrating another parameter adaptive configuration method based on PCIe topology provided in an embodiment of this application.

[0014] Figure 4 This is a schematic diagram of a parameter adaptive configuration device based on PCIe topology provided in an embodiment of this application.

[0015] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0016] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.

[0017] See Figure 1 , Figure 1 This is a flowchart illustrating a method provided in an embodiment of this application. In this embodiment, as one example, the method can be applied to an electronic device, such as a laptop computer, desktop computer, or server.

[0018] like Figure 1 As shown, the process may include the following steps: Step 101: When a newly online PCIe device is detected on the server, locate the PCIe device from the current PCIe device topology.

[0019] In this embodiment, the current PCIe device topology can be the topological connection structure of each PCIe device on the server, which indicates the hardware-level connection relationship between each PCIe device on the server. Optionally, this embodiment does not specifically limit the category to which the PCIe device belongs; for example, the category may include network card category, GPU category, etc.

[0020] As for how to detect newly online PCIe devices on the server and how to locate the PCIe device from the current PCIe device topology, examples will be given below, and will not be elaborated here.

[0021] Step 102: By analyzing the optimal path between the location of the PCIe device and the root complex, determine the current topology connection type of the PCIe device on the server.

[0022] In this embodiment, the topology connection type can be a direct connection to the root complex or a connection via a PCIe switch. A direct connection to the root complex means that the PCIe device is directly connected to the root complex. A connection via a PCIe switch means that the PCIe device is connected to the root complex through a PCIe switch or a PCIe bridge. The root complex (RC) can be a component used to connect the Central Processing Unit (CPU) to the PCIe topology, where the root complex can be the root node in the current PCIe device topology.

[0023] In this embodiment, as an example, the optimal path between the location of the PCIe device and the root complex can be determined by the following steps: the shortest path (i.e., the shortest PCIe link) between the PCIe device and the root complex in the current PCIe device topology is determined as the optimal path between the location of the PCIe device and the root complex.

[0024] Based on this, in this embodiment, after locating the PCIe device from the current PCIe device topology, the current topology connection type of the PCIe device on the server can be determined by analyzing whether the optimal path from the PCIe device's location to the root complex contains a PCIe bridge device or a PCIe device. For example, as an embodiment, it is checked whether the optimal path contains a PCIe switch device (or a PCIe bridge device); if the optimal path contains a PCIe switch device or a PCIe bridge device, the current topology connection type of the PCIe device on the server is determined to be connected via a PCIe switch; if the optimal path does not contain a PCIe switch device or a PCIe bridge device, the current topology connection type of the PCIe device on the server is determined to be directly connected to the root complex.

[0025] Step 103: Configure the corresponding parameters for the PCIe device based on the parameter configuration strategy that matches the determined topology connection type.

[0026] In this embodiment, at least one parameter configuration strategy corresponding to a topology connection type can be pre-configured in the server based on actual application requirements. This can be represented by a topology-parameter mapping relationship, which records the mapping relationship between topology connection types and parameter configuration strategies. Different topology connection types correspond to different parameter configuration strategies. Based on this, as an example, configuring corresponding parameters for the PCIe device based on the parameter configuration strategy matching the determined topology connection type can, in specific implementation, include: first, finding a parameter configuration strategy matching the determined topology connection type from the existing topology-parameter mapping relationship; then, configuring the corresponding parameters for the PCIe device based on the parameters indicated by the found parameter configuration strategy.

[0027] In this embodiment, the parameters indicated by the above parameter configuration strategy can refer to the underlying driver parameters of the PCIe device. These underlying driver parameters can refer to the hardware configuration of the PCIe device itself (such as a network card, GPU, etc.), which determines how the operating system communicates with the PCIe device and can be directly managed and controlled by the corresponding driver. Optionally, this embodiment does not specifically limit the content of these underlying driver parameters, and may include, but is not limited to, Active State Power Management (ASPM) parameters, driver's internal cache parameters, queue depth parameters, interrupt modulation parameters, etc.

[0028] As for how to configure the corresponding parameters for the PCIe device based on the parameters indicated by the found parameter configuration policy, examples will be provided below, and will not be elaborated here.

[0029] This concludes the process. Figure 1 The process is shown below.

[0030] pass Figure 1 As can be seen from the process shown, in this embodiment of the application, when a newly online PCIe device is detected on the server, the current topology connection type of the PCIe device on the server is identified, and the parameters of the PCIe device are configured based on the parameter configuration strategy that matches the topology connection type. In this way, PCIe devices of different topology connection types under the same category adopt different parameter configuration strategies, instead of forcing all PCIe devices of the same category to be configured with the same underlying driver parameters in the existing method. Obviously, this can avoid PCIe device abnormalities such as PCIe device disconnection and lag, and improve the performance of PCIe devices.

[0031] The following describes how a newly online PCIe device is detected on the server in step 101 above, and how the location of the PCIe device is located from the current PCIe device topology: In this embodiment, as one example, the detection of a newly online PCIe device on the server can, in specific implementations, include: the operating system kernel in the server using a device management mechanism (such as the UDEV mechanism) to detect the addition of a new PCIe device and thus determine that a newly online PCIe device has been detected on the server. Here, UDEV is an abbreviation for Userspace Device Manager.

[0032] In this embodiment, as an example, the current PCIe device topology can be a tree structure. Each node in the current PCIe device topology can be characterized by a unique identifier of one of the PCIe devices on the server, such as BDF information; where BDF is an abbreviation for Bus-Device-Function.

[0033] Based on this, as an example, the above-described method of locating the PCIe device from the current PCIe device topology may, in specific implementation, include: locating the PCIe device from the current PCIe device topology based on its BDF information. Specifically, this can be achieved by traversing each node in the current PCIe device topology, taking the traversed node as the current node, and checking whether the BDF information of the current node is the same as that of the PCIe device. If they are the same, the current node is determined to be the PCIe device; otherwise, the current node is determined not to be the PCIe device, and the traversal of each node in the current PCIe device topology continues.

[0034] This completes the description of step 101 above.

[0035] The following describes how, in step 103 above, the corresponding parameters are configured for the PCIe device based on the parameters indicated by the found parameter configuration strategy: In this embodiment, the parameters indicated by the parameter configuration strategy are used to configure the corresponding parameters for the PCIe device. There are many ways to implement this in practice: For example, as an embodiment, a specified system tool in the server can be invoked to trigger the server's operating system kernel, which will load the parameters indicated by the found parameter configuration policy into the PCIe device, thereby configuring the corresponding parameters for the PCIe device.

[0036] Optionally, in this embodiment, the specific system tool to be invoked can be determined based on the category to which the PCIe device belongs. For example, if the PCIe device belongs to the network interface card (NIC) category, the corresponding system tool to be invoked could be ethtool, setpci, or other system tools. It should be noted that this is only an illustrative example, and the specific system tools to be invoked under different categories can be flexibly set based on actual application needs. This embodiment is not specifically limited.

[0037] For example, as another embodiment, the parameters indicated by the found parameter configuration policy are written to the server's file system SysFS to trigger the server's operating system kernel to load the parameters in SysFS to the PCIe device, so as to configure the corresponding parameters for the PCIe device.

[0038] The following is a further description of step 103 above: In this embodiment, as an example, after determining the parameter configuration policy that matches the current topology connection type of the PCIe device on the server, the topology connection type and the parameter configuration policy that matches the topology connection type can also be written to the system log for fault tracing.

[0039] This completes the description of step 103 above.

[0040] The following is about the above. Figure 1 The overall process of the parameter adaptive configuration method shown is described below: In this embodiment, as one example, the above... Figure 1 The overall process of the parameter adaptive configuration method shown is as follows: First, when a newly online PCIe device is detected on the server, the current PCIe device topology on the server is obtained, and the location of the PCIe device is located from the current PCIe device topology based on the BDF information of the PCIe device.

[0041] Then, based on the location of the PCIe device in the current PCIe device topology, the optimal path between the location of the PCIe device in the current PCIe device topology and the root complex is analyzed.

[0042] Next, check whether the optimal path from the location of the PCIe device to the root complex contains a PCIeSwitch device or a PCIe bridge device.

[0043] If the optimal path from the location of the PCIe device to the root complex includes a PCIe switch device or a PCIe bridge device, then the current topology connection type of the PCIe device on the server is determined to be connected via a PCIe switch. The server then searches for a parameter configuration policy that matches the connection via a PCIe switch from the topology-parameter mapping relationship already configured locally, and configures the corresponding parameters for the PCIe device based on the parameters indicated by the found parameter configuration policy.

[0044] If the optimal path from the location of the PCIe device to the root complex does not contain a PCIe switch device or a PCIe bridge device, then the current topology connection type of the PCIe device on the server is determined to be a direct-connected root complex. The server then searches for a parameter configuration policy that matches the direct-connected root complex from the topology-parameter mapping relationship already configured locally, and configures the corresponding parameters for the PCIe device based on the parameters indicated by the found parameter configuration policy.

[0045] Finally, the current topology connection type of the PCIe device on the server, and the parameter configuration strategy matching that topology connection type, obtained above, can be written to the system log for subsequent fault tracing and performance analysis. To facilitate understanding of the specific implementation process of the above-described PCIe topology-based parameter adaptive configuration method, specific embodiments are described below.

[0046] In this embodiment, as an example, see [example]. Figure 2 The diagram illustrates the implementation of PCIe topology-based adaptive parameter configuration, using a network interface card (NIC) as an example to describe the PCIe topology-based adaptive parameter configuration method provided in this embodiment: First, at the server's operating system kernel layer, device management mechanisms such as UDEV are used to monitor the addition of PCIe bus network cards in real time; when a network card addition event is detected, the unique identifier of the network card, such as the network card's BDF information, is obtained.

[0047] Then, the PCIe device tree structure (i.e. the current PCIe device topology structure mentioned above) that indicates the topology connection structure of each PCIe device on the server is obtained from the server's file system SysFS, and the position of the network card in the PCIe device tree structure is located according to the network card's BDF information.

[0048] Based on the position of the network card in the PCIe device tree structure, the shortest path between the network card and the root complex in the PCIe device tree structure is analyzed. If there is a PCIe bridging device or a PCIe switch device in the shortest path, the network card's current topology connection type on the server is determined to be PCIe switch-connected. If there is no PCIe bridging device or PCIe switch device in the shortest path, the network card's current topology connection type on the server is determined to be directly connected to the root complex (also known as CPU direct connection).

[0049] Subsequently, based on the topology connection type determined above, the parameter configuration strategy matching the topology connection type is found from the topology-parameter mapping relationship stored in the application layer; and the network card is configured with parameters based on the parameters indicated by the parameter configuration strategy.

[0050] For example, by calling the server's system tools (such as ethtool, setpci, etc.), the network card driver interface in the operating system kernel can be accessed to load the parameters indicated by the parameter configuration policy into the network card in the hardware layer, thereby realizing the parameter configuration of the network card.

[0051] For example, the parameters specified by the configuration policy can be written to the server's file system (System Filesystem, SysFS), such as to the following SysFS path: / sys / bus / pci / . Then, when the server's operating system kernel detects that the parameters corresponding to the network card have been written to the specified SysFS path, it will load the written parameters into the network card in the hardware layer, thereby realizing the parameter configuration of the network card.

[0052] Finally, the topology connection type and parameter configuration strategy of the network card identified above can be written into the system log for fault tracing and performance analysis.

[0053] The following is combined Figure 3 The parameter adaptive configuration method based on PCIe topology provided in this embodiment is described with an example: Step 301: The server's operating system kernel uses device management mechanisms such as UDEV to detect the addition of a new network card and obtains the BDF information of that network card.

[0054] Step 302: Obtain the PCIe device tree structure from the server's file system SysFS, and locate the position of the network card in the PCIe device tree structure based on the network card's BDF information.

[0055] Step 303: Based on the position of the network card in the PCIe device tree structure, analyze and obtain the shortest path between the network card and the root complex in the PCIe device tree structure.

[0056] Step 304: Check if there is a PCIe bridging device or PCIe switch device in the shortest path. If yes, proceed to step 305; otherwise, proceed to step 306.

[0057] Step 305: Determine that the current topology connection type of the network card on the server is PCIe Switch under-connection, and find the parameter configuration policy that matches PCIe Switch under-connection from the existing topology-parameter mapping relationship. Proceed to step 307.

[0058] Step 306: Determine that the current topology connection type of the network card on the server is a directly connected root complex, and find the parameter configuration strategy that matches the directly connected root complex from the existing topology-parameter mapping relationship. Proceed to step 307.

[0059] Step 307: Configure the network card parameters based on the parameters indicated by the above parameter configuration strategy.

[0060] Step 308: Write the topology connection type and parameter configuration policy corresponding to the network card determined above into the system log for fault tracing and performance analysis.

[0061] This embodiment automatically identifies the topology connection type of newly launched PCIe devices and configures the parameters of the PCIe devices based on a parameter configuration strategy that matches the topology connection type. This approach, which uses different parameter configuration strategies for PCIe devices of different topology connection types within the same category, fundamentally avoids the PCIe device anomalies, such as PCIe device disconnection and lag, caused by the forced configuration of the same underlying driver parameters for PCIe devices of the same category in existing systems. This achieves full automation of PCIe device configuration and effectively improves the efficiency and reliability of data center operation and maintenance.

[0062] This concludes the description of the method provided in the embodiments of this application. The apparatus provided in the embodiments of this application will now be described: As an example, this embodiment also provides a parameter adaptive configuration device based on PCIe topology. For example, see... Figure 4 , Figure 4 This is a schematic diagram of a parameter adaptive configuration device based on PCIe topology provided in an embodiment of this application. The device corresponds to... Figure 1 The method flow is shown below. Figure 4 As shown, the PCIe topology-based parameter adaptive configuration device 400 includes: The positioning module 401 is used to locate the position of a newly online PCIe device from the current PCIe device topology when a new PCIe device is detected on the server; the current PCIe device topology is the topological connection structure of each PCIe device on the server. Analysis module 402 is used to determine the current topology connection type of the PCIe device on the server by analyzing the optimal path between the location of the PCIe device and the root complex; the topology connection type is either directly connected to the root complex or connected via a PCIe switch. Configuration module 403 is used to configure corresponding parameters for the PCIe device based on a parameter configuration strategy that matches the topology connection type.

[0063] As one embodiment, the analysis module 402 is specifically used for: Check whether the optimal path contains a PCIe Switch device; if so, determine that the current topology connection type of the PCIe device on the server is connected via a PCIe Switch; if not, determine that the current topology connection type of the PCIe device on the server is a direct root complex.

[0064] As an example, the configuration module 403 is specifically used for: Based on the topology connection type, a parameter configuration strategy matching the topology connection type is found from the existing topology-parameter mapping relationship; the topology-parameter mapping relationship is used to record the mapping relationship between the topology connection type and the parameter configuration strategy. Based on the parameters indicated by the found parameter configuration strategy, configure the corresponding parameters for the PCIe device.

[0065] As one embodiment, configuring the corresponding parameters for the PCIe device based on the parameters indicated by the found parameter configuration strategy includes: By invoking a specified system tool in the server, the operating system kernel of the server is triggered to load the parameters indicated by the parameter configuration policy into the PCIe device; Alternatively, the parameters indicated by the parameter configuration policy can be written to the server's file system SysFS to trigger the server's operating system kernel to load the parameters from SysFS into the PCIe device.

[0066] As one embodiment, the device further includes: The writing module is used to write the current topology connection type of the PCIe device on the server, as well as the parameter configuration policy that matches the topology connection type, to the system log for fault tracing.

[0067] As an example, each node in the current PCIe device topology is represented by the BDF information of one of the PCIe devices on the server; Locating the location of the PCIe device from the current PCIe device topology corresponding to the category to which the PCIe device belongs includes: Based on the BDF information of the PCIe device, the location of the PCIe device is located from the current PCIe device topology.

[0068] This concludes the process. Figure 4 Structural description of the device shown.

[0069] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0070] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0071] Please see Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided as an exemplary embodiment of this application. The electronic device includes a processor and a computer-readable storage medium; the computer-readable storage medium stores a plurality of computer program instructions, which, when executed by the processor, implement the method disclosed in the above example of this application. Depending on the actual function of the electronic device, other hardware may also be included, which will not be elaborated further.

[0072] Based on the same concept as the above method, this application also provides a computer-readable storage medium storing a plurality of computer program instructions, which, when executed by a processor, can implement the method disclosed in the above examples of this application.

[0073] For example, the aforementioned computer-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, messages, etc. For instance, computer-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.

[0074] The above are merely preferred embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A parameter adaptive configuration method based on PCIe topology, characterized in that, The method includes: When a newly connected PCIe device is detected on the server, the location of the PCIe device is located from the current PCIe device topology; the current PCIe device topology is the topological connection structure of each PCIe device on the server. By analyzing the optimal path from the location of the PCIe device to the root complex, the current topology connection type of the PCIe device on the server is determined; the topology connection type is either directly connected to the root complex or connected via a PCIe switch. Based on a parameter configuration strategy that matches the topology connection type, the corresponding parameters are configured for the PCIe device.

2. The method according to claim 1, characterized in that, The process of determining the current topology connection type of the PCIe device on the server by analyzing the optimal path from the location of the PCIe device to the root complex includes: Check whether the optimal path contains a PCIe Switch device; if so, determine that the current topology connection type of the PCIe device on the server is connected via a PCIe Switch; if not, determine that the current topology connection type of the PCIe device on the server is a direct-connect root complex.

3. The method according to claim 1, characterized in that, The parameter configuration strategy based on matching the topology connection type, configuring corresponding parameters for the PCIe device includes: Based on the topology connection type, a parameter configuration strategy matching the topology connection type is found from the existing topology-parameter mapping relationship; the topology-parameter mapping relationship is used to record the mapping relationship between the topology connection type and the parameter configuration strategy. Based on the parameters indicated by the found parameter configuration strategy, configure the corresponding parameters for the PCIe device.

4. The method according to claim 3, characterized in that, The configuration of corresponding parameters for the PCIe device based on the parameters indicated by the found parameter configuration strategy includes: By invoking a specified system tool in the server, the operating system kernel of the server is triggered to load the parameters indicated by the parameter configuration policy into the PCIe device; Alternatively, the parameters indicated by the parameter configuration policy can be written to the server's file system SysFS to trigger the server's operating system kernel to load the parameters from SysFS into the PCIe device.

5. The method according to claim 1, characterized in that, The method further includes: The current topology connection type of the PCIe device on the server, and the parameter configuration policy that matches the topology connection type, are written to the system log for fault tracing.

6. The method according to claim 1, characterized in that, Each node in the current PCIe device topology is represented by the Bus Number-Device Number-Function Number (BDF) information of one of the PCIe devices on the server. Locating the location of the PCIe device from the current PCIe device topology includes: Based on the BDF information of the PCIe device, the location of the PCIe device is located from the current PCIe device topology.

7. A parameter adaptive configuration device based on PCIe topology, characterized in that, The device includes: The positioning module is used to locate the position of a newly connected PCIe device from the current PCIe device topology when a new PCIe device is detected on the server; the current PCIe device topology is the topological connection structure of each PCIe device on the server. The analysis module is used to determine the current topology connection type of the PCIe device on the server by analyzing the optimal path from the location of the PCIe device to the root complex; the topology connection type is either directly connected to the root complex or connected via a PCIe switch. The configuration module is used to configure corresponding parameters for the PCIe device based on a parameter configuration strategy that matches the topology connection type.

8. The apparatus according to claim 7, characterized in that, The analysis module is specifically used for: Check whether the optimal path contains a PCIe Switch device; if so, determine that the current topology connection type of the PCIe device on the server is connected via a PCIe Switch; if not, determine that the current topology connection type of the PCIe device on the server is a direct-connect root complex. And / or, The configuration module is specifically used for: Based on the topology connection type, a parameter configuration strategy matching the topology connection type is found from the existing topology-parameter mapping relationship; the topology-parameter mapping relationship is used to record the mapping relationship between the topology connection type and the parameter configuration strategy. Based on the parameters indicated by the found parameter configuration strategy, configure the corresponding parameters for the PCIe device; And / or, The configuration of corresponding parameters for the PCIe device based on the parameters indicated by the found parameter configuration strategy includes: By invoking a specified system tool in the server, the operating system kernel of the server is triggered to load the parameters indicated by the parameter configuration policy into the PCIe device; Alternatively, the parameters indicated by the parameter configuration policy can be written to the server's file system SysFS to trigger the server's operating system kernel to load the parameters from SysFS into the PCIe device; And / or, The device further includes: The writing module is used to write the current topology connection type of the PCIe device on the server, as well as the parameter configuration policy that matches the topology connection type, to the system log for fault tracing. And / or, Each node in the current PCIe device topology is represented by the Bus Number-Device Number-Function Number (BDF) information of one of the PCIe devices on the server. Locating the location of the PCIe device from the current PCIe device topology corresponding to the category to which the PCIe device belongs includes: Based on the BDF information of the PCIe device, the location of the PCIe device is located from the current PCIe device topology.

9. An electronic device, characterized in that, The electronic device includes: Processor; and A computer-readable storage medium storing computer program instructions that, when executed by the processor, cause the processor to perform the steps of the method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, cause the processor to perform the steps of the method as described in any one of claims 1 to 6.