WO2020217968A1 - パケット処理装置およびパケット処理方法 - Google Patents

パケット処理装置およびパケット処理方法 Download PDF

Info

Publication number
WO2020217968A1
WO2020217968A1 PCT/JP2020/015639 JP2020015639W WO2020217968A1 WO 2020217968 A1 WO2020217968 A1 WO 2020217968A1 JP 2020015639 W JP2020015639 W JP 2020015639W WO 2020217968 A1 WO2020217968 A1 WO 2020217968A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
packet
unit
combined
memory
Prior art date
Application number
PCT/JP2020/015639
Other languages
English (en)
French (fr)
Inventor
川村 智明
晶子 大輝
祐太 右近
周平 吉田
Original Assignee
日本電信電話株式会社
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 日本電信電話株式会社 filed Critical 日本電信電話株式会社
Priority to US17/436,977 priority Critical patent/US20220171725A1/en
Publication of WO2020217968A1 publication Critical patent/WO2020217968A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4022Coupling between buses using switching circuits, e.g. switching matrix, connection or expansion network

Definitions

  • the present invention relates to a packet processing device and a packet processing method, and more particularly to a packet processing device and a packet processing method for performing packet data transfer processing in a communication system.
  • FIG. 35 is a block diagram showing the configuration of a conventional packet processing device.
  • the packet processing device includes a line correspondence unit 100 that receives packets from a communication line, a packet memory 101 that stores packets received from the communication line, and a packet transfer unit 102 that transfers packets received from the communication line to the packet memory 101.
  • a reception processing unit 103 that reads a packet from the packet memory 101 and a protocol processing unit 104 that performs protocol processing on the packet are provided.
  • the packet transfer unit 102 performs data transfer using DMA (Direct Memory Access) and arrives at the arrival of the packet to the line corresponding unit 100 connected to the communication line (not shown).
  • the packet is stored in the packet memory 101.
  • the packet transfer unit 102 generates a hardware interrupt to notify the processor (not shown) of the packet processing device that the packet has been received, and requests the start of the reception processing unit 103.
  • DMA Direct Memory Access
  • the packet transfer unit 102 is composed of a descriptor 1020, which is a data structure constructed by software executed by a processor of a packet processing device, and a DMA controller 1021, which is hardware.
  • FIG. 36 is a diagram illustrating an outline of the descriptor 1020.
  • FIG. 36 shows a case where N packets are stored in the packet memory 101.
  • the processor of the packet processing device sets the address and the flag corresponding to each of the N packets in the descriptor 1020.
  • the processor sets the start addresses A # 1 to A # N when writing the received packet to the packet memory 101 in the descriptor 1020 in advance.
  • the number of addresses that can be set at the same time is predetermined, and the order of the addresses used is also determined.
  • the processor sets / resets the flags AF # 1 to AF # N indicating whether or not the set addresses A # 1 to A # N are valid for the descriptor 1020. After setting the addresses A # 1 to A # N, if the processor enables the flags AF # 1 to AF # N, the packet can be written to the packet memory 101.
  • the descriptor 1020 has reception completion flags WF # 1 to WF # N indicating whether or not the writing of the packet to the set addresses A # 1 to A # N is completed, and the set addresses A # 1. Received data sizes L # 1 to L # N indicating the packet length of the packet written to A # N are set.
  • FIG. 37 is a flowchart illustrating the operation of the DMA controller 1021.
  • Write step S105 in FIG. 37.
  • a hardware interrupt is generated to notify the processor (not shown) of the packet processing device that the writing of the packet is completed, and the reception processing unit 103 is requested to start.
  • the DMA controller 1021 determines whether or not the variable n is equal to N (step S106 in FIG. 37). When the variable n has not reached N (no in step S106), the DMA controller 1021 increments the variable n by 1 (step S107 in FIG. 37) and returns to step S101. Further, when the variable n reaches N (yes in step S106), the DMA controller 1021 returns to step S100. In this way, N packets are sequentially transferred to the packet memory 101.
  • the activated reception processing unit 103 passes the received packet transferred to the packet memory 101 to the protocol processing unit 104.
  • the reception processing unit 103 secures a new area of the packet memory 101 from the memory of the packet processing device in order to replenish the packet memory portion passed to the protocol processing unit 104.
  • the protocol processing unit 104 to which the received packet is delivered releases the area of the packet memory 101 when the necessary protocol processing is completed.
  • the reception performance is lowered due to the overhead associated with the DMA transfer control because the number of times the DMA transfer is activated increases.
  • FIG. 38 is a block diagram showing a configuration of a conventional packet processing device disclosed in Patent Document 1.
  • This packet processing device includes a line correspondence unit 100, a packet memory 101, a combined packet transfer unit 102a, a reception processing unit 103, a protocol processing unit 104, a reception buffer 105, a packet coupling unit 106, and a coupling threshold control. It is provided with a unit 107.
  • the packet coupling unit 106 transfers the packet received by the line corresponding unit 100 to the receiving buffer 105 for packet coupling. At this time, the packet coupling unit 106 puts the packet into the reception buffer 105 so that the packet received by the line correspondence unit 100 and the packet already stored in the reception buffer 105 are combined into one combined packet. Store. Then, when the size of the combined packet in the receive buffer 105 exceeds the threshold set in advance in the combined threshold control unit 107, the packet combining unit 106 issues a transfer request for the combined packet to the packet memory 101.
  • the combined packet transfer unit 102a is composed of a descriptor 1020a and a DMA controller 1021a.
  • FIG. 39 is a diagram illustrating an outline of the descriptor 1020a. The example of FIG. 39 shows a case where N combined packets are stored in the packet memory 101. In this case, the processor of the packet processing device sets the address and the flag corresponding to each of the N combined packets in the descriptor 1020a.
  • the processor sets in advance the start addresses AD # 1 to AD # N when writing the combined packet to the packet memory 101 in the descriptor 1020a.
  • the number of addresses that can be set at the same time is predetermined, and the order of the addresses used is also determined.
  • the processor sets / resets the flags ADF # 1 to ADF # N indicating whether or not the set addresses AD # 1 to AD # N are valid for the descriptor 1020a.
  • the processor enables the flags ADF # 1 to ADF # N after setting the addresses AD # 1 to AD # N, the combined packet can be written to the packet memory 101.
  • the descriptor 1020a has reception completion flags WDF # 1 to WDF # N indicating whether or not the writing of the combined packet to the set addresses AD # 1 to AD # N is completed, and the set addresses A #.
  • Received data sizes LD # 1 to LD # N indicating the lengths of the combined packets written to 1 to A # N (the total value of the packet lengths of the combined packets) are set.
  • FIG. 40 is a flowchart illustrating the operation of the DMA controller 1021a.
  • the DMA controller 1021a determines whether or not the variable n is equal to N (step S206 in FIG. 40). When the variable n has not reached N (no in step S206), the DMA controller 1021a increments the variable n by 1 (step S207 in FIG. 40) and returns to step S201. Further, when the variable n reaches N (yes in step S206), the DMA controller 1021a returns to step S200. In this way, N combined packets are sequentially transferred to the packet memory 101.
  • a request for starting reception processing is made every time a combined packet in which a plurality of packets are combined is transferred, so that the number of times the reception processing unit 103 is started is reduced, and the packet processing device The load on the processor is reduced. Further, since the number of DMA transfer controls is also reduced, the overhead ratio is lowered, and high reception performance can be exhibited.
  • the protocol processing unit 104 restores the combined packet to the original plurality of packets.
  • this restoration process is to be realized by the hardware of the protocol processing unit 104, there is a means for notifying the protocol processing unit 104 of the information required for the restoration process (the number of combined packets, the size of each packet) from the packet combining unit 106. Therefore, there is a problem that the scale of hardware such as the packet coupling unit 106 becomes large. Further, it is necessary to hold the information necessary for the restoration process in the packet memory 101 or the like.
  • the restoration process can be realized by software such as the reception processing unit 103, but similarly to the above, the information necessary for the restoration process (number of combined packets, size for each packet) is provided in the packet combining unit 106. Therefore, there is a problem that the scale of hardware such as the packet coupling unit 106 is increased because a means for notifying the reception processing unit 103 is required. Further, since the restoration process is performed by the software, the process by the software increases, the load on the processor increases, and as a result, there is a problem that the improvement of the reception performance by the collective DMA transfer is suppressed.
  • FIG. 41 is a block diagram showing another configuration of the packet processing device.
  • a combined packet separation unit 108 that restores a combined packet into a plurality of original packets is inserted between the reception processing unit 103 and the protocol processing unit 104 of the packet processing device of FIG. 38.
  • the information required for the restoration process (the number of combined packets, each packet).
  • a means for notifying the size) from the packet coupling unit 106 to the combined packet separation unit 108 is required, which causes a problem that the scale of hardware such as the packet coupling unit 106 becomes large.
  • the combined packet separation unit 108 by software, but similarly to the above, the information necessary for the restoration process (the number of combined packets, the size of each packet) is input from the packet combining unit 106 to the combined packet.
  • a means for notifying the separation unit 108 is required, which causes a problem that the scale of hardware such as the packet coupling unit 106 becomes large.
  • the restoration process is performed by the software, the process by the software increases, the load on the processor increases, and as a result, there is a problem that the improvement of the reception performance by the collective DMA transfer is suppressed.
  • FIG. 42 is a block diagram showing another configuration of the packet processing device.
  • the packet processing device is provided with a packet processing unit 114 that processes the packet received from the communication line and outputs the processing result data, and receives the packet memory 101 and the combined packet transfer unit 102a.
  • the processing unit 103, the protocol processing unit 104, the reception buffer 105, the packet coupling unit 106, and the combined packet separation unit 108 are combined with a data memory 115 for data extracted from the packet, a combined data transfer unit 102b, and a reception processing unit 117, respectively. It is replaced with the data processing unit 116, the receiving buffer 118, the data combining unit 120, and the combined data separating unit 108b.
  • the data combining unit 120 transfers the data output by the packet processing unit 114 to the receiving buffer 118 for data combining. At this time, the data combining unit 120 stores the data in the receiving buffer 118 so as to concatenate the data output by the packet processing unit 114 and the data already stored in the receiving buffer 118 into one data block. To do.
  • the combined data transfer unit 102b DMA-transfers the data block generated by the data combination unit 120 to the data memory 115.
  • the reception processing unit 117 passes the data block transferred to the data memory 115 to the combined data separation unit 108b.
  • the combined data separation unit 108b restores the data block to the original plurality of data.
  • the data processing unit 116 performs necessary processing on the data restored by the combined data separation unit 108b.
  • the data combination unit 120 notifies the combined data separation unit 108b of the information required for the restoration process (the number of combined data, the size of each data). Means are required, and there is a problem that the scale of hardware such as the data coupling unit 120 becomes large. Further, it is necessary to hold information (size of each data, etc.) corresponding to a plurality of data blocks (transfer units) in the data memory 115 or the like. Further, although it is possible to realize the combined data separation unit 108b by software, there is a problem that the processing of the software increases as compared with the case where the data combination is not performed.
  • FIG. 43 is a block diagram showing another configuration of the packet processing device.
  • This packet processing device is provided with a combined packet writing unit 109 by software in place of the combined packet transfer unit 102a of the packet processing devices of FIGS. 38 and 41.
  • Even in a packet processing device that does not use DMA transfer when the effective throughput of writing to the packet memory 101 is improved by collectively writing a plurality of packets to the packet memory 101 (hereinafter, collectively writing) by software (packet memory 101). (For example, when it is composed of DRAM).
  • the packet processing device that performs collective writing also has the same problem as described above when restoring the combined packet to the original plurality of packets.
  • the information required for the restoration processing (number of combined packets, size for each packet). Is required to be stored in the packet memory 101 or the like, and there is a problem that the capacity (the number of writable bits) of the packet memory 101 or the like needs to be increased as compared with the case where the batch writing is not performed.
  • the present invention has been made to solve the problems of the prior art, and an object of the present invention is to display a plurality of data in a packet processing device using collective DMA transfer by hardware or collective writing by software. Providing a technology that makes it possible to reduce the scale of hardware required for the process of restoring a combined data block to multiple original data, and to realize high reception performance due to the effect of collective DMA transfer or collective write. To do.
  • the packet processing device of the present invention concatenates a packet processing unit configured to process a packet received from a communication line and output processing result data, and a plurality of data output from the packet processing unit.
  • a data coupling unit configured to generate a data block, a data memory configured to store data output from the packet processing unit, and a data block generated by the data coupling unit are described above.
  • the combined data transfer unit includes a combined data transfer unit configured to perform DMA transfer to or write to the data memory, and the combined data transfer unit is on the data memory at the beginning of each data in the data block. It is characterized in that the address information is written to a descriptor which is a data area on a predetermined memory.
  • the packet processing device of the present invention has a packet processing unit configured to process a packet received from a communication line and output data of a processing result, and a plurality of data output from the packet processing unit.
  • a data coupling unit configured to concatenate and generate a data block, a data memory configured to store data output from the packet processing unit, and a data block generated by the data coupling unit.
  • the data transfer unit is provided with a combined data transfer unit configured to DMA transfer or write the data to the data memory, and the combined data transfer unit is the head of each data in the data block.
  • the feature is that the above address is determined, the information of this address is written to a descriptor which is a data area on a predetermined memory, and the data block is DMA-transferred to the data memory or written by a processor. Is what you do.
  • the combined data transfer unit is characterized in that information on a received data size indicating the data length of each data in the data block is written to the descriptor. is there.
  • one configuration example of the packet processing device of the present invention further includes a processing unit that reads data stored in the data memory, and the processing unit further includes the data memory based on the information written in the descriptor. It is characterized in that data is read from and processed.
  • the first step of processing the packet received from the communication line and outputting the processing result data and the plurality of data obtained in the first step are concatenated.
  • the first step of processing the packet received from the communication line and outputting the processing result data and the plurality of data obtained in the first step are concatenated.
  • the second step of generating a data block and the data memory for which the processing unit that processes the data obtained in the first step reads the data each data in the data block
  • a third step of determining an address on the data memory, a fourth step of writing the address information to a descriptor which is a predetermined data area on the memory, and the data block are described. It is characterized by including a fifth step of DMA transfer to a data memory or writing by a processor.
  • the combined data transfer unit DMA-transfers the data block generated by the data combination unit to the data memory, or writes the data block by the processor on the data memory at the beginning of each data in the data block.
  • the address information in is written to a descriptor which is a predetermined data area on the memory.
  • the packet processing apparatus provided with the combined data transfer unit of the present invention, the hardware required for the process of restoring a data block in which a plurality of data are combined to the original plurality of data as compared with the configuration of the prior art. It is possible to reduce the scale of the data and to realize high reception performance due to the effect of collective DMA transfer or collective writing.
  • the combined data transfer unit determines an address on the data memory at the beginning of each data in the data block, and writes the information of this address in the descriptor to compare with the configuration of the prior art. Therefore, the size of the buffer area for the data block that needs to be secured in the data memory can be reduced.
  • the plurality of data are combined in the configuration of the present invention.
  • the processing of the processor required for processing one data becomes lighter, so the reception performance is improved (the number of data that can be processed per unit time is increased). It has the effect of increasing). It also has the effect of reducing the power consumption of the processor required to process one data.
  • FIG. 1 is a block diagram showing a configuration of a packet processing device according to a first reference example of the present invention.
  • FIG. 2 is a diagram illustrating an outline of a descriptor of the packet processing device according to the first reference example of the present invention.
  • FIG. 3 is a flowchart illustrating the operation of the transfer management unit of the packet processing device according to the first reference example of the present invention.
  • FIG. 4 is a flowchart illustrating the operation of the DMA controller of the packet processing device according to the first reference example of the present invention.
  • FIG. 5 is a flowchart illustrating the operation of the DMA controller of the packet processing device according to the first reference example of the present invention.
  • FIG. 1 is a block diagram showing a configuration of a packet processing device according to a first reference example of the present invention.
  • FIG. 2 is a diagram illustrating an outline of a descriptor of the packet processing device according to the first reference example of the present invention.
  • FIG. 3 is a flowchart illustrating the
  • FIG. 6 is a flowchart illustrating the operation of the reception processing unit of the packet processing device according to the first reference example of the present invention.
  • FIG. 7 is a block diagram showing a configuration of a packet processing device according to a second reference example of the present invention.
  • FIG. 8 is a diagram illustrating an outline of a descriptor of the packet processing device according to the second reference example of the present invention.
  • FIG. 9 is a flowchart illustrating the operation of the combined packet transfer unit of the packet processing device according to the second reference example of the present invention.
  • FIG. 10 is a flowchart illustrating the operation of the combined packet transfer unit of the packet processing device according to the second reference example of the present invention.
  • FIG. 10 is a flowchart illustrating the operation of the combined packet transfer unit of the packet processing device according to the second reference example of the present invention.
  • FIG. 11 is a block diagram showing a configuration of a packet processing device according to the first embodiment of the present invention.
  • FIG. 12 is a flowchart illustrating the operation of the transfer management unit of the packet processing device according to the first embodiment of the present invention.
  • FIG. 13 is a flowchart illustrating the operation of the DMA controller of the packet processing device according to the first embodiment of the present invention.
  • FIG. 14 is a flowchart illustrating the operation of the DMA controller of the packet processing device according to the first embodiment of the present invention.
  • FIG. 15 is a flowchart illustrating the operation of the reception processing unit of the packet processing device according to the first embodiment of the present invention.
  • FIG. 16 is a block diagram showing a configuration of a packet processing device according to a second embodiment of the present invention.
  • FIG. 17 is a flowchart illustrating the operation of the combined data transfer unit of the packet processing device according to the second embodiment of the present invention.
  • FIG. 18 is a flowchart illustrating the operation of the combined data transfer unit of the packet processing device according to the second embodiment of the present invention.
  • FIG. 19 is a block diagram showing a configuration of a packet processing device according to a third embodiment of the present invention.
  • FIG. 20 is a diagram illustrating an outline of a descriptor of the packet processing device according to the third embodiment of the present invention.
  • FIG. 21 is a flowchart illustrating the operation of the transfer management unit of the packet processing device according to the third embodiment of the present invention.
  • FIG. 22 is a flowchart illustrating the operation of the DMA controller of the packet processing device according to the third embodiment of the present invention.
  • FIG. 23 is a flowchart illustrating the operation of the DMA controller of the packet processing device according to the third embodiment of the present invention.
  • FIG. 24 is a flowchart illustrating the operation of the DMA controller of the packet processing device according to the third embodiment of the present invention.
  • FIG. 25 is a flowchart illustrating the operation of the DMA controller of the packet processing device according to the third embodiment of the present invention.
  • FIG. 26 is a flowchart illustrating the operation of the reception processing unit of the packet processing device according to the third embodiment of the present invention.
  • FIG. 27 is a flowchart illustrating the operation of the DMA controller of the packet processing device according to the third embodiment of the present invention.
  • FIG. 28 is a block diagram showing a configuration of a packet processing device according to a fourth embodiment of the present invention.
  • FIG. 29 is a flowchart illustrating the operation of the combined data transfer unit of the packet processing device according to the fourth embodiment of the present invention.
  • FIG. 30 is a flowchart illustrating the operation of the combined data transfer unit of the packet processing device according to the fourth embodiment of the present invention.
  • FIG. 31 is a flowchart illustrating the operation of the combined data transfer unit of the packet processing device according to the fourth embodiment of the present invention.
  • FIG. 32 is a flowchart illustrating the operation of the combined data transfer unit of the packet processing device according to the fourth embodiment of the present invention.
  • FIG. 33 is a flowchart illustrating the operation of the combined data transfer unit of the packet processing device according to the fourth embodiment of the present invention.
  • FIG. 34 is a block diagram showing a configuration example of a computer that realizes the packet processing device according to the first to fourth embodiments of the present invention.
  • FIG. 35 is a block diagram showing a configuration of a conventional packet processing device.
  • FIG. 36 is a diagram illustrating an outline of a descriptor of the packet processing device of FIG. 35.
  • FIG. 37 is a flowchart illustrating the operation of the DMA controller of the packet processing device of FIG. 35.
  • FIG. 38 is a block diagram showing another configuration of the conventional packet processing apparatus.
  • FIG. 39 is a diagram illustrating an outline of a descriptor of the packet processing device of FIG. 38.
  • FIG. 40 is a flowchart illustrating the operation of the DMA controller of the packet processing device of FIG. 38.
  • FIG. 41 is a block diagram showing another configuration of the conventional packet processing device.
  • FIG. 42 is a block diagram showing another configuration of the conventional packet processing apparatus.
  • FIG. 43 is a block diagram showing another configuration of the conventional packet processing apparatus.
  • FIG. 1 is a block diagram showing a configuration of a packet processing device according to a first reference example of the present invention.
  • the packet processing device of FIG. 1 is connected to a communication line (not shown), has a line corresponding unit 100 for receiving data from the communication line, and a packet in which packets received from the communication line are stored.
  • the transfer management unit 112 may be configured as a part of the reception processing unit 103.
  • the line correspondence unit 100, the receive buffer 105 for packet coupling, and the coupling threshold control unit 107 have the same configuration as that shown in FIG. 38.
  • the packet coupling unit 110 transfers the packet received by the line corresponding unit 100 to the receiving buffer 105 for packet coupling. At this time, the packet coupling unit 110 concatenates the packet received by the line correspondence unit 100 and the packet already stored in the reception buffer 105 into one combined packet, and puts the packet in the reception buffer 105. Store. Then, when the size of the combined packet in the receive buffer 105 exceeds the threshold set in the combined threshold control unit 107, the packet coupling unit 110 issues a transfer request for the combined packet to the packet memory 101.
  • the packet coupling unit 110 performs when a timeout (when the reception interval between packets exceeds a predetermined period, etc.) occurs before the size of the coupled packet in the reception buffer 105 exceeds the threshold value.
  • a transfer request may be issued.
  • the packet coupling unit 110 records the number of packets combined and the size of each packet in the receive buffer 105, and when issuing a transfer request for the combined packet, the number of combined packets and the size of each packet are recorded. Notify the combined packet transfer unit 111.
  • the combined packet transfer unit 111 is composed of a DMA controller 1111.
  • the combined packet transfer unit 111 transfers the combined packet to the packet memory 101 by one DMA transfer, generates a hardware interrupt, and issues a start request of the reception processing unit 103. Note that hardware interrupts to the processor (not shown) of the packet processing device may not be generated.
  • the combined packet transfer unit 111 is prepared by the transfer management unit 112 (software executed by the processor) for each packet by using the information on the number of combined packets and the size of each packet notified from the packet combination unit 110. The size and the like are written in the packet 1110. Details of the configuration of the descriptor 1110 and the operation of the combined packet transfer unit 111 will be described later.
  • the reception processing unit 103 When the reception processing unit 103 detects the activation request, it reads the packet in the packet memory 101 based on the address information and the size information written in the descriptor 1110 prepared for each packet and sends the packet to the protocol processing unit 104. hand over.
  • the operation of the reception processing unit 103 is equivalent to the operation of the configuration of FIG. 35.
  • the protocol processing unit 104 performs necessary protocol processing on the packet received from the reception processing unit 103. Then, when the required protocol processing is completed, the protocol processing unit 104 releases the area of the packet memory 101 in which the packet passed from the reception processing unit 103 is stored.
  • the operation of the protocol processing unit 104 is equivalent to the operation of the configuration shown in FIG. 35.
  • the reception processing unit 103, the protocol processing unit 104, and the transfer management unit 112 can be realized by software that operates on a general-purpose personal computer or workstation, or can be realized by software that operates in cooperation with a program, and is an FPGA (Field Programmable). It can also be realized by hardware such as Gate Array).
  • the packet memory 101 can be configured as a memory on a personal computer, a communication device, or a communication board.
  • the line correspondence unit 100, the coupling threshold control unit 107, and the packet coupling unit 110 can be configured by a communication device, an FPGA on a communication board, or the like.
  • the reception buffer 105 can be configured by a storage area of an FPGA or the like on a communication device or a communication board, or a storage circuit such as a FIFO (First In, First Out).
  • FIG. 2 shows a configuration example of the descriptor 1110 used by the combined packet transfer unit 111 of this embodiment.
  • a data structure that records the address and the like of the packet memory 101 for reception processing is called a descriptor 1110.
  • the example of FIG. 2 shows a case where N packets are stored in the packet memory 101.
  • the descriptor 1110 of FIG. 2 has valid flags AF # 1 to AF # N indicating whether or not the start addresses A # 1 to A # N of the write destination of the received packet and the start addresses A # 1 to A # N are valid.
  • the received data sizes L # 1 to L # N indicating the packet length of the packet written to the start addresses A # 1 to A # N, and the writing of the packet to the start addresses A # 1 to A # N.
  • the reception completion flags WF # 1 to WF # N which indicate whether or not the above is completed, are written in a plurality of (N sets) data structures.
  • the configuration of the descriptor 1110 is equivalent to the configuration of the descriptor 1020 for reception processing generally used in the configuration of FIG. 35.
  • the descriptor 1110 is actually arranged in a memory on a personal computer, a communication device, or a communication board, similarly to the packet memory 101. It is possible to arrange the descriptor 1110 in the same memory as the packet memory 101, but in that case, which purpose is used can be divided by the address in the memory.
  • the processor of the packet processing device determines the start addresses A # 1 to A # N of the packet writing destination, writes them to the descriptor 1020, and further determines whether or not the start addresses A # 1 to A # N are valid.
  • the valid flags AF # 1 to AF # N shown are rewritten from "invalid" to "valid".
  • the descriptor 1020 has N sets of areas for writing information such as the start address, but the writing order is predetermined. For example, in the example of FIG. 36, the processor writes the first start address A # 1, the second start address A # 2, ..., The Nth start address A # N in this order.
  • Whether or not the start address A # n (n is 1 to N) can be written may be determined, for example, if the valid flag AF # n corresponding to the start address A # n is "invalid".
  • the DMA controller 1021 confirms the valid flag AF # n of the descriptor 1020, and when the valid flag AF # n indicates that the start address A # n is "valid" (in FIG. 37 step S102). Yes), the start address A # n is read from the descriptor 1020 (step S103 in FIG. 37), and the corresponding nth packet is written in the area starting from the start address A # n in the packet memory 101 (step S104 in FIG. 37).
  • the DMA controller 1021 After the completion of this DMA transfer, the DMA controller 1021 writes the received data size L # n indicating the packet length of the nth packet to the descriptor 1020, and the writing of the nth packet set in the descriptor 1020 is completed.
  • the reception completion flag WF # n indicating that is rewritten from “not completed” to “completed” (FIG. 37 step S105).
  • the descriptor 1020 has N regions (sets) of valid flags AF # 1 to AF # N, but the order in which valid flags AF # 1 to AF # N are confirmed is predetermined.
  • the DMA controller 1021 has the first valid flag AF # 1, the second valid flag AF # 2, ..., The Nth valid flag AF # N, and so on. Confirm. After the confirmation is completed, the confirmation is performed again in order from the first valid flag AF # 1.
  • the descriptor 1020 is also provided with N sets of areas for writing the received data sizes L # 1 to L # N and the reception completion flags WF # 1 to WF # N.
  • the DMA controller 1021 has a reception data size L # n and a reception completion flag in the area of the number corresponding to the nth valid flag AF # n in which the nth start address A # n is confirmed to be “valid”. Write WF # n.
  • the processor of the packet processing device periodically checks the reception completion flag WF # n of the descriptor 1020, and if the reception completion flag WF # n indicates "completed", the corresponding nth. Using the information of the start address A # n and the information of the received data size L # n, the nth packet from the packet memory 101 is read, and necessary processing (for example, protocol processing) is performed.
  • the processor rewrites the nth valid flag AF # n of the descriptor 1020 corresponding to the nth packet after processing from "valid" to "invalid”, and at the same time, the nth reception completion flag WF of the descriptor 1020. Rewrite # n from "completed” to "unfinished”.
  • the descriptor 1020 has N areas (sets) of reception completion flags WF # 1 to WF # N, but the order in which reception completion flags WF # 1 to WF # N are confirmed is predetermined. For example, in the examples of FIGS. 36 and 37, the processor in the order of the first reception completion flag WF # 1, the second reception completion flag WF # 2, ..., The Nth reception completion flag WF # N, and so on. Confirm to. After the confirmation is completed, the confirmation is performed again in order from the first reception completion flag WF # 1.
  • the DMA controller 1021 makes an interrupt processing request to the processor after the DMA transfer is completed, and instead of the processor periodically checking the reception completion flags WF # 1 to WF # N, the processor performs DMA.
  • the reception completion flags WF # 1 to WF # N may be confirmed when the interrupt processing request from the controller 1021 is received.
  • FIG. 3 is a flowchart explaining the operation of the transfer management unit 112
  • FIGS. 4 and 5 are flowcharts explaining the operation of the DMA controller 1111
  • FIG. 6 is a flowchart explaining the operation of the reception processing unit 103.
  • the transfer management unit 112 sets the initial setting of the packet processing device to the address of the start data of each of N packets on the packet memory 101, that is, the start address of the write destination of each packet.
  • a # n (n is 1 to N) is determined and written in the descriptor 1020 (step S300 in FIG. 3). Further, the transfer management unit 112 rewrites the valid flag AF # n indicating whether or not the start address A # n is valid from “invalid” to “valid” (step S301 in FIG. 3).
  • the descriptor 1110 has N sets of areas for writing information such as the start address, but the writing order is predetermined. For example, in the example of FIG. 2, the transfer management unit 112 writes the first start address A # 1, the second start address A # 2, ..., The Nth start address A # N in this order.
  • Whether or not the start address A # n can be written may be determined, for example, if the valid flag AF # n corresponding to the start address A # n is "invalid". This operation is equivalent to that of the prior art.
  • the DMA controller 1111 in the combined packet transfer unit 111 initializes the variable n indicating the order of reading and writing of the descriptor 1110 to 1 (step S400 in FIG. 4). Then, when the packet coupling unit 110 issues a transfer request, the DMA controller 1111 confirms the nth valid flag AF # n of the descriptor 1110 (step S401 in FIG. 4).
  • the DMA controller 1111 When the valid flag AF # n indicates that the nth start address A # n is "valid" (yes in step S402 of FIG. 4), the DMA controller 1111 has information from the packet coupling unit 110 (combined). The number of packets and the size of each packet) are confirmed, and it is confirmed whether the data to be transferred to the packet memory 101 is a single packet that is not combined or a combined packet (step S403 in FIG. 4).
  • the DMA controller 1111 confirms that the corresponding valid flag AF # n is "valid" when the data to be transferred to the packet memory 101 is not a combined packet (when the number of combined packets is 1).
  • the start address A # n of the packet is read from the descriptor 1110 (step S404 in FIG. 4), and the corresponding nth packet is written in the area starting from the start address A # n of the packet memory 101 by DMA transfer (step S405 in FIG. 4).
  • the DMA controller 1111 After the completion of this DMA transfer, the DMA controller 1111 writes the received data size L # n indicating the packet length of the nth packet to the descriptor 1110, and the writing of the nth packet set in the descriptor 1110 is completed.
  • the reception completion flag WF # n indicating that the packet has been completed is rewritten from “not completed” to “completed” (step S406 in FIG. 4).
  • the DMA controller 1111 determines whether the variable n is equal to N (step S407 in FIG. 4). When the variable n has not reached N (no in step S407), the DMA controller 1111 increments the variable n by 1 (step S408 in FIG. 4), and returns to step S401. Further, when the variable n reaches N (yes in step S407), the DMA controller 1111 returns to step S400.
  • the descriptor 1110 is prepared with N areas (sets) of the effective flags AF # 1 to AF # N, but the order in which the effective flags AF # 1 to AF # N are confirmed is predetermined. ..
  • the DMA controller 1111 has the first valid flag AF # 1, the second valid flag AF # 2, ..., The Nth valid flag AF # N, and so on. Confirm.
  • the DMA controller 1111 initializes the variable n to 1 (step S400), and confirms again in order from the first valid flag AF # 1.
  • the descriptor 1110 is also provided with N sets of areas for writing the received data sizes L # 1 to L # N and the reception completion flags WF # 1 to WF # N.
  • the DMA controller 1111 has a reception data size L # n and a reception completion flag in the area of the number corresponding to the nth valid flag AF # n in which the nth start address A # n is confirmed to be “valid”. Write WF # n.
  • the DMA controller 1111 confirms the number k of the combined packets (step S409 in FIG. 5).
  • the reason for confirming the "k-1" valid flags is that the nth valid flag AF # n has already been confirmed in step S402.
  • the DMA controller 1111 may check the valid flags from AF # 1 to AF # (k-1). When n ⁇ N and n + k-1> N, the DMA controller 1111 is effective from AF # (n + 1) to AF # N and from AF # 1 to AF # (k-1- (Nn)). Just check the flag.
  • step S410 When all the k valid flags confirmed by the processing of steps S402 and S410 are "valid" (yes in step S410), the DMA controller 1111 is the first valid flag AF # among the k valid flags confirmed.
  • the n-th head address A # n corresponding to n is read from the descriptor 1110 (step S411 in FIG. 5), and the corresponding combined packet is written in the area starting from the head address A # n of the packet memory 101 by DMA transfer (FIG. 5). Step S412).
  • the DMA controller 1111 determines the packet length of each packet constituting the coupled packet that has been DMA-transferred to the packet memory 101 based on the information (size of each coupled packet) notified from the packet coupling unit 110.
  • the received data sizes L # n to L # (n + k-1) indicating the above are written in the descriptor 1110 (step S413 in FIG. 5).
  • the DMA controller 1111 may write the received data size L # n and the received data sizes from L # 1 to L # (k-1) to the descriptor 1110.
  • the DMA controller 1111 has a received data size L # n, L # (n + 1) to L # N, and L # 1 to L # (k-1-(k-1-(. The received data size up to Nn)) may be written to the descriptor 1110.
  • the DMA controller 1111 sets the "k-1" start addresses A # (n + 1) to A # (n + k-1) in the descriptor 1110 to the first of the k packets constituting the combined packet. It is rewritten according to the packet length of "k-1" packets (step S414 in FIG. 5).
  • the DMA controller 1111 has the start address A # n for the start address A # (n + 1) and the packet length (received data size L) of the first packet out of the k packets constituting the combined packet. Rewrite to the value obtained by adding (the value indicated by # n). Further, the DMA controller 1111 has, for the head address A # (n + k-1), the head address A # (n + k-2) and the "k-1" th packet among the k packets constituting the combined packet. Rewrite the value by adding the packet length (value indicated by the received data size L # (n + k-2)).
  • the DMA controller 1111 rewrites the start address A # i, the previous start address A # (i-1) and the "i-1" th packet among the packets constituting the combined packet It may be rewritten to the value obtained by adding the packet length.
  • the DMA controller 1111 rewrites the reception completion flags WF # n to WF # (n + k-1) corresponding to each packet constituting the combined packet DMA-transferred to the packet memory 101 from "unfinished” to "completed”. (FIG. 5 step S415).
  • the combined packet in which k packets are concatenated is collectively transferred to the packet memory 101, and the information of the start address of the descriptor 1110 is partially rewritten, whereby the processor of the packet processing device ( The reception processing unit 103 and the protocol processing unit 104) are notified of the address in which the beginning of each packet is written.
  • the reception processing unit 103 (software executed by the processor) periodically checks the reception completion flag WF # n (n is 1 to N) of the descriptor 1110, and the reception completion flag WF # n indicates "complete”. If yes (yes in step S501 of FIG. 6), the protocol processing unit reads the nth packet from the packet memory 101 based on the information of the corresponding nth start address A # n and the information of the received data size L # n. Pass it to 104 (step S502 in FIG. 6).
  • the reception processing unit 103 (software executed by the processor) has the descriptor 1110 corresponding to the nth packet for which the protocol processing has been completed.
  • the nth valid flag AF # n of is rewritten from "valid” to "invalid”
  • the nth reception completion flag WF # n of the processor 1110 is rewritten from "completed” to "unfinished” (FIG. 6, step S504). ..
  • the descriptor 1110 has N areas (sets) of reception completion flags WF # 1 to WF # N, but the order in which reception completion flags WF # 1 to WF # N are confirmed is predetermined.
  • the reception processing unit 103 (software executed by the processor) has the first reception completion flag WF # 1, the second reception completion flag WF # 2, ..., The Nth reception completion flag WF # N, and so on. Check in order. After the confirmation is completed, the confirmation is performed again in order from the first reception completion flag WF # 1.
  • the DMA controller 1111 issues an interrupt processing request to the processor after the completion of the DMA transfer, and the reception processing unit responds to the interrupt processing request.
  • 103 (software executed by the processor) may check the reception completion flag WF # n (n is 1 to N) of the descriptor 1110.
  • the operation of the above processor is equivalent to the operation of the conventional processor (software) having the configuration shown in FIG. 35, and it is necessary to realize the process of restoring the combined packet into a plurality of original packets with the software for reception processing. There is no. That is, the reception processing unit 103 and the protocol processing unit 104 may perform the same processing as before even when the combined packet is written to the packet memory 101 as in this reference example.
  • the packet processing device of this reference example is a means (DMA controller) that can realize collective DMA transfer and write information for restoring a combined packet to a plurality of original packets in the descriptor 1110. It includes a combined packet forwarding unit 111 having a built-in 1111). Since the DMA controller 1111 can be implemented by hardware, it is not necessary to execute the restoration process by software, and it is possible to realize high reception performance due to the effect of collective DMA transfer.
  • the software for the reception processing unit 103 and the protocol processing unit 104 having the configuration of FIG. 35 can be used as they are in the packet processing device of this reference example. This indicates that the reception performance can be improved by the collective DMA simply by changing the hardware (DMA controller 1111).
  • the transfer management unit 112 (software executed by the processor) needs to prepare an address area having a size capable of writing the maximum size of the combined packet and set it in the descriptor 1110.
  • the maximum size of the combined packet is a value obtained by adding the maximum allowable packet length to the threshold set in the combined threshold control unit 107.
  • the transfer management unit 112 (software executed by the processor) has N ⁇ DB_max (DB_max is the combined packet) in the packet memory 101 in advance. It is necessary to secure a buffer area (maximum size). This area securing is equivalent to the case of the configuration of FIG. 38.
  • the start address of this buffer area is set by the transfer management unit 112 (software executed by the processor), FIG.
  • the final address of the buffer area is the start address A # 1 + (N ⁇ DB_mux) -1.
  • the start address A # N in FIG. 2 set by the transfer management unit 112 (software executed by the processor) is the start address A # 1 + (N-1) ⁇ DB_max.
  • the forwarding address of the DMA transfer of the combined packet is A # N
  • the area for DB_mux from this address A # N to the final address of the above buffer area is secured in the packet memory 101. Therefore, the combined packet can be reliably written in the continuous area of this DB_mux.
  • the buffer area to be secured in the packet memory 101 is prepared not in a continuous area but in N areas for example, N areas for DB_mux are prepared in advance, and the start address of each area is set to A.
  • # 1 to A # N in the transfer management unit 112 software executed by the processor
  • the combined packet can be reliably written in the continuous area for DB_mux, and it will be written in the area that should not be written originally. Such a problem does not occur.
  • the DMA controller 1111 rewrites the information (start address, received data size, reception completion flag) of the descriptor 1110 after the DMA transfer, so that the restoration process by software is not required.
  • the restoration process is to be realized by the hardware of the reception processing unit 103, the protocol processing unit 104, or the combined packet separation unit 108 of FIG. 41, the information required for the restoration processing (number of combined packets, size for each packet) is provided.
  • a means for notifying the reception processing unit 103, the protocol processing unit 104, or the combined packet separation unit 108 of FIG. 41 from the packet coupling unit 106 is required.
  • the restoration processing is to be realized by the hardware of the reception processing unit 103, the protocol processing unit 104, or the combined packet separation unit 108 of FIG. 41, there may be a plurality of restoration processes from the completion of the DMA transfer until the reception processing is started. It must be taken into consideration that it is necessary to retain the information necessary for the restoration process for the combined packets of.
  • the scale of the hardware in this reference example is smaller than that in the case where the restoration process is realized by the hardware of the reception processing unit 103, the protocol processing unit 104, or the combined packet separation unit 108 of FIG.
  • the information required for the restoration processing is contained in the combined packet. It is also possible to write in. Specifically, in order to notify the size of each combined packet, for example, a method in which a header in which the packet size or the like is written is added before each packet and the additional header is DMA-transferred together with the packet data can be considered.
  • the combined packet transfer unit 111 is realized by hardware, but at least a part of the processing of the combined packet transfer unit 111 is implemented by a processor and software different from the processor used for the reception processing. It is also possible. Even when at least a part of the processing of the combined packet transfer unit 111 is realized by software in this way, it is not necessary for the reception processing unit 103 or the protocol processing unit 104 to perform the processing of restoring the combined packet to the original plurality of packets. It is possible to realize high reception performance due to the effect of collective DMA transfer.
  • the processing of the combined packet forwarding unit 111 is realized by software, the processing of restoring the combined packet to a plurality of original packets is performed in the same manner as when the combined packet forwarding unit 111 is realized by hardware.
  • the effect of reducing the scale of the required hardware (effect of not having to hold information for multiple combined packets) and the effect of not degrading the effective band that can be used for packet data transfer (for restoration processing). The effect of not adding the necessary information to the combined packet) can be obtained.
  • an area of a rewrite execution flag indicating whether or not the start address has been rewritten may be added to the descriptor 1110.
  • the processor that implements the transfer management unit 112 that performs the initial setting of the start addresses A # 1 to A # N has a cache memory
  • the start addresses A # 1 to A # N written in the descriptor 1110 are It is copied into the cache memory.
  • the processor can refer to the rewrite execution flag in order to read the information in the descriptor 1110 instead of the information in the cache memory.
  • the processor determines that the start address in the descriptor 1110 has not been rewritten as a result of referring to the rewrite execution flag, the processor reads and uses the information in the cache memory, and the start address in the descriptor 1110 is changed.
  • the cache may be temporarily disabled and the start address in the descriptor 1110 may be directly read and used.
  • the combined packet transfer unit 111 rewrites the corresponding rewrite execution flag in the descriptor 1110 from "rewrite not executed” to "rewrite execution". You can do it like this.
  • the descriptor 1110 is provided with an area in which the DMA controller 1111 writes the changed start address, in addition to the area of the start address written by the transfer management unit 112 (software executed by the processor). You may.
  • the reception processing unit 103 (software executed by the processor) refers to the area in which the changed start address is written.
  • the process described in step S414 of FIG. 5 is not a process of rewriting the start address, but a process of writing the changed start address.
  • a plurality of DMA controllers 1111 and descriptors 1110 corresponding to the respective DMA controllers 1111 may be mounted. Further, the packet coupling unit 110 may determine the type of packet and combine the packets of the same type as a coupled packet, or the plurality of DMA controllers 1111 and the plurality of descriptors 1110 may be used properly according to the packet type. May be good.
  • a DMA controller 1111 and a descriptor 1110 are prepared for each packet type, and a plurality of DMA controllers 1111 and a plurality of descriptors 1110 are used properly according to the packet type, different reception processing may be performed for each packet type. It will be easier.
  • a plurality of DMA controllers 1111 and a plurality of descriptors 1110 may be used properly for each core of a processor having a plurality of CPU cores, or a plurality of DMA controllers 1111 and a plurality of DMA controllers 1111 may be used for each virtual machine. It may be configured to use the descriptor 1110 properly.
  • FIG. 7 is a block diagram showing a configuration of a packet processing device according to a second reference example of the present invention.
  • the packet processing device of FIG. 7 transfers the line correspondence unit 100, the packet memory 101, the reception processing unit 103, the protocol processing unit 104, the reception buffer 105, the coupling threshold control unit 107, the packet coupling unit 110, and the like. It is composed of a management unit 112 and a combined packet transfer unit 113.
  • the difference between the configuration of FIG. 7 and the configuration of FIG. 1 is that the transfer means in FIG. 1 is replaced with the writing means by the processor (software) of the packet processing device. That is, in this reference example, the combined packet transfer unit 111 of FIG. 1 is replaced with the combined packet transfer unit 113 by software.
  • the line correspondence unit 100, the packet memory 101, the reception processing unit 103, the protocol processing unit 104, the reception buffer 105, the coupling threshold control unit 107, and the transfer management unit 112 have the same configuration as that shown in FIG.
  • the packet coupling unit 110 of FIG. 7 transfers the packet received by the line corresponding unit 100 to the receiving buffer 105 for packet coupling. At this time, the packet coupling unit 110 puts the packet into the reception buffer 105 so as to combine the packet received by the line correspondence unit 100 and the packet already stored in the reception buffer 105 into one combined packet. Store. Then, when the size of the combined packet in the receive buffer 105 exceeds the threshold set in the combined threshold control unit 107, the packet coupling unit 110 issues a transfer request for the combined packet to the packet memory 101.
  • the packet coupling unit 110 transfers the packet when a timeout (such as when the interval between packets exceeds a predetermined period) occurs before the size of the coupled packet in the receive buffer 105 exceeds the threshold value. You may want to issue a request. Further, the packet coupling unit 110 records the number of coupled packets and the size of each packet in the receive buffer 105, and when issuing a transfer request for the combined packet, information on the number of combined packets and the size of each packet. Is notified to the combined packet transfer unit 113.
  • the combined packet transfer unit 113 (software executed by the processor) writes a combined packet in which a plurality of packets are combined into the packet memory 101, and makes a start request of the reception processing unit 103. Further, the combined packet transfer unit 113 (software executed by the processor) uses the information on the number of combined packets and the size of each packet notified from the packet coupling unit 110, and the transfer management unit 112 (executed by the processor). The software) writes information such as size to the processor 1130 prepared for each packet.
  • the configuration of the descriptor 1130 is equivalent to the configuration of the descriptor 1110 of the first reference example.
  • the combined packet transfer unit 113 (software executed by the processor) writes to the descriptor 1130 instead of the combined packet transfer unit 111.
  • 9 and 10 are flowcharts explaining the operation of the combined packet transfer unit 113 (software executed by the processor).
  • the combined packet transfer unit 113 initializes the variable n to 1 (step S600 in FIG. 9), and confirms the valid flag AF # n of the descriptor 1130 after the transfer request is issued from the packet coupling unit 110 (FIG. 9). 9 steps S601).
  • the combined packet forwarding unit 113 confirms the information from the packet combining unit 110. , Check whether the data to be transferred to the packet memory 101 is a single packet or a combined packet (step S603 of FIG. 9).
  • the combined packet forwarding unit 113 reads the start address A # n confirmed that the valid flag AF # n is “valid” from the descriptor 1130 (FIG. 9). In step S604), the corresponding nth packet is written to the area starting from the start address A # n of the packet memory 101 (FIG. 9 step S605).
  • the combined packet transfer unit 113 writes the received data size L # n to the descriptor 1130 and rewrites the reception completion flag WF # n set in the descriptor 1130 from "unfinished” to "completed” ( FIG. 9 step S606).
  • the above processes of steps S600 to S606 and steps S607 and S608 are equivalent to the processes of steps S400 to S408 of FIG.
  • the combined packet transfer unit 113 confirms the number k of the combined packets (step S609 in FIG. 10), and the combined packet transfer unit 113 confirms the number k of "k-1" in the descriptor 1130. Check the valid flags AF # (n + 1) to AF # (n + k-1) (step S610 in FIG. 10).
  • the combined packet transfer unit 113 has a start address corresponding to the first valid flag AF # n among the confirmed k valid flags.
  • a # n is read from the descriptor 1130 (step S611 in FIG. 10), and the corresponding combined packet is written in the area starting from the start address A # n of the packet memory 101 (step S612 in FIG. 10).
  • the combined packet transfer unit 113 writes the received data sizes L # n to L # (n + k-1) indicating the packet length of each packet constituting the combined packet written in the packet memory 101 to the descriptor 1130 ( FIG. 10 Step S613).
  • the combined packet transfer unit 113 sets the “k-1” start addresses A # (n + 1) to A # (n + k-1) in the descriptor 1130 among the k packets constituting the combined packet. It is rewritten according to the packet length of the first "k-1" packet (step S614 in FIG. 10).
  • the combined packet transfer unit 113 changes the reception completion flags WF # n to WF # (n + k-1) corresponding to each packet constituting the combined packet written in the packet memory 101 from "unfinished” to "completed". Rewrite (FIG. 10 step S615).
  • steps S609 to S615 and steps S616 to S618 are equivalent to the processes of steps S409 to S418 of FIG.
  • the packet processing device of this reference example is provided with means (combined packet transfer unit 113) that can realize collective writing and write information for restoring the combined packet to the original plurality of packets to the descriptor 1130. ing.
  • the packet processing device of this reference example it is possible to eliminate the need to execute the restoration processing in the reception processing unit 103, the protocol processing unit 104, or the combined packet separation unit 108 in FIG. 41, and the reception is highly effective due to the effect of collective writing. It is possible to achieve performance.
  • the software for the reception processing unit 103 and the protocol processing unit 104 having the configuration of FIG. 35 can be used as they are in the packet processing device of this reference example.
  • the transfer management unit 112 (software executed by the processor) has N ⁇ in the packet memory 101 in advance. It is necessary to secure a buffer area of DB_mux (DB_mux is the maximum size of the combined packet). This area reservation is equivalent to the case of the configurations of FIGS. 38 and 1.
  • the combined packet transfer unit 113 rewrites the information (start address, received data size, reception completion flag) of the descriptor 1130 after the collective writing is completed, thereby eliminating the need for restoration processing.
  • the information required for the restoration processing (number of combined packets, size for each packet) is provided in the packet combining unit.
  • a means for notifying the reception processing unit 103, the protocol processing unit 104, or the combined packet separation unit 108 of FIG. 43 from 106 is required.
  • a plurality of combined packets may be used after the collective writing is completed until the reception processing is started. It must be taken into account that it is necessary to retain the information needed for the packet restoration process.
  • the scale of the hardware in this reference example is smaller than that in the case where the restoration process is realized by the reception processing unit 103, the protocol processing unit 104, or the combined packet separation unit 108 of FIG. 43. This is the same even if the process of restoring the combined packet to the original plurality of packets is implemented by software.
  • the information required for the restoration processing for a plurality of combined packets (the number of combined packets, the size of each packet). Needs to be stored in the packet memory 101 or the like.
  • the information for a plurality of combined packets (the number of combined packets, the size of each packet). No need to hold. That is, it is only necessary to hold the information (the number of combined packets, the size of each packet) necessary for the restoration processing of only one combined packet in the packet memory 101 or the like.
  • the configuration of this reference example is the capacity (writable) of the packet memory 101 or the like used for holding the information (number of combined packets, size for each packet) required for the restoration process, as compared with the configuration of FIG. 43.
  • the number of bits) can be small, and the scale of the required hardware can be reduced.
  • the information required for the restoration processing is contained in the combined packet. It is also possible to write in. Specifically, in order to notify the size of each combined packet, for example, a method in which a header in which the packet size or the like is written is added before each packet and an additional header is written together with the packet data can be considered. However, in this case, since a part of the bus bandwidth used for collective writing is occupied by the information required for the restoration process, the effective bandwidth that can be used for writing the original packet data becomes smaller, and the effective bandwidth is reduced. As a result, the performance of collective writing deteriorates.
  • the information required for the restoration process is not the packet memory 101 but another memory (writing from the packet coupling unit 110 and combined packet transfer) that does not use the bus to which the packet memory 101 is connected. It is sufficient if only reading from the unit 113 is possible), and the above-mentioned deterioration of the effective band does not occur.
  • an area of a rewrite execution flag indicating whether or not the start address has been rewritten may be added to the descriptor 1130.
  • the combined packet transfer unit 113 changes the corresponding rewrite execution flag in the descriptor 1130 from "rewrite not executed" to "rewrite execution". It should be rewritten as.
  • the transfer management unit 112 in addition to the area of the start address written by the transfer management unit 112 (software executed by the processor), the area in which the combined packet transfer unit 113 writes the changed start address is set in the descriptor 1130. You may prepare it.
  • the packet coupling unit 110 may determine the packet type and combine the packets of the same type as a coupled packet, or may use a plurality of descriptors 1130 properly according to the packet type. .. If descriptors 1130 are prepared for each type of packet and a plurality of descriptors 1130 are used properly according to the type of packet, it becomes easy to perform different reception processing for each type of packet.
  • a plurality of descriptors 1130 may be used properly for each core of a processor having a plurality of CPU cores, or a plurality of descriptors 1130 may be used properly for each virtual machine.
  • a plurality of descriptors 1130 for each CPU core or for each virtual machine, the performance of write processing and read processing by software is improved as compared with the case where only one descriptor 1130 is used.
  • FIG. 11 is a block diagram showing a configuration of a packet processing device according to the first embodiment of the present invention.
  • the packet processing device of FIG. 11 is connected to a communication line (not shown), has a line corresponding unit 100 that receives data from the communication line, processes the packet received from the communication line, and outputs the processing result data.
  • a reception processing unit 117 that passes the stored data to the data processing unit 116, a reception buffer 118 for data combination, a combination threshold control unit 119 in which a threshold for regulating the size of the data block is set in advance, and a packet processing unit.
  • a data combining unit 120 that concatenates a plurality of data output from 114 to generate a data block, a combined data transfer unit 121 that DMA-transfers the data block generated by the data combining unit 120 to the data memory 115, and a combined data transfer unit 121 in advance. It is composed of a transfer management unit 122 that performs initial settings of the descriptor 1210, which is a data area on a defined memory.
  • the transfer management unit 122 may be configured as a part of the reception processing unit 117.
  • the difference between the configuration of FIG. 11 and the configuration of FIG. 1 is that the packet processing unit 114 is added, and the packet memory 101, the reception processing unit 103, the protocol processing unit 104, the reception buffer 105, the coupling threshold control unit 107, the packet coupling unit 110,
  • the combined packet transfer unit 111 and transfer management unit 112 are divided into a data memory 115, a reception processing unit 117, a data processing unit 116, a reception buffer 118, a combined threshold control unit 119, a data combined unit 120, a combined data transfer unit 121, and a transfer, respectively.
  • This is a point replaced by the management unit 122.
  • the line correspondence unit 100 has the same configuration as that shown in FIG.
  • the packet processing unit 114 processes the packet output by the line corresponding unit 100 and outputs the processing result data.
  • the content of the processing is, for example, a process of extracting and outputting data of a predetermined size from the beginning of a packet when the packet length exceeds a predetermined size, an IP (Internet Protocol) header, etc.
  • Various processes can be considered, such as a process of extracting and outputting specific data of the above, a process of counting up the number of packets for each packet type and outputting updated counter information.
  • the data combining unit 120 transfers the data output by the packet processing unit 114 to the receiving buffer 118 for data combining. At this time, the data combining unit 120 stores the data in the receiving buffer 118 so as to concatenate the data output by the packet processing unit 114 and the data already stored in the receiving buffer 118 into one data block. To do. Then, when the size of the data block in the receive buffer 118 exceeds the threshold value set in the join threshold control unit 119, the data coupling unit 120 issues a transfer request for the data block to the data memory 115.
  • the data coupling unit 120 performs when a timeout (when the reception interval between packets exceeds a predetermined period, etc.) occurs before the size of the data block in the reception buffer 118 exceeds the threshold value.
  • a transfer request may be issued.
  • the data combining unit 120 records the number of combined data and the size of each data in the receive buffer 118, and when issuing the transfer request of the data block, the number of combined data and the size of each data are recorded. Notify the combined data transfer unit 121.
  • the size of the data output by the packet processing unit 114 is a predetermined fixed value (does not change for each packet), it is possible to omit the notification of the data size, but even in that case, a timeout occurs. It is necessary to notify the number of combined data when the transfer occurs due to.
  • the combined data transfer unit 121 is composed of a DMA controller 1211.
  • the combined data transfer unit 121 transfers a data block in which a plurality of data are combined to the data memory 115 by one DMA transfer, generates a hardware interrupt, and issues a start request for the reception processing unit 117. Note that hardware interrupts to the processor (not shown) of the packet processing device may not be generated.
  • the combined data transfer unit 121 is prepared by the transfer management unit 122 (software executed by the processor) for each data by using the information on the number of combined data and the size of each data notified from the data combination unit 120.
  • the size and the like are written in the descriptor 1210.
  • the configuration of the descriptor 1210 corresponds to the description of the descriptor 1110 in FIG. 2 in which "packet" is replaced with "data”. Therefore, in the following description, the reference numerals in FIG. 2 will be used.
  • the reception processing unit 117 When the reception processing unit 117 detects a start request, the reception processing unit 117 reads out the data in the data memory 115 based on the address information and the size information written in the descriptor 1210 prepared for each data, and the data processing unit 116 Pass to. At the same time, the reception processing unit 117 secures a new area of the data memory 115 from the memory of the packet processing device in order to replenish the data memory portion passed to the data processing unit 116.
  • the operation of the reception processing unit 117 is equivalent to the operation of the configuration shown in FIG. 42, and it is not necessary to implement the combined data separation unit 108b required in the configuration of FIG. 42 (a data block in which a plurality of data are combined). The process of restoring the original plurality of data is performed by the combined data transfer unit 121).
  • the data processing unit 116 performs necessary processing on the data received from the reception processing unit 117. Then, when the necessary processing is completed, the data processing unit 116 releases the area of the data memory 115 in which the data passed from the reception processing unit 117 is stored.
  • the reception processing unit 117, the data processing unit 116, and the transfer management unit 122 can be realized by software that operates on a general-purpose personal computer or workstation, or hardware such as an FPGA that operates in cooperation with a program. It is also possible to realize with.
  • the data memory 115 can be configured as a memory on a personal computer, a communication device, or a communication board.
  • the line correspondence unit 100, the packet processing unit 114, the coupling threshold control unit 119, the data coupling unit 120, and the combined data transfer unit 121 can be configured by a communication device, an FPGA on a communication board, or the like.
  • the reception buffer 118 can be configured by a storage area of an FPGA or the like on a communication device or a communication board, or a storage circuit such as a FIFO or the like.
  • FIGS. 11 to 15. 12 is a flowchart explaining the operation of the transfer management unit 122
  • FIGS. 13 and 14 are flowcharts explaining the operation of the DMA controller 1211
  • FIG. 15 is a flowchart explaining the operation of the reception processing unit 117.
  • the transfer management unit 122 sets the initial setting of the packet processing device to the address of the head of each of N data on the data memory 115, that is, the head of the write destination of each data.
  • the address A # n (n is 1 to N) is determined and written to the descriptor 1210 (step S300a in FIG. 12). Further, the transfer management unit 122 rewrites the valid flag AF # n indicating whether or not the start address A # n is valid from “invalid” to “valid” (step S301a in FIG. 12). Similar to the descriptor 1110, the descriptor 1210 is provided with N sets of areas for writing information such as the start address.
  • the DMA controller 1211 in the combined data transfer unit 121 initializes the variable n indicating the order of reading and writing of the descriptor 1210 to 1 (step S400a in FIG. 13). Then, when the transfer request is issued from the data coupling unit 120, the DMA controller 1211 confirms the nth valid flag AF # n of the descriptor 1210 (step S401a in FIG. 13).
  • the DMA controller 1211 When the valid flag AF # n indicates that the nth start address A # n is "valid" (yes in step S402a of FIG. 13), the DMA controller 1211 has information from the data coupling unit 120 (combined). The number of data and the size of each data) are confirmed, and it is confirmed whether the data to be transferred to the data memory 115 is uncombined single data or a data block (step S403a in FIG. 13).
  • the DMA controller 1211 confirmed that the corresponding valid flag AF # n is "valid" when the data to be transferred to the data memory 115 is not a data block (when the number of combined data is 1).
  • a DMA transfer is performed in which the th-th head address A # n is read from the descriptor 1210 (step S404a in FIG. 13) and the corresponding n-th data is written in the area starting from the head address A # n in the data memory 115 (step S405a in FIG. 13). ).
  • the DMA controller 1211 After the completion of this DMA transfer, the DMA controller 1211 writes the received data size L # n indicating the data length of the nth data to the descriptor 1210, and the writing of the nth data set in the descriptor 1210 is completed.
  • the reception completion flag WF # n indicating that the data has been completed is rewritten from “not completed” to “completed” (step S406a in FIG. 13).
  • the DMA controller 1211 determines whether the variable n is equal to N (step S407a in FIG. 13). When the variable n has not reached N (no in step S407a), the DMA controller 1211 increments the variable n by 1 (step S408a in FIG. 13), and returns to step S401a. Further, when the variable n reaches N (yes in step S407a), the DMA controller 1211 returns to step S400a.
  • the order of checking the valid flags AF # 1 to AF # N is predetermined. For example, in the examples of FIGS. 2 and 13, the DMA controller 1211 has the first valid flag AF # 1, the second valid flag AF # 2, ..., The Nth valid flag AF # N, and so on. Confirm. After the confirmation is completed, the DMA controller 1211 initializes the variable n to 1 (step S400a), and confirms again in order from the first valid flag AF # 1.
  • the DMA controller 1211 confirms the number k of the combined data when the data to be transferred to the data memory 115 is a data block (when the number k of the combined data is 2 or more) (step S409a in FIG. 14). , Confirm the "k-1" valid flags AF # (n + 1) to AF # (n + k-1) in the descriptor 1210 (step S410a in FIG. 14).
  • the DMA controller 1211 may check the valid flags from AF # 1 to AF # (k-1). Further, when n ⁇ N and n + k-1> N, the DMA controller 1211 is effective from AF # (n + 1) to AF # N and from AF # 1 to AF # (k-1- (Nn)). Just check the flag.
  • step S410a When all the k valid flags confirmed by the processing of steps S402a and S410a are "valid" (yes in step S410a), the DMA controller 1211 has the first valid flag AF # among the confirmed k valid flags.
  • the n-th start address A # n corresponding to n is read from the descriptor 1210 (step S411a in FIG. 14), and the corresponding data block is written to the area starting from the start address A # n of the data memory 115 by DMA transfer (FIG. FIG. 14 steps S412a).
  • the DMA controller 1211 determines the data of each data constituting the data block DMA transferred to the data memory 115 based on the information (size of each combined data) notified from the data combining unit 120.
  • the received data sizes L # n to L # (n + k-1) indicating the length are written in the descriptor 1210 (step S413a in FIG. 14).
  • the DMA controller 1211 writes the received data size L # n and the received data sizes from L # 1 to L # (k-1) to the descriptor 1210. It should be.
  • the DMA controller 1211 has received data sizes L # n, L # (n + 1) to L # N, and L # 1 to L # (k-1-(k-1-(. The received data size up to Nn)) may be written to the descriptor 1210.
  • the DMA controller 1211 sets the start addresses A # (n + 1) to A # (n + k-1) of "k-1" in the descriptor 1210 to the first of the k data constituting the data block.
  • the data is rewritten according to the data length of "k-1" data (step S414a in FIG. 14).
  • the DMA controller 1211 has the start address A # n for the start address A # (n + 1) and the data length (received data size L) of the first data among the k data constituting the data block. Rewrite to the value obtained by adding (the value indicated by # n). Further, the DMA controller 1211 has the start address A # (n + k-2) for the start address A # (n + k-1) and the "k-1" th data among the k data constituting the data block. Rewrite the value by adding the data length (value indicated by the received data size L # (n + k-2)).
  • the DMA controller 1211 rewrites the start address A # i, the previous start address A # (i-1) and the "i-1" th data among the data constituting the data block It may be rewritten to the value obtained by adding the data length.
  • the DMA controller 1211 changes the reception completion flags WF # n to WF # (n + k-1) corresponding to the data constituting the data block DMA-transferred to the data memory 115 from "unfinished” to "completed”.
  • Rewrite (FIG. 14 step S415a).
  • the data blocks in which k pieces of data are concatenated are collectively transferred to the data memory 115, and the information of the start address of the descriptor 1210 is partially rewritten, thereby causing the processor of the packet processing apparatus.
  • (Reception processing unit 117 and data processing unit 116) are notified of the address where the beginning of each data is written.
  • the reception processing unit 117 (software executed by the processor) periodically checks the reception completion flag WF # n (n is 1 to N) of the descriptor 1210, and the reception completion flag WF # n indicates “completed”. If yes (yes in step S501a in FIG. 15), the nth data is read from the data memory 115 and data processing is performed based on the information of the corresponding nth start address A # n and the information of the received data size L # n. It is passed to the unit 116 (step S502a in FIG. 15).
  • the reception processing unit 117 (software executed by the processor) of the descriptor 1210 corresponding to the nth data for which the processing has been completed.
  • the nth valid flag AF # n is rewritten from "valid” to "invalid”
  • the nth reception completion flag WF # n of the descriptor 1210 is rewritten from "completed” to "unfinished” (step S504a in FIG. 15).
  • the descriptor 1210 has N areas (sets) of reception completion flags WF # 1 to WF # N, but the order in which reception completion flags WF # 1 to WF # N are confirmed is It is decided in advance.
  • the DMA controller 1211 issues an interrupt processing request to the processor after the completion of the DMA transfer, and the reception processing unit responds to the interrupt processing request.
  • 117 (software executed by the processor) may check the reception completion flag WF # n (n is 1 to N) of the descriptor 1210.
  • the packet processing apparatus of this embodiment can realize collective DMA transfer, and is a means (DMA controller) for writing information for restoring a data block to a plurality of original data to the descriptor 1210.
  • a combined data transfer unit 121 having a built-in 1211) is provided. Since the DMA controller 1211 can be implemented by hardware, it is not necessary to execute the restoration process by software, and it is possible to realize high reception performance due to the effect of collective DMA transfer.
  • the processor (software) executes the process of restoring the data block in which a plurality of data are combined to the original plurality of data in the conventional packet processing device having the configuration of FIG. 42
  • the processor processing required for processing one data becomes lighter and the reception performance is improved (the number of data that can be processed in a unit time). Has the effect of increasing). Further, in this embodiment, there is also an effect that the power consumption of the processor required for processing one data (processing for one packet) is reduced.
  • the software for the reception processing unit 117 and the data processing unit 116 having the configuration of FIG. 42 can be used as they are in the packet processing apparatus of this embodiment. This indicates that the reception performance can be improved by the collective DMA simply by changing the hardware (DMA controller 1211).
  • the restoration process is to be realized by the hardware of the reception processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42, the information required for the restoration processing (the number of combined data, the size of each data) is obtained.
  • a means for notifying the reception processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42 from the data coupling unit 120 is required.
  • the restoration process is to be realized by the hardware of the reception processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42, there may be a plurality of restoration processes after the completion of the DMA transfer until the reception processing is started. It must be taken into consideration that it is necessary to retain the information necessary for the restoration process for the data blocks of.
  • the scale of the hardware in this embodiment is smaller than that in the case where the restoration process is realized by the hardware of the reception processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42.
  • the information required for the restoration processing is stored in the data block. It is also possible to write in. Specifically, in order to notify the size of each combined data, for example, a method in which a header in which the data size or the like is written is added before each data and the additional header is DMA-transferred together with the data can be considered.
  • the combined data transfer unit 121 is realized by hardware, but at least a part of the processing of the combined data transfer unit 121 is implemented by a processor and software different from the processor used for the reception processing. It is also possible. Even when at least a part of the processing of the combined data transfer unit 121 is realized by software in this way, it is not necessary for the reception processing unit 117 or the data processing unit 116 to perform the processing of restoring the data block to the original plurality of data. It is possible to realize high reception performance due to the effect of collective DMA transfer.
  • the processing of restoring the data block to the original plurality of data is performed in the same manner as when the combined data transfer unit 121 is realized by hardware.
  • the effect of reducing the scale of the required hardware (effect of not having to hold information for multiple data blocks) and the effect of not degrading the effective band that can be used for data transfer (necessary for restoration processing) The effect of not adding information to the data block) can be obtained.
  • a plurality of DMA controllers 1211 and descriptors 1210 corresponding to the respective DMA controllers 1211 may be mounted. Further, the data combining unit 120 may determine the type of data and collect the same type of data as a data block, or the plurality of DMA controllers 1211 and the plurality of descriptors 1210 may be used properly according to the type of data. May be good.
  • a DMA controller 1211 and a descriptor 1210 are prepared for each type of data, and a plurality of DMA controllers 1211 and a plurality of descriptors 1210 are used properly according to the type of data, different reception processing may be performed for each type of data. It will be easier.
  • a plurality of DMA controllers 1211 and a plurality of descriptors 1210 may be used properly for each core of a processor having a plurality of CPU cores, or a plurality of DMA controllers 1211 and a plurality of DMA controllers 1211 may be used for each virtual machine.
  • the descriptor 1210 and the descriptor 1210 may be used properly.
  • FIG. 16 is a block diagram showing a configuration of a packet processing device according to a second embodiment of the present invention.
  • the packet processing device of FIG. 16 includes a line correspondence unit 100, a packet processing unit 114, a data memory 115, a data processing unit 116, a reception processing unit 117, a reception buffer 118, a coupling threshold control unit 119, and the like. It is composed of a data combining unit 120, a transfer management unit 122, and a combined data transfer unit 123.
  • the difference between the configuration of FIG. 16 and the configuration of FIG. 11 is that the transfer means in FIG. 11 is replaced with the writing means by the processor (software) of the packet processing device. That is, in this embodiment, the combined data transfer unit 121 of FIG. 11 is replaced with the combined data transfer unit 123 by software.
  • the line correspondence unit 100, the data memory 115, the data processing unit 116, the reception processing unit 117, the reception buffer 118, the coupling threshold control unit 119, and the transfer management unit 122 have the same configuration as that shown in FIG.
  • the data combining unit 120 of FIG. 16 transfers the data output by the packet processing unit 114 to the receiving buffer 118 for data combining.
  • the data combining unit 120 stores the data in the receiving buffer 118 so as to combine the data output by the packet processing unit 114 and the data already stored in the receiving buffer 118 into one data block. To do.
  • the data coupling unit 120 issues a transfer request for the data block to the data memory 115.
  • the data combining unit 120 transfers data when a timeout (such as when the interval between packets exceeds a predetermined period) occurs before the size of the data block in the receive buffer 118 exceeds the threshold value. You may want to issue a request. Further, the data combining unit 120 records the number of combined data and the size of each data in the receive buffer 118, and when issuing a transfer request for a data block, the information on the number of combined data and the size of each data. Is notified to the combined data transfer unit 123.
  • the size of the data output by the packet processing unit 114 is a predetermined fixed value (does not change for each packet), it is possible to omit the notification of the data size, but even in that case, a timeout occurs. It is necessary to notify the number of combined data when the transfer occurs due to.
  • the combined data transfer unit 123 (software executed by the processor) writes a data block in which a plurality of data are combined to the data memory 115, and makes a start request for the reception processing unit 117. Further, the combined data transfer unit 123 (software executed by the processor) uses the information on the number of combined data and the size of each data notified from the data combination unit 120, and the transfer management unit 122 (executed by the processor). The software) writes information such as size to the descriptor 1230 prepared for each data.
  • the configuration of the descriptor 1230 is the same as the configuration of the descriptor 1210 of the first embodiment. However, in this embodiment, there is a difference that the combined data transfer unit 123 (software executed by the processor) writes to the descriptor 1230 instead of the combined data transfer unit 121.
  • 17 and 18 are flowcharts explaining the operation of the combined data transfer unit 123 (software executed by the processor).
  • the combined data transfer unit 123 initializes the variable n to 1 (step S600a in FIG. 17), and confirms the valid flag AF # n of the descriptor 1230 after the transfer request is issued from the data combination unit 120 (FIG. 17). 17 steps S601a).
  • the combined data transfer unit 123 confirms the information from the data combined unit 120. , It is confirmed whether the data to be transferred to the data memory 115 is a single data or a data block (step S603a in FIG. 17).
  • the combined data transfer unit 123 reads the start address A # n confirmed that the valid flag AF # n is “valid” from the descriptor 1230 (FIG. FIG. 17th step S604a), the corresponding nth data is written to the area starting from the start address A # n of the data memory 115 (FIG. 17 step S605a).
  • the combined data transfer unit 123 writes the received data size L # n to the descriptor 1230 and rewrites the reception completion flag WF # n set in the descriptor 1230 from "unfinished” to "completed” ( FIG. 17 step S606a).
  • the above processes of steps S600a to S606a and steps S607a and S608a are equivalent to the processes of steps S400a to S408a of FIG.
  • the combined data transfer unit 123 confirms the number k of the combined data (step S609a in FIG. 18), and "k-1" pieces in the descriptor 1230.
  • the valid flags AF # (n + 1) to AF # (n + k-1) of are confirmed (FIG. 18, step S610a).
  • step S610a When all the confirmed k valid flags are "valid" (yes in step S610a), the combined data transfer unit 123 starts the address corresponding to the first valid flag AF # n among the confirmed k valid flags.
  • a # n is read from the descriptor 1230 (step S611a in FIG. 18), and the corresponding data block is written in the area starting from the start address A # n of the data memory 115 (step S612a in FIG. 18).
  • the combined data transfer unit 123 writes the received data sizes L # n to L # (n + k-1) indicating the data length of each data constituting the data block written in the data memory 115 to the descriptor 1230. (FIG. 18 step S613a).
  • the combined data transfer unit 123 sets the start addresses A # (n + 1) to A # (n + k-1) of "k-1" in the descriptor 1230 from the k data constituting the data block.
  • the data is rewritten according to the data length of the first "k-1" data (step S614a in FIG. 18).
  • the combined data transfer unit 123 sets the reception completion flags WF # n to WF # (n + k-1) corresponding to each data constituting the data block written in the data memory 115 from “unfinished” to “completed”. (FIG. 18 step S615a).
  • steps S609a to S615a and steps S616a to S618a are equivalent to the processes of steps S409a to S418a of FIG.
  • the packet processing device of the present embodiment is provided with means (combined data transfer unit 123) that can realize collective writing and write information for restoring the data block to the original plurality of data to the descriptor 1230. ing. According to this embodiment, it is possible to eliminate the need to execute the restoration process in the reception processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42, and the high reception performance due to the effect of collective writing. Can be realized.
  • the software for the reception processing unit 117 and the data processing unit 116 having the configuration of FIG. 42 can be used as they are in the packet processing apparatus of this embodiment.
  • the restoration process is to be realized by the reception processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42
  • the information required for the restoration processing (the number of combined data, the size of each data) is provided by the data combination unit.
  • a means for notifying the reception processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42 from 120 is required.
  • a plurality of data blocks may be used from the completion of the collective writing until the reception processing is started. It must be taken into account that the information needed for the minute restore process must be retained.
  • the scale of the hardware in this embodiment is smaller than that in the case where the restoration process is realized by the reception processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42. This is the same even when the process of restoring a data block to a plurality of original data is implemented by software.
  • the information required for the restoration processing for a plurality of data blocks (the number of combined data, the size of each data). ) Needs to be stored in the data memory 115 or the like.
  • the information for a plurality of data blocks (the number of combined data, the size of each data). ) Does not need to be held. That is, it is only necessary to hold the information (the number of combined data, the size of each data) necessary for the restoration processing of only one data block in the data memory 115 or the like.
  • the configuration of this embodiment is different from the configuration of FIG. 42 in that the capacity (write) of the data memory 115 or the like used for holding the information required for the restoration process (the number of combined data, the size of each data). The number of possible bits) may be small, and the scale of the required hardware can be reduced.
  • the information required for the restoration processing is stored in the data block. It is also possible to write in. Specifically, in order to notify the size of each combined data, for example, a method in which a header in which the data size or the like is written is added before each data and an additional header is written together with the data can be considered. However, in this case, a part of the bandwidth of the bus used for collective writing is occupied by the information necessary for the restoration process, so that the effective bandwidth that can be used for writing the original data becomes smaller, and as a result, , The performance of collective writing deteriorates.
  • the information required for the restoration process is not the data memory 115 but another memory (writing and combining from the data combining unit 120) that does not use the bus to which the data memory 115 is connected. It suffices if only reading from the data transfer unit 123 is possible), and the above-mentioned deterioration of the effective band does not occur.
  • the data combining unit 120 may determine the type of data and collect the same type of data as a data block, or may use a plurality of descriptors 1230 properly according to the type of data. .. If descriptors 1230 are prepared for each type of data and a plurality of descriptors 1230 are used properly according to the type of data, it becomes easy to perform different reception processing for each type of data.
  • a plurality of descriptors 1230 may be used properly for each core of a processor having a plurality of CPU cores, or a plurality of descriptors 1230 may be used properly for each virtual machine.
  • a plurality of descriptors 1230 for each CPU core or for each virtual machine, the performance of write processing and read processing by software is improved as compared with the case where only one descriptor 1230 is used.
  • FIG. 19 is a block diagram showing a configuration of a packet processing device according to a third embodiment of the present invention.
  • the packet processing device of FIG. 19 includes a line correspondence unit 100, a packet processing unit 114, a data memory 115, a data processing unit 116, a reception processing unit 117, a reception buffer 118, a coupling threshold control unit 119, and the like. It is composed of a data combining unit 120, a combined data transfer unit 121a, and a transfer management unit 122a.
  • the line correspondence unit 100, the packet processing unit 114, the data memory 115, the data processing unit 116, the reception processing unit 117, the reception buffer 118, the coupling threshold control unit 119, and the data coupling unit 120 have the configuration of FIG. Equivalent.
  • the combined data transfer unit 121a of FIG. 19 is composed of a DMA controller 1211a.
  • the combined data transfer unit 121a transfers a data block in which a plurality of data are combined to the data memory 115 by one DMA transfer, generates a hardware interrupt, and issues a start request for the reception processing unit 117. Note that hardware interrupts to the processor (not shown) of the packet processing device may not be generated.
  • the combined data transfer unit 121a is prepared by the transfer management unit 122a (software executed by the processor) for each data by using the information on the number of combined data and the size of each data notified from the data combination unit 120. The size and the like are written in the descriptor 1210a.
  • FIG. 20 shows a configuration example of the descriptor 1210a used by the combined data transfer unit 121a of this embodiment.
  • the example of FIG. 20 shows a case where N pieces of data are stored in the data memory 115.
  • the descriptor 1210a of FIG. 20 has effective flags AF # 1 to AF # N indicating whether or not the start addresses A # 1 to A # N of the write destination of the received data and the start addresses A # 1 to A # N are valid.
  • the received data sizes L # 1 to L # N indicating the data length of the received data, and the reception completion flags WF # 1 to WF # N indicating whether or not the reading of the data from the data memory 115 is completed. Is a data structure in which a plurality of (N sets) can be written.
  • the descriptor 1210a is actually arranged in a memory on a personal computer, a communication device, or a communication board, similarly to the data memory 115. It is possible to arrange the descriptor 1210a in the same memory as the data memory 115, but in that case, it is possible to determine which purpose is used according to the address in the memory.
  • FIG. 21 is a flowchart explaining the operation of the transfer management unit 122a
  • FIGS. 22 to 25 and 27 are flowcharts explaining the operation of the DMA controller 1211a
  • FIG. 26 is a flowchart explaining the operation of the reception processing unit 117.
  • the transfer management unit 122a (software executed by the processor) secures a continuous area as a buffer area for data blocks in the data memory 115 as an initial setting of the packet processing device (step S700 in FIG. 21).
  • the start address A0 of this buffer area and the information indicating the capacity (size) C0 are written to the control register 124 (step S701 in FIG. 21).
  • the control register 124 is provided in the processor, for example.
  • control register 124 There is no problem with only one control register 124 (set), but it is possible to prepare multiple control registers 124.
  • the order in which they are used for writing data is determined in advance. Further, the control register 124 is set at the time of initial setting, and the setting is not changed during operation.
  • the transfer management unit 122a sets all the valid flags AF # n, which indicate whether the start address A # n (n is 1 to N), is valid or not as the initial setting of the descriptor 1210a (step 21 in FIG. 21). S702), all the reception completion flags WF # n indicating that the reading of the data from the data memory 115 is completed are set to “complete” (step S703 in FIG. 21).
  • the DMA controller 1211a in the combined data transfer unit 121a has a start address A0 and a capacity set by the transfer management unit 122a in the case of the first transfer request after the above initial setting.
  • (Size) C0 is read from the control register 124 (step S800 in FIG. 22).
  • the DMA controller 1211a sets the start address A0 read in step S800 as the initial value of the write pointer WP to be used for transferring the data to the data memory 115 (step S801 in FIG. 22). That is, in this embodiment, the range of addresses of the writable buffer area in the data memory 115 is calculated from the setting of the control register 124, and the writable buffer area is used as the ring buffer.
  • the DMA controller 1211a initializes the variable n indicating the order of reading and writing of the descriptor 1210a to 1 (step S802 in FIG. 22).
  • the DMA controller 1211a may check the reception completion flags of WF # N and WF # 1 to WF # (k-1).
  • the DMA controller 1211a has a reception completion flag from WF # n to WF # N and from WF # 1 to WF # (k-1- (Nn)). You just have to check.
  • step S804 When all the k reception completion flags confirmed by the process of step S804 are "completed" (yes in step S804), the DMA controller 1211a together with the remaining capacity CR of the buffer area for the data block in the data memory 115.
  • the size of the data to be transferred to the data memory 115 is compared with the CD (step S805 in FIG. 22).
  • the size of the single data is compared with the remaining capacity CR, and when the data to be transferred to the data memory 115 is a data block. Compares the size of the data block with the remaining capacity CR.
  • the data combining unit 120 notifies the size CD of the data to be transferred to the data memory 115.
  • the descriptor 1210a is provided with N areas (sets) of reception completion flags WF # 1 to WF # N, but the order in which reception completion flags WF # 1 to WF # N are confirmed is predetermined. It has been decided. For example, in the examples of FIGS. 20 and 22, the DMA controller 1211a has the nth reception completion flag WF # n, the (n + 1) th reception completion flag WF # (n + 1), ..., The Nth reception completion flag. Check the flags WF # N in order (step S804). After confirming the Nth reception completion flag WF # N, if the confirmation for k groups is not completed, the confirmation is performed in order from the first reception completion flag WF # 1.
  • step S805 When the remaining capacity CR of the buffer area for the data block in the data memory 115 is smaller than the size CD of the data to be transferred to the data memory 115 (yes in step S805), the DMA controller 1211a returns to step S804.
  • the state in which the remaining capacity CR of the buffer area is smaller than the data size CD is resolved when the remaining capacity CR of the buffer area is recovered by reading data from the data memory 115 by software.
  • the DMA controller 1211a sends the write pointer WP to the data to be transferred to the data memory 115.
  • the value obtained by adding the size CD of (WP + CD) is compared with a predetermined upper limit value (step S806 in FIG. 23).
  • the upper limit value is a value (A0 + C0) obtained by adding the capacity C0 of this buffer area to the start address A0 of the buffer area in the data memory 115.
  • the DMA controller 1211a When the value (WP + CD) obtained by adding the data size CD to the write pointer WP is smaller than the upper limit value (A0 + C0) (yes in step S806), the DMA controller 1211a has the information notified from the data combining unit 120 (each combined). The received data sizes L # n to L # (n + k-1) indicating the data lengths of k pieces of data constituting the data to be transferred to the data memory 115 based on the data size) are written to the descriptor 1210a (data size). FIG. 23 step S807).
  • the DMA controller 1211a when the data to be transferred to the data memory 115 is a data block (yes in step S809), the DMA controller 1211a has "k-1" start addresses A # (n + 1) to A # (yes in step S809) in the descriptor 1210a. n + k-1) is written according to the data length of the first "k-1" data among the k data constituting the data block (step S811 in FIG. 23).
  • the DMA controller 1211a has the start address A # n for the start address A # (n + 1) and the data length (received data size L) of the first data among the k data constituting the data block. Write the value obtained by adding (the value indicated by # n). Further, the DMA controller 1211a has the start address A # (n + k-2) for the start address A # (n + k-1) and the "k-1" th data among the k data constituting the data block. Write the value obtained by adding the data length (value indicated by the received data size L # (n + k-2)).
  • the DMA controller 1211a when the DMA controller 1211a writes the start address A # i, it is the "i-1" th data of the previous start address A # (i-1) and the data constituting the data block. The value obtained by adding the data length may be written.
  • the DMA controller 1211a When n ⁇ N and n + k-1> N, the DMA controller 1211a has a received data size L # n, L # (n + 1) to L # N, and L # 1 to L # (k-1-(k-1-( The received data size up to Nn)) is written to the descriptor 1210a, and the start address A # n, A # (n + 1) to A # N, and A # 1 to A # (k-1- (Nn)) are written. ))
  • the start address up to) may be written to the descriptor 1210a.
  • the DMA controller 1211a uses the write pointer WP as the start address of the transfer destination of the data memory 115, and transfers the data (single data or data block) to be transferred to the data memory 115 to the transfer destination of the data memory 115.
  • DMA transfer is performed to write to the buffer area starting from the start address of (FIG. 24, step S812). That is, when the value (A0 + C0) obtained by adding the capacity C0 of this buffer area to the start address A0 of the buffer area in the data memory 115 is larger than the value obtained by adding the data size CD to the write pointer WP (WP + CD).
  • DMA transfer is performed using the write pointer WP as the start address of the transfer destination.
  • the DMA controller 1211a may add the received data size L # n and the received data sizes from L # 1 to L # (k-1) to the write pointer WP.
  • the DMA controller 1211a has a received data size L # n, L # (n + 1) to L # N, and L # 1 to L # (k-1-(k-1-( The received data size up to Nn)) may be added to the write pointer WP.
  • the DMA controller 1211a rewrites the reception completion flags WF # n to WF # (n + k-1) corresponding to the data constituting the data DMA-transferred to the data memory 115 from "completed” to "unfinished”. (FIG. 24, step S814). Further, the DMA controller 1211a rewrites the valid flags AF # n to AF # (n + k-1) corresponding to the data constituting the data DMA-transferred to the data memory 115 from “invalid” to “valid” (FIG. 24). Step S815).
  • the DMA controller 1211a has the reception completion flag WF # n, WF # (n + 1) to WF # N, and WF # 1 to WF # (k-1-(k-1-( The reception completion flag up to Nn)) is rewritten to "unfinished", and the valid flags AF # n, AF # (n + 1) to AF # N, and AF # 1 to AF # (k-1-(k-1- ( The valid flags up to Nn)) may be rewritten to "valid".
  • the DMA controller 1211a when the value (WP + CD) obtained by adding the size CD of the data to be transferred to the data memory 115 to the write pointer WP is equal to or higher than the upper limit value (A0 + C0) (no in step S806), the data The size CD is compared with the value (RP-A0) obtained by subtracting the start address A0 of the buffer area in the data memory 115 from the read pointer RP (step S819 in FIG. 23).
  • the DMA controller 1211a data data based on the information notified from the data combining unit 120 (size of each combined data).
  • Received data sizes L # n to L # (n + k-1) indicating the data lengths of k pieces of data constituting the data to be transferred to the memory 115 are written to the descriptor 1210a (step S820 in FIG. 25).
  • the DMA controller 1211a when the data to be transferred to the data memory 115 is a data block (yes in step S822), the DMA controller 1211a has "k-1" start addresses A # (n + 1) to A # (yes in step S822) of the descriptor 1210a. n + k-1) is written according to the data length of the first "k-1" data among the k data constituting the data block (step S824 in FIG. 25).
  • the DMA controller 1211a has the start address A # n for the start address A # (n + 1) and the data length (received data size L) of the first data among the k data constituting the data block. Write the value obtained by adding (the value indicated by # n). Further, the DMA controller 1211a has the start address A # (n + k-2) for the start address A # (n + k-1) and the "k-1" th data among the k data constituting the data block. Write the value obtained by adding the data length (value indicated by the received data size L # (n + k-2)). In this way, when the DMA controller 1211a writes the start address A # i, it is the "i-1" th data of the previous start address A # (i-1) and the data constituting the data block. The value obtained by adding the data length may be written.
  • the DMA controller 1211a When n ⁇ N and n + k-1> N, the DMA controller 1211a has a received data size L # n, L # (n + 1) to L # N, and L # 1 to L # (k-1-(k-1-( The received data size up to Nn)) is written to the descriptor 1210a, and the start address A # n, A # (n + 1) to A # N, and A # 1 to A # (k-1- (Nn)) are written. ))
  • the start address up to) may be written to the descriptor 1210a.
  • the DMA controller 1211a performs a DMA transfer of writing the data (single data or data block) to be transferred to the data memory 115 to the buffer area starting from the start address A0 of the data memory 115 (FIG. 25, step S825). ). That is, when "A0 + C0-WP" is smaller than the size CD of the data to be transferred to the data memory 115 and the capacity from the start address A0 of the buffer area to the read pointer RP is larger than the size CD of the transfer data, the write pointer WP Instead, DMA transfer is performed using the start address A0 of the data memory 115 as the start address of the transfer destination.
  • the DMA controller 1211a adds a value obtained by adding the received data sizes L # n to L # (n + k-1) to the start address A0 of the write pointer WP. Set to a new value.
  • the DMA controller 1211a adds the received data size L # n and the received data sizes from L # 1 to L # (k-1) to the start address A0 to obtain the write pointer WP. It can be a new value of.
  • the DMA controller 1211a has a received data size L # n, L # (n + 1) to L # N, and L # 1 to L # (k-1-(k-1-( The value obtained by adding the received data size up to Nn)) to the start address A0 may be used as a new value of the write pointer WP.
  • the DMA controller 1211a rewrites the reception completion flags WF # n to WF # (n + k-1) corresponding to the data constituting the data DMA-transferred to the data memory 115 from "completed” to "unfinished". (FIG. 25, step S827). Further, the DMA controller 1211a rewrites the valid flags AF # n to AF # (n + k-1) corresponding to the data constituting the data DMA-transferred to the data memory 115 from "invalid" to "valid” (FIG. 25). Step S828).
  • the DMA controller 1211a has the reception completion flag WF # n, WF # (n + 1) to WF # N, and WF # 1 to WF # (k-1-(k-1-( The reception completion flag up to Nn)) is rewritten to "unfinished", and the valid flags AF # n, AF # (n + 1) to AF # N, and AF # 1 to AF # (k-1-(k-1- ( The valid flags up to Nn)) may be rewritten to "valid".
  • the data blocks in which k pieces of data are concatenated are collectively transferred to the data memory 115, and the information of the start address of the descriptor 1210a is written by the DMA controller 1211a, whereby the packet processing apparatus.
  • the processor (reception processing unit 117 and data processing unit 116) is notified of the address where the beginning of each data is written.
  • the DMA controller 1211a also performs the read pointer RP update process in response to the following processes of the reception processing unit 117 and the like (software executed by the processor), and the details of the read pointer RP update process will be described later.
  • the reception processing unit 117 (software executed by the processor) periodically checks the valid flag AF # n (n is 1 to N) of the descriptor 1210a, and when the valid flag AF # n indicates "valid". (Yes in step S901 of FIG. 26), the nth data is read from the data memory 115 based on the information of the corresponding nth start address A # n and the information of the received data size L # n, and the data processing unit 116 (FIG. 26, step S902).
  • the reception processing unit 117 (software executed by the processor) of the descriptor 1210a corresponding to the nth data for which the processing has been completed.
  • the nth reception completion flag WF # n is rewritten from "unfinished” to "completed”
  • the nth valid flag AF # n of the descriptor 1210a is rewritten from "valid" to "invalid” (FIG. 26, step S904).
  • the descriptor 1210a has N regions (sets) of the effective flags AF # 1 to AF # N, but the order in which the effective flags AF # 1 to AF # N are confirmed is determined in advance. Has been done.
  • the DMA controller 1211a issues an interrupt processing request to the processor after the completion of the DMA transfer, and the reception processing unit 117 responds to the interrupt processing request. (Software executed by the processor) may check the valid flag AF # n (n is 1 to N) of the descriptor 1210a.
  • step S840 of FIG. 27 the DMA controller 1211a sets the start address A0 of the buffer area for the data block of the data memory 115 as the initial value of the read pointer RP. Further, the DMA controller 1211a initializes the variable n indicating the confirmation order of the valid flags to 1 (step S841 in FIG. 27). Since this variable n and the variable n in FIGS. 22 to 25 have the same value, step S841 is the same process as step S802.
  • the DMA controller 1211a periodically confirms the nth valid flag AF # n of the descriptor 1210a during the processing of FIGS. 22 to 25 (step S842 of FIG. 27). After the DMA controller 1211a detects that the valid flag AF # n indicates that the n-th head address A # n is "valid" (yes in step S843 of FIG. 27), the n-th head address The nth reception completion flag WF # n of the descriptor 1210a corresponding to A # n is confirmed (FIG. 27, step S844).
  • the DMA controller 1211a When the nth reception completion flag WF # n of the descriptor 1210a indicates "completed" (yes in step S845 of FIG. 27), the DMA controller 1211a has the nth reception data size at the nth start address A # n. The value obtained by adding L # n is updated as a new value of the read pointer RP (FIG. 27, step S846). If the valid flag AF # n has not been rewritten to "invalid" by the software executed by the processor, the DMA controller 1211a updates it to "invalid" (step S847 in FIG. 27).
  • the DMA controller 1211a determines whether the variable n is equal to N (step S848 in FIG. 27). When the variable n has not reached N (no in step S848), the DMA controller 1211a increments the variable n by 1 (step S849 in FIG. 27) and returns to step S842. Further, when the variable n reaches N (yes in step S848), the DMA controller 1211a sets the variable n to 1 (step S850 in FIG. 27) and returns to step S842.
  • the reception completion flag WF # n becomes "completed” due to the operation of the reception processing unit 117 in FIG. 26. Further, the read pointer RP described above is used by the DMA controller 1211a for calculating the remaining capacity of the buffer area for the data block in the data memory 115, and is not used at the time of reading by software. Not expected.
  • the packet processing device of the present embodiment can realize collective DMA transfer, and is a means (DMA controller) for writing information for restoring a data block to a plurality of original data in the descriptor 1210a. It includes a combined data transfer unit 121a with a built-in 1211a). Since the DMA controller 1211a can be implemented by hardware, it is not necessary to execute the restoration process by software, and it is possible to realize high reception performance due to the effect of collective DMA transfer.
  • the processor (software) executes the process of restoring the data block in which a plurality of data are combined to the original plurality of data in the conventional packet processing device having the configuration of FIG. 42
  • the processor processing required for processing one data becomes lighter and the reception performance is improved (the number of data that can be processed in a unit time). Has the effect of increasing). Further, in this embodiment, there is also an effect that the power consumption of the processor required for processing one data (processing for one packet) is reduced.
  • a buffer area of N ⁇ DB_max (DB_max is the maximum size of the data block) is secured in advance in the data memory 115 by software. You need to do it.
  • the collective DMA transfer can be normally performed in a smaller buffer area.
  • the size of the buffer area that needs to be secured in the data memory 115 in the packet processing apparatus of this embodiment does not depend on N, and is the maximum size DB_max of the data block. That is, the size of the buffer area that needs to be secured in the data memory 115 in the packet processing apparatus of this embodiment is 2500 bytes under the same conditions as above.
  • the reason why the size of the buffer area can be reduced in this way is that when the remaining capacity CR of the buffer area is small, the DMA transfer is waited until the remaining capacity CR reaches the required amount (step S805 in FIG. 22 and step 23 in FIG. 23). This is the effect of the implementation of S819).
  • the probability that the next DMA transfer will be waited until the reading of the data from the data memory 115 by the software is completed increases.
  • the amount of the area that is wasted when the size of the buffer area secured in the data memory 115 in the packet processing apparatus of this embodiment is the same as the size required in the configuration of the conventional FIG. 42 is compared. ..
  • the size of the data block actually transferred to the data memory 115 is 501 bytes to 2500 bytes as described above. That is, in the conventional configuration of FIG. 42, when the size of each data block is S, the area obtained by adding (2500-S) by 10 data blocks is wasted. This indicates that if the average of the size S of the data blocks is 1500 Byte, the area of 10000 Byte out of 25000 Byte is wasted.
  • the size of the buffer area secured in the data memory 115 in the configuration of this embodiment is 25,000 Byte, 25,000 Byte is secured in a continuous area, and a plurality of data blocks can be written in the continuous area. ing. Therefore, in this embodiment, only the value obtained by subtracting 1 Byte from the maximum size of 2500 Byte of the data block, that is, 2499 Byte is wasted at the maximum.
  • the size of the buffer area secured in the data memory 115 in the packet processing apparatus of this embodiment is the same as the size required in the configuration of the conventional FIG. 42
  • the size of the buffer area is the same as that of the configuration of the conventional FIG. 42.
  • the wasted area becomes smaller, and more data blocks can be written to the buffer area of the same size.
  • the maximum number of data blocks to be written in the buffer area of the data memory 115 and the N of the descriptor 1210a can be independently determined.
  • the size of the buffer area may be determined by the maximum number of data blocks to be written to the buffer area, and N may be the maximum number of data to be written to the buffer area.
  • the maximum number of data that can be actually written to the buffer area depends on the size of the data to be stored and the size of the buffer area, and therefore is N or a smaller value.
  • the restoration processing is performed.
  • a means for notifying the necessary information (the number of combined data, the size of each data) from the data combining unit 120 to the receiving processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42 is required.
  • the restoration process is to be realized by the hardware of the reception processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42, there may be a plurality of restoration processes after the completion of the DMA transfer until the reception processing is started. It must be taken into consideration that it is necessary to retain the information necessary for the restoration process for the data blocks of.
  • the scale of the hardware in this embodiment is smaller than that in the case where the restoration process is realized by the hardware of the reception processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42.
  • the information required for the restoration processing is stored in the data block. It is also possible to write in. However, when the information required for the restoration process is written in the data block, a part of the bandwidth of the bus used for the DMA transfer is occupied by the information required for the restoration process, so that the original data The effective band that can be used for transfer becomes small, and as a result, there arises a problem that the performance of DMA transfer deteriorates. In the packet processing apparatus of this embodiment, since it is not necessary to write the information required for the restoration process to the data block, the above-mentioned deterioration of the effective band does not occur.
  • the combined data transfer unit 121a is realized by hardware, but at least a part of the processing of the combined data transfer unit 121a is implemented by a processor and software different from the processor used for the reception processing. It is also possible. Even when at least a part of the processing of the combined data transfer unit 121a is realized by software in this way, it is not necessary for the reception processing unit 117 or the data processing unit 116 to perform the processing of restoring the data block to the original plurality of data. It is possible to realize high reception performance due to the effect of collective DMA transfer.
  • the processing of restoring the data block to the original plurality of data is performed as in the case of realizing the combined data transfer unit 121a by hardware.
  • the effect of reducing the scale of the required hardware the effect of not having to hold information for multiple data blocks
  • the effect of not degrading the effective band that can be used for data transfer can be obtained.
  • a plurality of DMA controllers 1211a and a plurality of descriptors 1210a corresponding to the respective DMA controllers 1211a may be mounted. Further, the data combining unit 120 may determine the type of data and collect the same type of data as a data block, or the plurality of DMA controllers 1211a and the plurality of descriptors 1210a may be used properly according to the type of data. May be good.
  • a DMA controller 1211a and a descriptor 1210a are prepared for each type of data, and a plurality of DMA controllers 1211a and a plurality of descriptors 1210a are used properly according to the type of data, different reception processing may be performed for each type of data. It will be easier.
  • a plurality of DMA controllers 1211a and a plurality of descriptors 1210a may be used properly for each core of a processor having a plurality of CPU cores, or a plurality of DMA controllers 1211a and a plurality of DMA controllers 1211a may be used for each virtual machine.
  • the descriptor 1210a and the descriptor 1210a may be used properly.
  • FIG. 28 is a block diagram showing a configuration of a packet processing device according to a fourth embodiment of the present invention.
  • the packet processing device of FIG. 28 includes a line correspondence unit 100, a packet processing unit 114, a data memory 115, a data processing unit 116, a reception processing unit 117, a reception buffer 118, a coupling threshold control unit 119, and the like. It is composed of a data combining unit 120, a transfer management unit 122a, and a combined data transfer unit 123a.
  • the difference between the configuration of FIG. 28 and the configuration of FIG. 19 is that the transfer means in FIG. 19 is replaced with the writing means by the processor (software) of the packet processing device. That is, in this embodiment, the combined data transfer unit 121a in FIG. 19 is replaced with the combined data transfer unit 123a by software.
  • the line correspondence unit 100, the data memory 115, the data processing unit 116, the reception processing unit 117, the reception buffer 118, the coupling threshold control unit 119, the transfer management unit 122a, and the control register 124 have the same configuration as in FIG.
  • the data coupling unit 120 has the same configuration as that shown in FIG.
  • the combined data transfer unit 123a (software executed by the processor) writes a data block in which a plurality of data are combined to the data memory 115, and makes a start request for the reception processing unit 117. Further, the combined data transfer unit 123a is prepared by the transfer management unit 122a (software executed by the processor) for each data by using the information on the number of combined data and the size of each data notified from the data combination unit 120. Information such as size is written in the descriptor 1230a.
  • the configuration of the descriptor 1230a is the same as the configuration of the descriptor 1210a of the third embodiment. However, in this embodiment, there is a difference that the combined data transfer unit 123a (software executed by the processor) writes to the descriptor 1230a instead of the combined data transfer unit 121a.
  • 29 to 33 are flowcharts illustrating the operation of the combined data transfer unit 123a (software executed by the processor).
  • the combined data transfer unit 123a controls the start address A0 and the capacity (size) C0 set by the transfer management unit 122a in the case of the first transfer request after the initial setting.
  • Read from the register 124 step S1000 in FIG. 29.
  • the combined data transfer unit 123a sets the start address A0 as the initial value of the write pointer WP (step S1001 in FIG. 29).
  • the combined data transfer unit 123a performs the processes of steps S1002 to S1006 equivalent to steps S802 to S806.
  • the value (WP + CD) obtained by adding the data size CD to the write pointer WP is smaller than the upper limit value (A0 + C0) (yes in step S1006 of FIG. 30)
  • the combined data transfer unit 123a is notified from the data combination unit 120.
  • steps S1008 to S1011 of FIG. 30 is equivalent to the processing of steps S808 to S811 of FIG.
  • the combined data transfer unit 123a uses the write pointer WP as the start address of the transfer destination of the data memory 115, and transfers the data (single data or data block) to be transferred to the data memory 115 to the data memory 115. Write to the buffer area starting from the start address of the transfer destination (step S1012 in FIG. 31).
  • steps S1013 to S1018 of FIG. 31 is equivalent to the processing of steps S813 to S818 of FIG. 24.
  • the combined data transfer unit 123a returns to step S1003 after the processing of step S1017 or S1018.
  • the combined data transfer unit 123a is when the value (WP + CD) obtained by adding the size CD of the data to be transferred to the data memory 115 to the write pointer WP is equal to or higher than the upper limit value (A0 + C0) (no in step S1006 of FIG. 30). ), The size CD of the data is compared with the value (RP-A0) obtained by subtracting the start address A0 of the buffer area in the data memory 115 from the read pointer RP (step S1019 in FIG. 30).
  • the combined data transfer unit 123a is based on the information notified from the data combination unit 120 (the size of each combined data). , The received data sizes L # n to L # (n + k-1) indicating the data lengths of k pieces of data constituting the data to be transferred to the data memory 115 are written to the descriptor 1230a (step S1020 in FIG. 32).
  • steps S1021 to S1024 of FIG. 32 is equivalent to the processing of steps S821 to S824 of FIG.
  • the combined data transfer unit 123a writes the data (single data or data block) to be transferred to the data memory 115 to the buffer area starting from the start address A0 of the data memory 115 (step S1025 in FIG. 32).
  • steps S1026 to S1031 of FIG. 32 is equivalent to the processing of steps S826 to S831 of FIG.
  • the combined data transfer unit 123a returns to step S1003 after the processing of step S1030 or S1031.
  • the combined data transfer unit 123a sets the start address A0 of the buffer area for the data block of the data memory 115 as the initial value of the read pointer RP (step S1040 in FIG. 33). Further, the combined data transfer unit 123a initializes the variable n indicating the confirmation order of the valid flags to 1 (step S1041 in FIG. 33). Since this variable n and the variable n in FIGS. 29 to 32 have the same value, step S1041 is the same process as step S1002.
  • the processing of steps S1042 to S1050 of FIG. 33 is equivalent to the processing of steps S842 to S850 of FIG. 27.
  • the packet processing device of the present embodiment can realize collective writing, and means for writing information to the descriptor 1230a for restoring a data block in which a plurality of data are combined to the original plurality of data (combined data).
  • the transfer unit 123a) is provided. According to this embodiment, it is possible to eliminate the need to execute the restoration process in the reception processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42, and the high reception performance due to the effect of collective writing. Can be realized.
  • N ⁇ DB_max (DB_max is a data block) is stored in the data memory 115 in advance by the software for reception processing (read processing). It is necessary to secure a buffer area (maximum size).
  • the collective writing can be normally performed in a smaller buffer area as in the configuration of FIG.
  • the combined data transfer unit 123a writes the information (start address, received data size, reception completion flag) of the descriptor 1230a, thereby eliminating the need for restoration processing.
  • the information required for the restoration processing (the number of combined data, the size of each data) is provided by the data combination unit.
  • a means for notifying the reception processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42 from 120 is required.
  • a plurality of data blocks may be used from the completion of the collective writing until the reception processing is started. It must be taken into account that the information needed for the minute restore process must be retained.
  • the scale of the hardware in this embodiment is smaller than that in the case where the restoration process is realized by the reception processing unit 117, the data processing unit 116, or the combined data separation unit 108b of FIG. 42. This is the same even when the process of restoring a data block to a plurality of original data is implemented by software.
  • the processing of writing to the data memory 115 and the receiving processing including the restoration processing are different processors (or When implemented in a virtual machine, etc.), it is necessary to retain the information required for restoration processing for multiple data blocks in some cases until the reception processing is started after the writing to the data memory 115 is completed. , It is necessary to hold the information (the number of combined data, the size of each data) necessary for the restoration process for a plurality of data blocks in the data memory 115 or the like.
  • the processing of writing to the data memory 115 and the receiving processing not including the restoration processing are performed.
  • information for multiple data blocks It is not necessary to hold (the number of combined data, the size of each data), that is, the information (the number of combined data, the size of each data) required for the restoration process of only one data block is stored in the data memory. It is only necessary to hold it at 115 or the like.
  • the configuration of this embodiment is different from the configuration of FIG. 42 in that the capacity (write) of the data memory 115 or the like used for holding the information required for the restoration process (the number of combined data, the size of each data). The number of possible bits) may be small, and the scale of the required hardware can be reduced.
  • the information required for the restoration processing is transmitted to the data memory 115. It is also possible to write in. However, in this case, a part of the bandwidth of the bus used for collective writing is occupied by the information necessary for the restoration process, so that the effective bandwidth that can be used for writing the original data becomes smaller, and as a result, , The performance of collective writing deteriorates.
  • the information required for the restoration process is not the data memory 115 but another memory (writing and combining from the data combining unit 120) that does not use the bus to which the data memory 115 is connected. It is sufficient if only reading from the data transfer unit 123a is possible), and the above-mentioned deterioration of the effective band does not occur.
  • the data combining unit 120 may determine the type of data and collect the same type of data as a data block, or a plurality of data according to the type of data.
  • the descriptor 1230a may be used properly. If descriptors 1230a are prepared for each type of data and a plurality of descriptors 1230a are used properly according to the type of data, it becomes easy to perform different reception processing for each type of data.
  • a plurality of descriptors 1230a may be used properly for each core of a processor having a plurality of CPU cores, or a plurality of descriptors 1230a may be used properly for each virtual machine.
  • a plurality of descriptors 1230a for each CPU core or each virtual machine, the performance of the write processing and the read processing by the software is improved as compared with the case where only one descriptor 1230a is used.
  • the data memory 115, the transfer management unit 122, 122a, the data processing unit 116, the reception processing unit 117, and the combined data transfer unit 123, 123a are It can be realized by a computer equipped with a processor, a storage device and an interface, and a program that controls these hardware resources. Further, as described above, it is also possible to realize a part of the processing of the combined data transfer units 121 and 121a by a computer.
  • the computer includes a CPU (Central Processing Unit) 200, a storage device 201, and an interface device (hereinafter, abbreviated as I / F) 202.
  • a program for realizing the packet processing method of the present invention is stored in the storage device 201.
  • the CPU 200 executes the processes described in the second embodiment and the fourth embodiment according to the program stored in the storage device.
  • the present invention can be applied to a technique for performing protocol processing, transfer processing, etc. of communication data.
  • 100 ... line correspondence unit, 114 ... packet processing unit, 115 ... data memory, 116 ... data processing unit, 117 ... reception processing unit, 118 ... reception buffer, 119 ... coupling threshold control unit, 120 ... data coupling unit, 121, 121a, 123, 123a ... Combined data transfer unit, 122, 122a ... Transfer management unit, 124 ... Control register, 1210, 1210a, 1230, 1230a ... Descriptor, 1211, 1211a ... DMA controller.

Landscapes

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

Abstract

データブロックを元の複数のデータに復元する処理に必要となるハードウェアの規模を小さくし、かつ高い受信性能を実現する。 パケット処理装置は、通信回線から受信したパケットの処理を行って処理結果のデータを出力するパケット処理部114と、パケット処理部114から出力された複数のデータを連結してデータブロックを生成するデータ結合部120と、データ結合部120によって生成されたデータブロックをデータ用メモリ115にDMA転送する結合データ転送部121とを備える。結合データ転送部121は、データブロック内の各データの先頭の、データ用メモリ115上におけるアドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタ1210に書き込む。

Description

パケット処理装置およびパケット処理方法
 本発明は、パケット処理装置およびパケット処理方法に係り、特に、通信システムの中で、パケットデータの転送処理を行うパケット処理装置およびパケット処理方法に関するものである。
 図35は従来のパケット処理装置の構成を示すブロック図である。パケット処理装置は、通信回線からパケットを受信する回線対応部100と、通信回線から受信したパケットが格納されるパケットメモリ101と、通信回線から受信したパケットをパケットメモリ101に転送するパケット転送部102と、パケットメモリ101からパケットを読み出す受信処理部103と、パケットに対してプロトコル処理を行うプロトコル処理部104とを備えている。
 このパケット処理装置では、通信回線(不図示)と接続された回線対応部100へのパケットの到着を契機として、パケット転送部102がDMA(Direct Memory Access)を用いたデータ転送を行い、到着したパケットをパケットメモリ101に格納する。同時に、パケット転送部102は、パケットを受信したことをパケット処理装置のプロセッサ(不図示)に通知するためにハードウェア割り込みを発生させ、受信処理部103の起動要求を行う。
 パケット転送部102は、パケット処理装置のプロセッサが実行するソフトウェアによって構築されるデータ構造体であるディスクリプタ1020と、ハードウェアであるDMAコントローラ1021とから構成される。図36はディスクリプタ1020の概要を説明する図である。
 図36の例では、パケットメモリ101にN個のパケットが格納される場合を示している。この場合、パケット処理装置のプロセッサは、N個のパケットの各々に対応するアドレスやフラグをディスクリプタ1020に設定する。プロセッサは、受信したパケットをパケットメモリ101へ書き込む際の先頭アドレスA#1~A#Nをディスクリプタ1020に予め設定しておく。通常、同時に設定できるアドレスの数は予め決まっており、使用されるアドレスの順番も決まっている。
 プロセッサは、設定したアドレスA#1~A#Nが有効か否かを示すフラグAF#1~AF#Nのセット/リセットをディスクリプタ1020に対して行う。アドレスA#1~A#Nの設定後、プロセッサがフラグAF#1~AF#Nを有効にすると、パケットメモリ101へのパケットの書き込みが可能となる。
 また、ディスクリプタ1020には、設定されたアドレスA#1~A#Nへのパケットの書き込みが完了したか否かを示す受信完了フラグWF#1~WF#Nと、設定されたアドレスA#1~A#Nへの書き込みが行われたパケットのパケット長を示す受信データサイズL#1~L#Nとが設定される。
 図37はDMAコントローラ1021の動作を説明するフローチャートである。最初に、DMAコントローラ1021は、ディスクリプタ1020の読出および書込の順を示す変数nを1に初期化し(図37ステップS100)、n=1番目のフラグAF#1をディスクリプタ1020から読み出す(図37ステップS101)。
 DMAコントローラ1021は、先頭アドレスが有効であることをフラグAF#1が示している場合(図37ステップS102においてyes)、n=1番目の先頭アドレスA#1をディスクリプタ1020から読み出し(図37ステップS103)、対応するn=1番目のパケットをパケットメモリ101の先頭アドレスA#1から始まる領域に書き込む(図37ステップS104)。
 パケットの書き込み完了後、DMAコントローラ1021は、n=1番目のパケットのパケット長を示す受信データサイズL#1と、パケットの書き込みが完了したことを示す受信完了フラグWF#1とをディスクリプタ1020に書き込む(図37ステップS105)。
 また、パケットの書き込みが完了したことをパケット処理装置のプロセッサ(不図示)に通知するためにハードウェア割り込みを発生させ、受信処理部103の起動要求を行う。
 そして、DMAコントローラ1021は、変数nがNと等しいかどうかを判定する(図37ステップS106)。DMAコントローラ1021は、変数nがNに達していない場合(ステップS106においてno)、変数nを1増やし(図37ステップS107)、ステップS101に戻る。また、DMAコントローラ1021は、変数nがNに達した場合(ステップS106においてyes)、ステップS100に戻る。こうして、N個のパケットが順番にパケットメモリ101に転送される。
 次に、起動した受信処理部103は、パケットメモリ101に転送された受信パケットをプロトコル処理部104へ受渡す。同時に、受信処理部103は、プロトコル処理部104へ受け渡したパケットメモリ分を補充するために、パケット処理装置が持つメモリから新たなパケットメモリ101の領域を確保する。
 受信パケットが受け渡されたプロトコル処理部104は、必要なプロトコル処理が終了するとパケットメモリ101の領域を解放する。
 以上のような一般的な受信処理では、特に、小さいパケットが高頻度に到着した場合、ハードウェアの割り込みの数が増大するために、パケット処理装置のプロセッサが高負荷となり、受信性能が低下することが知られている。また、DMA転送が起動される回数が増加するために、DMA転送制御に伴うオーバーヘッドのために受信性能が低下することが知られている。
 このような問題に対処するために、回線対応部において設定された閾値に達するまで、複数の小さいパケットを1つの大きな結合パケットに纏め、結合パケットのサイズが閾値に到達することを契機として、一括してパケットメモリへ結合パケットをDMA転送する技術が提案されている(特許文献1参照)。
 このような、複数の小さなパケットを1つの結合パケットに纏めて転送するDMA転送方式(以降、纏めDMA転送)を用いることにより、パケット処理装置に小さなパケットが到着した場合でも、ハードウェア割り込みの回数を減少させることができ、またDMA転送のオーバーヘッドを削減することができるので、高速な受信処理を行うことができる。
 図38は特許文献1に開示された従来のパケット処理装置の構成を示すブロック図である。このパケット処理装置は、回線対応部100と、パケットメモリ101と、結合パケット転送部102aと、受信処理部103と、プロトコル処理部104と、受信バッファ105と、パケット結合部106と、結合閾値制御部107とを備えている。
 図38に示したパケット処理装置では、パケット結合部106は、回線対応部100において受信されたパケットをパケット結合用の受信バッファ105に転送する。このとき、パケット結合部106は、回線対応部100において受信されたパケットと受信バッファ105中に既に格納されているパケットとが結合され、1つの結合パケットになるように、パケットを受信バッファ105に格納する。そして、パケット結合部106は、受信バッファ105中の結合パケットの大きさが、結合閾値制御部107にあらかじめ設定された閾値を超えると、結合パケットのパケットメモリ101への転送要求を発行する。
 図35の場合と同様に、結合パケット転送部102aは、ディスクリプタ1020aと、DMAコントローラ1021aとから構成される。図39はディスクリプタ1020aの概要を説明する図である。図39の例では、パケットメモリ101にN個の結合パケットが格納される場合を示している。この場合、パケット処理装置のプロセッサは、N個の結合パケットの各々に対応するアドレスやフラグをディスクリプタ1020aに設定する。
 プロセッサは、結合パケットをパケットメモリ101へ書き込む際の先頭アドレスAD#1~AD#Nをディスクリプタ1020aに予め設定しておく。通常、同時に設定できるアドレスの数は予め決まっており、使用されるアドレスの順番も決まっている。
 プロセッサは、設定したアドレスAD#1~AD#Nが有効か否かを示すフラグADF#1~ADF#Nのセット/リセットをディスクリプタ1020aに対して行う。アドレスAD#1~AD#Nの設定後、プロセッサがフラグADF#1~ADF#Nを有効にすると、パケットメモリ101への結合パケットの書き込みが可能となる。
 また、ディスクリプタ1020aには、設定されたアドレスAD#1~AD#Nへの結合パケットの書き込みが完了したか否かを示す受信完了フラグWDF#1~WDF#Nと、設定されたアドレスA#1~A#Nへの書き込みが行われた結合パケットの長さ(結合したパケットのパケット長の合計値)を示す受信データサイズLD#1~LD#Nとが設定される。
 図40はDMAコントローラ1021aの動作を説明するフローチャートである。最初に、DMAコントローラ1021aは、ディスクリプタ1020aの読出および書込の順を示す変数nを1に初期化し(図40ステップS200)、n=1番目のフラグADF#1をディスクリプタ1020aから読み出す(図40ステップS201)。
 DMAコントローラ1021aは、先頭アドレスが有効であることをフラグADF#1が示している場合(図40ステップS202においてyes)、n=1番目の先頭アドレスAD#1をディスクリプタ1020aから読み出し(図40ステップS203)、対応するn=1番目の結合パケットをパケットメモリ101の先頭アドレスAD#1から始まる領域に書き込む(図40ステップS204)。
 結合パケットの書き込み完了後、DMAコントローラ1021aは、n=1番目の結合パケットの長さを示す受信データサイズLD#1と、結合パケットの書き込みが完了したことを示す受信完了フラグWDF#1とをディスクリプタ1020aに書き込む(図40ステップS205)。
 また、結合パケットの書き込みが完了したことをパケット処理装置のプロセッサ(不図示)に通知するためにハードウェア割り込みを発生させ、受信処理部103の起動要求を行う。
 そして、DMAコントローラ1021aは、変数nがNと等しいかどうかを判定する(図40ステップS206)。DMAコントローラ1021aは、変数nがNに達していない場合(ステップS206においてno)、変数nを1増やし(図40ステップS207)、ステップS201に戻る。また、DMAコントローラ1021aは、変数nがNに達した場合(ステップS206においてyes)、ステップS200に戻る。こうして、N個の結合パケットが順番にパケットメモリ101に転送される。
 結合パケット転送部102a(DMAコントローラ1021a)からの起動要求に応じて起動した受信処理部103は、パケットメモリ101に転送された結合パケットをプロトコル処理部104へと渡す。
 図38に示した構成によって、受信処理の起動要求が、複数のパケットが結合した結合パケットが転送される度に行われるようになるため、受信処理部103の起動回数が減少し、パケット処理装置のプロセッサの負荷が軽減される。また、DMA転送制御の回数も減少するためにオーバーヘッドの割合が低くなり、高い受信性能を発揮することが可能となる。
 ただし、図38に示した構成では、結合パケットをプロトコル処理部104において元の複数のパケットに復元する必要がある。この復元処理をプロトコル処理部104のハードウェアで実現しようとすると、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケット結合部106からプロトコル処理部104に通知する手段が必要となり、そのためにパケット結合部106等のハードウェアの規模が大きくなるという課題がある。また、復元処理に必要な情報をパケットメモリ101等に保持しておく必要がある。
 また、復元処理を受信処理部103等のソフトウェアで実現することも可能であるが、上記と同様に、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケット結合部106から受信処理部103に通知する手段が必要となり、そのためにパケット結合部106等のハードウェアの規模が大きくなるという課題がある。また、ソフトウェアで復元処理を行うため、ソフトウェアによる処理が増加し、プロセッサの負荷が上がり、その結果として、纏めDMA転送による受信性能の向上が抑制されるという課題もある。
 図41はパケット処理装置の別の構成を示すブロック図である。このパケット処理装置は、図38のパケット処理装置の受信処理部103とプロトコル処理部104との間に、結合パケットを元の複数のパケットに復元する結合パケット分離部108を挿入したものである。
 パケットの復元処理をプロトコル処理部104のハードウェアで実現する場合と同様に、結合パケット分離部108をハードウェアで実現しようとすると、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケット結合部106から結合パケット分離部108まで通知する手段が必要となり、そのためにパケット結合部106等のハードウェアの規模が大きくなるという課題がある。
 また、結合パケット分離部108をソフトウェアで実現することも可能であるが、上記と同様に、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケット結合部106から結合パケット分離部108に通知する手段が必要となり、そのためにパケット結合部106等のハードウェアの規模が大きくなるという課題がある。また、ソフトウェアで復元処理を行うため、ソフトウェアによる処理が増加し、プロセッサの負荷が上がり、その結果として、纏めDMA転送による受信性能の向上が抑制されるという課題もある。
 図42はパケット処理装置の別の構成を示すブロック図である。このパケット処理装置は、図41のパケット処理装置において、通信回線から受信したパケットの処理を行って処理結果のデータを出力するパケット処理部114を設け、パケットメモリ101と結合パケット転送部102aと受信処理部103とプロトコル処理部104と受信バッファ105とパケット結合部106と結合パケット分離部108とを、それぞれパケットから抽出したデータのためのデータ用メモリ115と結合データ転送部102bと受信処理部117とデータ処理部116と受信バッファ118とデータ結合部120と結合データ分離部108bに置き換えたものである。
 データ結合部120は、パケット処理部114が出力したデータをデータ結合用の受信バッファ118に転送する。このとき、データ結合部120は、パケット処理部114が出力したデータと受信バッファ118中に既に格納されているデータとを連結して1つのデータブロックになるように、データを受信バッファ118に格納する。
 結合データ転送部102bは、データ結合部120によって生成されたデータブロックをデータ用メモリ115にDMA転送する。
 受信処理部117は、データ用メモリ115に転送されたデータブロックを結合データ分離部108bへ受渡す。結合データ分離部108bは、データブロックを元の複数のデータに復元する。データ処理部116は、結合データ分離部108bによって復元されたデータに必要な処理を施す。
 図42に示した構成では、結合したデータを結合データ分離部108bにおいて元の複数のデータに復元する必要がある。この復元処理を結合データ分離部108bのハードウェアで実現しようとすると、復元処理に必要な情報(結合したデータの数、データ毎のサイズ)をデータ結合部120から結合データ分離部108bに通知する手段が必要となり、そのためにデータ結合部120等のハードウェアの規模が大きくなるという課題がある。また、複数のデータブロック(転送単位)分に対応する情報(データ毎のサイズ等)をデータ用メモリ115等に保持しておく必要がある。
 また、結合データ分離部108bをソフトウェアで実現することも可能であるが、データ結合を行わない場合よりもソフトウエアの処理が増えるという課題がある。
 図43はパケット処理装置の別の構成を示すブロック図である。このパケット処理装置は、図38、図41のパケット処理装置の結合パケット転送部102aの代わりに、ソフトウェアによる結合パケット書き込み部109を設けたものである。DMA転送を用いないパケット処理装置においても、ソフトウェアにより複数のパケットを纏めてパケットメモリ101に書き込むこと(以降、纏め書き込み)によりパケットメモリ101への書き込みの実効スループットが向上する場合(パケットメモリ101がDRAMで構成されている場合等)がある。このように、纏め書き込みを行うパケット処理装置においても、結合パケットを元の複数のパケットに復元する際に上記と同様の問題がある。
 また、図43の処理の全て(パケットメモリ101内と回線対応部100内のハードウェア処理を除く)をソフトウェアで行う場合、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケットメモリ101等に保存する必要があり、纏め書き込みを行わない場合と比較して、パケットメモリ101等の容量(書き込み可能なビット数)を大きくする必要があるという課題が有る。
特許第4468332号公報
 本発明は、前記従来技術の問題点を解決するためになされたものであり、本発明の目的は、ハードウェアによる纏めDMA転送、もしくはソフトウェアによる纏め書き込みを用いるパケット処理装置において、複数のデータが結合したデータブロックを元の複数のデータに復元する処理に必要となるハードウェアの規模を小さくし、かつ纏めDMA転送もしくは纏め書き込みの効果による高い受信性能を実現することが可能となる技術を提供することにある。
 本発明のパケット処理装置は、通信回線から受信したパケットの処理を行って処理結果のデータを出力するように構成されたパケット処理部と、前記パケット処理部から出力された複数のデータを連結してデータブロックを生成するように構成されたデータ結合部と、前記パケット処理部から出力されたデータを格納するように構成されたデータ用メモリと、前記データ結合部によって生成されたデータブロックを前記データ用メモリにDMA転送するか、またはプロセッサによって書き込むように構成された結合データ転送部とを備え、前記結合データ転送部は、前記データブロック内の各データの先頭の、前記データ用メモリ上におけるアドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタに書き込むことを特徴とするものである。
 また、本発明のパケット処理装置は、通信回線から受信したパケットの処理を行って処理結果のデータを出力するように構成されたパケット処理部と、前記パケット処理部から出力された複数のデータを連結してデータブロックを生成するように構成されたデータ結合部と、前記パケット処理部から出力されたデータを格納するように構成されたデータ用メモリと、前記データ結合部によって生成されたデータブロックを前記データ用メモリにDMA転送するか、またはプロセッサによって書き込むように構成された結合データ転送部とを備え、前記結合データ転送部は、前記データブロック内の各データの先頭の、前記データ用メモリ上におけるアドレスを決定し、このアドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタに書き込み、前記データブロックを前記データ用メモリにDMA転送するか、またはプロセッサによって書き込むことを特徴とするものである。
 また、本発明のパケット処理装置の1構成例において、前記結合データ転送部は、前記データブロック内の各データのデータ長を示す受信データサイズの情報を前記ディスクリプタに書き込むことを特徴とするものである。
 また、本発明のパケット処理装置の1構成例は、前記データ用メモリに格納されたデータを読み出す処理部をさらに備え、前記処理部は、前記ディスクリプタに書き込まれた情報に基づいて前記データ用メモリからデータを読み出して処理を施すことを特徴とするものである。
 また、本発明のパケット処理方法は、通信回線から受信したパケットの処理を行って処理結果のデータを出力する第1のステップと、前記第1のステップで得られた複数のデータを連結してデータブロックを生成する第2のステップと、前記第1のステップで得られたデータに対して処理を施す処理部がデータの読み出しを行うデータ用メモリに対して、前記データブロックをDMA転送するか、またはプロセッサによって書き込む第3のステップと、前記データブロック内の各データの先頭の、前記データ用メモリ上におけるアドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタに書き込む第4のステップとを含むことを特徴とするものである。
 また、本発明のパケット処理方法は、通信回線から受信したパケットの処理を行って処理結果のデータを出力する第1のステップと、前記第1のステップで得られた複数のデータを連結してデータブロックを生成する第2のステップと、前記第1のステップで得られたデータに対して処理を施す処理部がデータの読み出しを行うデータ用メモリに対して、前記データブロック内の各データの先頭の、前記データ用メモリ上におけるアドレスを決定する第3のステップと、前記アドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタに書き込む第4のステップと、前記データブロックを前記データ用メモリにDMA転送するか、またはプロセッサによって書き込む第5のステップとを含むことを特徴とするものである。
 本発明によれば、結合データ転送部は、データ結合部によって生成されたデータブロックをデータ用メモリにDMA転送するか、またはプロセッサによって書き込み、データブロック内の各データの先頭の、データ用メモリ上におけるアドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタに書き込む。本発明の結合データ転送部を備えたパケット処理装置によれば、従来技術の構成と比較して、複数のデータが結合したデータブロックを元の複数のデータに復元する処理に必要となるハードウェアの規模を小さくすることができ、かつ纏めDMA転送もしくは纏め書き込みの効果による高い受信性能を実現することが可能となる。
 また、本発明では、結合データ転送部が、データブロック内の各データの先頭の、データ用メモリ上におけるアドレスを決定し、このアドレスの情報をディスクリプタに書き込むことにより、従来技術の構成と比較して、データ用メモリ内に確保が必要なデータブロック用のバッファ領域のサイズを小さくすることができる。
 なお、従来の図42の構成で、複数のデータが結合したデータブロックを元の複数のデータに復元する処理をソフトウエアで実装した場合と比較すると、本発明の構成で複数のデータが結合したデータブロックを元の複数のデータに復元する処理をハードウエアで行う場合、1データの処理に必要となるプロセッサの処理が軽くなるため、受信性能が向上する(単位時間に処理できるデータの数が増加する)という効果がある。また、1データの処理に必要となるプロセッサの消費電力が小さくなるという効果もある。
図1は、本発明の第1の参考例に係るパケット処理装置の構成を示すブロック図である。 図2は、本発明の第1の参考例に係るパケット処理装置のディスクリプタの概要を説明する図である。 図3は、本発明の第1の参考例に係るパケット処理装置の転送管理部の動作を説明するフローチャートである。 図4は、本発明の第1の参考例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図5は、本発明の第1の参考例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図6は、本発明の第1の参考例に係るパケット処理装置の受信処理部の動作を説明するフローチャートである。 図7は、本発明の第2の参考例に係るパケット処理装置の構成を示すブロック図である。 図8は、本発明の第2の参考例に係るパケット処理装置のディスクリプタの概要を説明する図である。 図9は、本発明の第2の参考例に係るパケット処理装置の結合パケット転送部の動作を説明するフローチャートである。 図10は、本発明の第2の参考例に係るパケット処理装置の結合パケット転送部の動作を説明するフローチャートである。 図11は、本発明の第1の実施例に係るパケット処理装置の構成を示すブロック図である。 図12は、本発明の第1の実施例に係るパケット処理装置の転送管理部の動作を説明するフローチャートである。 図13は、本発明の第1の実施例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図14は、本発明の第1の実施例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図15は、本発明の第1の実施例に係るパケット処理装置の受信処理部の動作を説明するフローチャートである。 図16は、本発明の第2の実施例に係るパケット処理装置の構成を示すブロック図である。 図17は、本発明の第2の実施例に係るパケット処理装置の結合データ転送部の動作を説明するフローチャートである。 図18は、本発明の第2の実施例に係るパケット処理装置の結合データ転送部の動作を説明するフローチャートである。 図19は、本発明の第3の実施例に係るパケット処理装置の構成を示すブロック図である。 図20は、本発明の第3の実施例に係るパケット処理装置のディスクリプタの概要を説明する図である。 図21は、本発明の第3の実施例に係るパケット処理装置の転送管理部の動作を説明するフローチャートである。 図22は、本発明の第3の実施例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図23は、本発明の第3の実施例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図24は、本発明の第3の実施例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図25は、本発明の第3の実施例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図26は、本発明の第3の実施例に係るパケット処理装置の受信処理部の動作を説明するフローチャートである。 図27は、本発明の第3の実施例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図28は、本発明の第4の実施例に係るパケット処理装置の構成を示すブロック図である。 図29は、本発明の第4の実施例に係るパケット処理装置の結合データ転送部の動作を説明するフローチャートである。 図30は、本発明の第4の実施例に係るパケット処理装置の結合データ転送部の動作を説明するフローチャートである。 図31は、本発明の第4の実施例に係るパケット処理装置の結合データ転送部の動作を説明するフローチャートである。 図32は、本発明の第4の実施例に係るパケット処理装置の結合データ転送部の動作を説明するフローチャートである。 図33は、本発明の第4の実施例に係るパケット処理装置の結合データ転送部の動作を説明するフローチャートである。 図34は、本発明の第1~第4の実施例に係るパケット処理装置を実現するコンピュータの構成例を示すブロック図である。 図35は、従来のパケット処理装置の構成を示すブロック図である。 図36は、図35のパケット処理装置のディスクリプタの概要を説明する図である。 図37は、図35のパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図38は、従来のパケット処理装置の別の構成を示すブロック図である。 図39は、図38のパケット処理装置のディスクリプタの概要を説明する図である。 図40は、図38のパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図41は、従来のパケット処理装置の別の構成を示すブロック図である。 図42は、従来のパケット処理装置の別の構成を示すブロック図である。 図43は、従来のパケット処理装置の別の構成を示すブロック図である。
[第1の参考例]
 以下、本発明の基礎となる参考例について説明する。なお、参考例および実施例を説明するための全図において、同一機能を有するものは同一符号を付け、その繰り返しの説明は省略する。図1は、本発明の第1の参考例に係るパケット処理装置の構成を示すブロック図である。
 図1のパケット処理装置は、図38の構成と同様に、通信回線(不図示)と接続され、通信回線からデータを受信する回線対応部100と、通信回線から受信したパケットが格納されるパケットメモリ101と、パケットメモリ101に格納されたパケットをプロトコル処理部104へ渡す受信処理部103と、パケットのプロトコル処理を行うプロトコル処理部104と、パケット結合用の受信バッファ105と、結合パケットの大きさを規制する閾値があらかじめ設定された結合閾値制御部107と、通信回線から受信した複数のパケットを受信バッファ105において連結して1つの結合パケットを生成するパケット結合部110と、パケット結合部110によって生成された結合パケットをパケットメモリ101にDMA転送する結合パケット転送部111と、予め定められたメモリ上のデータ領域であるディスクリプタ1110の初期設定を行う転送管理部112とから構成される。なお、転送管理部112については、受信処理部103の一部として構成しても良い。
 このうち、回線対応部100とパケット結合用の受信バッファ105と結合閾値制御部107とは、図38の構成と同等である。
 パケット結合部110は、回線対応部100において受信されたパケットをパケット結合用の受信バッファ105に転送する。このとき、パケット結合部110は、回線対応部100において受信されたパケットと受信バッファ105中に既に格納されているパケットとを連結して1つの結合パケットになるように、パケットを受信バッファ105に格納する。そして、パケット結合部110は、受信バッファ105中の結合パケットの大きさが、結合閾値制御部107に設定された閾値を超えると、結合パケットのパケットメモリ101への転送要求を発行する。
 なお、パケット結合部110は、受信バッファ105中の結合パケットの大きさが閾値を超える前に、タイムアウト(パケット間の受信間隔が予め定められた期間を超えた場合等)が発生した場合に、転送要求を発行するようにしてもよい。
 さらに、パケット結合部110は、受信バッファ105において結合したパケットの数と各パケットのサイズとを記録し、結合パケットの転送要求を発行する際に、結合したパケットの数と各パケットのサイズとを結合パケット転送部111に対して通知する。
 結合パケット転送部111は、DMAコントローラ1111から構成される。結合パケット転送部111は、結合パケットを1度のDMA転送により、パケットメモリ101に転送し、ハードウェア割り込みを発生させて受信処理部103の起動要求を発行する。
 なお、パケット処理装置のプロセッサ(不図示)へのハードウェア割り込みの発生を行わないようにしてもよい。
 また、結合パケット転送部111は、パケット結合部110から通知された、結合したパケットの数と各パケットのサイズの情報を用いて、転送管理部112(プロセッサが実行するソフトウェア)がパケット毎に用意したディスクリプタ1110にサイズ等を書き込む。ディスクリプタ1110の構成と結合パケット転送部111の動作の詳細については後述する。
 受信処理部103は、起動要求を検知すると、パケット毎に用意されているディスクリプタ1110に書き込まれているアドレス情報とサイズの情報とに基づいてパケットメモリ101内のパケットを読み出してプロトコル処理部104へ渡す。この受信処理部103の動作は、図35の構成の動作と同等である。
 プロトコル処理部104は、受信処理部103から受け取ったパケットに対して必要なプロトコル処理を行う。そして、プロトコル処理部104は、必要なプロトコル処理が終了すると、受信処理部103から渡されたパケットが格納されていたパケットメモリ101の領域を解放する。このプロトコル処理部104の動作は、図35の構成の動作と同等である。
 必要なプロトコル処理が終了し、受信処理部103から渡されたパケットが格納されていたパケットメモリ101の領域が開放されたことをもって、後述する図6のS503における処理終了と判断する。
 なお、受信処理部103とプロトコル処理部104と転送管理部112とは、汎用のパーソナルコンピュータやワークステーション上で動作するソフトウェアで実現することもできるし、プログラムと協調して動作するFPGA(Field Programmable Gate Array)等のハードウェアで実現することも可能である。
 パケットメモリ101は、パーソナルコンピュータ、通信機器あるいは通信ボード上のメモリとして構成可能である。
 回線対応部100と結合閾値制御部107とパケット結合部110とは、通信機器あるいは通信ボード上のFPGA等により構成可能である。
 受信バッファ105は、通信機器あるいは通信ボード上のFPGA等が持つ記憶領域や、FIFO(First In,First Out)等の記憶回路により構成可能である。
 図2に本実施例の結合パケット転送部111が使用するディスクリプタ1110の構成例を示す。一般的に、受信処理用のパケットメモリ101のアドレス等を記録するデータ構造体がディスクリプタ1110と呼ばれている。図2の例では、パケットメモリ101にN個のパケットが格納される場合を示している。
 図2のディスクリプタ1110は、受信したパケットの書き込み先の先頭アドレスA#1~A#Nと、先頭アドレスA#1~A#Nが有効か否かを示す有効フラグAF#1~AF#Nと、先頭アドレスA#1~A#Nへの書き込みが行われたパケットのパケット長を示す受信データサイズL#1~L#Nと、先頭アドレスA#1~A#Nへのパケットの書き込みが完了したか否かを示す受信完了フラグWF#1~WF#Nとを、複数(N組)書き込み可能なデータ構造体となっている。このディスクリプタ1110の構成は、図35の構成で一般的に用いられている受信処理用のディスクリプタ1020の構成と同等である。
 ディスクリプタ1110は、実体としては、パケットメモリ101と同様に、パーソナルコンピュータ、通信機器あるいは通信ボード上のメモリ内に配置される。
 なお、ディスクリプタ1110をパケットメモリ101と同じメモリ内に配置することも可能であるが、その場合、どちらの用途に使用するのかをメモリ内のアドレスにより分けることができる。
 ここで、従来のディスクリプタ1020を用いた従来のDMA転送の動作例を、図36と図37を用いて再度詳細に説明する。
 まず、パケット処理装置のプロセッサは、パケットの書き込み先の先頭アドレスA#1~A#Nを決定してディスクリプタ1020に書き込み、さらに、その先頭アドレスA#1~A#Nが有効か否かを示す有効フラグAF#1~AF#Nを「無効」から「有効」に書き換える。
 なお、ディスクリプタ1020には、先頭アドレスの情報等を書き込む領域がN組あるが、書き込む順番は予め決められている。例えば図36の例では、プロセッサは、1番目の先頭アドレスA#1、2番目の先頭アドレスA#2、・・・・、N番目の先頭アドレスA#Nと順番に書き込む。
 一通り書き込んだ後に、再び1番目のパケットの転送が可能になったときには、1番目の先頭アドレスA#1から順番にディスクリプタ1020に書き込むようにすればよい。先頭アドレスA#n(nは1~N)の書き込みが可能か否かは、例えば先頭アドレスA#nに対応する有効フラグAF#nが「無効」であれば可能と判断すればよい。
 次に、DMAコントローラ1021は、ディスクリプタ1020の有効フラグAF#nを確認して、先頭アドレスA#nが「有効」であることを有効フラグAF#nが示している場合(図37ステップS102においてyes)、先頭アドレスA#nをディスクリプタ1020から読み出し(図37ステップS103)、対応するn番目のパケットをパケットメモリ101の先頭アドレスA#nから始まる領域に書き込む(図37ステップS104)。
 このDMA転送完了後、DMAコントローラ1021は、n番目のパケットのパケット長を示す受信データサイズL#nをディスクリプタ1020に書き込むと共に、ディスクリプタ1020に設定されている、n番目のパケットの書き込みが完了したことを示す受信完了フラグWF#nを「未了」から「完了」に書き換える(図37ステップS105)。
 上記のとおりディスクリプタ1020には、有効フラグAF#1~AF#Nの領域がN個(組)あるが、有効フラグAF#1~AF#Nを確認する順番は予め決められている。例えば、図36、図37の例では、DMAコントローラ1021は、1番目の有効フラグAF#1、2番目の有効フラグAF#2、・・・・、N番目の有効フラグAF#Nと順番に確認する。一通り確認が終わった後には、再び1番目の有効フラグAF#1から順番に確認する。
 ディスクリプタ1020には、受信データサイズL#1~L#Nと受信完了フラグWF#1~WF#Nとを書き込む領域もN組用意されている。DMAコントローラ1021は、n番目の先頭アドレスA#nが「有効」であることが確認されたn番目の有効フラグAF#nに対応する番号の領域に、受信データサイズL#nと受信完了フラグWF#nとを書き込む。
 次に、パケット処理装置のプロセッサは、定期的にディスクリプタ1020の受信完了フラグWF#nを確認して、受信完了フラグWF#nが「完了」を示している場合には、対応するn番目の先頭アドレスA#nの情報と受信データサイズL#nの情報とを用いて、パケットメモリ101からn番目のパケットを読み出し、必要な処理(例えばプロトコル処理)を行う。
 そして、プロセッサは、処理が終わったn番目のパケットに対応する、ディスクリプタ1020のn番目の有効フラグAF#nを「有効」から「無効」に書き換えると共に、ディスクリプタ1020のn番目の受信完了フラグWF#nを「完了」から「未了」に書き換える。
 ディスクリプタ1020には、受信完了フラグWF#1~WF#Nの領域がN個(組)あるが、受信完了フラグWF#1~WF#Nを確認する順番は予め決められている。例えば、図36、図37の例では、プロセッサは、1番目の受信完了フラグWF#1、2番目の受信完了フラグWF#2、・・・・、N番目の受信完了フラグWF#Nと順番に確認する。一通り確認が終わった後には、再び1番目の受信完了フラグWF#1から順番に確認する。
 なお、上記の動作でDMAコントローラ1021がDMA転送完了後にプロセッサに対して割り込み処理要求を行うようにし、プロセッサが定期的に受信完了フラグWF#1~WF#Nを確認する代わりに、プロセッサがDMAコントローラ1021からの割り込み処理要求を受信したときに受信完了フラグWF#1~WF#Nを確認するようにしてもよい。
 次に、図2の構成のディスクリプタ1110を用いた本実施例の動作例を図1~図6を用いて説明する。図3は転送管理部112の動作を説明するフローチャート、図4、図5はDMAコントローラ1111の動作を説明するフローチャート、図6は受信処理部103の動作を説明するフローチャートである。
 最初に、転送管理部112(プロセッサが実行するソフトウェア)は、パケット処理装置の初期設定として、N個の各パケットの先頭データの、パケットメモリ101上におけるアドレス、すなわち各パケットの書き込み先の先頭アドレスA#n(nは1~N)を決定してディスクリプタ1020に書き込む(図3ステップS300)。さらに、転送管理部112は、その先頭アドレスA#nが有効か否かを示す有効フラグAF#nを「無効」から「有効」に書き換える(図3ステップS301)。
 ディスクリプタ1110には、先頭アドレスの情報等を書き込む領域がN組用意されているが、書き込む順番は予め決められている。例えば図2の例では、転送管理部112は、1番目の先頭アドレスA#1、2番目の先頭アドレスA#2、・・・・、N番目の先頭アドレスA#Nと順番に書き込む。
 一通り書き込んだ後に、再び1番目のパケットの転送が可能になったときには、1番目の先頭アドレスA#1から順番にディスクリプタ1110に書き込むようにすればよい。先頭アドレスA#nの書き込みが可能か否かは、例えば先頭アドレスA#nに対応する有効フラグAF#nが「無効」であれば可能と判断すればよい。なお、この動作は従来技術と同等である。
 最初に、結合パケット転送部111内のDMAコントローラ1111は、ディスクリプタ1110の読出および書込の順を示す変数nを1に初期化する(図4ステップS400)。
 そして、DMAコントローラ1111は、パケット結合部110から転送要求が発行されると、ディスクリプタ1110のn番目の有効フラグAF#nを確認する(図4ステップS401)。
 DMAコントローラ1111は、n番目の先頭アドレスA#nが「有効」であることを有効フラグAF#nが示している場合(図4ステップS402においてyes)、パケット結合部110からの情報(結合したパケットの数と各パケットのサイズ)を確認して、パケットメモリ101に転送すべきデータが、結合されていない単体のパケットか結合パケットかを確認する(図4ステップS403)。
 DMAコントローラ1111は、パケットメモリ101に転送すべきデータが結合パケットではない場合(結合したパケットの数が1の場合)、対応する有効フラグAF#nが「有効」であることを確認したn番目の先頭アドレスA#nをディスクリプタ1110から読み出し(図4ステップS404)、対応するn番目のパケットをパケットメモリ101の先頭アドレスA#nから始まる領域に書き込むDMA転送を行う(図4ステップS405)。
 このDMA転送の完了後、DMAコントローラ1111は、n番目のパケットのパケット長を示す受信データサイズL#nをディスクリプタ1110に書き込むと共に、ディスクリプタ1110に設定されている、n番目のパケットの書き込みが完了したことを示す受信完了フラグWF#nを「未了」から「完了」に書き換える(図4ステップS406)。
 DMAコントローラ1111は、変数nがNと等しいかどうかを判定する(図4ステップS407)。DMAコントローラ1111は、変数nがNに達していない場合(ステップS407においてno)、変数nを1増やし(図4ステップS408)、ステップS401に戻る。また、DMAコントローラ1111は、変数nがNに達した場合(ステップS407においてyes)、ステップS400に戻る。
 上記のとおりディスクリプタ1110には、有効フラグAF#1~AF#Nの領域がN個(組)用意されているが、有効フラグAF#1~AF#Nを確認する順番は予め決められている。例えば、図2、図4の例では、DMAコントローラ1111は、1番目の有効フラグAF#1、2番目の有効フラグAF#2、・・・・、N番目の有効フラグAF#Nと順番に確認する。一通り確認が終わった後、DMAコントローラ1111は、変数nを1に初期化し(ステップS400)、再び1番目の有効フラグAF#1から順番に確認する。
 ディスクリプタ1110には、受信データサイズL#1~L#Nと受信完了フラグWF#1~WF#Nとを書き込む領域もN組用意されている。DMAコントローラ1111は、n番目の先頭アドレスA#nが「有効」であることが確認されたn番目の有効フラグAF#nに対応する番号の領域に、受信データサイズL#nと受信完了フラグWF#nとを書き込む。
 また、DMAコントローラ1111は、パケットメモリ101に転送すべきデータが結合パケットの場合(結合したパケットの数kが2以上の場合)、結合したパケットの数kを確認し(図5ステップS409)、ディスクリプタ1110内の「k-1」個の有効フラグAF#(n+1)~AF#(n+k-1)を確認する(図5ステップS410)。ここで、「k-1」個の有効フラグを確認する理由は、n番目の有効フラグAF#nを既にステップS402で確認しているからである。
 なお、n=Nの場合、DMAコントローラ1111は、AF#1からAF#(k-1)までの有効フラグを確認すればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1111は、AF#(n+1)からAF#NまでとAF#1からAF#(k-1-(N-n))までの有効フラグを確認すればよい。
 DMAコントローラ1111は、ステップS402,S410の処理により、確認したk個の有効フラグが全て「有効」の場合(ステップS410においてyes)、確認したk個の有効フラグの中で最初の有効フラグAF#nに対応するn番目の先頭アドレスA#nをディスクリプタ1110から読み出し(図5ステップS411)、対応する結合パケットをパケットメモリ101の先頭アドレスA#nから始まる領域に書き込むDMA転送を行う(図5ステップS412)。
 このDMA転送の完了後、DMAコントローラ1111は、パケット結合部110から通知された情報(結合した各パケットのサイズ)に基づいて、パケットメモリ101にDMA転送した結合パケットを構成する各パケットのパケット長を示す受信データサイズL#n~L#(n+k-1)を、ディスクリプタ1110に書き込む(図5ステップS413)。
 なお、n=Nの場合、DMAコントローラ1111は、受信データサイズL#nと、L#1からL#(k-1)までの受信データサイズをディスクリプタ1110に書き込むようにすればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1111は、受信データサイズL#nと、L#(n+1)からL#NまでとL#1からL#(k-1-(N-n))までの受信データサイズをディスクリプタ1110に書き込むようにすればよい。
 続いて、DMAコントローラ1111は、ディスクリプタ1110内の「k-1」個の先頭アドレスA#(n+1)~A#(n+k-1)を、結合パケットを構成するk個のパケットのうち、初めの「k-1」個のパケットのパケット長に応じて書き換える(図5ステップS414)。
 具体的には、DMAコントローラ1111は、先頭アドレスA#(n+1)については、先頭アドレスA#nと、結合パケットを構成するk個のパケットのうち1番目のパケットのパケット長(受信データサイズL#nが示す値)とを足した値に書き換える。また、DMAコントローラ1111は、先頭アドレスA#(n+k-1)については、先頭アドレスA#(n+k-2)と、結合パケットを構成するk個のパケットのうち「k-1」番目のパケットのパケット長(受信データサイズL#(n+k-2)が示す値)とを足した値に書き換える。
 このように、DMAコントローラ1111は、先頭アドレスA#iを書き換える場合、1つ前の先頭アドレスA#(i-1)と、結合パケットを構成するパケットのうち「i-1」番目のパケットのパケット長とを足した値に書き換えるようにすればよい。
 次に、DMAコントローラ1111は、パケットメモリ101にDMA転送した結合パケットを構成する各パケットに対応する受信完了フラグWF#n~WF#(n+k-1)を「未了」から「完了」に書き換える(図5ステップS415)。
 なお、n=Nの場合、DMAコントローラ1111は、受信完了フラグWF#nと、WF#1からWF#(k-1)までの受信完了フラグとを「未了」から「完了」に書き換えるようにすればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1111は、受信完了フラグWF#nと、WF#(n+1)からWF#NまでとWF#1からWF#(k-1-(N-n))までの受信完了フラグとを「完了」に書き換えるようにすればよい。
 そして、DMAコントローラ1111は、n+k>Nが成立するかどうかを確認し(図5ステップS416)、n+kがNより大きい場合は、変数nをn=n+k-Nとし(図5ステップS417)とし、ステップS401に戻る。また、DMAコントローラ1111は、n+kがN以下の場合は、変数nをn=n+kとし(図5ステップS418)とし、ステップS401に戻る。
 こうして、本実施例のDMA転送では、k個のパケットが連結された結合パケットを纏めてパケットメモリ101に転送し、ディスクリプタ1110の先頭アドレスの情報を一部書き換えることにより、パケット処理装置のプロセッサ(受信処理部103とプロトコル処理部104)に対して各パケットの先頭が書き込まれたアドレスを通知するようにしている。
 受信処理部103(プロセッサが実行するソフトウェア)は、定期的にディスクリプタ1110の受信完了フラグWF#n(nは1~N)を確認して、受信完了フラグWF#nが「完了」を示している場合(図6ステップS501においてyes)、対応するn番目の先頭アドレスA#nの情報と受信データサイズL#nの情報とに基づいてパケットメモリ101からn番目のパケットを読み出してプロトコル処理部104へ渡す(図6ステップS502)。
 プロトコル処理部104で必要な処理が行われた後に(図6ステップS503においてyes)、受信処理部103(プロセッサが実行するソフトウェア)は、プロトコル処理が終わったn番目のパケットに対応する、ディスクリプタ1110のn番目の有効フラグAF#nを「有効」から「無効」に書き換えると共に、ディスクリプタ1110のn番目の受信完了フラグWF#nを「完了」から「未了」に書き換える(図6ステップS504)。
 ディスクリプタ1110には、受信完了フラグWF#1~WF#Nの領域がN個(組)あるが、受信完了フラグWF#1~WF#Nを確認する順番は予め決められている。例えば、受信処理部103(プロセッサが実行するソフトウェア)は、1番目の受信完了フラグWF#1、2番目の受信完了フラグWF#2、・・・・、N番目の受信完了フラグWF#Nと順番に確認する。一通り確認が終わった後には、再び1番目の受信完了フラグWF#1から順番に確認する。
 なお、定期的にディスクリプタ1110の受信完了フラグWF#nを確認する代わりに、DMA転送の完了後にDMAコントローラ1111がプロセッサに対して割り込み処理要求を発行し、この割り込み処理要求に応じて受信処理部103(プロセッサが実行するソフトウェア)が、ディスクリプタ1110の受信完了フラグWF#n(nは1~N)を確認するようにしてもよい。
 以上のプロセッサ(ソフトウェア)の動作は図35の構成の従来技術のプロセッサ(ソフトウェア)の動作と同等であり、結合パケットを元の複数のパケットに復元する処理を受信処理用のソフトウェアで実現する必要はない。すなわち、受信処理部103とプロトコル処理部104とは、本参考例のように結合パケットがパケットメモリ101に書き込まれる場合でも、従来と同じ処理を行えばよい。
 以上に説明したように、本参考例のパケット処理装置は、纏めDMA転送を実現することができ、かつ結合パケットを元の複数のパケットに復元するための情報をディスクリプタ1110に書き込む手段(DMAコントローラ1111)を内蔵する結合パケット転送部111を備えている。DMAコントローラ1111はハードウェアで実装可能なので、復元処理のソフトウェアでの実行を不要とし、かつ、纏めDMA転送の効果による高い受信性能を実現することが可能となる。
 なお、従来の図38の構成、もしくは図41の構成のパケット処理装置において、結合パケットを元の複数のパケットに復元する処理をプロセッサ(ソフトウェア)で実行する場合と比較すると、本参考例では、復元処理をプロセッサ(ソフトウェア)で行う必要がなくなるので、1パケットの処理に必要となるプロセッサの処理が軽くなり、受信性能が向上する(単位時間に処理できるパケットの数が増加する)という効果がある。また、本参考例では、1パケットの処理に必要となるプロセッサの消費電力が小さくなるという効果もある。
 また、本参考例では、図35の構成の受信処理部103およびプロトコル処理部104用のソフトウェアをそのまま本参考例のパケット処理装置で使用することができる。これは、ハードウェア(DMAコントローラ1111)を変えるだけで、纏めDMAによる受信性能の向上が実現できることを示している。
 なお、本参考例では、プロセッサ(ソフトウェア)が用意するパケットメモリ101上のアドレス領域を複数のパケットで共有するので、共有する全てのパケットの受信処理(プロトコル処理部104への転送)が完了するまでそのアドレス領域は再利用できない。
 また、転送管理部112(プロセッサが実行するソフトウェア)は、結合パケットの最大サイズの書き込みが可能なサイズのアドレス領域を用意してディスクリプタ1110に設定する必要が有る。結合パケットの最大サイズは、結合閾値制御部107に設定される閾値に許容最大パケット長を足した値となる。
 また、本参考例のパケット処理装置で纏めDMA転送を正常に行うため、転送管理部112(プロセッサが実行するソフトウェア)は、事前に、パケットメモリ101内に、N×DB_mux(DB_muxは結合パケットの最大サイズ)のバッファ領域を確保しておく必要がある。この領域確保は、図38の構成の場合と同等である。
 例えば、本参考例において、上記のバッファ領域をパケットメモリ101内の連続した領域で用意する場合、このバッファ領域の先頭アドレスは、転送管理部112(プロセッサが実行するソフトウェア)が設定する、図2中の先頭アドレスA#1である。一方、バッファ領域の最終アドレスは、先頭アドレスA#1+(N×DB_mux)-1となる。この場合、転送管理部112(プロセッサが実行するソフトウェア)が設定する、図2中の先頭アドレスA#Nは、先頭アドレスA#1+(N-1)×DB_muxである。
 このような領域確保により、結合パケットのDMA転送の転送先アドレスがA#Nとなった場合でも、このアドレスA#Nから上記のバッファ領域の最終アドレスまでDB_mux分の領域がパケットメモリ101に確保されているので、結合パケットをこのDB_mux分の連続した領域に確実に書き込むことができる。
 仮に、アドレスA#Nからバッファ領域の最終アドレスまでの領域がDB_muxより小さい場合、書き込むべき結合パケットの一部を本来書き込んではいけない領域に書き込んでしまうケースが発生することになる。
 また、パケットメモリ101内に確保するバッファ領域を連続した領域ではなく、例えばN個の領域に非連続で用意する場合、DB_mux分の領域をあらかじめN個用意し、それぞれの領域の先頭アドレスをA#1~A#Nとして転送管理部112(プロセッサが実行するソフトウェア)で設定することにより、結合パケットをDB_mux分の連続した領域に確実に書き込むことができ、本来書き込んではいけない領域に書き込んでしまうような不具合は発生しない。
 本参考例のパケット処理装置では、DMA転送後にDMAコントローラ1111がディスクリプタ1110の情報(先頭アドレス、受信データサイズ、受信完了フラグ)を書き換えることにより、ソフトウェアでの復元処理を不要としている。
 復元処理を受信処理部103、プロトコル処理部104、もしくは図41の結合パケット分離部108のハードウェアで実現しようとすると、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケット結合部106から受信処理部103、プロトコル処理部104、もしくは図41の結合パケット分離部108に通知する手段が必要となる。
 また、復元処理を受信処理部103、プロトコル処理部104、もしくは図41の結合パケット分離部108のハードウェアで実現しようとすると、DMA転送完了後、受信処理が起動されるまで、場合によっては複数の結合パケット分の復元処理に必要な情報を保持しておく必要があることを考慮しなければならない。
 これに対して、本参考例のパケット処理装置では、1つの結合パケットのDMA転送が完了した時点で結合パケットの復元処理は終わっているので、複数の結合パケット分の情報を保持する必要がない。したがって、復元処理を受信処理部103、プロトコル処理部104、もしくは図41の結合パケット分離部108のハードウェアで実現する場合と比較して、本参考例の方がハードウェアの規模が小さい。
 また、復元処理に必要な情報をパケット結合部106から受信処理部103、プロトコル処理部104、もしくは図41の結合パケット分離部108に通知する手段として、復元処理に必要な情報を結合パケットの中に書き込むことも可能である。具体的には、結合された各パケットのサイズを通知するために、例えば各パケットの前にパケットサイズ等を書き込んだヘッダを付与して付加ヘッダをパケットデータと共にDMA転送する方法が考えられる。
 しかし、復元処理に必要な情報を結合パケットの中に書き込む場合、DMA転送に使用するバスの帯域の一部を、復元処理に必要な情報で占有してしまうことになるので、本来のパケットデータの転送に使用できる実効帯域が小さくなり、その結果、DMA転送の性能が劣化してしまうという問題が発生する。
 本参考例のパケット処理装置では、復元処理に必要な情報を結合パケットに書き込む必要がないので、上記のような実効帯域の劣化は起こらない。
 本参考例では、結合パケット転送部111をハードウェアで実現する例を示したが、受信処理に使用するプロセッサとは別のプロセッサとソフトウェアにより結合パケット転送部111の少なくとも一部の処理を実装することも可能である。このように結合パケット転送部111の少なくとも一部の処理をソフトウェアで実現する場合でも、結合パケットを元の複数のパケットに復元する処理を受信処理部103もしくはプロトコル処理部104で行う必要がなくなるので、纏めDMA転送の効果による高い受信性能を実現することが可能となる。
 また、結合パケット転送部111の少なくとも一部の処理をソフトウェアで実現する場合でも、結合パケット転送部111をハードウェアで実現する場合と同様に、結合パケットを元の複数のパケットに復元する処理に必要となるハードウェアの規模が小さくなる効果(複数の結合パケット分の情報を保持する必要がないことによる効果)、およびパケットデータの転送に使用できる実効帯域の劣化が起こらない効果(復元処理に必要な情報を結合パケットの中に加えないことによる効果)を得ることができる。
 本参考例の変形として、ディスクリプタ1110に、先頭アドレスの書き換えを行ったか否かを示す書き換え実行フラグの領域を追加してもよい。例えば、先頭アドレスA#1~A#Nの初期設定を行う転送管理部112を実装しているプロセッサがキャッシュメモリを持っている場合、ディスクリプタ1110に書き込んだ先頭アドレスA#1~A#Nがキャッシュメモリ内にコピーされる。
 しかし、DMAコントローラ1111によりディスクリプタ1110内の先頭アドレスが書き換えられたときに、転送管理部112を実装しているプロセッサのキャッシュメモリ内の該当の情報は書き換えが行われない場合がある。このような場合でも、プロセッサが、キャッシュメモリ内の情報ではなく、ディスクリプタ1110内の情報を読み出すために、書き換え実行フラグを参照することができる。
 具体的には、プロセッサは、書き換え実行フラグを参照した結果、ディスクリプタ1110内の先頭アドレスが書き換えられていないと判断した場合、キャッシュメモリ内の情報を読み出して使用し、ディスクリプタ1110内の先頭アドレスが書き換えられたと判断した場合、一時的にキャッシュを無効にしてディスクリプタ1110内の先頭アドレスを直接読み出して使用すればよい。
 結合パケット転送部111は、図5のステップS414の処理でディスクリプタ1110内の先頭アドレスを書き換えたときに、ディスクリプタ1110内の対応する書き換え実行フラグを、「書き換え未実行」から「書き換え実行」に書き換えるようにすればよい。
 また、本参考例の別の変形例として、転送管理部112(プロセッサが実行するソフトウェア)が書き込む先頭アドレスの領域とは別に、DMAコントローラ1111が変更後の先頭アドレスを書き込む領域をディスクリプタ1110に用意してもよい。この場合、受信処理部103(プロセッサが実行するソフトウェア)は、変更後の先頭アドレスが書き込まれた領域を参照することになる。また、図5のステップS414で説明した処理は、先頭アドレスの書き換えではなく、変更後の先頭アドレスを書き込む処理となる。
 また、本参考例において、DMAコントローラ1111とそれぞれのDMAコントローラ1111に対応するディスクリプタ1110とを複数搭載する構成としてもよい。また、パケット結合部110においてパケットの種類を判定して同じ種類のパケットを結合パケットとして纏める構成としてもよいし、パケットの種類に応じて複数のDMAコントローラ1111と複数のディスクリプタ1110とを使い分ける構成としてもよい。
 パケットの種類別にDMAコントローラ1111とディスクリプタ1110とを用意し、パケットの種類に応じて複数のDMAコントローラ1111と複数のディスクリプタ1110とを使い分ける構成とすると、パケットの種類毎に異なる受信処理を行うことが容易になる。
 また、本参考例において、複数のCPUコアを内蔵するプロセッサのコア毎に複数のDMAコントローラ1111と複数のディスクリプタ1110とを使い分ける構成としてもよいし、バーチャルマシン毎に複数のDMAコントローラ1111と複数のディスクリプタ1110とを使い分ける構成としてもよい。
 CPUコア毎もしくはバーチャルマシン毎に複数のDMAコントローラ1111と複数のディスクリプタ1110とを使い分ける構成とすることにより、DMAコントローラ等が1個のみの場合と比較して、ソフトウェアによる受信処理の性能を向上させることができる。
[第2の参考例]
 次に、本発明の第2の参考例について説明する。第1の参考例では、DMA転送を用いる場合を前提として説明したが、DMA転送を用いないパケット処理装置においても、複数のパケットを連結した結合パケットを纏めてパケットメモリに書き込む纏め書き込みにより、パケットメモリへの書き込みの実効スループットが大きくなる場合がある(例えばパケットメモリがDRAM(Dynamic Random Access Memory)で構成されている場合等)。
 図7は本発明の第2の参考例に係るパケット処理装置の構成を示すブロック図である。図7のパケット処理装置は、回線対応部100と、パケットメモリ101と、受信処理部103と、プロトコル処理部104と、受信バッファ105と、結合閾値制御部107と、パケット結合部110と、転送管理部112と、結合パケット転送部113とから構成される。
 図7の構成と図1の構成の違いは、図1における転送手段を、パケット処理装置のプロセッサ(ソフトウェア)による書き込み手段に置き換えた点である。つまり、本参考例は、図1の結合パケット転送部111を、ソフトウェアによる結合パケット転送部113に置き換えたものである。
 回線対応部100とパケットメモリ101と受信処理部103とプロトコル処理部104と受信バッファ105と結合閾値制御部107と転送管理部112とは、図1の構成と同等である。
 図7のパケット結合部110は、回線対応部100において受信されたパケットをパケット結合用の受信バッファ105に転送する。このとき、パケット結合部110は、回線対応部100において受信されたパケットと受信バッファ105中に既に格納されているパケットとを結合して1つの結合パケットになるように、パケットを受信バッファ105に格納する。そして、パケット結合部110は、受信バッファ105中の結合パケットの大きさが、結合閾値制御部107に設定された閾値を超えると、結合パケットのパケットメモリ101への転送要求を発行する。
 なお、パケット結合部110は、受信バッファ105中の結合パケットの大きさが閾値を超える前に、タイムアウト(パケット間の間隔が予め定められた期間を超えた場合等)が発生した場合に、転送要求を発行するようにしてもよい。
 さらに、パケット結合部110は、受信バッファ105において結合したパケットの数と各パケットのサイズとを記録し、結合パケットの転送要求を発行する際に、結合したパケットの数と各パケットのサイズの情報を結合パケット転送部113に対して通知する。
 結合パケット転送部113(プロセッサが実行するソフトウェア)は、複数のパケットが結合された結合パケットをパケットメモリ101に書き込み、受信処理部103の起動要求を行なう。また、結合パケット転送部113(プロセッサが実行するソフトウェア)は、パケット結合部110から通知された、結合したパケットの数と各パケットのサイズの情報を用いて、転送管理部112(プロセッサが実行するソフトウェア)がパケット毎に用意したディスクリプタ1130にサイズ等の情報を書き込む。
 図8に示すように、ディスクリプタ1130の構成は、第1の参考例のディスクリプタ1110の構成と同等である。ただし、本参考例では、結合パケット転送部111の代わりに、結合パケット転送部113(プロセッサが実行するソフトウェア)がディスクリプタ1130への書き込みを行うという違いがある。
 図9、図10は結合パケット転送部113(プロセッサが実行するソフトウェア)の動作を説明するフローチャートである。最初に、結合パケット転送部113は、変数nを1に初期化し(図9ステップS600)、パケット結合部110から転送要求が発行された後に、ディスクリプタ1130の有効フラグAF#nを確認する(図9ステップS601)。
 結合パケット転送部113は、先頭アドレスA#nが「有効」であることを有効フラグAF#nが示している場合(図9ステップS602においてyes)、パケット結合部110からの情報を確認して、パケットメモリ101に転送すべきデータが単体のパケットか結合パケットかを確認する(図9ステップS603)。
 結合パケット転送部113は、パケットメモリ101に転送すべきデータが結合パケットではない場合、有効フラグAF#nが「有効」であることを確認した先頭アドレスA#nをディスクリプタ1130から読み出し(図9ステップS604)、対応するn番目のパケットをパケットメモリ101の先頭アドレスA#nから始まる領域に書き込む(図9ステップS605)。
 この書き込み完了後、結合パケット転送部113は、受信データサイズL#nをディスクリプタ1130に書き込むと共に、ディスクリプタ1130に設定されている受信完了フラグWF#nを「未了」から「完了」に書き換える(図9ステップS606)。以上のステップS600~S606およびステップS607,S608の処理は、図4のステップS400~S408の処理と同等である。
 また、結合パケット転送部113は、パケットメモリ101に転送すべきデータが結合パケットの場合、結合したパケットの数kを確認し(図10ステップS609)、ディスクリプタ1130内の「k-1」個の有効フラグAF#(n+1)~AF#(n+k-1)を確認する(図10ステップS610)。
 結合パケット転送部113は、確認したk個の有効フラグが全て「有効」の場合(ステップS610においてyes)、確認したk個の有効フラグの中で最初の有効フラグAF#nに対応する先頭アドレスA#nをディスクリプタ1130から読み出し(図10ステップS611)、対応する結合パケットをパケットメモリ101の先頭アドレスA#nから始まる領域に書き込む(図10ステップS612)。
 この書き込み完了後、結合パケット転送部113は、パケットメモリ101に書き込んだ結合パケットを構成する各パケットのパケット長を示す受信データサイズL#n~L#(n+k-1)をディスクリプタ1130に書き込む(図10ステップS613)。
 続いて、結合パケット転送部113は、ディスクリプタ1130内の「k-1」個の先頭アドレスA#(n+1)~A#(n+k-1)を、結合パケットを構成するk個のパケットのうち、初めの「k-1」個のパケットのパケット長に応じて書き換える(図10ステップS614)。
 次に、結合パケット転送部113は、パケットメモリ101に書き込んだ結合パケットを構成する各パケットに対応する受信完了フラグWF#n~WF#(n+k-1)を「未了」から「完了」に書き換える(図10ステップS615)。
 以上のステップS609~S615およびステップS616~S618の処理は、図5のステップS409~S418の処理と同等である。ステップS610,S613,S615において、n=N、またはn<Nかつn+k-1>Nの場合、ステップS410,S413,S415で説明した処理を実行すればよい。
 こうして、本参考例のパケット処理装置は、纏め書き込みを実現することができ、かつ結合パケットを元の複数のパケットに復元するための情報をディスクリプタ1130に書き込む手段(結合パケット転送部113)を備えている。本参考例によれば、復元処理の受信処理部103、プロトコル処理部104、もしくは、図41の結合パケット分離部108での実行を不要とすることができ、かつ、纏め書き込みの効果による高い受信性能を実現することが可能となる。
 また、本参考例では、図35の構成の受信処理部103およびプロトコル処理部104用のソフトウェアをそのまま本参考例のパケット処理装置で使用することができる。
 なお、本参考例のパケット処理装置で図9、図10で説明した纏め書き込みを正常に行うため、転送管理部112(プロセッサが実行するソフトウェア)は、事前に、パケットメモリ101内に、N×DB_mux(DB_muxは結合パケットの最大サイズ)のバッファ領域を確保しておく必要がある。この領域確保は、図38および図1の構成の場合と同等である。
 本参考例のパケット処理装置では、纏め書き込み完了後に結合パケット転送部113がディスクリプタ1130の情報(先頭アドレス、受信データサイズ、受信完了フラグ)を書き換えることにより、復元処理を不要としている。
 復元処理を受信処理部103、プロトコル処理部104、もしくは図43の結合パケット分離部108で実現しようとすると、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケット結合部106から受信処理部103、プロトコル処理部104、もしくは図43の結合パケット分離部108に通知する手段が必要となる。
 また、復元処理を受信処理部103、プロトコル処理部104、もしくは図43の結合パケット分離部108で実現しようとすると、纏め書き込み完了後、受信処理が起動されるまで、場合によっては複数の結合パケット分の復元処理に必要な情報を保持しておく必要があることを考慮しなければならない。
 これに対して、本参考例のパケット処理装置では、1つの結合パケットの纏め書き込みが完了した時点で結合パケットの復元処理は終わっているので、複数の結合パケット分の情報を保持する必要がない。したがって、復元処理を受信処理部103、プロトコル処理部104、もしくは図43の結合パケット分離部108で実現する場合と比較して、本参考例の方がハードウェアの規模が小さい。これは、結合パケットを元の複数のパケットに復元する処理をソフトウェアで実装する場合で比較しても同じである。
 例えば、図43の構成でパケットメモリ101と回線対応部100以外の構成をすべてソフトウェアで実現した場合、複数の結合パケット分の復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケットメモリ101等に保持しておく必要がある。
 これに対して、本参考例の構成でパケットメモリ101と回線対応部100以外の構成をすべてソフトウェアで実現した場合は、複数の結合パケット分の情報(結合したパケットの数、パケット毎のサイズ)を保持する必要がない。すなわち、1つの結合パケット分のみの復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケットメモリ101等に保持しておくだけでよい。
 つまり、本参考例の構成は、図43の構成と比較して、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)の保持に使用するパケットメモリ101等の容量(書き込み可能なビット数)が小さくてもよいことになり、必要となるハードウェアの規模を削減することができる。
 また、復元処理に必要な情報をパケット結合部106から受信処理部103、プロトコル処理部104、もしくは図43の結合パケット分離部108に通知する手段として、復元処理に必要な情報を結合パケットの中に書き込むことも可能である。具体的には、結合された各パケットのサイズを通知するために、例えば各パケットの前にパケットサイズ等を書き込んだヘッダを付与して付加ヘッダをパケットデータと共に書き込みする方法が考えられる。しかし、この場合、纏め書き込みに使用するバスの帯域の一部を、復元処理に必要な情報で占有してしまうことになるので、本来のパケットデータの書き込みに使用できる実効帯域が小さくなり、その結果、纏め書き込みの性能が劣化する。
 本参考例のパケット処理装置では、復元処理に必要な情報を、パケットメモリ101ではなく、パケットメモリ101が接続されているバスを使用しない別のメモリ(パケット結合部110からの書き込みと結合パケット転送部113からの読み出しだけが可能であれば良い)に保持することができ、上記のような実効帯域の劣化は起こらない。
 第1の参考例と同様に、本参考例の変形として、ディスクリプタ1130に、先頭アドレスの書き換えを行ったか否かを示す書き換え実行フラグの領域を追加してもよい。この場合、結合パケット転送部113は、図10のステップS614の処理でディスクリプタ1130内の先頭アドレスを書き換えたときに、ディスクリプタ1130内の対応する書き換え実行フラグを、「書き換え未実行」から「書き換え実行」に書き換えるようにすればよい。
 また、第1の参考例と同様に、転送管理部112(プロセッサが実行するソフトウェア)が書き込む先頭アドレスの領域とは別に、結合パケット転送部113が変更後の先頭アドレスを書き込む領域をディスクリプタ1130に用意してもよい。
 また、本参考例において、パケット結合部110においてパケットの種類を判定して同じ種類のパケットを結合パケットとして纏める構成としてもよいし、パケットの種類に応じて複数のディスクリプタ1130を使い分ける構成としてもよい。パケットの種類別にディスクリプタ1130を用意し、パケットの種類に応じて複数のディスクリプタ1130を使い分ける構成とすると、パケットの種類毎に異なる受信処理を行うことが容易になる。
 また、本参考例において、複数のCPUコアを内蔵するプロセッサのコア毎に複数のディスクリプタ1130を使い分ける構成としてもよいし、バーチャルマシン毎に複数のディスクリプタ1130を使い分ける構成としてもよい。CPUコア毎もしくはバーチャルマシン毎に複数のディスクリプタ1130を使い分ける構成とすることにより、ディスクリプタ1130が1個のみの場合と比較して、ソフトウェアによる書き込み処理および読み出し処理の性能が向上する。
[第1の実施例]
 以下、本発明の実施例について図面を参照して説明する。第1、第2の参考例では、受信したパケットをパケットメモリに転送する場合を前提として説明したが、本発明は、パケット処理装置において、受信したパケットをパケットメモリに転送する代わりに、受信したパケットに対して何らかの処理を行った結果のデータをメモリに転送する場合に、複数の処理結果のデータを連結して纏めDMA転送もしくは纏め書き込みを行うものである。
 図11は、本発明の第1の実施例に係るパケット処理装置の構成を示すブロック図である。図11のパケット処理装置は、通信回線(不図示)と接続され、通信回線からデータを受信する回線対応部100と、通信回線から受信したパケットの処理を行って処理結果のデータを出力するパケット処理部114と、パケット処理部114から出力されたデータが格納されるデータ用メモリ115と、データ用メモリ115に格納されたデータに対して処理を施すデータ処理部116と、データ用メモリ115に格納されたデータをデータ処理部116へ渡す受信処理部117と、データ結合用の受信バッファ118と、データブロックの大きさを規制する閾値があらかじめ設定された結合閾値制御部119と、パケット処理部114から出力された複数のデータを連結してデータブロックを生成するデータ結合部120と、データ結合部120によって生成されたデータブロックをデータ用メモリ115にDMA転送する結合データ転送部121と、予め定められたメモリ上のデータ領域であるディスクリプタ1210の初期設定を行う転送管理部122とから構成される。なお、転送管理部122については、受信処理部117の一部として構成しても良い。
 図11の構成と図1の構成の違いは、パケット処理部114を追加し、パケットメモリ101、受信処理部103、プロトコル処理部104、受信バッファ105、結合閾値制御部107、パケット結合部110、結合パケット転送部111、転送管理部112を、それぞれデータ用メモリ115、受信処理部117、データ処理部116、受信バッファ118、結合閾値制御部119、データ結合部120、結合データ転送部121、転送管理部122に置き換えた点である。
 回線対応部100は、図1の構成と同等である。
 パケット処理部114は、回線対応部100が出力するパケットに対して処理を行って処理結果のデータを出力する。ここでの処理の内容は、例えば、パケット長が予め規定されていたサイズを超えていた場合にパケットの先頭から既定サイズ分のデータを抽出して出力する処理や、IP(Internet Protocol)ヘッダ等の特定のデータを抽出して出力する処理や、パケット種別毎にパケット数をカウントアップして更新されたカウンタの情報を出力する処理等、さまざまな処理が考えられる。
 データ結合部120は、パケット処理部114が出力したデータをデータ結合用の受信バッファ118に転送する。このとき、データ結合部120は、パケット処理部114が出力したデータと受信バッファ118中に既に格納されているデータとを連結して1つのデータブロックになるように、データを受信バッファ118に格納する。そして、データ結合部120は、受信バッファ118中のデータブロックの大きさが、結合閾値制御部119に設定された閾値を超えると、データブロックのデータ用メモリ115への転送要求を発行する。
 なお、データ結合部120は、受信バッファ118中のデータブロックの大きさが閾値を超える前に、タイムアウト(パケット間の受信間隔が予め定められた期間を超えた場合等)が発生した場合に、転送要求を発行するようにしてもよい。
 さらに、データ結合部120は、受信バッファ118において結合したデータの数と各データのサイズとを記録し、データブロックの転送要求を発行する際に、結合したデータの数と各データのサイズとを結合データ転送部121に対して通知する。
 なお、パケット処理部114が出力するデータのサイズが予め決まっている一定値(パケット毎に変化しない)の場合は、データのサイズの通知を省略することが可能であるが、その場合でも、タイムアウトによる転送が発生した場合等では、結合したデータの数の通知が必要である。
 結合データ転送部121は、DMAコントローラ1211から構成される。結合データ転送部121は、複数のデータが結合されたデータブロックを1度のDMA転送により、データ用メモリ115に転送し、ハードウェア割り込みを発生させて受信処理部117の起動要求を発行する。
 なお、パケット処理装置のプロセッサ(不図示)へのハードウェア割り込みの発生を行わないようにしてもよい。
 また、結合データ転送部121は、データ結合部120から通知された、結合したデータの数と各データのサイズの情報を用いて、転送管理部122(プロセッサが実行するソフトウェア)がデータ毎に用意したディスクリプタ1210にサイズ等を書き込む。ディスクリプタ1210の構成は、図2のディスクリプタ1110の説明において「パケット」を「データ」に置き換えたものに相当する。したがって、以下の説明では図2の符号を用いて説明する。
 受信処理部117は、起動要求を検知すると、データ毎に用意されているディスクリプタ1210に書き込まれているアドレス情報とサイズの情報とに基づいてデータ用メモリ115内のデータを読み出してデータ処理部116へ渡す。同時に、受信処理部117は、データ処理部116へ渡したデータ用メモリ分を補充するために、パケット処理装置が持つメモリから新たなデータ用メモリ115の領域を確保する。この受信処理部117の動作は、図42の構成の動作と同等であり、図42の構成で必要であった結合データ分離部108bの実装は不要である(複数のデータが結合したデータブロックを元の複数のデータに復元する処理は結合データ転送部121で行う)。
 データ処理部116は、受信処理部117から受け取ったデータに対して必要な処理を行う。そして、データ処理部116は、必要な処理が終了すると、受信処理部117から渡されたデータが格納されていたデータ用メモリ115の領域を解放する。
 なお、受信処理部117とデータ処理部116と転送管理部122は、汎用のパーソナルコンピュータやワークステーション上で動作するソフトウェアで実現することもできるし、プログラムと協調して動作するFPGA等のハードウェアで実現することも可能である。
 データ用メモリ115は、パーソナルコンピュータ、通信機器あるいは通信ボード上のメモリとして構成可能である。
 回線対応部100とパケット処理部114と結合閾値制御部119とデータ結合部120と結合データ転送部121とは、通信機器あるいは通信ボード上のFPGA等により構成可能である。
 受信バッファ118は、通信機器あるいは通信ボード上のFPGA等が持つ記憶領域や、FIFO等の記憶回路により構成可能である。
 次に、ディスクリプタ1210を用いた本実施例の動作例を図11~図15を用いて説明する。図12は転送管理部122の動作を説明するフローチャート、図13、図14はDMAコントローラ1211の動作を説明するフローチャート、図15は受信処理部117の動作を説明するフローチャートである。
 最初に、転送管理部122(プロセッサが実行するソフトウェア)は、パケット処理装置の初期設定として、N個の各データの先頭部の、データ用メモリ115上におけるアドレス、すなわち各データの書き込み先の先頭アドレスA#n(nは1~N)を決定してディスクリプタ1210に書き込む(図12ステップS300a)。さらに、転送管理部122は、その先頭アドレスA#nが有効か否かを示す有効フラグAF#nを「無効」から「有効」に書き換える(図12ステップS301a)。ディスクリプタ1110と同様に、ディスクリプタ1210には、先頭アドレスの情報等を書き込む領域がN組用意されている。
 最初に、結合データ転送部121内のDMAコントローラ1211は、ディスクリプタ1210の読出および書込の順を示す変数nを1に初期化する(図13ステップS400a)。
 そして、DMAコントローラ1211は、データ結合部120から転送要求が発行されると、ディスクリプタ1210のn番目の有効フラグAF#nを確認する(図13ステップS401a)。
 DMAコントローラ1211は、n番目の先頭アドレスA#nが「有効」であることを有効フラグAF#nが示している場合(図13ステップS402aにおいてyes)、データ結合部120からの情報(結合したデータの数と各データのサイズ)を確認して、データ用メモリ115に転送すべきデータが、結合されていない単体のデータかデータブロックかを確認する(図13ステップS403a)。
 DMAコントローラ1211は、データ用メモリ115に転送すべきデータがデータブロックではない場合(結合したデータの数が1の場合)、対応する有効フラグAF#nが「有効」であることを確認したn番目の先頭アドレスA#nをディスクリプタ1210から読み出し(図13ステップS404a)、対応するn番目のデータをデータ用メモリ115の先頭アドレスA#nから始まる領域に書き込むDMA転送を行う(図13ステップS405a)。
 このDMA転送の完了後、DMAコントローラ1211は、n番目のデータのデータ長を示す受信データサイズL#nをディスクリプタ1210に書き込むと共に、ディスクリプタ1210に設定されている、n番目のデータの書き込みが完了したことを示す受信完了フラグWF#nを「未了」から「完了」に書き換える(図13ステップS406a)。
 DMAコントローラ1211は、変数nがNと等しいかどうかを判定する(図13ステップS407a)。DMAコントローラ1211は、変数nがNに達していない場合(ステップS407aにおいてno)、変数nを1増やし(図13ステップS408a)、ステップS401aに戻る。また、DMAコントローラ1211は、変数nがNに達した場合(ステップS407aにおいてyes)、ステップS400aに戻る。
 第1の参考例と同様に、有効フラグAF#1~AF#Nを確認する順番は予め決められている。例えば、図2、図13の例では、DMAコントローラ1211は、1番目の有効フラグAF#1、2番目の有効フラグAF#2、・・・・、N番目の有効フラグAF#Nと順番に確認する。一通り確認が終わった後、DMAコントローラ1211は、変数nを1に初期化し(ステップS400a)、再び1番目の有効フラグAF#1から順番に確認する。
 また、DMAコントローラ1211は、データ用メモリ115に転送すべきデータがデータブロックの場合(結合したデータの数kが2以上の場合)、結合したデータの数kを確認し(図14ステップS409a)、ディスクリプタ1210内の「k-1」個の有効フラグAF#(n+1)~AF#(n+k-1)を確認する(図14ステップS410a)。
 第1の参考例と同様に、n=Nの場合、DMAコントローラ1211は、AF#1からAF#(k-1)までの有効フラグを確認すればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1211は、AF#(n+1)からAF#NまでとAF#1からAF#(k-1-(N-n))までの有効フラグを確認すればよい。
 DMAコントローラ1211は、ステップS402a,S410aの処理により、確認したk個の有効フラグが全て「有効」の場合(ステップS410aにおいてyes)、確認したk個の有効フラグの中で最初の有効フラグAF#nに対応するn番目の先頭アドレスA#nをディスクリプタ1210から読み出し(図14ステップS411a)、対応するデータブロックをデータ用メモリ115の先頭アドレスA#nから始まる領域に書き込むDMA転送を行う(図14ステップS412a)。
 このDMA転送の完了後、DMAコントローラ1211は、データ結合部120から通知された情報(結合した各データのサイズ)に基づいて、データ用メモリ115にDMA転送したデータブロックを構成する各データのデータ長を示す受信データサイズL#n~L#(n+k-1)を、ディスクリプタ1210に書き込む(図14ステップS413a)。
 第1の参考例と同様に、n=Nの場合、DMAコントローラ1211は、受信データサイズL#nと、L#1からL#(k-1)までの受信データサイズをディスクリプタ1210に書き込むようにすればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1211は、受信データサイズL#nと、L#(n+1)からL#NまでとL#1からL#(k-1-(N-n))までの受信データサイズをディスクリプタ1210に書き込むようにすればよい。
 続いて、DMAコントローラ1211は、ディスクリプタ1210内の「k-1」個の先頭アドレスA#(n+1)~A#(n+k-1)を、データブロックを構成するk個のデータのうち、初めの「k-1」個のデータのデータ長に応じて書き換える(図14ステップS414a)。
 具体的には、DMAコントローラ1211は、先頭アドレスA#(n+1)については、先頭アドレスA#nと、データブロックを構成するk個のデータのうち1番目のデータのデータ長(受信データサイズL#nが示す値)とを足した値に書き換える。また、DMAコントローラ1211は、先頭アドレスA#(n+k-1)については、先頭アドレスA#(n+k-2)と、データブロックを構成するk個のデータのうち「k-1」番目のデータのデータ長(受信データサイズL#(n+k-2)が示す値)とを足した値に書き換える。
 このように、DMAコントローラ1211は、先頭アドレスA#iを書き換える場合、1つ前の先頭アドレスA#(i-1)と、データブロックを構成するデータのうち「i-1」番目のデータのデータ長とを足した値に書き換えるようにすればよい。
 次に、DMAコントローラ1211は、データ用メモリ115にDMA転送したデータブロックを構成する各データに対応する受信完了フラグWF#n~WF#(n+k-1)を「未了」から「完了」に書き換える(図14ステップS415a)。
 第1の参考例と同様に、n=Nの場合、DMAコントローラ1211は、受信完了フラグWF#nと、WF#1からWF#(k-1)までの受信完了フラグとを「未了」から「完了」に書き換えるようにすればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1211は、受信完了フラグWF#nと、WF#(n+1)からWF#NまでとWF#1からWF#(k-1-(N-n))までの受信完了フラグとを「完了」に書き換えるようにすればよい。
 そして、DMAコントローラ1211は、n+k>Nが成立するかどうかを確認し(図14ステップS416a)、n+kがNより大きい場合は、変数nをn=n+k-Nとし(図14ステップS417a)とし、ステップS401aに戻る。また、DMAコントローラ1211は、n+kがN以下の場合は、変数nをn=n+kとし(図14ステップS418a)とし、ステップS401aに戻る。
 こうして、本実施例のDMA転送では、k個のデータが連結されたデータブロックを纏めてデータ用メモリ115に転送し、ディスクリプタ1210の先頭アドレスの情報を一部書き換えることにより、パケット処理装置のプロセッサ(受信処理部117とデータ処理部116)に対して各データの先頭が書き込まれたアドレスを通知するようにしている。
 受信処理部117(プロセッサが実行するソフトウェア)は、定期的にディスクリプタ1210の受信完了フラグWF#n(nは1~N)を確認して、受信完了フラグWF#nが「完了」を示している場合(図15ステップS501aにおいてyes)、対応するn番目の先頭アドレスA#nの情報と受信データサイズL#nの情報とに基づいてデータ用メモリ115からn番目のデータを読み出してデータ処理部116へ渡す(図15ステップS502a)。
 データ処理部116で必要な処理が行われた後に(図15ステップS503aにおいてyes)、受信処理部117(プロセッサが実行するソフトウェア)は、処理が終わったn番目のデータに対応する、ディスクリプタ1210のn番目の有効フラグAF#nを「有効」から「無効」に書き換えると共に、ディスクリプタ1210のn番目の受信完了フラグWF#nを「完了」から「未了」に書き換える(図15ステップS504a)。
 第1の参考例と同様に、ディスクリプタ1210には、受信完了フラグWF#1~WF#Nの領域がN個(組)あるが、受信完了フラグWF#1~WF#Nを確認する順番は予め決められている。
 なお、定期的にディスクリプタ1210の受信完了フラグWF#nを確認する代わりに、DMA転送の完了後にDMAコントローラ1211がプロセッサに対して割り込み処理要求を発行し、この割り込み処理要求に応じて受信処理部117(プロセッサが実行するソフトウェア)が、ディスクリプタ1210の受信完了フラグWF#n(nは1~N)を確認するようにしてもよい。
 以上に説明したように、本実施例のパケット処理装置は、纏めDMA転送を実現することができ、かつデータブロックを元の複数のデータに復元するための情報をディスクリプタ1210に書き込む手段(DMAコントローラ1211)を内蔵する結合データ転送部121を備えている。DMAコントローラ1211はハードウェアで実装可能なので、復元処理のソフトウェアでの実行を不要とし、かつ、纏めDMA転送の効果による高い受信性能を実現することが可能となる。
 なお、従来の図42の構成のパケット処理装置において、複数のデータが結合したデータブロックを元の複数のデータに復元する処理をプロセッサ(ソフトウェア)で実行する場合と比較すると、本実施例では、復元処理をプロセッサ(ソフトウェア)で行う必要がなくなるので、1データの処理(1パケット分の処理)に必要となるプロセッサの処理が軽くなり、受信性能が向上する(単位時間に処理できるデータの数が増加する)という効果がある。また、本実施例では、1データの処理(1パケット分の処理)に必要となるプロセッサの消費電力が小さくなるという効果もある。
 また、本実施例では、図42の構成の受信処理部117およびデータ処理部116用のソフトウェアをそのまま本実施例のパケット処理装置で使用することができる。これは、ハードウェア(DMAコントローラ1211)を変えるだけで、纏めDMAによる受信性能の向上が実現できることを示している。
 復元処理を受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bのハードウェアで実現しようとすると、復元処理に必要な情報(結合したデータの数、データ毎のサイズ)をデータ結合部120から受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bに通知する手段が必要となる。
 また、復元処理を受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bのハードウェアで実現しようとすると、DMA転送完了後、受信処理が起動されるまで、場合によっては複数のデータブロック分の復元処理に必要な情報を保持しておく必要があることを考慮しなければならない。
 これに対して、本実施例のパケット処理装置では、1つのデータブロックのDMA転送が完了した時点でデータブロックの復元処理は終わっているので、複数のデータブロック分の情報を保持する必要がない。したがって、復元処理を受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bのハードウェアで実現する場合と比較して、本実施例の方がハードウェアの規模が小さい。
 また、復元処理に必要な情報をデータ結合部120から受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bに通知する手段として、復元処理に必要な情報をデータブロックの中に書き込むことも可能である。具体的には、結合された各データのサイズを通知するために、例えば各データの前にデータサイズ等を書き込んだヘッダを付与して付加ヘッダをデータと共にDMA転送する方法が考えられる。
 しかし、復元処理に必要な情報をデータブロックの中に書き込む場合、DMA転送に使用するバスの帯域の一部を、復元処理に必要な情報で占有してしまうことになるので、本来のデータの転送に使用できる実効帯域が小さくなり、その結果、DMA転送の性能が劣化してしまうという問題が発生する。
 本実施例のパケット処理装置では、復元処理に必要な情報をデータブロックに書き込む必要がないので、上記のような実効帯域の劣化は起こらない。
 本実施例では、結合データ転送部121をハードウェアで実現する例を示したが、受信処理に使用するプロセッサとは別のプロセッサとソフトウェアにより結合データ転送部121の少なくとも一部の処理を実装することも可能である。このように結合データ転送部121の少なくとも一部の処理をソフトウェアで実現する場合でも、データブロックを元の複数のデータに復元する処理を受信処理部117もしくはデータ処理部116で行う必要がなくなるので、纏めDMA転送の効果による高い受信性能を実現することが可能となる。
 また、結合データ転送部121の少なくとも一部の処理をソフトウェアで実現する場合でも、結合データ転送部121をハードウェアで実現する場合と同様に、データブロックを元の複数のデータに復元する処理に必要となるハードウェアの規模が小さくなる効果(複数のデータブロック分の情報を保持する必要がないことによる効果)、およびデータの転送に使用できる実効帯域の劣化が起こらない効果(復元処理に必要な情報をデータブロックの中に加えないことによる効果)を得ることができる。
 また、本実施例において、DMAコントローラ1211とそれぞれのDMAコントローラ1211に対応するディスクリプタ1210とを複数搭載する構成としてもよい。また、データ結合部120においてデータの種類を判定して同じ種類のデータをデータブロックとして纏める構成としてもよいし、データの種類に応じて複数のDMAコントローラ1211と複数のディスクリプタ1210とを使い分ける構成としてもよい。
 データの種類別にDMAコントローラ1211とディスクリプタ1210とを用意し、データの種類に応じて複数のDMAコントローラ1211と複数のディスクリプタ1210とを使い分ける構成とすると、データの種類毎に異なる受信処理を行うことが容易になる。
 また、本実施例において、複数のCPUコアを内蔵するプロセッサのコア毎に複数のDMAコントローラ1211と複数のディスクリプタ1210とを使い分ける構成としてもよいし、バーチャルマシン毎に複数のDMAコントローラ1211と複数のディスクリプタ1210とを使い分ける構成としてもよい。
 CPUコア毎もしくはバーチャルマシン毎に複数のDMAコントローラ1211と複数のディスクリプタ1210とを使い分ける構成とすることにより、DMAコントローラ等が1個のみの場合と比較して、ソフトウェアによる受信処理の性能を向上させることができる。
[第2の実施例]
 次に、本発明の第2の実施例について説明する。図16は本発明の第2の実施例に係るパケット処理装置の構成を示すブロック図である。図16のパケット処理装置は、回線対応部100と、パケット処理部114と、データ用メモリ115と、データ処理部116と、受信処理部117と、受信バッファ118と、結合閾値制御部119と、データ結合部120と、転送管理部122と、結合データ転送部123とから構成される。
 図16の構成と図11の構成の違いは、図11における転送手段を、パケット処理装置のプロセッサ(ソフトウェア)による書き込み手段に置き換えた点である。つまり、本実施例は、図11の結合データ転送部121を、ソフトウェアによる結合データ転送部123に置き換えたものである。
 回線対応部100とデータ用メモリ115とデータ処理部116と受信処理部117と受信バッファ118と結合閾値制御部119と転送管理部122とは、図11の構成と同等である。
 図16のデータ結合部120は、パケット処理部114が出力したデータをデータ結合用の受信バッファ118に転送する。このとき、データ結合部120は、パケット処理部114が出力したデータと受信バッファ118中に既に格納されているデータとを結合して1つのデータブロックになるように、データを受信バッファ118に格納する。そして、データ結合部120は、受信バッファ118中のデータブロックの大きさが、結合閾値制御部119に設定された閾値を超えると、データブロックのデータ用メモリ115への転送要求を発行する。
 なお、データ結合部120は、受信バッファ118中のデータブロックの大きさが閾値を超える前に、タイムアウト(パケット間の間隔が予め定められた期間を超えた場合等)が発生した場合に、転送要求を発行するようにしてもよい。
 さらに、データ結合部120は、受信バッファ118において結合したデータの数と各データのサイズとを記録し、データブロックの転送要求を発行する際に、結合したデータの数と各データのサイズの情報を結合データ転送部123に対して通知する。
 なお、パケット処理部114が出力するデータのサイズが予め決まっている一定値(パケット毎に変化しない)の場合は、データのサイズの通知を省略することが可能であるが、その場合でも、タイムアウトによる転送が発生した場合等では、結合したデータの数の通知が必要である。
 結合データ転送部123(プロセッサが実行するソフトウェア)は、複数のデータが結合されたデータブロックをデータ用メモリ115に書き込み、受信処理部117の起動要求を行なう。また、結合データ転送部123(プロセッサが実行するソフトウェア)は、データ結合部120から通知された、結合したデータの数と各データのサイズの情報を用いて、転送管理部122(プロセッサが実行するソフトウェア)がデータ毎に用意したディスクリプタ1230にサイズ等の情報を書き込む。
 ディスクリプタ1230の構成は、第1の実施例のディスクリプタ1210の構成と同等である。ただし、本実施例では、結合データ転送部121の代わりに、結合データ転送部123(プロセッサが実行するソフトウェア)がディスクリプタ1230への書き込みを行うという違いがある。
 図17、図18は結合データ転送部123(プロセッサが実行するソフトウェア)の動作を説明するフローチャートである。最初に、結合データ転送部123は、変数nを1に初期化し(図17ステップS600a)、データ結合部120から転送要求が発行された後に、ディスクリプタ1230の有効フラグAF#nを確認する(図17ステップS601a)。
 結合データ転送部123は、先頭アドレスA#nが「有効」であることを有効フラグAF#nが示している場合(図17ステップS602aにおいてyes)、データ結合部120からの情報を確認して、データ用メモリ115に転送すべきデータが単体のデータかデータブロックかを確認する(図17ステップS603a)。
 結合データ転送部123は、データ用メモリ115に転送すべきデータがデータブロックではない場合、有効フラグAF#nが「有効」であることを確認した先頭アドレスA#nをディスクリプタ1230から読み出し(図17ステップS604a)、対応するn番目のデータをデータ用メモリ115の先頭アドレスA#nから始まる領域に書き込む(図17ステップS605a)。
 この書き込み完了後、結合データ転送部123は、受信データサイズL#nをディスクリプタ1230に書き込むと共に、ディスクリプタ1230に設定されている受信完了フラグWF#nを「未了」から「完了」に書き換える(図17ステップS606a)。以上のステップS600a~S606aおよびステップS607a,S608aの処理は、図13のステップS400a~S408aの処理と同等である。
 また、結合データ転送部123は、データ用メモリ115に転送すべきデータがデータブロックの場合、結合したデータの数kを確認し(図18ステップS609a)、ディスクリプタ1230内の「k-1」個の有効フラグAF#(n+1)~AF#(n+k-1)を確認する(図18ステップS610a)。
 結合データ転送部123は、確認したk個の有効フラグが全て「有効」の場合(ステップS610aにおいてyes)、確認したk個の有効フラグの中で最初の有効フラグAF#nに対応する先頭アドレスA#nをディスクリプタ1230から読み出し(図18ステップS611a)、対応するデータブロックをデータ用メモリ115の先頭アドレスA#nから始まる領域に書き込む(図18ステップS612a)。
 この書き込み完了後、結合データ転送部123は、データ用メモリ115に書き込んだデータブロックを構成する各データのデータ長を示す受信データサイズL#n~L#(n+k-1)をディスクリプタ1230に書き込む(図18ステップS613a)。
 続いて、結合データ転送部123は、ディスクリプタ1230内の「k-1」個の先頭アドレスA#(n+1)~A#(n+k-1)を、データブロックを構成するk個のデータのうち、初めの「k-1」個のデータのデータ長に応じて書き換える(図18ステップS614a)。
 次に、結合データ転送部123は、データ用メモリ115に書き込んだデータブロックを構成する各データに対応する受信完了フラグWF#n~WF#(n+k-1)を「未了」から「完了」に書き換える(図18ステップS615a)。
 以上のステップS609a~S615aおよびステップS616a~S618aの処理は、図14のステップS409a~S418aの処理と同等である。ステップS610a,S613a,S615aにおいて、n=N、またはn<Nかつn+k-1>Nの場合、ステップS410a,S413a,S415aで説明した処理を実行すればよい。
 こうして、本実施例のパケット処理装置は、纏め書き込みを実現することができ、かつデータブロックを元の複数のデータに復元するための情報をディスクリプタ1230に書き込む手段(結合データ転送部123)を備えている。本実施例によれば、復元処理の受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bでの実行を不要とすることができ、かつ、纏め書き込みの効果による高い受信性能を実現することが可能となる。
 また、本実施例では、図42の構成の受信処理部117およびデータ処理部116用のソフトウェアをそのまま本実施例のパケット処理装置で使用することができる。
 復元処理を受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bで実現しようとすると、復元処理に必要な情報(結合したデータの数、データ毎のサイズ)をデータ結合部120から受信処理部117、データ処理部116、もしくは、図42の結合データ分離部108bに通知する手段が必要となる。
 また、復元処理を受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bで実現しようとすると、纏め書き込み完了後、受信処理が起動されるまで、場合によっては複数のデータブロック分の復元処理に必要な情報を保持しておく必要があることを考慮しなければならない。
 これに対して、本実施例のパケット処理装置では、1つのデータブロックの纏め書き込みが完了した時点でデータブロックの復元処理は終わっているので、複数のデータブロック分の情報を保持する必要がない。したがって、復元処理を受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bで実現する場合と比較して、本実施例の方がハードウェアの規模が小さい。これは、データブロックを元の複数のデータに復元する処理をソフトウェアで実装する場合で比較しても同じである。
 例えば、図42の構成でデータ用メモリ115と回線対応部100以外の構成をすべてソフトウェアで実現した場合、複数のデータブロック分の復元処理に必要な情報(結合したデータの数、データ毎のサイズ)をデータ用メモリ115等に保持しておく必要がある。
 これに対して、本実施例の構成でデータ用メモリ115と回線対応部100以外の構成をすべてソフトウェアで実現した場合は、複数のデータブロック分の情報(結合したデータの数、データ毎のサイズ)を保持する必要がない。すなわち、1つのデータブロック分のみの復元処理に必要な情報(結合したデータの数、データ毎のサイズ)をデータ用メモリ115等に保持しておくだけでよい。
 つまり、本実施例の構成は、図42の構成と比較して、復元処理に必要な情報(結合したデータの数、データ毎のサイズ)の保持に使用するデータ用メモリ115等の容量(書き込み可能なビット数)が小さくてもよいことになり、必要となるハードウェアの規模を削減することができる。
 また、復元処理に必要な情報をデータ結合部120から受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bに通知する手段として、復元処理に必要な情報をデータブロックの中に書き込むことも可能である。具体的には、結合された各データのサイズを通知するために、例えば各データの前にデータサイズ等を書き込んだヘッダを付与して付加ヘッダをデータと共に書き込みする方法が考えられる。しかし、この場合、纏め書き込みに使用するバスの帯域の一部を、復元処理に必要な情報で占有してしまうことになるので、本来のデータの書き込みに使用できる実効帯域が小さくなり、その結果、纏め書き込みの性能が劣化する。
 本実施例のパケット処理装置では、復元処理に必要な情報を、データ用メモリ115ではなく、データ用メモリ115が接続されているバスを使用しない別のメモリ(データ結合部120からの書き込みと結合データ転送部123からの読み出しだけが可能であれば良い)に保持することができ、上記のような実効帯域の劣化は起こらない。
 また、本実施例において、データ結合部120においてデータの種類を判定して同じ種類のデータをデータブロックとして纏める構成としてもよいし、データの種類に応じて複数のディスクリプタ1230を使い分ける構成としてもよい。データの種類別にディスクリプタ1230を用意し、データの種類に応じて複数のディスクリプタ1230を使い分ける構成とすると、データの種類毎に異なる受信処理を行うことが容易になる。
 また、本実施例において、複数のCPUコアを内蔵するプロセッサのコア毎に複数のディスクリプタ1230を使い分ける構成としてもよいし、バーチャルマシン毎に複数のディスクリプタ1230を使い分ける構成としてもよい。CPUコア毎もしくはバーチャルマシン毎に複数のディスクリプタ1230を使い分ける構成とすることにより、ディスクリプタ1230が1個のみの場合と比較して、ソフトウェアによる書き込み処理および読み出し処理の性能が向上する。
[第3の実施例]
 次に、本発明の第3の実施例について説明する。図19は、本発明の第3の実施例に係るパケット処理装置の構成を示すブロック図である。図19のパケット処理装置は、回線対応部100と、パケット処理部114と、データ用メモリ115と、データ処理部116と、受信処理部117と、受信バッファ118と、結合閾値制御部119と、データ結合部120と、結合データ転送部121aと、転送管理部122aとから構成される。
 図19における、回線対応部100、パケット処理部114、データ用メモリ115、データ処理部116、受信処理部117、受信バッファ118、結合閾値制御部119、データ結合部120は、図11の構成と同等である。
 図19の結合データ転送部121aは、DMAコントローラ1211aから構成される。結合データ転送部121aは、複数のデータが結合されたデータブロックを1度のDMA転送により、データ用メモリ115に転送し、ハードウェア割り込みを発生させて受信処理部117の起動要求を発行する。
 なお、パケット処理装置のプロセッサ(不図示)へのハードウェア割り込みの発生を行わないようにしてもよい。
 また、結合データ転送部121aは、データ結合部120から通知された、結合したデータの数と各データのサイズの情報を用いて、転送管理部122a(プロセッサが実行するソフトウェア)がデータ毎に用意したディスクリプタ1210aにサイズ等を書き込む。
 図20に本実施例の結合データ転送部121aが使用するディスクリプタ1210aの構成例を示す。図20の例では、データ用メモリ115にN個のデータが格納される場合を示している。
 図20のディスクリプタ1210aは、受信したデータの書き込み先の先頭アドレスA#1~A#Nと、先頭アドレスA#1~A#Nが有効か否かを示す有効フラグAF#1~AF#Nと、受信したデータのデータ長を示す受信データサイズL#1~L#Nと、データ用メモリ115からのデータの読み出しが完了したか否かを示す受信完了フラグWF#1~WF#Nとを、複数(N組)書き込み可能なデータ構造体となっている。
 ディスクリプタ1210aは、実体としては、データ用メモリ115と同様に、パーソナルコンピュータ、通信機器あるいは通信ボード上のメモリ内に配置される。
 なお、ディスクリプタ1210aをデータ用メモリ115と同じメモリ内に配置することも可能であるが、その場合、どちらの用途に使用するのかをメモリ内のアドレスにより分けることができる。
 次に、図20の構成のディスクリプタ1210aを用いた本実施例の動作例を図19~図27を用いて説明する。図21は転送管理部122aの動作を説明するフローチャート、図22~図25、図27はDMAコントローラ1211aの動作を説明するフローチャート、図26は受信処理部117の動作を説明するフローチャートである。
 最初に、転送管理部122a(プロセッサが実行するソフトウェア)は、パケット処理装置の初期設定として、データ用メモリ115内にデータブロック用のバッファ領域として連続した領域を確保し(図21ステップS700)、このバッファ領域の先頭アドレスA0と容量(サイズ)C0を示す情報とを制御用レジスタ124に書き込む(図21ステップS701)。制御用レジスタ124は、例えばプロセッサ内に設けられる。
 なお、制御用レジスタ124は、1個(組)だけでも問題無いが、複数用意しておくことも可能である。制御用レジスタ124を複数設ける場合、データの書き込みに使用する順番は予め決めておく。また、制御用レジスタ124の設定は、初期設定時に行うものとし、動作中の設定変更は行わないものとする。
 次に、転送管理部122aは、ディスクリプタ1210aの初期設定として、先頭アドレスA#n(nは1~N)が有効か否かを示す有効フラグAF#nを全て「無効」とし(図21ステップS702)、データ用メモリ115からのデータの読み出しが完了したことを示す受信完了フラグWF#nを全て「完了」とする(図21ステップS703)。
 結合データ転送部121a内のDMAコントローラ1211aは、データ結合部120から転送要求が発行されると、上記の初期設定後の最初の転送要求の場合、転送管理部122aが設定した先頭アドレスA0と容量(サイズ)C0とを制御用レジスタ124から読み出す(図22ステップS800)。そして、DMAコントローラ1211aは、データ用メモリ115へのデータの転送に使用するためのライトポインタWPの初期値として、ステップS800で読み出した先頭アドレスA0を設定する(図22ステップS801)。すなわち、本実施例では、制御用レジスタ124の設定からデータ用メモリ115内の書き込み可能なバッファ領域のアドレスの範囲を計算し、書き込み可能なバッファ領域をリングバッファとして使用する。
 続いて、DMAコントローラ1211aは、ディスクリプタ1210aの読出および書込の順を示す変数nを1に初期化する(図22ステップS802)。
 DMAコントローラ1211aは、データ結合部120からの情報を確認して、データ用メモリ115に転送すべきデータが、結合されていない単体のデータかデータブロックかを確認し、結合したデータの数kを確認する(図22ステップS803)。上記のとおり、結合したデータの数kは、データ結合部120から通知される情報に含まれている(結合していない場合はk=1)。そして、DMAコントローラ1211aは、ディスクリプタ1210a内のk個の受信完了フラグWF#n~WF#n(n+k-1)を確認する(図22ステップS804)。
 なお、n=Nの場合、DMAコントローラ1211aは、WF#NとWF#1からWF#(k-1)までの受信完了フラグを確認すればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1211aは、WF#nからWF#NまでとWF#1からWF#(k-1-(N-n))までの受信完了フラグを確認すればよい。
 DMAコントローラ1211aは、ステップS804の処理により、確認したk個の受信完了フラグが全て「完了」の場合(ステップS804においてyes)、データ用メモリ115内のデータブロック用のバッファ領域の残容量CRとデータ用メモリ115に転送すべきデータのサイズCDとを比較する(図22ステップS805)。データ用メモリ115に転送すべきデータが結合されていない単体のデータの場合には、単体のデータのサイズを残容量CRと比較し、データ用メモリ115に転送すべきデータがデータブロックの場合には、データブロックのサイズを残容量CRと比較する。上記のとおり、データ用メモリ115に転送すべきデータのサイズCDは、データ結合部120から通知される。
 この比較の際に、DMAコントローラ1211aは、ライトポインタWPとリードポインタRPに基づいて、データ用メモリ115内のデータブロック用のバッファ領域の残容量CRを算出する。具体的には、DMAコントローラ1211aは、初期状態(ライトポインタWP=リードポインタRP)の場合、ステップS800において制御用レジスタ124から読み出した容量(サイズ)C0の値をそのまま残容量CRとする。
 また、DMAコントローラ1211aは、ライトポインタWP>リードポインタRPの場合、C0-WP+RPを残容量CRとし、ライトポインタWP<リードポインタRPの場合、RP-WPを残容量CRとする。また、DMAコントローラ1211aは、初期状態以外で、ライトポインタWP=リードポインタRPの場合、0もしくはC0を残容量CRとする。具体的には、ライトポインタWP>リードポインタRPの状態からライトポインタWP=リードポインタRPに遷移した場合はリードポインタが更新されたと判断して、残容量CRをC0とし、ライトポインタWP<リードポインタRPの状態からライトポインタWP=リードポインタRPに遷移した場合はライトポインタが更新されたと判断して、残容量CRを0とする。
 なお、上記のとおりディスクリプタ1210aには、受信完了フラグWF#1~WF#Nの領域がN個(組)用意されているが、受信完了フラグWF#1~WF#Nを確認する順番は予め決められている。例えば、図20、図22の例では、DMAコントローラ1211aは、n番目の受信完了フラグWF#n、(n+1)番目の受信完了フラグWF#(n+1)、・・・・、N番目の受信完了フラグWF#Nと順番に確認する(ステップS804)。N番目の受信完了フラグWF#Nの確認を行った後、k組分の確認が終わっていない場合は、1番目の受信完了フラグWF#1から順番に確認を行う。
 DMAコントローラ1211aは、データ用メモリ115内のデータブロック用のバッファ領域の残容量CRがデータ用メモリ115に転送すべきデータのサイズCDより小さい場合(ステップS805においてyes)、ステップS804に戻る。このバッファ領域の残容量CRがデータサイズCDより小さい状態は、ソフトウェアによるデータ用メモリ115からのデータの読み出しにより、バッファ領域の残容量CRが回復すると解消する。
 また、DMAコントローラ1211aは、バッファ領域の残容量CRがデータ用メモリ115に転送すべきデータのサイズCD以上の場合(ステップS805においてno)、ライトポインタWPに、データ用メモリ115に転送すべきデータのサイズCDを加算した値(WP+CD)と、所定の上限値とを比較する(図23ステップS806)。ここで、上限値は、データ用メモリ115内のバッファ領域の先頭アドレスA0に、このバッファ領域の容量C0を加算した値(A0+C0)である。
 DMAコントローラ1211aは、ライトポインタWPにデータのサイズCDを加算した値(WP+CD)が、上限値(A0+C0)より小さい場合(ステップS806においてyes)、データ結合部120から通知された情報(結合した各データのサイズ)に基づいて、データ用メモリ115に転送すべきデータを構成するk個のデータのデータ長を示す受信データサイズL#n~L#(n+k-1)を、ディスクリプタ1210aに書き込む(図23ステップS807)。
 続いて、DMAコントローラ1211aは、n番目の先頭アドレスA#nの値として、ライトポインタWPの値をディスクリプタ1210aに書き込む(図23ステップS808)。さらに、DMAコントローラ1211aは、データ用メモリ115に転送すべきデータが、結合されていない単体のデータ(k=1)の場合(図23ステップS809においてno)、図24のステップS812に遷移する。
 また、DMAコントローラ1211aは、データ用メモリ115に転送すべきデータがデータブロックの場合(ステップS809においてyes)、ディスクリプタ1210a内の「k-1」個の先頭アドレスA#(n+1)~A#(n+k-1)を、データブロックを構成するk個のデータのうち、初めの「k-1」個のデータのデータ長に応じて書き込む(図23ステップS811)。
 具体的には、DMAコントローラ1211aは、先頭アドレスA#(n+1)については、先頭アドレスA#nと、データブロックを構成するk個のデータのうち1番目のデータのデータ長(受信データサイズL#nが示す値)とを足した値を書き込む。また、DMAコントローラ1211aは、先頭アドレスA#(n+k-1)については、先頭アドレスA#(n+k-2)と、データブロックを構成するk個のデータのうち「k-1」番目のデータのデータ長(受信データサイズL#(n+k-2)が示す値)とを足した値を書き込む。
 このように、DMAコントローラ1211aは、先頭アドレスA#iを書き込む場合、1つ前の先頭アドレスA#(i-1)と、データブロックを構成するデータのうち「i-1」番目のデータのデータ長とを足した値を書き込むようにすればよい。
 なお、n=Nの場合、DMAコントローラ1211aは、受信データサイズL#nと、L#1からL#(k-1)までの受信データサイズをディスクリプタ1210aに書き込むと共に、先頭アドレスA#nと、A#1からA#(k-1)までの先頭アドレスをディスクリプタ1210aに書き込むようにすればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1211aは、受信データサイズL#nと、L#(n+1)からL#NまでとL#1からL#(k-1-(N-n))までの受信データサイズをディスクリプタ1210aに書き込むと共に、先頭アドレスA#nと、A#(n+1)からA#NまでとA#1からA#(k-1-(N-n))までの先頭アドレスをディスクリプタ1210aに書き込むようにすればよい。
 次に、DMAコントローラ1211aは、ライトポインタWPをデータ用メモリ115の転送先の先頭アドレスとして、データ用メモリ115に転送すべきデータ(単体のデータまたはデータブロック)を、データ用メモリ115の転送先の先頭アドレスから始まるバッファ領域に書き込むDMA転送を行う(図24ステップS812)。すなわち、データ用メモリ115内のバッファ領域の先頭アドレスA0に、このバッファ領域の容量C0を加算した値(A0+C0)が、ライトポインタWPにデータのサイズCDを加算した値(WP+CD)より大きい場合、ライトポインタWPを転送先の先頭アドレスとしてDMA転送を行う。
 そして、DMAコントローラ1211aは、データ用メモリ115にDMA転送したデータ(単体のデータまたはデータブロック)のサイズをライトポインタWPに加算する(図24ステップS813)。具体的には、DMAコントローラ1211aは、データ用メモリ115にDMA転送したデータが、結合されていない単体のデータ(k=1)の場合、当該データのデータ長(受信データサイズL#nが示す値)をライトポインタWPに加算する。また、DMAコントローラ1211aは、データ用メモリ115に転送すべきデータがデータブロックの場合、受信データサイズL#n~L#(n+k-1)をライトポインタWPに加算する。
 なお、n=Nの場合、DMAコントローラ1211aは、受信データサイズL#nと、L#1からL#(k-1)までの受信データサイズをライトポインタWPに加算すればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1211aは、受信データサイズL#nと、L#(n+1)からL#NまでとL#1からL#(k-1-(N-n))までの受信データサイズをライトポインタWPに加算すればよい。
 次に、DMAコントローラ1211aは、データ用メモリ115にDMA転送したデータを構成する各データに対応する受信完了フラグWF#n~WF#(n+k-1)を「完了」から「未了」に書き換える(図24ステップS814)。さらに、DMAコントローラ1211aは、データ用メモリ115にDMA転送したデータを構成する各データに対応する有効フラグAF#n~AF#(n+k-1)を「無効」から「有効」に書き換える(図24ステップS815)。
 なお、n=Nの場合、DMAコントローラ1211aは、受信完了フラグWF#nと、WF#1からWF#(k-1)までの受信完了フラグとを「完了」から「未了」に書き換えると共に、有効フラグAF#nと、AF#1からAF#(k-1)までの有効フラグとを「無効」から「有効」に書き換えるようにすればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1211aは、受信完了フラグWF#nと、WF#(n+1)からWF#NまでとWF#1からWF#(k-1-(N-n))までの受信完了フラグとを「未了」に書き換えると共に、有効フラグAF#nと、AF#(n+1)からAF#NまでとAF#1からAF#(k-1-(N-n))までの有効フラグとを「有効」に書き換えるようにすればよい。
 そして、DMAコントローラ1211aは、n+k>Nが成立するかどうかを確認し(図24ステップS816)、n+kがNより大きい場合は、変数nをn=n+k-Nとし(図24ステップS817)とし、ステップS803に戻る。また、DMAコントローラ1211aは、n+kがN以下の場合は、変数nをn=n+kとし(図24ステップS818)とし、ステップS803に戻る。
 一方、DMAコントローラ1211aは、ライトポインタWPに、データ用メモリ115に転送すべきデータのサイズCDを加算した値(WP+CD)が、上限値(A0+C0)以上の場合(ステップS806においてno)、データのサイズCDと、リードポインタRPからデータ用メモリ115内のバッファ領域の先頭アドレスA0を減算した値(RP-A0)とを比較する(図23ステップS819)。
 DMAコントローラ1211aは、データのサイズCDが、減算値(RP-A0)より小さい場合(ステップS819においてyes)、データ結合部120から通知された情報(結合した各データのサイズ)に基づいて、データ用メモリ115に転送すべきデータを構成するk個のデータのデータ長を示す受信データサイズL#n~L#(n+k-1)を、ディスクリプタ1210aに書き込む(図25ステップS820)。
 続いて、DMAコントローラ1211aは、n番目の先頭アドレスA#nの値として、データ用メモリ115内のバッファ領域の先頭アドレスA0の値をディスクリプタ1210aに書き込む(図25ステップS821)。さらに、DMAコントローラ1211aは、データ用メモリ115に転送すべきデータが、結合されていない単体のデータ(k=1)の場合(図25ステップS822においてno)、図25ステップS825に遷移する。
 また、DMAコントローラ1211aは、データ用メモリ115に転送すべきデータがデータブロックの場合(ステップS822においてyes)、ディスクリプタ1210a内の「k-1」個の先頭アドレスA#(n+1)~A#(n+k-1)を、データブロックを構成するk個のデータのうち、初めの「k-1」個のデータのデータ長に応じて書き込む(図25ステップS824)。
 具体的には、DMAコントローラ1211aは、先頭アドレスA#(n+1)については、先頭アドレスA#nと、データブロックを構成するk個のデータのうち1番目のデータのデータ長(受信データサイズL#nが示す値)とを足した値を書き込む。また、DMAコントローラ1211aは、先頭アドレスA#(n+k-1)については、先頭アドレスA#(n+k-2)と、データブロックを構成するk個のデータのうち「k-1」番目のデータのデータ長(受信データサイズL#(n+k-2)が示す値)とを足した値を書き込む。このように、DMAコントローラ1211aは、先頭アドレスA#iを書き込む場合、1つ前の先頭アドレスA#(i-1)と、データブロックを構成するデータのうち「i-1」番目のデータのデータ長とを足した値を書き込むようにすればよい。
 なお、n=Nの場合、DMAコントローラ1211aは、受信データサイズL#nと、L#1からL#(k-1)までの受信データサイズをディスクリプタ1210aに書き込むと共に、先頭アドレスA#nと、A#1からA#(k-1)までの先頭アドレスをディスクリプタ1210aに書き込むようにすればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1211aは、受信データサイズL#nと、L#(n+1)からL#NまでとL#1からL#(k-1-(N-n))までの受信データサイズをディスクリプタ1210aに書き込むと共に、先頭アドレスA#nと、A#(n+1)からA#NまでとA#1からA#(k-1-(N-n))までの先頭アドレスをディスクリプタ1210aに書き込むようにすればよい。
 次に、DMAコントローラ1211aは、データ用メモリ115に転送すべきデータ(単体のデータまたはデータブロック)を、データ用メモリ115の先頭アドレスA0から始まるバッファ領域に書き込むDMA転送を行う(図25ステップS825)。すなわち、「A0+C0-WP」がデータ用メモリ115に転送すべきデータのサイズCDより小さく、バッファ領域の先頭アドレスA0からリードポインタRPまでの容量が転送データのサイズCDより大きい場合、ライトポインタWPの代わりに、データ用メモリ115の先頭アドレスA0を転送先の先頭アドレスとしてDMA転送を行う。
 そして、DMAコントローラ1211aは、データ用メモリ115にDMA転送したデータ(単体のデータまたはデータブロック)のサイズを、データ用メモリ115のバッファ領域の先頭アドレスA0に加算した値を、ライトポインタWPの新たな値として更新する(図25ステップS826)。具体的には、DMAコントローラ1211aは、データ用メモリ115にDMA転送したデータが、結合されていない単体のデータ(k=1)の場合、当該データのデータ長(受信データサイズL#nが示す値)を先頭アドレスA0に加算した値を、ライトポインタWPの新たな値とする。また、DMAコントローラ1211aは、データ用メモリ115に転送すべきデータがデータブロックの場合、受信データサイズL#n~L#(n+k-1)を先頭アドレスA0に加算した値を、ライトポインタWPの新たな値とする。
 なお、n=Nの場合、DMAコントローラ1211aは、受信データサイズL#nと、L#1からL#(k-1)までの受信データサイズを先頭アドレスA0に加算した値を、ライトポインタWPの新たな値とすればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1211aは、受信データサイズL#nと、L#(n+1)からL#NまでとL#1からL#(k-1-(N-n))までの受信データサイズを先頭アドレスA0に加算した値を、ライトポインタWPの新たな値とすればよい。
 次に、DMAコントローラ1211aは、データ用メモリ115にDMA転送したデータを構成する各データに対応する受信完了フラグWF#n~WF#(n+k-1)を「完了」から「未了」に書き換える(図25ステップS827)。さらに、DMAコントローラ1211aは、データ用メモリ115にDMA転送したデータを構成する各データに対応する有効フラグAF#n~AF#(n+k-1)を「無効」から「有効」に書き換える(図25ステップS828)。
 なお、n=Nの場合、DMAコントローラ1211aは、受信完了フラグWF#nと、WF#1からWF#(k-1)までの受信完了フラグとを「完了」から「未了」に書き換えると共に、有効フラグAF#nと、AF#1からAF#(k-1)までの有効フラグとを「無効」から「有効」に書き換えるようにすればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1211aは、受信完了フラグWF#nと、WF#(n+1)からWF#NまでとWF#1からWF#(k-1-(N-n))までの受信完了フラグとを「未了」に書き換えると共に、有効フラグAF#nと、AF#(n+1)からAF#NまでとAF#1からAF#(k-1-(N-n))までの有効フラグとを「有効」に書き換えるようにすればよい。
 そして、DMAコントローラ1211aは、n+k>Nが成立するかどうかを確認し(図25ステップS829)、n+kがNより大きい場合は、変数nをn=n+k-Nとし(図25ステップS830)とし、ステップS803に戻る。また、DMAコントローラ1211aは、n+kがN以下の場合は、変数nをn=n+kとし(図25ステップS831)とし、ステップS803に戻る。
 こうして、本実施例のDMA転送では、k個のデータが連結されたデータブロックを纏めてデータ用メモリ115に転送し、ディスクリプタ1210aの先頭アドレスの情報をDMAコントローラ1211aが書き込むことにより、パケット処理装置のプロセッサ(受信処理部117とデータ処理部116)に対して各データの先頭が書き込まれたアドレスを通知するようにしている。
 なお、DMAコントローラ1211aは、以下の受信処理部117等(プロセッサが実行するソフトウェア)の処理に対応してリードポインタRPの更新処理も行うが、このリードポインタRPの更新処理の詳細は後述する。
 受信処理部117(プロセッサが実行するソフトウェア)は、定期的にディスクリプタ1210aの有効フラグAF#n(nは1~N)を確認して、有効フラグAF#nが「有効」を示している場合(図26ステップS901においてyes)、対応するn番目の先頭アドレスA#nの情報と受信データサイズL#nの情報とに基づいてデータ用メモリ115からn番目のデータを読み出してデータ処理部116へ渡す(図26ステップS902)。
 データ処理部116で必要な処理が行われた後に(図26ステップS903においてyes)、受信処理部117(プロセッサが実行するソフトウェア)は、処理が終わったn番目のデータに対応する、ディスクリプタ1210aのn番目の受信完了フラグWF#nを「未了」から「完了」に書き換えると共に、ディスクリプタ1210aのn番目の有効フラグAF#nを「有効」から「無効」に書き換える(図26ステップS904)。
 第1の実施例と同様に、ディスクリプタ1210aには、有効フラグAF#1~AF#Nの領域がN個(組)あるが、有効フラグAF#1~AF#Nを確認する順番は予め決められている。
 なお、定期的にディスクリプタ1210aの有効フラグAF#nを確認する代わりに、DMA転送の完了後にDMAコントローラ1211aがプロセッサに対して割り込み処理要求を発行し、この割り込み処理要求に応じて受信処理部117(プロセッサが実行するソフトウェア)が、ディスクリプタ1210aの有効フラグAF#n(nは1~N)を確認するようにしてもよい。
 次に、DMAコントローラ1211aによるリードポインタRPの更新処理について説明する。最初に、DMAコントローラ1211aは、リードポインタRPの初期値として、データ用メモリ115のデータブロック用のバッファ領域の先頭アドレスA0を設定する(図27ステップS840)。また、DMAコントローラ1211aは、有効フラグの確認順を示す変数nを1に初期化する(図27ステップS841)。なお、この変数nと図22~図25の変数nとは同じ値であるから、ステップS841はステップS802と同じ処理である。
 DMAコントローラ1211aは、図22~図25の処理中に、ディスクリプタ1210aのn番目の有効フラグAF#nを定期的に確認する(図27ステップS842)。DMAコントローラ1211aは、n番目の先頭アドレスA#nが「有効」であることを有効フラグAF#nが示していることを検出した後(図27ステップS843においてyes)、このn番目の先頭アドレスA#nに対応するディスクリプタ1210aのn番目の受信完了フラグWF#nを確認する(図27ステップS844)。
 DMAコントローラ1211aは、ディスクリプタ1210aのn番目の受信完了フラグWF#nが「完了」を示している場合(図27ステップS845においてyes)、n番目の先頭アドレスA#nにn番目の受信データサイズL#nを加算した値を、リードポインタRPの新たな値として更新する(図27ステップS846)。
 また、有効フラグAF#nがプロセッサが実行するソフトウェアにより「無効」に書き換えられていない場合はDMAコントローラ1211aが「無効」に更新する(図27ステップS847)。
 DMAコントローラ1211aは、変数nがNと等しいかどうかを判定する(図27ステップS848)。DMAコントローラ1211aは、変数nがNに達していない場合(ステップS848においてno)、変数nを1増やし(図27ステップS849)、ステップS842に戻る。また、DMAコントローラ1211aは、変数nがNに達した場合(ステップS848においてyes)、変数nを1とし(図27ステップS850)、ステップS842に戻る。
 なお、受信完了フラグWF#nが「完了」になるのは、図26の受信処理部117の動作によるものである。
 また、以上に説明したリードポインタRPは、DMAコントローラ1211aがデータ用メモリ115内のデータブロック用のバッファ領域の残容量の計算等に使用するためのものであり、ソフトウェアによる読み出し時等の使用は想定していない。
 以上に説明したように、本実施例のパケット処理装置は、纏めDMA転送を実現することができ、かつデータブロックを元の複数のデータに復元するための情報をディスクリプタ1210aに書き込む手段(DMAコントローラ1211a)を内蔵する結合データ転送部121aを備えている。DMAコントローラ1211aはハードウェアで実装可能なので、復元処理のソフトウェアでの実行を不要とし、かつ、纏めDMA転送の効果による高い受信性能を実現することが可能となる。
 なお、従来の図42の構成のパケット処理装置において、複数のデータが結合したデータブロックを元の複数のデータに復元する処理をプロセッサ(ソフトウェア)で実行する場合と比較すると、本実施例では、復元処理をプロセッサ(ソフトウェア)で行う必要がなくなるので、1データの処理(1パケット分の処理)に必要となるプロセッサの処理が軽くなり、受信性能が向上する(単位時間に処理できるデータの数が増加する)という効果がある。また、本実施例では、1データの処理(1パケット分の処理)に必要となるプロセッサの消費電力が小さくなるという効果もある。
 また、従来の図42の構成で、纏めDMA転送を正常に行うためには、ソフトウェアによって事前に、データ用メモリ115内に、N×DB_mux(DB_muxはデータブロックの最大サイズ)のバッファ領域を確保しておく必要がある。これに対して、本実施例のパケット処理装置では、より小さいバッファ領域で纏めDMA転送を正常に行うことができる。
 上記のデータブロックの最大サイズDB_muxは、結合閾値制御部119に設定される閾値に許容最大データ長を足した値となる。したがって、例えば閾値を500Byte、許容最大データ長を2000Byte、Nを10とすると、従来の図42の構成でデータ用メモリ115内に確保が必要なバッファ領域のサイズは、10×2500=25000Byteとなる。
 本実施例のパケット処理装置でデータ用メモリ115内に確保が必要なバッファ領域のサイズは、Nに依存せず、データブロックの最大サイズDB_muxとなる。すなわち、本実施例のパケット処理装置でデータ用メモリ115内に確保が必要なバッファ領域のサイズは、上記と同じ条件で、2500Byteとなる。このようにバッファ領域のサイズを小さくできるのは、バッファ領域の残容量CRが小さい場合に残容量CRが必要な量になるまでDMA転送を待たせる機能(図22のステップS805、図23のステップS819)の実装による効果である。
 したがって、本実施例では、データ用メモリ115内に確保するバッファ領域のサイズが小さいと、ソフトウェアによるデータ用メモリ115からのデータの読み出しが完了するまで次のDMA転送が待たされる確率が高くなる。
 ここで、本実施例のパケット処理装置でデータ用メモリ115内に確保するバッファ領域のサイズを従来の図42の構成で必要なサイズと同じサイズにした場合に無駄となる領域の量を比較する。
 上記のように閾値を500Byte、許容最大データ長を2000Byte、Nを10とした場合、実際にデータ用メモリ115に転送されるデータブロックのサイズは501Byte~2500Byteとなる。つまり、従来の図42の構成では、各データブロックのサイズをSとしたとき、(2500-S)を10個のデータブロック分加算した領域が無駄になる。これは、データブロックのサイズSの平均が仮に1500Byteだとすると、25000Byteの内10000Byte分の領域が無駄になっていることを示している。
 本実施例の構成でデータ用メモリ115内に確保するバッファ領域のサイズを25000Byteとした場合、25000Byteが連続した領域で確保され、複数のデータブロックを連続した領域に書き込むことが可能な構成となっている。したがって、本実施例で無駄になるのは、最大でデータブロックの最大サイズ2500Byteから1Byteを引いた値、すなわち、2499Byteのみとなる。この値は、データブロックのサイズSの平均が(25000-2499)/10=2250.1より小さい場合、Nを11以上にすれば、11個以上のデータブロックを同じ容量(25000Byte)のバッファに書き込めることを示している。従来の図42の構成で11個以上のデータブロックを書き込むためにはNを11以上にし、かつ27500Byte以上のバッファ領域が必要である。
 したがって、本実施例のパケット処理装置でデータ用メモリ115内に確保するバッファ領域のサイズを従来の図42の構成で必要なサイズと同じサイズにした場合、従来の図42の構成の場合より、無駄になる領域が小さくなり、より多数のデータブロックを同じサイズのバッファ領域に書き込むことが可能となる場合もある。
 また、データブロックのサイズSの平均を仮に1500Byte、バッファ領域に書き込むデータブロックの最大数を10だとして、本実施例のパケット処理装置でデータ用メモリ115内に確保すべきバッファ領域のサイズを計算すると、1500×10=15000Byteとなり、従来の図42の構成で必要なサイズ(25000Byte)より小さくなる。
 なお、本実施例の構成では、データ用メモリ115のバッファ領域に書き込むデータブロックの最大数とディスクリプタ1210aのNを独立に決定することができる。上記のようにバッファ領域に書き込むデータブロックの最大数によりバッファ領域のサイズを決め、Nはバッファ領域に書き込むデータの最大数とすれば良い。ただし、実際にバッファ領域に書き込めるデータの最大数は、格納するデータのサイズとバッファ領域のサイズに依存するので、Nもしくはそれより小さい値となる。仮に、データブロックのサイズSの平均が1500Byte、結合したデータの数kの平均が2個、バッファ領域に書き込むデータブロックの最大数を10だとすると、バッファ領域のサイズを1500×10=15000Byte、Nを2×10=20とするのが望ましい。
 複数のデータが結合したデータブロックを元の複数のデータに復元する処理を受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bのハードウェアで実現しようとすると、復元処理に必要な情報(結合したデータの数、データ毎のサイズ)をデータ結合部120から受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bに通知する手段が必要となる。
 また、復元処理を受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bのハードウェアで実現しようとすると、DMA転送完了後、受信処理が起動されるまで、場合によっては複数のデータブロック分の復元処理に必要な情報を保持しておく必要があることを考慮しなければならない。
 これに対して、本実施例のパケット処理装置では、1つのデータブロックのDMA転送が完了した時点でデータブロックの復元処理は終わっているので、複数のデータブロック分の情報を保持する必要がない。したがって、復元処理を受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bのハードウェアで実現する場合と比較して、本実施例の方がハードウェアの規模が小さい。
 また、復元処理に必要な情報をデータ結合部120から受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bに通知する手段として、復元処理に必要な情報をデータブロックの中に書き込むことも可能である。しかし、復元処理に必要な情報をデータブロックの中に書き込む場合、DMA転送に使用するバスの帯域の一部を、復元処理に必要な情報で占有してしまうことになるので、本来のデータの転送に使用できる実効帯域が小さくなり、その結果、DMA転送の性能が劣化してしまうという問題が発生する。
 本実施例のパケット処理装置では、復元処理に必要な情報をデータブロックに書き込む必要がないので、上記のような実効帯域の劣化は起こらない。
 本実施例では、結合データ転送部121aをハードウェアで実現する例を示したが、受信処理に使用するプロセッサとは別のプロセッサとソフトウェアにより結合データ転送部121aの少なくとも一部の処理を実装することも可能である。このように結合データ転送部121aの少なくとも一部の処理をソフトウェアで実現する場合でも、データブロックを元の複数のデータに復元する処理を受信処理部117もしくはデータ処理部116で行う必要がなくなるので、纏めDMA転送の効果による高い受信性能を実現することが可能となる。
 また、結合データ転送部121aの少なくとも一部の処理をソフトウェアで実現する場合でも、結合データ転送部121aをハードウェアで実現する場合と同様に、データブロックを元の複数のデータに復元する処理に必要となるハードウェアの規模が小さくなる効果(複数のデータブロック分の情報を保持する必要がないことによる効果)、およびデータの転送に使用できる実効帯域の劣化が起こらない効果(復元処理に必要な情報をデータブロックの中に加えないことによる効果)を得ることができる。
 本実施例の変形として、DMAコントローラ1211aとそれぞれのDMAコントローラ1211aに対応するディスクリプタ1210aとを複数搭載する構成としてもよい。また、データ結合部120においてデータの種類を判定して同じ種類のデータをデータブロックとして纏める構成としてもよいし、データの種類に応じて複数のDMAコントローラ1211aと複数のディスクリプタ1210aとを使い分ける構成としてもよい。
 データの種類別にDMAコントローラ1211aとディスクリプタ1210aとを用意し、データの種類に応じて複数のDMAコントローラ1211aと複数のディスクリプタ1210aとを使い分ける構成とすると、データの種類毎に異なる受信処理を行うことが容易になる。
 また、本実施例において、複数のCPUコアを内蔵するプロセッサのコア毎に複数のDMAコントローラ1211aと複数のディスクリプタ1210aとを使い分ける構成としてもよいし、バーチャルマシン毎に複数のDMAコントローラ1211aと複数のディスクリプタ1210aとを使い分ける構成としてもよい。
 CPUコア毎もしくはバーチャルマシン毎に複数のDMAコントローラ1211aと複数のディスクリプタ1210aとを使い分ける構成とすることにより、DMAコントローラ等が1個のみの場合と比較して、ソフトウェアによる受信処理の性能を向上させることができる。
[第4の実施例]
 次に、本発明の第4の実施例について説明する。図28は、本発明の第4の実施例に係るパケット処理装置の構成を示すブロック図である。図28のパケット処理装置は、回線対応部100と、パケット処理部114と、データ用メモリ115と、データ処理部116と、受信処理部117と、受信バッファ118と、結合閾値制御部119と、データ結合部120と、転送管理部122aと、結合データ転送部123aとから構成される。
 図28の構成と図19の構成の違いは、図19における転送手段を、パケット処理装置のプロセッサ(ソフトウェア)による書き込み手段に置き換えた点である。つまり、本実施例は、図19の結合データ転送部121aを、ソフトウェアによる結合データ転送部123aに置き換えたものである。
 回線対応部100とデータ用メモリ115とデータ処理部116と受信処理部117と受信バッファ118と結合閾値制御部119と転送管理部122aと制御用レジスタ124は、図19の構成と同等である。データ結合部120は、図11の構成と同等である。
 結合データ転送部123a(プロセッサが実行するソフトウェア)は、複数のデータが結合されたデータブロックをデータ用メモリ115に書き込み、受信処理部117の起動要求を行なう。また、結合データ転送部123aは、データ結合部120から通知された、結合したデータの数と各データのサイズの情報を用いて、転送管理部122a(プロセッサが実行するソフトウェア)がデータ毎に用意したディスクリプタ1230aにサイズ等の情報を書き込む。
 ディスクリプタ1230aの構成は、第3の実施例のディスクリプタ1210aの構成と同等である。ただし、本実施例では、結合データ転送部121aの代わりに、結合データ転送部123a(プロセッサが実行するソフトウェア)がディスクリプタ1230aへの書き込みを行うという違いがある。
 図29~図33は結合データ転送部123a(プロセッサが実行するソフトウェア)の動作を説明するフローチャートである。結合データ転送部123aは、データ結合部120から転送要求が発行されると、初期設定後の最初の転送要求の場合、転送管理部122aが設定した先頭アドレスA0と容量(サイズ)C0とを制御用レジスタ124から読み出す(図29ステップS1000)。そして、結合データ転送部123aは、ライトポインタWPの初期値として先頭アドレスA0を設定する(図29ステップS1001)。
 続いて、結合データ転送部123aは、ステップS802~S806と同等のステップS1002~S1006の処理を行う。結合データ転送部123aは、ライトポインタWPにデータのサイズCDを加算した値(WP+CD)が、上限値(A0+C0)より小さい場合(図30ステップS1006においてyes)、データ結合部120から通知された情報(結合した各データのサイズ)に基づいて、データ用メモリ115に転送すべきデータを構成するk個のデータのデータ長を示す受信データサイズL#n~L#(n+k-1)を、ディスクリプタ1230aに書き込む(図30ステップS1007)。
 図30のステップS1008~S1011の処理は、図23のステップS808~S811の処理と同等である。
 次に、結合データ転送部123aは、ライトポインタWPをデータ用メモリ115の転送先の先頭アドレスとして、データ用メモリ115に転送すべきデータ(単体のデータまたはデータブロック)を、データ用メモリ115の転送先の先頭アドレスから始まるバッファ領域に書き込む(図31ステップS1012)。
 図31のステップS1013~S1018の処理は、図24のステップS813~S818の処理と同等である。結合データ転送部123aは、ステップS1017またはS1018の処理後、ステップS1003に戻る。
 また、結合データ転送部123aは、ライトポインタWPに、データ用メモリ115に転送すべきデータのサイズCDを加算した値(WP+CD)が、上限値(A0+C0)以上の場合(図30ステップS1006においてno)、データのサイズCDと、リードポインタRPからデータ用メモリ115内のバッファ領域の先頭アドレスA0を減算した値(RP-A0)とを比較する(図30ステップS1019)。
 結合データ転送部123aは、データのサイズCDが、減算値(RP-A0)より小さい場合(ステップS1019においてyes)、データ結合部120から通知された情報(結合した各データのサイズ)に基づいて、データ用メモリ115に転送すべきデータを構成するk個のデータのデータ長を示す受信データサイズL#n~L#(n+k-1)を、ディスクリプタ1230aに書き込む(図32ステップS1020)。
 図32のステップS1021~S1024の処理は、図25のステップS821~S824の処理と同等である。
 次に、結合データ転送部123aは、データ用メモリ115に転送すべきデータ(単体のデータまたはデータブロック)を、データ用メモリ115の先頭アドレスA0から始まるバッファ領域に書き込む(図32ステップS1025)。
 図32のステップS1026~S1031の処理は、図25のステップS826~S831の処理と同等である。結合データ転送部123aは、ステップS1030またはS1031の処理後、ステップS1003に戻る。
 次に、結合データ転送部123aによるリードポインタRPの更新処理について説明する。最初に、結合データ転送部123aは、リードポインタRPの初期値として、データ用メモリ115のデータブロック用のバッファ領域の先頭アドレスA0を設定する(図33ステップS1040)。また、結合データ転送部123aは、有効フラグの確認順を示す変数nを1に初期化する(図33ステップS1041)。なお、この変数nと図29~図32の変数nとは同じ値であるから、ステップS1041はステップS1002と同じ処理である。
 図33のステップS1042~S1050の処理は、図27のステップS842~S850の処理と同等である。
 こうして、本実施例のパケット処理装置は、纏め書き込みを実現することができ、かつ複数のデータが結合したデータブロックを元の複数のデータに復元するための情報をディスクリプタ1230aに書き込む手段(結合データ転送部123a)を備えている。本実施例によれば、復元処理の受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bでの実行を不要とすることができ、かつ、纏め書き込みの効果による高い受信性能を実現することが可能となる。
 また、従来の図42の構成で、纏め書き込みを正常に行うためには、受信処理用(読み出し処理用)のソフトウェアによって事前に、データ用メモリ115内に、N×DB_mux(DB_muxはデータブロックの最大サイズ)のバッファ領域を確保しておく必要がある。
 これに対して、本実施例のパケット処理装置では、図19の構成と同様に、より小さいバッファ領域で纏め書き込みを正常に行うことができる。
 本実施例のパケット処理装置では、結合データ転送部123aがディスクリプタ1230aの情報(先頭アドレス、受信データサイズ、受信完了フラグ)を書き込むことにより、復元処理を不要としている。
 復元処理を受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bで実現しようとすると、復元処理に必要な情報(結合したデータの数、データ毎のサイズ)をデータ結合部120から受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bに通知する手段が必要となる。
 また、復元処理を受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bで実現しようとすると、纏め書き込み完了後、受信処理が起動されるまで、場合によっては複数のデータブロック分の復元処理に必要な情報を保持しておく必要があることを考慮しなければならない。
 これに対して、本実施例のパケット処理装置では、1つのデータブロックの纏め書き込みが完了した時点でデータブロックの復元処理は終わっているので、複数のデータブロック分の情報を保持する必要がない。したがって、復元処理を受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bで実現する場合と比較して、本実施例の方がハードウェアの規模が小さい。これは、データブロックを元の複数のデータに復元する処理をソフトウェアで実装する場合で比較しても同じである。
 例えば、図42の構成でデータ用メモリ115と回線対応部100以外の構成をすべてソフトウェアで実現した場合、データ用メモリ115への書き込みの処理と、復元処理を含む受信処理とを異なるプロセッサ(もしくはバーチャルマシン等)に実装すると、データ用メモリ115への書き込み完了後、受信処理が起動されるまで、場合によっては複数のデータブロック分の復元処理に必要な情報を保持しておく必要があるため、複数のデータブロック分の復元処理に必要な情報(結合したデータの数、データ毎のサイズ)をデータ用メモリ115等に保持しておく必要がある。
 これに対して、本実施例の構成でデータ用メモリ115と回線対応部100以外の構成をすべてソフトウェアで実現した場合は、データ用メモリ115への書き込みの処理と、復元処理を含まない受信処理とを異なるプロセッサ(もしくはバーチャルマシン等)に実装した場合でも、データ用メモリ115への書き込みの処理と復元処理を同じプロセッサ(もしくはバーチャルマシン等)に実装することにより、複数のデータブロック分の情報(結合したデータの数、データ毎のサイズ)を保持する必要がない、すなわち、1つのデータブロック分のみの復元処理に必要な情報(結合したデータの数、データ毎のサイズ)をデータ用メモリ115等に保持しておくだけでよい。
 つまり、本実施例の構成は、図42の構成と比較して、復元処理に必要な情報(結合したデータの数、データ毎のサイズ)の保持に使用するデータ用メモリ115等の容量(書き込み可能なビット数)が小さくてもよいことになり、必要となるハードウェアの規模を削減することができる。
 また、復元処理に必要な情報をデータ結合部120から受信処理部117、データ処理部116、もしくは図42の結合データ分離部108bに通知する手段として、復元処理に必要な情報をデータ用メモリ115に書き込むことも可能である。しかし、この場合、纏め書き込みに使用するバスの帯域の一部を、復元処理に必要な情報で占有してしまうことになるので、本来のデータの書き込みに使用できる実効帯域が小さくなり、その結果、纏め書き込みの性能が劣化する。
 本実施例のパケット処理装置では、復元処理に必要な情報を、データ用メモリ115ではなく、データ用メモリ115が接続されているバスを使用しない別のメモリ(データ結合部120からの書き込みと結合データ転送部123aからの読み出しだけが可能であれば良い)に保持することができ、上記のような実効帯域の劣化は起こらない。
 第3の実施例と同様に、本実施例の変形として、データ結合部120においてデータの種類を判定して同じ種類のデータをデータブロックとして纏める構成としてもよいし、データの種類に応じて複数のディスクリプタ1230aを使い分ける構成としてもよい。データの種類別にディスクリプタ1230aを用意し、データの種類に応じて複数のディスクリプタ1230aを使い分ける構成とすると、データの種類毎に異なる受信処理を行うことが容易になる。
 また、本実施例において、複数のCPUコアを内蔵するプロセッサのコア毎に複数のディスクリプタ1230aを使い分ける構成としてもよいし、バーチャルマシン毎に複数のディスクリプタ1230aを使い分ける構成としてもよい。CPUコア毎もしくはバーチャルマシン毎に複数のディスクリプタ1230aを使い分ける構成とすることにより、ディスクリプタ1230aが1個のみの場合と比較して、ソフトウェアによる書き込み処理および読み出し処理の性能が向上する。
 第2の実施例、及び、第4の実施例のパケット処理装置において、データ用メモリ115と転送管理部122,122aとデータ処理部116と受信処理部117と結合データ転送部123,123aとは、プロセッサ、記憶装置及びインタフェースを備えたコンピュータと、これらのハードウェア資源を制御するプログラムによって実現することができる。また、上記のとおり、結合データ転送部121,121aの一部の処理をコンピュータで実現することも可能である。
 コンピュータの構成例を図34に示す。コンピュータは、CPU(Central Processing Unit)200と、記憶装置201と、インターフェース装置(以下、I/Fと略する)202とを備えている。このようなコンピュータにおいて、本発明のパケット処理方法を実現させるためのプログラムは記憶装置201に格納される。CPU200は、記憶装置に格納されたプログラムに従って第2の実施例、及び、第4の実施例で説明した処理を実行する。
 本発明は、通信データのプロトコル処理や転送処理等を行う技術に適用することができる。
 100…回線対応部、114…パケット処理部、115…データ用メモリ、116…データ処理部、117…受信処理部、118…受信バッファ、119…結合閾値制御部、120…データ結合部、121,121a,123,123a…結合データ転送部、122,122a…転送管理部、124…制御用レジスタ、1210,1210a,1230,1230a…ディスクリプタ、1211,1211a…DMAコントローラ。

Claims (8)

  1.  通信回線から受信したパケットの処理を行って処理結果のデータを出力するように構成されたパケット処理部と、
     前記パケット処理部から出力された複数のデータを連結してデータブロックを生成するように構成されたデータ結合部と、
     前記パケット処理部から出力されたデータを格納するように構成されたデータ用メモリと、
     前記データ結合部によって生成されたデータブロックを前記データ用メモリにDMA転送するか、またはプロセッサによって書き込むように構成された結合データ転送部とを備え、
     前記結合データ転送部は、前記データブロック内の各データの先頭の、前記データ用メモリ上におけるアドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタに書き込むことを特徴とするパケット処理装置。
  2.  通信回線から受信したパケットの処理を行って処理結果のデータを出力するように構成されたパケット処理部と、
     前記パケット処理部から出力された複数のデータを連結してデータブロックを生成するように構成されたデータ結合部と、
     前記パケット処理部から出力されたデータを格納するように構成されたデータ用メモリと、
     前記データ結合部によって生成されたデータブロックを前記データ用メモリにDMA転送するか、またはプロセッサによって書き込むように構成された結合データ転送部とを備え、
     前記結合データ転送部は、前記データブロック内の各データの先頭の、前記データ用メモリ上におけるアドレスを決定し、このアドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタに書き込み、前記データブロックを前記データ用メモリにDMA転送するか、またはプロセッサによって書き込むことを特徴とするパケット処理装置。
  3.  請求項1または2記載のパケット処理装置において、
     前記結合データ転送部は、前記データブロック内の各データのデータ長を示す受信データサイズの情報を前記ディスクリプタに書き込むことを特徴とするパケット処理装置。
  4.  請求項1乃至3のいずれか1項に記載のパケット処理装置において、
     前記データ用メモリに格納されたデータを読み出す処理部をさらに備え、
     前記処理部は、前記ディスクリプタに書き込まれた情報に基づいて前記データ用メモリからデータを読み出して処理を施すことを特徴とするパケット処理装置。
  5.  通信回線から受信したパケットの処理を行って処理結果のデータを出力する第1のステップと、
     前記第1のステップで得られた複数のデータを連結してデータブロックを生成する第2のステップと、
     前記第1のステップで得られたデータに対して処理を施す処理部がデータの読み出しを行うデータ用メモリに対して、前記データブロックをDMA転送するか、またはプロセッサによって書き込む第3のステップと、
     前記データブロック内の各データの先頭の、前記データ用メモリ上におけるアドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタに書き込む第4のステップとを含むことを特徴とするパケット処理方法。
  6.  通信回線から受信したパケットの処理を行って処理結果のデータを出力する第1のステップと、
     前記第1のステップで得られた複数のデータを連結してデータブロックを生成する第2のステップと、
     前記第1のステップで得られたデータに対して処理を施す処理部がデータの読み出しを行うデータ用メモリに対して、前記データブロック内の各データの先頭の、前記データ用メモリ上におけるアドレスを決定する第3のステップと、
     前記アドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタに書き込む第4のステップと、
     前記データブロックを前記データ用メモリにDMA転送するか、またはプロセッサによって書き込む第5のステップとを含むことを特徴とするパケット処理方法。
  7.  請求項5または6記載のパケット処理方法において、
     前記データブロック内の各データのデータ長を示す受信データサイズの情報を前記ディスクリプタに書き込むステップをさらに含むことを特徴とするパケット処理方法。
  8.  請求項5乃至7のいずれか1項に記載のパケット処理方法において、
     前記ディスクリプタに書き込まれた情報に基づいて前記データ用メモリからデータを読み出して処理を施すステップをさらに含むことを特徴とするパケット処理方法。
PCT/JP2020/015639 2019-04-22 2020-04-07 パケット処理装置およびパケット処理方法 WO2020217968A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/436,977 US20220171725A1 (en) 2019-04-22 2020-04-07 Packet Processing Device and Packet Processing Method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2019-080731 2019-04-22
JP2019080731A JP7331431B2 (ja) 2019-04-22 2019-04-22 パケット処理装置およびパケット処理方法

Publications (1)

Publication Number Publication Date
WO2020217968A1 true WO2020217968A1 (ja) 2020-10-29

Family

ID=72936575

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2020/015639 WO2020217968A1 (ja) 2019-04-22 2020-04-07 パケット処理装置およびパケット処理方法

Country Status (3)

Country Link
US (1) US20220171725A1 (ja)
JP (1) JP7331431B2 (ja)
WO (1) WO2020217968A1 (ja)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006302246A (ja) * 2005-03-23 2006-11-02 Fujitsu Ltd ネットワークアダプタ、通信システムおよび通信方法
JP2010004262A (ja) * 2008-06-19 2010-01-07 Sony Corp 情報受信装置および情報受信方法

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5754436A (en) * 1994-12-22 1998-05-19 Texas Instruments Incorporated Adaptive power management processes, circuits and systems
US7451335B2 (en) * 2001-04-24 2008-11-11 Broadcom Corporation Selectively disabling a portion of ASF operations when ASF device is powered by auxiliary power
US7627693B2 (en) * 2002-06-11 2009-12-01 Pandya Ashish A IP storage processor and engine therefor using RDMA
US7213045B2 (en) * 2002-08-16 2007-05-01 Silverback Systems Inc. Apparatus and method for transmit transport protocol termination
US7539208B2 (en) * 2004-05-25 2009-05-26 Cisco Technology, Inc. Timing system for modular cable modem termination system
JP4468332B2 (ja) 2006-06-28 2010-05-26 日本電信電話株式会社 パケット処理方法およびパケット処理装置
US20190265976A1 (en) * 2018-02-23 2019-08-29 Yuly Goryavskiy Additional Channel for Exchanging Useful Information
US11792307B2 (en) * 2018-03-28 2023-10-17 Apple Inc. Methods and apparatus for single entity buffer pool management
JP7056337B2 (ja) * 2018-04-10 2022-04-19 日本電信電話株式会社 パケット処理装置およびパケット処理方法
JP7102936B2 (ja) * 2018-05-23 2022-07-20 日本電信電話株式会社 パケット処理装置およびパケット処理方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006302246A (ja) * 2005-03-23 2006-11-02 Fujitsu Ltd ネットワークアダプタ、通信システムおよび通信方法
JP2010004262A (ja) * 2008-06-19 2010-01-07 Sony Corp 情報受信装置および情報受信方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
OHTERU, SHOKO: "Improvement on DMA Transfer Efficiency by Packet Concatenation", IEICE TECHNICAL REPORT, vol. 118, no. 457, 20 February 2019 (2019-02-20), pages 79 - 84, XP009524559 *

Also Published As

Publication number Publication date
JP2020178303A (ja) 2020-10-29
US20220171725A1 (en) 2022-06-02
JP7331431B2 (ja) 2023-08-23

Similar Documents

Publication Publication Date Title
US20150288624A1 (en) Low-latency processing in a network node
WO2019225379A1 (ja) パケット処理装置およびパケット処理方法
WO2001004770A2 (en) Method and architecture for optimizing data throughput in a multi-processor environment using a ram-based shared index fifo linked list
JP2018190277A (ja) メモリアクセス制御装置及びその制御方法
JP7056337B2 (ja) パケット処理装置およびパケット処理方法
WO2020217968A1 (ja) パケット処理装置およびパケット処理方法
JP2007034392A (ja) 情報処理装置及びデータ処理方法
EP1891503A2 (en) Concurrent read response acknowledge enhanced direct memory access unit
CN112491715B (zh) 路由装置及片上网络的路由设备
JP2000029767A (ja) デ―タ処理装置における書き込みバッファ
US20050129014A1 (en) Packet forwarding system capable of transferring packets fast through interfaces by reading out information beforehand for packet forwarding and method thereof
WO2020217990A1 (ja) パケット処理装置およびパケット処理方法
JP2009301101A (ja) プロセッサ間通信システム、プロセッサ、プロセッサ間通信方法、および、通信方法
JP2011040038A (ja) 検索装置、検索装置の制御方法及びプログラム
US12010045B2 (en) Packet processing device and packet processing method
JP4170330B2 (ja) 情報処理装置
JP5694064B2 (ja) ルータおよび転送方法
US20140297972A1 (en) Memory control device and memory control method
JP7321913B2 (ja) 通信装置、制御方法およびプログラム
JP2009157731A (ja) 仮想計算機システムおよび仮想計算機システムの制御方法
JP6835758B2 (ja) フロー制御装置および方法
JP6747680B1 (ja) データ転送装置、データ転送方法及びコンピュータプログラム
JP7049140B2 (ja) 通信装置およびその制御方法
JP7005303B2 (ja) 通信装置、パケット生成装置およびそれらの制御方法
WO2019188174A1 (ja) 情報処理装置

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: 20793952

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: 20793952

Country of ref document: EP

Kind code of ref document: A1