CN104239248B - PCI E multiple buffer DMA data transfer methods - Google Patents

PCI E multiple buffer DMA data transfer methods Download PDF

Info

Publication number
CN104239248B
CN104239248B CN201410472222.3A CN201410472222A CN104239248B CN 104239248 B CN104239248 B CN 104239248B CN 201410472222 A CN201410472222 A CN 201410472222A CN 104239248 B CN104239248 B CN 104239248B
Authority
CN
China
Prior art keywords
data
memory
purpose system
source systems
buffer circle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410472222.3A
Other languages
Chinese (zh)
Other versions
CN104239248A (en
Inventor
云晓春
周游
包秀国
谢铭
周康成
童晓民
唐剑琪
周渊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIJING SCISTOR TECHNOLOGY Co Ltd
National Computer Network and Information Security Management Center
Original Assignee
BEIJING SCISTOR TECHNOLOGY Co Ltd
National Computer Network and Information Security Management Center
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BEIJING SCISTOR TECHNOLOGY Co Ltd, National Computer Network and Information Security Management Center filed Critical BEIJING SCISTOR TECHNOLOGY Co Ltd
Priority to CN201410472222.3A priority Critical patent/CN104239248B/en
Publication of CN104239248A publication Critical patent/CN104239248A/en
Application granted granted Critical
Publication of CN104239248B publication Critical patent/CN104239248B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Bus Control (AREA)

Abstract

The invention provides a kind of PCI E multiple buffers DMA data transfer method, it is related to PCI E technical field of data transmission.This method each distributes N block physical memories in data source systems and data purpose system, sets up available memory pool and working memory pond by doubly linked list to the N blocks physical memory in two systems respectively;The internal memory for writing data is obtained from available memory pool, the internal memory for writing data adds working memory pond;The physical start address and size of the internal memory to be operated are write in buffer circle.The present invention reduces memory copying number of times and system call number by available memory pool and using for working memory pond;Increase the message transmission rate of DMA by buffer circle.The present invention reduces the wait expense of system under the transmission of big data quantity, improves efficiency of transmission.

Description

PCI-E multiple buffer DMA data transfer methods
Technical field
The present invention relates to PCI-E technical field of data transmission, the DMA data transfer method of specifically a kind of multiple buffer.
Background technology
Traditional PCI-E data transmission methods are using DMA (Direct Memory Access, direct memory access). Specific method is to be both needed to distribute one piece of continuous physical memory in data source and data purpose system, in data source system before starting User application is responsible for, in data copy to physical memory, being responsible for data from number by dma controller during DMA transfer in system Transmitted into the physical memory of data purpose system according to source physical memory, DMA terminate after in data purpose system by application journey Sequence is copied to user's space and uses, and then former 2 pieces of physical memories (physical memory of data source systems and data purpose system) can It is used as data transfer next time.Fig. 1 is traditional data transmission method schematic diagram:
(1) data source systems:User application is in physical memory in data copy to kernel spacing;
(2) DMA transfer;
(3) data purpose system:Data, the physical memory from kernel spacing is copied to user's space to user application Use.
In data transmission procedure in the system of data source and data purpose, only one of which is for data transfer for the method Buffering area, DMA next time cannot be again carried out before a DMA is completed, and reduce efficiency of transmission.
The content of the invention
Data transmission efficiency the invention aims to improve PCI-E, mitigates CPU pressure, proposes that a kind of PCI-E is more Buffering area DMA data transfer method.
The PCI-E multiple buffer DMA data transfer methods that the present invention is provided, comprise the following steps:
Step one, the respective distribution N block physical memories in data source systems and data purpose system, respectively to two systems In N blocks physical memory available memory pool and working memory pond are set up by doubly linked list;Meanwhile, all set up in two systems More than one buffer circle and its corresponding read-write pointer;
Step 2, the user application in data source systems are obtained using API from the available memory pool of data source systems Obtain internal memory and insert data, the internal memory that will insert data is added in the working memory pond of data source systems, will insert data The physical start address and size of internal memory write the buffer circle of data source systems;
Step 3, the user application in data source systems initiate data transfer request using API;Data purpose system Kernel in system chooses free memory from the available memory pool of data purpose system, and by the physical start address of selected internal memory and Size is inserted in the buffer circle of data purpose system, is updated the data the write pointer of the buffer circle of purpose system and is notified Data source systems;
After the notice that the buffer circle that kernel in step 4, data source systems receives data purpose system updates, take Obtaining data purpose system will write the internal memory physical start address and size of data, initiate DMA and complete data transfer;
After the completion of step 5, data transfer, data source systems update the data the buffer circle read pointer of origin system and lead to Primary data purpose system;
The working memory pond that the internal memory of write-in data is put into data purpose system is supplied user by step 6, data purpose system Application program is used.
Multiple buffer DMA data transfer method of the invention, deletes unnecessary memory copying, dramatically reduces The pressure of CPU;The wait expense of system is reduced under the transmission of big data quantity, efficiency of transmission is improve.
Brief description of the drawings
Fig. 1 is traditional data transmission method schematic diagram;
Fig. 2 is PCI-E multiple buffers data transmission method schematic diagram of the invention;
Specific embodiment
Below in conjunction with drawings and Examples, the present invention is described in further detail.
Data transmission efficiency the invention aims to improve PCI-E, mitigates CPU pressure, proposes a kind of zero-copy Data transmission method.
As shown in Fig. 2 the PCI-E multiple buffer DMA data transfer methods that the present invention is provided specifically include following steps:
Step one, the appropriately sized physical memory of respective distribution N blocks in data source systems and data purpose system, respectively Available memory pool and working memory pond are set up to the N block physical memories in two systems.All set up single in two systems simultaneously The read-write pointer of individual or multiple buffer circles and buffer circle.
The size of N as needed or practice, be set by the user.Available memory pool and working memory pond use doubly linked list To represent.Data source systems and data purpose system are respectively to that should have an available memory pool and a working memory pond.From sky Not busy memory pool obtains the internal memory for writing data, and the internal memory for writing data adds working memory pond.Write in buffer circle Enter the physical start address and size of the internal memory to be operated.
As shown in Fig. 2 the buffer circle set up in data source systems and data purpose system, including at least two slow Rush area.
Step 2, the user application in data source systems, use API (Application Programming Interface, application programming interface) insert data from after the available memory pool acquirement memory headroom of data source systems.Fill out The internal memory for entering data is added to the working memory pond of data source systems.Meanwhile, the physical start address of the internal memory of data will be inserted And size writes the buffer circle of data source systems.
Step 3, the user application in data source systems initiate data transfer request using API.Data purpose system After the physical memory block that kernel in system selects the free time from the available memory pool of data purpose system, in the ring of data purpose system Physical start address and the size notice of selected internal memory are inserted in shape buffering area, and the buffer circle of data purpose system Write pointer updates and notifies data source systems.
After the notice that the buffer circle that kernel in step 4, data source systems receives data purpose system updates, take To write in data purpose system data internal memory physical start address and size, initiate DMA and complete data transfer.
Kernel in data source systems is according to the physical start address of internal memory in the buffer circle of data source systems and big It is small, data are read from corresponding physical memory, and be transferred to data purpose system.The data that data purpose system will be received The physical start address of internal memory in buffer circle according to data purpose system, corresponding physics in write-in data purpose system In internal memory.
After the completion of step 5, data transfer, data source systems update buffer circle read pointer and notify data purpose system System.
The memory block for having obtained data is put into work pool and is used for user program by step 6, purpose system.
In the inventive method, realize the data directly by user application in data source systems and be transferred to data mesh System in used, reduce data copy number of times and system call number, meanwhile, be increased using buffer circle The speed and size of DMA transfer data.PCI-E data transfers are made using the inventive method, with the existing biography in background technology The contrast effect of system data transmission scheme is as shown in table 1.Test uses+1 piece of PCI-E accelerator card of 1 DELL2950 server, first The data transfer of PC to accelerator card is carried out in units of 2K/8K/16K afterwards, respectively carry out it is average after 5 tests obtained by transfer rate.
The contrast table of the Zero-copy data transmission plan of the present invention of table 1 and traditional scheme
As shown in table 1, compared with scheme is spread out of, there is transmission rate higher using the inventive method, is more applicable for The transmission of big data quantity, can effectively reduce the wait expense of system.

Claims (1)

1. a kind of PCI-E multiple buffers DMA data transfer method, it is characterised in that comprise the following steps:
Step one, the respective distribution N block physical memories in data source systems and data purpose system, respectively in two systems N blocks physical memory sets up available memory pool and working memory pond by doubly linked list;Meanwhile, all set up multiple in two systems Buffer circle and its corresponding read-write pointer, write the physical start address of the internal memory to be operated in buffer circle And size;For PCI-E interface transmits data between described data source systems and data purpose system;
Step 2, the user application in data source systems obtain interior using API from the available memory pool of data source systems Data are deposited and insert, the internal memory that will insert data is added in the working memory pond of data source systems, will insert the internal memory of data Physical start address and size write data source systems buffer circle;
Step 3, the user application in data source systems initiate data transfer request using API;In data purpose system Kernel choose free memory from the available memory pool of data purpose system, and by the physical start address and size of selected internal memory Insert in the buffer circle of data purpose system, update the data the write pointer of the buffer circle of purpose system and notify data Origin system;
After the notice that the buffer circle that kernel in step 4, data source systems receives data purpose system updates, number is obtained The internal memory physical start address and size of data are write according to purpose system, DMA is initiated and is completed data transfer;
After the completion of step 5, data transfer, data source systems update the data the buffer circle read pointer of origin system and notify number According to purpose system;
Step 6, data purpose system are applied the working memory pond that the internal memory of write-in data is put into data purpose system for user Program is used.
CN201410472222.3A 2014-09-16 2014-09-16 PCI E multiple buffer DMA data transfer methods Active CN104239248B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410472222.3A CN104239248B (en) 2014-09-16 2014-09-16 PCI E multiple buffer DMA data transfer methods

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410472222.3A CN104239248B (en) 2014-09-16 2014-09-16 PCI E multiple buffer DMA data transfer methods

Publications (2)

Publication Number Publication Date
CN104239248A CN104239248A (en) 2014-12-24
CN104239248B true CN104239248B (en) 2017-06-06

Family

ID=52227355

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410472222.3A Active CN104239248B (en) 2014-09-16 2014-09-16 PCI E multiple buffer DMA data transfer methods

Country Status (1)

Country Link
CN (1) CN104239248B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101438B (en) * 2018-07-25 2020-07-28 百度在线网络技术(北京)有限公司 Method and apparatus for storing data
CN110046114B (en) * 2019-03-06 2020-08-14 上海熠知电子科技有限公司 DMA controller based on PCIE protocol and DMA data transmission method
CN112286688B (en) * 2020-11-05 2024-01-05 北京深维科技有限公司 Memory management and use method, device, equipment and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102467473A (en) * 2010-11-03 2012-05-23 Tcl集团股份有限公司 Method and device for transmitting data between user space and kernel
CN103645994A (en) * 2013-11-05 2014-03-19 华为技术有限公司 Data processing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7673105B2 (en) * 2005-06-27 2010-03-02 Ab Inition Technology LLC Managing memory pages

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102467473A (en) * 2010-11-03 2012-05-23 Tcl集团股份有限公司 Method and device for transmitting data between user space and kernel
CN103645994A (en) * 2013-11-05 2014-03-19 华为技术有限公司 Data processing method and device

Also Published As

Publication number Publication date
CN104239248A (en) 2014-12-24

Similar Documents

Publication Publication Date Title
US9760486B2 (en) Accelerating cache state transfer on a directory-based multicore architecture
US9934160B1 (en) Bit-mapped DMA and IOC transfer with dependency table comprising plurality of index fields in the cache for DMA transfer
CN104239249B (en) PCI E zero-copy DMA data transfer methods
JP6009692B2 (en) Multi-mode memory access technique for graphics processing unit based memory transfer operations
CN109564545B (en) Method and apparatus for compressing addresses
CN102467473B (en) Method and device for transmitting data between user space and kernel
US10055150B1 (en) Writing volatile scattered memory metadata to flash device
CN104239248B (en) PCI E multiple buffer DMA data transfer methods
DE102011101202A1 (en) Non-volatile storage for graphics hardware
CN106339061A (en) Mobile terminal and method of run application thereof
US9881680B2 (en) Multi-host power controller (MHPC) of a flash-memory-based storage device
US20220159286A1 (en) Low-latency consumption of an encoded video bitstream
CN102314400B (en) Method and device for dispersing converged DMA (Direct Memory Access)
CN106775477B (en) SSD (solid State disk) master control data transmission management device and method
WO2018119738A1 (en) Speculative read mechanism for distributed storage system
CN105450986B (en) Video processing method under Linux
CN102291298A (en) Efficient computer network communication method oriented to long message
TW201640487A (en) Display controller for reducing display noise and system including the same
US9904622B2 (en) Control method for non-volatile memory and associated computer system
TW201351276A (en) Scheduling and execution of compute tasks
CN105843631B (en) A method of improving system firmware burn writing speed
CN107179929B (en) WRITE _ SAME function optimization implementation method and device
US9652560B1 (en) Non-blocking memory management unit
WO2019114044A1 (en) Image processing method and device, electronic apparatus, and computer readable storage medium
CN106155626A (en) One Android Sparse form image download method fast and effectively

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant