CN105320625B - A kind of DMA transfer method based on PCIe of hardware package - Google Patents

A kind of DMA transfer method based on PCIe of hardware package Download PDF

Info

Publication number
CN105320625B
CN105320625B CN201510669692.3A CN201510669692A CN105320625B CN 105320625 B CN105320625 B CN 105320625B CN 201510669692 A CN201510669692 A CN 201510669692A CN 105320625 B CN105320625 B CN 105320625B
Authority
CN
China
Prior art keywords
payload
data
max
pcie
data packet
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
CN201510669692.3A
Other languages
Chinese (zh)
Other versions
CN105320625A (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.)
Shaanxi Hitech Electronic Co Ltd
Original Assignee
Shaanxi Hitech Electronic Co Ltd
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 Shaanxi Hitech Electronic Co Ltd filed Critical Shaanxi Hitech Electronic Co Ltd
Priority to CN201510669692.3A priority Critical patent/CN105320625B/en
Publication of CN105320625A publication Critical patent/CN105320625A/en
Application granted granted Critical
Publication of CN105320625B publication Critical patent/CN105320625B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • G06F13/282Cycle stealing DMA
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention relates to a kind of data transmission methods, and in particular to a kind of DMA transfer method based on PCIe.A kind of DMA transfer method based on PCIe of hardware package, in the board equipment based on PCIe buses, using board equipment to X86 platforms transmit one side of data as sending side, using X86 platforms to board equipment transmission data as receiving side;Include the following steps:(1)Set up independent data packet control unit respectively for sending side and receiving side;(2)Obtain the maximum valid data amount Payload on PCIe linkmax;(3)Determine the maximum valid data amount Payload carried in first data packetfirstAnd in starter system physical address AddrstartStart with PayloadmaxIt is transmitted, until remaining data amount is less than PayloadmaxThen stop using PayloadmaxIt is transmitted;(4)Determine the valid data amount Payload in the last one data packetlast, and transmit remaining data;By method provided by the invention, the processing load of software is greatly reduced, so as to ensure that data transmission procedure is more smooth and efficient.

Description

A kind of DMA transfer method based on PCIe of hardware package
Technical field
The present invention relates to a kind of data transmission methods, and in particular to a kind of DMA transfer method based on PCIe.
Background technology
Currently on the market in the existing board equipment carried out data transmission based on PCIe link, with based on X86 platforms Host computer carry out data communication during, due to the framework limitation of north bridge chips in X86 platforms, from X86 platforms to board During equipment transmission data, if being initiated by X86 platforms and dominating transmission process, in each TLP data packets(I.e. in PCIe protocol The data transmission format of session layer, a TLP data packet are made of data in the packet header of at least 12 bytes and optional packet)In The valid data of most 4 bytes all can be only carried, and the packet header minimum of TLP data packets is also required to 12 bytes, due to having Effect data occupy most the 1/4 of TLP data package sizes, therefore in such a mode, under the efficiency of data transmission is very low, It is unable to give full play the high-speed transfer performance of PCIe link.
In order to solve the problems, such as this, general way is all to realize corresponding DMA transfer control function in board equipment side, i.e., The overall process of control data transmission is initiated and dominated by board equipment.
In the market in the existing board equipment carried out data transmission based on PCIe link, typically from based on PCI chains Change and transplant what is come in the pattern on road, DMA tupes are also in this way, being typically all to pass through software configuration and calculate to lead The configured transmission wanted completes transmission process by the hardware of board equipment side later.
Invention content
The present invention is directed to propose a kind of packet encapsulation mechanism by hardware controls, i.e., obtain data transmission chain by hardware The permitted maximum valid data amount of data packet of road, independent data are carried out according to specific physical memory mappings address Package operates, so as to be greatly decreased in processing procedure to the dependence of bottom layer driving software and the operation of bottom software, to realize most Excellent data transmission performance.
Technical program of the present invention lies in:
A kind of DMA transfer method based on PCIe of hardware package, in the board equipment based on PCIe buses, with board Equipment to X86 platforms transmission data one side be sending side, using X86 platforms to board equipment transmission data as receiving side;Including with Lower step:
(1)Set up independent data packet control unit respectively for sending side and receiving side;
(2)Obtain the maximum valid data amount Payload on PCIe linkmax
(3)Determine the maximum valid data amount Payload carried in first data packetfirstAnd in starter system physical address AddrstartStart with PayloadmaxIt is transmitted, until remaining data amount is less than PayloadmaxThen stop using Payloadmax It is transmitted;
(4)Determine the valid data amount Payload in the last one data packetlast, and transmit remaining data;
Wherein, the determining PayloadfirstMethod be:With AddrstartDivided by PayloadmaxRemainder is obtained, then Use PayloadmaxSubtract this remainder, difference Payloadfirst;The determining PayloadfirstWhen single data packet in The 4K physical address boundary of entrained valid data not ride through system.
The technical effects of the invention are that:
By method provided by the invention, software it will need to set three registers and then only need two registers before It can complete total data transmission process;And need according to starter system physical address and in total the data volume transmitted not Together, if to complete a data transmission, software at least needs above three parameter configuration is primary, and being needed when most will be above-mentioned Three parameter configurations 3 times.By method provided by the invention, the processing load of software is greatly reduced, so as to ensure that number It is more smooth and efficient according to transmission process.
Specific embodiment
A kind of DMA transfer method based on PCIe of hardware package, in the board equipment based on PCIe buses, with board Equipment to X86 platforms transmission data one side be sending side, using X86 platforms to board equipment transmission data as receiving side;Including with Lower step:
(1)Set up independent data packet control unit respectively for sending side and receiving side;
(2)Obtain the maximum valid data amount Payload on PCIe linkmax
(3)Determine the maximum valid data amount Payload carried in first data packetfirstAnd in starter system physical address AddrstartStart with PayloadmaxIt is transmitted, until remaining data amount is less than PayloadmaxThen stop using Payloadmax It is transmitted;
(4)Determine the valid data amount Payload in the last one data packetlast, and transmit remaining data;
Wherein, the determining PayloadfirstMethod be:With AddrstartDivided by PayloadmaxRemainder is obtained, then Use PayloadmaxSubtract this remainder, difference Payloadfirst;The determining PayloadfirstWhen single data packet in The 4K physical address boundary of entrained valid data not ride through system.
Embodiment:
AddrstartIt is 5231, PayloadmaxIt is 32, total amount of data 9753, with Addrstart5231 divided by Payloadmax32 acquirement remainders are 15, then use Payloadmax32 subtract this remainder 15, obtain PayloadfirstSize is 17, first After a data packet transfers, corresponding system physical address is also added to 5248, to be total amount of data obtained by 5231+17 9753 subtract PayloadfirstAfterwards, remaining data amount is 9736.Later since address 5248, with Payloadmax32 are used as number Carry out data transmission according to the valid data capacity of packet, since the physical address on next 4K boundaries corresponds to 8192, i.e. 4096*2, Due to 5248+(91*32)=8160, since the capacity of next data packet is still 32, and 8160+32=8192, so on this side Do not occur the situation that data in data packet pass through 4K boundaries at boundary.Similarly, this will not occurs at next data boundary 12288 Kind situation.Quotient is 304 obtained by dividing exactly 32 due to 9736, remainder 8, so with Payload since address 5248max32 make After valid data capacity for data packet carries out data transmission, after transmitting 304 data packets, system physical address increases to 14976, i.e. 5248+32*304, due to transmitting the data of 9745 bytes in total at this time, and total amount of data is 9753 numbers According to, therefore the valid data in the data packet of last time transmission are 8, and are not also gone out in the last one transmission of data packets Data pass through the situation on 4K boundaries in existing data packet.
To sum up, during hardware realization, due to all having used binary data presentation technique, in computing system object Manage address AddrstartDivided by PayloadmaxDuring, it, can be by taking due to the integer power that Payloadmax is 2 AddrstartOperation several minimum realizes for example 10 system numbers 5231 represent to be exactly 1010001101111 with 2 systems, In the case that Payloadmax is 32, since 32 corresponding 2 binary datas are 100000,52312 systems need to only be taken to represent Low 5 of data result, you can obtain 5231 divided by 32 remainder 15, then Payload has been can obtain with 32-15firstIt is 17. Remaining data amount 9736 is first obtained with total data volume 9753-17 again later, later again every time transmission start before, by its with PayloadmaxCompare, if greater than PayloadmaxThen use PayloadmaxCarry out data transmission, and remaining data amount is subtracted Payloadmax, this process is repeated until remaining data amount is less than or equal to PayloadmaxAfterwards, using remaining data amount as finally This data transmission can be completed in valid data amount in one data packet.
The board equipment designed using the method, using in PCIe Gen1, the chain road of X1, what actual test obtained When as a result to carry out one-way transmission, when board equipment is to host computer transmission data, valid data transmission rate is 230MBps;On When position machine is to board equipment transmission data, valid data transmission rate is 220MBps;Board equipment to host computer transmission data and Host computer to board equipment transmission data be carried out at the same time when, total message transmission rate of both direction is 410Mbps, transmission The transmission performance of PCIe link has obtained significantly being promoted.

Claims (1)

1. a kind of DMA transfer method based on PCIe of hardware package, in the board equipment based on PCIe buses, is set with board It is standby to X86 platforms one side of transmission data be sending side, using X86 platforms to board equipment transmission data as receiving side;Its feature exists In:Include the following steps:
(1)Set up independent data packet control unit respectively for sending side and receiving side;
(2)Obtain the maximum valid data amount Payload on PCIe linkmax
(3)Determine the maximum valid data amount Payload carried in first data packetfirstAnd in starter system physical address AddrstartStart with PayloadmaxIt is transmitted, until remaining data amount is less than PayloadmaxThen stop using Payloadmax It is transmitted;
(4)Determine the valid data amount Payload in the last one data packetlast, and transmit remaining data;
Wherein, the determining PayloadfirstMethod be:With AddrstartDivided by PayloadmaxRemainder is obtained, then is used PayloadmaxSubtract this remainder, difference Payloadfirst;The determining PayloadfirstWhen single data packet in institute Carry the 4K physical address boundary of valid data not ride through system.
CN201510669692.3A 2015-10-16 2015-10-16 A kind of DMA transfer method based on PCIe of hardware package Active CN105320625B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510669692.3A CN105320625B (en) 2015-10-16 2015-10-16 A kind of DMA transfer method based on PCIe of hardware package

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510669692.3A CN105320625B (en) 2015-10-16 2015-10-16 A kind of DMA transfer method based on PCIe of hardware package

Publications (2)

Publication Number Publication Date
CN105320625A CN105320625A (en) 2016-02-10
CN105320625B true CN105320625B (en) 2018-06-26

Family

ID=55248033

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510669692.3A Active CN105320625B (en) 2015-10-16 2015-10-16 A kind of DMA transfer method based on PCIe of hardware package

Country Status (1)

Country Link
CN (1) CN105320625B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110688333A (en) * 2019-09-29 2020-01-14 郑州信大捷安信息技术股份有限公司 PCIE (peripheral component interface express) -based DMA (direct memory Access) data transmission system and method
TWI771852B (en) * 2020-12-29 2022-07-21 新唐科技股份有限公司 Direct memory access device, data transmission method and electronic device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101290604A (en) * 2007-04-20 2008-10-22 索尼株式会社 Information processing apparatus and method, and program
CN102609383A (en) * 2010-12-22 2012-07-25 索尼公司 Information processing device, information processing system, information processing method, and program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101290604A (en) * 2007-04-20 2008-10-22 索尼株式会社 Information processing apparatus and method, and program
CN102609383A (en) * 2010-12-22 2012-07-25 索尼公司 Information processing device, information processing system, information processing method, and program

Also Published As

Publication number Publication date
CN105320625A (en) 2016-02-10

Similar Documents

Publication Publication Date Title
WO2016187813A1 (en) Data transmission method and device for photoelectric hybrid network
US9830289B2 (en) Methods and apparatus for aggregating packet transfer over a virtual bus interface
US8782321B2 (en) PCI express tunneling over a multi-protocol I/O interconnect
KR101727874B1 (en) Method, apparatus and system for qos within high performance fabrics
JP5917474B2 (en) System and routing method using integrated multi-transfer media connector
KR101238622B1 (en) Unified connector architecture
TWI533140B (en) Method operable in a serial attached small computer system interface architecture and related data system
US20160342547A1 (en) Host bus access by add-on devices via a network interface controller
US9256564B2 (en) Techniques for improving throughput and performance of a distributed interconnect peripheral bus
CN103077148B (en) A kind of host communication method of Based PC IE and main frame
CN104641360A (en) Dual casting PCIe inbound writes to memory and peer devices
KR20210033996A (en) Integrated address space for multiple hardware accelerators using dedicated low-latency links
US10459860B2 (en) EMI mitigation on high-speed lanes using false stall
CN104378161A (en) FCoE protocol acceleration engine IP core based on AXI4 bus formwork
CN105320625B (en) A kind of DMA transfer method based on PCIe of hardware package
CN105765545A (en) Sharing method and device for PCIe I/O device and interconnection system
US20080235484A1 (en) Method and System for Host Memory Alignment
WO2012009556A2 (en) System and method for increased efficiency pci express transactions
KR20110110199A (en) Communication protocol for sharing memory resources between components of a device
US20160350250A1 (en) Input output data alignment
CN113347017B (en) Network communication method and device, network node equipment and hybrid network
WO2014194752A1 (en) Method, apparatus and electronic device for data mapping
TWI748839B (en) Data transmission method and apparatus having data reuse mechanism
CN103838691B (en) Realize the method and common interface chip of high speed data transfer
US20170052925A1 (en) Packet Data Processing Method, Apparatus, and System

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