Overflow processing method under credit management, processing device and related equipment
By monitoring the PCIe device memory space and sending overflow feedback, the problem of PCIe device storage space waste is solved, efficient read and write packet management is achieved, and storage space requirements, device area and power consumption are reduced.
Patent Information
- Application Number
- CN202211623166.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-12-16
AI Technical Summary
In the existing PCIe protocol, PCIe devices need to reserve a large amount of storage space to receive response packets, resulting in storage space requirements far exceeding the actual capabilities of the device, causing storage space waste.
By monitoring the remaining space of the root device memory, overflow monitoring feedback is sent. When no feedback is received, a read/write packet is written. When feedback is received, the read/write packet is discarded and an error signal is sent. The link object resends the read/write packet, and the memory does not receive other packets during the retransmission period.
The reserved space for receiving read and write packets is reduced to avoid memory overflow and ensure that data is not lost. The retransmission delay is used to gain memory reading time, reducing memory size and power consumption.
Smart Images

Figure CN116226014B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to a high-speed serial computer expansion bus, and more particularly to an overflow processing method, processing device, and related equipment under credit management. Background Art
[0002] PCI-Express (Peripheral Component Interconnect express, PCIe) is a high-speed serial computer expansion bus standard. Its primary advantage is its high data transfer rate while still meeting the needs of lower-speed devices, making it a promising candidate for future development. PCIe devices can send memory, input / output, or configuration read and write packets, called TLPs (Transaction Layer Packets), to each other.
[0003] The credit interaction process specified by the PCIe protocol is divided into two types: limited and unlimited. According to the PCIe protocol, for PCIe devices, the PCIe response packet flow control must be set to unlimited flow control mode, that is, no flow control management is performed on the response packet sent by the link object. Because the PCIe protocol specifies a label for each read and write packet, for example, if one end of the PCIe device sends a read request with a label of 1, the label of the end that receives the request in replying to the read request must also be 1, so that the RC can understand which read and write packet this response is for. One existing technology is to reserve a large enough space for the response packet to store the response packets that may be received; if the number of labels supported by PCIe is N, the reserved space must ensure that N response packets can be received.
[0004] However, the existing PCIe protocol supports only 768 tags, and the maximum payload length is 1024 bytes (DW = 4096 bytes). Existing solutions require reserving 768 * 4096 = 3145728 bytes of storage space for incoming response packets. This represents an extremely large amount of storage space, far less than the total storage space of all PCIe devices combined. Therefore, in situations like this, reducing the reserved space for receiving read and write packets has become a pressing technical challenge for those skilled in the art. Summary of the Invention
[0005] In view of this, the present application provides an overflow processing method under credit management to reduce the reserved space for receiving read and write packets.
[0006] The overflow processing method under credit management in the embodiment of the present application includes:
[0007] Monitor whether the remaining space of the memory corresponding to the root device has reached or is about to reach a preset monitoring value. If so, send overflow monitoring feedback;
[0008] If the overflow monitoring feedback is not received and the current link object read / write packet passes the detection, writing the current link object read / write packet into the memory;
[0009] Upon receiving the overflow monitoring feedback, the current link object read / write packet fails to pass the detection, the current link object read / write packet is discarded, and an error signal and a sequence number of the current link object read / write packet are sent to the current link object;
[0010] After receiving the error signal, the link object retransmits the read / write packet. The memory performs reading during the retransmission. During the retransmission period, the root device does not receive other read / write packets.
[0011] Optionally, if the overflow monitoring feedback is not received and the current link object read / write packet passes detection, the current link object read / write packet is written into the memory, including detecting a sequence code and a cyclic redundancy check code of the current link object read / write packet.
[0012] Optionally, if the overflow monitoring feedback is not received and the current link object read-write packet passes the detection, the current link object read-write packet is written to the memory, and if the overflow monitoring feedback is not received and the current link object read-write packet fails the detection, the current link object read-write packet is discarded and an error signal and the serial number of the current link object read-write packet are sent to the current link object.
[0013] Optionally, if the overflow monitoring feedback is not received and the current link object read / write packet fails the detection, the current link object read / write packet is discarded and an error signal and the serial number of the current link object read / write packet are sent to the current link object, and the error is also recorded.
[0014] Optionally, when the overflow monitoring feedback is received, the current link object read / write packet fails to pass the detection, the current link object read / write packet is discarded, and an error signal and the serial number of the current link object read / write packet are sent to the current link object, including no error recording.
[0015] Optionally, the monitoring root device monitors whether the remaining space of the memory corresponding to the root device has reached or is about to reach a preset monitoring value. If so, an overflow monitoring feedback is sent, including the corresponding write enable or read enable triggering the monitoring to calculate the remaining space of the memory when writing or reading the memory.
[0016] Optionally, when the overflow monitoring feedback is received, the current link object read-write packet fails to pass the detection, the current link object read-write packet is discarded, and an error signal and the serial number of the current link object read-write packet are sent to the current link object, including, when the overflow monitoring feedback is received, changing the current link object read-write packet so that the current link object read-write packet fails to pass the detection.
[0017] Optionally, the monitoring of whether the remaining space of the memory corresponding to the root device has reached or is about to reach a preset monitoring value, and if so, sending overflow monitoring feedback, further includes:
[0018] monitoring whether the remaining space of the memory has reached a full value, and sending overflow monitoring feedback if the full value has been reached, wherein the full value is 0;
[0019] Monitor whether the remaining space of the memory reaches a near-full value, and send near-overflow monitoring feedback if it reaches the near-full value, wherein the near-full value is a preset value greater than the full value.
[0020] Optionally, after receiving the error signal, the link object resends the read-write packet, and the memory is read during retransmission. During the retransmission, the root device does not receive other read-write packets, including when the link object repeatedly sends the same read-write packet or multiple read-write packets more than 4 times, the link object will be reconfigured, and the root device will clear the memory.
[0021] Optionally, the current link object read-write packet is received and a read-write packet detection is performed. If passed, the current link object read-write packet is written into the memory, including sending a confirmation signal and a serial number of the current link object read-write packet to the current link object, and the current link object clears the current link object read-write packet.
[0022] Optionally, the present application further provides an overflow processing device under credit management, comprising:
[0023] A monitoring module is used to monitor whether the remaining space of the memory corresponding to the root device has reached or is about to reach a preset monitoring value, and if so, to send overflow monitoring feedback;
[0024] a detection module, configured to, when the overflow monitoring feedback is not received and the current link object read / write packet passes detection, write the current link object read / write packet into the memory; and, when the overflow monitoring feedback is received and the current link object read / write packet fails detection, discard the current link object read / write packet and send an error signal and a sequence number of the current link object read / write packet to the current link object;
[0025] a link object, at least one link object, wherein the link object resends the read / write packet after receiving the error signal;
[0026] A memory for storing the read / write packet of the current link object when the read / write packet passes the detection; and for reading the read / write packet of the current link object when the read / write packet of the current link object is resent;
[0027] The root device does not receive other read / write packets during the retransmission of the read / write packet of the current link object.
[0028] Optionally, the detection module further includes:
[0029] a recording module configured to, if the detection module does not receive the overflow monitoring feedback and the current link object read / write packet fails detection, discard the current link object read / write packet and send an error signal and a sequence number of the current link object read / write packet to the current link object, and then record the error;
[0030] A modification module is used for the detection module to receive the overflow monitoring feedback, and then the current link object read-write packet fails to pass the detection, discard the current link object read-write packet and send an error signal and the serial number of the current link object read-write packet to the current link object; when the overflow monitoring feedback is received, change the current link object read-write packet so that the current link object read-write packet fails to pass the detection.
[0031] Optionally, the present application also provides a chip, which is configured as an overflow processing device under the above-mentioned credit management.
[0032] Optionally, the present application also provides an electronic device comprising the chip described above.
[0033] Compared with the prior art, the technical solution of the embodiment of the present application has the following advantages:
[0034] In the overflow processing method and processing device under credit management provided by the embodiment of the present application, it is monitored whether the remaining space of the memory corresponding to the root device has reached or is about to reach a preset monitoring value. If so, an overflow monitoring feedback is sent; if the overflow monitoring feedback is not received and the current link object read / write packet passes the detection, the current link object read / write packet is written to the memory; if the overflow monitoring feedback is received, the current link object read / write packet fails to pass the detection, the current link object read / write packet is discarded and an error signal and the sequence number of the current link object read / write packet are sent to the current link object; after the link object receives the error signal, the read / write packet is resent; when resending, the memory is read, and the root device does not receive other read / write packets during the retransmission. In this way, by adding overflow monitoring feedback, the retransmission mechanism of the read / write packet detection can be used to ensure that the memory does not overflow, thereby ensuring that data is not lost, and gaining time to read the memory through the delay of retransmission, and then the memory size for receiving the response packet is designed by calculating the delay, thereby reducing the reserved space for receiving the read / write packet. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0036] Figure 1 It is a schematic diagram of the existing PCIe device structure;
[0037] Figure 2 It is a flow chart of the read and write packet transmission under credit management in an existing PCIe device;
[0038] Figure 3 It is a partial structural diagram of an existing PCIe device;
[0039] Figure 4 This is a flow chart of the overflow processing method under credit management provided by an embodiment of the present application;
[0040] Figure 5 This is a complete flow chart of the overflow processing method under credit management provided by the embodiment of the present application;
[0041] Figure 6 This is a schematic diagram of an example of a workflow of an overflow processing device under credit management provided in an embodiment of the present application;
[0042] Figure 7 It is a structural diagram of the overflow processing device under credit management provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0044] PCI-Express (Peripheral Component Interconnect Express, PCIe) is a high-speed serial computer expansion bus standard. Its primary advantage is its high data transfer rate while still meeting the needs of lower-speed devices, making it a promising candidate for future development. PCIe devices can exchange memory, input / output, and configuration read and write packets, called TLPs (Transaction Layer Packets). TLPs are typically transmitted using credit management, where data link layer packets are used to exchange credits between devices. Read and write packets are transmitted within the credit limit.
[0045] There are three types of PCIe devices: root devices, switch devices, and endpoint devices.
[0046] like Figure 1 As shown, root device 13 is the PCIe device closest to CPU 11. It connects to memory 14 and can be connected to PCIe endpoint devices 12 and PCIe switch devices 15. PCIe switch devices 15 can be connected to other switch devices 15. Each endpoint device 12 or switch device 15 is collectively referred to as a link object. According to the PCIe protocol, each root device in a PCIe tree structure can connect to 256 PCIe devices.
[0047] PCIe read and write packets are divided into two categories: request packets and response packets. Request packets are read and write packets sent by one device to another device, and response packets are read and write packets sent by one device in response to a received request packet. PCIe credits are not transmitted in a tree structure. Credits are only exchanged between two devices. The management mechanism is as follows: Figure 2 As shown:
[0048] Step S21: Device B sends a credit initialization message to device A, telling device A that the currently available credit information is 2;
[0049] Step S22: After receiving the credit initialization information from device B, device A updates the credit limit to 2. However, device A has not yet sent any read / write packets, so the consumption value is 0. Device A determines that credit limit - consumption = 2 > 0 and considers that it can send read / write packets.
[0050] Step S23: Device A sends two read-write packets to device B. At this time, the consumption value of device A is updated to 2. Device A determines again that limit - consumption = 2 - 2 = 0, and considers that the read-write packet cannot be sent;
[0051] Step S24: After receiving the read / write packet from device A, device B stores it in its own storage. When the read / write packet is read from the storage, it indicates that device B's storage has new space available to receive the read / write packet.
[0052] Step S25: Device B sends updated credit information to device A, with the value being the original value (2) + the read pointer accumulated value (1) = 3. The read pointer accumulated value indicates the number of read and write packets that can release credits during this period.
[0053] Step S26: Device A updates the limit value = received updated credit information = 3, limit - consumption
[0054] =3-2=1, you can continue to send read and write packets.
[0055] It should be noted that the transmission process is simplified in the figure. Each read and write packet will update, compare and detect the packet header and payload.
[0056] The credit interaction process specified by the PCIe protocol is divided into two types: limited and unlimited. The limited one refers to the example process above, while the unlimited one does not require flow control and can receive read and write packets from the other party without restriction.
[0057] According to the PCIe protocol, for the RC root device, the PCIe response packet flow control must be set to unlimited flow control mode, that is, no flow control management is performed on the response packets sent by the link object;
[0058] Because the PCIe protocol specifies a tag for each read / write packet, for example, when the RC sends a read request with a tag of 1, the tag of the read response packet sent by the device must also be 1, so that the RC knows which read / write packet this response is for.
[0059] One existing technology is to reserve a large enough space for the corresponding packet to store the response packets that may be received; if the number of tags supported by PCIe is N, the reserved space must ensure that N response packets can be received.
[0060] Based on the above description, the inventors of this application discovered that, taking PCIe 5.0 as an example, the PCIe protocol supports 768 tags, and the maximum payload length of a packet can be 1024 bytes (DW = 4096 bytes). Existing solutions require reserving 768 * 4096 = 3145728 bytes of storage space for incoming response packets. This is an extremely large amount of storage space, and the combined storage space of all PCIe endpoint devices is far less than this.
[0061] Based on this, the embodiment of the present application considers adding a monitoring module to the memory and introducing a monitoring feedback mechanism. In the prior art, there is a detection step for the read-write packet, and if the detection fails, the read-write packet will be retransmitted. Figure 3 As shown, retransmission generally requires a read / write packet to be retrieved from the memory of the current PCIe root device and sent to the memory of the peer device. This packet must pass through the root device's transmit circuitry, the PCS (Physical Layer Coding Sublayer) and PHY (Port Physical Layer), then through the baseboard, the slot, and the peer's PHY / PCS receive path before reaching the memory. The link partner then returns a credit. This process takes a certain amount of time. If read / write packets are read within this time, there is no need to store all the packets that need to be received. Therefore, the memory only needs to store a total of read / write packets greater than the amount of data that can be read within this time, thus ensuring the highest data read efficiency. For example, if the aforementioned time is X, a memory size greater than X * data bit width is sufficient to meet the basic path requirements. For PCIe Gen5, for example, X is generally less than 200, and the data bit width is 512. Therefore, a memory space greater than 200 * 512 = 12800 bytes is sufficient, which is significantly less than 3145728 bytes. Therefore, this solution can effectively reduce the reserved space for receiving read and write packets.
[0062] The specific steps of the overflow processing method under credit management are as follows: Figure 4 Shown, including:
[0063] Step S41: monitoring whether the remaining space of the memory corresponding to the root device has reached or is about to reach a preset monitoring value. If so, proceed to step S44 to send overflow monitoring feedback;
[0064] It is easy to understand that at this time, if the read and write packets continue to be received, the remaining space in the memory may not be enough to write the read and write packets, resulting in an overflow. Sending overflow monitoring feedback and performing subsequent steps can ensure that the memory does not overflow.
[0065] Furthermore, in an optional implementation, the monitoring of whether the remaining space of the memory corresponding to the root device has reached or is about to reach a preset monitoring value, and if so, sending overflow monitoring feedback, further includes:
[0066] monitoring whether the remaining space of the memory has reached a full value, and sending overflow monitoring feedback if the full value has been reached, wherein the full value is 0;
[0067] Monitor whether the remaining space of the memory reaches a near-full value, and send near-overflow monitoring feedback if it reaches the near-full value, wherein the near-full value is a preset value greater than the full value.
[0068] It should be noted that the near overflow feedback is transmitted at a slow speed and there is a delay; the full overflow monitoring feedback is transmitted at a fast speed and there is no delay.
[0069] Therefore, when the space in the memory reaches the near-full value, a near-overflow monitoring feedback is issued, and the memory can continue to write the read-write packets sent during the transmission delay of the near-overflow monitoring feedback; when the space in the memory reaches the full value, a full overflow monitoring feedback is sent. The full overflow monitoring feedback has a fast transmission speed and will immediately terminate the memory from writing the read-write packets.
[0070] Therefore, when there is a read-write packet with a size larger than the nearly full value, after sending the near-overflow monitoring feedback, the read-write packet with a size larger than the nearly full value cannot be written into the memory because the size is larger than the remaining space of the memory, but it has no effect on other read-write packets with a size smaller than the nearly full value. The full overflow monitoring feedback will terminate the writing of all read-write packets. For example, the near-overflow monitoring feedback will only affect the larger mailing read-write packets, while other read-write packets will not be affected and can continue to be written into the memory, while the full overflow monitoring feedback will suspend the writing of all types of read-write packets. If the mailing read-write packet lowers the nearly full value, the writing of smaller read-write packets such as non-mailing read-write packets and completion read-write packets will also be suspended.
[0071] Therefore, the setting of the near overflow monitoring feedback needs to be set to be smaller than the expected limited read / write packet size according to the expected limited read / write packet size.
[0072] The monitoring step continuously compares the remaining memory space with a preset monitoring value and dynamically responds to the comparison result. When the remaining memory space reaches or is about to reach the preset monitoring value during the monitoring step, overflow monitoring feedback is continuously or intermittently sent. When the remaining memory space does not reach or is about to reach the preset monitoring value, overflow monitoring feedback is stopped.
[0073] In order to accurately monitor the remaining space in the memory, in an optional implementation, when the memory is written to or read from, the corresponding write enable or read enable will trigger the monitoring step to calculate the remaining space in the memory.
[0074] It should be noted that when the memory is written or read, there will be control signals responsible for controlling the memory input and output, namely write enable and read enable. When the memory is written, the write enable will be sent to the monitoring step at the same time, and the monitoring step will calculate the remaining space in the memory; when the memory is read, the read enable will be sent to the monitoring step at the same time, and the monitoring step will calculate the remaining space in the memory again. The current storage space of the memory = memory space size - number of memory write enable + number of memory read enable. If the write enable is valid, the remaining space is -1, and if the read enable is valid, the remaining space is +1.
[0075] Step S42: If the overflow monitoring feedback is not received and the current link object read / write packet passes the detection, proceed to step S43 to write the current link object read / write packet into the memory;
[0076] It should be noted that the root device receives the read-write package at this time, and there is a detection step for the read-write package, which is used to check whether the read-write package is transmitted correctly and whether it has been modified to achieve the purpose of preventing cracking.
[0077] In order to check whether the read / write packet is unpacked or modified and ensure that the read / write packet is transmitted correctly, in an optional implementation, the detection herein includes detecting the sequence code and cyclic redundancy check code of the read / write packet of the current link object.
[0078] It should be noted that the read-write packet will be assigned a serial code as a prefix in the link object, which can be understood as giving the read-write packet an identity number to facilitate subsequent inspection work. The link object will then generate a cyclic redundancy check code based on the serial code and the data in the read-write packet, and append it to the end of the read-write packet as a suffix. When the root device receives the read-write packet, it will first calculate the cyclic redundancy check code based on the serial code of the read-write packet and the data in the read-write packet, and then compare it with the cyclic redundancy check code at the end of the read-write packet to see if they are consistent. If the two are consistent, it will continue to check whether the serial code is correct. If both are correct, the test will pass. If one of them is wrong, the test will fail.
[0079] It is easy to understand that when the read / write packet passes the detection, it will continue to be transmitted and written to the memory. At this time, the write enable during writing will trigger the monitoring step, calculate the remaining space of the memory and compare it with the preset value.
[0080] like Figure 5 As shown, in an optional implementation, after the read / write packet passes the detection, step S51 is executed to send a confirmation signal and the serial number of the current link object read / write packet to the current link object, and then step S52 is executed for the current link object to clear the current link object read / write packet.
[0081] It should be noted that the link object here is to clear the read-write packet in the retransmission storage space, so as to prevent the read-write packet that has been received from being repeatedly sent in subsequent retransmissions.
[0082] Furthermore, if the overflow monitoring feedback is not received and the read / write packet fails the test, Figure 5 As shown, in an optional implementation, step S53 is performed to discard the current link object read / write packet and send an error signal and the sequence number of the current link object read / write packet to the current link object.
[0083] It is easy to understand that this is the error handling step of an embodiment of the present application. When the overflow monitoring feedback is not received and the read-write packet fails the detection, it means that an error occurs in the transmission process of the read-write packet. Therefore, it is necessary to clear the erroneous read-write packet and reply an error signal to the link object to request retransmission, and inform the link object of the read-write packet that needs to be retransmitted.
[0084] Furthermore, in order to facilitate the user to monitor the program running, such as Figure 5 As shown, after performing step S53, step S54 is executed to send an error signal and record the error.
[0085] Step S55: upon receiving the overflow monitoring feedback, the current link object read / write packet fails the detection, and step S46 is executed: the current link object read / write packet is discarded and an error signal and the sequence number of the current link object read / write packet are sent to the current link object;
[0086] It should be noted that if Figure 5 As shown, after receiving the overflow monitoring feedback, the read / write packet will be forced to fail the monitoring, and then step S46 which is the same as step S51 can be executed.
[0087] By executing the same steps as the error handling process, the retransmission delay can be used to buy time for reading the memory without additionally designing complex modules and steps.
[0088] In this way, even if the read / write packet detection due to overflow fails, an error signal will be generated and sent to the current link object along with the sequence number of the read / write packet of the current link object, thereby ensuring that data will not be lost.
[0089] Afterwards, step S47 is executed, after the link object receives the error signal, it resends the read / write packet, and the memory is read during the resending. During the retransmission period, the root device does not receive other read / write packets.
[0090] It should be noted that during the retransmission of the read / write packet, the root device discards any new data packets with a sequence number subsequent to the read / write packet's sequence number, and no feedback is given. This prevents subsequent read / write packets from being received prematurely, thus preventing errors. Furthermore, the lack of feedback allows subsequent read / write packets to continue to be stored in the retransmission storage space, preventing packet loss.
[0091] Further, in order to ensure that the current link object read and write packet cannot fail to pass the detection, as Figure 5 As shown, in an optional implementation, after receiving the overflow monitoring feedback, step S55 is executed to change the current link object read and write packet.
[0092] Specifically, "changing the read / write packet of the current link object" means increasing the sequence code of the read / write packet by 1. Thus, during read / write packet detection, the cyclic redundancy check code calculated based on the read / write packet sequence code differs from the cyclic redundancy check code of the read / write packet suffix. Even if the cyclic redundancy check code of the read / write packet suffix is incorrect during transmission and happens to be the same as the cyclic redundancy check code calculated based on the read / write packet sequence code, the sequence code of the read / write packet still differs from the sequence code expected by the root device, and therefore cannot necessarily pass detection. The read / write packet will then be forced to be retransmitted.
[0093] In addition, in order to avoid changes in the read-write package due to memory overflow, which may cause the detection to fail and affect the user's monitoring of the program operation, or affect the system and software, in an optional implementation, if the read-write package detection fails due to overflow, step S57 is performed without error recording.
[0094] Because the overflow processing method under credit management provided in the embodiment of the present application greatly reduces the reserved space, the above overflow processing is more likely to occur. If it is regarded as an error and recorded, it will cause great trouble to the system and system maintenance.
[0095] In particular, if an error occurs during the memory reading process, resulting in the memory being unable to be read smoothly, then the resent read and write packets will continue to be resent in a loop, thus causing a deadlock. In order to avoid deadlock, Figure 5 As shown, in an optional implementation, step S56 is further included to determine whether the same read / write packet or multiple packets are resent more than 4 times. If so, step S58 is executed to reconfigure the link object and clear the memory. If not, step S47 is continued.
[0096] In this way, when the memory may overflow during the process of receiving read-write packets, overflow monitoring feedback will be generated, causing the read-write packets to be retransmitted. There is a delay in the retransmission, so this time can be used to read the memory, thereby reducing the reserved space for receiving read-write packets.
[0097] Furthermore, because the reserved space for receiving read and write packets is reduced, the chip area can also be reduced, and the power consumption of the chip is also reduced at the same time.
[0098] In particular, the overflow processing method under credit management provided in the embodiment of the present application is not only applicable to the PCIe protocol, but also to other high-speed interface protocols.
[0099] The embodiment of the present application also provides an overflow processing device under credit management, which can be configured to execute the overflow processing method under credit management, such as Figure 6 Shown, including:
[0100] A monitoring module 625 is configured to monitor whether the remaining space of the memory 624 corresponding to the root device has reached or is about to reach a preset monitoring value, and if so, to send overflow monitoring feedback;
[0101] The detection module 621 is configured to write the current link object read / write packet into the memory 624 when the overflow monitoring feedback is not received and the current link object read / write packet passes the detection; and when the overflow monitoring feedback is received, the current link object read / write packet fails the detection, discard the current link object read / write packet, and send an error signal and the sequence number of the current link object read / write packet to the current link object 61;
[0102] The link object 61, at least one link object, resends the read / write packet after receiving the error signal, and the memory 624 reads the packet during resending. During the retransmission, the root device 62 does not receive other read / write packets.
[0103] The memory 624 is configured to store the current link object read / write packet when it passes the detection; and to read the current link object read / write packet when it is resent;
[0104] The root device 62 does not receive other read / write packets during the retransmission of the current link object read / write packet;
[0105] Furthermore, in an optional implementation, the detection module further includes:
[0106] a recording module 622 configured to, if the detection module does not receive the overflow monitoring feedback and the current link object read / write packet fails detection, discard the current link object read / write packet, send an error signal and a sequence number of the current link object read / write packet to the current link object, and then record the error;
[0107] Modification module 623 is used for the detection module to receive the overflow monitoring feedback, and the current link object read / write packet fails to pass the detection, discard the current link object read / write packet and send an error signal and the sequence number of the current link object read / write packet to the current link object. When the overflow monitoring feedback is received, the current link object read / write packet is modified so that the current link object read / write packet fails to pass the detection. It is easy to understand that if Figure 6 As shown, in order to ensure the normal operation of the device, the device also includes a working module 631 connected to the memory and arranged outside the root device 62 for reading and processing the read-write packet, and a working module 632 arranged inside the root device 62 for reading and processing the read-write packet.
[0108] It should be noted that in hardware implementation, Figure 6 As shown, there is an independent register 626 in the monitoring module 625 for storing the preset monitoring value separately, so that the user can easily change the preset monitoring value.
[0109] Specifically, examples of inter-module work execution are as follows Figure 7As shown. When the device receives a read / write packet sent by link object 76, it first sends the read / write packet to detection module 71 for read / write packet detection. If the detection passes, it continues to write to memory 72 and sends a confirmation signal to link object 76. After receiving the confirmation signal, link object 76 clears the read / write packet from the retransmitted storage space. The contents of memory 72 can be read into working module 74 for subsequent processing. During the writing and reading of memory 72, the write enable and read enable are simultaneously sent to monitoring module 73. When monitoring module 73 finds that the remaining space in memory 72 is no longer able to accommodate read / write packets, it sends overflow monitoring feedback to detection module 71. After receiving the overflow monitoring feedback, when detection module 71 receives a subsequent read / write packet, it modifies the subsequent read / write packet through modification module 711 so that the subsequent read / write packet fails the detection and then continues to perform the detection step to pass. At this time, an error signal and the sequence number of the read / write packet are first sent to link object 76. After receiving the error signal and the sequence number of the read / write packet, the link object retransmits the read / write packet. During the reply and retransmission process, working module 74 reads memory. This ensures that when the read / write packet is retransmitted to detection module 71, memory 72 has sufficient space to receive it. Furthermore, detection module 71 will not receive other read / write packets while reading memory 72. After returning an error signal, recording module 712 within detection module 71 determines whether the test failure is an overflow. If so, recording module 712 does not record the error. If not, recording module 712 records the error.
[0110] An embodiment of the present application also provides a chip. In the embodiment of the present application, the chip can be configured with the overflow processing device under the above-mentioned credit management.
[0111] An embodiment of the present application further provides an electronic device. In the embodiment of the present application, the electronic device includes the above-mentioned chip.
[0112] Although the embodiments of the present application are disclosed above, the present application is not limited thereto. Any person skilled in the art may make various changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims.
Claims
1. A method for handling overflow under credit management, characterized in that: include: Monitor whether the remaining space of the memory corresponding to the root device has reached or is about to reach a preset monitoring value. If so, send overflow monitoring feedback; If the overflow monitoring feedback is not received and the current link object read / write packet passes the detection, the current link object read / write packet is written into the memory; Upon receiving the overflow monitoring feedback, the current link object read / write packet fails to pass the detection, the current link object read / write packet is discarded, and an error signal and a sequence number of the current link object read / write packet are sent to the current link object; After receiving the error signal, the link object retransmits the read / write packet; during the retransmission, the memory performs reading, and the root device does not receive other read / write packets during the retransmission; The method further comprises: if the overflow monitoring feedback is not received and the current link object read / write packet passes the detection, and the current link object read / write packet is written into the memory; If the overflow monitoring feedback is not received and the current link object read / write packet fails the detection, the current link object read / write packet is discarded and an error signal and the sequence number of the current link object read / write packet are sent to the current link object.
2. The overflow processing method under credit management according to claim 1, characterized in that: The step of not receiving the overflow monitoring feedback and the current link object read / write packet passing the detection, and writing the current link object read / write packet into the memory comprises: The detection is to detect the sequence code and cyclic redundancy check code of the read and write packet of the current link object.
3. The overflow processing method under credit management according to claim 1, characterized in that: If the overflow monitoring feedback is not received and the current link object read / write packet fails the detection, the current link object read / write packet is discarded and an error signal and the sequence number of the current link object read / write packet are sent to the current link object, and the error is also recorded.
4. The overflow processing method under credit management according to claim 1, characterized in that: If the overflow monitoring feedback is received, the current link object read / write packet fails to pass the detection, the current link object read / write packet is discarded, and an error signal and the sequence number of the current link object read / write packet are sent to the current link object, including no error recording.
5. The overflow processing method under credit management according to claim 1, characterized in that: The monitoring device detects whether the remaining space of the memory corresponding to the root device has reached or is about to reach a preset monitoring value, and if so, sends overflow monitoring feedback, including: When writing or reading occurs in the memory, the corresponding write enable or read enable triggers monitoring and calculation of the remaining space of the memory.
6. The overflow processing method under credit management according to claim 1, characterized in that: The method of receiving the overflow monitoring feedback and then detecting that the current link object read / write packet fails to pass the detection, discarding the current link object read / write packet and sending an error signal and the sequence number of the current link object read / write packet to the current link object comprises: When overflow monitoring feedback is received, the current link object read / write packet is modified so that the current link object read / write packet fails detection.
7. The overflow processing method under credit management according to claim 1, characterized in that: The monitoring of whether the remaining space of the memory corresponding to the root device has reached or is about to reach a preset monitoring value, and if so, sending overflow monitoring feedback, further includes: monitoring whether the remaining space of the memory has reached a full value, and sending overflow monitoring feedback if the full value has been reached, wherein the full value is 0; Monitor whether the remaining space of the memory reaches a near-full value, and send near-overflow monitoring feedback if it reaches the near-full value, wherein the near-full value is a preset value greater than the full value.
8. The overflow processing method under credit management according to claim 1, characterized in that: After receiving the error signal, the link object retransmits the read / write packet, the memory performs reading during retransmission, and the root device does not receive other read / write packets during the retransmission, including: After the link object repeatedly sends the same read-write packet or multiple read-write packets for more than 4 times, the link object will be reconfigured and the root device will clear the memory.
9. The overflow processing method under credit management according to claim 1, characterized in that: The step of not receiving the overflow monitoring feedback and the current link object read / write packet passing the detection, and writing the current link object read / write packet into the memory comprises: A confirmation signal and a sequence number of the current link object read / write packet are sent to the current link object, and the current link object clears the current link object read / write packet.
10. An overflow processing device under credit management, characterized in that: include: A monitoring module is used to monitor whether the remaining space of the memory corresponding to the root device has reached or is about to reach a preset monitoring value, and if so, to send overflow monitoring feedback; a detection module configured to, when the overflow monitoring feedback is not received and the current link object read / write packet passes the detection, write the current link object read / write packet into the memory; and, when the overflow monitoring feedback is received and the current link object read / write packet fails the detection, discard the current link object read / write packet and send an error signal and a sequence number of the current link object read / write packet to the current link object; a link object, at least one link object, wherein the link object resends the read / write packet after receiving the error signal; A memory for storing the read / write packet of the current link object when the read / write packet passes the detection; The memory reads when the current link object read-write packet is resent; The root device does not receive other read / write packets during the retransmission of the read / write packet of the current link object; The detection module also includes: A recording module is used for discarding the current link object read-write packet and sending an error signal and the serial number of the current link object read-write packet to the current link object if the detection module does not receive the overflow monitoring feedback and the current link object read-write packet fails to pass the detection, and then recording the error.
11. The overflow processing device under credit management according to claim 10, characterized in that: The detection module also includes: A modification module is used for the detection module to receive the overflow monitoring feedback, and then the current link object read-write packet fails to pass the detection, discard the current link object read-write packet and send an error signal and the serial number of the current link object read-write packet to the current link object. When the overflow monitoring feedback is received, the current link object read-write packet is changed so that the current link object read-write packet fails to pass the detection.
12. A chip, characterized in that: The chip is configured as an overflow processing device under credit management as described in any one of claims 10-11.
13. An electronic device, characterized in that: Comprising a chip as claimed in claim 12.
Citation Information
Patent Citations
Deduplication memory module and memory deduplication method therefor
CN108363620A
Hardware error processing method, processor, controller, electronic equipment and storage medium
CN111966521A