JP7145607B2 - DMA TRANSFER DEVICE, DMA TRANSFER CONTROL METHOD, AND COMMUNICATION DEVICE - Google Patents

DMA TRANSFER DEVICE, DMA TRANSFER CONTROL METHOD, AND COMMUNICATION DEVICE Download PDF

Info

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
Application number
JP2017238920A
Other languages
Japanese (ja)
Other versions
JP2019106063A (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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2017238920A priority Critical patent/JP7145607B2/en
Priority to US16/213,024 priority patent/US10833703B2/en
Publication of JP2019106063A publication Critical patent/JP2019106063A/en
Priority to US17/029,248 priority patent/US11336297B2/en
Application granted granted Critical
Publication of JP7145607B2 publication Critical patent/JP7145607B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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.

特開平6-78024号公報JP-A-6-78024 特開2006-303765号公報JP 2006-303765 A

アプリケーション層からのデータグラム(ペイロード)を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.

通信装置100の概略構成図である。1 is a schematic configuration diagram of a communication device 100; FIG. 第1のチェックサム演算部112使用時のDMA転送例を示す。An example of DMA transfer when the first checksum calculator 112 is used is shown. 第2のチェックサム演算部113使用時のDMA転送例を示す。An example of DMA transfer when the second checksum calculator 113 is used is shown. 第1の実施形態におけるCPU101の処理フローチャートである。4 is a processing flowchart of the CPU 101 in the first embodiment; 第1の実施形態におけるDMA転送部110の処理フローチャートである。4 is a processing flowchart of a DMA transfer unit 110 according to the first embodiment; 第1の実施形態におけるペイロード長の変更無しの場合の各処理ブロックのシーケンスチャートを示す。FIG. 4 shows a sequence chart of each processing block when the payload length is not changed in the first embodiment; FIG. 第1の実施形態におけるペイロード長の変更有りの場合の各処理ブロックのシーケンスチャートを示す。FIG. 4 shows a sequence chart of each processing block when the payload length is changed in the first embodiment; FIG. 第2の実施形態におけるCPU101の処理フローチャートである。It is a processing flowchart of CPU101 in a 2nd embodiment. 第2の実施形態におけるペイロード変更有りの場合の各処理ブロックのシーケンスチャートを示す。FIG. 10 is a sequence chart of each processing block when payload change is present in the second embodiment; FIG.

以下、添付の図面を参照して、本発明をその実施形態の一例に基づいて詳細に説明する。なお、以下の実施形態において示す構成は一例に過ぎず、本発明は図示された構成に限定されるものではない。 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 communication device 100 in the embodiment described below. The CPU 101 controls each functional block, each software, and each hardware included in the communication device 100 . In this embodiment, the CPU 101 controls two pieces of software, an application and a protocol stack. The application is software that operates when data of a captured image or moving image is uploaded to the Internet or a media server when a camera or a camcorder is assumed as the communication device 100 . A protocol stack is software that performs communication protocol processing such as TCP (UDP)/IP. Specifically, the protocol stack performs retransmission control in TCP (UDP)/IP communication, guarantees the order of packets, and checks consistency of communication packets using checksums. Also, the protocol stack generates a TCP (UDP) header and an IP header, which are communication headers for realizing these functions.

メモリ106は、アプリケーションが利用するメモリ領域である。メモリ106には、例えば、アプリケーションから出力される動画像等のデータが格納される。一方、メモリ107はプロトコルスタックが利用するメモリ領域である。メモリ107は、例えば、プロトコルスタックが動画像データからパケットを生成するための一時的なデータコピー領域や、通信ヘッダを生成する領域として使用される。なお、図1ではメモリ106とメモリ107は別々に構成されているが、これらのメモリは同一のメモリで構成され、メモリアドレスで各ソフトウェアの利用領域が管理されても良い。 The memory 106 is a memory area used by applications. The memory 106 stores data such as moving images output from applications, for example. On the other hand, memory 107 is a memory area used by the protocol stack. The memory 107 is used, for example, as a temporary data copy area for the protocol stack to generate packets from moving image data, or as an area for generating communication headers. Note that although the memory 106 and the memory 107 are configured separately in FIG. 1, these memories may be configured by the same memory, and the areas used by each software may be managed by memory addresses.

アプリケーションが利用もしくは出力するデータは、システムバス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 memory 106 via system bus 102 . Data exchange (data transfer/copy) between storage areas (memory 106, memory 107, internal memory 105 in sequencer 103, transmission buffer 109 in communication unit 108) is performed via system bus 102 by: It is executed by the CPU 101 or the DMA controller 111 in the DMA transfer unit 110 . Also, it is assumed that data is exchanged between each hardware block in the communication device 100 via the system bus 102 .

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 transfer section 110 is composed of a first checksum calculation section 112 , a second checksum calculation section 113 and a DMA controller 111 . The first checksum calculator 112 calculates the sum of datagrams (hereafter referred to as payload sum). Also, the second checksum calculator 113 calculates an Internet checksum. The amount of computation involved in computing the payload sum is less than the amount of computation involved in computing the Internet checksum. Specifically, the payload sum is the one's complement sum of each 16-bit word of the input datagram. The Internet checksum is the 1's complement of the 1's complement sum for each 16-bit word in RFC (Request for Comments) 791, RFC793, RFC2460 and RFC1071 defined by the Internet Engineering Task Force (IETF). More specifically, the Internet checksum in this embodiment is the inverse (16-bit one's complement ). Here, the pseudo-header contains the SRC (source) address, DST (destination) address, protocol number. (number), which can be constructed from the TCP length.

DMA転送部110は、このような構成を有することにより、DMA転送中にペイロードサムとインターネットチェックサムを演算することが可能となる。また、DMA転送部110は、チェックサム演算を行わずに、単純にDMA転送器としても動作することも可能である。 With such a configuration, the DMA transfer unit 110 can calculate the payload sum and Internet checksum during DMA transfer. Also, the DMA transfer unit 110 can simply operate as a DMA transfer device without performing checksum calculation.

DMA転送部110は、CPU101またはシーケンサ103から設定されるレジスタの値等に基づいて、第1のチェックサム演算部112または第2のチェックサム演算部113のいずれかを選択する。また、DMA転送部110は、当該レジスタの値により指定されるメモリ領域からデスクリプタを読み出し、当該デスクリプタに基づいてDMA転送またはチェックサム演算を伴うDMA転送を行う。なお、以下の説明において、DMA転送を行うためのレジスタ設定を転送命令といい、チェックサム演算を伴うDMA転送を演算転送命令という。DMA転送部110に設定されるレジスタの値には、メモリの領域が指定される。DMA転送部110は、当該指定されたメモリの領域に格納されるデスクリプタにしたがって動作する。デスクリプタとは、DMA転送部110においてDMA転送を行う際に必要な情報であり、少なくとも転送元アドレス、転送先アドレス、データ長が含まれる。すなわち、DMA転送部は、受信した演算転送命令または転送命令に基づいて、転送元アドレスと転送先アドレスを含む情報を取得する。 The DMA transfer unit 110 selects either the first checksum calculation unit 112 or the second checksum calculation unit 113 based on the register values set by the CPU 101 or the sequencer 103 . Also, the DMA transfer unit 110 reads a descriptor from a memory area specified by the value of the register, and performs DMA transfer or DMA transfer involving checksum calculation based on the descriptor. In the following description, a register setting for DMA transfer is referred to as a transfer instruction, and a DMA transfer involving checksum calculation is referred to as an arithmetic transfer instruction. A memory area is designated as a register value set in the DMA transfer unit 110 . The DMA transfer unit 110 operates according to the descriptor stored in the specified memory area. A descriptor is information necessary for DMA transfer in the DMA transfer unit 110, and includes at least a transfer source address, a transfer destination address, and a data length. That is, the DMA transfer unit acquires information including the transfer source address and the transfer destination address based on the received operation transfer command or transfer command.

シーケンサ103は、後述するように、演算転送命令の代行の依頼と共に所定の指示を受けたことに応じて、データ連結またはデータ分割を行うことが可能な制御ハードウェアである。例えば、シーケンサ103は、演算転送命令の代行の依頼と共に、データ分割を行う指示を受けた場合、データグラムをMSS(Maximum Segment Size)に分割する。なお、MSSとは、アプリケーションが出力するデータグラムを通信パケット化する際に通信プロトコル上で伝送可能であるサイズに分割する際の最大データサイズである。続いて、シーケンサ103内のヘッダ生成ロジック104が、分割/連結データの各々に対する通信ヘッダを生成する。シーケンサ103は、分割/連結データの各々に対する通信ヘッダを生成後、各分割/連結データと生成した通信ヘッダを送信バッファ109にDMA転送して通信パケット化するためのデスクリプタを生成する。生成したデスクリプタは、メモリ106に格納される。シーケンサ103は、デスクリプタをメモリ106に格納後、転送命令をDMA転送部110に対して発行する。 As will be described later, the sequencer 103 is control hardware capable of performing data concatenation or data division in response to receiving a request for substitution of an operation transfer instruction and a predetermined instruction. For example, the sequencer 103 divides the datagram into MSS (Maximum Segment Size) when it receives an instruction to divide the data together with a request to substitute the operation transfer instruction. Note that the MSS is the maximum data size when dividing a datagram output by an application into a size that can be transmitted on a communication protocol when packetizing the datagram for communication. Subsequently, header generation logic 104 within sequencer 103 generates a communication header for each piece of split/concatenated data. After generating a communication header for each piece of divided/concatenated data, the sequencer 103 generates a descriptor for DMA-transferring each piece of divided/concatenated data and the generated communication header to the transmission buffer 109 and forming a communication packet. The generated descriptor is stored in memory 106 . After storing the descriptor in memory 106 , sequencer 103 issues a transfer command to DMA transfer unit 110 .

通信部108は、外部機器と通信を行う。具体的には、通信部108は、通信に必要なMAC(Media Access Contorol)層およびPHY層の処理を行う。 A communication unit 108 communicates with an external device. Specifically, the communication unit 108 performs processing of a MAC (Media Access Control) layer and a PHY layer necessary for communication.

(第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 first checksum calculator 112 in this embodiment. Hereinafter, when the DMA transfer unit 110 DMA-transfers the datagram output by the application to the memory 106 to the memory 107 used by the protocol stack, the first checksum calculation unit 112 is used to calculate the payload sum. will be described.

CPU101では、アプリケーションがメモリ106にデータグラム201を出力した後、プロトコルスタックへタスクが切り替わる。プロトコルスタックは、メモリ106に格納されたデータグラム201をDMA転送するためにデスクリプタ202を生成する。データグラムがMSSよりも小さい場合は、プロトコルスタックは、デスクリプタ202として、転送長がデータグラム201と同じサイズのデスクリプタと、ペイロードサム用に転送長が2バイトのデスクリプタを生成する。プロトコルスタックは、生成したデスクリプタ202をメモリ106に格納する。 In the CPU 101, after the application outputs the datagram 201 to the memory 106, the task is switched to the protocol stack. The protocol stack generates descriptors 202 for DMA transfer of datagrams 201 stored in memory 106 . If the datagram is smaller than the MSS, the protocol stack generates a descriptor 202 with a transfer length the same size as the datagram 201 and a descriptor with a transfer length of 2 bytes for the payload sum. The protocol stack stores the generated descriptor 202 in memory 106 .

一方、データグラム201がMSSよりも大きい場合は、MSS毎にペイロードサムを計算する必要があるため、プロトコルスタックはMSS毎にデータグラムを分割する。続いて、プロトコルスタックは、デスクリプタ202として、転送長がMSSである複数のデスクリプタと、転送長がMSSで分割した余りのデータサイズであるデスクリプタ、各分割データのペイロードサム用のデスクリプタを生成する。プロトコルスタックは、生成したデスクリプタ202をメモリ106に格納する。 On the other hand, if the datagram 201 is larger than the MSS, the protocol stack divides the datagram by MSS because it is necessary to calculate the payload sum for each MSS. Subsequently, the protocol stack generates, as descriptors 202, a plurality of descriptors whose transfer length is MSS, a descriptor whose transfer length is the data size remaining after division by MSS, and a descriptor for the payload sum of each divided data. The protocol stack stores the generated descriptor 202 in memory 106 .

なお、プロトコルスタックは、読み込み用のデスクリプタ202と書き込み用のデスクリプタ202を別々に生成してもよい。例えば、プロトコルスタックは、読み込み用のデスクリプタ202として、上記分割データ用のデスクリプタを生成してもよい。また、プロトコルスタックは、書き込み用のデスクリプタ202として、上記分割用のデスクリプタとペイロードサム用のデスクリプタを生成してもよい。ここで、プロトコルスタックは、書き込み用のデスクリプタ202として、分割データ用のデスクリプタとペイロードサム用のデスクリプタの転送長を加算して、1つのデスクリプタとしてまとめてもよい。 Note that the protocol stack may generate the read descriptor 202 and the write descriptor 202 separately. For example, the protocol stack may generate a descriptor for the divided data as the descriptor 202 for reading. Also, the protocol stack may generate the descriptor for division and the descriptor for the payload sum as the write descriptor 202 . Here, the protocol stack may add the transfer lengths of the descriptor for divided data and the descriptor for payload sum as the descriptor 202 for writing, and combine them into one descriptor.

プロトコルスタックは、デスクリプタ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 descriptor 202 , the protocol stack issues an operation transfer instruction to the DMA transfer unit 110 . That is, the protocol stack sets a value indicating the use of the first checksum calculation unit 112 and the memory area for storing the descriptor in the register of the DMA transfer unit 110 . The DMA transfer section 110 determines to use the first checksum calculation section 112 according to the value set in the register. Note that the DMA transfer unit 110 may decide to use the first checksum calculation unit 112 by a method other than determining the value set in the register. For example, the DMA transfer unit 110 detects that it is an operation transfer instruction from the protocol stack from the transaction ID on the system bus 102, the address of the register access source, etc., and uses the first checksum operation unit 112. may be determined. Also, the DMA transfer unit 110 may determine to use the first checksum calculation unit 112 from the combination of the transfer source address and the transfer destination address of the descriptor 202 .

CPU101(プロトコルスタック)から演算転送命令を受けたDMA転送部110において、内部のDMAコントローラ111は、レジスタに設定された値から、メモリ106に格納されているデスクリプタ202を読み込む。続いて、DMAコントローラ111は、デスクリプタ202に記載される転送長の分割データ203を、メモリ106からを読み出す。第1のチェックサム演算部112は、読み出された分割データのペイロードサム204を計算する。ペイロードサム204は、分割データ203の後ろに付加され、DMA転送部110は、デスクリプタ202に従って、これをメモリ107に書き込む。 In the DMA transfer unit 110 that receives an operation transfer command from the CPU 101 (protocol stack), the internal DMA controller 111 reads the descriptor 202 stored in the memory 106 from the value set in the register. Subsequently, the DMA controller 111 reads the divided data 203 of the transfer length written in the descriptor 202 from the memory 106 . The first checksum calculator 112 calculates the payload sum 204 of the read divided data. A payload sum 204 is added to the end of the divided data 203, and the DMA transfer unit 110 writes it to the memory 107 according to the descriptor 202. FIG.

次に、プロトコルスタックは、メモリ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 payload sum 204 stored in memory 107 . The protocol stack then generates a communication header 205 containing an internet checksum corresponding to each piece of data 203 and stores it in memory 107 . Furthermore, the protocol stack generates descriptors for DMA transferring the divided data 203 and the communication header 205 from the memory 107 to the transmission buffer 109 . After generating the descriptor, the protocol stack issues a transfer command to the DMA transfer unit 110 . In response, the DMA transfer unit 110 transfers the divided data 203 and the communication header 205 to the transmission buffer 109 of the communication unit 108 .

通信部108は、送信バッファ109に書き込まれた分割データ203と通信ヘッダ205からなる通信パケット121を、外部機器へ送信する。 The communication unit 108 transmits the communication packet 121 composed of the divided data 203 and the communication header 205 written in the transmission buffer 109 to the external device.

(第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 second checksum calculator 113 in this embodiment. Here, it is assumed that the protocol stack (CPU 101) determines to change the payload length after the datagram from the application is DMA-transferred from the memory 106 to the memory 107 with payload sum calculation. In this case, the payload sum cannot be used to calculate the Internet checksum. The case where the payload length is changed is, for example, the case where datagrams are concatenated or the case where the MSS is changed. In such a case, the operation of the DMA transfer unit 110 using the second checksum calculation unit 113 to calculate the Internet checksum will be described.

まず、アプリケーションからのデータグラムが、メモリ106からメモリ107へDMA転送された後、プロトコルスタックは、ペイロード長を変更すると判断した場合に、演算転送命令の代行をシーケンサ103に通知する。プロトコルスタックは、演算転送命令の代行の依頼と共に、データ分割/連結に関する指示を、シーケンサ103に対して通知する。例えば、プロトコルスタックは、アプリケーションからのデータグラムがMSSよりも小さい場合に、次データと連結可能か否かを判断する。連結可能と判断した場合は、プロトコルスタックは、シーケンサ103に対して、データ連結の指示を、演算転送命令の代行の依頼と共に通知する。また、アプリケーションからデータグラムを転送した時点からMSSが変更になった場合に、プロトコルスタックは、シーケンサ103に対して、新たなMSSでのデータ分割を行うための指示を、演算転送命令の代行の依頼と共に通知する。 First, after the datagram from the application is DMA-transferred from the memory 106 to the memory 107, the protocol stack notifies the sequencer 103 of substitution of the operation transfer instruction when determining to change the payload length. The protocol stack notifies the sequencer 103 of instructions regarding data division/concatenation together with a request for substitution of the operation transfer instruction. For example, when the datagram from the application is smaller than the MSS, the protocol stack determines whether it can be concatenated with the next data. When judging that connection is possible, the protocol stack notifies the sequencer 103 of a data connection instruction together with a request for substitution of the operation transfer instruction. Also, when the MSS is changed from the time the datagram is transferred from the application, the protocol stack instructs the sequencer 103 to divide the data according to the new MSS as a proxy for the operation transfer instruction. Notify with request.

シーケンサ103は、プロトコルスタックからの通知に応じて、データの連結またはデータ分割を行う。続いて、シーケンサ103は、ヘッダ生成ロジック104において、インターネットチェックサム303のフィールドが未計算の通信ヘッダ120を生成し、内部メモリ105に格納する。シーケンサ103はさらに、通信ヘッダ120と、メモリ107に格納されるペイロード302および(第2のチェックサム演算部113により生成される)インターネットチェックサム303を送信バッファへDMA転送するためのデスクリプタ301を生成する。ここで、インターネットチェックサム303に対する転送先アドレスは、DMA転送後の通信ヘッダにおけるチェックサムフィールドを参照させ、通信部108の送信バッファ109への転送完了時に通信パケット121が完成するように設定される。 The sequencer 103 performs data concatenation or data division according to notification from the protocol stack. Subsequently, the sequencer 103 generates the communication header 120 in which the Internet checksum 303 field has not been calculated in the header generation logic 104 and stores it in the internal memory 105 . The sequencer 103 further generates a descriptor 301 for DMA-transferring the communication header 120, the payload 302 stored in the memory 107, and the Internet checksum 303 (generated by the second checksum calculation unit 113) to the transmission buffer. do. Here, the transfer destination address for the Internet checksum 303 refers to the checksum field in the communication header after DMA transfer, and is set so that the communication packet 121 is completed when the transfer to the transmission buffer 109 of the communication unit 108 is completed. .

プロトコルスタックは、デスクリプタ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 descriptor 301 , the protocol stack issues an operation transfer instruction to the DMA transfer unit 110 . That is, the protocol stack sets a value indicating the use of the second checksum calculation unit 113 and the memory area for storing the descriptor 301 in the register of the DMA transfer unit 110 . The DMA transfer unit 110 determines to use the second checksum calculation unit 113 according to the value set in the register. Here, similarly to when the first checksum calculation unit 112 is used, the DMA transfer unit 110 detects that it is an operation transfer instruction from the sequencer 103 by means of the transaction ID on the system bus, the address of the register access source, and the like. Then, it may be determined to use the second checksum calculator 113 . Also, the DMA transfer unit 110 may determine to use the second checksum calculation unit 113 based on the combination of the transfer source address and the transfer destination address of the descriptor 301 .

通信部108は、送信バッファ109に書き込まれたインターネットチェックサム303を含む通信ヘッダ120と、ペイロード302からなる通信パケット121を、外部機器へ送信する。 The communication unit 108 transmits the communication header 120 including the Internet checksum 303 written in the transmission buffer 109 and the communication packet 121 composed of the payload 302 to the external device.

(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 memory 106 to the memory 107 with payload sum calculation will be described.

S400では、プロトコルスタックは、アプリケーションからのデータグラムを、メモリ106から、プロトコルスタックが利用するメモリ107へ、ペイロードサム演算を伴って転送(コピー)する演算転送命令を、DMA転送部110に対して発行する。データグラムの転送時に、データサイズがMSS以上である場合は、MSS単位で分割してDMA転送が行われるものとする。すなわち、MSS単位で分割された分割データに各々に対して、ペイロードサムが計算される。データサイズがMSS以下の場合には、アプリケーションから通知されるデータグラムのサイズで転送が行われる。 In S400, the protocol stack sends an operation transfer instruction to the DMA transfer unit 110 to transfer (copy) the datagram from the application from the memory 106 to the memory 107 used by the protocol stack with the payload sum operation. issue. At the time of datagram transfer, if the data size is greater than or equal to the MSS, the datagram is divided by MSS and DMA transferred. That is, the payload sum is calculated for each piece of divided data divided by MSS. If the data size is less than the MSS, the transfer is performed with the datagram size notified from the application.

S401では、プロトコルスタックは、S400で発行した演算転送命令に対する、DMA転送部110からの演算転送完了の通知を待つ。例えば、プロトコルスタックは、DMA転送部110からの割りこみを待つ。なお、プロトコルスタックは、演算転送完了を、DMAコントローラ111のレジスタをポーリングすることにより、判断してもよい。 In S401, the protocol stack waits for the completion of the operation transfer from the DMA transfer unit 110 in response to the operation transfer instruction issued in S400. For example, the protocol stack waits for an interrupt from DMA transfer section 110 . Note that the protocol stack may determine the completion of operation transfer by polling the registers of the DMA controller 111 .

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 first checksum calculator 112 when transferring data from the memory 106 to refer to each field value on the communication header. to calculate the internet checksum. The protocol stack also writes back the checksum field of the communication header after computing the Internet checksum. At S<b>405 , the protocol stack issues a transfer command to the DMA transfer unit 110 . Subsequently, in S408, the protocol stack waits for a transfer completion notification from the DMA transfer unit 110 for the transfer command. Here, the protocol stack may detect transfer completion either by interrupt or polling.

一方、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 sequencer 103 of the proxy (S406, S407). That is, the protocol stack requests the sequencer 103 to act as a substitute for the operation transfer instruction, and uses the second checksum calculation unit 113 to calculate the Internet checksum. In S408 from S406 or S407, the protocol stack waits for the completion of the operation transfer from the DMA transfer unit 110 in response to the transfer operation instruction from the sequencer 103. FIG. Here, the protocol stack may detect the completion of operation transfer by interrupt or polling.

(DMA転送部110の動作)
図5に、本実施形態におけるDMA転送部110の処理フローチャートを示す。図5は、DMA転送部110が、CPU101(プロトコルスタック)もしくはシーケンサ103から、演算転送命令または転送命令を受信した場合の処理を示すフローチャートである。
(Operation of DMA Transfer Unit 110)
FIG. 5 shows a processing flowchart of the DMA transfer unit 110 in this embodiment. FIG. 5 is a flowchart showing processing when the DMA transfer unit 110 receives an operation transfer command or a transfer command from the CPU 101 (protocol stack) or sequencer 103 .

S500では、DMA転送部110は、受信した命令が演算転送命令か転送命令かを判断する。例えば、DMA転送部110は、第1のチェックサム演算部112と第2のチェックサム演算部113をバイパス設定するレジスタをもち、レジスタに設定された設定値から転送命令か演算転送命令かを判断する。ここで、DMA転送部110は、読み込みのデスクリプタおよび書き込みのデスクリプタにおいて、転送長が2バイト異なる場合に演算転送命令とし、転送長が同じ場合に転送命令と判断してもよい。また、DMA転送部110は、第1のチェックサム演算部112と第2のチェックサム演算部113に対して設定される演算サイズが0となっている場合に、転送命令と判断しても良い。 In S500, the DMA transfer unit 110 determines whether the received instruction is an operation transfer instruction or a transfer instruction. For example, the DMA transfer unit 110 has a register that bypasses the first checksum calculation unit 112 and the second checksum calculation unit 113, and determines whether it is a transfer instruction or an arithmetic transfer instruction from the setting value set in the register. do. Here, the DMA transfer unit 110 may determine that a read descriptor and a write descriptor have transfer lengths different from each other by 2 bytes as an arithmetic transfer instruction, and that transfer lengths are the same as a transfer instruction. Further, the DMA transfer unit 110 may determine that the instruction is a transfer command when the operation size set for the first checksum operation unit 112 and the second checksum operation unit 113 is 0. .

転送命令の場合には(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 DMA transfer unit 110 transfers data between each memory area (memory 106, memory 107, internal memory 105 in sequencer 103, transmission buffer 109 in communication unit 108) based on the descriptor. DMA transfer is performed (S501). On the other hand, in the case of the operation transfer instruction (Yes in S500), in S502, the DMA transfer unit 110 determines whether the operation transfer instruction is from the protocol stack or the sequencer 103 (that is, the operation transfer instruction issuer). to decide. The DMA transfer unit 110 determines the issuing source of the operation transfer instruction, for example, from a combination of the register setting value, the transaction ID on the system bus, the address of the register access source, the transfer source of the descriptor, and the transfer destination address. If the sequencer 103 is the source of the operation transfer instruction (No in S502), the DMA transfer unit 110 uses the second checksum calculation unit 113 to calculate the Internet checksum in S503. Subsequently, in S<b>504 , the DMA transfer unit 110 transfers the communication header, payload, and calculated Internet checksum to the transmission buffer 109 . On the other hand, if the protocol stack is the source of the operation transfer instruction (Yes in S502), the DMA transfer unit 110 uses the first checksum operation unit 112 to calculate the payload sum in S505. In subsequent S506, the DMA transfer unit 110 transfers the payload and payload sum to the memory 107 used by the protocol stack. In S507, the DMA transfer unit 110 notifies the transfer instruction or operation transfer instruction issuer of transfer completion or operation transfer completion.

(各処理ブロックのシーケンスチャート(ペイロード長の変更無しの場合))
図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 CPU 101 generates a descriptor for transferring data from the application. In S<b>601 , the descriptor generated by the CPU 101 is stored in the memory 106 . In S<b>602 , the protocol stack operating on the CPU 101 issues an operation transfer instruction to the DMA transfer unit 110 . In S603, the DMA transfer unit 110 receives the operation transfer instruction, and in subsequent S604, the descriptor is read from the memory 106. FIG. Next, the DMA transfer unit 110 analyzes the read descriptor and reads data from an address in the memory 106 that matches the transfer source address. Subsequently, the first checksum calculator 112 of the DMA transfer unit 110 calculates the payload sum using the read data. When the calculation of the payload sum is completed, in S605, the DMA transfer unit 110 writes the data and payload sum to the address in the memory 107 that matches the transfer destination address in the descriptor. When the data transfer is completed, in S606, the DMA transfer unit 110 notifies the CPU 101 of the completion of the computation data transfer for the computation transfer command.

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 memory 107 at S607, S608. In S609, the protocol stack calculates the Internet checksum by referring to each field value on the communication header from the read payload sum. Subsequently, the protocol stack inserts the calculated Internet checksum into the checksum field of the communication header at S610 and writes the communication packet to memory 107 at S611. Further, the protocol stack generates a descriptor for transferring the communication packet to the transmission buffer 109 of the communication unit 108 and stores it in the memory 106 in S612. After generating the descriptor, the protocol stack issues a transfer command to the DMA transfer unit 110 in S614. The DMA transfer unit 110 having received the transfer command in S615 reads the descriptor from the memory 106 in S616. Subsequently, the DMA transfer unit 110 reads the communication packet from the memory 107 according to the descriptor in S617, and writes the communication packet to the transmission buffer 109 in the communication unit 108 in S618. Finally, in S619, the DMA transfer unit 110 notifies the CPU 101 (protocol stack) of transfer completion.

(各処理ブロックのシーケンスチャート(ペイロード長の変更有りの場合))
図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 first checksum calculator 112 calculates the payload sum.

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 sequencer 103 of a data concatenation instruction in S708 together with a request for substitution of the operation transfer instruction. In step S<b>709 , the sequencer 103 receives the proxy computation notification including the data concatenation instruction, and generates a communication header in the internal memory 105 . Subsequently, in S710, the sequencer 103 generates a descriptor for DMA transfer while calculating an internet checksum from the generated communication header and the payload stored in the memory 107 in S705. In S<b>711 , the sequencer 103 stores the generated descriptor in the memory 106 .

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 sequencer 103 issues an operation transfer instruction to the DMA transfer unit 110 . In S713, the DMA transfer unit 110 is instructed to start the checksum calculation, the address of the descriptor stored in the memory 106, and the DMA transfer by the calculation transfer instruction. The DMA transfer unit 110 accesses the memory 106 in S714, and reads the descriptor from the memory 106 in S715. In S715, the DMA transfer unit 110 starts DMA transfer according to the read descriptor. The DMA transfer unit 110 reads the communication header stored in the internal memory 105 of the sequencer 103 in S717, and reads the data stored in the memory 107 in S716. The DMA transfer unit 110 calculates an internet checksum from the read communication header and data.

S718では、DMA転送部110は、通信パケットとして、通信ヘッダ、データ(ペイロード)、および、インターネットチェックサムを、通信部108内の送信バッファ109に書き込む。この際、DMA転送部110は、インターネットチェックサムを、通信ヘッダ内のチェックサムフィールドに挿入した後に、送信バッファ109に書き込んでもよい。または、DMA転送部110は、送信バッファ109上で、通信ヘッダが書き込まれた後にインターネットチェックサムをチェックサムフィールドに上書きしても良い。 In S718, the DMA transfer unit 110 writes the communication header, data (payload), and Internet checksum to the transmission buffer 109 in the communication unit 108 as a communication packet. At this time, the DMA transfer unit 110 may write the Internet checksum to the transmission buffer 109 after inserting it into the checksum field in the communication header. Alternatively, the DMA transfer unit 110 may overwrite the checksum field with the Internet checksum after the communication header is written on the transmission buffer 109 .

S718の書き込み処理の完了後、DMA転送部110は、シーケンサ103に対して、演算転送完了を通知し、S719において、シーケンサ103が当該通知を受信する。さらに、シーケンサ103は、演算転送完了の通知の受信に伴い、CPU101に対して、演算転送命令の代行完了を通知する。最後に、S720において、CPU101は、演算転送命令の代行完了の通知を受信する。 After the write processing in S718 is completed, the DMA transfer unit 110 notifies the sequencer 103 of the completion of operation transfer, and the sequencer 103 receives the notification in S719. Furthermore, the sequencer 103 notifies the CPU 101 of the completion of the substitution of the operation transfer instruction upon receiving the notification of the operation transfer completion. Finally, in S720, the CPU 101 receives notification of completion of substitution of the operation transfer instruction.

このように、本実施形態によれば、ペイロード長が変更される場合であっても、ハードウェアでインターネットチェックサムの計算を代行することができ、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 sequencer 103 performs Internet checksum calculation instead of the CPU 101 when the payload length is changed during protocol stack processing. In the second embodiment, a case will be described in which the payload length can be changed during retransmission of communication packets in addition to the case where the payload length is changed during protocol stack processing. Differences from the first embodiment will be described below.

(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 sequencer 103 of the substitution of the calculation transfer instruction, and causes the second checksum calculation unit 113 in the DMA transfer unit 110 to calculate the Internet checksum. On the other hand, if a communication packet including the same payload as that at the time of transmission is to be transmitted at the time of retransmission (No in S800), the payload sum can be used. to calculate In subsequent S405, the protocol stack issues a transfer command for DMA-transferring the communication packet to the transmission buffer 109. FIG.

(各処理ブロックのシーケンスチャート(ペイロードの変更有りの場合))
図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 communication unit 108 receives an acknowledgment packet for the transmission packet. In S<b>902 , the protocol stack operating on the CPU 101 analyzes the acknowledgment packet received by the communication unit 108 . Then, the protocol stack detects that the communication partner has not correctly received the data included in the transmission packet from the middle, and determines to perform retransmission that causes a payload change. Subsequently, in S903, the protocol stack determines the data start position for retransmission from the ACK number of the acknowledgment packet. After determining the data start position for retransmission, in S904, the protocol stack requests the sequencer 103 to substitute the operation transfer instruction. At this time, the protocol stack notifies the sequencer 103 of the start position of the data that could not be correctly received by the communication partner. In S<b>905 , the sequencer 103 receives the proxy computation notification and generates a communication header in the internal memory 105 . Subsequently, in S906, the sequencer 103 calculates an internet checksum from the generated communication header and the payload stored in the memory 107, and generates a descriptor for DMA transfer. In S<b>907 , the sequencer 103 stores the generated descriptor in the memory 106 . Here, the address in the memory 106 that matches the data start position notified from the CPU 101 is described in the transfer source address in the descriptor. After storing the descriptor, the sequencer 103 issues an operation transfer instruction to the DMA transfer unit 110 in S908.

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 DMA transfer unit 110 receives the operation transfer command in S908. The DMA transfer unit 110 accesses the memory 106 in S910, and reads the descriptor from the memory 106 in S911. DMA transfer unit 110 in S912. DMA transfer is started according to the read descriptor. The DMA transfer unit 110 reads the communication header stored in the internal memory 105 of the sequencer 103 in S912, and reads the payload into the memory 107 in S913. Here, the address at which reading of the payload specified by the descriptor is started is the start address of the data in the middle that could not be correctly received at the communication partner. The second checksum calculation unit 113 of the DMA transfer unit 110 calculates the Internet checksum from the read communication header and payload according to the register setting at the time of issuing the calculation transfer instruction.

S913では、DMA転送部110は、通信パケットとして、通信ヘッダ、データ(ペイロード)、および、インターネットチェックサムを、通信部108内の送信バッファ109に書き込む。S913の書き込み処理の完了後、DMA転送部110は、シーケンサ103に対して、演算転送命令の完了を通知し、S914において、シーケンサ103が当該通知を受信する。さらに、シーケンサ103は、演算転送命令の通知の受信に伴い、CPU101に対して、演算転送命令の代行完了を通知する。最後に、S915において、CPU101は、演算転送命令の代行完了の通知を受信する。 In S913, the DMA transfer unit 110 writes the communication header, data (payload), and Internet checksum to the transmission buffer 109 in the communication unit 108 as a communication packet. After the write processing in S913 is completed, the DMA transfer unit 110 notifies the sequencer 103 of the completion of the operation transfer instruction, and the sequencer 103 receives the notification in S914. Furthermore, upon receiving the notification of the operation transfer instruction, the sequencer 103 notifies the CPU 101 of completion of the substitution of the operation transfer instruction. Finally, in S<b>915 , the CPU 101 receives notification of completion of substitution of the operation transfer instruction.

このように、本実施形態では、再送時にペイロードの変更があった場合に、DMA転送部110がインターネットチェックサムを演算し、再送パケットを生成することにより、DMA転送中における通信速度の低下を防ぐことが可能となる。なお、DMA転送部110に替えて、プロトコルスタックがインターネットチェックサムを計算して再送パケットを生成するように構成することも可能である。 Thus, in this embodiment, when the payload is changed during retransmission, the DMA transfer unit 110 calculates the Internet checksum and generates a retransmission packet, thereby preventing a decrease in communication speed during DMA transfer. becomes possible. Instead of the DMA transfer unit 110, it is also possible to configure the protocol stack to calculate the Internet checksum and generate a retransmission packet.

[第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 memory 106 to the memory 107 . However, in the UDP protocol that does not involve retransmission, when the DMA transfer unit 110 performs DMA transfer from the memory 106 to the transmission buffer 109, the second checksum calculation unit 113 is used to calculate the Internet checksum, and the communication is performed. Packets may be generated. In addition, in the TCP protocol, if data for retransmission can be managed in the memory 106 by managing the memory area between the application and the protocol stack, a communication packet is configured without transferring (copying) to the memory 107. good too. Also, depending on the type of application that requires data transfer, a communication packet is generated in the transmission buffer 109 (first embodiment), or the communication packet is generated without copying the data to the memory 107 as described above. You can switch whether to generate or not.

[その他の実施形態]
本発明は、上述の実施形態の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つのプロセッサと、アプリケーションからの第1のデータと第2のデータを連結するための連結処理を行うことが可能な制御ハードウェアとを有する通信装置に備えられるDMA(Direct Memory Access)転送装置であって、
前記プロトコルスタックを実行中の前記プロセッサから転送命令を受信した場合に、前記第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.
前記第2のチェックサムの演算は、前記プロセッサが前記第1のデータと前記第2のデータの連結が不要であると判断した場合、前記プロセッサが前記第1のチェックサムをメモリから読み込み、読み込んだ前記第1のチェックサムを用いて前記プロセッサによって行われることを特徴とする請求項1に記載のDMA転送装置。 In calculating the second checksum, if the processor determines that concatenation of the first data and the second data is unnecessary, the processor reads the first checksum from a memory, 2. The DMA transfer device according to claim 1, wherein the transfer is performed by said processor using said read first checksum. 受信した転送命令に基づいて転送元アドレスと前記転送先アドレスとを含む情報を取得する取得手段と、
前記第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の演算手段を選択することを特徴とする請求項3に記載のDMA転送装置。 4. The DMA transfer apparatus according to claim 3, wherein said selection means selects said first arithmetic means or said second arithmetic means based on the issuer of said transfer instruction. 前記第1のチェックサムの演算は、前記第2のチェックサムの演算より計算量が少ないことを特徴とする請求項3又は4に記載のDMA転送装置。 5. The DMA transfer device according to claim 3 , wherein the calculation of said first checksum has a smaller amount of calculation than the calculation of said second checksum. 前記第1のチェックサムの演算は、16ビットワードごとの1の補数和であり、前記第2のチェックサムの演算は、16ビットワードごとの1の補数和の1の補数であることを特徴とする請求項3からのいずれか1項に記載のDMA転送装置。 wherein the first checksum operation is a 1's complement sum for each 16-bit word and the second checksum operation is a 1's complement sum for the 1's complement sum for each 16-bit word 6. The DMA transfer device according to any one of claims 3 to 5 , wherein: 請求項1乃至のいずれか1項に記載のDMA転送装置と、前記少なくとも1つのプロセッサと、前記制御ハードウェアとを備える前記通信装置であって、
前記プロセッサにより前記第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.
請求項1乃至のいずれか1項に記載のDMA転送装置と、前記少なくとも1つのプロセッサと、前記制御ハードウェアとを備える前記通信装置であって、
前記プロセッサにより前記アプリケーションからのデータをパケット化して伝送可能な最大データサイズが変更されていないと判断された場合、前記プロセッサが前記転送命令を前記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.
請求項1乃至のいずれか1項に記載のDMA転送装置と、前記少なくとも1つのプロセッサと、前記制御ハードウェアとを備える前記通信装置であって、
前記アプリケーションからのデータがパケット化された通信パケット送信後において、
前記プロセッサにより当該通信パケットを再送すると判断された場合、前記プロセッサが前記転送命令を前記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.
請求項1乃至のいずれか1項に記載のDMA転送装置と、前記少なくとも1つのプロセッサと、前記制御ハードウェアとを備える前記通信装置であって、
前記アプリケーションからのデータを、前記転送手段が前記転送先アドレスに応じたメモリの領域にコピーする必要がある場合、前記プロセッサが前記転送命令を前記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つのプロセッサと、アプリケーションからの第1のデータと第2のデータを連結するための連結処理を行うことが可能な制御ハードウェアとを有する通信装置に備えられるDMA(Direct Memory Access)転送装置の制御方法であって、
前記プロトコルスタックを実行中の前記プロセッサから転送命令を受信した場合に、前記第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.
JP2017238920A 2017-12-13 2017-12-13 DMA TRANSFER DEVICE, DMA TRANSFER CONTROL METHOD, AND COMMUNICATION DEVICE Active JP7145607B2 (en)

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)

Citations (4)

* Cited by examiner, † Cited by third party
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 unit, arithmetic method and communication apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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 unit, 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
US7864806B2 (en) Method and system for transmission control packet (TCP) segmentation offload
US7707477B2 (en) Checksum calculation
JP4344576B2 (en) Packet communication device
WO2014180110A9 (en) Data processing apparatus and data processing method
JP5482230B2 (en) COMMUNICATION DEVICE, INFORMATION PROCESSING DEVICE, COMMUNICATION DEVICE CONTROL METHOD, AND CONTROL PROGRAM
EP3542276A1 (en) Flow control in remote direct memory access data communications with mirroring of ring buffers
US11336297B2 (en) DMA transfer apparatus, method of controlling the same, communication apparatus, method of controlling the same, and non-transitory computer-readable storage medium
JP4786575B2 (en) Data transfer method between computer and network interface controller, program, and network interface controller
JP2005167965A (en) Packet processing method and apparatus
JP7145607B2 (en) DMA TRANSFER DEVICE, DMA TRANSFER CONTROL METHOD, AND COMMUNICATION DEVICE
CN113422792A (en) Data transmission method and device, electronic equipment and computer storage medium
KR100576721B1 (en) Network card having zero-copy transmission function, server and method thereof
JP2007329730A (en) Communication protocol processor
JP6938399B2 (en) Communication equipment, communication methods and programs
JP2021036630A (en) Communication device, control method, and program
JP4519090B2 (en) Transmitting apparatus, receiving apparatus and methods thereof
JP7005303B2 (en) Communication equipment, packet generators and their control methods
JP6567476B2 (en) Data processing device
JP2018173856A (en) Information processor and method for controlling the same
JP6976786B2 (en) Communication device and control method of communication device
JP2019153214A (en) Communication device and control method
JP2021129162A (en) Communication device, control method, and program

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