Ethernet stream message processing method and electronic device

By extracting feature identifiers from the Ethernet media access control layer and switching to an asynchronous buffer, and assembling them into a multidimensional tensor wavefront using a data formatting engine, the problem of high latency in network data stream processing is solved, achieving efficient message reception and computation synchronization, and reducing system bus bandwidth usage and memory access power consumption.

CN123164081APending Publication Date: 2026-11-24WUHAN LINGJIU MICROELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611632179.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-21
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In scenarios such as distributed intelligent computing centers and high-frequency industrial control, the processing latency of network data streams is high and difficult to determine. Existing technologies require multiple transfers of message payloads, which occupy system bus bandwidth and increase memory access power consumption. Message reception and computation are difficult to complete in the same pipeline process.

Method used

Feature identifiers are extracted by a hardware classifier at the Ethernet media access control layer. When a streaming matching rule is matched, the packet payload is switched to an asynchronous buffer, bypassing the system bus and shared buffer. The data formatting engine assembles the packet into a multidimensional tensor wavefront according to the tensor mapping parameters and directly inputs it into the computing unit for calculation.

Benefits of technology

It enables message reception, assembly, and computation to be completed in the same pipeline process, reducing end-to-end processing latency and reducing system bus bandwidth usage and memory access power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123164081A_ABST
    Figure CN123164081A_ABST
Patent Text Reader

Abstract

This application relates to an Ethernet streaming packet processing method and electronic device. The method includes: configuring streaming matching rules to a hardware classifier in the Ethernet media access control layer, configuring tensor mapping parameters to a data formatting engine, and preloading operator weights to a computation unit; during packet reception, extracting the packet's feature identifier through the hardware classifier, and outputting a stream pass-through enable signal when a streaming matching rule is matched; when the signal is valid, switching the packet payload to an asynchronous buffer through a multiplexer to bypass the system bus and shared buffer; and assembling the payload into a multidimensional tensor wavefront according to the tensor mapping parameters through the data formatting engine and inputting it into the multiply-accumulate pin of the computation unit. This application enables the packet payload to complete multidimensional tensor assembly and computation without passing through the shared buffer and system bus, reducing end-to-end processing latency and memory access power consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data stream processing technology, and in particular to an Ethernet streaming message processing method and electronic device. Background Technology

[0002] In applications such as distributed intelligent computing centers, high-frequency industrial control, and multi-node collaboration, massive amounts of tensor data need to be synchronized at high frequency and computed in a distributed manner between different physical nodes. This places high demands on the real-time performance and determinism of data interaction in computing networks.

[0003] Currently, network data stream processing generally follows a storage-then-computation architecture. After receiving a packet, the Ethernet Media Access Control layer typically stores the entire packet of data into a shared buffer via the system bus. The computing unit then reads the data from the shared buffer to perform tensor operations such as matrix multiplication and addition.

[0004] In the above method, the message payload needs to be transported multiple times from the Ethernet Media Access Control layer to the shared buffer and then from the shared buffer to the computing unit, which consumes a lot of system bus bandwidth and brings high memory access power consumption. There is a format difference between the one-dimensional serial byte stream on the network side and the multi-dimensional tensor input format required by the computing unit, which usually requires an additional format reassembly step before it can be sent to the computing unit.

[0005] The common limitation of the above methods is that the message payload must first fall into the shared buffer and wait for a relatively complete reception before it can enter the calculation stage. Therefore, it is difficult to complete the message reception, assembly and calculation in the same pipeline process, resulting in high and unpredictable end-to-end processing delays. Summary of the Invention

[0006] This application provides an Ethernet streaming packet processing method and electronic device to at least partially solve the above-mentioned technical problems.

[0007] To achieve the above objectives, according to a first aspect of this application, an Ethernet streaming packet processing method is provided, comprising: Configure streaming matching rules for the hardware classifier in the Ethernet media access control layer, configure tensor mapping parameters for the data formatting engine, and preload operator weights for the computation unit; During the process of receiving a message, the hardware classifier extracts the feature identifier of the message and outputs a stream pass-through enable signal when the feature identifier matches the streaming matching rule. When the stream pass-through enable signal is active, the payload of the message is switched to the asynchronous buffer via a multiplexer to bypass the system bus and the shared buffer. The data formatting engine assembles the payload output by the asynchronous buffer into a multidimensional tensor wavefront according to the tensor mapping parameters. The multidimensional tensor wavefront is input into the multiply-accumulate pin of the computation unit.

[0008] In some embodiments, assembling the payload output by the asynchronous buffer into a multidimensional tensor wavefront using the data formatting engine according to the tensor mapping parameters includes: The address generation unit in the data formatting engine controls the read and write pointers of the row cache according to the tensor mapping parameters. According to the read / write pointer, the bytes in the payload are written to different rows in the row cache to obtain multiple data rows.

[0009] In some embodiments, the row cache includes a ping-pong row cache, and the step of writing bytes in the payload into different rows of the row cache according to the read / write pointer to obtain multiple data rows includes: The bytes in the payload are written through the first buffer of the ping-pong row cache, and the multiple data rows are read out from the second buffer of the ping-pong row cache at the same time; When the first cache is full, bytes in the payload are written through the second cache, and the multiple data lines are read from the first cache at the same time.

[0010] In some embodiments, assembling the load output by the asynchronous buffer into a multidimensional tensor wavefront further includes: A stepped delay is applied to the plurality of data rows, and the plurality of data rows after the stepped delay is applied are output within the same clock cycle to obtain the multidimensional tensor wavefront.

[0011] In some embodiments, the Ethernet streaming message processing method further includes: Obtain the remaining capacity level of the data formatting engine and the asynchronous cache; When the remaining capacity level is lower than a preset water level threshold, a back pressure signal is output to the Ethernet media access control layer.

[0012] In some embodiments, after outputting the backpressure signal to the Ethernet media access control layer, the method further includes: The Ethernet Media Access Control layer sends a flow control frame to the network source, which is used to instruct the network source to pause sending packets. When the remaining capacity water level rises back to the safe threshold, the back pressure signal is released.

[0013] In some embodiments, switching the payload of the message to an asynchronous buffer via a multiplexer to bypass the system bus and the shared buffer includes: The multiplexer located at the data output of the Ethernet Media Access Control layer disconnects the payload from the Direct Memory Access Engine and the system bus, and directs the payload, stripped of its header, to the asynchronous buffer.

[0014] In some embodiments, directing the payload, after stripping the message header, to the asynchronous buffer includes: The payload is written to the asynchronous buffer according to the network recovery clock domain; The payload is read from the asynchronous cache according to the computing clock domain of the computing unit to synchronize the payload to the computing clock domain; wherein the storage depth of the asynchronous cache is less than the storage depth of the shared cache.

[0015] In some embodiments, the multiplexer has a first path and a second path, the first path being connected to the asynchronous buffer and the second path being connected to the system bus; the method further includes: When the stream pass-through enable signal is in an invalid state, the message is output to the system bus via the second path to be stored in the shared buffer and to trigger a network interrupt of the main processor.

[0016] The Ethernet streaming packet processing method in this embodiment extracts feature identifiers during packet reception using a hardware classifier in the Ethernet Media Access Control layer. The intended packet payload is switched to an asynchronous buffer at the multiplexer, bypassing the system bus and being written to the shared buffer. The payload is then assembled into a multidimensional tensor wavefront by a data formatting engine according to tensor mapping parameters and input to the multiply-accumulate pins of the computation unit. The packet payload can be directly transmitted on-chip, byte by byte, from the Ethernet receiver to the computation unit. This eliminates the need to wait for the entire packet to be received or for the main processor and software protocol stack to intervene, avoiding the back-and-forth movement of the payload between the shared buffer and the system bus. Therefore, packet reception, assembly, and computation can be completed in the same pipeline, thereby reducing end-to-end processing latency and consequently reducing system bus bandwidth usage and memory access power consumption.

[0017] Other features and advantages of this application will be described in detail in the following detailed description section. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating an Ethernet streaming packet processing method provided in one embodiment of this application; Figure 2 This is a flowchart illustrating an Ethernet streaming packet processing method provided in another embodiment of this application; Figure 3 This is a hardware logic block diagram of message splitting and tensor assembly provided in one embodiment of this application; Figure 4 This is a schematic diagram of the dual-modal data path and physical direct connection principle provided in one embodiment of this application; Figure 5 This is a schematic diagram of the internal structure and spatiotemporal transformation of the data formatting engine provided in one embodiment of this application; Figure 6 This is a schematic diagram of on-network computing closed-loop and back pressure flow control provided in one embodiment of this application; Figure 7 This is a structural block diagram of an electronic device provided in one embodiment of this application. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the protection scope of this application.

[0021] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0022] The Ethernet streaming packet processing method provided in this application can be applied to edge computing chips. An edge computing chip is a system-on-a-chip (SoC) that integrates an Ethernet media access control layer and a computing unit, is deployed at the network edge, and undertakes data processing tasks locally. In this application scenario, the packet payload is split and sent to the computing unit on the receiving path of the Ethernet media access control layer, without waiting for the complete packet to fall into the shared buffer. Therefore, it can achieve higher computing power per watt under the limited area and power consumption budget at the edge, and keep the end-to-end processing latency deterministic. The method provided in this application can also be applied to other chips that integrate an Ethernet media access control layer and a computing unit; this application does not limit its application to such applications.

[0023] Reference Figure 1 and Figure 2 As shown, according to a first aspect of this application, this application provides an Ethernet streaming packet processing method, comprising the following steps: Step 100: Configure streaming matching rules for the hardware classifier in the Ethernet media access control layer, configure tensor mapping parameters for the data formatting engine, and preload operator weights for the computing unit.

[0024] Specifically, the hardware classifier is a message feature recognition circuit implemented with pure combinational logic, and it has an internal rule register. Streaming matching rules refer to the conditions used to determine whether a message belongs to the streaming tensor data to be computed, such as protocol identifiers, destination port numbers, or custom tag values. Tensor mapping parameters describe the dimensions and arrangement of the tensor to be assembled, such as the number of input channels, the length and width of the feature map, the bit width, and the step size of the sliding window. Operator weights are the coefficients that participate in multiplication and addition operations in the computation unit. During the chip power-on initialization phase, the main processor writes streaming matching rules to the hardware classifier and tensor mapping parameters to the data formatting engine via the configuration bus, and preloads the operator weights into the static storage area inside the computation unit via the system bus, putting the computation unit into a streaming computation ready state.

[0025] Optionally, the streaming matching rule written by the main processor to the hardware classifier can be a single rule or multiple rules arranged in priority order; the tensor mapping parameters can be determined by the main processor according to the computation graph of the task to be processed, or they can be updated online by the main processor during the operation of the data formatting engine; the operator weights can be the convolution kernel coefficients of the convolution operation or the weight coefficients of the fully connected operation. This application does not limit the specific form of the above rules and parameters.

[0026] Step 200: During the process of receiving a message, the feature identifier of the message is extracted by the hardware classifier, and a stream pass-through enable signal is output when the feature identifier matches the streaming matching rule.

[0027] Specifically, the Ethernet Media Access Control (MAC) layer is the hardware logic layer in the Ethernet protocol responsible for data frame encapsulation, media access control, and physical link interfacing. After the Ethernet physical signal enters the MACC layer via the Physical Layer, preamble stripping is performed. A hardware classifier intervenes during data reception at the MACC layer, extracting feature identifiers from the packet header and comparing these identifiers with streaming matching rules in the rule register. (See reference...) Figure 2 As shown, when the feature identifier matches the streaming matching rule, the hardware classifier outputs a valid stream pass-through enable signal to indicate that the packet payload should enter the pass-through path. When the feature identifier does not match the streaming matching rule, the hardware classifier outputs an invalid stream pass-through enable signal, and the multiplexer maintains the traditional path, writing to the shared buffer via the direct memory access engine, triggering a regular network interrupt on the main processor, which is then handled by the software protocol stack. The above comparison and signal output are completed within one clock cycle, without the need for main processor intervention or waiting for the complete reception of the packet.

[0028] Optionally, the feature identifier can be a virtual LAN tag, a custom micro-tag, or the destination port field in the message header; the polarity of the flow pass-through enable signal can be set according to the implementation of the hardware classifier, for example, a high level indicates validity and a low level indicates invalidity. This application does not limit this.

[0029] Step 300: When the stream pass-through enable signal is valid, the payload of the message is switched to the asynchronous buffer via a multiplexer to bypass the system bus and the shared buffer.

[0030] Specifically, the multiplexer is located at the data output of the Ethernet Media Access Control (MAC) layer. When the stream pass-through enable signal is active, the multiplexer switches the packet to the pass-through path, so that the packet payload is no longer written to the shared buffer via the Direct Memory Access (DMI) engine, and does not consume system bus bandwidth. A shared buffer refers to a large-capacity memory on the chip that is shared by multiple hardware modules for reading and writing, such as on-chip static random access memory (SRAM) or off-chip dynamic random access memory (DRAM); the system bus refers to the Network on Chip (NoC) that connects the various hardware modules. An asynchronous buffer is a shallow-depth buffer located between the Ethernet MAC layer and the data formatting engine, used to temporarily store the payload and complete clock domain switching.

[0031] Optionally, the asynchronous buffer can be implemented using a first-in, first-out (FIFO) memory structure, and its memory depth can be set according to the burst length of the load and the frequency ratio of the two clock domains; the multiplexer can be a gating circuit composed of transmission gates, or a combinational logic gating circuit composed of AND gates and OR gates. This application does not limit this.

[0032] Step 400: Using the data formatting engine, the payload output by the asynchronous buffer is assembled into a multidimensional tensor wavefront according to the tensor mapping parameters.

[0033] Specifically, the data formatting engine can be a programmable hardware state machine positioned between the Ethernet media access control layer and the computing unit, used to convert the bit width and arrangement of data along the transmission path. A multidimensional tensor wavefront refers to a data set formed by rearranging a one-dimensional serial byte stream in space according to tensor mapping parameters. This data set is output in parallel within one clock cycle to meet the requirement of the computing unit array structure for simultaneous input data parallelism. The data formatting engine reads the payload from the asynchronous buffer and determines the position of each byte in the wavefront according to the tensor mapping parameters, thus completing the format conversion without passing through a shared buffer. The dwell time of the payload in the data formatting engine overlaps with the payload transmission process; that is, the data formatting engine completes assembly during payload transmission without waiting for all payloads to be received before unified processing.

[0034] Optionally, the dimension defined by the tensor mapping parameters can be two-dimensional or three-dimensional; the data formatting engine can arrange the loads by row or by channel. This application does not impose any limitation on this.

[0035] Step 500: Input the multidimensional tensor wavefront into the multiply-accumulate pin of the calculation unit.

[0036] Specifically, the computing unit can be a neural network processor, graphics processing unit, tensor processing unit, or field-programmable gate array (FPGA) or other processing device with matrix multiplication and addition capabilities. Internally, it typically contains an array structure composed of multipliers and adders, which can be implemented using a systolic array. The multiply-add pins refer to the input ports of the array structure within the computing unit. Wavefronts are fed into the array in parallel at these ports, where the multipliers and adders within the array perform the operations. Since the wavefronts are already arranged according to the format required by the computing unit, they do not need to be temporarily stored in a buffer or rearranged when input to the multiply-add pins. The entire process of the message payload from arriving at the Ethernet Media Access Control layer to entering the computing unit is completed continuously in the same hardware pipeline, achieving synchronous message reception and computation.

[0037] The Ethernet streaming packet processing method in this embodiment extracts feature identifiers during packet reception using a hardware classifier in the Ethernet Media Access Control layer. The intended packet payload is switched to an asynchronous buffer at the multiplexer, bypassing the system bus and being written to the shared buffer. The payload is then assembled into a multidimensional tensor wavefront by a data formatting engine according to tensor mapping parameters and input to the multiply-accumulate pins of the computation unit. The packet payload can be directly transmitted on-chip, byte by byte, from the Ethernet receiver to the computation unit. This eliminates the need to wait for the entire packet to be received or for the main processor and software protocol stack to intervene, avoiding the back-and-forth movement of the payload between the shared buffer and the system bus. Therefore, packet reception, assembly, and computation can be completed in the same pipeline, thereby reducing end-to-end processing latency and consequently reducing system bus bandwidth usage and memory access power consumption.

[0038] Reference Figure 5 As shown, in an optional embodiment of this application, the step of assembling the payload output by the asynchronous buffer into a multidimensional tensor wavefront according to the tensor mapping parameters through the data formatting engine includes: Step 401: The address generation unit in the data formatting engine controls the read / write pointers of the row cache according to the tensor mapping parameters.

[0039] Specifically, the Address Generation Unit (AMU) is the hardware logic within the data formatting engine used to generate storage addresses. The Line Buffer is an internal storage array within the data formatting engine used to temporarily store payloads line by line; its storage capacity is much smaller than the shared buffer. The storage banks in the Line Buffer are designated Line Buffer 0, Line Buffer 1, and Line Buffer 2 from bottom to top. The Address Generation Unit calculates the row and column addresses for each write operation based on the dimensions and stride defined by the tensor mapping parameters, and generates write pointers accordingly. Simultaneously, it generates read pointers based on the read order, ensuring that bytes in the payload fall into the Line Buffer according to the positional relationships described by the tensor mapping parameters.

[0040] Optionally, the address generation unit can be implemented using an adder and a counter, or it can be implemented using a lookup table; the storage capacity of the row cache can be set according to the size of the sliding window. This application does not limit this.

[0041] Step 402: According to the read / write pointer, write the bytes in the payload into different rows in the row cache to obtain multiple data rows.

[0042] Specifically, bytes in the payload are allocated to different rows in the line buffer under the direction of the write pointer, and bytes in the same row are stored contiguously in the line buffer. When the payload is image data scanned line by line, pixels from the first row fall into the first line buffer, pixels from the second row fall into the second line buffer, and so on. When data within a sliding window needs to be output, the data formatting engine only needs to retrieve the corresponding bytes from each data row in parallel according to the read pointer, without having to read data from the shared buffer again.

[0043] The Ethernet streaming packet processing method in this embodiment controls the read / write pointers of the line buffer according to the tensor mapping parameters through the address generation unit, so that the payload falls directly into the line buffer in bytes and is organized into data rows. The one-dimensional serial payload is thus converted into a row-arranged data structure during transmission. The format conversion and transmission overlap, without the need for the participation of the shared buffer or the compiler to perform pre-format reorganization.

[0044] In an optional embodiment of this application, the row cache includes a ping-pong row cache, and the step of writing bytes in the payload into different rows of the row cache according to the read / write pointer to obtain multiple data rows includes: The bytes in the payload are written through the first buffer of the ping-pong row cache, and the multiple data rows are read from the second buffer of the ping-pong row cache at the same time.

[0045] Specifically, a ping-pong row cache refers to a row cache with multiple internal storage banks where writes and reads can be performed alternately. The first cache bank is the storage bank currently being written to, and the second cache bank is the storage bank currently being read from; both banks perform writes and reads within the same time period, and their roles are swapped when a cache bank is full. Therefore, the payload writing process and the data row reading process can be carried out in parallel without pausing writes for reads.

[0046] Optionally, the storage bank in the ping-pong line cache can be two, three or more, and used alternately in a round-robin manner; this application does not limit the number of storage banks.

[0047] When the first cache is full, bytes in the payload are written through the second cache, and the multiple data lines are read from the first cache at the same time.

[0048] Specifically, when the first cache is full, the write path switches to the second cache, and the read path switches back to the first cache, thus achieving a swap of storage roles. Because loads continuously flow in and data lines continuously flow out, neither the input nor output of the data formatting engine will be interrupted by the other's operations.

[0049] The Ethernet streaming packet processing method in this embodiment uses multiple storage banks of a ping-pong row buffer to alternately handle writing and reading, so that the writing of the payload and the reading of the data row can be carried out in parallel within the same time period. The output rhythm of the data formatting engine is not interrupted by the arrival rhythm of the payload, thus improving the assembly efficiency and avoiding the need to expand the row buffer capacity to wait for reading.

[0050] In an optional embodiment of this application, assembling the load output by the asynchronous buffer into a multidimensional tensor wavefront further includes: applying a stepped delay to the plurality of data rows, and outputting the plurality of data rows after applying the stepped delay within the same clock cycle to obtain the multidimensional tensor wavefront.

[0051] Specifically, stepped delay refers to applying different numbers of delay units to different data rows, ensuring that bytes in each data row that need to participate in the same operation arrive at the output in the same clock cycle. For example, when performing operations in a 3×3 window, the first data row needs to be delayed by 2 clock cycles, the second data row needs to be delayed by 1 clock cycle, and the third data row is not delayed. This ensures that the bytes covered by the window in the three rows are aligned and output within the same clock cycle. The delay units can be implemented using register chains or buffers. Thus, the data rows are spatially interleaved and temporally aligned, forming a wavefront shape that can be directly input.

[0052] Optionally, the amount of delay can be determined based on the size and step size of the sliding window; this application does not limit this.

[0053] The Ethernet streaming message processing method in this application applies a stepped delay to each data line and outputs them in parallel within the same clock cycle, so that bytes scattered in different lines can be aligned and sent to the computing unit at the same time. The format difference between one-dimensional streams and multi-dimensional tensors is eliminated in the hardware path, and the computing unit does not need to wait for the compiler to complete the format reorganization.

[0054] Reference Figure 2 As shown, in an optional embodiment of this application, the method further includes: Obtain the remaining capacity level of the data formatting engine and the asynchronous cache.

[0055] Specifically, the remaining capacity level refers to the remaining available capacity of the line cache and the asynchronous cache in the data formatting engine. This level can be obtained by counting writes and reads, or by comparing the positions of the read and write pointers. The data formatting engine acquires this level in real time during payload assembly to determine if there is data backlog in the pipeline.

[0056] When the remaining capacity level is lower than a preset water level threshold, a back pressure signal is output to the Ethernet media access control layer.

[0057] Specifically, the water level threshold is a pre-set capacity limit, and its value can be set according to a certain proportion of the total capacity of the line buffer and asynchronous buffer, for example, 20% of the total capacity. When the data consumption rate of the computing unit is lower than the packet ingestion rate, the amount of data that has been loaded but not retrieved in the line buffer and asynchronous buffer gradually increases, and the remaining capacity water level decreases accordingly. When the remaining capacity water level is lower than the water level threshold, the data formatting engine outputs a backpressure signal to the Ethernet Media Access Control layer to prompt the Ethernet Media Access Control layer to control the packet transmission on the source side.

[0058] Specifically, when the remaining capacity water level is not lower than the water level threshold, the data formatting engine does not output a back pressure signal, and the load continues to be assembled into a multidimensional tensor wave surface by the data formatting engine.

[0059] Optionally, the water level threshold can be a fixed value or can be adjusted online by the main processor according to the load of the computing unit; this application does not limit this.

[0060] The Ethernet streaming packet processing method in this application embodiment obtains the remaining capacity level of the line buffer and asynchronous buffer in real time and outputs a back pressure signal when the level is lower than the threshold. This allows the congestion status of the pipeline to be reflected in the Ethernet media access control layer at the hardware level in real time, without the need for the main processor to participate, thus providing a basis for maintaining no packet loss under extreme load.

[0061] Reference Figure 6 As shown, in an optional embodiment of this application, after outputting the backpressure signal to the Ethernet media access control layer, the method further includes: The Ethernet Media Access Control layer sends a flow control frame to the network source, which instructs the network source to pause packet transmission.

[0062] Specifically, flow control frames are frames defined by the link layer to instruct the peer to pause transmission, such as pause frames (PAUSE) or priority flow control frames. Upon receiving a backpressure signal, the Ethernet Media Access Control (MAC) layer directly constructs and sends a flow control frame to the network source, pausing transmission at the network source for a preset duration. This process does not involve the main processor, nor does it require the involvement of the software protocol stack or operating system. The backpressure signal acts directly on the Ethernet MAC layer, and therefore can also be referred to as physical backpressure.

[0063] When the remaining capacity water level rises back to the safe threshold, the back pressure signal is released.

[0064] Specifically, the safety threshold is a capacity threshold used to release the throttling state. Its value is greater than the water level threshold, and a hysteresis interval is formed between the two to avoid repeated jitter of the back pressure signal. When the computing unit completes the processing of the backlogged data and the remaining capacity water level of the line buffer and asynchronous buffer rises back above the safety threshold, the data formatting engine releases the back pressure signal, the Ethernet media access control layer stops sending flow control frames, the network source resumes transmission, and the data formatting engine resumes line-speed assembly.

[0065] The Ethernet streaming packet processing method in this application embodiment automatically sends flow control frames to the network source based on the back pressure signal by the Ethernet Media Access Control layer, and automatically releases the flow control when the water level rises back to the safe threshold. The entire throttling process is completed in a closed loop within the link layer, and packets will not be discarded due to insufficient processing time, thus ensuring data integrity during heterogeneous computing power collaboration.

[0066] Reference Figure 3 and Figure 4 As shown, in an optional embodiment of this application, switching the payload of the message to an asynchronous buffer via a multiplexer to bypass the system bus and the shared buffer includes: Step 301: By using the multiplexer located at the data output end of the Ethernet Media Access Control layer, the path from the payload to the Direct Memory Access Engine and the system bus is cut off.

[0067] Specifically, the multiplexer is located at the data output of the Ethernet Media Access Control (MAC) layer, which connects to the Media Independent Interface (MII) (e.g., a Gigabit MII or a 10 Gigabit MII). The multiplexer includes a first path connected to a pass-through path and a second path connected to a legacy path. When the stream pass-through enable signal is active, the multiplexer selects the first path, thereby physically disconnecting the payload from the Direct Memory Access Engine (DMI) and the system bus, preventing the payload from being written to the shared buffer.

[0068] Optionally, the selection of the multiplexer can be driven directly by the stream pass-through enable signal, or it can be driven jointly by the stream pass-through enable signal and the internal ready signal of the Ethernet media access control layer; this application does not limit this.

[0069] Step 302: The payload after stripping the message header is directed to the asynchronous buffer.

[0070] Specifically, after parsing the message header, the Ethernet Media Access Control (MAC) layer separates the header from the payload and sends only the payload to the asynchronous buffer via a first path. This first path is an on-chip hardwired path, and the payload does not pass through the shared buffer during transmission, nor does it require additional copying operations. Since the payload does not enter the shared buffer, subsequent reading of the payload no longer involves access to the system bus or read / write operations to the shared buffer.

[0071] The Ethernet streaming packet processing method in this embodiment of the application cuts off the path of the payload to the direct memory access engine and the system bus in terms of physical connection by using a multiplexer set at the data output end of the Ethernet media access control layer. This allows the payload to be transmitted without entering the shared buffer, thereby reducing the bandwidth occupation of the system bus and the power consumption of accessing the shared buffer during the packet processing.

[0072] In an optional embodiment of this application, directing the payload after stripping the message header to the asynchronous buffer includes: Step 312: Write the payload into the asynchronous buffer according to the network recovery clock domain.

[0073] Specifically, the network recovery clock domain refers to the clock domain in which the Ethernet physical layer recovers the clock from the received signal, and its frequency corresponds to the link rate. The payload is written to the asynchronous buffer in the Ethernet Media Access Control layer according to this clock domain.

[0074] Step 322: Read the payload from the asynchronous cache according to the computing clock domain of the computing unit to synchronize the payload to the computing clock domain; wherein the storage depth of the asynchronous cache is less than the storage depth of the shared cache.

[0075] Specifically, the computation clock domain refers to the clock domain on which the computation unit performs matrix multiplication and addition operations, and its frequency is usually higher than that of the network recovery clock domain. Asynchronous buffers transfer the load from the network recovery clock domain to the computation clock domain through cross-clock domain synchronization of read and write pointers, thus bridging the two clock domains without introducing a shared buffer. Since asynchronous buffers are only used to buffer a small amount of data during clock domain switching, their storage depth is much smaller than that of shared buffers, resulting in correspondingly lower read / write power consumption.

[0076] The Ethernet streaming packet processing method in this application embodiment completes cross-clock domain transmission by setting a shallow-depth asynchronous buffer between the Ethernet media access control layer and the data formatting engine. This allows the payload to be temporarily stored in a shared buffer during its entry into the computing clock domain, enabling the payload to complete clock domain bridging on-chip with minimal buffering cost.

[0077] Reference Figure 4 As shown, in an optional embodiment of this application, the multiplexer has a first path and a second path, the first path being connected to the asynchronous buffer, and the second path being connected to the system bus; the method further includes: When the stream pass-through enable signal is in an invalid state, the message is output to the system bus via the second path to be stored in the shared buffer and to trigger a network interrupt of the main processor.

[0078] Specifically, when a message fails to match a streaming matching rule, the multiplexer selects the second path, and the message is fully written to the shared buffer via the direct memory access engine and the system bus. After each message is received, the Ethernet media access control layer triggers a network interrupt on the main processor, and the software protocol stack on the main processor performs subsequent parsing and processing. Thus, the chip maintains its original receiving and processing method for messages that fail to match the rules, and the direct path and the original path do not affect each other.

[0079] The Ethernet streaming packet processing method in this application embodiment receives hit and miss packets through two paths of a multiplexer, enabling the chip to maintain compatibility processing of ordinary packets while enabling pass-through acceleration, without having to change the original packet receiving process to access the pass-through path.

[0080] In an optional embodiment of this application, the solution provided in this application is further described in conjunction with an industrial vision inspection scenario. In this scenario, the main processor first writes the rule "matching packets with a virtual LAN identifier of 100 and a destination port of a specified value" to the hardware classifier via the configuration bus, configures the upcoming image to be an 8-bit grayscale stream with a resolution of 1024×1024, a sliding window of 3×3, and a stride of 1 to the data formatting engine, and preloads the convolutional kernel weights of the scratch feature extraction convolutional neural network into the static storage area inside the computing unit via the system bus. The image acquisition device continuously sends mixed packets, where packets without the above identifier do not match the rule. The multiplexer selects the second path, and the packets are written to the shared buffer via the direct memory access engine and processed by the main processor. When an image packet carrying the above identifier arrives, the hardware classifier outputs a valid stream pass-through enable signal after completing the preamble stripping, and the multiplexer immediately switches the payload to the asynchronous buffer without waiting for the complete reception of the 1500-byte packet frame. The payload is synchronized from the network clock domain to the computation clock domain in the asynchronous buffer, with the clock frequency transitioning from 125 MHz to 800 MHz, before entering the data formatting engine. The address generation unit in the data formatting engine controls the read / write pointers of the ping-pong row buffer according to the configured dimension and step size, sequentially placing entire rows of pixels into the first and second row buffers. When the third row of pixels arrives, the data formatting engine applies a stepped delay to each of the three rows of data, aligning the nine pixels within the 3×3 window within the same clock cycle, stitching them together into a 128-bit wide multidimensional tensor wavefront, and directly inputting it into the multiply-accumulate pins of the computation unit. The wavefront is multiplied by the pre-loaded convolutional kernel weights in the computation unit; the gate circuit delay for the entire process is on the order of tens of nanoseconds. During this period, the data formatting engine continuously monitors the remaining capacity level of the line cache and asynchronous cache. If the computing unit consumes data more slowly due to high load and the remaining capacity level is lower than the threshold, it outputs a backpressure signal to the Ethernet Media Access Control layer. The Ethernet Media Access Control layer then sends a flow control frame to the imaging device to pause transmission for a few microseconds. After the capacity level rises back to the safe threshold, the backpressure signal is automatically released, and assembly and computing resume line speed.

[0081] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0082] The embodiments, implementation methods, and related technical features of this application can be combined and substituted for each other without conflict.

[0083] According to a second aspect of this application, an electronic device is provided, comprising at least one processing device; and a memory communicatively connected to the at least one processing device; wherein the memory stores instructions executable by the at least one processing device, the instructions being executed by the at least one processing device to enable the at least one processing device to implement the method described in the above-described method embodiments and have all the beneficial effects of the above-described method, which will not be elaborated further in this application.

[0084] like Figure 7 As shown, the electronic device includes a processing unit 901 and a memory. The processing unit 901 may include one or more combinations of devices with data processing capabilities, such as a central processing unit (CPU), a graphics processing unit (GPU), a neural processing unit (NPU), a tensor processing unit (TPU), and a field-programmable gate array (FPGA). The memory may include one or more combinations of a read-only memory (ROM) 902, a random access memory (RAM) 903, a storage portion 908, and a removable medium 911. The processing unit 901 performs various appropriate actions and processes according to instructions stored in the memory to implement the methods described above. In some embodiments, the instructions are stored in the read-only memory 902 as a program, or loaded from the storage portion 908 into the random access memory 903 as a program and then executed. In some embodiments, the acceleration unit such as the graphics processor or neural processing unit in the processing unit 901 may also be configured with video memory as its local memory. The video memory may be implemented as a high-bandwidth memory or a graphics double data rate memory, or may be partitioned from a portion of the storage space in the random access memory 903. Such video memory is also a specific implementation of the memory described in this disclosure.

[0085] Processing device 901, read-only memory 902, and random access memory 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904. In some embodiments, the following components are connected to I / O interface 905: input section 906 including keyboard, mouse, etc.; output section 907 including cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; storage section 908 including hard disk, etc.; and communication section 909 including network interface card, such as LAN card, modem, etc. Communication section 909 performs communication processing via a network such as the Internet. Drive 910 is also connected to I / O interface 905 as needed. Removable media 911, such as disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 910 as needed so that computer programs read from there can be installed into storage section 908 as needed.

[0086] The above are merely preferred embodiments of this application and are not intended to limit this application in any way. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of this application without departing from the scope of the technical solution of this application shall still fall within the scope of the technical solution of this application.

Claims

1. A method for Ethernet streaming packet processing, characterized in that, The method includes: Configure streaming matching rules for the hardware classifier in the Ethernet media access control layer, configure tensor mapping parameters for the data formatting engine, and preload operator weights for the computation unit; During the process of receiving a message, the hardware classifier extracts the feature identifier of the message and outputs a stream pass-through enable signal when the feature identifier matches the streaming matching rule. When the stream pass-through enable signal is active, the payload of the message is switched to the asynchronous buffer via a multiplexer to bypass the system bus and the shared buffer. The data formatting engine assembles the payload output by the asynchronous buffer into a multidimensional tensor wavefront according to the tensor mapping parameters. The multidimensional tensor wavefront is input into the multiply-accumulate pin of the computation unit.

2. The Ethernet streaming packet processing method according to claim 1, characterized in that, The step of assembling the payload output by the asynchronous buffer into a multidimensional tensor wavefront through the data formatting engine according to the tensor mapping parameters includes: The address generation unit in the data formatting engine controls the read and write pointers of the row cache according to the tensor mapping parameters. According to the read / write pointer, the bytes in the payload are written to different rows in the row cache to obtain multiple data rows.

3. The Ethernet streaming packet processing method according to claim 2, characterized in that, The row cache includes a ping-pong row cache. The bytes in the payload are written to different rows in the row cache according to the read / write pointers, resulting in multiple data rows, including: The bytes in the payload are written through the first buffer of the ping-pong row cache, and the multiple data rows are read out from the second buffer of the ping-pong row cache at the same time; When the first cache is full, bytes in the payload are written through the second cache, and the multiple data lines are read from the first cache at the same time.

4. The Ethernet streaming packet processing method according to claim 3, characterized in that, The step of assembling the payload output by the asynchronous buffer into a multidimensional tensor wavefront further includes: A stepped delay is applied to the plurality of data rows, and the plurality of data rows after the stepped delay is applied are output within the same clock cycle to obtain the multidimensional tensor wavefront.

5. The Ethernet streaming packet processing method according to any one of claims 1 to 4, characterized in that, The method further includes: Obtain the remaining capacity level of the data formatting engine and the asynchronous cache; When the remaining capacity level is lower than a preset water level threshold, a back pressure signal is output to the Ethernet media access control layer.

6. The Ethernet streaming packet processing method according to claim 5, characterized in that, After outputting the backpressure signal to the Ethernet media access control layer, the method further includes: The Ethernet Media Access Control layer sends a flow control frame to the network source, which is used to instruct the network source to pause sending packets. When the remaining capacity water level rises back to the safe threshold, the back pressure signal is released.

7. The Ethernet streaming packet processing method according to any one of claims 1 to 4 and 6, characterized in that, The step of switching the payload of the message to the asynchronous buffer via a multiplexer to bypass the system bus and the shared buffer includes: The multiplexer located at the data output of the Ethernet Media Access Control layer disconnects the payload from the Direct Memory Access Engine and the system bus, and directs the payload, stripped of its header, to the asynchronous buffer.

8. The Ethernet streaming packet processing method according to claim 7, characterized in that, The step of directing the payload, after stripping the message header, to the asynchronous buffer includes: The payload is written to the asynchronous buffer according to the network recovery clock domain; The payload is read from the asynchronous cache according to the computing clock domain of the computing unit to synchronize the payload to the computing clock domain; wherein the storage depth of the asynchronous cache is less than the storage depth of the shared cache.

9. The Ethernet streaming packet processing method according to any one of claims 1 to 4, 6, and 8, characterized in that, The multiplexer has a first path and a second path, the first path being connected to the asynchronous buffer, and the second path being connected to the system bus; the method further includes: When the stream pass-through enable signal is in an invalid state, the message is output to the system bus via the second path to be stored in the shared buffer and to trigger a network interrupt of the main processor.

10. An electronic device, characterized in that, include: At least one processing device; as well as, A memory communicatively connected to the at least one processing device; wherein the memory stores instructions executable by the at least one processing device, the instructions being executed by the at least one processing device to enable the at least one processing device to implement the Ethernet streaming message processing method as described in any one of claims 1 to 9.