TECHNOLOGIES FOR SCALABLE PACKET RECEPTION AND TRANSMISSION
Technologies for scalable packet reception and transmission include a network device. The network device is to establish a ring that is defined as a circular buffer and includes a plurality of slots to store entries representative of packets. The network device is also to generate and assign receive descriptors to the slots in the ring. Each receive descriptor includes a pointer to a corresponding memory buffer to store packet data. The network device is further to determine whether the NIC has received one or more packets and copy, with direct memory access (DMA) and in response to a determination that the NIC has received one or more packets, packet data of the received one or more packets from the NIC to the memory buffers associated with the receive descriptors assigned to the slots in the ring.
The present application is a continuation application of U.S. application Ser. No. 15/199,110, entitled “TECHNOLOGIES FOR SCALABLE PACKET RECEPTION AND TRANSMISSION,” which was filed on Jun. 30, 2016.
BACKGROUNDIn typical systems, all packet pointers received from a network interface card are taken by a thread executing on a core of a processor from a receive descriptor location and placed into a queue for processing by an application. This process creates a bottleneck on a core and prevents scalability when throughput exceeds the capacity of the single core to move the receive data pointers into the application queue. Additionally, in typical systems, a bottleneck also exists in the transmission of packets, as a single core executes a thread to execute a similar process to move data from an application queue to a network interface card for transmission.
The concepts described herein are illustrated by way of example and not by way of limitation in the accompanying figures. For simplicity and clarity of illustration, elements illustrated in the figures are not necessarily drawn to scale. Where considered appropriate, reference labels have been repeated among the figures to indicate corresponding or analogous elements.
While the concepts of the present disclosure are susceptible to various modifications and alternative forms, specific embodiments thereof have been shown by way of example in the drawings and will be described herein in detail. It should be understood, however, that there is no intent to limit the concepts of the present disclosure to the particular forms disclosed, but on the contrary, the intention is to cover all modifications, equivalents, and alternatives consistent with the present disclosure and the appended claims.
References in the specification to “one embodiment,” “an embodiment,” “an illustrative embodiment,” etc., indicate that the embodiment described may include a particular feature, structure, or characteristic, but every embodiment may or may not necessarily include that particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same embodiment. Further, when a particular feature, structure, or characteristic is described in connection with an embodiment, it is submitted that it is within the knowledge of one skilled in the art to effect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described. Additionally, it should be appreciated that items included in a list in the form of “at least one A, B, and C” can mean (A); (B); (C); (A and B); (A and C); (B and C); or (A, B, and C). Similarly, items listed in the form of “at least one of A, B, or C” can mean (A); (B); (C); (A and B); (A and C); (B and C); or (A, B, and C).
The disclosed embodiments may be implemented, in some cases, in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried by or stored on a transitory or non-transitory machine-readable (e.g., computer-readable) storage medium, which may be read and executed by one or more processors. A machine-readable storage medium may be embodied as any storage device, mechanism, or other physical structure for storing or transmitting information in a form readable by a machine (e.g., a volatile or non-volatile memory, a media disc, or other media device).
In the drawings, some structural or method features may be shown in specific arrangements and/or orderings. However, it should be appreciated that such specific arrangements and/or orderings may not be required. Rather, in some embodiments, such features may be arranged in a different manner and/or order than shown in the illustrative figures. Additionally, the inclusion of a structural or method feature in a particular figure is not meant to imply that such feature is required in all embodiments and, in some embodiments, may not be included or may be combined with other features.
Referring now to
The worker stages perform operations (“worker functions”) on the received packet data, such as compression, decompression, encryption, decryption, firewall services, and/or other functions and update metadata associated with the corresponding entries in the slots of the ring to indicate a completion status of each worker stage. Further, the output stages generate transmit descriptors and add them to the slots in the ring sequentially. The transmit descriptors are similar to the receive descriptors in that they include an instruction to the NIC (i.e., an instruction to transmit a packet) and a pointer to a memory buffer that includes the packet data to be transmitted. When the metadata of an entry in a slot indicates that the worker stages have finished processing the packet data and that the packet data is ready to be transmitted, the output stage copies the packet data to the NIC using DMA. It should be appreciated that, in the illustrative embodiment, the input and output stages fill the slots in the ring with receive descriptors and transmit descriptors at a rate that is independent of the rate at which packets are actually received and/or transmitted by the NIC, thereby reducing the bottleneck present in typical systems. In other words, a supply of receive descriptors and transmit descriptors, and the associated memory buffers, are made available before the NIC utilizes them. Further, as described in more detail herein, in some embodiments, to provide further efficiencies, operations of the input and output stages are implemented by hardware components of the NIC itself, rather than by software threads executed on cores of the processor.
The source endpoint node 102 may be embodied as any type of computation or computing device capable of performing the functions described herein, including, without limitation, a computer, a desktop computer, a smartphone, a workstation, a laptop computer, a notebook computer, a tablet computer, a mobile computing device, a wearable computing device, a network appliance, a web appliance, a distributed computing system, a processor-based system, and/or a consumer electronic device. Similarly, the destination endpoint node 108 may be embodied as any type of computation or computing device capable of performing the functions described herein, including, without limitation, a computer, a desktop computer, a smartphone, a workstation, a laptop computer, a notebook computer, a tablet computer, a mobile computing device, a wearable computing device, a network appliance, a web appliance, a distributed computing system, a processor-based system, and/or a consumer electronic device. Each of the source endpoint node 102 and the destination endpoint node 108 may include components commonly found in a computing device such as a processor, memory, input/output subsystem, data storage, communication circuitry, etc.
The network 104 may be embodied as any type of wired or wireless communication network, including cellular networks (e.g., Global System for Mobile Communications (GSM), 3G, Long Term Evolution (LTE), Worldwide Interoperability for Microwave Access (WiMAX), etc.), digital subscriber line (DSL) networks, cable networks (e.g., coaxial networks, fiber networks, etc.), telephony networks, local area networks (LANs) or wide area networks (WANs), global networks (e.g., the Internet), or any combination thereof. Additionally, the network 104 may include any number of network devices 106 as needed to facilitate communication between the source endpoint node 102 and the destination endpoint node 108.
Each network device 106 may be embodied as any type of computing device capable of facilitating wired and/or wireless network communications between the source endpoint node 102 and the destination endpoint node 108. For example, the network devices 106 may be embodied as a server (e.g., stand-alone, rack-mounted, blade, etc.), a router, a switch, a network hub, an access point, a storage device, a compute device, a multiprocessor system, a network appliance (e.g., physical or virtual), a computer, a desktop computer, a smartphone, a workstation, a laptop computer, a notebook computer, a tablet computer, a mobile computing device, or any other computing device capable of processing network packets. As shown in
The CPU 210 may be embodied as any type of processor capable of performing the functions described herein. The CPU 210 may be embodied as a single or multi-core processor(s), a microcontroller, or other processor or processing/controlling circuit. In some embodiments, the CPU 210 may be embodied as, include, or be coupled to a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a graphics processing unit (GPU), reconfigurable hardware or hardware circuitry, or other specialized hardware to facilitate performance of the functions described herein. In the illustrative embodiment, the CPU 210 is embodied as a processor containing a set 230 of multiple cores 232, 234, 236, 238, 240, 242, 244, and 246. While eight cores are shown in
The I/O subsystem 214 may be embodied as circuitry and/or components to facilitate input/output operations with the CPU 210, the main memory 212, and other components of the network device 106. For example, the I/O subsystem 214 may be embodied as, or otherwise include, memory controller hubs, input/output control hubs, integrated sensor hubs, firmware devices, communication links (i.e., point-to-point links, bus links, wires, cables, light guides, printed circuit board traces, etc.), and/or other components and subsystems to facilitate the input/output operations. In some embodiments, the I/O subsystem 214 may form a portion of a system-on-a-chip (SoC) and be incorporated, along with one or more of the CPU 210, the main memory 212, and other components of the network device 106, on a single integrated circuit chip.
The communication circuitry 216 may be embodied as any communication circuit, device, or collection thereof, capable of enabling communications over the network 104 between the network device 106 and the source endpoint node 102, another network device 106, and/or the destination endpoint node 108. The communication circuitry 216 may be configured to use any one or more communication technology (e.g., wired or wireless communications) and associated protocols (e.g., Ethernet, Bluetooth®, Wi-Fi®, WiMAX, etc.) to effect such communication.
The illustrative communication circuitry 216 includes a network interface controller (NIC) 218, which may also be referred to as a host fabric interface (HFI). The NIC 218 may be embodied as one or more add-in-boards, daughtercards, network interface cards, controller chips, chipsets, or other devices that may be used by the network device 106 to connect the source endpoint node 102, the destination endpoint node 108, and/or another network device 106. In some embodiments, the NIC 218 may be embodied as part of a system-on-a-chip (SoC) that includes one or more processors, or included on a multichip package that also contains one or more processors. In some embodiments, the NIC 218 may include a local processor (not shown) and/or a local memory (not shown) that are both local to the NIC 218. In such embodiments, the local processor of the NIC 218 may be capable of performing one or more of the functions of the CPU 210 described herein. Additionally or alternatively, in such embodiments, the local memory of the NIC 218 may be integrated into one or more components of the network device 106 at the board level, socket level, chip level, and/or other levels. Further, the NIC 218 may include ring access logic 220, which may be embodied as a processor, a microcontroller, an FPGA, an ASIC or any other device capable of enabling the NIC 218 to directly access receive descriptors and transmit descriptors stored in slots of the shared ring, rather than relying on software threads executed by one or more of the cores 230 of the CPU 210 to independently copy these descriptors to separate queues for the NIC 218. The ring access logic 220 enables the NIC 218 to access the non-contiguously stored receive descriptors and transmit descriptors in the ring rather than relying on the cores of the CPU 210 to separately copy the receive descriptors and the transmit descriptors to separate queues for the NIC 218 where those descriptors are stored contiguously.
The network device 106 may additionally include a data storage device 222, which may be embodied as any type of device or devices configured for short-term or long-term storage of data such as, for example, memory devices and circuits, memory cards, hard disk drives, solid-state drives, or other data storage devices. The data storage device 222 may include a system partition that stores data and firmware code for the network device 106. The data storage device 222 may also include an operating system partition that stores data files and executables for an operating system of the network device 106.
Additionally, the network device 106 may include a display 224. The display 224 may be embodied as, or otherwise use, any suitable display technology including, for example, a liquid crystal display (LCD), a light emitting diode (LED) display, a cathode ray tube (CRT) display, a plasma display, and/or other display usable in a compute device. The display may include a touchscreen sensor that uses any suitable touchscreen input technology to detect the user's tactile selection of information displayed on the display including, but not limited to, resistive touchscreen sensors, capacitive touchscreen sensors, surface acoustic wave (SAW) touchscreen sensors, infrared touchscreen sensors, optical imaging touchscreen sensors, acoustic touchscreen sensors, and/or other type of touchscreen sensors. Additionally or alternatively, the network device 106 may include one or more peripheral devices 226. Such peripheral devices 226 may include any type of peripheral device commonly found in a compute device such as speakers, a mouse, a keyboard, and/or other input/output devices, interface devices, and/or other peripheral devices.
Referring now to
In the illustrative environment 300, the network device 106 also includes ring data 302, packet data 304, stage data 306, and NIC queue data 308. The ring data 302 represents a ring established in the memory 212 and includes a set of entries. As discussed in more detail below in regard to
The network communication module 320, which may be embodied as hardware, firmware, software, virtualized hardware, emulated architecture, and/or a combination thereof as discussed above, is configured to facilitate inbound and outbound network communications (e.g., network traffic, network packets, network flows, etc.) to and from the network device 106, respectively. To do so, the network communication module 320 is configured to receive and process data packets from one computing device (e.g., the source endpoint node 102, another network device 106, the destination endpoint node 108) and to prepare and send data packets to another computing device (e.g., the source endpoint node 102, another network device 106, the destination endpoint node 108). Accordingly, in some embodiments, at least a portion of the functionality of the network communication module 320 may be performed by the communication circuitry 216, and, in the illustrative embodiment, by the NIC 218. The DMA module 330, which may be embodied as hardware, firmware, software, virtualized hardware, emulated architecture, and/or a combination thereof as discussed above, is configured to enable packet data to be copied, using direct memory access (DMA) between the NIC 218 and the memory buffers specified in the pointers in the descriptors included in the slots of the shared ring.
The ring management module 340, which may be embodied as hardware, firmware, software, virtualized hardware, emulated architecture, and/or a combination thereof as discussed above, is configured to establish the ring in the memory 212 of the network device 106, assign the cores 230 of the CPU 210 to the stages, including one or more input stages, one or more output stages, and various worker stages, and manage concurrent access of the stages to entries in the ring. To do so, in the illustrative embodiment, the ring management module 340 includes the ring setup module 350, the descriptor management module 360, and the stage management module 370. The ring setup module 350, in the illustrative embodiment, is configured to allocate a section of memory and establish a ring buffer (referred to herein as simply a “ring”) in the memory. In the illustrative embodiment, the ring is organized into a series of slots, each of which may contain an entry that includes metadata, a receive descriptor, and a transmit descriptor, as described above. The slots and, by association, the entries stored therein, have sequence numbers. As described in more detail herein, a process such as a stage may cycle through the entries in the ring by incrementing its own internal sequence number and applying a modulus function to the internal sequence number based on the size (i.e., number of slots) of the ring, such that the resulting sequence number falls into the range of 0 to the size of the ring minus one. In the illustrative embodiment, the ring setup module 350 is configured to establish a ring having a size that is a power of two, which enables the use of masking to convert from a sequence number of a stage to an index (i.e., slot number) into the ring.
The descriptor management module 360, which may be embodied as hardware, firmware, software, virtualized hardware, emulated architecture, and/or a combination thereof as discussed above, is configured to manage the generation of receive descriptors and transmit descriptors for use by the NIC 218. To do so, the descriptor management module 360 may include a descriptor copy module 362 and an update notification module 364. The descriptor copy module 362 may be configured to copy generated receive descriptors and transmit descriptors to corresponding queues for the NIC 218. The update notification module 364 may be configured to provide an update to the NIC 218 that a new receive descriptor or transmit descriptor has been added to the corresponding queue of the NIC 218, such as by updating a tail register associated with the NIC 218. As described herein, in other embodiments, the NIC 218 may be configured to directly access the non-contiguously stored descriptors in the shared ring, rather than relying on a separate process to copy those descriptors to the queues of the NIC 218. It should be appreciated that each of the descriptor copy module 362 and the update notification module 364 may be separately embodied as hardware, firmware, software, virtualized hardware, emulated architecture, and/or a combination thereof. For example, the descriptor copy module 362 may be embodied as a hardware component, while the update notification module 364 is embodied as virtualized hardware components or as some other combination of hardware, firmware, software, virtualized hardware, emulated architecture, and/or a combination thereof.
The stage management module 370, which may be embodied as hardware, firmware, software, virtualized hardware, emulated architecture, and/or a combination thereof as discussed above, is configured to assign stages to the cores 230 of the CPU 210, and/or to the NIC 218, and manage their access to the entries in the ring. To do so, the illustrative stage management module includes an input stage management module 372, a worker stage management module 374, and an output stage management module 376. The input stage management module 372, in the illustrative embodiment, is configured to assign one or more cores 230, or the NIC 218, to one or more input stages, and use the assigned component to prime (i.e., fill) available entries in the ring with receive descriptors, receive packets with the communication circuitry 216, such as the NIC 218, add the received packet data to the buffers associated with the receive descriptors for each entry in the ring, and add or update metadata for each entry in the ring indicating that the data is ready to be processed by one or more worker stages. The worker stage management module 374, in the illustrative embodiment, is configured to assign and/or reassign cores 230 to worker stages to identify entries in the ring associated with data packets that are ready to be processed by the worker stages, and use the assigned cores 230 to execute worker functions, such as compression, decompression, encryption, decryption, firewall services, and or other functions on the packet data, and update the metadata to indicate a completion status of each worker stage. The output stage management module 376, in the illustrative embodiment, is configured to assign one or more cores 230, or the NIC 218, to one or more output stages, and use the assigned components to iterate through the slots in the ring to prime (i.e., fill) entries in the ring with transmit descriptors, identify entries having metadata indicating that the associated data packets are ready for transmission, and provide the received processed packet data to the communication circuitry 216 (e.g., the NIC 218) using DMA, for transmission to another device, such as the destination endpoint node 108.
It should be appreciated that each of the input stage management module 372, the worker stage management module 374, and the output stage management module 376 may be separately embodied as hardware, firmware, software, virtualized hardware, emulated architecture, and/or a combination thereof. For example, the input stage management module 372 may be embodied as a hardware component, while the worker stage management module 374 and the output stage management module 376 are embodied as virtualized hardware components or as some other combination of hardware, firmware, software, virtualized hardware, emulated architecture, and/or a combination thereof.
Referring now to
After the stages have been identified, the method 400 advances to block 410 in which the network device 106 allocates hardware resources to the stages. In doing so, the network device 106 may assign one or more cores 230 of the CPU 210 to the stages, as indicated in block 412. By default, the network device 106 assigns cores 230 to the various stages, unless the NIC 218 includes one or more components to facilitate the input and/or output stages, such as the ring access logic 220. In such embodiments, the network device 106 may assign all or a portion of the operations of the input and output stages to the NIC 218, as indicated in block 414. With regard to the worker stages, the network device 106 may allocate multiple cores 230, such as cores 234, 236 to multiple instances of the same worker stage and/or may allocate different cores 230 to different worker stages. As described in more detail herein, when multiple instances of the same stage (e.g., input stage, worker stage, or output stage) have been allocated, the illustrative network device 106 employs methods to prevent two or more instances of the same stage from attempting to operate on the same entry in the ring. In embodiments with multiple different worker stages, some worker stages may be dependent on the results of other worker stages. For example, a data analysis stage may be dependent on completion of a data decompression stage.
Referring now to
Further, in block 426, the network device 106 processes the data packets represented by the entries in the ring with the worker stages. In doing so, the worker stages, which, in the illustrative embodiment, are executed as software processes or threads by one or more of the cores 230, access the packet data that was copied by DMA from the NIC 218 to the memory buffers in the main memory 212, as indicated in block 428. In block 430, the network device 106 marks a completely processed packet as being ready to transmit when the worker stages have finished performing their respective operations on the packet data. In marking packet as being ready to transmit, the network device 106 may modify the metadata associated with the corresponding entry in the ring to indicate that the packet data is ready to transmit, as indicated in block 432.
Additionally, in block 434, the network device 106 outputs the processed packets (i.e., provides the processed packets to the NIC 218) with the one or more output stages. As described in more detail herein, with reference to
Referring now to
In block 618, the network device 106 identifies available receive descriptors that were assigned to the slots in the ring, such as by identifying entries in the ring having metadata that indicates that the memory buffer associated with a descriptor is available to receive packet data. This process may be referred to as polling and may be executed by one or more cores 230 of the CPU 210, as indicated in block 620. Alternatively, as indicated in block 622, this polling process may be executed by the NIC 218, such as in embodiments in which the NIC 218 includes the ring access logic 220.
In block 624, the network device 106 determines whether descriptors are available in the ring. If not, the method 600 loops back to block 618 in which the network device 106 again identifies available receive descriptors in the ring. Otherwise, the method 600 may advance to block 626 of
In block 628, the network device 106 determines whether the NIC 218 has received new packets. In doing so, the NIC 218 may make this determination directly, as indicated in block 630. Alternatively, a core 230 of the CPU 210 executing a software thread may make this determination by polling the NIC 218, as indicated in block 632. In block 634, the network device 106 determines whether new packets have been received. If not, the method 600 loops back to block 628 in which the network device 106 again determines whether the NIC 218 has received new packets. Otherwise, the method 600 advances to block 636, in which the network device 106 copies, using DMA, received packet data from the NIC 218 to the memory buffers associated with the corresponding receive descriptors. By doing so, the packet data is now available in the memory buffers referenced by the entries in the ring and may be accessed by the worker stages for processing. In some embodiments, the network device 106 updates the metadata for these ring entries to indicate that the entries are ready to be processed by the worker stages. In block 638, the network device 106 determines whether it is to use static priming or not. In the illustrative embodiment, static priming means that the network device 106 primes the slots of the ring only once, and then reuses the same descriptors and memory buffers over and over, rather than continually regenerating the descriptors and reallocating new memory buffers for subsequent packets. Whether to use static priming may be based on a configuration setting stored in the memory, a hardware configuration, or other criteria. Regardless, in response to a determination not to use static priming, the method 600 loops back to block 604 of
Referring now to
In block 818, the network device 106 identifies available transmit descriptors that were assigned to the slots in the ring, such as by identifying entries in the ring having metadata that indicates that the packet data is available to be provided to the NIC 218 for transmission. This process may be referred to as polling and may be executed by one or more cores 230 of the CPU 210, as indicated in block 820. Alternatively, as indicated in block 822, this polling process may be executed by the NIC 218, such as in embodiments in which the NIC 218 includes the ring access logic 220.
In block 824, the network device 106 determines whether transmit descriptors are available in the ring. If not, the method 800 loops back to block 818 in which the network device 106 again identifies available transmit descriptors in the ring. Otherwise, the method 800 may advance to block 826 of
In block 828, the network device 106 copies, using DMA, the packet data from the memory buffers associated with the transmit descriptors that are available (i.e., those entries having metadata indicating that the worker stages have completed their processing of the packet data) to the NIC 218 for transmission to another device (i.e., the destination endpoint node 108). In block 830, the network device 106 may poll the NIC 218 for transmission status, to determine when the transmission has been completed.
In block 832, the network device 106 determines whether it is to use static priming. This determination is similar to the determination made in block 632 of
Referring now to
Referring now to
Referring now to
Referring now to
Illustrative examples of the technologies disclosed herein are provided below. An embodiment of the technologies may include any one or more, and any combination of, the examples described below.
Example 1 includes a network device to process packets, the network device comprising one or more processors that include a plurality of cores; a network interface controller (NIC) coupled to the one or more processors; and one or more memory devices having stored therein a plurality of instructions that, when executed by the one or more processors, cause the network device to establish a ring in a memory of the one or more memory devices, wherein the ring is defined as a circular buffer and includes a plurality of slots to store entries representative of packets; generate and assign receive descriptors to the slots in the ring, wherein each receive descriptor includes a pointer to a corresponding memory buffer to store packet data; determine whether the NIC has received one or more packets; and copy, with direct memory access (DMA) and in response to a determination that the NIC has received one or more packets, packet data of the received one or more packets from the NIC to the memory buffers associated with the receive descriptors assigned to the slots in the ring.
Example 2 includes the subject matter of Example 1, and wherein to generate and assign the receive descriptors to the slots in the ring comprises to generate and assign the receive descriptors with one or more of the cores.
Example 3 includes the subject matter of any of Examples 1 and 2, and wherein to generate and assign the receive descriptors to the slots in the ring comprises to generate and assign the receive descriptors with one or more hardware components of the NIC.
Example 4 includes the subject matter of any of Examples 1-3, and wherein to generate and assign the receive descriptors to the slots in the ring comprises to generate and assign the receive descriptors using multiple instances of an input stage executed as separate threads.
Example 5 includes the subject matter of any of Examples 1-4, and wherein the plurality of instructions, when executed by the one or more processors, further cause the network device to coordinate access of the multiple instances of the input stage to the slots with a modulo function.
Example 6 includes the subject matter of any of Examples 1-5, and wherein the plurality of instructions, when executed by the one or more processors, further cause the network device to identify available receive descriptors in the ring before the packet data is copied from the NIC, and wherein to copy the packet data from the NIC comprises to copy the packet data from the NIC to the memory buffers associated with the identified available receive descriptors.
Example 7 includes the subject matter of any of Examples 1-6, and wherein to identify the available receive descriptors comprises to identify the available receive descriptors with one or more of the cores.
Example 8 includes the subject matter of any of Examples 1-7, and wherein to identify the available receive descriptors comprises to identify the available receive descriptors with one or more hardware components of the NIC.
Example 9 includes the subject matter of any of Examples 1-8, and wherein to identify the available receive descriptors comprises to sequentially iterate through each slot in the ring and analyze metadata stored in association with each slot for an indication that one or more of the receive descriptors is available.
Example 10 includes the subject matter of any of Examples 1-9, and wherein the plurality of instructions, when executed by the one or more processors, further cause the network device to copy the receive descriptors from the ring to a NIC receive queue before the determination of whether the NIC has received one or more packets.
Example 11 includes the subject matter of any of Examples 1-10, and wherein to determine whether the NIC has received one or more packets comprises to poll the NIC with one or more of the cores.
Example 12 includes the subject matter of any of Examples 1-11, and wherein the plurality of instructions, when executed by the one or more processors, further cause the network device to generate and assign transmit descriptors to the slots in the ring, wherein each transmit descriptor includes a pointer to a corresponding memory buffer where packet data to be transmitted is stored; identify transmit descriptors for slots of the ring associated with packet data that has been marked as ready to transmit; copy, with DMA, packet data from the memory buffers associated with the identified transmit descriptors to the NIC for transmission.
Example 13 includes the subject matter of any of Examples 1-12, and wherein to generate and assign the transmit descriptors to the slots in the ring comprises to generate and assign the transmit descriptors with one or more of the cores.
Example 14 includes the subject matter of any of Examples 1-13, and wherein to generate and assign the transmit descriptors to the slots in the ring comprises to generate and assign the transmit descriptors with one or more hardware components of the NIC.
Example 15 includes the subject matter of any of Examples 1-14, and wherein the plurality of instructions, when executed by the one or more processors, further cause the network device to process the packet data with one or more worker stages; and modify metadata associated with the slots that are associated with the packet data to indicate that the packet data is ready to be transmitted, before the packet data is copied to the NIC for transmission.
Example 16 includes the subject matter of any of Examples 1-15, and wherein the plurality of instructions, when executed by the one or more processors, further cause the network device to copy the identified transmit descriptors to a NIC transmit queue before the packet data is copied from the memory buffers to the NIC.
Example 17 includes a method for processing packets, comprising establishing, by a network device, a ring in a memory of the network device, wherein the ring is defined as a circular buffer and includes a plurality of slots to store entries representative of packets; generating and assigning, by the network device, receive descriptors to the slots in the ring, wherein each receive descriptor includes a pointer to a corresponding memory buffer to store packet data; determining, by the network device, whether a network interface controller (NIC) of the network device has received one or more packets; and copying, with direct memory access (DMA) and in response to a determination that the NIC has received one or more packets, packet data of the received one or more packets from the NIC to the memory buffers associated with the receive descriptors assigned to the slots in the ring.
Example 18 includes the subject matter of Example 17, and wherein generating and assigning the receive descriptors to the slots in the ring comprises generating and assigning the receive descriptors with one or more cores of a processor of the network device.
Example 19 includes the subject matter of any of Examples 17 and 18, and wherein generating and assigning the receive descriptors to the slots in the ring comprises generating and assigning the receive descriptors with one or more hardware components of the NIC.
Example 20 includes the subject matter of any of Examples 17-19, and wherein generating and assigning the receive descriptors to the slots in the ring comprises generating and assigning the receive descriptors using multiple instances of an input stage executed as separate threads.
Example 21 includes the subject matter of any of Examples 17-20, and furthering including coordinating, by the network device, access of the multiple instances of the input stage to the slots with a modulo function.
Example 22 includes the subject matter of any of Examples 17-21, and furthering including identifying, by the network device, available receive descriptors in the ring before the packet data is copied from the NIC, and wherein copying the packet data from the NIC comprises copying the packet data from the NIC to the memory buffers associated with the identified available receive descriptors.
Example 23 includes the subject matter of any of Examples 17-22, and wherein identifying the available receive descriptors comprises identifying the available receive descriptors with one or more cores of a processor of the network device.
Example 24 includes the subject matter of any of Examples 17-23, and wherein identifying the available receive descriptors comprises identify the available receive descriptors with one or more hardware components of the NIC.
Example 25 includes the subject matter of any of Examples 17-24, and wherein identifying the available receive descriptors comprises sequentially iterating through each slot in the ring; and analyzing metadata stored in association with each slot for an indication that one or more of the receive descriptors is available.
Example 26 includes the subject matter of any of Examples 17-25, and furthering including copying, by the network device, the receive descriptors from the ring to a NIC receive queue before the determination of whether the NIC has received one or more packets.
Example 27 includes the subject matter of any of Examples 17-26, and wherein determining whether the NIC has received one or more packets comprises polling the NIC with one or more cores of a processor of the network device.
Example 28 includes the subject matter of any of Examples 17-27, and furthering including generating and assigning, by the network device, transmit descriptors to the slots in the ring, wherein each transmit descriptor includes a pointer to a corresponding memory buffer where packet data to be transmitted is stored; identifying, by the network device, transmit descriptors for slots of the ring associated with packet data that has been marked as ready to transmit; and copying, with DMA, packet data from the memory buffers associated with the identified transmit descriptors to the NIC for transmission.
Example 29 includes the subject matter of any of Examples 17-28, and wherein generating and assigning the transmit descriptors to the slots in the ring comprises generating and assigning the transmit descriptors with one or more cores of a processor of the network device.
Example 30 includes the subject matter of any of Examples 17-29, and wherein generating and assigning the transmit descriptors to the slots in the ring comprises generating and assigning the transmit descriptors with one or more hardware components of the NIC.
Example 31 includes the subject matter of any of Examples 17-30, and furthering including processing, by the network device, the packet data with one or more worker stages; and modifying, by the network device, metadata associated with the slots that are associated with the packet data to indicate that the packet data is ready to be transmitted, before the packet data is copied to the NIC for transmission.
Example 32 includes the subject matter of any of Examples 17-31, and furthering including copying, by the network device, the identified transmit descriptors to a NIC transmit queue before the packet data is copied from the memory buffers to the NIC.
Example 33 includes a network device comprising one or more processors; and a memory having stored therein a plurality of instructions that when executed by the one or more processors cause the network device to perform the method of any of Examples 17-32.
Example 34 includes one or more machine-readable storage media comprising a plurality of instructions stored thereon that in response to being executed result in a network device performing the method of any of Examples 17-32.
Example 35 includes a network device to process packets, the network device comprising one or more processors that include a plurality of cores; one or more memory devices coupled to the one or more processors; a network interface controller (NIC) coupled to the one or more processors; ring management circuitry to (i) establish a ring in a memory of the one or more memory devices, wherein the ring is defined as a circular buffer and includes a plurality of slots to store entries representative of packets, and (ii) generate and assign receive descriptors to the slots in the ring, wherein each receive descriptor includes a pointer to a corresponding memory buffer to store packet data; network communication circuitry to determine whether the NIC has received one or more packets; and direct memory access (DMA) circuitry to copy, with DMA and in response to a determination that the NIC has received one or more packets, packet data of the received one or more packets from the NIC to the memory buffers associated with the receive descriptors assigned to the slots in the ring.
Example 36 includes the subject matter of Example 35, and wherein to generate and assign the receive descriptors to the slots in the ring comprises to generate and assign the receive descriptors with one or more of the cores.
Example 37 includes the subject matter of any of Examples 35 and 36, and wherein to generate and assign the receive descriptors to the slots in the ring comprises to generate and assign the receive descriptors with one or more hardware components of the NIC.
Example 38 includes the subject matter of any of Examples 35-37, and wherein to generate and assign the receive descriptors to the slots in the ring comprises to generate and assign the receive descriptors using multiple instances of an input stage executed as separate threads.
Example 39 includes the subject matter of any of Examples 35-38, and wherein the ring management circuitry is further to coordinate access of the multiple instances of the input stage to the slots with a modulo function.
Example 40 includes the subject matter of any of Examples 35-39, and wherein the ring management circuitry is further to identify available receive descriptors in the ring before the packet data is copied from the NIC, and wherein to copy the packet data from the NIC comprises to copy the packet data from the NIC to the memory buffers associated with the identified available receive descriptors.
Example 41 includes the subject matter of any of Examples 35-40, and wherein to identify the available receive descriptors comprises to identify the available receive descriptors with one or more of the cores.
Example 42 includes the subject matter of any of Examples 35-41, and wherein to identify the available receive descriptors comprises to identify the available receive descriptors with one or more hardware components of the NIC.
Example 43 includes the subject matter of any of Examples 35-42, and wherein to identify the available receive descriptors comprises to sequentially iterate through each slot in the ring and analyze metadata stored in association with each slot for an indication that one or more of the receive descriptors is available.
Example 44 includes the subject matter of any of Examples 35-43, and wherein the ring management circuitry is further to copy the receive descriptors from the ring to a NIC receive queue before the determination of whether the NIC has received one or more packets.
Example 45 includes the subject matter of any of Examples 35-44, and wherein to determine whether the NIC has received one or more packets comprises to poll the NIC with one or more of the cores.
Example 46 includes the subject matter of any of Examples 35-45, and wherein the ring management circuitry is further to generate and assign transmit descriptors to the slots in the ring, wherein each transmit descriptor includes a pointer to a corresponding memory buffer where packet data to be transmitted is stored, and identify transmit descriptors for slots of the ring associated with packet data that has been marked as ready to transmit; and the DMA circuitry is further to copy, with DMA, packet data from the memory buffers associated with the identified transmit descriptors to the NIC for transmission.
Example 47 includes the subject matter of any of Examples 35-46, and wherein to generate and assign the transmit descriptors to the slots in the ring comprises to generate and assign the transmit descriptors with one or more of the cores.
Example 48 includes the subject matter of any of Examples 35-47, and wherein to generate and assign the transmit descriptors to the slots in the ring comprises to generate and assign the transmit descriptors with one or more hardware components of the NIC.
Example 49 includes the subject matter of any of Examples 35-48, and wherein the ring management circuitry is further to process the packet data with one or more worker stages; and modify metadata associated with the slots that are associated with the packet data to indicate that the packet data is ready to be transmitted, before the packet data is copied to the NIC for transmission.
Example 50 includes the subject matter of any of Examples 35-497, and wherein the ring management circuitry is further to copy the identified transmit descriptors to a NIC transmit queue before the packet data is copied from the memory buffers to the NIC.
Example 51 includes a network device to process packets, the network device comprising means for establishing a ring in a memory of the network device, wherein the ring is defined as a circular buffer and includes a plurality of slots to store entries representative of packets; means for generating and assigning receive descriptors to the slots in the ring, wherein each receive descriptor includes a pointer to a corresponding memory buffer to store packet data; network communication circuitry for determining whether a network interface controller (NIC) of the network device has received one or more packets; and direct memory access (DMA) circuitry for copying, with DMA and in response to a determination that the NIC has received one or more packets, packet data of the received one or more packets from the NIC to the memory buffers associated with the receive descriptors assigned to the slots in the ring.
Example 52 includes the subject matter of Example 51, and wherein the means for generating and assigning the receive descriptors to the slots in the ring comprises means for generating and assigning the receive descriptors with one or more cores of a processor of the network device.
Example 53 includes the subject matter of any of Examples 51 and 52, and wherein the means for generating and assigning the receive descriptors to the slots in the ring comprises means for generating and assigning the receive descriptors with one or more hardware components of the NIC.
Example 54 includes the subject matter of any of Examples 51-53, and wherein the means for generating and assigning the receive descriptors to the slots in the ring comprises means for generating and assigning the receive descriptors using multiple instances of an input stage executed as separate threads.
Example 55 includes the subject matter of any of Examples 51-54, and furthering including means for coordinating access of the multiple instances of the input stage to the slots with a modulo function.
Example 56 includes the subject matter of any of Examples 51-55, and furthering including means for identifying available receive descriptors in the ring before the packet data is copied from the NIC, and wherein the means for copying the packet data from the NIC comprises means for copying the packet data from the NIC to the memory buffers associated with the identified available receive descriptors.
Example 57 includes the subject matter of any of Examples 51-56, and wherein the means for identifying the available receive descriptors comprises means for identifying the available receive descriptors with one or more cores of a processor of the network device.
Example 58 includes the subject matter of any of Examples 51-57, and wherein the means for identifying the available receive descriptors comprises means for identifying the available receive descriptors with one or more hardware components of the NIC.
Example 59 includes the subject matter of any of Examples 51-58 and wherein the means for identifying the available receive descriptors comprises means for sequentially iterating through each slot in the ring; and means for analyzing metadata stored in association with each slot for an indication that one or more of the receive descriptors is available.
Example 60 includes the subject matter of any of Examples 51-59, and furthering including means for copying the receive descriptors from the ring to a NIC receive queue before the determination of whether the NIC has received one or more packets.
Example 61 includes the subject matter of any of Examples 51-60, and wherein the network communication circuitry for determining whether the NIC has received one or more packets comprises circuitry for polling the NIC with one or more cores of a processor of the network device.
Example 62 includes the subject matter of any of Examples 51-61, and furthering including means for generating and assigning transmit descriptors to the slots in the ring, wherein each transmit descriptor includes a pointer to a corresponding memory buffer where packet data to be transmitted is stored; means for identifying transmit descriptors for slots of the ring associated with packet data that has been marked as ready to transmit; and the DMA circuitry comprises circuitry for copying, with DMA, packet data from the memory buffers associated with the identified transmit descriptors to the NIC for transmission.
Example 63 includes the subject matter of any of Examples 51-62, and wherein the means for generating and assigning the transmit descriptors to the slots in the ring comprises means for generating and assigning the transmit descriptors with one or more cores of a processor of the network device.
Example 64 includes the subject matter of any of Examples 51-63, and wherein the means for generating and assigning the transmit descriptors to the slots in the ring comprises means for generating and assigning the transmit descriptors with one or more hardware components of the NIC.
Example 65 includes the subject matter of any of Examples 51-64, and furthering including means for processing the packet data with one or more worker stages; and means for modifying metadata associated with the slots that are associated with the packet data to indicate that the packet data is ready to be transmitted, before the packet data is copied to the NIC for transmission.
Example 66 includes the subject matter of any of Examples 51-65, and furthering including means for copying the identified transmit descriptors to a NIC transmit queue before the packet data is copied from the memory buffers to the NIC.
Claims
1. A network device to process packets, the network device comprising:
- one or more processors that include a plurality of cores;
- a network interface controller (NIC) coupled to the one or more processors; and
- one or more memory devices having stored therein a plurality of instructions that, when executed by the one or more processors, cause the network device to: establish a ring in a memory of the one or more memory devices, wherein the ring is defined as a circular buffer and includes a plurality of slots to store entries representative of packets; generate and assign receive descriptors to the slots in the ring, wherein each receive descriptor includes a pointer to a corresponding memory buffer to store packet data; determine whether the NIC has received one or more packets; and copy, with direct memory access (DMA) and in response to a determination that the NIC has received one or more packets, packet data of the received one or more packets from the NIC to the memory buffers associated with the receive descriptors assigned to the slots in the ring.
2. The network device of claim 1, wherein to generate and assign the receive descriptors to the slots in the ring comprises to generate and assign the receive descriptors with one or more of the cores.
3. The network device of claim 1, wherein to generate and assign the receive descriptors to the slots in the ring comprises to generate and assign the receive descriptors with one or more hardware components of the NIC.
4. The network device of claim 1, wherein to generate and assign the receive descriptors to the slots in the ring comprises to generate and assign the receive descriptors using multiple instances of an input stage executed as separate threads.
5. The network device of claim 4, wherein the plurality of instructions, when executed by the one or more processors, further cause the network device to coordinate access of the multiple instances of the input stage to the slots with a modulo function.
6. The network device of claim 1, wherein the plurality of instructions, when executed by the one or more processors, further cause the network device to identify available receive descriptors in the ring before the packet data is copied from the NIC, and
- wherein to copy the packet data from the NIC comprises to copy the packet data from the NIC to the memory buffers associated with the identified available receive descriptors.
7. The network device of claim 6, wherein to identify the available receive descriptors comprises to identify the available receive descriptors with one or more of the cores.
8. The network device of claim 6, wherein to identify the available receive descriptors comprises to identify the available receive descriptors with one or more hardware components of the NIC.
9. The network device of claim 6, wherein to identify the available receive descriptors comprises to sequentially iterate through each slot in the ring and analyze metadata stored in association with each slot for an indication that one or more of the receive descriptors is available.
10. The network device of claim 1, wherein the plurality of instructions, when executed by the one or more processors, further cause the network device to copy the receive descriptors from the ring to a NIC receive queue before the determination of whether the NIC has received one or more packets.
11. The network device of claim 1, wherein to determine whether the NIC has received one or more packets comprises to poll the NIC with one or more of the cores.
12. The network device of claim 1, wherein the plurality of instructions, when executed by the one or more processors, further cause the network device to:
- generate and assign transmit descriptors to the slots in the ring, wherein each transmit descriptor includes a pointer to a corresponding memory buffer where packet data to be transmitted is stored;
- identify transmit descriptors for slots of the ring associated with packet data that has been marked as ready to transmit;
- copy, with DMA, packet data from the memory buffers associated with the identified transmit descriptors to the NIC for transmission.
13. One or more machine-readable storage media comprising a plurality of instructions stored thereon that in response to being executed, cause a network device to:
- establish a ring in a memory of the network device, wherein the ring is defined as a circular buffer and includes a plurality of slots to store entries representative of packets;
- generate and assign receive descriptors to the slots in the ring, wherein each receive descriptor includes a pointer to a corresponding memory buffer to store packet data;
- determine whether a network interface controller (NIC) of the network device has received one or more packets; and
- copy, with direct memory access (DMA) and in response to a determination that the NIC has received one or more packets, packet data of the received one or more packets from the NIC to the memory buffers associated with the receive descriptors assigned to the slots in the ring.
14. The one or more machine-readable storage media of claim 13, wherein to generate and assign the receive descriptors to the slots in the ring comprises to generate and assign the receive descriptors with one or more cores of a processor of the network device.
15. The one or more machine-readable storage media of claim 13, wherein to generate and assign the receive descriptors to the slots in the ring comprises to generate and assign the receive descriptors with one or more hardware components of the NIC.
16. The one or more machine-readable storage media of claim 13, wherein to generate and assign the receive descriptors to the slots in the ring comprises to generate and assign the receive descriptors using multiple instances of an input stage executed as separate threads.
17. The one or more machine-readable storage media of claim 16, wherein the plurality of instructions further cause the network device to coordinate access of the multiple instances of the input stage to the slots with a modulo function.
18. The one or more machine-readable storage media of claim 13, wherein the plurality of instructions further cause the network device to identify available receive descriptors in the ring before the packet data is copied from the NIC, and
- wherein to copy the packet data from the NIC comprises to copy the packet data from the NIC to the memory buffers associated with the identified available receive descriptors.
19. The one or more machine-readable storage media of claim 18, wherein to identify the available receive descriptors comprises to identify the available receive descriptors with one or more cores of a processor of the network device.
20. The one or more machine-readable storage media of claim 18, wherein to identify the available receive descriptors comprises to identify the available receive descriptors with one or more hardware components of the NIC.
Type: Application
Filed: Jul 2, 2019
Publication Date: Oct 24, 2019
Inventors: John J. Browne (Limerick), Tomasz Kantecki (Ennis), Chris MacNamara (Limerick), Pierre Laurent (Quin), Sean Harte (Limerick)
Application Number: 16/460,424