Method and device for realizing cache sharing between lossless network ports

By dividing the cache space in the receiving side device and calculating the credit value, the problems of credit callback, buffer overflow and message loss in cache sharing between ports are solved, and efficient cache sharing and lossless data transmission are achieved.

CN119363827AActive Publication Date: 2025-01-24WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD

Patent Information

Application Number
CN202411473567.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-01-24
Estimated Expiration
2044-10-21

AI Technical Summary

Technical Problem

In the fields of high-performance computing and data centers, there are problems such as credit callbacks, cache overflows and packet loss in data exchange between node devices, resulting in system performance being affected.

Method used

By dividing the total cache space of the receiving side device into port private space and multi-port shared space, and setting the upper limit of the shared space that can be used by each port, the credit value is calculated and fed back to the sending side device, and data messages are sent based on the credit value. Transmit, and perform retransmission verification and cache space judgment on the receiving side to decide whether to store or discard the data message.

Benefits of technology

Without increasing the cache space, the available cache space of each port is increased, the cache utilization is improved, the service quality is ensured, and cache sharing and lossless transmission between ports are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363827A_ABST
    Figure CN119363827A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for realizing cache sharing among lossless network ports, and the method comprises the steps: dividing a receiving side total cache space into a port private space and a multi-port shared space, and setting an upper limit value of the shared space which can be used by each port; based on the port private space residual value and the corrected shared subspace residual value, calculating a credit value representing the corrected total residual space of the port of the side, and feeding back the credit value to the sending side; initiating data message transmission when the sending side equipment meets a preset message sending condition based on the credit value; when the port of the receiving side receives the data message, retransmission verification is carried out, whether the residual cache space is sufficient or not is judged, the message is stored or discarded, an ACK / NAK / CNAK response is triggered, and the response is sent to the sending side equipment; and when the sending side equipment receives the response, analyzing the message serial number in the response and executing retransmission operation or releasing the message retransmission cache space. According to the scheme, the cache utilization rate is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data exchange, and in particular relates to a method and device for implementing lossless cache sharing between network ports. Background Art

[0002] In the fields of high-performance computing and data centers, large amounts of data need to be frequently exchanged between node devices. The efficiency and correctness of these data exchanges directly affect the performance and stability of the switching network. Any loss of data packets will seriously affect system performance and may even lead to the failure of application tasks. With the continuous development of fields such as cloud computing and big data analysis, ensuring the losslessness of data during transmission has become one of the important considerations in network design.

[0003] Lossless transmission means that data packets will not be lost or damaged during data transmission. Mainstream network switching protocols such as PCIE, InfiniBand, and Ethernet use a variety of technologies to ensure the reliability and integrity of data transmission under high-load network communications. Summary of the invention

[0004] The purpose of the present application is to provide a method and device for implementing lossless network port-to-port cache sharing, aiming to solve the problems of credit callback, cache overflow, and message loss in port-to-port cache sharing.

[0005] According to a first aspect of the present application, a method for implementing lossless inter-port cache sharing is provided, comprising:

[0006] Divide the total cache space of the receiving side device into port private space and multi-port shared space, and set the upper limit of the shared space that can be used by each port;

[0007] Based on the remaining private space value of the port of the receiving side device and the corrected remaining shared space value, a credit value representing the corrected total remaining space information of the port on the local side is calculated, and the credit value is fed back to the connected sending side device;

[0008] Based on the credit value, when the sending side device meets the preset message sending condition, initiating data message transmission;

[0009] When the port of the receiving side device receives the data message from the sending side device, a retransmission check is performed, and whether the remaining buffer space is sufficient to store the data message is determined, and according to the retransmission check and the remaining buffer space determination results, the data message is stored or discarded, a corresponding type of response is triggered, and the response is sent to the sending side device;

[0010] When the sending side device receives the response from the receiving side device, it parses the message sequence number in the response, and performs corresponding retransmission operations or releases message retransmission buffer space according to different response types.

[0011] In an optional implementation, a private cache space is allocated to each port, and each private cache space is only used to store data packets of the corresponding port; a total shared cache space is allocated, which can be used to store data packets of all ports; a shared sub-cache space is allocated to each port, and the size of the shared sub-cache space is the upper limit value of the shared cache space that can be used by the port.

[0012] In an optional implementation manner, for any port of the receiving side device, the corrected shared space remaining value is a smaller value between a shared subspace remaining value of the port and a multi-port shared space remaining value of the receiving side device.

[0013] In an optional implementation manner, storing or discarding the data message according to the retransmission check and the remaining buffer space judgment result, triggering a corresponding type of response, further includes:

[0014] If the retransmission check passes, the data message is sent to the receiving side device buffer;

[0015] If the retransmission check fails, a NAK response containing the message sequence number PSN information is generated;

[0016] If the remaining total buffer space of the port is sufficient to store the current data message, the data message is stored and an ACK response including message sequence number information is generated;

[0017] If the remaining total buffer space of the port is insufficient to store the current data message, the data message is discarded and a CNAK response including message sequence number information is generated. The CNAK response is a NAK response that occurs when the buffer space is insufficient.

[0018] In an optional implementation, parsing the message sequence number in the response and performing corresponding retransmission operations or releasing message retransmission buffer space according to different response types further includes:

[0019] Parsing the message sequence number in the ACK response, and releasing the data message before the message sequence number in the retransmission buffer; or

[0020] Parsing the message sequence number in the NAK response, releasing the data message before the message sequence number in the retransmission buffer, and triggering the retransmission of the data message after the message sequence number in the retransmission buffer in real time; or

[0021] Parse the message sequence number in the CNAK response, release the data message before the message sequence number in the retransmission buffer, and trigger the retransmission of the data message after the message sequence number in the retransmission buffer when the credit retransmission condition is met. The CNAK response is a NAK response that occurs when the buffer space is insufficient.

[0022] In an optional implementation manner, the credit retransmission condition is:

[0023] receiving feedback of a newly added credit value from a downstream receiving device, where the newly added credit value is sufficient to receive the data message in the retransmission buffer, or

[0024] After waiting for a preset period of time, the system actively starts to try to retransmit.

[0025] According to a second aspect of the present application, a device for implementing lossless inter-port cache sharing is provided, comprising:

[0026] The space division unit is used to divide the total cache space of the receiving side device into a port private space and a multi-port shared space, and set an upper limit value of the shared space that can be used by each port;

[0027] a credit calculation unit, configured to calculate a credit value representing the corrected total remaining space information of the port on the receiving side based on the remaining private space value of the port of the receiving side device and the corrected remaining shared space value, and feed the credit value back to the connected sending side device;

[0028] A message transmission unit, configured to initiate data message transmission based on the credit value when the sending side device meets a preset message sending condition;

[0029] a message processing unit, configured to perform a retransmission check when the port of the receiving side device receives a data message from the sending side device, and determine whether the remaining buffer space is sufficient to store the data message, store or discard the data message according to the retransmission check and the remaining buffer space determination results, trigger a response of a corresponding type, and send the response to the sending side device;

[0030] The response parsing unit is used to parse the message sequence number in the response when the sending side device receives the response from the receiving side device, and perform corresponding retransmission operations or release message retransmission buffer space according to different response types.

[0031] A third aspect of the present application provides an electronic device, including a processor and a memory, wherein the memory stores a plurality of instructions, and the processor is used to read the instructions and execute the method of the first aspect.

[0032] A fourth aspect of the present application provides a computer-readable storage medium, which stores a plurality of instructions, and the plurality of instructions can be read by a processor to execute the method of the first aspect.

[0033] Compared with the related art, the technical solution of this application has the following advantages:

[0034] Aiming at the problem of large port cache resource consumption and low utilization in large-scale switching chips, a port cache sharing scheme suitable for lossless networks is given, and an improved credit flow control and retransmission mechanism is proposed to solve the problems of credit callback, cache overflow, and message loss in port cache sharing in related technologies. Without increasing the cache space, the size of the available cache space of each port is increased; when the cache resources of some ports are not used or not fully used, they can be used by other ports to improve cache utilization; the cache space can be flexibly divided, and the upper limit of port private space and shared occupancy can be set to ensure service quality; the credit fallback and credit retransmission mechanism are adopted to meet the needs of cache sharing and lossless transmission between ports; it is compatible with the shared storage solution between virtual channels in the port, and can be applied to various lossless switching protocols based on credit flow control mechanism such as PCIE / InfiniBand.

[0035] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained through the structures and processes indicated in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. It is obvious that the drawings described below are certain embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0037] Figure 1 It is a schematic diagram of port sharing in a protocol according to the related art.

[0038] Figure 2 It is an overall implementation block diagram of a method for implementing lossless inter-network port cache sharing in an exemplary embodiment of the present application.

[0039] Figure 3 It is a flowchart of a method for implementing lossless cache sharing between network ports according to an exemplary embodiment of the present application.

[0040] Figure 4 It is a schematic diagram of cache space division according to an exemplary embodiment of the present application.

[0041] Figure 5 is a flow chart of credit calculation on the sending side according to an exemplary embodiment of the present application.

[0042] Figure 6 It is a flow chart of ACK / NAK / CNAK response of a receiving side port according to an exemplary embodiment of the present application.

[0043] Figure 7 It is a flow chart of ACK / NAK / CNAK response of a sending-side device according to an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0045] PCIE and InfiniBand use a credit-based flow control mechanism (CBPC). When the remaining cache space on the receiving side is increased, the receiving side device will feedback the credit value reflecting the remaining cache space information on the sending side to the sending side device; the sending side device calculates the remaining cache space size on the downstream receiving side based on the credit, and initiates data transmission when the cache space of the downstream receiving side device is sufficient. The credit-based flow control mechanism is an efficient and lossless flow control solution that can prevent the overflow of the receiving side device cache space while transmitting data efficiently, thereby avoiding the loss of data packets.

[0046] Ethernet uses a pause-based flow control mechanism or a priority-based flow control mechanism PFC (Priority-based Flow Control). When the receiving cache queue or a certain priority receiving cache queue exceeds the preset threshold value, the receiving device sends a special pause frame (Pause Frame) to the sending device; after receiving the pause frame, the sending device stops sending data or stops sending data of the corresponding priority for a period of time to ensure that the receiving device has enough time to process the received data packets. This flow control mechanism is simple and easy to implement, and it prevents the receiving end cache space from overflowing and avoids the loss of data packets as much as possible.

[0047] PCIE, InfiniBand and TCP protocols define selective retransmission based on Go-Back-N and reliable transmission mechanisms based on Automatic Repeat Request (ARQ) respectively. When data packets are lost due to packet sequence number (PSN) check failure or damaged due to data integrity check (such as CRC check) failure during transmission, the retransmission mechanism will resend the affected data packets when the above data anomalies are detected, ultimately achieving no loss or damage to data packets during transmission, thus improving the reliability and integrity of data transmission.

[0048] The lossless transmission protocols such as PCIE and InfiniBand support virtual channel (VC) technology, that is, multiple virtual and mutually isolated logical links (logic links) are implemented on a physical link (physical link); logical links share physical links in a time-division multiplexing manner to solve the mutual interference problem caused by different service levels (Traffic Class, TC) messages in the network due to sharing physical links. In addition, the shared cache mechanism between virtual channels is defined in protocols such as PCIE6.0, allowing each virtual channel on the receiving side to share cache resources, which can better utilize cache resources, more flexibly manage and schedule data flows, thereby improving the performance and reliability of the entire system.

[0049] However, in the traditional lossless transmission protocol based on the credit mechanism, the cache space of each port of the receiving device is independent, and the cache sharing between ports is not supported. If the cache between the receiving ports is shared, there is a situation where the shared cache credit fed back by one port is used by another port, resulting in unexpected credit callback, cache overflow, and message loss. Figure 1 As shown, the total cache space of the receiving side device is divided into the private space and shared space of each port PORT0~PORTz of the device; when the private space of the port is used up, the ports PORT0 and PORTz respectively feedback the credit value n reflecting the remaining shared cache space information to the connected sending side device a and the sending side device b; subsequently, the sending side device a and the sending side device b respectively send data packets pkt a and pkt b to the receiving side device according to the credit value n; the data packets pkt a and pkt b arrive at the receiving side device successively, and after passing the retransmission check of the corresponding port, the remaining shared cache space is used for storage; when the data packet pkt a is stored in the shared cache space before the data packet pkt b, the following exceptions exist for the port PORT0:

[0050] First, PORT0 previously fed back credit n; after the data packet pkt a received by PORTz is stored in the shared cache, the available remaining shared space decreases; accordingly, the current credit value decreases from n to n-1, that is, the credit value becomes smaller than the previous feedback value;

[0051] Secondly, the sending device b determines that the remaining cache space of the connected receiving port PORT0 is sufficient based on the credit mechanism, and sends the data packet pkt b; however, after the data packet pkt a from the sending device a is stored in the shared cache, the remaining available shared space decreases; when the remaining shared space is insufficient to store the data packet pkt b, a credit anomaly, cache overflow, and packet discard will occur, which should not occur in the credit-based flow control mechanism.

[0052] In summary, the protocols in the relevant technologies do not support cache space sharing between ports. The cache space of each port needs to be strictly independent, and the cache space of each port needs to cover the round-trip time (RTT) of credit feedback to ensure that the transmission bandwidth will not be reduced due to untimely credit updates; in large-scale switching chips, storage resources are often consumed in large quantities and the manufacturing cost is high; when a port is not enabled or the port transmission rate is low or the data volume is low, the port cache resources cannot be used by other ports, resulting in low cache resource utilization.

[0053] Based on the above analysis, the present application provides a method and device for implementing lossless network port-to-port cache sharing. Aiming at the problem of large port cache resource consumption and low utilization in large-scale switching chips, a port-to-port cache sharing scheme suitable for lossless networks is provided, and the credit flow control and retransmission mechanism are improved. First, the total cache space on the receiving side is divided into port private space and multi-port shared space, and the upper limit of the shared space that can be used by each port is set; based on the remaining value of the port private space of the receiving side device and the corrected remaining value of the shared space, the credit value representing the corrected total remaining space information of the port on this side is determined and then fed back to the connected sending side device; then, the sending side device, based on the credit value fed back by the port of the connected receiving side device, initiates data message transmission when the sending conditions are met; when the receiving port receives the above data message, after retransmission verification and judging whether the remaining cache space is sufficient, the message is stored or discarded, and the corresponding ACK / NAK / CNAK response is triggered to the sending side device; finally, the sending side device receives the ACK / NAK / CNAK response and performs corresponding retransmission, message sending cache release and other operations. Among them, ACK (Acknowledgment) is a confirmation response mechanism for data transmission commonly used in network communication, NAK (Negative Acknowledgment) is a negative response mechanism for data transmission commonly used in network communication, and CNAK (Credit Negative Acknowledgement) is a credit negative response mechanism for data transmission, indicating a negative (NAK) response that occurs when the credit is insufficient, that is, the cache space is insufficient.

[0054] like Figure 2In the implementation block diagram of the exemplary embodiment of the present application shown, the receiving side device mainly completes the following operations. First, the total buffer space on the receiving side is divided into port private space and multi-port shared space, and the upper limit value of the shared space available for each port is set; the buffer space value is maintained, including the remaining private buffer space of the port, the remaining shared buffer space of the port, and the remaining total shared buffer space of the device, and the corrected available shared buffer space of the port is determined as the smaller value of the remaining shared buffer space of the port and the remaining total shared buffer space of the device, and the corrected remaining total buffer space of the port is calculated as the sum of the remaining private buffer space of the port and the corrected available shared buffer space of the port; the inbound message is retransmitted based on the message sequence number PSN and CRC. If the retransmission check passes, the data message is sent to the receiving side device cache; if the retransmission check fails, a NAK response containing the message sequence number PSN information is generated; it is determined whether the remaining buffer space of the port is sufficient to store the current data message, and the sufficient remaining buffer space indicates that the corrected remaining total buffer space is greater than or equal to the current data message length. If the cache space is sufficient, the data message is stored and an ACK response containing the sequence number information of the current data message is generated; if the cache space is insufficient, the data message is discarded and a CNAK response containing the sequence number information of the current data message is generated.

[0055] The sending side device port mainly completes the following operations. According to the credit value fed back by the downstream device port, the downstream remaining buffer space is calculated; when the downstream remaining buffer space is sufficient, data message transmission is initiated, and the message is synchronously stored in the retransmission buffer (Retry buffer); the Go-Back-N selective retransmission mechanism is used to respond to the ACK / NAK / CNAK response of the receiving side, specifically: the PSN sequence number in the ACK response is parsed, and the data message before the sequence number in the retransmission buffer is released; the PSN sequence number in the NAK response is parsed, and the data message before the sequence number in the retransmission buffer is released, and the data message after the message sequence number in the retransmission buffer is triggered in real time to be retransmitted; the PSN sequence number in the CNAK response is parsed, and the data message before the sequence number in the retransmission buffer is released, and when the credit retransmission condition is met, the data message after the message sequence number PSN in the retransmission buffer is triggered to be retransmitted; wherein, the credit retransmission condition is specifically that feedback of the newly added credit value from the downstream receiving side is received, and the newly added credit is sufficient to receive the data message in the retransmission buffer, or after backing off and waiting for a preset time period, actively start to try to retransmit.

[0056] See also Figure 3 The exemplary flowchart of the present application includes the following steps:

[0057] Step 301: Divide the total buffer space of the receiving side device into a port private space and a multi-port shared space, and set an upper limit value of the shared space that can be used by each port.

[0058] like Figure 4 In the traditional solution (a), the buffer space of each port of the receiving side device is independent and non-overlapping. Figure 4 (b) shows an optional implementation method of the present application. During the initialization of the receiving side device, based on the total cache space size and the number of ports enabled by the device, the total cache space is divided into private cache space for each port and a total shared cache space, and an upper limit value of the shared cache space that can be used by each port is set.

[0059] The space partitioning parameters are defined as follows:

[0060]

[0061] Among them, the private cache space set for each port is only for the exclusive use of the port; it can ensure the mutual isolation of data transmission of each port to a certain extent, and ensure that when the shared space is exhausted, each port can still use the exclusive private cache space for data message transmission, thereby ensuring the minimum bandwidth of each port.

[0062] In a preferred embodiment, the size of the private buffer space of each port should not be less than the length of the largest data message MTU (Max Transmission Unit) in the network.

[0063] The purpose of setting the upper limit of the shared cache space that can be used by each port is to avoid that when there is resource contention between ports, some ports consume excessive shared cache space, and other ports cannot use the shared cache space, causing data transmission congestion.

[0064] Exemplarily, the following constraints are set for the above parameters:

[0065] 1) Total cache space size = the sum of the private cache space sizes of each port + the total shared cache space size:

[0066] Total_Size=∑Dedicated_Size[n]+Global_Shared_Size;

[0067] 2) The upper limit of the shared cache space that can be used by port PORT n cannot exceed the total shared cache space size:

[0068] Shared_Limit[n]≤Global_Shared_Size;

[0069] 3) The sum of the upper limits of the shared cache space available to each port should be greater than or equal to the total shared cache space size to ensure that each virtual channel can use more shared space when the total storage space is limited:

[0070] ∑Shared_Limit[n]≥Global_Shared_Size.

[0071] Step 302: Based on the remaining private space value of the port of the receiving side device and the corrected remaining shared space value, a credit value representing the corrected total remaining space information of the port on this side is calculated, and the credit value is fed back to the connected sending side device.

[0072] The parameters related to the remaining space and credit maintenance of each port of the receiving device are as follows:

[0073]

[0074]

[0075]

[0076] For example, the remaining space and credit calculation process of each port on the receiving side is as follows: Figure 5 As shown:

[0077] Exemplarily, when the private space remaining value FS_Dedicated[n] of port n and the shared subspace remaining value FS_Shared[n] of receiving side port n are calculated based on the total cache space remaining value FS[n] of the port, the present application provides two different cache consumption and recovery strategies, and the implementation strategy can be selected according to the needs of the usage scenario.

[0078] Strategy 1: Prioritize the use of private cache and optimize the recovery of shared cache:

[0079] When FS[n]≥Shared_Limit[n]:

[0080] FS_Shared[n]=Shared_Limit[n];

[0081] FS_Dedicated[n]=FS[n]-FS_Shared[n];

[0082] Otherwise (FS[n]<Shared_Limit[n]):

[0083] FS_Shared[n] = FS[n];

[0084] FS_Dedicated[n]=0.

[0085] Strategy 2: Prioritize the use of shared cache and restore private cache:

[0086] When FS[n]≥Dedicated_Size[n]:

[0087] FS_Shared[n] = FS[n] - Dedicated_Size[n];

[0088] FS_Dedicated[n] = Dedicated_Size[n];

[0089] Otherwise (when FS[n] < Dedicated_Size[n]):

[0090] FS_Shared[n] = 0;

[0091] FS_Dedicated[n] = FS[n].

[0092] In view of the problems of credit anomaly and packet overflow and loss caused by the shared cache credit feedback from one port being used by another port in the traditional port - shared cache scheme, this application improves the flow control mechanism that can correct the remaining space and implement credit rollback.

[0093] Among them, the corrected remaining value AFS_Shared[n] of the shared subspace of port PORT n takes the smaller value between the remaining value FS_Shared[n] of the shared subspace of this port and the remaining value FS_Global_Shared of the multi - port shared space of the receiving - side device.

[0094] If the shared cache space credit feedback previously sent has been preempted by other ports, although the remaining value FS_Shared[n] of the shared subspace of this local port remains unchanged, the remaining value FS_Global_Shared of the multi - port shared space of the receiving - side device will decrease; correspondingly, the corrected remaining value AFS_Shared[n] of this port will decrease compared with the previous feedback. After this local port feeds back the credit to the sending - side device again, the callback of the previous feedback credit and the remaining space can be realized.

[0095] After the receiving - side port completes the above credit calculation, this local port feeds back the credit to the sending - side device, and the receiving - side device uses a specific flow control packet (FCP) to feed back the credit information of this local port to the sending - side device.

[0096] Exemplarily, the credit information can be fed back to the sending - side device when one of the following conditions is met:

[0097] 1) The receiving - side port maintains a timer and triggers credit feedback after timeout;

[0098] 2) Feed back when the newly added credit exceeds a preset threshold;

[0099] 3) Feed back during credit callback.

[0100] Step 303: Based on the credit value, when the sending side device meets the preset message sending condition, initiate data message transmission.

[0101] Based on the credit value CL fed back by the receiving port, the sending device can calculate the total downstream remaining space FS. The main parameters maintained by the receiving side are:

[0102]

[0103]

[0104] Preferably, the preset message sending condition is:

[0105] The total remaining buffer space value of the port of the downstream receiving device is greater than or equal to the length of the data packet DP (DataPacket) to be sent, that is:

[0106] FS≥DP.Packet Length.

[0107] As an optional embodiment, the inter-port cache sharing, flow control, and retransmission mechanism of the present application can be used in a traditional protocol switching network using an exclusive cache or a shared cache of a virtual channel within a port. In this case, the message sending conditions are:

[0108] 1) meet the virtual channel message sending conditions in the traditional protocol; and

[0109] 2) The above preset message sending conditions are met at the same time.

[0110] Step 304: When the port of the receiving side device receives the data packet from the sending side device, a retransmission check is performed, and it is determined whether the remaining cache space is sufficient to store the data packet. The data packet is stored or discarded based on the retransmission check and the judgment result, a response of the corresponding type is triggered, and the response is sent to the sending side device.

[0111] Exemplarily, the retransmission check is to perform a message transmission sequence check based on a message sequence number PSN and a data integrity check based on CRC when the receiving side port receives a data message from the sending side.

[0112] Exemplarily, the determination of whether the remaining buffer space is sufficient includes comparing the total remaining space value AFS of the port maintained by the local side after correction and the packet length Packet Length of the received data packet DP. When AFS≥DP.PacketLength, the remaining space is sufficient; otherwise, the remaining space is insufficient.

[0113] like Figure 6As shown, exemplarily, after the above retransmission check and judging whether the remaining buffer space is sufficient, it is determined that the received message should be stored in the buffer space of the receiving side device or discarded, and the corresponding ACK / NAK / CNAK response is triggered.

[0114] Verify the message sequence number PSN and CRC of the inbound message. If the verification passes, the data message is sent to the receiving device buffer; if the retransmission verification fails, a NAK response containing the message sequence number PSN information is generated;

[0115] Determine whether the corrected remaining total buffer space value AFS of the port is sufficient to store the current data message. The remaining total buffer space is sufficient, which means that the remaining buffer space is greater than or equal to the message length. If the buffer space is sufficient, the message is stored in the receiving buffer, and an ACK response containing the message sequence number information is generated; if the buffer space is insufficient, the data message is discarded, and a CNAK response containing the message sequence number information is generated. The CNAK response is a NAK response that occurs when the buffer space is insufficient.

[0116] The ACK / NAK / CNAK response of the receiving side port is sent to the upstream sending side device through a specific link message.

[0117] In addition, the present application solution is compatible with traditional devices that do not support port cache sharing. When it is determined that the connected device does not support port cache sharing, the CNAK response in the present application can be sent in the form of a NAK response to achieve compatibility. Optionally, whether the connected device supports port cache sharing can be determined by the network manager configuration to inform the receiving side device or feature negotiation during network initialization.

[0118] Step 305: When the sending side device receives the response from the receiving side device, it parses the message sequence number in the response, and performs corresponding retransmission operations or releases message retransmission buffer space according to different response types.

[0119] like Figure 7 As shown, illustratively, when the sending side device receives an ACK / NAK / CNAK response from the receiving side, it responds as follows:

[0120] For ACK response: parse the PSN sequence number in the ACK response and release the data packets before the sequence number in the retransmission buffer;

[0121] For NAK response: parse the PSN sequence number in the NAK response, release the data packets before the sequence number in the retransmission buffer, and trigger the retransmission of the data packets after the sequence number in the retransmission buffer in real time;

[0122] For CNAK response: parse the PSN sequence number in the CNAK response, release the data packets before the sequence number in the retransmission buffer, and retransmit the data packets after the message sequence number PSN in the retransmission buffer when the credit retransmission condition is met.

[0123] The credit retransmission conditions are specifically:

[0124] Receive feedback from the downstream receiving side that the newly added credit value is sufficient to receive the data message in the retransmission buffer; or actively start to try to retransmit after backing off and waiting for a preset time period. This application adopts the Go-Back-N selective retransmission mechanism.

[0125] It can be seen that the implementation method of lossless network port cache sharing provided by the present application has the following advantages compared with the related technologies:

[0126] Aiming at the problem of large consumption and low utilization of port cache resources in large-scale switching chips, a port cache sharing scheme suitable for lossless networks is given, and an improved credit flow control and retransmission mechanism is proposed to solve the problems of credit callback, cache overflow and message loss in port cache sharing in related technologies. Without increasing the cache space, the available cache space of each port is increased; when the cache resources of some ports are not used or not fully used, they can be used by other ports to improve cache utilization; the cache space can be flexibly divided, and the upper limit of port private space and shared occupancy can be set to ensure service quality; the credit fallback and credit retransmission mechanism are adopted to meet the needs of cache sharing and lossless transmission between ports; it is compatible with the shared storage solution between virtual channels in the port, and can be applied to various lossless switching protocols based on credit flow control mechanism such as PCIE / InfiniBand.

[0127] Accordingly, the present application provides, in a second aspect, a device for implementing lossless inter-network port cache sharing, comprising:

[0128] The space division unit is used to divide the total cache space of the receiving side device into a port private space and a multi-port shared space, and set an upper limit value of the shared space that can be used by each port;

[0129] a credit calculation unit, configured to calculate a credit value representing the corrected total remaining space information of the port on the receiving side based on the remaining private space value of the port of the receiving side device and the corrected remaining shared space value, and feed the credit value back to the connected sending side device;

[0130] A message transmission unit, configured to initiate data message transmission based on the credit value when the sending side device meets a preset message sending condition;

[0131] a message processing unit, configured to perform a retransmission check when the port of the receiving side device receives a data message from the sending side device, and determine whether the remaining buffer space is sufficient to store the data message, store or discard the data message according to the retransmission check and the remaining buffer space determination results, trigger a response of a corresponding type, and send the response to the sending side device;

[0132] The response parsing unit is used to parse the message sequence number in the response when the sending side device receives the response from the receiving side device, and perform corresponding retransmission operations or release message retransmission buffer space according to different response types.

[0133] The above-mentioned device can be implemented by the implementation method of lossless network port cache sharing provided by the embodiment of the first aspect above. The specific implementation method can be found in the description of the embodiment of the first aspect, which will not be repeated here.

[0134] It is understood that the circuit structures, names and parameters described in the above embodiments are only examples. Those skilled in the art can also easily combine and adjust the structural features of the above embodiments according to the use requirements, and should not limit the concept of the present application to the specific details of the above examples.

[0135] Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that he or she may still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for implementing lossless network port cache sharing, characterized in that: include: Divide the total cache space of the receiving side device into port private space and multi-port shared space, and set the upper limit of the shared space that can be used by each port; Based on the remaining private space value of the port of the receiving side device and the corrected remaining shared space value, a credit value representing the corrected total remaining space information of the port on the local side is calculated, and the credit value is fed back to the connected sending side device; Based on the credit value, when the sending side device meets the preset message sending condition, initiating data message transmission; When the port of the receiving side device receives the data message from the sending side device, a retransmission check is performed, and whether the remaining buffer space is sufficient to store the data message is determined, and according to the retransmission check and the remaining buffer space determination results, the data message is stored or discarded, a corresponding type of response is triggered, and the response is sent to the sending side device; When the sending side device receives the response from the receiving side device, it parses the message sequence number in the response, and performs corresponding retransmission operations or releases message retransmission buffer space according to different response types.

2. The method for implementing lossless network port cache sharing according to claim 1, characterized in that: The method further includes dividing the total cache space of the receiving side device into a port private space and a multi-port shared space, and setting an upper limit value of the shared space that can be used by each port, and: Allocate private cache space for each port, and each private cache space is only used to store data packets of the corresponding port; Allocate total shared cache space to store data packets from all ports; A shared sub-cache space is allocated to each port, and the size of the shared sub-cache space is the upper limit value of the shared cache space that can be used by the port.

3. The method for implementing lossless network port cache sharing according to claim 1, characterized in that: For any port of the receiving side device, the modified shared space remaining value is the smaller value between the shared subspace remaining value of the port and the multi-port shared space remaining value of the receiving side device.

4. The method for implementing lossless network port cache sharing according to claim 1, characterized in that: The storing or discarding of the data message according to the retransmission check and the remaining buffer space judgment result, triggering a corresponding type of response, further includes: If the retransmission check passes, the data message is sent to the receiving side device buffer; If the retransmission check fails, a NAK response containing the message sequence number PSN information is generated; If the remaining total buffer space of the port is sufficient to store the current data message, the data message is stored and an ACK response including message sequence number information is generated; If the remaining total buffer space of the port is insufficient to store the current data message, the data message is discarded and a CNAK response including message sequence number information is generated. The CNAK response is a NAK response that occurs when the buffer space is insufficient.

5. The method for implementing lossless network port cache sharing according to claim 1, characterized in that: The parsing of the message sequence number in the response and performing corresponding retransmission operations or releasing message retransmission buffer space according to different response types further includes: Parsing the message sequence number in the ACK response, and releasing the data message before the message sequence number in the retransmission buffer; or Parsing the message sequence number in the NAK response, releasing the data message before the message sequence number in the retransmission buffer, and triggering the retransmission of the data message after the message sequence number in the retransmission buffer in real time; or Parse the message sequence number in the CNAK response, release the data message before the message sequence number in the retransmission buffer, and trigger the retransmission of the data message after the message sequence number in the retransmission buffer when the credit retransmission condition is met. The CNAK response is a NAK response that occurs when the buffer space is insufficient.

6. The method for implementing lossless network port cache sharing according to claim 5, characterized in that: The credit retransmission condition is: receiving feedback of a newly added credit value from a downstream receiving device, where the newly added credit value is sufficient to receive the data message in the retransmission buffer, or After waiting for a preset period of time, the system actively starts to try to retransmit.

7. A device for implementing lossless network port cache sharing, characterized in that: include: The space division unit is used to divide the total cache space of the receiving side device into a port private space and a multi-port shared space, and set an upper limit value of the shared space that can be used by each port; a credit calculation unit, configured to calculate a credit value representing the corrected total remaining space information of the port on the receiving side based on the remaining private space value of the port of the receiving side device and the corrected remaining shared space value, and feed the credit value back to the connected sending side device; A message transmission unit, configured to initiate data message transmission based on the credit value when the sending side device meets a preset message sending condition; a message processing unit, configured to perform a retransmission check when the port of the receiving side device receives a data message from the sending side device, and determine whether the remaining buffer space is sufficient to store the data message, store or discard the data message according to the retransmission check and the remaining buffer space determination results, trigger a response of a corresponding type, and send the response to the sending side device; The response parsing unit is used to parse the message sequence number in the response when the sending side device receives the response from the receiving side device, and perform corresponding retransmission operations or release message retransmission buffer space according to different response types.

8. The device for implementing lossless network port cache sharing according to claim 7, characterized in that: The space division unit is further used for: A private cache space is allocated to each port, and each private cache space is only used to store data packets of the corresponding port; a total shared cache space is allocated, which can be used to store data packets of all ports; a shared sub-cache space is allocated to each port, and the size of the shared sub-cache space is the upper limit of the shared cache space that can be used by the port.

9. The device for implementing lossless network port cache sharing according to claim 7, characterized in that: For any port of the receiving side device, the modified shared space remaining value is the smaller value between the shared subspace remaining value of the port and the multi-port shared space remaining value of the receiving side device.

10. The device for implementing lossless network port cache sharing according to claim 7, characterized in that: The message processing unit is further used for: If the retransmission check passes, the data message is sent to the receiving side device buffer; If the retransmission check fails, a NAK response containing the message sequence number PSN information is generated; If the remaining total buffer space of the port is sufficient to store the current data message, the data message is stored and an ACK response including message sequence number information is generated; If the remaining total buffer space of the port is insufficient to store the current data message, the data message is discarded and a CNAK response including message sequence number information is generated. The CNAK response is a NAK response that occurs when the buffer space is insufficient.

11. The device for implementing lossless network port cache sharing according to claim 7, characterized in that: The response parsing unit is further used for: Parsing the message sequence number in the ACK response, and releasing the data message before the message sequence number in the retransmission buffer; or Parsing the message sequence number in the NAK response, releasing the data message before the message sequence number in the retransmission buffer, and triggering the retransmission of the data message after the message sequence number in the retransmission buffer in real time; or Parse the message sequence number in the CNAK response, release the data message before the message sequence number in the retransmission buffer, and trigger the retransmission of the data message after the message sequence number in the retransmission buffer when the credit retransmission condition is met. The CNAK response is a NAK response that occurs when the buffer space is insufficient.

12. The device for implementing lossless network port cache sharing according to claim 11, characterized in that: The credit retransmission condition is: receiving feedback of a newly added credit value from a downstream receiving device, where the newly added credit value is sufficient to receive the data message in the retransmission buffer, or After waiting for a preset period of time, the system actively starts to try to retransmit.

Citation Information

Patent Citations

  • Fluid control method and device based on tokens

    CN104780118A

  • Message processing method and device, communication equipment and switching circuit

    CN110830382A

  • Cache allocation method, device and equipment

    CN115051958A

  • Dynamic clearance cache management method and device for PFC (Power Factor Correction) switch

    CN116896534A

Cited By

  • Data caching method and device, electronic equipment, storage medium and program product

    CN121116613A

  • Data processing method and device, computer equipment, storage medium and program product

    CN121187991A

  • Virtual channel shared cache management method

    CN121357096A

  • Credit management method and device of data packet, board card, medium and product

    CN121691457A

  • End-taste-known shared cache priority allocation method and device and switch chip

    CN122395164A