A method and apparatus for lossless inter-network port cache sharing

By dividing the buffer space of the receiving device into port-private and shared spaces, and adopting a credit calculation and retransmission mechanism, the problems of credit callback and buffer overflow in port-to-port buffer sharing are solved, thus achieving efficient buffer utilization and transmission in lossless networks.

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

Patent Information

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

AI Technical Summary

Technical Problem

In existing technologies, port-to-port cache sharing suffers from issues such as credit callbacks, cache overflows, and packet loss, resulting in high port cache resource consumption and low utilization, which fails to meet the transmission requirements of lossless networks.

Method used

The total buffer space of the receiving device is divided into port-private space and multi-port shared space, and an upper limit value of the shared space that each port can use is set. Through credit calculation and retransmission mechanism, flexible sharing and lossless transmission of buffers between ports are realized.

Benefits of technology

Without increasing the cache space, the available cache space of the port is increased, the cache utilization rate is improved, the service quality is guaranteed, and it is compatible with multiple lossless switching protocols, meeting the lossless transmission requirements of cache sharing between ports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363827B_ABST
    Figure CN119363827B_ABST
Patent Text Reader

Abstract

The application provides an implementation method and device of lossless network port-to-port cache sharing, divides total cache space on the receiving side into port private space and multi-port shared space, sets an upper limit value of the shared space available to each port, calculates a credit value representing the total remaining space of the port after correction on the sending side based on the remaining value of the port private space and the remaining value of the corrected shared sub-space, feeds back to the sending side, initiates data packet transmission when the sending side device satisfies a preset packet sending condition based on the credit value, performs retransmission checking when the port on the receiving side receives a data packet, judges whether the remaining cache space is sufficient, stores or discards the packet, triggers an ACK / NAK / CNAK response, and sends the response to the sending side device, analyzes the packet sequence number in the response when the sending side device receives the response, and performs a retransmission operation or releases the packet retransmission cache space. The scheme of the application improves the cache utilization rate.
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 particularly relates to an implementation method and device for lossless cache sharing between network ports. BACKGROUND

[0002] In the fields of high-performance computing, data centers, etc., a large amount of data needs to be frequently exchanged between node devices, and the efficiency and correctness of the data exchange directly affect the performance and stability of the exchange network. Any loss of data packets will seriously affect the system performance and may even cause the failure of an application task. With the continuous development of cloud computing and big data analysis, ensuring lossless data transmission has become one of the important factors in network design.

[0003] Lossless transmission refers to that no data packet is lost or damaged in the data transmission process. The mainstream network exchange protocols such as PCIE, InfiniBand and Ethernet adopt various technologies to ensure the reliability and data integrity of data transmission under high-load network communication. SUMMARY

[0004] The present application aims to provide an implementation method and device for lossless cache sharing between network ports, and aims to solve the problems of credit callback, cache overflow and packet loss in cache sharing between ports.

[0005] According to a first aspect of the present application, an implementation method for lossless cache sharing between network ports is provided, comprising:

[0006] dividing the total cache space of a receiving side device into a port private space and a multi-port shared space, and setting an upper limit value of the shared space available to each port;

[0007] based on the port private space remaining value and the corrected shared space remaining value of the receiving side device, calculating a credit value representing the total remaining space information of the port after correction, and feeding back the credit value to a connected sending side device;

[0008] based on the credit value, initiating data packet transmission when the sending side device meets a preset packet sending condition;

[0009] when the port of the receiving side device receives a data packet from the sending side device, performing retransmission verification, and judging whether the remaining cache space is sufficient to store the data packet, storing or discarding the data packet according to the retransmission verification and the remaining cache space judgment result, triggering a response of a corresponding type, and sending the response to the sending side device;

[0010] When the sending side device receives the response from the receiving side device, the packet sequence number in the response is parsed, and corresponding retransmission operation or release of packet retransmission buffer space is performed according to different response types.

[0011] In an optional embodiment, private buffer spaces are allocated for respective ports, each of which is used only for storing data packets of the corresponding port; a total shared buffer space is allocated, which can be used for storing data packets of all ports; shared sub-buffer spaces are allocated for respective ports, and the size of each shared sub-buffer space is an upper limit of the shared buffer space available to the port.

[0012] In an optional embodiment, for any port of the receiving side device, the modified shared space remaining value is the smaller one of the shared sub-buffer space remaining value of the port and the multi-port shared space remaining value of the receiving side device.

[0013] In an optional embodiment, the storing or discarding of the data packet according to the retransmission check and remaining buffer space judgment result, and triggering of the corresponding type of response further comprises:

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

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

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

[0017] If the port remaining total buffer space is insufficient to store the current data packet, the data packet is discarded, and a CNAK response containing packet sequence number information is generated, which is a NAK response in the case of insufficient buffer space.

[0018] In an optional embodiment, the parsing of the packet sequence number in the response, and the performance of corresponding retransmission operation or release of packet retransmission buffer space according to different response types further comprises:

[0019] The packet sequence number in the ACK response is parsed, and data packets before the packet sequence number in the retransmission buffer are released; or

[0020] The packet sequence number in the NAK response is parsed, data packets before the packet sequence number in the retransmission buffer are released, and real-time triggering of retransmission of data packets after the packet sequence number in the retransmission buffer is performed; or

[0021] The message sequence number in the CNAK response is parsed, data messages before the message sequence number in the retransmission cache are released, and when a credit retransmission condition is met, retransmission of data messages after the message sequence number in the retransmission cache is triggered, the CNAK response being a NAK response that occurs when buffer space is insufficient.

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

[0023] feedback of an added credit value of the downstream receiving-side device is received, the added credit value being sufficient to receive data messages in the retransmission cache, or

[0024] after a preset time period of backoff waiting, actively starting to attempt retransmission.

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

[0026] a space division unit configured to divide total cache space of a receiving-side device into port private space and multi-port shared space, and set an upper limit value of shared space available to each port;

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

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

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

[0030] a response analysis unit configured to parse a message sequence number in a response when a sending-side device receives a response from a receiving-side device, and perform a corresponding retransmission operation or release a message retransmission cache space according to different response types.

[0031] The third aspect of the present application provides an electronic device comprising a processor and a memory, the memory storing a plurality of instructions, and the processor being configured to read the instructions and execute the method of the first aspect.

[0032] A fourth aspect of this application provides a computer-readable storage medium storing a plurality of instructions that can be read by a processor and used to execute the method described in the first aspect.

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

[0034] To address the issues of high port buffer resource consumption and low utilization in large-scale switching chips, a port-to-port buffer sharing scheme suitable for lossless networks is presented. An improved credit flow control and retransmission mechanism is also proposed to solve the problems of credit callback, buffer overflow, and packet loss in port-to-port buffer sharing in related technologies. This approach increases the available buffer space on each port without increasing the overall buffer space. When some port buffer resources are unused or underutilized, they can be made available to other ports, improving buffer utilization. The buffer space can be flexibly partitioned, with the ability to set private space for ports and shared occupancy limits to ensure quality of service. Credit rollback and credit retransmission mechanisms are employed to meet the requirements of port-to-port buffer sharing and lossless transmission. It is compatible with shared storage schemes between virtual channels within ports and is applicable to various lossless switching protocols based on credit flow control mechanisms, such as PCIe / InfiniBand.

[0035] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures and processes shown in the description and the accompanying drawings. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] Figure 1 This is a diagram illustrating port sharing according to the relevant technology protocol.

[0038] Figure 2 This is an overall implementation block diagram of the lossless network port cache sharing implementation method of the exemplary embodiment of this application.

[0039] Figure 3 This is a flowchart of a method for implementing lossless network port cache sharing according to an exemplary embodiment of this application.

[0040] Figure 4 This is a schematic diagram of cache space partitioning according to an exemplary embodiment of this application.

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

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

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

[0044] 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 described clearly and completely 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 work fall within the protection scope of the present application.

[0045] PCIE and InfiniBand adopt a credit-based flow control mechanism (CBPC). When the remaining buffer space on the receiving side device is increased, the receiving side device feeds back a credit value reflecting the remaining buffer space information on the receiving side device to the sending side device. The sending side device calculates the size of the remaining buffer space on the downstream receiving side device based on the credit value, and initiates data transmission when the buffer space on the downstream receiving side device is sufficient. The credit-based flow control mechanism is an efficient and lossless flow control scheme, which can prevent the buffer space on the receiving side device from overflowing while efficiently transmitting data, thereby avoiding loss of data packets.

[0046] Ethernet adopts a pause-based flow control mechanism or a priority-based flow control mechanism (PFC). When the receiving buffer queue or a receiving buffer queue of a certain priority exceeds a preset threshold value, the receiving side device sends a special pause frame to the sending side device. After receiving the pause frame, the sending side device stops sending data or stops sending data of the corresponding priority for a period of time, so as to ensure that the receiving side device has sufficient time to process the received data packets. The flow control mechanism is simple and easy to implement, and can prevent the buffer space on the receiving end from overflowing and avoid loss of data packets as much as possible.

[0047] PCIE, InfiniBand and TCP protocol respectively define the selective repeat based on Go-Back-N and the reliable transmission mechanism based on Automatic Repeat request (ARQ). When there is packet loss based on packet sequence number (PSN) check failure, data damage based on data integrity check (such as CRC check) failure in the transmission process of data packet, the retransmission mechanism will resend the affected data packet when the above data anomaly is detected, and finally realize the lossless and undamaged data packet in the transmission, improve the reliability and integrity of data transmission.

[0048] The lossless transmission protocol taking PCIE and InfiniBand as an example supports virtual channel (VC, Virtual Channel) technology, that is, multiple virtual and isolated logical links are realized on a physical link (physical link); the logical link shares the physical link through time division multiplexing, solving the problem of mutual interference of different traffic class (Traffic Class, TC) packets in the network due to sharing of physical link. In addition, the sharing buffer mechanism between virtual channels is defined in PCIE6.0 and other protocols, allowing each virtual channel on the receiving side to share buffer resources, which can better utilize buffer resources and more flexibly manage and schedule data flow, thereby improving the performance and reliability of the entire system.

[0049] However, in the traditional lossless transmission protocol based on credit mechanism, the buffer space of each port of the receiving side device is independent, and inter-port buffer sharing is not supported. If the inter-port buffer of the receiving side is shared, there is a situation that the shared buffer credit feedback by a certain port is used by another port, and there are unexpected credit callback, buffer overflow and packet loss exceptions in the protocol. As shown in Figure 1 The total buffer space of the receiving side device is divided into private space and shared space of each port PORT0-PORTz of the device; when the private space of the port is used up, the port PORT0 and PORTz respectively feedback the credit value n reflecting the remaining shared buffer space information to the connected sending side device a and sending side device b; the subsequent sending side device a and 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 in turn and are stored in the remaining shared buffer space after retransmission check of the corresponding port; when the data packet pkt a is stored in the shared buffer space before the data packet pkt b, the following exceptions exist for the port PORT0:

[0050] Firstly, PORT0 feeds back the last credit n; after the datagram pkt a received by PORTz is stored in the shared buffer, the remaining shared space is reduced; accordingly, the current credit value is reduced from n to n-1, that is, the credit value is smaller than the last feedback value;

[0051] Secondly, the sending device b judges that the remaining buffer space of the connected receiving side port PORT0 is sufficient based on the credit mechanism, and sends the datagram pkt b; but after the datagram pkt a from the sending device a is stored in the shared buffer, the remaining available shared space is reduced; when the remaining shared space is insufficient to store the datagram pkt b, the credit-based flow control mechanism will not occur, and the credit exception, buffer overflow and packet discard will occur.

[0052] In summary, the protocol in the related art does not support the sharing of buffer spaces among ports, and the buffer spaces of each port need to be strictly independent, and each port buffer space needs to cover the round-trip time (RTT) of credit feedback to ensure that the transmission bandwidth will not be reduced due to the delay of credit update; in a large-scale switch chip, the storage resource consumption is large, and the manufacturing cost is high; when the port is not enabled or the transmission rate of the port is low and the data volume is low, the buffer resource of the port cannot be used by other ports, resulting in low utilization of buffer resources.

[0053] Based on the above analysis, the application provides an implementation method and device for lossless network port buffer sharing. In view of the problems of large consumption and low utilization of port buffer resources in large-scale switch chips, a port buffer sharing scheme suitable for lossless network is given, and the credit flow control and retransmission mechanism are improved. 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 to each port is set. Based on the remaining value of the port private space and the corrected remaining value of the shared space of the receiving side device, the credit value representing the corrected total remaining space information of the port on the side is fed back to the connected sending side device. Then, based on the credit value fed back by the connected receiving side device, the sending side device initiates data packet transmission when the sending condition is met. When the receiving port receives the above data packet, it stores or discards the packet after retransmission checking and judging whether the remaining buffer space is sufficient, and triggers the corresponding ACK / NAK / CNAK response to the sending side device. Finally, the sending side device receives the ACK / NAK / CNAK response and performs corresponding retransmission, packet sending buffer release and other operations. Among them, ACK (Acknowledgment) is a common data transmission confirmation response mechanism in network communication, NAK (Negative Acknowledgment) is a common data transmission negative response mechanism in network communication, and CNAK (Credit Negative Acknowledgement) is a credit negative response mechanism for data transmission, indicating a negative (NAK) response in the case of insufficient credit, i.e. insufficient buffer space.

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

[0055] The port of the sending side device mainly performs the following operations. According to the credit value fed back by the downstream device port, the downstream remaining cache space is calculated; when the downstream remaining cache space is sufficient, data packet transmission is initiated, and the packet is synchronously stored in the retry buffer; the selective retransmission mechanism of Go-Back-N is used to respond to the ACK / NAK / CNAK responses of the receiving side, specifically: the PSN sequence number in the ACK response is parsed, and the data packets before the sequence number in the retry buffer are released; the PSN sequence number in the NAK response is parsed, the data packets before the sequence number in the retry buffer are released, and the retransmission of the data packets after the sequence number in the retry buffer is triggered in real time; the PSN sequence number in the CNAK response is parsed, the data packets before the sequence number in the retry buffer are released, and when the credit retransmission condition is met, the retransmission of the data packets after the sequence number PSN in the retry buffer is triggered; wherein the credit retransmission condition is specifically that the feedback of the newly added credit value of the downstream receiving side is received, the newly added credit is sufficient to receive the data packets in the retry buffer, or after the preset time period of backoff waiting, the retransmission is actively started.

[0056] Referring to the exemplary flowchart of Figure 3 The implementation method of the lossless network port-to-port cache sharing provided by the application includes:

[0057] Step 301: dividing the total cache space of the receiving side device into port private space and multi-port shared space, and setting the upper limit value of the shared space available to each port.

[0058] As Figure 4 In the traditional scheme of (a), the buffer space of each port of the receiving side device is independent and has no overlap. Figure 4 (b) shows an optional implementation of the present application, during initialization of the receiving side device, based on the total buffer space size and the number of ports enabled by the device, the total buffer space is divided into private buffer space for each port, total shared buffer space, and the upper limit value of the shared buffer space available to each port is set.

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

[0060]

[0061] The private buffer space set for each port is exclusively used by the port; it can ensure the mutual isolation of data transmission of each port to some extent, and ensure that each port can still use the exclusive private buffer space for data packet transmission when the shared space is exhausted, and ensure the minimum bandwidth of each port.

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

[0063] The upper limit of the shared buffer space available to each port is set to avoid resource contention between ports, where some ports excessively consume shared buffer space, and other ports cannot use shared buffer space, causing data transmission congestion.

[0064] By way of example, the following constraints are set for the above parameters:

[0065] 1) The total buffer space size = the sum of the private buffer space size of each port + the total shared buffer space size:

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

[0067] 2) The upper limit value of the shared buffer space available to port PORT n cannot exceed the total shared buffer space size:

[0068] Shared_Limit[n] ≤ Global_Shared_Size;

[0069] 3) The sum of the upper limit values of the shared buffer space available to each port should be greater than or equal to the total shared buffer space size, to ensure that each virtual channel can use more shared space under the condition of limited total storage space:

[0070] ∑Shared_Limit[n] ≥ Global_Shared_Size.

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

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

[0073]

[0074]

[0075]

[0076] Exemplarily, the remaining space of each port of the receiving side, the credit calculation process is as shown in the following table: Figure 5

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

[0078] Strategy 1: Preferentially use private cache, optimize 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 (when FS[n] < Shared_Limit[n]):

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

[0084] FS_Dedicated[n] = 0.

[0085] Strategy 2: Preferentially use shared cache, preferentially recover 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] For the problem of credit exception and packet overflow loss that the shared buffer credit fed back by one port is used by another port in the traditional port shared buffer scheme, the application improves the remaining space correction and implements the credit rollback flow control mechanism.

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

[0094] If the shared buffer space credit has been fed back by the other port last time, although the shared subspace remaining value FS_Shared[n] of the local port does not change, the multi-port shared space remaining value FS_Global_Shared of the receiving side device will decrease; accordingly, the modified shared subspace remaining value AFS_Shared[n] of the port will be less than that fed back last time, and after the local port feeds back the credit to the sending side device again, the last time credit and the remaining space can be rolled back.

[0095] After the receiving side port completes the above credit calculation, the 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 the 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, which triggers credit feedback after timeout;

[0098] 2) The credit is added to the preset threshold value and is fed back;

[0099] 3) The credit is rolled back and is fed back.

[0100] Step 303: based on the credit value, initiating data packet transmission when the preset packet transmission condition is met at the sending side device.

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

[0102]

[0103]

[0104] Preferably, the preset packet transmission condition is:

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

[0106] FS≥DP.Packet Length.

[0107] As an optional embodiment, the inter-port buffer sharing and flow control and retransmission mechanism of the present application can be used in a traditional protocol exchange network using port internal virtual channel exclusive buffer or virtual channel shared buffer. At this time, the packet transmission condition is:

[0108] 1) satisfying the virtual channel packet transmission condition in the traditional protocol; and

[0109] 2) simultaneously satisfying the above-mentioned preset packet transmission condition.

[0110] Step 304: when the port of the receiving side device receives the data packet from the sending side device, performing retransmission checking and judging whether the remaining buffer space is sufficient to store the data packet, storing or discarding the data packet according to the retransmission checking and the judgment result, triggering a corresponding type of response, and sending the response to the sending side device.

[0111] Illustratively, the retransmission checking is the packet transmission order checking based on the packet sequence number PSN and the data integrity checking based on CRC when the port of the receiving side receives the data packet from the sending side.

[0112] Illustratively, the judgment of whether the remaining buffer space is sufficient includes comparing the port modified total remaining space value AFS maintained by the side and the packet length Packet Length of the received data packet DP. When AFS≥DP.Packet Length, the remaining space is sufficient; otherwise, the remaining space is insufficient.

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

[0114] The message sequence number PSN and CRC of the incoming message are checked. If the check is passed, the data message is sent to the receiving device buffer; if the retransmission check fails, a NAK response containing the message sequence number PSN information is generated;

[0115] It is judged whether the total remaining buffer space value AFS after port correction is sufficient to store the current data message. The sufficient remaining total buffer space 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 to 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 in the case of insufficient buffer space.

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

[0117] In addition, the scheme of the present application is compatible with traditional devices that do not support port buffer sharing. When it is determined that the connected device does not support port buffer sharing, the CNAK response in the present application can be sent in the form of a NAK response to achieve compatibility. Alternatively, it can be determined whether the connected device supports port buffer sharing by configuring the receiving device with the network manager at network initialization or by characteristic negotiation.

[0118] Step 305: When the sending device receives the response from the receiving device, the message sequence number in the response is parsed, and corresponding retransmission operation or release of message retransmission buffer space is performed according to different response types.

[0119] As shown, exemplary, when the sending device receives the ACK / NAK / CNAK response from the receiving side, the following responses are performed: Figure 7

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

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

[0122] ​For CNAK response: parsing the PSN sequence number in the CNAK response, releasing the data packets in the retransmission cache before the sequence number, and triggering the retransmission of the data packets after the sequence number PSN in the retransmission cache when the credit retransmission condition is met.

[0123] The credit retransmission condition is specifically:

[0124] Receiving feedback of newly added credit value on the downstream receiving side, the newly added credit is sufficient to receive the data packets in the retransmission cache; or actively starting to try retransmission after a preset period of time of backoff waiting. In the present application, the selective retransmission mechanism of Go-Back-N is adopted.

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

[0126] In view of the problems of large consumption of port cache resources and low utilization rate 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, which solves the problems of credit callback, cache overflow and packet loss in the related art of inter-port cache sharing. Without increasing the cache space, the available cache space size of each port is improved; when part of the port cache resources is not used or not fully used, it can be used by other ports, improving the cache utilization rate; the cache space can be flexibly divided, and the port private space and the upper limit of shared occupation can be set to ensure the quality of service; the credit back and credit retransmission mechanism is adopted to meet the needs of inter-port cache sharing and lossless transmission; it is compatible with the inter-virtual channel sharing storage scheme in the port, and can be applied to PCIE / InfiniBand and other lossless switching protocols based on credit flow control mechanism.

[0127] Correspondingly, the present application provides an implementation device of lossless network inter-port cache sharing in a second aspect, comprising:

[0128] a space division unit, configured 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 available to each port;

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

[0130] a packet transmission unit, configured to initiate data packet transmission when the sending side device meets a preset packet sending condition on the basis of the credit value;

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

[0132] The response analysis unit is configured to analyze the message sequence number in the response when the sending-side device receives the response from the receiving-side device, and to perform a corresponding retransmission operation or release the message retransmission buffer space according to different response types.

[0133] The above device can be implemented by the lossless inter-network port buffer sharing implementation method provided by the embodiments of the first aspect, and the specific implementation manner can be referred to the description in the embodiments of the first aspect, which will not be described here again.

[0134] 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.

[0135] Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand 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 for implementing lossless inter-port cache sharing in a network, comprising: The application comprises the following steps: Divide the total cache space of the receiving side device into port private space and multi-port shared space, and set the upper limit value of the shared space available to each port; Calculate the credit value representing the total remaining space information of the port after correction based on the remaining value of the port private space and the corrected remaining value of the shared space of the receiving side device, and feed back the credit value to the connected sending side device; Based on the credit value, initiate data packet transmission when the sending side device meets the preset packet sending condition; When the port of the receiving side device receives data packets from the sending side device, perform retransmission check, and determine whether the remaining cache space is sufficient to store the data packets, store or discard the data packets according to the retransmission check and the remaining cache space determination result, trigger the corresponding type of response, and send the response to the sending side device; When the sending side device receives the response from the receiving side device, analyze the packet sequence number in the response, and perform the corresponding retransmission operation or release the packet retransmission cache space according to different response types; For any port of the receiving side device, the corrected remaining value of the shared space is the smaller one of the remaining value of the shared sub-space of the port and the remaining value of the multi-port shared space of the receiving side device.

2. The method of claim 1, wherein, The division of the total cache space of the receiving side device into port private space and multi-port shared space, and the setting of the upper limit value of the shared space available to each port further comprises the following steps: Allocate private cache space to each port, and each private cache space is used only for storing data packets of the corresponding port; Allocate total shared cache space, which can be used to store data packets of all ports; Allocate shared sub-cache space to each port, and the size of the shared sub-cache space is the upper limit value of the shared cache space available to the port.

3. The method of claim 1, wherein, The storage or discarding of the data packets according to the retransmission check and the remaining cache space determination result, and the triggering of the corresponding type of response further comprise the following steps: If the retransmission check is passed, send the data packets to the cache of the receiving side device; If the retransmission check fails, generate a NAK response containing packet sequence number (PSN) information; If the total remaining cache space of the port is sufficient to store the current data packets, store the data packets and generate an ACK response containing packet sequence number information; If the total remaining cache space of the port is insufficient to store the current data packets, discard the data packets and generate a CNAK response containing packet sequence number information, which is a NAK response in the case of insufficient cache space.

4. The method of claim 1, wherein, The analysis of the packet sequence number in the response, and the performance of the corresponding retransmission operation or release of the packet retransmission cache space according to different response types further comprise the following steps: Analyze the packet sequence number in the ACK response, and release the data packets in the retransmission cache before the packet sequence number; or Analyze the packet sequence number in the NAK response, release the data packets in the retransmission cache before the packet sequence number, and trigger the retransmission of the data packets in the retransmission cache after the packet sequence number in real time; or The message sequence number in a CNAK response is analyzed, data messages before the message sequence number in the retransmission cache are released, and when a credit retransmission condition is met, retransmission of data messages after the message sequence number in the retransmission cache is triggered.

5. The method of claim 4, wherein, The credit retransmission condition is that: Feedback of an added credit value of a downstream receiving side device is received, and the added credit value is sufficient to receive data messages in the retransmission cache, or After a preset time period of backoff waiting, retransmission is actively started.

6. An apparatus for implementing lossless inter-port cache sharing in a network, the apparatus comprising: It comprises: a space division unit configured to divide total cache space of a receiving side device into port private space and multi-port shared space, and set an upper limit value of shared space available to each port; a credit calculation unit configured to calculate a credit value representing total remaining space information of a port after correction based on a remaining value of port private space and a remaining value of shared space after correction of the receiving side device, and feed back the credit value to a connected sending side device; a message transmission unit configured to initiate data message transmission when the sending side device meets a preset message sending condition based on the credit value; a message processing unit configured to perform retransmission check when a port of the receiving side device receives a data message from the sending side device, and determine whether the remaining cache space is sufficient to store the data message, store or discard the data message according to the retransmission check and the remaining cache space determination result, trigger a corresponding type of response, and send the response to the sending side device; a response analysis unit configured to analyze a message sequence number in a response when the sending side device receives the response from the receiving side device, and perform a corresponding retransmission operation or release message retransmission cache space according to different response types. For any port of the receiving side device, the remaining value of the shared space after correction is the smaller one of the remaining value of the shared sub-space of the port and the remaining value of the multi-port shared space of the receiving side device.

7. The apparatus for implementing lossless inter-port cache sharing of a network-on- chip as claimed in claim 6 wherein, The space division unit is further configured to: allocate private cache space for each port, each private cache space being used only for storing data messages of the corresponding port; allocate total shared cache space, which can be used for storing data messages of all ports; and allocate shared sub-cache space for each port, the size of the shared sub-cache space being the upper limit value of the shared cache space available to the port.

8. The apparatus for implementing lossless inter-port cache sharing of claim 6, wherein, The message processing unit is further configured to: if the retransmission check is passed, send the data message to the cache of the receiving side device; if the retransmission check fails, generate a NAK response containing message sequence number (PSN) information; if the remaining total cache space of the port is sufficient to store the current data message, store the data message and generate an ACK response containing message sequence number information; if the remaining total cache space of the port is insufficient to store the current data message, discard the data message and generate a CNAK response containing message sequence number information, the CNAK response being a NAK response in the case of insufficient cache space.

9. The apparatus for implementing lossless inter-port cache sharing of claim 6, wherein, The response analysis unit is further configured to: analyzing the message sequence number in the ACK response, releasing the data messages in the retransmission cache before the message sequence number; or analyzing the message sequence number in the NAK response, releasing the data messages in the retransmission cache before the message sequence number, and triggering the retransmission of the data messages in the retransmission cache after the message sequence number in real time; or analyzing the message sequence number in the CNAK response, releasing the data messages in the retransmission cache before the message sequence number, and triggering the retransmission of the data messages in the retransmission cache after the message sequence number when the credit retransmission condition is met, wherein the CNAK response is a NAK response generated in the case of insufficient cache space.

10. The apparatus for implementing lossless inter-port cache sharing of a network-on-chip as claimed in claim 9, wherein, The credit retransmission condition is: receiving feedback of an added credit value of the downstream receiving device, wherein the added credit value is sufficient to receive the data messages in the retransmission cache, or actively starting to attempt retransmission after a preset period of backoff waiting.

Citation Information

Patent Citations

  • Fluid control method and device based on tokens

    CN104780118A

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

    CN110830382A