Device initialization method, system, electronic device, storage medium and program product
By not negotiating the target standby protocol during link training, but using the configuration transaction layer data packets for negotiation after negotiation at the data link layer, the problem of too long device initialization time is solved, and the device initialization time is shortened and the link training complexity is reduced.
Patent Information
- Application Number
- CN202510543639.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-04-28
AI Technical Summary
In the prior art, the equipment initialization time is long, mainly because a large number of target standby protocol negotiations are required during the link training process, resulting in an extended link training time.
During the link training process, the target standby protocol negotiation is not conducted, but the target standby protocol negotiation is conducted by configuring the transaction layer data packets to reduce data content transmission.
It shortens the time required for device initialization, reduces the complexity of link training and the power consumption and area of PHY layer control logic.
Smart Images

Figure CN120066597B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a device initialization method, system, electronic device, storage medium, and program product. Background Art
[0002] To improve memory performance and utilization, the Compute Express Link (CXL) interconnect protocol was developed. CXL devices are compatible with the Peripheral Component Interconnect Express (PCIe) protocol by reusing the protocol stack at the PCIe physical layer (PHY). By introducing an alternate protocol negotiation mechanism in the PCIe Generation 5.0 (Gen 5.0) specification, the host and device negotiate the CXL protocol, determining whether to use PCIe or CXL for data transmission.
[0003] In the related art, during the link training process between the host and device, the host negotiates the CXL protocol with the device by sending a modified training sequence. Since a large amount of data needs to be sent, the link training takes a long time. Link training is an important part of device initialization, so the device initialization takes a long time. Summary of the Invention
[0004] The present application provides a device initialization method, system, electronic device, storage medium and program product to at least solve the problem in the related art that the device initialization takes a long time.
[0005] In a first aspect, the present application provides a device initialization method, which is applied to a host side and includes:
[0006] Performing link training with the device based on the original protocol to complete the physical layer link with the device. During the link training process, no target backup protocol negotiation is performed with the device.
[0007] Conduct data link layer negotiation with the device based on the original protocol to complete the data link layer connection with the device;
[0008] Negotiate a target backup protocol with the device based on the configuration transaction layer data packet and determine the negotiated target protocol;
[0009] Configure registers on the device side based on the target protocol to transmit data with the device side based on the target protocol;
[0010] The device initialization process includes link training, data link layer negotiation, and register configuration.
[0011] A second aspect of the present application provides a device initialization method, applied to a device side, comprising:
[0012] Performing link training with the host based on the original protocol to complete the physical layer link with the host. During the link training process, no target backup protocol negotiation is performed with the host.
[0013] Conduct data link layer negotiation with the host based on the original protocol to complete the data link layer connection with the host;
[0014] Negotiate a target standby protocol with the host based on the configuration transaction layer data packet, so that the host determines the negotiated target protocol, configures registers on the device based on the target protocol, and transmits data with the device based on the target protocol;
[0015] The device initialization process includes link training, data link layer negotiation, and register configuration.
[0016] A third aspect of the present application provides a device initialization system, the system comprising a host side and a device side, the host side being configured to execute the steps of any one of the device initialization methods of the first aspect above;
[0017] The device end is used to execute the steps of any device initialization method of the second aspect above.
[0018] The fourth aspect of the present application provides an electronic device, comprising: a memory for storing a computer program; a processor for implementing the steps of any device initialization method of the first aspect or the steps of any device initialization method of the second aspect when executing the computer program.
[0019] In a fifth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the computer program implements the steps of any device initialization method of the first aspect or the steps of any device initialization method of the second aspect.
[0020] In a sixth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any device initialization method of the first aspect or the steps of any device initialization method of the second aspect.
[0021] Through the present application, since link training is performed with the device side based on the original protocol to complete the physical layer link with the device side, during the link training process, the target backup protocol is not negotiated with the device side; data link layer negotiation is performed with the device side based on the original protocol to complete the data link layer link with the device side; target backup protocol negotiation is performed with the device side based on the configuration transaction layer data packet to determine the negotiated target protocol; registers on the device side are configured based on the target protocol to transmit data with the device side based on the target protocol. By using the configuration transaction layer data packet to negotiate the target backup protocol with the device side after the data link layer negotiation, compared to negotiating the target backup protocol with the device side by sending a revised training sequence during the link training process, the data content that needs to be sent is reduced, and the link training time is reduced. Therefore, the technical problem of the long time required for device initialization can be solved, and the technical effect of shortening the time required for device initialization can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] 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.
[0023] Figure 1 A schematic diagram of a state machine for link training in related art;
[0024] Figure 2 A schematic diagram of a state machine in the configuration phase of link training in the related art;
[0025] Figure 3 A schematic diagram of a device initialization method according to an embodiment of the present invention;
[0026] Figure 4 A flowchart of another device initialization method provided in an embodiment of the present application;
[0027] Figure 5 A schematic diagram of the interaction between the host and the device for target standby protocol negotiation according to an embodiment of the present application;
[0028] Figure 6 A schematic diagram of a process for negotiating a target backup protocol between a host and a device according to an embodiment of the present application;
[0029] Figure 7 A schematic diagram of performing read and write operations when the target protocol is the original protocol provided in an embodiment of the present application;
[0030] Figure 8A flowchart of performing read and write operations when the target protocol is the input and output subprotocol and memory subprotocol of the target backup protocol provided in an embodiment of the present application;
[0031] Figure 9 A schematic diagram of a flow chart of another device initialization method provided in an embodiment of the present application;
[0032] Figure 10 A schematic diagram of the structure of the arbitration / multiplexing module provided in an embodiment of the present application;
[0033] Figure 11 An architectural diagram of a device initialization system provided in an embodiment of the present application;
[0034] Figure 12 An architectural diagram of another device initialization system provided in an embodiment of the present application;
[0035] Figure 13 A schematic diagram of the structure of the device provided in the embodiment of the present application;
[0036] Figure 14 A schematic diagram of a process for performing device initialization in a device initialization system provided in an embodiment of the present application;
[0037] Figure 15 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] 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.
[0039] 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.
[0040] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0041] With the continuous advancement of computer technology, the CXL interconnect protocol has emerged to meet the needs of expanding memory capacity, improving memory utilization, and achieving cache coherence. This CXL interconnect protocol includes three sub-protocols: Compute Express Link Input / Output (CXL.io), Compute Express Link Cache (CXL.cache), and Compute Express Link Memory (CXL.mem). CXL.io is required for all CXL devices and is used for device discovery, interrupt reporting, Direct Memory Access (DMA), and initialization. CXL.cache is used for device-side caching of system memory. CXL.mem enables access to device memory between the Central Processing Unit (CPU) and other CXL devices. Support for CXL.cache and CXL.mem is optional for CXL devices.
[0042] Currently, CXL devices achieve compatibility with the PCIe protocol by dynamically multiplexing the three sub-protocol stacks—CXL.io, CXL.cache, and CXL.mem—on the PCIe physical layer (PHY). During device initialization, the PCIe PHY layer manages the link training process between the host and device to complete the physical layer connection. The PCIe Gen5.0 and PCIe Gen6.0 specifications introduce an alternate protocol negotiation mechanism to facilitate CXL protocol negotiation between the host and device. This mechanism occurs during the configuration phase of PCIe PHY layer link training at Gen1.0 speeds of 2.5 Gigabits per second (GT / s). The host determines whether it supports and enables the CXL protocol based on its register configuration. If so, it proactively sends the protocol details—Modified Training Sequence 1 / Training Sequence 2 (Modified TS1 / TS2)—to the device, using these details for protocol negotiation. CXL negotiation is completed if both the host and device support and enable CXL. After link training, both devices use CXL for configuration and data transmission. In other words, after link training, both devices use CXL as their operating protocol. If either the host or device does not support or enable CXL, data transmission and configuration will be carried out using the PCIe control layer protocol.
[0043] Figure 1 Schematic diagram of the state machine for link training in related technologies, such as Figure 1As shown, after powering on, the host enters the Detect state. After completing physical detection of the peer device, it enters the Polling state. During the Polling state, bit lock and symbol lock are achieved by sending an ordered training set 1 / 2. Following the Polling state, the configuration phase begins. During the configuration phase, both link parties negotiate the link number and channel number using ordered sets, and simultaneously negotiate the backup protocol. It should be noted that the replacement protocol and the backup protocol described in this application are synonymous. After the configuration phase, the link enters the normal state (L0 state), which is the Gen 1.0 data rate state. In this state, Data Link Layer Packets (DLLPs) can be transmitted. If both link parties (the host and the device) support a higher speed, the link enters the Recovery state, where they switch to the higher speed and re-enter the L0 state. This process repeats until the speed reaches the highest speed supported by both parties and the link transitions back to the L0 state. The link then transmits DLLPs and Transaction Layer Packets (TLPs) in this state.
[0044] After link training is complete, the negotiated protocol will be used. For the CXL protocol, the alternate protocol identification (ID) is 000. If any of the above steps are not completed, the PCIe protocol will be used after link training is complete.
[0045] Figure 2 FIG. 1 is a schematic diagram of a state machine in the configuration phase of link training in the related art. Figure 2As shown, the Configuration Entry state is the starting point for the configuration phase, marking the beginning of the link training process and the start of configuration-related operations. The system then enters the Configuration.Linkwidth.Start state, where the link number is negotiated. The system then enters the Configuration.Linkwidth.Accept state, where the negotiated link number is received and confirmed. The system then enters the Configuration.LaneNum.Wait state, where the lane number is negotiated. The system then enters the Configuration.LaneNum.Accept state, where the negotiated lane number is received and confirmed. Between the Configuration.Complete state and the Alternate Protocol state, the system also negotiates the Alternate Protocol. Once both the Alternate Protocol negotiation and the lane number configuration are complete, the system enters the Configuration.Complete state. After configuration is complete, the system enters the Configuration.Idle state.
[0046] It should be noted that the specific process of the alternative protocol negotiation in the related art is as follows: when the downstream port enters the Configuration.Lanenum.Wait state for the first time and the Modified TS Usage Mode 2 Supported - Alternate Protocol in the 32.0 GT / s Capabilities Register is set to 1 and the Modified TS Usage Mode Selected in the 32.0 GT / s Control Register is 010b, the host side will start the protocol negotiation process. The start of the protocol negotiation is that the host side sends Modified TS1 Ordered Sets to the device side, where the Modified TS Usage field in the ordered set = 010b, the Modified TS VendorID in the ordered set, and the Modified TS Information 1 (Modified Training Sequence Information 1) and Modified TS Information 2 (Modified Training Sequence Information 2) are derived from the host's Alternate Protocol Extended Capability Register. The device receives Modified TS1 Ordered Sets from the host. If the Modified TS Usage Mode 2 Supported - Alternate Protocol field in the device's 32.0 GT / s Capabilities Register is set to 1, it responds with a Modified TS1 Ordered Set to the host. The Modified TS Usage field in this ordered set is 010b. The Modified TS Vendor ID, Modified TS Information 1, and Modified TS Information 2 in this ordered set are derived from the device's Alternate Protocol Extended Capability Register. The device also records the ordered set information sent by the host.If the host receives Modified TS1 Ordered Sets from the device, it will send Modified TS2 Ordered Sets (Modified Training Sequence 2 Ordered Sets) to the device. These Modified TS2 Ordered Sets, except for the Ordered Set Symbol, contain the same key information as the Modified TS1 Ordered Sets. After receiving the Modified TS2 Ordered Sets from the host, the device will reply with its own Modified TS2 Ordered Sets to the host. If the information (alternate protocol ID) carried in the Modified TS1 / TS2 Ordered Sets between the host and the device is consistent, the alternate protocol negotiation is complete. The alternate protocol negotiation process must occur between the Configuration.lanenum.wait and Configuration.complete states, and must be completed simultaneously with the lanenum (channel number) configuration process.
[0047] It should be noted that the alternative protocol negotiation mechanism is a mechanism specifically proposed by PCIe for negotiating protocols based on the PCIe PHY layer without using the PCIe control layer. It has a certain degree of versatility and can support the negotiation of all protocols similar to the CXL protocol.
[0048] However, this backup protocol negotiation mechanism occurs during the link training phase. During this phase, the host negotiates the CXL protocol with the device by sending a modified training sequence. Since a large amount of data needs to be sent, this inevitably prolongs the link training time. This delay problem is particularly prominent in scenarios where the link quality is poor and multiple link trainings are required. Link training is an important part of device initialization, which results in a longer time required for device initialization.
[0049] In addition, the use of the backup protocol negotiation mechanism in the related technology to negotiate the CXL protocol requires the addition of PCIe control layer logic circuits to ensure that the backup protocol negotiation process is completed simultaneously with the channel number configuration process during the link training phase, which increases the complexity of the link training machine and increases the power consumption and area of the PHY layer control logic.
[0050] In response to the above problems, the embodiments of the present application provide a device initialization method, system, electronic device, storage medium and program product. The method is applied to the host side, including: performing link training with the device side based on the original protocol to complete the physical layer link with the device side, and during the link training process, no target backup protocol negotiation is performed with the device side; performing data link layer negotiation with the device side based on the original protocol to complete the data link layer link with the device side; performing target backup protocol negotiation with the device side based on the configuration transaction layer data packet to determine the negotiated target protocol; configuring the registers of the device side based on the target protocol to transmit data with the device side based on the target protocol. The method provided by the above scheme does not perform target backup protocol negotiation during the link training process, but instead performs target backup protocol negotiation with the device side using the configuration transaction layer data packet after the data link layer negotiation. Compared with the method of performing target backup protocol negotiation with the device side by sending a modified training sequence during the link training process, the data content that needs to be sent is reduced, thereby reducing the link training time, achieving the technical effect of shortening the time required for device initialization.
[0051] And because the target backup protocol negotiation is not performed during the link training phase, there is no need to add PCIe control layer logic circuits to ensure that the target backup protocol negotiation process is completed simultaneously with the channel number configuration process during the link training phase, thereby reducing the complexity of the link training machine and the power consumption and area of the PHY layer control logic.
[0052] The embodiment of the present application provides a device initialization method, which is applied to a host side. Figure 3 A flowchart of a device initialization method provided in an embodiment of the present application, such as Figure 3 As shown, the process includes the following steps:
[0053] Step S301: link training is performed with the device end based on the original protocol to complete the physical layer link with the device end. During the link training process, the target backup protocol is not negotiated with the device end.
[0054] The original protocol is the PCIe protocol. It is understood that the PCIe PHY layer is responsible for the link training process between the host and device to complete the physical layer link between the host and device.
[0055] In an embodiment of the present application, during the link training process, related processes other than the target backup protocol negotiation are performed, such as the negotiation of the link number, the negotiation of the channel number, etc.
[0056] Step S302: Perform data link layer negotiation with the device end based on the original protocol to complete the data link layer connection with the device end.
[0057] After link training is completed, the PHY layer of the host and device sides will be in the L0 state, and the PCIe link layer of the host and device sides will enter the Data Link Control and Management State Machine (DLCMSM) respectively. In this state machine, the host and device sides will exchange and confirm the starting credit value of the other side through the PHY layer, that is, the host and device sides will conduct data link layer negotiation. After confirming the starting credit value of the other side, the data link layer negotiation is completed, that is, the data link layer link between the host and device sides is completed.
[0058] Step S303: negotiate a target backup protocol with the device based on the configuration transaction layer data packet to determine a negotiated target protocol.
[0059] Among them, after the link layer negotiation is passed, that is, after the host side completes the data link layer connection with the device side, the transaction layer of the host side and the device side will start working. The host side can negotiate the target backup protocol with the device side by sending a configuration transaction layer data packet to determine the negotiated target protocol.
[0060] It should be noted that the target backup protocol may be any protocol different from the PCIe protocol. In the embodiment of the present application, the target backup protocol is taken as the CXL protocol as an example for description.
[0061] Step S304 : configuring registers on the device side based on the target protocol, so as to perform data transmission with the device side based on the target protocol.
[0062] After determining the target protocol, the host side configures registers on the device side through the target protocol, so that after the configuration is completed, the host side and the device side can perform data transmission based on the target protocol.
[0063] The device initialization process includes: link training, data link layer negotiation and register configuration.
[0064] The device initialization method provided in the embodiment of the present application only negotiates the PCIe protocol in the PCIe PHY for backward compatibility, and does not negotiate the target backup protocol during the link training process. Instead, after the data link layer negotiation, the target backup protocol is negotiated with the device side using a configuration transaction layer data packet. Compared with the method of negotiating the target backup protocol with the device side by sending a modified training sequence during the link training process, the data content that needs to be sent is reduced, thereby reducing the link training time, achieving the technical effect of shortening the time required for device initialization.
[0065] First, this solution is fully backward compatible with the PCIe PHY link process. There is no need to add control logic in the link trainer to ensure that the backup protocol negotiation mechanism is completed between Configuration.lanenum.wait and Configuration.complete. At the same time, it can reduce the number of backup protocol-related registers in the PCI capability space, thereby reducing the power consumption and area of the PHY layer control logic and the complexity of the link trainer.
[0066] The embodiment of the present application provides a device initialization method, which is applied to a host side. Figure 4 A flowchart of a device initialization method provided in an embodiment of the present application, such as Figure 4 As shown, the process includes the following steps:
[0067] Step S401: Link training is performed with the device based on the original protocol to complete the physical layer link with the device. During the link training process, the target backup protocol is not negotiated with the device. Figure 3 Step S301 of the illustrated embodiment will not be described in detail here.
[0068] Step S402: Perform data link layer negotiation with the device based on the original protocol to complete the data link layer connection with the device. Figure 3 Step S302 of the illustrated embodiment will not be described in detail here.
[0069] Step S403: negotiate a target backup protocol with the device based on the configuration transaction layer data packet to determine a negotiated target protocol.
[0070] Specifically, the above step S403 includes:
[0071] Step S4031: Acquire the first standby protocol register information of the host side.
[0072] After the host completes the data link layer connection with the device, the transaction layers on both sides begin to work. The host can configure the device's registers by sending configuration TLP read / write packets. This register configuration process includes configuring the PCI Configuration Header Space, PCI Capability Space, and PCI Express Extended Capability Space.
[0073] Specifically, the register configuration process involves the host reading information from the device's PCI configuration header space, such as the Device ID, Vendor ID, device type, and base address space size. The host then configures the device's base address space based on the information in the PCI configuration header space. The host then reads the Capabilities Pointer located in the PCI configuration header space register to obtain the starting address of the PCI Capabilities Space. The PCI Capabilities Space includes the functions supported and implemented by the PCIe device, such as power management, Message Signaled Interrupt (MSI), and Extended Message Signaled Interrupt (MSI-X). Because the PCI Capabilities Space uses a linked list structure, the host can continuously read all supported functions of the PCIe device and configure relevant device parameters based on the starting address of the PCI Capabilities Space by configuring TLP read and write packets. After completing the configuration of the PCI Configuration Header Space and PCI Capabilities Space, the host proceeds to configure the PCIe Extended Capabilities Space.
[0074] The registers related to the alternate protocol negotiation mechanism contained in the PCIe extended capability space are as follows: Alternate Protocol Capabilities Register, Alternate Protocol Control Register, Alternate Protocol Data 1 Register, Alternate Protocol Data 2 Register, and Alternate Protocol Selective Enable Mask Register. The Alternate Protocol Capability Register contains the Alternate Protocol Count and Alternate Protocol Selective Enable Supported fields. The Alternate Protocol Control Register contains the Alternate Protocol Index Select and Alternate Protocol Negotiation Global Enable fields (used to determine whether the link supports the alternate protocol negotiation mechanism). The Alternate Protocol Data 1 Register contains information related to the alternate protocol, such as Alternate Protocol Usage Information, Alternate Protocol Details, and Alternate Protocol Vendor ID. The Alternate Protocol Data 2 Register primarily contains Modified TS Information 2. The Alternate Protocol Selective Enable Mask Register primarily contains Alternate Protocol Selective Enable Mask - PCI Express and Alternate Protocol Selective Enable Mask – Others.
[0075] During PCIe expansion capability space configuration, the host negotiates the target backup protocol with the device based on the configuration transaction layer data packet to determine the negotiated target protocol. Specifically, the host first obtains its own first backup protocol register information, which includes information about the host's replacement protocol capability register, replacement protocol control register, replacement protocol data 1 register, replacement protocol data 2 register, and replacement protocol selective enable mask register.
[0076] Step S4032: When the first standby protocol register information indicates that the host side supports and enables the target standby protocol, a configuration transaction layer read data packet is sent to the device side, so that the device side receives the configuration transaction layer read data packet, reads the second standby protocol register information of the device side based on the configuration transaction layer read data packet, and encapsulates the second standby protocol register information in a configuration transaction layer read completion data packet and returns it to the host side.
[0077] in, Figure 5 The interactive diagram of the target standby protocol negotiation between the host side and the device side provided in the embodiment of the present application is as follows. Figure 5 As shown, when the first standby protocol register information indicates that the host side supports and enables the target standby protocol, the host side reads the device side standby protocol register by configuring the TLP packet, that is, the host side sends the configuration transaction layer read data packet to the opposite device in sequence to read the contents of the replacement protocol capability register, replacement protocol control register, replacement protocol data 1 register, replacement protocol data 2 register and replacement protocol selective enable mask register of the opposite device side.
[0078] The device responds with the parameters related to the alternate protocol registers via a configuration TLP read completion packet. Specifically, the device receives the configuration transaction layer read data packet, reads the device's second alternate protocol register information based on the configuration transaction layer read data packet, and encapsulates the second alternate protocol register information in a configuration transaction layer read completion packet and returns it to the host. The second alternate protocol register information includes the contents of the device's alternate protocol capability register, alternate protocol control register, alternate protocol data 1 register, alternate protocol data 2 register, and alternate protocol selective enable mask register.
[0079] Step S4033: receiving a configuration transaction layer read completion data packet, parsing the configuration transaction layer read completion data packet, and obtaining second standby protocol register information.
[0080] It is understood that the second backup protocol register information can be used to determine whether the device supports and enables the target backup protocol, the number of supported and enabled backup protocols, and information related to the backup protocol. The information related to the backup protocol can be a backup protocol ID, i.e., a backup protocol identifier. When the target backup protocol is the CXL protocol, the corresponding target backup protocol identifier is 000.
[0081] Step S4034: Determine the target protocol based on the first standby protocol register information and the second standby protocol register information.
[0082] The host determines the operating protocol based on the received configuration TLP read completion packet. Specifically, the host receives the configuration transaction layer read completion packet, parses the packet, obtains the second standby protocol register information, and then determines the target protocol (i.e., the operating protocol) based on the first and second standby protocol register information.
[0083] Step S404: configure registers on the device based on the target protocol to transmit data with the device based on the target protocol. The device initialization process includes link training, data link layer negotiation, and register configuration.
[0084] Specifically, the above step S404 includes:
[0085] Step S4041, sending a configuration transaction layer write data packet to the device side so that the device side receives the configuration transaction layer write data packet, and updates the preset bit in the replacement protocol control register of the device side based on the configuration transaction layer write data packet, so that the host side and the device side can transmit data based on the target protocol.
[0086] Among them, the configuration transaction layer write data packet includes the attribute identifier of the target protocol, and the attribute identifier is used to indicate whether the target protocol belongs to the target backup protocol. When the target protocol belongs to the target backup protocol, the configuration transaction layer write data packet also includes the target protocol identifier corresponding to the target protocol.
[0087] like Figure 5 As shown in the figure, the host side makes a decision on the operating protocol and writes the result to the alternative protocol control register of the device side through a configuration TLP write packet. That is, after the host side determines the target protocol, it sends a configuration transaction layer write packet to the device side, so that the device side receives the configuration transaction layer write packet and updates the preset bits in the alternative protocol control register of the device side based on the configuration transaction layer write packet, so that the host side and the device side can perform data transmission based on the target protocol.
[0088] Specifically, the preset bits are bits [15:9] in the replacement protocol control register on the device side, which is a reserved bit. This preset bit corresponds to 7 bits of data, which includes a control bit [bit 15], three protocol ID information bits [bits 14:12], and three subprotocol bits [bits 11:9, with bit 11 corresponding to the CXL.io subprotocol, bit 10 corresponding to the CXL.mem subprotocol, and bit 9 corresponding to the CXL.cache subprotocol]. The control bit is determined by the attribute identifier of the target protocol, and the three protocol ID information bits and the three subprotocol bits are determined by the target protocol identifier corresponding to the target protocol.
[0089] For example, if the update preset bits are 0000000, the target protocol is determined not to be a target fallback protocol, meaning the target fallback protocol is not supported or enabled, and only the PCIe protocol, or the original protocol, can be used as the target protocol. For another example, if the update preset bits are 1000110, the target protocol is determined to be a target fallback protocol, and the target fallback protocol ID is 000, meaning the CXL protocol is supported as the operating protocol, with only the CXL.io and CXL.mem subprotocols of the CXL protocol being used. In other words, the target protocol is the CXL.io and CXL.mem subprotocols of the CXL protocol. The protocol ID is determined by the Peripheral Component Interconnect Special Interest Group (PCI-SIG).
[0090] The device initialization method provided in the embodiment of the present application sends a configuration transaction layer read data packet to the device side to determine the target protocol when the host side supports and enables the target backup protocol. There is no need to negotiate the CXL protocol during the link training process, which can reduce the link training time and avoid the long delay problem caused by multiple link training in some scenarios with poor link quality. The content of the configuration transaction layer read data packet is less than that of the modified training sequence, which reduces the device initialization time.
[0091] By sending a configuration transaction layer write data packet to the device side to update the preset bit in the replacement protocol control register of the device side, the host side and the device side are ensured to transmit data based on the negotiated target protocol, thereby ensuring the reliability of data transmission.
[0092] In some optional implementations, the above step S4034 includes:
[0093] Step a1: when the second standby protocol register information indicates that the device supports and enables the target standby protocol, determine the sub-protocol identifier of the target standby protocol supported and enabled by the device based on the second standby protocol register information.
[0094] Figure 6 The flowchart of the target standby protocol negotiation between the host side and the device side provided in the embodiment of the present application is as follows. Figure 6 As shown, first determine whether the host side supports and enables the target standby protocol. If the host side supports and enables the target standby protocol, determine whether the device side supports and enables the target standby protocol. If the device side supports and enables the target standby protocol, determine whether the sub-protocol identifiers of the target standby protocol supported and enabled by the host side and the device side are consistent. Specifically, based on the first standby protocol register information, determine the sub-protocol identifier of the target standby protocol supported and enabled by the host side; based on the second standby protocol register information, determine the sub-protocol identifier of the target standby protocol supported and enabled by the device side; compare the sub-protocol identifier of the target standby protocol supported and enabled by the host side with the sub-protocol identifier of the target standby protocol supported and enabled by the device side to obtain a comparison result; based on the comparison result, determine whether the sub-protocol identifiers of the target standby protocol supported and enabled by the host side and the device side are consistent, that is, based on the comparison result, determine whether the sub-protocol identifiers of the target standby protocol supported and enabled by the host side and the device side have the same sub-protocol identifier.
[0095] Step a2: determining the sub-protocol identifier of the target standby protocol supported and enabled by the host side based on the first standby protocol register information.
[0096] Step a3: compare the sub-protocol identifier of the target standby protocol supported and enabled by the host side with the sub-protocol identifier of the target standby protocol supported and enabled by the device side to obtain a comparison result.
[0097] Step a4: If the comparison result indicates that the subprotocol identifier of the target standby protocol supported and enabled by the host side is identical to the subprotocol identifier of the target standby protocol supported and enabled by the device side, the subprotocol corresponding to the identical subprotocol identifier is used as the target protocol.
[0098] At the same time, the same sub-protocol identifier will be recorded on the host side.
[0099] The device initialization method provided in the embodiment of the present application clarifies the specific process of determining the target protocol based on the backup protocol register information, simplifies the protocol negotiation process, and improves the efficiency of the target backup protocol negotiation between the host and the device.
[0100] In some optional implementations, the device initialization method further includes:
[0101] Step b1: When the second standby protocol register information indicates that the device end does not support or has not enabled the target standby protocol, the original protocol is used as the target protocol.
[0102] Among them, such as Figure 6 As shown, when the second standby protocol register information indicates that the device side does not support or enable the target standby protocol, the host side uses the PCIe protocol as the target protocol, ie, the operation protocol.
[0103] It can be understood that if the comparison result indicates that the sub-protocol identifier of the target backup protocol supported and enabled by the host side does not have the same sub-protocol identifier as the sub-protocol identifier of the target backup protocol supported and enabled by the device side, the original protocol will be used as the target protocol.
[0104] The device initialization method provided in the embodiment of the present application directly uses the original protocol as the target protocol when the device side does not support or does not enable the target backup protocol, thereby avoiding the interruption of the device initialization process caused by the device side not supporting or enabling the target backup protocol, thereby ensuring the continuity and stability of the device initialization process.
[0105] In some optional implementations, the device initialization method further includes:
[0106] Step c1: When the first standby protocol register information indicates that the host side does not support or has not enabled the target standby protocol, the original protocol is used as the target protocol.
[0107] Among them, such as Figure 6 As shown, when the first standby protocol register information indicates that the host side does not support or does not enable the target standby protocol, the host side uses the PCIe protocol as the target protocol.
[0108] The device initialization method provided in the embodiment of the present application directly uses the original protocol as the target protocol when the host side does not support or enable the target backup protocol, thereby avoiding the interruption of the device initialization process caused by the host side not supporting or enabling the target backup protocol, thereby ensuring the continuity and stability of the device initialization process.
[0109] In some optional implementations, the device initialization method further includes:
[0110] Step d1, after the device initialization is completed, if the target protocol is the original protocol, the read and write commands that need to be executed by the device side are written into the submission queue cache of the host side memory, so that the device side reads the read and write commands in the submission queue cache based on the original protocol, parses and processes the read and write commands, and when the read and write commands are processed, the read and write command completion information is written into the processing completion queue of the host side memory, and an interrupt is submitted.
[0111] in, Figure 7 The flowchart of the read and write operation provided by the embodiment of the present application is when the target protocol is the original protocol. Figure 7As shown, when the target protocol is the native protocol, data transfer between the host and device is completed according to the PCIe input / output (I / O) transaction process. During this process, the device disables the target backup protocol arbitration module. The main process includes: the host writes the read and write commands to be executed by the device into the submission queue buffer in the host memory. The device reads the read and write commands from the submission queue buffer in the host memory based on the PCIe protocol, parses the read and write commands, and completes the data write from the solid-state drive (SSD) to the host memory physical area or the device reads data from the host memory physical area according to the read and write commands. After processing the read and write commands, the read and write command completion information is written to the processing completion queue in the host memory, and an interrupt is generated to allow the host to obtain the read and write command completion information.
[0112] The host-side memory is a dynamic random access memory (DRAM). This embodiment is described by taking a solid-state storage device as an example, but the device side is not limited to this.
[0113] For the relevant description of the host side and the device side in this embodiment, reference can be made to the relevant description of the device side in the device initialization system in the following embodiment, and no detailed description is given here.
[0114] Step d2: Obtain read / write command completion information from the processing completion queue, and determine status information of the read / write command based on the read / write command completion information.
[0115] The host side responds to the interrupt submitted by the device side and obtains the read and write command completion information from the processing completion queue in the host side memory.
[0116] In some optional implementations, the device initialization method further includes:
[0117] Step e1, after the device initialization is completed, if the target protocol is the input and output sub-protocol of the target backup protocol, the read and write commands that need to be executed by the device side are written into the submission queue cache of the host side memory, so that the device side reads the read and write commands in the submission queue cache based on the input and output sub-protocol, parses and processes the read and write commands, and when the read and write commands are processed, the read and write command completion information is written into the processing completion queue of the host side memory, and an interrupt is submitted.
[0118] The input and output sub-protocol of the target backup protocol is the CXL.io sub-protocol of the CXL protocol. Figure 8The flowchart of the read and write operation provided in the embodiment of the present application is when the target protocol is the input and output sub-protocol and the memory sub-protocol of the target backup protocol. Figure 8 As shown, when the target protocol is the CXL.io sub-protocol, an I / O-based transaction process is performed through the CXL.io sub-protocol to complete the data transfer between the host and device sides. In this process, the device side starts the target backup protocol arbitration module. The main process of this process includes: the host side places the read and write commands that the device side needs to execute in the submission queue cache in the host side memory, and then the device side reads the read and write commands from the submission queue cache through the CXL.io sub-protocol, parses the read and write commands, and completes the data writing from the SSD to the host DRAM physical area or the device side reading data from the host side memory physical area according to the read and write commands. When the read and write commands are processed, the read and write command completion information is written to the processing completion queue of the host side memory, and an interrupt is submitted to enable the host side to obtain the read and write command completion information.
[0119] Step e2: Obtain read / write command completion information from the processing completion queue, and determine status information of the read / write command based on the read / write command completion information.
[0120] In some optional implementations, the device initialization method further includes:
[0121] Step f1, after the device initialization is completed, if the target protocol is the memory sub-protocol of the target backup protocol, then when the host side needs to read data from the memory of the device side, based on the memory sub-protocol, a data read request is sent to the device side through the data read channel, so that the device side receives the data read request, obtains the target read data corresponding to the data read request, and sends the target read data and the execution status of the data read request to the host side through the data response channel.
[0122] Step f2, when the host side needs to write data to the memory of the device side, based on the memory sub-protocol, a data write request and target write data are sent to the device side through the data write channel, so that the device side receives the data write request and target write data, and based on the data write request, the target write data is written to the memory of the device side, and the execution status of the data write request is returned to the host side through the non-data response channel.
[0123] The memory sub-protocol of the target backup protocol is the CXL.mem sub-protocol of the CXL protocol. Figure 8As shown in the figure, when the target protocol is the CXL.mem subprotocol, the device performs host-to-device coherent access via the CXL.mem subprotocol. During this process, the device activates the target backup protocol arbitration module. The main flow of this process includes: the host reads data from the device-side DRAM via the master-to-slave (M2S) data read channel based on the CXL.mem subprotocol, and the device transfers data and status via the slave-to-master (S2M) data response channel. The host writes data to the device-side DRAM via the M2S data write channel based on the CXL.mem subprotocol, and the device transfers status via the S2M non-data response channel.
[0124] In some optional implementations, the device initialization method further includes:
[0125] In step g1, if the link training with the device end based on the original protocol fails, the step of performing the link training with the device end based on the original protocol is repeated until the link training succeeds and the physical layer link with the device end is completed.
[0126] If the number of times link training with the device based on the original protocol is repeated exceeds a preset threshold and link training still fails, an alarm is issued. The preset threshold is set by technical personnel and is not specifically limited here.
[0127] Step g2: If the data link layer negotiation with the device end based on the original protocol fails, repeat the steps of performing data link layer negotiation with the device end based on the original protocol until the data link layer negotiation succeeds and the data link layer connection with the device end is completed.
[0128] If the number of times the steps of performing data link layer negotiation with the device based on the original protocol are repeated exceeds a preset threshold, and the data link layer negotiation still fails, an alarm is issued.
[0129] The device initialization method provided in the embodiments of the present application significantly improves the success rate of establishing physical and data link layer links by repeating the relevant steps when link training or data link layer negotiation fails, effectively addressing occasional failures. If the number of repetitions exceeds a preset threshold and failures persist, the system triggers an alarm, helping technicians quickly locate the root cause of the problem and take appropriate measures to fix it.
[0130] The embodiment of the present application provides a device initialization method, which is applied to the device side. Figure 9 A flowchart of a device initialization method provided in an embodiment of the present application, such as Figure 9As shown, the process includes the following steps:
[0131] Step S901: link training is performed with the host end based on the original protocol to complete the physical layer link with the host end. During the link training process, the target backup protocol is not negotiated with the host end.
[0132] Step S902: Perform data link layer negotiation with the host side based on the original protocol to complete the data link layer connection with the host side.
[0133] Step S903: negotiate a target standby protocol with the host based on the configuration transaction layer data packet, so that the host determines the negotiated target protocol, configures registers on the device based on the target protocol, and transmits data with the device based on the target protocol.
[0134] The device initialization process includes link training, data link layer negotiation, and register configuration.
[0135] For details, please refer to the corresponding description of the aforementioned embodiment of the device initialization method applied to the host side, which will not be repeated here.
[0136] The device initialization method provided in the embodiment of the present application only negotiates the PCIe protocol in the PCIe PHY for backward compatibility, and does not negotiate the target backup protocol during the link training process. Instead, after the data link layer negotiation, the target backup protocol is negotiated with the device side using a configuration transaction layer data packet. Compared with the method of negotiating the target backup protocol with the device side by sending a modified training sequence during the link training process, the data content that needs to be sent is reduced, thereby reducing the link training time, achieving the technical effect of shortening the time required for device initialization.
[0137] First, this solution is fully backward compatible with the PCIe PHY link process. There is no need to add control logic in the link trainer to ensure that the backup protocol negotiation mechanism is completed between Configuration.lanenum.wait and Configuration.complete. At the same time, it can reduce the number of backup protocol-related registers in the PCI capability space, thereby reducing the power consumption and area of the PHY layer control logic and the complexity of the link trainer.
[0138] In some optional implementations, the device initialization method further includes:
[0139] Step h1: During the device initialization process, the target standby protocol arbitration module is turned off. The target standby protocol arbitration module is used to distinguish received data packets to determine protocol information to which the data packets belong.
[0140] In the related art, during the link training process, if the result of the backup protocol negotiation is a successful negotiation of the CXL protocol, the CXL.io sub-protocol will need to be used to configure the registers on the device side. In the current implementation, the data packets of the CXL.io protocol stack must pass through the arbitration / multiplexing module to enter the PHY layer. After the data packets in the PHY layer are converted from serial to parallel, they are transmitted on the link. The data received at the receiving end first enters the PHY layer. After the PHY data passes through the arbitration / multiplexing module, it enters the CXL.io protocol stack. This process will bring about a delay of approximately 4 nanoseconds to the transmission of each configuration TLP data packet. In the register configuration stage, multiple transmissions of the configuration TLP data packet are required to complete the data transmission. Therefore, this process will significantly increase the delay of the register configuration process, thereby increasing the time required for device initialization.
[0141] in, Figure 10 A schematic diagram of the structure of the arbitration / multiplexing module provided in the embodiment of the present application is shown in FIG. Figure 10 As shown, the arbitration / multiplexing module includes a PCIe protocol path, a target backup protocol arbitration module, and a target backup protocol multiplexing module. The target backup protocol arbitration module primarily implements arbitration and routing for packets of the three subprotocols CXL.io, CXL.mem, and CXL.cache. Packets of these three subprotocols are distinguished by the protocol ID represented by the first two bytes of the flow unit (flit).
[0142] In this embodiment, the device initialization phase is entirely completed using the PCIe protocol. If the target standby protocol arbitration module is not disabled, PCIe protocol packets must still arbitrate with packets from the three sub-protocols to determine their protocol information, which increases data transmission delays. This embodiment disables the target standby protocol arbitration module in the arbitration / multiplexing module during the device initialization phase. This allows packets to pass directly through the PCIe protocol path to the PHY layer without arbitration, reducing the time required for device initialization.
[0143] Step h2: After the device initialization is completed, if the target protocol belongs to the target standby protocol, the target standby protocol arbitration module is started.
[0144] like Figure 10 As shown, after the device initialization is completed, that is, after obtaining the initialization completion signal, the device sends a corresponding control signal to the arbitration / multiplexing module according to the protocol negotiation result to determine whether to start the target standby protocol arbitration module.
[0145] Specifically, the device sends a corresponding control signal to the arbitration / multiplexing module according to the update result of the preset bit of the replacement protocol control register.
[0146] When the update result of the preset bit of the replacement protocol control register indicates that the target protocol belongs to the target standby protocol, that is, the target protocol is at least one of the three sub-protocols, the device sends a first control signal to the arbitration / multiplexing module to start the target standby protocol arbitration module.
[0147] Step h3: After the device initialization is completed, if the target protocol is the original protocol, the target backup protocol arbitration module remains closed.
[0148] When the update result of the preset bit of the replacement protocol control register indicates that the target protocol is the original protocol, the device sends a second control signal to the arbitration / multiplexing module to keep the target standby protocol arbitration module closed and use the PCIe protocol channel.
[0149] The device initialization method provided in the embodiment of the present application performs a register configuration process through the PCIe protocol after link training is completed. During the register configuration phase, the target standby protocol arbitration module is disabled, thereby reducing overall latency compared to using the CXL.io protocol.
[0150] It's important to note that after device initialization is complete, the device selects the protocol stack based on bits [15:9] of the replacement protocol control register. For PCIe protocols, neither the data transmission method nor the packet format will be modified. However, for non-PCIe protocols (such as CXL), the corresponding protocol stack will be selected as the control layer, and the packet format will change. Specifically, since CXL.io and PCIe share the same basic functionality, there's no need to implement two control layer logic layers, one for the PCIe protocol and the other for the CXL.io subprotocol. Instead, a selector can be added to the same functional circuitry, with the selector's selection signal determined based on bits [15:9] of the replacement protocol control register. The CXL.io subprotocol uses 68-byte Flits for data transmission, while the PCIe control layer uses Start Transaction Layer Packets (STPs) and TLPs for transmission.
[0151] The functional logic of CXL.mem / CXL.cache already exists on the device side, and data transmission can be achieved by enabling the [15:9] bits of the replacement protocol control register.
[0152] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0153] The embodiment of the present application also provides a device initialization system, Figure 11 The architecture diagram of the device initialization system provided in the embodiment of the present application is as follows: Figure 11 As shown, the device initialization system includes a host side and a device side, wherein the host side is used to execute the steps of any of the above device initialization method embodiments applied to the host side. The device side is used to execute the steps of any of the above device initialization method embodiments applied to the device side.
[0154] The device initialization system provided by the embodiment of the present application utilizes a standby protocol negotiation mechanism that is completely based on the PCIe protocol on the device side. This mechanism first completes the link training of the PHY layer by using the PCIe protocol, and then uses the PCIe control layer logic to configure the device register. In this process, the host that supports the target standby protocol and enables the target standby protocol control register will query whether the device side supports and enables the target standby protocol such as the CXL protocol by initiating a configuration TLP read data packet. In the case where both parties support and enable the target standby protocol, the target protocol is determined. The host writes the target protocol identifier into the device side standby protocol control register by initiating a configuration TLP write data packet. After the device initialization process is completed, the device side control layer PCIe protocol switches to the target protocol and transmits data through CXL.mem / CXL.cache, wherein CXL.mem is used for consistent transaction access and CXL.io is used for I / O block transaction access, DMA, and interrupt operations. In the case where either party does not support or does not enable the target standby protocol, the host side and the device side will continue to transmit data through the PCIe control layer protocol. Because the PHY layer fully utilizes the PCIe link negotiation mechanism, link training complexity is simplified and link training latency is effectively reduced. Furthermore, the PCIe control layer logic is consistently used throughout the initialization and protocol negotiation process, and the device bypasses the target standby protocol arbitration module. This reduces the overall device initialization latency compared to initialization using CXL.io.
[0155] The embodiment of the present application also provides a device initialization system, Figure 12 This is an architectural diagram of the device initialization system provided in an embodiment of the present application, which is compatible with the currently deployed CXL and PCIe ecosystems. Figure 12 As shown, the system includes a host side and a device side. Since the development path of the CXL protocol is to introduce CXL.Cache and CXL.mem while being backward compatible with the PCIe protocol, the device side is compatible with the host side that has currently deployed and developed CXL / PCIe.
[0156] The host side includes the host CPU, root port, and memory. The host CPU includes the Level 1 cache (L1 cache), Level 2 cache (L2 cache), Level 3 cache (L3 shared cache), and backup protocol registers. The root port includes a PCIe / CXL.io controller, a memory controller, a home agent, and a protocol multiplexer. The PCIe / CXL.io controller implements the PCIe / CXL.io protocol, while the memory controller facilitates information transfer between the host and the memory. DRAM is used as the memory. The home agent implements the Non-Volatile Memory Express (NVMe) host controller interface specification and the CXL.mem subprotocol. The NVMe driver implements the NVMe protocol, while the CXL.mem controller implements the CXL.mem subprotocol. The protocol multiplexer implements the PCIe PHY functionality.
[0157] The host and device are connected via CXL's spatial topology (CXL-Fabric), where PCIe / CXL.io / CXL.mem-Stream is the link transmission channel.
[0158] The device side is described using a solid-state storage device as an example. The solid-state storage device achieves full compatibility with PCIe and CXL through the above-mentioned device initialization method embodiment applied to the device side without requiring major changes, and can thus be applied in the CXL ecosystem.
[0159] The device side also includes a backup protocol register. The backup protocol registers included in the host side and the device side include the aforementioned replacement protocol capability register, replacement protocol control register, replacement protocol data 1 register, replacement protocol data 2 register and replacement protocol selective enable mask register.
[0160] Figure 13 A schematic diagram of the structure of the device side provided in the embodiment of the present application is shown as follows: Figure 13As shown in the figure, a solid-state storage device (SSD) is used as an example. This device includes an SSD controller chip and flash memory. The SSD controller chip includes a CXL controller, a cache controller, a flash memory controller, memory, and an Advanced RISC Machine (ARM) processor. The CXL controller consists of a CXL PHY layer and a CXL control layer. The CXL PHY layer primarily includes the PCIe PHY layer. The CXL control layer includes an arbitration / multiplexing module, an NVMe module, the PCIe, CXL.io, and CXL.mem protocol control layers, and a network interface card (NIC) bus, enabling access paths for the CXL.io, CXL.mem, and PCIe protocols.
[0161] The CXL PHY (PCIe PHY) layer performs initial link training, data serial-to-parallel conversion, and clock recovery. The CXL.mem, CXL.io, and PCIe protocol stacks reuse the PCIe PHY layer to transmit and receive data. The NVMe module parses the NVMe protocol and transmits data packets to the NIC bus. The flash memory controller includes the Open NAND Flash Interface Controller (ONFI-Ctrl) for address identification and the Open NAND Flash Interface Physical Layer (ONFI-Phy).
[0162] The PCIe protocol has the same functions as the CXL.io protocol and is generally used for device discovery, configuration, initialization, I / O virtualization, etc. In this embodiment, the negotiation process of the backup protocol is performed based on the existing initialization steps.
[0163] The CXL.io protocol, based on the traditional PCIe protocol, is typically used for functions such as device discovery, configuration, initialization, I / O virtualization, and direct memory access with non-coherent cache load / store semantics. However, in this embodiment, due to the use of an alternative protocol negotiation mechanism based entirely on the PCIe protocol, these functions, such as device discovery, configuration, initialization, and I / O virtualization, are handled by the PCIe protocol stack. The CXL.io protocol is only responsible for data transmission with the host during the read and write phases after the host and device have successfully negotiated the CXL protocol.
[0164] The CXL.mem subprotocol enables device-side memory to become host-managed memory (HDM). Depending on whether the device supports cache coherence, it can be further categorized into host-managed memory (HDM-H), such as memory expanders, which feature host-only cache coherence, and host-managed memory (HDM-D), such as host-managed accelerator memory, which features device-managed cache coherence. In this embodiment, since no device-managed cache is involved, it is considered an HDM-H device. The host manages and accesses this memory just like accessing local DRAM connected to the host. The protocol is media-agnostic and uses a simple set of read and write operations involving host physical addresses, requiring internal translation of host physical addresses into the device's media address space. The protocol has three channels in each direction: host-to-slave and slave-to-host. The M2S direction includes a request channel (data read channel), a request channel with data (data write channel), and a back-invalidate response channel. The S2M direction includes a no-data-response channel (NDR), a data-response channel (DRS), and a back-invalidate snoop channel. To achieve simplicity and low latency, there is no ordering between channels. The CXL.mem protocol eliminates the drawbacks of cumbersome data read and write traffic required by I / O queue-based transactions.
[0165] Figure 14 The flowchart of target standby protocol negotiation in the device initialization system provided by the embodiment of the present application is as follows. Figure 14 The figure shows a solid-state storage device as an example. To highlight the key points, CXL-Fabric is not shown.
[0166] During the device power-up phase, the host and device first perform link training. This process is consistent with the PCIe PHY link training process and will not be further described here. The host and device then perform data link layer negotiation. After the data link layer negotiation is successful, the host reads the device registers related to the standby protocol negotiation using a configuration TLP packet based on its own standby protocol registers. It then configures the final operating protocol to complete device initialization. The PCIe protocol control layer transmits the device register information related to the standby protocol negotiation, i.e., the standby protocol register information.
[0167] The host reads the device-side registers related to the backup protocol negotiation through the configuration TLP data packet based on its own backup protocol register results, and configures the final operating protocol to be used, including:
[0168] ① When the host supports and enables the target backup protocol, the host reads the registers related to the backup protocol negotiation on the device side through the configuration TLP packet.
[0169] ②The device responds to the host's corresponding register value.
[0170] ③ The host compares the register value returned by the device with the result of its own backup protocol register and writes the final negotiation result back to the [15:9] fields of the replacement protocol control register in the backup protocol negotiation register via a configuration TLP packet. The target backup protocol arbitration module remains disabled throughout the device initialization process. For details, please refer to the description of the corresponding embodiment above and will not be repeated here.
[0171] The device initialization system provided in the embodiment of the present application is fully backward compatible with the link process of PCIe PHY. There is no need to add control logic in the link training machine to ensure that the backup protocol negotiation mechanism is completed between Configuration.lanenum.wait and Configuration.complete, thereby reducing the power consumption and area of the PHY layer control logic; secondly, after the link training is completed, the device register configuration process is performed through the PCIe protocol, and the target backup protocol arbitration module is turned off during the register configuration stage, which can reduce the overall delay compared to using the CXL.io protocol; in addition, since there is no need to negotiate the CXL protocol during the link training process, the link training time can be reduced, avoiding the long delay problem caused by multiple link training in some scenarios with poor link quality. The device end based on the backup protocol negotiation mechanism of the embodiment of the present application can be fully compatible with the implementation plan of the embodiment of the present application and can effectively reduce the time and power consumption.
[0172] The embodiment of the present application also provides an electronic device, such as Figure 15 As shown, it includes a processor 1501 and a memory 1502, in which a computer program is stored. The processor 1501 is configured to run the computer program to execute the steps in any of the above-mentioned device initialization method embodiments applied to the host side or execute the steps in any of the above-mentioned device initialization method embodiments applied to the device side.
[0173] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, wherein the computer program is configured to execute the steps of any of the above-mentioned device initialization method embodiments applied to the host side or execute the steps of any of the above-mentioned device initialization method embodiments applied to the device side when running.
[0174] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0175] An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of any of the above-mentioned device initialization method embodiments applied to the host side or executes the steps of any of the above-mentioned device initialization method embodiments applied to the device side.
[0176] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, the non-volatile computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, implementing the steps of any of the above-mentioned device initialization method embodiments applied to the host side or executing the steps of any of the above-mentioned device initialization method embodiments applied to the device side.
[0177] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0178] The above is a detailed introduction to a device initialization method, system, electronic device, storage medium and program product provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A device initialization method, characterized in that: Applied to the host side, including: Performing link training with the device based on the original protocol to complete the physical layer link with the device. During the link training process, no target backup protocol negotiation is performed with the device. Conduct data link layer negotiation with the device based on the original protocol to complete the data link layer connection with the device; performing target backup protocol negotiation with the device end based on the configuration transaction layer data packet, and determining a negotiated target protocol, wherein the target backup protocol is different from the original protocol; Performing register configuration on the device side based on the target protocol to perform data transmission with the device side based on the target protocol; The device initialization process includes: link training, data link layer negotiation and register configuration; The step of negotiating a target standby protocol with the device based on the configuration transaction layer data packet and determining a negotiated target protocol includes: Obtain the first standby protocol register information of the host side; If the first standby protocol register information indicates that the host side supports and enables the target standby protocol, sending a configuration transaction layer read data packet to the device side, so that the device side receives the configuration transaction layer read data packet, reading the second standby protocol register information of the device side based on the configuration transaction layer read data packet, and encapsulating the second standby protocol register information in a configuration transaction layer read completion data packet and returning it to the host side; receiving a configuration transaction layer read completion data packet, parsing the configuration transaction layer read completion data packet, and obtaining the second standby protocol register information; A target protocol is determined based on the first standby protocol register information and the second standby protocol register information.
2. The device initialization method according to claim 1, characterized in that: The determining the target protocol based on the first standby protocol register information and the second standby protocol register information includes: In a case where the second standby protocol register information indicates that the device side supports and enables the target standby protocol, determining a sub-protocol identifier of the target standby protocol supported and enabled by the device side based on the second standby protocol register information; Determining, based on the first standby protocol register information, a sub-protocol identifier of a target standby protocol supported and enabled by the host end; Compare the sub-protocol identifier of the target standby protocol supported and enabled by the host side with the sub-protocol identifier of the target standby protocol supported and enabled by the device side to obtain a comparison result; If the comparison result indicates that the sub-protocol identifier of the target standby protocol supported and enabled by the host side is identical to the sub-protocol identifier of the target standby protocol supported and enabled by the device side, the sub-protocol corresponding to the identical sub-protocol identifier is used as the target protocol.
3. The device initialization method according to claim 2, characterized in that: The method further comprises: When the second standby protocol register information indicates that the device side does not support or does not enable the target standby protocol, the original protocol is used as the target protocol.
4. The device initialization method according to claim 1, wherein: The method further comprises: When the first standby protocol register information indicates that the host side does not support or does not enable the target standby protocol, the original protocol is used as the target protocol.
5. The device initialization method according to claim 1, characterized in that: The configuring registers on the device side based on the target protocol includes: Sending a configuration transaction layer write data packet to the device end, so that the device end receives the configuration transaction layer write data packet, and updating a preset bit in the replacement protocol control register of the device end based on the configuration transaction layer write data packet, so that the host end and the device end perform data transmission based on the target protocol; Among them, the configuration transaction layer write data packet includes the attribute identifier of the target protocol, and the attribute identifier is used to characterize whether the target protocol belongs to the target backup protocol. When the target protocol belongs to the target backup protocol, the configuration transaction layer write data packet also includes the target protocol identifier corresponding to the target protocol.
6. The device initialization method according to claim 1, characterized in that: The method further comprises: After the device initialization is completed, if the target protocol is the original protocol, the read and write commands to be executed by the device are written into the submission queue cache of the host memory, so that the device reads the read and write commands in the submission queue cache based on the original protocol, parses and processes the read and write commands, and writes the read and write command completion information into the processing completion queue of the host memory after processing the read and write commands, and submits an interrupt; Acquire read / write command completion information from the processing completion queue, and determine status information of the read / write command based on the read / write command completion information.
7. The device initialization method according to claim 1, characterized in that: The method further comprises: After the device initialization is completed, if the target protocol is the input / output sub-protocol of the target standby protocol, the read / write commands to be executed by the device side are written into the submission queue cache of the host side memory, so that the device side reads the read / write commands from the submission queue cache based on the input / output sub-protocol, parses and processes the read / write commands, and writes read / write command completion information into the processing completion queue of the host side memory after processing the read / write commands, and submits an interrupt; Acquire read / write command completion information from the processing completion queue, and determine status information of the read / write command based on the read / write command completion information.
8. The device initialization method according to claim 1, characterized in that: The method further comprises: After device initialization is completed, if the target protocol is a memory sub-protocol of the target standby protocol, when the host side needs to read data from the memory of the device side, based on the memory sub-protocol, a data read request is sent to the device side through a data read channel, so that the device side receives the data read request, obtains target read data corresponding to the data read request, and sends the target read data and the execution status of the data read request to the host side through a data response channel; When the host side needs to write data to the memory of the device side, based on the memory sub-protocol, a data write request and target write data are sent to the device side through the data write channel, so that the device side receives the data write request and target write data, and based on the data write request, the target write data is written to the memory of the device side, and the execution status of the data write request is returned to the host side through the non-data response channel.
9. A device initialization method, characterized in that: Applied to the device side, including: Performing link training with the host based on the original protocol to complete the physical layer link with the host. During the link training process, no target backup protocol negotiation is performed with the host. Conduct data link layer negotiation with the host based on the original protocol to complete the data link layer connection with the host; performing target backup protocol negotiation with the host end based on the configuration transaction layer data packet, so that the host end determines a negotiated target protocol, and configuring registers of the device end based on the target protocol to perform data transmission with the device end based on the target protocol, wherein the target backup protocol is different from the original protocol; The device initialization process includes: link training, data link layer negotiation and register configuration; The target backup protocol is negotiated with the host based on the configuration transaction layer data packet, so that the host determines the negotiated target protocol, including: Receive a configuration transaction layer read data packet, read the second standby protocol register information of the device end based on the configuration transaction layer read data packet, encapsulate the second standby protocol register information in a configuration transaction layer read completion data packet and return it to the host end, so that the host end receives the configuration transaction layer read completion data packet, parses the configuration transaction layer read completion data packet, obtains the second standby protocol register information, and determines the target protocol based on the first standby protocol register information and the second standby protocol register information, wherein the host end obtains the first standby protocol register information of the host end, and sends the configuration transaction layer read data packet to the device end when the first standby protocol register information indicates that the host end supports and enables the target standby protocol.
10. The device initialization method according to claim 9, characterized in that: The method further comprises: During the device initialization process, the target standby protocol arbitration module is turned off, wherein the target standby protocol arbitration module is used to distinguish received data packets to determine the protocol information to which the data packets belong; After the device initialization is completed, if the target protocol belongs to the target standby protocol, the target standby protocol arbitration module is started; If the target protocol is the original protocol, the target backup protocol arbitration module remains closed.
11. A device initialization system, characterized in that: The system comprises a host side and a device side, wherein the host side is used to execute the device initialization method according to any one of claims 1 to 8; The device end is used to execute the device initialization method according to any one of claims 9 to 10.
12. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the device initialization method according to any one of claims 1 to 8 or the steps of the device initialization method according to any one of claims 9 to 10 when executing the computer program.
13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the computer program implements the steps of the device initialization method according to any one of claims 1 to 8 or the steps of the device initialization method according to any one of claims 9 to 10.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the device initialization method according to any one of claims 1 to 8 or the steps of the device initialization method according to any one of claims 9 to 10 are implemented.
Citation Information
Patent Citations
Data processing method, solid state disk device and host
CN118363914A
Parameter negotiation method of high-speed serial interface
CN119621641A