INFORMATION PROCESSING APPARATUS, COMPUTER-READABLE RECORDING MEDIUM HAVING STORED THEREIN INFORMATION PROCESSING PROGRAM, AND METHOD FOR PROCESSING INFORMATION
20220413890 · 2022-12-29
Assignee
Inventors
Cpc classification
International classification
G06F9/455
PHYSICS
G06F9/50
PHYSICS
Abstract
An apparatus includes: a storing device including regions allocated to virtual machines (VMs); a processing device executing the VMs; a relay device executing a relaying process; and a transfer processor transferring data between the regions. The processing device stores a first and second numbers associated with a used entry among first entries allocated to the transfer processor and a used entry among second entries allocated to the relay device, respectively, the first and second numbers being included in numbers associated with entries of a reception buffer in a first region allocated to a first VM; and sets a smaller first and second numbers in the processing device to a number being set in the first region and representing an entry of data read from the reception buffer.
Claims
1. An information processing apparatus comprising: a storing device comprising a plurality of storing regions allocated one to each of a plurality of virtual machines; a processing device that is connected to the storing device and that executes the plurality of virtual machines; a relay device that is connected to the processing device and that executes a relaying process, serving as a virtual switch that connects the plurality of virtual machines to one another; and a transfer processor that transfers data between the plurality of storing regions, wherein the processing device stores a first used identification number associated with a used entry among a plurality of first entries allocated to the transfer processor and a second used identification number associated with a used entry among a plurality of second entries allocated to the relay device, the first used identification number and the second used identification number being included in a plurality of identification numbers each associated with one of a plurality of entries of a reception buffer included in a first storing region allocated to a first virtual machine among the plurality of virtual machines; and sets a smaller one of the first used identification number and the second used identification number stored in the processing device, to an identification number being set in the first storing region and representing an entry of data read from the reception buffer by the first virtual machine.
2. The information processing apparatus according to claim 1, wherein the processing device sets first information in the first storing region, the first information representing which one of the transfer processor and the relay device is allocated to each of the plurality of entries.
3. The information processing apparatus according to claim 2, wherein the processing device in a case where the entry associated with the first used identification number is not used for a first given time period, writes dummy data into each of entries from the entry associated with the first used identification number to a last entry allocated to the transfer processor and sets an identification number of the last entry in the first used identification number; and sets the first used identification number in the identification number set in the first storing region.
4. The information processing apparatus according to claim 2, wherein the transfer processor in forwarding data from a second storing region to the first storing region, forwards the data to a first entry specified by the first used identification number and the first information set in the first storing region; and sets an identification number of the specified first entry in the first used identification number stored in the processing device.
5. The information processing apparatus according to claim 2, wherein: the processing device in a case where the entry associated with the second used identification number is not used for a second given time period, forwards, to the relay device, dummy data for each of entries from the entry associated with the second used identification number to a last entry allocated to the relay device; and the relay device sets an identification number of the last entry in the second used identification number in response to receipt of the dummy data, and sets second information in the first information in the first storing region, the second information representing that entries of the reception buffer serving as writing destinations of the dummy data are each used.
6. The information processing apparatus according to claim 2, wherein the relay device in forwarding data from a second storing region or an external port provided to the relay device to the first storing region, forwards the data to a second entry specified by the second used identification number and the first information set in the first storing region, and sets an identification number of the specified second entry in the second used identification number stored in the processing device.
7. A non-transitory computer-readable recording medium having stored therein information processing program for causing a computer to execute a process, the computer comprising a storing device comprising a plurality of storing regions allocated one to each of a plurality of virtual machines, a processing device that is connected to the storing device and that executes the plurality of virtual machines, a relay device that is connected to the processing device and that executes a relaying process, serving as a virtual switch that connects the plurality of virtual machines to one another, and a transfer processor that transfers data between the plurality of storing regions, the process comprising: in the processing device storing a first used identification number associated with a used entry among a plurality of first entries allocated to the transfer processor and a second used identification number associated with a used entry among a plurality of second entries allocated to the relay device, the first used identification number and the second used identification number being included in a plurality of identification numbers each associated with one of a plurality of entries of a reception buffer included in a first storing region allocated to a first virtual machine among the plurality of virtual machines; and setting a smaller one of the first used identification number and the second used identification number stored in the processing device, to an identification number being set in the first storing region and representing an entry of data read from the reception buffer by the first virtual machine.
8. The non-transitory computer-readable recording medium according to claim 7, wherein the process further comprises: in the processing device setting first information in the first storing region, the first information representing which one of the transfer processor and the relay device is allocated to each of the plurality of entries.
9. The non-transitory computer-readable recording medium according to claim 8, wherein the process further comprises: the processing device in a case where the entry associated with the first used identification number is not used for a first given time period, writing dummy data into each of entries from the entry associated with the first used identification number to a last entry allocated to the transfer processor and setting an identification number of the last entry in the first used identification number; and setting the first used identification number in the identification number set in the first storing region.
10. The non-transitory computer-readable recording medium according to claim 8, wherein the process further comprises: in the transfer processor in forwarding data from a second storing region to the first storing region, forwarding the data to a first entry specified by the first used identification number and the first information set in the first storing region; and setting an identification number of the specified first entry in the first used identification number stored in the processing device.
11. The non-transitory computer-readable recording medium according to claim 8, wherein the process further comprises: in the processing device in a case where the entry associated with the second used identification number is not used for a second given time period, forwarding, to the relay device, dummy data for each of entries from the entry associated with the second used identification number to a last entry allocated to the relay device; and in the relay device setting an identification number of the last entry in the second used identification number in response to receipt of the dummy data, and setting second information in the first information in the first storing region, the second information representing that entries of the reception buffer serving as writing destinations of the dummy data are each used.
12. The non-transitory computer-readable recording medium according to claim 8, wherein the process further comprises in the relay device in forwarding data from a second storing region or an external port provided to the relay device to the first storing region, forwarding the data to a second entry specified by the second used identification number and the first information set in the first storing region, and setting an identification number of the specified second entry in the second used identification number stored in the processing device.
13. A method for processing information in computer comprising a storing device comprising a plurality of storing regions allocated one to each of a plurality of virtual machines, a processing device that is connected to the storing device and that executes the plurality of virtual machines, a relay device that is connected to the processing device and that executes a relaying process, serving as a virtual switch that connects the plurality of virtual machines to one another, and a transfer processor that transfers data between the plurality of storing regions, the method comprising: in the processing device storing a first used identification number associated with a used entry among a plurality of first entries allocated to the transfer processor and a second used identification number associated with a used entry among a plurality of second entries allocated to the relay device, the first used identification number and the second used identification number being included in a plurality of identification numbers each associated with one of a plurality of entries of a reception buffer included in a first storing region allocated to a first virtual machine among the plurality of virtual machines; and setting a smaller one of the first used identification number and the second used identification number stored in the processing device, to an identification number being set in the first storing region and representing an entry of data read from the reception buffer by the first virtual machine.
14. The method according to claim 13, further comprising: in the processing device setting first information in the first storing region, the first information representing which one of the transfer processor (52A) and the relay device is allocated to each of the plurality of entries.
15. The method according to claim 14, further comprising: in the processing device in a case where the entry associated with the first used identification number is not used for a first given time period, writing dummy data into each of entries from the entry associated with the first used identification number to a last entry allocated to the transfer processor and setting an identification number of the last entry in the first used identification number; and setting the first used identification number in the identification number set in the first storing region.
16. The method according to claim 14, further comprising: in the transfer processor in forwarding data from a second storing region to the first storing region, forwarding the data to a first entry specified by the first used identification number and the first information set in the first storing region; and setting an identification number of the specified first entry in the first used identification number stored in the processing device.
17. The method according to claim 14, further comprising: in the processing device in a case where the entry associated with the second used identification number is not used for a second given time period, forwarding, to the relay device, dummy data for each of entries from the entry associated with the second used identification number to a last entry allocated to the relay device; and in the relay device setting an identification number of the last entry in the second used identification number in response to receipt of the dummy data, and setting second information in the first information in the first storing region, the second information representing that entries of the reception buffer serving as writing destinations of the dummy data are each used.
18. The method according to claim 14, further comprising in the relay device in forwarding data from a second storing region or an external port provided to the relay device to the first storing region, forwarding the data to a second entry specified by the second used identification number and the first information set in the first storing region, and setting an identification number of the specified second entry in the second used identification number stored in the processing device.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
DESCRIPTION OF EMBODIMENT(S)
[0053] By offloading the relay function of the virtual switch to the communication device, all packets pass through the communication device. For example, packet forwarding in the information processing apparatus by the communication device causes each packet to pass through the I/O bus twice of reading of the packet from a VM memory of the forwarding source and writing of the packet to a VM memory of the forwarding destination.
[0054] Therefore, when the packet satisfies a given condition, the relaying process performed by the processor may have, for example, a smaller communication delay than the relaying process performed by the communication device. An example of the given condition is that a packet forwarding is within the information processing apparatus and that the processing load of the relaying process by means of software in the processor is small. As described above, in the communication device that offloads the relay function of the virtual switch, the data forwarding performance may be degraded.
[0055] Hereinafter, embodiments of the present invention will now be described with reference to the accompanying drawings. However, the embodiments described below are merely illustrative and are not intended to exclude the application of various modifications and techniques not explicitly described below. For example, the present embodiment can be variously modified and implemented without departing from the scope thereof.
[0056] In the accompanying drawings to be used in the following description, like reference number designates the same or substantially the same parts and elements unless specified otherwise.
[0057] (1) One Embodiment:
[0058] (1-1) Virtual Switch:
[0059]
[0060] In a relaying process of the virtual switch 110, a packet relay unit 115 retrieves a flow that matches a condition for a packet from a flow table 117 through a controlling unit 116, and applies the action of the obtained flow to the packet and forwards (transfers) the packet. In one embodiment, the flow may mean a set (combination) of a header field of a packet in which a condition for identifying a packet is set and an action (operation) to be applied to the packet. The action may include types such as forwarding (Forward) that transmits the packet from specified virtual ports 111 to 114, modifying (Modify) that rewrites the packet header, dropping (Drop) that discards the packet, and the like.
[0061] In the virtual switch 110, a flow cache 118 may be used to speed up the relaying process. The flow cache 118 temporarily holds the information on a flow that has been input most recently. As a result, the packet relay unit 115 can retrieve a flow at high speed without using the controlling unit 116. A flow not hit in the flow cache 118 is retrieved from the flow table 117, and the obtained flow is registered in the flow cache 118.
[0062] In the above manner, the processor performs a memory copying from the VM 121 to the VM 122 (see a broken arrow in
[0063] Incidentally, a communication device 130 performs communication of packets with an external device of the server 100 through at least one of physical ports 131.
[0064] In the example of
[0065]
[0066] When registering a flow into the flow cache 216, the virtual switch 210 registers the flow also in a forwarding information storing unit 240 which is a storing region that stores flows, which makes it possible to perform the flow retrieving process and the action applying process in the communication device 230. Consequently, a packet relay unit 235 of the communication device 230 can relay a packet corresponding to the same flow as that stored in the forwarding information storing unit 240 with reference to the forwarding information storing unit 240, thereby suppressing the waste of processor resources.
[0067] Hereinafter, description will now be made in relation to examples of communication within the server 200 from a VM 221 (VM #0) to a VM 222 (VM #1) when the flow is registered in the forwarding information storing unit 240 and when the flow is not registered in the forwarding information storing unit 240.
[0068] (a) When the flow is registered in the forwarding information storing unit 240:
[0069] The communication device 230 monitors a transmission queue 221a of the VM 221, and starts a transmitting process when the transmission queue 221a is updated. The communication device 230 performs a flow retrieval (lookup) from the forwarding information storing unit 240, and forwards a packet in a buffer 221b of the VM 221 to a buffer 222b of the VM 222 through a virtual port 231, the packet relay unit 235, and a virtual port 232 according to an action of a flow. In addition, the communication device 230 sets information representing completion of transmitting in a reception queue 222a of the VM 222.
[0070] (b) When the flow is not registered in the forwarding information storing unit 240:
[0071] When the flow is not registered in the forwarding information storing unit 240, the communication device 230 forwards the packet from the packet relay unit 235 to the virtual switch 210 through a virtual port 233. The virtual switch 210 retrieves, for the packet received at the virtual port 212, a flow that matches the condition from the flow table 215, applies the action of the matched flow to the packet, and transmits the packet to a virtual port 234 of the communication device 230 via the virtual port 211. The communication device 230 forwards the packet received from the virtual port 234 to the buffer 222b of the destination VM 222 through the virtual port 232 by the packet relay unit 235.
[0072] The virtual ports 233 and 234 may be referred to as exception ports because these ports are used to access the virtual switch 210 when the flow is not registered in the forwarding information storing unit 240, in other words, a case of an exception.
[0073] In the virtual switch 210, since destination resolution of a packet is performed when an action is applied to the packet, the communication device 230 can skip the flow retrieval from the forwarding information storing unit 240 when performing the relaying process of a packet received from the virtual port 234.
[0074] Furthermore, the virtual switch 210 registers the flow retrieved from the flow table 215 into the flow cache 216 and the forwarding information storing unit 240. This makes the communication device 230 possible to forward the next and subsequent packets corresponding to the same flow without passing through the virtual switch 210 in the above scheme (a).
[0075] The communication device 230 may cause the packet relay unit 235 to forward (relay) a packet received at a physical port 236 and/or a packet to be forwarded from the physical port 236 in the above scheme (a) or (b).
[0076] In the above manner, in the server 200, the communication device 230 performs memory copying from the VM 221 to the VM 222 (see the broken arrow in
[0077] In the server 200, the communication device 230 is connected to a processor (not illustrated) that executes the virtual switch 210 via an I/O bus. Thus, that all packets pass through the communication device 4 means that the packets pass through the I/O bus twice in communication within the server 200. For example, communication within the server 200 under a particular case more delays than relaying performed by means of software illustrated in
[0078] The particular case includes, for example, any one of the following cases or a combination of two or more of the following cases. [0079] The number of flows registered in the flow table 215 is a given number or less, and the flow retrieving process by the virtual switch 210 ends early. [0080] The header field of a packet does not specify a bitmask or wildcard, and the flow can be searched in the hash method. [0081] The header field does not undergo a changing process, for example and the action of the flow to be applied to the packet is only forwarding.
[0082] With the foregoing in view, description of one embodiment will now be made in relation a scheme that suppresses a lowering of data forwarding performance in a communication device that executes a relaying process as a virtual switch that connects multiple VMs.
[0083]
[0084] The processor 2 is an integrated circuit (IC) that performs various controls and arithmetic operations in the server 1 and is an example of a processing device, or an arithmetic operation processing device. In the one embodiment, the processor 2 is connected to the host memory 3 and executes multiple virtual machines (VMs) #0 and #1 using at least a part of the storing region of the host memory 3.
[0085] The processor 2 may be a multi-core processor including multiple cores or a multi-processor including multiple processors. Examples of the processor 2 may be any one of integrated circuits such as a Central Processing Unit (CPU), a Micro Processing Unit (MPU), a Graphics Processing Unit (GPU), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), and a Programmable Logic Device (PLD) (e.g., Field Programmable Gate Array (FPGA)), or a combination of two or more of these integrated circuits.
[0086] The host memory 3 may include a storing region for storing a program and data executed by the processor 2. An example of the host memory 3 may be a volatile memory, such as a Dynamic Random Access Memory (DRAM).
[0087] The host memory 3 according to the one embodiment may include a VM memory 30 for VMs. In the example of
[0088] The VM memory 30 may store various data to be used to execute the VM, which data is exemplified by a program of a virtual Operating System (OS), control data, and data. Each VM memory 30 may be, for example, a portion of the storing region of the host memory 3 and, for example, may be allocated, as a ring buffer, to a VM.
[0089] The communication device 4 is a device that carries out communication and is an example of a programmable communication device exemplified by an NIC, such as an FPGA-NIC or a smart NIC. To the communication device 4 of the one embodiment, at least a relaying process among functions that the virtual switch executes may be offloaded. The communication device forwards, in the relaying process, data that each of multiple VM memories stores.
[0090] As the above, the communication device 4 is an example of a relay device that is connected to the processor 2 and performs a relaying process, serving as a virtual switch that connects multiple VMs to one another.
[0091] The monitoring unit 51 determines whether or not the header of the data being to be transmitted and being stored in a first VM memory 30 among the multiple VM memories 30 satisfies a given condition. For example, the monitoring unit 51 may be implemented as software achieved by the processor 2 executing a program expanded in the host memory 3.
[0092] For example, the monitoring unit 51, as illustrated in
[0093] The copying unit 52 is an example of a forwarding unit that performs data forwarding between the multiple VM memories 30. For example, the copying unit 52 may be implemented as software achieved by the processor 2 executing a program expanded in the host memory 3. Alternatively, the copying unit 52 may be a device that copies data between the VM memories 30 without passing through the processor 2, and may be exemplified by a Direct Memory Access (DMA) device.
[0094] When the monitoring unit 51 determines that the header satisfies the given condition, the copying unit 52 forwards the data to be transmitted from the first VM memory 30 to a second VM memory 30 that is the destination of the data in a path not being used in the relaying process by the communication device 4.
[0095] For example, as illustrated in
[0096] Thereby, the packet P0 can be forwarded between the VM memories 30 by, for example, a memory copying by the copying unit 52 through a path that does not pass through the communication device 4. Accordingly, in communication within the server 1, the specific data can be escaped from passing through the I/O bus between the processor 2 and the communication device 4 so that a delay in the communication within the server 1 can be abated.
[0097] The given condition used in the copy determination by the monitoring unit 51 includes, for example, one or both of a case where the delay time of the relaying process by the communication device 4 exceeds the delay time of the relaying process by the software, and a case where the flow is simple enough and the load on the processor 2 in the memory copying process is small. As an example, the given condition may be a case where, in communication within the same server 1, the destination can be specified by referring to a destination address (e.g., a destination MAC (Media Access Control) address) in the packet header of the flow, and also the action of the flow is only forwarding (Forward).
Although it is possible to combine multiple operations exemplified by forwarding and modifying, such a combination of operations makes the operation complicated. In this case, copying process by the communication device 4 has a less delay than that by means of software. Considering the above, in order to reduce a delay in a copying process by means of software, excluding such a pattern in which the communication device 4 has a less delay, the given condition includes “a case where the action of the flow is only forwarding”.
[0098] Further, in the one embodiment, the processor 2 may set the communication device 4 to, for example, suppress the forwarding of data having a header satisfying the given condition. This setting may be accomplished, for example, by settling setting information in the forwarding information storing unit 6 used for forwarding data by the communication device 4. For example, in the setting information, the operation that the communication device 4 performs on the data is set for each header of the data to be processed in the relaying process.
[0099] As an example, the processor 2 may set discarding of data associated with a header satisfying the given condition to an operation performed on the header in the setting information stored in the forwarding information storing unit 6. In the example of
[0100] Here, as illustrated in
[0101] For example, as illustrated in
[0102] As described above, in the server 1 according to the one embodiment, for example, the monitoring unit 51 can switch forwarding of the packet, when detecting the communication within the server 1 that satisfies the given condition, from the relaying by the communication device 4 to the memory copying by the copying unit 52.
[0103] In addition, the communication device 4 can inhibit the packet P0 copied by the monitoring unit 51 and the copying unit 52 performing the processing of Arrows (1) to (3) in
[0104] Furthermore, the server 1 is inhibited from adding a process to be performed on a VM, such as determining switch of a forwarding path by recognizing a packet to be transmitted. Accordingly, this makes it possible to prevent the computational resources used by applications (e.g., user applications) on a VM from being consumed by processing on the side of the service infrastructure.
[0105] (1-2) Example of Configuration of Server:
[0106]
[0107] The virtual switch 20 may be implemented, for example, as software achieved by the processor 2 executing a program expanded in the host memory 3.
[0108] The virtual switch 20 may include a packet relay unit 21, a flow table 22, a flow cache 23, and a determining unit 24.
[0109] The packet relay unit 21 receives a packet that has been missed (not hit) in the retrieval from the forwarding information storing unit 6 via an exception port 44 of the communication device 4, processes the packet, gives the information of the output port to the packet, and transmits the packet to an exception port 45 of the communication device 4. The process that the packet relay unit 21 performs on the packet may include, for example, retrieval from the flow table 22 by referring to the packet information, applying of the operation (Action) to the packet, registering of a flow into the flow cache 23, and registering of the flow into the forwarding information storing unit 6. In the one embodiment, the packet relay unit 21 may invoke a process of the determining unit 24 before registering a flow into the forwarding information storing unit 6.
[0110] The flow table 22 is a table that stores multiple flows. The flow table 22 may store information on flows of multiple patterns that the server 1 would relay before starting the operation of the server 1. The flow may mean a set (combination) of a header field of a packet in which a condition for identifying the packet is set and an action (operation) to be applied to the packet. The Action may include types such as forwarding (Forward) that transmits the packet from specified virtual ports 41 and 42, modifying (Modify) that rewrites the packet header, dropping (Drop) that discards the packet, and the like.
[0111] The flow cache 23 is a cache used for speeding up the relaying process, and temporarily holds information of the flow that has been input most recently from the packet relay unit 21, for example.
[0112] The determining unit 24 determines whether or not a flow registered in the flow cache 23 by the packet relay unit 21 matches a condition (copying condition) of memory copying, which is an example of the given condition. In cases where the flow matches the copying condition, the determining unit 24 registers the copying condition into the monitoring and copying unit 5 so that the memory copying can be performed by the monitoring and copying unit 5 on the same packet transmitted the next and subsequent times. Further, the determining unit 24 rewrites the operation of the flow registered in the forwarding information storing unit 6 to discarding (Drop) so that the communication device 4 does not redundantly transmit the packet processed by the monitoring and copying unit 5 (i.e., subjected to the memory copying).
[0113] The virtual switch 20 may have a function similar to that of the controlling unit 214 illustrated in
[0114] As illustrated in
[0115] As illustrated in
[0116] For convenience, the example of
[0117] The communication device 4 may, by way of example, include the virtual ports 41 and 42, the packet relay unit 43, the exception ports 44 and 45, and a physical port 46.
[0118] The virtual ports 41 and 42 are virtual ports being respectively connected to the VM #0 and VM #1 that the processor 2 executes, using the VM memory 30, and being used to communicate with the VMs. In the example of
[0119] The virtual port 41 may perform control on the transmitting-side VM #0. For example, the virtual port 41 may monitor the transmission queue 33 of the VM memory #0 and confirm a difference between an available index and the available index that the virtual port 41 holds.
[0120] An available index is an index that indicates that a packet has been set in the transmission buffer 31 and may be referred to as an avail_idx. An available index may be managed independently of one another in each VM memory 30, an index updating unit 53, and each of virtual port 41 and 42, respectively.
[0121] Then, the virtual port 41 may read a number of packets as many packets as the difference from the transmission buffer 31 and may output the read packets to the packet relay unit 43. Further, when a transmitting process in the communication device 4 is completed, the virtual port 41 may notify the index updating unit 53 of the completion of the transmitting process by updating (e.g., incrementing) a process-completion index held by the index updating unit 53 of the monitoring and copying unit 5.
[0122] The process-completion index is an index that notifies that a buffer indicated by the available index has been used and may be referred to as a used_idx. The process-completion index is an example of information indicating the number of pieces of data being to be transmitted and being stored.
[0123] The virtual port 42 may perform control on the receiving-side VM #1. For example, the virtual port 42 may obtain a packet (data) addressed to the VM #1 from the packet relay unit 43, and write the obtained packet into the reception buffer 32 of the destination VM #1. Then, the virtual port 42 may notify the destination VM #1 of the reception of the packets by updating (e.g., incrementing) a process-completion index of the reception queue 35 by the number of packets written into the reception buffer 32 (e.g., incrementing).
[0124] The exception port 44 may transmit a packet, which output from the packet relay unit 43 to the virtual switch 20, to the packet relay unit 21 of the virtual switch 20. The exception port 45 may receive the packet output from the packet relay unit 21 and output the received packet to the packet relay unit 43. The exception ports 44 and 45 may independently of each other be virtual ports, for example.
[0125] The physical port 46 is one that is connected to an external interface (I/F) for communicating with an external NW (Network) or an external device disposed outside the server 1.
[0126] The virtual ports 41 and 42, the exception ports 44 and 45, and the physical port 46 may have port IDs (PID: Port Identifier) unique to each port. A PID may be unique among the virtual ports 41 and 42, the exception ports 44 and 45, and the physical port 46 in one or more communication devices 4 provided in the server 1. For example, even when the server 1 includes two or more communication devices 4, setting a PID such that, for example, several higher-order bits thereof indicate the ID of a communication device 4 and the several lower-order bits indicate the ID of the port in the communication device 4 makes it possible to identify the input port and the output port with reference to the PID.
[0127] The packet relay unit 43 performs a relaying process on an input packet and outputs the packet to a destination port. For example, the packet relay unit 43 may include a retrieving unit 43a, an operation applying unit 43b, and a cross-bar switch 43c.
[0128] The retrieving unit 43a performs retrieval from the forwarding information storing unit 6, using packet information input via any one of the virtual ports 41 and 42 and the physical port 46, and outputs an operation (Action) obtained as a result of the retrieval to the operation applying unit 43b along with the input packet. For packet information input via the exception port 45, the retrieving unit 43a may skip the retrieval from the forwarding information storing unit 6 and output the packet to the operation applying unit 43b or the cross-bar switch 43c.
[0129] The operation applying unit 43b may apply the operation input from the retrieving unit 43a to the packet input from the retrieving unit 43a, and output the packet having been subjected to the operation application to the cross-bar switch 43c. The “operation” may include, for example, determining of a destination port, rewriting of a header, and discarding of a packet.
[0130] The cross-bar switch 43c may output the packet having been subjected to the operation application to the specified (addressed) destination port exemplified by any one of the virtual ports 41 and 42 and the physical port 46. Further, the cross-bar switch 43c may transmit a packet from the exception port 44 to the packet relay unit 21 of the virtual switch 20 in order to register a flow of the packet missed in the retrieval in the forwarding information storing unit 6 into the forwarding information storing unit 6.
[0131] The monitoring and copying unit 5 is a module that performs monitoring and memory copying of a packet, and may include, for example, a copying unit 52, an index updating unit 53, and a snooping unit 54 as illustrated in
[0132] The copying unit 52 may copy a packet determined to satisfy the condition for memory copying in the snooping unit 54 from the transmission buffer 31 of a source (sender) VM to the reception buffer 32 of the destination VM. Further, the copying unit 52 may notify the destination VM of the reception of the packet by setting the reception queue 34 for memory copying as many as the number of (the same in number as) copied packets to “being used”.
[0133] The index updating unit 53 may monitor the transmission queue 33 of the source VM and confirm the available index. For example, the index updating unit 53 may obtain a difference between the available index of the transmission queue 33 and the available index held by the index updating unit 53 and check whether or not there is a new transmission.
[0134] Further, in the one embodiment, since the communication device 4 and the monitoring and copying unit 5 access the transmission queue 33 in parallel to each other to perform a transmitting process for a packet, the index updating unit 53 may notify the source VM of the completion of the processing by waiting for the completion of the transmitting process of the communication device 4 and the completion of the memory copying process and updating (for example, incrementing) the process-completion index of the transmission queue 33 to a position where both processes are completed.
[0135] When the index updating unit 53 detects a new transmission from a VM, the snooping unit 54 refers to (snoops) the used transmission buffer 31 one by one from the transmission queue 33 and determines whether or not the packet satisfies the condition for memory copying.
[0136] As described above, the index updating unit 53 and the snooping unit 54 are examples of the monitoring unit 51 illustrated in
[0137] The forwarding information storing unit 6 may be a storing region in which a flow referred to for determining an action from an input packet by the packet relay unit 43 is stored.
[0138]
[0139] As illustrated in
[0140] In the first example illustrated in
[0141] In the second example illustrated in
[0142] In the example of
[0143] (1-3) Example of Operation of Server:
[0144] Next, an operation example of the server 1 illustrated in
[0145] (1-3-1) Initializing Process:
[0146] First, description will now be made in relation to an example of operation of an initializing process.
[0147] As exemplified on the left side of
[0148] On the other hand, as illustrated on the right side of
[0149] In order to wait for the completions, for example, the server 1 may perform an initializing process on the monitoring and copying unit 5 when the VM establishes a connection with the virtual port 41 or 42 of the communication device 4, so that the setting of the communication device 4 may be changed.
[0150] For example, in the communication device 4, the address of the process-completion index updated by the communication device 4 may be changed from the address of the process-completion index of the transmission queue 33 of the VM memory 30 to the address of the process-completion index of the index updating unit 53 of the monitoring and copying unit 5. In the example of
[0151] Further, in the monitoring and copying unit 5, the address of the transmission queue 33 of the source VM may be set to the index updating unit 53. This makes the index updating unit 53 possible to notify the source VM of the completion of the transmission after the waiting in the monitoring and copying unit 5.
[0152] The initializing process may be performed, for example, by an administrator or a user of the server 1, or may be performed by one or more of the processor 2, the communication device 4, and the monitoring and copying unit 5.
[0153] (1-3-2) Flow Registering Process:
[0154] Next, description will now be made in relation to an example of operation of a flow registering process.
[0155] The following description assumes a case where a flow of the packet P0 received at the virtual port 41 (not illustrated) of the communication device 4 is not present in the forwarding information storing unit 6. As an example, after the server 1 is started (e.g., started for the first time) or is initialized, information of a flow is sometimes not present in the forwarding information storing unit 6 (and the flow cache 23). In such a case, the communication device 4 inquires the virtual switch 20 about operation of packets (in other words, all the packets received for the first time) the flows of which are not present in the forwarding information storing unit 6, and the flow registering process is executed in the virtual switch 20 and the monitoring and copying unit 5 for each packet.
[0156] As illustrated in
[0157] The packet relay unit 21 retrieves a flow in the flow table 22 on the basis of the header field of the received packet P0, and obtains the flow F0 including the header field and the operation (see Arrow (2); Step S2 in
[0158] The packet relay unit 21, for speeding up the process, registers the information of the flow F0 into the flow cache 23 (see Arrow (3); Step S4 in
[0159] The determining unit 24 determines whether or not to snoop the flow F0.
[0160] For example, the determining unit 24 determines whether a port associated with the destination MAC (Dst_MAC) address of the header field of the flow F0 indicates the virtual port of the communication device 4 (Step S5 in
[0161] In cases where the port associated with the destination MAC (Dst_MAC) address indicates the virtual port of the communication device 4 (YES in Step S5 of
[0162] In cases where the input port (Ingress port) indicates the virtual port of the communication device 4 (YES in Step S6 in
[0163] In cases where the operation of the flow F0 indicates the (only) forwarding (YES in Step S7 of
[0164] When determining to snoop the flow F0, the determining unit 24 determines whether or not information indicating the flow F0, for example, a destination MAC address included in the flow F0, is already registered in the snooping unit 54 (Step S8 in
[0165] In cases where the destination MAC address is not registered in the snooping unit 54 (NO in Step S8 in
[0166] The snooping list 54a is, for example, information that stores a list of information that can identify flows to be snooped, and may store, for example, a list of destination MAC addresses. The snooping list 54a may store the destination MAC addresses themselves, or may be information that can identify the destination MAC addresses, such as, hash values of the destination MAC addresses.
[0167] In addition, the determining unit 24 changes the operation of the flow F0 to Drop (see Arrow (4-2); Step S10 in
[0168] The determining unit 24 registers the flow F0 the operation of which has been changed into the forwarding information storing unit 6 (see Arrow (5); Step S11 in
[0169] In cases where the destination MAC address is registered in the snooping unit 54 in Step S8 of
[0170] When determining not to snoop the flow F0, the determining unit 24 may operate as follows.
[0171] For example, in cases where a port or input port associated with the destination MAC address of the header field does not indicate the virtual port of the communication device 4 (NO in Step S5 or NO in Step S6 in
[0172] When the operation of the flow F0 does not indicate (only) forwarding (NO in Step S7 of
[0173] In cases where the destination MAC address is registered in the snooping unit 54 (YES in Step S12 in
[0174] (1-3-3) Memory Copying Process:
[0175] Next, description will now be made in relation to an example of operation of a memory copying process.
[0176] As illustrated in
[0177] The index updating unit 53 of the monitoring and copying unit 5 detects the difference Diff between the avail_idx held by the index updating unit 53 and the avail_idx of the transmission queue 33 (Step S23 of
[0178] In a cases where the difference Diff is larger than “0” (Steps S24 and YES in S24 of
[0179] The snooping unit 54 reads one packet from the transmission buffer 31 on the basis of the avail_idx of the index updating unit 53 (see the Arrow (2-1); Step S25 of
[0180] The snooping unit 54 calculates the hash value of the destination MAC of the header portion of the read packet (Step S26 of
[0181] In cases where the calculated hash value is already registered in the snooping list 54a (Step S27 and YES in Step S27 in
[0182] The copying unit 52 memory-copies the packet from the transmission buffer 31 to the address of the reception buffer 32 (see Arrow (2-4); Step S30 of
[0183] The copying unit 52 updates, for example, increments, the used_idx of the reception queue 34 for memory copying (see the Arrow (2-5); Step S31 of
[0184] The index updating unit 53 updates, for example, increments, the avail_idx held by the index updating unit 53 (see Arrow (2-6); Step S32 in
[0185] For example, it is assumed that the snooping unit 54 reads (the header portion of) the packet P1 in the processing of the Arrow (2-1) in the next iteration after the processing on the packet P0 is completed. In this case, since the hash value of the destination MAC of the header portion of the packet P1 is not registered in the snooping list 54a (NO in Step S27 of
[0186] In this case, the difference Diff based on the updated avail_idx becomes “0” (NO in Step S24), in other words, the avail_idx of the index updating unit 53 matches the avail_idx of the transmission queue 33. This completes the memory copying process.
[0187] (1-3-4) Forwarding Process:
[0188] Next, description will now be made in relation to an example of operation of a forwarding process (relaying process).
[0189] As illustrated in
[0190] The virtual port 41 (virtual port #0) of the communication device 4 detects the difference Diff between the avail_idx that virtual port #0 holds and the avail_idx of the transmission queue 33 (Step S43 in
[0191] The virtual port #0 reads, from the transmission buffer 31, the packets #0 and #1 the same in number as the difference Diff (see Arrow (2); Step S44 in
[0192] The communication device 4 may repeatedly perform the process of Arrows (4) to (6-2) of
[0193] In the process of the Arrow (4), the retrieving unit 43a selects one of the input packets and retrieves a flow in the forwarding information storing unit 6 on the basis of the selected packet (Step S48 in
[0194] In the example of
[0195] The cross-bar switch 43c distributes the packets to the destination ports according to the respective applied operations (Step S50 in
[0196] Upon receipt of the packet P1, the virtual port #1 obtains the used_idx of the reception queue 35 of the VM memory #1 of the corresponding destination VM (Step S51 in
[0197] Further, the virtual port #1 updates, for example, increments, the used_idx of the reception queue 35 (see Arrow (6-2); Step S53 in
[0198] The communication device 4 increments the variable X (Step S54), and the process proceeds to Step S47.
[0199] If the variable X exceeds the number of read packets (YES in Step S47), the virtual port #0 updates, for example, increments, the used_idx of the index updating unit 53 by the number of packets that have been read (see Arrow (7); Step S55 in
[0200] This makes it possible to execute the waiting by the index updating unit 53 so that the source VM does not release the transmission buffer 31 of the VM memory #0 until the memory copying in the monitoring and copying unit 5 is completed.
[0201] The above-described packet forwarding process by the communication device 4 may be executed in the same manner as that performed by the communication device 230 illustrated in
[0202] (1-3-5) Waiting Process:
[0203] Next, description will now be made in relation to an example of operation of a waiting process.
[0204] As illustrated by the arrow (2-6) in
[0205] As illustrated in the Arrow (7) of
[0206] Therefore, by obtaining the minimum (smaller) value among the avail_idx and the used_idx, the index updating unit 53 can obtain the number of packets which have completed both of the processing of the communication device 4 and the processing the monitoring and copying unit 5.
[0207] Therefore, the index updating unit 53 waits for completion of processing of the communication device 4 and processing of the monitoring and copying unit 5, and can, after the completion of the waiting, notify the VM memory 30 of the source VM of the completion.
[0208] For example, the index updating unit 53 obtains the minimum value among the avail_idx and the used_idx held by the index updating unit 53 (Step S61 of
[0209] The index updating unit 53 updates, for example, increments, the used_idx of the transmission queue 33 of the transmission VM #0 until the used_idx comes to be the minimum value (Step S62 in
[0210] As described above, if detecting the completion of forwarding by the copying unit 52 and the completion of discarding by the communication device 4 that are performed in data being to be processed and having a header satisfying the given condition, the index updating unit 53 sets information representing completion of transmission in the first VM memory 30.
[0211] (1-4) Receiver VM #1
[0212] In the server 1 according to the one embodiment, as compared with the VM 222 (VM #1) of the server 200 illustrated in
[0213] For example, one of the solution to prevent additional queues from being provided to the VM memory 30 may omit the reception queue 34 for memory copying and may receive data from the both communication device 4 and the monitoring and copying unit 5, using the reception queue 35.
[0214]
[0215] As illustrated in
[0216] However, a memory access from the communication device 4 through the I/O bus 1b and the memory bus 1a may have an overhead of several tens to hundreds of times larger than that of a memory access from the processor 2 through the memory bus 1a. To reduce this overhead, for example, the communication device 4 may read the indexes of the reception queue 35 in batches every several tens to hundreds of cycles, utilizing a memory access being a one-to-one access.
[0217] However, an exclusive access makes an access to a lock variable and an index in each individual cycle. Therefore, an exclusive access performed in offload becomes a bottleneck in performance.
[0218]
[0219] As illustrated in
[0220] In the example of
[0221] (i) The VM allocates the reception buffer 32 to the access source exemplified by the processor 2 (monitoring and copying unit 5) or the communication device 4 (virtual port 42). In the example of
[0222] (ii) The access source fetches the descriptor 350 from the top of the reception queue 35 and obtains the address 351 of a writing destination. For example, the access source may refer to the descriptor 350 corresponding to the used_idx=“0”.
[0223] (iii) The access source writes data into the reception buffer 32 indicated by the obtained address 351.
[0224] (iv) The access source sets the data length of the written data to the length 353 of the descriptor 350.
[0225] (v) The VM performs notification of the completion of receiving data from the access source. The notification may be made, for example, by incrementing the used_idx which can be referenced by the access source (i.e., “0” to “2” in the example of
[0226] (vi) The VM reads the received data from the reception buffer 32. For example, the VM may refer to the two updated descriptors 350 from the difference between the current value “2” of the used_idx and the last value “0” of the used_idx, and read the data of the length 353 from the reception buffer 32 indicated by each address 351.
[0227]
[0228] In the example of
[0229] In this case, when the communication device 4 updates the used_idx of the VM up to “9” which is the top of the received data, the VM completes the reception process to that point. In this case, even if the copy unit 52 writes the received data to the reception buffer 32 associated with the used_idx “0” to “4” that is recognized to be available, the VM recognizes that the processing on the entries “0” to “9” has been completed according to the values of the respective used_idx, so that the received data is not processed. Therefore, when the common reception queue 35 is allocated to multiple access sources, it may be desirable to modify the updating process on the index of the VM, in other words, to optimize the receiving process in the VM.
[0230] (1-5) Description of Receiving Process of One Embodiment:
[0231] Hereinafter, description will now be made in relation to a server 1A in which the receiving process in the server 1 described above is optimized. The server 1A is one embodiment of the server 1, and is an exemplary mode in which the receiving process in the server 1 is optimized. The process, configuration, and functions of the server 1A not described below are the same as those of the server 1, and the repetitious description will be omitted.
[0232] For example, the server 1A can execute the same VM as the VM 222 (VM #1) illustrated in
[0233]
[0234] As illustrated in
[0235] As illustrated in
[0236] The buffer allocating unit 55 achieves multi-access to the reception queue 35 of the VM memory 30A while suppressing, for example, an exclusive access. For example, when the reception buffer 32 of the VM memory 30A is allocated by the receiver VM, the buffer allocating unit 55 distributes the allocated reception buffer 32 to the monitoring and copying unit 5A and the communication device 4A. The distribution by the buffer allocating unit 55 may include, for example, distributing the descriptors 350 that the VM refilled the reception queues 35 with to the monitoring and copying unit 5A and the communication device 4A.
[0237] The example of
[0238] Here, the buffer allocating unit 55 may attach, to each distributed descriptor 350, information (mark) that can distinguish whether the descriptor 350 is for the monitoring and copying unit 5A or for the communication device 4A. The information may be included in the other information 354 of the descriptor 350, for example, and may be set as a flag indicating that the corresponding descriptor 350 is for the monitoring and copying unit 5A or for the communication device 4A in the reserved region or the non-used region, for example.
[0239] The buffer allocating unit 55 has an index for managing the distributed descriptor 350 in the distribution of the reception buffer 32, and updates the index that the VM memory 30A holds. The index is an example of an identification number of each of the multiple entries included in the reception buffer 32.
[0240] The buffer allocating unit 55 may, for example, hold and manage an available index 551, a processed index 552 and an available index list 553 for the monitoring and copying unit 5A (copying unit 52A), and a processed index 554 and an available index list 555 for the communication device 4A.
[0241] The available index 551 may indicate an available index of the reception buffer 32 managed on the buffer allocating unit 55.
[0242] The processed index 552 is an example of the first used identification number corresponding to a used entry in multiple first entries allocated to the copying unit 52A among the identification numbers (indexes) one for each of the multiple entries included in the reception buffer 32. The processed index 552 may, for example, indicate an index of the starting point of the allocation of the reception buffer 32 allocated to the monitoring and copying unit 5A.
[0243] The available index list 553 may indicate an index of the end point of the allocation of the reception buffer 32 allocated to the monitoring and copying unit 5A, and may store the history of updating the index at the end point of the allocation in a list format.
[0244] The processed index 554 is an example of a second used identification number corresponding to a used entry in multiple second entries allocated to the communication device 4A among the identification numbers (indexes) of the multiple entries included in the reception buffer 32. The processed index 554 may, for example, indicate an index of the starting point of the allocation of the reception buffer 32 allocated to the communication device 4A.
[0245] The available index list 555 may indicate an index of the end point of the allocation of the reception buffer 32 allocated to the communication device 4A, and may store the history of updating the index at the end point of the allocation in a list format.
[0246] In the following description, the available index 551 is sometimes referred to as an “avail_idx of the buffer allocating unit 55.” The processed index 552 and the available index list 553 is sometimes referred to as a “used_idx for the copying unit 52A” and an “avail_idx_list for the copying unit 52A”, respectively. Further, the processed index 554 and the available index list 555 is sometimes referred to as a “used_idx for the communication device 4A” and an “avail_idx_list for the communication device 4A”, respectively.
[0247] The buffer allocating unit 55 causes the monitoring and copying unit 5A and the communication device 4A to use the used_idx and the avail_idx_list for the copying unit 52A and the used_idx and the avail_idx_list for the communication device 4A, respectively, so that packets can be written to respective intended reception buffer 32.
[0248] In performing a memory copying, the copying unit 52A refers to the address of an entry of the destination reception buffer 32 (hereinafter, sometimes simply referred to as the “address of the reception buffer 32”) from the descriptors 350 on the basis of the used_idx for the copying unit 52A. For example, the copying unit 52A performs memory copying when a flag included in the other information 354 indicates that the target reception buffer 32 is one for the monitoring and copying unit 5A, and refers to the following descriptor 350 when the flag indicates that the reception buffer 32 is one for the communication device 4A. After the memory copying, the copying unit 52A increments the used_idx for the copying unit 52A and notifies the buffer allocating unit 55 of the completion of the copying.
[0249] In writing data to the VM memory 30A, the virtual port 42A refers to the address of the destination reception buffer 32 from the descriptor 350 based on the used_idx for the communication device 4A. For example, the virtual port 42A performs data writing when a flag included in the other information 354 indicates that the target reception buffer 32 is one for the communication device 4A, and refers to the following descriptor 350 when the flag indicates that the reception buffer 32 is one for the monitoring and copying unit 5A. After the writing, the virtual port 42A increments the used_idx for the buffer allocating unit 55 and notifies the buffer allocating unit 55 of the completion of the copying.
[0250] The buffer allocating unit 55 determines the usage status of the reception buffer 32 by each access source on the basis of the change (progress) of the value of each used_idx, and updates the used_idx of the receiver VM to a position where the receiver VM can execute the receiving process. Updating of the used_idx of the receiver VM is an example of a completion notification of reception to the receiver VM.
[0251] For example, as illustrated in
[0252] Further, the buffer allocating unit 55 periodically checks the difference between the starting point and the end point of the allocation of the reception buffer 32 for each of the monitoring and copying unit 5A and the communication device 4A, and thereby confirms the presence of an entry in the reception buffer 32 that is continuously in non-received state.
[0253] For example, when the buffer allocating unit 55 detects that the entries corresponding to the indexes of “2” to “4” have not received data for a predetermined period of time, the buffer allocating unit 55 encourages the VM to carry out the receiving process by forcibly changing the entry of the reception buffer 32 to received state, (see Arrow (2)). For example, the buffer allocating unit 55 sets the descriptors 350 of “2” to “5” with information indicating that dummy data is written, and writes dummy data to the reception buffer 32 of “2” to “4” that have not received data by updating the used_idx from “2” to “5”, and to update the used_idx of the VM memory 30A. The dummy data may be data not accompanying, for example, an actual writing to the reception buffer 32, and is exemplified by data having a length of “0”.
[0254] Further, in parallel (asynchronously) with the processing related to the monitoring and copying unit 5A, the communication device 4A (virtual port 42A) writes three data pieces and updates the used_idx from “5” to “8” (see Arrow (3)). The buffer allocating unit 55 updates the used_idx of the VM memory 30A in response to updating of the used_idx by the virtual port 42A.
[0255] As described above, the buffer allocating unit 55 manages the used_idx of the monitoring and copying unit 5A and the used_idx of the communication device 4A, which enables multi-access to the VM memory 30A by both the monitoring and copying unit 5A and the communication device 4A.
[0256] Further, the buffer allocating unit 55 forcibly shifts an entry of the reception buffer 32 that has not performed writing by the access source for a predetermined time which access source has at least an earlier order of allocating of an index into the received state. This encourages the VM to perform a receiving process from an entry of the reception buffer 32 indicated by the indexes of “0” to “8” and can release the entries of the same reception buffer 32 after the receiving process, so that the period in which the reception buffer 32 lacks can be shortened.
[0257] (1-6) Example of Configuration of Server Related to Receiving Process:
[0258]
[0259] In the example of
[0260]
[0261]
[0262]
[0263] (1-7) Examples of Operations Related to Receiving Process of Server:
[0264] Next, description will now be made in relation to operation of the server 1A illustrated in
[0265] (1-7-1) Initializing Process:
[0266] First, description will now be made in relation to an example of the operation of the initializing process.
[0267]
[0268] As illustrated on the left side of the drawing of
[0269] On the other hand, as illustrated on the right side of the drawing of
[0270] For example, in the communication device 4A, the address of the processed index updated by the virtual port 42A may be changed from the address of the processed index of the reception queue 35 to the address of the processed index 554 for the communication device of the buffer allocating unit 55.
[0271] In the monitoring and copying unit 5A, the address of the reception queue 35 of the destination VM may be set in the buffer allocating unit 55. This makes the buffer allocating unit 55 possible to notify the completion of reception to the destination VM.
[0272] The initializing process may be performed by, for example, an administrator or a user of the server 1A, or may be performed by one or more of the processor 2A, the communication device 4A, and the monitoring and copying unit 5A.
[0273] (1-7-2) Buffer Distributing Process:
[0274] Next, description will now be made in relation to an example of the operation of a buffer distributing process.
[0275] As illustrated in
[0276] The buffer allocating unit 55 calculates the difference diff between the value “10” of the avail_idx of the VM and the value “0” of the local avail_idx (Step S72 of
[0277] In the example of
[0278] The buffer allocating unit 55 sets the used_idx and the avail_idx_list of the buffer allocating unit 55 in order to allocate the buffer. For example, in cases where the buffers are allocated in the order of the monitoring and copying unit 5A and then the communication device 4A, the buffer allocating unit 55 may set the used_idx and the avail_idx_list for the monitoring and copying unit 5A, and then set the used_idx and the avail_idx_list for the communication device 4A.
[0279] The buffer allocating unit 55 determines whether or not the avail_idx_list for the copying unit 52A is “Null” (Step S74 of
[0280] If the avail_idx_list for the copying unit 52A is “Null” (YES in Step S74), the buffer allocating unit 55 sets the value “0” (starting point of allocation) of the avail_idx in the used_idx for the copying unit 52A (see Arrow (4-1); Step S75 of
[0281] The buffer allocating unit 55 initializes the variable count by setting the variable count to “0” (zero) (Step S76 in
[0282] The buffer allocating unit 55 increments the value of the avail_idx (see Arrow (4-3); Step S80 in
[0283] If the count is equal to or greater than V (NO in Step S77 in
[0284] Then, the buffer allocating unit 55 determines whether or not the avail_idx_list for the communication device 4A is “Null” (Step S83 in
[0285] If the avail_idx_list for the communication device 4A is “Null” (YES in Step S83), the buffer allocating unit 55 sets the value “5” (starting point of allocation) of the avail_idx in the used_idx for the communication device 4A (see Arrow (5-1); Step S84 in
[0286] The buffer allocating unit 55 initializes the variable count by setting the variable count to “0” (zero) (Step S85 in
[0287] The buffer allocating unit 55 increments the value of the avail_idx (see Arrow (5-3); Step S89 in
[0288] In cases where the count is W or more (NO in Step S86 in
[0289] (1-7-3) Memory Copying Process
[0290] Next, description will now be made in relation to an example of the operation of a memory copying process. Hereinafter, being based on the memory copying process by the server 1 described with reference to
[0291]
[0292] As illustrated in
[0293] The snooping unit 54 reads one header portion of a packet (see Arrow (2-2)) from the transmission buffer 31 on the basis of the avail_idx of the index updating unit 53 (see Arrow (2-1)). The snooping unit 54 calculates the hash value of the destination MAC of the header portion of the read packet (Step S26 of
[0294] If the calculated hash value has been registered in the snooping list 54a (Step S27 and YES in Step S27 in
[0295] The copying unit 52A determines whether or not the used_idx for the copying unit 52A is less than the avail_idx of the buffer allocating unit 55 (Step S102 in
[0296] When the used_idx for the copying unit 52A is less than the avail_idx of the buffer allocating unit 55 (YES in the Step S102 of
[0297] The copying unit 52A determines whether or not the flag of the obtained descriptor 350 indicates the copying unit 52A (Step S104). If the flag does not indicate the copying unit 52A (NO in Step S104), the copying unit 52A increments the used_idx for the copying unit 52A (Step S107), and the process proceeds to Step S102.
[0298] If the flag indicates the copying unit 52A (YES in Step S104), the copying unit 52A obtains the address 351 of the reception buffer 32 from the descriptor 350 and memory copies the packet from the transmission buffer 31 to the address 351 of the reception buffer 32 (see Arrow (3-3); Step S105 of
[0299] The copying unit 52A updates the used_idx for the copying unit 52A by, for example, increment (see Arrow (3-4); Step S106 in
[0300] (1-7-4) Forwarding Process:
[0301] Next, description will now be made in relation to an example of the operation of a forwarding process. Hereinafter, being based on the forwarding process by the server 1 described with reference to
[0302]
[0303] As illustrated in
[0304] The physical port 46 or the virtual port 41 (#0) forwards the packets to the packet relay unit 43 (Step S112). For example, the following description assumes that the communication device 4 sets the variable X to “0” (Step S13), and if the variable X is equal to or less than the number of read packets (Step S114 and YES in Step S114), carries out the processes of Arrows (2) to (3-4) of
[0305] In the process of Arrow (2), the retrieving unit 43a selects one of the input packets and retrieves the setting information of the selected packet in the forwarding information storing unit 6 on the basis of the selected packet (Step S115 in
[0306] Upon receipt of the packet, the virtual port 42A (#1) executes the receiving process described below (Step S118). The virtual port 42A determines whether or not the sender of the packet is a VM (Step S119). If the sender of the packet is not a VM (NO in Step S119), the process proceeds to Step S121.
[0307] If the sender of the packet is a VM (YES in Step S119), the virtual port 41 increments the used_idx of the index updating unit 53 (Step S120). The communication device 4A increments the variable X (Step S121), and the process proceeds to Step S114.
[0308] If, in Step S114, the variable X exceeds the number of read packets (NO in Step S114), the process ends.
[0309] In the receiving process of Step S118 in
[0310] The virtual port 42A determines whether or not the used_idx for the communication device 4A is less than the avail_idx of the buffer allocating unit 55 (Step S132 in
[0311] If the used_idx for communication device 4A is less than the avail_idx of the buffer allocating unit 55 (YES in Step S132 in
[0312] The virtual port 42A determines whether or not the flag of the obtained descriptor 350 indicates the communication device 4A (Step S134). If the flag does not indicate the communication device 4A (NO in Step S134), the virtual port 42A increments the used_idx for the communication device 4A (see Arrow (3-4); see Step S137 in
[0313] If the flag indicates the communication device 4A (YES in Step S134), the virtual port 42A obtains the address 351 of the reception buffer 32 from the descriptor 350 and forwards the packet to the address 351 of the reception buffer 32 (see Arrow (3-3); Step S135 in
[0314] (1-7-5) Notifying Process of Reception to VM:
[0315] Next, description will now be made in relation to an example of the operation of a notifying process of reception to the VM.
[0316] The buffer allocating unit 55 sets the used_idx of the destination VM to the smaller one of the used_idx for the monitoring and copying unit 5A and the used_idx for the communication device 4A. This makes it possible to encourage the destination VM to receive a packet as much as possible even if an empty buffer is present between buffers allocated to the monitoring and copying unit 5A and buffers allocated to the communication device 4A. Further, this can suppress the occurrence of the inconvenience described with reference to
[0317] As illustrated in
[0318] If the avail_idx_list [0] for the copying unit 52A is less than the use avail_idx_list [0] for the communication device 4A (YES in Step S141), the buffer allocating unit 55 sets the used_idx for the copying unit 52A to the selected used_idx (Step S142). Further, the buffer allocating unit 55 sets the used_idx for the communication device 4A in the reserved used_idx (Step S143) and sets the avail_idx_list for the copying unit 52A into the selected avail_idx_list (Step S144), and the process proceeds to Step S148.
[0319] On the other hand, if the avail_idx_list[0] for the copying unit 52A is equal to or larger than the avail_idx_list[0] for the communication device 4A (NO in Step S141), the buffer allocating unit 55 sets the used_idx for the communication device 4A to the selected used_idx (Step S145). Further, the buffer allocating unit 55 sets the used_idx copying unit 52A in the reserved used_idx (Step S146), sets the avail_idx_list for the communication device 4A in the selected avail_idx_list (Step S147), and the process proceeds to Step S148.
[0320] The buffer allocating unit 55 obtains the index (selected avail_idx_list [0]) at the end of the allocated descriptor 350 from the beginning of the selected avail_idx_list, and determines whether or not the selected avail_idx_list [0] is equal to or less than the selected used_idx (see Arrow (1-2); Step S148 of
[0321] If the selected avail_idx_list [0] is larger than the selected used_idx (NO in Step S148), the buffer allocating unit 55 sets the used_idx of the VM to the selected used_idx (see Arrow (2); Step S151 in
[0322] The selected avail_idx_list [0] being equal to or less than the selected used_idx (YES in the Step S148) means that the access source corresponding to the selected used_idx has used all the entries of the reception buffer 32 allocated thereto, in other words, all the allocated descriptors 350.
[0323] In this case, for example, as illustrated in
[0324] For example, the buffer allocating unit 55 removes (e.g., by setting “Null” in) the top element of the selected avail_idx_list (see Arrow (1-3) in
[0325] (1-7-6) Buffer Distributing Process (when Reallocation);
[0326] The destination VM carries out the receiving process on data stored in the reception buffer 32 in the notifying process of reception to the VM described with reference to
[0327] If the reception buffer 32 is reallocated, the buffer allocating unit 55 executes the buffer distributing process described with reference to
[0328]
[0329] If the “avail_idx_list=Null” is satisfied (YES in Steps S74 and S83 in
[0330] On the other hand, the “avail_idx_list=Null” not being satisfied (NO in Steps S74 and S83 in
[0331] In the example of
[0332] Further, for the descriptor 350 newly allocated by reallocation, the buffer allocating unit 55 attaches the last index after the reallocation to the end of the avail_idx_list (see Arrows (4-4) and (5-4); Steps S82 and S91 in
[0333] (1-7-7) Releasing Process of Unreceived Buffer (for Copying Unit)
[0334] Next, description will now be made in relation to an example of an operation of a releasing process of an unreceived allocated to the copying unit 52A. An “unreceived buffer” may mean a reception buffer 32 that has not received yet.
[0335] For example, the buffer allocating unit 55 periodically checks the presence of an unreceived buffer at a position close to the used_idx for the copying unit 52A, and, if an unreceived buffer is present for a given time period, causes the VM to release the unreceived buffer.
[0336] The following description made with reference to
[0337] As illustrated in
[0338] The buffer allocating unit 55 initializes the variable count by setting “0” in the variable count (Step S162 in
[0339] The buffer allocating unit 55 sets “0” in the length 353 of the descriptor 350 (see Arrow (2-2); Step S165 in
[0340] The buffer allocating unit 55 increments the used_idx for the copying unit 52A (see Arrow (2-3); Step S166 in
[0341] In the Step S163, when the count is the Dif or more (NO in the Step S163), the buffer allocating unit 55 removes the top element of the avail_idx_list for the copying unit 52A (see Arrow (3); the Step S168 in
[0342] The buffer allocating unit 55 sets the value of the used_idx for the copying unit 52A in the used_idx of the VM (see Arrow (4); Step S169 in
[0343] As described above, when detecting an unreceived buffer that exists (is not used) for a given time period, the buffer allocating unit 55 can change the unreceived buffer to a state of being receivable by the VM by setting dummy data in the unreceived buffer.
[0344] Further, by setting the length 353 of the descriptor 350 to “0”, it is possible to encourage the VM to release the reception buffer 32 while suppressing the load of reading data from the VM memory 30A (reception buffer 32).
[0345] (1-7-8) Releasing Processing of Unreceived Buffer (for Communication Devices)
[0346] Next, description will now be made in relation to an example of the operation of a releasing process of an unreceived allocated to the communication device 4A.
[0347] For example, the buffer allocating unit 55 periodically checks the presence of an unreceived buffer (e.g., entry) in the reception buffer 32 at a position close to the used_idx for the communication unit 4A, and, if an unreceived buffer is present for a given time period, causes the VM to release the unreceived buffer.
[0348] The following description to be made with reference to
[0349] As illustrated in
[0350] The buffer allocating unit 55 initializes the variable count by setting “0” in the variable count (Step S172 in
[0351] The buffer allocating unit 55 forwards the generated dummy packet to the exception port 45A of the communication device 4A (see Arrow (2); Step S175 in
[0352] In Step S173, if count is equal to or larger than the dif (NO in Step S173), the forwarding of the dummy packet by the buffer allocating unit 55 ends. Upon receipt of a (dummy) packet from the exception port 45A (Step S177), the communication device 4A forwards the packet to the packet relay unit 43 (Step S178).
[0353] The communication device 4A may repeatedly perform the process of Arrows (3) to (4-3) of
[0354] In the process of Arrow (3), the packet relay unit 43 performs a packet relaying process. The packet relay unit 43 causes, in the packet relay process, the cross-bar switch 43c to distribute the packet to the destination port(s) (Step S181 in
[0355] Each virtual port 42A of the distribution destination determines whether or not the used_idx for the communication device 4A is less than the avail_idx of the buffer allocating unit 55 (see Arrow (4-1); Step S182 in
[0356] If the used_idx for communication device 4A is less than the avail_idx of the buffer allocating unit 55 (YES in Step S182), the virtual port 42A acquires a descriptor 350 based on used_idx for communication device 4A (Step S183).
[0357] The virtual port 42A determines whether or not the flag of the descriptor 350 indicates the communication device 4A (Step S184). If the flag does not indicate the communication device 4A (NO in Step S184), the virtual port 42A increments the used_idx for the communication device 4A (see Arrow (4-3); Step S187 of
[0358] If the flag of the descriptor 350 indicates the communication device 4A (YES in Step S184), the virtual port 42A sets “0” in the length of the descriptor 350 (see Arrow (4-2); Step S185 of
[0359] The virtual port 42A increments the used_idx for the communication device 4A (see Arrow (4-3); see Step S186 of
[0360] If, in Step S180, the variable X exceeds the number of read packets (NO in Step S180), the process ends.
[0361] As described above, the buffer allocating unit 55 forwards the dummy packet through the exception port 45A to the packet relay unit 43 of the communication device 4A, and causes the virtual port 42A to transmit the dummy data to the VM memory 30A. As described above, by operating the used_idx for the communication device 4A and the descriptor 350 by the buffer allocating unit 55 (software), it is possible to prevent a conflict in writing to the VM memory 30A between the communication device 4A and the monitoring and the copying unit 5A.
[0362] Further, by setting the length 353 of the descriptor 350 to “0”, the virtual port 42A can encourage the VM to release the reception buffer 32 while suppressing the load of reading data from the VM memory 30A (reception buffer 32).
[0363] The dummy packet described above may be regarded as a packet that causes, for example, the virtual port 42A to set “0” in the length 353 of the descriptor 350 corresponding to a reception buffer 32 of the destination of the dummy packet. A dummy packet may be a packet that sets the length 353 to “0” according to the logic of the virtual port 42A. Alternatively, the dummy packet may be a packet commonly known to the buffer allocating unit 55 and the virtual port 42A, as an example, a packet defined to set the length 353 to “0”.
[0364] Further, in response to reception of a dummy packet, the virtual port 42A may set the length 353 of the descriptor 350 to “0” and also suppress writing of data into the reception buffer 32. This makes it possible to suppress the load of writing data from the communication device 4A to the VM memory 30A (reception buffer 32).
[0365] The releasing process of an unreceived buffer for the copying unit 52A and the communication device 4A described with reference to
[0366] (2) Example of Hardware Configuration:
[0367]
[0368] As illustrated in
[0369] The processor 10a is an example of an arithmetic operation processing device that performs various controls and calculations. The processor 10a may be communicably connected to the blocks in the computer 10 via a bus 10i. The processor 10a may be a multiprocessor including multiple processors, may be a multicore processor having multiple processor cores, or may have a configuration having multiple multicore processors. The processor 2 illustrated in, for example,
[0370] The memory 10b is an example of a HW device that stores various types of data and information such as a program. Examples of the memory 10b include one or both of a volatile memory such as a Dynamic Random Access Memory (DRAM) and a non-volatile memory such as Persistent Memory (PM). The host memory 3 illustrated in, for example,
[0371] The storing device 10c is an example of a HW device that stores various types of data and information such as program. Examples of the storing device 10c include a magnetic disk device such as a Hard Disk Drive (HDD), a semiconductor drive device such as a Solid State Drive (SSD), and various storing devices such as a nonvolatile memory. Examples of the nonvolatile memory include a flash memory, a Storage Class Memory (SCM), and a Read Only Memory (ROM).
[0372] The storing device 10c may store a program 10g-1 that implements all or part of various functions of the computer 10. For example, the processor 10a of the server 1 can achieve the functions of the virtual switch 20 and the monitoring and copying unit 5 (monitoring unit 51 and copying unit 52) illustrated in, for example,
[0373] In addition, the flow table 22 and the flow cache 23 which are illustrated in, for example,
[0374] The I/F device 10d is an example of a communication IF that controls connection and communication with a network. For example, the I/F device 10d may include an applying adapter conforming to Local Area Network (LAN) such as Ethernet (registered trademark) or optical communication such as Fibre Channel (FC), and may be a communication device such as an NIC. The applying adapter may be compatible with one of or both wireless and wired communication schemes. For example, the server 1 may be communicably connected to an external Network (NW) or an external I/F via the I/F device 10d.
[0375] The communication device 4 illustrated in, for example,
[0376] The I/F device 10d can achieve the function as the communication devices 4 and 4A by executing a program 10g-2 stored in the storing region by, for example, the FPGA. Further, the other I/F device 10d can achieve the functions as the copying units 52 and 52A by executing the program 10g-2 stored in the storing region by, for example, the FPGA. The copying units 52 and 52A may be an I/O device that is connected to the server 1 via the I/F device 10d.
[0377] For example, the programs 10g-1 and 10g-2 may be downloaded from the network to the computer 10 via the I/F device 10d, and then stored respectively in the storing regions of the storing device 10c and the I/F device 10d.
[0378] The functions of the servers 1 and 1A of the one embodiment may be achieved by at least a part of these programs 10g-1 and 10g-2. Therefore, at least a part of the programs 10g-1 and 10g-2 can be regarded as the information processing program.
[0379] The I/O device 10e may include one or both of an input device and an output device. Examples of the input device include a keyboard, a mouse, and a touch panel. Examples of the output device include a monitor, a projector, and a printer.
[0380] The reader 10f is an example of a reader that reads data and programs recorded on a recording medium 10h. The reader 10f may include a connecting terminal or device to which the recording medium 10h can be connected or inserted. Examples of the reader 10f include an applying adapter conforming to, for example, Universal Serial Bus (USB), a drive apparatus that accesses a recording disk, and a card reader that accesses a flash memory such as an SD card. The programs 10g-1 and 10g-2 may be stored in the recording medium 10h. The reader 10f may read the programs 10g-1 and 10g-2 from the recording medium 10h and store the read programs 10g-1 and 10g-2 into the storing device 10c and the I/F device 10d.
[0381] The recording medium 10h is an example of a non-transitory computer-readable recording medium such as a magnetic/optical disk, and a flash memory. Examples of the magnetic/optical disk include a flexible disk, a Compact Disc (CD), a Digital Versatile Disc (DVD), a Blu-ray disk, and a Holographic Versatile Disc (HVD). Examples of the flash memory include a semiconductor memory such as a USB memory and an SD card.
[0382] The HW configuration of the computer 10 described above is exemplary. Accordingly, the computer 10 may appropriately undergo increase or decrease of HW devices (e.g., addition or deletion of arbitrary blocks), division, integration in an arbitrary combination, and addition or deletion of the bus. For example, in the servers 1 and 1A, at least one of the I/O device 10e and the reader 10f may be omitted.
[0383] (3) Miscellaneous:
[0384] The technique according to the one embodiment described above can be changed or modified as follows.
[0385] For example, the blocks included in the server 1 illustrated in
[0386] Further, the description of the one embodiment assumes a case where the server 1 includes a single communication device 4 and a case where the server 1A includes a single communication device 4A, but the configuration of the server 1 is by no means limited to this. Alternatively, the server 1 may include multiple communication devices 4 or 4A because the input/output ports can be discriminated from one another with the PIDs in units of the communication device 4 of 4A.
[0387] In one aspect, it is possible to suppress lowering of data transfer performance in a relay device that performs a relaying process, serving as a virtual switch that connects the multiple virtual machines to one another.
[0388] Throughout the descriptions, the indefinite article “a” or “an”, or adjective “one” does not exclude a plurality.
[0389] All examples and conditional language recited herein are intended for the pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although one or more embodiments of the present inventions have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.