A network processor, a network data processing device and a chip

By allowing at least two hardware threads to share the instruction pipeline and storage module in the network processor, zero data movement between threads is achieved, which solves the problem of power consumption and time extension in hardware thread data transmission and improves processor performance.

CN118012510BActive Publication Date: 2024-10-25SHENZHEN JAGUAR MICROSYSTEMS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410410574.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-08
Publication Date
2024-10-25
Estimated Expiration
2044-04-08

AI Technical Summary

Technical Problem

Existing network processors require intermediate modules during data transmission between hardware threads, resulting in increased power consumption, wasted computing resources, extended data processing time, and reduced performance.

Method used

Design a network processor in which at least two hardware threads share the instruction pipeline and storage module. The threads can directly access and transmit data through the shared storage module, avoiding the use of intermediate modules and achieving zero data movement.

Benefits of technology

It reduces network processor power consumption and complexity, reduces data processing time, and improves performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118012510B_ABST
    Figure CN118012510B_ABST
Patent Text Reader

Abstract

The present application relates to a network processor, a network data processing device and a chip, comprising at least two threads, an instruction pipeline and a storage module, wherein at least two threads share the instruction pipeline and the storage module; one of the at least two threads is used to execute a first instruction output by the instruction pipeline to obtain first data, and write the first data into a storage unit corresponding to a first storage address of the storage module; another of the at least two threads is used to execute a second instruction output by the instruction pipeline, and send a first request to one of the at least two threads; one of the at least two threads is also used to respond to the first request, send the first storage address to another of the at least two threads, and another of the at least two threads is also used to receive and read the first data from the storage module according to the first storage address. Through the present application, the power consumption and complexity of the network processor can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of integrated circuit development, and in particular to a network processor, a network data processing device and a chip. Background Art

[0002] In modern computer architecture, a network processor may include one or more physical cores, and a physical core may contain multiple hardware threads, so that a physical core can have the ability to process instructions in parallel. Each hardware thread can be regarded as an independent working unit that can execute program instructions, manage status, and process data. Therefore, in the eyes of the operating system, each hardware thread is like a separate processor that can be assigned independent tasks.

[0003] Each hardware thread will be assigned an independent cache module exclusively for the corresponding hardware thread. When data is transmitted between different hardware threads, for example, hardware thread a processes data data1 to obtain data data2, and this data2 will be stored in the cache module m1 assigned to hardware thread a. If hardware thread b needs to use this data data2, it needs to go through an intermediate module to take data data2 out of cache module m1 and then put it into the cache module m2 of hardware thread b.

[0004] The above data transmission method between hardware threads has the following problems:

[0005] An intermediate module needs to be added to complete the data transmission between hardware threads. The data movement between cache modules and the maintenance of cache consistency require additional energy and computing resources, which will generate certain power consumption and increase data processing time, thus reducing the performance of the network processor. Summary of the invention

[0006] The purpose of the present application is to provide a network processor, a network data processing device and a chip to reduce the power consumption and complexity of the network processor.

[0007] To achieve the above object, an embodiment of the present application provides a network processor, comprising at least two threads, an instruction pipeline and a storage module, wherein the at least two threads share the instruction pipeline and the storage module;

[0008] One of the at least two threads is used to receive a first instruction output by the instruction pipeline, execute the first instruction to obtain first data, and write the first data into a storage unit corresponding to a first storage address of the storage module;

[0009] Another thread among the at least two threads is used to receive a second instruction output by the instruction pipeline, and execute the second instruction to send a first request to one of the at least two threads;

[0010] One of the at least two threads is further used to respond to the first request and send the first storage address to another thread of the at least two threads, and the other thread of the at least two threads is further used to receive and read the first data from the storage module according to the first storage address.

[0011] The at least two threads share an instruction pipeline and a storage module. For example, assuming that the at least two threads include a first thread and a second thread, when the first thread executes a first instruction to obtain first data, it can store the first data in the shared storage module and record a first storage address of the first data in the storage module. If the second thread needs to obtain the first data, the second thread can send a request to the first thread, and the first thread responds to the request and sends the first storage address it records to the second thread. The second thread can read directly from the shared storage module according to the first storage address without the need for data transmission through an intermediate module, thereby achieving zero data movement, which helps to reduce power consumption and heat generation, and reduces data processing time. Since the intermediate modules are reduced, the complexity of the network processor is also reduced.

[0012] An embodiment of the present application further provides a network data processing device, comprising at least two network processors as described in the above embodiments.

[0013] An embodiment of the present application further provides a chip, comprising the network processor described in the above embodiment, or the network data processing device described in the above embodiment. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0015] Figure 1 A schematic diagram of the structure of a network processor in one embodiment of the present application.

[0016] Figure 2 This is a schematic diagram of the structure of a network processor in another embodiment of the present application.

[0017] Figure 3 This is a structural diagram of a thread management module in another embodiment of the present application.

[0018] Figure 4 This is a schematic diagram of the structure of a storage module in one embodiment of the present application.

[0019] Figure 5 It is a schematic diagram of the structure of a storage device in one embodiment of the present application.

[0020] Figure 6 A schematic diagram of a VxLan message processing architecture in an embodiment of the present application.

[0021] Figure 7 It is a schematic diagram of the structure of a network data processing device in one embodiment of the present application. DETAILED DESCRIPTION

[0022] The detailed description of the drawings is intended as an illustration of some embodiments of the present application, and is not intended to represent the only form in which the present application can be implemented. It should be understood that the same or equivalent functions can be accomplished by different embodiments intended to be included in the spirit and scope of the present application.

[0023] like Figure 1 As shown, an embodiment of the present application provides a network processor, which is a physical core, which can be an ME (Micro Engine) or an NPU (Network Processing Unit), including at least two threads (hardware threads), an instruction pipeline (Instruction Pipeline) and a storage module. The at least two threads share the instruction pipeline and the storage module, which means that at least two threads of a physical core can access the storage module, can read / write to the buffer storage module, and can execute the instructions output by the instruction pipeline. ME refers to a micro engine in a network processor, which is used to perform specific data processing tasks and instruction sets. ME is usually highly specialized and optimized, and is designed to perform certain specific network processing functions, such as processing specific types of messages, performing protocol parsing and forwarding operations, etc. NPU is a processing unit specially designed for processing network messages, usually including multiple processing engines and hardware accelerators, which are used to perform network processing tasks such as message parsing, routing decisions, and traffic forwarding. NPU plays a role in network devices similar to that of CPU in general computing devices, but is more focused on processing network messages.

[0024] In a network processor, the front end and the back end usually refer to different parts of network processing, which play different roles in the message processing flow. The front end is usually the part of the network processor that directly interacts with the external network interface and is responsible for receiving and sending messages; the front end may include the physical layer interface, media access control (MAC) layer processing, network layer processing (such as IP protocol processing) and link layer processing. The front end is used to ensure that the reception and transmission of messages meet the requirements of the network protocol and perform necessary processing, such as error detection and correction. The back end is the part of the network processor that processes messages, such as high-level protocol processing, content processing, security checks and message scheduling. The back end may include instruction pipelines, content checks, QoS processing, routing decisions and output interface scheduling; while the physical core is the hardware unit that executes instructions inside the processor, and they can process instructions in parallel. The instruction pipeline is a series of ordered hardware units that work together, and each unit is responsible for executing part of the instruction; the instructions generated by the instruction pipeline are sent to the physical core for execution; after the physical core executes the instruction, the result is fed back to the pipeline to continue to execute subsequent instructions. In this embodiment, the physical core includes at least two hardware threads, each of which has its own execution state and register file, and is like an independent processor that can execute instructions assigned to it (i.e., instructions generated by the instruction pipeline). This design allows the processor to execute multiple threads in parallel, thereby improving the throughput and performance of the processor. In this way, the instruction pipeline can efficiently output instructions to each hardware thread of the physical core for execution.

[0025] One thread a of the at least two threads is used to receive the first instruction output by the instruction pipeline, execute the first instruction to obtain first data, and write the first data into a storage unit corresponding to the first storage address of the storage module; specifically, the first instruction in this embodiment does not particularly refer to a certain instruction type, and the first instruction, for example, processes certain data to obtain new data, and this new data is stored in the storage module as the first data; for example, a security check, a content check, etc. is performed on certain data, and if the check is qualified, the certain data is stored in the storage module as the first data; the first data stored in the storage module waits for further processing, for example, other threads continue to complete the next step of processing to obtain other data, or for example, is sent out.

[0026] Another thread b among the at least two threads is used to receive a second instruction output by the instruction pipeline, execute the second instruction and send a first request to the thread a; specifically, the second instruction does not particularly refer to a certain instruction type, and the second instruction is, for example, processing the first data to obtain the second data, and then storing the second data in a storage unit corresponding to the second storage address of the storage module, and for another example, sending the first data out; before processing the first data, the thread b needs to send a request to the thread a to obtain the storage address of the first data.

[0027] The thread a is further configured to respond to the first request and send the first storage address to the thread b. The thread b is further configured to receive and read the first data from the storage module according to the first storage address.

[0028] In this embodiment, when threads a and b are transferring data, thread b can directly read the first data from the shared storage module according to the first storage address without the need to transmit data through an intermediate module, thereby achieving zero data movement, helping to reduce power consumption and data processing time. Since the intermediate modules are reduced, the complexity of the network processor is also reduced.

[0029] In some embodiments, Figure 2 As shown, the network processor includes a thread management module, the thread management module includes the at least two threads and at least two state machines (FiniteState Machine) corresponding to the at least two threads, and the at least two state machines are respectively used to control the threads corresponding thereto to execute the instructions output by the instruction pipeline. Specifically, the thread management module is provided with a first instruction pipeline interface and a first bus interface, the first instruction pipeline interface is used to receive the instructions output by the instruction pipeline, the instructions output by the instruction pipeline carry the relevant information of the thread executing the instruction, according to the relevant information, the thread management module assigns the instructions received by the first instruction pipeline interface to the corresponding thread for execution, and the first bus interface is used to transfer data with other network processors or external devices through the bus; further, each thread has its own state machine for managing its execution process and state transition; each thread executes the corresponding computing task according to the instructions of its corresponding state machine and the instructions assigned to it. The thread management module controls the execution of the corresponding thread through the state machine, so that the network processor can efficiently process network data and execute various network tasks.

[0030] In some embodiments, Figure 3 As shown, the thread management module further includes at least two thread queue pairs corresponding one-to-one to the at least two threads;

[0031] The thread queue pair corresponding to each thread includes a completed thread queue and a request thread queue, wherein the completed thread queue is used to store the storage address of the data processed by the corresponding thread in the storage module, and the request thread queue is used to store the requests of other threads;

[0032] Each thread is used to determine the data to be sent according to the request in its corresponding request thread queue, and to determine whether the data to be sent is ready according to the storage address in its corresponding completed thread queue. If so, the storage address corresponding to the data to be sent is read from the completed thread queue and sent to other threads.

[0033] Specifically, the completed thread queue is used to store the storage address of the data that the corresponding thread has processed in the storage module, which means that when a thread completes processing of a data, it will add the storage address of the data to the completed thread queue and wait for dequeue; the request thread queue is used to store requests from other threads to its own thread. When a thread needs to obtain data processed by another thread, it will send a request to that thread, and the request will be added to the request thread queue of that thread; further, the requests in the request thread queue include specific attribute information, and the storage address in the completed thread queue also includes specific attribute information. Each thread will process the request of its request thread queue, and can query whether there is a storage address with the same characteristic attribute information in its completed thread queue based on the specific attribute information of any request in its request thread queue. If so, it determines whether the data to be sent (that is, the data requested by other threads) is ready, dequeues the queried storage address, and sends the storage address to other threads. Other threads can access the storage module based on the received storage address to read the data they want to obtain.

[0034] It should be noted that, through queue pair management, each thread can utilize resources more efficiently because they can process requests only when data is ready, instead of waiting all the time; the thread queue pair allows each thread to request and provide data in an asynchronous manner, which helps to improve communication between threads, so that each thread can collaborate and respond more flexibly; therefore, the thread queue pair provides an efficient, secure and flexible data processing mechanism in the network processor, which helps to improve the performance and reliability of the system.

[0035] In some embodiments, Figure 4As shown, the storage module includes multiple memories (buffers), each memory has a unique memory id; each memory includes multiple storage units, each storage unit has a corresponding data type id, used to store data of the data type corresponding to its data type id; the storage address includes the memory id and the data type id, and the request of other threads includes the thread id corresponding to the other threads and the data type id of the data requested by the other threads.

[0036] This embodiment classifies and organizes the storage units required in the thread processing business process, mainly into two dimensions: (1) a memory is divided into multiple storage units according to the usage function, and a storage unit with a usage function is assigned a data type id, and the data type id corresponds to the buffer function type, such as key buffer, meta buffer, message buffer, etc.; the key buffer is usually used to store input key values, such as keyboard input, mouse clicks, etc.; the meta buffer can be used to store metadata, which is data about data, which describes the characteristics and attributes of the data, such as the structure, type, source, size and other information of the data; the message buffer is used to store message data in network communication; the specific implementation and use of the buffer may vary according to the application scenario and design requirements. They are usually used to optimize data flow and processing, reduce system bottlenecks, and improve overall performance; storage units with the same data type id have the same buffer function, and a multi-bank storage structure can be used in the integrated circuit IP implementation; (2) One storage unit with each buffer function is taken to form a memory, and each memory contains one storage unit with various buffer functions. One memory is assigned a memory id, that is, memories with different memory ids have the same structure and the same function. Before processing the business, the thread first obtains the memory id and data type id of the storage unit. The memory id and data type id will always be recorded in the status of the control and status register (CSR) corresponding to the thread. Various access operations performed by the thread on the storage module are performed in the storage unit corresponding to the memory id and data type id. After the processing is completed, the memory id and data type id are written into the completed thread queue of the thread.

[0037] Specifically, in this embodiment, the data type id is used as the specific attribute information of the storage address and the request. The instruction pipeline has no special requirements and can be a scalar execution, superscalar execution, or out-of-order execution pipeline shared by multiple threads. As long as the execution instructions listed later can be identified and distributed to the thread management module, there are no other special requirements. The instructions output by the instruction pipeline need to provide the data type id.

[0038] Taking thread a and thread b as examples, it is assumed that thread a and thread b are executing operation instructions in parallel respectively, and the data processed by thread a is to be passed to thread b for further processing. Thread a executes the first instruction to generate a first data with a data type id of A. The first data is stored in a cache unit of memory 1 with a memory id of 1, and the cache unit matches A. At this time, the storage address of the first data is (memory id=1, data type id=A); thread a receives a request from thread b (thread id=b, data type id=A), and thread b's thread id is b, requesting data with a data type id of A; if thread a determines that the first data requested by thread b is ready according to its thread queue pair, at this time, thread a will send the storage address (memory id=1, data type id=A) in its completed thread queue to thread b, and thread b reads the first data from the cache unit matching A in the memory with memory id=1 according to the storage address (memory id=1, data type id=A), and then proceeds to the next step of processing.

[0039] In this embodiment, the storage address of the data is represented by the memory id and the data type id, so that the thread can quickly find the data in the storage module according to the memory id and the data type id.

[0040] Then continue processing. If thread b is the last level of the pipeline of the processing unit, then thread b is assumed to execute the second instruction, and processes the first data to generate data with a data type id of B. The data is stored in a cache unit matching B in the memory with memory id = 2. At this time, the storage address of thread b's data is (memory id = 2, data type id = B), then (memory id = 2, data type id = B) This storage address will enter the completed processor queue.

[0041] In some embodiments, for two storage addresses with the same data type ID in the completed thread queue, the dequeue priority of the storage address that enters the queue first is higher than the dequeue priority of the storage address that enters the queue later; for two storage addresses with different data type IDs in the completed thread queue, the dequeue priorities are the same;

[0042] For two requests with the same data type id in the request thread queue, the dequeue priority of the request that enters the queue first is higher than the dequeue priority of the request that enters the queue later; for two requests with different data type ids in the request thread queue, the dequeue priorities are the same.

[0043] Specifically, in the completed thread queue, two storage addresses of the same data type id need to follow the first-in-first-out principle and are stored sequentially, while storage addresses of different data type ids do not need to follow the first-in-first-out principle and are stored non-sequentially.

[0044] For example, if there are two storage addresses with data type id A in the completed thread queue of thread a, namely (memory id=1, data type id=A) and (memory id=2, data type id=A), (memory id=1, data type id=A) enters the queue first and (memory id=2, data type id=A) enters the queue later, and there is only one request (thread id=b, data type id=A) from thread b with data type id A in the request thread queue of thread a, then the storage address (memory id=1, data type id=A) is dequeued from the completed thread queue, and the request (thread id=b, data type id=A) is dequeued from the request thread queue, and thread a will dequeue the storage address (memory id=1, data type id=A) that entered the queue first and send it to thread b;

[0045] For another example, if there are two storage addresses with data type id A in the completed thread queue of thread a, namely (memory id=1, data type id=A) and (memory id=2, data type id=A), (memory id=1, data type id=A) enters the queue first and (memory id=2, data type id=A) enters the queue later, and in the request thread queue of thread a there are only two requests from thread b with data type id A, namely (thread id=b, data type id=A) and (thread id=b, data type id=A), then the storage address (memory id=1, data type id=A) is dequeued from the completed thread queue and enters the queue first. The request of the queue (thread id=b, data type id=A) is dequeued from the request thread queue. Thread a will first dequeue the storage address (memory id=1, data type id=A) that entered the queue first and send it to thread b. Then, the storage address (memory id=2, data type id=A) is dequeued from the completed thread queue, and the request (thread id=b, data type id=A) that entered the queue later is dequeued from the request thread queue. Thread a will continue to dequeue the storage address (memory id=2, data type id=A) that entered the queue later and send it to thread b; and so on. One request reads one data, and the thread's completed thread queue and request thread queue dequeue one element each time.

[0046] For another example, if there are two storage addresses with different data type ids in the completed thread queue of thread a, namely (memory id=1, data type id=A) and (memory id=2, data type id=B), (memory id=1, data type id=A) enters the queue first and (memory id=2, data type id=B) enters the queue later, and in the request thread queue of thread a there is only one request (thread id=b, data type id=B) from thread b with data type id B, then, the storage address (memory id=1, data type id=B) is dequeued from the completed thread queue, and the request (thread id=b, data type id=B) is dequeued from the request thread queue. Thread a will dequeue the storage address (memory id=1, data type id=B) and send it to thread b. For queue elements with different data type ids, the dequeue of the elements that enter the queue later will not be affected by the elements that enter the queue first.

[0047] In some embodiments, Figure 5 As shown, the network processor further includes a read-write controller and a processor queue pair, the read-write controller, the storage module and the processor queue pair constitute a storage device, the processor queue pair includes a completed processor queue and a request processor queue, the completed processor queue is used to store the storage address of the data processed by the network processor in the storage module, and the request processor queue is used to store requests from other network processors or external devices;

[0048] The read-write controller is used to determine the data to be sent according to the request in the request processor queue, and determine whether the data to be sent is ready according to the completed processor queue. If so, read the storage address corresponding to the data to be sent from the completed processor queue, read the corresponding data from the storage module according to the storage address, and send it to other network processors or external devices; the read-write controller is also used to receive and perform read / write operations on the storage module according to the read / write commands of each thread.

[0049] Furthermore, the storage device is provided with a second instruction pipeline interface and a second bus interface, the second instruction pipeline interface is used to receive the read / write instructions output by the instruction pipeline, the read / write controller performs read data or write data operations on the storage module according to the read / write instructions output by the instruction pipeline, and the second bus interface is used to transfer data with other network processors or external devices through the bus.

[0050] Specifically, the completed processor queue is used to store the storage address of the data that has been processed by the corresponding network processor in the storage module, which means that when a network processor completes the processing of a data, it will add the storage address of the data to its completed processor queue and wait for dequeuing; its request processor queue is used to store requests from other network processors or external devices to this network processor. When other network processors or external devices need to obtain data processed by another network processor, they will send a request to that network processor, and the request will be added to the request processor queue of that network processor; further, the request packet in the request processor queue The storage address in the completed processor queue also includes specific attribute information. Each processor will process the request of its request processor queue. It can query whether there is a storage address with the same characteristic attribute information in its completed processor queue based on the specific attribute information of any request in its request processor queue. If so, it is determined whether the data to be sent (that is, the data requested by other network processors) is ready, and the queried storage address is dequeued. At the same time, the corresponding request is dequeued from the request processor queue, and then the data corresponding to the request is read from the storage module according to the storage address, and sent to other network processors or external devices.

[0051] It should be noted that, through queue pair management, each network processor can utilize resources more efficiently because they can process requests only when data is ready instead of waiting all the time; the processor queue pair allows each network processor to request and provide data in an asynchronous manner, which helps to improve communication between network processors so that each network processor can collaborate and respond more flexibly; therefore, the processor queue pair provides an efficient, secure and flexible data processing mechanism in the network processor, which helps to improve the performance and reliability of the system.

[0052] In some embodiments, Figure 4 As shown, the storage module includes multiple memories, each memory has a unique memory id; each memory includes multiple storage units, each storage unit has a corresponding data type id, used to store data of the data type corresponding to its data type id; the storage address includes the memory id and the data type id, the request of the other network processor or external device includes the bus interface id corresponding to the other network processor or external device and the data type id of the data requested by the other network processor or external device; the network processor is connected to other network processors or external devices via a bus.

[0053] Specifically, in this embodiment, the data type id is used as the specific attribute information of the storage address and other requests of the network processor or the external device;

[0054] Taking network processor M and network processor N as an example, the data processed by network processor M needs to be passed to network processor N for further processing. Network processor M executes instructions to generate second data with data type id C. The second data is stored in a cache unit of memory 1 with memory id 1, and the cache unit matches C. At this time, the storage address of the second data is (memory id=1, data type id=C); network processor M receives a request from network processor N (bus interface id=N, data type id=C), the bus interface id of network processor N is N, and the data with data type id C is requested; if network processor M determines that the second data requested by network processor N is ready according to its processor queue pair, at this time, network processor M will dequeue the storage address (memory id=1, data type id=C) in its completed processor queue, request (bus interface id=N, data type id=C) to be dequeued from the request processor queue, read the second data in the storage module according to the storage address (memory id=1, data type id=C), and send the second data to network processor N through the bus according to bus interface id=N.

[0055] In this embodiment, the storage address of the data is represented by the memory id and the data type id, so that the network processor can quickly find the data in the storage module according to the memory id and the data type id.

[0056] In some embodiments, for two storage addresses with the same data type ID in the completed processor queue, the dequeue priority of the storage address that enters the queue first is higher than the dequeue priority of the storage address that enters the queue later; for two storage addresses with different data type IDs in the completed processor queue, the dequeue priorities are the same;

[0057] For two requests with the same data type ID in the request processor queue, the dequeue priority of the request that enters the queue first is higher than the dequeue priority of the request that enters the queue later; for two requests with different data type IDs in the request processor queue, the dequeue priorities are the same.

[0058] Specifically, in the completed thread queue, two storage addresses of the same data type id need to follow the first-in-first-out principle and are stored sequentially, while storage addresses of different data type ids do not need to follow the first-in-first-out principle and are stored non-sequentially.

[0059] For example, if there are two storage addresses with data type id A in the completed processor queue of the network processor M, namely (memory id=1, data type id=A) and (memory id=2, data type id=A), (memory id=1, data type id=A) enters the queue first, and (memory id=2, data type id=A) enters the queue later, and there is only one request (bus interface id=N, data type id=A) from the network processor N with data type id A in the request processor queue of the network processor M, then the storage address (memory id=1, data type id=A) is dequeued from the completed processor queue, and the request (bus interface id=N, data type id=A) is dequeued from the request processor queue, and the network processor M will dequeue the storage address (memory id=1, data type id=A) that entered the queue first, read the corresponding data from the storage module according to the dequeued storage address (memory id=1, data type id=A), and send it to the network processor N;

[0060] For another example, if there are two storage addresses with data type id A in the completed processor queue of network processor M, namely (memory id=1, data type id=A) and (memory id=2, data type id=A), (memory id=1, data type id=A) enters the queue first and (memory id=2, data type id=A) enters the queue later, and there are only two requests with data type id A from network processor N in the request processor queue of network processor M, namely (bus interface id=N, data type id=A) and (bus interface id=N, data type id=A), then the storage address (memory id=1, data type id=A) is dequeued from the completed processor queue, and the request (bus interface id=N, data type id=A) that entered the queue first is dequeued from the request processor queue, and the network processor M will first dequeue the request that entered the queue first. The storage address (memory id=1, data type id=A) is dequeued, and the corresponding data is read from the storage module according to the dequeued storage address (memory id=1, data type id=A), and sent to the network processor N. Then, the storage address (memory id=2, data type id=A) is dequeued from the completed processor queue, and the later queued request (bus interface id=N, data type id=A) is dequeued from the request processor queue. The network processor M will continue to dequeue the later queued storage address (memory id=2, data type id=A), read the corresponding data from the storage module according to the dequeued storage address (memory id=2, data type id=A), and send it to the network processor N; and so on, one request reads one data, and the completed processor queue and request processor queue of the network processor dequeue one element each time.

[0061] For another example, if there are two storage addresses with different data type ids in the completed processor queue of network processor M, namely (memory id=1, data type id=A) and (memory id=2, data type id=B), (memory id=1, data type id=A) enters the queue first, and (memory id=2, data type id=B) enters the queue later, and there is only one request (bus interface id=N, data type id=B) from network processor N with data type id B in the request processor queue of network processor M, then the storage address (memory id=1, data type id=B) is dequeued from the completed processor queue, and the request (bus interface id=N, data type id=B) is dequeued from the request processor queue. The network processor M will dequeue the storage address (memory id=1, data type id=B), read the corresponding data from the storage module according to the dequeued storage address (memory id=1, data type id=B), and send it to the network processor N. For queue elements with different data type ids, the dequeue of the elements that enter the queue later will not be affected by the elements that enter the queue first.

[0062] In some embodiments, the data processing architecture of the at least two threads when processing data collaboratively is configured in a pipeline manner.

[0063] Specifically, the data processing architecture is set up in a pipeline mode, which means that the data processing process is divided into a series of continuous stages, and these stages are processed in sequence by multiple threads to form a pipeline. The processing results of each stage become the input of the next stage, thereby realizing parallel and continuous data processing; based on the pipeline architecture, data is processed in sequence at different stages, so it has a good order-preserving feature, that is, the processing order of data is orderly and will not be disordered due to parallel processing. In addition, thanks to the hardware thread architecture, the IPC performance of a single ME / NPU can be improved. At the same time, the corresponding software can be written for different thread tasks, and large processing tasks can be divided into multiple small thread tasks, which has a relatively good guarantee for both software stability and hardware performance.

[0064] For example, Figure 6The figure is a schematic diagram of the processing architecture of VxLan messages. The processing architecture includes multiple threads, each of which performs different pipeline functions. The original message is first processed by the first thread to distinguish whether it is IPv4 or IPv6, and the corresponding message is submitted to the corresponding second thread for processing by zero data transfer. The second thread submits the corresponding message to the third thread for processing by zero data transfer according to whether the message is UDP protocol or TCP protocol. For UDP protocol, if the message is a VxLan message, it is processed by the corresponding fourth thread. Furthermore, if another network processor is required to continue processing according to business performance, the message processed by the current network processor is routed to the thread of another network processor through the bus between the two network processors. Since the message in VxLan may be a complete L2 message, it is processed in sequence by different threads in the first another network processor, and finally sent out to another network processor after the processing is completed. In the above processing process, any data transfer between different threads in the same another network processor is zero data transfer, which greatly reduces the dynamic power consumption and time delay of the system.

[0065] like Figure 7 As shown, another embodiment of the present application provides a network data processing device, comprising at least two network processors as described in the above embodiments.

[0066] Specifically, at least two network processors can be connected via a bus to form a network processing module, which is used to support applications with more complex pipeline processing structures and can support SMP (Symmetric-Multi-Processor) data processing. Each network processor is assigned a bus interface ID.

[0067] Another embodiment of the present application further provides a chip, including the network processor described in one of the above embodiments, or the network data processing device described in another of the above embodiments.

[0068] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A network processor, characterized in that: The system comprises at least two threads, an instruction pipeline, a storage module, and at least two thread queue pairs corresponding to the at least two threads one by one, wherein the at least two threads share the instruction pipeline and the storage module; the at least two threads are hardware threads; One of the at least two threads is used to receive a first instruction output by the instruction pipeline, execute the first instruction to obtain first data, and write the first data into a storage unit corresponding to a first storage address of the storage module; Another thread among the at least two threads is used to receive a second instruction output by the instruction pipeline, and execute the second instruction to send a first request to one of the at least two threads; One of the at least two threads is further used to respond to the first request and send the first storage address to another thread of the at least two threads, and the other thread of the at least two threads is further used to receive and read the first data from the storage module according to the first storage address to achieve zero data migration; The thread queue pair corresponding to each thread includes a completed thread queue and a request thread queue, wherein the completed thread queue is used to store the storage address of the data processed by the corresponding thread in the storage module, and the request thread queue is used to store the requests of other threads; Each thread is used to determine the data to be sent according to the request in its corresponding request thread queue, and determine whether the data to be sent is ready according to the storage address in its corresponding completed thread queue. If so, read the storage address corresponding to the data to be sent from the completed thread queue and send it to other threads.

2. The network processor according to claim 1, characterized in that: It also includes at least two state machines corresponding to the at least two threads one by one, and the at least two state machines are respectively used to control the threads corresponding thereto to execute instructions output by the instruction pipeline.

3. The network processor according to claim 1, characterized in that: The storage module includes multiple memories, each memory has a unique memory id; each memory includes multiple storage units, each storage unit has a corresponding data type id, used to store data of the data type corresponding to its data type id; the storage address includes the memory id and the data type id, and the request of other threads includes the thread id corresponding to the other thread and the data type id of the data requested by the other thread.

4. The network processor according to claim 3, characterized in that: For two storage addresses with the same data type ID in the completed thread queue, the dequeue priority of the storage address that enters the queue first is higher than the dequeue priority of the storage address that enters the queue later; for two storage addresses with different data type IDs in the completed thread queue, the dequeue priority is the same; For two requests with the same data type id in the request thread queue, the dequeue priority of the request that enters the queue first is higher than the dequeue priority of the request that enters the queue later; for two requests with different data type ids in the request thread queue, the dequeue priorities are the same.

5. The network processor according to claim 1, characterized in that: The network processor further comprises a read-write controller and a processor queue pair, wherein the processor queue pair comprises a completed processor queue and a request processor queue, wherein the completed processor queue is used to store the storage address of the data processed by the network processor in the storage module, and the request processor queue is used to store requests from other network processors or external devices; The read-write controller is used to determine the data to be sent according to the request in the request processor queue, and determine whether the data to be sent is ready according to the completed processor queue. If so, read the storage address corresponding to the data to be sent from the completed processor queue, read the corresponding data from the storage module according to the storage address, and send it to other network processors or external devices.

6. The network processor according to claim 5, characterized in that: The storage module includes multiple memories, each memory has a unique memory id; each memory includes multiple storage units, each storage unit has a corresponding data type id, used to store data of the data type corresponding to its data type id; the storage address includes the memory id and the data type id, the request of the other network processor or external device includes the bus interface id corresponding to the other network processor or external device and the data type id of the data requested by the other network processor or external device; the network processor is connected to other network processors or external devices via a bus.

7. The network processor according to claim 6, characterized in that: For two storage addresses with the same data type ID in the completed processor queue, the dequeue priority of the storage address that enters the queue first is higher than the dequeue priority of the storage address that enters the queue later; for two storage addresses with different data type IDs in the completed processor queue, the dequeue priority is the same; For two requests with the same data type ID in the request processor queue, the dequeue priority of the request that enters the queue first is higher than the dequeue priority of the request that enters the queue later; for two requests with different data type IDs in the request processor queue, the dequeue priorities are the same.

8. The network processor according to any one of claims 1 to 7, characterized in that: The data processing architecture of the at least two threads when processing data collaboratively is configured in a pipeline manner.

9. A network data processing device, characterized in that: The method comprises at least two network processors according to any one of claims 1 to 8.

10. A chip, comprising the network processor according to any one of claims 1 to 8, or the network data processing device according to claim 9.

Citation Information

Patent Citations

  • Reconfigurable chip architecture for high-traffic network processing

    CN108809854A

  • Multi-thread data synchronization method

    CN111666339A

  • Interprocess memory sharing method and device

    CN114217982A

  • Data packet processing method, communication chip and computer equipment

    CN115086248A