A management method for receiving network data of zero copy buffer queue

A management method and network data technology, which are applied in the field of network data reception by separating handles to manage zero-copy data buffer queues, can solve the problem of inability to access data buffer queues at the same time, and achieve improved flexibility and efficiency, flexible and efficient management , the effect of improving the timeliness

Inactive Publication Date: 2008-03-26
DAWNING INFORMATION IND BEIJING
View PDF0 Cites 16 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The present invention is aimed at the data buffer queue management method in the current network data transmission and adopts that the elements (data) in the data queue and the control information (queue control items) of the queue are tightly coupled together, and are applied in the kernel driver program and user memory. When the program accesses the queue, it must check and set the mutual exclusion flag. It is impossible to realize the simultaneous access to the data buffer queue by the kernel driver program and the use

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A management method for receiving network data of zero copy buffer queue
  • A management method for receiving network data of zero copy buffer queue
  • A management method for receiving network data of zero copy buffer queue

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0020] Fig. 1 is a schematic diagram of the operation process of the present invention, and Fig. 6 is a schematic diagram of the structure of the control handle of the present invention. As shown in Figure 1 and Figure 6, the present invention includes the following steps:

[0021] A. Allocate continuous memory in user space as the DMA buffer of the message;

[0022] In this step, check the maximum shared memory value initially set by the system. If the requested memory value is greater than the system default shared memory value, modify the system default memory value. Allocate shared memory according to the required memory size, and after successfully returning the starting address of the memory, you can save data or lock the memory. Return this memory to the system when you are done using it.

[0023] B. Establish the control handle of the buffer in the kernel driver, divide the buffer into 4 ring queues for management, there are two queues for sending and receiving messa...

Embodiment 2

[0028] The difference between this embodiment and Embodiment 1 is that the specific operation process of the operation step A is shown in Figure 2, which is:

[0029] A1. The application program uses a series of parameters to call the interface library to open the device function. The parameters include the total capacity of the message buffer required by the application and the percentage of the sending buffer.

[0030] A2. The interface library function applies for a piece of continuous memory according to the buffer parameters, but does not divide the memory into a buffer queue, does not construct a management structure, but passes the buffer address and parameters to the kernel driver.

Embodiment 3

[0032] The difference between this embodiment and Embodiment 2 is that the specific operation process of the operation step B is as shown in Figure 3, which is:

[0033] B1. The kernel driver calculates the size of the management handle according to the size of the buffer memory, and applies for a continuous space as the handle structure.

[0034]B2. The driver initializes the 4 queues in the handle according to the buffer parameters, divides the entire buffer memory into multiple 2K byte buffers, and saves the index of each buffer in the queue of the handle, so that it can be passed The handle controls the entire buffer memory in user space. Because the queue in the handle will be accessed by the application and the driver at the same time, two queues are implemented for receiving and sending, which can avoid the use of mutexes and reduce system overhead.

[0035] B3. The driver constructs the physical address table of the buffer according to the size of the buffer, and calc...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a management method for network data receiving of zero copy buffer queue, which belongs to the field of management method of data buffer queue of network data zero copy. The technical proposal of the invention includes the following operating steps: A. a contiguous-memory allocated in a user space is taken as a DMA buffer for messages; B. a control handle of buffer is established inside the kernel-mode driver; C. the control handle is mapped by an application program through an interface repository so as to realize operation of the buffer; and D. when messages are received, the physical address of a full buffer is written into a network card by the driver, a buffer filled with messages taken out from the full buffer is applied, then the buffer is positioned inside an empty buffer queue after the messages are transmitted. The invention is applicable to the flexible management of a message buffer by a zero copy driver.

Description

technical field [0001] The invention relates to a method for managing network data reception of a zero-copy buffer queue, in particular to a method for managing network data reception of a zero-copy data buffer queue through a separate handle. Background technique [0002] In the existing data transmission technology of the computer, the data structure of the data queue is often used to store the data. The elements (data) in the data queue and the control information (queue control items) of the data queue are tightly coupled together, which is convenient to increase Cohesion of software, which is very beneficial for single-process operation. In zero-copy network transmission, it is necessary for the kernel driver and the user memory application to simultaneously access the queue space composed of message buffers, which brings about whether the queue control structure is constructed in the user memory space or in the kernel space. problem, and the mutual exclusion problem w...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): H04L12/54G06F13/28H04L12/861
Inventor 历军聂华曾宇刘朝辉
Owner DAWNING INFORMATION IND BEIJING
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products