JP7145607B2 - DMA TRANSFER DEVICE, DMA TRANSFER CONTROL METHOD, AND COMMUNICATION DEVICE - Google Patents
DMA TRANSFER DEVICE, DMA TRANSFER CONTROL METHOD, AND COMMUNICATION DEVICE Download PDFInfo
- Publication number
- JP7145607B2 JP7145607B2 JP2017238920A JP2017238920A JP7145607B2 JP 7145607 B2 JP7145607 B2 JP 7145607B2 JP 2017238920 A JP2017238920 A JP 2017238920A JP 2017238920 A JP2017238920 A JP 2017238920A JP 7145607 B2 JP7145607 B2 JP 7145607B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- transfer
- checksum
- dma
- dma transfer
- 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
Links
Images
Landscapes
- Bus Control (AREA)
Description
本発明は、チェックサム演算を行うことが可能なDMA転送装置に関する。 The present invention relates to a DMA transfer device capable of performing checksum calculation.
インターネットやイントラネット上でデータ通信を行う際に最も多く利用されている通信プロトコルとして、TCP/IPやUDP/IPがある。TCP/IPは、通信パケットの順序保証とパケット紛失時の再送制御を規定する通信プロトコルである。一方、UDP/IPは、通信パケットの順序保証や紛失に対するリカバリ処理を規定しない通信プロトコルである。なお、TCP/IPは、Transmission Control Protocol/Internet Protocolを示す。また、UDP/IPは、User Datagram Protocol/Internet Protocolを示す。 TCP/IP and UDP/IP are the most widely used communication protocols for data communication on the Internet and intranets. TCP/IP is a communication protocol that defines order assurance of communication packets and retransmission control when packets are lost. On the other hand, UDP/IP is a communication protocol that does not prescribe the order guarantee of communication packets or recovery processing for loss. Note that TCP/IP indicates Transmission Control Protocol/Internet Protocol. Also, UDP/IP indicates User Datagram Protocol/Internet Protocol.
これらの通信プロトコルでは、通信パケットの整合性を検査するために、チェックサムが利用される。チェックサムとは、単純には、送信側で演算されるデータ列の総和である。送信側は、チェックサムを送信データに添付して送信し、受信側は、受信データ列の総和を演算して、当該総和が添付されたチェックサムと不一致の場合に、エラーと判定する。 These communication protocols utilize checksums to verify the integrity of communication packets. A checksum is simply the sum of data strings calculated on the transmission side. The transmitting side attaches the checksum to the transmission data and transmits it, and the receiving side calculates the sum of the received data string, and determines an error if the sum does not match the attached checksum.
上記各通信プロトコルでは、チェックサムとして、IPヘッダとTCP/UDPヘッダの特定フィールドと、ペイロードとを利用して演算されるインターネットチェックサムが利用されている。PC(Personal Computer)や組込み機器におけるインターネットチェックサム演算は、CPU(Central Processing Unit)によるソフトウェア処理や、NIC(Network Interface Card)やチップ内通信部のハードウェアにより実現化される。 In each of the above communication protocols, an Internet checksum is used as a checksum, which is calculated using specific fields of the IP header and TCP/UDP header, and the payload. Internet checksum calculations in PCs (Personal Computers) and embedded devices are realized by software processing by CPUs (Central Processing Units) and hardware such as NICs (Network Interface Cards) and in-chip communication units.
チェックサム演算は処理負荷が大きいため、CPUの処理能力が低い組込み機器により演算される場合は、通信速度が低下してしまう可能性がある。そのため、以前より、通信処理専用のNPU(Network Processing Unit)やハードウェア演算器がチェックサムを演算することが提案されている。これにより、CPUの処理負荷の低減と演算処理の高速化が図られる。また、PCにおいても、CPUへの負荷低減を目的に、NIC等のハードウェアによりチェックサムが演算されてきた。例えば、特許文献1には、ネットワークパケットを記憶装置からネットワークアダプタ中のパケットバッファへ転送する際にチェックサムを計算することで、システムにおけるプロセッサへの負荷低減を実現する方法が提案されている。 Since the checksum calculation has a large processing load, there is a possibility that the communication speed will decrease if the checksum calculation is performed by an embedded device with a low CPU processing capability. Therefore, it has been proposed that an NPU (Network Processing Unit) dedicated to communication processing or a hardware computing unit computes the checksum. This reduces the processing load on the CPU and speeds up the arithmetic processing. Also, in a PC, a checksum has been calculated by hardware such as a NIC for the purpose of reducing the load on the CPU. For example, Patent Document 1 proposes a method of reducing the load on a processor in a system by calculating a checksum when transferring a network packet from a storage device to a packet buffer in a network adapter.
また、チェックサム演算器とDMA(Direct Memory Access)転送装置を組み合わせ、DMAデータ転送中にチェックサムを演算することで、機器内部のシステム全体を通じて通信処理を高速化させる技術が提案されている。例えば、特許文献2には、アプリケーション層からのデータグラムを格納するバッファと通信部のバッファとの間でDMA転送を行う際に、2つのチェックサムを計算する方法が提案されている。ここで、2つのチェックサムは、IPのヘッダ・チェックサム、および、UDPまたはTCPのチェックサムである。 A technique has also been proposed that combines a checksum calculator and a DMA (Direct Memory Access) transfer device to calculate a checksum during DMA data transfer, thereby speeding up communication processing throughout the entire system inside the device. For example, Patent Literature 2 proposes a method of calculating two checksums when performing DMA transfer between a buffer storing datagrams from the application layer and a buffer of a communication unit. Here the two checksums are the IP header checksum and the UDP or TCP checksum.
アプリケーション層からのデータグラム(ペイロード)をDMA転送中に、当該ペイロードの総和(ペイローサム)を演算することにより、当該ペイロードサムを利用したインターネットチェックサムを演算できることから、通信速度の高速化が図れる。しかしながら、DMA転送中にペイロード長が変更される場合には、インターネットチェックサムを演算する際に当該ペイロードサムを利用することができず、通信速度が低下するという課題がある。 During DMA transfer of datagrams (payload) from the application layer, by calculating the sum of the payloads (payload sum), it is possible to calculate the Internet checksum using the payload sum, so that the communication speed can be increased. However, if the payload length is changed during DMA transfer, the payload sum cannot be used when computing the Internet checksum, resulting in a decrease in communication speed.
本発明は上記課題に鑑みてなされたものであり、DMAデータ転送中にチェックサムを演算する場合に通信速度が低下することを防ぐことを目的とする。 SUMMARY OF THE INVENTION The present invention has been made in view of the above problems, and it is an object of the present invention to prevent a decrease in communication speed when a checksum is calculated during DMA data transfer.
上記目的を達成するため、本発明の一態様によるDMA転送装置は、以下の構成を有する。すなわち、プロトコルスタックを実行可能な少なくとも1つのプロセッサと、アプリケーションからの第1のデータと第2のデータを連結するための連結処理を行うことが可能な制御ハードウェアとを有する通信装置に備えられるDMA(Direct Memory Access)転送装置であって、
前記プロトコルスタックを実行中の前記プロセッサから転送命令を受信した場合に、前記第1のデータと前記第2のデータのそれぞれに対して第1のチェックサムの演算を行う第1の演算手段と、
前記制御ハードウェアから転送命令を受信した場合に、前記連結処理が行われる前記第1のデータおよび前記第2のデータと通信ヘッダとに対して前記第1のチェックサムの演算と異なる第2のチェックサムの演算を行う第2の演算手段と、
前記第1の演算手段または前記第2の演算手段による演算を介して得られたチェックサムデータを転送先アドレスに応じたメモリの領域に転送する転送手段と、
を有し、
前記第2の演算手段による演算は、前記プロセッサが前記第1のデータと前記第2のデータの連結が必要であると判断した場合に、前記連結処理が行われる前記第1のデータと前記第2のデータを転送するための転送命令を前記制御ハードウェアが前記DMA転送装置へ送信することに応じて行われることを特徴とする。
In order to achieve the above object, a DMA transfer device according to one aspect of the present invention has the following configuration. That is, provided in a communication device having at least one processor capable of executing a protocol stack and control hardware capable of performing concatenation processing for concatenating first data and second data from an application. A DMA (Direct Memory Access) transfer device,
first computing means for computing a first checksum for each of the first data and the second data when a transfer instruction is received from the processor executing the protocol stack ;
when a transfer command is received from the control hardware, a second checksum operation different from the first checksum calculation is performed on the first data and the second data on which the concatenation processing is performed, and a communication header; a second computing means for computing a checksum of 2;
transfer means for transferring checksum data obtained through calculation by the first calculation means or the second calculation means to a memory area corresponding to a transfer destination address;
has
When the processor determines that the first data and the second data need to be linked, the calculation by the second calculation means is performed by combining the first data and the It is characterized in that the control hardware transmits a transfer command for transferring the second data to the DMA transfer device.
DMAデータ転送中にチェックサムを演算する場合に通信速度が低下することを防ぐことが可能となる。 It is possible to prevent a decrease in communication speed when calculating a checksum during DMA data transfer.
以下、添付の図面を参照して、本発明をその実施形態の一例に基づいて詳細に説明する。なお、以下の実施形態において示す構成は一例に過ぎず、本発明は図示された構成に限定されるものではない。 BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, the present invention will be described in detail based on an example of its embodiment with reference to the accompanying drawings. Note that the configurations shown in the following embodiments are merely examples, and the present invention is not limited to the illustrated configurations.
[第1の実施形態]
(通信装置100の構成)
図1に、以下に説明する実施形態における通信装置100の概略構成図を示す。CPU101は、通信装置100に含まれる各機能ブロック、各ソフトウェア、各ハードウェアを制御する。本実施形態では、CPU101は、アプリケーションとプロトコルスタックの2つのソフトウェアを制御する。アプリケーションは、通信装置100としてカメラやカムコーダを想定する場合に、撮像した画像や動画像のデータをインターネットやメディアサーバにアップロードする際に動作するソフトウェアである。プロトコルスタックは、TCP(UDP)/IP等の通信プロトコル処理を行うソフトウェアである。具体的には、プロトコルスタックは、TCP(UDP)/IP通信における再送制御やパケットの順序保証、チェックサムを使用した通信パケットの整合性検査を行う。また、プロトコルスタックは、これらの機能を実現するための通信ヘッダであるTCP(UDP)ヘッダ、IPヘッダを生成する。
[First embodiment]
(Configuration of communication device 100)
FIG. 1 shows a schematic configuration diagram of a
メモリ106は、アプリケーションが利用するメモリ領域である。メモリ106には、例えば、アプリケーションから出力される動画像等のデータが格納される。一方、メモリ107はプロトコルスタックが利用するメモリ領域である。メモリ107は、例えば、プロトコルスタックが動画像データからパケットを生成するための一時的なデータコピー領域や、通信ヘッダを生成する領域として使用される。なお、図1ではメモリ106とメモリ107は別々に構成されているが、これらのメモリは同一のメモリで構成され、メモリアドレスで各ソフトウェアの利用領域が管理されても良い。
The
アプリケーションが利用もしくは出力するデータは、システムバス102を介してメモリ106へ入出力される。また、各記憶領域(メモリ106、メモリ107、シーケンサ103内の内部メモリ105、通信部108内の送信バッファ109)間のデータのやり取り(データの転送/コピー)は、システムバス102を介して、CPU101、または、DMA転送部110内のDMAコントローラ111により実行される。また、通信装置100内の各ハードウェアブロック間のデータのやり取りは、システムバス102を介して行われるものとする。
Data used or output by an application is input/output to/from
DMA転送部110は、第1のチェックサム演算部112と、第2のチェックサム演算部113と、DMAコントローラ111から構成される。第1のチェックサム演算部112は、データグラムの総和(以下、ペイロードサム)を演算する。また、第2のチェックサム演算部113は、インターネットチェックサムを演算する。ペイロードサムの計算に伴う計算量は、インターネットチェックサムの計算に伴う計算量より少ない。具体的には、ペイロードサムとは、入力されたデータグラムの16ビットワードごとの1の補数和である。インターネットチェックサムとは、IETF(Internet Engineering Task Force)で規定されるRFC (Request for Comments)791、RFC793、RFC2460およびRFC1071における16ビットワードごとの1の補数和の1の補数である。より詳細には、本実施形態におけるインターネットチェックサムは、疑似ヘッダとTCPヘッダとペイロード(すべてのヘッダとテキスト)の合計(16のビットワードの1の補数合計)の反転(16ビットの1の補数)である。ここで、疑似ヘッダは、SRC(送信元)アドレス、DST(宛先)アドレス、プロトコルNo.(番号)、TCP長から構成され得る。
The
DMA転送部110は、このような構成を有することにより、DMA転送中にペイロードサムとインターネットチェックサムを演算することが可能となる。また、DMA転送部110は、チェックサム演算を行わずに、単純にDMA転送器としても動作することも可能である。
With such a configuration, the
DMA転送部110は、CPU101またはシーケンサ103から設定されるレジスタの値等に基づいて、第1のチェックサム演算部112または第2のチェックサム演算部113のいずれかを選択する。また、DMA転送部110は、当該レジスタの値により指定されるメモリ領域からデスクリプタを読み出し、当該デスクリプタに基づいてDMA転送またはチェックサム演算を伴うDMA転送を行う。なお、以下の説明において、DMA転送を行うためのレジスタ設定を転送命令といい、チェックサム演算を伴うDMA転送を演算転送命令という。DMA転送部110に設定されるレジスタの値には、メモリの領域が指定される。DMA転送部110は、当該指定されたメモリの領域に格納されるデスクリプタにしたがって動作する。デスクリプタとは、DMA転送部110においてDMA転送を行う際に必要な情報であり、少なくとも転送元アドレス、転送先アドレス、データ長が含まれる。すなわち、DMA転送部は、受信した演算転送命令または転送命令に基づいて、転送元アドレスと転送先アドレスを含む情報を取得する。
The
シーケンサ103は、後述するように、演算転送命令の代行の依頼と共に所定の指示を受けたことに応じて、データ連結またはデータ分割を行うことが可能な制御ハードウェアである。例えば、シーケンサ103は、演算転送命令の代行の依頼と共に、データ分割を行う指示を受けた場合、データグラムをMSS(Maximum Segment Size)に分割する。なお、MSSとは、アプリケーションが出力するデータグラムを通信パケット化する際に通信プロトコル上で伝送可能であるサイズに分割する際の最大データサイズである。続いて、シーケンサ103内のヘッダ生成ロジック104が、分割/連結データの各々に対する通信ヘッダを生成する。シーケンサ103は、分割/連結データの各々に対する通信ヘッダを生成後、各分割/連結データと生成した通信ヘッダを送信バッファ109にDMA転送して通信パケット化するためのデスクリプタを生成する。生成したデスクリプタは、メモリ106に格納される。シーケンサ103は、デスクリプタをメモリ106に格納後、転送命令をDMA転送部110に対して発行する。
As will be described later, the
通信部108は、外部機器と通信を行う。具体的には、通信部108は、通信に必要なMAC(Media Access Contorol)層およびPHY層の処理を行う。
A
(第1のチェックサム演算部112使用時のDMA転送動作)
図2に、本実施形態における第1のチェックサム演算部112使用時のDMA転送例を示す。以下、DMA転送部110が、アプリケーションがメモリ106に出力したデータグラムをプロトコルスタックが使用するメモリ107へDMA転送する際に、第1のチェックサム演算部112を利用してペイロードサムを計算することを含む動作について説明する。
(DMA transfer operation when using the first checksum calculator 112)
FIG. 2 shows an example of DMA transfer when using the
CPU101では、アプリケーションがメモリ106にデータグラム201を出力した後、プロトコルスタックへタスクが切り替わる。プロトコルスタックは、メモリ106に格納されたデータグラム201をDMA転送するためにデスクリプタ202を生成する。データグラムがMSSよりも小さい場合は、プロトコルスタックは、デスクリプタ202として、転送長がデータグラム201と同じサイズのデスクリプタと、ペイロードサム用に転送長が2バイトのデスクリプタを生成する。プロトコルスタックは、生成したデスクリプタ202をメモリ106に格納する。
In the
一方、データグラム201がMSSよりも大きい場合は、MSS毎にペイロードサムを計算する必要があるため、プロトコルスタックはMSS毎にデータグラムを分割する。続いて、プロトコルスタックは、デスクリプタ202として、転送長がMSSである複数のデスクリプタと、転送長がMSSで分割した余りのデータサイズであるデスクリプタ、各分割データのペイロードサム用のデスクリプタを生成する。プロトコルスタックは、生成したデスクリプタ202をメモリ106に格納する。
On the other hand, if the
なお、プロトコルスタックは、読み込み用のデスクリプタ202と書き込み用のデスクリプタ202を別々に生成してもよい。例えば、プロトコルスタックは、読み込み用のデスクリプタ202として、上記分割データ用のデスクリプタを生成してもよい。また、プロトコルスタックは、書き込み用のデスクリプタ202として、上記分割用のデスクリプタとペイロードサム用のデスクリプタを生成してもよい。ここで、プロトコルスタックは、書き込み用のデスクリプタ202として、分割データ用のデスクリプタとペイロードサム用のデスクリプタの転送長を加算して、1つのデスクリプタとしてまとめてもよい。
Note that the protocol stack may generate the
プロトコルスタックは、デスクリプタ202の生成後、演算転送命令をDMA転送部110に対して発行する。すなわち、プロトコルスタックは、第1のチェックサム演算部112を使用すること、および、デスクリプタを格納するメモリ領域、を示した値を、DMA転送部110のレジスタに設定する。DMA転送部110は、レジスタに設定された値に応じて、第1のチェックサム演算部112を使用することを決定する。なお、レジスタに設定された値を判定する以外の手法で、DMA転送部110が第1のチェックサム演算部112を使用することを決定してもよい。例えば、DMA転送部110は、システムバス102におけるトランザクションIDやレジスタアクセス元のアドレス等により、プロトコルスタックからの演算転送命令であることを検出して、第1のチェックサム演算部112を使用することを決定してもよい。また、DMA転送部110は、デスクリプタ202の転送元アドレスと転送先アドレスの組み合わせから、第1のチェックサム演算部112を使用することを判断してもよい。
After generating the
CPU101(プロトコルスタック)から演算転送命令を受けたDMA転送部110において、内部のDMAコントローラ111は、レジスタに設定された値から、メモリ106に格納されているデスクリプタ202を読み込む。続いて、DMAコントローラ111は、デスクリプタ202に記載される転送長の分割データ203を、メモリ106からを読み出す。第1のチェックサム演算部112は、読み出された分割データのペイロードサム204を計算する。ペイロードサム204は、分割データ203の後ろに付加され、DMA転送部110は、デスクリプタ202に従って、これをメモリ107に書き込む。
In the
次に、プロトコルスタックは、メモリ107に格納されるペイロードサム204からインターネットチェックサムを計算する。その後、プロトコルスタックは、各分割データ203に対応するインターネットチェックサムを含む通信ヘッダ205を生成し、メモリ107に格納する。さらに、プロトコルスタックは、メモリ107から送信バッファ109へ、分割データ203と通信ヘッダ205をDMA転送するためのデスクリプタを生成する。デスクリプタを生成後、プロトコルスタックは、転送命令をDMA転送部110に対して発行する。これに応じて、DMA転送部110は、分割データ203と通信ヘッダ205を通信部108の送信バッファ109に転送する。
The protocol stack then calculates the internet checksum from the
通信部108は、送信バッファ109に書き込まれた分割データ203と通信ヘッダ205からなる通信パケット121を、外部機器へ送信する。
The
(第2のチェックサム演算部113使用時のDMA転送動作)
図3に、本実施形態における第2のチェックサム演算部113使用時のDMA転送例を示す。ここでは、アプリケーションからのデータグラムが、メモリ106からメモリ107へペイロードサム演算を伴ってDMA転送された後、プロトコルスタック(CPU101)がペイロード長を変更すると判断する場合を想定する。この場合、当該ペイロードサムを用いてインターネットチェックサムを計算することができなくなる。ペイロード長が変更される場合とは、例えば、データグラムを連結する場合や、MSSが変更される場合である。このような場合に、DMA転送部110が第2のチェックサム演算部113を利用してインターネットチェックサムを演算する動作について説明する。
(DMA transfer operation when using the second checksum calculator 113)
FIG. 3 shows an example of DMA transfer when using the
まず、アプリケーションからのデータグラムが、メモリ106からメモリ107へDMA転送された後、プロトコルスタックは、ペイロード長を変更すると判断した場合に、演算転送命令の代行をシーケンサ103に通知する。プロトコルスタックは、演算転送命令の代行の依頼と共に、データ分割/連結に関する指示を、シーケンサ103に対して通知する。例えば、プロトコルスタックは、アプリケーションからのデータグラムがMSSよりも小さい場合に、次データと連結可能か否かを判断する。連結可能と判断した場合は、プロトコルスタックは、シーケンサ103に対して、データ連結の指示を、演算転送命令の代行の依頼と共に通知する。また、アプリケーションからデータグラムを転送した時点からMSSが変更になった場合に、プロトコルスタックは、シーケンサ103に対して、新たなMSSでのデータ分割を行うための指示を、演算転送命令の代行の依頼と共に通知する。
First, after the datagram from the application is DMA-transferred from the
シーケンサ103は、プロトコルスタックからの通知に応じて、データの連結またはデータ分割を行う。続いて、シーケンサ103は、ヘッダ生成ロジック104において、インターネットチェックサム303のフィールドが未計算の通信ヘッダ120を生成し、内部メモリ105に格納する。シーケンサ103はさらに、通信ヘッダ120と、メモリ107に格納されるペイロード302および(第2のチェックサム演算部113により生成される)インターネットチェックサム303を送信バッファへDMA転送するためのデスクリプタ301を生成する。ここで、インターネットチェックサム303に対する転送先アドレスは、DMA転送後の通信ヘッダにおけるチェックサムフィールドを参照させ、通信部108の送信バッファ109への転送完了時に通信パケット121が完成するように設定される。
The
プロトコルスタックは、デスクリプタ301の生成後、演算転送命令をDMA転送部110に対して発行する。すなわち、プロトコルスタックは、第2のチェックサム演算部113を使用すること、および、デスクリプタ301を格納するメモリ領域、を示した値をDMA転送部110のレジスタに設定する。DMA転送部110は、レジスタに設定された値に応じて、第2のチェックサム演算部113を使用することを決定する。ここで、第1のチェックサム演算部112の使用時と同様に、DMA転送部110は、システムバスにおけるトランザクションIDやレジスタアクセス元のアドレス等により、シーケンサ103からの演算転送命令であることを検出して、第2のチェックサム演算部113を使用することを決定しても良い。また、DMA転送部110が、デスクリプタ301の転送元アドレスと転送先アドレスの組み合わせにより、第2のチェックサム演算部113を使用することを判断してもよい。
After generating the
通信部108は、送信バッファ109に書き込まれたインターネットチェックサム303を含む通信ヘッダ120と、ペイロード302からなる通信パケット121を、外部機器へ送信する。
The
(CPU101の動作)
図4に、本実施形態におけるCPU101(プロトコルスタック)の処理フローチャートを示す。ここでは、アプリケーションからのデータグラムが、メモリ106からメモリ107へペイロードサム演算を伴ってDMA転送された後、ペイロード長を変更するか否かに応じて動作を切り替えるフローチャートに関して説明を行う。
(Operation of CPU 101)
FIG. 4 shows a processing flowchart of the CPU 101 (protocol stack) in this embodiment. Here, a flowchart for switching the operation depending on whether or not to change the payload length after the datagram from the application is DMA-transferred from the
S400では、プロトコルスタックは、アプリケーションからのデータグラムを、メモリ106から、プロトコルスタックが利用するメモリ107へ、ペイロードサム演算を伴って転送(コピー)する演算転送命令を、DMA転送部110に対して発行する。データグラムの転送時に、データサイズがMSS以上である場合は、MSS単位で分割してDMA転送が行われるものとする。すなわち、MSS単位で分割された分割データに各々に対して、ペイロードサムが計算される。データサイズがMSS以下の場合には、アプリケーションから通知されるデータグラムのサイズで転送が行われる。
In S400, the protocol stack sends an operation transfer instruction to the
S401では、プロトコルスタックは、S400で発行した演算転送命令に対する、DMA転送部110からの演算転送完了の通知を待つ。例えば、プロトコルスタックは、DMA転送部110からの割りこみを待つ。なお、プロトコルスタックは、演算転送完了を、DMAコントローラ111のレジスタをポーリングすることにより、判断してもよい。
In S401, the protocol stack waits for the completion of the operation transfer from the
S402では、プロトコルスタックは、アプリケーションからのデータグラムの長さとMSSを比較し、データグラムの長さがMSS以下である場合に、アプリケーションからの次のデータグラムと連結可能か否かを判断する。次のデータグラムと連結してもMSS以下である場合には、プロトコルスタックは、連結可能と判断し(S402でYes)、S406の処理に進む。データグラムの長さがMSSと等しい、もしくは、データグラムの長さがMSS以下であるが次データグラムと連結した場合MSS以上となる場合には、プロトコルスタックは、連結不可と判断して(S402でNo)、S403の処理に進む。 In S402, the protocol stack compares the length of the datagram from the application with the MSS, and if the length of the datagram is less than or equal to the MSS, it determines whether it can be concatenated with the next datagram from the application. If the MSS is equal to or less than the MSS even after concatenation with the next datagram, the protocol stack determines that concatenation is possible (Yes in S402), and proceeds to the processing of S406. If the length of the datagram is equal to the MSS, or if the length of the datagram is less than the MSS but will be greater than the MSS when concatenated with the next datagram, the protocol stack determines that concatenation is not possible (S402 No), the process proceeds to S403.
S403では、プロトコルスタックは、通信状況が変化し、アプリケーションからのデータグラム転送前とMSSに変更があるか否かを判断する。例えば、プロトコルスタックは、受信したSYN(同期)パケットにおいて、TCPでMSSの変更があるか否かを判断する。MSSの変更があった場合には(S403でYes)、S407の処理に進み、MSSの変更が無い場合には(S403でNo)、S404の処理に進む。 In S403, the protocol stack determines whether or not there is a change in the MSS from before datagram transfer from the application due to a change in communication conditions. For example, the protocol stack determines whether there is an MSS change in TCP in the received SYN (synchronization) packet. If the MSS has been changed (Yes in S403), the process proceeds to S407, and if the MSS has not been changed (No in S403), the process proceeds to S404.
S404では、図2で説明したように、プロトコルスタックは、メモリ106からのデータ転送時に第1のチェックサム演算部112により計算されたペイロードサムを利用して、通信ヘッダ上の各フィールド値を参照して、インターネットチェックサムを計算する。また、プロトコルスタックは、インターネットチェックサムを計算後、通信ヘッダのチェックサムフィールドに書き戻す。S405では、プロトコルスタックは、DMA転送部110に対して、転送命令を発行する。続いて、S408では、プロトコルスタックは、転送命令に対する、DMA転送部110からの転送完了通知を待つ。ここで、プロトコルスタックは、転送完了を、割り込み、ポーリングのいずれにより検出してもよい。
In S404, as described in FIG. 2, the protocol stack uses the payload sum calculated by the
一方、S402でデータグラムが連結可能と判断された場合(S402でYes)、および、MSSに変更がある場合(S403でYes)、プロトコルスタックは、インターネットチェックサムを計算するために、計算されたペイロードサムが利用できない。これらの場合、プロトコルスタックは、シーケンサ103に対して代行を通知する(S406、S407)。すなわち、プロトコルスタックは、シーケンサ103に対して、演算転送命令の代行を依頼し、第2のチェックサム演算部113を利用して、インターネットチェックサムを演算させる。S406またはS407からのS408では、プロトコルスタックは、シーケンサ103からの転送演算命令に対する、DMA転送部110からの演算転送完了の通知を待つ。ここで、プロトコルスタックは、演算転送完了を、割り込み、ポーリングのいずれにより検出してもよい。
On the other hand, if it is determined in S402 that the datagrams can be concatenated (Yes in S402), and if there is a change in the MSS (Yes in S403), the protocol stack uses the calculated Payload sum not available. In these cases, the protocol stack notifies the
(DMA転送部110の動作)
図5に、本実施形態におけるDMA転送部110の処理フローチャートを示す。図5は、DMA転送部110が、CPU101(プロトコルスタック)もしくはシーケンサ103から、演算転送命令または転送命令を受信した場合の処理を示すフローチャートである。
(Operation of DMA Transfer Unit 110)
FIG. 5 shows a processing flowchart of the
S500では、DMA転送部110は、受信した命令が演算転送命令か転送命令かを判断する。例えば、DMA転送部110は、第1のチェックサム演算部112と第2のチェックサム演算部113をバイパス設定するレジスタをもち、レジスタに設定された設定値から転送命令か演算転送命令かを判断する。ここで、DMA転送部110は、読み込みのデスクリプタおよび書き込みのデスクリプタにおいて、転送長が2バイト異なる場合に演算転送命令とし、転送長が同じ場合に転送命令と判断してもよい。また、DMA転送部110は、第1のチェックサム演算部112と第2のチェックサム演算部113に対して設定される演算サイズが0となっている場合に、転送命令と判断しても良い。
In S500, the
転送命令の場合には(S500でNo)、DMA転送部110は、デスクリプタに基づいて各メモリ領域(メモリ106、メモリ107、シーケンサ103内の内部メモリ105、通信部108内の送信バッファ109)間でDMA転送を行う(S501)。一方、演算転送命令の場合には(S500でYes)、S502において、DMA転送部110は、プロトコルスタックまたはシーケンサ103のいずれからの演算転送命令であるか(すなわち、演算転送命令の発行元)を判断する。DMA転送部110は、例えば、レジスタ設定値、システムバスにおけるトランザクションIDやレジスタアクセス元のアドレス、デスクリプタの転送元、転送先アドレスの組み合わせから、演算転送命令の発行元を判断する。シーケンサ103が演算転送命令の発行元である場合には(S502でNo)、S503において、DMA転送部110は、第2のチェックサム演算部113を使用して、インターネットチェックサムを計算する。続いて、S504では、DMA転送部110は、通信ヘッダ、ペイロード、および、計算したインターネットチェックサムを送信バッファ109へ転送する。一方、プロトコルスタックが演算転送命令の発行元である場合には(S502でYes)、S505において、DMA転送部110は、第1のチェックサム演算部112を使用して、ペイロードサムを計算する。続くS506では、DMA転送部110は、ペイロードとペイロードサムを、プロトコルスタックが利用するメモリ107へ転送する。S507において、DMA転送部110は、転送命令または演算転送命令の発行元に対して、転送完了または演算転送完了を通知する。
In the case of a transfer command (No in S500), the
(各処理ブロックのシーケンスチャート(ペイロード長の変更無しの場合))
図6に、ペイロード長の変更無しの場合の各処理ブロックのシーケンスチャートを示す。S600では、CPU101で動作するプロトコルスタックが、アプリケーションからのデータを転送するためのデスクリプタを生成する。S601では、CPU101が生成したデスクリプタをメモリ106に格納する。S602では、CPU101で動作するプロトコルスタックが、DMA転送部110に対して演算転送命令を発行する。S603では、DMA転送部110が演算転送命令を受信し、続くS604で、メモリ106からデスクリプタを読み込む。次に、DMA転送部110は、読み込んだデスクリプタを解析し、メモリ106における、転送元アドレスに一致するアドレスからデータを読み込む。続いて、DMA転送部110の第1のチェックサム演算部112が、読み込まれたデータを用いてペイロードサムを計算する。ペイロードサムの計算が終了すると、S605において、DMA転送部110は、メモリ107における、デスクリプタ内の転送先アドレスに一致するアドレスに、データおよびペイロードサムを書き込む。データ転送が完了すると、S606において、DMA転送部110は、CPU101に対して、演算転送命令に対する演算タ転送完了を通知する。
(Sequence chart of each processing block (when payload length is not changed))
FIG. 6 shows a sequence chart of each processing block when the payload length is not changed. In S600, the protocol stack operating on the
S607では、プロトコルスタックは、ペイロード長が変更しないことを確認する。すなわち、プロトコルスタックは、インターネットチェックサムを計算するためにペイロードサムが利用可能であることを判断し、S607、S608において、ペイロードサムをメモリ107から読み込む。プロトコルスタックは、S609において、読み込んだペイロードサムから通信ヘッダ上の各フィールド値を参照してインターネットチェックサムを計算する。続いて、プロトコルスタックは、S610において、計算したインターネットチェックサムを通信ヘッダのチェックサムフィールドに挿入し、S611において、通信パケットをメモリ107へ書き込む。さらに、プロトコルスタックは、S612において、通信パケットを、通信部108の送信バッファ109に転送するためのデスクリプタを生成し、メモリ106に格納する。デスクリプタを生成後、プロトコルスタックは、S614において、DMA転送部110に対して転送命令を発行する。S615において、転送命令を受信したDMA転送部110は、S616において、デスクリプタをメモリ106より読み込む。続いて、DMA転送部110は、S617において、デスクリプタに従いメモリ107からから通信パケットを読み込み、S618において、通信部108内の送信バッファ109に通信パケットを書き込む。最後に、S619において、DMA転送部110は、CPU101(プロトコルスタック)に対して、転送完了を通知する。
At S607, the protocol stack confirms that the payload length does not change. That is, the protocol stack determines that the payload sum is available for computing the Internet checksum, and reads the payload sum from
(各処理ブロックのシーケンスチャート(ペイロード長の変更有りの場合))
図7に、ペイロード長の変更有りの場合の各処理ブロックのシーケンスチャートを示す。S700~S706の処理シーケンスは、図6におけるS600~S606と同様であるため、説明を省略する。すなわち、S700~S706において、第1のチェックサム演算部112により、ペイロードサムが演算される。
(Sequence chart of each processing block (when payload length is changed))
FIG. 7 shows a sequence chart of each processing block when the payload length is changed. The processing sequence of S700 to S706 is the same as that of S600 to S606 in FIG. 6, so the description is omitted. That is, in S700 to S706, the
S707において、プロトコルスタックは、アプリケーションからの複数のデータグラムが連結できるか否かを判断する。複数データグラムの連結が可能な場合に、プロトコルスタックは、S708において、シーケンサ103に対して演算転送命令の代行の依頼と共に、データ連結の指示を通知する。S709において、シーケンサ103はデータ連結の指示を含む演算代行通知を受信し、通信ヘッダを内部メモリ105に生成する。続いて、シーケンサ103は、S710において、生成した通信ヘッダとメモリ107にS705において格納されたペイロードからインターネットチェックサムを演算しつつ、DMA転送するためのデスクリプタを生成する。S711において、シーケンサ103は、生成したデスクリプタをメモリ106に格納する。
At S707, the protocol stack determines whether multiple datagrams from the application can be concatenated. If multiple datagrams can be concatenated, the protocol stack notifies the
S712において、シーケンサ103は、DMA転送部110に対して、演算転送命令を発行する。S713では、DMA転送部110は、演算転送命令により、チェックサム演算、および、メモリ106に格納されたデスクリプタのアドレス、および、DMA転送の開始が指示される。DMA転送部110は、S714において、メモリ106に対してアクセスし、S715において、メモリ106からデスクリプタを読み込む。DMA転送部110は、S715において、読み込んだデスクリプタに従って、DMA転送を開始する。DMA転送部110は、S717において、シーケンサ103の内部メモリ105に格納された通信ヘッダを読み込み、S716において、メモリ107に格納されたデータを読み込む。DMA転送部110は、読み込んだ通信ヘッダとデータから、インターネットチェックサムを計算する。
In S<b>712 , the
S718では、DMA転送部110は、通信パケットとして、通信ヘッダ、データ(ペイロード)、および、インターネットチェックサムを、通信部108内の送信バッファ109に書き込む。この際、DMA転送部110は、インターネットチェックサムを、通信ヘッダ内のチェックサムフィールドに挿入した後に、送信バッファ109に書き込んでもよい。または、DMA転送部110は、送信バッファ109上で、通信ヘッダが書き込まれた後にインターネットチェックサムをチェックサムフィールドに上書きしても良い。
In S718, the
S718の書き込み処理の完了後、DMA転送部110は、シーケンサ103に対して、演算転送完了を通知し、S719において、シーケンサ103が当該通知を受信する。さらに、シーケンサ103は、演算転送完了の通知の受信に伴い、CPU101に対して、演算転送命令の代行完了を通知する。最後に、S720において、CPU101は、演算転送命令の代行完了の通知を受信する。
After the write processing in S718 is completed, the
このように、本実施形態によれば、ペイロード長が変更される場合であっても、ハードウェアでインターネットチェックサムの計算を代行することができ、DMA転送中における通信速度の低下を防ぐことが可能となる。 As described above, according to the present embodiment, even when the payload length is changed, the Internet checksum calculation can be performed by hardware, thereby preventing a decrease in communication speed during DMA transfer. It becomes possible.
[第2の実施形態]
第1の実施形態では、ペイロード長がプロトコルスタックの処理時に変更される場合に、シーケンサ103がインターネットチェックサムの演算をCPU101に代わって行うことを説明した。第2の実施形態では、ペイロード長がプロトコルスタックの処理時に変更される場合に加えて、通信パケットの再送時にも変更され得る場合について説明する。以下、第1の実施形態と異なる点について説明する。
[Second embodiment]
In the first embodiment, it was explained that the
(CPU101の動作)
図8に、本実施形態におけるCPU101(プロトコルスタック)の処理フローチャートを示す。S800において、プロトコルスタックは、通信パケット送信後の通信パケット再送時のペイロード変更があるかどうかを判断する。ペイロード変更が発生する場合は、送信時のペイロードの途中までは正しく受信されており、送信時のペイロードの途中から再送パケット(最初に送信した通信パケットの一部を含む通信パケット)を生成する場合である。この場合、ペイロードが変更となるため、送信時に計算したペイロードサムは利用できなくなる。ここで、再送発生時にどこまで正しく受信できたかは、送信先からの確認応答パケットのACK番号を解析すること等により確認することができる。
(Operation of CPU 101)
FIG. 8 shows a processing flowchart of the CPU 101 (protocol stack) in this embodiment. At S800, the protocol stack determines whether or not there is a payload change when retransmitting a communication packet after transmitting the communication packet. When a payload change occurs, the part of the payload at the time of transmission was correctly received, and a resent packet (a communication packet containing part of the communication packet that was first sent) is generated from the middle of the payload at the time of transmission. is. In this case, since the payload changes, the payload sum calculated at the time of transmission is no longer available. Here, it is possible to confirm to what extent the retransmission was correctly received by analyzing the ACK number of the acknowledgment packet from the transmission destination.
S800において、ペイロードに変更がある場合には(S800でYes)S801に進む。S801において、プロトコルスタックは、シーケンサ103に対して、演算転送命令の代行を通知し、インターネットチェックサムをDMA転送部110における第2のチェックサム演算部113で演算させる。一方、再送時に送信時と同じペイロードを含む通信パケットを送信する場合には(S800でNo)、ペイロードサムが利用可能であるため、プロトコルスタックは、S404において、ペイロードサムを利用してインターネットチェックサムを計算する。続くS405では、プロトコルスタックは、通信パケットを送信バッファ109へDMA転送するための転送命令を発行する。
In S800, if there is a change in the payload (Yes in S800), the process proceeds to S801. In S<b>801 , the protocol stack notifies the
(各処理ブロックのシーケンスチャート(ペイロードの変更有りの場合))
図9に、ペイロード変更有りの場合の各処理ブロックのシーケンスチャートを示す。S900は、第1の実施形態において説明した図6および図7に示す通信パケットの送信シーケンスである。当該通信シーケンス後、S901で通信部108は、送信パケットに対する確認応答パケットを受信する。S902では、CPU101で動作するプロトコルスタックが、通信部108で受信した確認応答パケットを解析する。そして、プロトコルスタックは、通信相手先が送信パケットに含まれるデータの途中から正しく受信できていないことを検出し、ペイロード変更が生じる再送を行うことを決定する。続いて、プロトコルスタックは、S903において、再送時のデータ開始位置を確認応答パケットのACK番号から決定する。再送時のデータ開始位置を決定後、プロトコルスタックは、S904において、シーケンサ103に対して演算転送命令の代行を依頼する。この際、プロトコルスタックは、通信相手先で正しく受信できなかったデータの開始位置を、シーケンサ103に通知する。S905において、シーケンサ103は演算代行通知を受信し、通信ヘッダを内部メモリ105に生成する。続いて、シーケンサ103は、S906において、生成した通信ヘッダとメモリ107に格納されたペイロードからインターネットチェックサムを演算しつつ、DMA転送するためのデスクリプタを生成する。S907において、シーケンサ103は、生成したデスクリプタをメモリ106に格納する。ここで、デスクリプタにおける転送元アドレスには、CPU101から通知されるデータ開始位置に一致するメモリ106におけるアドレスが記載される。デスクリプタ格納後、シーケンサ103は、S908において、DMA転送部110に対して、演算転送命令を発行する。
(Sequence chart of each processing block (with payload change))
FIG. 9 shows a sequence chart of each processing block when there is a payload change. S900 is the communication packet transmission sequence shown in FIGS. 6 and 7 described in the first embodiment. After the communication sequence, in S901, the
DMA転送部110は、S908において、演算転送命令を受信する。DMA転送部110は、S910において、メモリ106に対してアクセスし、S911において、メモリ106からデスクリプタを読み込む。DMA転送部110は、S912において。読み込んだデスクリプタに従って、DMA転送を開始する。DMA転送部110は、S912において、シーケンサ103の内部メモリ105に格納された通信ヘッダを読み込み、S913において、メモリ107にペイロードを読み込む。ここで、デスクリプタにより指定されるペイロードの読み込みを開始するアドレスは、通信相手先において、正しく受信できなかった途中のデータの開始アドレスである。DMA転送部110の第2のチェックサム演算部113は、読み込んだ通信ヘッダとペイロードから、演算転送命令の発行時のレジスタ設定に従い、インターネットチェックサムを計算する。
The
S913では、DMA転送部110は、通信パケットとして、通信ヘッダ、データ(ペイロード)、および、インターネットチェックサムを、通信部108内の送信バッファ109に書き込む。S913の書き込み処理の完了後、DMA転送部110は、シーケンサ103に対して、演算転送命令の完了を通知し、S914において、シーケンサ103が当該通知を受信する。さらに、シーケンサ103は、演算転送命令の通知の受信に伴い、CPU101に対して、演算転送命令の代行完了を通知する。最後に、S915において、CPU101は、演算転送命令の代行完了の通知を受信する。
In S913, the
このように、本実施形態では、再送時にペイロードの変更があった場合に、DMA転送部110がインターネットチェックサムを演算し、再送パケットを生成することにより、DMA転送中における通信速度の低下を防ぐことが可能となる。なお、DMA転送部110に替えて、プロトコルスタックがインターネットチェックサムを計算して再送パケットを生成するように構成することも可能である。
Thus, in this embodiment, when the payload is changed during retransmission, the
[第3の実施形態]
第1の実施形態では、メモリ106からメモリ107にデータをDMA転送する際に、ペイロードサムを演算することを前提として説明を行った。しかしながら、再送を伴わないUDPプロトコルにおいては、DMA転送部110が、メモリ106から送信バッファ109にDMA転送を行う際に、第2のチェックサム演算部113を用いてインターネットチェックサムを計算し、通信パケットを生成してもよい。また、TCPプロトコルにおいては、アプリケーションとプロトコルスタック間におけるメモリ領域の管理により、メモリ106において再送のためのデータ管理が行える場合には、メモリ107への転送(コピー)なしに通信パケットを構成してもよい。また、データ転送が必要なアプリケーションか否かの種別に応じて、通信パケットを送信バッファ109に生成する(第1の実施形態)か、上記のようにメモリ107へのデータコピーなしに通信パケットを生成するかを切り替えてもよい。
[Third Embodiment]
In the description of the first embodiment, it is assumed that the payload sum is calculated when data is DMA-transferred from the
[その他の実施形態]
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
[Other embodiments]
The present invention supplies a program that implements one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in the computer of the system or apparatus reads and executes the program. It can also be realized by processing to It can also be implemented by a circuit (for example, ASIC) that implements one or more functions.
100 通信装置、101 CPU、102 システムバス、103 シーケンサ、104 ヘッダ生成ロジック、105 内部メモリ、106 メモリ、107 メモリ、108 通信部、109 送信バッファ
100 communication device, 101 CPU, 102 system bus, 103 sequencer, 104 header generation logic, 105 internal memory, 106 memory, 107 memory, 108 communication unit, 109 transmission buffer
Claims (11)
前記プロトコルスタックを実行中の前記プロセッサから転送命令を受信した場合に、前記第1のデータと前記第2のデータのそれぞれに対して第1のチェックサムの演算を行う第1の演算手段と、
前記制御ハードウェアから転送命令を受信した場合に、前記連結処理が行われる前記第1のデータおよび前記第2のデータと通信ヘッダとに対して前記第1のチェックサムの演算と異なる第2のチェックサムの演算を行う第2の演算手段と、
前記第1の演算手段または前記第2の演算手段による演算を介して得られたチェックサムデータを転送先アドレスに応じたメモリの領域に転送する転送手段と、
を有し、
前記第2の演算手段による演算は、前記プロセッサが前記第1のデータと前記第2のデータの連結が必要であると判断した場合に、前記連結処理が行われる前記第1のデータと前記第2のデータを転送するための転送命令を前記制御ハードウェアが前記DMA転送装置へ送信することに応じて行われることを特徴とするDMA転送装置。 A DMA provided in a communication device having at least one processor capable of executing a protocol stack and control hardware capable of performing concatenation processing for concatenating first data and second data from an application. Direct Memory Access) transfer device,
first computing means for computing a first checksum for each of the first data and the second data when a transfer instruction is received from the processor executing the protocol stack ;
when a transfer command is received from the control hardware, a second checksum operation different from the first checksum calculation is performed on the first data and the second data on which the concatenation processing is performed, and a communication header; a second computing means for computing a checksum of 2;
transfer means for transferring checksum data obtained through calculation by the first calculation means or the second calculation means to a memory area corresponding to a transfer destination address;
has
When the processor determines that the first data and the second data need to be linked, the calculation by the second calculation means is performed by combining the first data and the A DMA transfer device, wherein the control hardware transmits a transfer command for transferring the second data to the DMA transfer device.
前記第1の演算手段または前記第2の演算手段を選択する選択手段と、をさらに備え、
前記第1の演算手段は、前記転送元アドレスに応じたメモリの領域からのデータに対して、前記第1のチェックサムの演算を行い、
前記第2の演算手段は、前記転送元アドレスに応じたメモリの領域からのデータに対して、前記第2のチェックサムの演算を行う
ことを特徴とする請求項1又は2に記載のDMA転送装置。 acquisition means for acquiring information including the transfer source address and the transfer destination address based on the received transfer command;
further comprising selection means for selecting the first calculation means or the second calculation means,
The first computing means performs the first checksum computation on data from a memory area corresponding to the transfer source address,
3. The DMA transfer according to claim 1, wherein said second computing means computes said second checksum for data from a memory area corresponding to said transfer source address. Device.
前記プロセッサにより前記第1のデータと前記第2のデータの連結が不要であると判断された場合、前記プロセッサが前記転送命令を前記DMA転送装置に対して発行し、前記プロセッサにより前記第1のデータと前記第2のデータの連結が必要であると判断された場合、前記制御ハードウェアが前記転送命令を前記DMA転送装置に対して発行することを特徴とする通信装置。 A communication device comprising the DMA transfer device according to any one of claims 1 to 6 , the at least one processor, and the control hardware,
When the processor determines that concatenation of the first data and the second data is unnecessary , the processor issues the transfer instruction to the DMA transfer device, and the processor and said second data , said control hardware issues said transfer command to said DMA transfer device.
前記プロセッサにより前記アプリケーションからのデータをパケット化して伝送可能な最大データサイズが変更されていないと判断された場合、前記プロセッサが前記転送命令を前記DMA転送装置に対して発行し、前記プロセッサにより前記最大データサイズが変更されていると判断された場合、前記制御ハードウェアが前記転送命令を前記DMA転送装置に対して発行することを特徴とする通信装置。 A communication device comprising the DMA transfer device according to any one of claims 1 to 6 , the at least one processor, and the control hardware,
When the processor determines that the maximum data size that can be transmitted by packetizing the data from the application has not been changed, the processor issues the transfer command to the DMA transfer device, and the processor A communication device, wherein the control hardware issues the transfer command to the DMA transfer device when it is determined that the maximum data size has been changed.
前記アプリケーションからのデータがパケット化された通信パケット送信後において、
前記プロセッサにより当該通信パケットを再送すると判断された場合、前記プロセッサが前記転送命令を前記DMA転送装置に対して発行し、前記プロセッサにより当該通信パケットの一部を再送すると判断された場合、前記制御ハードウェアが前記転送命令を前記DMA転送装置に対して発行することを特徴とする通信装置。 A communication device comprising the DMA transfer device according to any one of claims 1 to 6 , the at least one processor, and the control hardware,
After transmitting a communication packet in which data from the application is packetized,
If the processor determines to resend the communication packet, the processor issues the transfer instruction to the DMA transfer device; and if the processor determines to resend part of the communication packet, the control A communication device, wherein hardware issues the transfer command to the DMA transfer device.
前記アプリケーションからのデータを、前記転送手段が前記転送先アドレスに応じたメモリの領域にコピーする必要がある場合、前記プロセッサが前記転送命令を前記DMA転送装置に対して発行し、当該コピーの必要が無い場合、前記制御ハードウェアが前記転送命令を前記DMA転送装置に対して発行することを特徴とする通信装置。 A communication device comprising the DMA transfer device according to any one of claims 1 to 6 , the at least one processor, and the control hardware,
When the transfer means needs to copy data from the application to a memory area corresponding to the transfer destination address, the processor issues the transfer instruction to the DMA transfer device, is absent, the control hardware issues the transfer command to the DMA transfer device.
前記プロトコルスタックを実行中の前記プロセッサから転送命令を受信した場合に、前記第1のデータと前記第2のデータのそれぞれに対して第1のチェックサムの演算を行う第1の演算工程と、
前記制御ハードウェアから転送命令を受信した場合に、前記連結処理が行われる前記第1のデータおよび前記第2のデータと通信ヘッダとに対して前記第1のチェックサムの演算と異なる第2のチェックサムの演算を行う第2の演算工程と、
前記第1の演算工程または前記第2の演算工程による演算を介して得られたチェックサムデータを転送先アドレスに応じたメモリの領域に転送する転送工程と、
を有し、
前記第2の演算工程による演算は、前記プロセッサが前記第1のデータと前記第2のデータとの連結が必要であると判断した場合に、前記連結処理が行われる前記第1のデータと前記第2のデータを転送するための転送命令を前記制御ハードウェアが前記DMA転送装置へ送信することに応じて行われることを特徴とするDMA転送装置の制御方法。 A DMA (DMA) provided in a communication device having at least one processor capable of executing a protocol stack and control hardware capable of performing concatenation processing for concatenating first data and second data from an application. Direct Memory Access) transfer device control method,
a first computing step of computing a first checksum for each of the first data and the second data when a transfer instruction is received from the processor executing the protocol stack ;
when a transfer command is received from the control hardware, a second checksum operation different from the first checksum calculation is performed on the first data and the second data on which the concatenation processing is performed, and a communication header; a second computing step of computing two checksums;
a transfer step of transferring the checksum data obtained through the calculation in the first calculation step or the second calculation step to a memory area corresponding to a transfer destination address;
has
When the processor determines that the first data and the second data need to be linked, the calculation by the second calculation step is performed by combining the first data and the A control method for a DMA transfer device, wherein the control hardware transmits a transfer command for transferring the second data to the DMA transfer device.
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2017238920A JP7145607B2 (en) | 2017-12-13 | 2017-12-13 | DMA TRANSFER DEVICE, DMA TRANSFER CONTROL METHOD, AND COMMUNICATION DEVICE |
| US16/213,024 US10833703B2 (en) | 2017-12-13 | 2018-12-07 | DMA transfer apparatus, method of controlling the same, communication apparatus, method of controlling the same, and non-transitory computer-readable storage medium |
| US17/029,248 US11336297B2 (en) | 2017-12-13 | 2020-09-23 | DMA transfer apparatus, method of controlling the same, communication apparatus, method of controlling the same, and non-transitory computer-readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2017238920A JP7145607B2 (en) | 2017-12-13 | 2017-12-13 | DMA TRANSFER DEVICE, DMA TRANSFER CONTROL METHOD, AND COMMUNICATION DEVICE |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2019106063A JP2019106063A (en) | 2019-06-27 |
| JP7145607B2 true JP7145607B2 (en) | 2022-10-03 |
Family
ID=67062017
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2017238920A Active JP7145607B2 (en) | 2017-12-13 | 2017-12-13 | DMA TRANSFER DEVICE, DMA TRANSFER CONTROL METHOD, AND COMMUNICATION DEVICE |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7145607B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR102866045B1 (en) * | 2020-11-06 | 2025-09-26 | 삼성전자주식회사 | Memory device including direct memory access engine, System having the same and Operating method of memory device |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010057033A (en) | 2008-08-29 | 2010-03-11 | Nec Electronics Corp | Communications apparatus and method therefor |
| JP2015207223A (en) | 2014-04-22 | 2015-11-19 | キヤノン株式会社 | Information processing device and information processing method |
| JP2017103734A (en) | 2015-12-04 | 2017-06-08 | キヤノン株式会社 | Communication device, control method therefor and program |
| JP2017108357A (en) | 2015-12-11 | 2017-06-15 | キヤノン株式会社 | Arithmetic apparatus, arithmetic method, and communication apparatus |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH11126181A (en) * | 1997-10-22 | 1999-05-11 | Mitsubishi Electric Corp | Information transfer device with arithmetic function |
-
2017
- 2017-12-13 JP JP2017238920A patent/JP7145607B2/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010057033A (en) | 2008-08-29 | 2010-03-11 | Nec Electronics Corp | Communications apparatus and method therefor |
| JP2015207223A (en) | 2014-04-22 | 2015-11-19 | キヤノン株式会社 | Information processing device and information processing method |
| JP2017103734A (en) | 2015-12-04 | 2017-06-08 | キヤノン株式会社 | Communication device, control method therefor and program |
| JP2017108357A (en) | 2015-12-11 | 2017-06-15 | キヤノン株式会社 | Arithmetic apparatus, arithmetic method, and communication apparatus |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2019106063A (en) | 2019-06-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6433146B2 (en) | Information processing apparatus, system, information processing method, computer program | |
| US8032670B2 (en) | Method and apparatus for generating DMA transfers to memory | |
| US7620746B2 (en) | Functional DMA performing operation on DMA data and writing result of operation | |
| JP4344576B2 (en) | Packet communication device | |
| US11336297B2 (en) | DMA transfer apparatus, method of controlling the same, communication apparatus, method of controlling the same, and non-transitory computer-readable storage medium | |
| CN100592273C (en) | Apparatus and method for performing DMA data transfer | |
| US7707477B2 (en) | Checksum calculation | |
| JP5482230B2 (en) | COMMUNICATION DEVICE, INFORMATION PROCESSING DEVICE, COMMUNICATION DEVICE CONTROL METHOD, AND CONTROL PROGRAM | |
| US20250133136A1 (en) | Remote Memory Filling | |
| JP7145607B2 (en) | DMA TRANSFER DEVICE, DMA TRANSFER CONTROL METHOD, AND COMMUNICATION DEVICE | |
| JP4786575B2 (en) | Data transfer method between computer and network interface controller, program, and network interface controller | |
| CN102792638B (en) | Network controller circuitry to issue at least one portion of packet payload to device in manner that by-passes communication protocol stack involvement | |
| CN113422792A (en) | Data transmission method and device, electronic equipment and computer storage medium | |
| CN1846424A (en) | Checksum determination | |
| JP6938399B2 (en) | Communication equipment, communication methods and programs | |
| CN121858391A (en) | Apparatus and method for data processing | |
| JP2004094931A (en) | Network system and communication method in network | |
| JP2007329730A (en) | Communication protocol processor | |
| JP2021036630A (en) | Communication device, control method, and program | |
| JP6567476B2 (en) | Data processing device | |
| JP4519090B2 (en) | Transmitting apparatus, receiving apparatus and methods thereof | |
| JP7005303B2 (en) | Communication equipment, packet generators and their control methods | |
| JP2020174322A (en) | Communication apparatus, control method, and program | |
| HK40058773A (en) | Data transmission method and device, electronic equipment and computer storage medium | |
| JP2004227040A (en) | Network server and storage data communication method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20201202 |
|
| RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20210103 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210113 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20210630 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210712 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210908 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20220218 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20220404 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20220822 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20220920 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 7145607 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |