Packet Processing Device and Packet Processing Method
20210034559 ยท 2021-02-04
Inventors
- Tomoaki Kawamura (Tokyo, JP)
- Saki Hatta (Tokyo, JP)
- Shoko Oteru (Tokyo, JP)
- Koji YAMAZAKI (Tokyo, JP)
- Takahiro Hatano (Tokyo, JP)
Cpc classification
G06F12/1081
PHYSICS
Y02D10/00
GENERAL 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
International classification
G06F13/28
PHYSICS
G06F12/1081
PHYSICS
Abstract
A packet processing device includes: a line adapter configured to receive packets from a communication line; a packet combining unit configured to generate a combined packet by combining a plurality of packets received from the communication line; a packet memory configured to store packets received from the communication line; and a combined packet transferring unit configured to DMA transfer the combined packet generated by the packet combining unit to the packet memory. The combined packet transferring unit writes information of an address of first data of each packet inside the combined packet on the packet memory into a descriptor that is a data area on a memory set in advance.
Claims
1.-6. (canceled)
7. A packet processing device comprising: a line adapter configured to receive a plurality of packets from a communication line; a packet combiner configured to generate a combined packet by combining the plurality of packets received from the communication line; a packet memory configured to store packets received from the communication line; and a combined packet transferor configured to: direct memory access (DMA) transfer the combined packet to the packet memory or write the combined packet to the packet memory using a processor; and write information of an address of each of the plurality of packets in the combined packet into a descriptor that is a data area of a memory, wherein the data area of the memory is set in advance.
8. The packet processing device according to claim 7, wherein the combined packet transferor is further configured to write a received data size indicating a packet length of each of the plurality of packets in the combined packet into the descriptor.
9. The packet processing device according to claim 7, further comprising one or more processors configured to: read packets stored in the packet memory based on information written in the descriptor; and perform processing of the packets read from the packet memory.
10. The packet processing device according to claim 7, wherein the packet combiner is configured to store the combined packet in a buffer until a size of the combined packet exceeds a threshold.
11. The packet processing device according to claim 10, wherein the packet combiner is further configured to in response to the size of the combined packet exceeding the threshold, request the combined packet transferor to send the combined packet to the packet memory.
12. The packet processing device according to claim 7, wherein the packet combiner is configured to: store the combined packet in a buffer; and in response to a timeout occurring, request the combined packet transferor to send the combined packet to the packet memory before a size of the combined packet exceeds a threshold.
13. A packet processing method comprising: generating a combined packet by combining a plurality of packets received from a communication line; direct memory access (DMA) transferring the combined packet to a packet memory or writing the combined packet to a packet memory, wherein the packet memory is read by a processor configured to perform processing of the plurality of packets received from the communication line; and writing information of an address of first data of each of the plurality of packets in the combined packet into a descriptor that is a data area of a memory, wherein the data area of the memory is set in advance.
14. The packet processing method according to claim 13, further comprising writing information of a received data size indicating a packet length of each of the plurality of packets in the combined packet into the descriptor.
15. The packet processing method according to claim 13 further comprising: reading packets from the packet memory based on information written in the descriptor; and performing processing of the packets read from the packet memory.
16. The packet processing method of claim 13 further comprising storing the combined packet in a buffer until a size of the combined packet exceeds a threshold.
17. The packet processing method of claim 16 further comprising in response to the size of the combined packet exceeding the threshold, requesting that the combined packet be sent to the packet memory.
18. The packet processing method according to claim 13 further comprising: storing the combined packet in a buffer; and in response to a timeout occurring, requesting that the combined packet be sent to the packet memory before a size of the combined packet exceeds a threshold.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
[0067]
DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS
First Example
[0068] Hereinafter, an embodiment of the present disclosure will be described in detail with reference to the drawings. In all the drawings for describing an embodiment, the same reference signs will be assigned to units having the same functions, and repeated description thereof will be omitted.
[0069] The packet processing device illustrated in
[0070] Among these, the line adapter 100, the reception buffer 105 for combining packets, and the combination threshold control unit 107 are equivalent to the components illustrated in
[0071] The packet combining unit 110 transfers packets received by the line adapter 100 to the reception buffer 105 for combining packets. At this time, the packet combining unit 110 stores packets in the reception buffer 105 such that a packet received by the line adapter 100 and packets stored in the reception buffer 105 in advance are connected to form one combined packet. When the size of the combined packet in the reception buffer 105 exceeds the threshold set in the combination threshold control unit 107, the packet combining unit 110 issues a request for transferring the combined packet to the packet memory 101.
[0072] In addition, the packet combining unit 110 may be configured to issue a transfer request in a case in which a timeout has occurred (in a case in which a reception interval between packets exceeds a period set in advance or the like) before the size of the combined packet in the reception buffer 105 exceeds the threshold.
[0073] In addition, the packet combining unit 110 records the number of packets combined in the reception buffer 105 and the size of each packet and notifies the combined packet transferring unit 111 of the number of combined packets and the size of each packet when issuing a request for transferring a combined packet.
[0074] The combined packet transferring unit 111 includes a DMA controller 1111. The combined packet transferring unit 111 transfers a combined packet to the packet memory 101 through one DMA transfer and issues a request for activating the reception processing unit 103 by generating a hardware interrupt.
[0075] In addition, the combined packet transfer unit 111 may be configured not to generate a hardware interrupt for the processor (not illustrated) of the packet processing device.
[0076] In addition, the combined packet transferring unit in writes a size and the like into the descriptor 1110 that is prepared for each packet by the transfer managing unit 112 (software executed by the processor) by using the information of the number of combined packets and the size of each packet notified of by the packet combining unit 110. Details of the configuration of the descriptor 1110 and the operations of the combined packet transferring unit in will be described later.
[0077] When an activation request is detected, the reception processing unit 103 reads packets stored in the packet memory 101 based on address information and size information written in the descriptor 1110 prepared for each packet and delivers the read packet to the protocol processing unit 104. At the same time, in order to supplement a packet memory corresponding to the packets delivered to the protocol processing unit 104, the reception processing unit 103 secures an area of a new packet memory 101 from memories included in the packet processing device. The operations of the reception processing unit 103 are equivalent to those of the configuration illustrated in
[0078] The protocol processing unit 104 performs necessary protocol processing on the packets received from the reception processing unit 103. Then, when the necessary protocol processing ends, the protocol processing unit 104 releases an area of the packet memory 101 in which the packets delivered from the reception processing unit 103 are stored. The operations of this protocol processing unit 104 are equivalent to those of the configuration illustrated in
[0079] The reception processing unit 103, the protocol processing unit 104, and the transfer managing unit 112 may be realized by software running on a general-purpose personal computer or a workstation or may be realized by hardware such as a field programmable gate array (FPGA) operating in cooperation with a program.
[0080] The packet memory 101 may be configured using a memory on a personal computer, a communication device, or a communication board.
[0081] The line adapter 100, the combination threshold control unit 107, and the packet combining unit no may be configured using an FPGA on a communication device or a communication board or the like.
[0082] The reception buffer 105 may be configured using a storage area included in an FPGA or the like on a communication device or a communication board or a storage circuit of a first in first out (FIFO) or the like.
[0083]
[0084] The descriptor 1110 illustrated in
[0085] The descriptor 1110, similar to the packet memory 101, is actually disposed inside a memory on a personal computer, a communication device, or communication board.
[0086] While the descriptor 1110 can be disposed inside the same memory as the packet memory 101, in such a case, the use of the memory can be divided in accordance with addresses inside the memory.
[0087] Here, an example of operations of DMA transfer in a related art using a descriptor 1020 in a related art will be described in detail again with reference to
[0088] First, the processor of the packet processing device determines start addresses A #1 to A #N of writing destinations of the packets and writes the determined start addresses in the descriptor 1020 and rewrites the validness flags AF #1 to AF #N, which indicate whether the start addresses A #1 to A #N are valid, from invalid to valid.
[0089] While there are N sets of areas in the descriptor 1020 in which information of start addresses and the like is written, the writing sequence is determined in advance. For example, in the example illustrated in
[0090] When a first packet can be transferred again after the information is written once, start addresses may be written into the descriptor 1020 in a sequence from the first start address A #1. Regarding whether information can be written at the start address A #n (here, n is 1 to N), for example, it can be determined that the writing can be performed when the validness flag AF #n corresponding to the start address A #n is invalid.
[0091] Next, the DMA controller 1021 checks the validness flag AF #n of the descriptor 1020 and, in a case in which the validness flag AF #n indicates that the start address A #n is valid (Yes in Step S102 illustrated in
[0092] After this DMA transfer is completed, the DMA controller 1021 writes a received data size L #n indicating a packet length of the n-th packet into the descriptor 1020 and rewrites the reception completion flag WF #n, which indicates that the writing of the n-th packet set in the descriptor 1020 has been completed, from not-completed to completed (step S105 illustrated in
[0093] As described above, while there are N (sets of) areas of the validness flags AF #1 to AF #N in the descriptor 1020, the sequence in which the validness flags AF #1 to AF #N are checked is determined in advance. For example, in the example illustrated in
[0094] In the descriptor 1020, N sets of areas in which received data sizes L #1 to L #N and reception completion flags WF #1 to WF #N are written are prepared. The DMA controller 1021 writes the received data size L #n and the reception completion flag WF #n into an area with a number corresponding to the n-th validness flag AF #n from which the n-th start address A #n is checked to be valid.
[0095] Next, the processor of the packet processing device regularly checks the reception completion flag WF #n of the descriptor 1020 and, in a case in which the reception completion flag WF #n indicates completed, reads the n-th packet from the packet memory 101 using the information of the n-th start address A #n and the information of the n-th received data size L #n corresponding thereto and performs a necessary process (for example, protocol processing).
[0096] Then, the processor rewrites the n-th validness flag AF #n of the descriptor 1020, which corresponds to the n-th packet of which processing has been completed, from valid to invalid and rewrites the n-th reception completion flag WF #n of the descriptor 1020 from completed to not-completed.
[0097] In the descriptor 1020, while there are N (sets of) areas of reception completion flags WF #1 to WF #N, a sequence in which the reception completion flags WF #1 to WF #N are checked is determined in advance. For example, in the example illustrated in
[0098] Alternatively, the DMA controller 1021 makes an interrupt processing request for the processor after completion of DMA transfer and instead of the processor regularly checking the reception completion flags WF #1 to WF #N in the operations described above, the processor may be configured to check the reception completion flags WF #1 to WF #N when an interrupt processing request is received from the DMA controller 1021.
[0099] Next, an example of operations according to this embodiment using the descriptor 1110 having the configuration illustrated in
[0100] First, the transfer managing unit 112 (software executed by the processor) determines an address of first data of each of N packets on the packet memory 101 as initial settings of the packet processing device, in other words, a start address A #n (here, n is 1 to N) of a writing destination of each packet and writes the start addresses into the descriptor 1020 (step S300 in
[0101] In the descriptor 1110, while N sets of areas in which information of start addresses and the like is to be written are prepared, a sequence in which information is written into the areas is determined in advance. For example, in the example illustrated in
[0102] When a first packet can be transferred again after the information is written once, start addresses may be written into the descriptor 1110 in a sequence from the first start address A #1. Regarding whether information can be written at the start address A #n, for example, it can be determined that the writing can be performed when the validness flag AF #n corresponding to the start address A #n is invalid. This operation is equivalent to that of a technology in a related art.
[0103] First, the DMA controller 1111 inside the combined packet transferring unit 111 initializes a variable n, which indicates the sequence of reading and writing of the descriptor 1110, to 1 (step S400 illustrated in
[0104] Then, when a transfer request is issued from the packet combining unit 110, the DMA controller 1111 checks the n-th validness flag AF #n of the descriptor 1110 (step S401 illustrated in
[0105] In a case in which the validness flag AF #n indicates that the n-th start address A #n is valid (Yes in step S402 illustrated in
[0106] In a case in which data to be transferred to the packet memory 101 is not a combined packet (in a case in which the number of combined packets is one), the DMA controller 1111 reads an n-th start address A #n for which a corresponding validness flag AF #n has been checked to be valid from the descriptor 1110 (step S404 illustrated in
[0107] After the completion of this DMA transfer, the DMA controller 1111 writes the received data size L #n indicating the packet length of the n-th packet into the descriptor 1110 and rewrites the reception completion flag WF #n, which indicates that the writing of the n-th packet has been completed, set in the descriptor 1110 from not-completed to completed (step S406 illustrated in
[0108] The DMA controller 1111 determines whether the variable n is equal to N (step S407 illustrated in
[0109] As described above, while N (sets of) areas of the validness flags AF #1 to AF #N are prepared in the descriptor 1110, a sequence in which the validness flags AF #1 to AF #N are checked is determined in advance. For example, in the example illustrated in
[0110] In the descriptor 1110, N sets of areas in which received data sizes L #1 to L #N and reception completion flags WF #1 to WF #N are written are also prepared. The DMA controller 1111 writes the received data size L #n and the reception completion flag WF #n into an area of a number corresponding to the n-th validness flag AF #n from which the n-th start address A #n has been checked to be valid.
[0111] In a case in which the data to be transferred to the packet memory 101 is a combined packet (in a case in which the number k of combined packets is equal to or larger than two), the DMA controller 1111 checks the number k of combined packets (step S409 illustrated in
[0112] In addition, in the case of n=N, the DMA controller 1111 may check the validness flags AF #1 to AF #(k1). In a case in which n<N, and n+k1>N, the DMA controller 1111 may check the validness flags AF #(n+1) to AF #N and from AF #1 to AF #(k1(Nn)).
[0113] In a case in which all the k validness flags that have been checked by the processes of steps S402 and S410 are valid (Yes in step S410), the DMA controller 1111 reads an n-th start address A #n corresponding to the first validness flag AF #n among the checked k validness flags from the descriptor 1110 (step S411 illustrated in
[0114] After the completion of this DMA transfer, the DMA controller 1111 writes received data sizes L #n to L #(n+k1) representing packet lengths of packets configuring the combined packet that has been DMA transferred to the packet memory 101 into the descriptor 110 based on the information (the size of each of packets that have been combined) notified from the packet combining unit 110 (step S413 illustrated in
[0115] In addition, in the case of n=N, the DMA controller 111 may write a received data size L #n and received data sizes from L #1 to L #(k1) into the descriptor 110. In a case in which n<N and n+k1>N, the DMA controller 111 may write a received data size L # and received data sizes from L #n(n+1) to L #N and from L #1 to L #(k1(Nn)) into the descriptor 1110.
[0116] Subsequently, the DMA controller 11 rewrites (k1) start addresses A #(n+1) to A #(n+k1) inside the descriptor 1110 in accordance with packet lengths of the first (k1) packets among k packets configuring the combined packet (step S414 illustrated in
[0117] More specifically, the DMA controller 1111 rewrites the start address A #(n+1) to a value acquired by adding the start address A #n and the packet length of the first packet (a value indicated by the received data size L #n) among k packets configuring the combined packet. In addition, the DMA controller 1111 rewrites an start address A #(n+k1) to a value acquired by adding the start address A #(n+k2) and the packet length of the (k 1)-th packet (a value indicated by the received data size L #(n+k2)) among k packets configuring the combined packet.
[0118] In this way, in a case in which a start address A #1 is to be rewritten, the DMA controller 1111 may rewrite the start address A #1 to a value acquired by adding a previous start address A #(i1) and the packet length of an (i1)-th packet among the packets configuring the combined packet.
[0119] Next, the DMA controller 1111 rewrites reception completion flags WF #n to WF #(n+k1) each corresponding to the packets configuring the combined packet that has been DMA transferred to the packet memory 101 from not-completed to completed (step S415 illustrated in
[0120] In addition, in the case of n=N, the DMA controller 1111 may rewrite the reception completion flag WF #n and the reception completion flags WF #1 to WF #(k1) from not-completed to completed. In a case in which n<N, and n+k1>N, the DMA controller 1111 may rewrite the reception completion flag WF #n, reception completion flags WF #(n+1) to WF #N, and reception completion flags WF #1 to WF #(k1(Nn)) to completed.
[0121] Then, the DMA controller 1111 checks whether n+k>N is satisfied (step S416 illustrated in
[0122] In this way, in the DMA transfer according to this embodiment, by arranging a combined packet in which k packets are combined, transferring the combined packet to the packet memory 101, and partially rewriting the information of the start addresses of the descriptor 1110, an address in which the start of each packet is written is notified to the processor (the reception processing unit 103 and the protocol processing unit 104) of the packet processing device.
[0123] The reception processing unit 103 (software executed by the processor) regularly checks the reception completion flags WF #n (here, n is 1 to N) of the descriptor 1110 and, in a case in which the reception completion flag WF #n indicates completed (Yes in step S501 illustrated in
[0124] After a necessary process is performed by the protocol processing unit 104 (Yes in step S503 illustrated in
[0125] In the descriptor 1110, while there are N (sets of) areas of the reception completion flags WF #1 to WF #N, a sequence in which the reception completion flags WF #1 to WF #N are checked is determined in advance. For example, the reception processing unit 103 (software executed by the processor) checks reception completion flags in a sequence of the first reception completion flag WF #1, the second reception completion flag WF #2, . . . , the N-th reception completion flag WF #N. After the checking is completed once, the reception processing unit 103 checks the reception completion flags from the first reception completion flag WF #1 again.
[0126] In addition, instead of regularly checking the reception completion flags WF #n of the descriptor 1110, the DMA controller 1111 may be configured to issue an interrupt processing request for the processor after the completion of the DMA transfer, and the reception processing unit 103 (software executed by the processor) may be configured to check the reception completion flags WF #n (here, n is 1 to N) of the descriptor 1110 in response to this interrupt processing request.
[0127] The operations of the processor (software) described above are equivalent to the operations of the processor (software) of a technology in a related art having the configuration of
[0128] As described above, the packet processing device according to this embodiment includes the combined packet transferring unit 11 in which a means (the DMA controller 1111) that can realize collected DMA transfer and write information used for restoring a combined packet into a plurality of original packets into the descriptor 1110 is built in. The DMA controller 1111 can be realized by hardware, and thus a restoration process using software does not need to be executed, and high reception performance according to effects of the collected DMA transfer can be realized.
[0129] In addition, compared to a case in which the process of restoring a combined packet to a plurality of original packets is executed by the processor (software) in the packet processing device having the configuration in a related art illustrated in
[0130] In this embodiment, software used for the reception processing unit 103 and the protocol processing unit 104 having the configuration illustrated in
[0131] In addition, in this embodiment, an address area on the packet memory 101 that is prepared by the processor (software) is shared by a plurality of packets, and therefore, the address area cannot be reused until the process of receiving all the packets sharing the area (transferring all the packets to the protocol processing unit 104) is completed.
[0132] The transfer managing unit 112 (software executed by the processor) needs to prepare an address area having a size for which a combined packet having a maximum size can be written and set the address area in the descriptor 110. The maximum size of the combined packet has a value acquired by adding an allowed maximum packet length to a threshold set by the combination threshold control unit 107.
[0133] In addition, in order to normally perform collected DMA transfer using the packet processing device according to this embodiment, the transfer managing unit 112 (software executed by the processor) needs to secure a buffer area of NxDB_mux (here, DB_mux is a maximum size of a combined packet) inside the packet memory 101 in advance. Such area securement is equivalent to that of the case of the configuration illustrated in
[0134] For example, in this embodiment, in a case in which the buffer area described above is prepared in a continuous area inside the packet memory 101, a start address of this buffer area is the start address A #1, which is illustrated in
[0135] In accordance with such area securement, even in a case in which a transfer destination address of DMA transfer of a combined packet becomes A #N, an area corresponding to DB_mux is secured in the packet memory 101 from this address A #N to a last address of the buffer area described above, and therefore, a combined packet can be reliably written in a continuous area corresponding to DB_mux.
[0136] In a case in which an area from the address A #N to the last address of the buffer area is smaller than DB_mux, a case in which a part of the combined packet to be written is written into an area in which the combined packet is not to be originally written occurs.
[0137] In addition, for example, in a case in which a buffer area to be secured inside the packet memory 101 is prepared as not a continuous area but N non-continuous areas, by preparing N areas corresponding to DB_mux in advance and setting start addresses of the areas to A #1 to A #N by the transfer managing unit 112 (software executed by the processor), a combined packet can be reliably written into a continuous area corresponding to DB_mux, and a defect of writing a combined packet into an area in which the combined packet is not to be written originally does not occur.
[0138] In the packet processing device according to this embodiment, the DMA controller 1111 rewrites the information (the start address, the received data size, and the reception completion flag) of the descriptor 1110 after DMA transfer, whereby a restoration process using software is not required.
[0139] In order to realize the restoration process using hardware of the reception processing unit 103, the protocol processing unit 104, or the combined packet separating unit 108 illustrated in
[0140] In addition, in order to realize the restoration process by hardware of the reception processing unit 103, the protocol processing unit 104, or the combined packet separating unit 108 illustrated in
[0141] In contrast to this, in the packet processing device according to this embodiment, the restoration process for a combined packet is completed at a time point at which DMA transfer of one combined packet is completed, and therefore, information corresponding to a plurality of combined packets does not need to be stored. Therefore, the scale of the hardware according to this embodiment is smaller than that of a case in which the restoration process is realized by hardware of the reception processing unit 103, the protocol processing unit 104, or the combined packet separating unit 108 illustrated in
[0142] In addition, as a means for the packet combining unit 106 to notify the reception processing unit 103, the protocol processing unit 104, or the combined packet separating unit 108 illustrated in
[0143] However, in a case in which information required for the restoration process is written inside a combined packet, a part of the band of a bus used for the DMA transfer is occupied by the information required for the restoration process. Therefore, an effective band that can be used for transferring the original packet data decreases, and, as a result, there is a problem in that the performance of the DMA transfer deteriorates.
[0144] In the packet processing device according to this embodiment, the information required for the restoration process does not need to be written into a combined packet, and therefore, the deterioration of the effective band as described above does not occur.
[0145] Although an example in which the combined packet transferring unit 11 is realized by hardware has been illustrated in this embodiment, at least some processes of the combined packet transferring unit 111 may be realized by a processor different from the processor used for a reception process and software. Even in a case in which at least some of the processes of the combined packet transferring unit 111 are realized by software in this way, the process of restoring a combined packet to a plurality of original packets does not need to be performed by the reception processing unit 103 or the protocol processing unit 104, whereby high reception performance according to effects of collected DMA transfer can be realized.
[0146] In addition, even in a case in which at least some of the processes of the combined packet transferring unit 111 are realized by software, similar to a case in which the combined packet transferring unit 111 is realized by hardware, an effect of decreasing the scale of the hardware required for the process of restoring a combined packet to a plurality of original packets (an effect owing to no need for storing information corresponding to a plurality of combined packets) and an effect of no occurrence of deterioration of the effective band that can be used for transferring packet data (an effect owing to no addition of information required for the restoration process inside a combined packet) can be acquired.
[0147] As a variation of this embodiment, an area of a rewrite execution flag indicating whether a start address has been rewritten may be added to the descriptor 1110. For example, in a case in which the processor mounting the transfer managing unit 112 performing initial setting of the start addresses A #1 to A #N includes a cache storage device, the start addresses A #1 to A #N written in the descriptor 1110 are copied to inside the cache storage device.
[0148] However, when a start address stored inside the descriptor 1110 is rewritten by the DMA controller 1111, there are cases in which corresponding information inside the cache storage device of the processor mounting the transfer managing unit 112 is not rewritten. Also in such cases, the processor can refer to the rewrite execution flag for reading not the information stored inside the cache storage device but the information stored inside the descriptor 1110.
[0149] More specifically, the processor may read and use the information stored inside the cache storage device in a case in which it is determined that start addresses stored inside the descriptor 1110 cannot be rewritten as a result of referring to the rewrite execution flag and may temporarily invalidate the cache and directly use and read start addresses stored inside the descriptor 1110 in a case in which it is determined that start addresses stored inside the descriptor 110 can be rewritten.
[0150] The combined packet transferring unit 11 may rewrite a corresponding rewrite execution flag stored inside the descriptor 1110 from non-rewritten to rewritten when the start address stored inside the descriptor 110 are rewritten in the process of step S414 illustrated in
[0151] As another modified example of this embodiment, in addition to the area of start addresses written by the transfer managing unit 112 (software executed by the processor), an area in which start addresses after change are written by the DMA controller 1111 may be prepared in the descriptor 1110. In such a case, the reception processing unit 103 (software executed by the processor) refers to the area in which start addresses after change are written. The process described in step S414 illustrated in
[0152] In addition, in this embodiment, a plurality of DMA controllers 1111 and a plurality of descriptors 1110 corresponding to the DMA controllers 1111 may be configured to be mounted. In addition, the packet combining unit 110 may be configured to determine a type of packet and collect packets of the same type as a combined packet or may be configured to use the plurality of DMA controllers 1111 and the plurality of descriptors 1110 in a divisional manner in accordance with a type of packet.
[0153] When a configuration in which a DMA controller 1111 and a descriptor 1110 are prepared for each type of packet, and a plurality of DMA controllers 1111 and a plurality of descriptors 1110 are used in a divisional manner in accordance with a type of packet is employed, a different reception process may be easily performed for each type of packet.
[0154] In addition, in this embodiment, a configuration in which a plurality of DMA controllers 1111 and a plurality of descriptors 1110 are used in a divisional manner for each core of the processor in which a plurality of CPU cores are built may be employed, or a configuration in which a plurality of DMA controllers 1111 and a plurality of descriptors 1110 are used in a divisional manner for each virtual machine may be employed.
[0155] By employing the configuration in which the plurality of DMA controllers 1111 and the plurality of descriptors 1110 are used in a divisional manner for each CPU core or for each virtual machine, the performance of the reception process implemented by software can be improved compared to a case in which there is only one DMA controller or the like.
Second Example
[0156] Next, a second example of the present invention will be described. Although the first embodiment has been described on the premise of a case in which DMA transfer is used, there are cases in which effective throughput of writing for the packet memory increases in accordance with collective writing of collecting a combined packet acquired by combining a plurality of packets and writing the combined packet in the packet memory increases (for example, a case in which the packet memory is configured using a dynamic random access memory (DRAM) and the like) also in a packet processing device not using DMA transfer.
[0157]
[0158] A difference between the configuration illustrated in
[0159] The line adapter 100, the packet memory 101, the reception processing unit 103, the protocol processing unit 104, the reception buffer 105, the combination threshold control unit 107, and the transfer managing unit 112 are equivalent to the components illustrated in
[0160] The packet combining unit 110 illustrated in
[0161] In addition, the packet combining unit 110 may be configured to issue a transfer request in a case in which a timeout has occurred (in a case in which a reception interval between packets exceeds a period set in advance or the like) before the size of the combined packet in the reception buffer 105 exceeds the threshold.
[0162] In addition, the packet combining unit 110 records the number of packets combined in the reception buffer 105 and the size of each packet and notifies the combined packet transferring unit 113 of information of the number of combined packets and the size of each packet when issuing a request for transferring a combined packet.
[0163] The combined packet transferring unit 113 (software executed by the processor) writes a combined packet in which a plurality of packets are combined into the packet memory 101 and requests to activate the reception processing unit 103. In addition, the combined packet transferring unit 113 (software executed by the processor) writes information such as size and the like into the descriptor 1130 prepared for each packet using the information of the number of packets combined and the size of each packet notified from the packet combining unit 110.
[0164] As illustrated in
[0165]
[0166] In a case in which the validness flag AF #n indicates that the start address A #n is valid (Yes in step S602 illustrated in
[0167] In a case in which the data to be transferred to the packet memory 101 is not a combined packet, the combined packet transferring unit 113 reads a start address A #n of which the validness flag AF #n has been checked to be valid from the descriptor 1130 (step S604 illustrated in
[0168] After completion of this writing, the combined packet transferring unit 113 writes the received data size L #n into the descriptor 1130 and rewrites the reception completion flag WF #n set in the descriptor 1130 from the not-completed to completed (step S606 illustrated in
[0169] In a case in which the data to be transferred to the packet memory 101 is a combined packet, the combined packet transferring unit 113 checks the number of k combined packets (step S609 illustrated in
[0170] In a case in which all the checked k validness flags are valid (Yes in step S610), the combined packet transferring unit 113 reads a start address A #n corresponding to the first validness flag AF #n among the checked k validness flags from the descriptor 1130 (step S611 illustrated in
[0171] After completion of this writing, the combined packet transferring unit 113 writes received data sizes L #n to L #(n+k1) indicating packet lengths of the packets configuring the combined packet written into the packet memory 101 into the descriptor 1130 (step S613 illustrated in
[0172] Subsequently, the combined packet transferring unit 113 rewrites (k1) start addresses A #(n+1) to A #(n+k1) inside the descriptor 1130 in accordance with the packet lengths of the first (k1) packets among the k packets configuring the combined packet (step S614 illustrated in
[0173] Next, the combined packet transferring unit 113 rewrites the reception completion flags WF #n to WF #(n+k1) corresponding to each packet configuring the combined packet written into the packet memory 101 from not-completed to completed (step S615 illustrated in
[0174] The processes of steps S609 to S615 and steps S616 to S618 described above are equivalent to those of steps S409 to S418 illustrated in
[0175] In this way, the packet processing device according to this embodiment includes a means (the combined packet transferring unit 113) that can realize collected writing and write information used for restoring a combined packet into a plurality of original packets into the descriptor 1130. According to this embodiment, execution of the reception processing unit 103 of the restoration process, the protocol processing unit 104, or the combined packet separating unit 108 illustrated in
[0176] In this embodiment, software for the reception processing unit 103 and the protocol processing unit 104 having the configuration illustrated in
[0177] In addition, in order to normally perform collected writing described with reference to
[0178] In the packet processing device according to this embodiment, the combined packet transferring unit 113 rewrites the information (the start address, the received data size, and the reception completion flag) of the descriptor 1130 after completion of collected writing, a restoration process is not required.
[0179] In order to realize the restoration process using the reception processing unit 103, the protocol processing unit 104, or the combined packet separating unit 108 illustrated in
[0180] In addition, in order to realize the restoration process using the reception processing unit 103, the protocol processing unit 104, or the combined packet separating unit 108 illustrated in
[0181] In contrast to this, in the packet processing device according to this embodiment, the restoration process for a combined packet is completed at a time point at which collected writing of one combined packet is completed, and therefore, information corresponding to a plurality of combined packets does not need to be stored. Therefore, the scale of the hardware according to this embodiment is smaller than that of a case in which the restoration process is realized using the reception processing unit 103, the protocol processing unit 104, or the combined packet separating unit 108 illustrated in
[0182] For example, in a case in which all the components other than the packet memory 101 and the line adapter 100 in the configuration illustrated in
[0183] In contrast to this, in a case in which all the components other than the packet memory 101 and the line adapter 100 are realized by software in the configuration according to this embodiment, information corresponding to a plurality of combined packets (the number of combined packets and a size of each packet) does not need to be stored, in other words, the information (the number of combined packets and a size of each packet) required for the restoration process corresponding to only one combined packet may be stored in the packet memory 101 or the like.
[0184] In other words, in the configuration according to this embodiment, the capacity (the number of writeable bits) of the packet memory 101 and the like used for storing the information (the number of combined packets and a size of each packet) required for the restoration process may be smaller than that of the configuration illustrated in
[0185] In addition, as a means for the packet combining unit 106 to notify the reception processing unit 103, the protocol processing unit 104, or the combined packet separating unit 108 illustrated in
[0186] In the packet processing device according to this embodiment, information required for the restoration process can be stored not in the packet memory 101 but in another memory (for which only writing from the packet combining unit 110 and reading from the combined packet transferring unit 113 may be able to be performed) not using the bus to which the packet memory 101 is connected, and thus, deterioration of the effective band as described above does not occur.
[0187] Similar to the first embodiment, as a modification of this embodiment, an area of a rewrite execution flag indicating whether a start address has been rewritten may be added to the descriptor 1130. In this case, when a start address inside the descriptor 1130 is rewritten in the process of Step S614 illustrated in
[0188] In addition, similar to the first embodiment, in addition to the area of start addresses written by the transfer managing unit 112 (software executed by the processor), an area in which start addresses after change are written by the combined packet transferring unit 113 may be prepared in the descriptor 1130.
[0189] In addition, in this embodiment, the packet combining unit no may be configured to determine a type of packet and collect packets of the same type as a combined packet or may be configured to use a plurality of descriptors 1130 in accordance with a type of packet. When a configuration in which a descriptor 1130 is prepared for each type of packet, and a plurality of descriptors 1130 are used in accordance with the type of the packet, a different reception process may be easily performed for each type of packet.
[0190] In addition, in this embodiment, a configuration in which a plurality of descriptors 1130 are used for each core of the processor in which a plurality of CPU cores are built may be employed, or a configuration in which a plurality of descriptors 1130 are used for each virtual machine may be employed. By employing the configuration in which the plurality of descriptors 1130 are used for each CPU core or for each virtual machine, the performance of a reception process and a writing process implemented by software can be improved compared to a case in which there is only one descriptor 1130.
[0191] In the packet processing devices according to the first and second embodiments, the packet memory 101, the transfer managing unit 112, the reception processing unit 103, the protocol processing unit 104, and the combined packet transferring unit 113 may be realized by a computer including a processor, a storage device, and an interface and a program for controlling these hardware resources.
[0192] In such a computer, the program for realizing the packet processing method according to the present disclosure is stored in the storage device. The processor executes the processes described in the first and second embodiments in accordance with the program stored in the storage device. In addition, some processes of the combined packet transferring unit 111 may be realized by a computer.
INDUSTRIAL APPLICABILITY
[0193] Embodiments of the present invention can be applied to technologies for performing protocol processing, a transfer process, and the like of communication data.
REFERENCE SIGNS LIST
[0194] 100 Line adapter [0195] 101 Packet memory [0196] 103 Reception processing unit [0197] 104 Protocol processing unit [0198] 105 Reception buffer [0199] 107 Combination threshold control unit [0200] 110 Packet combining unit [0201] 111, 113 Combined packet transferring unit [0202] 112 transfer managing unit [0203] 1110 1130 Descriptor [0204] 1111 DMA controller.