Search

CN-121979825-A - Order preserving method and device, electronic equipment and storage medium

CN121979825ACN 121979825 ACN121979825 ACN 121979825ACN-121979825-A

Abstract

The application discloses a sequence preserving method, a sequence preserving device, electronic equipment and a storage medium, and belongs to the technical field of computers. The method comprises the steps of receiving transaction layer packets and generating corresponding authorization indication signals, wherein the authorization indication signals are used for representing receiving time sequences of the corresponding transaction layer packets, the transaction layer packets are divided into first type packets and second type packets, the first type packets are used for achieving unidirectional data issuing, the second type packets are used for achieving bidirectional data interaction, based on the authorization indication signals of all the transaction layer packets, the number of front first type packets associated with each second type packet is recorded, the authorization indication signals of the front first type packets are generated before the second type packets, and when the number of the front first type packets associated with the second type packets is zero, the second type packets which are processed are sent. According to the scheme, the authorization indication signal is adopted to count the number of the pre-packets, and the order preservation is realized according to the judgment of whether the number of the pre-packets is zero, so that additional parameters are not required to follow the pipeline processing, and the hardware resource overhead is reduced.

Inventors

  • ZHU XIAOMING
  • Kang Liyu

Assignees

  • 海光信息技术股份有限公司

Dates

Publication Date
20260505
Application Date
20251201

Claims (19)

  1. 1. A method of preserving order, the method comprising: Receiving a transaction layer packet and generating a corresponding authorization indication signal, wherein the authorization indication signal is used for representing a receiving time sequence of the corresponding transaction layer packet, the transaction layer packet is divided into a first type packet and a second type packet, the first type packet is used for realizing unidirectional data transmission, and the second type packet is used for realizing bidirectional data interaction; Recording the number of leading first-type packets associated with each second-type packet based on authorization indication signals of each transaction layer packet, wherein the authorization indication signals of the leading first-type packets are generated before the second-type packets; And for the second type of packets which are processed, when the number of the leading first type of packets associated with the second type of packets is zero, sending the second type of packets.
  2. 2. The method of claim 1, wherein the recording the number of leading first-type packets associated with each second-type packet based on the grant indication signal of the respective transaction layer packet comprises: Recording the number of the received and unsent first-class packets in real time; And after the authorization indication signal of each second-type packet is generated, determining the number of the currently recorded received and unsent first-type packets as the number of the front first-type packets associated with the second-type packets.
  3. 3. The method of claim 2, wherein the recording in real time the number of the received and unsent first type packets comprises: after the authorization indication signal of the first type packet is generated, increasing the number of the first type packets which are currently received and not transmitted; when the first type packets are transmitted, the number of the first type packets which are currently received and not transmitted is reduced.
  4. 4. The method of claim 1, wherein the sending the second type of packet when the number of leading first type packets associated with the second type of packet is zero for the second type of packet that has completed processing comprises: when any second-class packet is detected to be sent, determining the number of the currently associated front first-class packets; And if the number is zero, sending the second type of packets.
  5. 5. The method according to claim 4, wherein the method further comprises: If the number is non-zero, suspending the transmission of the second type of packets; Updating the number of associated preamble first type packets based on the transmission status of the associated preamble first type packets; And after the quantity is updated to zero, sending the second type of packets.
  6. 6. The method of claim 1, wherein the second class of packets are divided into different subclasses; The method further comprises the steps of: And for a plurality of second-class packets belonging to the same subclass, if the number of the associated leading first-class packets is the same, merging and transmitting the plurality of second-class packets.
  7. 7. The method of any of claims 1-6, wherein the first type of packet is Posted TLP and the second type of packet includes two subclasses of Non-Posted TLP and Completion TLP.
  8. 8. A sequence preserving apparatus, the apparatus comprising: The generation module is used for receiving the transaction layer packet and generating a corresponding authorization indication signal, wherein the authorization indication signal is used for representing the receiving time sequence of the corresponding transaction layer packet, the transaction layer packet is divided into a first type packet and a second type packet, the first type packet is used for realizing unidirectional data issuing, and the second type packet is used for realizing bidirectional data interaction; The recording module is used for recording the quantity of the front first-class packets associated with each second-class packet based on the authorization indication signals of each transaction layer packet, wherein the authorization indication signals of the front first-class packets are generated before the second-class packets; And the processing module is used for sending the second-type packets after the processing is completed when the number of the front first-type packets associated with the second-type packets is zero.
  9. 9. The controller is characterized by being used for processing and preserving a transaction layer packet, the transaction layer packet is divided into a first packet and a second packet, the first packet is used for realizing unidirectional data transmission, the second packet is used for realizing bidirectional data interaction, the controller comprises a receiving module, a sequence checking module and a sending module, the receiving module is connected with the sequence checking module, and the sequence checking module is connected with the sending module; The receiving module is used for receiving the transaction layer packet, generating a corresponding authorization indication signal and sending the authorization indication signal to the sequence checking module, wherein the authorization indication signal is used for representing the receiving time sequence of the corresponding transaction layer packet; the sequence checking module is used for recording the quantity of the front first type packets associated with each second type packet based on the authorization indication signals of each transaction layer packet, and the authorization indication signals of the front first type packets are generated before the second type packets; the sequence checking module is used for notifying the sending module of the second type of packets which are processed completely when the number of the front first type of packets associated with the second type of packets is zero, so as to send the second type of packets.
  10. 10. The controller of claim 9, wherein the sequence verification module comprises a counter and a count logging unit; The counter is used for recording the number of the received and unsent first-class packets in real time; the counting and recording unit is used for writing the number recorded by the current counter after receiving the authorization indication signal of each second-class packet, and obtaining the number of the front first-class packets associated with the second-class packet.
  11. 11. The controller of claim 10, wherein the counter is configured to: after receiving the authorization indication signal of the first type of packet, increasing the number of the first type of packets which are currently received and not transmitted; when the first type packets are transmitted, the number of the first type packets which are currently received and not transmitted is reduced.
  12. 12. The controller of claim 9, wherein the sequence verification module comprises a count logging unit; The sequence checking module is used for determining the number of the currently associated front first-class packets through the counting and recording unit when detecting that any second-class packet is to be sent; the sequence checking module is further configured to notify the sending module to send the second type packet if the number is zero.
  13. 13. The controller of claim 12, wherein the sequence verification module is further configured to: if the number is non-zero, notifying the sending module to pause the sending of the second type packet; Updating the number of the associated preamble first type packets in the count recording unit based on the transmission state of the associated preamble first type packets; after the number is updated to zero, notifying the sending module to send the second type packet.
  14. 14. The controller of claim 9, wherein the second class of packets are divided into different subclasses; The sequence checking module is further used for: and for a plurality of second-class packets belonging to the same subclass, if the number of the associated leading first-class packets is the same, notifying the sending module to carry out combined sending on the plurality of second-class packets.
  15. 15. The controller of claim 9, wherein the first type of packet is Posted TLP and the second type of packet includes two subclasses of Non-Posted TLP and Completion TLP.
  16. 16. A chip comprising a controller according to any one of claims 9 to 15 to implement the order preserving method of any one of claims 1 to 8.
  17. 17. An electronic device comprising a chip as claimed in claim 16 to implement the order preserving method as claimed in any one of claims 1 to 8.
  18. 18. A computer readable storage medium, characterized in that the computer readable storage medium is adapted to store at least one computer program for performing the order preserving method according to any of claims 1 to 8.
  19. 19. A computer program product comprising a computer program which, when executed by a processor, implements the order preserving method of any of claims 1 to 8.

Description

Order preserving method and device, electronic equipment and storage medium Technical Field The present application relates to the field of computer technologies, and in particular, to a method and apparatus for preserving order, an electronic device, and a storage medium. Background PCIe (Peripheral Component Interconnect Express) as a high-speed serial computer expansion bus standard, TLP (Transaction LAYER PACKET ) is mainly divided into three types, P, NP and CPL, respectively. In order to avoid the deadlock problem in the protocol operation, the PCIe protocol formulates order preserving rules for the sending order of the three types of transaction layer packets, and requires to follow order preserving design logic in actual transmission. In the current order-preserving design scheme, tag labels are generally allocated to the received P TLP or NP TLP requests, and the subsequent order-preserving sending of each TLP is guided by the sequence of arrival of the Tag label requests. However, this approach has significant drawbacks, in that the Tag needs to follow each TLP to circulate in the whole processing pipeline, which not only increases the occupation cost of hardware resources, but also increases the complexity of the transaction flow. Disclosure of Invention The embodiment of the application provides a sequence preserving method, a sequence preserving device, electronic equipment and a storage medium, which reduce the hardware resource expenditure and the complexity of a transaction processing flow. The technical scheme is as follows: In one aspect, a method for preserving order is provided, the method comprising: Receiving a transaction layer packet and generating a corresponding authorization indication signal, wherein the authorization indication signal is used for representing a receiving time sequence of the corresponding transaction layer packet, the transaction layer packet is divided into a first type packet and a second type packet, the first type packet is used for realizing unidirectional data transmission, and the second type packet is used for realizing bidirectional data interaction; Recording the number of leading first-type packets associated with each second-type packet based on authorization indication signals of each transaction layer packet, wherein the authorization indication signals of the leading first-type packets are generated before the second-type packets; And for the second type of packets which are processed, when the number of the leading first type of packets associated with the second type of packets is zero, sending the second type of packets. In some embodiments, the recording the number of the leading first-type packets associated with each second-type packet based on the authorization indication signal of each transaction layer packet includes: Recording the number of the received and unsent first-class packets in real time; And after the authorization indication signal of each second-type packet is generated, determining the number of the currently recorded received and unsent first-type packets as the number of the front first-type packets associated with the second-type packets. In some embodiments, the recording in real time the number of the received and unsent packets of the first type includes: after the authorization indication signal of the first type packet is generated, increasing the number of the first type packets which are currently received and not transmitted; when the first type packets are transmitted, the number of the first type packets which are currently received and not transmitted is reduced. In some embodiments, the sending the second type packet when the number of the leading first type packets associated with the second type packet is zero, includes: when any second-class packet is detected to be sent, determining the number of the currently associated front first-class packets; And if the number is zero, sending the second type of packets. In some embodiments, the method further comprises: If the number is non-zero, suspending the transmission of the second type of packets; Updating the number of associated preamble first type packets based on the transmission status of the associated preamble first type packets; And after the quantity is updated to zero, sending the second type of packets. In some embodiments, the second class of packets are divided into different subclasses; The method further comprises the steps of: And for a plurality of second-class packets belonging to the same subclass, if the number of the associated leading first-class packets is the same, merging and transmitting the plurality of second-class packets. In some embodiments, the first type packet is Posted TLP and the second type packet includes two subclasses of Non-Posted TLP and Completion TLP. In another aspect, there is provided an order preserving apparatus, the apparatus comprising: The generation module is used for receiving the transaction layer packet