Message sending buffer device and chip
By designing the sending instruction interface, the sending status control module, the read address generation module and the read data processing module in the DPU message sending buffer device, the problem that cannot be applied to different message packaging methods in the prior art is solved, and the correct implementation is achieved. The flexible encapsulation and transmission of different network messages improves universality and efficiency.
Patent Information
- Application Number
- CN202411007813.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-01
AI Technical Summary
The existing DPU message sending buffer device cannot be used at the same time for encapsulation and transmission of network messages of different packet packaging methods, and lacks universality.
A message sending buffer device is designed, including a sending command interface, a sending status control module, a read address generation module, a memory and a bus interface, which can determine the data reading direction and the reading target message according to different message packaging methods. The required number of beats is processed through the readout data processing module and sent to the counterpart device.
It realizes flexible packaging and transmission of different packet packaging methods, improves the universality and efficiency of the message transmission buffer device, and can be used for packaging from the inside to the outside, from the outside to the inside, and then from the outside to the inside to the inside to the inside to the inside. network message processing scenario.
Smart Images

Figure CN118890329A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of integrated circuits, and in particular to a message sending buffer device and a chip. Background Art
[0002] DPU (Data Processing Unit) is an intermediate node for network message processing. Its processing of network messages includes decapsulation, encapsulation, header addition, header removal, and domain segment update. The network message processing process involves assembling a new message header. In the process of assembling a new message header, the network message encapsulation methods of different business data flows are different.
[0003] The network packets of some business data flows are encapsulated from the inside out. For example, starting from the payload data of the packet, the outer packet header is gradually added. This method is suitable for scenarios where the payload data needs to be processed first and then the packet header for network transmission is gradually added.
[0004] The network packets of some business data flows are encapsulated from the outside to the inside. For example, the outermost packet header is constructed first, and then the next layer of information is gradually added inward. This method is usually used in scenarios where it is necessary to first determine the transmission details of the packet in the network and then process the payload data.
[0005] The network messages of some service data flows are first encapsulated from the inside out and then from the outside in. This method combines the above two methods. In the first stage, the message is encapsulated from the inside out. In the second stage, the message part obtained by encapsulation in the first stage is further encapsulated from the outside in to obtain the final network message. The encapsulation and transmission of network messages are performed in the message transmission buffer device (out-buffer) of the DPU. After the network message is encapsulated, it will be temporarily stored in the memory of the out-buffer and wait for transmission.
[0006] At present, the design of the message sending buffer device of the DPU is mainly to design message sending buffer devices with different functions according to different business data flows. There is no message sending buffer device that can be simultaneously applicable to the encapsulation and sending of network messages with different message encapsulation methods. Summary of the invention
[0007] The purpose of the present application is to provide a message sending buffer device (out-buffer) and a chip to improve the versatility of the out-buffer.
[0008] To achieve the above object, according to a first aspect of the present application, a message sending buffer device (out-buffer) is provided, comprising:
[0009] Send command interface, used to receive and parse the message sending command to obtain command information;
[0010] A sending state control module, used to determine the number of beats required to read the target message and the data reading direction according to the instruction information; wherein the data reading direction is one of forward reading, reverse reading, and reverse reading first and then forward reading;
[0011] A read address generation module, used to generate a read address of a current beat according to the instruction information, the number of beats required to read the target message, and the data reading direction;
[0012] A memory, used to store message data and output the read data of the current beat according to the read address of the current beat;
[0013] A read data processing module, used for processing and outputting the read data of the current shot output by the memory;
[0014] The bus interface is used to send the data output by the read data processing module to the opposite end device.
[0015] In a specific implementation, the memory is divided into a plurality of storage spaces, each storage space being defined as a buffer;
[0016] The instruction information includes a start pointer indicating a starting position for data reading, an end pointer indicating an ending position for data reading, and buffer information, wherein the buffer information is an identifier of a buffer where the target message is located, and the start position and the end position are both one byte in the buffer where the target message is located.
[0017] In a specific implementation, the sending state control module is further used to:
[0018] When the starting position is the first byte in the buffer, and the starting position is different from the ending position, determining that the data reading direction is forward reading, and the target message to be read is the data between the starting position and the ending position in the buffer;
[0019] When the starting position and the ending position are the same, determining that the data reading direction of the target message is reverse reading, and the read target message is the data between the starting position and the first byte in the buffer;
[0020] When the starting position is between the first byte and the end position in the buffer, the data reading direction is determined to be reverse order reading first and then forward order reading. The target message for reverse order reading is the data between the starting position and the first byte, and the target message for forward order reading is the data between the next byte of the starting position and the end position.
[0021] In a specific implementation, the memory is formed by splicing a first memory bank and a second memory bank, the first memory bank and the second memory bank each include a plurality of memory cells arranged in rows, and the bit width of each memory cell is the same as the bus bit width.
[0022] In a specific implementation, it also includes a data cache module;
[0023] When the data reading direction is to read in reverse order first and then in forward order, if the starting position is not the highest byte of any storage unit of the first storage body or the second storage body, the read data processing module is further used to receive the first storage unit data output by the first storage body and the second storage unit data output by the second storage body in the first beat of the reverse reading, splice part of the data in the first storage unit data with part of the data in the second storage unit data to obtain a bus width data, send the bus width data to the bus interface, and output the remaining part of the data in the storage unit data at the starting position that has not been sent to the data cache module for temporary storage;
[0024] The read data processing module is further used to receive the third storage unit data output by the first storage body in the last beat of the reverse read, splice the unsent data in the third storage unit data with the remaining data temporarily stored in the data cache module to obtain a bus bit width data, and send the bus bit width data to the bus interface.
[0025] In a specific embodiment, when the data reading direction is to read in reverse order first and then in forward order, if at least three beats are required to complete the reverse order reading, the read data processing module is further used to receive and obtain a bus bit width data based on a storage unit data output by the first storage body and a storage unit data output by the second storage body in the middle beat of the reverse order reading, and send it to the bus interface.
[0026] In a specific embodiment, the read data processing module is further used to receive and obtain a bus width data based on a storage unit data output by the first storage body and a storage unit data output by the second storage body at each beat of the forward reading or reverse reading when the data reading direction is forward reading or reverse reading, and send it to the bus interface.
[0027] In a specific implementation, the read data processing module is further used to place the data read in reverse order in a bus width data in little-endian byte order, and place the data read in forward order in a bus width data in big-endian byte order.
[0028] In a specific embodiment, it also includes:
[0029] A data writing interface, used to receive a write command and write the data to be written into a corresponding storage location in the memory according to the write command;
[0030] The status reporting module is used to obtain the real-time status information of the message sending buffer device and report the real-time status information to the control status register of the network processor.
[0031] According to the out-buffer described in the first aspect of the present application, a message sending instruction is received and parsed to obtain instruction information, and the instruction information is used to indicate how to read and send a target message, and the target message is one of encapsulated from the inside to the outside, encapsulated from the outside to the inside, and first encapsulated from the inside to the outside and then from the outside to the inside; further, according to the instruction information, the number of beats required to read the target message and the data reading direction can be determined, and the data reading direction is one of forward reading (corresponding to encapsulating from the inside to the outside), reverse reading (corresponding to encapsulating from the outside to the inside), and first reverse reading and then forward reading (corresponding to first encapsulating from the inside to the outside and then from the outside to the inside). Through the above design, the out-buffer can be simultaneously applicable to the encapsulation and sending of network messages with different message encapsulation methods, thereby improving the versatility of the out-buffer.
[0032] According to a second aspect of the present application, a chip is provided, comprising the message sending buffer device according to the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 A circuit diagram of a message sending buffer device in one embodiment of the present application.
[0035] Figure 2 A schematic diagram of a start pointer, an end pointer, and a buffer for reading data in a positive order in an embodiment of the present application.
[0036] Figure 3 A schematic diagram of a start pointer, an end pointer, and a buffer for reading data in reverse order in an embodiment of the present application.
[0037] Figure 4 A schematic diagram of a start pointer, an end pointer, and a buffer for reading data in reverse order and then in forward order in an embodiment of the present application.
[0038] Figure 5 It is a schematic diagram of the structure of a memory in one embodiment of the present application.
[0039] Figure 6 This is a circuit diagram of a message sending buffer device in another embodiment of the present application.
[0040] Markings in the figure: 1 is the instruction receiving interface, 2 is the sending status control module, 3 is the read address generation module, 4 is the memory, 5 is the read data processing module, 6 is the bus interface, 7 is the data cache module, and 8 is the write data interface. DETAILED DESCRIPTION
[0041] The detailed description of the drawings is intended as an illustration of some embodiments of the present application, and is not intended to represent the only form in which the present application can be implemented. It should be understood that the same or equivalent functions can be accomplished by different embodiments intended to be included in the spirit and scope of the present application.
[0042] An embodiment of the present application provides a message sending buffer device (out-buffer), see Figure 1 The out-buffer of this embodiment includes an instruction receiving interface, a sending state control module, a read address generating module, a memory, a read data processing module and a bus interface.
[0043] The sending instruction interface is used to receive and parse the message sending instruction to obtain instruction information;
[0044] Specifically, the message sending instructions are issued by the control logic of the DPU. These instruction information is used to indicate how to read and send the target message, including but not limited to the storage address of the target message in the out-buffer, the message data size, information related to the data reading direction, and the information of the opposite device; the target message refers to the network message that has been encapsulated and stored in the memory of the out-buffer.
[0045] The sending state control module is used to determine the number of beats required to read the target message and the data reading direction according to the instruction information; wherein the data reading direction is one of forward reading, reverse reading, and reverse reading first and then forward reading; the target message is one of encapsulating from inside to outside, encapsulating from outside to inside, and encapsulating from inside to outside and then from outside to inside;
[0046] Specifically, the beat number refers to the number of clock cycles required to read the target message. The amount of data read in each beat is limited, which usually depends on the design of the bus width. For example, if the bus width is 32 bytes, then the message data read in each beat is 32 bytes, because each beat can only send 32 bytes of data to the other device through the bus. Therefore, a 64-byte network message requires two beats to be completely read and sent.
[0047] The data reading direction refers to the order in which the data of the target message is read, where: forward reading refers to starting from the beginning of the message and reading one by one in the natural order of the data; reverse reading refers to starting from the end of the message and reading the data one by one in reverse order; reverse reading first and then forward reading refers to first reading a part of the data in reverse order from the end of the message, and then reading the remaining data in forward order from the beginning of the message.
[0048] It should be noted that forward reading is a data reading method for network messages encapsulated from the inside to the outside, reverse reading is a data reading method for network messages encapsulated from the outside to the inside, and reverse reading first and forward reading is a data reading method for network messages encapsulated from the inside to the outside and then from the outside to the inside. Through such a corresponding relationship, the message sending buffer device can adopt the corresponding data reading direction according to different message encapsulation requirements, thereby realizing flexible message encapsulation and sending. Such a design enables the message sending buffer device to be applicable to a variety of different network message processing scenarios, thereby improving the versatility and efficiency of the out-buffer.
[0049] The read address generation module is used to generate a read address of the current beat according to the instruction information, the number of beats required to read the target message, and the data reading direction;
[0050] Specifically, the read address generation module can determine which addresses in the target message store data that are to be read in forward order and which addresses store data that need to be read in reverse order based on the instruction information, the number of beats required to read the target message, and the data reading direction, and generate a read address for each beat accordingly, which is then sent to the memory; for example, if the message is encapsulated from the inside to the outside and needs to be read in forward order, the read address generation module will start from the starting address of the message payload and generate a read address for each beat in sequence; for another example, if the message is encapsulated from the outside to the inside and needs to be read in reverse order, the read address generation module will start from the address of the outermost header of the message and generate a read address for each beat in reverse order.
[0051] Since the memory can only respond to one read address and output corresponding read data in each beat, the read address generation module generates a read address in each beat and sends it to the memory until the data of the entire target message is read.
[0052] The memory is used to store message data and output the read data of the current beat according to the read address of the current beat;
[0053] Specifically, the memory is a part of the out-buffer, which is used to temporarily store the message data to be sent. When the message is ready to be sent, it will be stored in this memory. The memory reads the data from the correct position according to the read address of the current beat provided by the read address generation module, and outputs the read data of the current beat.
[0054] The read data processing module is used to process the read data of the current shot output by the memory and then output it;
[0055] Specifically, the read data processing module is responsible for processing the data read from the memory to ensure that the read data is placed on the bus in the correct format and order to meet specific network protocols and transmission requirements, such as whether the data needs to be swapped, shifted, and expanded.
[0056] The bus interface is used to send the data output by the read data processing module to the opposite end device;
[0057] Specifically, the bus interface is the interface between the out-buffer and external devices (such as network interface cards, other processing units, etc.). The bus interface is responsible for sending the processed data output by the read data processing module to the opposite device through the bus network. The opposite device refers to the device that requests the target message.
[0058] Furthermore, in some more specific embodiments, the memory is divided into a plurality of storage spaces, each storage space being defined as a buffer;
[0059] The instruction information includes a start pointer indicating a starting position for data reading, an end pointer indicating an ending position for data reading, and buffer information, wherein the buffer information is an identifier of a buffer where the target message is located, and the start position and the end position are both one byte in the buffer where the target message is located.
[0060] Specifically, the divided multiple buffers can be used to store different messages or message fragments. In this embodiment, the start pointer is a pointer indicating the starting position of data reading, which points to a certain byte of the target message in a specific buffer. The start pointer tells the read address generation module where to start reading the message data in a forward direction or in a reverse direction.
[0061] The termination pointer is a pointer indicating the end position of data reading. It points to a byte of the target message in a specific buffer. The termination pointer tells the read address generation module where to end data reading.
[0062] Buffer information is identification information about the buffer where the target message is located. When the memory is divided into multiple buffers, each buffer will have a unique identifier. The buffer information indicates which buffer the read address generation module and the memory should access to read the message data.
[0063] When a message needs to be sent, the sending instruction interface will receive a message sending instruction, and the start pointer, end pointer and buffer information can be extracted according to the message sending instruction. The sending state control module and the read address generation module determine the address and order / direction of the data to be read in each beat based on this information. The memory reads the data from the correct buffer according to the generated address, and then after being processed by the read data processing module, it is sent to the network through the bus interface.
[0064] Furthermore, in some more specific embodiments, the sending state control module is further used to:
[0065] When the starting position is the first byte in the buffer, and the starting position is different from the ending position, the data reading direction is determined to be forward reading, and the target message to be read is the data between the starting position and the ending position in the buffer; specifically, Figure 2 As shown, when the starting position indicated by the start pointer (start point) is the first byte (byte0) in the buffer, and the starting position and the end position indicated by the end pointer (end point) are different, the sending status control module determines that the data reading direction is positive sequence reading. Positive sequence reading means starting from the starting position of the stored data and reading one by one in the natural order of the data until the end position of the data is reached. In this mode, the target message to be read is all the data from the starting position to the end position in the buffer. This configuration is used to process messages that are continuously stored in the buffer and need to be read in order from the beginning to the end. This is the most common data reading method and is suitable for sending most network messages.
[0066] When the starting position and the ending position are the same, it is determined that the data reading direction of the target message is reverse reading, and the read target message is the data between the starting position and the first byte (byte0) in the buffer; specifically, Figure 3As shown, when the starting position indicated by the start pointer (start point) and the end position indicated by the end pointer (end point) are the same, the sending status control module determines that the data reading direction is reverse reading. Reverse reading means starting from the starting position of the data and reading the data one by one in reverse order until the first byte (byte0) of the buffer is reached. In this mode, the target message to be read is all the data from the starting position (also the end position) to the first byte (byte0) in the buffer. This situation is usually used to process messages that need to be read from the end. For example, in some specific protocols, the header information of the message may be located at the end of the message, and the header information needs to be read first to determine how to process the subsequent data. Reverse reading ensures that it is possible to read from the end of the message until the beginning of the message.
[0067] When the starting position is between the first byte and the end position in the buffer, the data reading direction is determined to be first reverse reading and then forward reading, the target message read in reverse order is the data between the starting position and the first byte, and the target message read in forward order is the data between the next byte of the starting position and the end position; specifically, Figure 4 As shown, when the starting position indicated by the start pointer (start point) is between the first byte (byte0) in the buffer and the end position indicated by the end pointer (end point), the sending state control module determines that the data reading direction is to read in reverse order first and then in normal order. Specifically, this process is divided into a reverse order reading stage and a normal order reading stage; in the reverse order reading stage, starting from the starting position, the data between the first byte (byte0) of the buffer is read in reverse order, and in the normal order reading stage, starting from the next byte of the starting position (starting position + 1), the data between the end position is read in normal order.
[0068] Furthermore, in some more specific embodiments, Figure 5 As shown, the memory is formed by splicing a first memory bank (bank0) and a second memory bank (bank1), and the first memory bank and the second memory bank each include a plurality of memory cells arranged in rows. In each memory bank, the number of memory cells is the depth of the memory bank ( Figure 5 The depth is 4, each bank includes 4 storage units), the bit width of each storage unit is the same as the bus bit width, and bank0 and bank1 output one storage unit data each time, that is, the read address generation module will generate two read addresses and give them to bank0 and bank1 respectively. The read address is the address of the storage unit (i.e. Figure 5adr: 0~3), can also be understood as the depth of the storage body; where each storage unit includes multiple bytes, Figure 5 An 8-byte storage unit is shown.
[0069] Specifically, by designing the memory to be a structure formed by splicing two memory banks, the bus bandwidth can be effectively utilized. Because if there is only a single memory bank, when a bus width data data_a needs to be stored in different depth addresses of the memory bank, two beats are required to send the bus width data data_a during output. If it is designed to be spliced with two memory banks, then the bus width data data_a can be split into two parts and stored in different memory banks. Then, the two memory banks are read in parallel in the same beat and spliced for output.
[0070] Furthermore, in some more specific embodiments, Figure 6 As shown, it also includes a data cache module;
[0071] When the data reading direction is to read in reverse order first and then in normal order, if only one beat is needed to complete the reverse order reading at this time, the read data processing module is further used to receive and obtain a bus width data according to the storage unit data at the starting position output by the first storage body in the first beat of the reverse order reading and send it to the bus interface. If the starting position is the highest byte of the storage unit, the storage unit data is directly output as the bus width data. If the starting position is not the highest byte of the storage unit, part of the storage unit data needs to be read in reverse order and part of the data needs to be read in normal order. The data read in reverse order is placed in a bus width data in the little-endian byte order, and the data read in normal order is placed in a bus width data in the big-endian byte order.
[0072] When the data reading direction is to read in reverse order first and then in normal order, if at least two beats are required to complete the reverse order reading at this time, if the starting position is not the highest byte of any storage unit of the first storage body or the second storage body, the read data processing module is further used to receive the first storage unit data output by the first storage body and the second storage unit data output by the second storage body in the first beat of the reverse order reading, splice part of the data in the first storage unit data with part of the data in the second storage unit data to obtain a bus bit width data, send the bus bit width data to the bus interface, and output the remaining part of the data in the storage unit data at the starting position that has not been sent to the data cache module for temporary storage;
[0073] The read data processing module is further used to receive the third storage unit data output by the first storage body in the last beat of reverse reading, splice the unsent data in the third storage unit data with the remaining data temporarily stored in the data cache module to obtain a bus width data, and send the bus width data to the bus interface.
[0074] When the data reading direction is to read in reverse order first and then in normal order, if at least three beats are required to complete the reverse order reading at this time, the read data processing module is further used to receive and obtain a bus bit width data based on a storage unit data output by the first storage body and a storage unit data output by the second storage body in the middle beat of the reverse order reading, and send it to the bus interface.
[0075] Specifically, the middle byte of the storage unit refers to the other bytes in the storage unit except the highest byte. Figure 5 As shown, the bit width of bank0 and bank1 is 8 bytes, wherein a storage unit of bank0 includes bytes 0 to 7, wherein byte 7 is the highest byte of the storage unit; the start pointer points to byte 44 of the buffer, and the end pointer points to byte 58 of the buffer, and the byte 44 is not the highest byte (i.e., 47) of a storage unit of bank1. In this case, there is data splicing, and it takes 6 beats to read the data in reverse order. Specifically, in this example, in the first beat of reverse order reading, bank0 outputs storage unit data of bytes 39 to 32, and bank1 outputs storage unit data of bytes 47 to 40; then the 4 bytes of data of bytes 43 to 40 are spliced with the 4 bytes of data of bytes 39 to 36 to obtain a bus bit width data of 8 bytes (bytes 43 to 36) (in reverse order) output to the bus interface, and the 4 bytes of data of bytes 44 to 47 (in normal order) are output to the data cache module for temporary storage, and the 4 bytes of data of 45 to 32 are discarded;
[0076] Furthermore, in the second beat of reverse reading, bank0 outputs the storage unit data of bytes 39 to 32, and bank1 outputs the storage unit data of bytes 31 to 24; then the 4-byte data of bytes 35 to 32 and the 4-byte data of bytes 31 to 28 are spliced to obtain an 8-byte (byte 35 to 28) bus width data output to the bus interface; and so on, in the third beat of reverse reading, an 8-byte (byte 27 to 20) bus width data is obtained and output to the bus interface, until byte 0 (the first byte) of the buffer is reached; in the last beat of reverse reading, bank0 outputs the storage unit data of bytes 7 to 0; then bytes 3 to 0 The 4 bytes of data (in reverse order) and the 4 bytes of data (in normal order) of bytes 44 to 47 temporarily stored in the data cache module are spliced to obtain a bus width data, which is output to the bus interface and enters the normal order reading process. The normal order reading reads the data of bytes 48 to 59, so a total of two beats are required to complete the reading. The first beat of the normal order reading outputs the bus width data of bytes 48 to 55 to the bus interface; the second beat of the normal order reading outputs the bus width data of bytes 56 to 63 to the bus interface. In this way, the number of data transmissions can be effectively reduced, the occupancy of network resources can be reduced, the bandwidth can be more effectively utilized, and unnecessary data transmission can be reduced.
[0077] It should be noted that the above is a description of an embodiment in which the starting position is not the highest byte of any storage unit of the first storage bank or the second storage bank. If the starting position is the highest byte of any storage unit of the first storage bank or the second storage bank, there is no data splicing, and the storage unit data output by bank0 or bank1 can be output to the bus interface in each beat of reverse or forward sequence, so there is no need to store part of the data in the data cache module in the first beat of reverse reading. The lowest byte of any storage unit in any storage bank is analogous to this.
[0078] Furthermore, in some more specific embodiments, the read data processing module is further used to receive and obtain a bus bit width data based on a storage unit data output by the first storage body and a storage unit data output by the second storage body at each beat of the forward reading or reverse reading when the data reading direction is forward reading or reverse reading, and send the bus bit width data to the bus interface.
[0079] It should be noted that when the data reading direction is forward reading or reverse reading, the reading method can refer to Figure 5For example, in each beat, part of the byte data in the storage unit data output by bank0 is concatenated with part of the byte data in the storage unit data output by bank1 to obtain an 8-byte bus width data, and so on, until the last byte of data is read in positive or reverse order.
[0080] Furthermore, in some more specific embodiments, the read data processing module is further used to place the data read in reverse order in a bus bit width data in little-endian byte order, and place the data read in forward order in a bus bit width data in big-endian byte order.
[0081] In a more specific embodiment, the read data processing module uses a specific byte order to place the data read in reverse order and the data read in normal order to ensure the correctness and compatibility of the data.
[0082] The data read in reverse order is placed in a bus width data in little-endian byte order, which means that the bus width data is composed of multiple bytes, the smallest byte data (that is, the output low-order byte data output by the memory) will be placed at the starting position of the bus width data, and the largest byte data (that is, the output high-order byte data output by the memory) will be placed at the end of the bus width data, and all byte data are placed in order of bit height.
[0083] The data read in positive order is placed in a bus width data in big-endian byte order, which means that the bus width data is composed of multiple bytes. The largest byte data (that is, the highest-order byte data output by the memory) will be placed at the starting position of the bus width data, and the smallest byte data (that is, the lowest-order byte data output by the memory) will be placed at the end of the bus width data. All byte data are placed in order of bit height.
[0084] Furthermore, in some more specific embodiments, the memory is a memory formed by splicing a plurality of memory banks;
[0085] Specifically, multiple memory banks can work in parallel to increase the read and write speed of the memory, and each memory bank can process data independently, reducing the bottleneck of data transmission, thereby improving overall performance.
[0086] Furthermore, in some more specific embodiments, it also includes:
[0087] The write data interface is used to receive a write command and write the data to be written into a corresponding storage location in the memory according to the write command.
[0088] Specifically, when new message data needs to be stored in the buffer, the data can be written to a specified storage location through a write data interface.
[0089] Furthermore, in some more specific embodiments, it also includes:
[0090] The status reporting module is used to obtain the real-time status information of the message sending buffer device and report the real-time status information to the control status register of the network processor.
[0091] Specifically, the status reporting module is responsible for monitoring the status of the out-buffer and collecting relevant real-time status information, which reflects the operating status and performance indicators of the out-buffer, and may include but is not limited to the current usage of the out-buffer, the status of the memory, the status of data transmission, etc.
[0092] The control status register is a register in the network processor used to store and manage system status information. By reporting real-time status information to this register, the network processor can monitor and control the operation of the message sending buffer. Through this status reporting module, the out-buffer can realize the status information exchange between the network processor. The network processor can adjust the system configuration, optimize the data transmission strategy or perform fault diagnosis based on this real-time status information.
[0093] An embodiment of the present application also provides a chip, comprising the message sending buffer device described in the above embodiment.
[0094] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A message sending buffer device, characterized in that: include: Send command interface, used to receive and parse the message sending command to obtain command information; A sending state control module, used to determine the number of beats required to read the target message and the data reading direction according to the instruction information; wherein the data reading direction is one of forward reading, reverse reading, and reverse reading first and then forward reading; the target message is one of encapsulating from inside to outside, encapsulating from outside to inside, and encapsulating from inside to outside and then from outside to inside; A read address generation module, used to generate a read address of a current beat according to the instruction information, the number of beats required to read the target message, and the data reading direction; A memory, used to store message data and output the read data of the current beat according to the read address of the current beat; A read data processing module, used for processing and outputting the read data of the current shot output by the memory; The bus interface is used to send the data output by the read data processing module to the opposite end device.
2. The message sending buffer device according to claim 1, characterized in that: The memory is divided into a plurality of storage spaces, each storage space being defined as a buffer; The instruction information includes a start pointer indicating a starting position for data reading, an end pointer indicating an ending position for data reading, and buffer information, wherein the buffer information is an identifier of a buffer where the target message is located, and the start position and the end position are both one byte in the buffer where the target message is located.
3. The message sending buffer device according to claim 2, characterized in that: The sending status control module is further used to: When the starting position is the first byte in the buffer, and the starting position is different from the ending position, determining that the data reading direction is forward reading, and the target message to be read is the data between the starting position and the ending position in the buffer; When the starting position and the ending position are the same, determining that the data reading direction of the target message is reverse reading, and the read target message is the data between the starting position and the first byte in the buffer; When the starting position is between the first byte and the end position in the buffer, the data reading direction is determined to be reverse order reading first and then forward order reading. The target message for reverse order reading is the data between the starting position and the first byte, and the target message for forward order reading is the data between the next byte of the starting position and the end position.
4. The message sending buffer device according to claim 3, characterized in that: The memory is formed by splicing a first memory bank and a second memory bank, wherein the first memory bank and the second memory bank both include a plurality of memory cells arranged in rows, and the bit width of each memory cell is the same as the bus bit width.
5. The message sending buffer device according to claim 4, characterized in that: Also includes a data cache module; When the data reading direction is to read in reverse order first and then in forward order, if the starting position is not the highest byte of any storage unit of the first storage body or the second storage body, the read data processing module is further used to receive the first storage unit data output by the first storage body and the second storage unit data output by the second storage body in the first beat of the reverse reading, splice part of the data in the first storage unit data with part of the data in the second storage unit data to obtain a bus width data, send the bus width data to the bus interface, and output the remaining part of the data in the storage unit data at the starting position that has not been sent to the data cache module for temporary storage; The read data processing module is further used to receive the third storage unit data output by the first storage body in the last beat of the reverse read, splice the unsent data in the third storage unit data with the remaining data temporarily stored in the data cache module to obtain a bus bit width data, and send the bus bit width data to the bus interface.
6. The message sending buffer device according to claim 5, characterized in that: When the data reading direction is to read in reverse order first and then in normal order, if at least three beats are required to complete the reverse order reading, the read data processing module is further used to receive and obtain a bus bit width data based on a storage unit data output by the first storage body and a storage unit data output by the second storage body in the middle beat of the reverse order reading, and send it to the bus interface.
7. The message sending buffer device according to claim 4, characterized in that: The read data processing module is further used to receive and obtain a bus width data based on a storage unit data output by the first storage body and a storage unit data output by the second storage body at each beat of the forward reading or reverse reading when the data reading direction is forward reading or reverse reading, and send it to the bus interface.
8. The message sending buffer device according to any one of claims 1, characterized in that: The read data processing module is further used to place the data read in reverse order in a bus width data according to the little end byte order, and place the data read in forward order in a bus width data according to the big end byte order.
9. The message sending buffer device according to any one of claims 1 to 8, characterized in that: Also includes: A data writing interface, used to receive a write command and write the data to be written into a corresponding storage location in the memory according to the write command; The status reporting module is used to obtain the real-time status information of the message sending buffer device and report the real-time status information to the control status register of the network processor.
10. A chip, characterized in that: The invention comprises the message sending buffer device according to any one of claims 1 to 9.
Citation Information
Cited By
Message caching method, device and equipment
CN121547429A
Packet caching method, apparatus and device
CN121547429B
Message sending buffer device and chip
WO2026021527A1
