Message processing device and method and chip
By using a combination of coprocessor cluster and core processor in the message processing device, flexible message processing and exception processing are achieved, solving the unavailability problem caused by hardware errors in the prior art, and improving processing efficiency and flexibility sex.
Patent Information
- Application Number
- CN202411189333.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-06
AI Technical Summary
In the Pipeline framework, existing acceleration engines are prone to inflexible and unavailable due to hardware errors or exceptions when processing packets, making it difficult to handle message header format exceptions and bus errors, and the hardware cannot skip the error level, resulting in the entire acceleration engine being unavailable. use.
Provide a message processing device, including a coprocessor cluster and a core processor, the coprocessor cluster processes messages in a pipelined manner, the core processor receives error messages and handles exceptions through software, and the core processor replaces the hardware exception era A first-level coprocessor realizes flexibility in message processing and reduces latency.
It improves the flexibility of packet processing, reduces processing delay, and supports richer service processing, avoiding the problem of acceleration engine unavailability caused by hardware exceptions.
Smart Images

Figure CN119088456A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a message processing device, method and chip. Background Art
[0002] Currently, acceleration engines usually use a Pipeline framework, under which message processing is completely implemented by hardware. The hardware divides message processing into multiple pipelines according to the business processing flow, and each pipeline level is implemented by a coprocessor.
[0003] When receiving a message, the acceleration engine usually needs to perform protocol processing. At the same time, the input message may have various exceptions, such as abnormal message header format. In addition, the message may also be found to be abnormal when it is processed at the pipeline level in the pipeline, such as a bus error during processing. In the hardware-implemented pipeline framework, these exceptions are all handled by hardware, which is prone to errors and not flexible enough. In addition, since the hardware cannot skip a pipeline level to proceed to the next pipeline level for processing, once a bug occurs in a pipeline level in the pipeline, the entire acceleration engine will be unavailable, which will have a fatal impact on the commercial use of the chip. Summary of the invention
[0004] Based on this, it is necessary to provide a message processing device, method and chip that can improve data processing flexibility in response to the above technical problems.
[0005] In a first aspect, the present application provides a message processing device, comprising a coprocessor cluster and at least one core processor, the coprocessor cluster comprising at least two coprocessors, and the at least two coprocessors performing message processing in a pipeline manner;
[0006] The core processor is used to receive the error information sent by the current level coprocessor, and send prompt information to the message processing requester according to the error information;
[0007] And / or, used to receive the information to be processed sent by the current level coprocessor, run software to process the information to be processed, so as to realize the function of the next level coprocessor of the current level coprocessor.
[0008] In one embodiment, the core processor is also used to determine the next level coprocessor, and when it is determined that there is no hardware abnormality in the next level coprocessor, control the input of the information to be processed to the next level coprocessor so that the next level coprocessor performs message processing; the next level coprocessor is the next level coprocessor of the next level coprocessor.
[0009] In one embodiment, the current level coprocessor is used to receive the information to be processed input therein and process the information to be processed. If there is a data anomaly during the processing, the current level coprocessor reports error information to the core processor; accordingly, the core processor sends a prompt message to the message processing requester according to the error information;
[0010] If there is no data anomaly, and the current-level coprocessor determines that its next-level coprocessor has a hardware anomaly based on the configuration information, the current-level coprocessor controls the input of the pending information to the next-level coprocessor to the core processor; accordingly, the core processor is used to run the software to process the pending information to implement the function of the next-level coprocessor to continue message processing.
[0011] In one of the embodiments, the information to be processed includes accompanying information and QPC information, and the message processing device further includes a cache unit;
[0012] The cache unit is used to cache QPC information and accompanying information, and is used to respond to a QPC read request output by a previous level coprocessor to output QPC information and corresponding accompanying information to a current level coprocessor;
[0013] Accordingly, the current level coprocessor is used to receive the QPC information and the accompanying information, and process the QPC information and the accompanying information. If there is a data anomaly during the processing, the current level coprocessor reports error information to the core processor, and the core processor sends a prompt message to the message processing requester according to the error information;
[0014] If there is no data anomaly and the current-level coprocessor determines based on the configuration information that its next-level coprocessor has a hardware anomaly, the control sends the accompanying information and QPC information to the core processor; the core processor is also used to run software to process the received QPC information and accompanying information to implement the function of the next-level coprocessor to continue message processing.
[0015] In one of the embodiments, the cache unit includes a QPC cache unit, a companion information cache unit, and a control unit;
[0016] The QPC cache unit is used to cache QPC information;
[0017] The accompanying information cache unit is used to cache the accompanying information;
[0018] The control unit is used to read the QPC information according to the received QPC read request, read the accompanying information from the accompanying information cache unit according to the accompanying information index in the QPC read request, and send the QPC information and the accompanying information to the core processor.
[0019] In one of the embodiments, if there is no data exception, and the current-level coprocessor determines that its next-level coprocessor does not have a hardware exception based on the configuration information, the current-level coprocessor controls the sending of accompanying information and QPC information to the next-level coprocessor, and the next-level coprocessor continues to process the message based on the received QPC information and accompanying information.
[0020] In one of the embodiments, the message processing device includes a message processing request receiving module;
[0021] A message processing request receiving module, used for receiving a message processing request sent by a message processing requester, allocating a thread ID to the message processing request, and sending the message processing request after the thread ID is allocated to the core processor, where the thread ID is an accompanying information index;
[0022] Accordingly, the core processor is used to receive the message processing request sent by the message processing request receiving module, parse the message header, obtain the first-level coprocessor and accompanying information of the message processing request, send the accompanying information to the accompanying information cache unit, and send a QPC read request to the control unit;
[0023] The control unit is used to read the QPC information according to the QPC read request, and read the corresponding accompanying information from the accompanying information cache unit according to the accompanying information index in the QPC read request, and send the QPC information and the accompanying information to the first-level coprocessor.
[0024] In one embodiment, each coprocessor stage processes the received QPC information and accompanying information in a pipeline manner, at least two coprocessors in the coprocessor cluster share the pipeline, and in one pipeline stage of the pipeline, only one coprocessor works.
[0025] In a second aspect, the present application further provides a message processing method, which is applied to any message processing device provided in the first aspect, and the method includes:
[0026] The core processor receives the error information sent by the current-level coprocessor, and sends a prompt message to the message processing requester according to the error information;
[0027] And / or, receiving information to be processed sent by the current level coprocessor, and running software to process the information to be processed to implement the function of the next level coprocessor of the current level coprocessor.
[0028] In a third aspect, the present application further provides a chip, comprising any message processing device provided in the first aspect.
[0029] The above-mentioned message processing device, method and chip can send error information to the core processor when a data anomaly occurs when the current-level coprocessor is processing data, and the core processor that receives the error information can take over the next-level pipeline and send a prompt message to the message processing requester according to the error information, thereby realizing the exception processing through software. In the case of a hardware anomaly in the next-level coprocessor of the current-level coprocessor, the core processor can be used as an escape route to replace the next-level coprocessor by running software to realize the corresponding function. In this way, the flexibility of message processing can be increased, and at the same time, since the core processor can realize the function by running software only when the coprocessor has a hardware anomaly, it can reduce the processing delay. In addition, since coprocessors can be added according to demand, more abundant services can be supported. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of the structure of a message processing device in an embodiment;
[0031] Figure 2 A schematic diagram of the structure of a message processing device in another embodiment;
[0032] Figure 3 A schematic diagram of the structure of a message processing device in another embodiment;
[0033] Figure 4 A schematic diagram of the structure of a message processing device in another embodiment;
[0034] Figure 5 It is a schematic diagram of a flow chart of processing a message when no data anomaly and no hardware anomaly occur in one embodiment;
[0035] Figure 6 A schematic diagram of a process for processing a message when data anomaly occurs in one embodiment;
[0036] Figure 7 A schematic diagram of a process for processing a message when a hardware anomaly occurs in one embodiment;
[0037] Figure 8 A schematic diagram of a process for processing a message after adding a service in an embodiment;
[0038] Fig. 9 A schematic diagram of the pipeline stage division of a coprocessor in one embodiment. DETAILED DESCRIPTION
[0039] 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 accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0040] The present application embodiment provides a message processing device, such as Figure 1 As shown, it includes a coprocessor cluster and at least one core processor 102, the coprocessor cluster includes at least two coprocessors 104, and the at least two coprocessors 104 perform message processing in a pipeline manner;
[0041] The core processor is used to receive the error information sent by the current level coprocessor, and send prompt information to the message processing requester according to the error information;
[0042] And / or, used to receive the information to be processed sent by the current level coprocessor, run software to process the information to be processed, so as to realize the function of the next level coprocessor of the current level coprocessor.
[0043] Among them, the core processor can run software, and the core processor can be specifically a RISC-V core processor, which is not specifically limited in the embodiments of the present application. RISC-V refers to an open source instruction set architecture (ISA, Instruction Set Architecture) based on the principle of a reduced instruction set (RISC, Reduced Instruction Set Computer). The pipeline method refers to the fact that the message processing process can be divided into multiple pipeline stages according to the corresponding complexity of the message processing process, and different pipeline stages can have different or the same coprocessors to process at the same time. Error information is used to characterize data anomalies that occur during the processing of the coprocessor. Data anomalies usually refer to abnormalities in the input message. The embodiments of the present application do not specifically limit the content of the error information. The core processor can send a prompt message to the message processing requester based on the error information to indicate that the message processing requester can resend the message.
[0044] The above situation mainly refers to the way in which data anomalies are handled when the coprocessor is processing data. In actual implementation, the coprocessor may also have hardware anomalies, that is, chip anomalies. Therefore, when the current-level coprocessor finds that its next-level coprocessor has a hardware anomaly, it can send the pending information that originally needs to be sent to the next-level coprocessor for processing to the core processor, which will process it by running software, thereby realizing the function of the next-level coprocessor of the current-level coprocessor. After the core processor has completed the processing, it can continue to connect to the processing process of the next-level coprocessor. The next-level coprocessor refers to the next-level coprocessor of the next-level coprocessor in the processing order of the message pipeline level.
[0045] The message processing device can process the exception by software because when a data anomaly occurs when the current coprocessor performs data processing, the current coprocessor can send an error message to the core processor, and the core processor that receives the error message sends a prompt message to the message processing requester according to the error message. In the case of a hardware anomaly in the next coprocessor of the current coprocessor, the core processor can be used as an escape route to replace the next coprocessor by running software to implement the corresponding function. In this way, the flexibility of message processing can be increased, and at the same time, because the core processor can implement the function by running software only when the coprocessor has a hardware anomaly, the processing delay can be reduced.
[0046] In some embodiments, the core processor is also used to determine the next level coprocessor, and when it is determined that there is no hardware abnormality in the next level coprocessor, control the input of the information to be processed to the next level coprocessor so that the next level coprocessor performs message processing; the next level coprocessor is the next level coprocessor of the next level coprocessor.
[0047] Among them, the core processor determines the next level coprocessor, mainly when the next level coprocessor of the current level coprocessor has a hardware anomaly, and then runs the software to implement the corresponding function. If the core processor determines the next level coprocessor, and the next level coprocessor has no hardware anomaly, the message processing process can be handed over to the next level coprocessor. Therefore, the core processor can input the information to be processed to the next level coprocessor, and the next level coprocessor can continue to process according to the information to be processed.
[0048] In this embodiment, when a hardware abnormality occurs in the next-level coprocessor of the current-level coprocessor, the core processor replaces the next-level coprocessor by running software to implement the corresponding function. After the core processor completes the processing, when there is no hardware abnormality in the next-level coprocessor, the core processor can pass the information to be processed to the next-level coprocessor, and the next-level coprocessor will continue the data processing process, thereby increasing the flexibility of message processing, reducing latency, and ensuring the continuation of the message processing process.
[0049] In addition, under this architecture, coprocessors can be added as needed to support richer services.
[0050] In some embodiments, the current level coprocessor is used to receive the information to be processed input therein and process the information to be processed. If there is a data anomaly during the processing, the current level coprocessor reports error information to the core processor; accordingly, the core processor sends a prompt message to the message processing requester according to the error information;
[0051] If there is no data anomaly, and the current-level coprocessor determines that its next-level coprocessor has a hardware anomaly based on the configuration information, the current-level coprocessor controls the input of the pending information to the next-level coprocessor to the core processor; accordingly, the core processor is used to run the software to process the pending information to implement the function of the next-level coprocessor to continue message processing.
[0052] Specifically, the current-level coprocessor can be a first-level coprocessor after the core processor, and the information to be processed can be transmitted through the core processor; it can also be a coprocessor after the first-level coprocessor, and the information to be processed can be transmitted through the previous-level coprocessor. The embodiment of the present application does not specifically limit this. When the current-level coprocessor processes the information to be processed, if there is a data exception, it can report error information to the core processor as mentioned in the previous process, so that the core processor sends a prompt message to the message processing requester according to the error information. If the current-level coprocessor does not have a data exception when processing the information to be processed, but determines that the next-level coprocessor has a hardware exception based on the configuration information, then the core processor can implement the corresponding function of the next-level coprocessor by running the software as mentioned in the previous process. Among them, the configuration information can be used to describe whether there is a hardware exception in its next-level coprocessor.
[0053] In this embodiment, when a data anomaly occurs when the current level coprocessor performs data processing, the current level coprocessor can send error information to the core processor, and the core processor that receives the error information can send prompt information to the message processing requester according to the error information, and when a hardware anomaly occurs in the next level coprocessor of the current level coprocessor, the core processor can replace the next level coprocessor to implement the corresponding function by running software, thereby realizing the exception processing by software. In this way, the flexibility of message processing can be increased, and at the same time, because only when the coprocessor has a hardware anomaly, the core processor implements the function by running software, thereby reducing the processing delay.
[0054] In some embodiments, Figure 2 As shown, the information to be processed includes accompanying information and QPC information, and the message processing device further includes a cache unit 106;
[0055] The cache unit 106 is used to cache the QPC information and the accompanying information, and to respond to the QPC read request output by the previous level coprocessor to output the QPC information and the corresponding accompanying information to the current level coprocessor;
[0056] Accordingly, the current level coprocessor is used to receive the QPC information and the accompanying information, and process the QPC information and the accompanying information. If there is a data anomaly during the processing, the current level coprocessor reports error information to the core processor, and the core processor sends a prompt message to the message processing requester according to the error information;
[0057] If there is no data anomaly and the current-level coprocessor determines based on the configuration information that its next-level coprocessor has a hardware anomaly, the control sends the accompanying information and QPC information to the core processor; the core processor is also used to run software to process the received QPC information and accompanying information to implement the function of the next-level coprocessor to continue message processing.
[0058] Specifically, in the Remote Direct Memory Access (RDMA) technology, in order to ensure the sequential execution of each pipeline, a first-in-first-out processing method is generally adopted. When message commands (message cmd) enter the system, they will be processed in the order they enter. During the processing, the system will access external resources such as Queue Pair Context (QPC), and the access and return of these resources are also performed in an order-preserving manner. Among them, the content of QPC can be various parameters and configuration information related to RDMA communication for processing message commands, such as Queue Pair (QC) parameters, connection status, memory mapping, etc.; it can also contain some information related to specific operations, such as the address of the external cache area (QPC Cache) for sending or receiving data, data length, etc. The accompanying information is used to indicate which bit or bits of valid data in the cache unit have errors, and to correct the data bits that have errors.
[0059] After completing the processing, the previous level coprocessor can send a QPC read request to the cache unit 106 to instruct the cache unit 106 to read the corresponding QPC information and accompanying information and transmit it to the current level coprocessor. After obtaining the QPC information and accompanying information, the current level coprocessor can process it accordingly. If there is a data anomaly during the processing, the error information can be reported to the core processor according to the previous process, and the core processor will report an error prompt. If there is no data anomaly during the processing, that is, the current level coprocessor can complete the processing normally, but the next level coprocessor has a hardware anomaly, the core processor can replace the next level coprocessor to implement the corresponding function by running the software.
[0060] In this embodiment, since the information to be processed can be further divided into QPC information and accompanying information, and can be transmitted between the coprocessor and the core processor, the message can be processed more efficiently.
[0061] In some embodiments, Figure 3 As shown, the cache unit 106 includes a QPC cache unit, a companion information cache unit and a control unit;
[0062] The QPC cache unit is used to cache QPC information;
[0063] The accompanying information cache unit is used to cache the accompanying information;
[0064] The control unit is used to read the QPC information according to the received QPC read request, read the accompanying information from the accompanying information cache unit according to the accompanying information index in the QPC read request, and send the QPC information and the accompanying information to the core processor.
[0065] It should be noted that, in actual implementation, the QPC cache unit may exist in the Cache entity, while the accompanying information cache unit may not exist in the Cache entity, and when reading or writing data, it may have a shorter data transmission path than the QPC cache unit, thereby reducing the additional delay consumed by data transmission. As can be seen from the previous content, when the current-level coprocessor determines that its next-level coprocessor has a hardware abnormality based on the configuration information, it is necessary to control the accompanying information and QPC information to be sent to the core processor. Therefore, the current-level coprocessor can send a QPC read request to the control unit to instruct the control unit to read the corresponding QPC information and accompanying information from the QPC cache unit and the accompanying information cache unit, and send them to the core processor.
[0066] In this embodiment, the cache unit includes a QPC cache unit and an accompanying information cache unit, and the accompanying information cache unit does not exist in the Cache entity, and when reading or writing data, it can have a shorter data transmission path than the QPC cache unit, so that the Cache body does not need to be involved in the accompanying information transmission processing, thereby reducing the power consumption and area of the chip.
[0067] In some embodiments, if there is no data exception, and the current-level coprocessor determines that its next-level coprocessor does not have a hardware exception based on the configuration information, the current-level coprocessor controls the sending of accompanying information and QPC information to the next-level coprocessor, and the next-level coprocessor continues to process the message based on the received QPC information and accompanying information.
[0068] Specifically, if the current-level coprocessor does not encounter data exceptions when processing data, and it is determined based on the configuration information that the next-level coprocessor does not have hardware exceptions, then the current-level coprocessor can control the sending of accompanying information and QPC information to the next-level coprocessor in the order of the pipeline, and the next-level coprocessor can continue to process the message normally.
[0069] In this embodiment, if there is no data exception when the current-level coprocessor performs data processing, and the current-level coprocessor determines that there is no hardware exception in its next-level coprocessor based on the configuration information, the accompanying information and QPC information can be sent to the next-level coprocessor to continue message processing, thereby ensuring the continuation of the message processing process.
[0070] In some embodiments, reference Figure 4 , the message processing device includes a message processing request receiving module 108;
[0071] The message processing request receiving module 108 is used to receive the message processing request sent by the message processing requester, allocate a thread ID to the message processing request, and send the message processing request after the thread ID is allocated to the core processor, where the thread ID is an accompanying information index;
[0072] Accordingly, the core processor is used to receive the message processing request sent by the message processing request receiving module 108, parse the message header, obtain the first-level coprocessor and accompanying information of the message processing request, send the accompanying information to the accompanying information cache unit, and send a QPC read request to the control unit;
[0073] The control unit is used to read the QPC information according to the QPC read request, and read the corresponding accompanying information from the accompanying information cache unit according to the accompanying information index in the QPC read request, and send the QPC information and the accompanying information to the first-level coprocessor.
[0074] Specifically, the message processing request receiving module 108 can be the input of the software definition engine (SDEI) module. The message processing request receiving module 108 can receive the message processing request sent by the message processing requester, apply for the corresponding thread ID (thread id) for the message processing request, and send the message processing request to the core processor. After receiving the message processing request, the core processor can parse the corresponding message header to determine which coprocessor needs to be processed next and the accompanying information. Among them, because the coprocessor that performs data processing next is the first coprocessor to process the message processing request, the coprocessor is a first-level coprocessor.
[0075] The core processor can send the accompanying information to the accompanying information cache unit so that the accompanying information cache unit caches the accompanying information. The core processor can also send a QPC read request to the control unit. Referring to the previous process, the control unit can read the QPC information according to the received QPC read request, and read the accompanying information from the accompanying information cache unit according to the accompanying information index in the QPC read request. Since the first-level coprocessor is required to perform data processing next, the control unit can send the QPC information and the accompanying information to the first-level coprocessor. In addition to the message processing request receiving module 108, the message processing device can also include an output module 110. The output module 110 can be an output (The output of software definition engine, SDEO) module of the software defined acceleration engine. The output module 110 can implement direct memory access (Direct Memory Access, DMA) or the output of the message.
[0076] In this embodiment, since the message processing device may further include a message processing request receiving module and an output module, the message processing process can be improved.
[0077] In some embodiments, each coprocessor stage processes the received QPC information and accompanying information in a pipeline manner, at least two coprocessors in the coprocessor cluster share the pipeline, and in one pipeline stage of the pipeline, only one coprocessor works.
[0078] Specifically, each level of coprocessor in the coprocessor cluster can process the message in sequence according to the order of the coprocessor. The data processing process of the coprocessor is divided into 5 pipeline stages to form a pipeline. In different pipeline stages, different or the same coprocessors can work at the same time. In the same pipeline stage, only one coprocessor works to avoid conflicts.
[0079] In this embodiment, the data processing process of the coprocessor can be divided into 5 pipeline stages to form a pipeline to work, thereby improving the message processing efficiency. In addition, since only one coprocessor works in the same pipeline stage, conflicts can be avoided.
[0080] For ease of understanding, the message processing device is taken as the software definition engine (SDE). Figure 5, explaining the processing of the software-defined acceleration engine. In SDE, protocol-related processing (such as packet header format checking and exception handling) can be handled by software as much as possible. Non-protocol-related processing (such as queue management and DMA operations for send queues / receive queues / completion queues, etc.) is accelerated by hardware, which can increase the flexibility of business processing while ensuring the latency performance of business processing.
[0081] At the same time, the calling of coprocessors can be defined by software. After the core processor recognizes different messages, it can call different coprocessors (for example, request messages / ACK messages / congestion notification messages can call different coprocessors). In addition, different services can call different coprocessors (for example, RDMA services and virtio-net services can call different coprocessors). Figure 5 In the example, the structure of each coprocessor can be normalized (each coprocessor has a PIPE LINE structure inside), and the input and output of each coprocessor are similar, so it is easy to add coprocessors to support richer services.
[0082] Figure 5 The message processing process can be used to implement RDMA acceleration. The corresponding received message is a send message, which is mainly aimed at situations where there is no data anomaly or hardware anomaly. Figure 5 In the example, "input" may correspond to the message processing request receiving module mentioned above, and "output" may correspond to the output module mentioned above. "Side band info" may correspond to the accompanying information cache unit mentioned above, and "Cache" may correspond to the QPC cache unit mentioned above. Based on the above description, the corresponding processing flow is as follows:
[0083] 1. When the input module receives a send message, it can assign a thread ID to the send message request (the thread ID will accompany the entire processing process of the message) and send the message header to the core processor for processing.
[0084] 2. The core processor parses the message header and performs RDMA protocol related checks, including but not limited to message header field checks. The core processor parses the message header to obtain that the next-level coprocessor is a work queue element (WQE) coprocessor, which means that the first-level coprocessor is determined.
[0085] 3. The core processor reads the QPC information required by the first-level coprocessor from the cache, that is, sends a QPC read request to the cache, and sends the accompanying information required by the first-level coprocessor to the side band info.
[0086] 4. The accompanying information is stored in Side band info with thread ID as index.
[0087] 5. The QPC read request is sent to the Cache.
[0088] 6. The QPC information and accompanying information returned from the Cache are sent to the WQE coprocessor.
[0089] 7. The WQE coprocessor checks whether the message is out of order based on the QPC information. If it is out of order, the message is discarded. If it is not out of order, it will continue to be processed by the next-level coprocessor and obtain the CI pointer of the receive queue work queue element (RQ WQE) in the receive queue from the QPC information. Since the next-level scatter / gather element (SGE) coprocessor does not need to read the QPC information, it needs to update the QPC information used by the WQE coprocessor to the cache. Among them, the order preservation of the same flow is completed in the cache. After updating the QPC information here, the messages behind the same flow can continue to be processed by the WQE coprocessor, improving the performance of the single flow. Here, the accompanying information is also required when it is processed by the next-level coprocessor.
[0090] 8. The accompanying information is returned and sent to the SGE coprocessor. The SGE coprocessor reads the Receive queue Scatter / Gather Element (RQ SGE) in the receive queue, obtains the memory region (MR) and virtual address used by the message, and sends a QPC read request for the memory protection translation table (MPT) coprocessor to the cache, carrying the accompanying information required by the next level coprocessor.
[0091] 9. The read QPC information and accompanying information are returned and sent to the MPT coprocessor. The MPT coprocessor performs a permission check. Since the next-level physical buffer list (PBL) coprocessor does not need to read the QPC information, only the accompanying information is carried when it is sent to the next-level coprocessor for processing.
[0092] 10. The accompanying information is returned and sent to the PBL coprocessor. The PBL coprocessor reads the memory translation table (MTT) and converts the virtual address to the physical address.
[0093] 11. The core processor writes the payload of the message to the memory pointed to by the physical address obtained in step 10. After the processing is completed, the thread ID of the send message can be released.
[0094] Figure 5 The message processing process is mainly aimed at the situation where there is no data anomaly and hardware anomaly. For the situation where data anomaly occurs, the specific processing process can be referred to Figure 6 .exist Figure 6 In the process, the MPT coprocessor mainly performs the corresponding processing of the MPT permission check exception when receiving the send message.
[0095] Steps 1 to 8 can refer to the normal processing flow of the send message, and steps 9 to 11 reflect the processing process when the MPT coprocessor has an MPT permission check exception.
[0096] 9. The QPC information and accompanying information returned from the Cache are sent to the MPT coprocessor. The MPT coprocessor performs a permission check, but if the permission check fails, it is not sent to the next-level PBL coprocessor for processing, but to the core processor for processing (that is, the core processor handles this exception). The MPT coprocessor reads the QPC information required by the core processor from the Cache and carries the accompanying information.
[0097] 10. The QPC information and accompanying information are returned and sent to the core processor. The core processor processes the MPT's permission check exception and can generate an exception report reporting the error, that is, generate a prompt message.
[0098] 11. The core processor checks for exceptions based on the MPT's authority and outputs a NAK message of an invalid request to the remote end, that is, sends a prompt message to the message processing requester. After the processing is completed, the thread ID of the send message can be released.
[0099] Figure 5 The message processing process is mainly aimed at the situation where there is no data anomaly or hardware anomaly. Figure 6 This is for data anomalies. For hardware anomalies, please refer to the specific processing process. Figure 7 .exist Figure 7 In the process of PBL coprocessor failure, the core processor will replace the PBL coprocessor to perform the work. In this case, the core processor is equivalent to an escape route.
[0100] Steps 1 to 8 can refer to the normal processing flow of the send message, and steps 9 to 11 reflect the processing process when there is a bug in the hardware implementation of the PBL coprocessor.
[0101] 9. The QPC information and accompanying information required by the MPT coprocessor are returned and sent to the MPT coprocessor. The MPT coprocessor performs a permission check. Since the next-level PBL coprocessor does not need to read the QPC information, only the accompanying information is sent to the next-level coprocessor for processing. At the same time, since the PBL coprocessor is abandoned due to a bug, the MPT coprocessor will indicate that the next-level coprocessor is the core processor.
[0102] 10. The accompanying information is returned and sent to the core processor, which implements the function of the PBL coprocessor.
[0103] 11. The core processor writes the payload of the message to the memory pointed to by the physical address obtained in step 10. After the processing is completed, the thread ID of the send message can be released.
[0104] As we can see from the previous content, the structure of each coprocessor can be normalized (each coprocessor has a PIPE LINE structure inside), and the input and output of each coprocessor are similar, so it is very convenient to add coprocessors to support richer services. Taking the addition of virtio-net services as an example, you can add a VIRTIO-NET coprocessor to specifically handle virtio-net services. For details, please refer to Figure 8 The specific processing process is as follows:
[0105] 1. The input module receives the virtio-net message from the network side, applies for a thread ID, and sends the message header to the core processor for processing. The process is similar to the previous content.
[0106] 2. The core processor parses the message header and finds that the message is a VIRTIO-NET message, and performs VIRTIO-NET protocol related checks.
[0107] 3. The core processor reads the QPC information of VIRTIO required by the next-level coprocessor from the cache, and carries the accompanying information required by the next-level coprocessor.
[0108] 4. The accompanying information is stored in Side band info with thread ID as index.
[0109] 5. The QPC read request is sent to the Cache.
[0110] 6. The QPC information and accompanying information returned from the cache are sent to the VIRTIO-NET coprocessor.
[0111] 7. The VIRTIO-NET coprocessor initiates a read operation of the buffer descriptor. After the buffer descriptor is read, it returns to the VIRTIO-NET coprocessor for execution.
[0112] 8. The VIRTIO-NET coprocessor initiates a DMA operation to write the message into the buffer indicated by the buffer descriptor. After completion, it returns to the VIRTIO-NET coprocessor for execution. The VIRTIO-NET coprocessor updates the used ring entry in a similar way and finally updates the used ring index. After the processing is completed, the thread ID of the virtio-net message can be released.
[0113] As we can see from the previous content, in order to simplify the physical implementation, all coprocessors can share the PIPE LINE method, as follows Fig. 9 As shown, the processing of the coprocessor is divided into 5 pipeline stages (the number of pipeline stages can be divided according to the complexity of the business). Different pipeline stages can have different or the same coprocessors working at the same time, but in the same pipeline stage, only one coprocessor will be working. For example, when pipeline stage P4 outputs a QPC read request to the cache, or writes the payload to the output module, only one coprocessor will be valid. In addition, since there is only one coprocessor working at each pipeline stage, each pipeline stage only needs one accompanying information and one QPC information, and all coprocessors share this accompanying information and QPC information, which makes the physical implementation of the acceleration engine framework simpler.
[0114] The above content is mainly embodiments related to the message processing device. The embodiment of the present application provides a message processing method, which can be applied to any of the embodiments related to the previous message processing device. The method includes:
[0115] The core processor receives the error information sent by the current-level coprocessor, and sends a prompt message to the message processing requester according to the error information;
[0116] And / or, receiving information to be processed sent by the current level coprocessor, and running software to process the information to be processed to implement the function of the next level coprocessor of the current level coprocessor.
[0117] The respective processing processes of the core processor and the coprocessor can be referred to in the previous description and will not be repeated here.
[0118] An embodiment of the present application also provides a chip, including the message processing device provided in the embodiment related to the aforementioned message processing device.
[0119] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0120] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A message processing device, characterized in that: It includes a coprocessor cluster and at least one core processor, wherein the coprocessor cluster includes at least two coprocessors, and the at least two coprocessors perform message processing in a pipeline manner; The core processor is used to receive error information sent by the current-level coprocessor, and send prompt information to the message processing requester according to the error information; And / or, used to receive the information to be processed sent by the current-level coprocessor, and run software to process the information to be processed to implement the function of the next-level coprocessor of the current-level coprocessor.
2. The message processing device according to claim 1, characterized in that: The core processor is also used to determine the next level coprocessor, and when it is determined that there is no hardware abnormality in the next level coprocessor, control the input of the information to be processed to the next level coprocessor so that the next level coprocessor performs message processing; the next level coprocessor is the next level coprocessor of the next level coprocessor.
3. The message processing device according to claim 2, characterized in that: The current-level coprocessor is used to receive the information to be processed input therein and process the information to be processed. If there is a data anomaly during the processing, the current-level coprocessor reports error information to the core processor; correspondingly, the core processor sends a prompt message to the message processing requester according to the error information; If there is no data exception, and the current-level coprocessor determines that its next-level coprocessor has a hardware exception based on the configuration information, the current-level coprocessor controls the input of the to-be-processed information to the next-level coprocessor to the core processor; accordingly, the core processor is used to run software to process the to-be-processed information to implement the function of the next-level coprocessor to continue message processing.
4. The message processing device according to claim 3, characterized in that: The information to be processed includes accompanying information and QPC information, and the message processing device also includes a cache unit; The cache unit is used to cache QPC information and accompanying information, and is used to respond to a QPC read request output by a previous level coprocessor to output QPC information and corresponding accompanying information to the current level coprocessor; Correspondingly, the current level coprocessor is used to receive the QPC information and the accompanying information, and process the QPC information and the accompanying information. If there is a data anomaly during the processing, the current level coprocessor reports error information to the core processor, and the core processor sends a prompt message to the message processing requester according to the error information; If there is no data anomaly, and the current-level coprocessor determines, based on the configuration information, that its next-level coprocessor has a hardware anomaly, the control sends the accompanying information and the QPC information to the core processor; the core processor is also used to run software to process the received QPC information and the accompanying information to implement the function of the next-level coprocessor to continue message processing.
5. The message processing device according to claim 4, characterized in that: The cache unit includes a QPC cache unit, a companion information cache unit and a control unit; The QPC cache unit is used to cache QPC information; The accompanying information cache unit is used to cache the accompanying information; The control unit is used to read QPC information according to a received QPC read request, read accompanying information from the accompanying information cache unit according to an accompanying information index in the QPC read request, and send the QPC information and the accompanying information to the core processor.
6. The message processing device according to claim 5, characterized in that: If there is no data exception, and the current-level coprocessor determines that its next-level coprocessor does not have a hardware exception based on the configuration information, the current-level coprocessor controls the sending of accompanying information and QPC information to the next-level coprocessor, and the next-level coprocessor continues to process the message based on the received QPC information and accompanying information.
7. The message processing device according to claim 5 or 6, characterized in that: The message processing device comprises a message processing request receiving module; The message processing request receiving module is used to receive a message processing request sent by a message processing requester, allocate a thread ID to the message processing request, and send the message processing request after the thread ID is allocated to the core processor, wherein the thread ID is the accompanying information index; Accordingly, the core processor is used to receive the message processing request sent by the message processing request receiving module, parse the message header, obtain the first-level coprocessor and accompanying information of the message processing request, send the accompanying information to the accompanying information cache unit, and send a QPC read request to the control unit; The control unit is used to read the QPC information according to the QPC read request, and read the corresponding accompanying information from the accompanying information cache unit according to the accompanying information index in the QPC read request, and send the QPC information and the accompanying information to the first-level coprocessor.
8. The message processing device according to claim 7, characterized in that: Each coprocessor stage processes the received QPC information and accompanying information in a pipeline manner, the at least two coprocessors in the coprocessor cluster share the pipeline, and in one pipeline stage of the pipeline, only one coprocessor works.
9. A message processing method, applied to the message processing device according to any one of claims 1 to 8, characterized in that: include: The core processor receives the error information sent by the current-level coprocessor, and sends prompt information to the message processing requester according to the error information; And / or, receiving information to be processed sent by the current-level coprocessor, and running software to process the information to be processed to implement the function of the next-level coprocessor of the current-level coprocessor.
10. A chip, characterized in that: It comprises a message processing device as described in any one of claims 1 to 8.
