Network interface device
The network interface device with a configurable hardware module and processing units addresses CPU resource bottlenecks by enabling parallel data packet operations directly on the hardware, improving efficiency and scalability.
Patent Information
- Application Number
- JP2024083450
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2019-04-25
- Filing Date
- 2024-05-22
- Publication Date
- 2024-08-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing network interface devices face inefficiencies in processing data packets due to high resource consumption on host CPUs, particularly in performing operations like filtering and routing, which can lead to bottlenecks and increased power requirements when scaling to higher speeds.
A network interface device with a configurable hardware module comprising multiple processing units, each performing a predetermined operation in a single step, interconnected to form a data processing pipeline, allowing parallel execution of operations such as filtering and routing directly on the hardware, reducing reliance on host CPU resources.
This approach reduces compilation time and increases processing speed while minimizing resource consumption on the host system, enabling efficient handling of high data flows without the bottlenecks and power issues associated with traditional CPU-based solutions.
Smart Images

Figure 2024116163000001_ABST
Abstract
Description
[Technical field]
[0001] Field The present application relates to a network interface device for performing functions on data packets. [Background technology]
[0002] background Network interface devices are known and are typically used to provide an interface between a computing device and a network. Network interface devices may be configured to process data received from the network and / or process data placed on the network. Summary of the Invention [Means for solving the problem]
[0003] overview According to one aspect, there is provided a network interface device for interfacing a host device to a network, the network interface device comprising: a first interface, the first interface configured to receive a plurality of data packets; and a configurable hardware module comprising a plurality of processing units, each processing unit associated with a predetermined type of operation executable in a single step, at least some of the plurality of processing units being associated with different predetermined types of operations, the hardware module being configurable to interconnect at least some of the plurality of processing units to provide a first data processing pipeline for processing one or more of the plurality of data packets to perform a first function on the one or more of the plurality of data packets.
[0004] In some embodiments, the first function includes a filtering function. In some embodiments, the function includes at least one of a tunneling, an encapsulation, and a routing function. In some embodiments, the first function includes an extended Berkley packet filter function.
[0005] In some embodiments, the first function includes a distributed denial of service scrubbing operation. In some embodiments, the first function includes a firewall operation.
[0006] In some embodiments, the first interface is configured to receive a first data packet from a network.
[0007] In some embodiments, the first interface is configured to receive a first data packet from the host device.
[0008] In some embodiments, two or more of at least some of the plurality of processing units are configured to perform their associated at least one predetermined operation in parallel.
[0009] In some embodiments, two or more of at least some of the plurality of processing units may be configured to clock their associated predetermined clocks according to a common clock signal of the hardware module. The device is configured to perform an operation of the type:
[0010] In some embodiments, each of two or more of at least some of the plurality of processing units is configured to perform its associated predetermined type of operation within a predetermined length of time defined by a clock signal.
[0011] In some embodiments, two or more of at least some of the plurality of processing units are configured to access the first data packet within a period of a predetermined length of time and, in response to an end of the predetermined length of time, to transfer a result of the respective at least one operation to a next processing unit.
[0012] In some embodiments, the results include at least one or more of values from one or more of the plurality of data packets, updates to the map state, and metadata.
[0013] In some embodiments, each of the multiple processing units includes an application specific integrated circuit configured to perform at least one operation associated with the respective processing unit.
[0014] In some embodiments, each of the processing units comprises a field programmable gate array, hi some embodiments, each of the processing units comprises any other type of soft logic.
[0015] In some embodiments, at least one of the plurality of processing units comprises a digital circuit and a memory that stores state associated with processing performed by the digital circuit, the digital circuit being configured in communication with the memory to perform a predetermined type of operation associated with the respective processing unit.
[0016] In some embodiments, the network interface device comprises a memory accessible to two or more of the plurality of processing units, the memory configured to store a state associated with the first data packet, and during execution of the first function by the hardware module, the two or more of the plurality of processing units configured to access and modify the state.
[0017] In some embodiments, a first processing unit of at least some of the plurality of processing units is configured to stall during an access of the value of the state by a second processing unit of the plurality of processing units.
[0018] In some embodiments, one or more of the multiple processing units are individually configurable to perform operations specific to their respective pipelines based on their associated predetermined type of operation.
[0019] In some embodiments, a hardware module is configured to receive instructions and, in response to the instructions, at least one of: interconnect at least some of the plurality of said processing units to provide a data processing pipeline for processing one or more of the plurality of data packets; cause one or more of the plurality of processing units to perform their associated predetermined type of operation on the one or more data packets; add one or more of the plurality of processing units to the data processing pipeline; and remove one or more of the plurality of processing units from the data processing pipeline.
[0020] In some embodiments, the predetermined operation includes at least one of loading at least one value of the first data packet from a memory, storing at least one value of the data packet in a memory, and performing a lookup in a lookup table to determine an action to be performed with respect to the data packet.
[0021] In some embodiments, a hardware module is configured to receive instructions, the hardware module being configurable to interconnect at least some of the plurality of said processing units to provide a data processing pipeline for processing one or more of the plurality of data packets in response to said instructions, the instructions including a data packet to be transmitted via a third processing pipeline.
[0022] In some embodiments, at least some of the one or more of the plurality of processing units are configurable to perform selected ones of their associated predetermined types of operations with respect to the one or more of the plurality of data packets in response to the instructions.
[0023] In some embodiments, the plurality of components includes a second component of the plurality of components configured to provide the first function in a circuit separate from the hardware module, and the network interface device comprises at least one controller configured to cause data packets passing through the processing pipeline to be processed by one of the first component of the plurality of components and the second component of the plurality of components.
[0024] In some embodiments, the network interface device comprises at least one controller configured to issue instructions to cause a hardware module to begin performing a first function on a data packet, the instructions being configured to cause a first component of the plurality of components to be inserted into the processing pipeline.
[0025] In some embodiments, the network interface device comprises at least one controller configured to issue instructions to a hardware module to initiate performance of a first function on a data packet, the instructions including a control message configured to be sent through a processing pipeline and to cause a first component of the plurality of components to be actuated.
[0026] In some embodiments, for one or more of at least some of the plurality of processing units, the associated at least one operation includes at least one of loading at least one value of the first data packet from a memory of the network interface device, storing the at least one value of the first data packet in a memory of the network interface device, and performing a lookup in a lookup table to determine an action to be taken with respect to the first data packet.
[0027] In some embodiments, one or more of at least some of the plurality of processing units are configured to pass at least one result of its associated at least one predetermined operation to a next processing unit in the first processing pipeline, the next processing unit being configured to perform a next predetermined operation in response to the at least one result.
[0028] In some embodiments, each of the different predetermined types of actions is defined by a different template.
[0029] In some embodiments, the type of predetermined operation includes at least one of accessing a data packet, accessing a lookup table stored in a memory of the hardware module, performing a logical operation on data loaded from the data packet, and performing a logical operation on data loaded from the lookup table.
[0030] In some embodiments, the hardware module comprises routing hardware, the hardware module being configurable to interconnect at least some of the plurality of said processing units to provide a first data processing pipeline by configuring the routing hardware to route data packets between the plurality of processing units in a particular order defined by the first data processing pipeline.
[0031] In some embodiments, the hardware module is configurable to interconnect at least some of the plurality of said processing units to provide a second data processing pipeline for processing one or more of the plurality of data packets to perform a second function different from the first function.
[0032] In some embodiments, the hardware module is configurable to interconnect at least some of a plurality of said processing units to provide a first data processing pipeline and then to interconnect at least some of said plurality of said processing units to provide a second data processing pipeline.
[0033] In some embodiments, the network interface device comprises further circuitry separate from the hardware module and configured to perform a first function on one or more of said plurality of data packets.
[0034] In some embodiments, the further circuitry includes at least one of a field programmable gate array and a plurality of central processing units.
[0035] In some embodiments, the network interface device comprises at least one controller, and the further circuitry is configured to perform a first function on the data packets during a compilation process to cause the first function to be executed in a hardware module, and the at least one controller is configured to control the hardware module to initiate execution of the first function on the data packets in response to completion of the compilation process.
[0036] In some embodiments, the further circuitry includes a plurality of central processing units. In some embodiments, the at least one controller is configured to control the further circuitry to stop execution of the first function on the data packet in response to the determination that the compilation process for causing the first function to be executed in the hardware module is completed.
[0037] In some embodiments, the network interface device comprises at least one controller, and the hardware module is configured to perform a first function on the data packet during a compilation process for causing the first function to be performed in a further circuit, and the at least one controller is configured to determine that the compilation process for causing the first function to be performed in the further circuit is completed and, in response to said determination, control the further circuit to begin performing the first function on the data packet.
[0038] In some embodiments, the further circuitry includes a field programmable gate array.
[0039] In some embodiments, the at least one controller is configured to control the hardware module to stop executing the first function on the data packet in response to the determination that the compilation process for causing the first function to be executed in the further circuitry is completed.
[0040] In some embodiments, the network interface device comprises at least one controller configured to perform a compilation process to enable the first function to be executed in the hardware module.
[0041] In some embodiments, the compilation process includes providing instructions for providing a control plane interface in a hardware module that is responsive to control messages.
[0042] According to another aspect, there is provided a data processing system comprising a network interface device according to the first aspect and a host device, the data processing system comprising at least one controller configured to perform a compilation process to enable a first function to be executed in a hardware module.
[0043] In some embodiments, the at least one controller is provided by one or more of the network interface device and the host device.
[0044] In some embodiments, the compilation process is performed in response to a determination by the at least one controller that the computer program representing the first functionality is safe to execute in kernel mode on the host device.
[0045] In some embodiments, the at least one controller is configured to perform the compilation process by assigning each of at least some of the plurality of processing units to perform at least one operation from a plurality of operations represented by a sequence of computer code instructions in a particular order of the first data processing pipeline, the plurality of operations providing a first function for one or more of the plurality of data packets.
[0046] In some embodiments, the at least one controller is configured to send first instructions to further circuitry of the network interface device to perform a first function on the data packet prior to completion of the compilation process, and to send second instructions to the hardware module to begin performing the first function on the data packet after completion of the compilation process.
[0047] According to another aspect, a method is provided for implementation in a network interface device, the method comprising: receiving a plurality of data packets at a first interface; and configuring a hardware module to interconnect at least some of a plurality of processing units of the hardware module to provide a first data processing pipeline for processing one or more of the plurality of data packets to perform a first function on the one or more of the plurality of data packets, each processing unit being associated with a predetermined type of operation executable in a single step, and at least some of the plurality of processing units being configured to process a plurality of data packets at a first interface; A specific type of action is associated with the action.
[0048] According to another aspect, a non-transitory computer-readable medium is provided that includes program instructions for causing a network interface device to perform a method, the method including: receiving a plurality of data packets at a first interface; and configuring the hardware module to interconnect at least some of a plurality of processing units of the hardware module to provide a first data processing pipeline for processing one or more of the plurality of data packets to perform a first function on the one or more of the plurality of data packets, each processing unit being associated with a predetermined type of operation executable in a single step, and at least some of the plurality of processing units being associated with different predetermined types of operations.
[0049] According to another aspect, a processing unit is provided, the processing unit configured to perform at least one predefined operation on a first data packet received at the network interface device, connected to a first further processing unit configured to perform a first further at least one predefined operation on the first data packet, connected to a second further processing unit configured to perform a second further at least one predefined operation on said first data packet, configured to receive a result of the first further at least one predefined operation from the first further processing unit, perform at least one predefined operation in response to the result of the first further at least one predefined operation, and transmit a result of the at least one predefined operation to the second further processing unit for processing in said second further at least one predefined operation.
[0050] In some embodiments, the processing unit is configured to receive a clock signal for timing at least one predetermined operation, and the processing unit is configured to perform the at least one predetermined operation in at least one cycle of the clock signal.
[0051] In some embodiments, the processing unit is configured to perform at least one predetermined operation in a single cycle of the clock signal.
[0052] In some embodiments, the at least one predetermined operation, the first further at least one predetermined operation, and the second further at least one predetermined operation form part of a function performed on a first data packet received at the network interface device.
[0053] In some embodiments, the first data packet is received from a host device, and the network interface device is configured to interface the host device to the network.
[0054] In some embodiments, the first data packet is received from a network, and the network interface device is configured to interface the host device to the network.
[0055] In some embodiments the function is a filtering function. In some embodiments, the filtering function is an extended Berkley packet filter function.
[0056] In some embodiments, the processing unit includes an application specific integrated circuit configured to perform at least one predetermined operation.
[0057] In some embodiments, the processing unit comprises digital circuitry configured to perform at least one predetermined operation and a memory that stores state associated with the at least one predetermined operation to be performed.
[0058] In some embodiments, the processing unit is configured to access a memory accessible to the first further processing unit and the second further processing unit, the memory configured to store a state associated with the first data packet, and the at least one predetermined action includes modifying the state stored in the memory.
[0059] In some embodiments, the processing unit is configured to read a value of said state from memory during a first clock cycle and provide said value to a second further processing unit for modification by the second further processing unit, and the processing unit is configured to stall during a second clock cycle after the first clock cycle.
[0060] In some embodiments, the at least one predetermined operation includes at least one of loading the first data packet from a memory of the network interface device, storing the first data packet in a memory of the network interface device, and performing a lookup in a lookup table to determine an action to be performed with respect to the first data packet.
[0061] According to another aspect, there is provided a method implemented in a processing unit, the method comprising the steps of performing at least one predefined operation on a first data packet received at the network interface device, connecting to a first further processing unit configured to perform a first further at least one predefined operation on the first data packet, connecting to a second further processing unit configured to perform a second further at least one predefined operation on said first data packet, receiving a result of the first further at least one predefined operation from the first further processing unit, performing at least one predefined operation in response to a result of the first further at least one predefined operation, and transmitting a result of the at least one predefined operation to the second further processing unit for processing in the second further at least one predefined operation.
[0062] According to another aspect, a computer-readable non-transitory storage device is provided having stored thereon instructions that, when executed by a processing unit, cause the processing unit to perform a method comprising: performing at least one predetermined operation on a first data packet received at a network interface device; connecting to a first further processing unit configured to perform a first further at least one predetermined operation on the first data packet; connecting to a second further processing unit configured to perform a second further at least one predetermined operation on said first data packet; receiving a result of the first further at least one predetermined operation from the first further processing unit; performing at least one predefined operation in response to a result of the first further at least one predefined operation; and transmitting a result of the at least one predefined operation to the second further processing unit for processing in said second further at least one predefined operation.
[0063] According to another aspect, a network interface device for interfacing a host device to a network is provided, the network interface device including at least one controller, a first interface configured to receive data packets, and a data packet received at the first interface. and a second circuit configured to perform a first function on a data packet received at the first interface during a compilation process for causing the first function to be performed in the second circuit, and the at least one controller configured to determine that the compilation process for causing the first function to be performed in the second circuit is completed and, in response to said determination, to control the second circuit to begin performing the first function on the data packet received at the first interface.
[0064] In some embodiments, the at least one controller is configured to control the first circuit to stop executing the first function on data packets received at the first interface in response to the determination that the compilation process for causing the first function to be executed in the second circuit is completed.
[0065] In some embodiments, the at least one controller is configured to, in response to the determination that the compilation process for causing the first function to be executed in the second circuit is completed, control the first circuit to begin execution of the first function on data packets of the first data flow received at the first interface and to stop execution of the first function on data packets of the first data flow.
[0066] In some embodiments, the first circuit comprises at least one central processing unit, each of the at least one central processing unit configured to perform a first function on at least one data packet received at the first interface.
[0067] In some embodiments, the second circuit comprises a field programmable gate array configured to initiate performance of a first function on a data packet received at the first interface.
[0068] In some embodiments, the second circuit comprises a hardware module comprising a plurality of processing units, each processing unit associated with at least one predefined operation, the first interface configured to receive a first data packet, and the hardware module configured to cause at least some of the plurality of processing units to execute their associated at least one predefined operation in a particular order to perform the first function on the first data packet after a compilation process such that the first function is executed in the second circuit.
[0069] In some embodiments, the first circuit comprises a hardware module comprising a plurality of processing units, each processing unit associated with at least one predefined operation, the first interface configured to receive a first data packet, and the hardware module configured to cause at least some of the plurality of processing units to execute their associated at least one predefined operation in a particular order to perform the first function on the first data packet during a compilation process to cause the first function to be executed in the second circuit.
[0070] In some embodiments, the at least one controller is configured to perform a compilation process to compile the first function for execution by the second circuit.
[0071] In some embodiments, the at least one controller is configured to instruct the first circuit to perform a first function on a data packet received at the first interface prior to completion of the compilation process.
[0072] In some embodiments, the compilation process for compiling the first function for execution by the second circuit is performed by the host device, and the at least one controller is configured to determine that the compilation process is complete in response to receiving an indication of completion of the compilation process from the host device.
[0073] In some embodiments, a processing pipeline for processing data packets received at a first interface, the processing pipeline comprising a plurality of components each configured to perform one of a plurality of functions on the data packets received at the first interface, a first component of the plurality of components configured to provide the first function when provided by a first circuit, and a second component of the plurality of components configured to provide the first function when provided by a second at least one processing unit.
[0074] In some embodiments, the at least one controller is configured to control the second circuit to begin performance of a first function on a data packet received at the first interface by inserting a second component of the plurality of components into the processing pipeline.
[0075] In some embodiments, the at least one controller is configured to, in response to the determination that the compilation process for causing the first function to be executed in the second circuit is completed, control the first circuit to stop execution of the first function on data packets received at the first interface by removing a first component of the plurality of components from the processing pipeline.
[0076] In some embodiments, the at least one controller is configured to control the second circuit to initiate performance of a first function on a data packet received at the first interface by sending a control message through the processing pipeline to actuate a second component of the plurality of components.
[0077] In some embodiments, the at least one controller is configured to, in response to the determination that the compilation process for causing the first function to be executed in the second circuit is completed, control the first circuit to stop execution of the first function on data packets received at the first interface by sending a control message through the processing pipeline to stall a second component of the plurality of components.
[0078] In some embodiments, a first component of the plurality of components is configured to provide a first function on a first data flow of data packets passing through the processing pipeline, and a second component of the plurality of components is configured to provide the first function on data packets of a second data flow passing through the processing pipeline.
[0079] In some embodiments, the first function includes filtering the data packet.
[0080] In some embodiments, the first interface is configured to receive data packets from a network.
[0081] In some embodiments, the first interface is configured to receive data packets from the host device.
[0082] In some embodiments, the compilation time of the first function of the second circuit is longer than the compilation time of the first function of the first circuit.
[0083] According to another aspect, a method is provided, the method including the steps of receiving a data packet at a first interface of a network interface device and performing a first function in a first circuit of the network interface device on the data packet received at the first interface, the first circuit being configured to perform the first function on the data packet received at the first interface during a compilation process for causing the first function to be performed in a second circuit, the method including the steps of determining that the compilation process for causing the first function to be performed in the second circuit is completed and controlling the second circuit of the network interface device to begin performing the first function on the data packet received at the first interface in response to the determination.
[0084] According to another aspect, a non-transitory computer-readable medium is provided that includes program instructions for causing a data processing system to perform a method, the method including receiving a data packet at a first interface of a network interface device and performing, in a first circuit of the network interface device, a first function on the data packet received at the first interface, the first circuit being configured to perform the first function on the data packet received at the first interface during a compilation process for causing the first function to be performed in a second circuit, the method including determining that the compilation process for causing the first function to be performed in the second circuit is completed and, in response to the determination, controlling the second circuit of the network interface device to begin performing the first function on the data packet received at the first interface.
[0085] According to another aspect, a non-transitory computer readable medium is provided, the medium including program instructions for causing a data processing system to perform the following steps: executing a compilation process for compiling a first function for execution by a second circuit of a network interface device; transmitting first instructions to the first circuit of the network interface device prior to completion of the compilation process for causing the first circuit to perform the first function on data packets received at a first interface of the network interface device; and transmitting second instructions to the second circuit to begin execution of the first function on data packets received at the first interface after completion of the compilation process.
[0086] In some embodiments, the non-transitory computer readable medium includes program instructions for causing the data processing system to perform a further compilation process to compile the first function for execution by the first circuit, wherein the compilation process takes a longer time than the further compilation process.
[0087] In some embodiments, the data processing system includes a host device, and the network interface device is configured to interface the host device with a network.
[0088] In some embodiments, the data configuration system includes a network interface device, the network interface device configured to interface the host device to the network. The device is configured to interface with the
[0089] In some embodiments, a data processing system includes a host device and a network interface device configured to interface the host device with a network.
[0090] In some embodiments, the first function includes filtering data packets received at the first interface from the network.
[0091] In some embodiments, the non-transitory computer readable medium includes configuration program instructions for causing the data processing system to send a third instruction to the first circuit after completion of the compilation process, the third instruction causing the first circuit to stop performing a function on data packets received at the first interface.
[0092] In some embodiments, the non-transitory computer readable medium includes program instructions for causing the data processing system to send instructions to the second circuit to perform a first function on data packets of the first data flow and to send instructions to the first circuit to stop performing the first function on data packets of the first data flow.
[0093] In some embodiments, the first circuitry includes at least one central processing unit, and prior to completion of the second compilation process, each of the at least one central processing unit is configured to perform a first function on at least one data packet received at the first interface.
[0094] In some embodiments, the second circuit comprises a field programmable gate array configured to initiate performance of a first function on a data packet received at the first interface.
[0095] In some embodiments, the second circuit comprises a hardware module comprising a plurality of processing units, each processing unit associated with at least one predetermined operation, the data packets received at the first interface including the first data packet, and the hardware module is configured to perform, after completion of the second compilation process, a first function on the first data packet by at least some of the processing units of the plurality of processing units performing their respective at least one operation on the first data packet.
[0096] In some embodiments, the first circuit comprises a hardware module comprising a plurality of processing units configured to provide a first function on a data packet, each processing unit being associated with at least one predetermined operation, the data packets received at the first interface including the first data packet, and the hardware module is configured to perform the first function on the first data packet by each processing unit of at least some of the plurality of processing units performing their respective at least one operation on the first data packet prior to completion of the second compilation process.
[0097] In some embodiments, the compilation process includes assigning each of a plurality of processing units of the second circuit to perform in a particular order at least one operation associated with one of a plurality of processing stages in the sequence of computer code instructions.
[0098] In some embodiments, the first function provided by the first circuit is provided as a component of a processing pipeline for processing data packets received at the first interface, and the first function provided by the second circuit is provided as a component of the processing pipeline.
[0099] In some embodiments, the first instructions include instructions configured to cause a first component of the plurality of components to be inserted into a processing pipeline.
[0100] In some embodiments, the second instructions include instructions configured to cause a second component of the plurality of components to be inserted into the processing pipeline.
[0101] In some embodiments, the non-transitory computer readable medium includes configuration program instructions for causing the data processing system to, after completion of the compilation process, send third instructions to the first circuit to stop execution of the first function on data packets received at the first interface, the third instructions including instructions configured to cause a first component of the plurality of components to be removed from the processing pipeline.
[0102] In some embodiments, the first instruction includes a control message sent through the processing pipeline to operate a second component of the plurality of components.
[0103] In some embodiments, the second instruction includes a control message sent through the processing pipeline to operate a second component of the plurality of components.
[0104] In some embodiments, the non-transitory computer-readable medium includes program instructions for causing the data processing system to, after completion of the compilation process, send a third instruction to the first circuit to stop execution of a function on a data packet received at the first interface, the third instruction including a control message through the processing pipeline to stall a first component of the plurality of components.
[0105] According to another aspect, there is provided a data processing system comprising at least one processor and at least one memory containing computer program code, the at least one memory and the computer program code configured to cause the data processing system, using the at least one processor, to perform a compilation process for compiling a function to be executed by a second circuit of a network interface device, instructing a first circuit of the network interface device to execute the function on data packets received at a first interface of the network interface device before completion of the compilation process, and instructing a second at least one processing unit to start executing the function on data packets received at the first interface after completion of the second compilation process.
[0106] According to another aspect, a method is provided for implementation in a data processing system, the method comprising the steps of: executing a compilation process for compiling a function to be executed by a second circuit of a network interface device; transmitting, prior to completion of the compilation process, to a first circuit of the network interface device first instructions for causing the function to be executed on data packets received at a first interface of the network interface device; and transmitting, after completion of the compilation process, to the second circuit first instructions for causing the function to be executed on data packets received at the first interface. and transmitting a second instruction to the processor to initiate execution of the function.
[0107] According to another aspect, a non-transitory computer readable medium is provided that includes program instructions for causing a data processing system to assign each of a plurality of processing units to perform in a particular order at least one operation associated with one of a plurality of processing stages in a sequence of computer code instructions, the plurality of processing stages providing a first function for a first data packet received at a first interface of a network interface device, each of the plurality of processing units configured to perform one of a plurality of types of operations, at least some of the plurality of processing units configured to perform different types of operations, and for each of the plurality of processing units, the assignment is performed in response to a determination that the processing unit is configured to perform a type of operation suitable for performing the respective at least one operation.
[0108] In some embodiments, each of the types of processing is defined by one of a number of templates.
[0109] In some embodiments, the type of processing includes at least one of accessing a data packet received at the network interface device, accessing a lookup table stored in a memory of the hardware module, performing a logical operation on data loaded from the data packet, and performing a logical operation on data loaded from the lookup table.
[0110] In some embodiments, two or more of at least some of the plurality of processing units are configured to perform their associated at least one operation according to a common clock signal of the hardware module.
[0111] In some embodiments, the allocating includes allocating each of two or more of at least some of the plurality of processing units to perform its associated at least one operation within a predetermined length of time defined by a clock signal.
[0112] In some embodiments, the allocating includes allocating two or more of at least some of the plurality of processing units to access the first data packet within a period of a predetermined length of time.
[0113] In some embodiments, the allocating includes assigning each of two or more of at least some of the plurality of processing units to transfer a result of the respective at least one operation to a next processing unit in response to expiration of a period of a predetermined length of time.
[0114] In some embodiments, a non-transitory computer readable medium includes program instructions for causing a data processing system to assign at least some of a plurality of stages to occupy a single clock cycle.
[0115] In some embodiments, a non-transitory computer readable medium includes program instructions for causing a data processing system to assign two or more of a plurality of processing units to perform at least one of their assigned operations performed in parallel.
[0116] In some embodiments, the network interface device comprises a hardware module comprising multiple processing units.
[0117] In some embodiments, the non-transitory computer readable medium comprises a data processing system, The method includes computer program instructions for performing the steps of: performing a compilation process including an allocation; sending first instructions to circuitry of the network interface device to perform a first function on data packets received at the first interface before completion of the compilation process; and sending second instructions to a plurality of processing units to begin performing the first function on data packets received at the first interface after completion of the compilation process.
[0118] In some embodiments, the non-transitory computer-readable medium includes, for one or more of at least some of the plurality of processing units, the at least one operation assigned includes at least one of loading at least one value of the first data packet from a memory of the network interface device, storing the at least one value of the first data packet in a memory of the network interface device, and performing a lookup in a lookup table to determine an action to be taken with respect to the first data packet.
[0119] In some embodiments, a non-transitory computer readable medium includes computer program instructions for causing a data processing system to issue instructions to configure routing hardware of a network interface device to route a first data packet among a plurality of processing units in a particular order to perform a first function on the first data packet.
[0120] In some embodiments, the first functionality provided by the plurality of processing units is provided as a component of a processing pipeline for processing data packets received at the first interface.
[0121] In some embodiments, a non-transitory computer-readable medium includes computer program instructions for causing a data processing system to issue instructions that cause a component to be inserted into a processing pipeline, thereby causing a plurality of processing units to begin performing a first function on a data packet received at a first interface.
[0122] In some embodiments, the non-transitory computer-readable medium includes computer program instructions for causing a data processing system to issue instructions that cause components to be operated within a processing pipeline, thereby causing a plurality of processing units to begin performing a first function on a data packet received at a first interface.
[0123] In some embodiments, the data processing system includes a host device, and the network interface device is configured to interface the host device with a network.
[0124] In some embodiments, the data processing system comprises a network interface device.
[0125] In some embodiments, a data processing system includes a network interface device and a host device, the network interface device configured to interface the host device with a network.
[0126] According to another aspect, there is provided a data processing system comprising at least one processor and at least one memory containing computer program code, the at least one memory and the computer program code being configured to execute, using the at least one processor, , configured to cause the data processing system to assign each of a plurality of processing units to perform in a particular order at least one operation associated with one of a plurality of processing stages in a sequence of computer code instructions, the plurality of processing stages providing a first function for a first data packet received at a first interface of the network interface device, each of the plurality of processing units configured to perform one of a plurality of types of operations, at least some of the plurality of processing units configured to perform different types of operations, and for each of the plurality of processing units, the assignment is performed in response to a determination that the processing unit is configured to perform a type of operation suitable for performing the respective at least one operation.
[0127] According to another aspect, a method is provided that includes assigning each of a plurality of processing units to perform in a particular order at least one operation associated with one of a plurality of processing stages in a sequence of computer code instructions, the plurality of processing stages providing a first function on a first data packet received at a first interface of a network interface device, each of the plurality of processing units configured to perform one of a plurality of types of operations, at least some of the plurality of processing units configured to perform different types of operations, and for each of the plurality of processing units, the assignment is performed in response to a determination that the processing unit is configured to perform a type of operation suitable for performing the respective at least one operation.
[0128] The processing units of the hardware modules are described as performing those types of operations in a single step, however, those skilled in the art will recognize that this feature is merely a preferred feature and is not essential or necessary to the functioning of the invention.
[0129] According to one aspect, a method is provided that includes receiving at a compiler a bitfile description and a program, the bitfile description including a description of routing of a portion of a circuit, and compiling the program using the bitfile description to output a bitfile for the program.
[0130] The method may include using the bitfile to configure at least a portion of the portion of the circuitry to perform functions associated with the program.
[0131] The bitfile description may include information regarding routing between multiple processing units of said portion of the circuit.
[0132] The bitfile description may include routing information for at least one of the plurality of processing units indicating at least one of to which of one or more other processing units it can output data and from which it can receive data.
[0133] The bitfile description may include routing information that indicates one or more routes between two or more respective processing units.
[0134] A bitfile description may contain information that indicates only the routes that can be used by a compiler when compiling a program to provide a bitfile for the program.
[0135] The bitfile may include information indicating, for each processing unit, at least one of: from which one or more of the one or more other processing units in the bitfile description of the respective processing unit inputs should be provided; and to which one or more of the one or more other processing units in the bitfile description of the respective processing unit output should be provided.
[0136] The portion of the circuit may include at least a portion of a configurable hardware module comprising a plurality of processing units, each processing unit associated with a predetermined type of operation executable in a single step, at least some of the plurality of processing units associated with different predetermined types of operations, and the bitfile description including information regarding routing between at least some of the plurality of processing units, and the method may include using the bitfile to cause hardware to interconnect at least some of the plurality of processing units to provide a first data processing pipeline for processing one or more of the plurality of data packets to perform a first function on the one or more of the plurality of data packets.
[0137] The bitfile description may be of at least a portion of the FPGA. The bitfile description may be part of a dynamically programmable FPGA.
[0138] The program may include one of an eBPF program and a P4 program.
[0139] The compiler and the FPGA may be provided within a network interface device.
[0140] According to another aspect, there is provided an apparatus comprising at least one processor and at least one memory containing computer code for one or more programs, the at least one memory and the computer code configured to cause, with the at least one processor, the apparatus to at least receive a bitfile description and a program, the bitfile description including a description of routing of a portion of a circuit, and compile the program using the bitfile description to output a bitfile for the program.
[0141] The at least one memory and computer code can be configured to cause the device, using the at least one processor, to configure at least a portion of said portion of said circuitry using said bitfile to perform functions associated with said program.
[0142] The bitfile description may include information regarding routing between multiple processing units of said portion of the circuit.
[0143] The bitfile description may include routing information for at least one of the plurality of processing units indicating at least one of to which of one or more other processing units it can output data and from which it can receive data.
[0144] A bitfile description defines one or more routing relationships between two or more respective processing units. The routing information may include information indicating
[0145] A bitfile description may contain information that indicates only the routes that can be used by a compiler when compiling a program to provide a bitfile for the program.
[0146] The bitfile may include information indicating, for each processing unit, at least one of: from which one or more of the one or more other processing units in the bitfile description of the respective processing unit inputs should be provided; and to which one or more of the one or more other processing units in the bitfile description of the respective processing unit output should be provided.
[0147] A portion of the circuit may include at least a portion of a configurable hardware module comprising a plurality of processing units, each processing unit associated with a predetermined type of operation executable in a single step, at least some of the plurality of processing units associated with different predetermined types of operations, the bitfile description including information regarding routing between at least some of the plurality of processing units, and at least one memory and computer code configured to cause the apparatus, using the at least one processor, to perform a step of using the bitfile to cause the hardware to interconnect at least some of the plurality of processing units to provide a first data processing pipeline for processing one or more of the plurality of data packets to perform a first function on the one or more of the plurality of data packets.
[0148] The bitfile description may be of at least a portion of the FPGA. The bitfile description may be part of a dynamically programmable FPGA.
[0149] The program may include one of an eBPF program and a P4 program.
[0150] According to another aspect, a network interface device is provided, the network interface device comprising: a first interface configured to receive a plurality of data packets; a configurable hardware module comprising a plurality of processing units, each processing unit associated with a predetermined type of operation executable in a single step; and a compiler configured to receive a bitfile description and a program including a description of routing of at least a portion of said configurable hardware module, and to compile said program using said bitfile description to output a bitfile for said program, said hardware module being configurable using said bitfile to perform a first function associated with the program.
[0151] The network interface device may be for interfacing a host device to a network.
[0152] At least some of the multiple processing units may be associated with different predetermined types of operations.
[0153] A hardware module interconnects at least some of the plurality of processing units to process one or more of the plurality of data packets to generate the plurality of data packets. The data processing pipeline may be configurable to provide a first data processing pipeline for performing a first function on the one or more of the data packets.
[0154] In some embodiments, the first function includes a filtering function. In some embodiments, the function includes at least one of a tunneling, an encapsulation, and a routing function. In some embodiments, the first function includes an extended Berkley packet filter function.
[0155] In some embodiments, the first function includes a distributed denial of service scrubbing operation. In some embodiments, the first function includes a firewall operation.
[0156] In some embodiments, the first interface is configured to receive a first data packet from a network.
[0157] In some embodiments, the first interface is configured to receive a first data packet from the host device.
[0158] In some embodiments, two or more of at least some of the plurality of processing units are configured to perform their associated at least one predetermined operation in parallel.
[0159] In some embodiments, two or more of at least some of the plurality of processing units are configured to perform their associated predetermined type of operations according to a common clock signal of the hardware module.
[0160] In some embodiments, each of two or more of at least some of the plurality of processing units is configured to perform its associated predetermined type of operation within a predetermined length of time defined by a clock signal.
[0161] In some embodiments, two or more of at least some of the plurality of processing units are configured to access the first data packet within a period of a predetermined length of time and, in response to an end of the predetermined length of time, to transfer a result of the respective at least one operation to a next processing unit.
[0162] In some embodiments, the results include at least one or more of values from one or more of the plurality of data packets, updates to the map state, and metadata.
[0163] In some embodiments, each of the multiple processing units includes an application specific integrated circuit configured to perform at least one operation associated with the respective processing unit.
[0164] In some embodiments, each of the processing units comprises a field programmable gate array, hi some embodiments, each of the processing units comprises any other type of soft logic.
[0165] In some embodiments, at least one of the plurality of processing units comprises a digital circuit and a memory that stores state associated with processing performed by the digital circuit, the digital circuit being configured in communication with the memory to perform a predetermined type of operation associated with the respective processing unit.
[0166] In some embodiments, the network interface device comprises a memory accessible to two or more of the plurality of processing units, the memory configured to store a state associated with the first data packet, and during execution of the first function by the hardware module, the two or more of the plurality of processing units configured to access and modify the state.
[0167] In some embodiments, a first processing unit of at least some of the plurality of processing units is configured to stall during an access of the value of the state by a second processing unit of the plurality of processing units.
[0168] In some embodiments, one or more of the multiple processing units are individually configurable to perform operations specific to their respective pipelines based on their associated predetermined type of operation.
[0169] In some embodiments, a hardware module is configured to receive instructions and, in response to the instructions, at least one of: interconnect at least some of the plurality of said processing units to provide a data processing pipeline for processing one or more of the plurality of data packets; cause one or more of the plurality of processing units to perform their associated predetermined type of operation on the one or more data packets; add one or more of the plurality of processing units to the data processing pipeline; and remove one or more of the plurality of processing units from the data processing pipeline.
[0170] In some embodiments, the predetermined operation includes at least one of loading at least one value of the first data packet from a memory, storing at least one value of the data packet in a memory, and performing a lookup in a lookup table to determine an action to be performed with respect to the data packet.
[0171] In some embodiments, a hardware module is configured to receive instructions, the hardware module being configurable to interconnect at least some of the plurality of said processing units to provide a data processing pipeline for processing one or more of the plurality of data packets in response to said instructions, the instructions including a data packet to be transmitted via a third processing pipeline.
[0172] In some embodiments, at least some of the one or more of the plurality of processing units are configurable to perform selected ones of their associated predetermined types of operations with respect to the one or more of the plurality of data packets in response to the instructions.
[0173] In some embodiments, the plurality of components includes a second component of the plurality of components configured to provide the first function in a circuit separate from the hardware module, and the network interface device comprises at least one controller configured to cause data packets passing through the processing pipeline to be processed by one of the first component of the plurality of components and the second component of the plurality of components.
[0174] In some embodiments, the network interface device comprises at least one controller configured to issue instructions to cause a hardware module to begin performing a first function on a data packet, the instructions being configured to cause a first component of the plurality of components to be inserted into the processing pipeline.
[0175] In some embodiments, the network interface device comprises at least one controller configured to issue instructions to a hardware module to initiate performance of a first function on a data packet, the instructions including a control message configured to be sent through a processing pipeline and to cause a first component of the plurality of components to be actuated.
[0176] In some embodiments, for one or more of at least some of the plurality of processing units, the associated at least one operation includes at least one of loading at least one value of the first data packet from a memory of the network interface device, storing the at least one value of the first data packet in a memory of the network interface device, and performing a lookup in a lookup table to determine an action to be taken with respect to the first data packet.
[0177] In some embodiments, one or more of at least some of the plurality of processing units are configured to pass at least one result of its associated at least one predetermined operation to a next processing unit in the first processing pipeline, the next processing unit being configured to perform a next predetermined operation in response to the at least one result.
[0178] In some embodiments, each of the different predetermined types of actions is defined by a different template.
[0179] In some embodiments, the type of predetermined operation includes at least one of accessing a data packet, accessing a lookup table stored in a memory of the hardware module, performing a logical operation on data loaded from the data packet, and performing a logical operation on data loaded from the lookup table.
[0180] In some embodiments, the hardware module comprises routing hardware, the hardware module being configurable to interconnect at least some of the plurality of said processing units to provide a first data processing pipeline by configuring the routing hardware to route data packets between the plurality of processing units in a particular order defined by the first data processing pipeline.
[0181] In some embodiments, the hardware module is configurable to interconnect at least some of the plurality of said processing units to provide a second data processing pipeline for processing one or more of the plurality of data packets to perform a second function different from the first function.
[0182] In some embodiments, the hardware module is configurable to interconnect at least some of a plurality of said processing units to provide a first data processing pipeline and then to interconnect at least some of said plurality of said processing units to provide a second data processing pipeline.
[0183] In some embodiments, the network interface device comprises further circuitry separate from the hardware module and configured to perform a first function on one or more of said plurality of data packets.
[0184] In some embodiments, the further circuitry comprises a field programmable gate array; and at least one of a plurality of central processing units.
[0185] In some embodiments, the network interface device comprises at least one controller, and the further circuitry is configured to perform a first function on the data packets during a compilation process to cause the first function to be executed in a hardware module, and the at least one controller is configured to control the hardware module to initiate execution of the first function on the data packets in response to completion of the compilation process.
[0186] In some embodiments, the further circuitry includes a plurality of central processing units. In some embodiments, the at least one controller is configured to control the further circuitry to stop execution of the first function on the data packet in response to the determination that the compilation process for causing the first function to be executed in the hardware module is completed.
[0187] In some embodiments, the network interface device comprises at least one controller, and the hardware module is configured to perform a first function on the data packet during a compilation process for causing the first function to be performed in a further circuit, and the at least one controller is configured to determine that the compilation process for causing the first function to be performed in the further circuit is completed and, in response to said determination, control the further circuit to begin performing the first function on the data packet.
[0188] In some embodiments, the further circuitry includes a field programmable gate array.
[0189] In some embodiments, the at least one controller is configured to control the hardware module to stop executing the first function on the data packet in response to the determination that the compilation process for causing the first function to be executed in the further circuitry is completed.
[0190] In some embodiments, the network interface device comprises at least one controller configured to perform a compilation process to enable the first function to be executed in the hardware module.
[0191] In some embodiments, the compilation process includes providing instructions for providing a control plane interface in a hardware module that is responsive to control messages.
[0192] According to another aspect, a computer-implemented method is provided, the method including determining routing information for at least a portion of a configurable hardware module comprising a plurality of processing units, each processing unit being associated with a predetermined type of operation executable in a single step, at least some of the plurality of processing units being associated with different predetermined types of operations, the routing information providing information regarding available routes between at least a plurality of processing units.
[0193] The configurable hardware module may include a substantially static portion and a substantially dynamic portion, said determining step including determining routing information for said substantially dynamic portion.
[0194] Determining routing information for the substantially dynamic portion may include determining routing for the substantially dynamic portion for use by one or more of the processing units of the substantially static portion.
[0195] Determining may include analyzing a bitfile description of at least a portion of the configurable hardware module to determine the routing information.
[0196] According to another aspect, a non-transitory computer-readable medium is provided, the medium including program instructions for determining routing information for at least a portion of a configurable hardware module comprising a plurality of processing units, each processing unit being associated with a predetermined type of operation executable in a single step, at least some of the plurality of processing units being associated with different predetermined types of operations, the routing information providing information regarding available routes between at least a plurality of processing units.
[0197] A computer program may also be provided comprising program code means adapted to perform the method(s). The computer program may be stored and / or otherwise embodied by a carrier medium.
[0198] A number of different embodiments have been described above, it being understood that further embodiments may be provided by combining any two or more of the above-described embodiments.
[0199] Various other aspects and further embodiments are also described in the following detailed description and appended claims.
[0200] BRIEF DESCRIPTION OF THE DRAWINGS Some embodiments will now be described, by way of example only, with reference to the accompanying drawings, in which: [Brief description of the drawings]
[0201] [Figure 1] 1 is a schematic diagram of a data processing system coupled to a network; [Diagram 2] 1 is a schematic diagram of a data processing system with a filtering operation application configured to operate in a user mode on a host computing device. [Diagram 3] FIG. 1 is a schematic diagram of a data processing system with filtering operations configured to operate in kernel mode on a host computing device. [Figure 4] 1 is a schematic diagram of a network interface device with multiple CPUs for performing functions on data packets. [Diagram 5] 1 is a schematic diagram of a network interface device comprising a field programmable gate array that runs applications to perform functions on data packets. [Figure 6] FIG. 1 is a schematic diagram of a network interface device comprising hardware modules for performing functions on data packets. [Figure 7] 1 is a schematic diagram of a network interface device comprising a field programmable gate array and at least one processing unit for performing functions on data packets. [Figure 8] FIG. 1 illustrates a method implemented in a network interface device according to some embodiments. [Figure 9] FIG. 1 illustrates a method implemented in a network interface device according to some embodiments. [Figure 10] FIG. 1 illustrates an embodiment of processing a data packet by a series of programs. [Figure 11] FIG. 2 illustrates an embodiment of processing a data packet by multiple processing units. [Figure 12] FIG. 2 illustrates an embodiment of processing a data packet by multiple processing units. [Figure 13] FIG. 2 illustrates an example pipeline of processing stages for processing a data packet. [Figure 14] A diagram illustrating an example of a slice architecture having multiple pluggable components. [Figure 15] FIG. 2 illustrates an exemplary representation of the organization and order of processing of multiple processing units. [Figure 16] FIG. 2 illustrates an exemplary method for compiling a function. [Figure 17] FIG. 2 illustrates an example of a stateful processing unit. [Figure 18] FIG. 2 illustrates an example of a stateless processing unit. [Figure 19] FIG. 1 illustrates a method of some embodiments. [Figure 20a] FIG. 1 illustrates routing between slices in an FPGA. [Figure 20b] FIG. 1 illustrates routing between slices in an FPGA. [Figure 21] FIG. 1 is a diagram illustrating a schematic of partitions on an FPGA. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0202] Detailed Description The following description is presented to enable any person skilled in the art to make and use the invention, and is provided in the context of a particular application. Various modifications to the disclosed embodiments will be readily apparent to those skilled in the art.
[0203] The generic principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the invention, Thus, the present invention is not intended to be limited to the embodiments shown but is to be accorded the widest scope consistent with the principles and features disclosed herein.
[0204] When data is transferred between two data processing systems over a data channel, such as a network, each of the data processing systems has an appropriate network interface that allows them to communicate over the channel. Often the network is based on Ethernet technology. Data processing systems that communicate over a network are equipped with a network interface that can support the physical and logical requirements of the network protocol. The physical hardware component of a network interface is called a network interface device or network interface card (NIC).
[0205] Most computer systems include an operating system (OS) through which user-level applications communicate with the network. A part of the operating system known as the kernel contains a protocol stack for translating commands and data between applications and device drivers specific to the network interface device. The device drivers can directly control the network interface device. By providing these functions to the operating system kernel, the complexities and differences of the network interface devices can be hidden from user-level applications. Network hardware and other system resources (such as memory) can be safely shared by many applications, and the system can be protected from faulty or malicious applications.
[0206] An exemplary data processing system 100 for performing transmissions over a network is shown in FIG. 1. Data processing system 100 comprises a host computing device 101 coupled to a network interface device 102 configured to interface the host to a network 103. Host computing device 101 includes an operating system 104 that supports one or more user-level applications 105. Host computing device 101 may also include a network protocol stack (not shown). For example, the protocol stack may be a component of an application, a library to which an application is linked, or may be provided by the operating system. In some embodiments, more than one protocol stack may be provided.
[0207] The network protocol stack may be a Transmission Control Protocol (TCP) stack. An application 105 may send or receive TCP / IP messages by opening a socket and reading or writing data to the socket, and the operating system 104 causes the messages to be forwarded across the network. For example, an application may invoke a system call to send data through the socket and then through the operating system 104 to the network 103. This interface for sending messages may be known as a message passing interface.
[0208] Instead of implementing the stack on the host 101, some systems offload the protocol stack to the network interface device 102. For example, if the stack is a TCP stack, the network interface device 102 may include a TCP offload engine (TOE) for performing TCP protocol processing. By performing the protocol processing in the network interface device 102 rather than the host computing device 101, the demands on the processor(s) of the host system 101 may be reduced. Data sent over the network may be sent by the application 105 through a TOE-enabled virtual interface driver, by partially or completely bypassing the kernel TCP / IP stack. Thus, data sent along this high-speed path only needs to be formatted to meet the requirements of the TOE driver.
[0209] The host computing device 101 may include one or more processors and one or more memories. In some embodiments, the host computing device 101 and the network interface device 102 may communicate via a bus, such as a Peripheral Component Interconnect Express (PCIe bus).
[0210] During operation of the data processing system, data to be transmitted over a network may be transferred from the host computing device 101 to the network interface device 102 for transmission. In one example, data packets may be transferred directly from the host to the network interface device by the host processor. The host may provide the data to one or more buffers 106 located on the network interface device 102. The network interface device 102 may then prepare the data packets and transmit them over the network 103.
[0211] Alternatively, the data may be written to a buffer 107 within the host system 101. The data may then be retrieved from the buffer 107 by a network interface device and transmitted over the network 103.
[0212] In both of these cases, the data is stored in one or more are temporarily stored in multiple buffers. Data sent over the network can be returned to the host (in a lookback).
[0213] When data packets are transmitted and received over the network 103, there are many processing tasks that can be expressed as operations on the data packets, either on the data packets being sent over the network or on the data packets being received over the network. For example, a filtering process can be performed on the received data packets to protect the host system 101 from distributed denial of service (DDOS) filtering. Such a filtering process can be performed by simple pack inspection or extended Berkley packet filter (eBPF). As another example, encapsulation and forwarding can be performed on the data packets being sent over the network 103. These processes can consume many CPU cycles and be a burden on traditional OS architectures.
[0214] Reference is made to FIG. 2, which illustrates one way in which filtering operations or other packet processing operations may be implemented in the host system 220. The processes performed by the host system 220 are shown as executing in either user space or kernel space. A receive path exists in kernel space for delivering data packets received from the network at the network interface device 210 to an end application 250. This receive path comprises a driver 235, a protocol stack 240, and a socket 245. The filtering operation 230 is implemented in user space. Incoming packets provided by the network interface device 210 to the host system 220 bypass the kernel (where protocol processing takes place) and are provided directly to the filtering operation 230.
[0215] The filtering operation 230 is provided with a virtual interface (which may be an Ether Fabric Virtual Interface (EFVI) or Data Plane Development Kit (DPDK) or any other suitable interface) for exchanging data packets with other elements in the host system 220. The filtering operation 230 may perform DDOS scrubbing and / or other forms of filtering. The DDOS scrubbing process may be performed on all packets that are easily recognized as DDOS candidates, e.g., sample packets, copies of packets, and packets that have not yet been classified. Packets that are not delivered to the filtering operation 230 may be passed directly from the network interface to the driver 235. The operation 230 may provide an extended Berkeley packet filter (eBPF) for performing the filtering. If the received packet passes the filtering provided by the operation 230, the operation 230 is configured to reinject the packet into the receive path in the kernel for processing the received packet. Specifically, the packet is provided to the driver 235 or stack 240. The packet is then protocol processed by the protocol stack 240. The packet is then passed to a socket 245 associated with the end application 250. The end application 250 issues a recv() call to retrieve data packets from the associated socket's buffer.
[0216] However, there are several problems with this approach. First, the filtering operation 230 runs on the host CPU. In order for the filtering 230 to work, the host CPU must process data packets at the rate they are received from the network. If the rate at which data is sent and received from the network is high, this can constitute a large drain on the processing resources of the host CPU. A high data flow rate to the filtering operation 230 can result in a large consumption of other limited resources, such as I / O bandwidth and internal memory / cache bandwidth.
[0217] To perform the re-injection of data packets into the kernel, the filtering operation 230 needs to be provided with a privileged API to perform the re-injection. The re-injection process can be cumbersome and require careful packet ordering. To perform the re-injection, the operation 230 may often require a dedicated CPU core.
[0218] The steps of providing and re-injecting data into an operation require copying the data into and out of memory, which is a resource burden on the system.
[0219] Similar problems can arise when providing other types of actions other than filtering on data transmitted and received over a network.
[0220] Some operations (such as DPDK type operations) may require forwarding the processed packets back onto the network.
[0221] Refer to FIG. 3, which illustrates another approach. Like elements are referenced by like reference numerals. In this example, an additional layer known as Express Data Path (XDP) 310 is inserted into the transmit and receive paths in the kernel. Extensions to XDP 310 allow for insertion into the transmit path. XDP helpers allow packets to be transmitted (as a result of a receive operation). XDP 310 is inserted at the driver level of the operating system, allowing programs to run at this level to perform operations on data packets received from the network before they are protocol processed by stack 240. XDP 310 also allows programs to run at this level to perform operations on data packets transmitted over the network. Thus, eBPF programs and other programs can run in the transmit and receive paths.
[0222] 3, filtering operations 320 may be inserted into XDP from user space to form programs 330 that are part of XDP 310. Operations 320 are inserted using the XDP control plane to run on the data receive path to provide programs 330 that perform filtering operations (e.g., DDOS scrubbing) on packets on the receive path. Such programs 330 may be eBPF programs.
[0223] Program 330 is shown inserted in the kernel between driver 235 and protocol stack 240. However, in other examples, program 330 may be inserted at other points in the receive path within the kernel. Program 330 may be part of a separate control path that receives data packets. Program 330 may be provided by an application by providing an extension to the application programming interface (API) of socket 245 for that application.
[0224] This program 330 may additionally or alternatively perform one or more operations on the data being transmitted over the transmission path. XDP 310 then invokes the transmit function of driver 235 to transmit the data over the network via network interface device 210. Program 330 in this case may provide load balancing or routing operations on the data packets to be transmitted over the network. Program 330 may provide segment re-encapsulation and forwarding operations on the data packets to be transmitted over the network.
[0225] The program 330 may be used for firewalls, virtual switching, or other operations that do not require protocol termination or application processing.
[0226] One advantage of using XDP 310 in this manner is that programs 330 can directly access memory buffers handled by the driver without intermediate copies.
[0227] In order to insert a program 330 into the kernel for such operation, it is necessary to ensure that the program 330 is safe. If an unsafe program is inserted into the kernel, this poses certain risks such as infinite loops that can crash the kernel, buffer overflows, uninitialized variables, compiler errors, performance issues caused by large programs, etc.
[0228] To ensure that the program 330 is safe before being inserted into the XDP 310 in this manner, a verifier may run on the host system 220 to verify the safety of the program 330. The verifier may be configured to ensure that there are no loops. Jump-back operations may be permitted as long as they do not cause a loop. The verifier may be configured to ensure that the program 330 has no more than a predetermined number of instructions (e.g., 4000). The verifier may perform a check of the validity of register usage by traversing the data path of the program 330. If there are too many possible paths, the program 330 is rejected as being unsafe to run in kernel mode. For example, the program 330 may be rejected if there are more than 1000 branches.
[0229] One skilled in the art will appreciate that XDP is one example in which a secure program 330 may be installed in the kernel, and that there are other ways in which this may be accomplished.
[0230] The approach described above with respect to FIG. 3 can be as efficient as the approach described above with respect to FIG. 2, for example, if the operations can be expressed in a safe (or sandboxed) language required to execute code in the kernel. The eBPF language can run efficiently on x86 processors, and JIT (just-in-time) compilation techniques allow eBPF programs to be compiled into native machine code. The language is designed to be safe, e.g., state is restricted to only map structures that are shared data structures (such as hash tables). Allowed loops are limited, and instead, one eBPF program can tail call another eBPF program. The state space is constrained.
[0231] However, in some implementations, this approach can have a significant cost on the resources of the host system 220 (e.g., I / O bandwidth and internal memory / cache bandwidth, host CPU): operations on the data packets are still performed by the host CPU, which must perform such operations at the rate at which data is being sent / received.
[0232] Another proposal is to perform the above operations on the network interface device rather than on the host system. Doing so may free up CPU cycles used by the host CPU when performing the operations, in addition to the I / O bandwidth, memory and cache bandwidth consumed. Shifting the execution of processing operations from the host to the hardware of the network interface device may present several challenges.
[0233] One proposal for implementing the processing in network hardware is packet processing. and / or providing a network processing unit (NPU) in the network interface device with multiple CPUs dedicated to operational operations.
[0234] See FIG. 4, which illustrates an example of a network interface device 400 that includes an array 410 of central processing units (CPUs), such as CPU 420. The CPUs are configured to perform functions such as filtering data packets transmitted to and received from a network. Each CPU in the array of CPUs 410 may be an NPU. Although not shown in FIG. 4, the CPUs may additionally or alternatively be configured to perform operations such as load balancing on data packets received from a host for transmission over the network. These CPUs are specialized for such packet processing / manipulation operations. The CPUs execute instruction sets optimized for such packet processing / manipulation operations.
[0235] The network interface device 400 further comprises memory (not shown) shared among and accessible to the array of CPUs 410 .
[0236] The network interface device 400 includes a network medium access control (MAC) layer 430 for interfacing the network interface device 400 with a network. The MAC layer 430 is configured to receive data packets over the network and to transmit data packets over the network.
[0237] Operations on packets received at the network interface device 400 are parallelized across the CPUs. As shown, when a data flow is received at the MAC layer 430, it is passed to a diffusion function 440, which is configured to extract data packets from the flow and distribute the data packets across multiple CPUs in the NPU 410 for the CPUs to perform processing, e.g., filtering, of these data packets. The diffusion function 440 can analyze the received data packets to identify the data flow to which they belong. The diffusion function 440 generates, for each packet, an indication of the position of the respective packet in the data flow to which the packet belongs. The indication may be, for example, a tag. The diffusion function 440 adds the respective indication to the associated metadata of each packet. The associated metadata of each data packet can be attached to the data packet. The associated metadata can be passed to the diffusion function 440 as sideband control information. The indication is added according to the flow to which the data packet belongs, such that the order of the data packets of any particular flow can be reconstructed.
[0238] After being programmed by the multiple CPUs 410, the data packets are then passed to a reordering function 450, which reorders the packets of the data flow into the correct order before passing them to the host interface layer 460. The reordering function 450 can reorder the data packets in a flow by comparing instructions (e.g., tags) in the data packets of the flow to reconstruct the order of the data packets. The reordered data packets then traverse the host interface 460 and are delivered to the host system 220.
[0239] Although FIG. 4 shows the array of CPUs 410 operating only on data packets received from the network, similar principles (including spreading and reordering) can be performed on data packets received from the host for transmission over the network, with the array of CPUs 410 performing functions (e.g., load balancing) on these data packets received from the host.
[0240] The program executed by the CPU is the host CP in the example described above with respect to FIG. The instruction set may be a compiled or transcoded version of a program that runs on the U. In other words, the instruction set that runs on the host CPU to perform an operation is translated for execution on each of the CPU arrays of dedicated CPUs in network interface 400.
[0241] To achieve parallelism across CPUs, multiple instances of a program are compiled and run in parallel on multiple CPUs. Each instance of the program may be responsible for processing a different set of data packets received at the network interface device. However, each individual data packet is processed by a single CPU when providing the program's functionality for that data packet. The overall effect of running parallel programs may be the same as running a single program (e.g., program 330) on the host CPU.
[0242] One of the dedicated CPUs can process data packets at around 50 million packets per second. This operating speed may be slower than the operating speed of the host CPU. Thus, parallelization can be used to achieve the same performance as would be achieved by running an equivalent program on the host CPU. To achieve parallelization, the data packets are spread across the CPUs and then reordered after processing by the CPU. The requirement to process data packets of each flow in order together with the reordering step 450 can introduce a bottleneck and increase memory resource overhead, limiting the available throughput of the device. This requirement and the reordering step 450 can increase jitter in the device, as the processing throughput can vary depending on the content of the network traffic and the degree to which parallelism can be applied.
[0243] One advantage of using such a dedicated CPU may be short compilation times: for example, it may be possible to compile a filtering application to run in less than one second on such a CPU.
[0244] If this approach is scaled to higher link speeds, there may be problems with using an array of CPUs. Host network interfaces may be required to reach terabit / second speeds in the near future. Scaling up such an array of CPUs 410 to these higher speeds may be problematic in terms of the amount of power required.
[0245] Another proposal is to include a field programmable gate array (FPGA) in the network interface device and use the FPGA to perform operations on data packets received from the network.
[0246] 5, which illustrates an example of the use in a network interface device 500 of an FPGA 510 having an FPGA application 515 for performing operations on data packets received at the network interface device 500. Elements similar to those in FIG. 4 are referred to by similar reference numerals.
[0247] Although FIG. 5 shows FPGA applications 515 operating only on data packets received from the network, such FPGA applications 515 may also be used to perform functions (e.g., load balancing and / or firewall functions) on those data packets received from the host for transmission over the network or back to the host or another network interface on the system.
[0248] FPGA application 515 is written in C, C++ or scala. A program written in such a system-level language can be provided by compiling it to run on the FPGA 510.
[0249] The FPGA 510 may have a network interface function and an FPGA function. The FPGA function may provide an FPGA application 515 that may be programmed into the FPGA 510 as needed by a user of the network interface device. The FPGA application 515 may provide, for example, filtering of messages on the receive path from the network 230 to the host. The FPGA application 515 may provide a firewall.
[0250] The FPGA 510 may be programmable to provide an FPGA application 515. Part of the network interface device functionality may be implemented in the FPGA The FPGA application 515 may be implemented as "hard" logic in the FPGA application 510. For example, hard logic may be gates in an application specific integrated circuit (ASIC). The FPGA application 515 may be implemented as "soft" logic. Soft logic may be provided by programming FPGA LUTs (Look Up Tables). Hard logic may be capable of being clocked at a higher rate compared to soft logic.
[0251] The network interface device 500 includes a host interface 505 configured to transmit and receive data to and from a host. The network interface device 520 includes a network media access control (MAC) interface 520 configured to transmit and receive data to and from a network.
[0252] When a data packet is received from the network at the MAC interface 520, the data packet is passed to the FPGA application 515, which is configured to perform functions on the data packet, such as filtering. The data packet (if it passes any filtering) is then passed to the host interface 505, and from there to the host. Alternatively, the data packet FPGA application 515 can decide to drop or retransmit the data packet.
[0253] One problem with this approach of using FPGAs to perform functions on data packets is the relatively long compile times required. FPGAs consist of many logic elements (e.g., logic cells) that individually represent primitive logic operations such as AND, OR, NOT, etc. These logic elements are arranged in a matrix with programmable interconnects. To provide a function, these logic cells may need to work together to enforce circuit definitions and synchronous clock timing constraints. Placing each logic cell and routing between cells can be an algorithmically challenging challenge. When compiling on a lower utilization FPGA, the compile time may be less than 10 minutes. However, as FPGA devices become more utilized by various applications, the place-and-route challenge may increase such that the time to compile a given function onto an FPGA increases. Thus, adding additional logic to an FPGA that has already consumed most of its routing resources may require several hours of compile time.
[0254] One approach is to design the hardware using specific processing primitives, such as parsing primitives, matching primitives, and action primitives. These can be used to build a processing pipeline in which every packet undergoes each of the three processes. First, the packet is parsed to find the metadata table in the protocol header. Second, the packet is flexibly matched against the rules held in the table. Finally, when a match is found, the packet is acted upon according to the entry from the table that was selected in the matching operation.
[0255] The P4 programming language (or a similar language) can be used to implement the functions using the analysis / matching / action model. The P4 programming language is target independent, which means that programs written in P4 can be compiled and run on different types of hardware such as CPUs, FPGAs, ASICs, NPUs, etc. Each different type of target is provided with its own compiler that maps the P4 source code to the appropriate target switch model.
[0256] P4 can be used to provide a programming model that allows high-level programs to express packet processing operations of a packet processing pipeline. This approach works well for operations that naturally express themselves in a declarative style. In the P4 language, programmers express parsing, matching, and action stages as operations to be performed on received data packets. These operations are packaged on dedicated hardware for efficient execution. However, this declarative style may not be appropriate for expressing programs that are imperative in nature, such as eBPF programs.
[0257] In a network interface device, a sequence of eBPF programs may need to be executed serially. In this case, a chain of eBPF programs that call each other is generated. Each program can modify state, and the output is as if the entire chain of programs had been executed serially. It may be difficult for a compiler to collect all the analysis, matching, and action steps. However, even if a chain of eBPF programs is already installed, the chain may need to be installed, removed, or modified, which may present additional challenges.
[0258] To provide an example of such a program requiring repeated execution, refer to FIG. 10, which shows an example of a sequence of programs e1, e2, e3 configured to process a data packet. Each program may be, for example, an eBPF program. Each program is configured to analyze an incoming data packet, perform a lookup in table 1010 to determine an action in a matching entry in table 1010, and then perform an action on the data packet. The action may include modifying the packet. Each eBPF program may also perform an action depending on the local state and the shared state. The data packet P0 is first processed by eBPF program e1 before being passed to the next program e2 in the pipeline and modified. The output of the sequence of programs is the output of the final program in the pipeline, namely e3.
[0259] Combining the effects of each of n such programs into a single P4 program can be complex for a compiler. Furthermore, certain programming models (such as XDP) may require dynamically inserting and removing programs at any point in the sequence of programs, quickly in response to changing conditions.
[0260] According to some embodiments of the present application, there is provided a network interface device comprising a plurality of processing units. Each processing unit is configured to execute at least one predefined operation in hardware. Each processing unit comprises a memory for storing its own local state. Each processing unit comprises a digital circuit for modifying this state. The digital circuit may be an application specific integrated circuit. Each processing unit comprises: Each processing unit is configured to execute a program including configurable parameters to perform a respective one of a plurality of operations. Each processing unit may be an atom. An atom is defined by a specific programming and routing of predefined templates, which defines its specific operational behavior and logical location in the flow provided by the connected processing units. When the term "atom" is used herein, it may be understood to refer to a data processing unit configured to perform its operation in a single step. That is, an atom executes its operation as an atomic operation.
[0261] An atom can be viewed as a collection of hardware structures that can be configured to repeatedly perform one of a set of computations that take one or more inputs and produce one or more outputs.
[0262] Atoms may be provided by hardware. Atoms may be configured by a compiler. Atoms may be configured to perform a computation.
[0263] During compilation, at least some of the plurality of processing units are configured to perform operations such that a function is performed on data packets received at the network interface device by at least some of the plurality of processing units. Each of at least some of the plurality of processing units is configured to perform a respective at least one predetermined operation to perform a function on the data packets. In other words, the operations that the connected processing units are configured to perform are performed on the received data packets. The operations are performed sequentially by at least some of the plurality of processing units. Collectively, the execution of each of the plurality of operations provides a function, e.g., filtering, on the received packets.
[0264] By arranging each atom to perform at least one respective predetermined operation to perform a function, compilation times may be reduced as compared to the example FPGA application described above with respect to Figure 5. Additionally, by performing the function using a processing unit that is specifically dedicated to performing a particular operation in hardware, the speed at which the function may be performed may be improved as compared to performing the function for each data packet using a CPU running software in a network interface device as described above with respect to Figure 4.
[0265] Please refer to Fig. 6, which illustrates an example of a network interface device 600 according to an embodiment of the present application. The network interface device comprises a hardware module 610 configured to perform processing of data packets received at an interface of the network interface device 600. Although Fig. 6 illustrates the hardware module 610 performing functions (e.g., filtering) for data packets on a receive path, the hardware module 610 may also be used to perform functions (e.g., load balancing or firewall) for data packets on a transmit path received from a host.
[0266] The network interface device 600 includes a host interface 620 for transmitting and receiving data packets to and from a host, and a network MAC interface 630 for transmitting and receiving data packets to and from a network.
[0267] The network interface device 600 comprises a hardware module 610 that comprises a number of processing units 640a, 640b, 640c, 640d. Each processing unit may be an atom processing unit. The term atom is used herein to refer to a processing unit. Each processing unit may be implemented in hardware as at least Each of the processing units is configured to perform at least one operation. Each of the processing units comprises a digital circuit 645 configured to perform at least one operation. The digital circuit 645 may be an application specific integrated circuit. Each of the processing units further comprises a memory 650 that stores state information. The digital circuit 645 updates the state information as it performs each of the plurality of operations. In addition to the local memory, each processing unit can have access to a shared memory 660 that can also store state information accessible to each of the plurality of processing units.
[0268] The state information in the shared memory 660 and / or the state information in the processing unit's memory 650 may include at least one of metadata passed between the processing units, temporary variables, contents of data packets, and contents of one or more shared maps.
[0269] The multiple processing units together can provide a function that is performed on data packets received at the network interface device 600. The compiler outputs instructions for configuring the hardware module 610 to perform a function on incoming data packets by configuring at least some of the multiple processing units to perform their respective at least one predetermined operation on each incoming data packet. This can be accomplished by concatenating (i.e., connecting) at least some of the processing units 640a, 640b, 640c, 640d together, such that each of the connected processing units performs its respective at least one operation on each incoming data packet. Each processing unit performs its respective at least one operation in a particular order to perform the function. The order may be such that two or more processing units also perform in parallel, i.e., simultaneously, with each other. For example, one processing unit can read from a data packet during a period (defined by a periodic signal (e.g., a clock signal) of the hardware module 610) during which a second processing unit also reads from a different location within the same data packet.
[0270] In some embodiments, the data packet passes through each stage represented by a processing unit in sequence, with each processing unit completing its processing before passing the data packet to the next processing unit for execution of its processing.
[0271] In the example shown in FIG. 6, the processing units 640a, 640b, and 640d are connected to each other at compile time so that each of them performs at least one respective operation to perform a function, e.g., filtering, on a received data packet. The processing units 640a, 640b, 640d form a pipeline for processing data packets. The data packet can move along this pipeline in multiple stages, each having an equal period. The period can be defined according to a periodic signal or beat. The period can be defined by a clock signal. Several periods of the clock can define one period of each stage of the pipeline. The data packet moves along one stage in the pipeline at the end of each occurrence of a repeating period. The period can be a fixed interval. Alternatively, each period of a stage in the pipeline can take a variable amount of time. A signal indicating the next stage of the pipeline can be generated when the previous processing stage has finished its operation, which can take a variable amount of time. A stall can be introduced at any stage of the pipeline by delaying a signal for some predetermined amount of time.
[0272] Each of the processing units 640a, 640b, 640d may be configured to access the shared memory 660 as part of at least one of their respective operations. Each of the processing units 640a, 640b, 640d may be configured to pass metadata to one another as part of at least one of their respective operations. Each of 640a, 640b, 640d may be configured to access data packets received from the network as part of at least one of their respective operations.
[0273] In this example, processing unit 640c is not used to perform processing of received data packets to provide functionality and is omitted from the pipeline.
[0274] Data packets received at the network MAC layer 630 may be passed to hardware module 610 for processing. Although not shown in Figure 6, the processing performed by hardware module 610 may be part of a larger processing pipeline that provides additional functions on the data packets beyond the functions provided by hardware module 610. This is shown with respect to Figure 14 and described in more detail below.
[0275] The first processing unit 640a is configured to perform a first at least one operation on the data packet. The first at least one operation may include at least one of reading from the data packet, reading and writing to a shared state in the memory 660, and / or performing a lookup in a table to determine an action. The first processing unit 640a is then configured to generate a result from the at least one operation. The result may be in the form of metadata. The result may include a modification to the data packet. The result may include a modification to the shared state in the memory 660. The second processing unit 640b is configured to perform at least one operation on the first data packet depending on a result of the operation performed by the first processing unit 640a. The second processing unit 640b generates a result from the at least one operation and passes the result to a third processing unit 640d configured to perform the at least one operation on the first data packet. The first processing unit 640a, the second processing unit 640b, and the third processing unit 640d are together configured to provide a function on the data packet. The data packets may then be passed to the host interface 620, where they are passed to the host system.
[0276] It can thus be seen that the connected processing units form a pipeline for processing data packets received at the network interface device. The pipeline can provide for processing of an eBPF program. The pipeline can provide for processing of multiple eBPF programs. The pipeline can provide for processing of multiple modules executed in sequence.
[0277] The interconnection of processing units within a hardware module 610 may be performed by programming the routing functions of a pre-synthesized interconnect fabric of the hardware module 610. This interconnect fabric provides connections between the various processing units of the hardware module 610. The interconnect fabric is programmed according to the topology supported by the fabric. Possible exemplary topologies are described below with reference to FIG. 15.
[0278] The hardware module 610 supports at least one bus interface. The at least one bus interface receives data packets at the hardware module 610 (e.g., from a host or a network). The at least one bus interface outputs data packets from the hardware module 610 (e.g., to a host or a network). The at least one bus interface receives control messages at the hardware module 610. The control messages may be for configuring the hardware module 610.
[0279] The example shown in Figure 6 has the advantage of reduced compilation time compared to the FPGA application 515 shown in Figure 5. The hardware module 610 of Figure 6 may require less than 10 seconds to compile a filtering function, for example. The example shown in Figure 6 has the advantage of increased processing speed compared to the array of CPUs example shown in Figure 4.
[0280] An application can be compiled for execution on such a hardware module 610 by mapping a generic program (or multiple programs) to a pre-synthesized data path. The compiler builds the data path by linking any number of processing stage instances, each instance built from one of the pre-synthesized processing stage atoms.
[0281] Each atom is constructed from a circuit. Each circuit can be defined using RTL (Register Transfer Language) or a high-level language. Each circuit is synthesized using a compiler or tool chain. Atoms may be synthesized into hard logic and therefore may be available as hard (ASIC) resources in a hardware module of the network interface device. Atoms may be synthesized into soft logic. Atoms in the soft logic may be provided with constraints that assign and maintain location and route information for the synthesized logic on the physical device. Atoms may be designed with configurable parameters that specify the behavior of the atom. Each parameter may be a variable, or even a sequence of operations (microprogram), that may specify at least one operation to be performed by a processing unit during a clock cycle of the processing pipeline. The logic implementing the atom may be clocked synchronously or asynchronously.
[0282] The Atom's processing pipeline itself may be configured to operate according to a periodic signal, in which case each data packet and metadata moves one stage along the pipeline in response to each occurrence of the signal. The processing pipeline may operate asynchronously, in which case a higher level of backpressure in the pipeline causes each downstream stage to begin processing only when data from an upstream stage is presented to it.
[0283] When compiling a function performed by multiple such atoms, a sequence of computer code instructions is separated into multiple operations, with each operation being mapped to a single atom. Each operation may represent a single line of disassembled instructions in the computer code instruction. Each operation is assigned to one of the atoms to be performed by one of the atoms. There may be one atom per representation in the computer code instruction. Each atom is associated with one type of operation and is selected to perform at least one operation in the computer code instruction based on its associated type of operation. For example, an atom may be preconfigured to perform a load operation from a data packet. Thus, such an atom is assigned to perform an instruction representing a load operation from a data packet in the computer code.
[0284] Within a computer code instruction, one atom may be selected per line, so that when implementing a function within a hardware module that contains such atoms, there may be 100 such atoms, each performing a respective operation to perform the function on that data packet.
[0285] Each atom can be constructed according to one of a set of processing stage templates that determine the type of its associated operation(s). The compilation process is configured to generate instructions for controlling each atom to perform at least one specific operation based on the type of atom associated with it. For example, if an atom is pre-configured to perform a packet access operation, the compilation process may assign to that atom an operation to load specific information from the packet's header (e.g., the packet's source ID). The compilation process is configured to send the instructions to a hardware module, and the atom is configured to perform the operation assigned to the atom by the compilation process.
[0286] The processing stage templates that specify the behavior of atoms are logic stage templates (e.g., providing registers, scratchpad memory, and stacks, and operations for branching), packet access state templates (e.g., providing packet data loads and / or packet data stores), and map access stage templates (e.g., map lookup algorithms, map table sizes).
[0287] The packet access stage may include at least one of reading a byte sequence from the data packet, replacing one byte sequence in the data packet with a different byte sequence, inserting bytes into the data packet, and deleting bytes in the data packet.
[0288] The map access stage can be used to access different types of maps (e.g., lookup tables), including direct index arrays and associative arrays. The map access stage can include at least one of reading a value from a location, writing a value to a location, and replacing a value at a location in the map with a different value. The map access stage can include a comparison operation in which a value is read from a location in the map and compared to the different value. If the value read from the location is less than the different value, a first action (e.g., do nothing, exchange the value at the location with the different value, or add the values together) can be performed. Otherwise, a second action (e.g., do nothing, exchange or add the values) can be performed. In either case, the value read from the location can be provided to a next processing stage.
[0289] Each map access stage may be implemented in a stateful processing unit. See FIG. 17, which illustrates an example of a circuit 1700 that may be included in an atom configured to perform processing of a map access stage. The circuit 1700 may include a hash function 1710 configured to perform a hash of an input value used as an input to a lookup table. The circuit 1700 includes a memory 1720 configured to store a state associated with the operation of the atom. The circuit 1700 includes an arithmetic logic unit 1730 configured to perform operations.
[0290] A logic stage may perform a calculation on values provided by a preceding stage. The processing units configured to implement a logic stage may be stateless processing units. Each stateless processing unit may perform simple arithmetic. Each processing unit may perform, for example, 8-bit arithmetic.
[0291] Each logic stage may be implemented in a stateless processing unit. See FIG. 18, which illustrates an example of a circuit 1800 that may be included in an atom configured to perform the processing of the logic stages. The circuit 1800 comprises an array of arithmetic logic units (ALUs) and multiplexers. The ALUs and multiplexers are arranged in layers, such that the output of one layer of processing by the ALUs is used by the multiplexers to provide an input to the next layer of ALUs.
[0292] A pipeline of stages implemented in a hardware module may include a first packet access stage (pkt0), followed by a first logic stage (logic0), followed by a first map access stage (map0), followed by a second logic stage (logic1), followed by a second packet access stage (pkt1), etc. This may therefore take the following form: pkt0->logic0->map0->logic1->pkt1.
[0293] In some examples, stage pkt0 extracts necessary information from the packet, which it passes to stage logic0. Stage logic0 determines whether the packet is a valid IP packet. In some cases, logic0 forms a map request and sends the map request to map0, which performs the map operation. Stage map0 may perform lookup table updates. Stage logic1 then collects the results from the map operation and determines whether to drop the packet as a result.
[0294] In some cases, the map request is negated to cover the case where a map operation should not be performed on this packet. If no map operation is to be performed, logic0 indicates to logic1 whether the packet should be dropped or not, depending on whether the packet is a valid IP packet or not. In some examples, the lookup table contains 256 entries, each entry being an 8-bit value.
[0295] The example described includes only five stages. However, as mentioned above, many more can be used. Furthermore, the operations do not all have to be performed sequentially; several operations on the same data packet may be performed simultaneously by different processing units.
[0296] The hardware module 610 shown in FIG. 6 depicts a single pipeline of atoms for performing functions on data packets. However, the hardware module 610 may comprise multiple pipelines for processing data packets. Each of the multiple pipelines may perform a different function on the data packets. The hardware module 610 is configurable to interconnect a first set of atoms of the hardware module 610 to form a first data processing pipeline. The hardware module 610 is also configurable to interconnect a second set of atoms of the hardware module 610 to form a second data processing pipeline.
[0297] To compile a function to be implemented in a hardware module with multiple processing units, a series of steps may be performed starting with a sequence of computer code, and a compiler, which may run on a processor on the host device or on the network interface device, may have access to the disassembled sequence of the computer code.
[0298] First, the compiler is configured to divide a sequence of computer code instructions into separate stages. Each stage may include operations according to one of the processing stage templates described above. For example, one stage may provide for reading from a data packet. One stage may provide for updating map data. Another stage may make path dropping decisions. The compiler assigns each of a number of operations represented by the code to one of a number of stages.
[0299] Second, the compiler is configured to assign each of the processing stages determined from the code to be executed by a different processing unit. This means that each of the at least one operation in each of the stages is performed by a different processing stage. The output of the compiler can then be used to cause a processing unit to perform the operations of each stage in a particular order to perform the function.
[0300] The output of the compiler includes generated instructions that are used to cause the processing units of the hardware module to perform the operations associated with each processing stage.
[0301] The output of the compiler may also be used to generate logic within the hardware module that responds to control messages to configure the hardware module 610. Such control messages are described in more detail below with respect to FIG.
[0302] A compilation process for compiling the functionality to execute on the network interface device 600 may be performed in response to determining that the process for providing the functionality is safe to execute in the kernel of the host device. The determination of the safety of the program may be performed by a suitable verifier, as described above with respect to Figure 3. Once the process is determined to be safe for execution in the kernel, the process may be compiled for execution on the network interface device.
[0303] 15, which illustrates a representation of at least some of a plurality of processing units each performing at least one operation to perform a function on a data packet. Such a representation may be generated by a compiler and used to configure a hardware module to perform the function. The representation indicates the order in which the operations may be performed and how some of the processing units perform those operations in parallel.
[0304] Representation 1500 is in the form of a table with rows and columns. Some of the table entries represent atoms configured to perform the respective operations, such as atom 1510a. The row to which a processing unit belongs indicates the timing of the operations performed by that processing unit on a particular data packet. Each row can correspond to a single period represented by one or more cycles of a clock signal. Processing units that belong to the same row perform their operations in parallel.
[0305] Input to a logic stage is provided in row 0, and the computation flow proceeds to subsequent rows. By default, an atom receives the results from processing by an atom in the same column as itself, but in a previous row. For example, atom 1510b receives the results of processing by atom 1510a, and performs its own processing depending on these results.
[0306] When using local routing resources, atoms can also access output from atoms in previous rows whose column numbers differ by no more than 2. For example, atom 1510d can receive the results from the processing performed by atom 1510c.
[0307] When using global routing resources, an atom can also access the output from atoms in the previous two rows and any column. This can be done using global routing resources. For example, atom 1510f can receive the results from the processing performed by atom 1510e.
[0308] These constraints on routing between atoms are given as an example, other constraints may be applied. By applying more restrictive constraints, it may be easier to route information between atoms. By applying less restrictive constraints, it may be easier to schedule. If the number of atoms (for example, packet access or packet filter) is exhausted, or if routing between atoms cannot be performed, compilation of the function into the hardware module will fail.
[0309] The particular constraints are determined by the topology supported by the interconnect fabric supported by the hardware modules. The interconnect fabric is programmed to cause the atoms of the hardware modules to perform their operations in a particular order and provide data to one another within the constraints. Figure 15 shows one particular example of how the interconnect fabric can be so programmed.
[0310] During synthesis of the FPGA application 515 into an FPGA (as shown in FIG. 5), a place-and-route algorithm is used. In this case, however, the solution space is constrained, so the algorithm has a short bounded execution time.
[0311] There is a trade-off between processing speed or efficiency and compilation time. According to an embodiment of the present application, it may be desirable to first compile and execute a program on at least one processing unit (which may be a CPU or an Atom as described above with respect to FIG. 6) to provide a function on a received data packet. The at least one processing unit may then activate and execute the function on the received data packet during a first period of time. During operation of the network interface device, the second at least one processing unit (which may be an FPGA application or template type processing unit as described above with respect to FIG. 6) may be configured to execute the function on the data packet. The function may then be migrated from the first at least one processing unit to the second at least one processing unit such that the second at least one processing unit executes the function on a data packet subsequently received at the network interface device. Thus, a slower compilation time of the second at least one processing unit does not prevent the network interface device from executing the function on the data packet before the function is compiled for the second at least one processing unit, since the first at least one processing unit may be compiled faster and may be used to execute the function on the data packet while the function is being compiled for the second at least one processing unit. Since the second at least one processing unit typically has a faster processing time, migrating to the second at least one processing unit when compiled allows for faster processing of data packets received at the network interface device.
[0312] According to an embodiment of the present application, the compilation process may be configured to operate on at least one processor of the data processing system, and the at least one processor is configured to send instructions to the first at least one processing unit and the second at least one processing unit to perform at least one function on the data packet at appropriate times. The at least one processor may include a host CPU. The at least one processor may include a control processor on the network interface device. The at least one processor may include a combination of one or more processors on the host system and one or more processors on the network interface device.
[0313] Thus, the at least one processor is configured to perform a first compilation process for compiling functions to be executed by a first at least one processing unit of the network interface device. The at least one processor is also configured to perform a first compilation process for compiling functions to be executed by a second at least one processing unit of the network interface device. and performing a second compilation process to compile functions to be executed by the network. Prior to completion of the second compilation process, the at least one processing unit instructs the first at least one processing unit to execute the functions on data packets received from the network. Thereafter, after completion of the second compilation process, the at least one processing unit instructs the second at least one processing unit to begin executing the functions on data packets received from the network.
[0314] By performing these steps, the network interface device can execute the function using the first at least one processing unit (which may have a shorter compilation time but slower and / or less efficient processing) while waiting for the second compilation process to complete. Once the second compilation process is complete, the network interface device can execute the function using the second at least one processing unit (which may have a longer compilation time but faster and / or more efficient processing) in addition to or instead of the first at least one processing unit.
[0315] 7, which illustrates an exemplary network interface device 700 according to an embodiment of the present application. Similar reference elements to those illustrated in the previous figures are indicated with similar reference numerals.
[0316] The network interface device comprises a first at least one processing unit 710. The first at least one processing unit 710 may comprise the hardware module 610 shown in Figure 6, which comprises multiple processing units. The first at least one processing unit 710 may comprise one or more CPUs, as shown in Figure 4.
[0317] The function is compiled to be executed on the first at least one processing unit 710 such that the function is executed by the first at least one processing unit 710 on data packets received from the network during a first time period. The first at least one processing unit 710 is instructed by the first at least one processor to execute the function on data packets received from the network prior to completion of a second compilation process of the second at least one processing unit.
[0318] The network interface device comprises a second at least one processing unit 720. The second at least one processing unit 720 may comprise an FPGA with an FPGA application (as shown in FIG. 5) or may comprise a hardware module 610 shown in FIG. 6 comprising multiple processing units.
[0319] During the first period, a second compilation process is performed to compile functions for execution on the second at least one processing unit, i.e., the network interface device is configured to compile the FPGA application 515 on-the-fly.
[0320] After the first period of time (i.e., after completion of the second compilation process), the second at least one processing unit 720 is configured to begin executing functions on data packets received from the network.
[0321] After the first period of time, the first at least one processing unit 710 may stop performing functions on data packets received from the network. In this embodiment, the first at least one processing unit 710 may partially stop performing functions on data packets. For example, if the first at least one processing unit includes multiple CPUs, after the first period of time, one or more CPUs may stop performing processing on data packets received from the network, while remaining CPUs of the multiple CPUs continue to perform processing.
[0322] The first at least one processing unit 710 may be configured to perform functions on data packets of the first data flow. Once the second compilation process is complete, the second at least one processing unit 720 may start performing functions on data packets of the first data flow. Once the second compilation process is complete, the first at least one processing unit may stop performing functions on data packets of the first data flow.
[0323] Different combinations of the first at least one processing unit and the second at least one processing unit are possible. For example, in some embodiments, the first at least one processing unit 710 includes multiple CPUs (as shown in FIG. 4), while the second at least one processing unit 720 includes a hardware module having multiple processing units (as shown in FIG. 6). In some embodiments, the first at least one processing unit 710 includes multiple CPUs (as shown in FIG. 4), while the second at least one processing unit 720 includes an FPGA (as shown in FIG. 5). In some embodiments, the first at least one processing unit 710 includes a hardware module having multiple processing units (as shown in FIG. 6), while the second at least one processing unit 720 includes an FPGA (as shown in FIG. 5).
[0324] 11, which illustrates how a number of connected processing units 640a, 640b, 640d can perform their respective at least one operation on a data packet. Each of the processing units is configured to perform its respective at least one operation on a received data packet.
[0325] At least one operation of each processing unit may represent a logical stage within a function (e.g., a function of an eBPF program). At least one operation of each processing unit may be representable by an instruction executed by the processing unit. The instruction may determine the behavior of an atom.
[0326] FIG. 11 shows how a packet (P0) progresses through the processing stages performed by each processing unit.
[0327] Each processing unit performs operations on the packet in a particular order specified by the compiler. The order may be such that some of the processing units are configured to perform their operations in parallel. The operations may include accessing at least a portion of the packet held in memory. Additionally or alternatively, the operations may include performing a lookup into a lookup table to determine an action to be performed on the packet. Additionally or alternatively, the operations may include modifying the state 1110.
[0328] The processing units exchange metadata M0, M1, M2, M3 with each other. The first processing unit 640a is configured to perform at least one respective predetermined operation and generate metadata M1 accordingly. The first processing unit 640a is configured to pass the metadata M1 to the second processing unit 640b.
[0329] At least some of the processing units perform their respective at least one operation depending on at least one of the contents of the data packet, their own stored state, a global shared state, and metadata associated with the data packet (e.g., M0, M1, M2, M3). Some of the processing units may be stateless.
[0330] Each of the processing units is capable of performing its associated type of operation for a data packet (P0) during at least one clock cycle. In some embodiments, each of the processing units is capable of performing its associated type of operation during a single clock cycle. Each of the processing units may be clocked individually to perform their operations. This clocking may be in addition to the clocking of the processing pipeline of the processing unit.
[0331] Looking more closely at the operation of the second processing unit 640b, the second processing unit 640b is configured to be connected to a first processing unit 640a configured to perform a first at least one predefined operation on the first data packet. The second processing unit 640b is configured to receive a result of the first at least one predefined operation from the first further processing unit. The second processing unit 640b is configured to perform a second at least one predefined operation depending on the result of the first at least one predefined operation. The second processing unit 640b is configured to be connected to a third processing unit 640d configured to perform a third at least one predefined operation on the first data packet. The second processing unit 640b is configured to transmit a result of the second at least one predefined operation to the third processing unit 640d for processing in the third at least one predefined operation.
[0332] The processing units may similarly operate in a sequence to provide a function on each of a plurality of data packets.
[0333] An embodiment of the present application is such that multiple packets can be pipelined simultaneously, if functionality allows.
[0334] Please refer to FIG. 12, which illustrates the pipelining of data packets. As illustrated, different packets may be processed simultaneously by different processing units. The first processing unit 640a is performing at least one respective operation at a first time (t0) on the third data packet (P2). The second processing unit 640b is performing at least one respective operation at a first time (t0) on the second data packet (P1). The third processing unit 640d is performing at least one respective operation at a first time (t0) on the first data packet (P0).
[0335] After at least a respective operation has been performed by each processing unit, each packet moves along one stage in the sequence. For example, at a subsequent second time point (t1), the first processing unit 640a performs its respective at least one operation at the first time point (t0) on the fourth data packet (P3). The second processing unit 640b performs its respective at least one operation at the first time point (t0) on the third data packet (P2). The third processing unit 640d performs its respective at least one operation at the first time point (t0) on the first data packet (P1).
[0336] It should be appreciated that in some embodiments there may be multiple packets at a given stage.
[0337] In some embodiments, packets may move from one stage to the next, but not necessarily in lockstep.
[0338] As long as there are no pipeline hazards, such a pipeline running on a fixed clock can have a constant bandwidth, which can reduce jitter in the system.
[0339] To avoid hazards when executing instructions (such as contention when accessing shared state), each processing unit may be configured to execute no-op (i.e., the processing unit stalls) instructions when necessary.
[0340] In some embodiments, operations (such as simple arithmetic, increment, add / subtract constant values, shift, add / subtract values from a data packet or metadata, etc.) require one clock cycle to be executed by a processing unit. This may mean that values of the shared state that one processing unit needs have not yet been updated by another processing unit. Thus, old values of the shared state 1110 may be read by the processing unit that needs them. Thus, hazards may occur when reading and writing values to the shared state. On the other hand, operations on intermediate values may be passed as metadata without hazards occurring.
[0341] An example of a hazard in reading and writing to the shared state 1110 that may be avoided may be given in the context of an increment operation. Such an increment operation may be an operation of incrementing a packet counter in the shared state 1110. In one implementation of an increment operation, during a first time slot of the pipeline, the second processing unit 640b is configured to read the value of the counter from the shared state 1110 and provide an output of this read operation (e.g., as metadata M2) to the third processing unit 640d. The third processing unit 640d is configured to receive the value of the counter from the second processing unit 640b. During a second time slot, the third processing unit 640d increments this value and writes the new incremented value to the shared state 1110.
[0342] A problem may arise when performing such an increment operation: namely, if, during the second time slot, the second processing unit 640b attempts to access the counter stored in the shared state 1110, the second processing unit 640b may read the previous value of the counter before the counter value in the shared state 1110 has been updated by the third processing unit 640d.
[0343] Therefore, to address this issue, the second processing unit 640b may be stalled during the second time slot (through execution by the second processing unit 640b of a no-operation instruction or a pipeline bubble). A stall may be understood as a delay in the execution of the next instruction. This delay may be implemented by execution of a "no-operation" instruction instead of the next instruction. The second processing unit 640b then reads the counter value from the shared state 1110 during the subsequent third time slot. During the third time slot, the counter in the shared state 1110 has been updated, so it is guaranteed that the second processing unit 640b reads the updated value.
[0344] In some embodiments, each atom is configured to read from state, update state, and write the updated state during a single pipeline time slot, which may not involve stalling the processing unit as described above. However, stalling the processing unit may reduce the cost of the required memory interface. It is possible.
[0345] In some embodiments, to avoid hazards, processing units in a pipeline may wait until other processing units in the pipeline have finished their processing before performing their own operations.
[0346] As described above, the compiler constructs a datapath by linking together any number of processing stage instances, each instance constructed from one of a predetermined number (three in the given example) of pre-synthesized processing stage templates: logic stage templates (e.g., providing operations on registers, scratchpad memory, and metadata), packet access state templates (e.g., providing packet data loads and / or packet data stores), and map access stage templates (e.g., map lookup algorithms, map table sizes).
[0347] Each processing stage instance may be implemented by a single processing unit, i.e., each processing stage includes at least one respective operation that is performed by the processing unit.
[0348] FIG. 13 illustrates an example of how processing stages may be connected together in a pipeline 1300 to process a received data packet. As shown in FIG. 13, a first data packet is received and stored in a FIFO 1305. One or more call arguments are received in a first logic stage 1310. The call arguments may include a program selector that identifies a function to be performed on the received data packet. The call arguments may include an indication of a packet length of the received data packet. The first logic stage 1310 is configured to process the call arguments and provide an output to a first packet access stage 1315.
[0349] The first packet access stage 1315 loads data from the first packet at the network tap 1320. The first packet access stage 1315 can also write data to the first packet depending on the output of the first logic stage 1310. The first packet access stage 1315 can write data to the beginning of the first data packet. The first packet access stage 1315 can overwrite data in the data packet.
[0350] The loaded data and any other metadata and / or arguments are then provided to a second logic stage 1325, which performs processing on the first data packet and provides output arguments to a first map access stage 1330. The first map access stage 1330 performs a lookup into a lookup table using the output from the second logic stage 1325 to determine the action to be taken on the first data packet. The output is then passed to a third logic stage 1335, which processes the output and passes the result to a second packet access stage 1340.
[0351] The second packet access stage 1340 may read data from and / or write data to the first data packet depending on the output of the third logic stage 1335. The results of the second packet access stage 1340 are then passed to a fourth logic stage 1345 configured to perform processing on the received input.
[0352] The pipeline may include a number of packet access stages, a logic stage, and a map access stage. The final logic stage 1350 is configured to output a return argument. The return argument may comprise a pointer that identifies the start of the data packet. The return argument may comprise an indication of an action to be performed on the data packet. The indication of the action may indicate whether the packet should be dropped or not. The indication of the action may indicate whether the packet should be forwarded to a host system or not. The network interface device may comprise at least one processing unit configured to drop the respective data packet in response to an indication that the packet should be dropped.
[0353] The pipeline 1300 may further include one or more bypass FIFOs 1355a, 1355b, 1355c. The bypass FIFOs may be used to pass processed data, such as data from the first data packet around the map access stage and / or the packet access stage. In some embodiments, the map access stage and / or the packet access stage do not require data from the first data packet to perform their respective at least one operation. The map access stage and / or the packet access stage may perform their respective at least one operation in response to input arguments.
[0354] Reference is made to FIG. 8, which illustrates a method 800 performed by the network interface devices 600, 700 according to an embodiment of the present application.
[0355] At S810, a functional hardware module of the network interface device is configured to perform a function. The hardware module comprises a plurality of processing units, each configured to perform in hardware a certain operation on a data packet. S810 includes configuring at least some of the plurality of processing units to perform respective predetermined types of operations in a particular order to provide a function on each received data packet. So configuring the hardware module includes connecting at least some of the plurality of processing units such that a received data packet undergoes processing by each of a plurality of operations of at least some of the plurality of processing units. The connection may be achieved by configuring routing hardware of the hardware module to route data packets and associated metadata between the processing units.
[0356] At S820, a first data packet is received from a network at a first interface of the network interface device.
[0357] At S830, the first data packet is processed by each of at least some of the processing units that were connected during the compilation process of S810. Each of the at least some of the processing units performs, on at least one data packet, a type of operation that it is preconfigured to perform. Thus, a function is performed on the first data packet.
[0358] At S840, the processed first data packet is forwarded towards its destination, which may include transmitting the data packet to a host, which may include transmitting the data packet over a network.
[0359] Reference is made to FIG. 9, which illustrates a method 900 that may be performed in a network interface device 700 according to an embodiment of the present application.
[0360] At S910, a first at least one processing unit (i.e., a first circuit) of the network interface device is configured to receive and process data packets received over the network, the processing including performing a function on the data packets. The processing is performed during a first time period.
[0361] At S920, a second compilation process is performed during the first time period to compile functions for execution on a second at least one processing unit (ie, a second circuit).
[0362] In S930, it is determined whether the second compilation process is complete, and if not, the method returns to S910 and S920, the first at least one processing unit continues to perform processing on data packets received from the network, and the second compilation process continues.
[0363] In response to determining that the second compilation is complete at S940, the first at least one processing unit stops performing functions on the received data packets. In some embodiments, the first at least one processing unit may stop performing functions only on certain data flows. The second at least one processing unit may then perform functions on those specific data flows instead (S950).
[0364] At S950, once the second compilation process is completed, the second at least one processing unit is configured to begin executing functions on data packets received from the network.
[0365] Please refer to Fig. 16, which illustrates a method 1600 according to an embodiment of the present application. The method 1600 may be performed in a network interface device or a host device.
[0366] At S1610, a compilation process is performed to compile functions for execution by the first at least one processing unit.
[0367] At S1620, a compilation process is performed to compile the function to be executed by the second at least one processing unit. The process includes assigning each of a plurality of processing units of the second at least one processing unit to perform at least one operation associated with one stage of a plurality of stages for processing data packets to provide the first function. Each of the plurality of processing units is configured to perform a type of processing, and the assignment is made in response to a determination that the processing units are configured to perform a type of processing suitable for performing the respective at least one operation. In other words, the processing units are selected according to their templates.
[0368] At 1630, instructions are transmitted to cause the first at least one processing unit to perform a function prior to completion of the compilation process at S1620. The instructions may be transmitted before the compilation process of S1620 begins.
[0369] At S1640, after the compilation process at S1620 is completed, instructions are sent to the second circuit to cause the second circuit to perform functions on the data packet, which may include the compiled instructions generated at S1620.
[0370] Functionality according to embodiments of the present application may be provided as pluggable components of processing slices within a network interface. See FIG. 14, which illustrates an example of how a slice 1425 may be used in a network interface device 600. A slice 1425 may be referred to as a processing pipeline.
[0371] The network interface device 600 includes a transmit queue 1405 for receiving and storing data packets from the host that are to be processed by the slice 1425 and then transmitted over the network. The network interface device 600 includes a receive queue 1410 for storing data packets received from the network 1410 that are to be processed by the slice 1425 and then delivered to the host. The network interface device 600 includes a receive queue 1415 for storing data packets received from the network that are to be processed by the slice 1425 and then delivered to the host. The network interface device 600 includes a transmit queue for storing data packets received from the host that are to be processed by the slice 1425 and then delivered to the network.
[0372] The slice 1425 of the network interface device 600 comprises a number of processing functions for processing data packets on the receive path and the transmit path. The slice 1425 may comprise a protocol stack configured to perform protocol processing of the data packets on the receive path and the transmit path. In some embodiments, there may be a number of slices in the network interface device 600. At least one of the number of slices may be configured to process receive data packets received from the network. At least one of the number of slices may be configured to process transmit data packets for transmission over the network. The slices may be implemented by hardware processing devices such as at least one FPGA and / or at least one ASIC.
[0373] Accelerator components 1430a, 1430b, 1430c, 1430d can be inserted at different stages within the slice as shown. Each accelerator component provides functionality on data packets traversing the slice. Accelerator components can be inserted or removed on the fly, i.e., during operation of the network interface device. Accelerator components are therefore pluggable components. Accelerator components are logical regions and are assigned to slices 1425. Each of them supports a streaming packet interface that allows packets traversing the slice to be streamed in and out of the component.
[0374] For example, one type of accelerator component may be configured to provide encryption of data packets on an inbound or outbound path, and another type of accelerator component may be configured to provide decryption of data packets on an inbound or outbound path.
[0375] The above-mentioned functionality provided by performing operations performed by multiple connected processing units (as described above with reference to FIG. 6) may be provided by accelerator components. Similarly, functionality provided by an array of network processing CPUs (as described above with reference to FIG. 4) and / or an FPGA application (as described above with reference to FIG. 5) may be provided by accelerator components.
[0376] As described, during operation of the network interface device, the processing performed by the first at least one processing unit (e.g., a plurality of connected processing units) , may be migrated from the second at least one processing unit. To accomplish this migration, components of slice 1425 intended for processing by the first at least one processing unit may be replaced with components intended for processing by the second at least one processing unit.
[0377] The network interface device can include a control processor configured to insert and remove components from the slice 1425. During the first period of time described above, components from the execution of a function by the first at least one processing unit can be present in the slice 1425. The control processor can be configured to remove a pluggable component that provides a function by the first at least one processing unit from the slice 1425 and insert a pluggable component that provides a function by the second at least one processing unit into the slice 1425 after the first period of time.
[0378] In addition to or instead of inserting and removing components from slices, the control processor can load programs into components and issue control plane commands to control the flow of frames to components, in which case components may or may not be operated without being inserted or removed from the pipeline.
[0379] In some embodiments, control plane or configuration information is carried over the datapath without the need for a separate control bus. In some embodiments, requests to update the configuration of datapath components are encoded as messages carried over the same bus as network packets. Thus, the datapath can carry two types of packets: network packets and control packets.
[0380] Control packets are formed by the control processor and injected into the slice 1425 using the same mechanism that is used to transmit or receive data packets using the slice 1425. This same mechanism may be a transmit queue or a receive queue. Control packets may be distinguished from network packets in any suitable manner. In some embodiments, different types of packets may be distinguished by one or more bits in a metadata word.
[0381] In some embodiments, a control packet includes a routing field in the metadata word that determines the path the control packet takes through the slice 1425. The control packet may carry a sequence of control commands. Each control command may be targeted to one or more components of the slice 1425. Each data path component is identified by a component ID field. Each control command encodes a request for each identified component. The request may be to make a change to the configuration of that component. The request may control whether the component is actuated, i.e., whether the component performs its function with respect to data packets traversing the slice.
[0382] Thus, in some embodiments, the control processor of the network interface device 600 is configured to send a message to one of the components of the slice to cause it to start performing a function on a data packet received at the network interface device. This message is a control plane message that is sent through the pluggable component and causes an atomic switchover of the frame to the component to perform the function. This component then performs on all received data packets that traverse the slice until it is switched out. The control processor then notifies another of the components of the slice that this component will start performing a function on the network interface device. The network interface device 600 may be configured to transmit a message to cause the network interface device 600 to stop performing a function on a data packet received at the network interface device 600.
[0383] Sockets may exist at various points in the ingress and egress data paths to switch components into and out of the data slice 1425. The control processor may oversee additional logic to and from the slice 1425. This additional logic may take the form of FIFOs placed between components.
[0384] The control processor can send control plane messages through slice 1425 to configured components of slice 1425. The configuration can determine the functions to be performed by the components of slice 1425. For example, control messages sent through slice 1425 can cause a hardware module to be configured to perform a function with respect to a data packet. Such control messages can cause atoms of a hardware module to be interconnected into a pipeline of hardware modules to provide a particular function. Such control messages can cause individual atoms of a hardware module to be configured to select an operation to be performed by an individually selected atom. Because each atom is preconfigured to perform a certain type of operation, the selection of an operation for each atom is made according to the type of operation each atom is preconfigured to perform.
[0385] Next, some further embodiments will be described with reference to Figs. 19 to 21. In this embodiment, a packet processing program or a feed-forward pipeline is operated in an FPGA. A method for making a subunit of an FPGA implement a packet processing program or a feed-forward pipeline will be described. The packet processing program or the feed-forward pipeline may be an eBPF program or a P4 program or any other suitable program.
[0386] The FPGA may be located in a network interface device, in some embodiments, the packet processing program is deployed or activated only after the network interface device is installed on its host.
[0387] The packet processing program or feed-forward pipeline may implement a loop-free logic flow.
[0388] In some embodiments, the program may be written in a non-privileged domain, such as user level, or a lower privilege domain. The program may be run in a privileged domain, such as the kernel, or a higher privilege domain. The hardware on which the program runs may require the absence of any loops.
[0389] The following embodiments refer to an example eBPF program, however it should be understood that other embodiments may be used with any other suitable program.
[0390] It should be understood that one or more of the following embodiments can be used in combination with one or more of the above embodiments.
[0391] Some embodiments may be provided in the context of an FPGA, an ASIC, or any other suitable hardware device. Some embodiments use subunits such as an FPGA or an ASIC. The following examples are described with reference to an FPGA. It should be understood that similar processes may be performed by an ASIC or any other suitable hardware device.
[0392] The subunits may be atoms. Some examples of atoms have been described above. It should be understood that any of the examples of atoms described above may alternatively or additionally be used as subunits. Alternatively or additionally, these subunits may be referred to as "slices" or configurable logic blocks.
[0393] Each of these sub-units may be configured to execute a single instruction or multiple associated instructions, in which case the associated instruction may provide a single output (which may be defined by one or more bits).
[0394] The sub-units may be thought of as computational units. The sub-units may be arranged in a pipeline in which packets are processed in sequence. In some embodiments, the sub-units may be dynamically assigned to execute each instruction (or instructions) in a program.
[0395] In some embodiments, a subunit may be all or part of a unit used to define, for example, a block of an FPGA. In some FPGAs, a block of an FPGA is called a slice. In some embodiments, a subunit or atom is equivalent to a slice.
[0396] By mapping each atom or subunit to a respective block or slice of the FPGA, improved resource utilization may be achieved as compared to mapping RTL atoms to FPGA resources, which may result in RTL atoms requiring a relatively large number of individual blocks or slices of the FPGA.
[0397] In some embodiments, the compilation may be at the atom level. This may have the advantage that the processing is pipelined. Packets may be processed in order. The compilation process may be performed relatively quickly.
[0398] In some embodiments, arithmetic operations may require one slice per byte. Logical operations may require half a slice per byte. Shift operations may require a set of slices depending on the width of the shift operation. Comparison operations may require one slice per byte. Selection operations may require half a slice per byte.
[0399] As part of the compilation process, placement and routing are performed. Placement is the allocation of a particular physical subunit to execute a particular instruction or instructions. Routing ensures that one or more outputs of a particular subunit are routed to the correct destination, which may be, for example, another subunit or subunits.
[0400] Placement and routing may use a process in which operations are assigned to particular subunits starting at one end of the pipeline. In some embodiments, the most important operations may be placed before less important operations. In some embodiments, routing may be assigned at the same time that a particular operation is placed. In some embodiments, a route may be selected from a limited set of pre-computed routes, as will be described in more detail below.
[0401] In some embodiments, if a route cannot be allocated, the action is deferred for later.
[0402] In some embodiments, the pre-computed route may be a byte-wide route, however this is merely an example and in other embodiments different route widths may be defined, in some embodiments multiple different sized routes may be provided.
[0403] In some embodiments, routing may be limited to routing between nearby subunits.
[0404] In some embodiments, the subunits may be physically arranged in a regular structure on the FPGA.
[0405] In some embodiments, to facilitate routing, rules can be created regarding how subunits can communicate, for example, a subunit can only provide output to the subunit next to it, above it or below it.
[0406] Alternatively or additionally, there may be restrictions on how far away the next subunit is for routing purposes: for example, a subunit may only output data to adjacent subunits, or to subunits that are within a specified distance (e.g., there are no more than two intervening subunits).
[0407] Please refer to FIG. 19, which illustrates a method of some embodiments. In some embodiments, an FPGA can have one or more "static" regions and one or more "dynamic" regions. The static regions can provide standard configurations and the dynamic functions can provide functionality according to the requirements of an end user. The static portions can be defined, for example, before an end user receives the network interface device, for example, before the network interface device is installed relative to a host. For example, the static regions can be configured to cause the network interface device to provide a particular functionality. The static regions are provided with pre-computed routes between atoms. As will be described in more detail later, there can be routing between one or more static regions that pass through one or more dynamic regions. The dynamic regions can be configured by the end user according to their requirements when the network interface device is deployed relative to a host. The dynamic regions can be configured to perform different functions for the end user over time.
[0408] In step S1, a first compilation process is performed to provide a main bitfile 50 and a first bitfile called tool checkpoint 52. This is in some embodiments a bitfile of at least a portion of the static area. The bitfile, when downloaded to the FPGA, causes the FPGA to function as specified in the program from which the bitfile was compiled. In some embodiments, the program used in the first compilation process may be any program or programs, or may be a test program specifically designed to help determine routing within a portion of the FPGA. In some embodiments, a series of simple programs may be used alternatively or additionally.
[0409] A program may have reconfigurable partitions that may be modified or used by a compiler. A program may be modified to make the compiler's job easier by moving nets out of the reconfigurable partitions.
[0410] Step S1 may be performed in a design tool. By way of example only, the Vivado tool may be used with XilinXFPGA. The checkpoint file may be provided by the design tool. The checkpoint file may be a bit file. A checkpoint file represents a snapshot of the design at the time the file was generated. The checkpoint file may include one or more of a synthesis netlist, design constraints, placement information, and routing information.
[0411] In step S2, the bitfile is analyzed taking into account the checkpoint file to provide a bitfile description 54. The analysis may be for one or more of detecting resources, generating routes, checking timings, generating one or more partial byte files, and generating a bitfile description.
[0412] The analysis may be configured to extract routing information from the bitfile. The analysis may be configured to determine which wires or routes a signal has propagated.
[0413] The analysis phase may be performed at least in part within a synthesis or design tool. In some embodiments, a scripting tool in Vivado may be used. The scripting tool may be TCL (Tool Command Language). TCL may be used to add or modify functionality in Vivado. Vivado functionality may be invoked and controlled by TCL scripts.
[0414] The bitfile description 54 defines how a given portion of the FPGA can be used. For example, the bitfile description indicates which atoms can be routed to which other atoms, and one or more routes that can be routed between those atoms. For example, for each atom, the bitfile description indicates where the input to that atom can come from, and where the output from that atom can be routed, along with one or more routes for the output of the data. The bitfile description is independent of any program.
[0415] The bitfile description may include one or more of root information, an indication of which pairs of roots are in conflict, and a description of how to generate a bitfile from a required configuration of atoms.
[0416] A bitfile description can provide a set of available routes between a set of atoms, but this is before any particular instruction is executed by a given atom.
[0417] The bitfile description may be for a portion of the FPGA. The bitfile description may be for a dynamic portion of the FPGA. The bitfile description includes which routes are available and / or which routes are unavailable. For example, the bitfile may indicate which routes are available to the dynamic portion of the FPGA, taking into account any routing across the dynamic portion of the FPGA that is required, e.g., by the static portion(s) of the FPGA.
[0418] It should be appreciated that in some embodiments, the bitfile description may be obtained in any suitable manner, for example, the bitfile description may be provided by a provider of the FPGA or ASIC.
[0419] In some embodiments, the bitfile description may be provided by a design tool. In this embodiment, the analysis step may be omitted. The design tool may output the bitfile description. The bitfile description may be for the static portion of the FPGA, including any necessary routing across the dynamic portion of the FPGA.
[0420] It should be appreciated that any other suitable technique may be used to generate the bitfile description. In the previous example, the tools used to design the FPGA are used to provide the analysis that is used to generate the bitfile.
[0421] It should be understood that in other embodiments, different tools may be used. In some embodiments, the tools may be specific to a product or line of products. For example, a provider of an FPGA may offer associated tools for managing its FPGAs.
[0422] In other embodiments, a general purpose scripting tool may be used. In some embodiments, different tools or techniques can be used to determine the partial bitfiles. For example, a main bitfile can be analyzed to determine which features correspond to which features. This may require multiple partial bitfiles to be generated.
[0423] It should be understood that step S3 is performed when the network interface device is installed to a host and executed on a physical FPGA device. Steps S1 and S2 may be performed as part of a design synthesis process to generate a bitfile image that implements the network interface device. In some embodiments, step S1 and / or step S2 are used to characterize the operation of the FPGA. Once the FPGA is characterized, a bitfile description is stored in memory of all physical network interface devices that will operate in a given prescribed manner.
[0424] In step S3, a compilation is performed using the bitfile description and the eBPF program. The output of the compilation is a partial bitfile of the eBPF program. The compilation adds routes to the partial bitfile and to the programming that will be executed by the individual slices.
[0425] It should be understood that the bitfile description may be provided within the system to be deployed. The bitfile description may be stored in memory. The bitfile description may be stored on the FPGA, the network interface device, or the host device. In some embodiments, the bitfile description is stored in a flash memory connected to the FPGA on the network interface device, or the like. The flash memory may also include the main bitfile.
[0426] The eBPF program may be stored with the bitfile description or separately. The eBPF program may be stored on the FPGA, the network interface device, or the host. In the case of eBPF, the program may be transferred from a user mode program to the kernel, both running on the host. The kernel transfers the program to a device driver, which transfers the program to a compiler running on the host or the network interface device. In some embodiments, the eBPF program may be stored on the network interface device so that it can run before the host OS boots.
[0427] The compiler may be located in any suitable location on the network interface device, the FPGA, or the host. By way of example only, the compiler may run on a CPU on the network interface device.
[0428] Next, we will explain the compiler flow. The compiler front end is eBPF. A program is received. The eBPF program may be written in any suitable language. For example, the eBPF program may be written in a C-type language. A compiler is configured in the front end to convert the program into an intermediate representation (IR). In some embodiments, the IR may be LLVM-IR or any other suitable IR.
[0429] In some embodiments, pointer analysis may be performed to create packet / map access primitives.
[0430] It should be understood that in some embodiments, optimization of the IR may be performed by the compiler, which may be optional in some embodiments.
[0431] The high-level synthesis backend of the compiler is configured to split the program pipeline into stages, generate packet access taps, and emit C code. In some embodiments, the HLS portion of the design tool and / or the design tool being used can be invoked to synthesize the output of the HLS phase.
[0432] The FPGA Atom compiler backend splits the pipeline into stages and generates packet access taps. If transformations can be performed to convert control dependencies to data dependencies. The design is placed and routed. A partial bitfile of the eBPF program is output.
[0433] In the case of a routing conflict, a routing problem may occur as shown in FIG. 20a. For example, slice A may communicate with slice C, and slice B may communicate with slice D. In the configuration of FIG. 20a, a common routing unit 60 is assigned to communication between slices A and C, as well as between slices B and D. In some embodiments, this routing conflict may be avoided. In this regard, reference is made to FIG. 20b. As can be seen, a separate route 64 is provided between slices A and C, as compared to route 62 between slices B and D.
[0434] In some embodiments, the bitfile description may include multiple different routes for at least some pairs of subunits. The compilation process checks for routing conflicts, as shown in Figure 20a. In the event of a routing conflict, the compiler may resolve or avoid such a conflict by selecting one of the appropriate alternatives for the route.
[0435] 21 shows a partition 66 in an FPGA for executing an eBPF program. The partition interfaces with the static portion of the FPGA, for example, via a set of input flip-flops 68 and a set of output flip-flops. In some embodiments, there may be routing 70 throughout the design, as previously described.
[0436] The compiler may need to address routing across regions of the FPGA that are being configured by the compiler. The compiler needs to generate partial bitfiles that match the reconfigurable partitions in the main bitfile. When the main bitfile is generated with the reconfigurable partitions, the design tools avoid using logic resources in the reconfigurable partitions so that those resources can be used by the partial bitfiles. However, the design tools may not be able to avoid using routing resources in the reconfigurable partitions.
[0437] As a result, the analysis tools are used by the design tools that are in the main bitfile. In order to avoid using routing resources that are not part of the main bitfile, the analysis tool must avoid using routing resources that are not part of the main bitfile. The analysis tool may need to verify that its list of available routes in the bitfile description does not include any used resources that are used by the main bitfile. The available routes may be defined in terms of route templates that can be used in many places in the FPGA because FPGAs are very regular. The routing resources used by the main bitfile break the regularity, which means that the analysis tool must avoid using those templates in places that conflict with the main bitfile. The analysis tool may need to generate new route templates that can be used in those places and / or prevent certain route templates from being used in certain places.
[0438] We now describe some examples of the functionality provided by the compiler in converting some example eBPF program fragments into instructions executed by atoms.
[0439] Some embodiments may use any suitable synthesis tool to generate the bitfile description. By way of example only, some embodiments may use the Bluespec tool based on a mode that uses atomic transactions for hardware.
[0440] In the first example, the eBPF program fragment has two instructions: Instruction 1:r1+=r2 Instruction 2:r1+=r3 The first instruction adds the number in register 1 (r1) to the number in register 2 (r2) and places the result in r1. The second instruction adds r1 to r3 and places the result in r1. Both instructions in this example use 64-bit registers, but only the lowest 32 bits are used. The most significant 32 bits of the result are filled with zeros.
[0441] The compiler translates these into instructions that are executed by the atoms: a 32-bit add instruction requires 32 pairs of look-up tables (LUTs), a 32-bit carry chain, and 32 flip-flops.
[0442] Each pair in the lookup table adds two bits to produce a two-bit result. The carry chain is a structure that allows a bit to be carried from one column to the next during addition, and allows a bit to be borrowed from the next column during subtraction.
[0443] The 32 flip-flops are storage elements that receive a value on one clock cycle and regenerate the value on the next clock cycle. They can be used to limit the amount of work done per clock cycle and simplify timing analysis.
[0444] In some embodiments, an FPGA can include several slices. In some exemplary slices, the carry chain propagates from the bottom of the slice (CIN) to the top of the slice (COUT) and then connects to the CIN input of the next slice up.
[0445] In an example where each slice has a 4-bit carry chain, eight slices are used to perform a 32-bit addition. In this embodiment, an atom can be thought of as being provided by a pair of slices, since it may be convenient in some embodiments for the atom to operate on 8-bit values.
[0446] In the example where each slice has an 8-bit carry chain, it performs a 32-bit addition. Four slices are used to compute the number of atoms in a given slice. In this embodiment, the atoms can be thought of as being provided by the slices.
[0447] It should be understood that this is merely an example, and as stated above, atoms may be defined in any suitable manner.
[0448] In this example, a case in which the FPGA has a slice supporting an 8-bit carry chain is used here in compiling the first exemplary eBPF program fragment.
[0449] There are three input values of 32 bits wide and one output value of 32 bits wide. There may be other preceding instructions that produced these three input values. In what follows, we assume some arbitrary position of the slice (atom).
[0450] The following numbering convention is used: The slices (atoms) are arranged in a regular row and column array. XnYm indicates the position of the atom in the array. Xn indicates the column and Ym indicates the row. X6Y0 indicates that the slice is at column 6 and row 0. It should be understood that in other embodiments, any other suitable numbering scheme may be used.
[0451] Assume that the initial values are generated simultaneously at the following locations: r1: slices X6Y0, X6Y1, X6Y2, and X6Y3 r2: slices X6Y4, X6Y5, X6Y6, and X6Y7 r3: slices X6Y8, X6Y9, X6Y10, and X6Y11 The result of the first instruction needs to be calculated by four adjacent slices in the same column so that the carry chain is connected correctly. The compiler may choose to calculate the result in slices X7Y0, X7Y1, X7Y2 and X7Y3. For this to work, the inputs need to be connected. There is a connection from X6Y0 to X7Y0, another connection from X6Y1 to X7Y1, one connection from X6Y2 to X7Y2, and one connection from X6Y3 to X7Y3. A corresponding connection from X6Y4-X6Y7 to X7Y0-X7Y3 is also needed.
[0452] These are full byte connections, which means that each of the eight input bits is connected to a corresponding output bit. For example, the output from slice X6Y0 flip-flip 0 is connected to input 0 of slice X7Y0 LUT 0.
[0453] The output from slice X6Y0 flip-flip 1 is connected to input 0 of slice X7Y0 LUT 1.
[0454] The same applies from here on. The output from slice X6Y0 flip-flop 7 is connected to input 0 of slice X7Y0 LUT 7.
[0455] During the first clock cycle, the r1 and r2 values from slices X6Y0-X6Y7 are forwarded to the inputs of slices X7Y0-X7Y3, processed by the LUTs and carry chains, and the results are stored in the flip-flops of those slices (X7Y0-X7Y3), ready to be used in the next cycle.
[0456] Moving on to instruction 2. The compiler needs to choose where to compute the result of instruction 2. It might choose slice X7Y4 to X7Y7. Again, there will be a full byte connection from the result of instruction 1 (X7Y0 to X7Y3) to the input of instruction 2 (X7Y4 to X7Y7).
[0457] A value for r3 is also needed. If r1, r2, and r3 were generated in cycle 0, then r1+r2 is generated in cycle 1. The value of r3 needs to be delayed by a clock cycle so that it is generated in cycle 1. The compiler may choose to generate r3 in cycle 1 using slices X7Y8-X7Y11. Then we need connections from the original slices (X6Y8-X6Y11) that generated r3 in cycle 0 to the new slices (X7Y8-X7Y11) that generate the same value in cycle 1. Once that's done, we now need connections from those new slices to the slices for instruction 2, for instruction 2. So the output from slice X7Y8 connects to the input of slice X7Y4, and so on.
[0458] In this case, the FPGA bitfile contains the following functions: -Full byte connection from X6Y0 to X7Y0 input 0 (initial r1 byte 0) -Full byte connection from X6Y1 to X7Y1 input 0 (initial r1 byte 1) -Full byte connection from X6Y2 to X7Y2 input 0 (initial r1 byte 2) -Full byte connection from X6Y3 to X7Y3 input 0 (initial r1 byte 3) -Full byte connection from X6Y4 to X7Y0 input 1 (initial r2 byte 0) -Full byte connection from X6Y5 to X7Y1 input 1 (initial r2 byte 1) -Full byte connection from X6Y6 to X7Y2 input 1 (initial r2 byte 2) -Full byte connection from X6Y7 to X7Y3 input 1 (initial r2 byte 3) -Full byte connection from X6Y8 to X7Y8 input 0 (initial r3 byte 0) -Full byte connection from X6Y9 to X7Y9 input 0 (initial r3 byte 1) -Full byte connection from X6Y10 to X7Y10 input 0 (initial r3 byte 2) -Full byte connection from X6Y11 to X7Y11 input 0 (initial r3 byte 3) - slice X7Y0 configured to add input 0 to input 1 (instruction 1 byte 0) - slice X7Y1 configured to add input 0 to input 1 (instruction 1 byte 1) - slice X7Y2 configured to add input 0 to input 1 (instruction 1 byte 2) - slice X7Y3 configured to add input 0 to input 1 (instruction 1 byte 3) - slice X7Y8 configured to copy input 0 to output (r3 delayed byte 0) - slice X7Y9 configured to copy input 0 to output (r3 delayed byte 1) - slice X7Y10 configured to copy input 0 to output (r3 delayed byte 2) - slice X7Y11 configured to copy input 0 to output (r3 delayed byte 3) -Full byte connection from X7Y0 to X7Y4 input 0 (instruction 1 byte 0) -Full byte connection from X7Y1 to X7Y5 input 0 (instruction 1 byte 1) -Full byte connection from X7Y2 to X7Y6 input 0 (instruction 1 byte 2) -Full byte connection from X7Y3 to X7Y7 input 0 (instruction 1 byte 3) -Full byte connection from X7Y8 to X7Y4 input 1 (r3 delayed byte 0) -Full byte connection from X7Y9 to X7Y5 input 1 (r3 delayed byte 1) -Full byte connection from X7Y10 to X7Y6 input 1 (r3 delayed byte 2) -Full byte connection from X7Y11 to X7Y7 input 1 (r3 delayed byte 3) - slice X7Y4 configured to add input 0 to input 1 (instruction 2 byte 0) -Slice X7Y5 (Instruction 2 Byte 1) configured to add Input 0 to Input 1 -Slice X7Y6 (Instruction 2 Byte 2) configured to add Input 0 to Input 1 -Slice X7Y7 (Instruction 2 Byte 3) configured to add Input 0 to Input 1 The compiler does not need to generate the upper 32 bits of the result of Instruction 2. This is because they are known to be 0. Noting that fact, 0 can be used whenever they are used.
[0459] Next, a second example of the compilation of an eBPF fragment will be described. Instruction 1: r1 &= 0xff Instruction 2: r2 &= 0xff Instruction 3: If r1 < r2, proceed to L1 Instruction 4: r1 = r2 Label L1.
[0460] The first instruction performs a bitwise AND of r1 and the constant 0xff and places the result in r1. A given bit in the result is set to 1 if the corresponding bit was originally set to 1 in r1 and the corresponding bit is set to 1 in the constant; otherwise it is set to 0. The constant 0xff has bits 0 to 7 set and bits 8 to 63 cleared, so as a result, bits 0 to 7 of r1 are unchanged, but bits 8 to 63 are set to 0. This simplifies things for the compiler as it understands that bits 8 to 63 are 0 and it does not need to generate them. The second instruction does the same for r2.
[0461] Instruction 3 checks whether r1 is less than r2 and if so jumps to label L1. This skips Instruction 4. Instruction 4 simply copies the value from r2 to r1. This instruction sequence finds the minimum of r1 byte 0 and r2 byte 0 and places the result in r1 byte 0.
[0462] Compilers can turn conditional jumps into selection instructions using a technique known as "if transformation."
[0463] Instruction 1:r1&=0xff Instruction 2: r2&=0xff Instruction 5:c1=(r1 <r2) Instruction 6:r1=c1?r1:r2 Instruction 5 compares r1 to r2 and sets c1 to 1 if r1 is less than r2, otherwise it sets c1 to 0. Instruction 6 is a select instruction that copies r1 to r1 if c1 is set (which has no effect), and copies r2 to r1 otherwise. If c1 is equal to 1, instruction 3 has skipped instruction 4, which means r1 retains its value from instruction 1. In this case, the select instruction also keeps r1 unchanged. If c1 is equal to 0, instruction 3 has not skipped instruction 4, so r2 is copied to r1 by instruction 4. Again, the select instruction copies r2 to r1, so the new sequence has the same effect as the old sequence.
[0464] Instruction 6 is not a valid eBPF instruction. However, this instruction is represented in LLVM-IR while the compiler is operating on it. Instruction 6 is a valid instruction in LLVM-IR.
[0465] These instructions now need to be assigned to atoms. Assume that input r1 is available in slices X0Y0 to X0Y7, and r2 is available in slices X0Y8 to X0Y15. Instructions 1 and 2 cause the compiler to note that the most significant 7 bytes of r1 and r2 are set to 0.
[0466] The compiler may then choose to compute the result of instruction 5 in slice X1Y0. A full byte connection is needed from the output of slice X0Y0 to input 0 of slice X1Y0, and a full byte connection from the output of slice X0Y8 to input 1 of slice X1Y0. The way to compare two values is to subtract one from the other and try to borrow from the next bit up. The purpose of this comparison is to check whether the calculation will overflow by comparing the first two bits of the slice X1Y1 with the second one. The result of this comparison is then stored in flip-flop 7 of slice X1Y1.
[0467] Similar to the first example, r1 and r2 need to be delayed by one cycle to present their values in time for instruction 6. The compiler may use slices X1Y1 and X1Y2 for r1 and r2, respectively.
[0468] The select instruction requires three inputs: c1, r1, and r2. Note that r1 and r2 are one byte wide, but c1 is only one bit wide. Assume that a compilation computes the result of the select instruction slice X2Y0. The selection is performed bitwise, with each LUT in slice X2Y0 handling one bit.
[0469] If c1 is set, then bit 0 of the result is r1 bit 0, Otherwise, r2 bit is 0.
[0470] If c1 is set, then bit 1 of the result is r1 bit 1, Otherwise, r2 bit is 1.
[0471] ...and so on. If c1 is set, bit 7 of the result is r1 bit 7, Otherwise, r2 bit is 7.
[0472] Each LUT may need to access a corresponding bit from r1 and a corresponding bit from r2, but all LUTs need to access c1, which means that c1 needs to be replicated across the bits of input 0 of the slice. Thus, the connections for the inputs of instruction 6 are as follows:
[0473] Duplicate bit 7 of the output of slice X1Y0 to input 0 of slice X2Y0. Full byte connection from output of slice X1Y1 to input 1 of slice X2Y0.
[0474] Full byte connection from output of slice X1Y2 to input 2 of slice X2Y0. Another issue that needs to be addressed concerns shift instructions. Consider the following example:
[0475] A 16-bit shift left by 5 bits is Set output bit 0 to 0, Set output bit 1 to 0, Set output bit 2 to 0, Set output bit 3 to 0, Set output bit 4 to 0, Copy input bit 0 to output bit 5, Copy input bit 1 to output bit 6, ... This requires that input bit 10 be copied to output bit 15.
[0476] Note that the inputs and outputs here are of connections. The input of the connection is from the output of the first slice. The output of the connection goes to the input of the second slice.
[0477] It may not be possible to make this kind of connection within a slice, but rather it may be possible to make this kind of connection through interconnections between slices. The compiler assumes that a 16-bit input value is generated by two adjacent slices in the same column. This is because the compiler can make sure that a value is generated there.
[0478] As an example, assume that the inputs are produced by slices X0Y4 and X0Y5, and the outputs go to slices X1Y4 and X1Y5. Then the following connections are required:
[0479] Slice X1Y4 bit 0 is known to be 0, so it is not necessary Slice X1Y4 bit 1 is known to be 0, so not necessary Slice X1Y4 bit 2 is known to be 0, so not necessary Slice X1Y4 bit 3 is known to be 0, so not necessary Slice X1Y4 bit 4 is known to be 0, so not necessary Slice X1Y4 bit 5 is from slice X0Y4 bit 0 Slice X1Y4 bit 6 is from slice X0Y4 bit 1 Slice X1Y4 bit 7 is from slice X0Y4 bit 2 Slice X1Y5 bit 0 is from slice X0Y4 bit 3 Slice X1Y5 bit 1 is from slice X0Y4 bit 4 Slice X1Y5 bit 2 is from slice X0Y4 bit 5 Slice X1Y5 bit 3 is from slice X0Y4 bit 6 Slice X1Y5 bit 4 is from slice X0Y4 bit 7 Slice X1Y5 bit 5 is from slice X0Y5 bit 0 Slice X1Y5 bit 6 is from slice X0Y5 bit 1 Slice X1Y5 bit 7 is from slice X0Y5 bit 2 The eight connections to the inputs of slice X1Y5 can be thought of as shifted connections or shifted routes. The same structure can be used for slice X1Y4, but with inputs from X1Y3 and X1Y4, because bits 5 through 7 are matched and the slice can ignore bits 0 through 4, so it doesn't matter which input is presented there.
[0480] It may be necessary to be able to shift by any amount between 1 and 7 bits. A connection that shifts by 0 or 8 bits is exactly the same as a full-byte connection, since in that case each bit connects to the corresponding bit in another slice.
[0481] The variable amount shifting can be done in two or three stages, depending on the width of the value being shifted. The stages are as follows:
[0482] Stage 1: Shift by 0, 1, 2 or 3. Stage 2: Shift by 0, 4, 8 or 12.
[0483] Stage 3: Shift by 0, 16, 32 or 48 (32 or 64 bit only).
[0484] As another example, given an arithmetic right shift by a variable amount of bytes, the value to be shifted is generated by slice X3Y2 and the shift amount is generated by X3Y3.
[0485] An arithmetic right shift requires an "arithmetic right shift" type connection, which takes the outputs of one slice and connects them to the inputs of another slice, but in the process shifts them right by a fixed amount, duplicating the sign bit if necessary.
[0486] For example, the "arithmetic right shift 3" connection has the following: Output bit 0 is from input bit 3 Output bit 1 comes from input bit 4 Output bit 2 is from input bit 5 Output bit 3 comes from input bit 6 Output bit 4 comes from input bit 7 Output bit 5 comes from input bit 7 (the sign bit) Output bit 6 comes from input bit 7 (the sign bit) Output bit 7 comes from input bit 7 (the sign bit) Stage 1 can be computed in slice X4Y2, in which case the following connections are required:
[0487] Full byte from slice X3Y2 to slice X4Y2 input 0 Arithmetic right shift 1 from slice X3Y2 to slice X4Y2 input 1 Arithmetic right shift 2 from slice X3Y2 to slice X4Y2 input 2 Arithmetic right shift 3 from slice X3Y2 to slice X4Y2 input 3 Duplicate slice X3Y3 bit 0 to slice X4Y2 input 4 Duplicate slice X3Y3 bit 1 to slice X4Y2 input 5 Slice X4Y2 is then configured to select one of the first four inputs based on input 4 and input 5 as follows:
[0488] Input 4 is 0 and input 5 is 0: Select input 0 Input 4 is 1 and input 5 is 0: Input 1 is selected Input 4 is 0 and input 5 is 1: Input 2 is selected Input 4 is 1 and input 5 is 1: Select input 3 The shift amount can be copied from slice X3Y3 to slice X4Y3 to provide a delayed version.
[0489] Stage 2 can be computed in slice X5Y2, in which case the following connections are required:
[0490] Full byte from slice X4Y2 to slice X5Y2 input 0 Arithmetic right shift 4 from slice X4Y2 to slice X5Y2 input 1 Duplicate slice X4Y3 bit 2 to slice X5Y2 input 2 Slice X5Y2 is then configured to select input 0 or input 1 based on input 2 as follows:
[0491] Input 2 is 0: Select input 0 Input 2 is 1: Select input 1 The output of slice X5Y2 is the result of the variable arithmetic right shift operation.
[0492] The bitfile for a given atom might be: Atom Identification A list of other atoms from which a given atom can receive input and available routes for that input.
[0493] A list of other atoms for which a given atom can provide output and possible routes to that output. It will be appreciated that because an FPGA is a regular structure, there may be a common template that can be used for multiple atoms with modification of individual atoms as needed.
[0494] As an example, the bitfile description for slice X7Y1 has the following possible inputs and outputs: can be specified.
[0495] Input from X6Y1 via Route A or Route B Input from X6Y5 via route C or route D Input from X7Y0 via Route E or Route F Output to X8Y1 via Route G or Route H Output to X7Y2 via Route I or Route J Output to X7Y5 via route K or route L.
[0496] The compiler uses this bitfile description to provide partial bitfiles for the input and output of slice X7Y1 of the first eBPF example above:
[0497] Input from X6Y1 via route A Input from X6Y5 via route C Output to X7Y5 via route K or route L.
[0498] As an example, a bitfile description of slice XnYm may specify the following possible inputs and outputs:
[0499] Input from Xn-1Ym via route A or route B Input from Xn-1Ym+4 via route C or route D Input from XnYm-1 via route E or route F Output to Xn+1Ym via route G or route H Output to XnYm+1 via route I or route J Output to XnYm+4 via route K or route L.
[0500] This bitfile description can be modified, as described above, to remove one or more routes that are unavailable for use by the compiler, possibly because they are used by another atom or for cross-partition routing.
[0501] It should be understood that the compiler may be implemented by a computer program including computer executable instructions that may be executed by one or more computer processors. The compiler may be executed on hardware, such as at least one processor operating in conjunction with one or more memories.
[0502] While the above describes exemplary embodiments, it should be noted that there are several variations and modifications that can be made to the disclosed solutions without departing from the scope of the present invention.
[0503] Thus, the embodiments may vary within the scope of the appended claims. In general, some embodiments may be implemented in hardware or dedicated circuits, software, logic, or any combination thereof. For example, some aspects may be implemented in hardware, while other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device, but the embodiments are not limited thereto.
[0504] The embodiments may be implemented by computer software stored in a memory and executable by at least one data processor of the participating entities, or by hardware, or by a combination of software and hardware. .
[0505] The software can be stored on physical media such as memory chips or memory blocks implemented within a processor, magnetic media such as a hard disk or floppy disk, and optical media such as DVDs and their data variants, CDs, etc.
[0506] The memory may be of any type suitable for the local technology environment and may be implemented using any suitable data storage technology, such as semiconductor-based memory devices, magnetic memory devices and systems, optical memory devices and systems, fixed and removable memory.
[0507] The data processor may be of any type suitable for the local technology environment and may include, by way of non-limiting examples, one or more of a general purpose computer, a special purpose computer, a microprocessor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a gate level circuit, and a processor based on a multi-core processor architecture.
[0508] Various modifications and adaptations may become apparent to those skilled in the art in view of the foregoing description, when read in conjunction with the accompanying drawings and the appended claims, however, all such and similar modifications of the present teachings remain within the scope defined by the appended claims.
Claims
1. 1. A network interface device for interfacing a host device to a network, comprising: a first interface, the first interface configured to receive a plurality of data packets; a configurable hardware module comprising a plurality of processing units, each processing unit being associated with a predefined type of operation executable in a single step; At least some of the plurality of processing units are associated with different predetermined types of operations; The hardware module is configurable to interconnect at least some of the plurality of the processing units to provide a first data processing pipeline for processing one or more of the plurality of data packets to perform a first function on the one or more of the plurality of data packets.
2. The network interface device of claim 1 , wherein two or more of the at least some of the plurality of processing units are configured to perform associated at least one predetermined operation in parallel.
3. Two or more of the at least some of the plurality of processing units: performing an associated predetermined type of operation within a predetermined length of time defined by a clock signal; 3. A network interface device as claimed in claim 1 or 2, configured to transfer a result of each of said at least one operation to a next processing unit in response to completion of said predetermined period of time.
4. 13. The network interface device of any one of the preceding claims, wherein each of the plurality of processing units comprises an application specific integrated circuit configured to perform the at least one operation associated with the respective processing unit.
5. 13. A network interface device according to any one of the preceding claims, wherein at least one of the plurality of processing units comprises a digital circuit and a memory for storing state relating to processing performed by the digital circuit, the digital circuit being configured in communication with the memory to perform the predetermined type of operation associated with the respective processing unit.
6. 13. A network interface device according to any one of the preceding claims, comprising a memory accessible to two or more of the plurality of processing units, the memory configured to store a state associated with a first data packet, and wherein during execution of the first function by the hardware module, two or more of the plurality of processing units are configured to access and modify the state.
7. 7. The network interface device of claim 6, wherein a first processing unit of the at least some of the plurality of processing units is configured to stall during an access of the state value by a second processing unit of the plurality of processing units.
8. One or more of the plurality of processing units may be configured to perform a process based on an associated predetermined type of operation.
2. A network interface device according to any one of the preceding claims, wherein the network interface device is individually configurable to perform operations specific to each pipeline based on the pipelined operations.
9. The hardware module receives an instruction and, in response to the instruction, interconnecting at least some of the processing units to provide a data processing pipeline for processing one or more of the plurality of data packets; causing one or more of said plurality of processing units to perform an associated predetermined type of operation with respect to said one or more data packets; adding one or more of the plurality of processing units to a data processing pipeline; and 2. A network interface device according to any one of the preceding claims, configured to at least one of: remove one or more of the plurality of processing units from a data processing pipeline.
10. The predetermined operation is loading at least one value of the first data packet from a memory; storing at least one value of the data packet in a memory; and 2. A network interface device according to any one of the preceding claims, comprising at least one of performing a lookup in a lookup table to determine an action to be taken with respect to the data packet.
11. 13. A network interface device according to any one of the preceding claims, wherein one or more of the at least some of the plurality of processing units are configured to pass at least one result of an associated at least one predetermined operation to a next processing unit in a first processing pipeline, the next processing unit being configured to perform a next predetermined operation in response to the at least one result.
12. 2. A network interface device according to any one of the preceding claims, wherein each of the different predetermined types of operation is defined by a different template.
13. The predetermined type of action is: Accessing the data packets; accessing a lookup table stored in a memory of the hardware module; performing a logical operation on the data loaded from the data packet; and 2. A network interface device according to any one of the preceding claims, comprising at least one of: performing a logical operation on data loaded from the look-up table.
14. 13. A network interface device according to any one of the preceding claims, wherein the hardware module comprises routing hardware, the hardware module being configurable to interconnect at least some of the plurality of processing units to provide the first data processing pipeline by configuring the routing hardware to route data packets between the plurality of processing units in a particular order defined by the first data processing pipeline.
15. The hardware module is adapted to interconnect at least some of the plurality of the processing units to provide a second data processing pipeline for processing one or more of the plurality of data packets to perform a second function different from the first function.
2. A network interface device according to any one of the preceding claims, configurable as follows:
16. 10. A network interface device according to any one of the preceding claims, wherein the hardware module is configurable to interconnect at least some of the plurality of said processing units to provide the first data processing pipeline before interconnecting at least some of the plurality of said processing units to provide a second data processing pipeline.
17. 10. A network interface device according to any one of the preceding claims, comprising further circuitry separate from the hardware module and configured to perform the first function on one or more of the plurality of data packets.
18. The further circuitry comprises: Field programmable gate arrays, and 20. The network interface device of claim 17, comprising at least one of a plurality of central processing units.
19. 19. A network interface device according to claim 17 or 18, wherein the network interface device comprises at least one controller, the further circuitry being configured to perform the first function on a data packet during a compilation process to cause the first function to be executed in the hardware module, the at least one controller being configured to control the hardware module to initiate execution of the first function on a data packet in response to completion of the compilation process.
20. 20. The network interface device of claim 19, wherein the at least one controller is configured to control the further circuitry to stop performing the first function on data packets in response to the determination that the compilation process for causing the first function to be executed on the hardware module is completed.
21. 19. A network interface device according to claim 17 or 18, wherein the network interface device comprises at least one controller, the hardware module being configured to perform the first function on a data packet during a compilation process for causing the first function to be performed in the further circuitry, the at least one controller being configured to determine that the compilation process for causing the first function to be performed in the further circuitry is completed and to control the further circuitry to start performing the first function on a data packet in response to the determination.
22. 22. The network interface device of claim 21, wherein the at least one controller is configured to control the hardware module to stop performing the first function on data packets in response to the determination that the compilation process for causing the first function to be executed in the further circuitry is completed.
23. 10. A network interface device according to any one of the preceding claims, comprising at least one controller configured to perform a compilation process to enable the first function to be executed in the hardware module.
24. 11. A data processing system comprising a network interface device according to any one of the preceding claims and a host device, the data processing system comprising at least one controller configured to perform a compilation process to enable the first function to be executed in the hardware module.
25. The at least one controller the network interface device, and 25. The data processing system of claim 24 provided by one or more of the host devices.
26. 26. The data processing system of claim 24 or 25, wherein the compilation process is performed in response to a determination by the at least one controller that a computer program representing the first functionality is safe to execute in a kernel mode of the host device.
27. 27. The data processing system of claim 24, 25 or 26, wherein the at least one controller is configured to perform the compilation process by assigning each of the at least some of the plurality of processing units to perform at least one operation from a plurality of operations represented by a sequence of computer code instructions in a particular order of the first data processing pipeline, the plurality of operations providing the first function for the one or more of the plurality of data packets.
28. The at least one controller sending first instructions to further circuitry of the network interface device to perform the first function on data packets prior to completion of the compilation process; 28. The data processing system of claim 24, further configured to send a second instruction to the hardware module to cause the hardware module to start executing the first function on a data packet after the compilation process is completed.
29. 1. A method for implementation in a network interface device, comprising: receiving a plurality of data packets at a first interface; and configuring the hardware module to interconnect at least some of a plurality of processing units of the hardware module to provide a first data processing pipeline for processing one or more of the plurality of data packets to perform a first function on the one or more of the plurality of data packets; Each processing unit is associated with a given type of operation that can be performed in a single step; A method, wherein at least some of the plurality of processing units are associated with different predetermined types of operations.
30. A non-transitory computer readable medium containing program instructions for causing a network interface device to perform a method, the method comprising: receiving a plurality of data packets at a first interface; a first data processing unit for interconnecting at least some of the processing units of the hardware module to process one or more of the plurality of data packets and perform a first function on the one or more of the plurality of data packets; and configuring the hardware modules to provide a processing pipeline; Each processing unit is associated with a given type of operation that can be performed in a single step; A non-transitory computer-readable medium, at least some of the plurality of processing units being associated with different predetermined types of operations.
