Data processing method of network card and network card
By splitting and processing data based on the address and length information of IO commands in the network card, the problems of bus pressure and processor overhead caused by data migration are solved, achieving more efficient data processing and reducing memory resource consumption.
Patent Information
- Application Number
- CN202010999199.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-06-09
- Filing Date
- 2020-09-22
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2040-09-22
AI Technical Summary
In existing technologies, when a network interface card (NIC) processes input/output commands, the movement of data from the host memory to the NIC's memory leads to high bus pressure and increased processor overhead. At the same time, it requires a large amount of memory resources, increasing program complexity and memory resource consumption.
The network interface card (NIC) splits data by obtaining address and length information from the I/O command and retrieves the data directly from the host memory without moving the data to the NIC's memory. It then sends the data directly to the peer server, reducing the dependence on the NIC's memory and processor overhead.
It reduces the pressure on the network card bus and processor overhead, lowers memory resource consumption and program complexity, and improves data processing efficiency.
Smart Images

Figure CN113778319B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of servers, and more particularly to a data processing method of a network card and the network card. BACKGROUND
[0002] With the rise of cloud computing, in order to reduce the occupancy rate of the host processor (for example, a central processing unit (CPU)), more host CPUs are used to provide external sales or to make the user's experience better and the user's CPU 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 offloaded 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.
[0003] Taking the storage business as an example, in the related technical solution, for an 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 an 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.
[0004] 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
[0005] The present application provides a data processing method of a network card and the 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.
[0006] In a first aspect, a data processing method of a network card is provided, comprising: the network card acquiring a first input output (IO) command, the first IO command indicating that the data stored in a local server is written into at least one server at the other end, 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 acquiring the 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 server at the other end.
[0007] In the technical solution, for the 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, instead of 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, so that the complexity of the program and the consumption of the memory resource are reduced.
[0008] In a possible implementation, the network card obtains the data corresponding to the plurality of sets of address information and length information from the first virtual machine (VM) corresponding to the identifier of the first VM in the local server, according to the plurality of sets of address information and length information and the identifier of the first VM in the local server.
[0009] In another possible implementation, the network card does not store the data in the memory.
[0010] In another possible implementation, the method further includes: receiving, by the network card, a plurality of IO commands; and selecting, by the network card, the first IO command from the plurality of IO commands according to the storage address of the plurality of IO commands stored in the opposite server and / or the virtual machine (VM) of the local server issuing the plurality of IO commands.
[0011] In another possible implementation, the network card includes a hardware engine, and the hardware engine is configured to process the data plane. The hardware engine on the network card selects the first IO command from the plurality of IO commands according to the storage address of the plurality of IO commands stored in the opposite server and / or the virtual machine (VM) of the local server issuing the plurality of IO commands.
[0012] 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 server according to the context information of the first IO command, wherein the context information of the first IO command includes the storage state of the plurality of data in the at least one opposite 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 server respectively.
[0013] In a second aspect, a data processing method of a network card is provided, including: the network card obtaining a second IO command, the second IO command indicating storing data in at least one opposite end server to a local server, and the second IO command including address information and length information of the data written to the local server; the network card splitting 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 to the local server; and the network card sending the IO read messages to the at least one opposite end server respectively.
[0014] In the above technical solution, for IO read, the data read from the opposite end server does not need to be written to the memory of the network card and then to the VM memory. In this way, the data does not need to be uploaded to the memory of the network card, which can reduce the resource consumption of the memory of the network card and the bandwidth pressure, and can also reduce the overhead of the processor of the network card.
[0015] In a possible implementation, the information of each data 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 VM.
[0016] In another possible implementation, the method further includes: the network card receiving a first IO read response message from the opposite end server, the first IO read response message including first data required by the local server to obtain from the opposite end server; the network card determining address information and length information of the first data written to the local server according to the first IO read response message; and the network card storing the first data in the local server according to the address information and the length information.
[0017] 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 network card determines a plurality of sets of address information and length information of the data written to the VM according to the first ID, and determines 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.
[0018] 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 that issues the second IO command, and the network card determines the address information and length information of the first data written to the local server according to the information included in the first IO read response message.
[0019] In another possible implementation, the length information is within a permission table, and the permission table includes a plurality of sets of address information and length information of data written to 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.
[0020] In another possible implementation, the method further includes: determining, by the network card, whether all the plurality of data are written to the local server according to context information of the second IO command, the context information of the second IO command including completion status 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 all the plurality of data are written to the local server.
[0021] In a third aspect, a network card is provided, including: an obtaining module, a splitting module, and a sending module,
[0022] 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.
[0023] 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.
[0024] 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.
[0025] In a possible implementation, the obtaining module is specifically configured to obtain the data corresponding to the plurality of sets of address information and length information from a first virtual machine (VM) in the local server according to the plurality of sets of address information and length information and an identifier corresponding to the first VM that issues the first IO command.
[0026] In another possible implementation, the network card does not store the data in a memory.
[0027] In another possible implementation manner, the network card further includes a scheduling module,
[0028] The obtaining module is further configured to receive a plurality of IO commands.
[0029] The scheduling module is configured to select the first IO command from the plurality of IO commands according to a storage address of the plurality of IO commands stored in the peer server and / or a virtual machine (VM) of the local server to which the plurality of IO commands are issued.
[0030] In another possible implementation manner, 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 plurality of IO commands according to a storage address of the plurality of IO commands stored in the peer server and / or a virtual machine (VM) of the local server to which the plurality of IO commands are issued.
[0031] In another possible implementation manner, the network card further includes a determining module,
[0032] The determining module is configured to determine whether the plurality of data are all written into the at least one peer server according to context information of the first IO command, and the context information of the first IO command includes a storage state of the plurality of data in the at least one peer server.
[0033] The sending module is further configured to send 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 peer server respectively.
[0034] The beneficial effects of the third aspect and any one of the possible implementation manners of the third aspect are corresponding to those of the first aspect and any one of the possible implementation manners of the first aspect, which will not be repeated here.
[0035] In a fourth aspect, a network card is provided, including an obtaining module, a splitting module, and a sending module,
[0036] The obtaining module is configured to obtain a second IO command, the second IO command indicating storage of data in at least one peer server to a local server, and the second IO command including address information and length information of the data written into the local server.
[0037] 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 of each data in the data written into the local server.
[0038] The sending module is configured to send the IO read message to the at least one opposite end server respectively.
[0039] In a possible implementation, the information of each data written in the local server includes any one of the following: address information and length information of each data written in the local server; or address information and length information of each data written in 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 in 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 in the VM.
[0040] In another possible implementation, the network card further includes: a determining module, a storage module,
[0041] The obtaining module is further configured to receive a first IO read response message from the opposite end server, the first IO read response message including first data required by the local server to obtain from the opposite end server;
[0042] The determining module is configured to determine address information and length information of the first data written in the local server according to the first IO read response message.
[0043] The storage module is configured to store the first data in the local server according to the address information and the length information.
[0044] In another possible implementation, the first IO read response message includes a first ID and offset information of the first data written in the local server,
[0045] The determining module is specifically configured to determine a plurality of sets of address information and length information of the data written in the VM according to the first ID.
[0046] The storage module is specifically configured to determine address information and length information of the first data written in the local server from the plurality of sets of address information and length information according to the offset information.
[0047] In another possible implementation, the first IO read response message includes address information and length information of the first data written in the local server and VM information of the local server in which the second IO command is issued,
[0048] The determining module is specifically configured to determine address information and length information of the first data written in the local server according to information included in the first IO read response message.
[0049] In another possible implementation manner, 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 a 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.
[0050] 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.
[0051] In another possible implementation manner, 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.
[0052] 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.
[0053] 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 details are not repeated here.
[0054] In a fifth aspect, a network card is provided, including a processor and a memory, and the processor executes 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.
[0055] In a sixth aspect, a network card is provided, including a processor and a memory, and the processor executes 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.
[0056] In a seventh aspect, a server is provided, including the network card in the third aspect or any one of the possible implementation manners of the third aspect.
[0057] In an eighth aspect, a server is provided, including the network card in the fourth aspect or any one of the possible implementation manners of the fourth aspect.
[0058] In a ninth aspect, a computer readable storage medium is provided, including 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.
[0059] Optionally, as an implementation manner, the storage medium can be a non-volatile storage medium.
[0060] 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.
[0061] Optionally, as an implementation manner, the storage medium can be a non-volatile storage medium.
[0062] 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.
[0063] 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.
[0064] 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.
[0065] 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.
[0066] 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 implements the method in the second aspect or any possible implementation manner of the second aspect.
[0067] 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 implement the method in the second aspect or any possible implementation manner of the second aspect. BRIEF DESCRIPTION OF DRAWINGS
[0068] Figure 1 is a schematic diagram of an architecture provided by an embodiment of the present application.
[0069] Figure 2 is a schematic diagram of an application scenario provided by an embodiment of the present application.
[0070] Figure 3 is a schematic flowchart of a data processing method of a network card provided by an embodiment of the present application.
[0071] Figure 4 is a structural schematic diagram of a network card 400 provided by an embodiment of the present application.
[0072] 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.
[0073] Figure 6 is a schematic block diagram of IO command scheduling provided by an embodiment of the present application.
[0074] Figure 7 is a schematic block diagram of a data splitting process provided by an embodiment of the present application.
[0075] Figure 8 is a schematic block diagram of an IO command processing process provided by an embodiment of the present application.
[0076] 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.
[0077] 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.
[0078] 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.
[0079] 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.
[0080] Figure 13 is a schematic block diagram of a network card 1300 provided by an embodiment of the present application. DETAILED DESCRIPTION
[0081] The technical solutions in the present application will be described below with reference to the accompanying drawings.
[0082] 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 the devices, components, modules, etc. discussed in connection with the accompanying drawings. In addition, combinations of these solutions can also be used.
[0083] In addition, in the embodiments of the present application, the words "example" and "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design presented as an "example" in the present application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "example" is intended to present concepts in a concrete manner.
[0084] In the embodiments of the present application, "corresponding" and "relevant" can be used interchangeably, and it should be pointed out that when the distinction is not emphasized, the meanings expressed are consistent.
[0085] 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.
[0086] In the present specification, the reference to "one embodiment" or "some embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment", "in some embodiments", "in other embodiments", "in additional embodiments", and so on, in various places in the specification are not necessarily all referring to the same embodiment, unless otherwise specified. The terms "comprise", "comprising", "have", "having", and any variations thereof are meant to cover "including but not limited to", unless otherwise specified.
[0087] 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 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.
[0088] 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, and to protect user CPUs from more host background services. Figure 1 As shown in FIG. 1, cloud computing manufacturers now gradually offload 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 host CPU can be basically provided to the user.
[0089] The following describes the storage service in detail with the application scenario shown in FIG. 2 as an example. Figure 2
[0090] As shown in FIG. 2, the scenario can include a host 210, a network card 220, and a target storage device 230. The following describes each device in detail. Figure 2
[0091] 1. Host 210
[0092] The host 210 can include at least one processor 211 and a memory 212.
[0093] 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.
[0094] The processor 211 can access the memory 212 through the system bus 213, for example, the processor 211 can read and write data in the memory 212 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 only one type of bus.
[0095] 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.
[0096] 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 independently run program instructions and use the parallel computing capability to speed up the program running. The processor cores have fixed logical structures, for example, including logical units such as a level-1 cache, a level-2 cache, an execution unit, an instruction-level unit, and a bus interface.
[0097] Optionally, the processor 211 can be an integrated circuit chip and has a signal processing capability. As an example but not 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, a discrete gate or transistor logic device, a discrete hardware component. Among them, the general purpose processor is a microprocessor and the like. For example, the processor 110 is a central processing unit (CPU).
[0098] The memory 212 is the main memory of the host 210 (also 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, etc. 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 a high speed through a memory controller (not shown in the figure), and perform read and write operations on any one storage unit in the memory 212. Figure 1
[0099] 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).
[0100] 2. Network card 220
[0101] 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 host 210. 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 (Peripheral Component Interface Express, PCIe) interface.
[0102] For ease of description, Figure 2 The network card 220 is described as an external device connected to the host 210.
[0103] 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.
[0104] 3. Destination storage device 230
[0105] 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.
[0106] 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.
[0107] 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 (e.g., a VM) running on the host to instruct reading data from a remote device (e.g., a destination storage device), and the write command is a command issued by an application (e.g., 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 sent to the destination storage device 230 as the communication opposite end.
[0108] In the related technical solution, taking the IO command as an example of an IO write command, 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.
[0109] In the related technical solution, taking the IO command as an example of an IO read command, 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.
[0110] In the aforementioned technical solutions, taking an I / O write command as an example, the data to be written needs to be moved from the host 210's memory 212 to the network card 220's memory 222, and then the network card 220's processor 221 processes the storage service for this data. On the one hand, since data needs to be read from the host 210's memory 212 into the network card 220's memory 222, this puts a lot of pressure on the network card 220's bus 223 and greatly increases the overhead of the network card 220's processor 221. On the other hand, the network card 220 requires a large amount of memory 222 to store this data, and the storage and management of this data greatly increases the complexity of the program and the consumption of memory 222 resources.
[0111] In view of this, this application proposes a data storage method in which 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, this can reduce the resource consumption and bandwidth pressure of the memory 222; on the other hand, it can also reduce the overhead of the processor 221 in the network card 220.
[0112] The following is combined with Figure 3 This application provides a detailed description of a data storage method according to an embodiment.
[0113] Figure 3 This is a schematic flowchart illustrating a data processing method for a network interface card (NIC) provided in an embodiment of this application. Figure 3 As shown, the method may include steps 310-330, which will be described in detail below.
[0114] Step 310: The network card obtains the first IO command, which includes the address information and length information of the data stored on the local server.
[0115] In this embodiment of the application, the first IO command can be used to instruct data stored in the local server to be written to at least one peer server. As an example, the data can be stored in the memory of the local server.
[0116] As an example, the aforementioned local server could be Figure 2 Host 210 in the example. The aforementioned peer server can be a storage device or a computing device with computing capabilities. As an example, the peer server is... Figure 2 The destination storage device 230.
[0117] The network interface card (NIC) can be used as an external device for the local server and connects to the server via an interface. This interface can be a bus or peripheral component interface express (PCIe) interface. Please refer to [reference needed] for specific connection details.Figure 2 The details are described in the foregoing description and will not be repeated here.
[0118] 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.
[0119] 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.
[0120] In the embodiments of the present 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, so 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.
[0121] 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.
[0122] 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.
[0123] 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.
[0124] In a possible implementation, 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 data from the memory of a certain VM.
[0125] 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 memory resources.
[0126] The following will be described in detail Figure 4 with reference to a possible structure of the network card provided in the embodiments of the present application.
[0127] Figure 4 Fig. 4 is a structure diagram of a network card 400 provided in the embodiments of the present application. As shown in Fig. 4, the network card 400 is connected to the host 210 through a PCIE interface. Figure 4
[0128] 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.
[0129] 1. Data plane offload engine 410
[0130] As an example, the data plane offload engine 410 can be composed of 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.
[0131] 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.
[0132] The data plane offload engine 410 can be connected with the host 210 through a PCIE interface, for obtaining data stored in the memory 212 of the host 210. The data plane offload engine 410 can also be connected with the CPU core 430 and the memory controller 420 through the system bus 450, so as to realize high-speed communication between each module in the data plane offload engine 410 and the CPU core 430 and the memory controller 420.
[0133] 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.
[0134] The functions of each module included in the data plane offload engine 410 will be described in detail below.
[0135] The device emulation module 411 is mainly used to realize device emulation, so that the network card 400 presents the required devices to the host or the virtual machine VM running on the host, such as emulation of storage, network, and other devices. As an example, the device emulation module 411 is used to realize presentation of non-volatile memory host controller interface specification (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.
[0136] It should be understood that device emulation can also be completed by hardware logic and CPU cores together, and generally, strong data interaction is completed by the data plane offload engine, and configuration related operations are completed by the CPU core.
[0137] The IO command processing module 412 is used to perform simple analysis and processing on IO commands. As an example, it can be used to determine whether an IO command is a read command or a write command. As another example, for read and write commands of IO, scheduling is usually required, so as to ensure the quality of service (Qos) of device IO.
[0138] Data scheduling module 430 is configured to schedule a plurality of IO commands. As an example, the scheduling can include Qos processing of data. For example, to avoid an unreasonable load of a VM or a volume, it is necessary to limit the bandwidth and packet rate of each device. For storage IO data, it is also necessary to schedule IO commands based on the IOPS (input output operation per second) of each volume, the bandwidth of the entire VM, and the IOPS and bandwidth management of the entire VM.
[0139] Network protocol processing engine 460 is mainly configured to complete the processing of network protocols, and ensure reliable transmission of data to a destination node. The network protocol can be various, which is not limited in the present application. For example, the network protocol can be a RDMA (remote direct data access) protocol, or the network protocol can be a TCP (transmission control protocol) protocol, or the network protocol can be a self-defined reliable transmission protocol.
[0140] 2. Memory controller 420
[0141] Memory controller 420 is configured to control the data interaction between memory 440 and CPU core 430. Specifically, memory controller 420 receives a memory access request from CPU core 430, and controls the access to memory 440 based on the memory access request.
[0142] In an implementation example, each memory controller 420 performs the addressing of memory 440 through 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 competing accesses of a plurality of CPU cores 430.
[0143] 3. CPU core 430
[0144] CPU core 430 is the most important component of CPU, and can also be referred to as CPU processing unit. It is manufactured by single crystal silicon through a certain production process. All the computing, command receiving, command storage, and data processing of CPU are performed by CPU core 430. CPU core 430 independently runs program instructions, and accelerates the running speed of the program by using the parallel computing capability. Various CPU cores 430 have fixed logic structures, for example, CPU core 430 includes logic units such as a first-level cache, a second-level cache, an execution unit, an instruction-level unit, and a bus interface.
[0145] CPU core 430 is generally used to perform complex service processing, and usually runs an operating system (OS), so that complex service processing software, various management software, control plane software, etc. can be run thereon.
[0146] 4. Memory 440
[0147] Memory 440 can be an external memory of CPU core 430, and is used to store program running of CPU core 430 and part of table entries of data plane offload engine 410.
[0148] The present embodiment does not make specific limitation on external memory 440, and as an example, the external memory 440 is a double data rate (DDR) memory.
[0149] It should be understood that the internal memory integrated in data plane offload engine 410 is a cache, which is fast and high in cost, and can only be integrated in a small amount. Large-scale table entries need to be stored in external memory 440. For example, the external memory 440 stores large forwarding flow tables required by network forwarding, transceiving queues of network connections, context table entries of network connections, context table entries of IO, etc.
[0150] It should also be understood that the data uplink to the CPU we often say is actually uplink to the external memory 440 of CPU core 430. In the following of this paper, the data uplink to the CPU and the CPU memory refer to the external memory 440 of CPU core 430.
[0151] 5. System bus 450
[0152] System bus 450 can connect data plane offload engine 410 with CPU core 430 and memory controller 420, so that data plane offload engine 410, CPU core 430 and memory controller 420 can communicate with each other through system bus 450.
[0153] Next, taking the hardware architecture shown in FIG. 1 as an example, and combining the example in FIG. 2, a specific implementation manner of processing IO write command by the network card is described in detail. It should be understood that the example of FIG. 2 is only to help those skilled in the art to understand the present embodiment, and is not intended to limit the present embodiment to the specific values or specific scenarios of FIG. 2. Those skilled in the art can obviously make various equivalent modifications or changes according to the given example, and such modifications and changes also fall within the scope of the present embodiment. Figure 4 Figure 5 Figure 5 Figure 5
[0154] Figure 5 is a schematic flowchart of a method for processing IO write commands by a network card, provided by an embodiment of the present application. As shown in Figure 5 The method can include steps 510-560, which are described in detail below.
[0155] Step 510: A VM in the host 210 issues an IO write command.
[0156] A certain VM of the host can initiate an IO write command for storage service based on a storage IO device interface (e.g. NVMe, SCSI, Virtio-BLK, Virtio-SCSI, etc.).
[0157] It should be noted that, Figure 5 The IO command or the IO command to be processed mentioned in the embodiments shown can be understood as an IO write command to be processed.
[0158] It should be understood that an embodiment 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 enabling single-root I / O virtualization (SR-IOV), the storage IO device above can be a physical function (PF) or a virtual function (VF). In the case of enabling scalable I / O virtualization (scalable-IOV), the storage IO device above can also be an ADI.
[0159] Since the number of VFs is usually larger, in the VM application scenario, the VM is mainly allocated to the VF. For simplicity of description, the following description is described in terms of VF, but as long as it is not particularly emphasized that it can only be PF, all the descriptions of VF are also applicable to PF. That is, as an example, a VM running in the host 210 can be identified by a VF.
[0160] Step 520: The processor 211 in the host 210 sends a prompt message to the network card 400.
[0161] 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.
[0162] As an example, the prompt message can be a door bell (DB).
[0163] Step 530: The IO command processing module 412 in the network card 400 processes the IO write command to be processed.
[0164] For IO commands such as IO read and IO write commands, Qos control is usually required. For example, for logical unit number (LUN) information (in NVMe, it is a namespace) in the IO command, the LUN ID of the VM and the VF information of the portal can be converted into a global LUN ID, which can be the address information of the destination storage device. Alternatively, the VF + LUN ID of the VM can also be directly used.
[0165] For ease of description, the LUN ID appearing hereinafter can be understood as a global LUN ID.
[0166] It should be understood that the VF information (for example, VF ID) is not in the IO command, just like a message entering the network card like the port attribute, this information is not in the message.
[0167] Step 540: The data scheduling module 430 in the network card 400 schedules the IO command to be processed.
[0168] It should be understood that step 540 is optional. That is, if the above-mentioned IO command to be processed 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, therefore, it is necessary to schedule the above-mentioned 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.
[0169] As shown in FIG. 4B, the data scheduling module 430 in the data plane offload engine 410 schedules the multiple IO commands and stores the scheduled IO commands in the IO message receiving queue. Figure 6
[0170] In a possible implementation, the data scheduling module 430 can schedule the multiple IO commands to select the IO command meeting the condition. For example, the data scheduling module 430 can schedule the IO command to be processed according to the storage address of the destination storage device storing the IO command to be processed to select the IO command meeting the condition. For another example, the data scheduling module 430 can also schedule the IO command to be processed according to the virtual machine VM in the host 210 issuing the multiple IO commands to select the IO command meeting the condition.
[0171] In another possible implementation, the data scheduling module 430 can also perform multi-level scheduling on the plurality of IO commands and select the IO commands meeting the condition. For example, in two-level scheduling, the first level is to schedule the IO commands based on LUN ID, and the second level is to schedule the IO commands based on VM. Specifically, the data scheduling module 430 can schedule the IO commands to be processed according to the storage address of the storage device storing the IO commands to be processed and the virtual machine (VM) in the host 210 issuing the plurality of IO commands, and select the IO commands meeting the condition.
[0172] In the embodiment of the application, if the size 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 size of the IO message receiving queue is large and the internal cache of the chip cannot save the queue, the queue can be placed in the external memory 440 of the network card 400.
[0173] The IO commands meeting the condition can be traffic measurement of the data size of the IO commands. It should be understood that the measurement can include but is not limited to measurement of IOPS, IO times allowed per second, or IO bandwidth, etc.
[0174] In the embodiment of the application, the token bucket algorithm can be used for traffic measurement. The token bucket algorithm is to place a certain number of tokens in the token bucket, and one token allows sending of 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, sending of any size of data is considered to exceed the rated bandwidth. Only when there is a token left in the bucket, data can be continuously sent.
[0175] In one example, two token buckets can be used to obtain more committed performance (guaranteed performance) and allowed peak performance (maximum allowed performance in the case of idle processing capacity) to achieve more accurate control.
[0176] 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 every second, the data can be sent.
[0177] Therefore, in the embodiments of the present application, in order to obtain more flexible QoS scheduling effect, the token bucket provides a token adjustment interface, and the CPU core 430 replenishes tokens based on the characteristics of the message. 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, the insufficient bandwidth can be avoided, and the user experience can be affected.
[0178] In the above technical solution, the QoS scheduling is performed by the data plane, and more accurate and stable QoS guarantee and better performance can be obtained. The token replenishment adjustment of the CPU core can also provide higher QoS flexibility.
[0179] Step 550: The CPU core 430 processes the IO command.
[0180] 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 LUN, logical block address (LBA), data size (size), and a scatter gather (SG) list pointing to a data block.
[0181] The LUN represents the ID of the storage unit to be accessed, for example, Figure 2 The ID of the destination storage device 230 is shown. The LBA represents the block where the data on the storage unit to be accessed is located, that is, the logical address starting address of the data to be accessed in the LUN. The size represents the size of the data after the address is read. The CPU core 430 can perform addressing of the destination storage device based on the LUN, LBA, and size.
[0182] The SG list is a list composed of multiple addresses and lengths. One address + length constitutes one memory block, and multiple address blocks constitute the total memory size required to store IO data in the host. That is, the SG list refers to a sequence of starting addresses + lengths to describe a scatter-gather data block, and multiple data blocks are combined into a logically continuous data block.
[0183] It should be understood that one address + length in the SG list can correspond to the address information and length information of the data in the above.
[0184] For IO write, the SG list indicates where to read data from the host's memory (memory) and write it into the destination storage device.
[0185] 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.
[0186] 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, such as data splitting processing, data deduplication, data encryption, data compression, data snapshot, and the like.
[0187] The following takes data splitting processing as an example to describe in detail 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.
[0188] It should be understood that for the distributed storage system commonly used on cloud computing, data will be scattered and saved to hundreds or thousands of destination storage devices. In this way, high-speed concurrent access to data can be achieved, 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, and the like. Different data blocks are sent to different destination storage devices.
[0189] 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 are obtained from multiple destination storage devices, and different data blocks are combined into a complete IO data. The read is the reverse process of the write.
[0190] Optionally, in some embodiments, in order to improve the efficiency of sending to multiple destination storage devices, it is also common to appropriately aggregate, that is, combine multiple data blocks sent to the same destination storage device into a larger data packet, such as 128KB, and send it out at a time. In this way, frequent calls to the protocol stack for data transmission can be avoided, which can cause the CPU core 430 to be overloaded.
[0191] The process of splitting data is generally as shown in Figure 7 The IO data is split horizontally to split one IO data into multiple data blocks. Vertically generated is a data packet, and each data packet uniquely corresponds to a distributed remote destination storage device. Each data packet can include a data block, or can include multiple data blocks sent to the same destination storage device.
[0192] In this embodiment, since the real data written by IO is stored in the memory 212 of the host 210 and not in the memory 440 of the network card 400, the process of the CPU core 430 partitioning the data is not based on the real data written by IO, but on the virtual data pointer of SG in the IO command (the address information and length information of the data in the memory 212 of the host 210), which points to the data block with the address and length of the corresponding host VF.
[0193] In other words, the embodiments of this application do not split the actual data written by IO, but split it based on the memory address and data length of the IO data of a certain VM stored in memory 212, thereby obtaining the split VF+SG information.
[0194] Step 560: CPU core 430 instructs network protocol processing engine 460 to send IO write data to at least one destination storage device at a remote location.
[0195] 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.
[0196] 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.
[0197] 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.
[0198] 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.
[0199] 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.
[0200] 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.
[0201] Optionally, the network interface card 400 can also determine whether all the data has been written to at least one destination storage device based on the context information of the IO command. When all the data has been written to the at least one destination storage device, the network interface card 400 sends an IO write complete message to the host 210 through the PCIe interface. It should be understood that the context information of the IO command may include the storage status of the data in the at least one destination storage device.
[0202] The following is based on Figure 4 Taking the hardware architecture shown as an example, combined with Figure 9 The example below details a specific implementation of how a network interface card (NIC) processes I / O read commands. It should be understood that... Figure 9 The examples are merely to help those skilled in the art understand the embodiments of this application, and are not intended to limit the embodiments of the application to... Figure 9 The specific numerical values or specific scenarios will be considered. Those skilled in the art will obviously be able to 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 this application.
[0203] Figure 9 This is a schematic flowchart illustrating a method for a network interface card (NIC) to process I / O read commands, as provided in an embodiment of this application. Figure 9 As shown, the method may include steps 910-950, which will be described in detail below.
[0204] Step 910: The VM in host 210 issues an IO read command.
[0205] An IO read command is used to instruct the retrieval of data from the destination storage device and store that data in host 210. As an example, this data can be stored in the memory of the VM that issued the IO read command on host 210.
[0206] The IO read command can also be referred to as an IO read message.
[0207] Step 915: The processor 211 in the host 210 sends a prompt message to the network card 400.
[0208] 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.
[0209] Step 920: The CPU core 430 on the network card 400 processes the IO read command.
[0210] 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 in the host 210 where the data is stored, etc.
[0211] For 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.
[0212] 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.
[0213] It should be understood that the information of each data written to the memory of the host 210 includes any one of the following: 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 in the VM.
[0214] Step 925: The CPU core 430 instructs the network protocol processing engine 460 to send a message packet to the remote target storage device.
[0215] After the CPU core 430 processes the IO read command, the network protocol processing engine 460 can be instructed 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 storage address information of the corresponding target storage device, which is usually a network connection sending queue.
[0216] The CPU core 430 can also instruct the network protocol processing engine 460 to initiate a network protocol sending process, and the network protocol processing engine 460 sends the IO read message packet to the corresponding target storage device.
[0217] Step 930: The data plane offload engine 410 receives the returned IO read response message from the target storage device.
[0218] The target 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 the IO read response message.
[0219] The IO read response message can be understood as a response packet of the target storage device to the received IO read command.
[0220] The format of the IO read response message returned by the target storage device is various, which is not limited in the present application, and will be described in detail in combination with step 940, which will not be described here.
[0221] Step 940: The data plane offload engine 410 directly writes the data in the IO read response message into the memory of the VM.
[0222] In the embodiment of the present application, after receiving the data in the IO read response message, the data plane offload engine 410 can not write the data into the memory 440 of the network card 400 first, and then write the data from the memory 440 into the memory of the VM to which the IO read command is issued, but can directly write the data in the IO read response message into the memory of the VM to which 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.
[0223] The data plane offload engine 410 needs to obtain the address information and length information of each data block stored in the memory 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.
[0224] Specifically, the data plane offload engine 410 can determine the VF+SG information stored in the memory 212 of the host 210 for each data chunk. There are multiple specific implementation manners to obtain the VF+SG information, which will be described in detail below.
[0225] In one possible implementation manner, referring to Figure 10 , the IO read response message can include: the ID of the IO of each data chunk, offset information, and data. The data plane offload engine 410 can query the context of the corresponding IO according to the ID of the IO of each data chunk in the IO read response message, and obtain the VF+SG information.
[0226] 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 the IO after sending the IO read command to the target storage device. One context of the IO can correspond to one ID. The context information of the IO can be used to record the ID of the IO corresponding to each chunk, the VF processing the IO, the LUN and the SG list in the VM, and the address and length of the data to be read in the target storage device.
[0227] It should be noted that one IO read command can have multiple such chunks, which can be different chunks of different IOs.
[0228] For example, the ID of one data chunk in the IO read message is ID1, and the offset information is 2. Referring to Figure 10 , when performing address query, the data plane offload engine 410 can determine that the information stored in the memory 212 of the host 210 for the data chunk is VF1+SG2 according to the ID ID1 and the offset information 2. After obtaining the VF1+SG2 information, the data plane offload engine 410 can directly write the data into the memory 212 of the host 210 through the direct memory access (DMA) technology.
[0229] In another possible implementation manner, referring to Figure 11 , the IO read response message can include: 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.
[0230] 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, and the MSG ID table records the VF+SG information of each data block corresponding to each data shard. The MSG ID can be carried in the sent IO read message, and of course, the length information of each shard is also needed. The ordering of the shards is consistent with the ID ordering in the MSG ID table.
[0231] When the IO read response message is returned, the data plane offload engine 410 can obtain the SG information in the MSG ID table according to the MSG ID of the returned message, and then obtain the specific address to be put in according to the number of the data block. The data is written into the address through the DMA technology, so as to realize the direct writing of the data into the memory of the VM.
[0232] In another possible implementation, referring to Figure 12 , one or more VF+SG and data can be carried in the IO read response message. 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 stored in the memory of the host.
[0233] 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, the data is directly written into the memory 212 of the host 210 through the direct memory access (DMA) technology.
[0234] Optionally, in some embodiments, in order to verify whether the VF+SG information carried in the IO read response message is legal and effective, the data plane offload engine 410 can compare the SG address in the IO read response message with the SG information in the 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, so as to realize the 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.
[0235] 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. The SG authority table is created when the IO is initiated, and the corresponding SG authority is deleted when the IO is completed. The SG authority table includes the VF+SG corresponding to the writing of the data into the memory of the VM.
[0236] Step 950: The data plane offload engine 410 sends an IO read completion message to the host 210.
[0237] Since the returned IO read response message consists of M data packet return messages, an IO read is considered complete only after all M data packet return messages have arrived. Because this process is relatively simple, in this embodiment, it can be handled by the data plane offloading engine 410. This way, the returned data no longer needs to be processed by the CPU core 430 in the network card 400, improving processing performance.
[0238] As an example, the CPU core 430 in the network card 400 determines that all data reception is complete, and then sends an IO read completion message to the device emulation module 411 of the data plane offloading engine 410. There are several possible implementation methods, which are described in detail below.
[0239] In one possible implementation, based on the previously allocated IO context, each ID's corresponding IO context records not only the necessary information for IO processing but also the completion status of the message ID. The data plane offloading engine 410 obtains the IO context based on 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 completion, the CPU core 430 in the network card 400 directly sends an IO read completion message to the device simulation module 411.
[0240] It should be understood that once the I / O read is complete, the corresponding I / O context becomes invalid, and the CPU can reassign that context.
[0241] In another possible implementation, based on the previously allocated IO context, each ID's corresponding IO context records not only the necessary information for IO processing but also the data block offset number. The returned message can carry the IO ID and the data block offset number. The data plane offloading engine 410 obtains the IO ID, acquires the IO context, and sets the corresponding data block completion flag based on the data block offset number. When all data is complete, the CPU core 430 in the network card 400 directly sends an IO read completion message to the device emulation module 411.
[0242] The above text combined Figure 1 to Figure 12 The data processing method of the network card in the embodiments of this application is described in detail below. Figure 13 The following describes in detail the device embodiments of this application.
[0243] Figure 13 This is a schematic block diagram of a network interface card (NIC) 1300 provided in an embodiment of this application. The NIC 1300 is capable of performing... Figure 2 , Figure 5 , Figure 9The steps of the method are not repeated here in order to avoid repetition. The network card 1300 comprises: an acquisition module 1310, a splitting module 1320, a sending module 1330,
[0244] The acquisition module 1310 is configured to acquire 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 peer server, and the first IO command comprising address information and length information of the data stored in the local server.
[0245] 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.
[0246] The sending module 1330 is further configured to acquire, from the local server, data corresponding to the plurality of groups of address information and length information according to the plurality of groups of address information and length information, and send the data to the at least one peer server.
[0247] Optionally, the acquisition module 1310 is specifically configured to acquire, from a first virtual machine (VM) corresponding to an identifier of the first VM in the local server, data corresponding to the plurality of groups of address information and length information according to the plurality of groups of address information and length information.
[0248] Optionally, the data is not stored in a memory of the network card.
[0249] Optionally, the network card 1300 further comprises a scheduling module 1340,
[0250] The acquisition module 1310 is further configured to receive a plurality of IO commands.
[0251] The scheduling module 1340 is configured to select the first IO command from the plurality of IO commands according to a storage address of the plurality of IO commands stored in the peer server and / or a virtual machine (VM) of the local server from which the plurality of IO commands are issued.
[0252] Optionally, the network card 1300 comprises a hardware engine configured to process a data plane, and the hardware engine is configured to select the first IO command from the plurality of IO commands according to a storage address of the plurality of IO commands stored in the peer server and / or a VM of the local server from which the plurality of IO commands are issued.
[0253] Optionally, the network card 1300 further comprises a determination module 1350,
[0254] The determining module 1350 is configured to determine whether the plurality of 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 comprises a storage state of the plurality of data in the at least one peer server.
[0255] The sending module 1330 is further configured to send 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 peer server respectively.
[0256] Optionally, the obtaining module 1310 is further configured to obtain a second IO command, wherein the second IO command indicates storage of data in the at least one peer server to the local server, and the second IO command comprises address information and length information of the data written into the local server.
[0257] 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, and each of the plurality of IO read messages comprises information of each data in the data written into the local server.
[0258] The sending module 1330 is further configured to send the IO read messages to the at least one peer server respectively.
[0259] In a possible implementation, the information of each data written into the local server comprises 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, wherein the first ID is used to indicate VM information in which the second IO command is issued and a plurality of groups of address information and length information of the data written into the VM.
[0260] In another possible implementation, the network card 1300 further comprises a storage module 1360,
[0261] The obtaining module 1300 is further configured to receive a first IO read response message from a peer server, wherein the first IO read response message comprises first data required by the local server to obtain from the peer server.
[0262] 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.
[0263] The storage module 1360 is configured to store the first data in the local server according to the address information and the length information.
[0264] In another possible implementation, the first ID and offset information of the first data written in the local server are included in the first IO read response message.
[0265] The determination module 1350 is specifically configured to determine a plurality of sets of address information and length information of data written in the VM according to the first ID.
[0266] The storage module 1360 is specifically configured to determine address information and length information of the first data written in the local server from the plurality of sets of address information and length information according to the offset information.
[0267] In another possible implementation, the address information and length information of the first data written in the local server and VM information of the local server in which the second IO command is issued are included in the first IO read response message.
[0268] The determination module 1350 is specifically configured to determine address information and length information of the first data written in the local server according to information included in the first IO read response message.
[0269] In another possible implementation, the determination 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 a 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.
[0270] The storage 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.
[0271] In another possible implementation, the determination 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 storage of the plurality of data in the local server.
[0272] 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.
[0273] The modules of the above-described examples can be implemented in electronic hardware, or in 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.
[0274] 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.
[0275] 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 (such as a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combination logic circuit, and / or other suitable components that support the described functions.
[0276] The embodiments of the present application also provide a chip, which acquires instructions and executes the instructions to implement the above-described method.
[0277] Optionally, as an implementation manner, the chip includes a processor and a data interface, the processor reads instructions stored on a memory through the data interface, and executes the above-described method.
[0278] Optionally, as an implementation manner, the chip can further include 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 above-described method.
[0279] The embodiments of the present application also provide a computer readable storage medium, which stores instructions, and the instructions are used for the method in the method embodiments.
[0280] The embodiments of the present application also provide a computer program product including instructions, and the instructions are used for implementing the method in the method embodiments.
[0281] In one implementation, the processor can be a central processing unit (CPU), 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, or the like. The general purpose processor can be a microprocessor, but in the alternative, the processor can be any conventional processor, controller, microcontroller, or state machine. Also, the processor can be implemented as multiple processor(s), or as part of a system using optical processing, quantum computing, or the like.
[0282] In one implementation, the memory can be volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of illustration, and not limitation, nonvolatile memory can be read only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically EPROM (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which acts as external cache. By way of illustration and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory can also include one or more processors in the form of microprocessors, conventional processors, controller(s), microcontroller(s), or state machines, or external logic.
[0283] The term "and / or", merely describes an associated relationship, which means that there can be three relationships, for example, A and / or B, which means that there are three cases: A alone, A and B together, and B alone, where A and B can be singular or plural. In addition, the character " / " generally represents an "or" relationship between the front and rear associated objects, but it can also represent an "and / or" relationship. The specific meaning can be understood according to the context before and after.
[0284] In this application, "multiple" means two or more. "At least one of the following" or similar expressions means any combination of these items, including any combination of single 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, and c can be single or multiple.
[0285] In various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0286] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0287] If the function is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or 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 various embodiments of the present application. The foregoing storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and various program code storage media.
[0288] 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 of a network card, characterized in that, The method comprises: The network card obtains a first input / output (IO) command, the first IO command indicating writing data stored in a local server to at least one peer server, and the first IO command comprising address information and length information of the data stored in the local server; The network card splits the data according to the address information and length information to obtain multiple sets of address information and length information; The network card obtains 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 the at least one peer server.
2. The method of claim 1, wherein, The network card obtains 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, comprising: The network card obtains 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.
3. The method according to claim 1 or 2, characterized in that, The memory of the network card does not store the data.
4. The method according to claim 1 or 2, characterized in that, The method further comprises: The network card receives multiple IO commands; The network card selects 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.
5. The method of claim 4, wherein, The network card comprises a hardware engine for processing a data plane, The network card selects 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, comprising: The hardware engine on the network card selects 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.
6. The method of claim 1 or 2, wherein, The method further comprises: The network card determines whether multiple data are all written to the at least one peer server according to context information of the first IO command, the context information of the first IO command comprising storage states of the multiple data in the at least one peer server; When the multiple data are all written to the at least one peer server respectively, the network card sends an IO write completion message to the local server through an interface.
7. A data processing method of a network card, characterized by, The method comprises: The network card obtains a second IO command, the second IO command indicating storing data in at least one peer server to a local server, and the second IO command comprising address information and length information of the data written to the local server; The network card splits the second IO command according to the address information and length information to obtain multiple IO read messages, and the multiple IO read messages comprising information of each data in the data written to the local server; The network card sends the IO read messages to the at least one peer server respectively.
8. The method of claim 7, wherein, The information of each data written into the local server includes any one of the following: The address information and length information of each data written into the local server; or The address information and length information of each data written into the local server and the VM information of the local server in which the second IO command is issued; or The first ID and the offset information of the data written into the local server, wherein the first ID is used to indicate the VM information of the local server in which the second IO command is issued and the multiple sets of address information and length information of the data written into the VM.
9. The method according to claim 7 or 8, characterized in that, The method further includes: The network card receives a first IO read response message from a peer server, wherein the first IO read response message includes first data required by the local server to obtain from the peer server; The network card determines, according to the first IO read response message, address information and length information of the first data written into the local server; The network card stores the first data in the local server according to the address information and length information.
10. The method of claim 9, wherein, The first IO read response message includes a first ID and offset information of the first data written into the local server, The network card determines, according to the first IO read response message, address information and length information of the first data written into the local server, including: The network card determines, according to the first ID, multiple sets of address information and length information of data written into a VM; The network card determines, according to the offset information, address information and length information of the first data written into the local server from the multiple sets of address information and length information.
11. The method of claim 9, wherein, 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 network card determines, according to the first IO read response message, address information and length information of the first data written into the local server, including: The network card determines, according to information included in the first IO read response message, address information and length information of the first data written into the local server.
12. The method of claim 11, wherein, The network card stores the first data in the local server according to the address information and length information, including: The network card determines that the address information and length information included in the first IO read response message are within the scope of an authority table, wherein the authority table includes multiple sets of address information and length information of data written into the local server; 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.
13. The method of claim 7 or 8, wherein, The method further includes: The network card determines, according to context information of the second IO command, whether all of multiple data are written into the local server, wherein the context information of the second IO command includes a completion state of storage of the multiple data in the local server; When all of the multiple data are written into the local server, the network card sends an IO read completion message to the local server through an interface.
14. A network card, comprising: comprising a processor and a memory; the processor running instructions in the memory causing the network card to perform the method of any of claims 1 to 6.
15. A network card, comprising: comprising a processor and a memory; the processor running instructions in the memory causing the network card to perform the method of any of claims 7 to 13.
16. A computer readable storage medium characterized by: comprising instructions; the instructions being for implementing the method of any of claims 1 to 6.
17. A computer readable storage medium characterized by: comprising instructions; the instructions being for implementing the method of any of claims 7 to 13.
Citation Information
Patent Citations
Data reading method and device
CN108319428A