Device initialization method and system, electronic device, storage medium and program product
By negotiating the target standby protocol after negotiation in the data link layer during device initialization, the problem of long device initialization time is solved, and the effect of shortening the device initialization time is achieved.
Patent Information
- Application Number
- CN202510543639.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-04-28
AI Technical Summary
In the prior art, the time required for initialization of equipment is long, mainly because a large amount of data content needs to be sent during link training, resulting in a longer training time.
During the link training process, the target backup protocol negotiation is not conducted. Instead, after the data link layer negotiation, the target backup protocol negotiation is negotiated with the device side by configuring the transaction layer data packets, determining the negotiated target protocol, and data transmission is carried out based on the protocol.
By reducing the data content sent during link training, the time for link training is shortened, thereby reducing the total time required for device initialization.
Smart Images

Figure CN120066597A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to a device initialization method, system, electronic device, storage medium, and program product. Background Art
[0002] In order to improve memory performance and utilization, the Compute Express Link (CXL) interconnect protocol emerged as the times require. CXL devices are compatible with the PCIe protocol by multiplexing the protocol stack on the Physical Layer (PHY) of the Peripheral Component Interconnect Express (PCIe). By introducing an alternative protocol negotiation mechanism in the PCIe Generation 5.0 (Gen5.0) specification, the negotiation of the CXL protocol between the host side and the device side is realized to determine whether the host side and the device side use the PCIe protocol or the CXL protocol for data transmission.
[0003] In the related art, during the link training process between the host side and the device side, the host side negotiates the CXL protocol with the device side by sending a modified training sequence. Since the amount of data to be sent is large, the time required for link training is long, and link training is an important part of device initialization, so the time required for device initialization is long. Summary of the Invention
[0004] This application provides a device initialization method, system, electronic device, storage medium, and program product to at least solve the problem of long device initialization time in the related art.
[0005] The first aspect of this application provides a device initialization method 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. During the link training process, no target alternative 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 alternative protocol negotiation with the device side based on the configuration transaction layer packet to determine the negotiated target protocol; Configuring the registers of the device side based on the target protocol to perform data transmission with the device side based on the target protocol; Among them, the process of device initialization includes: link training, data link layer negotiation, and register configuration.
[0006] The second aspect of the present application provides a device initialization method, which is applied to the device side and includes: Performing link training with the host side based on the original protocol to complete the physical layer link with the host side. During the link training process, no negotiation on the target standby protocol is performed with the host side; Performing data link layer negotiation with the host side based on the original protocol to complete the data link layer link with the host side; Performing negotiation on the target standby protocol with the host side based on the configuration transaction layer packet, so that the host side determines the negotiated target protocol, and 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; Wherein, the process of device initialization includes: link training, data link layer negotiation, and register configuration.
[0007] The third aspect of the present application provides a device initialization system. The system includes a host side and a device side. The host side is used to execute the steps of any one of the device initialization methods in the first aspect above; The device side is used to execute the steps of any one of the device initialization methods in the second aspect above.
[0008] The fourth aspect of the present application provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any one of the device initialization methods in the first aspect above or implementing the steps of any one of the device initialization methods in the second aspect above when executing the computer program.
[0009] The fifth aspect of the present application provides a computer-readable storage medium, in which a computer program is stored. Wherein, when the computer program is executed by a processor, it implements the steps of any one of the device initialization methods in the first aspect above or implements the steps of any one of the device initialization methods in the second aspect above.
[0010] The sixth aspect of the present application provides a computer program product, including a computer program, which implements the steps of any one of the device initialization methods in the first aspect above or implements the steps of any one of the device initialization methods in the second aspect above when executed by a processor.
[0011] Through this 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, no negotiation on the target standby protocol is carried out 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; negotiation on the target standby protocol is carried out with the device side based on the configuration transaction layer packet to determine the negotiated target protocol; register configuration is performed on the device side based on the target protocol to perform data transmission with the device side based on the target protocol. By performing negotiation on the target standby protocol with the device side using the configuration transaction layer packet after the data link layer negotiation, compared with performing negotiation on the target standby protocol with the device side by sending a modified training sequence during the link training process, the amount of data content to be sent is reduced, and the time for link training 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
[0012] To more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0013] Figure 1 It is a state machine schematic diagram of link training in the related art; Figure 2 It is a state machine schematic diagram of the configuration phase of link training in the related art; Figure 3 It is a flowchart of the device initialization method provided by the embodiment of the present application; Figure 4 It is a flowchart of another device initialization method provided by the embodiment of the present application; Figure 5 It is an interaction schematic diagram of the host side and the device side performing negotiation on the target standby protocol provided by the embodiment of the present application; Figure 6 It is a flowchart of the host side and the device side performing negotiation on the target standby protocol provided by the embodiment of the present application; Figure 7 It is a schematic diagram of performing read and write operations in the case where the target protocol is the original protocol provided by the embodiment of the present application; Figure 8 It is a flowchart of performing read and write operations in the case where the target protocol is the input / output sub-protocol and the memory sub-protocol of the target standby protocol provided by the embodiment of the present application; Figure 9 It is a flowchart of another device initialization method provided by the embodiment of the present application; Figure 10 Structural schematic diagram of the arbitration / multiplexing module provided by the embodiment of the present application; Figure 11 Architectural diagram of the device initialization system provided by the embodiment of the present application; Figure 12 Another architectural diagram of the device initialization system provided by the embodiment of the present application; Figure 13 Structural schematic diagram of the device side provided by the embodiment of the present application; Figure 14 Flow schematic diagram of device initialization in the device initialization system provided by the embodiment of the present application; Figure 15 Hardware structural schematic diagram of an electronic device provided by the embodiment of the present application. Specific implementation manners
[0014] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.
[0015] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device including a series of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0016] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.
[0017] In the context of the continuous development of computer technology, to meet the needs of expanding memory capacity, improving memory utilization, and achieving cache coherence, the CXL interconnect protocol has emerged. The CXL interconnect protocol includes three sub-protocols: Compute Express Link Input / Output protocol (CXL.io for short), Compute Express Link Cache protocol (CXL.cache for short), and Compute Express Link Memory protocol (CXL.mem for short). Among them, the CXL.io protocol is mandatory for all CXL devices and is used to implement functions such as device discovery, interrupt reporting, direct memory access (DMA), and initialization. The CXL.cache protocol is used for the device-side caching of system memory. The CXL.mem protocol is used to enable the central processing unit (CPU) and other CXL devices to access device memory. Support for the CXL.cache protocol and the CXL.mem protocol is optional for CXL devices.
[0018] Currently, CXL devices achieve compatibility between the CXL protocol and the PCIe protocol by dynamically multiplexing the three sub-protocol stacks of CXL.io, CXL.cache, and CXL.mem on the Physical Layer (PHY) of PCIe. During the device initialization phase, the PCIe PHY layer is responsible for the link training process between the host side and the device side to complete the physical layer connection of the two devices. In the PCIe Gen5.0 and PCIe Gen6.0 specifications, an alternative protocol negotiation mechanism is proposed to achieve the negotiation of the CXL protocol between the host side and the device side. In the configuration phase of the PCIe PHY layer link training at a Gen1.0 speed of 2.5 Gigatransfers per second (2.5 GT / s), the host side determines whether it supports and enables the CXL protocol based on the configuration of its own registers. If the host side supports and enables the CXL protocol, the host side actively sends the protocol content: Modified Training Sequence 1 / Training Sequence 2 (Modified TS1 / TS2) to the device side, and conducts protocol negotiation with the device side through this protocol content. When both the host side and the device side support and enable the CXL protocol, the negotiation of the CXL protocol is completed. After the link training ends, the two devices will configure the device side and transfer data through the CXL protocol, that is, after the link training ends, the two devices will use the CXL protocol as the operating protocol. If either the host side or the device side does not support or enable the CXL protocol, after the link training ends, the two devices will transfer data and configure through the PCIe control layer protocol.
[0019] Figure 1 It is a state machine schematic diagram of link training in the related art, as Figure 1As shown, after the host side is powered on, it enters the Detect state. After completing the physical detection of the peer device, it enters the Polling state. During the Polling state, bit locking and symbol locking are completed by sending the ordered training set 1 / 2. After the Polling state, it enters the configuration phase. During the configuration phase, both sides of the link negotiate the link number and channel number through the ordered set, and at the same time, the negotiation of the alternate protocol is completed. It should be noted that the replacement protocol and the alternate protocol described in this application have the same meaning. After the configuration phase is completed, it will be in the normal state (L0 state), that is, the Gen 1.0 data rate state. In this state, the transmission of Data Link Layer Packet (DLLP) data can be carried out. If both sides of the link, that is, the host side and the device side, support a higher speed, it will enter the Recovery state. In the Recovery state, the higher speed switch is completed and it enters the L0 state again. Repeat the above actions until the speed is switched to the highest speed supported by both sides and it is switched to the L0 state. After that, the link transmits DLLP and Transaction Layer Packet (TLP) in this state.
[0020] After the link training is completed, it will work with the negotiated protocol. For the CXL protocol, the alternate protocol Identification (ID) is 000. If any stage in the above process is not completed, it will work with the PCIe protocol after the link training is completed.
[0021] Figure 2 It is a state machine schematic diagram of the configuration phase of link training in the related art. As Figure 2As shown, the Configuration Entry is the starting point of the configuration phase, marking the entry of link training into the configuration-related operation process. Then it enters the Configuration.Linkwidth.Start state, where the negotiation of the link number is carried out. Next, it enters the Configuration.Linkwidth.Accept state, where the negotiated link number is received and confirmed. Then it enters the Configuration.LaneNum.Wait state, where the negotiation of the lane number is carried out. Next, it enters the Configuration.LaneNum.Accept state, where the negotiated lane number is received and confirmed. Between the Configuration.LaneNum.Wait state and the Configuration.Complete state, the negotiation of the alternate protocol also needs to be carried out. When the negotiation of the alternate protocol is completed simultaneously with the configuration process of the lane number, it enters the Configuration.Complete state. After the configuration is completed, it enters the Configuration.Idle state.
[0022] It should be noted that the specific process of standby protocol negotiation in the related technology is as follows: When the downstream port first enters the Configuration.Lanenum.Wait state, 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 will start the protocol negotiation process. The start of the protocol negotiation is that the host sends Modified TS1 Ordered Sets to the device side, where the Modified TS Usage field in this ordered set = 010b, and the Modified TS VendorID, Modified TS Information 1, and Modified TS Information 2 in the ordered set are from the host-side AlternateProtocol Extended Capability Register. The device side receives the Modified TS1 Ordered Sets sent by the host side. If the Modified TS Usage Mode 2 Supported - Alternate Protocol in the 32.0 GT / s Capabilities Register of the device side is set to 1, it will reply to the host side with Modified TS1 Ordered Sets. The Modified TS Usage field in this ordered set = 010b, and the Modified TS Vendor ID, Modified TS Information 1, and Modified TS Information 2 in the ordered set are from the device-side Alternate Protocol Extended Capability Register, and at the same time record the information of the ordered set sent by the host side.If the host receives the Modified TS1 Ordered Sets sent by the device, it will send Modified TS2 Ordered Sets (modified training sequence 2 ordered sets) to the device. Except that the ordered set symbol is inconsistent with that of the Modified TS1 Ordered Sets, the key information content of the Modified TS2 Ordered Sets is the same as that of the Modified TS1 Ordered Sets. After receiving the Modified TS2 Ordered Sets sent by the host, the device will reply with its own Modified TS2 Ordered Sets to the host. If the information (alternate protocol ID) carried by the host and the device through the Modified TS1 / TS2 Ordered Sets is the same, then both sides complete the alternate protocol negotiation. The alternate protocol negotiation process needs to be completed between the Configuration.lanenum.wait state and the Configuration.complete state and simultaneously with the configuration process of lanenum (channel number).
[0023] It should be noted that the alternate protocol negotiation mechanism is specifically proposed by PCIe for negotiating protocols based on the PCIe PHY layer without using the PCIe control layer. It has a certain generality and can support the negotiation of all protocols similar to the CXL protocol.
[0024] However, this alternate protocol negotiation mechanism occurs in the link training stage. In this stage, the host negotiates the CXL protocol with the device by sending modified training sequences. Since the amount of data to be sent is large, this will inevitably prolong the duration of link training. Especially in some scenarios where the link quality is poor and link training needs to be performed multiple times, this delay problem will be more prominent. And link training is an important part of device initialization, which results in a longer time required for device initialization.
[0025] Moreover, when using the alternate protocol negotiation mechanism in the related technology to negotiate the CXL protocol, it is necessary to add PCIe control layer logic circuits to ensure that the alternate protocol negotiation process is completed simultaneously with the configuration process of the channel number in the link training stage, which increases the complexity of the link training machine and at the same time increases the power consumption and area of the PHY layer control logic.
[0026] In view of the above problems, an embodiment of the present application provides a device initialization method, system, electronic device, storage medium, and program product. The method is applied to the host side and includes: performing link training with the device side based on the original protocol to complete the physical layer link with the device side. During the link training process, no negotiation of the target standby protocol 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 negotiation of the target standby protocol with the device side based on the configuration transaction layer packet to determine the negotiated target protocol; and 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 method provided by the above solution does not perform negotiation of the target standby protocol during the link training process, but after the data link layer negotiation, uses the configuration transaction layer packet to perform negotiation of the target standby protocol with the device side. Compared with the method of performing negotiation of the target standby protocol with the device side by sending a modified training sequence during the link training process, the amount of data to be sent is reduced, thereby reducing the time of link training and achieving the technical effect of shortening the time required for device initialization.
[0027] Moreover, since no negotiation of the target standby protocol is performed during the link training phase, there is no need to add PCIe control layer logic circuits to ensure that the negotiation process of the target standby protocol is completed simultaneously with the configuration process of the channel number during the link training phase, reducing the complexity of the link training machine and at the same time reducing the power consumption and area of the PHY layer control logic.
[0028] An embodiment of the present application provides a device initialization method, which is applied to the host side. Figure 3 It is a flowchart of the device initialization method provided by an embodiment of the present application. As Figure 3 shown, the process includes the following steps: Step S301: Perform link training with the device side based on the original protocol to complete the physical layer link with the device side. During the link training process, no negotiation of the target standby protocol is performed with the device side.
[0029] Among them, the original protocol is the PCIe protocol. It can be understood that the PCIe PHY layer is responsible for the link training process between the host side and the device side to complete the physical layer link between the host side and the device side.
[0030] In an embodiment of the present application, during the link training process, related processes other than the negotiation of the target standby protocol are performed, such as negotiation of the link number, negotiation of the channel number, etc.
[0031] Step S302: Perform data link layer negotiation with the device side based on the original protocol to complete the data link layer link with the device side.
[0032] After link training is completed, the PHY layers of the host side and the device side will be in the L0 state. The PCIe link layers of the host side and the device side will enter the Data Link Control and Management State Machine (DLCMSM) respectively. Under this state machine, the host side and the device side will exchange and confirm the initial credit value of the peer through the PHY layer, that is, the host side and the device side conduct data link layer negotiation. After confirming the initial credit value of the peer, the data link layer negotiation is completed, that is, the data link layer connection between the host side and the device side is completed.
[0033] Step S303, perform target alternative protocol negotiation with the device side based on the configuration transaction layer packet to determine the negotiated target protocol.
[0034] 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 layers of the host side and the device side will start to work. The host side can perform target alternative protocol negotiation with the device side by sending a configuration transaction layer packet to determine the negotiated target protocol.
[0035] It should be noted that the target alternative protocol can be any protocol different from the PCIe protocol. In the embodiments of this application, the CXL protocol is taken as an example of the target alternative protocol for illustration.
[0036] Step S304, perform register configuration on the device side based on the target protocol to perform data transmission with the device side based on the target protocol.
[0037] Among them, after the target protocol is determined, the host side performs register configuration 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.
[0038] The process of device initialization includes: link training, data link layer negotiation, and register configuration.
[0039] The device initialization method provided by the embodiments of this application only negotiates the PCIe protocol in the PCIe PHY for backward compatibility, does not perform target alternative protocol negotiation during link training, but after the data link layer negotiation, uses the configuration transaction layer packet to perform target alternative protocol negotiation with the device side. Compared with the method of performing target alternative protocol negotiation with the device side by sending a modified training sequence during link training, the amount of data to be sent is reduced, thereby reducing the time of link training, achieving the technical effect of shortening the time required for device initialization.
[0040] This solution is fully backward-compatible with the link process of the PCIe PHY. There is no need to add control logic in the link trainer to ensure that the alternate protocol negotiation mechanism is completed between Configuration.lanenum.wait and Configuration.complete. At the same time, it can reduce the registers related to the alternate protocol in the PCI capability space, thus reducing the power consumption and area of the PHY layer control logic and the complexity of the link trainer.
[0041] An embodiment of the present application provides a device initialization method, which is applied to the host side. Figure 4 The flowchart of the device initialization method provided by the embodiment of the present application is as Figure 4 shown. This process includes the following steps: Step S401: Perform link training with the device side based on the original protocol to complete the physical layer link with the device side. During the link training process, no target alternate protocol negotiation is performed with the device side. For details, please refer to Figure 3 Step S301 of the embodiment shown, which will not be elaborated here.
[0042] Step S402: Perform data link layer negotiation with the device side based on the original protocol to complete the data link layer link with the device side. For details, please refer to Figure 3 Step S302 of the embodiment shown, which will not be elaborated here.
[0043] Step S403: Perform target alternate protocol negotiation with the device side based on the configuration transaction layer packet to determine the negotiated target protocol.
[0044] Specifically, the above step S403 includes: Step S4031: Obtain the first alternate protocol register information of the host side.
[0045] Among them, after the host side completes the data link layer link with the device side, the transaction layers of the host side and the device side will start to work. The host side can configure the registers of the device side by sending configuration TLP read / write packets. This register configuration process includes: the configuration of the PCI Configuration Header Space, the configuration of the PCICapability Space, and the configuration of the PCI Express Extended Capability Space.
[0046] Specifically, the register configuration process includes: The host reads the information in the PCI configuration header space of the device side, such as Device ID (device identifier), Vendor ID (vendor identifier), device type, and the size of the base address space, and completes the configuration of the base address space of the device side based on the information in the PCI configuration header space of the device side. The host will obtain the starting address of the PCI capabilities space by reading the Capabilities Pointer in the PCI configuration header space register. The PCI capabilities space includes functions that this PCIe device can support and implement, such as power management, Message Signaled Interrupt (abbreviated as: MSI), Message Signaled Interrupt Extended (abbreviated as: MSI-X), etc. Since the PCI capabilities space adopts a linked list structure, the host can continuously read all the functions supported by the PCIe device and configure the relevant parameters of the device side by configuring the TLP read and write packets based on the starting address of the PCI capabilities space. After completing the configuration of the PCI configuration header space and the PCI capabilities space, the host will continue with the configuration of the PCIe extended capabilities space.
[0047] The registers related to the alternate protocol negotiation mechanism included in the PCIe extended capabilities 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. Among them, the Alternate Protocol Capabilities Register contains fields such as Alternate Protocol Count and Alternate Protocol Selective Enable Supported; the Alternate Protocol Control Register contains Alternate Protocol Index Select and Alternate Protocol Negotiation Global Enable (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 mainly contains Modified TS Information 2. The Alternate Protocol Selective Enable Mask Register mainly contains Alternate Protocol Selective Enable Mask - PCI Express and Alternate Protocol Selective Enable Mask–Others.
[0048] In the process of configuring the PCIe expansion capability space, the host side negotiates the target alternative protocol with the device side based on the configuration transaction layer packet to determine the negotiated target protocol. Specifically, the host side first obtains the information of its first alternative protocol register, which includes the information of the replacement protocol capability register of the host side, the information of the replacement protocol control register, the information of the replacement protocol data 1 register, the information of the replacement protocol data 2 register, and the information of the replacement protocol selective enable mask register, etc.
[0049] Step S4032, when the information of the first alternative protocol register indicates that the host side supports and enables the target alternative protocol, send a configuration transaction layer read packet to the device side so that the device side receives the configuration transaction layer read packet, reads the information of the second alternative protocol register of the device side based on the configuration transaction layer read packet, and encapsulates the information of the second alternative protocol register in the configuration transaction layer read completion packet and returns it to the host side.
[0050] Among them, Figure 5 is an interaction schematic diagram for the host side and the device side to negotiate the target alternative protocol provided by the embodiment of the present application. As Figure 5 shown, when the information of the first alternative protocol register indicates that the host side supports and enables the target alternative protocol, the host side reads the alternative protocol register of the device side through the configuration TLP packet, that is, the host side sequentially sends a configuration transaction layer read packet to the peer device to read the content in the replacement protocol capability register, the replacement protocol control register, the replacement protocol data 1 register, the replacement protocol data 2 register, and the replacement protocol selective enable mask register of the peer device.
[0051] The device side replies with the relevant parameters of the alternative protocol register through the configuration TLP read completion packet, that is, the device side receives the configuration transaction layer read packet, reads the information of the second alternative protocol register of the device side based on the configuration transaction layer read packet, and encapsulates the information of the second alternative protocol register in the configuration transaction layer read completion packet and returns it to the host side. Among them, the information of the second alternative protocol register includes the content in the replacement protocol capability register, the replacement protocol control register, the replacement protocol data 1 register, the replacement protocol data 2 register, and the replacement protocol selective enable mask register of the device side.
[0052] Step S4033, receive the configuration transaction layer read completion packet, parse the configuration transaction layer read completion packet, and obtain the information of the second alternative protocol register.
[0053] It can be understood that through the second spare protocol register information, it can be determined whether the device side supports and enables the target spare protocol, the number of supported and enabled spare protocols, and the information related to the spare protocol, etc. Among them, the information related to the spare protocol can be the spare protocol ID, that is, the spare protocol identifier. When the target spare protocol is the CXL protocol, the corresponding target spare protocol identifier is 000.
[0054] Step S4034, determine the target protocol based on the first spare protocol register information and the second spare protocol register information.
[0055] The host side makes a decision on the operation protocol according to the received configuration TLP read completion packet. That is, the host receives the configuration transaction layer read completion data packet, parses the configuration transaction layer read completion data packet, obtains the second spare protocol register information, and determines the target protocol, that is, the operation protocol, based on the first spare protocol register information and the second spare protocol register information.
[0056] Step S404, perform register configuration on the device side based on the target protocol to perform data transmission with the device side based on the target protocol. Among them, the process of device initialization includes: link training, data link layer negotiation, and register configuration.
[0057] Specifically, the above step S404 includes: Step S4041, send 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 update the preset bits 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 perform data transmission based on the target protocol.
[0058] 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 spare protocol. When the target protocol belongs to the target spare protocol, the configuration transaction layer write data packet also includes the target protocol identifier corresponding to the target protocol.
[0059] Such as Figure 5 As shown, the host side makes a decision on the operation protocol and writes the result into the spare protocol control register of the device side through the configuration TLP write packet. That is, after the host side determines the target protocol, it sends 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 bits 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 perform data transmission based on the target protocol.
[0060] Specifically, the preset bit is the [15:9] bit in the replacement protocol control register of the device side, and this field is a reserved bit. This preset bit corresponds to 7-bit data, and this 7-bit data includes a control bit [bit 15] + three protocol ID information bits [bits: 14:12] + three sub-protocol bits [bits: 11:9, bit 11 corresponds to the CXL.io sub-protocol, bit 10 corresponds to the CXL.mem sub-protocol, bit 9 corresponds to the CXL.cache sub-protocol]. Among them, the control bit is determined by the attribute identifier of the target protocol, and the three protocol ID information bits and the three sub-protocol bits are determined by the target protocol identifier corresponding to the target protocol.
[0061] For example, if the preset bit is updated to 0000000, it is determined that the target protocol does not belong to the target alternative protocol, that is, the target alternative protocol is not supported or not enabled, and only the PCIe protocol, that is, the original protocol, can be used as the target protocol. For another example, if the preset bit is updated to 1000110, it is determined that the target protocol belongs to the target alternative protocol, and the ID of this target alternative protocol is 000, that is, the CXL protocol is supported as the operation protocol, and only the CXL.io sub-protocol and the CXL.mem sub-protocol in the CXL protocol are used. That is to say, the target protocol is the CXL.io sub-protocol and the CXL.mem sub-protocol of the CXL protocol. The protocol ID is determined by the Peripheral Component Interconnect Special Interest Group (PCI-SIG).
[0062] The device initialization method provided by the embodiments of the present application, when the host side supports and enables the target alternative protocol, sends a configuration transaction layer read data packet to the device side to determine the target protocol, without the need to negotiate the CXL protocol during the link training process, which can reduce the link training duration, avoid the long delay problem caused by multiple link trainings in some scenarios with poor link quality, and the content of the configuration transaction layer read data packet is less than the content of the modified training sequence, reducing the device initialization duration.
[0063] 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, it is ensured that the host side and the device side perform data transmission based on the negotiated target protocol, ensuring the reliability of data transmission.
[0064] In some alternative embodiments, the above step S4034 includes: Step a1, when the second alternative protocol register information indicates that the device side supports and enables the target alternative protocol, based on the second alternative protocol register information, determine the sub-protocol identifier of the target alternative protocol supported and enabled by the device side.
[0065] Figure 6 This is a schematic diagram of the process for the host side and the device side in the embodiment of this application to negotiate the target standby protocol. As Figure 6 shown, first, it is determined whether the host side supports and enables the target standby protocol. When the host side supports and enables the target standby protocol, it is determined whether the device side supports and enables the target standby protocol. When the device side supports and enables the target standby protocol, it is determined whether the sub - protocol identifiers of the target standby protocols supported and enabled by the host side and the device side are the same. Specifically, based on the first standby protocol register information, the sub - protocol identifier of the target standby protocol supported and enabled by the host side is determined; based on the second standby protocol register information, the sub - protocol identifier of the target standby protocol supported and enabled by the device side is determined; the sub - protocol identifier of the target standby protocol supported and enabled by the host side is compared 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, it is determined whether the sub - protocol identifiers of the target standby protocols supported and enabled by the host side and the device side are the same, that is, based on the comparison result, it is determined whether there are the same sub - protocol identifiers among the sub - protocol identifiers of the target standby protocols supported and enabled by the host side and the device side.
[0066] Step a2: 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.
[0067] 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.
[0068] Step a4: If the comparison result indicates that there are the same sub - protocol identifiers between the sub - protocol identifier of the target standby protocol supported and enabled by the host side and the sub - protocol identifier of the target standby protocol supported and enabled by the device side, then use the sub - protocol corresponding to the same sub - protocol identifier as the target protocol.
[0069] Meanwhile, the host side will record the same sub - protocol identifier.
[0070] The device initialization method provided by the embodiment of this application clarifies the specific process of determining the target protocol based on the standby protocol register information, simplifies the protocol negotiation process, and improves the efficiency of negotiating the target standby protocol between the host side and the device side.
[0071] In some alternative embodiments, the above - mentioned device initialization method further includes: Step b1: When the second standby protocol register information indicates that the device side does not support or is not enabled with the target standby protocol, use the original protocol as the target protocol.
[0072] Among them, as Figure 6As shown, when the second standby protocol register information indicates that the device side does not support or has not enabled the target standby protocol, the host side takes the PCIe protocol as the target protocol, that is, the operating protocol.
[0073] It can be understood that if the comparison result indicates that there is no same sub - protocol identifier between the sub - protocol identifier of the target standby protocol supported and enabled by the host side and the sub - protocol identifier of the target standby protocol supported and enabled by the device side, the original protocol is taken as the target protocol.
[0074] The device initialization method provided by the embodiments of this application, by directly taking the original protocol as the target protocol when the device side does not support or has not enabled the target standby protocol, avoids the interruption of the device initialization process caused by the device side not supporting or not enabling the target standby protocol, thus ensuring the continuity and stability of the device initialization process.
[0075] In some alternative embodiments, the above - mentioned device initialization method further includes: 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, take the original protocol as the target protocol.
[0076] Among them, as Figure 6 shown, when the first standby protocol register information indicates that the host side does not support or has not enabled the target standby protocol, the host side takes the PCIe protocol as the target protocol.
[0077] The device initialization method provided by the embodiments of this application, by directly taking the original protocol as the target protocol when the host side does not support or has not enabled the target standby protocol, avoids the interruption of the device initialization process caused by the host side not supporting or not enabling the target standby protocol, thus ensuring the continuity and stability of the device initialization process.
[0078] In some alternative embodiments, the above - mentioned device initialization method further includes: Step d1, after the device initialization is completed, if the target protocol is the original protocol, write the read - write commands that the device side needs to execute into the submission queue cache in the host side memory, so that the device side reads the read - write commands from the submission queue cache based on the original protocol, parses and processes the read - write commands, and after processing the read - write commands, writes the read - write command completion information into the processing completion queue in the host side memory and submits an interrupt.
[0079] Among them, Figure 7 is the flowchart of the read - write operation provided by the embodiments of this application when the target protocol is the original protocol. As Figure 7As shown, when the target protocol is the original protocol, the data transfer between the host side and the device side is completed following the PCIe Input / Output (I / O) transaction process. During this process, the device side shuts down the target standby protocol arbitration module. The main processes of this process include: The host side writes the read and write commands that the device side needs to execute into the submission queue cache in the host side memory. The device side reads the read and write commands from the submission queue cache in the host side memory based on the PCIe protocol, parses the read and write commands, and completes the operation of writing data from the Solid State Drive (SSD) to the physical area of the host memory or reading data from the physical area of the host memory by the device according to the read and write commands. After processing the read and write commands, the information indicating the completion of the read and write commands is written into the processing completion queue in the host side memory, and an interrupt is submitted to enable the host side to obtain the information indicating the completion of the read and write commands.
[0080] Among them, the host side memory is Dynamic Random Access Memory (DRAM). In this embodiment, the device side is a solid-state storage device, and the solid-state storage device is used as an example of SSD for description, but the device side is not limited to this.
[0081] For the relevant descriptions of the host side and the device side in this embodiment, reference can be made to the relevant descriptions of the device side in the device initialization system in the following embodiments, and no detailed description is given here.
[0082] Step d2, obtain the information indicating the completion of the read and write commands from the processing completion queue, and determine the status information of the read and write commands based on the information indicating the completion of the read and write commands.
[0083] Among them, in response to the interrupt submitted by the device side, the host side obtains the information indicating the completion of the read and write commands from the processing completion queue in the host side memory.
[0084] In some optional implementation manners, the above device initialization method further includes: Step e1, after the device initialization is completed, if the target protocol is the input / output sub-protocol of the target standby protocol, write the read and write commands that the device side needs to execute into the submission queue cache in the host side memory, so that the device side reads the read and write commands from the submission queue cache based on the input / output sub-protocol, parses and processes the read and write commands, and after processing the read and write commands, write the information indicating the completion of the read and write commands into the processing completion queue in the host side memory, and submit an interrupt.
[0085] Among them, the input / output sub-protocol of the target standby protocol is the CXL.io sub-protocol of the CXL protocol. Figure 8 This is a flowchart of performing read and write operations in the case where the target protocol is the input / output sub-protocol and the memory sub-protocol of the target standby protocol. AsFigure 8 As shown, when the target protocol is the CXL.io sub - protocol, an I / O - based transaction process is carried out through the CXL.io sub - protocol to complete the data transfer between the host side and the device side. During this process, the device side activates the target alternative protocol arbitration module. The main process of this process includes: The host side places the read - write commands that the device side needs to execute in the submission queue cache in the host - side memory. Then, the device side reads the read - write commands from the submission queue cache through the CXL.io sub - protocol, parses the read - write commands, and completes the operation of writing data from the SSD to the physical area of the host DRAM or reading data from the physical area of the host - side memory by the device side according to the read - write commands. After processing the read - write commands, the read - write command completion information is written into the processing completion queue in the host - side memory, and an interrupt is submitted to enable the host side to obtain the read - write command completion information.
[0086] Step e2: Obtain the read - write command completion information from the processing completion queue, and determine the status information of the read - write command based on the read - write command completion information.
[0087] In some optional implementation manners, the above device initialization method further includes: Step f1: After the device initialization is completed, if the target protocol is the memory sub - protocol of the target alternative 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 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.
[0088] Step f2: When the host side needs to write data into the memory of the device side, based on the memory sub - protocol, a data write request and the 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 the target write data, and based on the data write request, writes the target write data into the memory of the device side, and returns the execution status of the data write request to the host side through the non - data response channel.
[0089] Among them, the memory sub - protocol of the target alternative protocol is the CXL.mem sub - protocol of the CXL protocol. As Figure 8As shown, when the target protocol at the device side is the CXL.mem sub - protocol, coherent access from the host side to the device side is performed through the CXL.mem sub - protocol. During this process, the device side enables the target alternate protocol arbitration module. The main processes of this process include: The host side reads data from the device - side DRAM through the Master - to - Subordinate (M2S) data read channel based on the CXL.mem sub - protocol, and the device side completes the transmission of data and status through the Subordinate - to - Master (S2M) data response channel. The host writes data to the device - side DRAM through the M2S data write channel based on the CXL.mem sub - protocol, and the device side completes the transmission of status through the S2M non - data response channel.
[0090] In some alternative embodiments, the above - mentioned device initialization method further includes: Step g1, if the link training with the device side based on the original protocol fails, repeat the step of performing link training with the device side based on the original protocol until the link training is successful, and complete the physical layer link with the device side.
[0091] Among them, if the number of times of repeating the step of performing link training with the device side based on the original protocol exceeds a preset number threshold and the link training still fails, an alarm is issued. The preset number threshold is set by technical personnel and is not specifically limited here.
[0092] Step g2, if the data link layer negotiation with the device side based on the original protocol fails, repeat the step of performing data link layer negotiation with the device side based on the original protocol until the data link layer negotiation is successful, and complete the data link layer link with the device side.
[0093] Among them, if the number of times of repeating the step of performing data link layer negotiation with the device side based on the original protocol exceeds a preset number threshold and the data link layer negotiation still fails, an alarm is issued.
[0094] The device initialization method provided by the embodiments of the present application can significantly improve the success rate of establishing the physical layer link and the data link layer link by repeating relevant steps when the link training or the data link layer negotiation fails, and effectively cope with accidental failure situations. When the number of repetitions exceeds the preset threshold and still fails, the system will trigger an alarm to help technical personnel quickly locate the root cause of the problem, so as to take corresponding measures for repair.
[0095] An embodiment of the present application provides a device initialization method, which is applied to the device side. Figure 9 It is a flowchart of the device initialization method provided by the embodiments of the present application. As Figure 9 shown, this process includes the following steps: Step S901: Perform 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 negotiation for the target alternate protocol is performed with the host.
[0096] Step S902: Perform data link layer negotiation with the host based on the original protocol to complete the data link layer link with the host.
[0097] Step S903: Perform negotiation for the target alternate protocol with the host based on the configuration transaction layer packet, so that the host determines the negotiated target protocol, and perform register configuration on the device side based on the target protocol to perform data transmission with the device side based on the target protocol.
[0098] Among them, the process of device initialization includes: link training, data link layer negotiation, and register configuration.
[0099] For details, refer to the corresponding description of the foregoing embodiment of the device initialization method applied to the host side, which will not be elaborated here.
[0100] The device initialization method provided by the embodiment of the present application performs only PCIe protocol negotiation in the PCIe PHY for backward compatibility. Instead of performing negotiation for the target alternate protocol during the link training process, after the data link layer negotiation, the configuration transaction layer packet is used to perform negotiation for the target alternate protocol with the device side. Compared with the method of performing negotiation for the target alternate protocol with the device side by sending a modified training sequence during the link training process, the amount of data to be sent is reduced, thereby reducing the time of link training, achieving the technical effect of shortening the time required for device initialization.
[0101] This solution fully backward-compatible with the link process of the PCIe PHY. There is no need to add control logic in the link training machine to ensure that the alternate protocol negotiation mechanism is completed between Configuration.lanenum.wait and Configuration.complete. At the same time, the registers related to the alternate protocol in the PCIe capability space can be reduced, thus reducing the power consumption and area of the PHY layer control logic and reducing the complexity of the link training machine.
[0102] In some optional embodiments, the above device initialization method further includes: Step h1: During the device initialization process, turn off the target alternate protocol arbitration module, which is used to distinguish the received packets to determine the protocol information to which the packets belong.
[0103] In the related art, during the link training process, if the result of the standby protocol negotiation is successfully negotiated to the CXL protocol, subsequent register configuration of the device side needs to be carried out using the CXL.io sub - protocol. In the current implementation solution, the data packets of the CXL.io protocol stack must enter the PHY layer through the arbitration / multiplexing module. After the data packets go through the serial - to - parallel conversion in the PHY layer, they are transmitted on the link. The data received at the receiving end first enters the PHY layer, and after passing through the arbitration / multiplexing module, it enters the CXL.io protocol stack. This process will bring a delay of approximately 4 nanoseconds to the transmission of each configured TLP data packet. During the register configuration stage, it is necessary to transmit the configured TLP data packets multiple times 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.
[0104] Among them, Figure 10 is the structural schematic diagram of the arbitration / multiplexing module provided by the embodiment of the present application. As Figure 10 shown, the arbitration / multiplexing module includes a PCIe protocol path, a target standby protocol arbitration module, and a target standby protocol multiplexing module. The target standby protocol arbitration module is mainly used to implement the arbitration and routing of data packets of the three sub - protocols of CXL.io / CXL.mem / CXL.cache. The data packets of these three sub - protocols are distinguished by the protocol ID represented by the first two bytes (Byte) in the flow unit (Flow Unit, abbreviated as: Flit).
[0105] In this embodiment, during the device initialization stage, the PCIe protocol is completely used to complete. If the target standby protocol arbitration module is not turned off, the data packets of the PCIe protocol still need to be arbitrated with the data packets of the above - mentioned three sub - protocols to determine the protocol information of the data packets, which will lead to an increase in data transmission delay. In this embodiment, by turning off the target standby protocol arbitration module in the arbitration / multiplexing module during the device initialization stage, the data packets can directly pass through the PCIe protocol path to the PHY layer without arbitration, reducing the time required for device initialization.
[0106] Step h2, after the device initialization is completed, if the target protocol belongs to the target standby protocol, turn on the target standby protocol arbitration module.
[0107] As Figure 10 shown, after the device initialization is completed, that is, after obtaining the initialization completion signal, the device side sends a corresponding control signal to the arbitration / multiplexing module according to the protocol negotiation result to determine whether to turn on the target standby protocol arbitration module.
[0108] Specifically, the device side 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.
[0109] When the update result of the preset bit in the replacement protocol control register indicates that the target protocol belongs to the target alternative protocol, that is, the target protocol is at least one of the three sub-protocols, the device side sends a first control signal to the arbitration / multiplexing module to activate the target alternative protocol arbitration module.
[0110] Step h3, after the device initialization is completed, if the target protocol is the original protocol, keep the target alternative protocol arbitration module closed.
[0111] When the update result of the preset bit in the replacement protocol control register indicates that the target protocol is the original protocol, the device side sends a second control signal to the arbitration / multiplexing module to keep the target alternative protocol arbitration module closed and use the PCIe protocol path.
[0112] The device initialization method provided by the embodiments of the present application performs the register configuration process through the PCIe protocol after the link training is completed. The target alternative protocol arbitration module will be closed during the register configuration phase, which can reduce the overall latency compared with using the CXL.io protocol.
[0113] It should be noted that after the device initialization is completed, the device side will select the protocol stack according to the [15:9] bits of the replacement protocol control register. For the case where the operating protocol is the PCIe protocol, neither the data transmission method nor the packet format will be changed. For the case where the operating protocol is a non-PCIe protocol (such as the CXL protocol), the corresponding protocol stack will be selected as the control layer, and the packet format will change. Specifically, since CXL.io has the same basic functions as PCIe, there is no need to implement two sets of control layer logics for the PCIe protocol and the CXL.io sub-protocol respectively. A selector can be added to the same functional circuit, and the selection signal of the selector is determined based on the result of the [15:9] bits of the replacement protocol control register. The CXL.io sub-protocol uses 68 Byte Flit for data transmission, and the PCIe control layer uses Start Transaction Layer Packet (STP) and TLP for transmission.
[0114] For the functional logics of CXL.mem / CXL.cache already exist on the device side, and the data transmission can be achieved by enabling them based on the result of the [15:9] bits of the replacement protocol control register.
[0115] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0116] Embodiments of the present application also provide a device initialization system. Figure 11 It is the architecture diagram of the device initialization system provided by the embodiments of the present application. As Figure 11 shown, the device initialization system includes a host side and a device side. The host side is used to execute the steps in any of the above-mentioned embodiments of the device initialization method applied to the host side. The device side is used to execute the steps in any of the above-mentioned embodiments of the device initialization method applied to the device side.
[0117] For the device initialization system provided by the embodiments of the present application, the device side utilizes a spare protocol negotiation mechanism completely based on the PCIe protocol. This mechanism first completes the link training of the PHY layer by using the PCIe protocol, and then uses the PCIe control layer logic for device register configuration. During this process, the host that supports and enables the target spare protocol will query whether the device side supports and enables the target spare protocol such as the CXL protocol by initiating a configuration TLP read data packet. When both parties support and enable the target spare protocol, the target protocol is determined. The host writes the target protocol identifier into the device side spare protocol control register by initiating a configuration TLP write data packet. After the device initialization process ends, the device side control layer PCIe protocol switches to the target protocol, and data is transmitted through CXL.mem / CXL.cache, where CXL.mem is used for consistent transaction access and CXL.io is used for I / O block transactions, DMA, and interrupt operations. For the situation where either party does not support or has not enabled the target spare protocol, the host side and the device side will continue to transmit data through the PCIe control layer protocol. Since the PHY layer completely uses the PCIe link negotiation mechanism, the complexity of link training is simplified, and the link training delay is effectively reduced. In addition, the PCIe control layer logic is always adopted throughout the initialization and protocol negotiation process, and the device side will skip the target spare protocol arbitration module, which reduces the total device initialization delay compared to using CXL.io for initialization.
[0118] Embodiments of the present application also provide a device initialization system. Figure 12 It is the architecture diagram of the device initialization system provided by the embodiments of the present application. The device initialization system is compatible with the currently deployed CXL and PCIe ecosystems. As Figure 12 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.
[0119] The host side includes a host CPU, a root port, memory, etc. Among them, the host CPU contains a level 1 cache (L1 cache), a level 2 cache (L2 cache), a level 3 shared cache (L3 cache), and a spare protocol register. The root port contains a PCIe / CXL.io controller, a memory controller, a home agent, and a protocol multiplexer. Among them, the PCIe / CXL.io controller is used to implement the PCIe / CXL.io protocol, and the memory controller is used to implement the information transmission between the host and the memory. The memory is DRAM. The home agent is used to implement the Non-Volatile Memory Express (NVMe) and the CXL.mem sub-protocol. Among them, the NVMe driver is used to implement the NVMe protocol, and the CXL.mem controller is used to implement the CXL.mem sub-protocol. The protocol multiplexer is used to implement the function of the PCIe PHY.
[0120] The host side and the device side are connected through the CXL space topology structure (CXL-Fabric). Among them, the PCIe / CXL.io / CXL.mem-Stream is the link transmission channel.
[0121] The device side is described by taking a solid-state storage device as an example. Through the above-described embodiment of the device initialization method applied to the device side, the solid-state storage device can achieve full compatibility with PCIe and CXL without major changes, and thus be applied in the CXL ecosystem.
[0122] The device side also includes a spare protocol register. The spare 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.
[0123] Figure 13 The structural schematic diagram of the device side provided by the embodiment of the present application is as Figure 13As shown in the figure, taking the device side as a solid-state storage device, and the solid-state storage device as an SSD for example, the solid-state storage device includes an SSD main control chip and flash memory. Among them, the SSD main control chip includes a CXL controller, a cache controller, a flash memory controller, a 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 mainly includes a PCIe PHY layer, and the CXL control layer includes an arbitration / multiplexing module, an NVMe module, PCIe, CXL.io, CXL.mem protocol control layers, and a Network Interface Card (NIC) bus, which can implement access paths for the CXL.io, CXL.mem, and PCIe protocols.
[0124] Among them, the functions of the CXL PHY (PCIe PHY) layer include link training in the initial stage, serial-parallel conversion of data, and clock recovery functions. The CXL.mem, CXL.io, and PCIe protocol stacks multiplex the PCIe PHY layer to achieve data transmission and reception. The NVMe module is used to parse the NVMe protocol and transmit data packets to the NIC bus. The flash memory controller includes an Open NAND Flash Interface Controller (ONFI-Ctrl) for address recognition and an Open NAND Flash Interface Physical Layer (ONFI-Phy).
[0125] The PCIe protocol, whose functions are the same as those of the CXL.io protocol, is usually used for device discovery, configuration, initialization, I / O virtualization, etc. In this embodiment, the negotiation process of the alternative protocol will be carried out based on the existing initialization steps.
[0126] The CXL.io protocol is based on the traditional PCIe protocol and is usually used for functions such as device discovery, configuration, initialization, I / O virtualization, and direct memory access using non-uniform cache load storage semantics. In this embodiment, due to the use of an alternative protocol negotiation mechanism completely based on the PCIe protocol, functions such as device discovery, configuration, initialization, I / O virtualization, etc. will be completed by the PCIe protocol stack, and the CXL.io protocol is only responsible for data transmission with the host side during the read / write data stage after the host and the device successfully negotiate to the CXL protocol.
[0127] The CXL.mem sub - protocol makes device - side memory into Host - Managed Memory (HDM). According to whether the device side supports cache coherence, it can be further divided into Host - Managed Memory–Host (HDM - H), such as a memory expander, which has the characteristic of "only the host implements cache coherence", and Host - Managed Memory–Device (HDM - D), such as host - managed accelerator memory, which has the characteristic of "device - manages cache coherence". In this embodiment, since device - managed caches are not involved, it is of the HDM - H device type. Hosts manage and access this memory just like accessing local DRAM connected to the host. This protocol is independent of the medium used and uses a set of simple read and write operations involving host physical addresses. Therefore, it requires the device to internally convert the host physical address to the device's media address space. This protocol has three channels in each direction. The two directions refer to the host - to - slave and slave - to - host directions. In the M2S direction, there are a Request channel (data read channel), a Request - with - Data channel (data write channel), and a Back - Invalidate Response channel. In the S2M direction, there are a No - Data - Response (NDR) channel, a Data - Response (DRS) channel, and a Back - Invalidate Snoop channel. To achieve goals such as simplicity / low latency, there is no ordering between channels. The CXL.mem protocol eliminates the drawbacks such as the cumbersome data read - write traffic required for I / O queue transaction types.
[0128] Figure 14 This is a schematic diagram of the process of target standby protocol negotiation in the device initialization system provided by the embodiment of this application. As Figure 14 shown, taking the device side as a solid - state storage device as an example, to highlight the key points, the CXL - Fabric is not shown.
[0129] In the power - on stage of the device side, first, the host side and the device side perform link training, which is the same as the link training process of PCIe PHY and will not be elaborated here. Then, the host side and the device side perform data - link - layer negotiation. After the data - link - layer negotiation passes, the host side reads the registers related to standby protocol negotiation of the device side through the configured TLP data packet according to the result of its own standby protocol register and configures the finally used operation protocol to complete device initialization. Among them, the information of the standby protocol register, that is, the information of the registers related to standby protocol negotiation of the device side, is transmitted based on the PCIe protocol control layer.
[0130] The host side reads the registers related to the alternative protocol negotiation of the device side through the configured TLP data packet according to the result of its own alternative protocol register, and configures the finally used operation protocol, specifically including: ① When the host side supports and enables the target alternative protocol, the host side reads the registers related to the alternative protocol negotiation of the device side through the configured TLP packet.
[0131] ② The device side returns the corresponding register values to the host side.
[0132] ③ The host side compares the register values returned by the device side with the result of its own alternative protocol register, and writes the final negotiation result back to the [15:9] field of the replacement protocol control register in the alternative protocol negotiation register through the configured TLP data packet. Keep the target alternative protocol arbitration module closed during the entire device initialization process. For details, refer to the description of the corresponding embodiment above and will not be elaborated here.
[0133] The device initialization system provided by the embodiments of the present application is fully backward compatible with the link process of the PCIe PHY, and there is no need to add control logic in the link training machine to ensure that the alternative protocol negotiation mechanism is completed between Configuration.lanenum.wait and Configuration.complete, so the control logic power consumption and area of the PHY layer are reduced; secondly, after the link training is completed, the device register configuration process is carried out through the PCIe protocol, and the target alternative protocol arbitration module is closed during the register configuration stage, which can reduce the overall delay compared with 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 duration can be reduced, avoiding the long delay problem caused by multiple link trainings in some scenarios with poor link quality. The device side based on the alternative protocol negotiation mechanism of the embodiments of the present application can be fully compatible with the implementation scheme of the embodiments of the present application and can effectively reduce the duration and power consumption.
[0134] The embodiments of the present application also provide an electronic device, as Figure 15 shown, including a processor 1501 and a memory 1502. The memory 1502 stores a computer program, and the processor 1501 is configured to run the computer program to execute the steps in any of the above embodiments of the device initialization method applied to the host side or execute the steps in any of the above embodiments of the device initialization method applied to the device side.
[0135] Embodiments of the present application also provide a computer-readable storage medium storing a computer program, where the computer program is configured to execute the steps in any of the above-described embodiments of the device initialization method applied to the host side or execute the steps in any of the above-described embodiments of the device initialization method applied to the device side when running.
[0136] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memories (ROM), random access memories (RAM), external hard drives, magnetic disks, or optical discs that can store computer programs.
[0137] Embodiments of the present application also provide a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described embodiments of the device initialization method applied to the host side or executes the steps in any of the above-described embodiments of the device initialization method applied to the device side.
[0138] Embodiments of the present application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described embodiments of the device initialization method applied to the host side or executes the steps in any of the above-described embodiments of the device initialization method applied to the device side.
[0139] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0140] The above has introduced in detail a device initialization method, system, electronic device, storage medium, and program product provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope 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, and during the link training, not negotiating the target backup protocol with the device; Conduct data link layer negotiation with the device end based on the original protocol to complete the data link layer link with the device end; Negotiate the target backup protocol with the device end based on the configuration transaction layer data packet, and determine the negotiated target protocol; Performing register configuration on the device end based on the target protocol to perform data transmission with the device end based on the target protocol; The device initialization process includes: link training, data link layer negotiation and register configuration.
2. The device initialization method according to claim 1, characterized in that: The step of negotiating a target standby protocol with the device end 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; In a case where 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.
3. The device initialization method according to claim 2, 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 subprotocol identifier of the target standby protocol supported and enabled by the device side based on the second standby protocol register information; Determine, based on the first standby protocol register information, a subprotocol identifier of a target standby protocol supported and enabled by the host end; Compare the subprotocol identifier of the target standby protocol supported and enabled by the host end with the subprotocol identifier of the target standby protocol supported and enabled by the device end to obtain a comparison result; 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.
4. The device initialization method according to claim 3, characterized in that: The method further comprises: When the second standby protocol register information indicates that the device end 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 2, characterized in that: 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.
6. The device initialization method according to claim 1, characterized in that: The configuring registers of the device end 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 a 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 an attribute identifier of the target protocol, and the attribute identifier is used to characterize whether the target protocol belongs to a target backup protocol. In the case that the target protocol belongs to a target backup protocol, the configuration transaction layer write data packet also includes a target protocol identifier corresponding to the target protocol.
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 original protocol, the read and write commands that the device needs to execute 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; The read / write command completion information is obtained from the processing completion queue, and the status information of the read / write command is determined 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 the device initialization is completed, if the target protocol is the input / output sub-protocol of the target standby protocol, the read / write commands that the device needs to execute are written into the submission queue cache of the host memory, so that the device reads the read / write commands in the submission queue cache based on the input / output sub-protocol, parses and processes the read / write commands, and writes the read / write command completion information into the processing completion queue of the host memory after processing the read / write commands, and submits an interrupt; The read / write command completion information is obtained from the processing completion queue, and the status information of the read / write command is determined based on the read / write command completion information.
9. 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 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 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 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 the target write data, and based on the data write request, the target write data is written into 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.
10. 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 which 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 link with the host; Performing target standby protocol negotiation with the host end based on the configuration transaction layer data packet, so that the host end determines the negotiated target protocol, and performing register configuration on the device end based on the target protocol, so as to perform data transmission with the device end based on the target protocol; The device initialization process includes: link training, data link layer negotiation and register configuration.
11. The device initialization method according to claim 10, characterized in that: The method further comprises: During the device initialization process, the target standby protocol arbitration module is turned off, and the target standby protocol arbitration module is used to distinguish the 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 standby protocol arbitration module is kept closed.
12. A device initialization system, characterized in that: The system comprises a host end and a device end, wherein the host end is used to execute the device initialization method according to any one of claims 1 to 9; The device end is used to execute the device initialization method described in any one of claims 10 to 11.
13. 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 9 or the steps of the device initialization method according to any one of claims 10 to 11 when executing the computer program.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the device initialization method according to any one of claims 1 to 9 or implements the steps of the device initialization method according to any one of claims 10 to 11.
15. A computer program product comprising a computer program, characterized in that 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 9 or the steps of the device initialization method according to any one of claims 10 to 11.
Citation Information
Patent Citations
Controlling a physical link of a first protocol using an extended capability structure of a second protocol
CN106970886A
Flex bus protocol negotiation and enabling sequence
CN110442540A
Hard disk data access method and device, equipment and medium
CN114816254A
Multi-source heterogeneous distributed system, memory access method and storage medium
CN117806553A
CXL protocol switching chip and message processing method
CN118337889A
Cited By
Acceleration device, system and method
CN121326815A
Accelerating devices, systems, and methods
CN121326815B