Packet Processing Device and Packet Processing Method

20210034559 ยท 2021-02-04

    Inventors

    Cpc classification

    International classification

    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] FIG. 1 is a block diagram illustrating a configuration of a packet processing device according to a first embodiment of the present invention.

    [0051] FIG. 2 is a diagram illustrating an overview of a descriptor of a packet processing device according to the first embodiment of the present invention.

    [0052] FIG. 3 is a flowchart illustrating operations of a transfer managing unit of a packet processing device according to the first embodiment of the present invention.

    [0053] FIG. 4 is a flowchart illustrating operations of a DMA controller of a packet processing device according to the first embodiment of the present invention.

    [0054] FIG. 5 is a flowchart illustrating operations of a DMA controller of a packet processing device according to the first embodiment of the present invention.

    [0055] FIG. 6 is a flowchart illustrating operations of a reception processing unit of a packet processing device according to the first embodiment of the present invention.

    [0056] FIG. 7 is a block diagram illustrating a configuration of a packet processing device according to a second embodiment of the present invention.

    [0057] FIG. 8 is a diagram illustrating an overview of a descriptor of a packet processing device according to the second embodiment of the present invention.

    [0058] FIG. 9 is a flowchart illustrating operations of a combined packet transferring unit of a packet processing device according to the second embodiment of the present invention.

    [0059] FIG. 10 is a flowchart illustrating operations of a combined packet transferring unit of a packet processing device according to the second embodiment of the invention.

    [0060] FIG. 11 is a block diagram illustrating a configuration of a packet processing device in a related art.

    [0061] FIG. 12 is a diagram illustrating an overview of a descriptor of the packet processing device illustrated in FIG. 11.

    [0062] FIG. 13 is a flowchart illustrating operations of a DMA controller of the packet processing device illustrated in FIG. 11.

    [0063] FIG. 14 is a block diagram illustrating another configuration of a packet processing device in a related art.

    [0064] FIG. 15 is a diagram illustrating an overview of a descriptor of the packet processing device illustrated in FIG. 14.

    [0065] FIG. 16 is a flowchart illustrating operations of a DMA controller of the packet processing device illustrated in FIG. 14.

    [0066] FIG. 17 is a block diagram illustrating another configuration of a packet processing device in a related art.

    [0067] FIG. 18 is a block diagram illustrating another configuration of a packet processing device in a related art.

    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. FIG. 1 is a block diagram illustrating a configuration of a packet processing device according to a first embodiment of the present invention.

    [0069] The packet processing device illustrated in FIG. 1 includes the following. A first component, similar to the configuration illustrated in FIG. 14, is a line adapter 100 that is connected to a communication line (not illustrated) and receives data from the communication line. A second component is a packet memory 101 that stores packets received from the communication line. A third component is a reception processing unit 103 that delivers packets stored in the packet memory 101 to a protocol processing unit 104. A fourth component is the protocol processing unit 104 that performs protocol processing of packets. A fifth component is a reception buffer 105 for combining packets. A sixth component is a combination threshold control unit 107 in which a threshold used for regulating the size of a combined packet is set in advance. A seventh component is a packet combining unit 110 that generates one combined packet by combining a plurality of packets received from the communication line in the reception buffer 105. An eighth component is a combined packet transferring unit 111 that performs DMA transfer of a combined packet generated by the packet combining unit 110 to the packet memory 101. A ninth component is a transfer managing unit 112 that performs initial setting of a descriptor 1110 that is a data area on a memory that is set in advance. The transfer managing unit 112 may be configured as a part of the reception processing unit 103.

    [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 FIG. 14.

    [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 FIG. 11.

    [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 FIG. 11.

    [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] FIG. 2 illustrates a configuration example of the descriptor 1110 used by the combined packet transferring unit 111 according to this embodiment. Generally, a data structure that records an address of the packet memory 101 for reception processing and the like is referred to as a descriptor 1110. In the example illustrated in FIG. 2, a case in which N packets are stored in packet memory 101 is illustrated.

    [0084] The descriptor 1110 illustrated in FIG. 2 is a data structure in which a plurality of (N sets of) start addresses A #1 to A #N of writing destinations of received packets, validness 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 packet lengths of packets written into the start addresses A #1 to A #N, and reception completion flags WF #1 to WF #N indicating whether writing of packets into each of the start addresses A #1 to A #N has been completed can be written. This configuration of the descriptor 1110 is equivalent to the configuration of the descriptor 1020 for reception processing that is generally used in the configuration illustrated in FIG. 11.

    [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 FIG. 12 and FIG. 13.

    [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 FIG. 12, the processor writes information in a sequence of a first start address A #1, a second start address A #2, . . . , and an N-th start address A #N.

    [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 FIG. 13), reads the start address A #n from the descriptor 1020 (step S103 illustrated in FIG. 13) and writes a corresponding n-th packet into an area starting from the start address A #n of the packet memory 101 (step S104 illustrated in FIG. 13).

    [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 FIG. 13).

    [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 FIG. 12 and FIG. 13, the DMA controller 1021 checks validness flags in a sequence of a first validness flag AF #1, a second validness flag AF #2, . . . , an N-th validness flag AF #N. After the checking is completed once, the validness flags are checked in a sequence from the first validness flag AF #1 again.

    [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 FIG. 12 and FIG. 13, the processor checks the reception completion flags in a sequence of a first reception completion flag WF #1, a second reception completion flag WF #2, . . . , an N-th reception completion flag WF #N. After the checking is completed once, the reception completion flags are checked in a sequence from the first reception completion flag WF #1 again.

    [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 FIG. 2 will be described with reference to FIG. 1 to FIG. 6. FIG. 3 is a flowchart illustrating operations of the transfer managing unit 112, FIG. 4 and FIG. 5 are flowcharts illustrating operations of the DMA controller 1111, and FIG. 6 is a flowchart illustrating operations of the reception processing unit 103.

    [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 FIG. 3). In addition, the transfer managing unit 112 rewrites the validness flag AF #n, which indicates whether the start address A #n is valid, from invalid to valid (step S301 illustrated in FIG. 3).

    [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 FIG. 2, the transfer managing unit 112 writes information in a sequence of the first start address A #1, the second start address a #2, . . . , the N-th start address A #N.

    [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 FIG. 4)

    [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 FIG. 4).

    [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 FIG. 4), the DMA controller 1111 checks information from the packet combining unit 110 (the number of combined packets and the size of each packet) and checks whether data to be transferred to the packet memory 101 is a single packet that has not been combined or a combined packet (step S403 illustrated in FIG. 4).

    [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 FIG. 4) and performs DMA transfer of writing a corresponding n-th packet into an area starting from the start address A #n of the packet memory 101 (step S405 illustrated in FIG. 4).

    [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 FIG. 4).

    [0108] The DMA controller 1111 determines whether the variable n is equal to N (step S407 illustrated in FIG. 4). In a case in which the variable n has not reached N (No in step S407), the DMA controller 1111 increases the variable n by i (step S408 illustrated in FIG. 4) and returns the process to step S401. In a case in which the variable n has reached N (Yes in step S407), the DMA controller 1111 returns the process to step S400.

    [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 FIG. 2 and FIG. 4, the DMA controller 1111 checks the validness flags in a sequence of the first validness flag AF #1, the second validness flag AF #2, . . . , the N-th validness flag AF #N. After the checking is completed once, the DMA controller 1111 initializes the variable n to 1 (step S400) and checks the validness flags in a sequence from the first validness flag AF #1.

    [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 FIG. 5) and checks (k1) validness flags AF #(n+1) to AF #(n+k1) inside the descriptor 1110 (step S410 illustrated in FIG. 5). Here, the reason for checking the (k1) validness flags is that the n-th validness flag AF #n has already been checked in step S402.

    [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 FIG. 5) and performs DMA transfer of writing a corresponding combined packet into an area starting from the start address A #n of the packet memory 101 (step S412 illustrated in FIG. 5).

    [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 FIG. 5).

    [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 FIG. 5).

    [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 FIG. 5).

    [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 FIG. 5) and, in a case in which (n+k) is larger than N, sets the variable to n=n+kN (step S417 illustrated in FIG. 5) and causes the process to return to step S401. In addition, in a case in which (n+k) is equal to or smaller than N, the DMA controller 1111 sets the variable n to n=n+k (step S418 illustrated in FIG. 5) and returns the process to step S401.

    [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 FIG. 6), reads an n-th packet from the packet memory 101 based on the information of an n-th start address A #n and the information of the received data size L #n corresponding thereto, and delivers the read n-th packet to the protocol processing unit 104 (step S502 illustrated in FIG. 6).

    [0124] After a necessary process is performed by the protocol processing unit 104 (Yes in step S503 illustrated in FIG. 6), the reception processing unit 103 (software executed by the processor) rewrites an n-th validness flag AF #n of the descriptor 1110 that corresponds to the n-th packet of which protocol processing has been completed from valid to invalid and rewrites the n-th reception completion flag WF #n of the descriptor 1110 from completed to not-completed (step S504 illustrated in FIG. 6).

    [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 FIG. 11, and the process of restoring a combined packet into a plurality of original packets does not need to be realized using software for a reception process. In other words, the reception processing unit 103 and the protocol processing unit 104 may perform the same process as in a case in a related art even in the case where a combined packet is written into the packet memory 101 as in this embodiment.

    [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 FIG. 14 or the configuration illustrated in FIG. 17, in this embodiment, the restoration process does not need to be performed using the processor (software). Therefore, the process of the processor required for processing one packet becomes light, and there is an effect of improving the reception performance (increasing the number of packets that can be processed per unit time). In addition, in this embodiment, there is also an effect of decreasing the power consumption of the processor that is required for processing one packet.

    [0130] In this embodiment, software used for the reception processing unit 103 and the protocol processing unit 104 having the configuration illustrated in FIG. 1 can be directly used in the packet processing device according to this embodiment. This illustrates that, by simply changing the hardware (the DMA controller 11n), improvement of reception performance according to collected DMA can be realized.

    [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 FIG. 14.

    [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 FIG. 2, set by the transfer managing unit 112 (software executed by the processor). On the other hand, a last address of the buffer area becomes the start address A #1+(NDB_mux)1. In this case, the start address A #N, which is illustrated in FIG. 2, set by the transfer managing unit 112 (software executed by the processor) is the start address A #1+(N1)DB_mux.

    [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 FIG. 17, a means for the packet combining unit 106 to notify the reception processing unit 103 and the protocol processing unit 104 or the combined packet separating unit 108 illustrated in FIG. 17 of information (the number of combined packets and the size of each packet) required for the restoration process is required.

    [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 FIG. 17, it should be considered that information, which is required for the restoration process, corresponding to a plurality of combined packets needs to be stored depending on a situation until a reception process is activated after the completion of DMA transfer.

    [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 FIG. 17.

    [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 FIG. 17 of information required for the restoration process, the information required for the restoration process may be written inside a combined packet. More specifically, in order to notify of the size of each combined packet, for example, a method in which a header in which a packet size and the like are written is added before each packet, and the added header is DMA transferred together with packet data may be considered.

    [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 FIG. 5.

    [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 FIG. 5 is a process not for rewriting start address but for writing start addresses after change.

    [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] FIG. 7 is a block diagram illustrating a configuration of a packet processing device according to the second embodiment of the present invention. The packet processing device illustrated in FIG. 7 includes a line adapter 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 combining unit 110, a transfer managing unit 112, and a combined packet transferring unit 113.

    [0158] A difference between the configuration illustrated in FIG. 7 and the configuration illustrated in FIG. 1 is that the transfer means illustrated in FIG. 1 is replaced by a writing means according to a processor (software) of the packet processing device. In other words, this embodiment is acquired by replacing the combined packet transferring unit in illustrated in FIG. 1 with the combined packet transferring unit 113 according to software.

    [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 FIG. 1.

    [0160] The packet combining unit 110 illustrated in FIG. 7 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 the packet in the reception buffer 105 so as to combine the packet received by the line adapter 100 and packets already stored in the reception buffer 105 to become one combined packet. When the size of a combined packet in the reception buffer 105 exceeds a threshold set by the combination threshold control unit 107, the packet combining unit 110 issues a request for transferring the combined packet to the packet memory 101.

    [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 FIG. 8, the configuration of the descriptor 1130 is equivalent to that of the descriptor 1110 according to the first embodiment. However, in this embodiment, the combined packet transferring unit 113 (software executed by the processor) performs writing for the descriptor 1130 instead of the combined packet transferring unit 111, which is different from that according to the first embodiment.

    [0165] FIG. 9 and FIG. 10 are flowcharts illustrating operations of the combined packet transferring unit 113 (software executed by the processor). First, the combined packet transferring unit 113 initializes the variable n to 1 (step S600 illustrated in FIG. 9) and checks the validness flag AF #n of the descriptor 1130 after the transfer request is issued from the packet combining unit 110 (step S601 illustrated in FIG. 9).

    [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 FIG. 9), the combined packet transferring unit 113 checks whether data to be transferred to the packet memory 101 is a single packet or a combined packet by checking the information from the packet combining unit 110 (step S603 illustrated in FIG. 9).

    [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 FIG. 9) and writes a corresponding n-th packet into an area starting from the start address A #n of the packet memory 101 (Step S605 illustrated in FIG. 9).

    [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 FIG. 9). The processes of steps S600 to S606 and steps S607 and S608 are equivalent to the processes of steps S400 to S408 illustrated in FIG. 4.

    [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 FIG. 10) and checks (k1) validness flags AF #(n+1) to AF #(n+k1) inside the descriptor 1130 (step S610 illustrated in FIG. 10).

    [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 FIG. 10) and writes a corresponding combined packet into an area starting from the start address A #n of the packet memory 101 (step S612 illustrated in FIG. 1).

    [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 FIG. 1).

    [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 FIG. 1).

    [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 FIG. 1).

    [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 FIG. 5. In steps S610, S613, and S615, in a case in which n=N or n<N and n+k1>N, the processes described in steps S410, S413, and S415 may be performed.

    [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 FIG. 17 is not necessary, and high reception performance owing to effects of collected writing can be realized.

    [0176] In this embodiment, software for the reception processing unit 103 and the protocol processing unit 104 having the configuration illustrated in FIG. 1i can be directly used in the packet processing device according to this embodiment.

    [0177] In addition, in order to normally perform collected writing described with reference to FIG. 9 and FIG. 10 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. This area securement is equivalent to that of the case of the configurations illustrated in FIG. 14 and FIG. 1.

    [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 FIG. 18, a means for the packet combining unit 106 to notify the reception processing unit 103 and the protocol processing unit 104 or the combined packet separating unit 108 illustrated in FIG. 18 of information (the number of combined packets and the size of each packet) required for the restoration process is required.

    [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 FIG. 18, it should be considered that information, which is required for the restoration process, corresponding to a plurality of combined packets needs to be stored depending on a situation until a reception process is activated after completion of the collected writing.

    [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 FIG. 18. This is the same also when compared to a case in which the process of restoring a combined packet into a plurality of original packets is implemented by software.

    [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 FIG. 18 are realized by software, the information (the number of combined packets and a size of each packet) required for a restoration process corresponding to a plurality of combined packets needs to be stored in the packet memory 101 or the like.

    [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 FIG. 18, and therefore, the scale of required hardware can be reduced.

    [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 FIG. 18 of information required for the restoration process, the information required for the restoration process may be written inside a combined packet. More specifically, in order to notify of the size of each combined packet, for example, a method in which a header in which a packet size and the like are written is added before each packet, and the added header is written together with packet data may be considered. However, in this case, a part of the band of a bus used for the collected writing is occupied by the information required for the restoration process. Therefore, an effective band that can be used for writing the original packet data decreases, and, as a result, the performance of collected writing deteriorates.

    [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 FIG. 10, the combined packet transferring unit 113 may rewrite a corresponding rewrite execution flag inside the descriptor 1130 from the rewriting non-executed to rewriting executed.

    [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.