Data storage device, message storage method and message reading method

By merging the cache space of idle linked list nodes and queue linked list nodes, using multi-queue data storage mechanism and read and write address pool technology, the problem of excessive consumption of linked list cache resources is solved, and resource conservation, cache efficiency improvement and exception handling are achieved.

CN120050250AActive Publication Date: 2025-05-27WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510189205.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2025-05-27
Estimated Expiration
2045-02-19

AI Technical Summary

Technical Problem

In the prior art, the resource consumption of linked list cache is too large, resulting in waste of resources and unfriendly physical implementation.

Method used

By merging the cache space of the idle linked list node and the queue linked list node, a multi-queue data storage mechanism is adopted, a read and write address pool is set, and a single linked list node controls multiple addresses, and the data buffer is divided into multiple cache blocks to support message storage of different bit widths.

Benefits of technology

Reduces resource consumption, improves cache space utilization, shortens queue length, realizes efficient discarding of abnormal packets and fast release of cache space, and avoids effective bandwidth waste caused by bad packets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050250A_ABST
    Figure CN120050250A_ABST
Patent Text Reader

Abstract

The invention provides a data storage device, a message storage method and a message reading method. The data storage device comprises a data cache region, a linked list node cache region, a queue linked list management module and an idle linked list management module, the data cache region comprises cache blocks, and the cache blocks comprise cache lines; linked list nodes are stored in the linked list node cache region; the linked list nodes comprise queue linked list nodes and idle linked list nodes; the queue chain table management module comprises a unicast virtual channel queue chain table management module and a multicast virtual channel queue chain table management module; the unicast virtual channel queue linked list management module controls the read-write process of the unicast message of the corresponding virtual channel and manages the queue linked list node corresponding to the unicast message of the corresponding virtual channel; the multicast virtual channel queue linked list management module controls the read-write process of multicast messages of all virtual channels and manages queue linked list nodes corresponding to the multicast messages of all virtual channels; the idle queue linked list management module manages idle linked list nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of network communication technologies, and particularly relates to a data storage device, a message storage method, and a message reading method. Background Art

[0002] The IB protocol defines a variety of IB devices for system communication, including channel adapters, switches, routers, etc. When the system is running, the IB devices communicate with each other. On the sending side of the IB device, messages are read out from its cache space and then sent, and the number of messages sent depends on the available credit feedback from the peer device; on the receiving side of the IB device, messages from the sending side of the peer IB device are received and cached in its own cache space, and the available credit is fed back to the peer IB device. During message transmission, devices with only a single transmission channel are prone to message blocking. Therefore, implementing multiple virtual channels in the IB device can effectively alleviate message blocking, and the cache space in the device is allocated to different virtual channels according to the actual device usage scenario. To improve the data caching efficiency in the cache space, a linked list is used to manage the multi-queue space of the cache space, thereby achieving flexible partitioning of the cache space, and further achieving the purpose of flexible configuration of the number of virtual channels and flexible setting of the virtual channel space size. Summary of the Invention

[0003] The purpose of this application is to provide a data storage device, a message storage method, and a message reading method, aiming to solve the problem of excessive consumption of cache resources by the linked list.

[0004] According to the first aspect of this application, a data storage device is provided, including: a data cache area, a linked list node cache area, a queue linked list management module, and an idle linked list management module;

[0005] The data cache area includes multiple cache blocks, and each cache block includes multiple cache lines;

[0006] The linked list node cache area is used to store multiple linked list nodes, the multiple linked list nodes correspond to the cache lines of the cache blocks one by one, and the position where the linked list node is located in the linked list node cache area is the same as the position where the corresponding cache line is located in the cache block; the linked list node includes a queue linked list node and an idle linked list node;

[0007] The queue linked list management module includes a unicast virtual channel queue linked list management module and a multicast virtual channel queue linked list management module; the queues include a unicast virtual channel queue and a multicast virtual channel queue, and the unicast virtual channel queues correspond one-to-one with the virtual channels; the unicast virtual channel queue linked list management module is used to control the reading and writing processes of unicast packets of the corresponding virtual channel and manage the queue linked list nodes corresponding to the unicast packets of the corresponding virtual channel; the multicast virtual channel queue linked list management module is used to control the reading and writing processes of multicast packets of all virtual channels and manage the queue linked list nodes corresponding to the multicast packets of all virtual channels;

[0008] The free queue linked list management module is used to manage the free linked list nodes.

[0009] In some alternative implementation manners, the same cache line of different cache blocks can store slice data of the same packet or slice data of different packets of the same queue; the same packet can be stored across cache lines of the cache blocks.

[0010] In some alternative implementation manners, for a to-be-stored unicast packet, according to the virtual channel to which it belongs, it is stored by the corresponding unicast virtual channel queue management module at one or more cache lines corresponding to the corresponding queue linked list node; for a to-be-stored multicast packet, it is stored by the multicast virtual channel queue management module at one or more cache lines corresponding to the corresponding queue linked list node.

[0011] In some alternative implementation manners, a read address pool and a write address pool are set in each of the queue linked list management modules. After converting the cache line address corresponding to the queue head node in the corresponding queue linked list node into a block address, the queue linked list management module adds it to the corresponding read address pool; the free linked list management module takes out the free head node from the free linked list nodes and, after converting the cache line address corresponding to the free head node into a block address, adds it to the corresponding write address pool.

[0012] In some alternative implementation manners, the queue linked list management module uses the cache line address corresponding to the queue head node as the low address and uses the serial number of the cache block as the high address to obtain the block address corresponding to the cache line address corresponding to the queue head node; the free linked list management module uses the cache line address corresponding to the free head node as the low address and uses the serial number of the cache block as the high address to obtain the block address corresponding to the cache line address corresponding to the free head node.

[0013] In some alternative implementation manners, during the process of writing a message, the queue linked list management module reads the block address from the write address pool, determines the cache block corresponding to the block address and the cache line address in the cache block, and writes the message to the cache line address in the cache block; the free linked list management module also adds the free linked list node corresponding to the cache line address of the cache block where the message is written as the queue tail node to the queue linked list nodes of the corresponding queue linked list management module.

[0014] In some alternative implementation manners, during the process of reading a message, the queue linked list management module reads the block address from the read address pool, determines the cache block corresponding to the block address and the cache line address in the cache block, and reads the message from the cache line address in the cache block; the free linked list management module also adds the queue linked list node corresponding to the cache line address of the cache block from which the message is read as the free tail node to the free linked list nodes.

[0015] In some alternative implementation manners, after an abnormal message is found, if the abnormal message has not started to be transmitted downstream, the queue linked list management module corresponding to the abnormal message also adds the queue linked list node corresponding to the cache line storing the abnormal message in the data buffer area to the free linked list nodes; if the abnormal message has started to be transmitted downstream, the queue linked list management module corresponding to the abnormal message transmits the bad packet end flag downstream and adds the queue linked list node corresponding to the cache line storing the abnormal message in the data buffer area to the free linked list nodes.

[0016] According to a second aspect of the present application, there is provided a message storage method, which stores messages by using the data storage device according to any one of the first aspect, including:

[0017] Reading a block address from the write address pool of the queue linked list management module corresponding to the message;

[0018] Determining the cache block corresponding to the block address and the cache line address in the cache block;

[0019] Writing the message to the cache line address in the cache block;

[0020] Adding the free linked list node corresponding to the cache line address of the cache block where the message is written as the queue tail node to the queue linked list nodes of the queue linked list management module.

[0021] According to a third aspect of the present application, there is provided a message reading method, which reads messages by using the data storage device according to any one of the first aspect, including:

[0022] Read a block address from the read address pool of the queue linked list management module corresponding to the message;

[0023] Determine the cache block corresponding to the block address and the cache line address in the cache block;

[0024] Read the message from the cache line address in the cache block;

[0025] Take the queue linked list node corresponding to the cache line address of the cache block that has read the message as the free tail node and add it to the free linked list node.

[0026] Compared with the related art, the technical solution of the present application has the following advantages:

[0027] 1. The free linked list node and the queue linked list node are merged and cached in the linked list node buffer area, reducing resource consumption and being physically friendly.

[0028] 2. By setting up read and write address pools, a single linked list node can control multiple addresses, that is, the same cache lines of different banks are indicated by the same linked list node. Therefore, the same linked list node can control multiple cache line addresses corresponding to the same cache lines of multiple banks.

[0029] 3. Since the data buffer is divided into multiple cache blocks, there is no need to additionally increase the message splicing cache resources, and the memory_pool can adapt to messages of different bit widths.

[0030] 4. The queue length can be shortened, the linked list resource consumption can be reduced, and the area of the data storage device caused by a large number of linked list nodes can be avoided.

[0031] 5. In the direct forwarding mode, abnormal messages are efficiently discarded, the cache space is quickly released, and the waste of effective bandwidth caused by bad packets is avoided.

[0032] 6. The multicast virtual channel queue is independently set, effectively solving the problem that the multicast replication continuously occupies the queue head and avoiding blocking the forwarding of unicast messages.

[0033] 7. A data storage and credit management scheme is proposed in which the cache bit width (that is, the data bit width of a cache line) is greater than the flow control unit (that is, the line bit width of a bank).

[0034] Other features and advantages of the present application will be described in the subsequent description, and will be partially obvious from the description, or will be understood by implementing the present application. The objectives and other advantages of the present application can be achieved and obtained through the structures and processes pointed out in the description and the drawings. Brief Description of the Drawings

[0035] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the accompanying drawings required for the description of the embodiments or related technologies. Obviously, the accompanying drawings in the following description are certain embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.

[0036] Figure 1 It is a schematic structural diagram of a data storage device according to an exemplary embodiment of the present application.

[0037] Figure 2 It is a schematic diagram of the correspondence between virtual channels and queues according to an exemplary embodiment of the present application.

[0038] Figure 3 It is a schematic diagram of the correspondence between a data buffer and a linked list node buffer according to an exemplary embodiment of the present application.

[0039] Figure 4 It is a schematic diagram of the storage management of linked list nodes according to an exemplary embodiment of the present application.

[0040] Figure 5 It is a schematic diagram of the management of a read / write address pool according to an exemplary embodiment of the present application.

[0041] Figure 6 It is a schematic diagram of the processing of an exception message when part of the data has been sent out of the data buffer according to an exemplary embodiment of the present application.

[0042] Figure 7 It is a schematic diagram of the processing of an exception message when the data has not been sent out of the data buffer according to an exemplary embodiment of the present application.

[0043] Figure 8 It is a schematic flowchart of a message storage method according to an exemplary embodiment of the present application.

[0044] Figure 9 It is a schematic flowchart of a message reading method according to an exemplary embodiment of the present application. Detailed implementation manners

[0045] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.

[0046] In related technical solutions, the cache space for storing queue linked list nodes pointing to the next data in the queue and the cache space for storing available free linked list nodes are independent of each other, resulting in high resource consumption; it is not applicable to scenarios where the data bit width per single clock cycle and the flow control unit are inconsistent, and there may be credit waste; in addition, related technologies do not give solutions for bad packet discarding and linked list maintenance in the direct forwarding mode; when there are unicast packets and multicast packets in the same virtual channel, the same queue is used for maintenance, resulting in blocking the forwarding of unicast packets when multicast packets are replicated and forwarded.

[0047] Based on the above analysis, the present application exemplarily proposes a multi-queue data storage mechanism, which has the advantages of low resource consumption, supporting multiple input data bit widths, supporting fast bad packet discarding, and being friendly to unicast packet forwarding.

[0048] To solve the problem of excessive consumption of linked list cache resources in the present application, the cache space for storing queue linked list nodes pointing to the next data in the queue and the cache space for storing available free linked list nodes are merged, and the queue linked list nodes and free linked list nodes are uniformly cached in the linked list node cache area list_pool; the data cache area memory_pool is divided into multiple cache blocks (banks) according to the flow control unit, supporting scenarios where the data bit width per single clock cycle and the flow control unit are inconsistent, and improving the utilization rate of the cache space; to facilitate the forwarding of unicast packets, unicast packets and multicast packets are cached separately, and multicast packets are managed separately; to achieve rapid release of the cache space, a mechanism for fast bad packet discarding and linked list rollback in the direct forwarding mode is provided.

[0049] See Figure 1 As shown, the present application exemplarily provides a data storage device, including: a data cache area, a linked list node cache area, a queue linked list management module, and a free linked list management module;

[0050] The data cache area includes multiple cache blocks, and each cache block includes multiple cache lines;

[0051] The linked list node cache area is used to store multiple linked list nodes, and the multiple linked list nodes correspond to the cache lines of the cache blocks one by one, and the position of the linked list node in the linked list node cache area is the same as the position of the corresponding cache line in the cache block; the linked list node includes a queue linked list node and a free linked list node;

[0052] The queue linked list management module includes a unicast virtual channel queue linked list management module and a multicast virtual channel queue linked list management module; among them, the queue includes a unicast virtual channel queue and a multicast virtual channel queue, and the unicast virtual channel queue corresponds to the virtual channel one by one;

[0053] The unicast virtual channel queue linked list management module is used to control the read and write processes of unicast packets in the corresponding virtual channel and manage the queue linked list nodes corresponding to the unicast packets in the corresponding virtual channel;

[0054] The multicast virtual channel queue linked list management module is used to control the read and write processes of multicast packets in all virtual channels and manage the queue linked list nodes corresponding to the multicast packets in all virtual channels;

[0055] The free queue linked list management module is used to manage free linked list nodes.

[0056] Exemplarily, the cache space in this application is managed as follows:

[0057] When the data bit width in a single clock cycle exceeds the flow control unit, to ensure no waste of credit, the data buffer memory_pool is divided into n (n is a natural number) cache blocks bank according to the flow control unit, denoted as bank0, bank1... bankn-1. Each bank includes multiple cache lines, and each cache line corresponds to a cache line address. The cache line addresses of the same cache line in different banks are the same. Figure 1 Each bank in the shown memory_pool includes m cache lines, and the corresponding cache line addresses are addr1, addr2 ······ addrm respectively.

[0058] When data is input, to improve the utilization efficiency of memory_pool, in the same cache line of different banks, only the same packet of the same queue is allowed to be saved; in different banks of the same line, multiple packets of the same queue can also be saved; the packets deposited in the same clock cycle can be stored across lines. Among them, the queues include unicast virtual channel queues, multicast virtual channel queues, and free queues, and the unicast virtual channel queues correspond to virtual channels one by one.

[0059] To avoid cache overflow caused by insufficient remaining space in memory_pool, credit management can be performed on memory_pool: 1. When a packet is deposited into memory_pool, credit is deducted according to the VL (virtual channel) field and flow control unit of the packet; 2. When a packet is removed from memory_pool, credit is released according to the VL field and flow control unit of the packet.

[0060] Exemplarily, the linked list nodes in this application are managed as follows:

[0061] See Figure 2As shown in the figure, to avoid the blocking of unicast packet forwarding by multicast packet replication, a separate multicast virtual channel queue is added. Therefore, the input packets are respectively placed into the unicast virtual channel queue and the multicast virtual channel (VL) queue according to the virtual channel and whether the packet is unicast or multicast. The unicast virtual channel queue includes: unicast VL0 queue, unicast VL1 queue... unicast VLd queue, where d is the number of virtual channels.

[0062] For the multicast VL queue, data packets of different VLs may exist; for the unicast VL queue, the VL fields of the packets in the same queue must be the same, that is, a unicast VL queue corresponds to storing packets of the same virtual channel.

[0063] Exemplarily, when there is valid data of a certain queue in different banks of the same row, this row is managed by the queue linked list node corresponding to this queue; when there is no valid data, this row is managed by the free linked list node. That is to say, the linked list nodes stored in list_pool are divided into queue linked list nodes and free linked list nodes. The current queue linked list node stores a pointer to the position of the cache line of the next queue linked list node in list_pool, and the position of the cache line of the next queue linked list node in list_pool is the same as the position of the next slice data of the slice data corresponding to this current queue linked list node in memory_pool. That is to say, the queue linked list node corresponding to the slice data of the packet stores the cache line address of the next slice data in memory_pool, which is also the cache line address of the next queue linked list node in list_pool.

[0064] Exemplarily, refer to Figure 3 As shown in the figure, the slice data in the packet is cached in memory_pool, and the queue linked list node corresponding to the cache line storing this slice data is cached in the linked list node buffer list_pool, and the cache line address of this queue linked list node is the same as the cache line address of this slice data in the bank, and the cache line address of the next slice data of this slice data is stored in this queue linked list node. That is to say, the position of the queue linked list node in list_pool is the same as the position of the corresponding data in memory_pool. The cache line address of the queue linked list node can be stored in the previous queue linked list node in the same queue. The cache line address of the first queue linked list node, that is, the head of the queue, is stored in the head pointer (head_queue) of this queue, and the cache line address of the last queue linked list node of this queue is also stored in the tail pointer (tail_queue) of this queue. For example Figure 1Among them, the sliced data of the packet stored in the first cache line of the bank are data(0_0), data(0_1),..., data(0_n - 1) respectively. The queue linked list node addr1 stored in the first row of the list_pool is the queue linked list node corresponding to the sliced data of the packet stored in the first cache line of the bank. What is stored in addr1 is the position of the next sliced data of data(0_n - 1) in the cache line in the bank, and this position is also the position of the next queue linked list node of addr1 in the cache line in the list_pool. That is to say, the queue linked list nodes correspond one by one to each cache line of different banks in the memory_pool, and the cache lines corresponding to the queue linked list nodes store valid packets. Similarly, the free linked list nodes in the free linked list queue are similar to the queue linked list nodes. The difference is that the cache lines in the cache block corresponding to the free linked list nodes do not store valid packets. It can be understood that due to the existence of at least one unicast virtual channel queue and one multicast virtual channel queue, the queue linked list nodes are distributed in different queues, and the queue linked list nodes in the same queue form a linked list, which has a head pointer and a tail pointer.

[0065] Exemplarily, each queue is managed by a corresponding queue linked list management module. The unicast virtual channel queue is managed by the unicast virtual channel queue linked list management module, the multicast virtual channel queue is managed by the virtual channel queue linked list management module, and the free queue is managed by the free queue linked list management module. Each queue corresponds to a cache line for storing packets and a linked list node for storing addresses. For the unicast virtual channel queue, the cache line corresponding to its corresponding queue linked list node stores unicast packets belonging to the corresponding virtual channel. For the multicast virtual channel queue, the cache line corresponding to its corresponding queue linked list node stores multicast packets belonging to all virtual channels, and the queue linked list node also stores the cache line address of the next queue linked list node, which is also the cache line address of the sliced data of the next cache line. The sliced data of the next cache line is the next data of the packet stored in the cache line corresponding to the current queue linked list node, which can be the next sliced data of the same packet or the sliced data of the next packet. For the free queue, the cache line corresponding to its corresponding free linked list node does not store valid packet data, but the free linked list node stores the cache line address of the next free linked list node.

[0066] Exemplarily, the list_pool in this application is managed as follows:

[0067] Since the sum of the number of free linked list nodes and queue linked list nodes is equal to the total number of linked lists, and the free linked list nodes and queue linked list nodes are independent of each other without intersection, the free linked list nodes and queue linked list nodes can be cached in the same cache entity, that is, uniformly cached in the list_pool.

[0068] See Figure 4 As shown, exemplarily, list_pool is provided with two sets of read / write interfaces: 1. Free list read / write interface; 2. Queue list read / write interface, so as to achieve simultaneous reading and writing of the free list and the queue list.

[0069] In some alternative implementation manners, the same cache line of different cache blocks can store slice data of the same message or slice data of different messages of the same queue; the same message can be stored across cache lines of cache blocks.

[0070] Exemplarily, after receiving a message, the message can be sliced according to the flow control unit to obtain slice data, and each slice data can be stored in a cache line of a bank. Multiple slice data of the same message can be stored in the same cache line of multiple banks, or in multiple cache lines of multiple banks. A queue can occupy the same cache line of multiple banks. After the messages belonging to the queue fill up the cache line of all banks, they can be stored in another cache line, and the other cache lines of all banks also belong to the queue.

[0071] In some alternative implementation manners, for the unicast message to be stored, according to its belonging virtual channel, it is stored by the corresponding unicast virtual channel queue management module at the cache lines of one or more cache blocks corresponding to the corresponding queue list node; for the multicast message to be stored, it is stored by the multicast virtual channel queue management module at the corresponding one or more cache lines corresponding to the queue list node.

[0072] Exemplarily, the input message is respectively put into the unicast virtual channel queue and the multicast virtual channel (VL) queue according to the virtual channel and whether the message is unicast or multicast type. That is to say, there is a queue list node in the unicast virtual channel queue corresponding to the virtual channel to which the unicast message belongs, and the position of the cache line corresponding to the queue list node is the position of the cache line in the corresponding bank in the data buffer area where the unicast message is stored. Similarly, there is also a queue list node in the multicast virtual channel queue corresponding to the multicast message, and the position of the cache line corresponding to the queue list node is the position of the cache line in the corresponding bank in the data buffer area where the multicast message is stored. The unicast message is stored by the unicast virtual channel queue management module corresponding to its belonging virtual channel, and the multicast message is stored by the multicast virtual channel queue management module.

[0073] In some alternative implementations, a read address pool and a write address pool are set in each queue linked list management module. After converting the cache line address corresponding to the queue head node in the corresponding queue linked list node into a block address, the queue linked list management module adds it to the corresponding read address pool; the free linked list management module removes the free head node from the free linked list node in the free linked list, and after converting the cache line address corresponding to the free head node into a block address, adds it to the corresponding write address pool.

[0074] Exemplarily, each unicast virtual channel queue linked list management module and multicast virtual channel queue linked list management module are respectively provided with a write address pool and a read address pool. The write address pool and the read address pool are initially empty. When storing a packet, the corresponding free linked list management module (including the unicast virtual channel queue linked list management module and the multicast virtual channel queue linked list management module) takes out a free linked list node from the free linked list queue, usually the free head node of the free linked list queue, that is, the free linked list node pointed to by the head pointer (head_idle) of the free linked list queue. After converting the cache line address corresponding to the free head node into a block address, it is placed in the write address pool. The free head node in the free linked list queue is deleted from the free linked list node, and the head pointer head_idle points to the next free linked list node of the free head node. When reading a packet, after converting the cache line address corresponding to the queue head node in the corresponding queue linked list node into a block address, it is placed in the read address pool. The queue head node is not temporarily deleted from the queue linked list node. After the packet is read from the block address later, it is then deleted from the queue linked list node.

[0075] In some alternative implementations, the queue linked list management module takes the cache line address corresponding to the queue head node as the low address, and takes the serial number of the cache block as the high address to obtain the block address corresponding to the cache line address corresponding to the queue head node; the free linked list management module takes the cache line address corresponding to the free head node as the low address, and takes the serial number of the cache block as the high address to obtain the block address corresponding to the cache line address corresponding to the free head node.

[0076] See Figure 5 As shown, exemplarily, the address pool in the present application is managed as follows:

[0077] Each unicast virtual channel queue and multicast virtual channel queue are respectively provided with a read address pool and a write address pool, which are respectively managed by the unicast virtual channel queue management module and the multicast virtual channel queue management module. See Figure 5As shown, the initial state of the address pool is empty, and the number of addresses it can accommodate is twice the maximum number of banks. The cache line address corresponding to the first free node in a single free linked list node (i.e., the first free linked list node pointed to by the head pointer head_idle of the free linked list queue) or the first queue node in the queue linked list node (i.e., the first queue linked list node pointed to by the head pointer head_queue of the queue linked list queue) is converted into multiple bank addresses and added to the read / write address pool. The conversion rules are as follows:

[0078] bank address = {bank number, head_idle / head_queue}

[0079] By means of low-order address interleaving, data reading and writing to multiple banks are realized. That is, the bank number where the read / write operation occurs can be confirmed by the high-order bits of the bank address, and the actual read / write address of the bank (i.e., the cache line address in the bank) can be confirmed by the low-order bits of the bank address. It should be noted that since there are multiple banks, such as n banks, and the numbers range from 0 to n - 1, one cache line address can be converted into n bank addresses.

[0080] When a message is input, the bank number and the cache line address to be written are obtained by parsing the bank address in the write address pool, the write enable is pulled high, and the data is stored at the cache line address of the bank with this number; when a message is read out, the bank number and the cache line address to be read out are obtained by parsing the bank address in the read address pool, the read enable is pulled high, and the data is read from the cache line address of the bank with this number.

[0081] In some optional implementation manners, during the message writing process, the queue linked list management module reads the block address from the write address pool, determines the cache block corresponding to the block address and the cache line address in the cache block, and writes the message to the cache line address in the cache block; the free linked list management module also adds the free linked list node corresponding to the cache line address of the cache block where the message is written as the tail node of the queue to the queue linked list node of the corresponding queue linked list management module.

[0082] Exemplarily, the process of writing data in this application is as follows:

[0083] After the message is input, the message content is parsed, and the queue to which the message belongs is determined according to whether the message is unicast or multicast type and the VL (virtual channel) field. Then, after the message is sliced by the flow control unit, it is written to the expected position in the data cache space, specifically as follows:

[0084] 1. Read the free list: When the bank addresses in the write address pool of the queue to which the message belongs are insufficient for the current message, read the cache line address stored in the head pointer from the free list node in list_pool (i.e., the cache line address corresponding to the free head node), and convert the cache line address into a bank address, that is, add the bank number before the cache line address (since one cache line address corresponds to multiple banks, multiple corresponding bank addresses can be obtained after adding multiple bank numbers before the cache line address respectively), and then store it in the write address pool of the queue to which the message belongs. At the same time, update the head pointer (head_idle) of the free list node, so that the head pointer of the free list node points to the next free list node of the free head node, that is, update the cache line address stored in the head pointer to the cache line address corresponding to the next free list node, which is equivalent to removing the free head node from the free list node.

[0085] 2. Write data: According to the number of slices after slicing the message, take the corresponding number of bank addresses in sequence from the write address pool of the queue to which the message belongs. Determine the bank number for data writing through the high address of each slice data, and determine the actual write address in the bank (i.e., the cache line address in the bank) through the low address of the slice data. Then write the slice data into the corresponding position in memory_pool.

[0086] 3. Write the queue list: When there is a data writing operation in any bank in memory_pool (such as the corresponding bank for writing the slice data of the message in the previous step), write the above actual write address (i.e., the cache line address of the slice data of the written message) into the queue tail node of the queue list node of the queue to which the message belongs in list_pool. At the same time, update the tail pointer (tail_queue) in the queue list node of the queue to which the message belongs, so that the tail pointer points to the free list node corresponding to the actual write address (i.e., the cache line address of the slice data of the written message), which is equivalent to adding the free list node to the queue and becoming the last queue list node of the queue, that is, the queue tail node.

[0087] In some alternative implementation manners, during the message reading process, the queue list management module reads the block address from the read address pool, determines the cache block corresponding to the block address and the cache line address in the cache block, and reads the message from the cache line address in the cache block; the free list management module also adds the queue list node corresponding to the cache line address of the cache block from which the message has been read as the free tail node to the free list node.

[0088] Exemplarily, the process of reading data in this application is as follows:

[0089] When there are read packet requests in multiple queues, after arbitrating among the multiple read packet requests, data is read from the memory_pool based on the read packet request that wins the arbitration, as follows:

[0090] 1. Read queue linked list: If there is no address or insufficient addresses in the read address pool corresponding to the queue to which the read packet request belongs, new addresses are read from the queue linked list node of the corresponding queue in the list_pool, that is, the cache line address corresponding to the queue head node pointed to by the head pointer head_queue of the queue linked list node of this queue is read. The cache line address corresponding to this queue head node is stored in head_queue and can be directly read from head_queue. After the read new address is converted into a bank address, it is stored in the read address pool. Since the cache line address corresponding to the queue head node is added to the read address pool, the packet data in the cache line address corresponding to this queue head node can be directly read from the read address pool during the next scheduling and forwarded to the downstream network device. Therefore, the queue head node can be taken out from the queue linked list node of its belonging queue, and then the head pointer of this queue linked list node is updated so that the head pointer of this queue linked list node points to the cache line address corresponding to the next queue linked list node pointed to by the taken-out queue head node.

[0091] 2. Write free linked list: After the queue linked list management module takes out the block address from the read address pool and reads the sliced data of the packet from the cache line of the corresponding bank according to the block address, the queue linked list node corresponding to this cache line can be added to the free linked list node. Therefore, when there is a read data operation in any bank in the memory_pool, the corresponding queue linked list management module will write the actual read address of the bank of the currently read packet (that is, the cache line address where the packet is actually read in this bank) to the free tail node of the free linked list node in the list_pool, and update the tail pointer (tail_idle) of the free linked list node so that the tail pointer points to the linked list node corresponding to this actual read address, thereby adding the linked list node corresponding to this actual read address as the free tail node to the free linked list node.

[0092] 3. Read data: Read the block address from the read address pool, determine the bank where the packet to be read is located through the high bit of the read block address, and determine the actual read address of the read packet in the bank through the low bit of the block address. Then, the read packet is taken out from the actual read address of this bank in the memory_pool.

[0093] 4. After multiple sliced data of the packet to be read are read out, they are combined in order to form new data with the expected bit width and then output to the downstream network device.

[0094] In some alternative implementations, after an exception packet is detected, if the exception packet has not started to be transmitted downstream, the queue linked list management module corresponding to the exception packet will also add the queue linked list node corresponding to the cache line storing the exception packet in the data buffer to the free linked list node; if the exception packet has started to be transmitted downstream, the queue linked list management module corresponding to the exception packet will transmit an end bad packet flag downstream and add the queue linked list node corresponding to the cache line storing the exception packet in the data buffer to the free linked list node.

[0095] Exemplarily, the exception packets in this application are processed as follows:

[0096] In the cut-through forwarding mode, after an exception packet is detected, it is discarded. Specifically, there are the following two cases:

[0097] 1. If the exception packet has not been transmitted downstream from the cache space, write-side packet dropping is adopted, that is, the sliced data of the exception packet is discarded from the cache, and the linked list is rolled back. See Figure 6 As shown, the head pointer of the queue linked list to which the exception packet belongs rolls back to the tail pointer of the previous packet, and the head pointer head_idle of the free linked list rolls back to the head pointer of the current packet, and the invalid linked list nodes in the read address pool and write address pool of the queue to which the exception packet belongs are cleared.

[0098] 2. If the exception packet has been transmitted downstream from the cache space, read-side EBP (End Bad Packet) is supplemented and then truncated, and the linked list does not need to be rolled back. See Figure 7 As shown, the queue linked list to which the exception packet belongs has been cleared, there is no valid linked list head and tail pointer, and the queue linked list does not need to be rolled back; while the head pointer head_idle of the free linked list queue rolls back to the head pointer of the queue linked list node, that is, the queue linked list node corresponding to the cache line storing the exception packet is added to the free linked list node.

[0099] Through write-side packet dropping or read-side truncation, packet discarding is efficiently implemented, and the maintenance of the data queue / free linked list and the rapid release of the cache space are completed.

[0100] The above is the data storage device exemplarily proposed in this application, which has the following advantages:

[0101] 1. The free linked list nodes and queue linked list nodes are merged and cached in the linked list node buffer area, reducing resource consumption and being physically implementation-friendly.

[0102] 2. By setting up read and write address pools, a single linked list node can control multiple addresses, that is, the same cache lines of different banks are indicated by the same linked list node. Therefore, the same linked list node can control multiple cache line addresses corresponding to the same cache lines of multiple banks.

[0103] 3. Since the data buffer is divided into multiple cache blocks, there is no need to additionally increase the cache resources for message splicing, and the memory_pool can adapt to messages with different bit widths.

[0104] 4. The queue length can be shortened, the consumption of linked list resources can be reduced, and the area of the data storage device can be prevented from being too large due to a large number of linked list nodes.

[0105] 5. In the cut-through forwarding mode, abnormal messages are efficiently discarded, and the cache space is quickly released, avoiding the waste of effective bandwidth caused by bad packets.

[0106] 6. A multicast virtual channel queue is independently set, effectively solving the problem that multicast replication continuously occupies the head of the queue and avoiding blocking the forwarding of unicast messages.

[0107] 7. A data storage and credit management scheme is proposed in which the cache bit width (i.e., the data bit width of a cache line) is greater than the flow control unit (i.e., the bit width of a row in a bank).

[0108] Correspondingly, as shown in Figure 8 shown, the present application also exemplarily provides a message storage method, which stores messages by using any of the above data storage devices. The method includes:

[0109] In step S801, read the block address from the write address pool of the queue linked list management module corresponding to the message;

[0110] In step S802, determine the cache block corresponding to the block address and the cache line address in the cache block;

[0111] In step S803, write the message to the cache line address in the cache block;

[0112] In step S804, add the free linked list node corresponding to the cache line address of the cache block where the message is written as the tail node of the queue to the queue linked list nodes of the queue linked list management module.

[0113] Correspondingly, as shown in Figure 9 shown, the present application also exemplarily provides a message reading method, which reads messages by using any of the above data storage devices. The method includes:

[0114] In step S901, read the block address from the read address pool of the queue linked list management module corresponding to the message;

[0115] In step S902, determine the cache block corresponding to the block address and the cache line address in the cache block;

[0116] In step S903, read the message from the cache line address in the cache block;

[0117] In step S904, the queue linked list node corresponding to the cache line address of the cache block that has read the message is added as the free tail node to the free linked list node.

[0118] The above message storage method and message reading method can be implemented by the data storage device provided in the above embodiments. For the specific implementation manner, reference can be made to the description of the data storage device in the above embodiments, which will not be elaborated here.

[0119] It can be understood that the circuit structures, names, and parameters described in the above embodiments are only examples. Those skilled in the art can also easily combine and adjust the structural features of the above multiple embodiments according to the usage requirements, and should not limit the concept of this application to the specific details of the above examples.

[0120] Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A data storage device, characterized in that: include: Data buffer area, linked list node buffer area, queue linked list management module and free linked list management module; The data cache area includes a plurality of cache blocks, each cache block includes a plurality of cache lines; The linked list node cache area is used to store a plurality of linked list nodes, the plurality of linked list nodes correspond one-to-one to the cache lines of the cache block, and the positions of the linked list nodes in the linked list node cache area are the same as the positions of the corresponding cache lines in the cache block; the linked list nodes include queue linked list nodes and free linked list nodes; The queue linked list management module includes a unicast virtual channel queue linked list management module and a multicast virtual channel queue linked list management module; wherein the queue includes a unicast virtual channel queue and a multicast virtual channel queue, and the unicast virtual channel queue corresponds to the virtual channel one by one; The unicast virtual channel queue linked list management module is used to control the reading and writing process of the unicast message of the corresponding virtual channel and manage the queue linked list nodes corresponding to the unicast message of the corresponding virtual channel; The multicast virtual channel queue linked list management module is used to control the reading and writing process of the multicast messages of all virtual channels and manage the queue linked list nodes corresponding to the multicast messages of all virtual channels; The idle queue linked list management module is used to manage the idle linked list nodes.

2. The data storage device according to claim 1, characterized in that The same cache lines of different cache blocks can store slice data of the same message or slice data of different messages in the same queue; the same message can be stored across rows in the cache lines of the cache blocks.

3. The data storage device according to claim 1, characterized in that: For unicast messages to be stored, according to the virtual channel to which they belong, the corresponding unicast virtual channel queue management module stores them in the cache lines of one or more cache blocks corresponding to the corresponding queue list node; for multicast messages to be stored, the multicast virtual channel queue management module stores them in the cache lines corresponding to the corresponding queue list node.

4. The data storage device according to claim 1, characterized in that: Each of the queue linked list management modules is provided with a read address pool and a write address pool, and the queue linked list management module converts the cache line address corresponding to the queue head node in the corresponding queue linked list node into a block address and adds the address to the corresponding read address pool; The free list management module takes out the free first node in the free list node from the free list node, converts the cache line address corresponding to the free first node into a block address, and then adds it to the corresponding write address pool.

5. The data storage device according to claim 4, characterized in that: The queue linked list management module uses the cache line address corresponding to the queue head node as the low-order address, and uses the sequence number of the cache block as the high-order address to obtain the block address corresponding to the cache line address corresponding to the queue head node; the free linked list management module uses the cache line address corresponding to the free head node as the low-order address, and uses the sequence number of the cache block as the high-order address to obtain the block address corresponding to the cache line address corresponding to the free head node.

6. The data storage device according to claim 4 or 5, characterized in that: During the message writing process, the queue linked list management module reads the block address from the write address pool, determines the cache block corresponding to the block address and the cache line address in the cache block, and writes the message to the cache line address in the cache block; the free linked list management module also adds the free linked list node corresponding to the cache line address of the cache block where the message is written as the queue tail node to the queue linked list node of the corresponding queue linked list management module.

7. The data storage device according to claim 4 or 5, characterized in that: During the message reading process, the queue linked list management module reads the block address from the read address pool, determines the cache block corresponding to the block address and the cache line address in the cache block, and reads the message from the cache line address in the cache block; The free linked list management module also reads the queue linked list node corresponding to the cache line address of the cache block of the message, and adds it to the free linked list node as an idle tail node.

8. The data storage device according to any one of claims 1 to 5, characterized in that: After the abnormal message is found, if the abnormal message has not started to be transmitted downstream, the queue linked list management module corresponding to the abnormal message also adds the queue linked list node corresponding to the cache line storing the abnormal message in the data cache area to the free linked list node; If the abnormal message has started to be transmitted downstream, the queue linked list management module corresponding to the abnormal message transmits a bad packet end identifier downstream, and adds a queue linked list node corresponding to the cache line storing the abnormal message in the data cache area to the free linked list node.

9. A message storage method, characterized in that: The method uses the data storage device according to any one of claims 1 to 8 to store the message, comprising: Reading a block address from a write address pool of a queue linked list management module corresponding to the message; Determine a cache block corresponding to the block address and a cache line address in the cache block; Writing the message into the cache line address in the cache block; The free linked list node corresponding to the cache line address of the cache block into which the message is written is added as a queue tail node to the queue linked list node of the queue linked list management module.

10. A message reading method, characterized in that: The method uses the data storage device according to any one of claims 1 to 8 to read the message, comprising: Reading a block address from a read address pool of the queue linked list management module corresponding to the message; Determine a cache block corresponding to the block address and a cache line address in the cache block; Reading a message from the cache line address in the cache block; The queue linked list node corresponding to the cache line address of the cache block that has read the message is added to the idle linked list node as an idle tail node.

Citation Information

Patent Citations

  • Memory management method and system of traffic management chip chain tables of high-speed router

    CN102130833A

  • Cache management method and cache management apparatus for Ethernet switching chip

    CN102857446A

  • Method and device for processing message

    CN103731368A

  • Data caching method and device, chip and storage medium

    CN113641599A

  • Message caching method and device, electronic equipment and storage medium

    CN117354268A