WO2015192685A1 - 一种存储数据的方法及网络接口卡 - Google Patents
一种存储数据的方法及网络接口卡 Download PDFInfo
- Publication number
- WO2015192685A1 WO2015192685A1 PCT/CN2015/076991 CN2015076991W WO2015192685A1 WO 2015192685 A1 WO2015192685 A1 WO 2015192685A1 CN 2015076991 W CN2015076991 W CN 2015076991W WO 2015192685 A1 WO2015192685 A1 WO 2015192685A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- network interface
- interface card
- unsolicited
- destination address
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/10—Program control for peripheral devices
- G06F13/12—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
- G06F13/124—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine
- G06F13/128—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine for dedicated transfers to a network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/40—Network security protocols
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/28—Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
Definitions
- the present invention relates to the field of data storage technologies, and in particular, to a method for storing data and a network interface card.
- iSCSI Internet Small Computer System Interface
- IP Internet Protocol
- FIG. 1B is a flow chart of the existing write operation process:
- Step A The iSCSI initiator sends a write data command to the iSCSI target.
- Step B After receiving the write data command, the iSCSI target allocates a destination address for all data stored in the network to be written in the storage area, and sends the destination address to the iSCSI boot through the R2T (Ready to Transfer) command.
- R2T Ready to Transfer
- Step C The iSCSI initiator sends a request DATA_OUT (output data) message carrying the data to be written to the iSCSI target, and the iSCSI target passes the copy or DDP (Direct Data). Placement, direct data storage technology puts the data to be written into the storage space corresponding to the destination address.
- DATA_OUT output data
- DDP Direct Data
- Figure 1C is a flow chart of the existing read operation process:
- Step a The iSCSI initiator sends a read data command to the iSCSI target.
- the iSCSI initiator has determined the destination address where the data to be read is located.
- Step b The iSCSI initiator receives the Data-In (input data) message sent by the iSCSI target, where the Data-In message carries the data stored in the storage space corresponding to the destination address.
- the iSCSI technology implements the interactive step of omitting the R2T command, which is implemented in the following two ways:
- the first type is in the form of a write data command: the small data to be written is directly carried in the write data command;
- the second type is the form of the unsolicited DATA_OUT message sent for the first time: the small data to be written is directly carried in the unsent DATA_OUT message sent for the first time, and the unsolicited DATA_OUT message carrying the small data to be written is followed. There is no interaction of the R2T command between the write data command, that is, the unsolicited DATA_OUT message and the write data command.
- the iSCSI initiator does not need to wait for the iSCSI target to reply to the R2T command, and can directly send the small data to be written to the iSCSI target, but because the iSCSI target is receiving the iSCSI initiator to send When the small data is written, the destination address of the small data to be written is not obtained. Therefore, when receiving the small data to be written sent by the iSCSI initiator, the cache is first cached.
- the Adapter After receiving the small data to be written sent by the iSCSI initiator, the Adapter first caches the small data to be written to the driver layer, and the driver layer receives the data to be written by the SCSI layer. After the destination address, the driver layer copies the cached small data to be written to the storage space corresponding to the destination address. As can be seen from the above process, the driver layer stores the cached small data to be written to the destination address.
- the copy mode storage has the disadvantages of long time-consuming and low efficiency.
- the current storage process has a long time-consuming and low-efficiency problem, and at the same time, since the copy operation is In the driver layer, the driver layer is the software layer.
- the software layer performs operations, it needs to occupy CPU (Central Processing Unit) resources, and the CPU resources are limited. Therefore, the current method of storing data will be The processing rate of other applications has an impact.
- CPU Central Processing Unit
- the existing method of storing data has the disadvantages of long time-consuming, low storage efficiency, and influence on the processing rate of other applications.
- Embodiments of the present invention provide a method for storing data and a network interface card, which are used to solve the problem of long time consumption, low storage rate, and processing rate of other applications in the process of storing data in the prior art. Defects of influence.
- a method of storing data comprising:
- the network interface card obtains the unsolicited data, and caches the obtained unsolicited data to the cache space of the network interface card, where the unsolicited data is not obtained for the data received by the network interface card.
- the network interface card acquires a destination address corresponding to the unsolicited data, and writes the cached unrequested data into a storage space corresponding to the destination address corresponding to the unsolicited data by using a direct memory access DMA mode.
- the unsolicited data is carried Data in a write data command sent by the client; or the unsolicited data is data carried in the unsolicited output data DATA_OUT message sent by the client;
- the unsolicited DATA_OUT message is a message received by the network interface card before sending the R2T command to the client after receiving the write data command sent by the client.
- the network interface card caches the acquired unsolicited data to a cache space of the network interface card, Specifically include:
- the network interface card adopts a DMA manner to buffer the unsolicited data to a random access memory RAM space of the network interface card;
- the network interface card adopts a DMA manner to buffer the unsolicited data to a double rate DDR synchronous dynamic random access memory SDRAM space of the network interface card.
- the network interface card writes cached unsolicited data in a DMA manner Before the storage space corresponding to the destination address corresponding to the unrequested data, the method further includes:
- the network interface card acquires a data complete domain DIF calculation rule corresponding to the unsolicited data
- the network interface card uses the DIF calculation rule to calculate a DIF value corresponding to the unsolicited data
- the network interface card determines the calculated DIF value, and the preset DIF values corresponding to the unsolicited data are equal.
- the network interface card writes cached unsolicited data in a DMA manner After the storage space corresponding to the destination address corresponding to the unrequested data, the method further includes:
- the network interface card carries the determined storage space size to be sent to the client in the R2T command
- the network interface card writes the received data to be stored into a storage space corresponding to the destination address of the data to be stored.
- a network interface card including:
- An acquiring unit configured to acquire unsolicited data, a destination address corresponding to the unsolicited data, where the unsolicited data is data to be stored that does not obtain a corresponding destination address in the data received by the acquiring unit;
- a cache unit configured to cache the obtained unsolicited data to a cache space of the network interface card
- the writing unit is configured to write the cached unsolicited data into the storage space corresponding to the destination address corresponding to the unsolicited data by using a direct memory access DMA method.
- the unsolicited data acquired by the acquiring unit is data carried in a write data command sent by the client; or the unsolicited data obtained by the acquiring unit is Carrying data in the unsolicited output data DATA_OUT message sent by the client;
- the unsolicited DATA_OUT message is a message that is received by the obtaining unit before sending the R2T command to send the R2T command to the client after receiving the write data command sent by the client.
- the cache unit is specifically configured to:
- the unsolicited data is buffered to the double rate DDR synchronous dynamic random access memory SDRAM space of the network interface card by using a DMA method.
- the determining unit is further configured to:
- the preset DIF values corresponding to the unsolicited data are equal.
- the writing unit is further configured to:
- the received data to be stored is written into a storage space corresponding to the destination address of the data to be stored.
- a method for storing data is provided: the network interface card acquires unsolicited data, and caches the obtained unsolicited data to a cache space of the network interface card, where the unsolicited data is received by the network interface card.
- the data to be stored corresponding to the destination address is not obtained in the data; the network interface card acquires the destination address corresponding to the unsolicited data, and the cached unsolicited data is written by DMA (Direct Memory Access)
- DMA Direct Memory Access
- the rate of writing data by DMA is higher than the rate of writing data by copying. Therefore, the time required for storing data is reduced, the storage rate is increased, and the write operation is a network interface card. Hardware to do, therefore, downgraded to the CPU The consumption of resources, which in turn reduces the impact on the processing rate of other applications.
- FIG. 1A is a schematic diagram of a SCSI protocol module in the prior art
- FIG. 1B is a flowchart of a write operation based on a SCSI protocol in the prior art
- 1C is a flow chart of a read operation based on a SCSI protocol in the prior art
- 2A is a detailed flowchart of storing data in an embodiment of the present invention.
- 2B is a schematic diagram of data and corresponding DIF values in an embodiment of the present invention.
- 3A is a first schematic diagram of an embodiment of storing data in an embodiment of the present invention.
- 3B is a second schematic diagram of an embodiment of storing data in an embodiment of the present invention.
- FIG. 4 is a schematic structural diagram of a network interface card according to an embodiment of the present invention.
- FIG. 5 is a schematic diagram of a physical device of a network interface card according to an embodiment of the present invention.
- system and “network” are used interchangeably herein.
- the term “and/or” in this context is merely an association describing the associated object, indicating that there may be three relationships, for example, A and / or B, which may indicate that A exists separately, and both A and B exist, respectively. B these three situations.
- the letter “/” in this article generally indicates that the contextual object is an "or" relationship.
- the cache layer stores the cached small data to be stored in the storage space corresponding to the destination address
- the drive layer is implemented by copying, and the copy mode storage takes a long time. Low-efficiency defects. Therefore, the current storage process has a long time-consuming and low-efficiency problem.
- the driver layer is the software layer, and the software layer needs to occupy the CPU when performing operations. Resources, and CPU resources are limited. Therefore, the current method of storing data also affects the processing rate of other applications.
- the network interface card acquires unsolicited data, and caches the obtained unsolicited data to a cache space of the network interface card, where The unsolicited data is data to be stored in the data received by the network interface card, and the destination address corresponding to the unsolicited data is obtained, and the cached unsolicited data is written in DMA mode.
- the DMA method is used for writing, and the rate of writing data by the DMA method is greater than the rate of writing data by the copy method, thereby reducing the storage.
- the time required in the data process increases the storage rate.
- the write operation is done by the network interface card hardware, the consumption of CPU resources is degraded, thereby reducing the processing rate for other applications. Impact.
- Step 200 The network interface card acquires the unsolicited data, and caches the obtained unsolicited data to the cache space of the network interface card, where the unrequested data is not obtained by the network interface card. Storing data;
- Step 210 The network interface card acquires a destination address corresponding to the unrequested data, and caches The unsolicited data is written in the storage space corresponding to the destination address corresponding to the unsolicited data by the DMA method.
- the network interface card may be a plurality of types, for example, a network card or an HBA.
- the application may be in other forms depending on the application scenario, and details are not described herein.
- the unsolicited data has multiple forms, and may be in the following form:
- the unsolicited data is data carried in a write data command sent by the client, that is, the network interface card can obtain unsolicited data from the write data command;
- the unsolicited data is data carried in an unsolicited DATA_OUT message sent by the client, that is, the network interface card can obtain unsolicited data from the unsolicited DATA_OUT message;
- the unsolicited DATA_OUT message is a message received by the network interface card before sending the R2T command to the client after receiving the write data command sent by the client.
- the network interface card caches the obtained unsolicited data to the cache space of the network interface card in multiple manners.
- the method may be as follows:
- the network interface card adopts a DMA method to buffer unsolicited data to a RAM (Random-Access Memory) space of the network interface card, wherein the RAM space has attributes of DMA operations performed by the DMA engine.
- a DMA method to buffer unsolicited data to a RAM (Random-Access Memory) space of the network interface card, wherein the RAM space has attributes of DMA operations performed by the DMA engine.
- the network interface card uses a DMA method to buffer unsolicited data to a DDR (Double Data Rate) SDRAM (Synchronous Dynamic Random Access Memory) space of the network interface card.
- DDR Double Data Rate
- SDRAM Synchronous Dynamic Random Access Memory
- the unrequested data may be all data to be written into the storage space, when However, it may also be part of the data to be written to the storage space, but the total size of all data to be written to the storage space is always carried in the write data command, and does not follow the unsolicited data as to be written to the storage space. All of the data changes and changes.
- the write data command can only carry 5K of data, and the total size of all data to be written to the storage space is 15K. Then, the size of the data to be written to the storage space carried in the write data command is 5K.
- the command can carry 15K of data.
- the unsolicited data is all data to be written to the storage space; if the write data command can only carry 5K of data, at this time, the unsolicited data is the storage space to be written. Part of the data.
- the network interface card when the network interface card caches the unsolicited data in the buffer space and writes the storage space corresponding to the destination address corresponding to the unrequested data by using the DMA mode, if the request data is buffered to the RAM space of the network interface card. Then, the network interface card will cache the unsolicited data in the RAM space, and write the DMA method into the storage space corresponding to the destination address corresponding to the unsolicited data.
- the network interface card caches the unsolicited data in the DDR SDRAM space, and writes the unrequested data corresponding to the destination address corresponding to the unsolicited data in the DMA mode.
- DIF Data Integrity Field
- iSCSI Internet Protocol
- DIF technology is an end-to-end data protection method. The data consists of two parts, one part is valid data, the other part is the DIF value corresponding to the valid data, and the DIF value is composed of 8 bytes, which is located every 512 bytes. After the valid data, that is, every 512 bytes of data in the transmitted data will be followed by the DIF value corresponding to the 512-byte data, as shown in FIG.
- DIF value 1 corresponds to data 1
- DIF value 2 corresponds to data 2
- DIF value 3 corresponds to data 3.
- the iSCSI initiator in the client When unsolicited data is transmitted, the DIF value of the unrequested data is calculated by a specified algorithm, and the DIF value is transmitted. After receiving the unsolicited data, the SCSI layer in the server calculates the DIF value corresponding to the unrequested data according to the unrequested data, and confirms the transmission when it is determined that the calculated DIF value is equal to the DIF value corresponding to the unrequested data. The data is complete. When it is determined that the calculated DIF value is not equal to the DIF value corresponding to the unrequested data, it is confirmed that the transmitted data is incomplete, falsified or destroyed.
- the network interface card includes the cached unsolicited data in the storage space corresponding to the destination address corresponding to the unrequested data by using the DMA mode, and further includes Do the following:
- the network interface card acquires a DIF calculation rule corresponding to the unsolicited data
- the network interface card uses the DIF calculation rule to calculate the DIF value corresponding to the unsolicited data
- the network interface card determines whether the calculated DIF value is equal to the preset DIF value corresponding to the unrequested data, and if so, the cached unrequested data is written into the storage space corresponding to the destination address corresponding to the unrequested data by using the DMA method. Otherwise, no write operation is performed.
- the DIF operation is performed by the network interface card, that is, the DIF operation is performed by hardware, and the hardware performs operations without occupying CPU resources, and the CPU resources are limited, if the DIF is executed.
- the operation does not consume CPU resources, so other applications use more CPU resources for processing. Therefore, performing DIF operations by the network interface card reduces the impact on the processing rate of other applications.
- the unsolicited data may change during the transmission process, such as tampering or destruction, and there is a certain degree of security risk.
- the network interface card in order to confirm the integrity of the unsolicited data, the network interface card is not Before requesting data writing, determining whether the calculated DIF value is equal to the preset DIF value corresponding to the unrequested data, and if so, the unsolicited data is considered complete.
- the cached unsolicited data is written into the storage space corresponding to the destination address corresponding to the unsolicited data by DMA. Otherwise, the received unsolicited data is considered to be incomplete and the write operation is not performed.
- the unsolicited data may not be all the data to be written into the storage space in the client. Further, in the implementation of the present invention, the cached unsolicited data in the network interface card is written and unrequested by the DMA method. After the data corresponding to the destination address corresponds to the storage space, the following operations are also included:
- the network interface card determines the size of the storage space corresponding to the destination address of the data to be stored when determining that there is data to be stored that is not written in the storage space;
- the network interface card carries the determined storage space size and sends it to the client in the R2T command;
- the network interface card receives the data to be stored returned by the client according to the R2T command
- the network interface card writes the to-be-stored data into the storage space corresponding to the destination address of the data to be stored.
- the size of the data to be stored that is not written to the storage space is 72K.
- the network interface card determines the storage space corresponding to the destination address of the data to be stored, and then the server sends an R2T carrying the determined storage space size.
- the command is sent to the client.
- the client can directly send a DATA_OUT message.
- the DATA_OUT message carries 72K data, or two DATA_OUT messages are sent. Each DATA_OUT message carries 36K data.
- Step 300 The network card receives a write data command sent by the client.
- the size of all the data to be written to the storage space in the write data command is 80K, and carries 8K of unsolicited data.
- Step 310 The network card caches the unrequested data into the RAM inside the network card.
- Step 320 The network card sends a write data command to the driver layer.
- Step 330 The driver layer sends a write data command to the SCSI layer.
- Step 340 The SCSI layer allocates a destination address for the data of 80K, and sends the destination address to the network card through the driver layer by calling the sending interface of the driver layer;
- Step 350 The network card stores the cached 8K unsolicited data into the storage space of the destination address corresponding to the unsolicited data according to the destination address;
- Step 360 The network card sends an R2T command to the client, where the remaining storage space in the storage space corresponding to the destination address is 72K;
- Step 370 The client sends 72K data to the network card.
- Step 380 The network card stores 72K of data into the remaining storage space.
- the network interface card includes an obtaining unit 400, a buffer unit 410, and a writing unit 420, where:
- the obtaining unit 400 is configured to acquire unsolicited data, a destination address corresponding to the unsolicited data, where the unsolicited data is data to be stored that does not obtain the corresponding destination address in the data received by the obtaining unit 400;
- the cache unit 410 is configured to cache the acquired unsolicited data to a cache space of the network interface card
- the writing unit 420 is configured to write the cached unsolicited data into the storage space corresponding to the destination address corresponding to the unrequested data by using the DMA method.
- the unsolicited data acquired by the obtaining unit 400 is the data carried in the write data command sent by the client; or the unsolicited data acquired by the obtaining unit 400 is carried in the non-requested data sent by the client.
- the unsolicited DATA_OUT message is a message received by the obtaining unit 400 before receiving the R2T command to the client after receiving the write data command sent by the client.
- the cache unit 410 is specifically configured to:
- DMA mode is used to cache unsolicited data to the RAM space of the network interface card
- the DMA method is used to buffer unsolicited data to the DDR SDRAM space of the network interface card.
- the determining unit 430 is configured to:
- the calculated DIF value is determined, and the preset DIF values corresponding to the unrequested data are equal.
- the writing unit 420 is further configured to:
- the received data to be stored is written into the storage space corresponding to the destination address of the data to be stored.
- the network interface card includes at least one processor 501, a communication bus 502, a memory 503, and at least one communication interface 504.
- the communication bus 502 is used to implement the connection and communication between the above components, and the communication interface 504 is used to connect and communicate with external devices.
- the memory 503 is configured to store program code that needs to be executed.
- the processor 501 executes the program code in the memory 503, the following functions are implemented:
- the destination address corresponding to the unsolicited data is obtained, and the cached unsolicited data is written into the storage space corresponding to the destination address corresponding to the unrequested data by using the DMA method.
- a method for storing data is provided: a network interface card Obtaining the unsolicited data, and buffering the obtained unsolicited data to the cache space of the network interface card, where the unsolicited data is the data to be stored that does not obtain the corresponding destination address in the data received by the network interface card; the network interface card Obtaining a destination address corresponding to the unrequested data, and writing the cached unrequested data into a storage space corresponding to the destination address corresponding to the unrequested data by using a DMA manner, in the scheme, the cached unsolicited data is written
- the DMA method is used for writing, and the rate of writing data by the DMA method is greater than the rate of writing data by the copy method, thereby reducing the data storage.
- the time required in the process increases the storage rate.
- the write operation is done by the network interface card hardware, the consumption of CPU resources is de
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the apparatus functions in one or more blocks of a flow or a flow diagram and/or block diagram of a flowchart.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
- the instructions provide functionality for implementing a block or blocks in one or more processes and/or block diagrams of the flowchart A step of.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Microelectronics & Electronic Packaging (AREA)
- Computer And Data Communications (AREA)
- Information Transfer Between Computers (AREA)
- Information Transfer Systems (AREA)
Abstract
本发明公开了一种存储数据的方法及网络接口卡,在该方案中,由于将缓存的非请求数据写入非请求数据对应的目的地址对应的存储空间中时,是采用DMA方式写入的,而采用DMA方式写入数据的速率大于采用拷贝方式写入数据的速率,因此,降低了在存储数据的过程中所需要的耗时、提高了存储速率,同时,由于写入操作是网络接口卡硬件来做的,因此,降级了对CPU资源的消耗,进而降低了对其他应用程序的处理速率的影响。
Description
本申请要求于2014年06月20日提交中国专利局、申请号为201410279606.3、发明名称为“一种存储数据的方法及网络接口卡”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及数据存储技术领域,特别涉及一种存储数据的方法及网络接口卡。
随着网络技术的发展以及数字信息的指数式增长,网络存储的重要性日益显现,多种网络存储技术应运而生。iSCSI(Internet Small Computer System Interface,互联网小型计算机系统接口)技术,是一种在IP(Internet Protocol,互联网协议)网络上运行SCSI(Small Computer System Interface,小型计算机系统接口)协议的存储技术,由于iSCSI技术具有维护简单,容易扩充,且硬件成本相对低廉的优点,使得iSCSI技术得到了广泛的应用,SCSI协议模块示意图如图1A所示。
iSCSI数据传送主要涉及到读写流程,图1B为现有的写操作处理流程图:
步骤A:iSCSI启动器向iSCSI目标器发送写数据命令;
步骤B:iSCSI目标器接收到写数据命令后,为待写入存储区域中的网络存储的所有数据分配目的地址,并将的目的地址通过R2T(Ready to Transfer,准备传输)命令发送给iSCSI启动器;
步骤C:iSCSI启动器向iSCSI目标器发送携带待写入数据的请求DATA_OUT(输出数据)消息,iSCSI目标器通过拷贝或者DDP(Direct Data
Placement,直接数据存储)技术把待写入数据放到目的地址对应的存储空间中。
图1C为现有的读操作处理流程图:
步骤a:iSCSI启动器向iSCSI目标器发送读数据命令;
在该步骤中,iSCSI启动器已经确定了待读数据所在的目的地址。
步骤b:iSCSI启动器接收iSCSI目标器发送的Data-In(输入数据)消息,其中,Data-In消息中携带目的地址对应的存储空间中存储的数据。
在图1B所示的写操作处理流程中,iSCSI启动器发送数据时,都是在接收到iSCSI目标器回复R2T命令之后才真正发送数据。在实际应用中,采用iSCSI技术存储数据的过程中,存在很多小数据的存储,若采用上述过程来实现写操作的话,在长距离传输的过程中因为交互操作繁琐而存在传输时延较大的缺陷。
为了降低小数据传输时的传输时延,iSCSI技术中又实现了省略发送R2T命令这个交互步骤,具体通过如下两种方式进行实现:
第一种为采用写数据命令的形式:将待写入的小数据直接携带在写数据命令中;
第二种为采用首次发送的非请求DATA_OUT消息的形式:将待写入的小数据直接携带在首次发送的非请求DATA_OUT消息中,而携带待写入的小数据的非请求DATA_OUT消息是紧跟在写数据命令发送的,也就是说,非请求DATA_OUT消息和写数据命令之间没有R2T命令的交互。
上述两种方式中,iSCSI启动器均不需要等到iSCSI目标器回复R2T命令,就可以直接向iSCSI目标器发送待写入的小数据,但是,因为iSCSI目标器在接收到iSCSI启动器发送的待写入的小数据时,没有获取待写入的小数据的目的地址,因此,在接收到iSCSI启动器发送的待写入的小数据时,要先进行缓存。
现有技术中,在将待写入的小数据缓存时,具体为:HBA(Host Bus
Adapter,主机总线适配器)接收到iSCSI启动器发送的待写入的小数据后,先将待写入的小数据缓存至驱动层,驱动层在接收到SCSI层下发的待写入的数据的目的地址后,驱动层将缓存的待写入的小数据拷贝至目的地址对应的存储空间,从上述过程中可以看出,驱动层在将缓存的待写入的小数据存储到目的地址对应的存储空间时,是通过拷贝方式实现的,而拷贝方式存储存在耗时较长,效率较低的缺陷,因此,目前的存储过程存在耗时较长,效率较低问题,同时,由于拷贝操作是在驱动层完成的,驱动层为软件层,软件层执行操作时,需要占用CPU(Central Processing Unit,中央处理器)资源,而CPU资源是有限的,因此,目前的存储数据的方法还会对其他应用程序的处理速率造成影响。
综上所述,现有的存储数据的方法存在耗时较长、存储效率较低,及对其他应用程序的处理速率存在影响的缺陷。
发明内容
本发明实施例提供一种存储数据的方法及网络接口卡,用以解决现有技术中在存储数据的过程中存在的耗时较长、存储速率较低,及对其他应用程序的处理速率存在影响的缺陷。
本发明实施例提供的具体技术方案如下:
第一方面,提供一种存储数据的方法,包括:
网络接口卡获取非请求数据,并将获取的非请求数据缓存至所述网络接口卡的缓存空间,其中,所述非请求数据为所述网络接口卡接收到的数据中未获取到对应的目的地址的待存储数据;
所述网络接口卡获取与所述非请求数据对应的目的地址,并将缓存的非请求数据,采用直接存储器访问DMA方式写入与所述非请求数据对应的目的地址对应的存储空间中。
结合第一方面,在第一种可能的实现方式中,所述非请求数据为携带
在客户端发送的写数据命令中的数据;或者,所述非请求数据为携带在客户端发送的非请求输出数据DATA_OUT消息中的数据;
其中,所述非请求DATA_OUT消息是所述网络接口卡在接收到所述客户端发送的所述写数据命令后,在向所述客户端发送准备传输R2T命令之前接收到的消息。
结合第一方面,或者第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述网络接口卡将获取的非请求数据缓存至所述网络接口卡的缓存空间,具体包括:
所述网络接口卡采用DMA方式,将所述非请求数据缓存至所述网络接口卡的随机存取存储器RAM空间;或者
所述网络接口卡采用DMA方式,将所述非请求数据缓存至所述网络接口卡的双倍速率DDR同步动态随机存储器SDRAM空间。
结合第一方面,或者第一方面的第一至第二种可能的实现方式,在第三种可能的实现方式中,所述网络接口卡将缓存的非请求数据,采用DMA方式写入与所述非请求数据对应的目的地址对应的存储空间中之前,还包括:
所述网络接口卡获取与所述非请求数据对应的数据完整域DIF计算规则;
所述网络接口卡采用所述DIF计算规则,计算与所述非请求数据对应的DIF值;
所述网络接口卡确定计算得到的DIF值,与所述非请求数据对应的预设DIF值相等。
结合第一方面,或者第一方面的第一至第三种可能的实现方式,在第四种可能的实现方式中,所述网络接口卡将缓存的非请求数据,采用DMA方式写入与所述非请求数据对应的目的地址对应的存储空间中之后,还包括:
所述网络接口卡在判定存在未写入存储空间的待存储数据时,确定所述待存储数据的目的地址对应的存储空间大小;
所述网络接口卡将确定出的存储空间大小携带在R2T命令中发送至客户端;
所述网络接口卡接收所述客户端根据所述R2T命令返回的所述待存储数据;
所述网络接口卡将接收到的待存储数据,写入所述待存储数据的目的地址对应的存储空间中。
第二方面,提供一种网络接口卡,包括:
获取单元,用于获取非请求数据、与所述非请求数据对应的目的地址,其中,所述非请求数据为所述获取单元接收到的数据中未获取到对应的目的地址的待存储数据;
缓存单元,用于将获取的非请求数据缓存至网络接口卡的缓存空间;
写入单元,用于将缓存的非请求数据,采用直接存储器访问DMA方式写入与所述非请求数据对应的目的地址对应的存储空间中。
结合第二方面,在第一种可能的实现方式中,所述获取单元获取的非请求数据为携带在客户端发送的写数据命令中的数据;或者,所述获取单元获取的非请求数据为携带在客户端发送的非请求输出数据DATA_OUT消息中的数据;
其中,所述非请求DATA_OUT消息是所述获取单元在接收到所述客户端发送的所述写数据命令后,在向所述客户端发送准备传输R2T命令之前接收到的消息。
结合第二方面,或者第二方面的第一种可能的实现方式,在第二种可能的实现方式中,所述缓存单元具体用于:
采用DMA方式,将所述非请求数据缓存至所述网络接口卡的随机存取存储器RAM空间;或者
采用DMA方式,将所述非请求数据缓存至所述网络接口卡的双倍速率DDR同步动态随机存储器SDRAM空间。
结合第二方面,或者第二方面的第一至第二种可能的实现方式,在第三种可能的实现方式中,还包括确定单元,所述确定单元用于:
获取与所述非请求数据对应的数据完整域DIF计算规则;
采用所述DIF计算规则,计算与所述非请求数据对应的DIF值;
确定计算得到的DIF值,与所述非请求数据对应的预设DIF值相等。
结合第二方面,或者第二方面的第一至第三种可能的实现方式,在第四种可能的实现方式中,所述写入单元还用于:
在判定存在未写入存储空间的待存储数据时,确定所述待存储数据的目的地址对应的存储空间大小;
将确定出的存储空间大小携带在R2T命令中发送至客户端;
接收所述客户端根据所述R2T命令返回的所述待存储数据;
将接收到的待存储数据,写入所述待存储数据的目的地址对应的存储空间中。
本发明有益效果如下:
本发明实施例中,提出一种存储数据的方法:网络接口卡获取非请求数据,并将获取的非请求数据缓存至网络接口卡的缓存空间,其中,非请求数据为网络接口卡接收到的数据中未获取到对应的目的地址的待存储数据;网络接口卡获取与非请求数据对应的目的地址,并将缓存的非请求数据,采用DMA(Direct Memory Access,直接内存存取)方式写入与非请求数据对应的目的地址对应的存储空间中,在该方案中,由于将缓存的非请求数据写入非请求数据对应的目的地址对应的存储空间中时,是采用DMA方式写入的,而采用DMA方式写入数据的速率大于采用拷贝方式写入数据的速率,因此,降低了在存储数据的过程中所需要的耗时、提高了存储速率,同时,由于写入操作是网络接口卡硬件来做的,因此,降级了对CPU
资源的消耗,进而降低了对其他应用程序的处理速率的影响。
图1A为现有技术中SCSI协议模块的示意图;
图1B为现有技术中基于SCSI协议的写操作的流程图;
图1C为现有技术中基于SCSI协议的读操作的流程图;
图2A为本发明实施例中存储数据的详细流程图;
图2B为本发明实施例中数据和对应的DIF值的示意图;
图3A为本发明实施例中存储数据的实施例的第一示意图;
图3B为本发明实施例中存储数据的实施例的第二示意图;
图4为本发明实施例中网络接口卡的功能结构示意图;
图5为本发明实施例中网络接口卡的实体装置示意图。
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
另外,本文中术语“系统”和“网络”在本文中常被可互换使用。本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字母“/”,一般表示前后关联对象是一种“或”的关系。
现有技术中,驱动层在将缓存的待写入的小数据存储到目的地址对应的存储空间时,是通过拷贝方式实现的,而拷贝方式存储存在耗时较长,
效率较低的缺陷,因此,目前的存储过程存在耗时较长,效率较低问题,同时,由于拷贝操作是在驱动层完成的,驱动层为软件层,软件层执行操作时,需要占用CPU资源,而CPU资源是有限的,因此,目前的存储数据的方法还会对其他应用程序的处理速率造成影响,为了解决现有技术中存在的耗时较长、存储速率较低,及对其他应用程序的处理速率存在影响的缺陷,本发明实施例中,提出一种存储数据的方法:网络接口卡获取非请求数据,并将获取的非请求数据缓存至网络接口卡的缓存空间,其中,非请求数据为网络接口卡接收到的数据中未获取到对应的目的地址的待存储数据;网络接口卡获取与非请求数据对应的目的地址,并将缓存的非请求数据,采用DMA方式写入与非请求数据对应的目的地址对应的存储空间中,在该方案中,由于将缓存的非请求数据写入非请求数据对应的目的地址对应的存储空间中时,是采用DMA方式写入的,而采用DMA方式写入数据的速率大于采用拷贝方式写入数据的速率,因此,降低了在存储数据的过程中所需要的耗时、提高了存储速率,同时,由于写入操作是网络接口卡硬件来做的,因此,降级了对CPU资源的消耗,进而降低了对其他应用程序的处理速率的影响。
下面结合说明书附图对本发明优选的实施方式进行详细说明,应当理解,此处所描述的优选实施例仅用于说明和解释本发明,并不用于限定本发明,并且在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
下面结合附图对本发明优选的实施方式进行详细说明。
参阅图2A所示,本发明实施例中,存储数据的详细流程如下:
步骤200:网络接口卡获取非请求数据,并将获取的非请求数据缓存至网络接口卡的缓存空间,其中,非请求数据为网络接口卡接收到的数据中未获取到对应的目的地址的待存储数据;
步骤210:网络接口卡获取与非请求数据对应的目的地址,并将缓存的
非请求数据,采用DMA方式写入与非请求数据对应的目的地址对应的存储空间中。
本发明实施例中,网络接口卡有多种,例如,可以为网卡,也可以为HBA,当然,随着应用场景的不同,还可以为其他形式,在此不再进行一一详述。
本发明实施例中,非请求数据的形式有多种,可选的,可以为如下形式:
例如,非请求数据是携带在客户端发送的写数据命令中的数据,也就是说,网络接口卡可以从写数据命令中获取非请求数据;
又例如,非请求数据为携带在客户端发送的非请求DATA_OUT消息中的数据,也就是说,网络接口卡可以从非请求DATA_OUT消息中获取非请求数据;
其中,非请求DATA_OUT消息是网络接口卡在接收到客户端发送的写数据命令后,在向客户端发送R2T命令之前接收到的消息。
当然,在实际应用中,非请求数据还有其他形式,在此不再进行一一详述。
本发明实施例中,网络接口卡将获取的非请求数据缓存至网络接口卡的缓存空间的方式有多种,可选的,可以采用如下方式:
例如,网络接口卡采用DMA方式,将非请求数据缓存至网络接口卡的RAM(Random-Access Memory,随机存取存储器)空间,其中,RAM空间具有由DMA引擎进行DMA操作的属性。
或者,还可以采用如下方式:
例如,网络接口卡采用DMA方式,将非请求数据缓存至网络接口卡的DDR(Double Data Rate,双倍速率)SDRAM(Synchronous Dynamic Random Access Memory,同步动态随机存储器)空间。
本发明实施例中,非请求数据可以为待写入存储空间的所有数据,当
然,也可以是待写入存储空间的部分数据,但是,写数据命令中携带的始终是待写入存储空间的所有数据的总大小,不会随着非请求数据是否为待写入存储空间的所有数据的变化而发生变化。
例如,写数据命令中只能携带5K的数据,待写入存储空间的所有数据的总大小为15K,那么,写数据命令中携带的待写入存储空间的数据的大小为5K,若写数据命令中可以携带15K的数据,此时,非请求数据就为待写入存储空间的所有数据;若写数据命令中只可以携带5K的数据,此时,非请求数据就为待写入存储空间的部分数据。
本发明实施例中,网络接口卡将缓存在缓存空间的非请求数据,采用DMA方式写入与非请求数据对应的目的地址对应的存储空间中时,若请求数据缓存至网络接口卡的RAM空间,那么,网络接口卡将缓存在RAM空间的非请求数据,采用DMA方式写入与非请求数据对应的目的地址对应的存储空间中。
此时,若非请求数据缓存至网络接口卡的DDR SDRAM,那么,网络接口卡将缓存在DDR SDRAM空间的非请求数据,采用DMA方式写入与非请求数据对应的目的地址对应的存储空间中。
在实际应用中,非请求数据从客户端传输到网络接口卡的过程中,可能会因恶略的环境引入错误,但这些错误对于一些对数据有严格需求的场合,比如银行账户信息等,是绝对不允许的,因此,为了确认数据传输的完整性,在iSCSI技术中又引入了DIF(Data Integrity Field,数据完整域)技术。DIF技术是一种端到端的数据保护的方法,数据由两部分组成,一部分为有效的数据,另一部分为与有效数据对应的DIF值,DIF值由8字节大小组成,位于每512字节的有效数据后面,也就是说,发送的数据中每512字节数据后面都会紧跟与这512字节的数据对应的DIF值,如图2B所示,在该图示中,数据1、数据2、数据3均为有效数据,DIF值1与数据1对应,DIF值2与数据2对应,DIF值3与数据3对应。现有技术中,客户端中的iSCSI启动器
在发送非请求数据时,通过指定算法计算出非请求数据的DIF值,并把DIF值发送。服务器中的SCSI层接收到非请求数据后,会根据非请求数据计算出与非请求数据对应的DIF值,并在判定计算得出的DIF值与非请求数据对应的DIF值相等时,确认传输的数据是完整的,在判定计算得出的DIF值与非请求数据对应的DIF值不相等时,确认传输的数据是不完整的,发生了篡改或者是破坏。
从上述过程可以看出,现有技术中在确定非请求数据是否完整时,是在SCSI层执行的,也就是说,这个操作是软件层来执行的,因此,同样存在占用CPU资源,进而对其他应用程序的处理速率存在影响的缺陷。
本发明实施例中,进一步的,为了确认非请求数据的完整性,网络接口卡将缓存的非请求数据,采用DMA方式写入与非请求数据对应的目的地址对应的存储空间中之前,还包括如下操作:
网络接口卡获取与非请求数据对应的DIF计算规则;
网络接口卡采用DIF计算规则,计算与非请求数据对应的DIF值;
网络接口卡判定计算得到的DIF值,与非请求数据对应的预设DIF值是否相等,若是,将缓存的非请求数据,采用DMA方式写入与非请求数据对应的目的地址对应的存储空间中,否则,不执行写入操作。
本发明实施例中,由于DIF操作是由网络接口卡来执行的,也就是说,DIF操作是由硬件来执行的,而硬件执行操作时不占用CPU资源,CPU资源是有限的,若执行DIF操作时不占用CPU资源,那么其他应用程序用使用更多的CPU资源进行处理,因此,由网络接口卡执行DIF操作降低了对其他应用程序的处理速率的影响。
在实际应用中,非请求数据在传输过程中会发生变化,如篡改,或者破坏,存在一定程度的安全隐患,本发明实施例中,为了确认非请求数据的完整性,网络接口卡在将非请求数据写入之前,判定计算得到的DIF值,与非请求数据对应的预设DIF值是否相等,若是,认为非请求数据是完整
的,才将缓存的非请求数据,采用DMA方式写入与非请求数据对应的目的地址对应的存储空间中,否则,认为接收到的非请求数据是不完整的,不执行写入操作。
本发明实施例中,可能非请求数据不是客户端中待写入存储空间的所有数据,进一步的,本发明实施中,在网络接口卡将缓存的非请求数据,采用DMA方式写入与非请求数据对应的目的地址对应的存储空间中之后,还包括如下操作:
网络接口卡在判定存在未写入存储空间的待存储数据时,确定待存储数据的目的地址对应的存储空间大小;
网络接口卡将确定出的存储空间大小携带在R2T命令中发送至客户端;
网络接口卡接收客户端根据R2T命令返回的待存储数据;
网络接口卡将接收到的待存储数据,写入待存储数据的目的地址对应的存储空间中。
例如,未写入存储空间的待存储数据的大小为72K,这时网络接口卡要确定待存储数据的目的地址对应的存储空间大小,然后,服务器会发送一个携带确定出的存储空间大小的R2T命令给客户端,客户端接收到R2T命令后,可以直接发送一个DATA_OUT消息,该DATA_OUT消息中携带72K大小的数据,或者,发送两个DATA_OUT消息,每一个DATA_OUT消息中携带36K大小的数据。
为了更好地理解本发明实施例,以下给出具体应用场景,针对存储数据的过程,作出进一步详细描述,如图3A、3B所示:
步骤300:网卡接收客户端发送的写数据命令;
该步骤中,写数据命令中携带待写入存储空间的所有数据的大小为80K,并携带8K的非请求数据。
步骤310:网卡将非请求数据缓存至网卡内部的RAM中;
步骤320:网卡向驱动层发送写数据命令;
步骤330:驱动层将写数据命令发送至SCSI层;
步骤340:SCSI层为80K的数据分配目的地址,并通过调用驱动层的发送接口将目的地址通过驱动层发送至网卡;
步骤350:网卡根据目的地址将缓存的8K非请求数据存储至与非请求数据对应的目的地址的存储空间中;
步骤360:网卡向客户端发送R2T命令,该命令中携带目的地址对应的存储空间中剩余的存储空间为72K;
步骤370:客户端向网卡发送72K的数据;
步骤380:网卡将72K的数据存储至剩余的存储空间中。
基于上述技术方案,参阅图4所示,本发明实施例提供一种网络接口卡,该网络接口卡包括获取单元400、缓存单元410,写入单元420,其中:
获取单元400,用于获取非请求数据、与非请求数据对应的目的地址,其中,非请求数据为获取单元400接收到的数据中未获取到对应的目的地址的待存储数据;
缓存单元410,用于将获取的非请求数据缓存至网络接口卡的缓存空间;
写入单元420,用于将缓存的非请求数据,采用DMA方式写入与非请求数据对应的目的地址对应的存储空间中。
本发明实施例中,可选的,获取单元400获取的非请求数据为携带在客户端发送的写数据命令中的数据;或者,获取单元400获取的非请求数据为携带在客户端发送的非请求DATA_OUT消息中的数据;
其中,非请求DATA_OUT消息是获取单元400在接收到客户端发送的写数据命令后,在向客户端发送R2T命令之前接收到的消息。
本发明实施例中,可选的,缓存单元410具体用于:
采用DMA方式,将非请求数据缓存至网络接口卡的RAM空间;或者
采用DMA方式,将非请求数据缓存至网络接口卡的DDR SDRAM空间。
本发明实施例中,进一步的,还包括确定单元430,确定单元430用于:
获取与非请求数据对应的DIF计算规则;
采用DIF计算规则,计算与非请求数据对应的DIF值;
确定计算得到的DIF值,与非请求数据对应的预设DIF值相等。
本发明实施例中,进一步的,写入单元420还用于:
在判定存在未写入存储空间的待存储数据时,确定待存储数据的目的地址对应的存储空间大小;
将确定出的存储空间大小携带在R2T命令中发送至客户端;
接收客户端根据R2T命令返回的待存储数据;
将接收到的待存储数据,写入待存储数据的目的地址对应的存储空间中。
如图5所示,为本发明实施例提供的网络接口卡的实体装置图,网络接口卡包括至少一个处理器501,通信总线502,存储器503以及至少一个通信接口504。
其中,通信总线502用于实现上述组件之间的连接并通信,通信接口504用于与外部设备连接并通信。
其中,存储器503用于存储需要执行的程序代码,当处理器501执行存储器503中的程序代码时,实现如下功能:
获取非请求数据,并将获取的非请求数据缓存至网络接口卡的缓存空间,其中,非请求数据为网络接口卡接收到的数据中未获取到对应的目的地址的待存储数据;
获取与非请求数据对应的目的地址,并将缓存的非请求数据,采用DMA方式写入与非请求数据对应的目的地址对应的存储空间中。
综上所述,本发明实施例中,提出一种存储数据的方法:网络接口卡
获取非请求数据,并将获取的非请求数据缓存至网络接口卡的缓存空间,其中,非请求数据为网络接口卡接收到的数据中未获取到对应的目的地址的待存储数据;网络接口卡获取与非请求数据对应的目的地址,并将缓存的非请求数据,采用DMA方式写入与非请求数据对应的目的地址对应的存储空间中,在该方案中,由于将缓存的非请求数据写入非请求数据对应的目的地址对应的存储空间中时,是采用DMA方式写入的,而采用DMA方式写入数据的速率大于采用拷贝方式写入数据的速率,因此,降低了在存储数据的过程中所需要的耗时、提高了存储速率,同时,由于写入操作是网络接口卡硬件来做的,因此,降级了对CPU资源的消耗,进而降低了对其他应用程序的处理速率的影响。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中的功能
的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本发明实施例的精神和范围。这样,倘若本发明实施例的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。
Claims (10)
- 一种存储数据的方法,其特征在于,包括:网络接口卡获取非请求数据,并将获取的非请求数据缓存至所述网络接口卡的缓存空间,其中,所述非请求数据为所述网络接口卡接收到的数据中未获取到对应的目的地址的待存储数据;所述网络接口卡获取与所述非请求数据对应的目的地址,并将缓存的非请求数据,采用直接存储器访问DMA方式写入与所述非请求数据对应的目的地址对应的存储空间中。
- 如权利要求1所述的方法,其特征在于,所述非请求数据为携带在客户端发送的写数据命令中的数据;或者,所述非请求数据为携带在客户端发送的非请求输出数据DATA_OUT消息中的数据;其中,所述非请求DATA_OUT消息是所述网络接口卡在接收到所述客户端发送的所述写数据命令后,在向所述客户端发送准备传输R2T命令之前接收到的消息。
- 如权利要求1或2所述的方法,其特征在于,所述网络接口卡将获取的非请求数据缓存至所述网络接口卡的缓存空间,具体包括:所述网络接口卡采用DMA方式,将所述非请求数据缓存至所述网络接口卡的随机存取存储器RAM空间;或者所述网络接口卡采用DMA方式,将所述非请求数据缓存至所述网络接口卡的双倍速率DDR同步动态随机存储器SDRAM空间。
- 如权利要求1-3任一项所述的方法,其特征在于,所述网络接口卡将缓存的非请求数据,采用DMA方式写入与所述非请求数据对应的目的地址对应的存储空间中之前,还包括:所述网络接口卡获取与所述非请求数据对应的数据完整域DIF计算规则;所述网络接口卡采用所述DIF计算规则,计算与所述非请求数据对应 的DIF值;所述网络接口卡确定计算得到的DIF值,与所述非请求数据对应的预设DIF值相等。
- 如权利要求1-4任一项所述的方法,其特征在于,所述网络接口卡将缓存的非请求数据,采用DMA方式写入与所述非请求数据对应的目的地址对应的存储空间中之后,还包括:所述网络接口卡在判定存在未写入存储空间的待存储数据时,确定所述待存储数据的目的地址对应的存储空间大小;所述网络接口卡将确定出的存储空间大小携带在R2T命令中发送至客户端;所述网络接口卡接收所述客户端根据所述R2T命令返回的所述待存储数据;所述网络接口卡将接收到的待存储数据,写入所述待存储数据的目的地址对应的存储空间中。
- 一种网络接口卡,其特征在于,包括:获取单元,用于获取非请求数据、与所述非请求数据对应的目的地址,其中,所述非请求数据为所述获取单元接收到的数据中未获取到对应的目的地址的待存储数据;缓存单元,用于将获取的非请求数据缓存至网络接口卡的缓存空间;写入单元,用于将缓存的非请求数据,采用直接存储器访问DMA方式写入与所述非请求数据对应的目的地址对应的存储空间中。
- 如权利要求6所述的网络接口卡,其特征在于,所述获取单元获取的非请求数据为携带在客户端发送的写数据命令中的数据;或者,所述获取单元获取的非请求数据为携带在客户端发送的非请求输出数据DATA_OUT消息中的数据;其中,所述非请求DATA_OUT消息是所述获取单元在接收到所述客户 端发送的所述写数据命令后,在向所述客户端发送准备传输R2T命令之前接收到的消息。
- 如权利要求6或7所述的网络接口卡,其特征在于,所述缓存单元具体用于:采用DMA方式,将所述非请求数据缓存至所述网络接口卡的随机存取存储器RAM空间;或者采用DMA方式,将所述非请求数据缓存至所述网络接口卡的双倍速率DDR同步动态随机存储器SDRAM空间。
- 如权利要求6-8任一项所述的网络接口卡,其特征在于,还包括确定单元,所述确定单元用于:获取与所述非请求数据对应的数据完整域DIF计算规则;采用所述DIF计算规则,计算与所述非请求数据对应的DIF值;确定计算得到的DIF值,与所述非请求数据对应的预设DIF值相等。
- 如权利要求6-9任一项所述的网络接口卡,其特征在于,所述写入单元还用于:在判定存在未写入存储空间的待存储数据时,确定所述待存储数据的目的地址对应的存储空间大小;将确定出的存储空间大小携带在R2T命令中发送至客户端;接收所述客户端根据所述R2T命令返回的所述待存储数据;将接收到的待存储数据,写入所述待存储数据的目的地址对应的存储空间中。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP15810575.9A EP3159803B1 (en) | 2014-06-20 | 2015-04-20 | Data storage method and network interface card |
US15/216,477 US10116746B2 (en) | 2014-06-20 | 2016-07-21 | Data storage method and network interface card |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410279606.3A CN104063344B (zh) | 2014-06-20 | 2014-06-20 | 一种存储数据的方法及网络接口卡 |
CN201410279606.3 | 2014-06-20 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US15/216,477 Continuation US10116746B2 (en) | 2014-06-20 | 2016-07-21 | Data storage method and network interface card |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2015192685A1 true WO2015192685A1 (zh) | 2015-12-23 |
Family
ID=51551063
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2015/076991 WO2015192685A1 (zh) | 2014-06-20 | 2015-04-20 | 一种存储数据的方法及网络接口卡 |
Country Status (4)
Country | Link |
---|---|
US (1) | US10116746B2 (zh) |
EP (1) | EP3159803B1 (zh) |
CN (1) | CN104063344B (zh) |
WO (1) | WO2015192685A1 (zh) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104063344B (zh) * | 2014-06-20 | 2018-06-26 | 华为技术有限公司 | 一种存储数据的方法及网络接口卡 |
CN105404596B (zh) * | 2015-10-30 | 2018-07-20 | 华为技术有限公司 | 一种数据传输方法、装置及系统 |
CN106210041B (zh) * | 2016-07-05 | 2019-09-20 | 杭州华为数字技术有限公司 | 一种数据写入方法及服务器端网卡 |
CN109564502B (zh) * | 2016-08-19 | 2020-12-08 | 华为技术有限公司 | 应用于存储设备中的访问请求的处理方法和装置 |
CN106909513A (zh) * | 2017-03-20 | 2017-06-30 | 杭州朔天科技有限公司 | 一种异步非对称的读写存储区管理方法 |
US11630994B2 (en) * | 2018-02-17 | 2023-04-18 | Advanced Micro Devices, Inc. | Optimized asynchronous training of neural networks using a distributed parameter server with eager updates |
CN109040221A (zh) * | 2018-07-26 | 2018-12-18 | 郑州云海信息技术有限公司 | 一种数据传输方法、系统、设备及存储阵列和存储介质 |
CN110837479B (zh) * | 2018-08-17 | 2023-09-01 | 华为云计算技术有限公司 | 数据处理方法、相关设备及计算机存储介质 |
CN112291293B (zh) * | 2019-07-27 | 2023-01-06 | 华为技术有限公司 | 任务处理方法、相关设备及计算机存储介质 |
EP4268111A4 (en) * | 2020-12-23 | 2024-07-03 | Intel Corp | VM ENCRYPTION OF BLOCK STORAGE WITH END-TO-END DATA INTEGRITY PROTECTION IN ONE SMARTNIK |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20010047433A1 (en) * | 1997-10-14 | 2001-11-29 | Alacritech, Inc. | Obtaining a destination address so that a network interface device can write network data without headers directly into host memory |
CN102244579A (zh) * | 2010-05-12 | 2011-11-16 | 北京研华兴业电子科技有限公司 | 网卡及网络数据接收方法 |
CN103200128A (zh) * | 2013-04-01 | 2013-07-10 | 华为技术有限公司 | 一种网络包处理的方法、装置和系统 |
CN104063344A (zh) * | 2014-06-20 | 2014-09-24 | 华为技术有限公司 | 一种存储数据的方法及网络接口卡 |
Family Cites Families (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8027194B2 (en) | 1988-06-13 | 2011-09-27 | Samsung Electronics Co., Ltd. | Memory system and method of accessing a semiconductor memory device |
US7237036B2 (en) * | 1997-10-14 | 2007-06-26 | Alacritech, Inc. | Fast-path apparatus for receiving data corresponding a TCP connection |
US6226680B1 (en) | 1997-10-14 | 2001-05-01 | Alacritech, Inc. | Intelligent network interface system method for protocol processing |
US6775693B1 (en) * | 2000-03-30 | 2004-08-10 | Baydel Limited | Network DMA method |
ATE550852T1 (de) * | 2000-09-29 | 2012-04-15 | Alacritech Inc | Intelligentes netzwerkspeicherschnittstellensystem und solche einrichtungen |
US7685254B2 (en) * | 2003-06-10 | 2010-03-23 | Pandya Ashish A | Runtime adaptable search processor |
US8417834B2 (en) | 2003-09-10 | 2013-04-09 | Broadcom Corporation | Unified infrastructure over ethernet |
US7835380B1 (en) * | 2004-10-19 | 2010-11-16 | Broadcom Corporation | Multi-port network interface device with shared processing resources |
US20060168091A1 (en) * | 2005-01-21 | 2006-07-27 | International Business Machines Corporation | RNIC-BASED OFFLOAD OF iSCSI DATA MOVEMENT FUNCTION BY INITIATOR |
US20060168286A1 (en) * | 2005-01-21 | 2006-07-27 | International Business Machines Corporation | iSCSI DATAMOVER INTERFACE AND FUNCTION SPLIT WITH RDMA ATP MECHANISM |
US8387073B1 (en) * | 2007-03-23 | 2013-02-26 | Qlogic, Corporation | Method and system for processing network packets |
US8365057B2 (en) * | 2009-07-30 | 2013-01-29 | Mellanox Technologies Ltd | Processing of data integrity field |
CN103533075B (zh) * | 2013-10-23 | 2017-05-03 | 中国科学院声学研究所 | 将数据导入iSCSI目标器的方法和iSCSI启动器 |
-
2014
- 2014-06-20 CN CN201410279606.3A patent/CN104063344B/zh active Active
-
2015
- 2015-04-20 EP EP15810575.9A patent/EP3159803B1/en active Active
- 2015-04-20 WO PCT/CN2015/076991 patent/WO2015192685A1/zh active Application Filing
-
2016
- 2016-07-21 US US15/216,477 patent/US10116746B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20010047433A1 (en) * | 1997-10-14 | 2001-11-29 | Alacritech, Inc. | Obtaining a destination address so that a network interface device can write network data without headers directly into host memory |
CN102244579A (zh) * | 2010-05-12 | 2011-11-16 | 北京研华兴业电子科技有限公司 | 网卡及网络数据接收方法 |
CN103200128A (zh) * | 2013-04-01 | 2013-07-10 | 华为技术有限公司 | 一种网络包处理的方法、装置和系统 |
CN104063344A (zh) * | 2014-06-20 | 2014-09-24 | 华为技术有限公司 | 一种存储数据的方法及网络接口卡 |
Also Published As
Publication number | Publication date |
---|---|
EP3159803B1 (en) | 2018-11-28 |
EP3159803A4 (en) | 2017-06-28 |
US20160330283A1 (en) | 2016-11-10 |
CN104063344A (zh) | 2014-09-24 |
US10116746B2 (en) | 2018-10-30 |
EP3159803A1 (en) | 2017-04-26 |
CN104063344B (zh) | 2018-06-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2015192685A1 (zh) | 一种存储数据的方法及网络接口卡 | |
US11126353B2 (en) | Method and apparatus for data copy | |
US9251201B2 (en) | Compatibly extending offload token size | |
US9071585B2 (en) | Copy offload for disparate offload providers | |
US9578132B2 (en) | Zero copy data transfers without modifying host side protocol stack parameters | |
WO2015062339A1 (zh) | 远程应用程序运行的方法和装置 | |
US9876845B2 (en) | Data transmission | |
CN104317716B (zh) | 分布式节点间的数据传输方法及分布式节点设备 | |
CN109478171B (zh) | 提高openfabrics环境中的吞吐量 | |
US20190317692A1 (en) | Method and apparatus for ensuring data consistency | |
US10606773B2 (en) | Systems and methods for low latency access of memory between computing devices | |
US20090010157A1 (en) | Flow control in a variable latency system | |
KR102180975B1 (ko) | 랩핑된 판독 대 연속적인 판독을 갖는 메모리 서브 시스템 | |
US20210306149A1 (en) | Hardware security module proxy device for storage expansion | |
US10523741B2 (en) | System and method for avoiding proxy connection latency | |
US11940917B2 (en) | System and method for network interface controller based distributed cache | |
US8375164B2 (en) | Content addressable storage with reduced latency | |
JP2013541753A (ja) | ロー・レイテンシ内容アドレス記憶装置 | |
US20110296441A1 (en) | System And Method For Supporting A Remote Isochronous Device | |
CN117061502A (zh) | 文件传输方法、装置、设备和存储介质 | |
CN118585472A (zh) | 一种数据传输方法、装置、电子设备及计算机可读介质 | |
JP2002024153A (ja) | バッファ制御方式 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 15810575 Country of ref document: EP Kind code of ref document: A1 |
|
REEP | Request for entry into the european phase |
Ref document number: 2015810575 Country of ref document: EP |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2015810575 Country of ref document: EP |
|
NENP | Non-entry into the national phase |
Ref country code: DE |