A method and apparatus for initializing flow control

By adding the FC_INIT_HDR_SIZE state and negotiation process to the Flit-Mode of the PCIe data link, the flow control of the PCIe protocol is optimized, the problem of resource waste is solved, and more efficient resource allocation and bandwidth utilization are achieved.

CN119854220BActive Publication Date: 2025-12-26WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411965341.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-28
Publication Date
2025-12-26
Estimated Expiration
2044-12-28

AI Technical Summary

Technical Problem

The existing PCIe protocol, in its flow control, reserves the TLP packet header field size according to the worst-case scenario, resulting in wasted resources, inability to flexibly allocate and calculate the required credits, and impacting bus bandwidth performance.

Method used

In the Flit-Mode mode of the PCIe data link, by adding the FC_INIT_HDR_SIZE state and negotiation process, the reserved size of each header field of the TLP data packet is obtained, a negotiation data packet is generated, the two negotiating parties determine the initial credit amount, and the allocation of Header Credit buffer resources is optimized.

Benefits of technology

It enables accurate calculation of Header Credits based on actual needs, saving redundant cache space and improving resource allocation efficiency, with the number of Header Credits increased by 126% to 271%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854220B_ABST
    Figure CN119854220B_ABST
Patent Text Reader

Abstract

The application provides a flow control initialization method and device, the method is applied to Flit-Mode mode of PCIE data link local end, comprising: switching to negotiation state in response to entering initialization stage of data link layer; in the negotiation state, obtaining reserved size corresponding to each header field of TLP data packet; generating first negotiation data packet based on the reserved size corresponding to each header field; sending the first negotiation data packet to PCIE data link opposite end, so that the PCIE data link opposite end determines initial credit number of the PCIE data link opposite end according to the reserved size of each header field carried in the first negotiation data packet.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the chip technical field, and particularly relates to a flow control initialization method and device. BACKGROUND

[0002] With the increasing requirements of modern computer systems on performance and power consumption, PCIe is widely used in various computer systems as a high-bandwidth and low-latency interface standard.

[0003] In the earlier PCI version of PCIe, there is no flow control mechanism, and the sending end does not know whether the receiving end can receive the corresponding TLP (Transaction Layer Packet) at the current time. Therefore, the sending end can only try to send first, during which multiple waiting periods (such as the receiving device is not ready) or even retries may be inserted, which seriously affects the bandwidth performance of the bus with the evolution of the PCIe bus, including the improvement of data rate and transmission bandwidth requirements. SUMMARY

[0004] The application aims to provide a flow control initialization method and device, and aims to solve the problem that in the related art, the head field size in the TLP data packet is reserved according to the worst case, so that the required credit number cannot be flexibly allocated and calculated according to the actual needs, causing resource waste.

[0005] According to a first aspect of the application, a flow control initialization method is provided, which is applied to a Flit-Mode mode of a PCIE data link local end, and includes:

[0006] In response to entering an initialization stage of a data link layer, switching to a negotiation state;

[0007] In the negotiation state, obtaining a reserved size corresponding to each head field of a TLP data packet;

[0008] Based on the reserved size corresponding to each head field, a first negotiation data packet is generated;

[0009] The first negotiation data packet is sent to a PCIE data link opposite end, so that the PCIE data link opposite end determines an initial credit number of the PCIE data link opposite end according to the reserved size of each head field carried in the first negotiation data packet.

[0010] In an optional embodiment, in the negotiation state, obtaining a reserved size corresponding to each head field of a TLP data packet includes:

[0011] determining a first reserved size of a header field of the TLP packet based on whether a Flit-Mode of the TLP packet is a reserved type;

[0012] determining a second reserved size of an OHC field of the TLP packet based on whether the TLP packet supports an OHC-E type;

[0013] determining a third reserved size of a trailer field of the TLP packet based on whether the trailer field of the TLP packet supports an ECRC and an IDE MAC.

[0014] In an optional implementation, the method further comprises:

[0015] receiving a second negotiation packet sent by a peer of the PCIE data link; wherein the second negotiation packet carries reserved sizes of each header field of a TLP packet of the peer of the PCIE data link;

[0016] determining an initial credit number of the PCIE data link based on the reserved sizes of each header field of the TLP packet of the peer of the PCIE data link in the second negotiation packet, and switching to an initialization state of an initialization phase of a data link layer;

[0017] in the initialization state, sending a flow control DLLP corresponding to a TLP packet of a different type to the peer of the PCIE data link based on the initial credit number.

[0018] In an optional implementation, the reserved sizes of each header field of the TLP packet of the peer of the PCIE data link in the second negotiation packet include a first reserved size of a header field, a second reserved size of an OHC field, and a third reserved size of a trailer field; and the determining of the initial credit number of the PCIE data link based on the reserved sizes of each header field of the TLP packet of the peer of the PCIE data link in the second negotiation packet comprises:

[0019] calculating a header size of the TLP packet of the peer of the PCIE data link based on the first reserved size of the header field, the second reserved size of the OHC field, and the third reserved size of the trailer field of the TLP packet of the peer of the PCIE data link;

[0020] determining the initial credit number based on the header size of the TLP packet of the peer of the PCIE data link, a size of other fields, and a receiving data buffer size of the PCIE data link.

[0021] In an optional implementation, the method further comprises:

[0022] In the negotiation state, if a flow control DLLP sent by the peer end of the PCIE data link in the initialization state of the initialization phase of the data link layer is received, the initialization state of the initialization phase of the data link layer is directly switched to;

[0023] In the initialization state, the flow control DLLP corresponding to the TLP data packet of different types is sent to the peer end of the PCIE data link based on the default credit number.

[0024] According to a second aspect of the present application, an initialization device for flow control is provided, which is applied to the Flit-Mode mode of the local end of the PCIE data link, and includes:

[0025] A response unit is configured to switch to the negotiation state in response to entering the initialization phase of the data link layer.

[0026] An acquisition unit is configured to acquire the reserved size corresponding to each header field of the TLP data packet in the negotiation state.

[0027] A generation unit is configured to generate a first negotiation data packet based on the reserved size corresponding to each header field.

[0028] A first sending unit is configured to send the first negotiation data packet to the peer end of the PCIE data link, so that the peer end of the PCIE data link determines the initial credit number of the peer end of the PCIE data link according to the reserved size of each header field carried in the first negotiation data packet.

[0029] In an optional embodiment, the acquisition unit includes:

[0030] A first determination subunit is configured to determine the first reserved size of the header basic field of the TLP data packet based on whether the newly added message type of Flit-Mode in the TLP data packet is a reserved type.

[0031] A second determination subunit is configured to determine the second reserved size of the header OHC field of the TLP data packet based on whether the TLP data packet supports the OHC-E type.

[0032] A third determination subunit is configured to determine the third reserved size of the header tail field of the TLP data packet based on whether the header tail field of the TLP data packet supports ECRC and IDE MAC.

[0033] In an optional embodiment, the device further includes:

[0034] The receiving unit is configured to receive a second negotiation data packet sent by the opposite end of the PCIE data link, wherein the second negotiation data packet carries reserved sizes of each header field of a TLP data packet of the opposite end of the PCIE data link.

[0035] The determining unit is configured to determine an initial credit number of the local end of the PCIE data link based on the reserved sizes of each header field of the TLP data packet of the opposite end of the PCIE data link in the second negotiation data packet, and switch to an initialization state of an initialization phase of the data link layer.

[0036] The second sending unit is configured to send, in the initialization state, a traffic control DLLP corresponding to a TLP data packet of different types to the opposite end of the PCIE data link based on the initial credit number.

[0037] In an optional implementation, the reserved sizes of each header field of the TLP data packet of the opposite end of the PCIE data link in the second negotiation data packet include a first reserved size of a header field basic field, a second reserved size of a header field OHC field, and a third reserved size of a header field tail field; and the determining unit includes:

[0038] The calculating sub-unit is configured to calculate a header size of the TLP data packet of the opposite end of the PCIE data link based on the first reserved size of the header field basic field, the second reserved size of the header field OHC field, and the third reserved size of the header field tail field of the TLP data packet of the opposite end of the PCIE data link.

[0039] The fourth determining sub-unit is configured to determine the initial credit number based on the header size of the TLP data packet of the opposite end of the PCIE data link, a size of other fields, and a receiving data buffer size of the local end of the PCIE data link.

[0040] In an optional implementation, the apparatus further includes:

[0041] The switching unit is configured to, in the negotiation state, directly switch to the initialization state of the initialization phase of the data link layer if a traffic control DLLP sent by the opposite end of the PCIE data link in the initialization state of the initialization phase of the data link layer is received.

[0042] The third sending unit is configured to send, in the initialization state, a traffic control DLLP corresponding to a TLP data packet of different types to the opposite end of the PCIE data link based on a default credit number.

[0043] Compared with the related art, the technical scheme of the present application has at least the following advantages:

[0044] The application adds FCINIT HDR SIZE state and related negotiation process on the basis of the original PCIE protocol. For PCIE 6.X devices, resources are not reserved according to the worst case, but the size of the Header Credit unit negotiated by both sides of the PCIE link is combined with the size of the local Header credit buffer resource to accurately calculate the number of Header Credits, which can save redundant cache space, increase the number of Header Credits by 126% to 271%, and realize more reasonable allocation of resources. Other features and advantages of the application will be described in the subsequent specification, and some will become apparent from the specification, or be understood by implementing the application. The purpose and other advantages of the application can be achieved and obtained by the structure and process indicated in the specification and the drawings. BRIEF DESCRIPTION OF DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the application or the related art, the following will briefly introduce the drawings needed to be used in the embodiment or related art description. Obviously, the drawings described below are some embodiments of the application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.

[0046] Figure 1 It is a schematic diagram of the flow control basis of the PCIE system according to the related art.

[0047] Figure 2 It is a schematic diagram of the flow control buffer classification of the PCIE system according to the related art.

[0048] Figure 3 It is a protocol description schematic diagram of the newly added 5 / 6 / 7 DW in the TLP Header Base in the PCIE 6.X protocol according to the related art.

[0049] Figure 4 It is a flowchart of the initialization method of the flow control according to the exemplary embodiment of the application.

[0050] Figure 5 It is an optimization description schematic diagram of the data link state according to the exemplary embodiment of the application.

[0051] Figure 6 It is a structure block diagram of the initialization device of the flow control according to the exemplary embodiment of the application. DETAILED DESCRIPTION

[0052] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts should fall into the scope of the present application.

[0053] In order to ensure that the data sent by the sending PCIe device does not exceed the receiving capability of the receiving device, avoid triggering data retransmission to reduce data output efficiency or data overflow to cause data loss, the PCIe protocol gives a set of flow control (FC) scheme to improve the data transmission efficiency of the PCIe bus.

[0054] The flow control of the PCIe bus uses the Credit-Based principle and is coordinated and realized by the transaction layer and the data link layer. Referring to Figure 1 As shown in the figure, by sending Flow Control DLLPs (Data Link Layer Packets) between the data link layers of two adjacent ports, the receiving end informs the sending end of the size of the buffer during initialization, and then periodically informs the sending end of the size of each buffer of the receiving end during normal operation. The sending end can know whether the receiving end can receive the TLP (Transaction Layer Packets) to be sent through the Flow Control mechanism before sending. The types of TLPs sent and received by the PCIe device are divided into three categories: P (Posted Request) messages, NP (Non-Posted Request) messages and CPL (Completion) messages. The receiving buffer of the receiving device is also divided into three categories according to the three types of TLPs, to store P / NP / CPL TLPs respectively, as shown in Figure 2 As shown in the figure, each type of buffer in the TLP is further divided into Header Buffer and Data Buffer according to whether it stores the message header field or the message data field. The buffer that stores the header field of the P type message is defined as PH (Posted request Header buffer), and the buffer that stores the data field of the P type message is defined as PD (Posted request Data buffer). The same type of buffer that stores the header field and the data field of the NP / CPL type message is defined as NPH / NPD and CPLH / CPLD.

[0055] The receiving buffer of all types of messages of the PCIe receiving device is in Credit units, and the number of Credits reflects the size of the buffer.

[0056] In the PCIe 6.X protocol, a new transmission mode, Flit mode, is added, and the traditional transmission mode is called non-Flit mode. In the traditional mode, the TLP is of indefinite length, and the start and end flags are needed in the physical layer to mark the head and tail of the data packet. Moreover, the TLP and the DLLP work in different layers and are independent of each other. The Flit mode packs the information of multiple TLPs and a DLLP into a large data frame, called Flit, and the transmission of data is in units of Flit, each of which is fixed at 256 bytes. In this mode, a new TLP format is defined, which consists of:

[0057] 1) Local TLP prefixes (optional).

[0058] 2) TLP Header Base (1 DW (nop), 3 DW, 4 DW, 5 DW (R), 6 DW (R), 7 DW (R)).

[0059] 3) Orthogonal Header Content (OHC) (optional), 0-7 DW, a total of four types, respectively: OHC-A, OHC-B, OHC-C, OHC-E; the specific type and size are indicated by OHC[4:0] in the first DW of the TLP Header Base.

[0060] 4) TLP data payload.

[0061] 5) TLP Trailer (optional), the specific type and size are indicated by TS[2:0] in the first DW of the TLP Header Base.

[0062] Among them, the part that is calculated as the TLP Header (TLP header field) includes: TLP Header Base (TLP header basic field), OHC (TLP header OHC field) and TLP Trailer (TLP header tail field) three parts.

[0063] According to the PCIE 6.X protocol, the three parts calculated as the message header field are described as follows:

[0064] 1. For TLP Header Base, 1DW and 5DW have been added in FM (Flit Mode).

[0065] There are four new formats: 6DW and 7DW. 1DW is a NOP (empty) format. The others are 5DW, 6DW, and...

[0066] The 7DW header has three lengths. In FM mode, there are 256 possible 8-bit type encodings, 40 of which are designated as Reserved. However, in the current protocol, all of these are marked as Reserved. (See screenshots of some protocols below.) Figure 3 As shown.

[0067] 2. Regarding OHCs, the main focus here is on the size of various OHC types. The PCIe 6.X protocol provides four main categories of OHCs: OHC-A, OHC-B, OHC-C, and OHC-E, with their sizes shown in Table 1 below:

[0068] Table 1

[0069] OHC Type Size (DW) OHC-A 1 DW OHC-B 1 DW OHC-C 1 DW OHC-E 1 DW (E1), 2 DW (E2), 4 DW (E4)

[0070] Among them, OHC-A / B / C may coexist, and OHC-E is equivalent to the EE TLPPrefix in the PCIE 6.X and earlier protocols, and is an optional part;

[0071] 3. For PCIe Trailers, the specific type and size are indicated by the TS[2:0] of the first DW in the TLP Header Base. The Trailer size and meaning corresponding to the TS values ​​are shown in Table 2 below:

[0072] Table 2

[0073]

[0074]

[0075] For PCIe Trailers, similar to the TLP Digiest in the PCIE 6.X and earlier protocols, and enhanced in the latest protocol, but still optional content, with sizes ranging from 0 to 5 DW.

[0076] According to the PCIe 6.X protocol, the calculation of the Header creditunit size (header field size) corresponding to the TLP Header under FM (Flit-Mode) is shown in Table 3 below:

[0077] Table 3

[0078]

[0079] For Switch (Switch Receiver) and EP / RP (Endpoint Upstream Port / Root Port Receiver), the calculation rules of FC (Flow control) Header credit unit size (i.e. TLP header size) are consistent. According to the analysis of the size of each component in the foregoing, the size of a Header credit unit can be calculated as follows:

[0080] Header Credit Unit size = 1 largest Base hdr (TLP Header Base) (7DW) + OHC-A (1DW) + OHC-B (1DW) + OHC-C (1DW) + OHC-E (4DW) + 1 largest TLP Trailer (5DW) = 7 + 1 + 1 + 1 + 4 + 5 = 19DW.

[0081] In the PCIe 6.X protocol, the number of Header Credits required at a higher rate has doubled, and a Header Credit Unit size has also increased to 19 DW (in the PCIe 5.0 and previous protocols, without considering the Local-prefix, the maximum still only needs 9 DW), which has more than doubled. In the FM mode, this expansion and reservation of TLP not only improves the protocol to absorb more features in the future, but also puts higher requirements on the storage resources of the device.

[0082] According to the analysis of the components of the TLP Headerbase in the foregoing, it can be seen that:

[0083] 1. The size of a largest TLP Headerbase is 7DW, but 5DW, 6DW and 7DW TLPs are currently of the reserved type.

[0084] 2. A total of 7DW is reserved for various OHCs, but for the optional message of OHC-E type, if OHC-E is not supported, OHC only needs to occupy 3DW of space.

[0085] 3. For the TLP Trailer, if only ECRC is reserved, only 1DW is needed, and 5DW is not needed in most cases.

[0086] Therefore, according to the different supported features, the required Header Credit Unit size is calculated as shown in Table 4:

[0087] Table 4

[0088]

[0089] In Table 4, in the first row, the maximum space occupied by the TLP base hdr is 3DW, the maximum space occupied by the OHC is 4DW, and the space occupied by the TLP Trailer is 0, because the TLP Trailer does not support ECRC and IDE, so the size of the Header Credit Unit in the first row can be 3+4=7. The second to fourth rows support different fields respectively on this basis, so the space occupied by the supported fields can be added on this basis.

[0090] In the PCIe 6.X protocol, the protocol proposes a way for a Header Credit Unit to reserve Header credit buffer resources in the worst case, but according to the above calculation, the actual situation is difficult to fill, even if only excluding the reserved cases in the current protocol, a Header credit unit size can be reduced to 15DW, compared with the recommended value of 19DW, there is still 21% of the resource optimization space.

[0091] Because the protocol proposes to reserve resources in the worst case, the initialization stage of the Flow Control lacks the step of negotiating the size of the Header Credit Size, and only the number of Credits is negotiated, so there is a problem of possible serious waste of Header Credit buffer.

[0092] On the basis of the original PCIE protocol, the present application proposes a new flow control packet format (FC DLLP) in the Flit-Mode mode, and proposes an optimized PCIE initialization flow control process using the packet format. Through the execution of the flow, the latest PCIE 6.X protocol supporting device does not need to reserve Header credit Buffer resources in the worst case, and through the execution of the new flow control negotiation process by the two ends of the PCIE link, the characteristics that may affect the size of the Header Credit Buffer supported by the opposite end can be accurately known, and then the number of credits on the local side can be flexibly allocated and calculated according to the negotiation result, to realize the optimization adjustment of the Header Credit buffer resources of the two sides.

[0093] Referring to Figure 4 The present application exemplarily proposes a flow control initialization method, which is applied to the Flit-Mode mode of the local side of a PCIE data link, and includes:

[0094] In step S401, in response to entering an initialization phase of a data link layer, switching to a negotiation state;

[0095] In step S402, in the negotiation state, obtaining a reserved size corresponding to each header field of a TLP data packet;

[0096] In step S403, generating a first negotiation data packet based on the reserved size corresponding to each header field;

[0097] In step S404, sending the first negotiation data packet to a peer end of a PCIE data link, so that the peer end of the PCIE data link determines an initial credit number of the peer end of the PCIE data link according to the reserved size of each header field carried in the first negotiation data packet.

[0098] Exemplarily, after the PCIe 6.X protocol introduces the FM (Flit-Mode) mode, the DLLP message type is expanded from the original 46 to 181, and the 8-bit DLLP type coding is still used. In order to realize the confirmation of the Header credit unit size (that is, the header field size), a kind of DLLP message type is added, which is used for the link parties to negotiate the characteristics affecting the Header credit unit size.

[0099] From the reserved code type of the DLLP Type coding, 00111V2V1V0 (V2V1V0 represents a virtual channel VC number) is selected as a new self-defined FC DLLP message type initFC_hdr_size, and the message format is defined as shown in Table 5:

[0100] Table 5

[0101]

[0102] Among them, 1) Byte0 still represents the DLLP type; 2) Byte1 / 2 / 3 respectively represent the Header base (header field base) of P / NP / CPL TLP message, OCH-E (OCH-E type in OHC field of header), and the number of DWs occupied in the worst case in TLP Trailer (header tail field), and the format is the same. The specific meanings of the new FC DLLP (for convenience, it is also called negotiation data packet in this application, the first negotiation data packet corresponds to the local end of the PCIE data link, and the second negotiation data packet corresponds to the peer end of the PCIE data link) field segment and the corresponding reserved size are shown in Table 6:

[0103] Table 6

[0104]

[0105] bit[7:5] indicates the number of DWs of the Header base reserved size; bit[4:3] indicates the number of DWs of the OHC-E reserved size; bit[2:0] indicates the number of DWs of the TLP Trailer reserved size. The 16-bit CRC check code contained in the original FC DLLP packet is no longer generated separately in Flit Mode, but is included in the Flit TLP and calculated uniformly.

[0106] In the PCIe 6.X protocol Flit-Mode mode, the sending of the DL_INIT stage (data link layer initialization stage) DLLP is optimized and improved.

[0107] Exemplarily, taking the PCIE data link local end as an example, the DL (Data Link) state machine jump optimization is shown in the following figure: Figure 5 The specific description is as follows:

[0108] 1) A new state FC_INIT_HDR_SIZE (for convenience of description, the application refers to it as a negotiation state) is added. After the PCIE data link local end enters the DL_INIT stage (data link layer initialization stage), it first enters the negotiation state preferentially, and sends the newly added FC DLLP initFC_hdr_size (the first negotiation data packet, which carries the reserved size of each header field of the TLP data packet) to the PCIE data link opposite end in the negotiation state, and negotiates the size of the TLP header credit unit (TLP data packet header). The reserved size of each header field of the TLP data packet is sent to the PCIE data link opposite end through the first negotiation data packet, including the maximum occupied DW number information of each header field such as Header base, OHC-E, and TLP_Trailer supported by the PCIE data link local end. It should be noted that the PCIE data link local end can be a data receiving end or a data sending end. If the PCIE data link local end is a data receiving end, then the PCIE data link opposite end is a data sending end. If the PCIE data link local end is a data sending end, then the PCIE data link opposite end is a data receiving end.

[0109] 2) PCIE data link opposite end receives the first negotiation data packet, and the size of the actual required Header credit unit is calculated according to the information carried in the first negotiation data packet, that is, the size of the entire header field of the TLP data packet. Then, according to the resources of the local Header credit receiving buffer, the maximum Header credit that can be supported is calculated, that is, the initial credit number. It can be understood that during the data transmission process, the initial credit number will change after the received data is stored in the receiving data buffer, and this change will be periodically sent to the opposite end in the subsequent process.

[0110] In some optional implementations, in the negotiation state, the reserved size of each header field of the TLP data packet is obtained, including:

[0111] Based on whether the newly added message type of Flit-Mode in the TLP data packet is a reserved type, the first reserved size of the header base field of the TLP data packet is determined;

[0112] Based on whether the TLP data packet supports OHC-E type, the second reserved size of the header OHC field of the TLP data packet is determined;

[0113] Based on whether the tail field of the header of the TLP data packet supports ECRC and IDE MAC, the third reserved size of the tail field of the header of the TLP data packet is determined.

[0114] Exemplarily, as described above, the header size of the TLP data packet depends on three fields, namely the header base field Header base, the header OHC field and the tail field TLP Trailer of the header, and the maximum occupation size of the three fields is as described above. The header base field Header base depends on whether the newly added message type of Flit-Mode is a reserved type, that is, if the newly added 1DW, 5DW, 6DW and 7DW of Flit-Mode are all marked as Reserved (reserved) type, it can be understood that the header base field only needs to reserve the original part, that is, the maximum occupation size is 4DW. If the newly added 1DW, 5DW, 6DW and 7DW of Flit-Mode are not all marked as Reserved (reserved) type, then the maximum occupation size of the header base field can be determined as 5DW, 6DW or 7DW according to the actual situation.

[0115] Similarly, for the OHC field in the header, in Flit-mode, a total of 7DW is reserved for each type of OHC, but if OHC-E is not supported, then OHC only needs to occupy 3DW of space, so the maximum size of the OHC field in the header can be determined to be 3DW or 7DW depending on whether OHC-E is supported. For the tail field in the header, if only ECRC is reserved, then only 1DW is needed, and if IDE MAC (Integrated Development Environment MAC) is also supported, then 4DW is needed. Therefore, the reserved size of the tail field in the header can be determined by determining whether ECRC is supported and whether IDE MAC is supported.

[0116] In some optional implementations, the method further includes:

[0117] receiving a second negotiation data packet sent by the opposite end of the PCIE data link; wherein the second negotiation data packet carries the reserved size of each header field of the TLP data packet of the opposite end of the PCIE data link;

[0118] based on the reserved size of each header field of the TLP data packet of the opposite end of the PCIE data link in the second negotiation data packet, determining the initial credit number of the local end of the PCIE data link, and switching to the initialization state of the initialization phase of the data link layer;

[0119] in the initialization state, sending different types of TLP data packet corresponding to the traffic control DLLP based on the initial credit number to the opposite end of the PCIE data link.

[0120] Exemplarily, after the local end of the PCIE data link enters the initialization phase of the data link layer, it preferentially switches to the negotiation state and sends a first negotiation data packet to the opposite end of the PCIE data link; at the same time, the opposite end of the PCIE data link also preferentially switches to the negotiation state after entering the initialization phase of the data link layer, and sends a second negotiation data packet to the local end of the PCIE data link, the first negotiation data packet and the second negotiation data packet are the same, except that the second negotiation data packet is sent by the opposite end of the PCIE data link to the local end of the PCIE data link, and the second negotiation data packet carries the reserved size of each header field of the opposite end of the PCIE data link.

[0121] Exemplarily, if the peer of the PCIE data link sends the second negotiation data packet to the local of the PCIE data link, and the local of the PCIE data link receives the second negotiation data packet, the local of the PCIE data link calculates the space size occupied by the header field of the TLP data packet of the peer of the PCIE data link based on the reserved size of each header field carried in the second negotiation data packet, that is, the header field size, so as to determine how much space the header field in the TLP data packet received from the peer of the PCIE data link will occupy at most, and the space size of the data payload part in the TIP data packet except the header field is fixed, so based on the maximum occupied size of the header field and the space size of the data payload, the maximum occupied space size of a TLP data packet can be determined, and thus in the case that the size of the receiving data buffer is known, the credit number of the local of the PCIE data link in the initial case can be determined. The credit number is provided by the local of the PCIE data link to the peer of the PCIE data link, so that when the peer of the PCIE data link sends data to the local of the PCIE data link, flow control measures are taken based on the credit number.

[0122] Exemplarily, after the local of the PCIE data link receives the second negotiation data packet sent by the peer of the PCIE data link and completes the calculation of the initial credit number, the local of the PCIE data link enters an initialization state FC INIT1 of the initialization phase of the data link layer. The initialization state FC INIT1 is a state specified by the protocol, and in this state, the local of the PCIE data link sends an initFC-P / NP / CPL DLLP message to the peer of the PCIE data link, that is, sends a flow control DLLP corresponding to different types of TLP data packets to the peer of the PCIE data link, to inform the peer of the PCIE data link of the initial credit number corresponding to different types of TLP data packets.

[0123] In some optional implementation manners, the reserved size of each header field of the TLP data packet of the peer of the PCIE data link in the second negotiation data packet includes: a first reserved size of a header field basis, a second reserved size of a header field OHC, and a third reserved size of a header field tail; and determining the initial credit number of the local of the PCIE data link based on the reserved size of each header field of the TLP data packet of the peer of the PCIE data link in the second negotiation data packet includes:

[0124] calculating the header field size of the TLP data packet of the peer of the PCIE data link based on the first reserved size of the header field basis, the second reserved size of the header field OHC, and the third reserved size of the header field tail of the TLP data packet of the peer of the PCIE data link;

[0125] The initial credit number is determined based on the header field size of the TLP data packet of the PCIE data link peer, other field sizes, and the receiving data buffer size of the PCIE data link local end.

[0126] Exemplarily, the PCIE data link peer and the PCIE data link local end both include the first reserved size of the header field basic field, the second reserved size of the header field OHC field, and the third reserved size of the header field tail field in the second negotiation data packet. The PCIE data link local end calculates the header field size of the TLP data packet of the PCIE data link peer based on the above three reserved sizes in the second negotiation data packet. The TLP data packet of the PCIE data link peer is received by the PCIE data link local end and stored in the receiving data buffer, and thus the initial credit number needs to be calculated based on the header field size of the TLP data packet of the PCIE data link peer, other field sizes of the TLP data packet, and the receiving data buffer size. The other field sizes of the TLP data packet may, for example, include the data size of the valid data payload, which is usually fixed.

[0127] In some optional implementations, the method further includes:

[0128] In the negotiation state, if a traffic control DLLP sent by the PCIE data link peer in the initialization state of the initialization phase of the data link layer is received, the state is directly switched to the initialization state of the initialization phase of the data link layer.

[0129] In the initialization state, the traffic control DLLP corresponding to different types of TLP data packets is sent to the PCIE data link peer based on the default credit number.

[0130] Exemplarily, as recorded above, in order to be able to flexibly allocate and calculate the local credit quantity, and realize the optimized adjustment of the receiving data buffer resource between the local and the opposite end, after entering the initial stage of the data link layer, a new state, i.e. the negotiation state, is added, so that the local end sends a first negotiation data packet to the opposite end, and the opposite end also sends a second negotiation data packet to the local end. However, if the opposite end is still the original unimproved device and does not support the scheme provided by the application, the PCIE data link local end will not be able to receive the second negotiation data packet sent by the opposite end in the negotiation state, but will directly receive the flow control DLLP of various TLP data packets sent by the PCIE data link opposite end in the initialization state of the initialization stage of the data link layer. In this case, the PCIE data link local end can determine that the opposite end is the original unimproved device and does not support the scheme provided by the application, so it is necessary to no longer negotiate the header field size of the TLP data packet according to the protocol specified manner, and it is not necessary to recalculate the initial credit quantity, but directly use the default credit quantity. The default credit quantity is calculated based on the maximum occupation size 19DW of the header field size of the TLP data packet. Therefore, after the PCIE data link local end directly receives the flow control DLLP of various TLP data packets sent by the opposite end in the initialization state of the initialization stage of the data link layer, it switches to the initialization state of the initialization stage of the data link layer, and also sends the flow control DLLP of various TLP data packets to the opposite end, and the credit quantity in these flow control DLLPs is determined based on the default credit quantity. It should be noted that the PCIE data link opposite end and the PCIE data link local end enter FC_INIT1, and the flow is consistent with the original PCIE6.X initialization flow until entering the DL_Active state.

[0131] Based on the previous analysis, if the device supporting PCIE6.X reserves 128 credit resources in the Header Credit buffer according to the worst case required by the protocol, and after the newly added FC_INIT_HDR_SIZE process negotiation adjustment, the credit quantity changes as shown in Table 7:

[0132] Table 7

[0133]

[0134] From the table calculation can be seen: increased FCINIT_HDR_SIZE state and related negotiation process, for PCIE6.X device, no longer need to reserve resources according to the worst case, but according to the PCIE link both sides of the size of the Header Credit unit after negotiation, combined with the size of the local Header credit buffer resource accurate calculation Header Credit quantity, can save redundant cache space, Header Credit quantity can be improved by 126% ~ 271%, can realize more reasonable allocation of resources.

[0135] Correspondingly, referring to Figure 6 As shown in the figure, the application exemplarily proposes a flow control initialization device applied in the Flit-Mode mode of the PCIE data link local end, including:

[0136] The response unit 601 is configured to switch to the negotiation state in response to the entering of the initialization stage of the data link layer.

[0137] The acquisition unit 602 is configured to acquire the reserved size corresponding to each header field of the TLP data packet in the negotiation state.

[0138] The generation unit 603 is configured to generate a first negotiation data packet based on the reserved size corresponding to each header field.

[0139] The first sending unit 604 is configured to send the first negotiation data packet to the PCIE data link opposite end, so that the PCIE data link opposite end determines the initial credit quantity of the PCIE data link opposite end according to the reserved size of each header field carried in the first negotiation data packet.

[0140] In some optional implementation manners, the acquisition unit includes:

[0141] The first determination sub-unit is configured to determine the first reserved size of the header basic field of the TLP data packet based on whether the newly added message type of the Flit-Mode in the TLP data packet is a reserved type.

[0142] The second determination sub-unit is configured to determine the second reserved size of the header OHC field of the TLP data packet based on whether the TLP data packet supports the OHC-E type.

[0143] The third determination sub-unit is configured to determine the third reserved size of the header tail field of the TLP data packet based on whether the header tail field of the TLP data packet supports the ECRC and the IDE MAC.

[0144] In some optional implementation manners, the device further includes:

[0145] The receiving unit is configured to receive a second negotiation data packet sent by a peer of the PCIE data link, wherein the second negotiation data packet carries reserved sizes of each header field of a TLP data packet of the peer of the PCIE data link.

[0146] The determining unit is configured to determine an initial credit number of the PCIE data link based on the reserved sizes of each header field of the TLP data packet of the peer of the PCIE data link in the second negotiation data packet, and switch to an initialization state of an initialization phase of the data link layer.

[0147] The second sending unit is configured to send, in the initialization state, a traffic control DLLP corresponding to a TLP data packet of different types to the peer of the PCIE data link based on the initial credit number.

[0148] In some optional implementation manners, the reserved sizes of each header field of the TLP data packet of the peer of the PCIE data link in the second negotiation data packet include a first reserved size of a header field basic field, a second reserved size of a header field OHC field, and a third reserved size of a header field tail field; and the determining unit includes:

[0149] The calculating sub-unit is configured to calculate a header size of the TLP data packet of the peer of the PCIE data link based on the first reserved size of the header field basic field, the second reserved size of the header field OHC field, and the third reserved size of the header field tail field of the TLP data packet of the peer of the PCIE data link.

[0150] The fourth determining sub-unit is configured to determine the initial credit number based on the header size of the TLP data packet of the peer of the PCIE data link, a size of other fields, and a receiving data buffer size of the PCIE data link.

[0151] In some optional implementation manners, the apparatus further includes:

[0152] The switching unit is configured to, in the negotiation state, if the traffic control DLLP sent by the peer of the PCIE data link in the initialization state of the initialization phase of the data link layer is received, directly switch to the initialization state of the initialization phase of the data link layer.

[0153] The third sending unit is configured to, in the initialization state, send the traffic control DLLP corresponding to the TLP data packet of different types to the peer of the PCIE data link based on a default credit number.

[0154] The apparatus is used for implementing the initialization method of the traffic control provided in the above embodiments, and specific details can be referred to the description of the initialization method of the traffic control in the above embodiments, which will not be described herein again.

[0155] It can be understood that the circuit structure, name and parameter described in the above embodiments are only examples. Those skilled in the art can also easily think of combinations and adjustments of the structural features of the above multiple embodiments according to the use needs, and the concept of the present application should not be limited to the specific details of the above examples.

[0156] Although the present application is described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method of initializing flow control, characterized by, The method is applied to a Flit-Mode mode of a PCIE data link local end, and comprises the following steps: in response to entering an initialization stage of a data link layer, switching to a negotiation state; in the negotiation state, obtaining reserved sizes corresponding to each header field of a TLP data packet; generating a first negotiation data packet based on the reserved sizes corresponding to each header field; sending the first negotiation data packet to a PCIE data link opposite end, so that the PCIE data link opposite end determines an initial credit number of the PCIE data link opposite end according to the reserved sizes of each header field carried in the first negotiation data packet.

2. The initialization method of flow control according to claim 1, characterized in that, in the negotiation state, obtaining reserved sizes corresponding to each header field of a TLP data packet, comprising the following steps: determining a first reserved size of a header basic field of the TLP data packet based on whether a newly added message type of the Flit-Mode in the TLP data packet is a reserved type; determining a second reserved size of an OHC field of the TLP data packet based on whether the TLP data packet supports an OHC-E type; determining a third reserved size of a tail field of the TLP data packet based on whether the tail field of the TLP data packet supports an ECRC and an IDE MAC.

3. The initialization method of flow control according to claim 1 or 2, characterized in that, The method further comprises the following steps: receiving a second negotiation data packet sent by the PCIE data link opposite end; wherein the second negotiation data packet carries reserved sizes of each header field of a TLP data packet of the PCIE data link opposite end; determining an initial credit number of the PCIE data link local end based on the reserved sizes of each header field of the TLP data packet of the PCIE data link opposite end in the second negotiation data packet, and switching to an initialization state of the initialization stage of the data link layer; in the initialization state, sending a traffic control DLLP corresponding to a TLP data packet of different types to the PCIE data link opposite end based on the initial credit number.

4. The initialization method of flow control according to claim 3, characterized in that, The reserved sizes of each header field of the TLP data packet of the PCIE data link opposite end in the second negotiation data packet comprise a first reserved size of a header basic field, a second reserved size of a header OHC field and a third reserved size of a tail field of a header; and the determination of the initial credit number of the PCIE data link local end based on the reserved sizes of each header field of the TLP data packet of the PCIE data link opposite end in the second negotiation data packet comprises the following steps: calculating a header size of the TLP data packet of the PCIE data link opposite end based on the first reserved size of the header basic field, the second reserved size of the header OHC field and the third reserved size of the tail field of the header of the TLP data packet of the PCIE data link opposite end; determining the initial credit number based on the header size of the TLP data packet of the PCIE data link opposite end, a size of other fields and a receiving data buffer size of the PCIE data link local end.

5. The initialization method of flow control according to any one of claims 1, 2, 4, characterized by, The method further comprises the following steps: In the negotiation state, if a flow control DLLP sent by the peer end of the PCIE data link in an initialization state of an initialization phase of the data link layer is received, the initialization state of the initialization phase of the data link layer is directly switched to; In the initialization state, flow control DLLPs corresponding to different types of TLP data packets are sent to the peer end of the PCIE data link based on a default credit number.

6. An initialization device for flow control, characterized by The device is applied to a Flit-Mode mode of a local end of a PCIE data link, and includes: A response unit is configured to switch to a negotiation state in response to entering an initialization phase of a data link layer; An acquisition unit is configured to acquire reserved sizes of each header field of a TLP data packet in the negotiation state; A generation unit is configured to generate a first negotiation data packet based on the reserved sizes of each header field; A first sending unit is configured to send the first negotiation data packet to a peer end of a PCIE data link, so that the peer end of the PCIE data link determines an initial credit number of the peer end of the PCIE data link according to the reserved sizes of each header field carried in the first negotiation data packet.

7. The flow control initialization apparatus of claim 6, wherein The acquisition unit includes: A first determination subunit is configured to determine a first reserved size of a header basic field of a TLP data packet based on whether a newly-added message type of Flit-Mode in the TLP data packet is a reserved type; A second determination subunit is configured to determine a second reserved size of a header OHC field of the TLP data packet based on whether the TLP data packet supports an OHC-E type; A third determination subunit is configured to determine a third reserved size of a header tail field of the TLP data packet based on whether the header tail field of the TLP data packet supports ECRC and IDE MAC.

8. The initialization device for flow control according to claim 6 or 7, characterized in that The device further includes: A receiving unit is configured to receive a second negotiation data packet sent by the peer end of the PCIE data link; the second negotiation data packet carries reserved sizes of each header field of a TLP data packet of the peer end of the PCIE data link; A determination unit is configured to determine an initial credit number of a local end of the PCIE data link based on the reserved sizes of each header field of the TLP data packet of the peer end of the PCIE data link in the second negotiation data packet, and switch to an initialization state of an initialization phase of the data link layer; A second sending unit is configured to send flow control DLLPs corresponding to different types of TLP data packets to the peer end of the PCIE data link based on the initial credit number in the initialization state.

9. The flow control initialization apparatus of claim 8, wherein, The reserved sizes of each header field of the TLP data packet of the peer end of the PCIE data link in the second negotiation data packet include a first reserved size of a header basic field, a second reserved size of a header OHC field, and a third reserved size of a header tail field; and the determination unit includes: The computing subunit is configured to compute a header size of the TLP data packet of the peer end of the PCIE data link based on a first reserved size of a header field of the TLP data packet of the peer end of the PCIE data link, a second reserved size of an OHC field of the header field, and a third reserved size of a tail field of the header field. The fourth determining subunit is configured to determine the initial credit number based on the header size of the TLP data packet of the peer end of the PCIE data link, a size of other fields, and a size of a receiving data buffer of the local end of the PCIE data link.

10. The initialization means for flow control according to any one of claims 6, 7, 9, characterized by, The device further comprises: The switching unit is configured to, in the negotiation state, directly switch to an initialization state of the initialization phase of the data link layer if a flow control DLLP sent by the peer end of the PCIE data link in the initialization state of the initialization phase of the data link layer is received. The third sending unit is configured to send, in the initialization state, the flow control DLLP corresponding to different types of TLP data packets to the peer end of the PCIE data link based on a default credit number.

Citation Information

Patent Citations

  • Flow control credit updates for virtual channels in the advanced switching (as) architecture

    CN1783839A

  • Credit Management When Resource Granularity is Larger than Credit Granularity

    US20100165842A1