Programmable message parsing method, pipeline device and equipment

The programmable message parsing method through multi-channel header clipping and shared parsing pipeline solves the problems of large circuit area, high instruction space and extended processing time in the existing technology, and achieves efficient message processing and flexible protocol adaptability. , suitable for high-speed network environments.

CN117424948BActive Publication Date: 2024-10-18YUSUR TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311433208.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-31
Publication Date
2024-10-18
Estimated Expiration
2043-10-31

AI Technical Summary

Technical Problem

When processing multiple message streams, the existing message parsing pipeline architecture results in large circuit area occupation, high instruction space occupation and long processing delay. It is difficult for traditional methods to flexibly adapt to different protocols and message structures.

Method used

It adopts a programmable message parsing method, realizes parallel processing and hierarchical protocol parsing through multi-channel header clipping and shared parsing pipeline, reduces circuit area and instruction space occupation, and improves processing efficiency.

Benefits of technology

It achieves message processing capabilities that far exceed line speed, reduces processing delays, is suitable for high-speed network environments, meets real-time requirements, and saves circuit area and instruction space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117424948B_ABST
    Figure CN117424948B_ABST
Patent Text Reader

Abstract

The present application provides a programmable message parsing method, pipeline device and equipment, the method comprising: based on multiple channels, respectively performing header clipping on each message in a multi-channel message stream, obtaining and caching the clipped target message corresponding to each channel; respectively inputting the target message of each channel into a programmable message parsing pipeline module shared by each channel, so as to perform preset programmable message parsing actions on the layered protocol of the target message in parallel, and obtaining the layered protocol parsing result data corresponding to the target message of each channel; and caching and outputting each layered protocol parsing result data according to the channel to which it belongs. The present application releases the parsing pipeline performance through header clipping, achieving a processing capability far exceeding the line speed, and through the programmable message parsing pipeline module, it can effectively reduce the circuit area and instruction space occupation, and can effectively improve the efficiency of message parsing and the performance of the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of message parsing, and in particular to a programmable message parsing method, a pipeline device and equipment. Background Art

[0002] Message parsing plays an important role in modern network communications. It is responsible for parsing received data messages according to the protocol format and extracting key information for processing. The performance of message parsing is crucial to the efficiency and speed of network communications. However, with the rapid development of network communications, traditional message parsing methods face some challenges. First, each message stream requires line-speed processing capabilities, but as the complexity of the network increases, multiple message streams need to be processed in the system. The traditional method creates a separate parsing pipeline for each message stream, resulting in a huge demand for circuit area. Secondly, different protocol formats and message structures are diverse, and traditional hardware designs are difficult to flexibly adapt to different protocol and message requirements. In addition, storage and parsing during message processing are often performed serially, resulting in high processing latency for the overall system.

[0003] At present, the existing message parsing solutions adopt a pipeline architecture, with one message parsing pipeline for each data channel, see Figure 1 The complete message enters the message parsing pipeline, supporting line-speed processing. In addition, in the entire message processing process, after the message is parsed, it is divided into storage and post-processing. Figure 2 .

[0004] However, in the existing pipeline architecture for message parsing, the message enters the message parsing pipeline as a whole, resulting in the data part that does not need to be parsed also occupying the number of cycles of the parsing pipeline, which will waste the performance of the parsing pipeline and affect the efficiency of message parsing. In addition, after the message is parsed, the storage and header parsing results are separated, and the message storage processing needs to wait for the delay of the parsing pipeline before processing, which will also lead to a high processing delay. At the same time, in order to achieve line-speed processing performance, each message requires an independent parsing pipeline, which will occupy a large circuit area and instruction space. Summary of the invention

[0005] In view of this, embodiments of the present application provide a programmable message parsing method, a pipeline device and equipment to eliminate or improve one or more defects existing in the prior art.

[0006] One aspect of the present application provides a programmable message parsing method, including:

[0007] Based on multiple channels, header clipping is performed on each message in the multiple message streams to obtain and cache the clipped target messages corresponding to each of the channels;

[0008] Inputting the target messages of each of the channels into a programmable message parsing pipeline module shared by each of the channels, respectively, so that the programmable message parsing pipeline module takes the layered protocol of the target message as the current target processing object, and performs preset programmable message parsing actions on the target processing object in parallel, so as to obtain layered protocol parsing result data corresponding to the target message of each of the channels;

[0009] Cache the layered protocol parsing result data corresponding to each of the target messages according to the channels to which they belong;

[0010] The cached layered protocol parsing result data are output based on each channel.

[0011] In some embodiments of the present application, the step of performing header clipping on each message in the multiple message streams based on multiple channels to obtain and cache the clipped target messages corresponding to each of the channels includes:

[0012] Obtaining the deepest header in all message paths from the network topology corresponding to the multiple message flows, and determining a current clipping header depth threshold for each message in the multiple message flows based on the deepest header;

[0013] Using the clipping header depth threshold, clipping the header of each message in the multiple message streams based on each of the channels, so as to obtain the clipped target message corresponding to each of the channels;

[0014] The target messages corresponding to the respective channels are cached in the respective channels.

[0015] In some embodiments of the present application, the step of inputting the target messages of each of the channels into a programmable message parsing pipeline module shared by each of the channels comprises:

[0016] Based on the RR scheduling method, the target message of each channel is respectively input into a programmable message parsing pipeline module shared by each channel.

[0017] In some embodiments of the present application, the programmable message parsing pipeline module includes: one or more preset programmable message parsing basic processing units based on layered protocols; if the programmable message parsing pipeline module is provided with multiple programmable message parsing basic processing units based on layered protocols, each of the programmable message parsing basic processing units based on layered protocols is sequentially connected end to end to form a corresponding parsing pipeline;

[0018] The programmable message parsing basic processing unit based on the layered protocol includes: a multi-stage pipeline unit based on a VLIW wide instruction architecture, a configuration bus interface arranged at the input side of the multi-stage pipeline unit, and the same interface group respectively arranged at the input side and the output side of the multi-stage pipeline unit;

[0019] The multi-stage pipeline unit is used to take the layered protocol of the target message received from the interface group on the input side as the current target processing object, and according to the configuration information obtained from the configuration bus interface, execute the preset programmable message parsing action on the target processing object in parallel based on each preset special function register to obtain the corresponding layered protocol parsing result data, and output the layered protocol parsing result data from the interface group on the output side.

[0020] In some embodiments of the present application, the multi-stage pipeline unit includes: an instruction fetch and alignment module and a programmable message parsing group arranged in sequence starting from the input side;

[0021] The instruction fetch and alignment module is used to identify the layered protocol of the target message received from the interface group on the input side according to the configuration information obtained from the configuration bus interface, and hit and output the corresponding wide instructions corresponding to the layered protocol based on the VLIW wide instruction architecture; at the same time, the instruction fetch and alignment module is also used to perform header alignment processing on the layered protocol and output the corresponding aligned layered header data, so that the programmable message parsing group executes the preset programmable message parsing actions on the target processing object in parallel based on each preset special function register according to the wide instructions corresponding to the layered protocol output by the instruction fetch and alignment module and the aligned layered header data, so as to obtain the corresponding layered protocol parsing result data.

[0022] In some embodiments of the present application, the programmable message parsing group includes a decoding module, an execution module and an update module connected in sequence; wherein the output end of the instruction fetch and alignment module is connected to the decoding module, the execution module and the update module respectively;

[0023] The decoding module is used to extract various preset special function registers and various domain value fields within the current parsing range in parallel from the aligned layered header data based on the wide instruction corresponding to the layered protocol;

[0024] The execution module is used to execute corresponding processing corresponding to each of the special function registers and each of the domain value fields in parallel based on the wide instruction corresponding to the layered protocol, so as to obtain calculation result data corresponding to each of the special function registers and field extraction result data corresponding to each of the domain value fields;

[0025] The update module is used to update the target processing object according to the calculation result data corresponding to each of the special function registers and the field extraction result data corresponding to each of the domain value fields, so as to obtain the corresponding layered protocol parsing result data.

[0026] Another aspect of the present application provides a programmable message parsing pipeline device, comprising:

[0027] A multi-channel header clipping input buffer module is used to perform header clipping on each message in the multi-channel message stream based on multiple channels, and obtain and buffer the clipped target message corresponding to each of the channels;

[0028] A message transmission module, used for inputting the target message of each channel into a programmable message parsing pipeline module shared by each channel;

[0029] The programmable message parsing pipeline module is used to take the layered protocol of the target message as the current target processing object, and execute the preset programmable message parsing action on the target processing object in parallel to obtain the layered protocol parsing result data corresponding to the target message of each channel;

[0030] An output dispatcher module, used for caching the layered protocol parsing result data corresponding to each of the target messages according to the channels to which they belong;

[0031] The output result cache module is used to output the cached layered protocol parsing result data based on each channel.

[0032] In some embodiments of the present application, the message transmission module includes:

[0033] An input RR scheduler module is used to schedule the target message of each channel based on the RR scheduling method, so as to input the target message of each channel into a programmable message parsing pipeline module shared by each channel.

[0034] In some embodiments of the present application, the multi-channel header clipping input buffer module includes:

[0035] Each of the channels arranged in parallel has a corresponding header clipping unit, and each of the header clipping units shares one programmable message parsing pipeline module via the input RR scheduler module;

[0036] Each of the header clipping units is used to perform header clipping on the message by using a preset clipping header depth threshold, and cache the clipped target message.

[0037] The third aspect of the present application provides an electronic device, including a network card, an intelligent network card or a DPU, wherein the electronic device is provided with a programmable message parsing pipeline device, and the programmable message parsing pipeline device is used for the programmable message parsing method.

[0038] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the programmable message parsing method when executed by a processor.

[0039] The programmable message parsing method provided by the present application performs header clipping on each message in a multi-channel message stream based on multiple channels, obtains and caches the clipped target messages corresponding to each of the channels; inputs the target messages of each of the channels into a programmable message parsing pipeline module shared by each of the channels, so that the programmable message parsing pipeline module takes the layered protocol of the target message as the current target processing object, and performs the preset programmable message parsing action on the target processing object in parallel to obtain the layered protocol parsing result data corresponding to the target message of each of the channels; caches the layered protocol parsing result data corresponding to each of the target messages according to the channels to which they belong; based on the output of the cached layered protocol parsing result data of each channel, the performance of the parsing pipeline is released through header clipping, and a processing capacity far exceeding the line speed is achieved. Multiple message streams share the same parsing pipeline, making full use of the pipeline performance. By organizing the programmable message parsing processing unit in a pipeline manner, programmable support for the network topology graph (protocol graph) is realized, which can effectively reduce the circuit area and instruction space occupation. By performing the offloading of raw data storage and header parsing before the message enters the parsing pipeline, parallel processing is achieved, thereby reducing processing latency. This method and architecture is suitable for scenarios where the message hierarchy is known to have a limited depth, and can be trimmed according to the estimated header depth, which can further improve performance. It has broad application prospects in the field of network communications and can meet the real-time requirements in high-speed network environments.

[0040] Additional advantages, purposes, and features of the present application will be partially described in the following description, and will become partially apparent to those skilled in the art after studying the following, or may be learned from the practice of the present application. The purposes and other advantages of the present application can be achieved and obtained by the structures specifically pointed out in the specification and the drawings.

[0041] Those skilled in the art will understand that the purposes and advantages that can be achieved by the present application are not limited to the above specific description, and the above and other purposes that can be achieved by the present application will be more clearly understood based on the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The drawings described herein are used to provide a further understanding of the present application, constitute a part of the present application, and do not constitute a limitation of the present application. The components in the drawings are not drawn to scale, but are only for the purpose of illustrating the principles of the present application. In order to facilitate the illustration and description of some parts of the present application, the corresponding parts in the drawings may be enlarged, that is, they may become larger relative to other components in the exemplary device actually manufactured according to the present application. In the drawings:

[0043] Figure 1 The following is a schematic diagram showing an example of an existing pipeline for parsing multiple data streams and multiple messages.

[0044] Figure 2 The following is a schematic diagram showing an example of dividing the original data and the header result of an existing data flow after message parsing.

[0045] Figure 3 This is a first flow chart of a programmable message parsing method in one embodiment of the present application.

[0046] Figure 4 The second flowchart of the programmable message parsing method in one embodiment of the present application is shown in FIG.

[0047] Figure 5 Schematic diagram of the architecture of a basic processing unit for programmable message parsing based on a layered protocol in one embodiment of the present application.

[0048] Figure 6 This is a schematic diagram of the instruction logic of a programmable message parsing basic processing unit based on a layered protocol in one embodiment of the present application.

[0049] Figure 7 Schematic diagram of the structure of a programmable message parsing device in one embodiment of the present application.

[0050] Figure 8 A schematic diagram of the execution logic of a programmable message parsing device in one embodiment of the present application.

[0051] Fig. 9 A logical diagram of overlapping message parsing and message storage processing time to reduce latency in one embodiment of the present application.

[0052] Fig.10 This is an example diagram of a network topology diagram that supports VxLAN, GRE and IPinIP tunneling protocols in the application example of this application.

[0053] Fig.11 This is a schematic diagram of a simple network topology diagram in the application example of this application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the implementation modes and the accompanying drawings. Here, the illustrative implementation modes and descriptions of the present application are used to explain the present application, but are not intended to limit the present application.

[0055] It should also be noted here that in order to avoid obscuring the present application due to unnecessary details, only the structures and / or processing steps closely related to the scheme according to the present application are shown in the accompanying drawings, while other details that are not very relevant to the present application are omitted.

[0056] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0057] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.

[0058] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0059] In order to solve the problems of low performance, low message parsing efficiency and large circuit area and instruction space occupied by the existing pipeline architecture for message parsing, the embodiments of the present application respectively provide a programmable message parsing method, a programmable message parsing device for executing the programmable message parsing method, an electronic device and a computer-readable storage medium. The performance of the parsing pipeline is released by header clipping to achieve a processing capability far exceeding the line speed. The programmable message parsing pipeline module can effectively reduce the circuit area and instruction space occupied, and can effectively improve the efficiency of message parsing and the performance of the device.

[0060] The details are described in detail through the following examples.

[0061] Based on this, the embodiment of the present application provides a programmable message parsing method that can be implemented by a programmable message parsing device, see Figure 3 , the programmable message parsing method specifically includes the following contents:

[0062] Step 100: Based on multiple channels, headers of each message in multiple message streams are clipped respectively, and the clipped target messages corresponding to each of the channels are obtained and cached.

[0063] In one or more embodiments of the present application, a plurality of channels for performing header clipping on each message in a multi-channel message stream are provided on the input side of the programmable message parsing pipeline module, and each of the channels corresponds to a header clipping unit, and these header clipping units can constitute a multi-channel header clipping input cache module, which is used to execute the step 100.

[0064] Step 200: Input the target messages of each of the channels respectively into a programmable message parsing pipeline module shared by each of the channels, so that the programmable message parsing pipeline module takes the layered protocol of the target message as the current target processing object, and executes the preset programmable message parsing action on the target processing object in parallel to obtain the layered protocol parsing result data corresponding to the target message of each of the channels.

[0065] In one or more embodiments of the present application, the programmable message parsing pipeline module is used to take the layered protocol of the target message received from the interface group on the input side as the current target processing object based on the VLIW wide instruction architecture, and according to the configuration information obtained from the configuration bus interface on the input side, execute the preset programmable message parsing actions on the target processing object in parallel based on various preset special function registers to obtain the corresponding layered protocol parsing result data.

[0066] It can be understood that step 200 can effectively reduce the complexity of a single basic processing unit by designing a programmable message parsing pipeline module to parse a single layered protocol; the use of a multi-stage pipeline architecture can make the basic processing unit flexible and programmable, and can effectively improve the adaptability of message parsing when the demand changes; by adopting a VLIW wide instruction architecture to execute parsing actions in parallel, it can effectively improve the processing efficiency of message parsing and the performance of the basic processing unit, and can obtain deterministic latency, so that the programmable message parsing pipeline module has the advantages of versatility, programmability, deterministic latency, high performance, and parameterizability.

[0067] Step 300: Cache the layered protocol parsing result data corresponding to each of the target messages according to the channels to which they belong.

[0068] Step 400: Outputting cached layered protocol parsing result data based on each channel.

[0069] From the above description, it can be seen that the programmable message parsing method provided in the embodiment of the present application releases the performance of the parsing pipeline through header clipping, achieving processing capabilities far exceeding the line speed. Multiple message streams share the same parsing pipeline, making full use of the pipeline performance. By organizing the programmable message parsing processing unit in a pipeline manner, programmable support for the protocol graph (network topology graph) is achieved, which can effectively reduce the circuit area and instruction space occupancy. By performing the diversion of raw data storage and header parsing before the message enters the parsing pipeline, parallel processing is achieved, thereby reducing processing delays. This method and architecture are suitable for scenarios where the message hierarchy is known to have a limited depth, and can be clipped according to the estimated header depth, which can further improve performance. It has broad application prospects in the field of network communications and can meet the real-time requirements in high-speed network environments.

[0070] In order to further improve the application reliability, flexibility and efficiency of header clipping in the programmable message parsing process, in the programmable message parsing method provided in the embodiment of the present application, see Figure 4 , step 100 in the programmable message parsing method specifically includes the following contents:

[0071] Step 110: Obtain the deepest header in all message paths from the network topology corresponding to the multiple message flows, and determine the current clipping header depth threshold for each message in the multiple message flows based on the deepest header.

[0072] Step 120: Using the clipping header depth threshold, perform header clipping on each message in the multi-channel message stream based on each of the channels, so as to obtain clipped target messages corresponding to each of the channels.

[0073] Step 130: Cache the target messages corresponding to the respective channels in the respective channels.

[0074] In other words, the multi-channel header clipping input cache module performs multi-channel message header caching and can dynamically configure the clipped header depth. Specifically, the deepest header in all message paths can be calculated based on the configured parsing network topology diagram to ensure that the header information content is not lost after clipping. Due to the clipping of the header, the message parsing pipeline performance of the original Payload and other data placeholders will be released, so that multiple channels can share a message parsing pipeline performance.

[0075] In order to further improve the application reliability and efficiency of pipeline message parsing in the process of programmable message parsing, in the programmable message parsing method provided in the embodiment of the present application, see Figure 4 , step 200 in the programmable message parsing method specifically includes the following contents:

[0076] Step 210: Based on the RR scheduling method, the target message of each channel is input into a programmable message parsing pipeline module shared by each channel, so that the target message of each channel is input into a programmable message parsing pipeline module shared by each channel, based on the RR scheduling method.

[0077] It is understandable that the RR scheduling method specifically refers to the RR scheduling algorithm (Round-Robin Scheduling Algorithm), which is a commonly used preemptive scheduling algorithm. The RR scheduling algorithm can solve the problem of long waiting time for long jobs in the short job priority scheduling algorithm (SJF). The RR scheduling algorithm allocates a time slice (TimeSlice) to each process. When the process occupies the device for more than one time slice, the process will be suspended and placed at the end of the ready queue, waiting for its turn to execute next time. By adopting the RR scheduling method, messages between multiple channels can be intelligently scheduled to ensure that each channel has a fair chance to be processed.

[0078] In order to further enable the programmable message parsing pipeline module to have the advantages of versatility, programmability, deterministic latency, high performance, and parameterizability, in the programmable message parsing method provided in the embodiment of the present application, the programmable message parsing pipeline module specifically includes one or more preset programmable message parsing basic processing units based on a layered protocol. If the programmable message parsing pipeline module is provided with a plurality of the programmable message parsing basic processing units based on a layered protocol, then each of the programmable message parsing basic processing units based on a layered protocol are connected end to end in sequence to form a corresponding parsing pipeline.

[0079] See also Figure 5 The programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:

[0080] A multi-stage pipeline unit 10 based on a VLIW wide instruction architecture, a configuration bus interface 11 arranged at the input side of the multi-stage pipeline unit, and the same interface group arranged at the input side and the output side of the multi-stage pipeline unit respectively.

[0081] It can be understood that the configuration bus interface 11 is used to receive preset configuration information from the configuration bus.

[0082] The interfaces of the basic processing units for programmable message parsing based on the layered protocol are identical except for the configuration bus. The overall message parsing framework with diverse designs can be realized through the consistent interfaces. For example, a pipeline structure is realized by connecting multiple levels of basic processing units end to end; or a multi-cycle processing architecture in which the output bus is looped back to the input bus of the basic processing unit at the same level. The same parameterizable and programmable basic processing unit is applied to different project scenarios.

[0083] The interface groups include a message data bus interface 12 , a parsing indication bus interface 13 , a protocol structure (Struct) bus interface 14 , a field (Fields) bus interface 15 and a linkage bus interface 16 .

[0084] Specifically, the message data bus interface 12 is used to receive the target message transmitted by the message data bus, and the parsing indication bus interface 13 is used to receive the parsing instruction transmitted by the parsing indication bus, so that the multi-stage pipeline unit 10 starts execution processing according to the parsing instruction; the protocol structure bus interface 14 is used to receive the layered protocol characteristics transmitted by the protocol structure bus (which can be abbreviated as Struct bus), mainly Type representing the type, offset representing the position, and len representing the length; the field (Fields) bus interface 15 is used to receive the corresponding field information extracted from the parsing range of the previous basic processing unit according to the decoding configuration transmitted by the field bus (which can be abbreviated as Fields bus); the linkage bus interface 16 is used to receive necessary information loaded from the previous basic processing unit, etc.

[0085] The multi-stage pipeline unit 10 is used to take the layered protocol of the target message received from the interface group on the input side as the current target processing object, and according to the configuration information obtained from the configuration bus interface 11, execute the preset programmable message parsing action on the target processing object in parallel based on each preset special function register to obtain the corresponding layered protocol parsing result data, and output the layered protocol parsing result data from the interface group on the output side.

[0086] It is understandable that the multi-stage pipeline unit 10 is used to take the layered protocol of the target message received from the message data bus interface 12 of the input side as the current target processing object. The special function registers therein may at least include a layered jump register, a layered length calculation register, and the like.

[0087] Through the pipeline design of multi-stage pipeline units and VLIW wide instruction DSA architecture. The pipeline structure is divided into multiple stages, so that the programmable message parsing basic processing unit based on the layered protocol provided in the embodiment of the present application is similar to the general CPU architecture, but the programmable message parsing basic processing unit based on the layered protocol adopts wide instructions, has no general registers, and all are special registers to realize parallel processing. In other words, the architectural features of the programmable message parsing basic processing unit based on the layered protocol provided by the present application determine that the programmable message parsing basic processing unit based on the layered protocol has both the flexibility of the general CPU architecture (VLIW wide instruction programmable) and the high performance of the pipeline (parallel high performance and deterministic delay) characteristics.

[0088] In one or more embodiments of the present application, the number of stages of the multi-stage pipeline unit can be set according to actual application requirements, for example, it can be set to 3 or 4 stages.

[0089] That is to say, the programmable message parsing basic processing unit based on the layered protocol provided in the embodiment of the present application can realize different scenario requirements with a unified message parsing processing unit through the characteristics of programmability (fixed hardware supports programmable network protocols), deterministic latency (internal pipeline architecture), high performance (wide instruction parallel execution), parameterizability (performance and area can be tailored), etc., and is suitable for the functional verification of the data processor DPU (Data Processing Unit) and various requirements of the product performance upgrade process.

[0090] In one or more embodiments of the present application, the layered protocol-based programmable message parsing basic processing unit specifically refers to a basic processing unit architecture of a programmable message parsing method that is executed using the layered protocol of the message as a processing object.

[0091] From the above description, it can be seen that the programmable message parsing method provided in the embodiment of the present application can effectively reduce the complexity of a single basic processing unit by designing a basic processing unit to implement parsing of a single layered protocol; the multi-stage pipeline architecture adopted in the present application can enable the basic processing unit to have flexible programmability, and can effectively improve the adaptability and versatility of message parsing when the demand changes; the present application can effectively improve the processing efficiency of message parsing and improve the performance of the basic processing unit by adopting a VLIW wide instruction architecture to execute parsing actions in parallel, and can obtain deterministic delay, so that the programmable message parsing basic processing unit based on the layered protocol provided in the present application has the advantages of versatility, programmability, deterministic delay, high performance, and parameterizability.

[0092] In order to further improve the application reliability, flexibility and efficiency of the multi-stage pipeline unit in the programmable message parsing process based on the layered protocol, in a programmable message parsing method provided in an embodiment of the present application, see Figure 5 The multi-stage pipeline unit 10 in the programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:

[0093] An instruction fetch and alignment module 20 and a programmable message parsing group 30 are sequentially arranged from the input side.

[0094] The instruction fetch and alignment module 20 is used to identify the layered protocol of the target message received from the interface group on the input side according to the configuration information obtained from the configuration bus interface, and to hit and output the wide instruction corresponding to the layered protocol based on the VLIW wide instruction architecture;

[0095] At the same time, the instruction fetch and alignment module 20 is also used to perform header alignment processing on the layered protocol and output corresponding aligned layered header data, so that the programmable message parsing group 30 executes preset programmable message parsing actions on the target processing object in parallel based on each preset special function register according to the wide instructions corresponding to the layered protocol output by the instruction fetch and alignment module and the aligned layered header data, so as to obtain corresponding layered protocol parsing result data.

[0096] In order to further improve the application reliability, flexibility and efficiency of the programmable message parsing group in the programmable message parsing process based on the layered protocol, in a programmable message parsing basic processing unit based on the layered protocol provided in an embodiment of the present application, see Figure 5 The programmable message parsing group 30 in the programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:

[0097] A decoding module 40, an execution module 50 and an update module 60 connected in sequence; wherein the output end of the instruction fetch and alignment module 20 is connected to the decoding module 40, the execution module 50 and the update module 60 respectively;

[0098] The decoding module 40 is used to extract various preset special function registers and various domain value fields within the current parsing range in parallel from the aligned layered header data based on the wide instruction corresponding to the layered protocol;

[0099] The execution module 50 is used to execute corresponding processing corresponding to each of the special function registers and each of the domain value fields in parallel based on the wide instruction corresponding to the layered protocol, so as to obtain calculation result data corresponding to each of the special function registers and field extraction result data corresponding to each of the domain value fields;

[0100] The update module 60 is used to update the target processing object according to the calculation result data corresponding to each of the special function registers and the field extraction result data corresponding to each of the domain value fields, so as to obtain the corresponding layered protocol parsing result data.

[0101] Among them, see Figure 5 The instruction fetch and alignment module 20 as the first stage of the pipeline in the programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:

[0102] The VLIW random access memory submodule 21 is used to store a plurality of wide instructions for processing layered protocols.

[0103] Specifically, the VLIW random access memory submodule 21 implements the storage of multiple wide instructions required for processing specific layered protocols. Simple layered protocols are executed by one wide instruction, and complex layered protocols are broken down into multiple wide instructions for combined execution. By storing multiple wide instructions, it is possible for a single basic processing end element to process multiple layered protocols, realizing the programmable characteristics of the basic processing unit structure.

[0104] The hit submodule 22 is used to identify the layered protocol of the target message received from the interface group on the input side according to the configuration information obtained from the configuration bus interface. If the identification is successful, the various wide instructions corresponding to the layered protocol are indexed from the VLIW random access memory submodule to configure the layered protocol as a programmable target processing object, and the various wide instructions corresponding to the layered protocol are output to the decoding module 40, the execution module 50 and the update module 60 respectively via the VLIW random access memory submodule 21.

[0105] Specifically, the hit submodule can determine whether the current input layered protocol data can be recognized and processed. Since the message parsing basic processing unit is configured with the layered protocol as the object and is programmable, hit processing is required. When the input layered protocol data can be processed, the hit module outputs the VLIW RAM type corresponding index width instruction to achieve the hit of the layered protocol.

[0106] The header alignment submodule 23 is used to perform header alignment processing on the layered protocol to obtain aligned layered header data corresponding to the layered protocol, and output the aligned layered header data to the decoding module 40 .

[0107] Specifically, the header alignment submodule can realize the alignment of layered protocol data starting with bit 0. Data is transmitted from the message data bus, and the starting position of each layer is located at a different position on the bus. The message parsing basic processing unit takes the layered protocol as the object, so the header alignment submodule is used to realize the alignment of each layered protocol data during processing and simplify the processing behavior.

[0108] The decoding module 40 as the second stage of the pipeline in the programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:

[0109] The hierarchical jump register extraction submodule 41 is used to extract the hierarchical jump register from the aligned hierarchical header data and output the hierarchical jump register to the execution module 50 .

[0110] Specifically, the layer jump register extraction submodule can extract the layer jump register from the aligned layer header data. For example, the layer jump register of IPv4 is a 1-byte protocol field of bits 72-79.

[0111] In one or more embodiments of the present application, the hierarchical jump register may be abbreviated as a Type register.

[0112] The layer length calculation register extraction submodule 42 is used to extract the layer length calculation register from the aligned layer header data and output the layer length calculation register to the execution module 50 .

[0113] Specifically, the layer length calculation register extraction submodule extracts the layer length calculation register from the aligned layer header data. For example, the layer length calculation register of IPv4 is the 4-bit IHL field of bits 4-7.

[0114] In one or more embodiments of the present application, the layer length calculation register may be abbreviated as a Len register.

[0115] The domain value field extraction and decoding submodule 43 is used to extract each domain value field from the current parsing range based on the domain value byte mark field in the wide instruction corresponding to the layered protocol, and decode and convert each domain value field to obtain a corresponding domain value extraction control signal, and output the domain value extraction control signal to the execution module 50.

[0116] Specifically, the domain value field extraction and decoding submodule realizes the decoding conversion of the required fields extracted from the current parsing range. The programmable message parsing basic processing unit realizes the extraction of various domain value fields required by the subsequent matching action flow while parsing the layered protocol, thereby accelerating the subsequent processing. The domain value field extraction and decoding submodule receives the domain value byte tag field in the VLIW wide instruction and decodes it into a control signal for the domain value extraction submodule in the execution module 50 of the next level.

[0117] In one or more embodiments of the present application, the domain value field extraction and decoding submodule can be abbreviated as Fields extraction and decoding submodule.

[0118] The execution module 50 as the third stage of the pipeline in the programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:

[0119] The hierarchical jump submodule 51 is used to perform fuzzy matching comparisons with multiple masked features based on the comparison array according to the hierarchical jump register to obtain the next hierarchical jump result corresponding to the hierarchical protocol, and output the next hierarchical jump result to the update module.

[0120] Specifically, the hierarchical jump submodule realizes the fuzzy matching comparison of multiple masked features by comparing the array at the same time to obtain the next hierarchical jump result. For jump matching, simultaneous matching will become more complicated as the jump possibility increases. The hierarchical jump submodule uses a limited number of comparisons to achieve jump coverage for most hierarchical protocols. For hierarchical protocols that exceed the number of jumps, a multi-level combination is used to implement it. In this way, the jump submodule is guaranteed to compare the performance of the array circuit area and timing.

[0121] In one or more embodiments of the present application, the hierarchical jump submodule can be abbreviated as a Type jump submodule.

[0122] The layer length calculation submodule 52 is used to calculate the length of the layered protocol according to the layer length calculation register to obtain a corresponding length calculation result, and output the length calculation result to the update module.

[0123] Specifically, the layered length calculation submodule realizes the calculation of the layered protocol length. A simplified general ALU calculation unit is used to realize the operation of the operand. When the layered protocol length is fixed, the immediate number in the direct load wide instruction is used. When the layered protocol needs to be calculated, the LEN register is used to perform a certain operation through Len to obtain the length result.

[0124] In one or more embodiments of the present application, the layer length calculation submodule can be abbreviated as a Len calculation submodule.

[0125] The domain value extraction submodule 53 is used to extract and compress the corresponding field information in the aligned layered header data from the current parsing range according to the domain value extraction control signal to obtain corresponding field compressed data, and output the field compressed data to the update module.

[0126] Specifically, the domain value extraction submodule realizes the extraction of corresponding fields from the current parsing range according to the decoding configuration. By loading the Fields extraction control signal from the domain value field extraction decoding submodule, the field information required by the subsequent stage is extracted from the layered protocol header data for compression output, which speeds up the time for the subsequent stage to re-extract the field.

[0127] In one or more embodiments of the present application, the field value extraction submodule can be abbreviated as Fields extraction submodule.

[0128] The update module 60 as the fourth stage of the pipeline in the programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:

[0129] The type updating submodule 61 is used to update the type indication of the target processing object according to the next layer jump result.

[0130] Specifically, the type update submodule implements the update of the layered protocol type indication, such as jumping or continuing parsing after parsing is completed. According to whether the jump comparison matches, whether the current layered protocol is parsed, the actual jump of Type is implemented. If multi-level parsing is required, the jump will take effect when the parsing is completed.

[0131] In one or more embodiments of the present application, the type update submodule may be abbreviated as a Type update submodule.

[0132] The progress updating submodule 62 is used to update the parsing progress of the target processing object according to the length calculation result.

[0133] Specifically, the progress update submodule implements the update of the hierarchical protocol parsing progress. The offset is in bytes, indicating the byte offset in the parsing of the entire message. When multiple levels are linked, the offset can be 0 to continue parsing the current range; the offset can be the parsed length, and the subsequent range parsing of this hierarchical protocol can be incremented; the offset can be the length of this hierarchical protocol to complete this hierarchical parsing.

[0134] In one or more embodiments of the present application, the progress update submodule may be abbreviated as an Offset update submodule.

[0135] The protocol structure updating submodule 63 is used to record the layered protocol characteristics for the target processing object according to the next layer jump result and the length calculation result.

[0136] Specifically, the protocol structure update submodule realizes recording of layered protocol features after the layered protocol is parsed. It mainly includes Type representing type, offset representing position, and len representing length. Each layered protocol has only one result. When single-level parsing or linkage parsing is performed, the update occurs at the parsed level and is finally transmitted by the Struct bus.

[0137] In one or more embodiments of the present application, the protocol structure update submodule may be abbreviated as a Struct update submodule.

[0138] The domain value field updating submodule 64 is used to update the fields extracted within the current parsing range according to the field compression data.

[0139] Specifically, the domain value field update submodule realizes the update of the useful fields extracted within the current parsing range. When there are multiple levels of linkage, if there are fields extracted, they are updated and transmitted, and finally transmitted by the Fields bus.

[0140] In one or more embodiments of the present application, the domain value field update submodule can be abbreviated as the Fields update submodule.

[0141] That is to say, the basic processing unit provided in the embodiment of the present application can realize the overall and local parsing of the layered protocol, and realizes the parsing of the message layered protocol as the object. The basic processing unit is a 4-stage pipeline and a VLIW wide instruction architecture. Through the pipeline method, multiple execution sub-modules are used to realize the parallel execution of message parsing actions. The layered protocol within the processing capacity of the basic processing unit is parsed through the capacity of a basic processing unit; for complex layered protocols, they are parsed through a combination of the capabilities of multiple basic processing units. Compared with the network processor NPU (Network Processor Unit) with a RISC reduced instruction architecture, it parses layered protocols of different complexities through the number of instructions, and there is uncertainty in the processing time. The programmable message parsing basic processing unit structure implemented by the present application is designed through a 4-stage pipeline, and parallelization is achieved through VLIW wide instructions to obtain deterministic delay results.

[0142] The decoding module 40 in the programmable message parsing basic processing unit based on the layered protocol or the execution module 50 specifically includes a linkage loading submodule 70;

[0143] Correspondingly, if the linkage loading submodule 70 is provided in the decoding module 40 , the linkage transmission submodule 71 is provided in both the execution module 50 and the update module 60 .

[0144] See also Figure 5 If the linkage loading submodule 70 is set in the execution module 50, the update module 60 is provided with a linkage transmission submodule 71.

[0145] The linkage loading submodule 70 is used to load the processing instructions and data of other modules before the current module into the current module.

[0146] Specifically, the linkage loading submodule realizes loading the necessary combination processing information from the previous stage. When the capacity of a single-level basic processing unit is less than that required for parsing a complex layered protocol, a multi-level cascade method can be used to load the necessary information from the previous stage to continue parsing. For example, when the number of jump comparisons or the domain value extraction range is insufficient, multi-level processing is used to achieve parsing.

[0147] The linkage transmission submodule 71 is used to transmit the processing instructions and data.

[0148] Specifically, the linkage transmission submodule 71 transmits the instructions and data required for multi-level linkage, and solves the analysis of complex layered protocols by linkage, ensuring that the basic processing unit can solve complex layered protocols while maintaining a small circuit area scale.

[0149] in, Figure 5 The execution logic of the architecture shown is as follows Figure 6 As shown, Figure 6 The overall architecture and Figure 5 Provides the exact same architecture, and Figure 6 The various function boxes in Figure 5 The functional modules at corresponding positions correspond one to one.

[0150] Furthermore, the present application also provides a programmable message parsing device for executing all or part of the programmable message parsing method, see Figure 7 , the programmable message parsing device specifically includes the following contents:

[0151] The multi-channel header clipping input buffer module 1 is used to perform header clipping on each message in the multi-channel message stream based on multiple channels, and obtain and buffer the clipped target messages corresponding to each of the channels.

[0152] Specifically, the multi-channel header clipping input cache module 1 performs multi-channel message header caching, and can dynamically configure the clipped header depth. According to the configured parsing network topology diagram, the deepest header in all message paths is calculated to ensure that the information content of the clipped header is not lost. Due to the clipping of the header, the message parsing pipeline performance of the original Payload and other data places will be released, so that multiple channels can share a message parsing pipeline performance.

[0153] In order to further improve the application reliability, flexibility and efficiency of header clipping in the process of programmable message parsing, the multi-channel header clipping input buffer module 1 may include header clipping units corresponding to each channel arranged in parallel, and each of the header clipping units shares one programmable message parsing pipeline module through the input RR scheduler module; each of the header clipping units is used to perform header clipping on the message using a preset clipping header depth threshold, and cache the clipped target message. It can be understood that the header clipping unit can be abbreviated as InBuffer. For example, if N is set to be greater than 3 header clipping units, the N header clipping units can be written as InBuffer0, InBuffer1, InBuffer2, ..., InBufferN-1.

[0154] The message transmission module is used to input the target message of each channel into a programmable message parsing pipeline module shared by each channel.

[0155] Among them, in order to further improve the application reliability and efficiency of pipeline message parsing in the programmable message parsing process, the message transmission module can be specifically implemented by an input RR scheduler module 2.

[0156] The input RR scheduler module 2 is used for the target message of each channel based on the RR scheduling method, so as to input the target message of each channel into a programmable message parsing pipeline module shared by each channel.

[0157] Specifically, the input RR scheduler module 2 can intelligently schedule messages between multiple channels to ensure that each channel can get a fair processing opportunity.

[0158] The programmable message parsing pipeline module 3 is used to take the layered protocol of the target message as the current target processing object, and execute the preset programmable message parsing action on the target processing object in parallel to obtain the layered protocol parsing result data corresponding to the target message of each channel.

[0159] Specifically, the programmable message parsing pipeline module 3 can be composed of a multi-stage pipeline cascaded message parsing processing unit. It can be programmable to support different network topologies and flexibly configured and adjusted according to different message formats and requirements:

[0160] a) Design a pipeline architecture, where each pipeline processing unit is responsible for processing a specific layered protocol and implements progressive parsing of the message header layer in a pipeline manner.

[0161] b) A programmable message parsing processing unit is implemented using a basic processing unit in a patent for a programmable message parsing basic processing unit structure targeting a layered protocol. Each processing module has programmable capabilities, and each level of processing unit is configured through wide instructions to enable it to recognize and process specific layered protocols, such as the IB protocol, the ETH protocol, etc.

[0162] The output dispatcher module 4 is used to cache the layered protocol parsing result data corresponding to each of the target messages according to the channels to which they belong.

[0163] The output dispatcher module 4 may also be referred to as an output channel dispatcher. The output dispatcher module can cache the parsing results into the corresponding output result cache module according to the channel, so as to ensure that the results of each channel can be correctly output.

[0164] The output result cache module 5 is used to output the cached layered protocol parsing result data based on each channel.

[0165] The output result cache module may include output units corresponding to each channel arranged in parallel, and the output unit may be abbreviated as OutBuffer, wherein each of the output units corresponds one-to-one to each of the header clipping units. For example, if N is set to be greater than 3 output units, the N output units may be written as OutBuffer0, OutBuffer1, OutBuffer2, ..., N-1.

[0166] The embodiments of the programmable message parsing device provided in the present application can be specifically used to execute the processing flow of the embodiments of the programmable message parsing method in the above embodiments. Its functions will not be repeated here, and reference can be made to the detailed description of the embodiments of the programmable message parsing method in the above embodiments.

[0167] The design of the entire programmable message parser architecture takes into account the utilization of system resources, and achieves performance sharing of a single pipeline through multi-channel sharing. This can reduce the use of resources such as message parsing circuits and instruction space, and improve system efficiency and performance.

[0168] See also Figure 8In a specific implementation, the programmable message parsing pipeline module 3 may include M greater than 3 programmable message parsing basic processing units based on layered protocols.

[0169] The programmable message parsing pipeline architecture of the present application, which far exceeds the line speed performance, realizes efficient message parsing processing. Specifically, the present application has the following effects and advantages:

[0170] a) Message data trimming reduces the number of data cycles entering the pipeline and improves the processing performance of message parsing.

[0171] b) The multi-channel sharing mechanism enables multiple message parsing pipelines to share processing power, improving the performance of the overall system and reducing the circuit scale.

[0172] c) The multi-stage pipeline architecture enables each stage of the pipeline to focus on the processing of a specific layered protocol, improving the accuracy and efficiency of parsing.

[0173] d) Programmability enables each pipeline processing module to be flexibly configured and processed according to the requirements of different protocols.

[0174] From the above description, it can be seen that the programmable message parsing device provided in the embodiment of the present application, through a programmable message parsing pipeline architecture that far exceeds the line speed performance, includes a multi-channel header clipping input cache, an input RR scheduler, a programmable message parsing pipeline, an output dispatcher, a multi-channel result output cache and other modules. The messages in the multi-channel message stream are cached in the header clipping input cache module after header clipping; the input RR scheduling module performs scheduling between multiple channels and sends them to the message parsing pipeline for processing; after the message is parsed, the output dispatcher caches the parsing results to the corresponding output result cache module according to the channel. The entire application uses a message parsing pipeline, and through clipping, the processing performance far exceeds the line speed of a single data stream. The performance of a single pipeline is shared by multiple channels. From the perspective of the overall system, it is achieved to reduce resources such as message parsing circuits and instruction space.

[0175] In order to achieve multi-channel high-performance message parsing performance, according to the message stream header clipping, this application realizes the diversion of raw data storage and message parsing before the message stream enters the message parsing pipeline, such as Fig. 9 shown.

[0176] By simultaneously processing the original message storage and message header parsing, storage and parsing can be performed in parallel, reducing the overall message processing delay.

[0177] The above method of changing the timing of splitting the original data and the message header realizes the conversion of storage and parsing from serial processing to parallel processing, thereby reducing the overall system latency.

[0178] Furthermore, based on the above embodiments of the programmable message parsing method and / or the programmable message parsing pipeline device, the present application also provides an embodiment of an electronic device. The electronic device is provided with the programmable message parsing pipeline device mentioned in the above embodiments.

[0179] The electronic device can also refer to a network processing device, in particular, a network card, an intelligent network card, and a DPU, etc., so that the electronic device can solve the problems faced by existing network cards, intelligent network cards or DPUs in the programmability and performance iteration of message parsing functions; the purpose is to realize the message parsing capability of existing network cards / intelligent network cards / DPUs in the most economical form, and to achieve high performance and low latency. The calculation of the deepest header in all message paths of the programmed network topology graph (protocol graph) is adopted to realize header clipping without losing information content. The header clipping method is adopted to realize message parsing capabilities far exceeding line speed. The method of multiple channels sharing the same message parsing pipeline is adopted to make full use of the performance of the message parsing pipeline, save circuit area and instruction space, etc. The method of simultaneous message parsing and message storage is adopted to realize the time of overlapping message parsing or storage, and reduce the overall message processing delay. Through the above methods, a message parsing architecture far exceeding the line speed is realized, and the characteristics of small area and low latency are realized.

[0180] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned programmable message parsing basic processing method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.

[0181] In summary, the programmable message parsing method, programmable message parsing pipeline device, and electronic device provided in the embodiments of the present application realize efficient message parsing processing through technical means such as multi-stage pipeline, programmable capability, and header trimming. This architecture is suitable for scenarios where the message hierarchy is known to have a limited depth, and can be trimmed according to the estimated header depth to further improve performance. This application has broad application prospects in the field of network communications and can meet the real-time requirements in high-speed network environments.

[0182] In order to further illustrate the above embodiments provided by the present application, the present application also provides a specific application example of the programmable message parsing method for illustration:

[0183] Step A: Head cutting:

[0184] The following two specific application examples are used to explain header trimming in detail, so as to achieve a processing performance far exceeding the line speed of a single parsing pipeline without losing information.

[0185] (1) First header cutting application example

[0186] Assume programmable parsing pipeline configuration support Fig.10 The tunnel network topology diagram shown in FIG. Fig.10 The content in each circle in the figure represents a protocol different from the other circles. These protocols specifically include: ETH (Ethernet) protocol type but refers to different ETH and ETH_i, VLAN (Virtual Local Area Network) protocol type but refers to different VLAN1, VLAN2, VLAN1_i and VLAN2_i; IP4 (Internet Protocol version 4) protocol type but refers to two different protocols, IP4 and IP4_i; IP6 (Internet Protocol Version 6) protocol type but refers to two different protocols, IP6 and IP6_i; TCP (Transmission Control Protocol) protocol type but refers to two different protocols, TCP and TCP_i; UDP (User Datagram Protocol) protocol type but refers to two different protocols, UDP and UDP_i; GRE (Generic Routing Encapsulation) and VXLAN (Virtual extensible Local Area Network) protocols are also included, where the "_i" suffix indicates the inner layer protocol of the tunnel.

[0187] a) First of all Fig.10 The deepest path in the network is searched to find out how big the clipping should be to ensure that all the messages supported by the network topology do not lose information.

[0188] b) Since the network topology is a directed acyclic graph, the deepest message path can be easily obtained (the brackets in the following quotation marks indicate the maximum length of each layered protocol, calculated without supporting option):

[0189] "ETH(14)->VLAN1(4)->VLAN2(4)->IP6(40)->UDP(8)->VxLAN(8)->ETH_i(14)->VLAN1_i(4)->VLAN2_i(4)->IP6_i(40)->TCP_i(20)".

[0190] c) The deepest path above is 160B, assuming that the bandwidth of the packet parsing pipeline is 256 bits. Fig.10 In the network topology diagram shown, a message occupies a maximum of 160 / (256 / 8)=5 cycles.

[0191] d) Configure the header clipping input buffer in 5 cycles. Assuming the message parsing pipeline is 250MHz, the minimum pipeline parsing performance is 250 / 5=50Mpps (some messages are smaller than 160B).

[0192] (2) Second header cutting application example

[0193] Assume that the programmable parsing pipeline configuration supports Fig.11 The tunnel type network topology diagram is shown.

[0194] a) The deepest message path (the content in quotation marks does not support option calculation):

[0195] "ETH(14)->VLAN1(4)->VLAN2(4)->IP6(40)->->TCP(20)";

[0196] b) The deepest path 82B, assuming that the packet parsing pipeline bandwidth is 256 bits, Fig.11 In the network topology shown, the maximum occupancy of a message is 82 / (256 / 8)=2.56, which requires a total of 3 cycles;

[0197] c) Configure the header clipping input buffer in 3 cycles. Assuming the packet parsing pipeline is 250MHz, the minimum pipeline performance is 250 / 3=83.33Mpps.

[0198] By comparing the header clipping application examples 1 and 2, we can see that header clipping can effectively improve the performance of the message parsing pipeline. By designing according to the actual project requirements, multi-channel sharing can be used to fully utilize the parsing capabilities and the extra parsing performance.

[0199] Step B: Programmable message parsing pipeline:

[0200] a) Network topology implementation to be supported (can be represented by P4);

[0201] b) According to each layered protocol, the layered protocol processing wide instruction conversion is realized. The complex protocol is split into multiple wide instructions and parsed through multi-level basic unit combination.

[0202] c) Split the converted multiple wide instructions into different pipeline levels according to the directed acyclic graph logic.

[0203] d) Since all protocols are customized, programmable messages can support all customized protocols.

[0204] i.Support Ethernet network protocol

[0205] ii. If the underlying layer supports infinite band interface (L1 layer), the message parsing can also be configured to support IB protocol.

[0206] Step C: Raw data storage and message parsing diversion to reduce the overall message processing delay:

[0207] a) Assume that the message parsing pipeline delay is 80 beats;

[0208] b) Assuming the message storage bus bandwidth is 256 bits; the following is a rough estimate of the overlap time for different message sizes:

[0209] i.96B-->3 beats; can overlap 3 beats;

[0210] ii.1500B-->46 beats: 46 beats can be overlapped;

[0211] iii.2048B-->64 beats: 64 beats can be overlapped;

[0212] iv.9600B-->300 beats: 80 beats can be overlapped;

[0213] c) When the message length is less than 80*32B=2560B, the message storage time can be overlapped;

[0214] d) When the message length is greater than 2560B, the time of the parsing pipeline can be overlapped.

[0215] It should be noted that the project scenario is changed by inspiration of this application, and the simplified solution inspired by the idea of ​​this application is also protected by this application. For example, a message parsing preprocessing solution is designed by inspiration of this application, which only checks the first few layers of the header (only a small amount of header is intercepted), realizes multi-channel high-performance line-speed message parsing, and provides a pre-scheduling information.

[0216] The programmable message parsing method and related device provided by the present application adopt the method of header clipping to achieve message parsing capability far exceeding line speed; adopt the method of multiple channels sharing the same message parsing pipeline to fully utilize the performance of the message parsing pipeline, save circuit area and instruction space, etc.; adopt the method of simultaneous message parsing and message storage to achieve the time of overlapping message parsing or storage, and reduce the overall message processing delay. Therefore, it has the following beneficial effects:

[0217] 1) According to the trimming of the message header in the present application, the number of data cycles entering the message parsing pipeline is reduced, and the message parsing capability is achieved far exceeding the single-stream line speed, solving the problem of wasting the performance of the parsing pipeline.

[0218] 2) According to the calculation of the deepest path of the configured network topology diagram in this application, the number of cycles that need to be pruned is obtained, which solves the problem of ensuring sufficient header information after pruned.

[0219] 3) According to the present application, multiple message streams share one message parsing pipeline, which fully utilizes the performance far exceeding the line speed of a single stream and solves the problems of circuit area and instruction space of multiple parsing pipelines.

[0220] 4) According to the present application, message storage and parsing are divided and processed in parallel before message parsing, thereby achieving the effect of overlapping partial message processing, further improving the processing efficiency and response speed of the system.

[0221] To sum up, the solution of the present application solves the problem of wasting parsing pipeline performance, ensures sufficient header information after trimming, saves pipeline circuit area and instruction space, reduces the overall delay of message processing, and improves system performance and efficiency by optimizing the message parsing pipeline.

[0222] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is specifically performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit ASIC, appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.

[0223] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0224] In the present application, features described and / or illustrated for one embodiment may be used in the same manner or in a similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.

[0225] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the embodiments of the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A programmable message parsing method, characterized in that: include: Based on multiple channels, header clipping is performed on each message in the multiple message streams to obtain and cache the clipped target messages corresponding to each of the channels; Inputting the target messages of each of the channels into a programmable message parsing pipeline module shared by each of the channels, respectively, so that the programmable message parsing pipeline module takes the layered protocol of the target message as the current target processing object, and performs preset programmable message parsing actions on the target processing object in parallel based on various preset special function registers set in the programmable message parsing pipeline module, so as to obtain layered protocol parsing result data corresponding to the target message of each of the channels; The special function registers include a hierarchical jump register and a hierarchical length calculation register; Cache the layered protocol parsing result data corresponding to each of the target messages according to the channels to which they belong; Outputting cached layered protocol parsing result data based on each channel; The method of performing header clipping on each message in the multiple message streams based on the multiple channels to obtain and cache the clipped target messages corresponding to each of the channels includes: Obtaining the deepest header in all message paths from the network topology corresponding to the multiple message flows, and determining a current clipping header depth threshold for each message in the multiple message flows based on the deepest header; Using the clipping header depth threshold, clipping the header of each message in the multiple message streams based on each of the channels, so as to obtain the clipped target message corresponding to each of the channels; The target messages corresponding to the respective channels are cached in the respective channels.

2. The programmable message parsing method according to claim 1, characterized in that: The step of inputting the target messages of each channel into a programmable message parsing pipeline module shared by each channel comprises: The target message of each channel is retrieved based on the RR scheduling method, so as to input the target message of each channel into a programmable message parsing pipeline module shared by each channel.

3. The programmable message parsing method according to claim 1, characterized in that: If the programmable message parsing pipeline module is provided with a plurality of the programmable message parsing basic processing units based on the layered protocol, the respective programmable message parsing basic processing units based on the layered protocol are sequentially connected end to end to form a corresponding parsing pipeline; The programmable message parsing basic processing unit based on the layered protocol includes: a multi-stage pipeline unit based on a VLIW wide instruction architecture, a configuration bus interface arranged at the input side of the multi-stage pipeline unit, and the same interface group respectively arranged at the input side and the output side of the multi-stage pipeline unit; The multi-stage pipeline unit is used to take the layered protocol of the target message received from the interface group on the input side as the current target processing object, and according to the configuration information obtained from the configuration bus interface, execute the preset programmable message parsing action on the target processing object in parallel based on each preset special function register to obtain the corresponding layered protocol parsing result data, and output the layered protocol parsing result data from the interface group on the output side.

4. The programmable message parsing method according to claim 3, characterized in that: The multi-stage pipeline unit comprises: an instruction fetch and alignment module and a programmable message parsing group which are sequentially arranged starting from the input side; The instruction fetch and alignment module is used to identify the layered protocol of the target message received from the interface group on the input side according to the configuration information obtained from the configuration bus interface, and hit and output the corresponding wide instructions corresponding to the layered protocol based on the VLIW wide instruction architecture; at the same time, the instruction fetch and alignment module is also used to perform header alignment processing on the layered protocol and output the corresponding aligned layered header data, so that the programmable message parsing group executes the preset programmable message parsing actions on the target processing object in parallel based on each preset special function register according to the wide instructions corresponding to the layered protocol output by the instruction fetch and alignment module and the aligned layered header data, so as to obtain the corresponding layered protocol parsing result data.

5. The programmable message parsing method according to claim 4, characterized in that: The programmable message parsing group includes a decoding module, an execution module and an update module connected in sequence; wherein the output end of the instruction fetch and alignment module is connected to the decoding module, the execution module and the update module respectively; The decoding module is used to extract various preset special function registers and various domain value fields within the current parsing range in parallel from the aligned layered header data based on the wide instruction corresponding to the layered protocol; The execution module is used to execute corresponding processing corresponding to each of the special function registers and each of the domain value fields in parallel based on the wide instruction corresponding to the layered protocol, so as to obtain calculation result data corresponding to each of the special function registers and field extraction result data corresponding to each of the domain value fields; The update module is used to update the target processing object according to the calculation result data corresponding to each of the special function registers and the field extraction result data corresponding to each of the domain value fields, so as to obtain the corresponding layered protocol parsing result data.

6. A programmable message parsing pipeline device, characterized in that: include: A multi-channel header clipping input buffer module is used to perform header clipping on each message in the multi-channel message stream based on multiple channels, and obtain and buffer the clipped target message corresponding to each of the channels; A message transmission module, used for inputting the target message of each channel into a programmable message parsing pipeline module shared by each channel; The programmable message parsing pipeline module is used to take the layered protocol of the target message as the current target processing object, and execute preset programmable message parsing actions on the target processing object in parallel based on various preset special function registers set in the programmable message parsing pipeline module, so as to obtain the layered protocol parsing result data corresponding to the target message of each channel; The special function registers include a hierarchical jump register and a hierarchical length calculation register; An output dispatcher module, used for caching the layered protocol parsing result data corresponding to each of the target messages according to the channels to which they belong; An output result cache module, used for outputting cached layered protocol parsing result data based on each channel; The method of performing header clipping on each message in the multiple message streams based on the multiple channels to obtain and cache the clipped target messages corresponding to each of the channels includes: Obtaining the deepest header in all message paths from the network topology corresponding to the multiple message flows, and determining a current clipping header depth threshold for each message in the multiple message flows based on the deepest header; Using the clipping header depth threshold, clipping the header of each message in the multiple message streams based on each of the channels, so as to obtain the clipped target message corresponding to each of the channels; The target messages corresponding to the respective channels are cached in the respective channels.

7. The programmable message parsing pipeline device according to claim 6, characterized in that: The message transmission module comprises: An input RR scheduler module is used to schedule the target message of each channel based on the RR scheduling method, so as to input the target message of each channel into a programmable message parsing pipeline module shared by each channel.

8. The programmable message parsing pipeline device according to claim 7, characterized in that: The multi-channel header clipping input buffer module comprises: Each of the channels arranged in parallel has a corresponding header clipping unit, and each of the header clipping units shares one programmable message parsing pipeline module via the input RR scheduler module; Each of the header clipping units is used to perform header clipping on the message by using a preset clipping header depth threshold, and cache the clipped target message.

9. An electronic device, comprising a network card, a smart network card or a DPU, characterized in that: The electronic device is provided with a programmable message parsing pipeline device, and the programmable message parsing pipeline device is used to execute the programmable message parsing method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Message analysis method and device based on FPGA hardware parallel pipelines

    CN106961445A