This disclosure relates generally to the field of the inspection and processing of data received over a communication channel, and in particular to a packet handler including a plurality of parallel action machines for use in a packet processing system.
A computing system includes a central processing unit (CPU) that performs execution of instructions and processing of data. A lexicon of machine commands understood by the CPU are referred to as an instruction set of the CPU. A CPU instruction set may include a list of basic computing operations, referred to as opcodes. Some example opcodes include set, load, add, multiply, jump, and branch-on-condition. A unit of data that is processed by the CPU is referred to as an operand. During CPU processing, one or more operands are associated with an opcode to specify the data on which the opcode operation is to be performed to form an instruction.
The time required to execute an instruction by the CPU is an important metric for assessment of performance of the CPU. CPU execution time is a measure of a number of seconds that a CPU takes to perform a task or a program, the program being made up of a plurality of instructions. CPU execution time may be expressed in terms of instruction count (IC), i.e. the number of instructions included in the task or program; an average number of clock cycles required per instruction (CPI); and the clock rate (F) of the CPU. Therefore, CPU execution time is equal to: (IC×CPI)/F, and may be reduced by reducing the CPI or increasing the F. The CPI of a computing system CPU may be reduced by increasing instruction level parallelism of the computing system. To increase parallelism, some packet processing tasks may be shifted from the CPU to a received packet processing system of the computing system.
In one aspect, a packet handler for a packet processing system includes a plurality of parallel action machines, each of the plurality of parallel action machines being configured to perform a respective packet processing function; and a plurality of action machine input registers, wherein each of the plurality of parallel action machines is associated with one or more of the plurality of action machine input registers, and wherein an action machine of the plurality of parallel action machines is automatically triggered to perform its respective packet processing function in the event that data sufficient to perform the actions machine's respective packet processing function is written into the action machine's one or more respective action machine input registers.
In another aspect, a method of operating a packet handler of a packet processing system, the packet handler comprising a plurality of parallel action machines, each of the plurality of parallel action machines being configured to perform a respective packet processing function includes causing data to be written into one or more action machine input registers corresponding to an action machine of the plurality of parallel action machines; and in the event the one or more action machine input registers contains data sufficient to perform their corresponding actions machine's respective packet processing function, automatically triggering the corresponding action machine to perform its respective packet processing function using the data in the one or more action machine input registers corresponding to the action machine.
Additional features are realized through the techniques of the present exemplary embodiment. Other embodiments are described in detail herein and are considered a part of what is claimed. For a better understanding of the features of the exemplary embodiment, refer to the description and to the drawings.
Referring now to the drawings wherein like elements are numbered alike in the several FIGURES:
Embodiments of a packet handler including a plurality of parallel action machines are provided, with exemplary embodiments being discussed below in detail. A packet handler in a received packet processing system may process data received by the computing system at data line rates through use of a plurality of parallel action machines. The parallel action machines are independent execution units, each assigned to a particular packet processing function, so as to reduce the complexity of the individual action machines. An action machine is automatically triggered by receipt of data sufficient to perform the action machine's particular packet processing function. The packet handler may be controlled by instructions, wherein instruction opcodes are issued from a packet parser of the packet processing system, and instruction operands are received from a data path of the packet processing system. Instruction opcodes control the writing of instruction operands to the action machines, with the number of instruction opcodes being less-than-or-equal to the number of instruction operands. Because the number of instruction opcodes is tied to the number of instruction operands and not to the number of action machines, the size of the instruction vector used to control the packet handler remains relatively small when the number of action machines increases.
AMs 203a-n are shown for illustrative purposes only; a PH 200 may include any desired number of AMs, and the AMs may be assigned to any appropriate packet processing functions. Multiple AMs may be assigned to the same packet processing function in some embodiments. Each AM of AMs 203a-n performs its respective packet processing function in parallel with the other AMs. Each AM function may require a single clock cycle to execute in some embodiments. Example functions that may be performed by an individual AM include but are not limited to classification, filtering, such as VLAN or MAC address filtering, hashing, discarding and checksum verification, such as TCP or IP checksum verification. Each AM of AMs 203a-n may implement microcode and/or hard-wired function required for implementing its particular function in various embodiments. AMs 203a-n may be reset into a clean starting state whenever a new packet processing task is required by PP 102; all the AMs 203a-n may be reset whenever the PP 102 detects an end-of-packet in some embodiments, such that AMs 203a-n are ready to start processing the next packet as soon as a start-of-packet is detected by PP 102.
In a single clock cycle, a single operand input may write into multiple AM input registers, and/or a single AM input register may receive operands from multiple operand inputs, as required by the opcodes in opcode input registers 303A-C. The presence of data sufficient to perform an AM's packet processing function in its respective AM input register automatically triggers the AM to perform its packet processing function using the data in its respective AM input register. The size of an AM's respective AM input register may vary depending upon the packet processing function performed by the AM. For example, an Ethernet MAC address filter AM requires an input register of 48 bits to hold an entire MAC address. The size of an AM input register also depends upon the size of the atomic parsing element used by the PP 102, as the size of the operands are matched with the size of the atomic parsing element. For example, since protocols carried over a network are typically byte-oriented, an Ethernet protocol packet processing system might operate with an atomic parsing element of 8 bits (a byte), which would translate into 6 target registers (48/8) being instantiated in a MAC filter AM input register. A single opcode may trigger a single AM or multiple AMs, based on unicast (UC) and multicast (MC) encoding of the opcodes, as is explained below.
Operand inputs 302A-D may provide operands in a data-flow manner from DP 101, PP 102, packet result provider 204, or any other appropriate component of the computing system in which packet processing system 100 is located. Operand inputs 302A-D and opcode input registers 303A-C are shown for illustrative purposes only; an AM filler may include any appropriate number of operand inputs (which may be connected to any appropriate data source within the computing system), and any appropriate number of opcode input registers. The number of operand inputs and the number of opcode inputs in an AM filler 300 is may be less than or equal to the total number of AMs 203a-n in the PH 103. The size of an operand received on an operand input may be selected to correspond to the size of an atomic parsing element (e.g. digit, byte, word) that best suits the processing requirements of the packet processing system 100 in which PH 102 is located. The number of opcode input registers 303A-C determines the number of opcodes that may be included in an instruction bundle from PP 102.
Opcode decoder 308 comprises logic (i.e., logic row 402) to match the opcodes in opcode input registers 303A-C and AM input registers 401AW-Z comprise logic enabling writing from operand inputs 302A-D based on the matched opcodes. A box with a ‘O’ (such as boxes 403 and 405) corresponds to a logical “OR” function, and a box with a ‘A’ (such as box 404) corresponds to a logical “AND” function. An opcode in any of opcode input registers 303A-C may be a unicast (UC) opcode or a multicast (MC) opcode. A UC opcode is used to write a single operand into a single AM input register. For example, if the opcode in opcode input 303A equals a unicast decode value corresponding to AM input register 401W (i.e., UDW), then the operand carried over operand input 302A is written into AM input register 401W. Similarly, if the opcode in opcode input 303B also equals the unicast value corresponding to AM input register 401W (UDW), then the operand carried over operand input 302B is also written into AM input register 401W. A MC opcode is used to write an operand into multiple AM input registers. For example, if the opcode in opcode input 303A is a multicast decode value MDA, then the operand carried over operand input 302A is written into four AM input registers i.e., AM input registers 401W-Z. An MC opcode may be used to write multiple operands into multiple different input registers. For example, the multicast opcode MDB in opcode input 303B causes the operand carried over operand input 302B to written into AM input registers 401W and 401X, and operand carried over operand input 302C to be written into AM input registers 401Y and 401Z. An MC opcode, such as MDC, may also decode multiple multicast opcodes values. For example, if the opcode in opcode input 303C equals the first multicast decode value of MDC, then the operand carried over operand input 302D gets written into AM input registers 401W and 401X, while if opcode in opcode input 303C equals the second multicast decode value of MDC, then operand carried over operand input 302D is only written into AM input register 401Y. A code compiler may be implemented to avoid a conflict situation in which two opcodes attempt to write to the same AM input register in the same cycle.
Method 500 of
The computer 600 includes, but is not limited to, PCs, workstations, laptops, PDAs, palm devices, servers, storages, and the like. Generally, in terms of hardware architecture, the computer 600 may include one or more processors 610, memory 620, and one or more I/O devices 670 that are communicatively coupled via a local interface (not shown). The local interface can be, for example but not limited to, one or more buses or other wired or wireless connections, as is known in the art. The local interface may have additional elements, such as controllers, buffers (caches), drivers, repeaters, and receivers, to enable communications. Further, the local interface may include address, control, and/or data connections to enable appropriate communications among the aforementioned components.
The processor 610 is a hardware device for executing software that can be stored in the memory 620. The processor 610 can be virtually any custom made or commercially available processor, a central processing unit (CPU), a digital signal processor (DSP), or an auxiliary processor among several processors associated with the computer 600, and the processor 610 may be a semiconductor based microprocessor (in the form of a microchip) or a macroprocessor.
The memory 620 can include any one or combination of volatile memory elements (e.g., random access memory (RAM), such as dynamic random access memory (DRAM), static random access memory (SRAM), etc.) and nonvolatile memory elements (e.g., ROM, erasable programmable read only memory (EPROM), electronically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), tape, compact disc read only memory (CD-ROM), disk, diskette, cartridge, cassette or the like, etc.). Moreover, the memory 620 may incorporate electronic, magnetic, optical, and/or other types of storage media. Note that the memory 620 can have a distributed architecture, where various components are situated remote from one another, but can be accessed by the processor 610.
The software in the memory 620 may include one or more separate programs, each of which comprises an ordered listing of executable instructions for implementing logical functions. The software in the memory 620 includes a suitable operating system (O/S) 650, compiler 640, source code 630, and one or more applications 660 in accordance with exemplary embodiments. As illustrated, the application 660 comprises numerous functional components for implementing the features and operations of the exemplary embodiments. The application 660 of the computer 600 may represent various applications, computational units, logic, functional units, processes, operations, virtual entities, and/or modules in accordance with exemplary embodiments, but the application 660 is not meant to be a limitation.
The operating system 650 controls the execution of other computer programs, and provides scheduling, input-output control, file and data management, memory management, and communication control and related services. It is contemplated by the inventors that the application 660 for implementing exemplary embodiments may be applicable on all commercially available operating systems.
Application 660 may be a source program, executable program (object code), script, or any other entity comprising a set of instructions to be performed. When a source program, then the program is usually translated via a compiler (such as the compiler 640), assembler, interpreter, or the like, which may or may not be included within the memory 620, so as to operate properly in connection with the O/S 650. Furthermore, the application 660 can be written as an object oriented programming language, which has classes of data and methods, or a procedure programming language, which has routines, subroutines, and/or functions, for example but not limited to, C, C++, C#, Pascal, BASIC, API calls, HTML, XHTML, XML, ASP scripts, FORTRAN, COBOL, Perl, Java, ADA, .NET, and the like.
The I/O devices 670 may include input devices such as, for example but not limited to, a mouse, keyboard, scanner, microphone, camera, etc. Furthermore, the I/O devices 670 may also include output devices, for example but not limited to a printer, display, etc. Finally, the I/O devices 670 may further include devices that communicate both inputs and outputs, for instance but not limited to, a NIC or modulator/demodulator (for accessing remote devices, other files, devices, systems, or a network), a radio frequency (RF) or other transceiver, a telephonic interface, a bridge, a router, etc. The I/O devices 670 also include components for communicating over various networks, such as the Internet or intranet.
If the computer 600 is a PC, workstation, intelligent device or the like, the software in the memory 620 may further include a basic input output system (BIOS) (omitted for simplicity). The BIOS is a set of essential software routines that initialize and test hardware at startup, start the O/S 650, and support the transfer of data among the hardware devices. The BIOS is stored in some type of read-only-memory, such as ROM, PROM, EPROM, EEPROM or the like, so that the BIOS can be executed when the computer 600 is activated.
When the computer 600 is in operation, the processor 610 is configured to execute software stored within the memory 620, to communicate data to and from the memory 620, and to generally control operations of the computer 600 pursuant to the software. The application 660 and the O/S 650 are read, in whole or in part, by the processor 610, perhaps buffered within the processor 610, and then executed.
When the application 660 is implemented in software it should be noted that the application 660 can be stored on virtually any computer readable medium for use by or in connection with any computer related system or method. In the context of this document, a computer readable medium may be an electronic, magnetic, optical, or other physical device or means that can contain or store a computer program for use by or in connection with a computer related system or method.
The application 660 can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. In the context of this document, a “computer-readable medium” can be any means that can store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer readable medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium.
More specific examples (a nonexhaustive list) of the computer-readable medium may include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic or optical), a random access memory (RAM) (electronic), a read-only memory (ROM) (electronic), an erasable programmable read-only memory (EPROM, EEPROM, or Flash memory) (electronic), an optical fiber (optical), and a portable compact disc memory (CDROM, CD R/W) (optical). Note that the computer-readable medium could even be paper or another suitable medium, upon which the program is printed or punched, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
In exemplary embodiments, where the application 660 is implemented in hardware, the application 660 can be implemented with any one or a combination of the following technologies, which are well known in the art: a discrete logic circuit(s) having logic gates for implementing logic functions upon data signals, an application specific integrated circuit (ASIC) having appropriate combinational logic gates, a programmable gate array(s) (PGA), a field programmable gate array (FPGA), etc.
The technical effects and benefits of exemplary embodiments include relatively fast operation of a packet handler in a packet processing system, with relatively a short format for instructions passed between the packet parser and the packet handler.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms “a”, “an”, and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
The corresponding structures, materials, acts, and equivalents of all means or step plus function elements in the claims below are intended to include any structure, material, or act for performing the function in combination with other claimed elements as specifically claimed. The description of the present invention has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the invention. The embodiment was chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.