Link training intervention method and storage device
By monitoring and modifying the preset coefficient of the PCIe link, the problem of poor signal quality of the PCIe link is solved, the signal quality is improved, and the stability and accuracy of signal transmission are ensured.
Patent Information
- Application Number
- CN202411266101.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-31
AI Technical Summary
In PCIe high-speed interface, signal attenuation and phase distortion problems lead to data errors. The existing equalization technology relies on the transmission terminal algorithm and the receiving circuit to be unable to select the optimal preset coefficient when the performance of the poor, resulting in signal quality problems.
By monitoring the link training status, modifying and cacheing the preset coefficients of the PCIe link, ensuring that the uplink device uses the optimized preset coefficients in subsequent communications, enhancing signal quality.
The signal quality of the PCIe link is improved, and the preset coefficient selection problems caused by poor signal reception capabilities and signal detection algorithms of downlink devices are solved.
Smart Images

Figure CN119226197A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular, to a link training intervention method and a storage device. Background Art
[0002] PCIe (peripheral component interconnect express) is commonly used to communicate between multiple devices (such as hosts and storage devices). However, on high-speed interfaces such as PCIe, as the transmission speed increases, the longer the signal is transmitted on the physical medium (such as copper wire), the more serious problems such as signal attenuation, phase distortion and interference become, which may cause data errors. To overcome these problems, PCIe introduces equalization technology, which aims to compensate for these losses and distortions by adjusting the frequency characteristics of the signal at the transmitting end, ensuring that the signal can still be accurately decoded when it reaches the receiving end.
[0003] The PCIe specification defines 11 sets of preset coefficients, referred to as Preset 0-10. An existing signal conditioning solution based on equalization technology is to obtain the optimal signal frequency characteristics by selecting appropriate preset coefficients. Specifically, during the link training process, the transmitter actively sets different preset coefficient numbers (Preset index) and sends a signal to the receiver. The receiver feeds back a signal with the same frequency characteristics. After repeated multiple times, the transmitter selects the optimal preset coefficient. This method relies on the transmitter selection algorithm and the normal function of the transmitter's receiving circuit. For transmitters with poor algorithm and receiving circuit performance, the optimal preset coefficient cannot be selected, and the signal quality of the link cannot be improved, which is prone to various signal quality problems. Summary of the invention
[0004] In view of this, an embodiment of the present disclosure provides a link training intervention method and a storage device to solve the above problems.
[0005] According to an embodiment of the present disclosure, a link training intervention method is provided. The link training intervention method is applied to an uplink device in an uplink device and a downlink device that communicate through a PCIe link. The PCIe link is established and initialized through link training. The link training intervention method includes the following steps:
[0006] Monitoring the current status of the link training;
[0007] When the link training is in the first state, obtaining each preset coefficient number used by each channel of the PCIe link from the received message, and modifying one or more preset coefficients corresponding to the first preset coefficient number and the cached modification, the uplink device uses the modified preset coefficient to send a feedback message under the corresponding channel, and the first preset coefficient number is taken from the multiple preset coefficient numbers used by the multiple channels of the PCIe link;
[0008] When the link training is in the second state, the preset coefficient numbers used by the channels of the PCIe link are obtained from the received message, and the preset coefficient numbers are compared to see whether they are equal to the first preset coefficient number. If so, the cached modifications of the first preset coefficient number are persistently stored so that the uplink device can subsequently use the persistently stored preset coefficient to send a message to the uplink device.
[0009] In some embodiments, when the upstream device and the downstream device first establish a PCIe link, a modification of one or more preset coefficients corresponding to the first preset coefficient number is determined, and the upstream device and the downstream device subsequently use the PCIe link to communicate using the modification.
[0010] In some embodiments, the current state of the link training is obtained by monitoring the state change of the link training state machine.
[0011] In some embodiments, the first state is a fourth equalization stage of a recovery state of the link training, and the second state is an L0 state of the link training.
[0012] In some embodiments, the one or more preset coefficients corresponding to the first preset coefficient number are de-emphasis coefficients and / or pre-emphasis coefficients.
[0013] In some embodiments, it also includes: checking whether the modification made to one or more preset coefficients corresponding to the first preset coefficient number complies with the value range of the corresponding preset coefficient in the PCIe specification.
[0014] In some embodiments, the upstream device is a storage device, and the downstream device is a host.
[0015] In some embodiments, the link training intervention method is implemented as firmware of a storage device.
[0016] According to an embodiment of the present disclosure, a storage device is provided, including: a coupled controller and a storage medium, wherein the controller executes the above-mentioned link training intervention method.
[0017] According to an embodiment of the present disclosure, a solid state drive is provided, comprising: a coupled controller and a storage medium, wherein the storage medium is a flash memory, and the controller executes the above-mentioned link training intervention method.
[0018] According to the embodiments of the present disclosure, the uplink device adjusts some or all of the preset coefficients to enhance the quality of the signal sent to the uplink device, so as to solve the problem that the downlink device cannot select the correct preset coefficient due to the poor signal quality of the PCIe link, the weak signal receiving capability of the downlink device, and / or the poor signal detection algorithm of the downlink device. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other objects, features and advantages of the present disclosure will become more apparent through the description of the embodiments of the present disclosure with reference to the following drawings, in which:
[0020] Figure 1 This is a schematic diagram of end-to-end connection through PCIe;
[0021] Figure 2 is a schematic diagram of the link training state machine;
[0022] Figure 3 It is a flow chart of interaction between an uplink device and a downlink device in the EQ3 stage in the prior art;
[0023] Figure 4A and Figure 4B is a flow chart of a link training intervention method provided by an embodiment of the present disclosure;
[0024] Figure 5 Provides multiple sets of preset coefficients defined by the PCIe specification;
[0025] Figure 6 is a flow chart of interaction between an uplink device and a downlink device in the EQ3 stage in an embodiment of the present disclosure;
[0026] Figure 7 It is a flowchart of a link training intervention method provided by another embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The present disclosure will be described in more detail below with reference to the accompanying drawings. In each of the accompanying drawings, the same elements are represented by similar reference numerals. For the sake of clarity, the various parts in the accompanying drawings are not drawn to scale. In addition, some well-known parts may not be shown.
[0028] Figure 1This is a schematic diagram of achieving end-to-end connection through PCIe. As shown in the figure, the downstream device 100 and the upstream device 200 communicate through the PCIe link, wherein the downstream device 100 sends messages via the following path: the data message is first generated in the core layer of the downstream device 100, and then sent out through the transaction layer, data link layer and physical layer, and the upstream device 200 receives the message via the following path: the data message reaches the core layer from the physical layer, data link layer and transaction layer in the upstream device 200200. However, before being able to send and receive messages through the PCIe link, the PCIe link needs to be trained. The training of the PCIe link is automatically completed by the Link Training and Status State Machine (LTSSM) in the devices at both ends of the PCIe link, and starting with PCIe 2.0, the adjustment of the link signal quality, rate, and link width (i.e., balancing) is added during the link training (Link Training) of the physical layer. Figure 2 It is a state diagram of the link training state machine.
[0029] like Figure 2 As shown, the link training state machine has a total of 11 states, among which the normal PCIe link training state conversion process is, detection->polling->configuration->L0. Detection is that the downstream device detects whether the upstream device exists. If it exists, it enters the polling state. In the polling state, the upstream device and the downstream device determine the bit lock, character lock and solve the problem of channel polarity reversal by sending messages to each other. The configuration state is mainly that the downstream device and the upstream device determine the channel used by the PCIe link by sending messages to each other. L0, L0s, L1, and L2 are four levels of energy consumption states, among which L0 is a normal working state, L0s is a first-level low-power state, L1 is a second-level low-power state, and L2 is a third-level low-power state. The three states of L0s, L1, and L2 are not closely related to disabling, hot reset, and loopback testing and the technical solution of this application, and are not described in detail here. The recovery state is an optional state used to retrain the PCIe link. There are many reasons for entering this state, including errors in the PCIe link, the need to adjust the bit lock and symbol lock, change the PCIe link rate, adjust the PCIe link width, equalization (Equalization Procedure) in PCIe Gen3 and PCIe Gen4, and software triggering. The equalization process in PCIe Gen3 and PCIe Gen4 is divided into 4 stages: Stage 1 to Stage 4 (EQ0 to EQ3). Stages 3 and 4 are optional. If these two stages are skipped, the initialization of the PCIe link will be accelerated, but at the expense of data accuracy. In the fourth stage, the interaction process shown in 3 is generated. Figure 3In the figure, EC=11 indicates the fourth stage of the equalization process, and Preset Index (preset coefficient number)=A / B / C indicates that the preset coefficient numbers used by the PCIe link are A / B / C respectively. The process is described as follows:
[0030] 1: The uplink device 200 initiates an EQ3 stage request, requiring the downlink device to determine the preset coefficient number to be used.
[0031] 2: The downstream device 100 starts to enter EQ3 and sends a request message of Preset index = A; 3: The upstream device 200 sends a feedback message to the downstream device 100 according to the request of preset coefficient number = A;
[0032] 4: Downstream device 100 sends a request message with Preset index = B;
[0033] 5: The uplink device 200 sends a feedback message to the downlink device 100 according to the request of Preset index=B;
[0034] 6: Downstream device 100 sends a request for Preset index = C;
[0035] 7: The uplink device 200 sends a feedback message to the downlink device 100 according to the request of Preset index=C;
[0036] …
[0037] 8: The downlink device 100 selects a preset coefficient of Preset index = B according to the feedback signal quality, and sends a request message of Preset index = B;
[0038] 9: The uplink device 200 sends a feedback message to the downlink device 100 according to the request of Preset index=B, and the EQ3 stage is now completed.
[0039] exist Figure 3 In the EQ3 stage, the uplink device 200 and the downlink device 100 determine that the preset coefficient corresponding to Preset index=B is used in subsequent normal operation. Figure 5 Given multiple sets of preset coefficients defined by the PCIe specification, where the preset coefficients are numbered P0 to P10, then Figure 2 The values of A, B and C in are from P0 to P10. Figure 5 It can be seen that each preset coefficient number corresponds to a set of preset coefficients, that is, when the uplink device 200 and the downlink device 100 work normally, a set of preset coefficients corresponding to the preset coefficient number (each preset coefficient uses a default value) is used to send and receive messages.
[0040] Figure 3 The process can be performed on multiple channels (PCIe links usually use multiple channels), and the downstream device 100 sends request messages with various preset coefficient numbers on each channel to determine which preset coefficient number on each channel has better signal quality. However, as described in the background technology, this method relies on the downstream device 100 selecting an algorithm and the receiving circuit of the downstream device 100 functioning properly. Downstream devices 100 with poor algorithm and receiving circuit performance cannot select the optimal preset coefficient, and thus cannot improve the signal quality of the link, and are prone to various signal quality problems. In order to solve this problem, the embodiments of the present disclosure provide a method such as Figure 4A and Figure 4B The link training intervention method shown is executed in the uplink device 200 and includes the following steps.
[0041] In step S401 , link training is continuously monitored.
[0042] In step S402, it is determined whether the link training is in the first state, if yes, step S403 is executed, if no, step S401 is executed.
[0043] In step S403, each preset coefficient number used by each channel of the PCIe link is obtained from the received message.
[0044] In step S404, one or more preset coefficients corresponding to the first preset coefficient number are modified and the modifications are cached.
[0045] In step S405, modifications made to one or more preset coefficients corresponding to the first preset coefficient number are cached.
[0046] In step S406, it is determined whether the link training is in the second state. If yes, step S407 is executed; if no, step S403 is executed.
[0047] In step S407, each preset coefficient number used by each channel of the PCIe link is obtained from the received message.
[0048] In step S408, it is determined whether the numbers of the preset coefficients are equal to the first preset coefficient number. If so, step S409 is executed.
[0049] In step S409, the cached modification of the first preset coefficient number is persistently stored.
[0050] According to this embodiment, the current state of the link training may be monitored by monitoring the link training state machine. Figure 2 Given an exemplary link training state machine state change, the first state corresponds to Figure 2The fourth equilibrium stage (EQ3) in the recovery state in the second state corresponds to Figure 2 In some embodiments, the state change information of the link training state machine is obtained from an internal register, and a time interval is set to obtain the state change information of the link training state machine.
[0051] According to this embodiment, multiple preset coefficient numbers used by each channel of the PCIe link are obtained from the received message, and then one or more preset coefficients corresponding to the first preset coefficient number among the multiple preset coefficient numbers are modified. Figure 5 As shown, the first preset coefficient number is, for example, P0, and the modification of one or more preset coefficients corresponding to the first preset coefficient number is, for example: modifying the de-emphasis coefficient (De-emphasis) corresponding to P0 to (-6.0±1.0dB), which is within the allowable range. After the modification is completed, the modification made to the one or more preset coefficients corresponding to the first preset coefficient number is cached, and the data cached in the cache unit of, for example, a solid-state hard disk will be lost due to the link entering a low power consumption state.
[0052] According to this embodiment, the upstream device sends feedback messages on each channel of the PCIe link. Since one or more preset coefficients corresponding to the first preset coefficient number are modified, although the feedback message is still sent based on the first preset coefficient number, the modified preset coefficient is actually used to send the feedback message. After receiving the feedback messages from each channel, the downstream device will determine the preset coefficient number to be used by each channel for subsequent normal operation and send messages accordingly during subsequent normal operation. If the upstream device finds in the message received after normal operation that a certain channel uses the first preset coefficient number, the modification previously made to the one or more preset coefficients corresponding to the first preset coefficient number will be changed from cache to persistent storage. The data persistently stored in the flash memory storage medium such as a solid-state drive will not be lost due to the link entering a low-power state. Figure 6 For example, the uplink device 200 adds N to De-emphasis in Preset index = B and then gives a feedback message, and the downlink device 100 finally determines to send a normal message with Preset index = B (De-emphasis + N), then the uplink device 200 permanently stores Preset index = B (De-emphasis + N).
[0053] In summary, based on the embodiments of the present disclosure, the uplink device adjusts part or all of the preset coefficients to gain the signal sent to the downlink device, with the aim of solving the problem that the downlink device cannot select the correct preset coefficient due to poor signal quality of the PCIe link, weak signal receiving capability of the downlink device and / or poor signal detection algorithm of the downlink device.
[0054] In some embodiments, a computer program in an uplink device is used to implement Figure 4A and Figure 4B The process, that is, the computer program implements the modification of one or more preset coefficients corresponding to the first preset coefficient number, and then the sending circuit of the hardware in the downlink device sends and receives the message. Since most of the modifications are in the computer program, no or very little hardware modification is involved, which is conducive to reducing the overall implementation cost of the solution. Further, the computer program is implemented as firmware, for example, as firmware in a storage device. In addition, if the uplink device has multiple processor cores, a processor core with a lighter load can also be used for monitoring, or when the link training state machine enters a certain point in time of a certain state (for example, the first stage of the equalization process in the detection or recovery state), a processor core starts to monitor the state of the link training state machine to reduce resource consumption.
[0055] In some embodiments, the downlink device randomly selects one or more preset coefficient numbers corresponding to the de-emphasis coefficient and / or pre-emphasis coefficient for modification, and sends a feedback message accordingly. In other embodiments, when the uplink device and the downlink device first establish a PCIe link, it is determined that one or more preset coefficient numbers of the de-emphasis coefficient and / or pre-emphasis coefficient are to be modified and the modification is permanently stored. When the uplink device and the downlink device subsequently work using the PCIe link, the modified preset coefficients obtained for the first time are used.
[0056] In some embodiments, the downstream device further checks whether the modification made to one or more preset coefficients corresponding to the first preset coefficient number complies with the value range of the corresponding preset coefficient in the PCIe specification.
[0057] Figure 7 It is a flowchart of a link training intervention method provided by another embodiment of the present disclosure, which includes the following steps.
[0058] In step S701, it is monitored whether the link training state machine is started, and if so, step S702 is executed.
[0059] In step S702, it is determined whether the link training state machine satisfies the fourth stage of (Gen3||Gen4)&&balance. If yes, step S703 is executed; if not, step S711 is executed.
[0060] In step S703, the preset coefficients of each channel are obtained.
[0061] In step S704, it is determined whether all channels have been processed. If not, step S705 is executed. If yes, step S711 is executed.
[0062] In step S705, it is determined whether the preset coefficient of the current channel is the same as the previously recorded one, if yes, step S711 is executed, if not, step S706 is executed.
[0063] In step S706, the record of the preset coefficients of the current channel is updated.
[0064] In step S707, the preset coefficient number of the current channel is updated.
[0065] In step S708, it is determined whether the preset coefficient number of the current channel is the first preset coefficient number, if yes, step S709 is executed, if not, step S710 is executed.
[0066] In step S710, the previous current channel record is cleared.
[0067] In step S711, the link training state machine determines whether it satisfies (Gen3||Gen4)&& the first stage of equalization. If yes, step S701 is executed; if not, step S712 is executed.
[0068] In step S712, determine whether the link training state machine satisfies (Gen3||Gen4)&&L0. If yes, execute step S712; if not, the process ends.
[0069] In step S713, it is determined whether all channels have been processed. If yes, the process ends; if not, step S714 is executed.
[0070] In step S714, the preset coefficient number of each channel is obtained.
[0071] In step S715, determine whether it is the first preset coefficient number, if yes, execute step S716, if not, execute step S713.
[0072] In step S716, the deduplicated coefficients of the first preset coefficient number are permanently stored.
[0073] and 4A and Figure 4BCompared with the embodiment shown in , this embodiment adds more details, such as judging whether the link training state machine satisfies (Gen3||Gen4). This is because PCIe2.0 and later versions stipulate that the equalization process in the recovery state satisfies Gen3 or Gen4. Also, since the link training intervention needs to be performed in the appropriate state of link training, this embodiment includes many judgment operations to continuously check the state changes of link training. However, it should be understood that the actual design of the link training state machine in different products is different, and this design is related to the PCIe version used. Therefore, the first state and the second state in the above embodiment should be adjusted based on the actual design of the product, but in general, the first state can be defined as: in this state, the upstream device and the downstream device determine the preset coefficients during normal operation by sending messages with different preset coefficient numbers, and the second state can be defined as: in this state, the upstream device and the downstream device work normally.
[0074] Although the embodiments of the present disclosure are disclosed as the preferred embodiments as above, they are not intended to limit the claims. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present disclosure. Therefore, the scope of protection of the present disclosure shall be based on the scope defined by the claims of the present disclosure.
[0075] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A link training intervention method, the link training intervention method is applied to an uplink device in an uplink device and a downlink device communicating through a PCIe link, the PCIe link is established and initialized through link training, and the link training intervention method comprises the following steps: Monitoring the current status of the link training; When the link training is in the first state, obtaining each preset coefficient number used by each channel of the PCIe link from the received message, and modifying one or more preset coefficients corresponding to the first preset coefficient number and the cached modification, the uplink device uses the modified preset coefficient to send a feedback message under the corresponding channel, and the first preset coefficient number is taken from the multiple preset coefficient numbers used by the multiple channels of the PCIe link; When the link training is in the second state, the preset coefficient numbers used by the channels of the PCIe link are obtained from the received message, and the preset coefficient numbers are compared to see whether they are equal to the first preset coefficient number. If so, the cached modifications of the first preset coefficient number are persistently stored so that the uplink device can subsequently use the persistently stored preset coefficient to send a message to the uplink device.
2. The link training intervention method according to claim 1, wherein: When the upstream device and the downstream device establish a PCIe link for the first time, a modification of one or more preset coefficients corresponding to the first preset coefficient number is determined, and the upstream device and the downstream device subsequently communicate using the PCIe link using the modification.
3. The link training intervention method according to claim 1, wherein: The current state of the link training is obtained by monitoring the state change of the link training state machine.
4. The link training intervention method according to claim 1, wherein: The first state is a fourth equalization stage of a recovery state of the link training, and the second state is an L0 state of the link training.
5. The link training intervention method according to claim 1, wherein: The one or more preset coefficients corresponding to the first preset coefficient number are de-emphasis coefficients and / or pre-emphasis coefficients.
6. The link training intervention method according to claim 1, further comprising: Check whether the modification made to one or more preset coefficients corresponding to the first preset coefficient number complies with the value range of the corresponding preset coefficient in the PCIe specification.
7. The link training intervention method according to any one of claims 1 to 6, wherein: The upstream device is a storage device, and the downstream device is a host. 8 . The link training intervention method according to claim 7 , wherein the link training intervention method is implemented as firmware of a storage device.
9. A storage device comprising: A coupled controller and storage medium, wherein the controller executes the link training intervention method as described in any one of claims 1 to 8.
10. A solid state hard disk comprising: A coupled controller and storage medium, wherein the storage medium is a flash memory, and the controller executes the link training intervention method as described in any one of claims 1 to 8.
Citation Information
Cited By
PCIe link training method, PCIe link training system and PCIe link communication system
CN120358141A
