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

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

Info

Publication number
WO2019225379A1
WO2019225379A1 PCT/JP2019/018931 JP2019018931W WO2019225379A1 WO 2019225379 A1 WO2019225379 A1 WO 2019225379A1 JP 2019018931 W JP2019018931 W JP 2019018931W WO 2019225379 A1 WO2019225379 A1 WO 2019225379A1
Authority
WO
WIPO (PCT)
Prior art keywords
packet
combined
memory
unit
processing
Prior art date
Application number
PCT/JP2019/018931
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/057,067 priority Critical patent/US11321255B2/en
Publication of WO2019225379A1 publication Critical patent/WO2019225379A1/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/36Handling requests for interconnection or transfer for access to common bus or bus system
    • G06F13/362Handling requests for interconnection or transfer for access to common bus or bus system with centralised access control
    • G06F13/364Handling requests for interconnection or transfer for access to common bus or bus system with centralised access control using independent requests or grants, e.g. using separated request and grant lines
    • 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/10Program control for peripheral devices
    • G06F13/12Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
    • G06F13/124Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine
    • G06F13/128Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine for dedicated transfers to a network
    • 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/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1668Details of memory controller
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present invention relates to a packet processing apparatus and a packet processing method, and more particularly to a packet processing apparatus and a packet processing method for performing packet data transfer processing in a communication system.
  • FIG. 17 is a block diagram showing the configuration of a conventional packet processing apparatus.
  • the packet processing apparatus includes a line correspondence unit 100 that receives a packet from a communication line, a packet memory 101 that stores a packet received from the communication line, and a packet transfer unit 102 that transfers a packet 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.
  • the packet transfer unit 102 performs data transfer using DMA (Direct Memory Access) upon arrival of a packet to the line corresponding unit 100 connected to a communication line (not shown) and arrives.
  • 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 makes a request for starting the reception processing unit 103.
  • DMA Direct Memory Access
  • the packet transfer unit 102 includes a descriptor 1020 that is a data structure constructed by software executed by the processor of the packet processing device, and a DMA controller 1021 that is hardware.
  • FIG. 18 is a diagram for explaining the outline of the descriptor 1020.
  • the processor of the packet processing apparatus sets an address and a flag corresponding to each of the N packets in the descriptor 1020.
  • the processor presets in the descriptor 1020 the leading addresses A # 1 to A # N when writing the received packet to the packet memory 101.
  • the number of addresses that can be set simultaneously is determined in advance, and the order of addresses to be used is also determined.
  • the processor sets / resets the flags AF # 1 to AF # N indicating whether the set addresses A # 1 to A # N are valid or not to the descriptor 1020. After the addresses A # 1 to A # N are set, if the processor validates the flags AF # 1 to AF # N, the packet can be written to the packet memory 101.
  • the descriptor 1020 also includes reception completion flags WF # 1 to WF # N indicating whether or not writing of packets to the set addresses A # 1 to A # N is completed, and the set address A # 1.
  • the received data sizes L # 1 to L # N indicating the packet length of the packet that has been written to A # N are set.
  • FIG. 19 is a flowchart for explaining the operation of the DMA controller 1021.
  • the DMA controller 1021 determines whether or not the variable n is equal to N (step S106 in FIG. 19). If the variable n has not reached N (no in step S106), the DMA controller 1021 increases the variable n by 1 (step S107 in FIG. 19), and returns to step S101. If the variable n reaches N (yes in step S106), the DMA controller 1021 returns to step S100. In this way, N packets are transferred to the packet memory 101 in order.
  • the activated reception processing unit 103 delivers 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 supplement the packet memory transferred to the protocol processing unit 104.
  • the protocol processing unit 104 to which the received packet has been delivered releases the area of the packet memory 101 when necessary protocol processing is completed.
  • reception performance deteriorates due to the overhead associated with DMA transfer control because the number of times DMA transfer is started increases.
  • DMA transfer By using the DMA transfer method (hereinafter collectively DMA transfer) in which a plurality of small packets are transferred together in one combined packet, the number of hardware interrupts even when a small packet arrives at the packet processing device. And the overhead of DMA transfer can be reduced, so that high-speed reception processing can be performed.
  • DMA transfer method hereinafter collectively DMA transfer
  • FIG. 20 is a block diagram showing a configuration of a conventional packet processing device disclosed in Patent Document 1.
  • the packet processing apparatus 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 combining unit 106, and a combination threshold control. Part 107.
  • the packet combining unit 106 transfers the packet received by the line corresponding unit 100 to the packet combining reception buffer 105. At this time, the packet combining unit 106 combines the packet received in the line corresponding unit 100 and the packet already stored in the reception buffer 105 into one combined packet so that the packet is received in the reception buffer 105. Store. Then, when the size of the combined packet in the reception buffer 105 exceeds a 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 includes a descriptor 1020a and a DMA controller 1021a.
  • FIG. 21 is a diagram for explaining the outline of the descriptor 1020a. In the example of FIG. 21, a case where N combined packets are stored in the packet memory 101 is shown. In this case, the processor of the packet processing apparatus sets an address and a flag corresponding to each of the N combined packets in the descriptor 1020a.
  • the processor presets the leading addresses AD # 1 to AD # N when writing the combined packet into the packet memory 101 in the descriptor 1020a. Usually, the number of addresses that can be set simultaneously is determined in advance, and the order of addresses to be used is also determined.
  • the processor sets / resets the flags ADF # 1 to ADF # N indicating whether 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 also includes reception completion flags WDF # 1 to WDF # N indicating whether or not writing of the combined packet to the set addresses AD # 1 to AD # N is completed, and the set address A #.
  • Reception data sizes LD # 1 to LD # N indicating the length of the combined packet written to 1 to A # N (total packet length of the combined packet) are set.
  • FIG. 22 is a flowchart for explaining 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. 22). If the variable n has not reached N (no in step S206), the DMA controller 1021a increases the variable n by 1 (step S207 in FIG. 22), and returns to step S201. When the variable n reaches N (yes in step S206), the DMA controller 1021a returns to step S200. Thus, N combined packets are transferred to the packet memory 101 in order.
  • the activation request for the reception process is made each time a combined packet in which a plurality of packets are combined is transferred, so that the number of activations of the reception processing unit 103 is reduced, and the packet processing device The load on the processor is reduced.
  • the number of DMA transfer controls is reduced, the overhead ratio is reduced, and high reception performance can be exhibited.
  • the protocol processing unit 104 restores the combined packet to a plurality of original packets. If the restoration processing is to be realized by the hardware of the protocol processing unit 104, means for notifying the protocol processing unit 104 of information necessary for the restoration processing (number of combined packets, size for each packet) from the packet combining unit 106 is provided. Therefore, there is a problem that the scale of hardware such as the packet combining unit 106 is increased. Further, it is necessary to store 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 the information necessary for the restoration process (the number of combined packets and the size of each packet) is also stored in the packet combining unit 106 as described above. Therefore, there is a problem that a means for notifying the reception processing unit 103 is required, which increases the scale of hardware such as the packet combining unit 106.
  • restoration processing is performed by software, processing by software increases, and the load on the processor increases. As a result, there is a problem that improvement in reception performance by collective DMA transfer is suppressed.
  • FIG. 23 is a block diagram showing another configuration of the packet processing apparatus.
  • a combined packet separation unit 108 that restores a combined packet to 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.
  • the packet restoration processing is realized by the hardware of the protocol processing unit 104
  • the combined packet separation unit 108 is realized by hardware, information necessary for the restoration processing (number of combined packets, each packet A means for notifying the packet size from the packet combining unit 106 to the combined packet separating unit 108 is required, which causes a problem that the hardware size of the packet combining unit 106 and the like increases.
  • the combined packet separation unit 108 can be realized by software, the information necessary for the restoration process (the number of combined packets and the size of each packet) is received from the packet combining unit 106 in the same manner as described above. A means for notifying the separation unit 108 is required, which causes a problem that the scale of hardware such as the packet combining unit 106 increases. In addition, since restoration processing is performed by software, processing by software increases, and the load on the processor increases. As a result, there is a problem that improvement in reception performance by collective DMA transfer is suppressed.
  • FIG. 24 is a block diagram showing another configuration of the packet processing apparatus.
  • This packet processing device is provided with a combined packet writing unit 109 by software instead of the combined packet transfer unit 102a of the packet processing device of FIGS.
  • the effective throughput of writing to the packet memory 101 is improved (the packet memory 101 is Etc.).
  • the packet processing apparatus that performs batch writing also has the same problem as described above when restoring the combined packet to a plurality of original packets.
  • DB_mux is the maximum size of the combined packet
  • the maximum size DB_mux of the combined packet is a value obtained by adding the allowable maximum packet length to the threshold set in the combined threshold control unit 107. Therefore, for example, if the threshold is 500 bytes and the allowable maximum packet length is 2000 bytes, the size of the buffer area that needs to be secured in the packet memory 101 is N ⁇ 2500 bytes.
  • the size of the combined packet actually transferred to the packet memory 101 is 501 bytes to 2500 bytes, and there is a problem that a part of the secured area is wasted. For example, when the size of the combined packet is 501 bytes, 1999 bytes out of the buffer area secured in the packet memory 101 is wasted.
  • the present invention has been made to solve the above-described problems of the prior art, and an object of the present invention is to generate a combined packet in a packet processing apparatus using collective DMA transfer by hardware or collective writing by software. It is an object of the present invention to provide a technique capable of reducing the scale of hardware required for the process of restoring a plurality of packets and realizing high reception performance due to the effect of collective DMA transfer or collective writing. A further object of the present invention is to provide a technique capable of reducing the size of the buffer area for the combined packet that needs to be secured in the packet memory, as compared with the conventional configuration.
  • the packet processing device of the present invention includes a line corresponding unit that receives a packet from a communication line, a packet combining unit that generates a combined packet by connecting a plurality of packets received from the communication line, and a packet received from the communication line And a combined packet transfer unit that DMA-transfers the combined packet generated by the packet combining unit to the packet memory or writes it by a processor, and the combined packet transfer unit includes the combined packet
  • the address of the first data of each packet in the packet is determined on the packet memory, the address information is written to a descriptor which is a predetermined data area on the memory, and the combined packet is DMA transferred to the packet memory. Or written by the processor The one in which the features.
  • the combined packet transfer unit writes information of a received data size indicating a packet length of each packet in the combined packet into the descriptor. is there.
  • one configuration example of the packet processing device of the present invention further includes a processing unit that reads a packet stored in the packet memory, and the processing unit receives a packet from the packet memory based on information written in the descriptor. Is read and processed.
  • the packet processing method of the present invention includes a first step of generating a combined packet by concatenating a plurality of packets received from a communication line, and a processing unit for processing the packet received from the communication line A second step of determining the address on the packet memory of the head data of each packet in the combined packet, and the address information on the predetermined memory
  • the method includes a third step of writing into a descriptor which is a data area, and a fourth step of DMA transfer of the combined packet to the packet memory or writing by a processor.
  • the combined packet transfer unit DMA-transfers the combined packet generated by the packet combining unit to the packet memory or writes it by the processor, and the leading data of each packet in the combined packet is stored on the packet memory.
  • the address information is written into a descriptor which is a data area in a predetermined memory.
  • the packet processing apparatus including the combined packet transfer unit of the present invention hardware required for processing to restore a combined packet in which a plurality of packets are combined into the original plurality of packets, as compared with the configuration of the prior art. Can be reduced, and high reception performance can be realized by the effect of batch DMA transfer or batch write.
  • the combined packet transfer unit determines the address on the packet memory of the head data of each packet in the combined packet, and writes this address information to the descriptor, thereby comparing with the configuration of the prior art.
  • the size of the buffer area for the combined packet that needs to be secured in the packet memory can be reduced.
  • the configuration of the present invention includes a plurality of packets.
  • the process that restores the combined packet, which is a combination of multiple packets, to the original multiple packets is performed by hardware, the processing of the processor required for processing one packet is lightened, so the reception performance is improved (processing per unit time) The number of packets that can be increased). There is also an effect that the power consumption of the processor required for processing one packet is reduced.
  • FIG. 1 is a block diagram showing the configuration of the packet processing apparatus according to the first embodiment of the present invention.
  • FIG. 2 is a diagram for explaining the outline of the descriptor of the packet processing apparatus according to the first embodiment of the present invention.
  • FIG. 3 is a flowchart for explaining the operation of the transfer management unit of the packet processing apparatus according to the first embodiment of the present invention.
  • FIG. 4 is a flowchart for explaining the operation of the DMA controller of the packet processing apparatus according to the first embodiment of the present invention.
  • FIG. 5 is a flowchart for explaining the operation of the DMA controller of the packet processing apparatus according to the first embodiment of the present invention.
  • FIG. 6 is a flowchart for explaining the operation of the DMA controller of the packet processing apparatus according to the first embodiment of the present invention.
  • FIG. 1 is a block diagram showing the configuration of the packet processing apparatus according to the first embodiment of the present invention.
  • FIG. 2 is a diagram for explaining the outline of the descriptor of the packet processing apparatus according to the first
  • FIG. 7 is a flowchart for explaining the operation of the DMA controller of the packet processing apparatus according to the first embodiment of the present invention.
  • FIG. 8 is a flowchart for explaining the operation of the reception processing unit of the packet processing apparatus according to the first embodiment of the present invention.
  • FIG. 9 is a flowchart for explaining the operation of the DMA controller of the packet processing apparatus according to the first embodiment of the present invention.
  • FIG. 10 is a block diagram showing the configuration of the packet processing apparatus according to the second embodiment of the present invention.
  • FIG. 11 is a diagram for explaining the outline of the descriptor of the packet processing apparatus according to the second embodiment of the present invention.
  • FIG. 12 is a flowchart for explaining the operation of the combined packet transfer unit of the packet processing apparatus according to the second embodiment of the present invention.
  • FIG. 13 is a flowchart for explaining the operation of the combined packet transfer unit of the packet processing apparatus according to the second embodiment of the present invention.
  • FIG. 14 is a flowchart for explaining the operation of the combined packet transfer unit of the packet processing apparatus according to the second embodiment of the present invention.
  • FIG. 15 is a flowchart for explaining the operation of the combined packet transfer unit of the packet processing apparatus according to the second embodiment of the present invention.
  • FIG. 16 is a flowchart for explaining the operation of the combined packet transfer unit of the packet processing apparatus according to the second embodiment of the present invention.
  • FIG. 17 is a block diagram showing a configuration of a conventional packet processing apparatus.
  • FIG. 18 is a diagram for explaining the outline of the descriptor of the packet processing device of FIG. FIG.
  • FIG. 19 is a flowchart for explaining the operation of the DMA controller of the packet processing apparatus of FIG.
  • FIG. 20 is a block diagram showing another configuration of the conventional packet processing apparatus.
  • FIG. 21 is a diagram for explaining the outline of the descriptor of the packet processing device of FIG.
  • FIG. 22 is a flowchart for explaining the operation of the DMA controller of the packet processing apparatus of FIG.
  • FIG. 23 is a block diagram showing another configuration of the conventional packet processing apparatus.
  • FIG. 24 is a block diagram showing another configuration of the conventional packet processing apparatus.
  • FIG. 1 is a block diagram showing the configuration of the packet processing apparatus according to the first embodiment of the present invention.
  • the packet processing apparatus of FIG. 1 is connected to a communication line (not shown) and has a line corresponding unit 100 that receives data from the communication line and a packet that stores a packet received from the communication line, as in the configuration of FIG.
  • a memory 101 a reception processing unit 103 that passes a packet stored in the packet memory 101 to a protocol processing unit 104, a protocol processing unit 104 that performs packet protocol processing, a reception buffer 105 for packet combination, and a size of the combined packet
  • a combination threshold control unit 107 in which a threshold value for controlling the threshold is set in advance, a packet combination unit 110 that combines a plurality of packets received from the communication line in the reception buffer 105 to generate one combined packet, and a packet combination unit 110 DMA transfer of the combined packet generated by the above to the packet memory 101 And if the packet transfer unit 111, and a transfer management section 112. where the descriptor 1110 is a data area of the memory to a predetermined initial setting of the control register 113. Note that the transfer management
  • the line corresponding unit 100, the packet combining reception buffer 105, and the combination threshold control unit 107 are the same as those in FIG.
  • the packet combining unit 110 transfers the packet received by the line corresponding unit 100 to the reception buffer 105 for packet combination. At this time, the packet combining unit 110 concatenates the packet received in the line corresponding unit 100 and the packet already stored in the reception buffer 105 into one combined packet so that the packet is received in the reception buffer 105. Store. When the size of the combined packet in the reception buffer 105 exceeds the threshold set in the combined threshold control unit 107, the packet combining unit 110 issues a transfer request for the combined packet to the packet memory 101.
  • the packet combining unit 110 when a timeout (such as when the reception interval between packets exceeds a predetermined period) occurs before the size of the combined packet in the reception buffer 105 exceeds the threshold, A transfer request may be issued.
  • the packet combining unit 110 records the number of packets combined and the size of each packet in the reception buffer 105, and when issuing a transfer request for the combined packet, the packet combining unit 110 calculates the number of combined packets and the size of each packet.
  • the combined packet transfer unit 111 is notified.
  • the combined packet transfer unit 111 includes 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 an activation request for the reception processing unit 103. Note that a hardware interrupt to a processor (not shown) of the packet processing device may not be generated.
  • the combined packet transfer unit 111 is prepared for each packet by the transfer management unit 112 (software executed by the processor) using the information on the number of combined packets and the size of each packet notified from the packet combining unit 110.
  • the size and the like are written in the descriptor 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 receiving the activation request, the reception processing unit 103 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 it to the protocol processing unit 104. hand over.
  • the operation of the reception processing unit 103 is equivalent to the operation of the configuration in FIG.
  • the protocol processing unit 104 performs necessary protocol processing on the packet received from the reception processing unit 103. Then, when the necessary 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 in FIG.
  • reception processing unit 103 can be realized by software operating on a general-purpose personal computer or workstation, or an FPGA (Field Programmable) operating in cooperation with a program. It can also be realized by hardware such as (Gate Array).
  • the packet memory 101 can be configured as a personal computer, a communication device, or a memory on a communication board.
  • the line corresponding unit 100, the coupling threshold value control unit 107, and the packet coupling unit 110 can be configured by communication devices or FPGAs on a communication board.
  • the reception buffer 105 can be configured by a storage area of a communication device or an FPGA on 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 an address of the packet memory 101 for reception processing is called a descriptor 1110.
  • N packets are stored in the packet memory 101 is illustrated.
  • the descriptor 1110 in FIG. 2 includes the start addresses A # 1 to A # N to which the received packet is written and valid flags AF # 1 to AF # N indicating whether the start addresses A # 1 to A # N are valid.
  • Received data sizes L # 1 to L # N indicating the packet length of the received packet, and reception completion flags WF # 1 to WF # N indicating whether or not the reading of the packet from the packet memory 101 is completed. This is a data structure that can be written in plural (N sets).
  • the descriptor 1110 is actually arranged in a memory on a personal computer, a communication device, or a communication board, like the packet memory 101. Note that the descriptor 1110 can be arranged in the same memory as the packet memory 101, but in this case, which application is used can be classified by the address in the memory.
  • the processor of the packet processing apparatus determines the start addresses A # 1 to A # N of the write destination of the packet (or combined packet), writes them in the descriptors 1020 and 1020a, and further, the start addresses A # 1 to A #.
  • the valid flags AF # 1 to AF # N indicating whether N is valid are rewritten from “invalid” to “valid”.
  • the descriptors 1020 and 1020a have N sets of areas in which information of the head address and the like are written, but the order of writing (“validating”) is determined in advance. For example, in the example of FIG. 18, the processor writes the first head address A # 1, the second head address A # 2,..., And the Nth head address A # N in order.
  • the DMA controllers 1021 and 1021a check the valid flag AF # n of the descriptors 1020 and 1020a, and the valid flag AF # n indicates that the start address A # n is “valid” (FIG. 19 in step S102), the head address A # n is read from the descriptors 1020 and 1020a (step S103 in FIG. 19), and the corresponding nth packet (or combined packet) starts from the head address A # n of the packet memory 101. (Step S104 in FIG. 19).
  • the DMA controllers 1021 and 1021a write the received data size L # n indicating the packet length of the nth packet (or the length of the nth combined packet) to the descriptors 1020 and 1020a, and the descriptor 1020. , 1020a, the reception completion flag WF # n indicating that the writing of the nth packet (or combined packet) has been completed is rewritten from “incomplete” to “completed” (step S105 in FIG. 19).
  • the descriptors 1020 and 1020a have N (set) areas of the valid flags AF # 1 to AF # N, but the order in which the valid flags AF # 1 to AF # N are confirmed is determined in advance.
  • the DMA controllers 1021 and 1021a have the first valid flag AF # 1, the second valid flag AF # 2, ..., the Nth valid flag AF # N. Check in order. After the confirmation is completed, confirmation is performed again in order from the first valid flag AF # 1.
  • N sets of areas for writing received data sizes L # 1 to L # N and reception completion flags WF # 1 to WF # N are also prepared.
  • the DMA controllers 1021 and 1021a receive the received data size L # n and the received data size in the area of the number corresponding to the nth valid flag AF # n in which it is confirmed that the nth start address A # n is “valid”.
  • a completion flag WF # n is written.
  • the processor of the packet processing apparatus periodically checks the reception completion flag WF # n of the descriptors 1020 and 1020a. If the reception completion flag WF # n indicates “complete”, the corresponding n Using the information of the first head address A # n and the information of the received data size L # n, the nth packet (or combined packet) is read from the packet memory 101 and necessary processing (for example, protocol processing) is performed.
  • the processor rewrites the n-th valid flag AF # n of the descriptors 1020 and 1020a corresponding to the n-th packet (or combined packet) for which processing has been completed from “valid” to “invalid”, and the descriptor 1020,
  • the nth reception completion flag WF # n of 1020a is rewritten from “completed” to “incomplete”.
  • the descriptors 1020 and 1020a have N areas (sets) of reception completion flags WF # 1 to WF # N, but the order of confirming the reception completion flags WF # 1 to WF # N is determined in advance. For example, in the examples of FIG. 18 and FIG. 19, the processor is in order of the first reception completion flag WF # 1, the second reception completion flag WF # 2,..., The Nth reception completion flag WF # N. Check with. After the confirmation is completed, confirmation is performed again in order from the first reception completion flag WF # 1.
  • the DMA controllers 1021 and 1021a make an interrupt processing request to the processor after the completion of the DMA transfer, and instead of the processor periodically checking the reception completion flags WF # 1 to WF # N, the processor May receive reception completion flags WF # 1 to WF # N when receiving an interrupt processing request from the DMA controllers 1021 and 1021a.
  • FIG. 3 is a flowchart for explaining the operation of the transfer management unit 112
  • FIGS. 4 to 7 and FIG. 9 are flowcharts for explaining the operation of the DMA controller 1111
  • FIG. 8 is a flowchart for explaining the operation of the reception processing unit 103.
  • the transfer management unit 112 (software executed by the processor) secures a continuous area as a buffer area for the combined packet in the packet memory 101 as an initial setting of the packet processing device (step S300 in FIG. 3).
  • Information indicating the start address A0 and the capacity (size) C0 of the buffer area is written in the control register 113 (step S301 in FIG. 3).
  • the control register 113 is provided in the processor, for example.
  • control register 113 there is no problem with only one control register 113 (group), but a plurality of control registers 113 can be prepared.
  • the order in which packets are used for writing is determined in advance.
  • the control register 113 is set at the time of initial setting, and the setting change during operation is not performed.
  • the transfer management unit 112 sets all the valid flags AF # n indicating whether the head address A # n (n is 1 to N) is valid or not (invalid in FIG. 3). S302), all the reception completion flags WF # n indicating that the reading of the packet from the packet memory 101 is completed are set to “complete” (step S303 in FIG. 3).
  • the DMA controller 1111 in the combined packet transfer unit 111 receives the first address A0 and the capacity set by the transfer management unit 112 in the case of the first transfer request after the above initial setting.
  • (Size) C0 is read from the control register 113 (step S400 in FIG. 4).
  • the DMA controller 1111 sets the head address A0 read in step S400 as an initial value of the write pointer WP used for transferring the packet to the packet memory 101 (step S401 in FIG. 4). That is, in this embodiment, the address range of the writable buffer area in the packet memory 101 is calculated from the setting of the control register 113, and the writable buffer area is used as a ring buffer.
  • the DMA controller 1111 initializes a variable n indicating the reading and writing order of the descriptor 1110 to 1 (step S402 in FIG. 4).
  • the DMA controller 1111 may confirm the reception completion flags from WF # N and WF # 1 to WF # (k-1).
  • the DMA controller 1111 receives the reception completion flags from WF # n to WF # N and WF # 1 to WF # (k ⁇ 1 ⁇ (N ⁇ n)). You can confirm.
  • the DMA controller 1111 determines the remaining capacity CR and the packet in the buffer area for the combined packet in the packet memory 101.
  • the size CD of data to be transferred to the memory 101 is compared (step S405 in FIG. 4).
  • the size of the single packet is compared with the remaining capacity CR, and when the data to be transferred to the packet memory 101 is a combined packet, The size of the combined packet is compared with the remaining capacity CR.
  • the size CD of data to be transferred to the packet memory 101 is notified from the packet combining unit 110.
  • the DMA controller 1111 sets C0 ⁇ WP + RP as the remaining capacity CR when the write pointer WP> the read pointer RP, and sets RP ⁇ WP as the remaining capacity CR when the write pointer WP ⁇ the read pointer RP.
  • the descriptor 1110 is provided with N (sets) of reception completion flags WF # 1 to WF # N.
  • the order in which the reception completion flags WF # 1 to WF # N are confirmed is determined in advance. It has been decided.
  • the DMA controller 1111 receives the nth reception completion flag WF # n, the (n + 1) th reception completion flag WF # (n + 1),..., The Nth reception completion.
  • the flags are checked in order with the flag WF # N (step S404). After confirmation of the Nth reception completion flag WF # N, if confirmation for k groups has not been completed, confirmation is performed in order from the first reception completion flag WF # 1.
  • step S405 If the remaining capacity CR of the buffer area for the combined packet in the packet memory 101 is smaller than the data size CD to be transferred to the packet memory 101 (yes in step S405), the DMA controller 1111 returns to step S404. The state in which the remaining capacity CR of the buffer area is smaller than the data size CD is canceled when the remaining capacity CR of the buffer area is recovered by reading the packet from the packet memory 101 by software.
  • the DMA controller 1111 sets the size of the data to be transferred to the packet memory 101 to the write pointer WP.
  • the value obtained by adding CD (WP + CD) is compared with a predetermined upper limit value (step S406 in FIG. 5).
  • the upper limit value is a value (A0 + C0) obtained by adding the capacity C0 of the buffer area to the start address A0 of the buffer area in the packet memory 101.
  • the DMA controller 1111 receives information notified from the packet combining unit 110 (each combined Based on the packet size), received data sizes L # n to L # (n + k ⁇ 1) indicating the packet lengths of k packets constituting the data to be transferred to the packet memory 101 are written in the descriptor 1110 (FIG. 5 step S407).
  • the DMA controller 1111 “k ⁇ 1” start addresses A # (n + 1) to A # (n + k) in the descriptor 1110. ⁇ 1) is written according to the packet length of the first “k ⁇ 1” packets among the k packets constituting the combined packet (step S411 in FIG. 5).
  • the DMA controller 1111 and the start address A # n and the packet length of the first packet among the k packets constituting the combined packet (reception data size L A value obtained by adding the value indicated by #n) is written.
  • the DMA controller 1111 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 is written.
  • the DMA controller 1111 when writing the head address A # i, the DMA controller 1111 and the previous head address A # (i ⁇ 1) and the “i ⁇ 1” -th packet among the packets constituting the combined packet. A value obtained by adding the packet length may be written.
  • the DMA controller 1111 determines the received data size L # n, L # (n + 1) to L # N, L # 1 to L # (k ⁇ 1 ⁇ ( N ⁇ n)) is written in the descriptor 1110, and the start address A # n, A # (n + 1) to A # N, and A # 1 to A # (k ⁇ 1 ⁇ (N ⁇ n) The head address up to)) may be written to the descriptor 1110.
  • the DMA controller 1111 uses the write pointer WP as the start address of the transfer destination of the packet memory 101, and transfers the data (single packet or combined packet) to be transferred to the packet memory 101 to the start address of the transfer destination of the packet memory 101.
  • the DMA controller 1111 may add the received data size L # n and the received data size from L # 1 to L # (k ⁇ 1) to the write pointer WP.
  • the DMA controller 1111 determines the received data size L # n, L # (n + 1) to L # N, L # 1 to L # (k ⁇ 1 ⁇ ( The received data size up to (N ⁇ n)) may be added to the write pointer WP.
  • the DMA controller 1111 rewrites the reception completion flags WF # n to WF # (n + k ⁇ 1) corresponding to each packet constituting the data DMA-transferred to the packet memory 101 from “completed” to “incomplete” ( FIG. 6 step S414). Further, the DMA controller 1111 rewrites the valid flags AF # n to AF # (n + k ⁇ 1) corresponding to each packet constituting the data DMA-transferred to the packet memory 101 from “invalid” to “valid” (step in FIG. 6). S415).
  • the valid flag AF # n and the valid flags from AF # 1 to AF # (k ⁇ 1) may be rewritten from “invalid” to “valid”.
  • the DMA controller 1111 receives the reception completion flag WF # n, WF # (n + 1) to WF # N, WF # 1 to WF # (k ⁇ 1 ⁇ ( N ⁇ n)) is rewritten to “incomplete”, and the valid flag AF # n, AF # (n + 1) to AF # N, AF # 1 to AF # (k ⁇ 1 ⁇ ( The valid flags up to Nn)) may be rewritten to “valid”.
  • the DMA controller 1111 determines whether the value (WP + CD) obtained by adding the size CD of the data to be transferred to the packet memory 101 to the write pointer WP (WP + CD) is equal to or larger than the upper limit (A0 + C0) (no in step S406).
  • the DMA controller 1111 The CD is compared with the value (RP-A0) obtained by subtracting the start address A0 of the buffer area in the packet memory 101 from the read pointer RP (step S419 in FIG. 5).
  • the DMA controller 1111 determines the packet based on the information notified from the packet combining unit 110 (the size of each combined packet). Received data sizes L # n to L # (n + k ⁇ 1) indicating the packet lengths of k packets constituting the data to be transferred to the memory 101 are written in the descriptor 1110 (step S420 in FIG. 7).
  • step S422 If the data to be transferred to the packet memory 101 is a combined packet (yes in step S422), the DMA controller 1111 “k ⁇ 1” start addresses A # (n + 1) to A # (n + k) in the descriptor 1110. ⁇ 1) is written according to the packet length of the first “k ⁇ 1” packets among the k packets constituting the combined packet (step S424 in FIG. 7).
  • the DMA controller 1111 and the start address A # n and the packet length of the first packet among the k packets constituting the combined packet (reception data size L A value obtained by adding the value indicated by #n) is written.
  • the DMA controller 1111 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 is written.
  • the DMA controller 1111 when writing the head address A # i, the DMA controller 1111 and the previous head address A # (i ⁇ 1) and the “i ⁇ 1” -th packet among the packets constituting the combined packet. A value obtained by adding the packet length may be written.
  • the DMA controller 1111 determines the received data size L # n, L # (n + 1) to L # N, L # 1 to L # (k ⁇ 1 ⁇ ( N ⁇ n)) is written in the descriptor 1110, and the start address A # n, A # (n + 1) to A # N, and A # 1 to A # (k ⁇ 1 ⁇ (N ⁇ n) The head address up to)) may be written to the descriptor 1110.
  • the DMA controller 1111 performs DMA transfer in which data (a single packet or a combined packet) to be transferred to the packet memory 101 is written in a buffer area starting from the head address A0 of the packet memory 101 (step S425 in FIG. 7). That is, if “A0 + C0 ⁇ WP” is smaller than the size CD of the data to be transferred to the packet memory 101 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 is substituted. Then, DMA transfer is performed using the start address A0 of the packet memory 101 as the start address of the transfer destination.
  • the DMA controller 1111 adds a value obtained by adding the received data size L # n to L # (n + k ⁇ 1) to the head address A0, and newly sets the write pointer WP.
  • the value is
  • the DMA controller 1111 adds the value obtained by adding the received data size L # n and the received data size from L # 1 to L # (k ⁇ 1) to the head address A0, and the write pointer WP.
  • the new value may be used.
  • the DMA controller 1111 determines the received data size L # n, L # (n + 1) to L # N, L # 1 to L # (k ⁇ 1 ⁇ ( A value obtained by adding the received data size up to (N ⁇ n)) to the head address A0 may be a new value of the write pointer WP.
  • the DMA controller 1111 rewrites the reception completion flags WF # n to WF # (n + k ⁇ 1) corresponding to each packet constituting the data DMA-transferred to the packet memory 101 from “completed” to “incomplete” ( FIG. 7 step S427). Further, the DMA controller 1111 rewrites the valid flags AF # n to AF # (n + k ⁇ 1) corresponding to each packet constituting the data DMA-transferred to the packet memory 101 from “invalid” to “valid” (step in FIG. 7). S428).
  • the valid flag AF # n and the valid flags from AF # 1 to AF # (k ⁇ 1) may be rewritten from “invalid” to “valid”.
  • the DMA controller 1111 receives the reception completion flag WF # n, WF # (n + 1) to WF # N, WF # 1 to WF # (k ⁇ 1 ⁇ ( N ⁇ n)) is rewritten to “incomplete”, and the valid flag AF # n, AF # (n + 1) to AF # N, AF # 1 to AF # (k ⁇ 1 ⁇ ( The valid flags up to Nn)) may be rewritten to “valid”.
  • the combined packet in which k packets are concatenated is transferred to the packet memory 101, and the information of the head address of the descriptor 1110 is written by the DMA controller 1111.
  • the processor (reception processing unit 103 and protocol processing unit 104) is notified of the address at which the head of each packet is written.
  • the DMA controller 1111 also performs a read pointer RP update process corresponding to the following processing of the reception processing unit 103 and the like (software executed by the processor). Details of the read pointer RP update process will be described later.
  • the reception processing unit 103 (software executed by the processor) periodically checks the valid flag AF # n (n is 1 to N) of the descriptor 1110, and the valid flag AF # n indicates “valid” (Yes in step S501 in FIG. 8), the n-th packet is read from the packet memory 101 based on the information on the corresponding n-th head address A # n and the information on the received data size L # n, and is sent to the protocol processing unit 104. Pass (step S502 in FIG. 8).
  • the reception processing unit 103 (software executed by the processor) describes the descriptor 1110 corresponding to the nth packet for which the protocol processing has been completed.
  • the nth reception completion flag WF # n is rewritten from “incomplete” to “completed”, and the nth valid flag AF # n of the descriptor 1110 is rewritten from “valid” to “invalid” (step S504 in FIG. 8). .
  • the descriptor 1110 has N (set) areas of valid flags AF # 1 to AF # N, and the order of checking the valid flags AF # 1 to AF # N is determined in advance. For example, the reception processing unit 103 checks the first valid flag AF # 1, the second valid flag AF # 2,..., And the Nth valid flag AF # N in order. After the confirmation is completed, confirmation is performed again in order from the first valid flag AF # 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 103 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 1110.
  • the above-described operation of the processor is equivalent to the operation of the prior art processor (software) having the configuration shown in FIG. 17, and it is necessary to realize the processing for 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 in the past even when the combined packet is written in the packet memory 101 as in this embodiment.
  • step S440 the DMA controller 1111 sets the start address A0 of the buffer area for the combined packet in the packet memory 101 as the initial value of the read pointer RP (step S440 in FIG. 9).
  • the DMA controller 1111 initializes a variable n indicating the order of confirmation of the valid flag to 1 (step S441 in FIG. 9). Since the variable n and the variable n in FIGS. 4 to 7 have the same value, step S441 is the same process as step S402.
  • the DMA controller 1111 periodically checks the nth valid flag AF # n of the descriptor 1110 during the processing of FIGS. 4 to 7 (step S442 in FIG. 9).
  • the DMA controller 1111 detects that the valid flag AF # n indicates that the nth start address A # n is “valid” (yes in step S443 in FIG. 9), and then the nth start address.
  • the nth reception completion flag WF # n of the descriptor 1110 corresponding to A # n is confirmed (step S444 in FIG. 9).
  • the DMA controller 1111 determines the nth received 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 (step S446 in FIG. 9). If the valid flag AF # n has not been rewritten to “invalid” by software executed by the processor, the DMA controller 1111 updates to “invalid” (step S447 in FIG. 9).
  • the DMA controller 1111 determines whether or not the variable n is equal to N (step S448 in FIG. 9). If the variable n has not reached N (no in step S448), the DMA controller 1111 increases the variable n by 1 (step S449 in FIG. 9), and returns to step S442. If the variable n reaches N (yes in step S448), the DMA controller 1111 sets the variable n to 1 (step S450 in FIG. 9) and returns to step S442.
  • reception completion flag WF # n becomes “complete” due to the operation of the reception processing unit 103 in FIG.
  • the read pointer RP described above is used by the DMA controller 1111 to calculate the remaining capacity of the buffer area for the combined packet in the packet memory 101, and is assumed to be used at the time of reading by software. Not done.
  • the packet processing apparatus can implement the collective DMA transfer and writes means (DMA controller) for writing information for restoring the combined packet into a plurality of original packets. 1111) is included. Since the DMA controller 1111 can be implemented by hardware, it is not necessary to execute restoration processing software, and high reception performance can be realized due to the effect of the collective DMA transfer.
  • DMA controller collective DMA transfer and writes means
  • this embodiment also has an effect that the power consumption of the processor required for processing one packet is reduced.
  • N ⁇ DB_mux (DB_mux is the maximum size of the combined packet) in the packet memory 101 in advance by software. It is necessary to secure the buffer area of On the other hand, in the packet processing apparatus of the present embodiment, the DMA transfer can be normally performed with a smaller buffer area.
  • the size of the buffer area that needs to be secured in the packet memory 101 in the packet processing apparatus of the present embodiment does not depend on N, and is the maximum size DB_mux of the combined packet. That is, the size of the buffer area that needs to be secured in the packet memory 101 in the packet processing apparatus of this embodiment is 2500 bytes under the same conditions as described above.
  • the size of the buffer area can be reduced in this way because the function of waiting for DMA transfer until the remaining capacity CR reaches the required amount when the remaining capacity CR of the buffer area is small (step S405 in FIG. 4, step in FIG. 5). This is an effect of the implementation of S419).
  • the probability that the next DMA transfer is waited until the reading of the packet from the packet memory 101 by the software is completed becomes high.
  • the size of the combined packet actually transferred to the packet memory 101 is 501 bytes to 2500 bytes. That is, in the conventional configuration of FIG. 20 or the configuration of FIG. 23, when the size of each combined packet is S, an area obtained by adding (2500-S) for 10 combined packets is wasted. This indicates that if the average size S of the combined packets is 1500 bytes, an area of 10000 bytes out of 25000 bytes is wasted.
  • the size of the buffer area secured in the packet memory 101 in the packet processing apparatus of the present embodiment is the same as the size required in the conventional configuration of FIG. 20 or the configuration of FIG. 23, the conventional FIG. Compared to the configuration or the configuration shown in FIG. 23, the area that is wasted may be smaller, and a larger number of combined packets may be written to the buffer area of the same size.
  • the maximum number of combined packets to be written in the buffer area of the packet memory 101 and N of the descriptor 1110 can be determined independently.
  • the size of the buffer area is determined by the maximum number of combined packets to be written to the buffer area, and N may be the maximum number of packets to be written to the buffer area.
  • the maximum number of packets that can actually be written in the buffer area depends on the size of the packet to be stored and the size of the buffer area, the maximum number is N or smaller.
  • a means is required for notifying the necessary information (number of combined packets, size for each packet) from the packet combining unit 106 to the reception processing unit 103, the protocol processing unit 104, or the combined packet separation unit 108 in FIG.
  • 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. 23, there are a plurality of cases depending on the case until the reception processing is started after the DMA transfer is completed. It is necessary to consider that it is necessary to hold information necessary for the restoration process for the combined packets.
  • the combined packet restoration processing is completed when the DMA transfer of one combined packet is completed, and thus it is not necessary to hold information for a plurality of combined packets. . Therefore, the hardware scale of this embodiment is smaller than when the restoration processing is realized by hardware of the reception processing unit 103, the protocol processing unit 104, or the combined packet separation unit 108 of FIG.
  • the combined packet transfer unit 111 is realized by hardware.
  • 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 process. It is also possible.
  • the reception processing unit 103 or the protocol processing unit 104 does not need to perform processing for restoring the combined packet to a plurality of original packets. Therefore, it is possible to realize high reception performance due to the effect of the collective DMA transfer.
  • the combined packet transfer unit 111 is realized by software, as in the case where the combined packet transfer unit 111 is realized by hardware, the combined packet is restored to a plurality of original packets.
  • the packet combining unit 110 may determine the packet type and collect the same type of packet as a combined packet, or may use a plurality of DMA controllers 1111 and a plurality of descriptors 1110 depending on the packet type. Also 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 selectively used according to the packet type, different reception processing can be performed for each packet type. It becomes easy.
  • a plurality of DMA controllers 1111 and a plurality of descriptors 1110 may be used separately for each core of a processor incorporating a plurality of CPU cores.
  • the descriptor 1110 may be used properly.
  • the capacity from the current write pointer WP to the address that cannot be written is the transfer data (combined data). If the packet size is smaller than the size CD of the packet or the combined packet), the value of the write pointer WP may be jumped to an address area having a capacity larger than the size CD of the transfer data and used for writing.
  • FIG. 10 is a block diagram showing the configuration of the packet processing apparatus according to the second embodiment of the present invention.
  • the packet processing apparatus in FIG. 10 includes a line correspondence unit 100, a packet memory 101, a reception processing unit 103, a protocol processing unit 104, a reception buffer 105, a combination threshold control unit 107, a packet combination unit 110, and a transfer.
  • the management unit 112, the combined packet transfer unit 114, the control register 113, and the descriptor 1130 are configured.
  • the difference between the configuration of FIG. 10 and the configuration of FIG. 1 is that the transfer means in FIG. 1 is replaced with a writing means by a processor (software) of the packet processing device. That is, in this embodiment, the combined packet transfer unit 111 in FIG. 1 is replaced with a combined packet transfer unit 114 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 value control unit 107, the transfer management unit 112, and the control register 113 are the same as those in FIG.
  • the packet combining unit 110 combines the packet received by the line corresponding unit 100 and the packet already stored in the reception buffer 105 into one combined packet so that the packet is received in the reception buffer 105. Store.
  • the packet combining unit 110 issues a transfer request for the combined packet to the packet memory 101.
  • the packet combining unit 110 transfers the packet when the size of the combined packet in the reception buffer 105 exceeds the threshold value when a timeout (such as when the interval between packets exceeds a predetermined period) occurs. A request may be issued. Further, the packet combining unit 110 records the number of packets combined in the reception buffer 105 and the size of each packet, and when issuing a transfer request for the combined packet, information on the number of combined packets and the size of each packet. To the combined packet transfer unit 114.
  • the combined packet transfer unit 114 (software executed by the processor) writes the combined packet, in which a plurality of packets are combined, to the packet memory 101, and makes a start request for the reception processing unit 103. Further, the combined packet transfer unit 114 writes information such as the size in the descriptor 1130 prepared for each packet, using the information on the number of combined packets and the size of each packet notified from the packet combining unit 110.
  • the configuration of the descriptor 1130 is the same as the configuration of the descriptor 1110 of the first embodiment. However, in this embodiment, there is a difference that the combined packet transfer unit 114 (software executed by the processor) writes to the descriptor 1130 instead of the combined packet transfer unit 111.
  • 12 to 16 are flowcharts for explaining the operation of the combined packet transfer unit 114 (software executed by the processor).
  • the combined packet transfer unit 114 controls the head address A0 and the capacity (size) C0 set by the transfer management unit 112 in the case of the first transfer request after the initial setting. Read out from the register 113 (step S600 in FIG. 12). Then, the combined packet transfer unit 114 sets the start address A0 as the initial value of the write pointer WP (step S601 in FIG. 12).
  • the combined packet transfer unit 114 performs the processing of steps S602 to S606 equivalent to steps S402 to S406.
  • 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 S606 in FIG. 13)
  • the combined packet transfer unit 114 receives information notified from the packet combining unit 110 Based on (the size of each combined packet), received data sizes L # n to L # (n + k ⁇ 1) indicating the packet lengths of k packets constituting the data to be transferred to the packet memory 101 are set as the descriptor 1130. (Step S607 in FIG. 13).
  • the processing in steps S608 to S611 in FIG. 13 is equivalent to the processing in steps S408 to S411 in FIG.
  • the combined packet transfer unit 114 uses the write pointer WP as the start address of the transfer destination of the packet memory 101 to transfer data (single packet or combined packet) to the packet memory 101 to the transfer destination of the packet memory 101. Write to the buffer area starting from the top address (step S612 in FIG. 14).
  • steps S613 to S618 in FIG. 14 is equivalent to the processing in steps S413 to S418 in FIG.
  • the combined packet transfer unit 114 returns to step S603 after the process of step S617 or S618.
  • the combined packet transfer unit 114 has a value (WP + CD) obtained by adding the size CD of data to be transferred to the packet memory 101 to the write pointer WP equal to or greater than the upper limit value (A0 + C0) (no in step S606 in FIG. 13).
  • the data size CD is compared with the value (RP-A0) obtained by subtracting the start address A0 of the buffer area in the packet memory 101 from the read pointer RP (step S619 in FIG. 13).
  • the combined packet transfer unit 114 is based on the information notified from the packet combining unit 110 (the size of each combined packet). Then, received data sizes L # n to L # (n + k ⁇ 1) indicating the packet lengths of k packets constituting the data to be transferred to the packet memory 101 are written in the descriptor 1130 (step S620 in FIG. 15).
  • the processing in steps S621 to S624 in FIG. 15 is equivalent to the processing in steps S421 to S424 in FIG.
  • the combined packet transfer unit 114 writes the data to be transferred to the packet memory 101 (single packet or combined packet) in the buffer area starting from the head address A0 of the packet memory 101 (step S625 in FIG. 15).
  • steps S626 to S631 in FIG. 15 is equivalent to the processing in steps S426 to S431 in FIG.
  • the combined packet transfer unit 114 returns to step S603 after the process of step S630 or S631.
  • the combined packet transfer unit 114 sets the start address A0 of the buffer area for the combined packet in the packet memory 101 as the initial value of the read pointer RP (step S640 in FIG. 9). Also, the combined packet transfer unit 114 initializes a variable n indicating the confirmation order of the valid flag to 1 (step S641 in FIG. 9). Since the variable n and the variable n in FIGS. 12 to 15 have the same value, step S641 is the same process as step S602. The processing in steps S642 to S650 in FIG. 16 is equivalent to the processing in steps S442 to S450 in FIG.
  • the packet processing apparatus of this embodiment includes means (combined packet transfer unit 114) that can implement batch writing and writes information for restoring the combined packet into a plurality of original packets in the descriptor 1130. ing. According to the present embodiment, it is possible to eliminate the execution of the restoration processing by the reception processing unit 103, the protocol processing unit 104, or the combined packet separation unit 108 of FIG. 23, and high reception due to the effect of batch writing. Performance can be realized.
  • the size of the buffer area secured in the packet memory 101 in the packet processing apparatus of the present embodiment is set to the same size as that required in the conventional configuration of FIG. 24, the amount of area that is wasted is compared.
  • the size of the combined packet actually transferred to the packet memory 101 is 501 bytes to 2500 bytes. That is, in the conventional configuration of FIG. 24, assuming that the size of each combined packet is S, the area obtained by adding (2500-S) for 10 combined packets is wasted. This indicates that if the average of the combined packet size S is 1500 bytes, an area of 10000 bytes out of 25000 bytes is wasted.
  • the size of the buffer area secured in the packet memory 101 in the packet processing apparatus of this embodiment is the same as the size required in the conventional configuration of FIG. 24, it is more wasteful than the configuration of the conventional FIG. In some cases, it becomes possible to write a larger number of combined packets in a buffer area of the same size.
  • the combined packet transfer unit 114 writes the information (head address, received data size, reception completion flag) of the descriptor 1130 so that the restoration process is unnecessary.
  • the restoration processing is to be realized by the reception processing unit 103, the protocol processing unit 104, or the combined packet separation unit 108 in FIG. 24, information necessary for the restoration processing (number of combined packets, size for each packet) is stored 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 in FIG. 24 from 106 is required.
  • the restoration processing is to be realized by the reception processing unit 103, the protocol processing unit 104, or the combined packet separation unit 108 in FIG. 24, a plurality of combined packets may be required until the reception processing is started after completion of the batch writing. It must be taken into account that information necessary for the restoration process of minutes must be retained.
  • the combined packet restoration process is completed when the combined writing of one combined packet is completed, and thus it is not necessary to hold information for a plurality of combined packets. . Therefore, the hardware scale of this embodiment is smaller than when the restoration processing is realized by the reception processing unit 103, the protocol processing unit 104, or the combined packet separation unit 108 of FIG. This is the same even when the process of restoring the combined packet to a plurality of original packets is implemented by software.
  • a processor or a virtual machine that performs processing for writing to the packet memory 101 and reception processing including restoration processing are different. Etc.), it is necessary to hold information necessary for restoration processing for a plurality of combined packets until reception processing is started after writing to the packet memory 101 is completed. It is necessary to store information (number of combined packets, size for each packet) necessary for restoration processing of combined packets in the packet memory 101 or the like.
  • the writing process to the packet memory 101 and the receiving process not including the restoration process are performed.
  • information for multiple combined packets (combined) can be obtained by implementing the write processing and restoration processing to the packet memory 101 on the same processor (or virtual machine, etc.).
  • Numberer of packets, size for each packet does not need to be stored, that is, information necessary for restoration processing of only one combined packet (number of combined packets, size for each packet) is stored in the packet memory 101 or the like Just do it.
  • the configuration of this embodiment has a capacity (writeable) such as the packet memory 101 used for holding information (number of combined packets, size for each packet) necessary for restoration processing, compared to the configuration of FIG. Therefore, the required hardware scale can be reduced.
  • information necessary for the restoration processing is stored in the packet memory 101. It is also possible to write. However, in this case, part of the bandwidth of the bus used for batch writing is occupied by information necessary for restoration processing, so the effective bandwidth that can be used for writing original packet data is reduced. As a result, the performance of batch writing deteriorates.
  • the information necessary for the restoration process is not the packet memory 101 but another memory that does not use the bus to which the packet memory 101 is connected (writing from the packet combining unit 110 and combined packet transfer). It is sufficient that only reading from the unit 114 is possible), and the effective band is not deteriorated as described above.
  • the packet combining unit 110 may determine the packet type and collect the same type of packets as a combined packet.
  • the descriptor 1130 may be selectively used. If a descriptor 1130 is prepared for each packet type and a plurality of descriptors 1130 are used depending on the packet type, it is easy to perform different reception processing for each packet type.
  • a configuration may be used in which a plurality of descriptors 1130 are used for each core of a processor incorporating a plurality of CPU cores, or a configuration in which a plurality of descriptors 1130 are used for each virtual machine.
  • the packet memory 101, the transfer management unit 112, the reception processing unit 103, the protocol processing unit 104, and the combined packet transfer unit 114 include a processor, a storage device, and an interface. It can be realized by a computer and a program for controlling these hardware resources.
  • a program for realizing the packet processing method of the present invention is stored in a storage device.
  • the processor executes the processing described in the first and second embodiments according to the program stored in the storage device. Further, as described above, a part of the process of the combined packet transfer unit 111 can be realized by a computer.
  • the present invention can be applied to a technique for performing protocol processing or transfer processing of communication data.
  • DESCRIPTION OF SYMBOLS 100 ... Line corresponding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Computer Hardware Design (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Multimedia (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)
  • Bus Control (AREA)

Abstract

結合パケットを元の複数のパケットに復元する処理に必要となるハードウェアの規模を小さくし、かつ高い受信性能を実現する。 パケット処理装置は、通信回線からパケットを受信する回線対応部100と、通信回線から受信した複数のパケットを連結して結合パケットを生成するパケット結合部110と、通信回線から受信したパケットが格納されるパケットメモリ101と、パケット結合部110によって生成された結合パケットをパケットメモリ101にDMA転送する結合パケット転送部111とを備える。結合パケット転送部111は、結合パケット内の各パケットの先頭データの、パケットメモリ101上におけるアドレスを決定し、このアドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタ1110に書き込み、結合パケットをパケットメモリ101にDMA転送する。

Description

パケット処理装置およびパケット処理方法
 本発明は、パケット処理装置およびパケット処理方法に係り、特に、通信システムの中で、パケットデータの転送処理を行うパケット処理装置およびパケット処理方法に関するものである。
 図17は従来のパケット処理装置の構成を示すブロック図である。パケット処理装置は、通信回線からパケットを受信する回線対応部100と、通信回線から受信したパケットが格納されるパケットメモリ101と、通信回線から受信したパケットをパケットメモリ101に転送するパケット転送部102と、パケットメモリ101からパケットを読み出す受信処理部103と、パケットに対してプロトコル処理を行うプロトコル処理部104とを備えている。
 このパケット処理装置では、通信回線(不図示)と接続された回線対応部100へのパケットの到着を契機として、パケット転送部102がDMA(Direct Memory Access)を用いたデータ転送を行い、到着したパケットをパケットメモリ101に格納する。同時に、パケット転送部102は、パケットを受信したことをパケット処理装置のプロセッサ(不図示)に通知するためにハードウェア割り込みを発生させ、受信処理部103の起動要求を行う。
 パケット転送部102は、パケット処理装置のプロセッサが実行するソフトウェアによって構築されるデータ構造体であるディスクリプタ1020と、ハードウェアであるDMAコントローラ1021とから構成される。図18はディスクリプタ1020の概要を説明する図である。
 図18の例では、パケットメモリ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とが設定される。
 図19はDMAコントローラ1021の動作を説明するフローチャートである。最初に、DMAコントローラ1021は、ディスクリプタ1020の読出および書込の順を示す変数nを1に初期化し(図19ステップS100)、n=1番目のフラグAF#1をディスクリプタ1020から読み出す(図19ステップS101)。
 DMAコントローラ1021は、先頭アドレスが有効であることをフラグAF#1が示している場合(図19ステップS102においてyes)、n=1番目の先頭アドレスA#1をディスクリプタ1020から読み出し(図19ステップS103)、対応するn=1番目のパケットをパケットメモリ101の先頭アドレスA#1から始まる領域に書き込む(図19ステップS104)。
 パケットの書き込み完了後、DMAコントローラ1021は、n=1番目のパケットのパケット長を示す受信データサイズL#1と、パケットの書き込みが完了したことを示す受信完了フラグWF#1とをディスクリプタ1020に書き込む(図19ステップS105)。
 また、パケットの書き込みが完了したことをパケット処理装置のプロセッサ(不図示)に通知するためにハードウェア割り込みを発生させ、受信処理部103の起動要求を行う。
 そして、DMAコントローラ1021は、変数nがNと等しいかどうかを判定する(図19ステップS106)。DMAコントローラ1021は、変数nがNに達していない場合(ステップS106においてno)、変数nを1増やし(図19ステップ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転送のオーバーヘッドを削減することができるので、高速な受信処理を行うことができる。
 図20は特許文献1に開示された従来のパケット処理装置の構成を示すブロック図である。このパケット処理装置は、回線対応部100と、パケットメモリ101と、結合パケット転送部102aと、受信処理部103と、プロトコル処理部104と、受信バッファ105と、パケット結合部106と、結合閾値制御部107とを備えている。
 図20に示したパケット処理装置では、パケット結合部106は、回線対応部100において受信されたパケットをパケット結合用の受信バッファ105に転送する。このとき、パケット結合部106は、回線対応部100において受信されたパケットと受信バッファ105中に既に格納されているパケットとが結合され、1つの結合パケットになるように、パケットを受信バッファ105に格納する。そして、パケット結合部106は、受信バッファ105中の結合パケットの大きさが、結合閾値制御部107にあらかじめ設定された閾値を超えると、結合パケットのパケットメモリ101への転送要求を発行する。
 図17の場合と同様に、結合パケット転送部102aは、ディスクリプタ1020aと、DMAコントローラ1021aとから構成される。図21はディスクリプタ1020aの概要を説明する図である。図21の例では、パケットメモリ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とが設定される。
 図22はDMAコントローラ1021aの動作を説明するフローチャートである。最初に、DMAコントローラ1021aは、ディスクリプタ1020aの読出および書込の順を示す変数nを1に初期化し(図22ステップS200)、n=1番目のフラグADF#1をディスクリプタ1020aから読み出す(図22ステップS201)。
 DMAコントローラ1021aは、先頭アドレスが有効であることをフラグADF#1が示している場合(図22ステップS202においてyes)、n=1番目の先頭アドレスAD#1をディスクリプタ1020aから読み出し(図22ステップS203)、対応するn=1番目の結合パケットをパケットメモリ101の先頭アドレスAD#1から始まる領域に書き込む(図22ステップS204)。
 結合パケットの書き込み完了後、DMAコントローラ1021aは、n=1番目の結合パケットの長さを示す受信データサイズLD#1と、結合パケットの書き込みが完了したことを示す受信完了フラグWDF#1とをディスクリプタ1020aに書き込む(図22ステップS205)。
 また、結合パケットの書き込みが完了したことをパケット処理装置のプロセッサ(不図示)に通知するためにハードウェア割り込みを発生させ、受信処理部103の起動要求を行う。
 そして、DMAコントローラ1021aは、変数nがNと等しいかどうかを判定する(図22ステップS206)。DMAコントローラ1021aは、変数nがNに達していない場合(ステップS206においてno)、変数nを1増やし(図22ステップS207)、ステップS201に戻る。また、DMAコントローラ1021aは、変数nがNに達した場合(ステップS206においてyes)、ステップS200に戻る。こうして、N個の結合パケットが順番にパケットメモリ101に転送される。
 結合パケット転送部102a(DMAコントローラ1021a)からの起動要求に応じて起動した受信処理部103は、パケットメモリ101に転送された結合パケットをプロトコル処理部104へと渡す。
 図20に示した構成によって、受信処理の起動要求が、複数のパケットが結合した結合パケットが転送される度に行われるようになるため、受信処理部103の起動回数が減少し、パケット処理装置のプロセッサの負荷が軽減される。また、DMA転送制御の回数も減少するためにオーバーヘッドの割合が低くなり、高い受信性能を発揮することが可能となる。
 ただし、図20に示した構成では、結合パケットをプロトコル処理部104において元の複数のパケットに復元する必要がある。この復元処理をプロトコル処理部104のハードウェアで実現しようとすると、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケット結合部106からプロトコル処理部104に通知する手段が必要となり、そのためにパケット結合部106等のハードウェアの規模が大きくなるという課題がある。また、復元処理に必要な情報をパケットメモリ101等に保持しておく必要がある。
 また、復元処理を受信処理部103等のソフトウェアで実現することも可能であるが、上記と同様に、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケット結合部106から受信処理部103に通知する手段が必要となり、そのためにパケット結合部106等のハードウェアの規模が大きくなるという課題がある。また、ソフトウェアで復元処理を行うため、ソフトウェアによる処理が増加し、プロセッサの負荷が上がり、その結果として、纏めDMA転送による受信性能の向上が抑制されるという課題もある。
 図23はパケット処理装置の別の構成を示すブロック図である。このパケット処理装置は、図20のパケット処理装置の受信処理部103とプロトコル処理部104との間に、結合パケットを元の複数のパケットに復元する結合パケット分離部108を挿入したものである。
 パケットの復元処理をプロトコル処理部104のハードウェアで実現する場合と同様に、結合パケット分離部108をハードウェアで実現しようとすると、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケット結合部106から結合パケット分離部108まで通知する手段が必要となり、そのためにパケット結合部106等のハードウェアの規模が大きくなるという課題がある。
 また、結合パケット分離部108をソフトウェアで実現することも可能であるが、上記と同様に、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケット結合部106から結合パケット分離部108に通知する手段が必要となり、そのためにパケット結合部106等のハードウェアの規模が大きくなるという課題がある。また、ソフトウェアで復元処理を行うため、ソフトウェアによる処理が増加し、プロセッサの負荷が上がり、その結果として、纏めDMA転送による受信性能の向上が抑制されるという課題もある。
 図24はパケット処理装置の別の構成を示すブロック図である。このパケット処理装置は、図20、図23のパケット処理装置の結合パケット転送部102aの代わりに、ソフトウェアによる結合パケット書き込み部109を設けたものである。DMA転送を用いないパケット処理装置においても、ソフトウェアにより複数のパケットを纏めてパケットメモリ101に書き込むこと(以降、纏め書き込み)によりパケットメモリ101への書き込みの実効スループットが向上する場合(パケットメモリ101がDRAMで構成されている場合等)がある。このように、纏め書き込みを行うパケット処理装置においても、結合パケットを元の複数のパケットに復元する際に上記と同様の問題がある。
 また、図24の処理の全て(パケットメモリ101内と回線対応部100内のハードウェア処理を除く)をソフトウェアで行う場合、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケットメモリ101等に保存する必要があり、纏め書き込みを行わない場合と比較して、パケットメモリ101等の容量(書き込み可能なビット数)を大きくする必要があるという課題が有る。
 また、図20、図23、もしくは図24の構成では、パケットメモリ101内に、N×DB_mux(DB_muxは結合パケットの最大サイズ)のバッファ領域を確保しておく必要がある。この結合パケットの最大サイズDB_muxは、結合閾値制御部107に設定される閾値に許容最大パケット長を足した値となる。したがって、例えば閾値を500Byte、許容最大パケット長を2000Byteとすると、パケットメモリ101内に確保が必要なバッファ領域のサイズは、N×2500Byteとなる。
 しかし、実際にパケットメモリ101に転送される結合パケットのサイズは501Byte~2500Byteとなり、確保した領域の一部が無駄になるという課題がある。例えば、結合パケットのサイズが501Byteの場合、パケットメモリ101に確保したバッファ領域の内、1999Byte分が無駄になる。
特許第4468332号公報
 本発明は、前記従来技術の問題点を解決するためになされたものであり、本発明の目的は、ハードウェアによる纏めDMA転送、もしくはソフトウェアによる纏め書き込みを用いるパケット処理装置において、結合パケットを元の複数のパケットに復元する処理に必要となるハードウェアの規模を小さくし、かつ纏めDMA転送もしくは纏め書き込みの効果による高い受信性能を実現することが可能となる技術を提供することにある。
 本発明のさらなる目的は、従来の構成と比較して、パケットメモリ内に確保が必要な結合パケット用のバッファ領域のサイズを小さくすることが可能となる技術を提供することにある。
 本発明のパケット処理装置は、通信回線からパケットを受信する回線対応部と、前記通信回線から受信した複数のパケットを連結して結合パケットを生成するパケット結合部と、前記通信回線から受信したパケットが格納されるパケットメモリと、前記パケット結合部によって生成された結合パケットを前記パケットメモリにDMA転送するか、またはプロセッサによって書き込む結合パケット転送部とを備え、前記結合パケット転送部は、前記結合パケット内の各パケットの先頭データの、前記パケットメモリ上におけるアドレスを決定し、このアドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタに書き込み、前記結合パケットを前記パケットメモリにDMA転送するか、またはプロセッサによって書き込むことを特徴とするものである。
 また、本発明のパケット処理装置の1構成例において、前記結合パケット転送部は、前記結合パケット内の各パケットのパケット長を示す受信データサイズの情報を前記ディスクリプタに書き込むことを特徴とするものである。
 また、本発明のパケット処理装置の1構成例は、前記パケットメモリに格納されたパケットを読み出す処理部をさらに備え、前記処理部は、前記ディスクリプタに書き込まれた情報に基づいて前記パケットメモリからパケットを読み出して処理を施すことを特徴とするものである。
 また、本発明のパケット処理方法は、通信回線から受信した複数のパケットを連結して結合パケットを生成する第1のステップと、前記通信回線から受信したパケットに対して処理を施す処理部がパケットの読み出しを行うパケットメモリに対して、前記結合パケット内の各パケットの先頭データの、前記パケットメモリ上におけるアドレスを決定する第2のステップと、前記アドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタに書き込む第3のステップと、前記結合パケットを前記パケットメモリにDMA転送するか、またはプロセッサによって書き込む第4のステップとを含むことを特徴とするものである。
 本発明によれば、結合パケット転送部は、パケット結合部によって生成された結合パケットをパケットメモリにDMA転送するか、またはプロセッサによって書き込み、結合パケット内の各パケットの先頭データの、パケットメモリ上におけるアドレスの情報を、予め定められたメモリ上のデータ領域であるディスクリプタに書き込む。本発明の結合パケット転送部を備えたパケット処理装置によれば、従来技術の構成と比較して、複数のパケットが結合した結合パケットを元の複数のパケットに復元する処理に必要となるハードウェアの規模を小さくすることができ、かつ纏めDMA転送もしくは纏め書き込みの効果による高い受信性能を実現することが可能となる。また、本発明では、結合パケット転送部が、結合パケット内の各パケットの先頭データの、パケットメモリ上におけるアドレスを決定し、このアドレスの情報をディスクリプタに書き込むことにより、従来技術の構成と比較して、パケットメモリ内に確保が必要な結合パケット用のバッファ領域のサイズを小さくすることができる。
 なお、従来の図20の構成、もしくは図23の構成で、複数のパケットが結合した結合パケットを元の複数のパケットに復元する処理をソフトウェアで実現する場合と比較すると、本発明の構成で複数のパケットが結合した結合パケットを元の複数のパケットに復元する処理をハードウェアで行う場合、1パケットの処理に必要となるプロセッサの処理が軽くなるため、受信性能が向上する(単位時間に処理できるパケットの数が増加する)という効果がある。また、1パケットの処理に必要となるプロセッサの消費電力が小さくなるという効果もある。
図1は、本発明の第1の実施例に係るパケット処理装置の構成を示すブロック図である。 図2は、本発明の第1の実施例に係るパケット処理装置のディスクリプタの概要を説明する図である。 図3は、本発明の第1の実施例に係るパケット処理装置の転送管理部の動作を説明するフローチャートである。 図4は、本発明の第1の実施例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図5は、本発明の第1の実施例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図6は、本発明の第1の実施例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図7は、本発明の第1の実施例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図8は、本発明の第1の実施例に係るパケット処理装置の受信処理部の動作を説明するフローチャートである。 図9は、本発明の第1の実施例に係るパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図10は、本発明の第2の実施例に係るパケット処理装置の構成を示すブロック図である。 図11は、本発明の第2の実施例に係るパケット処理装置のディスクリプタの概要を説明する図である。 図12は、本発明の第2の実施例に係るパケット処理装置の結合パケット転送部の動作を説明するフローチャートである。 図13は、本発明の第2の実施例に係るパケット処理装置の結合パケット転送部の動作を説明するフローチャートである。 図14は、本発明の第2の実施例に係るパケット処理装置の結合パケット転送部の動作を説明するフローチャートである。 図15は、本発明の第2の実施例に係るパケット処理装置の結合パケット転送部の動作を説明するフローチャートである。 図16は、本発明の第2の実施例に係るパケット処理装置の結合パケット転送部の動作を説明するフローチャートである。 図17は、従来のパケット処理装置の構成を示すブロック図である。 図18は、図17のパケット処理装置のディスクリプタの概要を説明する図である。 図19は、図17のパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図20は、従来のパケット処理装置の別の構成を示すブロック図である。 図21は、図20のパケット処理装置のディスクリプタの概要を説明する図である。 図22は、図20のパケット処理装置のDMAコントローラの動作を説明するフローチャートである。 図23は、従来のパケット処理装置の別の構成を示すブロック図である。 図24は、従来のパケット処理装置の別の構成を示すブロック図である。
[第1の実施例]
 以下、図面を参照して本発明の実施例を詳細に説明する。なお、実施例を説明するための全図において、同一機能を有するものは同一符号を付け、その繰り返しの説明は省略する。図1は、本発明の第1の実施例に係るパケット処理装置の構成を示すブロック図である。
 図1のパケット処理装置は、図20の構成と同様に、通信回線(不図示)と接続され、通信回線からデータを受信する回線対応部100と、通信回線から受信したパケットが格納されるパケットメモリ101と、パケットメモリ101に格納されたパケットをプロトコル処理部104へ渡す受信処理部103と、パケットのプロトコル処理を行うプロトコル処理部104と、パケット結合用の受信バッファ105と、結合パケットの大きさを規制する閾値があらかじめ設定された結合閾値制御部107と、通信回線から受信した複数のパケットを受信バッファ105において連結して1つの結合パケットを生成するパケット結合部110と、パケット結合部110によって生成された結合パケットをパケットメモリ101にDMA転送する結合パケット転送部111と、予め定められたメモリ上のデータ領域であるディスクリプタ1110と制御用レジスタ113の初期設定を行う転送管理部112とから構成される。なお、転送管理部112については、受信処理部103の一部として構成しても良い。
 このうち、回線対応部100とパケット結合用の受信バッファ105と結合閾値制御部107とは、図20の構成と同等である。
 パケット結合部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の動作は、図17の構成の動作と同等である。
 プロトコル処理部104は、受信処理部103から受け取ったパケットに対して必要なプロトコル処理を行う。そして、プロトコル処理部104は、必要なプロトコル処理が終了すると、受信処理部103から渡されたパケットが格納されていたパケットメモリ101の領域を解放する。このプロトコル処理部104の動作は、図17の構成の動作と同等である。
 なお、必要なプロトコル処理が終了し、受信処理部103から渡されたパケットが格納されていたパケットメモリ101の領域が開放されたことをもって、後述する図8の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と、受信したパケットのパケット長を示す受信データサイズL#1~L#Nと、パケットメモリ101からのパケットの読み出しが完了したか否かを示す受信完了フラグWF#1~WF#Nとを、複数(N組)書き込み可能なデータ構造体となっている。
 ディスクリプタ1110は、実体としては、パケットメモリ101と同様に、パーソナルコンピュータ、通信機器あるいは通信ボード上のメモリ内に配置される。
 なお、ディスクリプタ1110をパケットメモリ101と同じメモリ内に配置することも可能であるが、その場合、どちらの用途に使用するのかをメモリ内のアドレスにより分けることができる。
 ここで、図17、図20および図23の構成で一般的に用いられている受信処理用のディスクリプタ1020,1020aを用いた従来のDMA転送の動作例を、図18と図19を用いて再度詳細に説明する。
 まず、パケット処理装置のプロセッサは、パケット(もしくは結合パケット)の書き込み先の先頭アドレスA#1~A#Nを決定してディスクリプタ1020,1020aに書き込み、さらに、その先頭アドレスA#1~A#Nが有効か否かを示す有効フラグAF#1~AF#Nを「無効」から「有効」に書き換える。
 なお、ディスクリプタ1020,1020aには、先頭アドレスの情報等を書き込む領域がN組あるが、書き込む(「有効」化する)順番は予め決められている。例えば図18の例では、プロセッサは、1番目の先頭アドレスA#1、2番目の先頭アドレスA#2、・・・・、N番目の先頭アドレスA#Nと順番に書き込む。
 一通り書き込んだ後に、再び1番目のパケット(もしくは結合パケット)の転送が可能になったときには、1番目の先頭アドレスA#1から順番にディスクリプタ1020,1020aに書き込むようにすればよい。先頭アドレスA#n(nは1~N)の書き込みが可能か否かは、例えば先頭アドレスA#nに対応する有効フラグAF#nが「無効」であれば可能と判断すればよい。
 次に、DMAコントローラ1021,1021aは、ディスクリプタ1020,1020aの有効フラグAF#nを確認して、先頭アドレスA#nが「有効」であることを有効フラグAF#nが示している場合(図19ステップS102においてyes)、先頭アドレスA#nをディスクリプタ1020,1020aから読み出し(図19ステップS103)、対応するn番目のパケット(もしくは結合パケット)をパケットメモリ101の先頭アドレスA#nから始まる領域に書き込む(図19ステップS104)。
 このDMA転送完了後、DMAコントローラ1021,1021aは、n番目のパケットのパケット長(もしくはn番目の結合パケットの長さ)を示す受信データサイズL#nをディスクリプタ1020,1020aに書き込むと共に、ディスクリプタ1020,1020aに設定されている、n番目のパケット(もしくは結合パケット)の書き込みが完了したことを示す受信完了フラグWF#nを「未了」から「完了」に書き換える(図19ステップS105)。
 上記のとおりディスクリプタ1020,1020aには、有効フラグAF#1~AF#Nの領域がN個(組)あるが、有効フラグAF#1~AF#Nを確認する順番は予め決められている。例えば、図18、図19の例では、DMAコントローラ1021,1021aは、1番目の有効フラグAF#1、2番目の有効フラグAF#2、・・・・、N番目の有効フラグAF#Nと順番に確認する。一通り確認が終わった後には、再び1番目の有効フラグAF#1から順番に確認する。
 ディスクリプタ1020,1020aには、受信データサイズL#1~L#Nと受信完了フラグWF#1~WF#Nとを書き込む領域もN組用意されている。DMAコントローラ1021,1021aは、n番目の先頭アドレスA#nが「有効」であることが確認されたn番目の有効フラグAF#nに対応する番号の領域に、受信データサイズL#nと受信完了フラグWF#nとを書き込む。
 次に、パケット処理装置のプロセッサは、定期的にディスクリプタ1020,1020aの受信完了フラグWF#nを確認して、受信完了フラグWF#nが「完了」を示している場合には、対応するn番目の先頭アドレスA#nの情報と受信データサイズL#nの情報とを用いて、パケットメモリ101からn番目のパケット(もしくは結合パケット)を読み出し、必要な処理(例えばプロトコル処理)を行う。
 そして、プロセッサは、処理が終わったn番目のパケット(もしくは結合パケット)に対応する、ディスクリプタ1020,1020aのn番目の有効フラグAF#nを「有効」から「無効」に書き換えると共に、ディスクリプタ1020,1020aのn番目の受信完了フラグWF#nを「完了」から「未了」に書き換える。
 ディスクリプタ1020,1020aには、受信完了フラグWF#1~WF#Nの領域がN個(組)あるが、受信完了フラグWF#1~WF#Nを確認する順番は予め決められている。例えば、図18、図19の例では、プロセッサは、1番目の受信完了フラグWF#1、2番目の受信完了フラグWF#2、・・・・、N番目の受信完了フラグWF#Nと順番に確認する。一通り確認が終わった後には、再び1番目の受信完了フラグWF#1から順番に確認する。
 なお、上記の動作でDMAコントローラ1021,1021aがDMA転送完了後にプロセッサに対して割り込み処理要求を行うようにし、プロセッサが定期的に受信完了フラグWF#1~WF#Nを確認する代わりに、プロセッサがDMAコントローラ1021,1021aからの割り込み処理要求を受信したときに受信完了フラグWF#1~WF#Nを確認することもある。
 次に、図2の構成のディスクリプタ1110を用いた本実施例の動作例を図1~図9を用いて説明する。図3は転送管理部112の動作を説明するフローチャート、図4~図7、図9はDMAコントローラ1111の動作を説明するフローチャート、図8は受信処理部103の動作を説明するフローチャートである。
 最初に、転送管理部112(プロセッサが実行するソフトウェア)は、パケット処理装置の初期設定として、パケットメモリ101内に結合パケット用のバッファ領域として連続した領域を確保し(図3ステップS300)、このバッファ領域の先頭アドレスA0と容量(サイズ)C0を示す情報とを制御用レジスタ113に書き込む(図3ステップS301)。制御用レジスタ113は、例えばプロセッサ内に設けられる。
 なお、制御用レジスタ113は、1個(組)だけでも問題無いが、複数用意しておくことも可能である。制御用レジスタ113を複数設ける場合、パケットの書き込みに使用する順番は予め決めておく。また、制御用レジスタ113の設定は、初期設定時に行うものとし、動作中の設定変更は行わないものとする。
 次に、転送管理部112は、ディスクリプタ1110の初期設定として、先頭アドレスA#n(nは1~N)が有効か否かを示す有効フラグAF#nを全て「無効」とし(図3ステップS302)、パケットメモリ101からのパケットの読み出しが完了したことを示す受信完了フラグWF#nを全て「完了」とする(図3ステップS303)。
 結合パケット転送部111内のDMAコントローラ1111は、パケット結合部110から転送要求が発行されると、上記の初期設定後の最初の転送要求の場合、転送管理部112が設定した先頭アドレスA0と容量(サイズ)C0とを制御用レジスタ113から読み出す(図4ステップS400)。そして、DMAコントローラ1111は、パケットメモリ101へのパケットの転送に使用するためのライトポインタWPの初期値として、ステップS400で読み出した先頭アドレスA0を設定する(図4ステップS401)。すなわち、本実施例では、制御用レジスタ113の設定からパケットメモリ101内の書き込み可能なバッファ領域のアドレスの範囲を計算し、書き込み可能なバッファ領域をリングバッファとして使用する。
 続いて、DMAコントローラ1111は、ディスクリプタ1110の読出および書込の順を示す変数nを1に初期化する(図4ステップS402)。
 DMAコントローラ1111は、パケット結合部110からの情報を確認して、パケットメモリ101に転送すべきデータが、結合されていない単体のパケットか結合パケットかを確認し、結合したパケットの数kを確認する(図4ステップS403)。上記のとおり、結合したパケットの数kは、パケット結合部110から通知される情報に含まれている(結合していない場合はk=1)。そして、DMAコントローラ1111は、ディスクリプタ1110内のk個の受信完了フラグWF#n~WF#n(n+k-1)を確認する(図4ステップS404)。
 なお、n=Nの場合、DMAコントローラ1111は、WF#NとWF#1からWF#(k-1)までの受信完了フラグを確認すればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1111は、WF#nからWF#NまでとWF#1からWF#(k-1-(N-n))までの受信完了フラグを確認すればよい。
 DMAコントローラ1111は、ステップS404の処理により、確認したk個の受信完了フラグが全て「完了」の場合(ステップS404においてyes)、パケットメモリ101内の結合パケット用のバッファ領域の残容量CRとパケットメモリ101に転送すべきデータのサイズCDとを比較する(図4ステップS405)。パケットメモリ101に転送すべきデータが結合されていない単体のパケットの場合には、単体のパケットのサイズを残容量CRと比較し、パケットメモリ101に転送すべきデータが結合パケットの場合には、結合パケットのサイズを残容量CRと比較する。上記のとおり、パケットメモリ101に転送すべきデータのサイズCDは、パケット結合部110から通知される。
 この比較の際に、DMAコントローラ1111は、ライトポインタWPとリードポインタRPに基づいて、パケットメモリ101内の結合パケット用のバッファ領域の残容量CRを算出する。具体的には、DMAコントローラ1111は、初期状態(ライトポインタWP=リードポインタRP)の場合、ステップS400において制御用レジスタ113から読み出した容量(サイズ)C0の値をそのまま残容量CRとする。
 また、DMAコントローラ1111は、ライトポインタWP>リードポインタRPの場合、C0-WP+RPを残容量CRとし、ライトポインタWP<リードポインタRPの場合、RP-WPを残容量CRとする。また、DMAコントローラ1111は、初期状態以外で、ライトポインタWP=リードポインタRPの場合、0もしくはC0を残容量CRとする。具体的には、ライトポインタWP>リードポインタRPの状態からライトポインタWP=リードポインタRPに遷移した場合はリードポインタが更新されたと判断して、残容量CRをC0とし、ライトポインタWP<リードポインタRPの状態からライトポインタWP=リードポインタRPに遷移した場合はライトポインタが更新されたと判断して、残容量CRを0とする。
 なお、上記のとおりディスクリプタ1110には、受信完了フラグWF#1~WF#Nの領域がN個(組)用意されているが、受信完了フラグWF#1~WF#Nを確認する順番は予め決められている。例えば、図2、図4の例では、DMAコントローラ1111は、n番目の受信完了フラグWF#n、(n+1)番目の受信完了フラグWF#(n+1)、・・・・、N番目の受信完了フラグWF#Nと順番に確認する(ステップS404)。N番目の受信完了フラグWF#Nの確認を行った後、k組分の確認が終わっていない場合は、1番目の受信完了フラグWF#1から順番に確認を行う。
 DMAコントローラ1111は、パケットメモリ101内の結合パケット用のバッファ領域の残容量CRがパケットメモリ101に転送すべきデータのサイズCDより小さい場合(ステップS405においてyes)、ステップS404に戻る。このバッファ領域の残容量CRがデータサイズCDより小さい状態は、ソフトウェアによるパケットメモリ101からのパケットの読み出しにより、バッファ領域の残容量CRが回復すると解消する。
 また、DMAコントローラ1111は、バッファ領域の残容量CRがパケットメモリ101に転送すべきデータのサイズCD以上の場合(ステップS405においてno)、ライトポインタWPに、パケットメモリ101に転送すべきデータのサイズCDを加算した値(WP+CD)と、所定の上限値とを比較する(図5ステップS406)。ここで、上限値は、パケットメモリ101内のバッファ領域の先頭アドレスA0に、このバッファ領域の容量C0を加算した値(A0+C0)である。
 DMAコントローラ1111は、ライトポインタWPにデータのサイズCDを加算した値(WP+CD)が、上限値(A0+C0)より小さい場合(ステップS406においてyes)、パケット結合部110から通知された情報(結合した各パケットのサイズ)に基づいて、パケットメモリ101に転送すべきデータを構成するk個のパケットのパケット長を示す受信データサイズL#n~L#(n+k-1)を、ディスクリプタ1110に書き込む(図5ステップS407)。
 続いて、DMAコントローラ1111は、n番目の先頭アドレスA#nの値として、ライトポインタWPの値をディスクリプタ1110に書き込む(図5ステップS408)。さらに、DMAコントローラ1111は、パケットメモリ101に転送すべきデータが、結合されていない単体のパケット(k=1)の場合(図5ステップS409においてno)、図5ステップS412に遷移する。
 また、DMAコントローラ1111は、パケットメモリ101に転送すべきデータが結合パケットの場合(ステップS409においてyes)、ディスクリプタ1110内の「k-1」個の先頭アドレスA#(n+1)~A#(n+k-1)を、結合パケットを構成するk個のパケットのうち、初めの「k-1」個のパケットのパケット長に応じて書き込む(図5ステップS411)。
 具体的には、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」番目のパケットのパケット長とを足した値を書き込むようにすればよい。
 なお、n=Nの場合、DMAコントローラ1111は、受信データサイズL#nと、L#1からL#(k-1)までの受信データサイズをディスクリプタ1110に書き込むと共に、先頭アドレスA#nと、A#1からA#(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に書き込むと共に、先頭アドレスA#nと、A#(n+1)からA#NまでとA#1からA#(k-1-(N-n))までの先頭アドレスをディスクリプタ1110に書き込むようにすればよい。
 次に、DMAコントローラ1111は、ライトポインタWPをパケットメモリ101の転送先の先頭アドレスとして、パケットメモリ101に転送すべきデータ(単体のパケットまたは結合パケット)を、パケットメモリ101の転送先の先頭アドレスから始まるバッファ領域に書き込むDMA転送を行う(図6ステップS412)。すなわち、パケットメモリ101内のバッファ領域の先頭アドレスA0に、このバッファ領域の容量C0を加算した値(A0+C0)が、ライトポインタWPにデータのサイズCDを加算した値(WP+CD)より大きい場合、ライトポインタWPを転送先の先頭アドレスとしてDMA転送を行う。
 そして、DMAコントローラ1111は、パケットメモリ101にDMA転送したデータ(単体のパケットまたは結合パケット)のサイズをライトポインタWPに加算する(図6ステップS413)。具体的には、DMAコントローラ1111は、パケットメモリ101にDMA転送したデータが、結合されていない単体のパケット(k=1)の場合、当該パケットのパケット長(受信データサイズL#nが示す値)をライトポインタWPに加算する。また、DMAコントローラ1111は、パケットメモリ101に転送すべきデータが結合パケットの場合、受信データサイズL#n~L#(n+k-1)をライトポインタWPに加算する。
 なお、n=Nの場合、DMAコントローラ1111は、受信データサイズL#nと、L#1からL#(k-1)までの受信データサイズをライトポインタWPに加算すればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1111は、受信データサイズL#nと、L#(n+1)からL#NまでとL#1からL#(k-1-(N-n))までの受信データサイズをライトポインタWPに加算すればよい。
 次に、DMAコントローラ1111は、パケットメモリ101にDMA転送したデータを構成する各パケットに対応する受信完了フラグWF#n~WF#(n+k-1)を「完了」から「未了」に書き換える(図6ステップS414)。さらに、DMAコントローラ1111は、パケットメモリ101にDMA転送したデータを構成する各パケットに対応する有効フラグAF#n~AF#(n+k-1)を「無効」から「有効」に書き換える(図6ステップS415)。
 なお、n=Nの場合、DMAコントローラ1111は、受信完了フラグWF#nと、WF#1からWF#(k-1)までの受信完了フラグとを「完了」から「未了」に書き換えると共に、有効フラグAF#nと、AF#1からAF#(k-1)までの有効フラグとを「無効」から「有効」に書き換えるようにすればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1111は、受信完了フラグ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コントローラ1111は、n+k>Nが成立するかどうかを確認し(図6ステップS416)、n+kがNより大きい場合は、変数nをn=n+k-Nとし(図6ステップS417)とし、ステップS403に戻る。また、DMAコントローラ1111は、n+kがN以下の場合は、変数nをn=n+kとし(図6ステップS418)とし、ステップS403に戻る。
 一方、DMAコントローラ1111は、ライトポインタWPに、パケットメモリ101に転送すべきデータのサイズCDを加算した値(WP+CD)が、上限値(A0+C0)以上の場合(ステップS406においてno)、データのサイズCDと、リードポインタRPからパケットメモリ101内のバッファ領域の先頭アドレスA0を減算した値(RP-A0)とを比較する(図5ステップS419)。
 DMAコントローラ1111は、データのサイズCDが、減算値(RP-A0)より小さい場合(ステップS419においてyes)、パケット結合部110から通知された情報(結合した各パケットのサイズ)に基づいて、パケットメモリ101に転送すべきデータを構成するk個のパケットのパケット長を示す受信データサイズL#n~L#(n+k-1)を、ディスクリプタ1110に書き込む(図7ステップS420)。
 続いて、DMAコントローラ1111は、n番目の先頭アドレスA#nの値として、パケットメモリ101内のバッファ領域の先頭アドレスA0の値をディスクリプタ1110に書き込む(図7ステップS421)。さらに、DMAコントローラ1111は、パケットメモリ101に転送すべきデータが、結合されていない単体のパケット(k=1)の場合(図7ステップS422においてno)、図7ステップS425に遷移する。
 また、DMAコントローラ1111は、パケットメモリ101に転送すべきデータが結合パケットの場合(ステップS422においてyes)、ディスクリプタ1110内の「k-1」個の先頭アドレスA#(n+1)~A#(n+k-1)を、結合パケットを構成するk個のパケットのうち、初めの「k-1」個のパケットのパケット長に応じて書き込む(図7ステップS424)。
 具体的には、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」番目のパケットのパケット長とを足した値を書き込むようにすればよい。
 なお、n=Nの場合、DMAコントローラ1111は、受信データサイズL#nと、L#1からL#(k-1)までの受信データサイズをディスクリプタ1110に書き込むと共に、先頭アドレスA#nと、A#1からA#(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に書き込むと共に、先頭アドレスA#nと、A#(n+1)からA#NまでとA#1からA#(k-1-(N-n))までの先頭アドレスをディスクリプタ1110に書き込むようにすればよい。
 次に、DMAコントローラ1111は、パケットメモリ101に転送すべきデータ(単体のパケットまたは結合パケット)を、パケットメモリ101の先頭アドレスA0から始まるバッファ領域に書き込むDMA転送を行う(図7ステップS425)。すなわち、「A0+C0-WP」がパケットメモリ101に転送すべきデータのサイズCDより小さく、バッファ領域の先頭アドレスA0からリードポインタRPまでの容量が転送データのサイズCDより大きい場合、ライトポインタWPの代わりに、パケットメモリ101の先頭アドレスA0を転送先の先頭アドレスとしてDMA転送を行う。
 そして、DMAコントローラ1111は、パケットメモリ101にDMA転送したデータ(単体のパケットまたは結合パケット)のサイズを、パケットメモリ101のバッファ領域の先頭アドレスA0に加算した値を、ライトポインタWPの新たな値として更新する(図7ステップS426)。具体的には、DMAコントローラ1111は、パケットメモリ101にDMA転送したデータが、結合されていない単体のパケット(k=1)の場合、当該パケットのパケット長(受信データサイズL#nが示す値)を先頭アドレスA0に加算した値を、ライトポインタWPの新たな値とする。また、DMAコントローラ1111は、パケットメモリ101に転送すべきデータが結合パケットの場合、受信データサイズL#n~L#(n+k-1)を先頭アドレスA0に加算した値を、ライトポインタWPの新たな値とする。
 なお、n=Nの場合、DMAコントローラ1111は、受信データサイズL#nと、L#1からL#(k-1)までの受信データサイズを先頭アドレスA0に加算した値を、ライトポインタWPの新たな値とすればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1111は、受信データサイズL#nと、L#(n+1)からL#NまでとL#1からL#(k-1-(N-n))までの受信データサイズを先頭アドレスA0に加算した値を、ライトポインタWPの新たな値とすればよい。
 次に、DMAコントローラ1111は、パケットメモリ101にDMA転送したデータを構成する各パケットに対応する受信完了フラグWF#n~WF#(n+k-1)を「完了」から「未了」に書き換える(図7ステップS427)。さらに、DMAコントローラ1111は、パケットメモリ101にDMA転送したデータを構成する各パケットに対応する有効フラグAF#n~AF#(n+k-1)を「無効」から「有効」に書き換える(図7ステップS428)。
 なお、n=Nの場合、DMAコントローラ1111は、受信完了フラグWF#nと、WF#1からWF#(k-1)までの受信完了フラグとを「完了」から「未了」に書き換えると共に、有効フラグAF#nと、AF#1からAF#(k-1)までの有効フラグとを「無効」から「有効」に書き換えるようにすればよい。また、n<Nかつn+k-1>Nの場合、DMAコントローラ1111は、受信完了フラグ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コントローラ1111は、n+k>Nが成立するかどうかを確認し(図7ステップS429)、n+kがNより大きい場合は、変数nをn=n+k-Nとし(図7ステップS430)とし、ステップS403に戻る。また、DMAコントローラ1111は、n+kがN以下の場合は、変数nをn=n+kとし(図7ステップS431)とし、ステップS403に戻る。
 こうして、本実施例のDMA転送では、k個のパケットが連結された結合パケットを纏めてパケットメモリ101に転送し、ディスクリプタ1110の先頭アドレスの情報をDMAコントローラ1111が書き込むことにより、パケット処理装置のプロセッサ(受信処理部103とプロトコル処理部104)に対して各パケットの先頭が書き込まれたアドレスを通知するようにしている。
 なお、DMAコントローラ1111は、以下の受信処理部103等(プロセッサが実行するソフトウェア)の処理に対応してリードポインタRPの更新処理も行うが、このリードポインタRPの更新処理の詳細は後述する。
 受信処理部103(プロセッサが実行するソフトウェア)は、定期的にディスクリプタ1110の有効フラグAF#n(nは1~N)を確認して、有効フラグAF#nが「有効」を示している場合(図8ステップS501においてyes)、対応するn番目の先頭アドレスA#nの情報と受信データサイズL#nの情報とに基づいてパケットメモリ101からn番目のパケットを読み出してプロトコル処理部104へ渡す(図8ステップS502)。
 プロトコル処理部104で必要な処理が行われた後に(図8ステップS503においてyes)、受信処理部103(プロセッサが実行するソフトウェア)は、プロトコル処理が終わったn番目のパケットに対応する、ディスクリプタ1110のn番目の受信完了フラグWF#nを「未了」から「完了」に書き換えると共に、ディスクリプタ1110のn番目の有効フラグAF#nを「有効」から「無効」に書き換える(図8ステップS504)。
 ディスクリプタ1110には、有効フラグAF#1~AF#Nの領域がN個(組)あるが、有効フラグAF#1~AF#Nを確認する順番は予め決められている。例えば、受信処理部103は、1番目の有効フラグAF#1、2番目の有効フラグAF#2、・・・・、N番目の有効フラグAF#Nと順番に確認する。一通り確認が終わった後には、再び1番目の有効フラグAF#1から順番に確認する。
 なお、定期的にディスクリプタ1110の有効フラグAF#nを確認する代わりに、DMA転送の完了後にDMAコントローラ1111がプロセッサに対して割り込み処理要求を発行し、この割り込み処理要求に応じて受信処理部103(プロセッサが実行するソフトウェア)が、ディスクリプタ1110の有効フラグAF#n(nは1~N)を確認するようにしてもよい。
 以上のプロセッサ(ソフトウェア)の動作は図17の構成の従来技術のプロセッサ(ソフトウェア)の動作と同等であり、結合パケットを元の複数のパケットに復元する処理を受信処理用のソフトウェアで実現する必要はない。すなわち、受信処理部103とプロトコル処理部104とは、本実施例のように結合パケットがパケットメモリ101に書き込まれる場合でも、従来と同等な処理を行えばよい。
 次に、DMAコントローラ1111によるリードポインタRPの更新処理について説明する。最初に、DMAコントローラ1111は、リードポインタRPの初期値として、パケットメモリ101の結合パケット用のバッファ領域の先頭アドレスA0を設定する(図9ステップS440)。また、DMAコントローラ1111は、有効フラグの確認順を示す変数nを1に初期化する(図9ステップS441)。なお、この変数nと図4~図7の変数nとは同じ値であるから、ステップS441はステップS402と同じ処理である。
 DMAコントローラ1111は、図4~図7の処理中に、ディスクリプタ1110のn番目の有効フラグAF#nを定期的に確認する(図9ステップS442)。DMAコントローラ1111は、n番目の先頭アドレスA#nが「有効」であることを有効フラグAF#nが示していることを検出した後(図9ステップS443においてyes)、このn番目の先頭アドレスA#nに対応するディスクリプタ1110のn番目の受信完了フラグWF#nを確認する(図9ステップS444)。
 DMAコントローラ1111は、ディスクリプタ1110のn番目の受信完了フラグWF#nが「完了」を示している場合(図9ステップS445においてyes)、n番目の先頭アドレスA#nにn番目の受信データサイズL#nを加算した値を、リードポインタRPの新たな値として更新する(図9ステップS446)。
 また、有効フラグAF#nがプロセッサが実行するソフトウェアにより「無効」に書き換えられていない場合はDMAコントローラ1111が「無効」に更新する(図9ステップS447)。
 DMAコントローラ1111は、変数nがNと等しいかどうかを判定する(図9ステップS448)。DMAコントローラ1111は、変数nがNに達していない場合(ステップS448においてno)、変数nを1増やし(図9ステップS449)、ステップS442に戻る。また、DMAコントローラ1111は、変数nがNに達した場合(ステップS448においてyes)、変数nを1とし(図9ステップS450)、ステップS442に戻る。
 なお、受信完了フラグWF#nが「完了」になるのは、図8の受信処理部103の動作によるものである。
 また、以上に説明したリードポインタRPは、DMAコントローラ1111がパケットメモリ101内の結合パケット用のバッファ領域の残容量の計算等に使用するためのものであり、ソフトウェアによる読み出し時等の使用は想定していない。
 以上に説明したように、本実施例のパケット処理装置は、纏めDMA転送を実現することができ、かつ結合パケットを元の複数のパケットに復元するための情報をディスクリプタ1110に書き込む手段(DMAコントローラ1111)を内蔵する結合パケット転送部111を備えている。DMAコントローラ1111はハードウェアで実装可能なので、復元処理のソフトウェアでの実行を不要とし、かつ、纏めDMA転送の効果による高い受信性能を実現することが可能となる。
 なお、従来の図20の構成、もしくは図23の構成のパケット処理装置において、結合パケットを元の複数のパケットに復元する処理をプロセッサ(ソフトウェア)で実行する場合と比較すると、本実施例では、復元処理をプロセッサ(ソフトウェア)で行う必要がなくなるので、1パケットの処理に必要となるプロセッサの処理が軽くなり、受信性能が向上する(単位時間に処理できるパケットの数が増加する)という効果がある。また、本実施例では、1パケットの処理に必要となるプロセッサの消費電力が小さくなるという効果もある。
 また、従来の図20の構成、もしくは図23の構成で、纏めDMA転送を正常に行うためには、ソフトウェアによって事前に、パケットメモリ101内に、N×DB_mux(DB_muxは結合パケットの最大サイズ)のバッファ領域を確保しておく必要がある。これに対して、本実施例のパケット処理装置では、より小さいバッファ領域で纏めDMA転送を正常に行うことができる。
 上記の結合パケットの最大サイズDB_muxは、結合閾値制御部107に設定される閾値に許容最大パケット長を足した値となる。したがって、例えば閾値を500Byte、許容最大パケット長を2000Byte、Nを10とすると、従来の図20の構成、もしくは図23の構成でパケットメモリ101内に確保が必要なバッファ領域のサイズは、10×2500=25000Byteとなる。
 本実施例のパケット処理装置でパケットメモリ101内に確保が必要なバッファ領域のサイズは、Nに依存せず、結合パケットの最大サイズDB_muxとなる。すなわち、本実施例のパケット処理装置でパケットメモリ101内に確保が必要なバッファ領域のサイズは、上記と同じ条件で、2500Byteとなる。このようにバッファ領域のサイズを小さくできるのは、バッファ領域の残容量CRが小さい場合に残容量CRが必要な量になるまでDMA転送を待たせる機能(図4のステップS405、図5のステップS419)の実装による効果である。
 したがって、本実施例では、パケットメモリ101内に確保するバッファ領域のサイズが小さいと、ソフトウェアによるパケットメモリ101からのパケットの読み出しが完了するまで次のDMA転送が待たされる確率が高くなる。
 ここで、本実施例のパケット処理装置でパケットメモリ101内に確保するバッファ領域のサイズを従来の図20の構成、もしくは図23の構成で必要なサイズと同じサイズにした場合に無駄となる領域の量を比較する。
 上記のように閾値を500Byte、許容最大パケット長を2000Byte、Nを10とした場合、実際にパケットメモリ101に転送される結合パケットのサイズは501Byte~2500Byteとなる。つまり、従来の図20の構成、もしくは図23の構成では、各結合パケットのサイズをSとしたとき、(2500-S)を10個の結合パケット分加算した領域が無駄になる。これは、結合パケットのサイズSの平均が仮に1500Byteだとすると、25000Byteの内10000Byte分の領域が無駄になっていることを示している。
 本実施例の構成でパケットメモリ101内に確保するバッファ領域のサイズを25000Byteとした場合、25000Byteが連続した領域で確保され、複数の結合パケットを連続した領域に書き込むことが可能な構成となっている。したがって、本実施例で無駄になるのは、最大で結合パケットの最大サイズ2500Byteから1Byteを引いた値、すなわち、2499Byteのみとなる。この値は、結合パケットのサイズSの平均が(25000-2499)/10=2250.1より小さい場合、Nを11以上にすれば、11個以上の結合パケットを同じ容量(25000Byte)のバッファに書き込めることを示している。従来の図20の構成、もしくは図23の構成で11個以上の結合パケットを書き込むためにはNを11以上にし、かつ27500Byte以上のバッファ領域が必要である。
 したがって、本実施例のパケット処理装置でパケットメモリ101内に確保するバッファ領域のサイズを従来の図20の構成、もしくは図23の構成で必要なサイズと同じサイズにした場合、従来の図20の構成、もしくは図23の構成の場合より、無駄になる領域が小さくなり、より多数の結合パケットを同じサイズのバッファ領域に書き込むことが可能となる場合もある。
 また、結合パケットのサイズSの平均を仮に1500Byte、バッファ領域に書き込む結合パケットの最大数を10だとして、本実施例のパケット処理装置でパケットメモリ101内に確保すべきバッファ領域のサイズを計算すると、1500×10=15000Byteとなり、従来の図20の構成、もしくは図23の構成で必要なサイズ(25000Byte)より小さくなる。
 なお、本実施例の構成では、パケットメモリ101のバッファ領域に書き込む結合パケットの最大数とディスクリプタ1110のNを独立に決定することができる。上記のようにバッファ領域に書き込む結合パケットの最大数によりバッファ領域のサイズを決め、Nはバッファ領域に書き込むパケットの最大数とすれば良い。ただし、実際にバッファ領域に書き込めるパケットの最大数は、格納するパケットのサイズとバッファ領域のサイズに依存するので、Nもしくはそれより小さい値となる。仮に、結合パケットのサイズSの平均が1500Byte、結合したパケットの数kの平均が2個、バッファ領域に書き込む結合パケットの最大数を10だとすると、バッファ領域のサイズを1500×10=15000Byte、Nを2×10=20とするのが望ましい。
 複数のパケットが結合した結合パケットを元の複数のパケットに復元する処理を受信処理部103、プロトコル処理部104、もしくは図23の結合パケット分離部108のハードウェアで実現しようとすると、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケット結合部106から受信処理部103、プロトコル処理部104、もしくは図23の結合パケット分離部108に通知する手段が必要となる。
 また、復元処理を受信処理部103、プロトコル処理部104、もしくは図23の結合パケット分離部108のハードウェアで実現しようとすると、DMA転送完了後、受信処理が起動されるまで、場合によっては複数の結合パケット分の復元処理に必要な情報を保持しておく必要があることを考慮しなければならない。
 これに対して、本実施例のパケット処理装置では、1つの結合パケットのDMA転送が完了した時点で結合パケットの復元処理は終わっているので、複数の結合パケット分の情報を保持する必要がない。したがって、復元処理を受信処理部103、プロトコル処理部104、もしくは図23の結合パケット分離部108のハードウェアで実現する場合と比較して、本実施例の方がハードウェアの規模が小さい。
 また、復元処理に必要な情報をパケット結合部106から受信処理部103、プロトコル処理部104、もしくは図23の結合パケット分離部108に通知する手段として、復元処理に必要な情報を結合パケットの中に書き込むことも可能である。しかし、復元処理に必要な情報を結合パケットの中に書き込む場合、DMA転送に使用するバスの帯域の一部を、復元処理に必要な情報で占有してしまうことになるので、本来のパケットデータの転送に使用できる実効帯域が小さくなり、その結果、DMA転送の性能が劣化してしまうという問題が発生する。
 本実施例のパケット処理装置では、復元処理に必要な情報を結合パケットに書き込む必要がないので、上記のような実効帯域の劣化は起こらない。
 本実施例では、結合パケット転送部111をハードウェアで実現する例を示したが、受信処理に使用するプロセッサとは別のプロセッサとソフトウェアにより結合パケット転送部111の少なくとも一部の処理を実装することも可能である。このように結合パケット転送部111の少なくとも一部の処理をソフトウェアで実現する場合でも、結合パケットを元の複数のパケットに復元する処理を受信処理部103もしくはプロトコル処理部104で行う必要がなくなるので、纏めDMA転送の効果による高い受信性能を実現することが可能となる。
 また、結合パケット転送部111の少なくとも一部の処理をソフトウェアで実現する場合でも、結合パケット転送部111をハードウェアで実現する場合と同様に、結合パケットを元の複数のパケットに復元する処理に必要となるハードウェアの規模が小さくなる効果(複数の結合パケット分の情報を保持する必要がないことによる効果)、およびパケットデータの転送に使用できる実効帯域の劣化が起こらない効果(復元処理に必要な情報を結合パケットの中に加えないことによる効果)を得ることができる。
 本実施例の変形として、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個のみの場合と比較して、ソフトウェアによる受信処理の性能を向上させることができる。
 なお、パケットメモリ101内の書き込み可能なアドレスとして、制御用レジスタ113等により、間に書込みできないアドレスが設定された場合、その時点のライトポインタWPから書き込みできないアドレスまでの容量が転送データ(結合していないパケット、もしくは結合パケット)のサイズCDより小さい場合、ライトポインタWPの値を転送データのサイズCDより大きな容量を持っているアドレス領域までジャンプさせて書き込みに使用すればよい。
[第2の実施例]
 次に、本発明の第2の実施例について説明する。第1の実施例では、DMA転送を用いる場合を前提として説明したが、DMA転送を用いないパケット処理装置においても、複数のパケットを連結した結合パケットを纏めてパケットメモリに書き込む纏め書き込みにより、パケットメモリへの書き込みの実効スループットが大きくなる場合がある(例えばパケットメモリがDRAM(Dynamic Random Access Memory)で構成されている場合等)。
 図10は本発明の第2の実施例に係るパケット処理装置の構成を示すブロック図である。図10のパケット処理装置は、回線対応部100と、パケットメモリ101と、受信処理部103と、プロトコル処理部104と、受信バッファ105と、結合閾値制御部107と、パケット結合部110と、転送管理部112と、結合パケット転送部114と、制御用レジスタ113と、ディスクリプタ1130とから構成される。
 図10の構成と図1の構成の違いは、図1における転送手段を、パケット処理装置のプロセッサ(ソフトウェア)による書き込み手段に置き換えた点である。つまり、本実施例は、図1の結合パケット転送部111を、ソフトウェアによる結合パケット転送部114に置き換えたものである。
 回線対応部100とパケットメモリ101と受信処理部103とプロトコル処理部104と受信バッファ105と結合閾値制御部107と転送管理部112と制御用レジスタ113は、図1の構成と同等である。
 図10のパケット結合部110は、回線対応部100において受信されたパケットをパケット結合用の受信バッファ105に転送する。このとき、パケット結合部110は、回線対応部100において受信されたパケットと受信バッファ105中に既に格納されているパケットとを結合して1つの結合パケットになるように、パケットを受信バッファ105に格納する。そして、パケット結合部110は、受信バッファ105中の結合パケットの大きさが、結合閾値制御部107に設定された閾値を超えると、結合パケットのパケットメモリ101への転送要求を発行する。
 なお、パケット結合部110は、受信バッファ105中の結合パケットの大きさが閾値を超える前に、タイムアウト(パケット間の間隔が予め定められた期間を超えた場合等)が発生した場合に、転送要求を発行するようにしてもよい。
 さらに、パケット結合部110は、受信バッファ105において結合したパケットの数と各パケットのサイズとを記録し、結合パケットの転送要求を発行する際に、結合したパケットの数と各パケットのサイズの情報を結合パケット転送部114に対して通知する。
 結合パケット転送部114(プロセッサが実行するソフトウェア)は、複数のパケットが結合された結合パケットをパケットメモリ101に書き込み、受信処理部103の起動要求を行なう。また、結合パケット転送部114は、パケット結合部110から通知された、結合したパケットの数と各パケットのサイズの情報を用いて、パケット毎に用意したディスクリプタ1130にサイズ等の情報を書き込む。
 図11に示すように、ディスクリプタ1130の構成は、第1の実施例のディスクリプタ1110の構成と同等である。ただし、本実施例では、結合パケット転送部111の代わりに、結合パケット転送部114(プロセッサが実行するソフトウェア)がディスクリプタ1130への書き込みを行うという違いがある。
 図12~図16は結合パケット転送部114(プロセッサが実行するソフトウェア)の動作を説明するフローチャートである。結合パケット転送部114は、パケット結合部110から転送要求が発行されると、初期設定後の最初の転送要求の場合、転送管理部112が設定した先頭アドレスA0と容量(サイズ)C0とを制御用レジスタ113から読み出す(図12ステップS600)。そして、結合パケット転送部114は、ライトポインタWPの初期値として先頭アドレスA0を設定する(図12ステップS601)。
 続いて、結合パケット転送部114は、ステップS402~S406と同等のステップS602~S606の処理を行う。結合パケット転送部114は、ライトポインタWPにデータのサイズCDを加算した値(WP+CD)が、上限値(A0+C0)より小さい場合(図13ステップS606においてyes)、パケット結合部110から通知された情報(結合した各パケットのサイズ)に基づいて、パケットメモリ101に転送すべきデータを構成するk個のパケットのパケット長を示す受信データサイズL#n~L#(n+k-1)を、ディスクリプタ1130に書き込む(図13ステップS607)。
 図13のステップS608~S611の処理は、図5のステップS408~S411の処理と同等である。
 次に、結合パケット転送部114は、ライトポインタWPをパケットメモリ101の転送先の先頭アドレスとして、パケットメモリ101に転送すべきデータ(単体のパケットまたは結合パケット)を、パケットメモリ101の転送先の先頭アドレスから始まるバッファ領域に書き込む(図14ステップS612)。
 図14のステップS613~S618の処理は、図6のステップS413~S418の処理と同等である。結合パケット転送部114は、ステップS617またはS618の処理後、ステップS603に戻る。
 また、結合パケット転送部114は、ライトポインタWPに、パケットメモリ101に転送すべきデータのサイズCDを加算した値(WP+CD)が、上限値(A0+C0)以上の場合(図13ステップS606においてno)、データのサイズCDと、リードポインタRPからパケットメモリ101内のバッファ領域の先頭アドレスA0を減算した値(RP-A0)とを比較する(図13ステップS619)。
 結合パケット転送部114は、データのサイズCDが、減算値(RP-A0)より小さい場合(ステップS619においてyes)、パケット結合部110から通知された情報(結合した各パケットのサイズ)に基づいて、パケットメモリ101に転送すべきデータを構成するk個のパケットのパケット長を示す受信データサイズL#n~L#(n+k-1)を、ディスクリプタ1130に書き込む(図15ステップS620)。
 図15のステップS621~S624の処理は、図7のステップS421~S424の処理と同等である。
 次に、結合パケット転送部114は、パケットメモリ101に転送すべきデータ(単体のパケットまたは結合パケット)を、パケットメモリ101の先頭アドレスA0から始まるバッファ領域に書き込む(図15ステップS625)。
 図15のステップS626~S631の処理は、図7のステップS426~S431の処理と同等である。結合パケット転送部114は、ステップS630またはS631の処理後、ステップS603に戻る。
 次に、結合パケット転送部114によるリードポインタRPの更新処理について説明する。最初に、結合パケット転送部114は、リードポインタRPの初期値として、パケットメモリ101の結合パケット用のバッファ領域の先頭アドレスA0を設定する(図9ステップS640)。また、結合パケット転送部114は、有効フラグの確認順を示す変数nを1に初期化する(図9ステップS641)。なお、この変数nと図12~図15の変数nとは同じ値であるから、ステップS641はステップS602と同じ処理である。
 図16のステップS642~S650の処理は、図9のステップS442~S450の処理と同等である。
 こうして、本実施例のパケット処理装置は、纏め書き込みを実現することができ、かつ結合パケットを元の複数のパケットに復元するための情報をディスクリプタ1130に書き込む手段(結合パケット転送部114)を備えている。本実施例によれば、復元処理の受信処理部103、プロトコル処理部104、もしくは、図23の結合パケット分離部108での実行を不要とすることができ、かつ、纏め書き込みの効果による高い受信性能を実現することが可能となる。
 ここで、本実施例のパケット処理装置でパケットメモリ101内に確保するバッファ領域のサイズを従来の図24の構成で必要なサイズと同じサイズにした場合に無駄となる領域の量を比較する。
 従来の図24の構成で、纏め書き込みを正常に行うためには、受信処理用(読み出し処理用)のソフトウェアによって事前に、パケットメモリ101内に、N×DB_mux(DB_muxは結合パケットの最大サイズ)のバッファ領域を確保しておく必要がある。この結合パケットの最大サイズDB_muxは、結合閾値制御部107に設定される閾値に許容最大パケット長を足した値となる。したがって、例えば閾値を500Byte、許容最大パケット長を2000Byte、Nを10とすると、従来の図24の構成でパケットメモリ101内に確保が必要なバッファ領域のサイズは、10×2500=25000Byteとなる。
 上記のように閾値を500Byte、許容最大パケット長を2000Byte、Nを10とした場合、実際にパケットメモリ101に転送される結合パケットのサイズは501Byte~2500Byteとなる。つまり、従来の図24の構成では、各結合パケットのサイズをSとしたとき、(2500-S)を10個の結合パケット分加算した領域が無駄になる。これは、結合パケットのサイズSの平均が仮に1500Byteだとすると、25000Byteの内10000Byte分の領域が無駄になっていることを示している。
 本実施例の構成でパケットメモリ101内に確保するバッファ領域のサイズを25000Byteとした場合、25000Byteが連続した領域で確保され、複数の結合パケットを連続した領域に書き込むことが可能な構成となっている。したがって、本実施例で無駄になるのは、最大で結合パケットの最大サイズ2500Byteから1Byteを引いた値、すなわち、2499Byteのみとなる。この値は、結合パケットのサイズSの平均が(25000-2499)/10=2250.1より小さい場合、Nを11以上にすれば、11個以上の結合パケットを同じ容量(25000Byte)のバッファに書き込めることを示している。従来の図24の構成で11個以上の結合パケットを書き込むためにはNを11以上にし、かつ27500Byte以上のバッファ領域が必要である。
 したがって、本実施例のパケット処理装置でパケットメモリ101内に確保するバッファ領域のサイズを従来の図24の構成で必要なサイズと同じサイズにした場合、従来の図24の構成の場合より、無駄になる領域が小さくなり、より多数の結合パケットを同じサイズのバッファ領域に書き込むことが可能となる場合もある。
 また、結合パケットのサイズSの平均を仮に1500Byte、バッファ領域に書き込む結合パケットの最大数を10だとして、本実施例のパケット処理装置でパケットメモリ101内に確保すべきバッファ領域のサイズを計算すると、1500×10=15000Byteとなり、従来の図24の構成で必要なサイズ(25000Byte)より小さくなる。
 本実施例のパケット処理装置では、結合パケット転送部114がディスクリプタ1130の情報(先頭アドレス、受信データサイズ、受信完了フラグ)を書き込むことにより、復元処理を不要としている。
 復元処理を受信処理部103、プロトコル処理部104、もしくは図24の結合パケット分離部108で実現しようとすると、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケット結合部106から受信処理部103、プロトコル処理部104、もしくは図24の結合パケット分離部108に通知する手段が必要となる。
 また、復元処理を受信処理部103、プロトコル処理部104、もしくは図24の結合パケット分離部108で実現しようとすると、纏め書き込み完了後、受信処理が起動されるまで、場合によっては複数の結合パケット分の復元処理に必要な情報を保持しておく必要があることを考慮しなければならない。
 これに対して、本実施例のパケット処理装置では、1つの結合パケットの纏め書き込みが完了した時点で結合パケットの復元処理は終わっているので、複数の結合パケット分の情報を保持する必要がない。したがって、復元処理を受信処理部103、プロトコル処理部104、もしくは図24の結合パケット分離部108で実現する場合と比較して、本実施例の方がハードウェアの規模が小さい。これは、結合パケットを元の複数のパケットに復元する処理をソフトウェアで実装する場合で比較しても同じである。
 例えば、図24の構成でパケットメモリ101と回線対応部100以外の構成をすべてソフトウェアで実現した場合、パケットメモリ101への書き込みの処理と、復元処理を含む受信処理とを異なるプロセッサ(もしくはバーチャルマシン等)に実装すると、パケットメモリ101への書き込み完了後、受信処理が起動されるまで、場合によっては複数の結合パケット分の復元処理に必要な情報を保持しておく必要があるため、複数の結合パケット分の復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケットメモリ101等に保持しておく必要がある。
 これに対して、本実施例の構成でパケットメモリ101と回線対応部100以外の構成をすべてソフトウェアで実現した場合は、パケットメモリ101への書き込みの処理と、復元処理を含まない受信処理とを異なるプロセッサ(もしくはバーチャルマシン等)に実装した場合でも、パケットメモリ101への書き込みの処理と復元処理を同じプロセッサ(もしくはバーチャルマシン等)に実装することにより、複数の結合パケット分の情報(結合したパケットの数、パケット毎のサイズ)を保持する必要がない、すなわち、1つの結合パケット分のみの復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)をパケットメモリ101等に保持しておくだけでよい。
 つまり、本実施例の構成は、図24の構成と比較して、復元処理に必要な情報(結合したパケットの数、パケット毎のサイズ)の保持に使用するパケットメモリ101等の容量(書き込み可能なビット数)が小さくてもよいことになり、必要となるハードウェアの規模を削減することができる。
 また、復元処理に必要な情報をパケット結合部106から受信処理部103、プロトコル処理部104、もしくは図24の結合パケット分離部108に通知する手段として、復元処理に必要な情報をパケットメモリ101に書き込むことも可能である。しかし、この場合、纏め書き込みに使用するバスの帯域の一部を、復元処理に必要な情報で占有してしまうことになるので、本来のパケットデータの書き込みに使用できる実効帯域が小さくなり、その結果、纏め書き込みの性能が劣化する。
 本実施例のパケット処理装置では、復元処理に必要な情報を、パケットメモリ101ではなく、パケットメモリ101が接続されているバスを使用しない別のメモリ(パケット結合部110からの書き込みと結合パケット転送部114からの読み出しだけが可能であれば良い)に保持することができ、上記のような実効帯域の劣化は起こらない。
 第1の実施例と同様に、本実施例の変形として、パケット結合部110においてパケットの種類を判定して同じ種類のパケットを結合パケットとして纏める構成としてもよいし、パケットの種類に応じて複数のディスクリプタ1130を使い分ける構成としてもよい。パケットの種類別にディスクリプタ1130を用意し、パケットの種類に応じて複数のディスクリプタ1130を使い分ける構成とすると、パケットの種類毎に異なる受信処理を行うことが容易になる。
 また、本実施例において、複数のCPUコアを内蔵するプロセッサのコア毎に複数のディスクリプタ1130を使い分ける構成としてもよいし、バーチャルマシン毎に複数のディスクリプタ1130を使い分ける構成としてもよい。CPUコア毎もしくはバーチャルマシン毎に複数のディスクリプタ1130を使い分ける構成とすることにより、ディスクリプタ1130が1個のみの場合と比較して、ソフトウェアによる書き込み処理および読み出し処理の性能が向上する。
 第1、第2の実施例のパケット処理装置において、パケットメモリ101と転送管理部112と受信処理部103とプロトコル処理部104と結合パケット転送部114とは、プロセッサ、記憶装置及びインタフェースを備えたコンピュータと、これらのハードウェア資源を制御するプログラムによって実現することができる。
 このようなコンピュータにおいて、本発明のパケット処理方法を実現させるためのプログラムは記憶装置に格納される。プロセッサは、記憶装置に格納されたプログラムに従って第1、第2の実施例で説明した処理を実行する。また、上記のとおり、結合パケット転送部111の一部の処理をコンピュータで実現することも可能である。
 本発明は、通信データのプロトコル処理や転送処理等を行う技術に適用することができる。
 100…回線対応部、101…パケットメモリ、103…受信処理部、104…プロトコル処理部、105…受信バッファ、107…結合閾値制御部、110…パケット結合部、111,114…結合パケット転送部、112…転送管理部、113…制御用レジスタ、1110,1130…ディスクリプタ、1111…DMAコントローラ。

Claims (6)

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

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/057,067 US11321255B2 (en) 2018-05-23 2019-05-13 Packet processing device and packet processing method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2018-098548 2018-05-23
JP2018098548A JP7102936B2 (ja) 2018-05-23 2018-05-23 パケット処理装置およびパケット処理方法

Publications (1)

Publication Number Publication Date
WO2019225379A1 true WO2019225379A1 (ja) 2019-11-28

Family

ID=68617341

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2019/018931 WO2019225379A1 (ja) 2018-05-23 2019-05-13 パケット処理装置およびパケット処理方法

Country Status (3)

Country Link
US (1) US11321255B2 (ja)
JP (1) JP7102936B2 (ja)
WO (1) WO2019225379A1 (ja)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7331431B2 (ja) * 2019-04-22 2023-08-23 日本電信電話株式会社 パケット処理装置およびパケット処理方法
JP2022048716A (ja) * 2020-09-15 2022-03-28 キオクシア株式会社 ストレージシステム
US20230102614A1 (en) * 2021-09-27 2023-03-30 Qualcomm Incorporated Grouping data packets at a modem

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 (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5933654A (en) * 1996-09-24 1999-08-03 Allen-Bradley Company, Llc Dynamic buffer fracturing by a DMA controller
US7079501B2 (en) 2001-01-31 2006-07-18 International Business Machines Corporation Method and system for efficiently delivering content to multiple requesters
DE10213839B4 (de) * 2002-03-27 2016-11-03 Advanced Micro Devices, Inc. DMA-Mechanismus für einen Hochgeschwindigkeitspaketbus
US7609723B2 (en) 2003-05-23 2009-10-27 Intel Corporation Packet combining on PCI express
US7620071B2 (en) * 2004-11-16 2009-11-17 Intel Corporation Packet coalescing
JP4468332B2 (ja) 2006-06-28 2010-05-26 日本電信電話株式会社 パケット処理方法およびパケット処理装置
US7813342B2 (en) * 2007-03-26 2010-10-12 Gadelrab Serag Method and apparatus for writing network packets into computer memory
CN101699419B (zh) * 2009-11-13 2012-03-21 威盛电子股份有限公司 数据传输方法以及使用该方法的通用串行总线主机控制器
DE102012023395A1 (de) * 2012-11-29 2014-06-05 Eads Deutschland Gmbh Schnittstellenvorrichtung und Verfahren zum Austauschen von Nutzdaten
US9460019B2 (en) * 2014-06-26 2016-10-04 Intel Corporation Sending packets using optimized PIO write sequences without SFENCEs
JP7056337B2 (ja) 2018-04-10 2022-04-19 日本電信電話株式会社 パケット処理装置およびパケット処理方法

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 情報受信装置および情報受信方法

Also Published As

Publication number Publication date
US20210141751A1 (en) 2021-05-13
JP2019205051A (ja) 2019-11-28
US11321255B2 (en) 2022-05-03
JP7102936B2 (ja) 2022-07-20

Similar Documents

Publication Publication Date Title
WO2019225379A1 (ja) パケット処理装置およびパケット処理方法
JP4205181B2 (ja) Atmパケット・ヘッダおよびデータをホスト・コンピュータ・システムにバースト転送するための方法および装置
EP2550603B1 (en) Direct scatter loading of executable software image from a primary processor to one or more secondary processors in a multi-processor system
US5909546A (en) Network interface having support for allowing remote operations with reply that bypass host computer interaction
US20090144527A1 (en) Stream processing apparatus, method for stream processing and data processing system
US5845151A (en) System using descriptor and having hardware state machine coupled to DMA for implementing peripheral device bus mastering via USB controller or IrDA controller
US6728797B2 (en) DMA controller
US7130932B1 (en) Method and apparatus for increasing the performance of communications between a host processor and a SATA or ATA device
JP7056337B2 (ja) パケット処理装置およびパケット処理方法
EP1891503B1 (en) Concurrent read response acknowledge enhanced direct memory access unit
US5930483A (en) Method and apparatus for communications control on a small computer system interface
US20030043634A1 (en) Semiconductor memory device with block-unit erase type nonvolatile memory
US8756356B2 (en) Pipe arbitration using an arbitration circuit to select a control circuit among a plurality of control circuits and by updating state information with a data transfer of a predetermined size
CN110445580B (zh) 数据发送方法及装置、存储介质、电子装置
JP2004227501A (ja) データ転送制御装置および方法
JP7331431B2 (ja) パケット処理装置およびパケット処理方法
JP3655930B2 (ja) データ処理システムにおいてレジスタをアンスタッキングする方法および装置
US20220182340A1 (en) Packet Processing Device and Packet Processing Method
US12010045B2 (en) Packet processing device and packet processing method
EP0953905A2 (en) Method and apparatus for switching tasks
JP2005346164A (ja) データ処理装置およびデータ転送制御方法
JP2009157731A (ja) 仮想計算機システムおよび仮想計算機システムの制御方法
EP4170508A1 (en) Parallel and distributed computing system
JP6940283B2 (ja) Dma転送制御装置、dma転送制御方法、及び、dma転送制御プログラム
JPH02310649A (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: 19806535

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

Country of ref document: EP

Kind code of ref document: A1