WO2021181897A1 - 通信装置、通信装置の制御方法、および集積回路 - Google Patents

通信装置、通信装置の制御方法、および集積回路 Download PDF

Info

Publication number
WO2021181897A1
WO2021181897A1 PCT/JP2021/001753 JP2021001753W WO2021181897A1 WO 2021181897 A1 WO2021181897 A1 WO 2021181897A1 JP 2021001753 W JP2021001753 W JP 2021001753W WO 2021181897 A1 WO2021181897 A1 WO 2021181897A1
Authority
WO
WIPO (PCT)
Prior art keywords
priority
data
transfer
received data
communication device
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.)
Ceased
Application number
PCT/JP2021/001753
Other languages
English (en)
French (fr)
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.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
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 Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Publication of WO2021181897A1 publication Critical patent/WO2021181897A1/ja
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14—Handling requests for interconnection or transfer
    • G06F13/36—Handling requests for interconnection or transfer for access to common bus or bus system
    • G06F13/362—Handling requests for interconnection or transfer for access to common bus or bus system with centralised access control
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14—Handling requests for interconnection or transfer
    • G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28—Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal

Definitions

  • the present invention relates to a communication device in which the processing order is prioritized.
  • EtherCAT registered trademark
  • TSN Time Sensitive Network
  • the control data needs to have low delay and small jitter, and the control data needs to communicate with high priority over the large amount of information data.
  • a process of changing the processing order of received data is known as a prior art.
  • Patent Document 1 discloses a technique for distributing received data to a plurality of data buffers based on field information in the received data. Further, Patent Document 2 discloses a packet processing apparatus in which priority is taken into consideration by analyzing packets and allocating packets according to whether or not a delay is acceptable.
  • the above-mentioned conventional technique has a problem that the reception processing of high-priority data is delayed due to the started low-priority data reception processing.
  • a system that requires real-time performance such as an industrial control device, it is preferable that there is no slight delay or timing lag.
  • An object of the present invention is to be able to arbitrate the transfer order of received data in order of priority, and to enable low-delay transfer processing for received data of high priority.
  • the communication device includes a reception queue, and one reception queue includes a priority determination unit that determines the priority of received data received from the network, a buffer that stores the reception data, and the like.
  • the buffer has the first priority.
  • the transfer unit is stopped from transferring the first priority received data, and the second priority received data is transferred to the main memory. It is provided with a transfer arbitration unit for starting the operation.
  • the control method of the communication device is a control method of a communication device including a reception queue having a buffer for storing received data received from the network, and is a priority for determining the priority of the received data.
  • a determination step, a transfer step of transferring the received data stored in the buffer to the main memory, and a transfer step of transferring the received data of the first priority to the main memory, the buffer has the first priority.
  • the transfer of the received data of the first priority is stopped and the transfer of the received data of the second priority to the main memory is started. Includes mediation steps and.
  • the transfer order of received data can be arbitrated in order of priority, and low-delay transfer processing is possible for received data with high priority.
  • FIG. 1 is a block diagram showing components of the information processing apparatus of the present embodiment.
  • the information processing device 1 includes a communication device 2, a CPU (central processing unit) 3, and a main memory 4.
  • the transfer of the received data from the communication device 2 to the main memory 4 may cause the transfer of the received data received from the network to be awaited later.
  • the communication device 2 of the present embodiment transfers (receives) the first data when the second data having a higher priority is received while the first data having a lower priority is being transferred to the main memory. Processing) is interrupted, and the second data transfer processing is performed. Therefore, it is possible to realize low-delay processing by interrupting and receiving data having a higher priority than in the conventional technique of simply starting the transfer processing in the order of priority.
  • FIG. 1 is a block diagram showing components of the information processing apparatus of the present embodiment.
  • the information processing device 1 includes a communication device 2, a CPU (central processing unit) 3, and a main memory 4.
  • the communication device 2 (communication controller) includes a transmission / reception port 21, a reception queue 22, a priority storage unit 23, and an interface 24.
  • the communication device 2 is hardware that performs data reception processing.
  • the communication device 2 is, for example, a network interface card (NIC), and is an integrated circuit in which a logic circuit is formed, which is composed of an ASIC (Application Specific Integrated Circuit) or an FPGA (Field-Programmable Gate Array).
  • the communication device 2 has a function of prioritizing and communicating received data.
  • the transmission / reception port 21 is a part that actually transmits / receives data (transmission data / reception data) from a plurality of external devices via a network.
  • Ethernet registered trademark
  • the network may be a network such as EtherCAT, EtherCAT G, or TSN.
  • a plurality of networks may be connected to the transmission / reception port 21 via a branch controller.
  • the external device has a plurality of priorities, and the priorities differ depending on the external device.
  • a high-priority external device that should send and receive control data with a low delay such as sensor input or valve control, and a delay that should send and receive a large amount of information data such as an image processing device are allowed.
  • the reception queue 22 functions as a buffer for temporarily storing received data and writing it to the main memory 4.
  • the priority storage unit 23 stores a plurality of source addresses and a plurality of priorities in association with each other.
  • the interface 24 communicates with the CPU 3 and the main memory 4.
  • the reception queue 22 has a priority determination unit 221, a plurality of data buffers (buffers) 222, a transfer arbitration unit 223, a DMAC (transfer unit) 224, and a descriptor buffer 225.
  • the priority determination unit 221 determines the priority based on the header of the received data, and stores the received data in the data buffer 222 of the corresponding priority.
  • the data buffer 222 functions as a buffer for storing received data and transferring the received data to the main memory 4. There are a plurality of data buffers 222, from those having a high reception priority (data buffer 0) to those having a low reception priority (data buffer n).
  • the transfer arbitration unit 223 has a function of arbitrating the processing order of data transfer of the received data stored in the data buffer 222 to the main memory 4 based on the priority.
  • the DMAC224 can access the main memory 4 by a DMA (Direct Memory Access) method.
  • the DMAC 224 acquires a receive descriptor from the descriptor buffer 225.
  • the DMAC 224 transfers the data stored in the data buffer 222 to the main memory 4 via the interface 24 based on the reception descriptor.
  • the descriptor buffer 225 acquires a plurality of receive descriptors from the main memory 4 in advance.
  • the CPU 3 operates the OS (Operating System) 31 and the driver 32.
  • the CPU 3 is a processor (hardware) that operates software, and operates a FW.
  • the driver 32 is software that mediates between software and hardware.
  • the main memory 4 includes a reception descriptor area 41 and a reception data area 42.
  • the reception descriptor includes information indicating an address in the reception data area 42 of the main memory 4 in which the reception data should be stored.
  • the main memory 4 is an area for storing data processed or used by the CPU 3, for example, DRAM (Dynamic Random Access Memory), SRAM (Static Random Access Memory), SDRAM (Synchronous Dynamic Random Access Memory), SSD. (SolidStateDrive), HDD (HardDiscDrive), or a storage device such as an SD card.
  • the receiving descriptor area 41 is a data area for storing a plurality of receiving descriptors.
  • the received data area 42 is a data area for storing a plurality of received data.
  • FIG. 2 is a diagram showing a data structure of a received descriptor and received data.
  • the receive descriptor 5 includes a buffer address area 51, a reception completion flag area 52, and a reserved area 54.
  • the buffer address area 51 includes information indicating the address of the main memory 4 (the address in the received data area 42) in which the received data 6 should be stored.
  • the reception completion flag area 52 is an area including information indicating whether or not the reception data 6 has been transferred from the reception queue 22 to the main memory 4.
  • the reserved area 54 includes other information necessary for communication and a spare area.
  • Received data 6 is an Ethernet (registered trademark) frame.
  • the received data 6 includes a header 60 and an IP frame 61.
  • the header 60 of the received data 6 includes a source MAC address area 62 and a reserved area 63.
  • the IP frame 61 of the received data 6 includes a header 64 and a data area 67.
  • the header 64 of the IP frame 61 includes a source IP address area 65 and a reserved area 66.
  • the source MAC address area 62 is an area including the MAC address of the source external device.
  • the source IP address area 65 is an area including the IP address of the external device of the source.
  • Reserved areas 63 and 66 include other information necessary for communication and a spare area. A protocol is adopted in which reception is established if either the source MAC address area 62 or the source IP address area 65 is set.
  • the CPU 3 sets a plurality of source addresses and a plurality of priorities in association with each other in advance in the priority storage unit 23 via the interface 24 of the communication device 2.
  • the source address may be a MAC address, an IP address, and / or other network-specific address. Further, when the destination address is an IP address, it may correspond to IPv6.
  • the CPU 3 saves the one arbitrarily set by the user on the upper computer in the main memory 4.
  • the relationship between the source and the priority is read from the main memory 4 into the communication device 2 when the communication device 2 is initialized.
  • the driver 32 prepares a plurality of receiving descriptors in the receiving descriptor area 41 of the main memory 4 in advance.
  • the receive descriptor 5 of the main memory 4 is consumed by the reception process by the communication device 2.
  • One receive descriptor 5 is used to write one receive data 6 to the main memory 4.
  • FIG. 3 is an operation flowchart of the communication device.
  • the reception queue 22 acquires the reception descriptor 5 in advance from the reception descriptor area 41 of the main memory 4 via the interface 24. At this time, a plurality of receiving descriptors 5 may be acquired in advance.
  • the receive queue 22 stores the acquired receive descriptor 5 in the descriptor buffer 225.
  • the transmission / reception port 21 When the transmission / reception port 21 receives the reception data 6 (packet) from the network, the transmission / reception port 21 outputs the reception data 6 to the reception queue 22.
  • the priority determination unit 221 of the reception queue 22 acquires the source MAC address and / or the source IP address from the source MAC address area 62 and / or the source IP address area 65 of the received data 6.
  • the priority determination unit 221 acquires information indicating the relationship between the source address (source MAC address and / or source IP address) and the priority from the priority storage unit 23, and receives the information from the source address.
  • the priority of the received data 6 is determined (S21).
  • the priority determination unit 221 stores (distributes) the received data 6 in the data buffer 222 corresponding to the determined priority (S22).
  • the data buffer 222 is a data buffer having a first-in first-out structure, stores data at the end, and retrieves data from the beginning. Further, the data buffer 222 has a function of holding the entire received data without erasing the data even if the data is taken out halfway until the transfer of the received data 6 to the main memory 4 is completed.
  • an example of the data buffer 222 is a ring buffer capable of holding n pieces of data.
  • the ring buffer has HEAD and TAIL as reference indexes.
  • HEAD indicates the start address of the data currently being transferred or transferred next
  • TAIL indicates the end address of the untransferred data.
  • the TAIL address is added according to the data length of the received data 6.
  • the transfer arbitration unit 223 reads the received data 6 from the data buffer 222 having the highest priority among the one or more data buffers 222 storing the received data 6.
  • the transfer arbitration unit 223 outputs the received data 6 to the DMAC224 and instructs the DMAC224 to transfer the data.
  • the DMAC 224 acquires one receive descriptor 5 from the descriptor buffer 225.
  • the DMAC224 starts transferring the reception data 6 having the highest priority to the main memory 4 based on the reception descriptor 5 (S23). As a result, the DMAC 224 writes the received data 6 to the address of the received data area 42 of the main memory 4 indicated by the receiving descriptor 5.
  • the transfer arbitration unit 223 causes the DMAC224 to transfer the received data 6 of the data buffer having the highest priority and the data buffer is not empty.
  • the data buffer 222 stores the HEAD value before the transfer when the transfer is started.
  • the TAIL increases, and the TAIL catches up with the saved HEAD, the reception process is interrupted until the ring buffer becomes full and the ring buffer becomes free.
  • the data buffer 222 keeps holding the entire received data 6 until the transfer of the received data 6 to the main memory 4 is completed.
  • the transfer arbitration unit 223 monitors whether or not a data buffer other than the transfer source has received the received data 6 even during data transfer to the main memory 4 (S24).
  • the received data 6 being transferred is used as the first data.
  • the DMAC 224 writes information (transfer completion flag) indicating that the received data 6 has been transferred to the reception descriptor area 41 (S27).
  • the second data is the first data in the transfer arbitration unit 223. It is determined whether or not the priority is higher than that (S25).
  • the transfer arbitration unit 223 causes the DMAC224 to continue the transfer of the first data.
  • the process proceeds to S27.
  • the transfer arbitration unit 223 When the priority of the second data is higher than the priority of the first data being transferred (Yes in S25), the transfer arbitration unit 223 immediately causes the DMAC224 and the data buffer 222 to stop the transfer of the first data.
  • the data buffer 222 that stores the first data overwrites the HEAD value before transfer with the HEAD.
  • the entire first data including the amount already read and transferred is restored to the data buffer 222 (S26). Therefore, the entire first data can be read again later.
  • the transfer arbitration unit 223 causes the DMAC 224 to start transferring the second data having the highest priority to the main memory 4 (S23). At this time, the DMAC224, which has been instructed by the transfer arbitration unit 223 to start transferring the second data, reuses the receiving descriptor used for transferring the first data.
  • the DMAC224 transfers the second data to the reception data area 42 of the main memory 4 by using the reception descriptor used for the transfer of the first data again. Since the reused reception descriptor points to the address of the same reception data area 42, the first data written in the reception data area 42 halfway is overwritten by the second data.
  • the DMAC 224 acquires another receive descriptor 5 from the descriptor buffer 225, and uses the other receive descriptor 5 to transfer the next higher priority received data 6 (first data). .. Since the receive descriptor 5 is reused, the OS 31 does not need to consider that the transfer order has been changed, and the load of memory management can be reduced.
  • the communication device 2 when the communication device 2 receives the received data 6 having a higher priority, the communication device 2 stops the transfer of the received data 6 having a lower priority and starts the transfer of the received data 6 having a higher priority.
  • FIG. 4 shows a timing chart of transfer of received data.
  • medium priority data 81a, low priority data 82a, and high priority data 83a are input to the communication device 2 via the network in this order as received data.
  • the communication speed from the network to the communication device 2 is faster than the transfer speed from the communication device 2 to the main memory 4. Therefore, the time required to transfer the received medium-priority data 81a, low-priority data 82a, and high-priority data 83a to the main memory 4 is the medium-priority data 81b, low-priority data 82b, and high-priority data 83a, respectively. It becomes longer as shown in the degree data 83b.
  • the medium priority data 81b, the low priority data 82b, and the high priority data 83b are shown to overlap each other, they are actually transferred one by one.
  • the communication device 2 when the communication device 2 receives the medium priority data 81a, the communication device 2 starts transferring the medium priority data to the main memory 4 as shown by reference numeral 81c.
  • the communication device 2 receives the low priority data 82a during the transfer of the medium priority data 81c, but continues the transfer of the medium priority data 81c.
  • the communication device 2 receives the high priority data 83a during the transfer of the medium priority data 81c.
  • the high priority data 83a has a higher priority than the medium priority data 81c being transferred. Therefore, the communication device 2 cancels (cancels) the transfer of the medium priority data 81c. Then, the communication device 2 starts transferring the high priority data to the main memory 4 as shown by reference numeral 83c.
  • the communication device 2 completes the transfer of the high priority data 83c.
  • the communication device 2 starts transferring the medium-priority data having a higher priority among the already received medium-priority data 81a and the low-priority data 82a to the main memory 4 (reference numeral 81d). In this way, the communication device 2 transfers the medium priority data whose transfer has been stopped again from the beginning of the data.
  • the communication device 2 completes the transfer of the medium priority data 81d.
  • the communication device 2 starts transferring the already received low priority data 82a to the main memory 4 (reference numeral 82c).
  • the communication device 2 even when the received data 6 having three or more different priorities is received, the transfer of the received data having a higher priority to the main memory 4 can be prioritized. Due to the low priority received data (low priority data 82a, medium priority data 81a), it is possible to avoid waiting for the transfer of the higher priority received data (high priority data 83a). Therefore, the communication device 2 can quickly process received data such as control data to be received at a fixed cycle, and can improve real-time performance.
  • FIG. 5 is a timing chart for explaining the processing order of the received data between the operation example 1 and the reference example 1 of the embodiment.
  • the communication device transfers data to the main memory at the same time as receiving the data. It is assumed that this is a model case in which the priority is two stages, and the communication device 2 receives the low priority data 71a and the high priority data 72a in order. It is assumed that the high priority data 72a is received before the transfer processing of the low priority data 71a to the main memory 4 is completed.
  • Reference example 1 The communication device of Reference Example 1 mediates the transfer order of the received received data, but does not start the high-priority received data transfer until the transfer of the low-priority received data is interrupted.
  • the communication device starts transferring the low priority data 71b.
  • the communication device receives the high priority data 72a.
  • the communication device cannot immediately transfer the high priority data 72a.
  • the communication device starts transferring the high priority data 72a to the main memory (reference numeral 72b). Therefore, a delay occurs from the reception of the high priority data 72a to the start of transfer of the high priority data 72b.
  • the priority is determined from the source address of the packet, and the corresponding priority is given.
  • the received data 6 is distributed to the data buffer 222 of the degree.
  • the transfer arbitration unit 223 controls the transfer order and transfers the received data 6 to the main memory 4. At this time, if the received data 6 is distributed to the data buffer 222 having a higher priority than the received data 6 being transferred, the transfer is interrupted and the transfer of the high priority received data 6 is immediately started.
  • the received data having a higher priority is stored in the data buffer than in the conventional technique in which the priority distribution is performed by a plurality of reception queues having different priorities to perform reception processing.
  • the residence time is short, and low-delay processing can be realized.
  • the communication device 2 of the present embodiment arbitrates the transfer order of received data of a plurality of priorities in one reception queue 22. Therefore, it is possible to suppress an increase in the receive queue and the receive descriptor area, reduce the processing load of the CPU 3, and reduce the delay.
  • the transfer of the low priority data 71c is started almost at the same time as the reception of the low priority data 71a.
  • the high priority data 72a is received during the transfer of the low priority data 71c.
  • the transfer of the low priority data 71c is interrupted, the transferred data is discarded, and the transfer of the high priority data 72c is started immediately.
  • discarding the data means that the transferred data (a part of the received data) is not retained in the main memory 4 and is overwritten with the high priority data 72c.
  • the low priority data 71a discarded earlier is transferred to the main memory again. Therefore, the processing order is changed and high priority data can be transferred without delay, and real-time performance is improved.
  • the transfer timing is not limited to this, and the storage of the entire received data 6 in the data buffer 222 is completed when the reception is completed. After that), the transfer to the main memory 4 may be started.
  • FIG. 6 is a timing chart for explaining the processing order of the received data between the operation example 2 and the reference example 2 of the second embodiment. It is assumed that this is a model case in which the priority is two stages, and the communication device 2 receives the low priority data 71a and the high priority data 72a in order. Regarding the high priority data 72a, it is assumed that the reception of the low priority data 71a is completed (the storage in the data buffer 222 is completed) before the transfer processing to the main memory is completed.
  • the communication device starts transferring the low priority data 71e to the main memory at the same time as receiving the entire low priority data 71a.
  • the reception of the entire high priority data 72a is completed (storage in the data buffer is completed), but since it is occupied by the transfer of the low priority data 71e, the high priority data 71e is transferred.
  • the transfer of 72a cannot be started.
  • the high priority data 72e is transferred to the main memory. Therefore, the transfer of the high priority data 72e is delayed.
  • the communication device 2 starts transferring the low priority data 71f to the main memory 4 at the same time as the reception of the entire low priority data 71a is completed.
  • the communication device 2 completes the reception of the entire high priority data 72a (the storage in the data buffer is completed) during the transfer of the low priority data 71f. Since the priority of the received high priority data is higher than the priority of the low priority data being transferred, the communication device 2 immediately interrupts the transfer of the low priority data and discards the transferred data. .. After that, the communication device 2 starts transferring the high priority data 72a to the main memory 4 (reference numeral 72f). After the transfer of the high priority data 72f is completed, the entire interrupted low priority data 71g is transferred again. Therefore, the processing order is changed and high priority data can be transferred without delay.
  • the present embodiment has an advantage that even if there is a data loss due to noise or the like during reception, the communication device 2 can confirm and replenish the data loss and then transfer the data.
  • the priority determination unit 221 determines the priority based on the source address described in the source MAC address area 62 or the source IP address area 65 or the reserved areas 63 and 66 of the received data. I have done it, but this is not the case.
  • priority information indicating the priority of the received data 6 may be described in the reserved areas 63 and 66 of the received data 6.
  • the priority determination unit 221 determines the priority based on the priority information included in the received data 6.
  • the priority storage unit 23 can be omitted. As a result, different priorities can be set among the plurality of received data 6 from the same external device.
  • one receive queue 22 has a plurality of data buffers 222 according to a plurality of priorities, but the present invention is not limited to this.
  • One receive queue has one data buffer, and received data of a plurality of priorities may be stored in one data buffer.
  • the data buffer is not first-in first-out, and the transfer arbitrator can take out received data from the data buffer in any order according to the priority.
  • the communication device includes a reception queue, and one reception queue includes a priority determination unit that determines the priority of received data received from the network, a buffer that stores the reception data, and the like.
  • the buffer has the first priority.
  • the transfer unit is stopped from transferring the first priority received data, and the second priority received data is transferred to the main memory. It is provided with a transfer arbitration unit for starting the operation.
  • the transfer order of received data can be arbitrated in order of priority, and for high priority received data, real-time transfer processing with low delay and no timing variation is possible.
  • the buffer may include a first buffer for storing the reception data of the first priority and a second buffer for storing the reception data of the second priority.
  • a plurality of buffers can be prepared for each priority, and the hardware configuration becomes easy.
  • the transfer unit acquires a reception descriptor from the reception descriptor area of the main memory and transfers the received data to the data area of the main memory indicated by the reception descriptor, and the transfer unit is the transfer mediation unit.
  • the transfer unit is the transfer mediation unit.
  • the receiving descriptor can be reused, and the OS (Operating System) does not need to perform processing according to the transfer cancellation. Therefore, memory management by the OS becomes easy.
  • the first buffer may continue to hold the entire received data of the first priority until the transfer of the received data of the first priority to the main memory is completed.
  • the retransfer of the low priority received data interrupted by the high priority received data can be retransmitted from the beginning of the data instead of being retransmitted from the middle of the data. Inconsistency can be prevented and the system can be simplified.
  • the priority determination unit may determine the priority of the received data based on the source address of the received data.
  • the received data includes priority information
  • the priority determination unit may determine the priority of the received data based on the priority information.
  • the source can actively set the priority regardless of the source address.
  • the control method of the communication device is a control method of a communication device including a reception queue having a buffer for storing received data received from the network, and is a priority for determining the priority of the received data.
  • a determination step, a transfer step of transferring the received data stored in the buffer to the main memory, and a transfer step of transferring the received data of the first priority to the main memory, the buffer has the first priority.
  • the transfer of the received data of the first priority is stopped and the transfer of the received data of the second priority to the main memory is started. Includes mediation steps and.
  • the integrated circuit that functions as the communication device may be formed with a hardware logic circuit that functions as the priority determination unit, the buffer, and the transfer arbitration unit.

Landscapes

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

Abstract

通信装置の優先度の振分処理をハードウェアで行い、低遅延な通信を実現する。通信装置(2)は、受信キュー(22)を備える。受信キューは、ネットワークから受信されデータバッファ(222)に格納されている受信データを主メモリ(4)に転送するDMAC(224)と、DMACが第1優先度の受信データを転送しているときに、データバッファが第1優先度より優先度が高い第2優先度の受信データを受信すると、第1優先度の受信データの転送を中止させ、第2優先度の受信データの転送を開始させる転送調停部(223)と、を備える。

Description

通信装置、通信装置の制御方法、および集積回路
 本発明は、処理順を優先度順にする通信装置に関する。
 従来、産業用制御装置に用いられる通信手段は多数あり、EtherCAT(登録商標)などが多く用いられてきている。データ容量の増加またはリアルタイム性の向上の為に、Gigabpsに対応したEtherCAT Gへの対応または、Time Sensitive Network(以下、TSN)への対応が求められている。更に、一定周期での制御データの通信と、不定期での情報データの通信とが混在した通信規格が求められている。
 制御データは低遅延、小ジッターである必要があり、大容量の情報データよりも、制御データは高優先に通信を行う必要がある。この通信を実現するため、受信データの処理順を、入れ替える処理が従来技術として知られている。
 特許文献1に、受信データ内のフィールド情報に基づき、受信データを複数あるデータバッファに振り分ける技術が開示されている。また、特許文献2に、パケットを分析し、遅延を許容可能なものかどうかでパケットを振り分けることで、優先度を考慮したパケット処理装置が開示されている。
日本国公開特許公報特開2007-243382号公報 日本国公開特許公報特開2016-046669号公報
 しかしながら、上述のような従来技術は、開始された低優先度のデータの受信処理によって、高優先度のデータの受信処理が遅延する課題がある。産業用制御装置のように、リアルタイム性が必要なシステムでは、軽微な遅延またはタイミングのずれであっても無い方が好ましい。
 本発明の一様態は、優先度順に受信データの転送順を調停でき、かつ高優先度の受信データに関しては、低遅延の転送処理を可能にすることを目的とする。
 本発明の一様態に係る通信装置は、受信キューを備え、1つの前記受信キューは、ネットワークから受信した受信データの優先度を判定する優先度判定部と、前記受信データを格納するバッファと、前記バッファに格納されている前記受信データを主メモリに転送する転送部と、前記転送部が第1優先度の受信データを前記主メモリに転送しているときに、前記バッファが前記第1優先度より優先度が高い第2優先度の受信データを受信すると、前記転送部に前記第1優先度の受信データの転送を中止させ、前記第2優先度の受信データの前記主メモリへの転送を開始させる転送調停部と、を備える。
 本発明の一様態に係る通信装置の制御方法は、ネットワークから受信した受信データを格納するバッファを有する受信キューを備える通信装置の制御方法であって、前記受信データの優先度を判定する優先度判定ステップと、前記バッファに格納されている前記受信データを主メモリに転送する転送ステップと、第1優先度の受信データを前記主メモリに転送しているときに、前記バッファが前記第1優先度より優先度が高い第2優先度の受信データを受信すると、前記第1優先度の受信データの転送を中止させ、前記第2優先度の受信データの前記主メモリへの転送を開始させる受信調停ステップと、を含んでいる。
 本発明の一様態によれば、優先度順に受信データの転送順を調停でき、かつ高優先度の受信データに関しては、低遅延の転送処理が可能である。
本発明の一実施形態に係る情報処理装置の構成要素を示すブロック図である。 本発明の一実施形態に係る受信ディスクリプタと受信データのデータ構造を示す図である。 通信装置の動作フローチャートである。 受信データの転送のタイミングチャートを示す。 本発明の一実施形態の動作例と参考例との受信データの処理順を説明するタイミングチャートである。 本発明の一実施形態の動作例と参考例との受信データの処理順を説明するタイミングチャートである。
 〔実施形態1〕
 §1 適用例
 図1は、本実施形態の情報処理装置の構成要素を示すブロック図である。情報処理装置1は、通信装置2と、CPU(中央演算処理装置)3と、主メモリ4と、を備える。
 受信データを優先度によって並び替えて受信する場合において、ただ並び替えただけでは遅延が発生する。特にネットワークの通信速度が向上すると、通信装置2から主メモリ4への受信データの転送によって、後にネットワークから受信された受信データの転送が待たされる事態が発生し得る。
 そこで、本実施形態の通信装置2は、優先度が低い第1データを主メモリへ転送している時に、より優先度が高い第2データを受信した場合は、第1データの転送処理(受信処理)を中断し、第2データの転送処理を行う。そのため、単に優先度順に転送処理を開始する従来技術よりも、優先度の高いデータの受信で割り込んで受信することで、低遅延な処理が実現できる。
 §2 構成例
 〔情報処理装置の機能構成〕
 図1は、本実施形態の情報処理装置の構成要素を示すブロック図である。情報処理装置1は、通信装置2と、CPU(中央演算処理装置)3と、主メモリ4と、を備える。
 通信装置2(通信コントローラ)は、送受信ポート21と、受信キュー22と、優先度記憶部23と、インタフェース24と、を備える。通信装置2は、データの受信処理を行うハードウェアである。通信装置2は、例えばネットワークインタフェースカード(NIC)であり、ASIC(Application Specific Integrated Circuit)、またはFPGA(Field-Programmable Gate Array)で構成された、論理回路が形成された集積回路である。通信装置2は、受信データに優先度をつけ通信する機能を有する。
 送受信ポート21は、実際にデータ(送信データ/受信データ)を、ネットワークを介して複数の外部装置から送受信する部位である。ここでは、ネットワークとしてEthernet(登録商標)を想定した例を説明するが、これに限らない。ネットワークは、EtherCAT、EtherCAT G、またはTSN等のネットワークであってもよい。複数のネットワークがブランチコントローラを介して送受信ポート21に接続されていてもよい。外部装置としては、複数の優先度があり、外部装置に応じて優先度は異なる。外部装置としては、センサ入力、またはバルブ制御などの低遅延で定周期の制御データを送受信すべき高優先度の外部装置と、画像処理装置などの大容量の情報データを送受信すべき遅延を許した低優先度の外部装置とがある。
 受信キュー22は、受信データを仮保存し、主メモリ4に書き込むまでのバッファとして機能する。優先度記憶部23は、複数の送信元アドレスと複数の優先度とを互いに関連付けて記憶する。インタフェース24は、CPU3と主メモリ4と通信する。
 受信キュー22は、優先度判定部221と、複数のデータバッファ(バッファ)222と、転送調停部223と、DMAC(転送部)224と、ディスクリプタバッファ225と、を有する。優先度判定部221は、受信データのヘッダに基づいて優先度を判定し、該当の優先度のデータバッファ222に受信データを格納する。データバッファ222は、受信データを保存しておき、主メモリ4に転送する際のバッファとして機能する。データバッファ222は、受信優先度が高優先度(データバッファ0)のものから低優先度(データバッファn)のものまで複数ある。転送調停部223は、データバッファ222に格納されている受信データの主メモリ4へのデータ転送の処理順を、優先度に基づいて調停する機能をもつ。DMAC224は、DMA(Direct Memory Access)方式により主メモリ4にアクセスできる。DMAC224は、ディスクリプタバッファ225から受信ディスクリプタを取得する。DMAC224は、データバッファ222に格納されたデータを、インタフェース24を介して、受信ディスクリプタに基づいて主メモリ4に転送する。ディスクリプタバッファ225は、あらかじめ主メモリ4から複数の受信ディスクリプタを取得しておく。
 CPU3は、OS(Operating System)31と、ドライバ32と、を動作させる。CPU3はソフトウェアを動作させるプロセッサ(ハードウェア)で、FWを動作させている。
 OS31上でソフトウェア(アプリケーション)が動作する。ドライバ32は、ソフトウェアとハードウェアの仲立ちをするソフトウェアである。
 主メモリ4は、受信ディスクリプタ領域41と、受信データ領域42と、を含む。受信ディスクリプタは、受信データを格納すべき主メモリ4の受信データ領域42におけるアドレスを示す情報を含む。
 主メモリ4は、CPU3が処理したまたは処理に用いるデータを保存しておく領域であり、例えばDRAM(Dynamic Random Access Memory)、SRAM(Static Random Access Memory)、SDRAM(Synchronous Dynamic Random Access Memory)、SSD(Solid State Drive)、HDD(Hard Disc Drive)、またはSDカードなどの記憶装置である。受信ディスクリプタ領域41は、受信ディスクリプタを複数格納しておくデータ領域である。受信データ領域42は、受信データを複数格納しておくデータ領域である。
 図2は、受信ディスクリプタと受信データのデータ構造を示す図である。受信ディスクリプタ5は、バッファアドレス領域51と、受信完了フラグ領域52と、予約領域54と、を含む。バッファアドレス領域51は、受信データ6を格納すべき主メモリ4のアドレス(受信データ領域42におけるアドレス)を示す情報を含む。受信完了フラグ領域52は、受信キュー22から主メモリ4に受信データ6を転送されたか否かを示す情報を含む領域である。予約領域54は、その他通信に必要な情報および予備領域を含む。
 受信データ6はEthernet(登録商標)フレームである。受信データ6は、ヘッダ60と、IPフレーム61と、を含む。受信データ6のヘッダ60は、送信元MACアドレス領域62と、予約領域63と、を含む。受信データ6のIPフレーム61は、ヘッダ64と、データ領域67と、を含む。IPフレーム61のヘッダ64は、送信元IPアドレス領域65と予約領域66とを含む。送信元MACアドレス領域62は、送信元の外部装置のMACアドレスを含む領域である。送信元IPアドレス領域65は、送信元の外部装置のIPアドレスを含む領域である。予約領域63、66は、その他通信に必要な情報および予備領域を含む。送信元MACアドレス領域62と送信元IPアドレス領域65とのいずれか一方でも設定されていれば受信は成立するプロトコルを採用している。
 §3 動作例
 CPU3は、通信装置2のインタフェース24を介して、予め優先度記憶部23に複数の送信元アドレスと複数の優先度とを互いに関連付けて設定する。送信元アドレスとしては、MACアドレス、IPアドレス、および/またはその他ネットワーク独自のアドレスでもよい。また、宛先アドレスがIPアドレスの場合、IPv6に対応していてもよい。
 送信元と優先度との関係は、上位のコンピュータでユーザが任意に設定したものを、CPU3が主メモリ4に保存しておく。送信元と優先度との関係は、通信装置2の初期化時に主メモリ4から通信装置2に読み込まれる。
 ドライバ32は、予め主メモリ4の受信ディスクリプタ領域41に受信ディスクリプタを複数用意する。
 通信装置2による受信処理に伴い、主メモリ4の受信ディスクリプタ5は消費される。1つの受信データ6を主メモリ4に書き込むために、1つの受信ディスクリプタ5が使用される。
 図3は、通信装置の動作フローチャートである。受信キュー22は、インタフェース24を介して、主メモリ4の受信ディスクリプタ領域41から、予め受信ディスクリプタ5を取得する。この時、予め複数の受信ディスクリプタ5を取得してもよい。受信キュー22は、取得した受信ディスクリプタ5を、ディスクリプタバッファ225に格納しておく。
 送受信ポート21がネットワークから受信データ6(パケット)を受信すると、送受信ポート21は受信データ6を受信キュー22に出力する。受信キュー22の優先度判定部221は、受信データ6の送信元MACアドレス領域62および/または送信元IPアドレス領域65から、送信元MACアドレスおよび/または送信元IPアドレスを取得する。優先度判定部221は、優先度記憶部23から送信元アドレス(送信元MACアドレスおよび/または送信元IPアドレス)と優先度との関係を示す情報を取得し、該送信元アドレスから受信された受信データ6の優先度を判定する(S21)。
 優先度判定部221は、判定した優先度に対応するデータバッファ222に、該受信データ6を格納する(振り分ける)(S22)。データバッファ222は先入れ先出し構造のデータバッファであり、末尾にデータを格納し、先頭からデータを取り出すものとする。また、データバッファ222は、主メモリ4まで受信データ6を転送完了するまでは、途中までデータを取り出していても、データを消さずに受信データ全体を保持する機能を持つ。
 例えば、該データバッファ222の一例としては、n個のデータを保持できるリングバッファが挙げられる。該リングバッファでは、参照インデックスとして、HEADとTAILとを有する。HEADは現在転送中または次に転送するデータの先頭のアドレスを示し、TAILは未転送のデータの末尾のアドレスを示す。受信データ6がデータバッファ222に入力されると、受信データ6のデータ長さに応じてTAILのアドレスが加算される。受信データ6がデータバッファ222から読み出されると、読み出された分に応じてHEADのアドレスが加算される。転送が進み、HEADとTAILが同じインデックスを示す場合、そのデータバッファ222は空になり、転送が完了したものといえる。また、転送よりも受信が早く、未転送データが増えて、TAILがHEADに追いつく(=HEAD-1)と、リングバッファが満杯になり、リングバッファに空きができるまで、受信処理を中断する。
 転送調停部223は、受信データ6を格納している1つ以上のデータバッファ222のうち、最も優先度の高いデータバッファ222から受信データ6を読み出す。転送調停部223は、受信データ6をDMAC224に出力し、DMAC224にデータ転送を指示する。DMAC224は、ディスクリプタバッファ225から1つの受信ディスクリプタ5を取得する。DMAC224は、受信ディスクリプタ5に基づき、主メモリ4に最も優先度の高い受信データ6の転送を開始する(S23)。これにより、DMAC224は、受信ディスクリプタ5が示す主メモリ4の受信データ領域42のアドレスに受信データ6を書き込む。この時、転送調停部223は、データバッファが空でない、最も優先度が高いデータバッファの受信データ6の転送をDMAC224にさせる。なお、データバッファ222は、転送を開始するとき、転送前のHEADの値を保存しておく。データバッファ222は、さらに受信データ6が入力され、TAILが増加し、保存したHEADにTAILが追いつくと、リングバッファが満杯になり、リングバッファに空きができるまで、受信処理を中断する。これにより、データバッファ222は、受信データ6の主メモリ4への転送が完了するまで、受信データ6の全体を保持し続ける。
 転送調停部223は、主メモリ4へのデータ転送中も、転送元以外のデータバッファが受信データ6を受信したか否かを監視する(S24)。転送中の受信データ6を第1データとする。
 第1データの転送中に、転送元以外のデータバッファが他の受信データ6を受信しなかった場合(S24でNo)、第1データの転送が完了する。転送完了後、DMAC224は、受信データ6が転送されたことを示す情報(転送完了フラグ)を受信ディスクリプタ領域41に書き込む(S27)。
 第1データの転送中に、転送元以外のデータバッファが他の受信データ6(第2データ)を受信した場合(S24でYes)、転送調停部223は、第2データの方が第1データよりも優先度が高いか否かを判定する(S25)。
 転送中の第1データの優先度より第2データの優先度が高くない場合(S25でNo)、転送調停部223は、DMAC224に第1データの転送を続けさせる。第1データの転送が完了すると、処理はS27へ進む。
 転送中の第1データの優先度より第2データの優先度が高い場合(S25でYes)、転送調停部223は、ただちにDMAC224およびデータバッファ222に第1データの転送を中止させる。第1データを格納していたデータバッファ222は、転送前のHEADの値をHEADに上書きする。これにより、既に読み出して転送した分を含めて第1データ全体がデータバッファ222に復元される(S26)。それゆえ、後で第1データ全体を再度読み出すことが可能となる。また、転送調停部223は、DMAC224に最も優先度の高い第2データの主メモリ4への転送を開始させる(S23)。このとき、転送調停部223から第2データの転送開始の指示を受けたDMAC224は、第1データの転送に用いた受信ディスクリプタを再利用する。DMAC224は、第1データの転送に用いた受信ディスクリプタを再度用いて、第2データを主メモリ4の受信データ領域42に転送する。再利用された受信ディスクリプタは、同じ受信データ領域42のアドレスを指しているので、途中まで受信データ領域42に書き込まれた第1データは、第2データによって上書きされる。
 第2データの転送完了後、DMAC224は、別の受信ディスクリプタ5をディスクリプタバッファ225から取得し、別の受信ディスクリプタ5を用いて次に優先度の高い受信データ6(第1データ)の転送を行う。受信ディスクリプタ5を再利用するため、OS31は転送順が変更されたことを考慮する必要がなく、メモリ管理の負荷が小さくて済む。
 このようにして、通信装置2は、優先度がより高い受信データ6を受信すると、優先度が低い受信データ6の転送を中止し、優先度がより高い受信データ6の転送を開始する。
 図4は、受信データの転送のタイミングチャートを示す。ネットワークを介して、通信装置2に、受信データとして、中優先度データ81a、低優先度データ82a、および高優先度データ83aがこの順に入力される場合を考える。ここでは、通信装置2から主メモリ4への転送速度より、ネットワークから通信装置2への通信速度が速いとする。そのため、受信した中優先度データ81a、低優先度データ82a、および高優先度データ83aを主メモリ4へ転送に必要な時間は、それぞれ中優先度データ81b、低優先度データ82b、および高優先度データ83bに示すように長くなる。中優先度データ81b、低優先度データ82b、および高優先度データ83bは互いに重なるよう図示しているが、実際は1つずつ転送される。
 まず、通信装置2が中優先度データ81aを受信すると、通信装置2は、符号81cに示すように中優先度データの主メモリ4への転送を開始する。通信装置2は、中優先度データ81cの転送中に、低優先度データ82aを受信するが、中優先度データ81cの転送を継続する。
 時刻t1で、通信装置2は、中優先度データ81cの転送中に、高優先度データ83aを受信する。高優先度データ83aは、転送中の中優先度データ81cより優先度が高い。そのため、通信装置2は、中優先度データ81cの転送を中止(キャンセル)する。そして通信装置2は、符号83cに示すように高優先度データの主メモリ4への転送を開始する。
 時刻t2で、通信装置2は、高優先度データ83cの転送を完了する。通信装置2は、既に受信された中優先度データ81a、および低優先度データ82aのうち、より優先度の高い中優先度データの主メモリ4への転送を開始する(符号81d)。このように、通信装置2は、一旦転送が中止された中優先度データを、データの最初から再度転送する。
 時刻t3で、通信装置2は、中優先度データ81dの転送を完了する。通信装置2は、既に受信された低優先度データ82aの主メモリ4への転送を開始する(符号82c)。
 このように、通信装置2によれば、3つ以上の異なる優先度の受信データ6を受信した場合でも、より優先度が高い受信データの主メモリ4への転送を優先することができる。低い優先度の受信データ(低優先度データ82a、中優先度データ81a)のために、より高い優先度の受信データ(高優先度データ83a)の転送が待たされることを回避することができる。それゆえ、通信装置2は、制御データ等の定周期で受信すべき受信データを、迅速に処理することができ、リアルタイム性を向上させることができる。
 図5は、実施形態の動作例1と参考例1との受信データの処理順を説明するタイミングチャートである。ここでは、通信装置は、受信と同時に主メモリへのデータ転送を行うとする。優先度が2段階でのモデルケースであり、通信装置2は低優先度データ71a、および高優先度データ72aを順に受信したとする。高優先度データ72aに関しては、低優先度データ71aの主メモリ4への転送処理完了前に受信したものとする。
 (参考例1)
 参考例1の通信装置は、受信済の受信データの転送順を調停するものの、低優先度の受信データの転送を中断してまで高優先度の受信データ転送を開始しない。
 低優先度データ71aを受信すると同時に(データバッファに格納開始するとすぐに)、通信装置は低優先度データ71bの転送を開始する。転送中に、通信装置は高優先度データ72aを受信する。しかしながら、主メモリへの転送が低優先度データ71bによって占有されているため、通信装置は高優先度データ72aを即時に転送できない。低優先度データ71bの転送完了後、通信装置は高優先度データ72aの主メモリへの転送を開始する(符号72b)。そのため、高優先度データ72aを受信してから、高優先度データ72bの転送開始までに遅延が発生する。
 (動作例1)
 動作例1の通信装置2は、低優先度データ71aを受信すると同時に(データバッファに格納開始するとすぐに)、通信装置2は低優先度データ71cの転送を開始する。転送中に、通信装置2は高優先度データ72aを受信する。通信装置2は、高優先度データ72aを受信すると同時に(データバッファに格納開始するとすぐに)、低優先度データ71cの転送を中止(破棄)し、高優先度データ72aの主メモリ4への転送を開始する(符号72c)。通信装置2は、高優先度データ72cの転送が完了すると、低優先度データの最初から再度転送する(符号71d)。
 §4 作用・効果
 以上のとおり、本実施形態1に係る情報処理装置1は、通信装置2が受信データ6(パケット)を受信後、パケットの送信元アドレスから優先度を判定し、該当する優先度のデータバッファ222に受信データ6を振り分ける。その後、転送調停部223により、転送順を制御され、主メモリ4に受信データ6を転送する。この時、転送中の受信データ6よりも優先度が高いデータバッファ222に受信データ6が振り分けられた場合、転送を中断し、直ちに該高優先度の受信データ6の転送を開始する。そのため、本実施形態1に係る情報処理装置1では、例えば優先度の異なる複数の受信キューによって優先度振分を行って受信処理する従来技術よりも、高優先度の受信データがデータバッファ上に滞留する時間が短く、低遅延な処理が実現できる。
 また、複数の優先度に応じて複数の受信キューを設ける従来技術では、複数の受信キューに対応して主メモリに複数の受信ディスクリプタ領域および複数の受信データ領域を設ける必要が生じる。そのため、OAまたはドライバによるメモリ管理が複雑になり、CPUの処理負荷と遅延が増加する。
 本実施形態の通信装置2は、1つの受信キュー22の中で、複数の優先度の受信データの転送順の調停を行う。それゆえ、受信キューおよび受信ディスクリプタ領域の増加を抑制し、CPU3の処理負荷の低減および遅延の低減を実現することができる。
 図5を参照されたい。参考例1に対して、本実施形態の動作例1の場合、低優先度データ71aの受信とほぼ同時に、低優先度データ71cの転送を開始する。その後、低優先度データ71cの転送中に、高優先度データ72aを受信する。低優先度データ71cの転送を中断し、転送済みのデータを破棄し、直ちに高優先度データ72cの転送を開始する。ここで、データを破棄するとは、主メモリ4において転送済みのデータ(受信データの一部)を保持せず高優先度データ72cで上書きすることを意味する。高優先度データ72cの転送完了後、先ほど破棄した低優先度データ71aを主メモリに再度転送を行う。そのため、処理順が前後し高優先度データが遅延なく転送でき、リアルタイム性が向上する。
 〔実施形態2〕
 本発明の他の実施形態について、以下に説明する。なお、説明の便宜上、上記実施形態にて説明した部材と同じ機能を有する部材については、同じ符号を付記し、その説明を繰り返さない。
 実施形態1では、受信と同時に主メモリへのデータ転送を行うことと規定したが、転送タイミングはこの限りではなく、受信完了時に(1つの受信データ6全体のデータバッファ222への格納が完了してから)主メモリ4への転送を開始してもよい。
 図6は、実施形態2の動作例2と参考例2との受信データの処理順を説明するタイミングチャートである。優先度が2段階でのモデルケースであり、通信装置2は低優先度データ71a、および高優先度データ72aを順に受信したとする。高優先度データ72aに関しては、低優先度データ71aの主メモリへの転送処理完了前に受信が完了(データバッファ222への格納が完了)したものとする。
 参考例2では、通信装置は、低優先度データ71a全体を受信完了すると同時に、主メモリへの低優先度データ71eの転送を開始する。低優先度データ71eの転送中に、高優先度データ72a全体の受信を完了(データバッファへの格納が完了)するが、低優先度データ71eの転送に占有されているため、高優先度データ72aの転送を開始できない。低優先度データ71eの転送完了後、主メモリへの高優先度データ72eの転送を行う。そのため、高優先度データ72eの転送は遅延する。
 本実施形態の動作例2では、通信装置2は、低優先度データ71a全体を受信完了すると同時に、主メモリ4への低優先度データ71fの転送を開始する。通信装置2は、低優先度データ71fの転送中に、高優先度データ72a全体の受信を完了(データバッファへの格納が完了)する。転送中の低優先度データの優先度よりも、受信完了した高優先度データの優先度が高いため、通信装置2は、低優先度データの転送を直ちに中断し、転送済みのデータを破棄する。その後、通信装置2は、高優先度データ72aの主メモリ4への転送を開始する(符号72f)。高優先度データ72fの転送完了後、再度、中断した低優先度データ71g全体の転送を行う。そのため、処理順が前後し高優先度データが遅延なく転送できる。
 また、受信完了後に転送を行うため、本実施形態では、受信中にノイズなどでデータ欠損があった場合でも、通信装置2においてデータ欠損を確認・補充後に転送を行える利点がある。
 〔変形例1〕
 実施形態1、2では、優先度判定部221は、受信データの送信元MACアドレス領域62または送信元IPアドレス領域65または予約領域63,66に記載の送信元アドレスに基づき、優先度の判定を行っているが、この限りではない。外部装置において、受信データ6の予約領域63,66に該受信データ6の優先度を示す優先度情報を記載してもよい。この場合、優先度判定部221は、該受信データ6に含まれる優先度情報に基づいて優先度を判定する。この場合、優先度記憶部23を省略することができる。これにより、同じ外部装置からの複数の受信データ6の中でも異なる優先度を設定することができる。
 〔変形例2〕
 実施形態1、2では、1つの受信キュー22は、複数の優先度に応じて複数のデータバッファ222を有しているが、この限りではない。1つの受信キューは、1つのデータバッファを有し、複数の優先度の受信データを1つのデータバッファに格納してもよい。この場合、データバッファは先入れ先出しではなく、転送調停部は、データバッファから優先度に応じて任意の順で受信データを取り出し可能である。
 〔まとめ〕
 本発明の一様態に係る通信装置は、受信キューを備え、1つの前記受信キューは、ネットワークから受信した受信データの優先度を判定する優先度判定部と、前記受信データを格納するバッファと、前記バッファに格納されている前記受信データを主メモリに転送する転送部と、前記転送部が第1優先度の受信データを前記主メモリに転送しているときに、前記バッファが前記第1優先度より優先度が高い第2優先度の受信データを受信すると、前記転送部に前記第1優先度の受信データの転送を中止させ、前記第2優先度の受信データの前記主メモリへの転送を開始させる転送調停部と、を備える。
 上記の構成によれば、優先度順に受信データの転送順を調停でき、かつ高優先度の受信データに関しては、低遅延でタイミングのばらつきがないリアルタイムな転送処理が可能である。
 前記バッファは、前記第1優先度の受信データを格納する第1バッファと、前記第2優先度の受信データを格納する第2バッファとを含んでもよい。
 上記の構成によれば、優先度毎にバッファを複数用意することができ、ハードウェアの構成が容易になる。
 前記転送部は、前記主メモリの受信ディスクリプタ領域から受信ディスクリプタを取得し、前記受信ディスクリプタが示す前記主メモリのデータ領域に前記受信データを転送するものであり、前記転送部は、前記転送調停部から前記第1優先度の受信データの転送を中止し、前記第2優先度の受信データの前記主メモリへの転送を開始する指示を受けると、前記第1優先度の受信データを転送するために用いていた受信ディスクリプタを再度用いて、前記第2優先度の受信データを前記主メモリのデータ領域に転送してもよい。
 上記の構成によれば、受信ディスクリプタを再利用することができ、OS(Operating System)は、転送中止に応じた処理を行う必要が無い。それゆえ、OSによるメモリ管理が容易になる。
 前記第1バッファは、前記第1優先度の受信データの前記主メモリへの転送が完了するまで、前記第1優先度の受信データの全体を保持し続けてもよい。
 上記の構成によれば、高優先度の受信データに割り込まれた、低優先度の受信データの再転送を、データの途中から再送信するのではなく、データの先頭から再送信でき、データの齟齬の防止・システムの容易化ができる。
 前記優先度判定部は、前記受信データの送信元アドレスに基づいて前記受信データの優先度を判定してもよい。
 前記受信データは優先度情報を含み、前記優先度判定部は、前記優先度情報に基づいて前記受信データの優先度を判定してもよい。
 上記の構成によれば、送信元アドレスによらず、送信元が能動的に優先度を設定することができる。
 本発明の一様態に係る通信装置の制御方法は、ネットワークから受信した受信データを格納するバッファを有する受信キューを備える通信装置の制御方法であって、前記受信データの優先度を判定する優先度判定ステップと、前記バッファに格納されている前記受信データを主メモリに転送する転送ステップと、第1優先度の受信データを前記主メモリに転送しているときに、前記バッファが前記第1優先度より優先度が高い第2優先度の受信データを受信すると、前記第1優先度の受信データの転送を中止させ、前記第2優先度の受信データの前記主メモリへの転送を開始させる受信調停ステップと、を含んでいる。
 前記通信装置として機能する集積回路は、前記優先度判定部と、前記バッファと、前記転送調停部と、として機能する、ハードウェアの論理回路が形成されていてもよい。
 〔付記事項〕
 本発明は上述した各実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能であり、異なる実施形態にそれぞれ開示された技術的手段を適宜組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。
 1 情報処理装置
 2 通信装置
 3 CPU
 4 主メモリ
 5 受信ディスクリプタ
 6 受信データ
 21 送受信ポート
 22 受信キュー
 23 優先度記憶部
 24 インタフェース
 31 OS
 32 ドライバ
 41 受信ディスクリプタ領域
 42 受信データ領域
 51 バッファアドレス領域
 52 受信完了フラグ領域
 54、63、66 予約領域
 60、64 ヘッダ
 61 IPフレーム
 62 送信元MACアドレス領域
 65 送信元IPアドレス領域
 67 データ領域
 71a、71b、71c、71e、71f、71g 低優先度データ
 72a、72b、72c、72e、72f 高優先度データ
 221 優先度判定部
 222 データバッファ(第1バッファ、第2バッファ)
 223 転送調停部
 224 DMAC(転送部)
 225 ディスクリプタバッファ(転送部)

Claims (8)

  1.  受信キューを備え、
     1つの前記受信キューは、
      ネットワークから受信した受信データの優先度を判定する優先度判定部と、
      前記受信データを格納するバッファと、
      前記バッファに格納されている前記受信データを主メモリに転送する転送部と、
      前記転送部が第1優先度の受信データを前記主メモリに転送しているときに、前記バッファが前記第1優先度より優先度が高い第2優先度の受信データを受信すると、前記転送部に前記第1優先度の受信データの転送を中止させ、前記第2優先度の受信データの前記主メモリへの転送を開始させる転送調停部と、を備える、通信装置。
  2.  前記バッファは、
      前記第1優先度の受信データを格納する第1バッファと、
      前記第2優先度の受信データを格納する第2バッファとを含む、請求項1に記載の通信装置。
  3.  前記転送部は、前記主メモリの受信ディスクリプタ領域から受信ディスクリプタを取得し、前記受信ディスクリプタが示す前記主メモリのデータ領域に前記受信データを転送するものであり、
     前記転送部は、前記転送調停部から前記第1優先度の受信データの転送を中止し、前記第2優先度の受信データの前記主メモリへの転送を開始する指示を受けると、前記第1優先度の受信データを転送するために用いていた受信ディスクリプタを再度用いて、前記第2優先度の受信データを前記主メモリのデータ領域に転送する、請求項1または2に記載の通信装置。
  4.  前記第1バッファは、前記第1優先度の受信データの前記主メモリへの転送が完了するまで、前記第1優先度の受信データの全体を保持し続ける、請求項2に記載の通信装置。
  5.  前記優先度判定部は、前記受信データの送信元アドレスに基づいて前記受信データの優先度を判定する、請求項1から4のいずれか一項に記載の通信装置。
  6.  前記受信データは優先度情報を含み、
     前記優先度判定部は、前記優先度情報に基づいて前記受信データの優先度を判定する、請求項1から4のいずれか一項に記載の通信装置。
  7.  ネットワークから受信した受信データを格納するバッファを有する受信キューを備える通信装置の制御方法であって、
     前記受信データの優先度を判定する優先度判定ステップと、
     前記バッファに格納されている前記受信データを主メモリに転送する転送ステップと、
     第1優先度の受信データを前記主メモリに転送しているときに、前記バッファが前記第1優先度より優先度が高い第2優先度の受信データを受信すると、前記第1優先度の受信データの転送を中止させ、前記第2優先度の受信データの前記主メモリへの転送を開始させる受信調停ステップと、を含む、通信装置の制御方法。
  8.  請求項1に記載の通信装置として機能する集積回路であって、
     前記優先度判定部と、前記バッファと、前記転送調停部と、として機能する、ハードウェアの論理回路が形成されていることを特徴とする集積回路。
PCT/JP2021/001753 2020-03-10 2021-01-20 通信装置、通信装置の制御方法、および集積回路 Ceased WO2021181897A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2020041071A JP7435055B2 (ja) 2020-03-10 2020-03-10 通信装置、通信装置の制御方法、および集積回路
JP2020-041071 2020-03-10

Publications (1)

Publication Number Publication Date
WO2021181897A1 true WO2021181897A1 (ja) 2021-09-16

Family

ID=77671297

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2021/001753 Ceased WO2021181897A1 (ja) 2020-03-10 2021-01-20 通信装置、通信装置の制御方法、および集積回路

Country Status (2)

Country Link
JP (1) JP7435055B2 (ja)
WO (1) WO2021181897A1 (ja)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09312652A (ja) * 1996-05-23 1997-12-02 Mitsubishi Electric Corp フレーム組立装置
JP2002288115A (ja) * 2001-03-27 2002-10-04 Ricoh Co Ltd Usbコントローラ
JP2003318971A (ja) * 2002-04-25 2003-11-07 Fujitsu Ltd ネットワークスイッチ装置およびネットワークスイッチ方法
JP2018025879A (ja) * 2016-08-08 2018-02-15 富士通株式会社 データ転送装置およびデータ転送方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007088709A (ja) * 2005-09-21 2007-04-05 Oki Electric Ind Co Ltd パケット通信装置およびその処理方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09312652A (ja) * 1996-05-23 1997-12-02 Mitsubishi Electric Corp フレーム組立装置
JP2002288115A (ja) * 2001-03-27 2002-10-04 Ricoh Co Ltd Usbコントローラ
JP2003318971A (ja) * 2002-04-25 2003-11-07 Fujitsu Ltd ネットワークスイッチ装置およびネットワークスイッチ方法
JP2018025879A (ja) * 2016-08-08 2018-02-15 富士通株式会社 データ転送装置およびデータ転送方法

Also Published As

Publication number Publication date
JP7435055B2 (ja) 2024-02-21
JP2021145182A (ja) 2021-09-24

Similar Documents

Publication Publication Date Title
US10778594B2 (en) Transfer control device, transfer control method, and computer program product
US10412017B2 (en) Transfer device, transfer method, and computer program product
US10193831B2 (en) Device and method for packet processing with memories having different latencies
CN103460199B (zh) 基于业务类别的自适应中断调整
JP7000088B2 (ja) 通知制御装置、通知制御方法及びプログラム
WO2011089660A1 (ja) バス調停装置
JP7354361B2 (ja) 処理装置、処理方法及びプログラム
US7860120B1 (en) Network interface supporting of virtual paths for quality of service with dynamic buffer allocation
CN111970213B (zh) 一种将数据写入存储器的方法及网元
US12010045B2 (en) Packet processing device and packet processing method
US20070113023A1 (en) Method and system for accessing a single port memory
US6061748A (en) Method and apparatus for moving data packets between networks while minimizing CPU intervention using a multi-bus architecture having DMA bus
JP7435054B2 (ja) 通信装置、通信装置の制御方法、および集積回路
CN115955441A (zh) 一种基于tsn队列的管理调度方法、装置
JP7435055B2 (ja) 通信装置、通信装置の制御方法、および集積回路
US7984210B2 (en) Method for transmitting a datum from a time-dependent data storage means
WO2022170561A1 (zh) 一种信息传输方法及装置
EP1891503B1 (en) Concurrent read response acknowledge enhanced direct memory access unit
CN121100330A (zh) 用于spi通信的传输设备
JP2006217600A (ja) 通信システムにおける送信キューデータの移動方法及び装置
WO2021065370A1 (ja) 車両制御装置及びデータ転送制御方法
US20250193125A1 (en) Data transfer device and method
CN120567801B (zh) 一种数据传输方法、系统、产品、设备、介质及装置
US20080228823A1 (en) Frame transfer apparatus
CN118819421B (zh) Psram设备的读写方法、芯片及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21768766

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21768766

Country of ref document: EP

Kind code of ref document: A1