TOE component and method for processing data thereof

By using external storage units and metadata storage units to manage storage resources in TOE components, multiple sessions share storage resources, solving the problem of low utilization of storage resources in the prior art, meeting high concurrency requirements and saving circuits resource.

CN118283134BActive Publication Date: 2024-11-05WELL CORE MICROELECTRONICS TECH (TIANJIN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410683545.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-11-05
Estimated Expiration
2044-05-30

AI Technical Summary

Technical Problem

The existing TOE implementation methods have low storage resource utilization and cannot meet the high concurrency requirements, resulting in limited number of TOE sessions.

Method used

The received data is cached through the external storage unit, and the storage resources are managed through the basic metadata storage unit and the session metadata storage unit, so as to realize multiple sessions share storage resources, and provide a high-concurrency TOE circuit cache allocation implementation solution.

Benefits of technology

It improves resource utilization, meets high concurrency needs, and saves circuit resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118283134B_ABST
    Figure CN118283134B_ABST
Patent Text Reader

Abstract

This application provides a TOE component and a method for processing data thereon. In some embodiments, the method includes: in response to receiving data from a peer device, when the host side cannot receive data, storing the received data in an external storage unit; and recording the termination address of this data transmission in the termination block of the basic metadata storage unit and the termination block of the corresponding session metadata in the session metadata storage unit; when the host side recovers the ability to receive data, reading the corresponding data from the external storage unit according to the address recorded in the start block of the basic metadata storage unit, and sending it to the host side; updating both the start block of the basic metadata storage unit and the start block of the corresponding session metadata in the session metadata storage unit to the last address of the data read this time. This application improves resource utilization by allowing multiple sessions to share storage resources, meeting high concurrency requirements and saving circuit resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a TOE component and a method for processing data thereof. Background Art

[0002] When network devices process TCP (Transmission Control Protocol) traffic, they consume a lot of CPU resources. In order to reduce CPU resource consumption and improve the processing speed of TCP traffic, TOE (TCP offload engine) technology is introduced to offload and autonomously process and maintain TCP protocol traffic through dedicated hardware.

[0003] The existing TOE implementation method is to use a TOE module for each session, distribute the five-tuple of the message to each TOE module through the bus, and each module determines whether the message belongs to this module and responds; or map the five-tuple and session relationship through the CAM table, query the message through the CAM table according to the five-tuple to the corresponding session, and then send the message to the corresponding TOE module. In addition, each session is equipped with a cache for processing sliding windows.

[0004] The current implementation method structure has the following defects.

[0005] (1) The number of TOE sessions is limited by storage resources and cannot meet high concurrency requirements;

[0006] (2) Each session requires an independent cache, and the overall storage resource utilization is low. Summary of the invention

[0007] The present application provides a TOE component and a method for processing data thereof.

[0008] In a first aspect, the present application provides a method for a TOE component to process data, the method comprising: in response to receiving data sent by a peer device, confirming whether a host side is able to receive data; when the host side cannot receive data, storing the received data in an external storage unit, and recording the termination address of this data in a termination block of a basic metadata storage unit, and distinguishing the termination address of this data by session and recording it in a termination block of corresponding session metadata in the session metadata storage unit; when the host side recovers to be able to receive data, reading a starting block in the basic metadata storage unit, reading corresponding data from an external storage unit according to the address recorded in the starting block, and sending the read data to the host side; updating the starting block in the basic metadata storage unit and the starting block of the corresponding session metadata in the session metadata storage unit to the last address of the data read this time; judging whether the starting block and the termination block in the basic metadata storage unit are consistent, and if not, returning to the step of reading the starting block in the basic metadata storage unit.

[0009] In some optional embodiments, the method also includes: after storing the received data in the external storage unit, the method also includes: when the remaining space in the external storage unit is greater than a first preset value, returning a confirmation message containing a sliding window, and reducing the sliding window accordingly according to the amount of received data; when the remaining space in the external storage unit is less than the first preset value, forcibly returning a confirmation message containing a sliding window, wherein the sliding window is set to zero, and recording the session number corresponding to the currently received data.

[0010] In some optional embodiments, after responding to receiving data sent by the opposite device, the method also includes: when the remaining space of the external storage unit is less than a second preset value, discarding the received data, and forcibly returning a confirmation message containing a sliding window, wherein the sliding window is set to zero, and the acknumber remains unchanged, and recording the session number corresponding to the currently received data.

[0011] In some optional implementations, storing the received data in an external storage unit includes: extracting quintuple data of the received data, a session number of the corresponding session, a data size of the valid data, and the valid data, and storing them in the external storage unit.

[0012] In some optional embodiments, the reading of the starting block in the basic metadata storage unit and reading the corresponding data from the external storage unit according to the address recorded in the starting block includes: reading the starting block in the basic metadata storage unit, obtaining the address recorded in the starting block, and adding one to the address to obtain the starting address; reading the corresponding data block from the external storage unit according to the starting address, obtaining the recorded five-tuple data, the session number of the session to which it belongs, the data size of the valid data and the address where the valid data is located, and obtaining the valid data by reading the address where the valid data is located.

[0013] In some optional implementations, after determining whether the start block and the end block in the basic metadata storage unit are consistent, the method further includes: if they are consistent, returning a confirmation message to the other device according to the recorded session number and refreshing the sliding window.

[0014] In some optional implementations, the method further includes: when terminating the session, reading the start address and the end address in the session metadata storage unit to determine whether they are consistent; if they are inconsistent, pausing the action of terminating the session; if they are consistent, terminating the session.

[0015] In a second aspect, the present application provides a TOE component, comprising: a receiving unit, configured to confirm whether the host side can receive data in response to receiving data sent by the opposite device; when the host side cannot receive data, store the received data in an external storage unit, and record the end address of this data in the end block of the basic metadata storage unit, and distinguish the end address of this data by session and record it in the end block of the corresponding session metadata in the session metadata storage unit; a sending unit, configured to read the starting block in the basic metadata storage unit when the host side recovers to be able to receive data, read the corresponding data from the external storage unit according to the address recorded in the starting block, and send the read data to the host side; and update the starting block in the basic metadata storage unit and the starting block of the corresponding session metadata in the session metadata storage unit to the last address of the data read this time; and determine whether the starting block and the end block in the basic metadata storage unit are consistent, if not, return to the step of reading the starting block in the basic metadata storage unit.

[0016] In some optional embodiments, the TOE component also includes: a feedback unit, configured to return a confirmation message containing a sliding window when the remaining space in the external storage unit is greater than a first preset value, and reduce the sliding window accordingly according to the amount of received data; when the remaining space in the external storage unit is less than the first preset value, forcibly return a confirmation message containing a sliding window, wherein the sliding window is set to zero, and record the session number corresponding to the currently received data.

[0017] In a third aspect, the present application provides a computer device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing data by the TOE component as described in the first aspect.

[0018] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by one or more processors, implements the method for the TOE component to process data as described in the first aspect.

[0019] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by one or more processors, implements the method for processing data by a TOE component as described in the first aspect.

[0020] In order to solve the technical problems of low storage resource utilization and inability to meet high concurrency requirements in existing TOE implementation methods, this application proposes a TOE component and a method for processing data thereof. This application is applied to a method for processing data by a TOE component in the receiving direction, which caches received data through an external storage unit, and manages the storage resources in the external storage unit through a basic metadata storage unit and a session metadata storage unit, thereby achieving the sharing of storage resources in the external storage unit by multiple sessions in the receiving direction, and providing a high-concurrency TOE circuit cache allocation implementation scheme for processing complex TCP protocols using small-capacity storage. This scheme uses a smaller-capacity storage to support more TCP sessions at the same time, improves resource utilization, meets high concurrency requirements, and saves circuit resources.

[0021] In addition, the present application is applied to a method for processing data by a TOE component in the sending direction, by allocating a data block for the current session in an external storage unit to carry data, and managing the data blocks in the external storage unit through the session metadata in the metadata storage unit, the session metadata including the starting address of the starting data block, the starting address of the data block to be received and sent, the starting address of the data block to be sent indicates that the data sent by the host side will be written from the starting address next time, the starting address of the data block to be received indicates that the data will be sent from the starting address next time when sending data to the opposite device, and the starting address of the starting data block indicates that the data will be released from the starting address next time when releasing the data block. In this way, the present application realizes that multiple sessions share the storage resources in the external storage unit in the sending direction, and provides a high-concurrency TOE circuit cache allocation implementation scheme for processing complex TCP protocols using small-capacity storage. The scheme uses a smaller capacity of storage to support more TCP sessions at the same time, improves resource utilization, meets high concurrency requirements, and saves circuit resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the drawings:

[0023] Figure 1 is a schematic diagram of an exemplary system architecture of at least one embodiment of the present application;

[0024] Figure 2 is a flow chart of an embodiment of a method for processing data by a TOE component in a sending direction according to the present application;

[0025] Figure 3 is a flow chart of an embodiment of a method for processing data by a TOE component in a receiving direction according to the present application;

[0026] Figure 4-35 is a schematic diagram of the data structure involved in some embodiments of the present application;

[0027] Fig.36 is a system structure diagram of an embodiment of a TOE component according to the present application;

[0028] Fig.37 is a schematic diagram of the structure of an embodiment of a TOE component according to the present application;

[0029] Fig.38 is a schematic diagram of the structure of an embodiment of a TOE component according to the present application;

[0030] Fig.39 It is a schematic diagram of the hardware composition structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

[0032] refer to Figure 1 , Figure 1 An exemplary system architecture 100 is shown according to at least one embodiment of a TOE component and a method of processing data thereof according to the present application.

[0033] like Figure 1As shown, the system architecture 100 may include a host device 101, a peer device 102, and a network 103. Among them, the host device 101 is additionally connected with a TOE component, and the TOE component may be additionally connected with an external storage unit. Exemplarily, the TOE component may be mounted on the bus of the host device 101 and communicate with the CPU (central processing unit) of the host device 101, and the external storage unit may be directly connected to the TOE component or mounted on the bus. Exemplarily, the TOE component may be implemented with an FPGA (Field Programmable Gate Array). The TOE component is a hardware device. The network 103 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. Exemplarily, it may be an Ethernet connection. The host device 101 and the TOE component may interact with the peer device 102 through the network 103. The host device 101 and the peer device 102 may be various electronic devices or servers, including but not limited to mobile phones, tablet computers, laptop portable computers, desktop computers, etc. when they are electronic devices, and may be implemented as a distributed server cluster consisting of multiple servers when they are servers, or may be implemented as a single server. It should be noted that the method for processing data by the TOE component provided in this application is generally executed by the TOE component.

[0034] The existing TOE multi-session processing method uses a storage for each session to store received data and data to be sent. This method is limited by the storage size of the chip itself or the size of the external storage. Achieving high concurrency requires large-capacity storage resources.

[0035] To solve the above problems, the present application proposes a method for processing data by a TOE component and a TOE component. The present application manages the storage structure and uses a small-capacity shared cache mechanism so that all sessions can use sorted shared storage to achieve multiple TCP sessions working simultaneously. The specific implementation scheme is divided into two parts: the sending direction and the receiving direction.

[0036] Please refer to Figure 2 , Figure 2 FIG. 1 is a flow chart of an embodiment of a method for processing data by a TOE component in a sending direction according to the present application. Figure 2 The method shown is applicable to the sending direction of the TOE component, that is, the direction in which the host device sends data to the opposite device through the TOE component.

[0037] like Figure 2 As shown, the method for processing data by the TOE component of the present application includes the following steps:

[0038] 210. In response to the current session link establishment, determine a free data block in the external storage unit as a starting data block of the current session.

[0039] Here, session link establishment refers to establishing a session link, that is, the TOE component establishes a session link with the peer device through Ethernet. Here, the external storage unit provided may be a storage device independent of the TOE component, which is used when all sessions are shared. Here, the external storage unit may be cut into data blocks according to the minimum granularity, and each data block may be numbered, the data blocks may be marked as free data blocks, and the number of free data blocks may be counted. Here, the data block number may be used as the address of the data block in the external storage unit.

[0040] Optionally, when each session is linking, it can be confirmed whether there are free data blocks in the external storage unit. If there are, the link is established and one of the free data blocks is registered (determined) as the starting data block of the current session. All subsequent data of the current session is stored in the external storage unit starting from the starting data block.

[0041] 220. Write the session metadata of the current session into the metadata storage unit, where the session metadata of the current session includes the following three starting addresses: a starting address of a starting data block, a starting address of a data block to be received and sent, and a starting address of a data block to be sent, and the address of the starting data block of the current session is used as an initial value of the three starting addresses.

[0042] The TOE component also sets up a metadata storage unit for storing session metadata of each session. The metadata storage unit can be a storage unit inside the TOE component (this method has a faster communication speed) or a storage unit outside the TOE component. The present application uses the session metadata of each session stored in the metadata storage unit to manage the storage resources in the external storage unit.

[0043] Here, the session metadata of the current session includes three blocks, i.e., three parts, which are respectively used to store the following three starting addresses: the starting address of the starting data block, the starting address of the data block to be received and sent, and the starting address of the data block to be sent. Optionally, the present application initializes the above three starting addresses included in the session metadata, and during initialization, the address of the starting data block of the current session is used as the initial value of the three starting addresses.

[0044] The present application utilizes the above three starting addresses for the following operations: writing the data to be sent received from the host side into the external storage unit, sending the data written in the external storage unit to the opposite device, and releasing and managing the data blocks in the external storage unit after receiving the confirmation message returned by the opposite device, thereby realizing the management of the storage resources in the external storage unit, thereby realizing that multiple sessions share the storage resources in the external storage unit.

[0045] 230. In response to receiving data sent by the host side, at least one free data block in the external storage unit is allocated to carry the data sent by the host side, and the starting address of the data block to be sent is updated accordingly. The starting address of the data block to be sent indicates that writing starts from this starting address when receiving data sent by the host side next time.

[0046] When the host side (i.e., the host device) needs to send data outward, TOE responds to the data sent by the host side and allocates data blocks from the external storage unit to implement the receiving operation. Here, the data that the host side interacts with the peer device through the TOE component can be a TCP message. The TCP message uses a combination of five pieces of information (hereinafter referred to as a five-tuple) including sourceIP (source address), destIP (destination address), sourcePORT (source port number), destPORT (destination port number), and protocol (transport layer protocol) to determine a session, and different TCP sessions are distinguished by different five-tuples. Each TCP session has a sliding window that tells the sender how much buffer is available to accept data. The sliding window is an application of the TCP protocol, which is used for flow control during network data transmission to avoid congestion.

[0047] In some optional embodiments, this step may include: in response to receiving data sent by the host side, allocating at least one free data block in the external storage unit as a bearing data block, the bearing data block is used to bear the data sent by the host side; registering (determining) an additional free data block in the external storage unit as the next transmission start data block of the current session, and writing the quintuple of the current session and the session number, data size, address of the bearing data block and address of the next transmission start data block into this start data block, and writing the data sent by the host side this time into the bearing data block, wherein the current start data block refers to the data block represented by the start address of the data block to be sent; and updating the start address of the data block to be sent to the address of the next transmission start data block.

[0048] 240. In response to sending data to the opposite device, the starting address of the data block to be received is updated accordingly, and the starting address of the data block to be received indicates that the data will be sent from the starting address when it is sent to the opposite device next time.

[0049] If there is data in the external storage unit that has not been sent and the sending conditions are met, the TOE component can send the data in the external storage unit to the peer device.

[0050] In some optional implementations, this step may include: determining whether the starting address of the data block to be received and sent in the session metadata of the current session is consistent with the starting address of the data block to be sent; if they are consistent, confirming that there is no data that has not been sent; if they are inconsistent, confirming that there is data that has not been sent; if there is data that has not been sent, further confirming whether the sending condition is met; if the sending condition is met, reading the session metadata of the current session from the metadata storage unit; reading the data block represented by the starting address of the data block to be received and sent, obtaining the address of the bearer data block and the address of the next transmission starting data block recorded in the data block, reading the data in the corresponding bearer data block and sending it to the opposite device; using the read address of the next transmission starting data block to update the starting address of the data block to be received and sent; and then returning to the step of determining whether the starting address of the data block to be received and sent in the session metadata of the current session is consistent with the starting address of the data block to be sent.

[0051] In some optional embodiments, after further confirming whether the sending conditions are met, the method of the present application may also include: if the sending conditions are not met and the host side continues to send data, returning a response to receiving the data sent by the host side, allocating at least one free data block in the external storage unit to carry the data sent by the host side, and updating the starting address of the data block to be sent accordingly.

[0052] In some optional implementations, further confirming whether the sending condition is met includes: polling whether the current session has back pressure and whether the sliding window is sufficient; if there is no back pressure and the sliding window is sufficient, confirming that the sending condition is met.

[0053] 250. In response to receiving a confirmation message replied by the opposite device, the corresponding data block in the external storage unit is released, and the starting address of the starting data block is updated accordingly, where the starting address of the starting data block indicates that the data block will be released starting from the starting address next time it is released.

[0054] It is easy to understand that when the data sent to the peer device is confirmed to be received by the peer device, the TOE component can release the data block occupied by this part of the data in the external storage unit so that it can be re-marked as a free data block for other use.

[0055] In some optional embodiments, this step may include: in response to receiving a confirmation message returned by the peer device, determining the data length confirmed to be received by the peer device, and using the data length as the length of the data to be released; reading the session metadata of the current session from the metadata storage unit, reading the starting data block represented by the starting address of the starting data block, obtaining the address of the bearer data block recorded in the starting data block and the address of the starting data block for the next transmission, releasing the obtained bearer data block and the starting data block itself, and re-marking them as free data blocks; and, updating the starting address of the starting data block in the session metadata of the current session to the address of the starting data block for the next transmission that was read.

[0056] In some optional embodiments, before updating the starting data block revelation address in the session metadata of the current session to the address of the starting data block of the next transmission that is read, it also includes: determining whether the length of the data to be released is consistent with the data size recorded in the starting data block of this time; if not, subtracting the data size recorded in the starting data block of this time from the data length of the data to be released as the new length of the data to be released, returning to the step of reading the session metadata of the current session from the metadata storage unit, and reading the starting data block represented by the starting address of the starting data block.

[0057] Please refer to Figure 3 , Figure 3 FIG. 1 is a flow chart of an embodiment of a method for processing data by a TOE component in a receiving direction according to the present application. Figure 3 The method shown is applicable to the receiving direction of the TOE component, that is, the direction in which the host device receives data from the opposite device through the TOE component.

[0058] like Figure 3 As shown, the method for processing data by the TOE component of the present application includes the following steps:

[0059] 310. In response to receiving data sent by the opposite device, confirm whether the host side can receive the data; when the host side cannot receive the data, store the received data in an external storage unit, and record the termination address of this data in the termination block of the basic metadata storage unit and the termination block of the corresponding session metadata in the session metadata storage unit.

[0060] For the TOE component, when the host side is in a receiving state, in response to receiving the data sent by the opposite device, it can be directly transferred to the CPU of the host device without storage. When the host side is in a non-receiving state, in response to receiving the data sent by the opposite device, the TOE component temporarily caches the data to wait for subsequent transmission to the host device. Here, not only is the termination address of this data recorded in the termination block of the basic metadata storage unit, but the termination address of this data is also recorded in the termination block of the corresponding session metadata in the session metadata storage unit according to the session distinction.

[0061] In some optional implementations, the TOE component responds to the data sent by the opposite device and also confirms the remaining space of the external storage unit, so as to perform different operation modes according to the size of the remaining space of the external storage unit.

[0062] In some optional implementations, the step of storing the received data in an external storage unit may include: extracting the five-tuple data of the received data, the session number of the session to which it belongs, the data size of the valid data, and the valid data, and storing them in the external storage unit. Among them, a starting data block may be allocated to cache the attribute information of the data, and at least one bearing data block may be allocated to cache the valid data, and the attribute information such as the five-tuple data of the received data, the session number of the session to which it belongs, the data size of the valid data, and the address of the valid data may be stored in the starting data block, and the valid data may be stored in the bearing data block indicated by the address of the valid data.

[0063] 320. When the host side recovers to be able to receive data, the starting block in the basic metadata storage unit is read, and corresponding data is read from the external storage unit according to the address recorded in the starting block, and the read data is sent to the host side.

[0064] In some optional embodiments, this step reads the starting block in the basic metadata storage unit, and reading the corresponding data from the external storage unit according to the address recorded in the starting block may include: reading the starting block in the basic metadata storage unit, obtaining the address recorded in the starting block, and adding one to the address to obtain the starting address; reading the corresponding data block from the external storage unit according to the starting address, obtaining the recorded five-tuple data, the session number of the session to which it belongs, the data size of the valid data, and the address of the valid data, and obtaining the valid data by reading the address of the valid data.

[0065] 330. Update the starting block in the basic metadata storage unit and the starting block corresponding to the session metadata in the session metadata storage unit to the last address of the data read this time.

[0066] 340. Determine whether the start block and the end block in the basic metadata storage unit are consistent. If not, return to the step of reading the start block in the basic metadata storage unit.

[0067] In some optional embodiments, in step 310, after storing the received data in the external storage unit, the method may further include: when the remaining space of the external storage unit is greater than a first preset value (for example, half of the total capacity), returning a confirmation message containing the sliding window, and reducing the sliding window accordingly according to the amount of received data.

[0068] In some optional embodiments, in step 310, after storing the received data in the external storage unit, the method may further include: when the remaining space in the external storage unit is less than a first preset value, forcibly returning a confirmation message containing a sliding window, wherein the sliding window is set to zero, and recording the session number corresponding to the currently received data.

[0069] In some optional embodiments, in step 310, in response to receiving data sent by the opposite device, the method may further include: when the remaining space in the external storage unit is less than a second preset value (for example, the size of a maximum packet), discarding the received data, and forcibly returning a confirmation message containing a sliding window, wherein the sliding window is set to zero, and the acknumber remains unchanged, and recording the session number corresponding to the currently received data.

[0070] In some optional implementations, after step 340, the method may further include: if the start block and the end block in the basic metadata storage unit are consistent, returning a confirmation message to the opposite device according to the recorded session number, and refreshing the sliding window.

[0071] In some optional implementations, the method of the embodiment of the present application may also include: when terminating a session, reading the start address and the end address in the session metadata storage unit to determine whether they are consistent; if they are inconsistent, pausing the action of terminating the session; if they are consistent, terminating the session.

[0072] Above, reference Figure 2 and Figure 3 , the method for processing data by the TOE component proposed in this application is introduced from the sending direction and the receiving direction respectively.

[0073] To facilitate further understanding and implementation of the present application scheme, further detailed description is given below in conjunction with specific application scenario embodiments.

[0074]

Sending direction

[0075] Taking session 1 as an example, the TOE component receives data from the host side and sends data to the outside (the peer device).

[0076] Step 1: Set up an external storage unit for sharing by all sessions, cut the external storage unit into data blocks according to the minimum granularity, number each data block, mark the data blocks as free data blocks, and count the number of free data blocks. Exemplarily, the data blocks in the external storage unit are numbered 1, 2, 3...n... Here, the data block number can be regarded as the address of the data block in the external storage unit.

[0077] Step 2: When each session is chained, if there is a free data block, the chain is built and a free data block is registered as the starting data block of the current session. For example, the first block of session metadata (i.e., the starting address of the starting data block) can be written into the number of data block address 1.

[0078] Step 3: In the TOE component, a metadata storage unit is set according to the session distinction to store the session metadata of the current session, and the starting data block address (i.e., number) of the current session is recorded as the starting address of the starting data block, the starting address of the data block to be received and sent, and the starting address of the data block to be sent. Exemplarily, the first block (starting address of the starting data block), the second block (starting address of the data block to be received and sent), and the third block (starting address of the data block to be sent) of the session metadata are simultaneously written into the number of data block 1. At this time, the session metadata is as follows: Figure 4 As shown, the initial values ​​of the three blocks (three starting addresses) in the session metadata of session 1 are all the addresses (numbers) of data block 1.

[0079] Step 4: When receiving the data (first data packet) sent by the host side, if the number of remaining free data blocks is greater than a preset value, such as the maximum packet length of a burst, the data can be accepted. Here, free data blocks can be allocated to carry the data. Exemplarily, data blocks 2-6 (not necessarily consecutive) can be allocated to carry the data.

[0080] Here, the host side, that is, the CPU of the host device can issue corresponding instructions to the TOE component, can send data that needs to be sent out through the TCP protocol to the TOE component, and can receive data parsed by the TOE component.

[0081] Step 5: Mark these data blocks used to carry data (for example, 2-6) as non-free data blocks; in addition, allocate an additional data block to be registered as the data block to be received and sent for this session (or called the starting data block for the next transmission), and store the starting address of these data blocks (including the carrying data and the data block to be received and sent), the length information of this data (data size), the session number to which they belong, etc. in order in this starting data block. Exemplarily, the data block at address 11 of the external storage unit can be allocated as the data block to be received and sent for this session (the starting data block for the next transmission), and at the same time, write the following content in the data block represented by address 1 of the external storage unit (quintuple, session 1 number (session number), data size, address 2-6 number, address 11 number); write the data block represented by address number 2-6 of the external storage unit into the data to be sent this time. At this time, the data blocks at addresses 1-6 of the external storage unit should be as follows Figure 5 shown.

[0082] Here, chain storage is adopted, and the data blocks at addresses 1-6 are used to store the first data packet. Address 1, which is the starting data block of the first data packet, also stores the number of address 11. The data block represented by address 11 will become the starting data block of the next data packet.

[0083] Step 6: The metadata storage unit refreshes and stores the starting address of the next data block to be sent (i.e., the number of the starting data block for the next transmission) as the starting address of the data block to be received. For example, the third block of session metadata is refreshed, and the number of data block address 11 is written to replace the original number of address 1; at this time, the session metadata is as follows: Figure 6 shown.

[0084] Step 7: poll the session to see if there is back pressure, whether the sliding window is sufficient, and read the session metadata information stored in the metadata storage unit to determine whether the start address of the data block to be sent is consistent with the address of the data block to be received. If they are inconsistent, it is determined that there is data that has not been sent. Figure 6 The second and third blocks of session metadata of session 1 are address 1 and address 11, indicating that there is data that has not been sent.

[0085] Step 8: Determine whether the conditions are met. If the sending conditions are not met (i.e., the session has back pressure, and / or the sliding window is insufficient), and the host side continues to send data to the TOE component, the next transmission start data block registered in step 5 can be used as the start data block of the data packet to be received this time, and steps 4 to 6 are repeated.

[0086] Repeat steps 4 to 6. The detailed instructions are as follows:

[0087] At this time, the host side continues to send data (second data packet), and repeats step 4 to allocate data blocks 11-16 (not necessarily consecutive) to carry these data;

[0088] Repeat step 5, and additionally allocate the data block at address 20 of the external storage unit as the data block to be received and sent for this session (the starting data block for the next transmission), and write the following content (five-tuple, the number of session 1, the data size, the numbers of addresses 12-16, and the number of address 20) into the data block represented by address numbers 12-16 in the external storage unit; write the data to be sent this time (the second data packet) into the data block represented by address numbers 12-16 in the external storage unit. At this time, addresses 11-16 in the external storage unit can be as follows Figure 7 shown.

[0089] Repeat step 6 to refresh the third block of session metadata for session 1, and write the number of data block address 20 instead of the original number of address 11; now the session metadata is as follows Figure 8 shown.

[0090] Step 9: If the sending condition is met (i.e., the session has no back pressure and the sliding window is sufficient), read the session metadata information stored in the metadata storage unit, and obtain the starting data block of session 1 according to the information of the metadata storage unit. Exemplarily, the second block of session metadata is read, which is the number of address 1, and the information of the data block at address 1 in the external storage unit is read out.

[0091] Step 10: Read the data in the data block that carries the data according to the information in the starting data block. Determine the actual data according to the data length and send it. Exemplarily, read the data block at address 1 in the external storage unit, and read out the five-tuple, session 1 number, data size, address 2-6, address 11; at this time, read the data in address 2-6 in the external storage unit. For example, each address is 64 bytes in size, and the data size indicates that this data packet is only 300 bytes in size, then take addresses 2-5 for a total of 256 bytes plus 44 bytes in address 6 for a total of 300 bytes, and discard the remaining data in address 6. Send these data.

[0092] Step 11: Store the next starting data block address stored in the starting data block into the session metadata of the metadata storage unit, and refresh the starting address of the data block to be received and sent for this session, and the starting address of the starting data block remains unchanged. For example, after the first data packet (address 1-6) is sent out, the second block of session metadata (the starting address of the data block to be received and sent) is refreshed, and the number of data block address 11 (this value can be obtained from the data block at address 1 in the external storage unit in step 10) is written to replace the original number of address 1; at this time, the session metadata is as follows: Fig. 9 shown.

[0093] Step 12: Repeat steps 7 to 11, read the metadata storage unit information, and determine whether the starting address of the data block to be sent is consistent with the address of the data block to be received. If they are consistent, it is determined that there is no data that has not been sent.

[0094] Step 13: After sending, receive the confirmation message (ack message) returned by the other end, calculate the length of the data confirmed to be received by the other end through the increase of the acknum field in the message, and use this length as the length of the data to be released. For example, after sending the first data packet of 300 bytes (see step 10), the other end replies that acknum increases by 300, which is regarded as the other party confirming that 300 bytes of data have been received.

[0095] Step 14: Read the metadata storage unit information of this session, and read the information in the starting data block according to the metadata storage unit information. Exemplarily, read the first block of session metadata, which is numbered at address 1, and read the data block at address 1 in the external storage.

[0096] Step 15: Based on the information in the starting data block, all the contained bearer data blocks and the starting data block itself are released and re-marked as free data blocks. Exemplarily, at this time, based on the read data, the data block address 1 and the read addresses 2-6, a total of addresses 1-6, are released and marked as free data blocks. At this time, the address of the starting data block of the next data packet can also be read from the data block at address 1, that is, 11, which is subsequently used as the starting address of the next starting data block.

[0097] Step 16: Determine whether the length of the data to be released is consistent with the data length information stored in the starting data block in step 15; if they are consistent, refresh the starting address of the next starting data block in the starting data block to the starting address of the starting data block in the original data storage unit. Exemplarily, upon receiving a reply from the other end, acknum is increased by 300, which means that the other party confirms receipt of 300 bytes of data, which is consistent with the 300 bytes of the first data packet, indicating that the ack confirmation of this reply is complete. Refresh the first block of session metadata, and write the number of data block address 11 (this value can be obtained from the data block at address 1 in the external storage unit in step 15) instead of the original number of address 1; at this time, the session metadata is as follows Fig.10 shown.

[0098] Step 17: Determine whether the length of the data to be released is inconsistent with the data length information stored in the starting data block in step 15, then subtract the length of the data to be released from the data block to obtain the new length of the data to be released; repeat steps 14 to 16 until the length of the data to be released is reduced to zero.

[0099] In this case, both the first and second packets are sent, and the session metadata is as follows: Fig.11 shown.

[0100] For example, the length of the first data packet is 300, the length of the second data packet is 320, and the acknum received in the reply increases to 620, which means that one ack confirms the length of both data packets, a total of 620 bytes. At this time, according to step 16, the first block of session metadata is refreshed and written to data block address 11. The session metadata should be as follows: Fig.12 shown.

[0101] Exemplarily, the received acknum increases to 620 which is inconsistent with the length of the first data packet 300, 620-300, 320 is used as the new length of the data to be released, and steps 14 to 16 are repeated.

[0102] At this time, the first block of session metadata is read, which is the number of address 11. At this time, the data block at address 11 in the external storage is read out.

[0103] The data block at address 11 is the information of the second data packet. At this time, according to the read data, the data block address 11 and the read addresses 12-16, a total of addresses 11-16, are released and marked as free data blocks. At the same time, the other end receives a reply acknum with a remaining 320 bytes. At this time, it is considered that the other party confirms that it has received 320 bytes of data, which is consistent with the 320 bytes of the second data packet, indicating that the ack confirmation of this reply is complete. At this time, according to step 16, the first block of session metadata is refreshed and written to data block address 20. At this time, the session metadata is as follows Fig.13 shown.

[0104] refer to Fig.14 , shows the storage structure of the external storage unit in the sending direction (data has been received but not yet sent to the other end).

[0105] [Receiving direction]

[0106] Step 1: Set up an external storage unit for all sessions to share, set up a basic metadata storage unit and a session metadata storage unit, and count the available cache size on the entire receiving side (i.e., the host device). The external storage unit can be a storage unit independently set outside the TOE component, and the basic metadata storage unit and the session metadata storage unit can be storage units inside the TOE component.

[0107] Step 2: When receiving valid TCP data sent by the peer device via Ethernet, if the host side can receive data, extract the five-tuple data, session number, valid data size and valid data, and send them to the host side in sequence, and the sliding window in the returned ack remains unchanged. At this time, the data goes directly to the host side without being cached by the TOE component.

[0108] Step 3: If the host side cannot receive data, store the five-tuple data, session number, valid data size and valid data in the external storage unit in order; record the termination address of this data in the basic metadata storage unit; and, distinguish this termination address by session and record it in the session metadata storage unit.

[0109] Exemplarily, firstly, the basic metadata storage unit and the session metadata storage unit are initialized to 0, such as Fig.15 As shown, the basic metadata storage unit includes two storage blocks, namely a start block and an end block, both initialized to 0, and the session metadata storage unit stores multiple session metadata, each session metadata includes two storage blocks, namely a start block and an end block, both initialized to 0.

[0110] For example, data of sessions 1, 2, and 3 are received in sequence, such as Fig.16 shown.

[0111] When the first data of session 1 is received, the second block (i.e., the termination block, representing the address of the last write) of the basic metadata storage unit is numbered by one to obtain address 1. The five-tuple data, session number, valid data size, and data are stored in order at addresses 2-5 (continuous) and stored in external storage unit address 1. External storage unit addresses 2-5 store valid data. The header information of address 1 is as follows: Fig.17 shown.

[0112] At this point, the session metadata and basic metadata are as follows Fig.18 As shown, the termination block of the basic metadata storage unit is address 5, and the termination block of session 1 of the session metadata storage unit is address 5.

[0113] Similarly, when the second data at address 6-9 is received, the session metadata and basic metadata are as follows Fig.19 shown.

[0114] When the third data at address 10-15 is received, the session metadata and basic metadata are as follows Fig. 20 shown.

[0115] When the fourth data at address 16-20 is received, the session metadata and basic metadata are as follows Fig.21 As shown. …

[0116] When all data is received, session metadata and basic metadata are as follows Fig. 22 shown.

[0117] Step 4: The sliding window in the returned confirmation message (ack) is reduced according to the amount of data.

[0118] Step 5: When the external storage unit caches data that reaches a preset value, such as half of the capacity, and receives valid TCP data, repeat step 3 and receive this data, while forcing the return of an ack message and setting the window to zero to inform the other end that there is no receive cache, stop sending data, and record the session number of this session.

[0119] Step 6: When the remaining space in the external storage unit is less than a preset value, such as the size of a maximum packet, if valid TCP data is received, the valid data will be discarded, and the ack message will be forced to be returned, and the window will be set to zero. At the same time, the acknumber will not change, indicating that the transmission is invalid, and the session number of this session will be recorded.

[0120] Step 7: When the host side recovers to a receivable state, read the starting address in the basic metadata storage unit; read the five-tuple data, session number, and valid data size from the external storage unit according to the address, calculate the last address of this data according to the valid data size, read the valid data in sequence, and send it to the host side at the same time.

[0121] Exemplarily, the storage structure of the current external storage unit, session metadata storage unit, and basic metadata storage unit is as follows: Fig.23 shown.

[0122] Exemplarily, the address 0 of the starting block (representing the address of the last read) in the basic metadata storage unit is read plus one to obtain address 1. Fig.24 , the header information read out at address 1 is the five-tuple of session 1, session number 1, the data size of this data packet, and the address where the data is located is 2-5.

[0123] The data in address 2-5 is read out, and the read data is evaluated according to the data size, and the valid data is sent to the host side together with the five-tuple data, the session number, and the valid data size.

[0124] Step 8: Confirm the last address of this data, take the last address as the starting address, refresh the basic metadata storage unit information, and refresh the session metadata storage unit information by session according to the session number of this data.

[0125] For example, the information in address 1 (address 0 plus 1) is the quintuple of session 1, session number 1, the data size of this data packet, and the data address 2-5. Address 5 is written into the start block of session metadata of session 1 (representing the address read last time), and the basic metadata start block (representing the address read last time) is also written. At this time, the session metadata storage unit and the basic metadata storage unit are as follows: Fig.25 shown.

[0126] Step 9: Determine whether the start block and the end block stored in the basic metadata storage unit are consistent. If they are inconsistent, it is determined that there is still data in the external storage unit, and steps 7 to 8 are repeated; if they are consistent, it is determined that there is no data in the external storage unit, and a confirmation message (ack) is sent for the session recorded in steps 5 and 6, and the sliding window value is refreshed at the same time to inform the other end that data can be sent.

[0127] For example, as in step eight corresponding to Fig.25 As shown, it can be determined from the basic metadata storage unit that there is data from address 6 (address 5 plus one) to address 45 that has not been sent to the host side.

[0128] Here, the data in the external storage unit is read out step by step and sent to the host side. Similarly, when the second data at address 6-9 is read out, the session metadata and basic metadata are as follows: Fig.26 shown.

[0129] Similarly, when reading the third data at address 10-15, the session metadata and basic metadata are as follows Fig. 27 shown.

[0130] Similarly, when reading the fourth data at address 16-20, the session metadata and basic metadata are as follows Fig.28 shown.

[0131] Similarly, when reading the fifth data at address 16-20, the session metadata and basic metadata are as follows Fig.29 shown.

[0132] Similarly, when reading the sixth data at address 21-40, the session metadata and basic metadata are as follows Fig.30 shown.

[0133] After all data in the external storage is read out and sent to the host side, the session metadata and basic metadata are refreshed. Fig.31 shown.

[0134] Step 10: When terminating a session (for example, when receiving a session termination request for a session from the peer device, at which time the peer device no longer sends data for the session), read the start block and the end block in the session metadata storage unit to determine whether they are consistent; if they are inconsistent, it means that there is still data for this session waiting to be sent to the host side in the external storage unit, and the action of terminating the session is suspended; if they are consistent, it means that there is no data for this session in the external storage unit, and the session can be terminated.

[0135] For example, when reading the fifth data at address 16-20, the session metadata and basic metadata are as follows: Fig.32 shown.

[0136] At this time, according to the fact that the start block (representing the address of the last read) and the end block (representing the address of the last write) of session 3 in the session metadata are both address 20, it can be determined that there is no data of session 3 in the external storage, and session 3 can be terminated.

[0137] Similarly, when reading the sixth data at address 21-40, the session metadata and basic metadata are as follows Fig.33 shown.

[0138] At this time, according to the fact that the start block (representing the address of the last read) and the end block (representing the address of the last write) of session 2 in the session metadata are both address 40, it can be determined that there is no data of session 2 in the external storage, and session 2 can be terminated.

[0139] For example, the overall cache implementation architecture for the receiving direction is as follows: Fig.34 and Fig.35 As shown, Fig.34 The storage structure when the data represented has been written but not read out, Fig.35 The storage structure when all the data represented has been read out.

[0140] refer to Fig.36 An embodiment of the present application exemplarily provides a system structure diagram of a TOE component 400, one end of which is connected to the CPU of the host device (host side), and the other end is connected to the Ethernet (ETH side), and the TOE component 400 is connected to an external storage unit 500. The internal modules of the TOE component 400 can be divided into three categories: receiving direction, internal management, and sending direction, with a total of nine modules. The functions of each module are described as follows:

[0141] Message parsing module 401: parses each element in the message according to the message header content;

[0142] Message data extraction module 402: extracting valid payload data from the message;

[0143] Receiving metadata storage module 403: manages and records receiving direction payload data;

[0144] Session management module 404: switching and managing different sessions according to the elements in the parsed message;

[0145] TOE status module 405: manages the internal status of TOE components;

[0146] Sliding window module 406: used to calculate and manage the sliding windows of the peer end and the own end;

[0147] Sending metadata storage module 407: manages and records the payload data in the sending direction;

[0148] Message assembly module 408: assembling reply messages and assembling data messages with payload;

[0149] Traffic control module 409: controls the size of external traffic according to the receiving capacity of the Ethernet side.

[0150] The technical solution of this application focuses on the receiving metadata storage module 403 and the sending metadata storage module 407 and the use logic of the external storage unit 500. The sending direction logic described in this application is mainly performed in the sending metadata storage module 407, and the receiving direction logic is mainly performed in the receiving metadata storage module 403 and the sliding window module 406.

[0151] Exemplarily, the overall use logic of the TOE component includes the following steps:

[0152] [Receiving direction]

[0153] Step 1: When establishing a session connection (session link), the five-tuple of the TCP session is hashed;

[0154] Step 2: Complete the mapping between the five-tuple and the session number according to the hash value. Store various information of the session, such as session status, seqnum, acknum, etc., into the session management module composed of RAM with the session number as the address.

[0155] Step 3: After receiving the TCP message, perform the same hash processing on the five-tuple in the TCP message as in step 1, and match the corresponding session according to the hash value.

[0156] Step 4: Use the matched session number as the address, read out the information of this session in the session management module, and load it into the TOE status module.

[0157] Step 5: According to the parsing result of the message parsing module, the message data is extracted and provided to the receiving metadata storage module; at the same time, the TOE status module writes the ack reply indication and the current session status into the session management module for saving the session information pair according to the message parsing result.

[0158] Step 6: The receiving metadata storage unit applies to the host side for unloading.

[0159] Step 7: After the host side responds to the uninstallation, the receiving metadata storage module transmits the data to the host side.

[0160]

Sending direction

[0161] Step 8: The host side transmits the data to be sent to the sending metadata storage module, stores the data in the cache (ie, the external storage unit) in order, and transmits the session number to which the data belongs to the TOE status module.

[0162] Step 9: The TOE status module sequentially polls the established connected sessions. If the session number to which data belongs is passed in, the session with data is processed first.

[0163] Step 10: The TOE status module reads the session status from the session management module according to the session number that needs to be processed currently, and asks the sending metadata storage module whether this session needs to send data; based on the session status, whether data needs to be sent, the sending instruction is passed to the message assembly module.

[0164] Step 11: The message assembly module applies for the data to be sent from the sending metadata storage module according to the transmitted instruction, assembles the data into a TCP data message, and sends it to the flow control module.

[0165] Step 12: The flow control module performs flow control processing based on whether the ETH side can accept data.

[0166] refer to Fig.37 , Fig.37 It is a schematic structural diagram of an embodiment of a TOE component 600 according to the present application.

[0167] like Fig.37 As shown, the TOE component 600 of the present application includes the following:

[0168] The management unit 601 is configured to, in response to the current session link establishment, determine a free data block in the external storage unit as the starting data block of the current session; write the session metadata of the current session in the metadata storage unit, the session metadata of the current session including the following three starting addresses: the starting address of the starting data block, the starting address of the data block to be received and sent, and the starting address of the data block to be sent, and use the address of the starting data block of the current session as the initial value of the three starting addresses;

[0169] The receiving unit 602 is configured to allocate at least one free data block in the external storage unit to carry the data sent by the host side in response to receiving the data sent by the host side, and update the starting address of the data block to be sent accordingly, wherein the starting address of the data block to be sent indicates that the data sent by the host side will be written from the starting address next time the data is received;

[0170] The sending unit 603 is configured to update the start address of the data block to be received in response to sending data to the opposite device, wherein the start address of the data block to be received indicates that the next time data is sent to the opposite device, the data will be sent from the start address;

[0171] The release unit 604 is configured to release the corresponding data block in the external storage unit in response to receiving the confirmation message replied by the opposite device, and update the starting address of the starting data block accordingly, and the starting address of the starting data block indicates that the next release of the data block starts from this starting address.

[0172] Exemplarily, each functional unit of the TOE component 600 of the present application is mainly composed of Fig.36 The metadata storage module 407 in the system structure diagram shown in the figure is used for implementation.

[0173] It should be noted that the implementation details and technical effects of each module in the device of this embodiment can refer to the description of other embodiments in this application, and will not be repeated here. The implementation scheme of each module in the device is diverse, as long as the purpose of the module can be achieved, and the actual deployment is not limited to a specific implementation scheme.

[0174] refer to Fig.38 , Fig.38 It is a schematic structural diagram of an embodiment of a TOE component 700 according to the present application.

[0175] like Fig.38 As shown, the TOE component 700 of the present application includes the following:

[0176] The receiving unit 701 is configured to confirm whether the host side can receive the data in response to receiving the data sent by the opposite end device; when the host side cannot receive the data, store the received data in the external storage unit, and record the termination address of this data in the termination block of the basic metadata storage unit, and distinguish the termination address of this data by session and record it in the termination block of the corresponding session metadata in the session metadata storage unit;

[0177] The sending unit 702 is configured to, when the host side recovers to be able to receive data, read the starting block in the basic metadata storage unit, read the corresponding data from the external storage unit according to the address recorded in the starting block, and send the read data to the host side; and update the starting block in the basic metadata storage unit and the starting block of the corresponding session metadata in the session metadata storage unit to the last address of the data read this time; and determine whether the starting block and the ending block in the basic metadata storage unit are consistent. If they are inconsistent, return to the step of reading the starting block in the basic metadata storage unit.

[0178] Exemplarily, each functional unit of the TOE component 700 of the present application is mainly composed of Fig.36 The metadata receiving storage module 403 in the system structure diagram is used to implement it.

[0179] It should be noted that the implementation details and technical effects of each module in the device of this embodiment can refer to the description of other embodiments in this application, and will not be repeated here. The implementation scheme of each module in the device is diverse, as long as the purpose of the module can be achieved, and the actual deployment is not limited to a specific implementation scheme.

[0180] refer to Fig.39 , Fig.39 FIG. 1 is a schematic diagram of a computer device according to an embodiment of the present application. Fig.39 As shown, the computer device 800 of the present application may include:

[0181] One or more processors 801;

[0182] A memory 802 on which one or more programs 803 are stored;

[0183] Components such as the processor 801 and the memory 802 may be coupled together via a bus system 804; the bus system 804 is used to implement connection and communication between these components;

[0184] When one or more programs 803 are executed by one or more processors 801 , the one or more processors 501 implement the method for the TOE component to process data as disclosed in the above method embodiment.

[0185] The bus system 804 may include a power bus, a control bus, and a status signal bus in addition to a data bus. The memory 802 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The processor 801 may be an integrated circuit chip with signal processing capabilities, and may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0186] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by one or more processors, the method for processing data by the TOE component disclosed in the method embodiment above is implemented.

[0187] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by one or more processors, implements the method for processing data by the TOE component as disclosed in the method embodiment above.

[0188] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0189] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0190] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1A step that specifies a function in one or more boxes.

[0191] It should be understood that the terms "system" and "network" are often used interchangeably in this application. The term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.

[0192] The above is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A method for processing data by a transmission control protocol offload engine TOE component, characterized in that: The method is used in the receiving direction of the TOE component, uses small-capacity storage to process complex TCP protocols, and supports multiple TCP sessions; The method comprises: The TOE component responds to receiving data sent by the peer device and confirms whether the host side can receive the data; When the host side cannot receive data, the received data is stored in an external storage unit, which is a storage device independent of the TOE component and is shared by all sessions, and the termination address of this data is recorded in the termination block of the basic metadata storage unit, and the termination address of this data is distinguished by session and recorded in the termination block of the corresponding session metadata in the session metadata storage unit. The basic metadata storage unit and the session metadata storage unit are storage units inside the TOE component, the basic metadata storage unit includes a start block and a termination block, and the session metadata storage unit stores multiple session metadata, each of which includes a start block and a termination block; When the host side recovers to be able to receive data, the starting block in the basic metadata storage unit is read, and the corresponding data is read from the external storage unit according to the address recorded in the starting block, and the read data is sent to the host side; Update the starting block in the basic metadata storage unit and the starting block corresponding to the session metadata in the session metadata storage unit to the last address of the data read this time; Determine whether the start block and the end block in the basic metadata storage unit are consistent. If not, return to the step of reading the start block in the basic metadata storage unit. If consistent, return a confirmation message to the peer device according to the recorded session number and refresh the sliding window. The method further comprises: when terminating a session, reading the start address and the end address of the corresponding session metadata in the session metadata storage unit, and judging whether they are consistent; if they are inconsistent, suspending the action of terminating the session; if they are consistent, terminating the session; The storing of the received data into the external storage unit comprises: extracting the five-tuple data of the received data, the session number of the session to which it belongs, the data size of the valid data and the valid data, and storing them into the external storage unit; wherein, a starting data block is allocated for caching the attribute information of the data, and at least one bearing data block is allocated for caching the valid data, the five-tuple data of the received data, the session number of the session to which it belongs, the data size of the valid data and the address of the valid data are stored into the starting data block, and the valid data are stored into the bearing data block indicated by the address of the valid data; The reading of the starting block in the basic metadata storage unit and reading the corresponding data from the external storage unit according to the address recorded in the starting block includes: reading the starting block in the basic metadata storage unit, obtaining the address recorded in the starting block, and adding one to the address to obtain the starting address; reading the corresponding data block from the external storage unit according to the starting address, obtaining the recorded five-tuple data, the session number of the session to which it belongs, the data size of the valid data and the address of the valid data, and obtaining the valid data by reading the address of the valid data.

2. The method according to claim 1, characterized in that After storing the received data in the external storage unit, the method further includes: When the remaining space of the external storage unit is greater than the first preset value, a confirmation message containing the sliding window is returned, and the sliding window is reduced accordingly according to the amount of received data; When the remaining space in the external storage unit is less than a first preset value, a confirmation message containing a sliding window is forcibly returned, wherein the sliding window is reset to zero and a session number corresponding to the currently received data is recorded.

3. The method according to claim 1, characterized in that After the response to receiving the data sent by the opposite device, the method further includes: When the remaining space of the external storage unit is less than the second preset value, the received data is discarded, and a confirmation message containing a sliding window is forcibly returned, wherein the sliding window is set to zero, the acknumber remains unchanged, and the session number corresponding to the currently received data is recorded.

4. A transmission control protocol offload engine TOE component, characterized in that: include: a receiving unit, configured to confirm whether the host side can receive the data in response to receiving the data sent by the opposite end device; When the host side cannot receive data, the received data is stored in an external storage unit, which is a storage device independent of the TOE component and is shared by all sessions, and the termination address of this data is recorded in the termination block of the basic metadata storage unit, and the termination address of this data is distinguished by session and recorded in the termination block of the corresponding session metadata in the session metadata storage unit. The basic metadata storage unit and the session metadata storage unit are storage units inside the TOE component, the basic metadata storage unit includes a start block and a termination block, and the session metadata storage unit stores multiple session metadata, each of which includes a start block and a termination block; The sending unit is configured to read the starting block in the basic metadata storage unit when the host side is restored to be able to receive data, read the corresponding data from the external storage unit according to the address recorded in the starting block, and send the read data to the host side; and update the starting block in the basic metadata storage unit and the starting block of the corresponding session metadata in the session metadata storage unit to the last address of the data read this time; and, determining whether the start block and the end block in the basic metadata storage unit are consistent, and if not, returning to the step of reading the start block in the basic metadata storage unit; If they are consistent, a confirmation message is returned to the peer device according to the recorded session number, and the sliding window is refreshed; when the session is terminated, the start address and end address of the corresponding session metadata in the session metadata storage unit are read to determine whether they are consistent; If they are inconsistent, the action of terminating the session is suspended; If they match, the session is terminated; The storing of the received data into the external storage unit comprises: extracting the five-tuple data of the received data, the session number of the session to which it belongs, the data size of the valid data and the valid data, and storing them into the external storage unit; wherein, a starting data block is allocated for caching the attribute information of the data, and at least one bearing data block is allocated for caching the valid data, the five-tuple data of the received data, the session number of the session to which it belongs, the data size of the valid data and the address of the valid data are stored into the starting data block, and the valid data are stored into the bearing data block indicated by the address of the valid data; The reading of the starting block in the basic metadata storage unit and reading the corresponding data from the external storage unit according to the address recorded in the starting block includes: reading the starting block in the basic metadata storage unit, obtaining the address recorded in the starting block, and adding one to the address to obtain the starting address; reading the corresponding data block from the external storage unit according to the starting address, obtaining the recorded five-tuple data, the session number of the session to which it belongs, the data size of the valid data and the address of the valid data, and obtaining the valid data by reading the address of the valid data.

5. The TOE assembly according to claim 4, characterized in that: Also includes: The feedback unit is configured to return a confirmation message containing a sliding window when the remaining space in the external storage unit is greater than a first preset value, and reduce the sliding window accordingly according to the amount of received data; when the remaining space in the external storage unit is less than the first preset value, forcibly return a confirmation message containing a sliding window, in which the sliding window is set to zero, and record the session number corresponding to the currently received data.

6. A computer device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing data by the transmission control protocol offload engine TOE component as described in any one of claims 1-3.

7. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by one or more processors, the method for processing data by a transmission control protocol offload engine TOE component as described in any one of claims 1-5 is implemented.

Citation Information

Patent Citations

  • TCP message processing method, TOE component and network equipment

    CN110958213A

  • Data transmission method and device

    CN111277600A

  • High-concurrency protocol stack unloading method and device based on large-capacity memory and medium

    CN113179327A

  • Data processing method, toe hardware and computer-readable storage medium

    WO2022257587A1