PCIe device dynamic link segmentation method, PCIe devices and media

By configuring the priority and link width of PCIe device ports and dynamically allocating physical channels, the problems of low resource utilization and configuration impact caused by static link segmentation are solved, achieving efficient link management and performance assurance.

CN120090782BActive Publication Date: 2026-11-17WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510241134.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2026-11-17
Estimated Expiration
2045-02-28

AI Technical Summary

Technical Problem

The existing link segmentation method for PCIe devices is static, which requires software reconfiguration when connecting different types of PCIe devices. This affects the normal operation of PCIe controllers with established links and results in low resource utilization.

Method used

By configuring priorities, maximum link widths, and minimum link widths for each port of a PCIe device, physical channels are dynamically allocated. The multi-port branch management module allocates resources reasonably based on the actual link width, ensuring the link performance and resource utilization of high-priority ports.

Benefits of technology

It improves the resource utilization and link management efficiency of PCIe devices, avoids the impact on existing links when connecting new devices, and ensures link performance and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120090782B_ABST
    Figure CN120090782B_ABST
Patent Text Reader

Abstract

This application relates to the field of computer hardware interface technology, and discloses a dynamic link segmentation method for PCIe devices, a PCIe device, and media. Each port on the PCIe device is configured with a corresponding priority, maximum link width, and minimum link width. The method includes: allocating a physical channel with the corresponding maximum link width to a first-priority port; when the state machine of the first-priority port enters a completed state, determining the actual link establishment width of the first-priority port; if the actual link establishment width of the first-priority port is less than the maximum link width of the first-priority port, determining the number of physical channels established and the number of unestablished physical channels for the first-priority port based on the actual link establishment width and the minimum link width; allocating the unestablished physical channels to the next-priority port, until all physical channels are allocated or all ports have completed link establishment. This application can improve the resource utilization and link management efficiency of PCIe devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer hardware interface technology, specifically to a method for dynamic link segmentation of PCIe devices, PCIe devices, and media. Background Technology

[0002] Bifurcation, a common technique in PCIe, can divide a single PCIe physical link into multiple PCIe links to adapt to various application scenarios (for example, a single x16 physical link can be divided into one x16, two x8, or four x4 links, depending on the actual connected devices).

[0003] In this traditional design, biscuits are statically assigned, meaning they are fixed during system initialization. During software initialization, the configuration needs to be modified based on the type of the connected device. If a subsequent PCIe device is added, or if the PCIe device type is changed and differs from the software's initial configuration, the software may need to modify the biscuit configuration. Furthermore, modifying the biscuit configuration can affect the normal operation of currently established PCIe controllers. Summary of the Invention

[0004] In view of this, this application provides a method for dynamic link segmentation of PCIe devices, PCIe devices, and media to improve the resource utilization and link management efficiency of PCIe devices.

[0005] In a first aspect, this application provides a dynamic link segmentation method for PCIe devices. Each port on the PCIe device is configured with a corresponding priority, maximum link width, and minimum link width. The method includes: allocating a physical channel with the corresponding maximum link width to a first priority port; when the state machine of the first priority port enters the completion state, determining the actual link establishment width of the first priority port; if the actual link establishment width of the first priority port is less than the maximum link width of the first priority port, determining the number of physical channels established and the number of unestablished physical channels of the first priority port based on the actual link establishment width and the minimum link width of the first priority port; allocating the unestablished physical channels to the next priority port, until all physical channels are allocated or all ports have completed link establishment.

[0006] The method provided in this application improves the resource utilization and link management efficiency of PCIe devices by configuring priorities, maximum link width and minimum link width for each port and dynamically allocating physical channels according to the actual link width.

[0007] In an optional implementation, the method further includes: if the actual link establishment width of the first priority port is equal to the maximum link width of the first priority port, then the link establishment of the first priority port is completed.

[0008] This optional implementation ensures that the port communicates at the maximum link width, maximizing data transmission capacity and improving port link performance.

[0009] In one alternative implementation, if the actual link width is greater than or equal to the minimum link width, then the number of physical channels of the first priority port is equal to the actual link width.

[0010] This optional implementation ensures that the port can utilize as many available physical channels as possible while meeting minimum link performance requirements, thereby improving link utilization.

[0011] In one alternative implementation, if the actual link width is less than the minimum link width, then the number of physical channels of the first priority port is equal to the minimum link width.

[0012] This optional implementation ensures that the first priority port obtains the minimum link width required for data transmission, thereby improving the reliability of link management.

[0013] Secondly, this application provides a PCIe device, in which each port is configured with a corresponding priority, maximum link width, and minimum link width; the PCIe device includes a multi-port branch management module; the multi-port branch management module is used to allocate physical channels with the corresponding maximum link width to the first priority port; when the state machine of the first priority port enters the completion state, the actual link width of the first priority port is determined; if the actual link width is less than the maximum link width, the number of physical channels established and the number of physical channels not established by the first priority port are determined; the physical channels not established are allocated to the next priority port until all physical channels are allocated or all ports have completed link establishment.

[0014] The multi-port branch management module for PCIe devices provided in this application can reasonably allocate resources according to the priority of each port, thereby making the resource utilization of PCIe devices higher.

[0015] In an optional implementation, the multi-port branch management module is further configured to: complete the link establishment of the first priority port if the actual link establishment width of the first priority port is equal to the maximum link width of the first priority port.

[0016] In one optional implementation, the multi-port branch management module is further configured to: if the actual link width is greater than or equal to the minimum link width, then the number of physical channels of the first priority port is equal to the actual link width.

[0017] In one optional implementation, the multi-port branch management module is further configured to: if the actual link width is less than the minimum link width, then the number of physical channels of the first priority port is equal to the minimum link width.

[0018] In one optional implementation, the PCIe device further includes a priority configuration register module, a maximum link width configuration register module, and a minimum link width configuration register module; the priority configuration register module is used to configure the priority of each port; the maximum link width configuration register module is used to configure the maximum link width of each port; and the minimum link width configuration register module is used to configure the minimum link width of each port.

[0019] This optional implementation allows for flexible setting of the priority of each port through the priority configuration register module, and flexible setting of the maximum and minimum link width of each port through the maximum link width configuration register module and the minimum link width configuration register module, thereby improving link management efficiency.

[0020] Thirdly, this application provides a computer-readable storage medium storing computer instructions for causing a computer to execute the PCIe device dynamic link segmentation method described in the first aspect or any corresponding embodiment thereof.

[0021] Fourthly, this application provides a computer program product, including computer instructions for causing a computer to execute the PCIe device dynamic link segmentation method described in the first aspect or any corresponding embodiment thereof. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram illustrating PCIe device link segmentation in an exemplary embodiment;

[0024] Figure 2 This is a flowchart illustrating the PCIe device dynamic link segmentation method according to an embodiment of this application;

[0025] Figure 3 This is a schematic diagram of a PCIe controller according to an optional embodiment of this application;

[0026] Figure 4This is a flowchart of a PCIe device dynamic link segmentation method according to an optional embodiment of this application;

[0027] Figure 5 This is a schematic diagram of the physical channel allocation of the first priority port according to an optional embodiment of this application;

[0028] Figure 6 This is a schematic diagram of establishing a connection at a first priority port according to an optional embodiment of this application;

[0029] Figure 7 This is a schematic diagram of a second priority port connection establishment according to an optional embodiment of this application;

[0030] Figure 8 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0032] In the description of the embodiments of this application, the term "correspondence" may indicate that there is a direct or indirect correspondence between two things, or that there is an association between two things, or that there is a relationship of instruction and being instructed, configuration and being configured, etc.

[0033] Figure 1 This is a schematic diagram illustrating PCIe device link segmentation in an exemplary embodiment, as shown below. Figure 1 As shown, a PCIe device has 16 lanes (a lane is an independent data transmission channel on the PCIe bus, i.e., a physical channel). Assuming only one PCIe x8 device is initially connected, leaving 8 unused physical channels, the software cannot determine which category (as shown in the diagram) a newly connected PCIe device will fall into. The software can only choose one configuration option. If the subsequently connected PCIe device has a different configuration than the software-configured configuration, the software needs to reconfigure according to the connected device. This reconfiguration will also affect the normal operation of the already established PCIe controller, requiring a re-establishment of the connection.

[0034] According to an embodiment of this application, a method for dynamic link segmentation of PCIe devices is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0035] This embodiment provides a method for dynamic link segmentation in PCIe devices. Each port on the PCIe device is configured with a corresponding priority, maximum link width, and minimum link width. Figure 2 This is a flowchart illustrating the dynamic link segmentation method for PCIe devices according to an embodiment of this application, as shown below. Figure 2 As shown, the process includes the following steps:

[0036] Step S201: Assign a physical channel with the maximum link width to the first priority port.

[0037] A PCIe port is a link interface connecting a PCIe device to another device. Each port on a PCIe device is configured with a priority to determine the order in which physical channels are allocated. Ports with higher priority are allocated physical channels first. For example, if port A has a higher priority than port B, then port A will receive more physical channels if there are limited channels. A link consists of one or more physical channels. A physical channel is the basic physical unit in a PCIe link, used for data transmission.

[0038] Configure a maximum link width for each port, indicating the maximum link width that the port can support. Optionally, the maximum link width for each port can be different. Link width refers to the number of physical channels available for data transmission in a PCIe link (such as x1, x4, x8, etc.). For example, if the maximum link width of port A is configured as x8, then port A can use a maximum of 8 physical channels for data transmission.

[0039] Configure a minimum link width for each port, representing the minimum link width that the port can accept, i.e., the minimum number of physical channels the port can communicate with. Optionally, the minimum link width for each port can be different. For example, if the minimum link width for port B is configured as x4, then port B requires at least 4 channels to transmit data.

[0040] First, allocate physical channels to the highest priority port. Based on the maximum link width configured for that port, allocate the corresponding number of physical channels to that port, prioritizing the link establishment needs of high-priority ports.

[0041] Step S202: When the state machine of the first priority port enters the completed state, determine the actual link establishment width of the first priority port.

[0042] A state machine is a mechanism for managing the state of a device or system, controlling the behavior of PCIe devices through a series of predefined states and transitions between states.

[0043] In PCIe devices, the completion state of the state machine indicates that the negotiation of the link width for that port has been completed. At this point, the actual link width established for the first priority port is determined, i.e., the negotiated link width. The actual link width refers to the link width actually used by the port during the link establishment process. However, the actual link width may not be consistent for each priority port.

[0044] By allocating link channels based on the actual link width, unused physical channels can be assigned to the next priority port, thereby improving link resource utilization.

[0045] Step S203: If the actual link width of the first priority port is less than the maximum link width of the first priority port, then determine the number of physical channels established and the number of physical channels not established for the first priority port based on the actual link width of the first priority port and the minimum link width of the first priority port.

[0046] If the actual link width of the first priority port is less than its maximum link width, the number of physical channels used for link establishment and the number of unused physical channels need to be determined based on the actual link width of the first priority port and its pre-configured minimum link width.

[0047] Specifically, if the actual link width of the first priority port is greater than or equal to its minimum link width, then the number of physical channels established is equal to the actual link width. If the actual link width is less than the minimum link width, then the number of physical channels established will be forcibly set to the minimum link width. After determining the number of physical channels established for the first priority port, the remaining unestablished physical channels are identified.

[0048] Optionally, if the actual link width of the first priority port is equal to the maximum link width of the first priority port, then the link establishment of the first priority port is completed.

[0049] When the actual link width established during the link establishment process of the first-priority port matches the maximum link width previously configured for it, the link establishment process for that port is complete. The link allocation for the first-priority port has reached its limit and no further adjustment is needed. Therefore, it can be considered that the link establishment process for this port has been successfully completed, enabling normal data transmission, ensuring that the port communicates at its maximum link width, maximizing data transmission capacity, and improving port link performance.

[0050] Optionally, if the actual link width is greater than or equal to the minimum link width, then the number of physical channels of the first priority port is equal to the actual link width.

[0051] When a first-priority port's actual link establishment width is greater than or equal to its configured minimum link width during link establishment, the number of physical channels used by that port will be set to the actual link establishment width. The allocation of physical channels is dynamically adjusted based on the actual link establishment situation to ensure that the port can utilize as many available physical channels as possible while meeting minimum link performance requirements, thereby improving link utilization.

[0052] Optionally, if the actual link width is less than the minimum link width, the number of physical channels of the first priority port is equal to the minimum link width.

[0053] When the actual link width of the first priority port is less than the minimum link width configured for the port during the link establishment process, the number of physical channels used by the port will be set to the minimum link width to ensure that the first priority port obtains the minimum link width required for data transmission and improve the reliability of link management.

[0054] Step S204: Assign the physical channels that have not yet established a link to the next priority port until all physical channels have been assigned or all ports have established a link.

[0055] The above steps allocate physical channels to the first priority port and determine the number of physical channels that have been established and the number of physical channels that have not been established. Based on the port priority order, the physical channels that have not been established are allocated to the next priority port. Steps S101 to S103 are repeated. For example, physical channels corresponding to the maximum link width are allocated to the second priority port. When the state machine of the second priority port enters the completion state, the actual link width of the second priority port is determined. Based on the actual link width and the minimum link width of the second priority port, the number of physical channels that have been established and the number of physical channels that have not been established are determined, and then the physical channels that have not been established are allocated to the next priority port. This process is repeated until all physical channels have been allocated or all ports have completed link establishment.

[0056] The PCIe device dynamic link segmentation method provided in this embodiment improves the resource utilization and link management efficiency of PCIe devices by configuring priority, maximum link width and minimum link width for each port and dynamically allocating physical channels according to the actual link width.

[0057] This embodiment also provides a PCIe device, wherein each port on the PCIe device is configured with a corresponding priority, maximum link width and minimum link width;

[0058] PCIe devices include a multi-port branch management module;

[0059] The multi-port branch management module is used to allocate physical channels with the corresponding maximum link width to the first priority port; when the state machine of the first priority port enters the completion state, the actual link width of the first priority port is determined; if the actual link width is less than the maximum link width, the number of physical channels established and the number of physical channels not established by the first priority port are determined; the physical channels not established are allocated to the next priority port until all physical channels are allocated or all ports have completed link establishment.

[0060] Specifically, the multi-port branch management module can allocate resources reasonably according to the priority of each port. When a high-priority port needs more link resources, the module will prioritize meeting its needs, while limiting the upper limit of channel allocation based on the maximum link width of the port to ensure that there is no over-allocation or that the allocation is not lower than the minimum link width of the port, thereby ensuring basic communication capabilities and making PCIe device resource utilization more efficient.

[0061] In one alternative implementation, the multi-port branch management module is further used for:

[0062] If the actual link width of the first priority port is equal to the maximum link width of the first priority port, then the link establishment of the first priority port is completed.

[0063] If the actual link width is greater than or equal to the minimum link width, then the number of physical channels of the first priority port is equal to the actual link width.

[0064] If the actual link width is less than the minimum link width, then the number of physical channels of the first priority port is equal to the minimum link width.

[0065] In one optional implementation, the PCIe device further includes a priority configuration register module, a maximum link width configuration register module, and a minimum link width configuration register module;

[0066] The priority configuration register module is used to configure the priority of each port;

[0067] The maximum link width configuration register module is used to configure the maximum link width of each port;

[0068] The minimum link width configuration register module is used to configure the minimum link width for each port.

[0069] Optionally, the PCIe device includes a PCIe controller, which includes a priority configuration register module, a maximum link width configuration register module, a minimum link width configuration register module, and a multi-port branch management module.

[0070] This optional implementation allows for flexible setting of the priority of each port through the priority configuration register module, and flexible setting of the maximum and minimum link width of each port through the maximum link width configuration register module and the minimum link width configuration register module, thereby improving link management efficiency.

[0071] Figure 3 This is a schematic diagram of a PCIe controller according to an optional embodiment of this application, as shown below. Figure 3 As shown, the following hardware module components are added to the PCIe controller:

[0072] The priority configuration register module, such as the configuration register prio_port, is used to independently configure the connection priority of each PCIe controller. 0 indicates the highest priority, and multiple ports can be configured with the same value.

[0073] The maximum link width configuration register module, such as the configuration register max_link_width_port, is used to independently configure the maximum link width of each PCIe controller, that is, the initial maximum link width allocated to each port;

[0074] The minimum link width configuration register module, such as the configuration register min_link_width_port, is used to independently configure the minimum link width of each PCIe controller, even if the actual link width of this port is what it is, it forces the reservation of the number of lanes.

[0075] Multi-port branch management modules, such as the Multi-Port Bifurcation Management module (hereinafter referred to as MP_BIF_MGT), are used to manage the establishment of links for all PCIe controllers. Optionally, the MP_BIF_MGT module also includes a Bifurcation module, which can implement Bifurcation control.

[0076] Figure 4 The following is a flowchart of a PCIe device dynamic link segmentation method according to an optional embodiment of this application. As shown in the figure, the implementation process of this process is as follows:

[0077] Step 1: Configure the priority of each port in the prio_port register as 0 / 1 / 2 / 3 / 4 / 5 / 6 / 7, where Port0 is the first priority port;

[0078] Step 2: Configure the max_link_width_port register to support the maximum link width for each port, i.e., 16 / 8 / 4 / 4 / 2 / 2 / 2 / 2. Then the maximum link width of the first priority port is x16.

[0079] Step 3: Configure all registers of min_link_width_port to 0, indicating that it is not necessary to reserve a physical channel for each port.

[0080] Step 4: MP_BIF_MGT allocates physical channels to the port with prio_port = 0 (Port0 in this example) according to the configured prio_port order, corresponding to the number of max_link_width_ports (16 in this example). MP_BIF_MGT controls the Bifurcation module to allocate all 16 physical channels to Port0. Figure 5 This is a schematic diagram of the physical channel allocation of the first priority port according to an optional embodiment of this application, such as... Figure 5 As shown, Lanes 0 through 15 are all assigned to Port 0;

[0081] Step 5: MP_BIF_MGT enables the LTSSM state machine of Port0 and begins the connection establishment process;

[0082] Step 6: When Port0's LTSSM enters the Configuration.Complete state, it indicates that the link width negotiation has been completed. At this time, Port0 feeds back the actual link width to the MP_BIF_MGT module, which is x8.

[0083] Step 7: After MP_BIF_MGT receives the link width feedback from Port0, it controls the Bifurcation module to reserve the number of physical channels for Port0 = Max(min_link_width_port, actual link width) and reclaim the resources of other physical channels. Figure 6 This is a schematic diagram of a first priority port connection establishment according to an optional embodiment of this application, such as... Figure 6 As shown, if Port0 establishes a link of x8 and min_link_width_port = 0, then the 8 physical channels that have not yet established a link, namely Lane8 to Lane15, will be recycled for the establishment of the next priority Port.

[0084] Step 8: The MP_BIF_MGT module allocates physical channels corresponding to the number of `max_link_width_port` channels (8 in this example) for the port with `prio_port = 1` (Port1 in this example). MP_BIF_MGT controls the Bifurcation module to allocate the remaining 8 physical channels to Port1. Figure 7 This is a schematic diagram of second priority port connection establishment according to an optional embodiment of this application, such as... Figure 7 As shown, Lane 8 to Lane 15 are assigned to the second priority ports;

[0085] Step 9: MP_BIF_MGT enables the LTSSM state machine of Port1 and begins the connection establishment process.

[0086] Step 10: Repeat steps 1 to 6 until all physical channels are used up or all ports have completed the connection establishment, at which point the entire process ends.

[0087] The method provided in this optional embodiment solves the problem of physical channel management and allocation for multi-port PCIe devices. The hardware automatically handles the entire link establishment process of the multi-port PCIe controller, and automatically allocates unused physical channels to other PCIe controllers based on the link establishment results. It provides flexible software configuration, which can configure the link establishment order of each PCIe controller and allocate the maximum and minimum number of physical channels to ensure that sufficient physical channel resources are reserved for the devices. Without affecting the already connected devices, it can dynamically allocate unused physical channels, avoiding the need for software to reconfigure the bifurcation information when a new PCIe device is connected, which would affect the already linked PCIe controllers and require them to re-establish the link.

[0088] This application also provides a computer device that can be implemented as the PCIe device described above.

[0089] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of this application, such as... Figure 8 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 8 Take a processor 10 as an example.

[0090] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0091] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.

[0092] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0093] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0094] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.

[0095] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.

[0096] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the methods shown in the above embodiments are implemented.

[0097] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0098] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and all such modifications and variations fall within the scope defined by the appended claims.

Claims

1. A method for dynamic link segmentation in PCIe devices, characterized in that, Each port on the PCIe device is configured with a corresponding priority, maximum link width, and minimum link width. The method includes: Allocate a physical channel with the maximum link width to the first priority port; When the state machine of the first priority port enters the completed state, the actual link establishment width of the first priority port is determined; If the actual link width of the first priority port is less than the maximum link width of the first priority port, then the number of physical channels established and the number of physical channels not established by the first priority port are determined based on the actual link width of the first priority port and the minimum link width of the first priority port. If the actual link width is greater than or equal to the minimum link width, then the number of physical channels of the first priority port is equal to the actual link width. The physical channels that have not yet established a link are assigned to the next priority port until all physical channels have been assigned or all ports have established a link.

2. The method according to claim 1, characterized in that, The method further includes: If the actual link width of the first priority port is equal to the maximum link width of the first priority port, then the link establishment of the first priority port is completed.

3. The method according to claim 1 or 2, characterized in that, If the actual link width is less than the minimum link width, then the number of physical channels of the first priority port is equal to the minimum link width.

4. A PCIe device, characterized in that, Each port on the PCIe device is configured with a corresponding priority, maximum link width, and minimum link width; The PCIe device includes a multi-port branch management module; The multi-port branch management module is used to allocate physical channels with the maximum link width to the first priority port; When the state machine of the first priority port enters the completed state, the actual link establishment width of the first priority port is determined; If the actual link width is less than the maximum link width, determine the number of physical channels for link establishment and the number of physical channels for which no link has been established at the first priority port; If the actual link width is greater than or equal to the minimum link width, then the number of physical channels of the first priority port is equal to the actual link width. The physical channels that have not yet established a link are assigned to the next priority port until all physical channels have been assigned or all ports have established a link.

5. The PCIe device according to claim 4, characterized in that, The multi-port branch management module is also used for: If the actual link width of the first priority port is equal to the maximum link width of the first priority port, then the link establishment of the first priority port is completed.

6. The PCIe device according to claim 4, characterized in that, The multi-port branch management module is also used for: If the actual link width is less than the minimum link width, then the number of physical channels of the first priority port is equal to the minimum link width.

7. The PCIe device according to claim 4, characterized in that, The PCIe device also includes a priority configuration register module, a maximum link width configuration register module, and a minimum link width configuration register module; The priority configuration register module is used to configure the priority of each port; The maximum link width configuration register module is used to configure the maximum link width of each port. The minimum link width configuration register module is used to configure the minimum link width of each port.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the PCIe device dynamic link segmentation method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Determining channel-to-link allocations for peripheral component fast interconnect ports

    CN117751355A

  • Allocating lanes of a serial computer expansion bus among installed devices

    US20150324311A1