Data processing method of network card and network card

By splitting the address and length information of IO commands in the network card, data can be directly obtained from the host memory and sent to the peer server, solving the problems of bus pressure and memory resource consumption when the network card processes IO write commands, and achieving more efficient data processing.

CN121635801APending Publication Date: 2026-03-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2020-09-22
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, when a network interface card (NIC) processes an I/O write command, it needs to move data from the host's memory to the NIC's memory, which leads to high bus pressure, increased processor overhead, and a large amount of memory resources, increasing program complexity and memory resource consumption.

Method used

The network card (NIC) splits the data by obtaining the address and length information from the I/O command, retrieves the data directly from the host's memory, and sends it to the peer server, without storing the data in the NIC's memory. The data is then processed using a hardware engine.

Benefits of technology

It reduces the pressure on the network card bus and processor overhead, lowers the consumption of memory resources and program complexity, and improves data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121635801A_ABST
    Figure CN121635801A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method for a network card, and the method comprises the steps: the network card obtains a first IO command, the first IO command indicates to write data stored in a home terminal server into at least one opposite terminal server, and the first IO command comprises address information and length information of the data stored in the home terminal server; the network card splits the data according to the address information and the length information to obtain multiple groups of address information and length information; and the network card obtains data corresponding to the multiple groups of address information and the length information from a home terminal server according to the multiple groups of address information and the length information, and sends the data to at least one opposite terminal server. In the technical scheme of the invention, the network card does not need a large number of memories to store the data to be written, so that the complexity of a program and the consumption of memory resources are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application, the original application number is 202010999199.9, the original application date is September 22, 2020, and the entire contents of the original application are incorporated herein by reference. TECHNICAL FIELD

[0002] The present application relates to the technical field of servers, and more particularly to a data processing method of a network card and a network card. BACKGROUND

[0003] With the rise of cloud computing, in order to reduce the occupancy rate of the host processor (for example, central processing unit (CPU)), let more host CPUs be used to provide external sales, or let the user's experience be better, and let the user's CPU be less affected by the host background business. The original business running on the host, such as management business, storage business, network business, etc., can be unloaded to the network card, and the CPU on the network card processes the above-mentioned business, so that the CPU of the host can be basically provided to the user.

[0004] Taking the storage business as an example, in the related technical solution, for the input output (IO) write command, the network card needs to store the data to be written in the host into the storage of the network card, and then the processor of the network card processes the data and sends the data to the server at the other end. For the IO read command, the data is first read from the server at the other end to the storage of the network card, and then the data is written into the storage of the host.

[0005] In the above-mentioned related technical solution, on the one hand, since the data needs to be read from the storage of the host to the storage of the network card, it brings great pressure to the bus of the network card, and greatly increases the overhead of the processor in the network card. On the other hand, the network card needs a large amount of storage to store the data, and the storage and management of the data greatly increase the complexity of the program and the consumption of the storage resources. SUMMARY

[0006] The present application provides a data processing method of a network card and a network card, which can not need a large amount of storage to store the data to be written, thereby reducing the complexity of the program and the consumption of the storage resources.

[0007] In a first aspect, a data processing method of a network card is provided, including: the network card obtaining a first input / output (IO) command, the first IO command indicating that data stored in a local server is to be written into at least one opposite server, the first IO command including address information and length information of the data stored in the local server; the network card splitting the data according to the address information and the length information to obtain a plurality of groups of address information and length information; and the network card obtaining data corresponding to the plurality of groups of address information and length information from the local server according to the plurality of groups of address information and length information, and sending the data to the at least one opposite server.

[0008] In the above technical solution, for an IO write command, the data to be written does not need to be moved from the memory of the host to the memory of the network card. The network card processes the storage service based on the storage address and the data length of the data in the memory of the host, rather than the real data to be written stored in the memory of the host. In this way, on the one hand, since the data does not need to be read from the memory of the host to the memory of the network card, the pressure of the bus of the network card can be reduced, and the overhead of the processor of the network card is also reduced. On the other hand, the network card does not need a large amount of memory to store the data to be written, thereby reducing the complexity of the program and the consumption of memory resources.

[0009] In a possible implementation, the network card obtains the data corresponding to the plurality of groups of address information and length information from a first virtual machine (VM) corresponding to an identifier of the first VM in the local server according to the plurality of groups of address information and length information.

[0010] In another possible implementation, the memory of the network card does not store the data.

[0011] In another possible implementation, the method further includes: the network card receiving a plurality of IO commands; and the network card selecting the first IO command from the plurality of IO commands according to a storage address of the plurality of IO commands stored in the opposite server and / or a virtual machine (VM) of the local server issuing the plurality of IO commands.

[0012] In another possible implementation, the network card includes a hardware engine, and the hardware engine is configured to process a data plane. The hardware engine on the network card selects the first IO command from the plurality of IO commands according to a storage address of the plurality of IO commands stored in the opposite server and / or a virtual machine (VM) of the local server issuing the plurality of IO commands.

[0013] In another possible implementation, the method further includes: determining, by the network card, whether the plurality of data are all written into the at least one opposite end server according to context information of the first IO command, the context information of the first IO command including storage states of the plurality of data in the at least one opposite end server; and sending, by the network card, an IO write completion message to the local server through an interface when the plurality of data are all written into the at least one opposite end server respectively.

[0014] In a second aspect, a data processing method of a network card is provided, including: obtaining, by the network card, a second IO command, the second IO command indicating storage of data in at least one opposite end server into a local server, the second IO command including address information and length information of the data written into the local server; splitting, by the network card, the second IO command according to the address information and the length information to obtain a plurality of IO read messages, each of the plurality of IO read messages including information of each data in the data written into the local server; and sending, by the network card, the IO read messages to the at least one opposite end server respectively.

[0015] In the above technical solution, for IO read, the data read from the opposite end server does not need to be written into the memory of the network card and then into the VM memory. In this way, the data does not need to be uploaded into the memory of the network card, which can reduce resource consumption of the memory of the network card and bandwidth pressure on one hand, and can also reduce the overhead of the processor of the network card on the other hand.

[0016] In a possible implementation, the information of each data written into the local server includes any one of the following: address information and length information of each data written into the local server; or address information and length information of each data written into the local server and VM information of the local server in which the second IO command is issued; or a first ID and offset information of the data written into the local server, the first ID being used to indicate VM information of the local server in which the second IO command is issued and a plurality of sets of address information and length information of the data written into the VM.

[0017] In another possible implementation, the method further includes: receiving, by the network card, a first IO read response message from an opposite end server, the first IO read response message including first data required by the local server to obtain from the opposite end server; determining, by the network card, address information and length information of the first data written into the local server according to the first IO read response message; and storing, by the network card, the first data in the local server according to the address information and the length information.

[0018] In another possible implementation, the first IO read response message includes a first ID and offset information of the first data written to the local server, and the network card determines, according to the first ID, a plurality of sets of address information and length information of the data written in the VM; and the network card determines, according to the offset information, address information and length information of the first data written to the local server from the plurality of sets of address information and length information.

[0019] In another possible implementation, the first IO read response message includes address information and length information of the first data written to the local server and VM information of a VM in the local server in which the second IO command is issued, and the network card determines, according to the information included in the first IO read response message, address information and length information of the first data written to the local server.

[0020] In another possible implementation, the length information is within a scope of an authority table, and the authority table includes a plurality of sets of address information and length information of the data written in the local server; and the network card stores the first data in the local server according to the address information and length information included in the first IO read response message.

[0021] In another possible implementation, the method further includes: determining, by the network card according to context information of the second IO command, whether the plurality of data are all written to the local server, the context information of the second IO command including a completion state of storage of the plurality of data in the local server; and sending, by the network card, an IO read completion message to the local server through an interface when the plurality of data are all written to the local server.

[0022] In a third aspect, a network card is provided, including: an obtaining module, a splitting module, and a sending module, The obtaining module is configured to obtain a first input output (IO) command, the first IO command indicating writing data stored in a local server to at least one opposite server, and the first IO command including address information and length information of the data stored in the local server. The splitting module is configured to split the data according to the address information and the length information to obtain a plurality of sets of address information and length information. The sending module is further configured to obtain data corresponding to the plurality of sets of address information and length information from the local server according to the plurality of sets of address information and length information, and send the data to the at least one opposite server.

[0023] In a possible implementation, the obtaining module is specifically configured to: obtain, from the first virtual machine (VM) in the local server, data corresponding to the multiple sets of address information and length information according to the multiple sets of address information and length information and an identifier corresponding to the first VM in the local server that issues the first IO command.

[0024] In another possible implementation, the data is not stored in the memory of the network card.

[0025] In another possible implementation, the network card further includes a scheduling module, The obtaining module is further configured to receive multiple IO commands. The scheduling module is configured to select the first IO command from the multiple IO commands according to a storage address of the multiple IO commands stored in the peer server and / or a virtual machine (VM) in the local server that issues the multiple IO commands.

[0026] In another possible implementation, the network card includes a hardware engine configured to process a data plane, and the hardware engine is configured to select the first IO command from the multiple IO commands according to a storage address of the multiple IO commands stored in the peer server and / or a virtual machine (VM) in the local server that issues the multiple IO commands.

[0027] In another possible implementation, the network card further includes a determining module, The determining module is configured to determine whether the multiple data are all written into the at least one peer server according to context information of the first IO command, wherein the context information of the first IO command includes a storage state of the multiple data in the at least one peer server. The sending module is further configured to send an IO write completion message to the local server through an interface when the multiple data are all written into the at least one peer server respectively.

[0028] The beneficial effects of the third aspect and any one of the possible implementations of the third aspect are corresponding to those of the first aspect and any one of the possible implementations of the first aspect, which will not be repeated here.

[0029] In a fourth aspect, a network card is provided, which includes an obtaining module, a splitting module, and a sending module, The obtaining module is configured to obtain a second IO command, wherein the second IO command indicates storage of data in at least one peer server to a local server, and the second IO command includes address information and length information of the data written into the local server. The splitting module is configured to split the second IO command according to the address information and the length information to obtain a plurality of IO read messages, each of the plurality of IO read messages including information that each data in the data is written to the local server; The sending module is configured to send the IO read messages to the at least one opposite server respectively.

[0030] In a possible implementation, the information that each data is written to the local server includes any one of the following: address information and length information of each data written to the local server; or address information and length information of each data written to the local server and VM information of the local server in which the second IO command is issued; or a first ID and offset information of the data written to the local server, the first ID being used to indicate VM information in which the second IO command is issued and a plurality of sets of address information and length information of the data written to the local server.

[0031] In another possible implementation, the network card further includes: a determining module, a storage module, The obtaining module is further configured to receive a first IO read response message from an opposite server, the first IO read response message including first data that the local server needs to obtain from the opposite server; The determining module is configured to determine address information and length information of the first data written to the local server according to the first IO read response message. The storage module is configured to store the first data in the local server according to the address information and the length information.

[0032] In another possible implementation, the first IO read response message includes a first ID and offset information of the first data written to the local server, The determining module is specifically configured to determine a plurality of sets of address information and length information of the data written to the local server according to the first ID. The storage module is specifically configured to determine address information and length information of the first data written to the local server from the plurality of sets of address information and length information according to the offset information.

[0033] In another possible implementation, the first IO read response message includes address information and length information of the first data written to the local server and VM information of the local server in which the second IO command is issued, The determining module is specifically configured to determine address information and length information of the first data written to the local server according to information included in the first IO read response message.

[0034] In another possible implementation, the determining module is specifically configured to determine that the address information and the length information included in the first IO read response message are within the scope of an authority table, and the authority table includes a plurality of sets of address information and length information of data written in the local server. The storing module is specifically configured to store the first data in the local server according to the address information and the length information included in the first IO read response message.

[0035] In another possible implementation, the determining module is further configured to determine whether the plurality of data are all written in the local server according to context information of the second IO command, and the context information of the second IO command includes a completion state of storing the plurality of data in the local server. The sending module is further configured to send an IO read completion message to the local server through an interface when the plurality of data are all written in the local server.

[0036] The beneficial effects of the fourth aspect and any one of the possible implementation manners of the fourth aspect are corresponding to those of the second aspect and any one of the possible implementation manners of the second aspect, and thus are not described herein.

[0037] In a fifth aspect, a network card is provided, which includes a processor and a memory, and the processor runs instructions in the memory, so that the computing device performs the method steps performed in the first aspect or any one of the possible implementation manners of the first aspect.

[0038] In a sixth aspect, a network card is provided, which includes a processor and a memory, and the processor runs instructions in the memory, so that the computing device performs the method steps performed in the second aspect or any one of the possible implementation manners of the second aspect.

[0039] In a seventh aspect, a server is provided, which includes the network card in the third aspect or any one of the possible implementation manners of the third aspect.

[0040] In an eighth aspect, a server is provided, which includes the network card in the fourth aspect or any one of the possible implementation manners of the fourth aspect.

[0041] In a ninth aspect, a computer readable storage medium is provided, which includes instructions; the instructions are used to implement the method steps performed in the first aspect or any one of the possible implementation manners of the first aspect.

[0042] Optionally, as an implementation manner, the storage medium can be a non-volatile storage medium.

[0043] In a tenth aspect, a computer-readable storage medium is provided, including instructions; the instructions are used to implement the method steps performed in the second aspect or any possible implementation manner of the second aspect.

[0044] Optionally, as an implementation manner, the storage medium can be a non-volatile storage medium.

[0045] In an eleventh aspect, a chip is provided, which acquires instructions and executes the instructions to implement the method in the first aspect and any implementation manner of the first aspect.

[0046] Optionally, as an implementation manner, the chip includes a processor and a data interface, the processor reads the instructions stored on the storage through the data interface, and executes the method in the first aspect and any implementation manner of the first aspect.

[0047] Optionally, as an implementation manner, the chip can further include a storage, the storage stores the instructions, and the processor is configured to execute the instructions stored on the storage, and when the instructions are executed, the processor is configured to execute the method in the first aspect and any implementation manner of the first aspect.

[0048] In a twelfth aspect, a chip is provided, which acquires instructions and executes the instructions to implement the method in the second aspect or any possible implementation manner of the second aspect.

[0049] Optionally, as an implementation manner, the chip includes a processor and a data interface, the processor reads the instructions stored on the storage through the data interface, and executes the method in the second aspect or any possible implementation manner of the second aspect.

[0050] Optionally, as an implementation manner, the chip can further include a storage, the storage stores the instructions, and the processor is configured to execute the instructions stored on the storage, and when the instructions are executed, the processor is configured to execute the method in the second aspect or any possible implementation manner of the second aspect. BRIEF DESCRIPTION OF DRAWINGS

[0051] Figure 1 FIG. 1 is an architectural schematic diagram provided by an embodiment of the present application.

[0052] Figure 2 FIG. 2 is an application scenario schematic diagram provided by an embodiment of the present application.

[0053] Figure 3 FIG. 3 is a schematic flowchart of a data processing method of a network card provided by an embodiment of the present application.

[0054] Figure 4is a structural schematic diagram of a network card 400 provided by an embodiment of the present application.

[0055] Figure 5 is a schematic flow chart of a method for processing an IO write command by a network card provided by an embodiment of the present application.

[0056] Figure 6 is a schematic block diagram of IO command scheduling provided by an embodiment of the present application.

[0057] Figure 7 is a schematic block diagram of a data splitting process provided by an embodiment of the present application.

[0058] Figure 8 is a schematic block diagram of an IO command processing process provided by an embodiment of the present application.

[0059] Figure 9 is a schematic flow chart of a method for processing an IO read command by a network card provided by an embodiment of the present application.

[0060] Figure 10 is a schematic flow chart of a method for processing an IO write response message by a network card provided by an embodiment of the present application.

[0061] Figure 11 is a schematic flow chart of another method for processing an IO write response message by a network card provided by an embodiment of the present application.

[0062] Figure 12 is a schematic flow chart of another method for processing an IO write response message by a network card provided by an embodiment of the present application.

[0063] Figure 13 is a schematic block diagram of a network card 1300 provided by an embodiment of the present application. DETAILED DESCRIPTION

[0064] The technical solutions in the present application will be described below with reference to the drawings.

[0065] The present application will present various aspects, embodiments or features around a system including a plurality of devices, components, modules, etc. It should be understood and appreciated that each system can include additional devices, components, modules, etc., and / or can not include all of the devices, components, modules, etc. discussed in connection with the drawings. Furthermore, combinations of these solutions can also be used. In addition, in the embodiments of the present application, the words "example", "for example", etc. are used to mean serving as an example, instance or illustration. Any embodiment or design solution described as "example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design solutions. Rather, the word "example" is used to present the concept in a specific manner. In the embodiments of the present application, "corresponding" and "relevant" can be used interchangeably at times. It should be noted that when the distinction between them is not emphasized, the meanings expressed by them are consistent.

[0066] The network architecture and service scenarios described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, as network architectures evolve and new service scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0067] In this specification, the reference to "one embodiment" or "some embodiments" etc. means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, the appearances of the phrases "in one embodiment", "in some embodiments", "in other embodiments", "in additional embodiments" etc. in various places in the specification are not necessarily all referring to the same embodiment, but can refer to one or more but not all embodiments, unless otherwise specifically stated. The terms "comprising", "including", "having" and their conjugates mean "including but not limited to", unless otherwise specifically stated.

[0068] In the present application, "at least one" means one or more, and "multiple" means two or more. The association relationship between the associated objects is described by "and / or", which means that there can be three kinds of relationships, for example, A and / or B can represent the following cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one of the following" or similar expressions means any combination of these items, including any combination of single item or multiple items. For example, at least one of a, b, or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.

[0069] With the rise of cloud computing, in order to reduce the occupancy rate of host processors (for example, central processing units (CPUs)), more host CPUs are used to provide external sales, or to provide better user experience, so that the user's CPU is less affected by the host background business. For example, Figure 1As shown, current cloud computing manufacturers gradually offload the management services, storage services, network services, etc. originally running on the host to the network card, and the CPU on the network card processes the above services. In this way, the CPU of the host can be basically provided to the user.

[0070] The following describes the storage service in detail with the application scenario as an example. Figure 2 The application scenario as shown in the figure can include a host 210, a network card 220, and a destination storage device 230. The following describes each device in detail.

[0071] As shown in the figure, the scenario can include a host 210, a network card 220, and a destination storage device 230. The following describes each device in detail. Figure 2

[0072] 1. Host 210 The host 210 can include at least one processor 211 and a memory 212.

[0073] Optionally, the host 210 further includes a system bus 213. The at least one processor 211 and the memory 212 are respectively connected with the system bus 213.

[0074] The processor 211 can access the memory 212 through the system bus 213, for example, the processor 211 can read and write data or execute code in the memory 212 through the system bus. The system bus 213 can be, for example, a quick path interconnect (QPI) or an ultra path interconnect (UPI). The system bus 213 is divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 2 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0075] In one possible implementation, the function of the processor 211 is mainly to interpret the instructions (or code) of the computer program and process the data in the computer software. The instructions of the computer program and the data in the computer software can be saved in the memory 212.

[0076] The processor 211 is the operation core and control core of the host 210. The processor 211 can include multiple processor cores. All calculations, command acceptance, command storage, and data processing in the processor 211 are performed by the processor cores. The processor cores respectively and independently run program instructions, and use the parallel computing capability to speed up the program running speed. The processor cores have a fixed logical structure, for example, including a first-level cache, a second-level cache, an execution unit, an instruction-level unit, and a bus interface, etc. ​

[0077] Optionally, the processor 211 can be an integrated circuit chip and has a signal processing capability. As an example but not a limitation, the processor 110 is a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. Among them, the general purpose processor is a microprocessor and the like. For example, the processor 110 is a central processing unit (CPU).

[0078] The memory 212 is the main memory of the host 210 (also can be referred to as the memory of the host 210). The memory 212 is usually used to store various running software programs in the operating system, input output (IO) commands issued by the upper application and information exchanged with the external storage and the like. In order to improve the access speed of the processor 211, the memory 212 needs to have the advantage of fast access speed. In some computer system architectures, dynamic random access memory (DRAM) is used as the memory 212. The processor 211 can access the memory 212 at high speed through the memory controller (not shown in the figure) and perform read and write operations on any one storage unit in the memory 212. Figure 1

[0079] ​It should also be understood that the memory 212 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0080] 2. Network card 220 Network interface card 220 is used to enable host 210 to communicate with other servers in the network (e.g., Figure 1 Communication between the target storage device 230 (shown) and the network card 220. The network card 220 can be built into the host 210, or it can also be used as an external device of the host 210 and connected to the host 210 through an interface. This interface can be, for example, a bus and interface standard (PCIe) interface.

[0081] For ease of description, Figure 2 The network card 220 is described as an external device connected to the host 210.

[0082] The network interface card 220 may also include a memory 222 and a processor 221. Optionally, the network interface card 220 may also include a bus 223. The internal structure of the network interface card 220 may be similar to that of the host 210. For details, please refer to the description of the various parts of the host 210 above, which will not be repeated here.

[0083] 3. Destination storage device 230 The destination storage device 230 can also include a memory, a processor, a network card. Optionally, the destination storage device 230 can also include a bus. The internal structure of the destination storage device 230 can be similar to that of the host 210, and specific reference can be made to the description of the parts in the host 210 above, which will not be repeated here.

[0084] In the context of data processing and communication, the host 210 is taken as the local end, and the destination storage device 230 is taken as the communication opposite end. The virtual machine (VM) on the host 210 issues an input output (IO) command, and the processor 211 on the host 210 can send the IO command to the memory 212 through the bus 213. The network card 220 obtains the IO command from the memory 212 and processes the IO command.

[0085] Taking the IO command as an example of a read command and a write command, the read command is a command issued by an application (for example, a VM) running on the host to instruct reading data from a remote device (for example, a destination storage device), and the write command is a command issued by an application (for example, a VM) running on the host to instruct writing data to a remote device. The processor of the host can receive the IO command and store it in the memory, so that the IO command waits to be processed by the network card 220 and then sent to the destination storage device 230 as the communication opposite end.

[0086] In the related technical solution, taking the IO command as an IO write command as an example, the data of the IO write is stored in the memory 212, and the network card 220 needs to first move the data to be written from the memory 212 of the host 210 to the memory 222 of the network card 220. Then the processor 221 of the network card 220 obtains the data to be written from the memory 222 of the network card 220, processes the data to complete the storage service, generates a data message package, and sends the data to be written to the destination storage device 230 as the communication opposite end through the generated message package.

[0087] In the related technical solution, taking the IO command as an IO read command as an example, the processor 221 of the network card 220 obtains data from the destination storage device 230 as the communication opposite end, and stores the data in the memory 222 of the network card 220. Then the data is obtained from the memory 222 of the network card 220, assembled into complete IO data, and written into the memory 212 of the host 210.

[0088] In the related technical solution, taking the IO write command as an example, the data to be written needs to be moved from the memory 212 of the host 210 to the memory 222 of the network card 220, and then the processor 221 of the network card 220 processes the data to complete the storage service. On the one hand, since the data needs to be read from the memory 212 of the host 210 to the memory 222 of the network card 220, it brings great pressure to the bus 223 of the network card 220, and greatly increases the overhead of the processor 221 in the network card 220. On the other hand, the network card 220 needs a large amount of memory 222 to store the data, and the storage and management of the data greatly increase the complexity of the program and the consumption of the memory 222 resources.

[0089] Therefore, the present application provides a data storage method, and the data to be written does not need to be moved from the memory 212 of the host 210 to the memory 222 of the network card 220. On the one hand, the resource consumption of the memory 222 and the bandwidth pressure can be reduced, and on the other hand, the overhead of the processor 221 in the network card 220 can also be reduced.

[0090] The data storage method provided by the embodiment of the present application will be described in detail below. Figure 3 The data storage method provided by the embodiment of the present application will be described in detail below.

[0091] Figure 3 is a schematic flowchart of a data processing method of a network card provided by the embodiment of the present application. As shown in Figure 3 , the method can include steps 310-330, which will be described in detail below.

[0092] Step 310: The network card acquires a first IO command, and the first IO command includes address information and length information of data storage in a local server.

[0093] In the embodiment of the present application, the first IO command can be used to instruct to write the data stored in the local server into at least one opposite server. As an example, the data can be stored in the memory of the local server.

[0094] As an example, the local server can be the host 210 in Figure 2 . The opposite server can be a storage device, or a computing device with computing capability. As an example, the opposite server is the destination storage device 230 in Figure 2 .

[0095] The network card can be an external device of the local server, and is connected with the local server through an interface. The interface can be a bus and a peripheral component interface express (PCIE) interface. For specific connection relationship, please refer toFigure 2 The details are described in the foregoing description and will not be repeated here.

[0096] Step 320: The network card splits the data according to the address information and the length information, to obtain multiple sets of address information and length information.

[0097] The network card can split the data based on the address information and the length information of the data carried in the first IO command, to obtain multiple sets of address information and length information. It should be understood that the address information and the length information of the data can be used to describe a data block stored in the memory of the local server.

[0098] In the embodiment of the application, the memory of the network card can not need to store the data in the local server that needs to be written to at least one opposite server, therefore, the splitting of the data by the network card can not be based on the real data, but according to the virtual address information (for example, the address information and the length information of the data in the memory of the local server) of the data, to split the data, on the one hand, since the data does not need to be read from the memory of the local server to the memory of the network card, the pressure of the network card bus can be reduced, and the overhead of the network card processor is also reduced. On the other hand, the network card does not need a large amount of memory to store the data to be written, which reduces the complexity of the program and the consumption of memory resources.

[0099] Step 330: The network card obtains the data corresponding to the multiple sets of address information and length information from the local server according to the multiple sets of address information and length information, and sends the data to at least one opposite server.

[0100] It should be understood that in step 330, when the network card needs to send data to at least one opposite server, it directly obtains the data corresponding to the multiple sets of address information and length information from the local server according to the multiple sets of address information and length information, and sends the data to at least one opposite server.

[0101] It should be noted that the data obtained by the network card will not be stored in the memory of the network card, but after obtaining the data from the memory of the local server, the data is directly sent to at least one opposite server.

[0102] In a possible implementation manner, the network card can obtain the data corresponding to the multiple sets of address information and length information from the local server based on the multiple sets of address information and length information obtained after splitting. Alternatively, in some embodiments, the network card can also obtain the data corresponding to the multiple sets of address information and length information from the first virtual machine (VM) corresponding to the first VM that issues the first IO command based on the multiple sets of address information and length information. In this way, the network card can accurately obtain the data from the memory of a certain VM.

[0103] In the technical solution, the network card can be used as an external device of the local server and is connected to the local server through an interface. For an IO write command, the data to be written does not need to be moved from the memory of the local server to the memory of the network card. The network card processes the storage service based on the storage address and the data length of the data in the memory of the local server, instead of the real data to be written stored in the memory of the local server. In this way, on the one hand, since the data does not need to be read from the memory of the local server to the memory of the network card, the pressure of the network card and the memory bus can be reduced, and the overhead of the network card processor is also reduced. On the other hand, the network card does not need a large amount of memory to store the data to be written, thereby reducing the complexity of the program and the consumption of the memory resources.

[0104] The following will be described in detail in combination with Figure 4 a possible structure of the network card provided by the embodiment of the present application.

[0105] Figure 4 Fig. 4 is a structure schematic diagram of a network card 400 provided by the embodiment of the present application. As shown in the figure, the network card 400 is connected to the host 210 through a PCIE interface. Figure 4

[0106] The network card 400 can include a data plane offload engine 410, a memory controller 420, a CPU core 430, a memory 440, and a system bus 450.

[0107] 1. Data plane offload engine 410 As an example, the data plane offload engine 410 can be composed of a hardware logic or a ready-made programmable gate array (FPGA) or a network processor (NP) engine of a special processing architecture specially supporting data plane processing. The feature is that it can perform fast forwarding processing on the message, but it is not suitable for complex protocol processing.

[0108] It should be understood that the data plane offload engine 410 is more suitable for network forwarding processing, so the data plane of the network forwarding is usually borne by the data plane offload engine 410. However, due to the complexity of the service, it is difficult to completely complete the data plane of the storage service directly by the data plane offload engine 410, and the CPU core 430 is usually needed to complete the data plane of the storage service.

[0109] The data plane offload engine 410 can be connected to the host 210 through a PCIE interface to obtain the data stored in the memory 212 of the host 210. The data plane offload engine 410 can also be connected to the CPU core 430 and the memory controller 420 through the system bus 450 to realize high-speed communication between the modules in the data plane offload engine 410 and the CPU core 430 and the memory controller 420.​

[0110] The data plane offload engine 410 can internally include a device emulation module 411, an IO command processing module 412, a data scheduling module 430, and a network protocol processing engine 460.

[0111] The functions of each module included in the data plane offload engine 410 will be described in detail below.

[0112] The device emulation module 411 is mainly used to implement the emulation of devices, so that the network card 400 presents the required devices, such as storage, network, etc., to the host or a virtual machine VM running on the host. As an example, the device emulation module 411 is used to implement the presentation of non-volatile memory express (NVMe) storage devices, small computer system interface (SCSI) devices, virtual small computer system interface (virtio-SCSI) devices, virtio-BLK devices, and other types of virtio devices.

[0113] It should be understood that the device emulation can also be completed by hardware logic and CPU cores together, and generally the strong data interaction is completed by the data plane offload engine, and the configuration related is completed by the CPU core.

[0114] The IO command processing module 412 is used to perform simple analysis and processing on the IO command. As an example, it can be used to determine whether the IO command is a read command or a write command. As another example, for the read and write commands of the IO, scheduling is usually required to ensure the quality of service (Qos) of the device IO.

[0115] The data scheduling module 430 is used to schedule a plurality of IO commands. As an example, the scheduling can include Qos processing of data. For example, in order to avoid unreasonable load of a VM or a volume, the bandwidth and packet rate of each device need to be limited. For storage IO data, it is usually also required to manage the IO commands based on the input output operation per second (IOPS) of the volume, the bandwidth and the IOPS and bandwidth of the entire VM.

[0116] The network protocol processing engine 460 is mainly used for completing the processing of a network protocol, and ensuring that data is reliably transmitted to a destination node. The network protocol can be various, and the present application does not make a specific limitation on the network protocol. For example, the network protocol can be a remote direct data access (RDMA) protocol, or the network protocol can also be a transmission control protocol (TCP) protocol, or the network protocol can also be a self-defined reliable transmission protocol.

[0117] 2. Memory controller 420 The memory controller 420 is used for controlling the data interaction between the memory 440 and the CPU core 430. Specifically, the memory controller 420 receives a memory access request from the CPU core 430, and controls the access to the memory 440 based on the memory access request.

[0118] In an implementation, each memory controller 420 performs the addressing for the memory 440 through the system bus 450. An arbiter (not shown in the figure) is configured in the system bus, and the arbiter is responsible for processing and coordinating the competitive access of the plurality of CPU cores 430.

[0119] 3. CPU core 430 The CPU core 430 is the most important component of the CPU, and can also be referred to as a CPU processing unit. The CPU core 430 is manufactured by monocrystalline silicon through a certain production process, and all the computing, command receiving, command storage and data processing of the CPU are performed by the CPU core 430. The CPU core 430 independently runs program instructions respectively, and accelerates the running speed of the program by using the parallel computing capability. Various CPU cores 430 have fixed logic structures, for example, the CPU core 430 includes a first-level cache, a second-level cache, an execution unit, an instruction-level unit and a bus interface and the like.

[0120] The CPU core 430 is generally used for performing complex service processing, and usually runs an operating system (OS), so that complex service processing software, various management software, control plane software and the like can be run thereon.

[0121] 4. Memory 440 The memory 440 can be an external memory of the CPU core 430, and is used for storing the program running of the CPU core 430 and part of the table entries of the data plane offload engine 410.

[0122] The external memory 440 is not specifically limited in the embodiments of the present application, and as an example, the external memory 440 is a double data rate (DDR) memory.

[0123] It should be understood that the on-chip memory integrated inside the data plane offload engine 410 is a cache, but it is fast and high cost, and can only be integrated in small amounts. Large-scale entries need to be stored in the external memory 440. For example, the external memory 440 stores large forwarding flow tables required for network forwarding, transceiver queues of network connections, context table entries of network connections, context table entries of IOs, and the like.

[0124] It should also be understood that the so-called data upload CPU is actually the external memory 440 of the upload CPU core 430. In the following of this paper, the data upload CPU and the upload CPU memory refer to the external memory 440 of the upload CPU core 430.

[0125] 5, system bus 450 The system bus 450 can connect the data plane offload engine 410 with the CPU core 430 and the memory controller 420, so that the data plane offload engine 410 and the CPU core 430 and the memory controller 420 can communicate through the system bus 450.

[0126] Next, taking the hardware architecture shown in Figure 4 as an example, combined with the examples in Figure 5 , a specific implementation manner of the network card processing IO write command is described in detail. It should be understood that the examples of Figure 5 are only to help those skilled in the art understand the embodiments of the application, and are not intended to limit the embodiments of the application to Figure 5 specific numerical values or specific scenarios. Those skilled in the art can obviously make various equivalent modifications or changes based on the examples given, and such modifications and changes also fall within the scope of the embodiments of the application.

[0127] Figure 5 is a schematic flow chart of a method for processing IO write command by a network card provided by the embodiments of the application. As Figure 5 shown, the method can include steps 510-560, which will be described in detail below.

[0128] Step 510: The VM in the host 210 issues an IO write command.

[0129] A certain VM of the host can initiate an IO write command of storage service based on a storage IO device interface (such as NVMe, SCSI, Virtio-BLK, Virtio-SCSI, etc.).

[0130] It should be noted that Figure 5 the IO command or the IO command to be processed mentioned in the embodiments shown in

[0131] It should be understood that the embodiments of the present application can identify a virtualized device by an identity (ID). The storage IO device above is usually mapped to a function on PCIE, and in the case of single-root I / O virtualization (SR-IOV) enabled, the storage IO device above can be a physical function (PF) or a virtual function (VF). In the case of scalable I / O virtualization (scalable-IOV) enabled, the storage IO device above can also be an ADI.

[0132] Since the number of VFs is usually more, in the VM application scenario, the VM is mainly allocated a VF, and for the sake of simplicity of description, the following description is described by taking the VF as an example, but as long as it is not particularly emphasized that it can only be a PF, all the descriptions of the VF are also applicable to the PF. That is, as an example, a VM running in the host 210 can be identified by a VF.

[0133] Step 520: The processor 211 in the host 210 sends a prompt message to the network card 400.

[0134] After the processor 211 sends the IO write command to be processed to the memory 212, the processor 211 can send a prompt message to the network card 400. The prompt message is used to inform the data plane offload engine 410 that there is an IO command to be processed.

[0135] As an example, the prompt message can be a door bell (DB).

[0136] Step 530: The IO command processing module 412 in the network card 400 processes the IO write command to be processed.

[0137] For IO commands such as IO read and IO write commands, Qos control is usually required. For example, for the logical unit number (LUN) information (in NVMe, it is the namespace) in the IO command, the LUN ID of the VM and the VF information of the entry can be converted into a global LUN ID, which can be the address information of the destination storage device. Or the VF+VM LUN ID can also be directly used.

[0138] For the sake of description, the LUN ID appearing in the following text can be understood as a global LUN ID.

[0139] It should be understood that the VF information (e.g., VF ID) is not in the IO command, just like a message entering the port attribute of the network card, this information is not in the message.

[0140] Step 540: The data scheduling module 430 in the network card 400 schedules the to-be-processed IO command.

[0141] It should be understood that step 540 is optional. That is, if the to-be-processed IO command is multiple IO commands, in order to avoid unreasonable load of a VM or a volume, it is necessary to limit the bandwidth and packet rate of each device, and therefore, it is necessary to schedule the multiple IO commands to select the IO command meeting the condition from the multiple IO commands. The data scheduling module 430 can store the IO command meeting the condition in the IO message receiving queue in the memory 440 of the network card 400.

[0142] As shown in FIG. 4, the data scheduling module 430 in the data plane offload engine 410 schedules the multiple IO commands and stores the scheduled IO command in the IO message receiving queue. Figure 6

[0143] In a possible implementation, the data scheduling module 430 can perform one-level scheduling on the multiple IO commands to select the IO command meeting the condition. For example, the data scheduling module 430 can schedule the to-be-processed IO command according to the storage address of the storage device storing the to-be-processed IO command to select the IO command meeting the condition. For another example, the data scheduling module 430 can also schedule the to-be-processed IO command according to the virtual machine VM in the host 210 issuing the multiple IO commands to select the IO command meeting the condition.

[0144] In another possible implementation, the data scheduling module 430 can also perform multi-level scheduling on the multiple IO commands to select the IO command meeting the condition. Taking two-level scheduling as an example, the first level is to schedule the IO command based on the LUN ID, and the second level is to schedule the IO command based on the VM. Specifically, the data scheduling module 430 can schedule the to-be-processed IO command according to the storage address of the storage device storing the to-be-processed IO command and the virtual machine VM in the host 210 issuing the multiple IO commands to select the IO command meeting the condition.

[0145] In the embodiment of the application, if the specification of the IO message receiving queue is not large, the internal cache of the data plane offload engine 410 can be used for storage. However, if the specification of the IO message receiving queue is relatively large, the internal cache of the chip cannot save, and these queues can be placed in the external memory 440 of the network card 400.

[0146] ​The IO command meeting the condition can be a flow measurement on a data size of the IO command read and write. It should be understood that the measurement can include, but is not limited to, measuring IOPS, IO times allowed per second, or IO bandwidth, etc.

[0147] The token bucket algorithm can be used in the embodiment of the present application to measure the flow. The token bucket algorithm is to place a certain number of tokens in the token bucket, and one token allows to send a specified unit of data (for example, 1 Byte). After sending 1 Byte of data, one token needs to be removed from the bucket. When there is no token left in the bucket, continuing to send data of any size will be considered to exceed the rated bandwidth. Only when there is a token left in the bucket, data can continue to be sent.

[0148] An example can obtain more committed performance and allowed peak performance (maximum allowed performance in the case of idle processing capacity) through 2 token buckets to achieve more accurate control.

[0149] The token bucket algorithm is like water in a pond, which can flow out and flow in. The tokens in the token bucket can not only be removed, but also can be added. In order to ensure that data can be sent at any time, tokens can also be added to the bucket. Therefore, the speed of adding tokens to the token bucket determines the speed of sending data. For example, the bandwidth of a user is set to 1 GBps, and each token represents 1 Mbit, as long as 1000 tokens are added to the bucket per second.

[0150] Therefore, in order to obtain more flexible QoS scheduling effect in the embodiment of the present application, the token bucket provides a token adjustment interface, and the CPU core 430 replenishes tokens based on the characteristics of the packet. For example, in order to avoid that the VM continuously generates small IO commands, the CPU core 430 can perform on-site merging and appropriately replenish part of the tokens. In this way, bandwidth shortage can be avoided, and user experience can be affected.

[0151] In the above technical solution, the data plane performs QoS scheduling, which can obtain more accurate and stable QoS guarantee and better performance. The token replenishment adjustment of the CPU core can also provide higher QoS flexibility.

[0152] Step 550: The CPU core 430 processes the IO command.

[0153] After the IO command is stored in the external memory 440 of the network card 400, the software on the CPU core 430 analyzes the IO command. As an example, the IO command can generally include information such as a LUN, a logical block address (LBA), a data size, and a scatter gather (SG) list pointing to a data block.

[0154] The LUN represents an ID of a storage unit to be accessed, for example, Figure 2 The LUN represents an ID of a storage unit to be accessed, for example,

[0155] The SG list is a list of multiple items each consisting of an address and a length. One address + length constitutes one memory block, and multiple address blocks constitute the total memory size required for storing IO data in the host. That is, the SG list refers to a sequence of start addresses + lengths to describe a scatter-stored data block, and multiple data blocks are combined into a logically continuous data block.

[0156] It should be understood that one address + length in the SG list can correspond to the address information and the length information of the data described above.

[0157] For IO writing, the SG list indicates where to read data from the memory (RAM) of the host and write it into the target storage device.

[0158] It should be noted that the SG itself only has address and length information, and when virtualization is applied, the VF ID information is also added to accurately map to the memory address of the corresponding VM.

[0159] In the embodiments of the present application, the CPU core 430 can perform storage service processing based on the address of the data to be processed in the host memory and the data length. The storage service processing process can be various, for example, data splitting processing, data deduplication, data encryption, data compression, data snapshot, and the like.

[0160] The specific implementation process of the CPU core 430 performing storage service processing based on the address of the data to be processed in the host memory and the data length will be described in detail below taking data splitting processing as an example.

[0161] It should be understood that for the distributed storage system commonly used on cloud computing, data will be scattered and stored on hundreds or thousands of destination storage devices. In this way, high-speed concurrent access to data can be achieved at the same time, high performance can be obtained, and better security and scalability can be obtained. This process is the process of splitting data. That is, the data is split into fixed-size data blocks, such as 4K, 8K, 16K, 32K, etc. Different data blocks are sent to different destination storage devices.

[0162] For IO write, the data to be written needs to be split, and different data blocks are sent to different destination storage devices. For IO read, different data blocks need to be obtained from multiple destination storage devices, and different data blocks are combined into a complete IO data. Reading is the reverse process of writing.

[0163] Optionally, in some embodiments, in order to improve the efficiency of sending to multiple destination storage devices, it is also common to appropriately aggregate multiple data blocks sent to the same destination storage device into a larger data packet, for example, combined into a 128KB large packet and sent out at a time. In this way, frequent calls to the protocol stack for data transmission can be avoided, causing CPU core 430 to be overloaded.

[0164] The process of splitting data is generally as shown in Figure 7 IO data is split horizontally to split one IO data into multiple data blocks. Vertically generated is a data packet, each of which uniquely corresponds to a distributed remote destination storage device. Each data packet can include a data block, or it can include multiple data blocks sent to the same destination storage device.

[0165] In the embodiment of the application, since the real data of IO write is stored in the memory 212 in the host 210, and is not stored in the memory 440 in the network card 400, the partitioning process of the CPU core 430 is not based on the real data of IO write, but based on the virtual data pointer (address information and length information of the data in the memory 212 in the host 210) of the SG in the IO command for splitting, which points to the data block of the corresponding host VF address and length.

[0166] That is, the embodiment of the application does not split the real data of IO write, but splits the memory address and data length of the IO data of a certain VM stored in the memory 212, thereby obtaining the VF+SG information after splitting.

[0167] Step 560: The CPU core 430 instructs the network protocol processing engine 460 to send the data of IO write to at least one remote destination storage device.

[0168] After processing the I / O command, CPU core 430 can generate a message packet, which includes a message header. The message header can carry information about the corresponding destination storage device, which is usually the network connection's send queue. CPU core 430 can put the split M data blocks into M message queues. Each data block does not store the actual data to be written, but rather VF+SG information.

[0169] CPU core 430 can also send storage data processing instructions to network protocol processing engine 460. These instructions are used to instruct network protocol processing engine 460 to obtain the actual data written by IO, encapsulate the actual data written by IO, and send the encapsulated message to the corresponding remote destination storage device, thereby realizing the IO write process.

[0170] As an example, the network protocol processing engine 460 reads the VF+SG information stored in each data block from M message queues, and initiates DMA to the VM corresponding to the VF, thereby obtaining the actual data of IO write corresponding to each data block based on the VF+SG information.

[0171] like Figure 8 As shown, for example, the network protocol processing engine 460 can receive message 1 sent by the CPU core 430, which contains: VF1+SG1, VF2+SG1, VF3+SG1, ..., VFm+SGn. The network protocol processing engine 460 can obtain or read the data corresponding to VF1+SG1, VF2+SG1, VF3+SG1, ..., VFm+SGn from the memory 212 of the host 210 through the PCIe interface.

[0172] For example, the network protocol processing engine 460 can receive messages 2 sent by the CPU core 430, which contain: VF1+SG2, VF2+SG2, VF3+SG2, ..., VFm+SGm. The network protocol processing engine 460 can obtain or read the data corresponding to VF1+SG2, VF2+SG2, VF3+SG2, ..., VFm+SGm from the memory 212 of the host 210 through the PCIe interface.

[0173] The network protocol processing engine 4600 can encapsulate the data obtained from the memory 212, and then combine it into a message that actually contains data before sending it to the remote destination storage device, thereby realizing the writing of the data written by IO to the destination storage device.

[0174] Optionally, the network card 400 can also determine whether the data is all written into the at least one target storage device according to the context information of the IO command. When the plurality of data is all written into the at least one target storage device respectively, the network card 400 sends an IO write completion message to the host 210 through the PCIE interface. It should be understood that the context information of the IO command can include the storage state of the data in the at least one target storage device.

[0175] The following describes in detail a specific implementation manner of the network card processing the IO read command with the hardware architecture shown in Figure 4 as an example and in combination with the examples in Figure 9 . It should be understood that the examples in Figure 9 are only used to help those skilled in the art understand the present application, and are not intended to limit the application to Figure 9 specific numerical values or specific scenarios. Those skilled in the art can obviously make various equivalent modifications or changes according to the examples given, and such modifications and changes also fall within the scope of the present application.

[0176] Figure 9 is a schematic flowchart of a method for processing an IO read command by a network card provided by the present application. As shown in Figure 9 , the method can include steps 910-950, which are described in detail below.

[0177] Step 910: The VM in the host 210 issues an IO read command.

[0178] The IO read command is used to instruct to obtain the data to be read from the target storage device and store the data in the host 210. As an example, the data can be stored in the memory corresponding to the VM issuing the IO read command in the host 210.

[0179] The IO read command can also be referred to as an IO read message.

[0180] Step 915: The processor 211 in the host 210 sends a prompt message to the network card 400.

[0181] Step 917: The data plane offload engine 410 in the network card 400 forwards the IO read command to the external memory 440 of the network card 400.

[0182] Step 920: The CPU core 430 on the network card 400 processes the IO read command.

[0183] The software on the CPU core 430 analyzes the IO read command. The IO read command can generally include the information of the storage device to be read, including but not limited to: LUN, LBA, data size, and VF+SG list of the memory of the host 210 where the data is stored locally, and the like.

[0184] For the IO read, the VF+SG information indicates where the data read from the target storage device is written to the memory of the host 210.

[0185] In the embodiment of the present application, the CPU core 430 can split the IO read command according to the address information and length information (SG list) of the memory of the host 210 where the data read from the target storage device is written, to obtain a plurality of IO read messages. Each of the plurality of IO read messages includes information of each data read from the target storage device written to the memory of the host 210.

[0186] It should be understood that the information of each data written to the memory of the host 210 includes any one of: address information and length information (SG list) of each data written to the memory of the host 210; or address information and length information of each data written to the memory of the host 210 and VM information (VF+SG list) of the host 210 where the IO read command is issued; or a first ID indicating the VM information of the host 210 where the IO read command is issued and a plurality of sets of address information and length information (SG list) of the data written to the memory of the host 210.

[0187] Step 925: The CPU core 430 instructs the network protocol processing engine 460 to send a message packet to the remote target storage device.

[0188] After the CPU core 430 processes the IO read command, the CPU core 430 can instruct the network protocol processing engine 460 to send the plurality of IO read messages to the plurality of remote target storage devices. The message can include a message header, and the message header can carry the storage address information of the corresponding target storage device, which can generally be the sending queue of the network connection.

[0189] The CPU core 430 can also instruct the network protocol processing engine 460 to initiate the sending process of the network protocol, and the network protocol processing engine 460 sends the IO read message packet to the corresponding target storage device.

[0190] Step 930: The data plane offload engine 410 receives the returned IO read response message from the target storage device.

[0191] The destination storage device can read the corresponding storage data based on the storage address information in the IO read message packet, and feed back the storage data to the data plane offload engine 410 through an IO read response message.

[0192] The IO read response message can be understood as a response message fed back by the destination storage device to the received IO read command.

[0193] The format of the IO read response message returned by the destination storage device is various, which is not limited in the present application, and will be described in detail in combination with step 940, which is not described in detail here.

[0194] Step 940: The data plane offload engine 410 directly writes the data in the IO read response message into the memory of the VM.

[0195] In the embodiment of the present application, after receiving the data in the IO read response message, the data plane offload engine 410 can directly write the data in the IO read response message into the memory of the VM where the IO read command is issued, without writing the data into the memory 440 of the network card 400 first and then writing the data from the memory 440 into the memory of the VM where the IO read command is issued. That is, the memory 440 of the network card 400 does not store the data in the IO read response message.

[0196] The data plane offload engine 410 needs to obtain the address information and length information of each data block stored in the storage 212 of the host 210 according to the IO read message, so as to directly write the data into the memory of the VM of the host 210 without writing the data into the memory 440 of the network card 400 first and then writing the data into the memory of the VM. In this way, the data does not need to be sent to the memory of the network card, which can reduce the resource consumption and bandwidth pressure of the network card memory on the one hand, and can also reduce the overhead of the network card processor on the other hand.

[0197] Specifically, the data plane offload engine 410 can determine the VF+SG information of each data block stored in the storage 212 of the host 210. The specific implementation manner of obtaining the VF+SG information is various, which will be described in detail below.

[0198] In one possible implementation manner, referring to Figure 10 The IO read response message can include the ID, offset information and data of each data block. The data plane offload engine 410 can query the context of the corresponding IO according to the ID of each data block in the IO read response message, and obtain the VF+SG information.

[0199] It should be understood that in the embodiments of the present application, the CPU core 430 of the data plane offload engine 410 can apply for the context information of an IO after sending an IO read command to a target storage device. The context of an IO can correspond to an ID. The context information of the IO can be used to record the ID of each chunk corresponding to the IO, the VF processing the IO, the LUN and SG list of the VM, and the address and length of the data to be read in the target storage device.

[0200] It should be noted that one IO read command can have multiple such chunks, which can be different chunks of different IOs.

[0201] For example, the ID corresponding to a data chunk in the IO read message is ID1, and the offset information is 2. Referring to Figure 10 , the data plane offload engine 410 can determine that the information stored in the memory 212 of the host 210 is VF1+SG2 according to the ID ID1 and the offset information 2 when performing address query. After obtaining the information of VF1+SG2, the data plane offload engine 410 can directly write the data into the memory 212 of the host 210 through direct memory access (DMA) technology.

[0202] In another possible implementation, referring to Figure 11 , the IO read response message can include a message ID (message ID, MSG ID) and data. The data plane offload engine 410 can obtain the VF+SG information in the MSDID table according to the MSG ID in the IO read response message.

[0203] It should be understood that in the embodiments of the present application, an ID and a MSG ID table can be created based on each IO read message. The MSG ID table records the VF+SG information of each data chunk. The MSG ID can be carried in the sent IO read message, and of course the length information of each chunk is also required. The order of the chunks is consistent with the ID order in the MSG ID table.

[0204] When the IO read response message is returned, the data plane offload engine 410 can obtain the SG information in the MSDID table according to the MSG ID of the returned message, and can obtain the specific address to be put in according to the number of the data chunk. And the data is written into the address through DMA technology, so as to realize the direct writing of the data into the memory of the VM.

[0205] In another possible implementation, referring to Figure 12The IO read response message can carry one or more VF+SG and data. It should be understood that the one or more VF+SG carried in the IO read response message is the address information of the data read back in the memory of the host.

[0206] The data plane offload engine 410 can directly obtain the VF+SG information of the corresponding data block through the IO read response message, and based on the VF+SG information, directly write the data into the memory 212 of the host 210 through a direct memory access (DMA) technology.

[0207] Optionally, in some embodiments, in order to verify whether the VF+SG information carried in the IO read response message is legal and valid, the data plane offload engine 410 can compare the SG address in the IO read response message with the SG information in the corresponding SG authority table based on the VF query, to see whether it is within the address range of the authority table. If it is within the address range of the authority table, the data plane offload engine 410 directly writes the data into the host address corresponding to the VF+SG through the DMA technology, thereby realizing direct writing of the data into the memory of the VM. Otherwise, the writing of this data block is discarded, and error processing is notified.

[0208] It should also be understood that in the embodiments of the present application, an SG authority table can be established for each VF for each IO read message, and the SG authority table is created when the IO is initiated and is deleted when the IO is completed. The SG authority table includes the VF+SG corresponding to the writing of data into the memory of the VM.

[0209] Step 950: The data plane offload engine 410 sends an IO read completion message to the host 210.

[0210] Since the returned IO read response message is composed of M data packet return messages, only when the return messages of the M data packets are all returned, it means that an IO read is completed. Since this process is relatively simple to handle, in the embodiments of the present application, the data plane offload engine 410 can be used to complete it, so that the returned data can no longer be processed by the CPU core 430 in the network card 400, thereby improving the processing performance.

[0211] As an example, after the CPU core 430 in the network card 400 judges that all data reception is completed, it sends an IO read completion message to the device simulation module 411 of the data plane offload engine 410. There are various specific implementation manners, and the possible implementation manners are described in detail below.

[0212] In a possible implementation, on the basis of allocating an IO context in advance, the IO context corresponding to each ID records the completion status of the message ID in addition to the relevant information necessary for processing the IO. The data plane offload engine 410 obtains the context of the IO according to the IO ID carried in the returned message, and sets the status of the corresponding message to the completion status according to the message ID. When the status of all messages is set to the completion status, the CPU core 430 in the network card 400 directly sends an IO read completion message to the device simulation module 411.

[0213] It should be understood that when the IO read is completed, the corresponding IO context set is invalidated, and the CPU can allocate the context again.

[0214] In another possible implementation, on the basis of allocating an IO context in advance, the IO context corresponding to each ID records the offset number of the data block in addition to the relevant information necessary for processing the IO. The returned message can carry the IO ID and the offset number of the data block, the data plane offload engine 410 obtains the IO ID, obtains the context of the IO, and sets the completion flag of the corresponding data block according to the offset number of the data block. When all data is completed, the CPU core 430 in the network card 400 directly sends an IO read completion message to the device simulation module 411.

[0215] The data processing method of the network card in the embodiment of the present application is described in detail above. Figure 1 to Figure 12 The device embodiment of the present application will be described in detail below. Figure 13

[0216] Figure 13 is a schematic block diagram of a network card 1300 provided by an embodiment of the present application. The network card 1300 can perform each step of the method shown in Figure 2 , Figure 5 , Figure 9 To avoid repetition, details are not described here. The network card 1300 comprises an obtaining module 1310, a splitting module 1320, a sending module 1330, The obtaining module 1310 is configured to obtain a first input / output (IO) command, the first IO command indicating writing data stored in a local server into at least one peer server, the first IO command comprising address information and length information of the data stored in the local server; The splitting module 1320 is configured to split the data according to the address information and the length information, to obtain a plurality of groups of address information and length information; ​The sending module 1330 is further configured to acquire data corresponding to the multiple sets of address information and length information from the local server according to the multiple sets of address information and length information, and send the data to the at least one opposite server.

[0217] Optionally, the obtaining module 1310 is specifically configured to: acquire the data corresponding to the multiple sets of address information and length information from the first virtual machine (VM) according to the multiple sets of address information and length information and an identifier corresponding to a first VM in the local server that issues the first IO command.

[0218] Optionally, the data is not stored in the memory of the network card.

[0219] Optionally, the network card 1300 further includes a scheduling module 1340, The obtaining module 1310 is further configured to receive multiple IO commands. The scheduling module 1340 is configured to select the first IO command from the multiple IO commands according to a storage address of the multiple IO commands stored in the opposite server and / or a virtual machine (VM) that issues the multiple IO commands in the local server.

[0220] Optionally, the network card 1300 includes a hardware engine configured to process a data plane, and the hardware engine is configured to select the first IO command from the multiple IO commands according to a storage address of the multiple IO commands stored in the opposite server and / or a virtual machine (VM) that issues the multiple IO commands in the local server.

[0221] Optionally, the network card 1300 further includes a determining module 1350, The determining module 1350 is configured to determine whether the multiple data are all written into the at least one opposite server according to context information of the first IO command, wherein the context information of the first IO command includes a storage state of the multiple data in the at least one opposite server. The sending module 1330 is further configured to send an IO write completion message to the local server through an interface when the multiple data are all written into the at least one opposite server respectively.

[0222] Optionally, the obtaining module 1310 is further configured to obtain a second IO command, wherein the second IO command indicates that data in the at least one opposite server is stored into the local server, and the second IO command includes address information and length information of the data written into the local server. The splitting module 1320 is further configured to split the second IO command according to the address information and the length information to obtain a plurality of IO read messages, each of the plurality of IO read messages including information that each of the data is written into the local server; The sending module 1330 is further configured to send the IO read messages to the at least one opposite server respectively.

[0223] In a possible implementation, the information that each of the data is written into the local server includes any one of the following: address information and length information of each of the data written into the local server; or address information and length information of each of the data written into the local server and VM information of the local server in which the second IO command is issued; or a first ID and offset information of the data written into the local server, the first ID being used to indicate VM information in which the second IO command is issued and a plurality of sets of address information and length information of the data written into the VM.

[0224] In another possible implementation, the network card 1300 further includes a storage module 1360, The obtaining module 1300 is further configured to receive a first IO read response message from an opposite server, the first IO read response message including first data that the local server needs to obtain from the opposite server; The determining module 1350 is further configured to determine address information and length information of the first data written into the local server according to the first IO read response message; The storage module 1360 is configured to store the first data in the local server according to the address information and the length information.

[0225] In another possible implementation, the first IO read response message includes a first ID and offset information of the first data written into the local server, The determining module 1350 is specifically configured to determine a plurality of sets of address information and length information of the data written into the VM according to the first ID; The storage module 1360 is specifically configured to determine address information and length information of the first data written into the local server from the plurality of sets of address information and length information according to the offset information.

[0226] In another possible implementation, the first IO read response message includes address information and length information of the first data written into the local server and VM information of the local server in which the second IO command is issued, The determining module 1350 is specifically configured to determine the address information and the length information of the first data written to the local server according to the information included in the first IO read response message.

[0227] In another possible implementation, the determining module 1350 is specifically configured to determine that the address information and the length information included in the first IO read response message are within the scope of an authority table, and the authority table includes a plurality of sets of address information and length information of data written in the local server. The storing module 1360 is specifically configured to store the first data in the local server according to the address information and the length information included in the first IO read response message.

[0228] In another possible implementation, the determining module 1350 is further configured to determine whether the plurality of data are all written in the local server according to context information of the second IO command, and the context information of the second IO command includes a completion state of storing the plurality of data in the local server. The sending module 1330 is further configured to send an IO read completion message to the local server through an interface when the plurality of data are all written in the local server.

[0229] The modules of the above-described examples can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether the functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0230] The network card 1300 herein can be embodied in the form of a functional module. The term “module” herein can be implemented in the form of software and / or hardware, and is not specifically limited.

[0231] For example, the “module” can be a software program, a hardware circuit, or a combination of both, which implements the above-described functions. The hardware circuit can include an application specific integrated circuit (ASIC), an electronic circuit, a processor (for example, a shared processor, a dedicated processor, or a group processor) and a memory for executing one or more software or firmware programs, and a combination logic circuit, and / or other suitable components that support the described functions.

[0232] The embodiments of the present application also provide a chip, which acquires an instruction and executes the instruction to implement the above-described method.

[0233] Optionally, as an implementation form, the chip comprises a processor and a data interface, the processor reads instructions stored on a memory through the data interface, and executes the method.

[0234] Optionally, as an implementation form, the chip can further comprise a memory, the memory stores instructions, and the processor is configured to execute the instructions stored on the memory, and when the instructions are executed, the processor is configured to execute the method.

[0235] The embodiment of the present application further provides a computer readable storage medium, which stores instructions, and the instructions are used for the method in the method embodiment.

[0236] The embodiment of the present application further provides a computer program product comprising instructions, and the instructions are used for implementing the method in the method embodiment.

[0237] As an implementation form, the processor can be a central processing unit (CPU), and the processor can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0238] In one implementation example, the memory can be volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. Where nonvolatile memory is utilized, this can be read-only memory (ROM), programmable ROM (PROM), erasable programmable ROM (EPROM), electrically EPROM (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which acts as external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous dynamic RAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0239] The term "and / or", within the context of this document, is simply used to represent one or more of the associated listed items, e.g., A and / or B can mean A alone, A and B together, or B alone. In addition, the character " / " is generally used to represent an "or" relationship between the associated objects, but can also represent an "and / or" relationship, which can be understood in context.

[0240] In this application, "multiple" means two or more. "At least one of the following" or similar expressions means any combination of the items, including any combination of single item or multiple items. For example, at least one of a, b, or c can mean a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c can be single or multiple.

[0241] The sequence of the above processes does not mean the execution order in various embodiments of the present application. The execution order of the processes should be determined according to the functions and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0242] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, and will not be described here.

[0243] The functions, if implemented in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the part of the technical solutions that essentially contribute to the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computing device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0244] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A data processing method, characterized by, The method comprises: The network card obtains a first write command, the first write command is used to instruct to write first data to a peer server, the first write command comprises first address information and first length information, and the first data is stored in a memory of a local server; The network card obtains a plurality of second data by dividing the first data according to the first address information and the first length information; The network card sends the plurality of second data to the peer server in sequence; The first data obtained by the network card is not stored in a memory of the network card.

2. The method of claim 1, wherein, The network card is simulated as a storage device of the local server.

3. The method of claim 2, wherein, The network card is simulated as one of the following types of storage devices: an NVMe storage device, a virtual small computer system interface virtio-SCS device, a virtio-BLK device or other types of virtio devices.

4. The method according to any one of claims 1-3, characterized in that, The type of the first write command is any one of the following commands: NVMe, SCSI, Virtio-BLK or Virtio-SCSI write command.

5. The method according to any one of claims 1-3, characterized in that, The method comprises: The network card performs data encryption processing on the first data.

6. The method according to any one of claims 1-3, characterized in that, The first write command comes from a first virtual machine deployed in the local server.

7. The method of claim 1, wherein, The method further comprises: After sending all the second data contained in the first data to the peer server, the network card sends a write command completion message to the local server.

8. The method of claim 1, wherein, The first write command is stored in a memory of a local server, and the network card obtains the first write command, comprising: The network card obtains the first write command from the memory through a bus.

9. A network card, characterized by The network card is located in a server, and the network card comprises a processor core and a data plane offload engine, The processor core is configured to split the first data according to first address information and first length information to obtain a plurality of second address information and second length information, wherein a group of second address information and second length information is used to describe a data block of the first data, the first address information and the first length information are obtained from a first write command stored in a memory of the server, and the first write command is used to instruct to write the first data to a peer server; The data plane offload engine is configured to obtain corresponding second data according to the second address information and the second length information, and send the second data to the peer server.

10. The network card of claim 9, wherein, The network card is simulated as a storage device of the local server.

11. The network card of claim 9, wherein, The network card is simulated as one of the following types of storage devices: an NVMe storage device, a virtual small computer system interface virtio-SCS device, a virtio-BLK device or other types of virtio devices.

12. The network card of claim 9, wherein, The type of the first write command is any one of the following commands: NVMe, SCSI, Virtio-BLK or Virtio-SCSI write command.

13. The network card of any of claims 9-12, wherein, The first write command comes from a first virtual machine deployed in the local server.

14. A data processing method, characterized by, The method comprises: The network card obtains a first write command, the first write command being used to indicate writing first data to a peer server, the first write command comprising first address information and first length information, the first data being stored in a memory of a local server; The network card encrypts the first data and sends the encrypted first data to the peer server; The first data obtained by the network card is not stored in a memory of the network card.

15. A server, characterized by The server comprises a CPU and a network card, and the network card performs the method in any one of claims 1-8 and 14.