WO2014169874A1 - Table entry management device, table entry management method, and computer storage medium - Google Patents

Table entry management device, table entry management method, and computer storage medium Download PDF

Info

Publication number
WO2014169874A1
WO2014169874A1 PCT/CN2014/077802 CN2014077802W WO2014169874A1 WO 2014169874 A1 WO2014169874 A1 WO 2014169874A1 CN 2014077802 W CN2014077802 W CN 2014077802W WO 2014169874 A1 WO2014169874 A1 WO 2014169874A1
Authority
WO
WIPO (PCT)
Prior art keywords
search
entry
unit
lookup
management unit
Prior art date
Application number
PCT/CN2014/077802
Other languages
French (fr)
Chinese (zh)
Inventor
包闯
赖明亮
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2014169874A1 publication Critical patent/WO2014169874A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9017Indexing; Data structures therefor; Storage structures using directory or table look-up

Definitions

  • Item management device table item management method, and computer storage medium
  • the present invention relates to communication technologies, and in particular, to an entry management device, an entry management method, and a computer storage medium. Background technique
  • NP Network Processor
  • ASIP Application Specific Instruction Processor
  • the embodiment of the present invention provides an entry management device and an entry management method, so as to solve at least the problem that the related entry search technology cannot meet the requirements for the entry type, the entry size, and the lookup performance of the entry in the multiple scenarios.
  • An embodiment of the present invention provides an entry management device, where the device includes: a structure definition table (SDT), a lookup scheduling unit, a second level search management unit, a cache management unit, and a return scheduling unit.
  • SDT structure definition table
  • the SDT unit is configured to maintain a table entry length and an entry base address corresponding to the first lookup of the entry, and a table entry length and an entry base address corresponding to the second lookup of the entry; a scheduling unit, configured to be initiated according to the discovery interface in the SDT unit Searching for the corresponding entry length and the entry base address of the entry, and the key value corresponding to the first search sent by the lookup interface when the first lookup is initiated, and initiating the first search to the secondary search management unit And initiating a second search to the cache management unit according to the offset returned by the secondary lookup management unit and the entry length and the entry base address of the SDT unit corresponding to the second lookup;
  • the return scheduling unit is configured to send the content of the second searched item returned by the cache management unit to the corresponding search interface.
  • the SDT unit is further configured to maintain information of a search algorithm used for the first search
  • the locating and scheduling unit is further configured to determine, according to the information of the search algorithm corresponding to the first search initiated by the search interface in the SDT unit, a secondary search management unit of the search algorithm corresponding to the response, and determine The secondary lookup management unit initiates a first lookup to the cache management unit.
  • the apparatus further includes a secondary lookup unit corresponding to the secondary lookup management unit;
  • the secondary search management unit is further configured to: according to the first entry search initiated by the lookup interface in the SDT unit, the entry length and the entry base address, and the key value corresponding to the first lookup , initiating a first search to the corresponding secondary search unit;
  • the secondary search unit is further configured to: according to the first item search initiated by the lookup interface, the entry length and the entry base address, and the first searched key value.
  • the corresponding offset information is requested from the cache management unit.
  • the SDT unit is further configured to maintain information corresponding to a target memory type of the first search
  • the secondary search unit is further configured to request, according to the type information of the target memory corresponding to the first lookup initiated by the lookup interface in the SDT unit, to the corresponding cache management unit. Offset information;
  • the cache management unit is further configured to request the offset information of the secondary search unit to search for offset information in the corresponding memory.
  • the SDT unit is further configured to maintain information corresponding to a target memory type of the second search
  • the search scheduling unit is further configured to request the content of the entry from the corresponding cache management unit according to the type information of the target memory corresponding to the second search in the SDT unit.
  • the SDT unit is further configured to maintain an enable identifier for the second lookup;
  • the lookup scheduling unit is further configured to determine, when receiving the offset returned by the second level search management unit, When the enable identifier of the second search corresponding to the first lookup initiated by the lookup interface is valid, the second search is initiated to the cache management unit, otherwise, the received offset information is sent to the first start. Find the lookup interface that requests the offset information.
  • the SDT unit is further configured to directly search for a corresponding entry length and a base address of the entry;
  • the lookup scheduling unit is further configured to: according to the table entry length and the table base address corresponding to the direct search initiated by the lookup interface in the SDT unit, and the key value sent when the lookup interface initiates a direct lookup, Initiating a direct lookup to the cache management unit;
  • the return scheduling unit is configured to send the content of the directly searched item returned by the cache management unit to a lookup interface that initiates the direct search to request the content of the corresponding entry.
  • the SDT unit is further configured to maintain information corresponding to the target memory type directly searched and directly search for used algorithm information;
  • the search scheduling unit is further configured to request the content of the entry from the corresponding cache management unit according to the type information of the target memory corresponding to the direct search in the SDT unit and the algorithm information used for directly searching.
  • the return scheduling unit is further configured to query the content of the same entry according to the first Finding or directly searching for a corresponding pointer, determining a sequence of the first search or the direct search initiation, and sending the content of the entry returned by the cache management unit to the first one according to the determined sequence Secondary lookup or lookup interface for the direct lookup.
  • the device further includes:
  • An entry management unit configured to send, by the cache management unit, the direct search, the content of the entry corresponding to the second search, and the offset information corresponding to the first search to a corresponding type of memory .
  • the embodiment of the present invention further provides an entry management method, which is applied to an entry management device, where the device includes: an SDT unit, a lookup scheduling unit, a secondary search management unit, a cache management unit, and a return scheduling unit; Includes:
  • the SDT unit maintains the entry length and the entry base address corresponding to the first lookup of the entry, and the entry length and the entry base address corresponding to the second lookup of the entry;
  • the lookup scheduling unit is configured to: according to the first item searched by the search interface, the entry length and the entry base address, and the search interface to initiate the first search, and the key value corresponding to the first search, Initiating a first lookup to the secondary lookup management unit, and returning an offset according to the first lookup returned by the second level lookup management unit, and an entry corresponding to the second lookup in the SDT unit a length and an entry base address, and initiating a second search to the cache management unit;
  • the return scheduling unit sends the content of the second searched item returned by the cache management unit to the corresponding search interface.
  • the method further includes:
  • the SDT unit maintains information for the first lookup using the lookup algorithm
  • the search scheduling unit determines, according to the information of the search algorithm corresponding to the first search initiated by the lookup interface in the SDT unit, the secondary search management unit of the search algorithm corresponding to the response, and uses the determined secondary search a management unit, initiating the cache management unit for the first time Find.
  • the device further includes a secondary search unit corresponding to the secondary search management unit; and correspondingly, the method further includes:
  • the second-level search management unit according to the first item search and the base address corresponding to the first search initiated by the search interface, and the key value corresponding to the first search, to the corresponding
  • the secondary search unit initiates a first lookup
  • the secondary searching unit sends the cache entry length and the entry base address corresponding to the first lookup initiated by the lookup interface in the SDT unit, and the key value corresponding to the first lookup to the cache.
  • the snap-in requests the corresponding offset information.
  • the method further includes:
  • the SDT unit maintains information corresponding to the target memory type of the first lookup; the secondary search unit according to the type information of the target memory corresponding to the first lookup initiated by the lookup interface in the SDT unit, to the corresponding
  • the cache management unit requests the offset information; the cache management unit searches for the offset information in the corresponding memory according to the request of the offset information of the secondary search unit.
  • the method further includes:
  • the SDT unit maintains information corresponding to the target memory type of the second search; the search scheduling unit requests the corresponding cache management unit according to the type information of the target memory corresponding to the second search in the SDT unit. The contents of the entry.
  • the method further includes:
  • the SDT unit maintains an enable identifier for the second search
  • the receiving the scheduling unit receives the offset returned by the second-level search management unit, determining whether the enable identifier of the second search corresponding to the first search sent by the search interface is Valid, if valid, initiate a second lookup to the cache management unit, otherwise; send the received offset information to initiate the first lookup to request the bias The search interface for the shift information.
  • the method further includes:
  • the SDT unit maintains a direct search for the corresponding entry length and the base address of the entry;
  • the search scheduling unit initiates a direct search according to the length of the entry and the base address of the entry directly initiated by the lookup interface in the SDT unit, and the key value sent by the lookup interface when the direct search is initiated;
  • the return scheduling unit sends the content of the entry returned by the direct search returned by the cache management unit to a lookup interface that initiates the direct search to request the content of the corresponding entry.
  • the method further includes:
  • the SDT unit maintains information corresponding to the target memory type directly searched and directly searches for the used algorithm information
  • the search scheduling unit requests the content of the entry from the corresponding cache management unit according to the type information of the target memory corresponding to the direct search in the SDT unit and the algorithm information used for directly searching.
  • the method further includes:
  • the contents of the entry returned by the cache management unit are sent to a lookup interface that initiates the first lookup or the direct lookup.
  • the device further includes: an entry management unit; and the method further includes: the entry management unit, by the cache management unit, the table corresponding to the direct search and the second search The item content, the offset information corresponding to the first search is sent to a corresponding type of memory.
  • An embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, where the computer executable instructions are used to execute the foregoing items. Management method.
  • the information corresponding to the direct search, the first search, and the second search such as the lookup entry type, the lookup entry length, and the lookup table entry base address, are implemented.
  • the second lookup enablement flag can initiate a second search, which saves the overhead of the instruction and improves the search efficiency;
  • the content of the corresponding entry can be returned in the order in which the search is initiated, so that the order can be implemented;
  • Indirect addressing is used to find the contents of the table. It overcomes the shortcomings of the bus address space caused by the random access memory (RAM) in the traditional technology, and can be widely applied to other address spaces. In the item management scenario. DRAWINGS
  • FIG. 1 is a schematic structural diagram of a component management apparatus according to an embodiment of the present invention.
  • FIG. 2a is a schematic structural diagram of the SDT unit 101 storing the first search and the second search corresponding entry information according to an embodiment of the present invention
  • 2b is a schematic diagram of a structure in which the SDT unit 101 stores a direct search for corresponding entry information according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a lookup scheduling unit 102 according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a cache management unit 104 according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a control register according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of an entry management unit 107 according to an embodiment of the present invention.
  • FIG. 7 is a schematic flowchart of implementing an entry management method according to an embodiment of the present invention. detailed description
  • FIG. 1 is a schematic structural diagram of a table item management apparatus according to an embodiment of the present invention. As shown in FIG. 1, the method includes: an SDT unit 101, a lookup scheduling unit 102, a secondary lookup management unit 103, a cache management unit 104, and a return scheduling unit 105. ; among them,
  • the SDT unit 101 is configured to maintain an entry length and an entry base address corresponding to the first lookup of the entry, and an entry length and an entry base address corresponding to the second lookup of the entry;
  • the lookup scheduling unit 102 is configured to: according to the table entry length and the entry base address corresponding to the first lookup initiated by the lookup interface in the SDT unit 101, and the correspondence sent by the lookup interface when the first lookup is initiated.
  • the first searched key value initiates a first search to the secondary search management unit 103, and according to the offset returned by the secondary search management unit 103, and the SDT unit 101 and the first Finding the corresponding entry length and the entry base address twice, and initiating a second search to the cache management unit 104;
  • the return scheduling unit 105 is configured to send the content of the second searched item returned by the cache management unit 104 to the corresponding search interface.
  • the SDT unit 101 maintains different indexes for different entries.
  • the lookup interface initiates the first lookup, according to the SDT table index sent by the lookup interface, the length of the corresponding entry is determined. The base address of the entry and the base entry length and the base address of the entry corresponding to the second lookup of the entry.
  • the SDT unit 101 is further configured to maintain search algorithm information used for the first search;
  • the locating and scheduling unit 102 is further configured to determine, according to the information of the search algorithm corresponding to the first search initiated by the search interface in the SDT unit 101, the secondary search management unit 103 that responds to the corresponding search algorithm, and Through the determined secondary search management unit 103, The cache management unit 104 initiates a first lookup.
  • the apparatus further includes a secondary lookup unit 106 corresponding to the secondary lookup management unit 103;
  • the secondary search management unit 103 is further configured to: the entry length and the entry base address corresponding to the first lookup initiated by the lookup interface in the SDT unit 101, and the corresponding first lookup Key value, initiates a first search to the corresponding secondary search unit 106;
  • the second-level searching unit 106 is further configured to: according to the first item search and the base address corresponding to the first search initiated by the search interface in the SDT unit 101, and corresponding to the first search
  • the key value is requested from the cache management unit 104 for the corresponding offset information.
  • the offset information is used for subsequent second lookups
  • the SDT unit 101 is further configured to maintain information corresponding to a target memory type of the first lookup;
  • the secondary searching unit 106 is further configured to request an offset from the corresponding type of the cache management unit 104 according to the type information of the target memory corresponding to the first lookup initiated by the lookup interface in the SDT unit 101.
  • the cache management unit 104 is further configured to look up the offset information in the corresponding memory according to the request of the offset information of the secondary search unit.
  • the type of the memory may include an on-chip memory and an off-chip memory. Accordingly, when the secondary search unit 106 is in the target memory type information of the first lookup maintained by the SDT unit 101, determining the first lookup. When the type of the corresponding target memory is on-chip memory, the offset management information is requested from the cache management unit 104 responsible for the first lookup of the on-chip memory.
  • the SDT unit 101 is further configured to maintain information corresponding to a target memory type of the second search;
  • the lookup scheduling unit 102 is further configured to be in accordance with the SDT unit 101 and the first The type information of the corresponding target memory is searched twice, and the content of the entry is requested from the corresponding cache management unit 104.
  • the SDT unit 101 is further configured to maintain an enable identifier for the second lookup; the lookup scheduling unit 102 is further configured to, when receiving the offset returned by the second level search management unit 103, Determining whether the enable identifier corresponding to the second search corresponding to the first search initiated by the search interface is valid, and if valid, initiating a second search to the cache management unit 104; otherwise, receiving the received
  • the offset information is sent to a lookup interface that initiates a first lookup to request the offset information.
  • the SDT unit 101 is further configured to directly search for a corresponding entry length and an entry base address
  • the lookup scheduling unit 102 is further configured to: according to the table entry length and the entry base address corresponding to the direct lookup initiated by the lookup interface in the SDT unit 101, and the key value sent when the lookup interface initiates a direct lookup, Initiating a direct lookup to the cache management unit 104;
  • the return scheduling unit 105 is configured to send the content of the directly searched entry returned by the cache management unit 104 to the lookup interface ⁇ that initiates the first lookup to request the offset information.
  • the SDT unit 101 is further configured to maintain information corresponding to a target memory type directly searched and directly search for used algorithm information;
  • the lookup scheduling unit 102 is further configured to request the content of the entry from the corresponding cache management unit 104 according to the type information of the target memory corresponding to the direct search in the SDT unit 101 and the algorithm information used for directly searching.
  • the return scheduling unit 105 is further configured to determine, according to the first lookup of the content of the same entry or directly search for the corresponding pointer, determine the sequence of the first search or the direct search initiation, according to the The determined order sends the contents of the entry returned by the cache management unit to the lookup interface that initiates the first lookup or the direct lookup.
  • the return scheduling unit 105 sends the content of the entry returned by the cache management unit 104 to the corresponding search interface according to the search interface identifier corresponding to the first search and the direct search. .
  • the device further comprises:
  • the entry management unit 107 is configured to deliver, by the cache management unit 104, the entry corresponding to the direct search, the first search, and the second search to a corresponding type of memory.
  • each unit in the entry management device can be implemented by a Network Processor (NP).
  • NP Network Processor
  • FIG. 2a is a schematic structural diagram of the SDT unit 101 storing the first lookup and the second lookup corresponding entry information according to the embodiment of the present invention. As shown in FIG. 2a, the method includes:
  • the search algorithm includes: a hash search algorithm, a route lookup algorithm, and a high-speed route lookup algorithm based on a Ternary Content Addressable Memory (TCAM);
  • TCAM Ternary Content Addressable Memory
  • the above search algorithms are secondary search algorithms, that is, For the content of the entry to be searched, the offset information of the entry is determined by the first search, and the second search is performed according to the offset information determined by the first search to determine the content of the entry to be searched.
  • target memory include on-chip memory and off-chip memory.
  • the first lookup table entry base address is a stored start address of an entry corresponding to the same entry type.
  • the content of the first searched entry of the same search algorithm is in the corresponding slice.
  • the contiguous space is stored in the memory or off-chip memory, and the starting address of the contiguous space is the base address of the first lookup entry type. 3) The length of the first lookup entry;
  • the offset information of the first search and the second searched entry corresponding to the first search are preset. Type, table item base address, and table item length for a second lookup.
  • the base address of the entry is the stored start address of the entry corresponding to the same entry type.
  • the content of the second searched entry of the same search algorithm is in the corresponding on-chip memory or off-chip.
  • the memory utilizes contiguous spatial storage, the starting address of which is the base address of the second lookup entry type.
  • the lookup interface initiates the first lookup
  • the first lookup uses the hash lookup algorithm
  • the storage space of the offset information to be searched is determined by storing the key value of the first lookup sent according to the lookup table interface. For: (first lookup table entry base address + key value) ⁇ (first lookup table entry base address + key value + first lookup table entry length); correspondingly, the second lookup of the table entry content
  • the storage space is: (second lookup table entry base address + offset) ⁇ (first lookup table entry base address + offset + second lookup table entry length).
  • FIG. 2b is a schematic structural diagram of the SDT unit 101 storing a direct search for the corresponding entry information according to the embodiment of the present invention. As shown in FIG. 2b, the method includes:
  • the direct search corresponding algorithm refers to a search algorithm that can query the content of the corresponding entry by one search, that is, for the entry to be searched, directly according to the key value of the entry to be searched and the base address of the entry to be searched.
  • the length of the entry which determines the content of the entry to be searched.
  • the type of the target memory includes an on-chip memory and an off-chip memory.
  • an on-chip search mode may be adopted, that is, in the scenario, The delivered entries are stored in the on-chip memory and searched in the corresponding on-chip memory.
  • the on-chip memory and the off-chip memory can be mixed and stored. The way the item is published, and the corresponding on-chip memory or off-chip memory is searched.
  • the direct lookup table entry base address is a stored start address of an entry corresponding to the same entry type.
  • the content of the first searched entry of the same search algorithm is in the corresponding on-chip memory or
  • the off-chip memory utilizes contiguous spatial storage, the starting address of which is the base address of the first lookup entry type.
  • the storage space of the entry to be searched is determined according to the key value sent by the lookup table interface: (table entry base address + key value) ⁇ (table entry base address + key value + direct lookup table Item length).
  • the lookup scheduling unit 102 caches the first lookup, the second lookup, and the direct lookup for the corresponding key and the corresponding information in the SDT table.
  • Corresponding queue according to preset The load balancing policy, scheduling the first information of the cache, the second search, and the direct search, corresponding to initiating the first search, the second search, or the direct search, and initiating the first search, the first
  • the corresponding search interface identifier is sent when the second search or direct search.
  • FIG. 3 is a schematic structural diagram of the search and scheduling unit 102 according to an embodiment of the present invention.
  • the second search and analysis sub-unit 301 is included.
  • a first lookup parsing subunit 302 a direct lookup cache subunit 303, a first lookup cache subunit 304, a second lookup cache subunit 305, a first lookup management subunit 306, and a second lookup management subunit 307; among them,
  • the first lookup parsing sub-unit 302 is configured to directly search for a key value, and a direct lookup table entry base address and a direct lookup table entry length corresponding to the direct lookup in the SDT unit 101, according to a target memory directly searched.
  • Type cached to the corresponding direct lookup cache subunit 303; the first searched key value, and the first lookup table entry base address and first lookup corresponding to the first lookup in the SDT unit 101
  • the length of the entry is cached to the corresponding first lookup cache subunit 304;
  • the second lookup parsing subunit 301 is configured to set a second lookup key value, and a second lookup table entry base address and a second lookup table corresponding to the second lookup in the SDT unit 101.
  • the length of the item, according to the type of the target memory of the second search, is cached to the corresponding second lookup cache subunit 305;
  • the second lookup scheduling sub-unit 307 is configured to schedule a key value cached by the first lookup cache subunit 304 connected to the first lookup scheduling subunit 307, a first lookup table entry base address, and a first The secondary lookup table entry length, initiates a first lookup to the secondary lookup management unit 103 connected to the second lookup scheduling subunit 307, and sends a first lookup corresponding search interface identifier to the secondary lookup unit 106.
  • pointers
  • the first lookup management sub-unit 306 is configured to schedule a key value cached by the second lookup cache subunit 305 connected to the first lookup and dispatch subunit 306, and a second lookup table entry base address. And the second lookup entry length, initiates a first lookup to the cache management unit 104 connected to the first lookup management subunit 306, and sends the first lookup corresponding search interface identifier and pointer to the cache management unit 104. And configuring, by the direct lookup cache subunit 303 connected to the first lookup and dispatching subunit 306, a key value, a direct lookup table base address, and a direct lookup entry length, to the first lookup management subunit. The cache management unit 104 of the connection 306 initiates a direct lookup and sends a direct lookup to the corresponding lookup interface identifier and pointer to the cache management unit 104.
  • the first lookup parsing sub-unit 302 selects the direct lookup entry base address and the direct lookup entry length corresponding to the direct lookup initiated by the lookup interface in the SDT unit 101, and directly searches for The type of the target memory is cached in the corresponding direct lookup cache subunit 303.
  • the first lookup parsing subunit 302 will first search the SDT unit 101 and the lookup interface.
  • the corresponding first lookup table entry base address and the first lookup entry length, and the type of the target memory that is first searched, are cached in the corresponding first lookup cache subunit 304;
  • the first search parsing sub-unit 302 respectively corresponds to the search algorithm used by the first search (including the hash search algorithm and the route search algorithm); the second search management sub-unit 307 according to the preset load balancing policy, from the corresponding The first lookup cache sub-unit 304 schedules the first lookup of the corresponding first lookup table base address and the first lookup entry length for the first time, and initiates the first lookup to the corresponding secondary lookup management unit 103.
  • FIG. 4 is a schematic structural diagram of a cache management unit 104 according to an embodiment of the present invention. As shown in FIG. 4, the method includes:
  • the address resolution subunit 401 is configured to parse an access address of a memory storing the item to be published, and determine a physical address of the memory corresponding to the access address;
  • the cache management scheduling sub-unit 402 is configured to parse the physical address, and send the to-be-published item to the corresponding cache management control sub-unit 403;
  • the cache management control sub-unit 403 is configured to cache the to-be-published item to the read-write queue according to the physical address corresponding to the item to be published; cache the first-time searched physical address to the read-write queue; Cache the directly searched physical address to the read/write queue; perform the operations in the read/write queue in sequence according to the preset load balancing policy, including: the content of the entry to be delivered in the read/write queue Write the memory 404 corresponding to the cache management control sub-unit 403, obtain the corresponding entry content in the memory 404 according to the physical address in the read-write queue, and send the obtained entry content to the Return to scheduling unit 105.
  • the number of cache management control sub-units 403 may be multiple, and each cache management control sub-unit 403 is responsible for a continuous physical address space of the memory 404.
  • the read-write queue may be implemented in the form of a register.
  • the memory 404 can be implemented in the form of a random access memory (RAM). The following implementation examples are described.
  • the address resolution subunit 401 maintains a data register and a control register corresponding to the read and write operations, wherein the data register is used.
  • the control register is used to control the read and write operations of the data register to store data to be written to the memory 404 (ie, the content of the next published item) or data to be read (ie, the contents of the entry to be searched).
  • FIG. 5 is a schematic structural diagram of a control register according to an embodiment of the present invention.
  • the read command write_cmd, the write command read_cmd, the RAM block select ram_sel, and the RAM address ram_addr are four fields, and the RAM is accessed when the control register is parsed.
  • the specific address if the current write command is valid, the data is written into the corresponding RAM, as the current read command is valid, Read out the data in the corresponding address.
  • the entry management unit 107 delivers the content of the entry (including the first storage and update of the entry), the content of the entry is written into the corresponding memory 404 according to the information in the SDT unit 101, and the memory 404 Types include on-chip and off-chip.
  • the content of the corresponding item is directly searched for, the content of the item to be delivered is directly written into the memory 404 through the Peripheral Component Interface (PCI-E) according to the information directly corresponding to the search in the SDT unit 101.
  • PCI-E Peripheral Component Interface
  • DMA direct memory access
  • the content of the entry to be delivered is written into the entry management unit according to the information corresponding to the first search and the second search by the SDT unit 101.
  • the content of the table item to be delivered is forwarded to the corresponding on-chip memory 304 or off-chip memory 404 by calling a hardware interface function.
  • FIG. 6 is a schematic structural diagram of an entry management unit 107 according to an embodiment of the present invention. As shown in FIG. 6, the method includes:
  • the central processing sub-unit 601 is configured to directly search for the corresponding entry content according to the information directly corresponding to the search in the SDT 101, and send the content to the entry management sub-unit 602, and trigger the entry management sub-unit 602;
  • the information corresponding to the first search and the second search, the first search and the second search corresponding entry content, is sent to the entry management sub-unit 602, and triggers the entry management sub-unit 602;
  • the item management sub-unit 602 is configured to directly search for the corresponding item content delivered by the central processing sub-unit 601, and write the content of the corresponding item to the memory 404 through the fast peripheral component interface PCI-E;
  • the content of the corresponding entry in the first search and the second search is written into the entry management unit cache sub-unit 603 by calling the memory read/write function, and the contents of the entry of the cache sub-unit 603 are forwarded to the corresponding by calling the hardware interface function.
  • FIG. 7 is a schematic flowchart of an implementation process of an entry management method according to an embodiment of the present invention, which is applied to the entry management device shown in FIG. 1; as shown in FIG. 7, the following steps are included:
  • Step 701 The SDT unit 101 maintains the entry length and the entry base address corresponding to the first lookup of the entry, and the entry length and the entry base address corresponding to the second lookup of the entry.
  • Step 702 The lookup scheduling unit 102 performs the first lookup according to the entry length and the entry base address corresponding to the first lookup initiated by the lookup interface, and the first lookup initiated by the lookup interface. The key value, initiates a first lookup to the secondary lookup management unit 103.
  • Step 703 The lookup scheduling unit 102 returns an offset according to the first lookup returned by the second-level lookup management unit 103, and an entry length and an entry corresponding to the second lookup in the SDT unit 101.
  • the base address initiates a second lookup to the cache management unit 104.
  • Step 704 The return scheduling unit 105 sends the content of the second searched entry returned by the cache management unit 104 to the corresponding search interface.
  • the method further includes:
  • the SDT unit 101 maintains the information of the search algorithm used for the first search; the search and scheduling unit 102 determines the information of the search algorithm corresponding to the first search initiated by the search interface in the SDT unit 101.
  • the second lookup management unit 103 responds to the corresponding lookup algorithm, and initiates a first lookup to the cache management unit 104 through the determined secondary lookup management unit 103.
  • the device further includes a secondary search unit 106 corresponding to the secondary search management unit 103; correspondingly, the method further includes:
  • the second-level search management unit 103 according to the first lookup corresponding to the first lookup initiated by the lookup interface in the SDT unit 101, and the base address of the entry, and corresponding to the first check Finding the key value, and initiating a first search to the corresponding secondary search unit 106;
  • the second-level searching unit 106 is configured according to the length of the entry corresponding to the first search initiated by the search interface in the SDT unit 101, the base address of the entry, and the key value corresponding to the first search.
  • the cache management unit 104 requests the corresponding offset information.
  • the method further includes:
  • the SDT unit 101 maintains information corresponding to the target memory type of the first lookup; the secondary search unit 106 according to the type information of the target memory corresponding to the first search initiated by the lookup interface in the SDT unit 101, Requesting offset information from the corresponding cache management unit 104;
  • the cache management unit 104 searches for the offset information in the corresponding memory according to the request of the offset information of the secondary search unit 106.
  • the method further includes:
  • the SDT unit 101 maintains information corresponding to the target memory type of the second search; the search scheduling unit 102 according to the type information of the target memory corresponding to the second search in the SDT unit 101, to the corresponding cache.
  • the management unit 104 requests the contents of the entry.
  • the method further includes:
  • the SDT unit 101 maintains an enable identifier for the second search
  • the search scheduling unit 102 determines whether the enable identifier of the second search corresponding to the first search sent by the search interface is valid, when the offset returned by the second-level search management unit 103 is received, if If so, a second lookup is initiated to the cache management unit 104, otherwise; the received offset information is sent to a lookup interface that initiates the first lookup to request the offset information.
  • the method further includes:
  • the SDT unit 101 maintains a direct search for a corresponding entry length and an entry base address; the lookup scheduling unit 102 initiates according to the search interface in the SDT unit 101. Directly searching for the corresponding entry length and the base address of the entry, and the key value sent by the lookup interface when initiating a direct lookup initiates a direct lookup;
  • the return scheduling unit 105 sends the content of the entry returned by the direct search returned by the cache management unit 104 to the lookup interface that initiates the direct lookup to request the content of the corresponding entry.
  • the method further includes:
  • the SDT unit 101 maintains information corresponding to the target memory type directly searched and directly searches for the used algorithm information
  • the lookup scheduling unit 102 requests the content of the entry from the corresponding cache management unit 104 according to the type information of the target memory corresponding to the direct search in the SDT unit 101 and the algorithm information used for directly searching.
  • the method further includes:
  • the return scheduling unit 105 determines the sequence of the first search or the direct search initiation according to the first search of the content of the same entry or directly searches for the corresponding pointer, according to the determined sequence, The contents of the entry returned by the cache management unit 104 are sent to a lookup interface that initiates the first lookup or the direct lookup.
  • the device further includes: an entry management unit 107; and correspondingly, the method further includes:
  • the entry management unit 107 delivers, by the cache management unit 104, the direct search, the content of the entry corresponding to the second search, and the offset information corresponding to the first search to the corresponding type. Memory.
  • the method further includes:
  • the offset information of the first search and the second searched entry corresponding to the first search are preset. Type, table item base address, and table item length for a second lookup.
  • the direct lookup table entry base address is a stored start address of an entry corresponding to the same entry type.
  • the content of the first searched entry of the same search algorithm is in the corresponding on-chip memory or
  • the off-chip memory utilizes contiguous spatial storage, the starting address of which is the base address of the first lookup entry type.
  • the direct lookup table entry length is the length of each entry for the first lookup using the same lookup algorithm.
  • the lookup scheduling unit 102 caches the first lookup, the second lookup, and the direct lookup for the corresponding key and the corresponding information in the SDT table.
  • the first search, the second search, and the direct search of the cache are scheduled, and the first search, the second search, or the direct search is initiated, and
  • the corresponding lookup interface identifier is sent when the first lookup, the second lookup, or the direct lookup is initiated.
  • the entry base address of the entry is a stored start address of an entry corresponding to the same entry type.
  • the content of the first searched entry of the same search algorithm is in the corresponding on-chip memory or off-chip.
  • the memory utilizes contiguous spatial storage, the starting address of which is the base address of the first lookup entry type.
  • the entry length is the length of each entry for the first lookup using the same lookup algorithm.
  • the search algorithm includes: a hash search algorithm, a route lookup algorithm, and a TCAM-based high-speed route search algorithm; the above search algorithms are secondary search algorithms, that is, the content of the entry to be searched needs to be determined by the first search.
  • the offset information of the entry is searched for a second time according to the offset information determined by the first lookup, and the content of the entry to be searched is determined.
  • the types of target memory include on-chip memory and off-chip memory.
  • the embodiment of the invention further describes a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the entry management method shown in FIG. 7.
  • the entry management device and the entry management method provided by the embodiment of the present invention by using preset information corresponding to direct search, first search, and second search, for example, lookup entry type, lookup entry length, and lookup
  • preset information corresponding to direct search, first search, and second search for example, lookup entry type, lookup entry length, and lookup
  • the base address of the entry which implements flexible configuration of entry storage
  • the second lookup enablement flag can initiate a second search, which saves the overhead of the instruction and improves the search efficiency;
  • the content of the corresponding entry can be returned in the order in which the search is initiated, so that the order can be implemented;
  • Indirect addressing is used when looking up table entries, overcoming direct addressing in traditional techniques
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware aspects. Moreover, the invention can take the form of a computer program product embodied on one or more computer usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps that are configured to implement the functions specified in one or more blocks of the flowchart or in a block or blocks of the flowchart.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention embodiment discloses a table entry management device, a table entry management method, and a computer storage medium, said device including: a structure definition table (SDT) unit, configured for maintaining a table entry length and a table entry base address corresponding to a first search, and also a table entry length and a table entry base address corresponding to a second search; a search scheduling unit, configured for initiating the first search in regard to a level-2 search management unit, and, in accordance with an offset amount returned by the level-2 search management unit, initiating a second search in regard to a cache management unit; a return scheduling unit, configured for sending table item contents, which are returned by the cache management unit following the second search, to a corresponding search interface.

Description

表项管理装置、 表项管理方法及计算机存储介质 技术领域  Item management device, table item management method, and computer storage medium
本发明涉及通信技术, 尤其涉及一种表项管理装置、 表项管理方法及 计算机存储介质。 背景技术  The present invention relates to communication technologies, and in particular, to an entry management device, an entry management method, and a computer storage medium. Background technique
网络处理器 ( NP , Network Processor )是为网络应用领域设计的专用 指令集处理器(ASIP, Application Specific Instruction Processor ), ASIP具 有自身的结构特征和专门的电路设计以适用于网络分组处理, 同时其又是 软件可编程芯片 , 使得网络系统能够具备高性能和灵活性。  Network Processor (NP) is an Application Specific Instruction Processor (ASIP) designed for network applications. ASIP has its own structural features and special circuit design for network packet processing. It is also a software programmable chip that enables network systems to deliver high performance and flexibility.
网络处理器应用于不同的场景中时, 查表的类型、 表项容量及查表性 能需求差异较大, 传统的表项管理方法, 不能适应多变的应用场景。 发明内容  When the network processor is used in different scenarios, the types of table lookups, the capacity of table entries, and the performance of table lookups are quite different. The traditional method of table entry management cannot adapt to changing application scenarios. Summary of the invention
本发明实施例提供一种表项管理装置及表项管理方法, 以至少解决相 关表项查找技术不能满足多场景中对表项类型、 表项容量和表项查找性能 的需求的问题。  The embodiment of the present invention provides an entry management device and an entry management method, so as to solve at least the problem that the related entry search technology cannot meet the requirements for the entry type, the entry size, and the lookup performance of the entry in the multiple scenarios.
本发明实施例的技术方案是这样实现的:  The technical solution of the embodiment of the present invention is implemented as follows:
本发明实施例提供了一种表项管理装置, 所述装置包括: 结构定义表 ( SDT, Structure Definition Table )单元、 查找调度单元、 二级查找管理单 元、 緩存管理单元和返回调度单元; 其中,  An embodiment of the present invention provides an entry management device, where the device includes: a structure definition table (SDT), a lookup scheduling unit, a second level search management unit, a cache management unit, and a return scheduling unit.
所述 SDT单元, 配置为维护针对表项的第一次查找对应的表项长度和 表项基地址、 以及针对表项的第二次查找对应的表项长度和表项基地址; 所述查找调度单元, 配置为根据所述 SDT单元中与查找接口发起的第 一次查找对应的表项长度和表项基地址、 以及所述查找接口发起第一次查 找时发送的对应所述第一次查找的键值, 向所述二级查找管理单元发起第 一次查找, 并根据所述二级查找管理单元返回的偏移量、 以及所述 SDT单 元中与第二次查找对应的表项长度和表项基地址, 向所述緩存管理单元发 起第二次查找; The SDT unit is configured to maintain a table entry length and an entry base address corresponding to the first lookup of the entry, and a table entry length and an entry base address corresponding to the second lookup of the entry; a scheduling unit, configured to be initiated according to the discovery interface in the SDT unit Searching for the corresponding entry length and the entry base address of the entry, and the key value corresponding to the first search sent by the lookup interface when the first lookup is initiated, and initiating the first search to the secondary search management unit And initiating a second search to the cache management unit according to the offset returned by the secondary lookup management unit and the entry length and the entry base address of the SDT unit corresponding to the second lookup;
所述返回调度单元, 配置为将所述緩存管理单元返回的第二次查找的 表项内容发送至相应的查找接口。  The return scheduling unit is configured to send the content of the second searched item returned by the cache management unit to the corresponding search interface.
优选地, 所述 SDT单元, 还配置为维护第一次查找所使用的查找算法 的信息;  Preferably, the SDT unit is further configured to maintain information of a search algorithm used for the first search;
所述查找调度单元, 还配置为根据所述 SDT单元中与所述查找接口发 起的第一次查找对应的查找算法的信息, 确定响应对应的查找算法的二级 查找管理单元, 并通过所确定的二级查找管理单元, 向所述緩存管理单元 发起第一次查找。  The locating and scheduling unit is further configured to determine, according to the information of the search algorithm corresponding to the first search initiated by the search interface in the SDT unit, a secondary search management unit of the search algorithm corresponding to the response, and determine The secondary lookup management unit initiates a first lookup to the cache management unit.
优选地, 所述装置还包括与所述二级查找管理单元对应的二级查找单 元;  Preferably, the apparatus further includes a secondary lookup unit corresponding to the secondary lookup management unit;
所述二级查找管理单元, 还配置为根据所述 SDT单元中与所述查找接 口发起的第一次查找对应的表项长度和表项基地址、 以及对应所述第一次 查找的键值, 向对应的二级查找单元发起第一次查找;  The secondary search management unit is further configured to: according to the first entry search initiated by the lookup interface in the SDT unit, the entry length and the entry base address, and the key value corresponding to the first lookup , initiating a first search to the corresponding secondary search unit;
所述二级查找单元, 还配置为根据所述 SDT单元中与所述查找接口发 起的第一次查找对应的表项长度和表项基地址、 以及对应所述第一次查找 的键值 , 向所述緩存管理单元请求相应的偏移量信息。  The secondary search unit is further configured to: according to the first item search initiated by the lookup interface, the entry length and the entry base address, and the first searched key value. The corresponding offset information is requested from the cache management unit.
优选地, 所述 SDT单元, 还配置为维护对应第一次查找的目标存储器 类型的信息;  Preferably, the SDT unit is further configured to maintain information corresponding to a target memory type of the first search;
所述二级查找单元, 还配置为根据所述 SDT单元中与所述查找接口发 起的第一查找对应的目标存储器的类型信息, 向对应的緩存管理单元请求 偏移量信息; The secondary search unit is further configured to request, according to the type information of the target memory corresponding to the first lookup initiated by the lookup interface in the SDT unit, to the corresponding cache management unit. Offset information;
所述緩存管理单元, 还配置为 居所述二级查找单元的偏移量信息的 请求, 在对应的存储器查找偏移量信息。  The cache management unit is further configured to request the offset information of the secondary search unit to search for offset information in the corresponding memory.
优选地, 所述 SDT单元, 还配置为维护对应第二次查找的目标存储器 类型的信息;  Preferably, the SDT unit is further configured to maintain information corresponding to a target memory type of the second search;
所述查找调度单元, 还配置为根据所述 SDT单元中与所述第二次查找 对应的目标存储器的类型信息, 向对应的緩存管理单元请求表项内容。  The search scheduling unit is further configured to request the content of the entry from the corresponding cache management unit according to the type information of the target memory corresponding to the second search in the SDT unit.
优选地, 所述 SDT单元, 还配置为维护第二次查找的使能标识; 所述查找调度单元, 还配置为在接收到所述二级查找管理单元返回的 偏移量时, 确定与所述查找接口发起的第一次查找对应的第二次查找的使 能标识有效时, 向所述緩存管理单元发起第二次查找, 否则, 将所接收到 的偏移量信息发送至发起第一次查找以请求所述偏移量信息的查找接口。  Preferably, the SDT unit is further configured to maintain an enable identifier for the second lookup; the lookup scheduling unit is further configured to determine, when receiving the offset returned by the second level search management unit, When the enable identifier of the second search corresponding to the first lookup initiated by the lookup interface is valid, the second search is initiated to the cache management unit, otherwise, the received offset information is sent to the first start. Find the lookup interface that requests the offset information.
优选地, 所述 SDT单元, 还配置为维护直接查找对应的表项长度和表 项基地址;  Preferably, the SDT unit is further configured to directly search for a corresponding entry length and a base address of the entry;
所述查找调度单元, 还配置为根据所述 SDT单元中与所述查找接口发 起的直接查找对应的表项长度和表项基地址、 以及所述查找接口发起直接 查找时所发送的键值 , 向所述緩存管理单元发起直接查找;  The lookup scheduling unit is further configured to: according to the table entry length and the table base address corresponding to the direct search initiated by the lookup interface in the SDT unit, and the key value sent when the lookup interface initiates a direct lookup, Initiating a direct lookup to the cache management unit;
所述返回调度单元, 配置为将所述緩存管理单元返回的直接查找的表 项内容发送至发起所述直接查找以请求相应表项内容的查找接口。  The return scheduling unit is configured to send the content of the directly searched item returned by the cache management unit to a lookup interface that initiates the direct search to request the content of the corresponding entry.
优选地, 所述 SDT单元, 还配置为维护对应直接查找的目标存储器类 型的信息和直接查找所使用的算法信息;  Preferably, the SDT unit is further configured to maintain information corresponding to the target memory type directly searched and directly search for used algorithm information;
所述查找调度单元, 还配置为根据所述 SDT单元中与所述直接查找对 应的目标存储器的类型信息和直接查找所使用的算法信息, 向对应的緩存 管理单元请求表项内容。  The search scheduling unit is further configured to request the content of the entry from the corresponding cache management unit according to the type information of the target memory corresponding to the direct search in the SDT unit and the algorithm information used for directly searching.
优选地, 所述返回调度单元, 还配置为根据查询同一表项内容的第一 次查找或直接查找对应的指针, 确定所述第一次查找或所述直接查找发起 的先后顺序, 按照所确定的先后顺序将所述緩存管理单元返回的表项内容 发送至发起所述第一次查找或所述直接查找的查找接口。 Preferably, the return scheduling unit is further configured to query the content of the same entry according to the first Finding or directly searching for a corresponding pointer, determining a sequence of the first search or the direct search initiation, and sending the content of the entry returned by the cache management unit to the first one according to the determined sequence Secondary lookup or lookup interface for the direct lookup.
优选地, 所述装置还包括:  Preferably, the device further includes:
表项管理单元, 配置为通过所述緩存管理单元将所述直接查找、 所述 第二次查找对应的表项内容、 所述第一次查找对应的偏移量信息下发至相 应类型的存储器。  An entry management unit, configured to send, by the cache management unit, the direct search, the content of the entry corresponding to the second search, and the offset information corresponding to the first search to a corresponding type of memory .
本发明实施例还提供一种表项管理方法, 应用于表项管理装置中, 所 述装置包括: SDT单元、 查找调度单元、 二级查找管理单元、 緩存管理单 元和返回调度单元; 所述方法包括:  The embodiment of the present invention further provides an entry management method, which is applied to an entry management device, where the device includes: an SDT unit, a lookup scheduling unit, a secondary search management unit, a cache management unit, and a return scheduling unit; Includes:
所述 SDT单元维护针对表项的第一次查找对应的表项长度和表项基地 址、 以及针对表项的第二次查找对应的表项长度和表项基地址;  The SDT unit maintains the entry length and the entry base address corresponding to the first lookup of the entry, and the entry length and the entry base address corresponding to the second lookup of the entry;
所述查找调度单元根据与查找接口发起的第一次查找对应的表项长度 和表项基地址、 以及所述查找接口发起第一次查找时发送的对应所述第一 次查找的键值, 向所述二级查找管理单元发起第一次查找, 并根据所述二 级查找管理单元返回的第一次查找返回的偏移量、 以及所述 SDT单元中与 第二次查找对应的表项长度和表项基地址, 向所述緩存管理单元发起第二 次查找;  The lookup scheduling unit is configured to: according to the first item searched by the search interface, the entry length and the entry base address, and the search interface to initiate the first search, and the key value corresponding to the first search, Initiating a first lookup to the secondary lookup management unit, and returning an offset according to the first lookup returned by the second level lookup management unit, and an entry corresponding to the second lookup in the SDT unit a length and an entry base address, and initiating a second search to the cache management unit;
所述返回调度单元将所述緩存管理单元返回的第二次查找的表项内容 发送至相应的查找接口。  The return scheduling unit sends the content of the second searched item returned by the cache management unit to the corresponding search interface.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述 SDT单元维护第一次查找所使用的查找算法的信息;  The SDT unit maintains information for the first lookup using the lookup algorithm;
所述查找调度单元根据所述 SDT单元中与所述查找接口发起的第一次 查找对应的查找算法的信息, 确定响应对应的查找算法的二级查找管理单 元, 并通过所确定的二级查找管理单元, 向所述緩存管理单元发起第一次 查找。 The search scheduling unit determines, according to the information of the search algorithm corresponding to the first search initiated by the lookup interface in the SDT unit, the secondary search management unit of the search algorithm corresponding to the response, and uses the determined secondary search a management unit, initiating the cache management unit for the first time Find.
优选地, 所述装置还包括与所述二级查找管理单元对应的二级查找单 元; 相应地, 所述方法还包括:  Preferably, the device further includes a secondary search unit corresponding to the secondary search management unit; and correspondingly, the method further includes:
所述二级查找管理单元根据所述 SDT单元中与所述查找接口发起的第 一次查找对应的表项长度和表项基地址、 以及对应所述第一次查找的键值, 向对应的二级查找单元发起第一次查找;  And the second-level search management unit, according to the first item search and the base address corresponding to the first search initiated by the search interface, and the key value corresponding to the first search, to the corresponding The secondary search unit initiates a first lookup;
所述二级查找单元根据所述 SDT单元中与所述查找接口发起的第一次 查找对应的表项长度和表项基地址、 以及对应所述第一次查找的键值, 向 所述緩存管理单元请求相应的偏移量信息。  The secondary searching unit sends the cache entry length and the entry base address corresponding to the first lookup initiated by the lookup interface in the SDT unit, and the key value corresponding to the first lookup to the cache. The snap-in requests the corresponding offset information.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述 SDT单元维护对应第一次查找的目标存储器类型的信息; 所述二级查找单元根据所述 SDT单元中与所述查找接口发起的第一查 找对应的目标存储器的类型信息, 向对应的緩存管理单元请求偏移量信息; 所述緩存管理单元根据所述二级查找单元的偏移量信息的请求 , 在对 应的存储器查找偏移量信息。  The SDT unit maintains information corresponding to the target memory type of the first lookup; the secondary search unit according to the type information of the target memory corresponding to the first lookup initiated by the lookup interface in the SDT unit, to the corresponding The cache management unit requests the offset information; the cache management unit searches for the offset information in the corresponding memory according to the request of the offset information of the secondary search unit.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述 SDT单元维护对应第二次查找的目标存储器类型的信息; 所述查找调度单元根据所述 SDT单元中与所述第二次查找对应的目标 存储器的类型信息, 向对应的緩存管理单元请求表项内容。  The SDT unit maintains information corresponding to the target memory type of the second search; the search scheduling unit requests the corresponding cache management unit according to the type information of the target memory corresponding to the second search in the SDT unit. The contents of the entry.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述 SDT单元维护第二次查找的使能标识;  The SDT unit maintains an enable identifier for the second search;
所述查找调度单元在接收到所述在接收到所述二级查找管理单元返回 的偏移量时, 判断与所述查找接口发送的第一次查找对应的第二次查找的 使能标识是否有效, 如果有效, 则向所述緩存管理单元发起第二次查找, 否则; 将所接收到的偏移量信息发送至发起所述第一次查找以请求所述偏 移量信息的查找接口。 When the receiving the scheduling unit receives the offset returned by the second-level search management unit, determining whether the enable identifier of the second search corresponding to the first search sent by the search interface is Valid, if valid, initiate a second lookup to the cache management unit, otherwise; send the received offset information to initiate the first lookup to request the bias The search interface for the shift information.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述 SDT单元维护直接查找对应的表项长度和表项基地址;  The SDT unit maintains a direct search for the corresponding entry length and the base address of the entry;
所述查找调度单元根据所述 SDT单元中与所述查找接口发起的直接查 找对应的表项长度和表项基地址、 以及所述查找接口发起直接查找时所发 送的键值发起直接查找;  The search scheduling unit initiates a direct search according to the length of the entry and the base address of the entry directly initiated by the lookup interface in the SDT unit, and the key value sent by the lookup interface when the direct search is initiated;
所述返回调度单元将所述緩存管理单元返回的直接查找返回的表项内 容发送至发起所述直接查找以请求相应表项内容的查找接口。  The return scheduling unit sends the content of the entry returned by the direct search returned by the cache management unit to a lookup interface that initiates the direct search to request the content of the corresponding entry.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述 SDT单元维护对应直接查找的目标存储器类型的信息和直接查找 所使用的算法信息;  The SDT unit maintains information corresponding to the target memory type directly searched and directly searches for the used algorithm information;
所述查找调度单元根据所述 SDT单元中与所述直接查找对应的目标存 储器的类型信息和直接查找所使用的算法信息, 向对应的緩存管理单元请 求表项内容。  The search scheduling unit requests the content of the entry from the corresponding cache management unit according to the type information of the target memory corresponding to the direct search in the SDT unit and the algorithm information used for directly searching.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述返回调度单元根据查询同一表项内容的第一次查找或直接查找对 应的指针, 确定所述第一次查找或所述直接查找发起的先后顺序, 按照所 确定的先后顺序, 将所述緩存管理单元返回的表项内容发送至发起所述第 一次查找或所述直接查找的查找接口。  Determining, by the return scheduling unit, the first search or the direct search initiation sequence according to the first search of the content of the same entry, or directly searching for the corresponding pointer, according to the determined sequence, The contents of the entry returned by the cache management unit are sent to a lookup interface that initiates the first lookup or the direct lookup.
优选地, 所述装置还包括: 表项管理单元; 相应地, 所述方法还包括: 所述表项管理单元通过所述緩存管理单元将所述直接查找、 所述第二 次查找对应的表项内容、 所述第一次查找对应的偏移量信息下发至相应类 型的存储器。  Preferably, the device further includes: an entry management unit; and the method further includes: the entry management unit, by the cache management unit, the table corresponding to the direct search and the second search The item content, the offset information corresponding to the first search is sent to a corresponding type of memory.
本发明实施例还提供一种计算机存储介质 , 所述计算机存储介质中存 储有计算机可执行指令, 所述计算机可执行指令用于执行以上所述的表项 管理方法。 An embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, where the computer executable instructions are used to execute the foregoing items. Management method.
通过本发明实施例提供的技术方案, 预设与直接查找、 第一次查找和 第二次查找的对应的信息, 例如查找表项类型、 查找表项长度和查找表项 基地址, 实现了表项存储的灵活配置;  According to the technical solution provided by the embodiment of the present invention, the information corresponding to the direct search, the first search, and the second search, such as the lookup entry type, the lookup entry length, and the lookup table entry base address, are implemented. Flexible configuration of item storage;
支持二级查找(第一次查找和第二次查找), 无需向用户侧的查找接口 返回第一次查找的表项内容(偏移量信息), 仅根据第一次查找的接口和预 设的第二次查找使能标识即可发起第二次查找, 节省了指令的开销, 提高 了查找效率;  Supports secondary lookup (first lookup and second lookup), without returning the first lookup entry content (offset information) to the lookup interface on the user side, based only on the first lookup interface and preset The second lookup enablement flag can initiate a second search, which saves the overhead of the instruction and improves the search efficiency;
根据查找对应的指针, 可对查找对应的表项内容按照查找发起的顺序 返回, 即可实现保序;  According to the search for the corresponding pointer, the content of the corresponding entry can be returned in the order in which the search is initiated, so that the order can be implemented;
查找表项内容时采用间接寻址的方法, 克服了传统技术中直接寻址随 机存储器( RAM, Random Access Memory ) 带来的占用总线地址空间大的 缺陷, 能够广泛应用于其他地址空间较少的表项管理场景中。 附图说明  Indirect addressing is used to find the contents of the table. It overcomes the shortcomings of the bus address space caused by the random access memory (RAM) in the traditional technology, and can be widely applied to other address spaces. In the item management scenario. DRAWINGS
图 1为本发明实施例的表项管理装置的组成结构示意图;  1 is a schematic structural diagram of a component management apparatus according to an embodiment of the present invention;
图 2a为本发明实施例的 SDT单元 101存储第一次查找和第二次查找对 应表项信息的结构示意图;  2a is a schematic structural diagram of the SDT unit 101 storing the first search and the second search corresponding entry information according to an embodiment of the present invention;
图 2b为本发明实施例的 SDT单元 101存储直接查找对应表项信息的结 构示意图,  2b is a schematic diagram of a structure in which the SDT unit 101 stores a direct search for corresponding entry information according to an embodiment of the present invention.
图 3为本发明实施例的查找调度单元 102的结构示意图;  FIG. 3 is a schematic structural diagram of a lookup scheduling unit 102 according to an embodiment of the present invention;
图 4为本发明实施例的緩存管理单元 104的结构示意图;  FIG. 4 is a schematic structural diagram of a cache management unit 104 according to an embodiment of the present invention;
图 5为本发明实施例的控制寄存器的结构示意图;  FIG. 5 is a schematic structural diagram of a control register according to an embodiment of the present invention; FIG.
图 6为本发明实施例的表项管理单元 107的结构示意图;  FIG. 6 is a schematic structural diagram of an entry management unit 107 according to an embodiment of the present invention;
图 7为本发明实施例的表项管理方法实现流程示意图。 具体实施方式 FIG. 7 is a schematic flowchart of implementing an entry management method according to an embodiment of the present invention. detailed description
下面结合附图及具体实施例对本发明作进一步详细说明。  The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
图 1为本发明实施例的表项管理装置的组成结构示意图, 如图 1所示, 包括: SDT单元 101、 查找调度单元 102、 二级查找管理单元 103、 緩存管 理单元 104和返回调度单元 105; 其中,  1 is a schematic structural diagram of a table item management apparatus according to an embodiment of the present invention. As shown in FIG. 1, the method includes: an SDT unit 101, a lookup scheduling unit 102, a secondary lookup management unit 103, a cache management unit 104, and a return scheduling unit 105. ; among them,
所述 SDT单元 101 , 配置为维护针对表项的第一次查找对应的表项长 度和表项基地址、 以及针对表项的第二次查找对应的表项长度和表项基地 址;  The SDT unit 101 is configured to maintain an entry length and an entry base address corresponding to the first lookup of the entry, and an entry length and an entry base address corresponding to the second lookup of the entry;
所述查找调度单元 102, 配置为根据所述 SDT单元 101中与查找接口 发起的第一次查找对应的表项长度和表项基地址、 以及所述查找接口发起 第一次查找时发送的对应所述第一次查找的键值, 向所述二级查找管理单 元 103发起第一次查找, 并根据所述二级查找管理单元 103返回的偏移量、 以及所述 SDT单元 101中与第二次查找对应的表项长度和表项基地址, 向 所述緩存管理单元 104发起第二次查找;  The lookup scheduling unit 102 is configured to: according to the table entry length and the entry base address corresponding to the first lookup initiated by the lookup interface in the SDT unit 101, and the correspondence sent by the lookup interface when the first lookup is initiated. The first searched key value initiates a first search to the secondary search management unit 103, and according to the offset returned by the secondary search management unit 103, and the SDT unit 101 and the first Finding the corresponding entry length and the entry base address twice, and initiating a second search to the cache management unit 104;
所述返回调度单元 105,配置为将所述緩存管理单元 104返回的第二次 查找的表项内容发送至相应的查找接口。  The return scheduling unit 105 is configured to send the content of the second searched item returned by the cache management unit 104 to the corresponding search interface.
实际应用中, 所述 SDT单元 101为不同的表项维护不同的索引, 当查 找接口发起第一次查找时, 根据查找接口发送的 SDT表索引, 即可确定第 一次查找对应的表项长度和表项基地址、 以及针对表项的第二次查找对应 的表项长度和表项基地址。  In an actual application, the SDT unit 101 maintains different indexes for different entries. When the lookup interface initiates the first lookup, according to the SDT table index sent by the lookup interface, the length of the corresponding entry is determined. The base address of the entry and the base entry length and the base address of the entry corresponding to the second lookup of the entry.
优选地, 所述 SDT单元 101 , 还配置为维护第一次查找所使用的查找 算法信息;  Preferably, the SDT unit 101 is further configured to maintain search algorithm information used for the first search;
所述查找调度单元 102, 还配置为根据所述 SDT单元 101中与所述查 找接口发起的第一次查找对应的查找算法的信息, 确定响应对应的查找算 法的二级查找管理单元 103 , 并通过所确定的二级查找管理单元 103 , 向所 述緩存管理单元 104发起第一次查找。 The locating and scheduling unit 102 is further configured to determine, according to the information of the search algorithm corresponding to the first search initiated by the search interface in the SDT unit 101, the secondary search management unit 103 that responds to the corresponding search algorithm, and Through the determined secondary search management unit 103, The cache management unit 104 initiates a first lookup.
优选地, 该装置还包括与所述二级查找管理单元 103对应的二级查找 单元 106;  Preferably, the apparatus further includes a secondary lookup unit 106 corresponding to the secondary lookup management unit 103;
所述二级查找管理单元 103, 还配置为 居所述 SDT单元 101中与所 述查找接口发起的第一次查找对应的表项长度和表项基地址、 以及对应所 述第一次查找的键值, 向对应的二级查找单元 106发起第一次查找;  The secondary search management unit 103 is further configured to: the entry length and the entry base address corresponding to the first lookup initiated by the lookup interface in the SDT unit 101, and the corresponding first lookup Key value, initiates a first search to the corresponding secondary search unit 106;
所述二级查找单元 106, 还配置为才艮据所述 SDT单元 101中与所述查 找接口发起的第一次查找对应的表项长度和表项基地址、 以及对应所述第 一次查找的键值, 向所述緩存管理单元 104请求相应的偏移量信息。  The second-level searching unit 106 is further configured to: according to the first item search and the base address corresponding to the first search initiated by the search interface in the SDT unit 101, and corresponding to the first search The key value is requested from the cache management unit 104 for the corresponding offset information.
所述偏移量信息用于在后续的第二次查找  The offset information is used for subsequent second lookups
优选地, 所述 SDT单元 101 , 还配置为维护对应第一次查找的目标存 储器类型的信息;  Preferably, the SDT unit 101 is further configured to maintain information corresponding to a target memory type of the first lookup;
所述二级查找单元 106, 还配置为才艮据所述 SDT单元 101中与所述查 找接口发起的第一查找对应的目标存储器的类型信息, 向相应类型的緩存 管理单元 104请求偏移量信息;  The secondary searching unit 106 is further configured to request an offset from the corresponding type of the cache management unit 104 according to the type information of the target memory corresponding to the first lookup initiated by the lookup interface in the SDT unit 101. Information
所述緩存管理单元 104,还配置为才艮据所述二级查找单元的偏移量信息 的请求, 在对应的存储器查找偏移量信息。  The cache management unit 104 is further configured to look up the offset information in the corresponding memory according to the request of the offset information of the secondary search unit.
实际应用中, 所述存储器的类型可以包括片内存储器和片外存储器, 相应地, 当二级查找单元 106 居 SDT单元 101维护的第一次查找的目标 存储器类型的信息, 确定第一次查找对应的目标存储器的类型为片内存储 器时, 则向负责响应片内存储器的第一次查找的緩存管理单元 104请求偏 移量信息。  In a practical application, the type of the memory may include an on-chip memory and an off-chip memory. Accordingly, when the secondary search unit 106 is in the target memory type information of the first lookup maintained by the SDT unit 101, determining the first lookup. When the type of the corresponding target memory is on-chip memory, the offset management information is requested from the cache management unit 104 responsible for the first lookup of the on-chip memory.
优选地, 所述 SDT单元 101 , 还配置为维护对应第二次查找的目标存 储器类型的信息;  Preferably, the SDT unit 101 is further configured to maintain information corresponding to a target memory type of the second search;
所述查找调度单元 102, 还配置为根据所述 SDT单元 101中与所述第 二次查找对应的目标存储器的类型信息, 向对应的緩存管理单元 104请求 表项内容。 The lookup scheduling unit 102 is further configured to be in accordance with the SDT unit 101 and the first The type information of the corresponding target memory is searched twice, and the content of the entry is requested from the corresponding cache management unit 104.
优选地, 所述 SDT单元 101 , 还配置为维护第二次查找的使能标识; 所述查找调度单元 102, 还配置为在接收到所述二级查找管理单元 103 返回的偏移量时, 判断与所述查找接口发起的第一次查找对应的第二次查 找对应的使能标识是否有效, 如果有效, 则向所述緩存管理单元 104发起 第二次查找; 否则, 将所接收到的偏移量信息发送至发起第一次查找以请 求所述偏移量信息的查找接口。  Preferably, the SDT unit 101 is further configured to maintain an enable identifier for the second lookup; the lookup scheduling unit 102 is further configured to, when receiving the offset returned by the second level search management unit 103, Determining whether the enable identifier corresponding to the second search corresponding to the first search initiated by the search interface is valid, and if valid, initiating a second search to the cache management unit 104; otherwise, receiving the received The offset information is sent to a lookup interface that initiates a first lookup to request the offset information.
所述 SDT单元 101 , 还配置为维护直接查找对应的表项长度和表项基 地址;  The SDT unit 101 is further configured to directly search for a corresponding entry length and an entry base address;
所述查找调度单元 102, 还配置为根据所述 SDT单元 101中与查找接 口发起的直接查找对应的表项长度和表项基地址、 以及所述查找接口发起 直接查找时所发送的键值, 向所述緩存管理单元 104发起直接查找;  The lookup scheduling unit 102 is further configured to: according to the table entry length and the entry base address corresponding to the direct lookup initiated by the lookup interface in the SDT unit 101, and the key value sent when the lookup interface initiates a direct lookup, Initiating a direct lookup to the cache management unit 104;
所述返回调度单元 105 ,配置为将所述緩存管理单元 104返回的直接查 找的表项内容发送至发起所述第一次查找以请求所述偏移量信息的查找接 α。  The return scheduling unit 105 is configured to send the content of the directly searched entry returned by the cache management unit 104 to the lookup interface α that initiates the first lookup to request the offset information.
优选地, 所述 SDT单元 101 , 还配置为维护对应直接查找的目标存储 器类型的信息和直接查找所使用的算法信息;  Preferably, the SDT unit 101 is further configured to maintain information corresponding to a target memory type directly searched and directly search for used algorithm information;
所述查找调度单元 102, 还配置为根据所述 SDT单元 101中与所述直 接查找对应的目标存储器的类型信息和直接查找所使用的算法信息, 向对 应的緩存管理单元 104请求表项内容。  The lookup scheduling unit 102 is further configured to request the content of the entry from the corresponding cache management unit 104 according to the type information of the target memory corresponding to the direct search in the SDT unit 101 and the algorithm information used for directly searching.
优选地, 所述返回调度单元 105,还配置为根据查询同一表项内容的第 一次查找或直接查找对应的指针, 确定所述第一次查找或所述直接查找发 起的先后顺序, 按照所确定的先后顺序将所述緩存管理单元返回的表项内 容发送至发起所述第一次查找或所述直接查找的查找接口。 实际应用中, 所述返回调度单元 105 ,根据所述与所述第一次查找和所 述直接查找对应的查找接口标识, 将所述緩存管理单元 104返回的表项内 容发送至对应的查找接口。 Preferably, the return scheduling unit 105 is further configured to determine, according to the first lookup of the content of the same entry or directly search for the corresponding pointer, determine the sequence of the first search or the direct search initiation, according to the The determined order sends the contents of the entry returned by the cache management unit to the lookup interface that initiates the first lookup or the direct lookup. In an actual application, the return scheduling unit 105 sends the content of the entry returned by the cache management unit 104 to the corresponding search interface according to the search interface identifier corresponding to the first search and the direct search. .
优选地, 该装置还包括:  Preferably, the device further comprises:
表项管理单元 107,配置为通过所述緩存管理单元 104将所述直接查找 对应的表项、 所述第一次查找和所述第二次查找对应的表项下发至相应类 型的存储器。  The entry management unit 107 is configured to deliver, by the cache management unit 104, the entry corresponding to the direct search, the first search, and the second search to a corresponding type of memory.
实际应用中,表项管理装置中的各单元均可由网络处理器( NP, Network Processor ) 实现。  In practical applications, each unit in the entry management device can be implemented by a Network Processor (NP).
图 2a为本发明实施例的 SDT单元 101存储第一次查找和第二次查找对 应表项信息的结构示意图, 如图 2a所示, 包括:  2a is a schematic structural diagram of the SDT unit 101 storing the first lookup and the second lookup corresponding entry information according to the embodiment of the present invention. As shown in FIG. 2a, the method includes:
1 ) 第一次查找表项类型;  1) The first time to find the entry type;
包括第一次查找对应的查找算法信息以及第一次查找的目标存储器的 类型信息; 其中,  The first finding the corresponding search algorithm information and the type information of the target memory for the first search; wherein
所述查找算法包括: 哈希查找算法、 路由查找算法、 基于三态内容寻 址存 4诸器(TCAM, Ternary Content Addressable Memory ) 的高速路由查找 算法; 上述查找算法均为二级查找算法, 即对于待查找的表项的内容, 需 要通过第一次查找确定该表项的偏移量信息 , 根据第一次查找确定的偏移 量信息进行第二次查找, 确定待查找表项的内容。  The search algorithm includes: a hash search algorithm, a route lookup algorithm, and a high-speed route lookup algorithm based on a Ternary Content Addressable Memory (TCAM); the above search algorithms are secondary search algorithms, that is, For the content of the entry to be searched, the offset information of the entry is determined by the first search, and the second search is performed according to the offset information determined by the first search to determine the content of the entry to be searched.
所述目标存储器的类型包括片内存储器和片外存储器。  The types of target memory include on-chip memory and off-chip memory.
2 )第一次查找表项基地址;  2) The first lookup table entry base address;
所述第一次查找表项基地址为对应同一表项类型的表项的存储的起始 地址, 本发明实施例中, 对于相同查找算法的第一次查找的表项内容在对 应的片内存储器或片外存储器中利用连续的空间存储, 该连续空间的起始 地址为第一次查找表项类型的基地址。 3 )第一次查找表项长度; The first lookup table entry base address is a stored start address of an entry corresponding to the same entry type. In the embodiment of the present invention, the content of the first searched entry of the same search algorithm is in the corresponding slice. The contiguous space is stored in the memory or off-chip memory, and the starting address of the contiguous space is the base address of the first lookup entry type. 3) The length of the first lookup entry;
即对于相同查找算法的第一次查找的每个表项的长度。  That is, the length of each entry for the first lookup of the same lookup algorithm.
4 ) 第二次查找表项使能标识;  4) The second lookup entry enable identifier;
预设该使能标识为有效状态时, 对应某一表项的第一次查找结束后, 根据第一次查找的偏移量信息、 以及与第一次查找对应的第二次查找的表 项类型、 表项基地址和表项长度, 进行第二次查找。  When the first identification of the corresponding entry is completed, the offset information of the first search and the second searched entry corresponding to the first search are preset. Type, table item base address, and table item length for a second lookup.
5 ) 第二次查找表项类型;  5) The second lookup entry type;
包括第二次查找的目标存储器的类型信息。  Includes type information for the target memory for the second lookup.
6 ) 第二次查找表项基地址;  6) The second lookup table entry base address;
所述表项基地址为对应同一表项类型的表项的存储的起始地址, 本发 明实施例中, 对于相同查找算法的第二次查找的表项内容在对应的片内存 储器或片外存储器中利用连续的空间存储, 该连续空间的起始地址为第二 次查找表项类型的基地址。  The base address of the entry is the stored start address of the entry corresponding to the same entry type. In the embodiment of the present invention, the content of the second searched entry of the same search algorithm is in the corresponding on-chip memory or off-chip. The memory utilizes contiguous spatial storage, the starting address of which is the base address of the second lookup entry type.
7 )第二次查找表项长度。  7) The second lookup entry length.
即对应相同查找算法的第二次查找的每个表项的长度。  That is, the length of each entry corresponding to the second lookup of the same lookup algorithm.
例如, 查表接口发起第一次查找时, 假设第一次查找使用哈希查找算 法, 则在存储根据查表接口发送的第一次查找的键值确定待查找的偏移量 信息的存储空间为: (第一次查找表项基地址 +键值 ) ~ (第一次查找表项基 地址 +键值 +第一次查找表项长度); 相应地, 第二次查找的表项内容的存储 空间为: (第二次查找表项基地址 +偏移量) ~ (第一次查找表项基地址 +偏 移量 +第二次查找表项长度)。  For example, when the lookup interface initiates the first lookup, it is assumed that the first lookup uses the hash lookup algorithm, and the storage space of the offset information to be searched is determined by storing the key value of the first lookup sent according to the lookup table interface. For: (first lookup table entry base address + key value) ~ (first lookup table entry base address + key value + first lookup table entry length); correspondingly, the second lookup of the table entry content The storage space is: (second lookup table entry base address + offset) ~ (first lookup table entry base address + offset + second lookup table entry length).
图 2b为本发明实施例的 SDT单元 101存储直接查找对应表项信息的优 选的结构示意图, 如图 2b所示, 包括:  FIG. 2b is a schematic structural diagram of the SDT unit 101 storing a direct search for the corresponding entry information according to the embodiment of the present invention. As shown in FIG. 2b, the method includes:
1 )直接查找表项类型;  1) directly look up the entry type;
包括直接查找对应的查找算法信息以及直接查找的目标存储器的类型 信息; 其中, Including directly looking up the corresponding search algorithm information and the type of target memory directly searched Information; among them,
所述直接查找对应的算法是指通过一次查找即可查询到相应表项内容 的查找算法, 即对于待查找的表项, 直接根据待查找表项的键值以及待查 找表项的基地址和表项长度, 确定待查找表项的内容。  The direct search corresponding algorithm refers to a search algorithm that can query the content of the corresponding entry by one search, that is, for the entry to be searched, directly according to the key value of the entry to be searched and the base address of the entry to be searched. The length of the entry, which determines the content of the entry to be searched.
所述目标存储器的类型包括片内存储器和片外存储器, 实际应用中, 在表项长度比较小但对查找性能要求比较高的场景中, 可以采片内的查找 方式, 即在该场景中将下发的表项存储至片内存储器, 并在对应的片内存 储器进行查找; 在表项长度比较大或者对于查表性能要求高的场景中, 可 以采用片内存储器、 片外存储器混合存储下发表项的方式, 并在对应的片 内存储器或片外存储器进行查找。  The type of the target memory includes an on-chip memory and an off-chip memory. In an actual application, in a scenario where the length of the entry is relatively small but the search performance is relatively high, an on-chip search mode may be adopted, that is, in the scenario, The delivered entries are stored in the on-chip memory and searched in the corresponding on-chip memory. In the scenario where the length of the entry is relatively large or the performance of the table is high, the on-chip memory and the off-chip memory can be mixed and stored. The way the item is published, and the corresponding on-chip memory or off-chip memory is searched.
2 )直接查找表项基地址;  2) directly look up the base address of the entry;
所述直接查找表项基地址为对应同一表项类型的表项的存储的起始地 址, 本发明实施例中, 对于相同查找算法的第一次查找的表项内容在对应 的片内存储器或片外存储器中利用连续的空间存储, 该连续空间的起始地 址为第一次查找表项类型的基地址。  The direct lookup table entry base address is a stored start address of an entry corresponding to the same entry type. In the embodiment of the present invention, the content of the first searched entry of the same search algorithm is in the corresponding on-chip memory or The off-chip memory utilizes contiguous spatial storage, the starting address of which is the base address of the first lookup entry type.
3 )直接查找表项长度;  3) directly look up the length of the entry;
即对应相同查找算法的直接查找的每个表项的长度。  That is, the length of each entry corresponding to the direct lookup of the same lookup algorithm.
例如, 查表接口发起直接查找时, 根据查表接口发送的键值确定待查 找表项的存储空间为: (表项基地址 +键值 ) ~ (表项基地址 +键值 +直接查找 表项长度)。  For example, when the lookup interface initiates a direct lookup, the storage space of the entry to be searched is determined according to the key value sent by the lookup table interface: (table entry base address + key value) ~ (table entry base address + key value + direct lookup table Item length).
实际应用中, 当本发明实施例中的表项管理装置应用于维护表项数量 较大且查找频率高的场景中时, 为了避免查找拥塞, 保证对查找的响应速 率, 查找调度单元 102对第一次查找、 第二次查找以及直接查找的目标存 储器的类型以及所使用的查找算法, 将第一次查找、 第二次查找和直接查 找对应的键值以及在 SDT表中对应的信息緩存到对应的队列中, 根据预设 的负载均衡策略, 对緩存的第一次查找、 第二次查找以及直接查找的上述 信息进行调度, 对应发起第一次查找、 第二次查找或直接查找, 并在发起 第一次查找、 第二次查找或直接查找时发送对应的查找接口标识。 In an actual application, when the entry management device in the embodiment of the present invention is applied to a scenario in which the number of maintenance entries is large and the search frequency is high, in order to avoid searching for congestion, and ensuring the response rate to the search, the lookup scheduling unit 102 The type of target memory for one lookup, second lookup, and direct lookup, and the lookup algorithm used, caches the first lookup, the second lookup, and the direct lookup for the corresponding key and the corresponding information in the SDT table. Corresponding queue, according to preset The load balancing policy, scheduling the first information of the cache, the second search, and the direct search, corresponding to initiating the first search, the second search, or the direct search, and initiating the first search, the first The corresponding search interface identifier is sent when the second search or direct search.
下面以直接查找、 第一次查找和第二次查找为例进行说明, 图 3 为本 发明实施例的查找调度单元 102的结构示意图, 如图 3所示, 包括: 第二 查找解析子单元 301、第一查找解析子单元 302、直接查找緩存子单元 303、 第一次查找緩存子单元 304、 第二次查找緩存子单元 305、 第一查找管理子 单元 306和第二查找管理子单元 307; 其中,  The following is a description of the direct search, the first search, and the second search. FIG. 3 is a schematic structural diagram of the search and scheduling unit 102 according to an embodiment of the present invention. As shown in FIG. 3, the second search and analysis sub-unit 301 is included. a first lookup parsing subunit 302, a direct lookup cache subunit 303, a first lookup cache subunit 304, a second lookup cache subunit 305, a first lookup management subunit 306, and a second lookup management subunit 307; among them,
所述第一查找解析子单元 302, 配置为将直接查找的键值、 以及 SDT 单元 101 中与所述直接查找对应的直接查找表项基地址和直接查找表项长 度, 根据直接查找的目标存储器的类型, 緩存到相应的直接查找緩存子单 元 303; 将第一次查找的键值、 以及 SDT单元 101中与所述第一次查找对 应的第一次查找表项基地址和第一次查找表项长度, 根据第一次查找的目 标存储器的类型, 緩存到相应的第一次查找緩存子单元 304;  The first lookup parsing sub-unit 302 is configured to directly search for a key value, and a direct lookup table entry base address and a direct lookup table entry length corresponding to the direct lookup in the SDT unit 101, according to a target memory directly searched. Type, cached to the corresponding direct lookup cache subunit 303; the first searched key value, and the first lookup table entry base address and first lookup corresponding to the first lookup in the SDT unit 101 The length of the entry, according to the type of the target memory of the first lookup, is cached to the corresponding first lookup cache subunit 304;
所述第二查找解析子单元 301 , 配置为将第二次查找的键值、 以及在 SDT单元 101 中与所述第二次查找对应的第二次查找表项基地址和第二次 查找表项长度, 按照第二次查找的目标存储器的类型, 緩存到相应的第二 次查找緩存子单元 305;  The second lookup parsing subunit 301 is configured to set a second lookup key value, and a second lookup table entry base address and a second lookup table corresponding to the second lookup in the SDT unit 101. The length of the item, according to the type of the target memory of the second search, is cached to the corresponding second lookup cache subunit 305;
所述第二查找调度子单元 307,配置为调度与所述第一次查找调度子单 元 307连接的第一次查找緩存子单元 304緩存的键值、 第一次查找表项基 地址和第一次查找表项长度, 向与所述第二查找调度子单元 307连接的二 级查找管理单元 103发起第一次查找, 并向所述二级查找单元 106发送第 一次查找对应的查找接口标识和指针;  The second lookup scheduling sub-unit 307 is configured to schedule a key value cached by the first lookup cache subunit 304 connected to the first lookup scheduling subunit 307, a first lookup table entry base address, and a first The secondary lookup table entry length, initiates a first lookup to the secondary lookup management unit 103 connected to the second lookup scheduling subunit 307, and sends a first lookup corresponding search interface identifier to the secondary lookup unit 106. And pointers;
所述第一查找管理子单元 306,配置为调度与所述第一查找调度子单元 306连接的第二次查找緩存子单元 305緩存的键值、第二次查找表项基地址 和第二次查找表项长度, 向与所述第一查找管理子单元 306连接的緩存管 理单元 104发起第一次查找, 并向緩存管理单元 104发送第一次查找对应 的查找接口标识和指针; 配置为调度与所述第一查找调度子单元 306连接 的直接查找緩存子单元 303緩存的键值、 直接查找表项基地址和直接查找 表项长度, 向与所述第一查找管理子单元 306连接的緩存管理单元 104发 起直接查找, 并向緩存管理单元 104发送直接查找对应的查找接口标识和 指针。 The first lookup management sub-unit 306 is configured to schedule a key value cached by the second lookup cache subunit 305 connected to the first lookup and dispatch subunit 306, and a second lookup table entry base address. And the second lookup entry length, initiates a first lookup to the cache management unit 104 connected to the first lookup management subunit 306, and sends the first lookup corresponding search interface identifier and pointer to the cache management unit 104. And configuring, by the direct lookup cache subunit 303 connected to the first lookup and dispatching subunit 306, a key value, a direct lookup table base address, and a direct lookup entry length, to the first lookup management subunit. The cache management unit 104 of the connection 306 initiates a direct lookup and sends a direct lookup to the corresponding lookup interface identifier and pointer to the cache management unit 104.
例如, 查找接口发起直接查找时, 由第一查找解析子单元 302将 SDT 单元 101 中与所述查找接口发起的直接查找对应的直接查找表项基地址和 直接查找表项长度, 以及直接查找的目标存储器的类型, 緩存到对应的直 接查找緩存子单元 303 中; 查找接口发起第一次查找时, 由第一查找解析 子单元 302将 SDT单元 101中与所述查找接口发起的第一次查找对应的第 一次查找表项基地址和第一次查找表项长度, 以及第一次查找的目标存储 器的类型, 緩存到对应的第一次查找緩存子单元 304中;  For example, when the lookup interface initiates a direct lookup, the first lookup parsing sub-unit 302 selects the direct lookup entry base address and the direct lookup entry length corresponding to the direct lookup initiated by the lookup interface in the SDT unit 101, and directly searches for The type of the target memory is cached in the corresponding direct lookup cache subunit 303. When the lookup interface initiates the first lookup, the first lookup parsing subunit 302 will first search the SDT unit 101 and the lookup interface. The corresponding first lookup table entry base address and the first lookup entry length, and the type of the target memory that is first searched, are cached in the corresponding first lookup cache subunit 304;
其中,第一查找解析子单元 302分别与第一次查找使用的查找算法(包 括哈希查找算法和路由查找算法)对应; 第二查找管理子单元 307根据预 设的负载均衡策略, 从对应的第一次查找緩存子单元 304调度出第一次查 找对应的第一次查找表项基地址和第一次查找表项长度, 向对应的二级查 找管理单元 103发起第一次查找。  The first search parsing sub-unit 302 respectively corresponds to the search algorithm used by the first search (including the hash search algorithm and the route search algorithm); the second search management sub-unit 307 according to the preset load balancing policy, from the corresponding The first lookup cache sub-unit 304 schedules the first lookup of the corresponding first lookup table base address and the first lookup entry length for the first time, and initiates the first lookup to the corresponding secondary lookup management unit 103.
实际应用中, 当緩存管理单元 104需要响应查找调度单元 102发起的 直接查找和二次查找调度单元 106发起的第一次查找(即进行读操作 )、 以 及接收表项管理单元 107下发的表项(即进行写入操作 ), 为了避免读写的 沖突, 緩存管理单元 104 还可以将存储器的物理存储的存储地址划分为若 干地址段, 对每个地址段的读写操作进行緩存, 根据预设的负载均衡策略 执行对顺序执行对存储器的读写操作, 并对读写操作的结果进行校验。 图 4为本发明实施例的緩存管理单元 104的结构示意图, 如图 4所示, 包括: In the actual application, when the cache management unit 104 needs to respond to the first lookup initiated by the direct lookup and secondary lookup scheduling unit 106 initiated by the lookup scheduling unit 102 (ie, perform a read operation), and the table sent by the receiving entry management unit 107. In order to avoid the conflict between the read and write operations, the cache management unit 104 may further divide the storage address of the physical storage of the memory into a plurality of address segments, and buffer the read and write operations of each address segment according to the pre-processing. The load balancing policy is executed to perform read and write operations on the memory in sequence, and to verify the results of the read and write operations. FIG. 4 is a schematic structural diagram of a cache management unit 104 according to an embodiment of the present invention. As shown in FIG. 4, the method includes:
地址解析子单元 401 , 配置为解析存储待下发表项的存储器的访问地 址, 确定与所述访问地址对应的存储器的物理地址;  The address resolution subunit 401 is configured to parse an access address of a memory storing the item to be published, and determine a physical address of the memory corresponding to the access address;
所述緩存管理调度子单元 402, 配置为解析所述物理地址,将待下发表 项发送至相应的緩存管理控制子单元 403;  The cache management scheduling sub-unit 402 is configured to parse the physical address, and send the to-be-published item to the corresponding cache management control sub-unit 403;
所述緩存管理控制子单元 403 , 配置为根据待下发表项对应的物理地 址, 緩存所述待下发表项至读写队列中; 緩存第一次查找的物理地址至所 述读写队列中; 緩存直接查找的物理地址至所述读写队列中; 根据预设的 负载均衡策略, 依次执行所述读写队列中的操作, 包括: 将所述读写队列 中的待下发的表项内容写入所述緩存管理控制子单元 403 对应的存储器 404, 根据所述读写队列中的物理地址在所述存储器 404中获取相应的表项 内容, 并将所获取的表项内容发送至所述返回调度单元 105。  The cache management control sub-unit 403 is configured to cache the to-be-published item to the read-write queue according to the physical address corresponding to the item to be published; cache the first-time searched physical address to the read-write queue; Cache the directly searched physical address to the read/write queue; perform the operations in the read/write queue in sequence according to the preset load balancing policy, including: the content of the entry to be delivered in the read/write queue Write the memory 404 corresponding to the cache management control sub-unit 403, obtain the corresponding entry content in the memory 404 according to the physical address in the read-write queue, and send the obtained entry content to the Return to scheduling unit 105.
如图 4所示, 緩存管理控制子单元 403的数量可以为多个, 每个緩存 管理控制子单元 403 负责存储器 404的一段连续的物理地址空间, 上述读 写队列可以采用寄存器的形式实现, 所述存储器 404可以采用随机存储器 ( RAM, Random Access Memory )组的形式实现, 下面对上述实现举例进 行说明: 地址解析子单元 401 维护对应读写操作的数据寄存器和控制寄存 器, 其中, 数据寄存器用于存储待写入存储器 404的数据(即下发表项的 内容)或待读取数据(即待查找的表项的内容), 控制寄存器用于对数据寄 存器的读写操作进行控制。  As shown in FIG. 4, the number of cache management control sub-units 403 may be multiple, and each cache management control sub-unit 403 is responsible for a continuous physical address space of the memory 404. The read-write queue may be implemented in the form of a register. The memory 404 can be implemented in the form of a random access memory (RAM). The following implementation examples are described. The address resolution subunit 401 maintains a data register and a control register corresponding to the read and write operations, wherein the data register is used. The control register is used to control the read and write operations of the data register to store data to be written to the memory 404 (ie, the content of the next published item) or data to be read (ie, the contents of the entry to be searched).
图 5为本发明实施例的控制寄存器的优选的结构示意图, 如图 5所示, 包括读命令 write_cmd 、 写命令 read_cmd、 RAM块选择 ram_sel和 RAM 地址 ram_addr四个字段, 当解析控制寄存器得到 RAM访问的具体地址时, 如当前为写命令有效则将数据写入对应的 RAM中, 如当前为读命令有效, 将对应地址中的数据读出。 FIG. 5 is a schematic structural diagram of a control register according to an embodiment of the present invention. As shown in FIG. 5, the read command write_cmd, the write command read_cmd, the RAM block select ram_sel, and the RAM address ram_addr are four fields, and the RAM is accessed when the control register is parsed. The specific address, if the current write command is valid, the data is written into the corresponding RAM, as the current read command is valid, Read out the data in the corresponding address.
实际应用中, 表项管理单元 107对表项的内容进行下发(包括表项的 首次存储和更新 ) 时, 根据 SDT单元 101中的信息将表项内容写入对应的 存储器 404, 存储器 404的类型包括片内和片外。  In an actual application, when the entry management unit 107 delivers the content of the entry (including the first storage and update of the entry), the content of the entry is written into the corresponding memory 404 according to the information in the SDT unit 101, and the memory 404 Types include on-chip and off-chip.
例如,对于直接查找对应的表项内容, 直接根据 SDT单元 101中对应 直接查找的信息将需要下发的表项内容通过快速外围组件接口 (PCI-E, Peripheral Component Interface-Express )写入存储器 404中, 同时, 为提高 表项内容的下发速度,可采用直接内存存取( DMA, Direct Memory Access ) 模式进行下发;  For example, if the content of the corresponding item is directly searched for, the content of the item to be delivered is directly written into the memory 404 through the Peripheral Component Interface (PCI-E) according to the information directly corresponding to the search in the SDT unit 101. In the meantime, in order to improve the delivery speed of the content of the entry, the direct memory access (DMA) mode can be used for delivery;
对于第一次查找和第二次查找对应的表项内容, 才艮据 SDT单元 101与 第一次查找和第二次查找对应的信息, 将需要下发的表项内容写入表项管 理单元 107 自身的緩存中, 通过调用硬件接口函数将需要下发的表项内容 转发至对应的片内存储器 304或片外存储器 404。  For the first lookup and the second lookup of the corresponding entry, the content of the entry to be delivered is written into the entry management unit according to the information corresponding to the first search and the second search by the SDT unit 101. In the cache of the own, the content of the table item to be delivered is forwarded to the corresponding on-chip memory 304 or off-chip memory 404 by calling a hardware interface function.
图 6为本发明实施例的表项管理单元 107的结构示意图,如图 6所示, 包括:  FIG. 6 is a schematic structural diagram of an entry management unit 107 according to an embodiment of the present invention. As shown in FIG. 6, the method includes:
中央处理子单元 601 , 配置为根据 SDT 101中对应直接查找的信息, 将直接查找对应的表项内容, 下发至表项管理子单元 602, 并触发表项管理 子单元 602; 居 SDT单元 101与第一次查找和第二次查找对应的信息, 将第一次查找和第二次查找对应的表项内容, 下发至表项管理子单元 602, 并触发表项管理子单元 602;  The central processing sub-unit 601 is configured to directly search for the corresponding entry content according to the information directly corresponding to the search in the SDT 101, and send the content to the entry management sub-unit 602, and trigger the entry management sub-unit 602; The information corresponding to the first search and the second search, the first search and the second search corresponding entry content, is sent to the entry management sub-unit 602, and triggers the entry management sub-unit 602;
表项管理子单元 602,配置为将中央处理子单元 601下发的直接查找对 应的表项内容, 通过快速外围组件接口 PCI-E写入存储器 404中; 将中央 处理子单元 601 下发的第一次查找和第二次查找对应的表项内容通过调用 内存读写函数写入表项管理单元緩存子单元 603 中, 并通过调用硬件接口 函数将緩存子单元 603的表项内容转发至对应的片内存储器 404或片外存 储器 404。 The item management sub-unit 602 is configured to directly search for the corresponding item content delivered by the central processing sub-unit 601, and write the content of the corresponding item to the memory 404 through the fast peripheral component interface PCI-E; The content of the corresponding entry in the first search and the second search is written into the entry management unit cache sub-unit 603 by calling the memory read/write function, and the contents of the entry of the cache sub-unit 603 are forwarded to the corresponding by calling the hardware interface function. On-chip memory 404 or off-chip memory Reservoir 404.
图 7为本发明实施例的表项管理方法的实现流程示意图,应用于如图 1 所示的于表项管理装置中; 如图 7所示, 包括以下步骤:  FIG. 7 is a schematic flowchart of an implementation process of an entry management method according to an embodiment of the present invention, which is applied to the entry management device shown in FIG. 1; as shown in FIG. 7, the following steps are included:
步骤 701: 所述 SDT单元 101维护针对表项的第一次查找对应的表项 长度和表项基地址、 以及针对表项的第二次查找对应的表项长度和表项基 地址。  Step 701: The SDT unit 101 maintains the entry length and the entry base address corresponding to the first lookup of the entry, and the entry length and the entry base address corresponding to the second lookup of the entry.
步骤 702:所述查找调度单元 102根据与查找接口发起的第一次查找对 应的表项长度和表项基地址、 以及所述查找接口发起第一次查找时发送的 对应所述第一次查找的键值, 向所述二级查找管理单元 103发起第一次查 找。  Step 702: The lookup scheduling unit 102 performs the first lookup according to the entry length and the entry base address corresponding to the first lookup initiated by the lookup interface, and the first lookup initiated by the lookup interface. The key value, initiates a first lookup to the secondary lookup management unit 103.
步骤 703:所述查找调度单元 102根据所述二级查找管理单元 103返回 的第一次查找返回的偏移量、 以及所述 SDT单元 101中与第二次查找对应 的表项长度和表项基地址, 向所述緩存管理单元 104发起第二次查找。  Step 703: The lookup scheduling unit 102 returns an offset according to the first lookup returned by the second-level lookup management unit 103, and an entry length and an entry corresponding to the second lookup in the SDT unit 101. The base address initiates a second lookup to the cache management unit 104.
步骤 704:所述返回调度单元 105将所述緩存管理单元 104返回的第二 次查找的表项内容发送至相应的查找接口。  Step 704: The return scheduling unit 105 sends the content of the second searched entry returned by the cache management unit 104 to the corresponding search interface.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述 SDT单元 101维护第一次查找所使用的查找算法的信息; 所述查找调度单元 102根据所述 SDT单元 101中与所述查找接口发起 的第一次查找对应的查找算法的信息, 确定响应对应的查找算法的二级查 找管理单元 103, 并通过所确定的二级查找管理单元 103, 向所述緩存管理 单元 104发起第一次查找。  The SDT unit 101 maintains the information of the search algorithm used for the first search; the search and scheduling unit 102 determines the information of the search algorithm corresponding to the first search initiated by the search interface in the SDT unit 101. The second lookup management unit 103 responds to the corresponding lookup algorithm, and initiates a first lookup to the cache management unit 104 through the determined secondary lookup management unit 103.
优选地, 所述装置还包括与所述二级查找管理单元 103对应的二级查 找单元 106; 相应地, 所述方法还包括:  Preferably, the device further includes a secondary search unit 106 corresponding to the secondary search management unit 103; correspondingly, the method further includes:
所述二级查找管理单元 103才艮据所述 SDT单元 101中与所述查找接口 发起的第一次查找对应的表项长度和表项基地址、 以及对应所述第一次查 找的键值, 向对应的二级查找单元 106发起第一次查找; The second-level search management unit 103, according to the first lookup corresponding to the first lookup initiated by the lookup interface in the SDT unit 101, and the base address of the entry, and corresponding to the first check Finding the key value, and initiating a first search to the corresponding secondary search unit 106;
所述二级查找单元 106根据所述 SDT单元 101中与所述查找接口发起 的第一次查找对应的表项长度和表项基地址、 以及对应所述第一次查找的 键值, 向所述緩存管理单元 104请求相应的偏移量信息。  The second-level searching unit 106 is configured according to the length of the entry corresponding to the first search initiated by the search interface in the SDT unit 101, the base address of the entry, and the key value corresponding to the first search. The cache management unit 104 requests the corresponding offset information.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述 SDT单元 101维护对应第一次查找的目标存储器类型的信息; 所述二级查找单元 106根据所述 SDT单元 101中与所述查找接口发起 的第一查找对应的目标存储器的类型信息, 向对应的緩存管理单元 104请 求偏移量信息;  The SDT unit 101 maintains information corresponding to the target memory type of the first lookup; the secondary search unit 106 according to the type information of the target memory corresponding to the first search initiated by the lookup interface in the SDT unit 101, Requesting offset information from the corresponding cache management unit 104;
所述緩存管理单元 104根据所述二级查找单元 106的偏移量信息的请 求, 在对应的存储器查找偏移量信息。  The cache management unit 104 searches for the offset information in the corresponding memory according to the request of the offset information of the secondary search unit 106.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述 SDT单元 101维护对应第二次查找的目标存储器类型的信息; 所述查找调度单元 102根据所述 SDT单元 101中与所述第二次查找对 应的目标存储器的类型信息, 向对应的緩存管理单元 104请求表项内容。  The SDT unit 101 maintains information corresponding to the target memory type of the second search; the search scheduling unit 102 according to the type information of the target memory corresponding to the second search in the SDT unit 101, to the corresponding cache. The management unit 104 requests the contents of the entry.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述 SDT单元 101维护第二次查找的使能标识;  The SDT unit 101 maintains an enable identifier for the second search;
所述查找调度单元 102在接收到所述二级查找管理单元 103返回的偏 移量时, 判断与所述查找接口发送的第一次查找对应的第二次查找的使能 标识是否有效, 如果有效, 则向所述緩存管理单元 104发起第二次查找, 否则; 将所接收到的偏移量信息发送至发起所述第一次查找以请求所述偏 移量信息的查找接口。  The search scheduling unit 102 determines whether the enable identifier of the second search corresponding to the first search sent by the search interface is valid, when the offset returned by the second-level search management unit 103 is received, if If so, a second lookup is initiated to the cache management unit 104, otherwise; the received offset information is sent to a lookup interface that initiates the first lookup to request the offset information.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述 SDT单元 101维护直接查找对应的表项长度和表项基地址; 所述查找调度单元 102根据所述 SDT单元 101中与所述查找接口发起 的直接查找对应的表项长度和表项基地址、 以及所述查找接口发起直接查 找时所发送的键值发起直接查找; The SDT unit 101 maintains a direct search for a corresponding entry length and an entry base address; the lookup scheduling unit 102 initiates according to the search interface in the SDT unit 101. Directly searching for the corresponding entry length and the base address of the entry, and the key value sent by the lookup interface when initiating a direct lookup initiates a direct lookup;
所述返回调度单元 105将所述緩存管理单元 104返回的直接查找返回 的表项内容发送至发起所述直接查找以请求相应表项内容的查找接口。  The return scheduling unit 105 sends the content of the entry returned by the direct search returned by the cache management unit 104 to the lookup interface that initiates the direct lookup to request the content of the corresponding entry.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述 SDT单元 101维护对应直接查找的目标存储器类型的信息和直接 查找所使用的算法信息;  The SDT unit 101 maintains information corresponding to the target memory type directly searched and directly searches for the used algorithm information;
所述查找调度单元 102根据所述 SDT单元 101中与所述直接查找对应 的目标存储器的类型信息和直接查找所使用的算法信息, 向对应的緩存管 理单元 104请求表项内容。  The lookup scheduling unit 102 requests the content of the entry from the corresponding cache management unit 104 according to the type information of the target memory corresponding to the direct search in the SDT unit 101 and the algorithm information used for directly searching.
优选地, 所述方法还包括:  Preferably, the method further includes:
所述返回调度单元 105根据查询同一表项内容的第一次查找或直接查 找对应的指针, 确定所述第一次查找或所述直接查找发起的先后顺序, 按 照所确定的先后顺序, 将所述緩存管理单元 104返回的表项内容发送至发 起所述第一次查找或所述直接查找的查找接口。  The return scheduling unit 105 determines the sequence of the first search or the direct search initiation according to the first search of the content of the same entry or directly searches for the corresponding pointer, according to the determined sequence, The contents of the entry returned by the cache management unit 104 are sent to a lookup interface that initiates the first lookup or the direct lookup.
优选地, 所述装置还包括: 表项管理单元 107; 相应地, 所述方法还包 括:  Preferably, the device further includes: an entry management unit 107; and correspondingly, the method further includes:
所述表项管理单元 107通过所述緩存管理单元 104将所述直接查找、 所述第二次查找对应的表项内容、 所述第一次查找对应的偏移量信息下发 至相应类型的存储器。  The entry management unit 107 delivers, by the cache management unit 104, the direct search, the content of the entry corresponding to the second search, and the offset information corresponding to the first search to the corresponding type. Memory.
优选地, 所述方法还包括:  Preferably, the method further includes:
维护第二次查找的使能标识;  Maintain the enable identifier for the second lookup;
预设该使能标识为有效状态时, 对应某一表项的第一次查找结束后, 根据第一次查找的偏移量信息、 以及与第一次查找对应的第二次查找的表 项类型、 表项基地址和表项长度, 进行第二次查找。 所述直接查找表项基地址为对应同一表项类型的表项的存储的起始地 址, 本发明实施例中, 对于相同查找算法的第一次查找的表项内容在对应 的片内存储器或片外存储器中利用连续的空间存储, 该连续空间的起始地 址为第一次查找表项类型的基地址。 When the first identification of the corresponding entry is completed, the offset information of the first search and the second searched entry corresponding to the first search are preset. Type, table item base address, and table item length for a second lookup. The direct lookup table entry base address is a stored start address of an entry corresponding to the same entry type. In the embodiment of the present invention, the content of the first searched entry of the same search algorithm is in the corresponding on-chip memory or The off-chip memory utilizes contiguous spatial storage, the starting address of which is the base address of the first lookup entry type.
所述直接查找表项长度为对于使用相同查找算法的第一次查找的每个 表项的长度。  The direct lookup table entry length is the length of each entry for the first lookup using the same lookup algorithm.
实际应用中, 当本发明实施例中的表项管理装置应用于维护表项数量 较大且查找频率高的场景中时, 为了避免查找拥塞, 保证对查找的响应速 率, 查找调度单元 102对第一次查找、 第二次查找以及直接查找的目标存 储器的类型以及所使用的查找算法, 将第一次查找、 第二次查找和直接查 找对应的键值以及在 SDT表中对应的信息緩存到对应的队列中, 根据预设 的负载均衡策略, 对緩存的第一次查找、 第二次查找以及直接查找的上述 信息进行调度, 对应发起第一次查找、 第二次查找或直接查找, 并在发起 第一次查找、 第二次查找或直接查找时发送对应的查找接口标识。  In an actual application, when the entry management device in the embodiment of the present invention is applied to a scenario in which the number of maintenance entries is large and the search frequency is high, in order to avoid searching for congestion, and ensuring the response rate to the search, the lookup scheduling unit 102 The type of target memory for one lookup, second lookup, and direct lookup, and the lookup algorithm used, caches the first lookup, the second lookup, and the direct lookup for the corresponding key and the corresponding information in the SDT table. In the corresponding queue, according to the preset load balancing policy, the first search, the second search, and the direct search of the cache are scheduled, and the first search, the second search, or the direct search is initiated, and The corresponding lookup interface identifier is sent when the first lookup, the second lookup, or the direct lookup is initiated.
所述表项基地址为对应同一表项类型的表项的存储的起始地址, 本发 明实施例中, 对于相同查找算法的第一次查找的表项内容在对应的片内存 储器或片外存储器中利用连续的空间存储, 该连续空间的起始地址为第一 次查找表项类型的基地址。  The entry base address of the entry is a stored start address of an entry corresponding to the same entry type. In the embodiment of the present invention, the content of the first searched entry of the same search algorithm is in the corresponding on-chip memory or off-chip. The memory utilizes contiguous spatial storage, the starting address of which is the base address of the first lookup entry type.
所述表项长度为对于使用相同查找算法的第一次查找的每个表项的长 度。  The entry length is the length of each entry for the first lookup using the same lookup algorithm.
所述查找算法包括: 哈希查找算法、 路由查找算法、 基于 TCAM的高 速路由查找算法; 上述查找算法均为二级查找算法, 即对于待查找的表项 的内容, 需要通过第一次查找确定该表项的偏移量信息, 根据第一次查找 确定的偏移量信息进行第二次查找, 确定待查找表项的内容。  The search algorithm includes: a hash search algorithm, a route lookup algorithm, and a TCAM-based high-speed route search algorithm; the above search algorithms are secondary search algorithms, that is, the content of the entry to be searched needs to be determined by the first search. The offset information of the entry is searched for a second time according to the offset information determined by the first lookup, and the content of the entry to be searched is determined.
所述目标存储器的类型包括片内存储器和片外存储器。 本发明实施例还记载一种计算机存储介质 , 所述计算机存储介质中存 储有计算机可执行指令, 所述计算机可执行指令用于为执行图 7所示的表 项管理方法。 The types of target memory include on-chip memory and off-chip memory. The embodiment of the invention further describes a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the entry management method shown in FIG. 7.
本发明实施例提供的表项管理装置和表项管理方法, 通过预设的与直 接查找、 第一次查找和第二次查找的对应的信息, 例如查找表项类型、 查 找表项长度和查找表项基地址 , 实现了表项存储的灵活配置;  The entry management device and the entry management method provided by the embodiment of the present invention, by using preset information corresponding to direct search, first search, and second search, for example, lookup entry type, lookup entry length, and lookup The base address of the entry, which implements flexible configuration of entry storage;
支持二级查找(第一次查找和第二次查找), 无需向用户侧的查找接口 返回第一次查找的表项内容(偏移量信息), 仅根据第一次查找的接口和预 设的第二次查找使能标识即可发起第二次查找, 节省了指令的开销, 提高 了查找效率;  Supports secondary lookup (first lookup and second lookup), without returning the first lookup entry content (offset information) to the lookup interface on the user side, based only on the first lookup interface and preset The second lookup enablement flag can initiate a second search, which saves the overhead of the instruction and improves the search efficiency;
根据查找对应的指针, 可以对查找对应的表项内容按照查找发起的顺 序返回, 即可实现保序;  According to the search for the corresponding pointer, the content of the corresponding entry can be returned in the order in which the search is initiated, so that the order can be implemented;
查找表项内容时采用间接寻址的方法, 克服了传统技术中直接寻址 Indirect addressing is used when looking up table entries, overcoming direct addressing in traditional techniques
RAM带来的占用总线地址空间大的缺陷, 能够广泛应用于其他地址空间较 少的表项管理场景中。 The disadvantage of occupying a large bus address space brought by RAM can be widely applied to other item management scenarios with less address space.
本领域内的技术人员应明白, 本发明的实施例可提供为方法、 系统、 或计算机程序产品。 因此, 本发明可采用硬件实施例、 软件实施例、 或结 合软件和硬件方面的实施例的形式。 而且, 本发明可采用在一个或多个其 中包含有计算机可用程序代码的计算机可用存储介质 (包括但不限于磁盘 存储器和光学存储器等)上实施的计算机程序产品的形式。  Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware aspects. Moreover, the invention can take the form of a computer program product embodied on one or more computer usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、 设备(系统)、 和计算机程序 产品的流程图和 /或方框图来描述的。 应理解可由计算机程序指令实现流程 图和 /或方框图中的每一流程和 /或方框、以及流程图和 /或方框图中的流程和 /或方框的结合。 可提供这些计算机程序指令到通用计算机、 专用计算机、 嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器, 使得 通过计算机或其他可编程数据处理设备的处理器执行的指令产生配置为实 现在流程图一个流程或多个流程和 /或方框图一个方框或多个方框中指定的 功能的装置。 The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, a special purpose computer, an embedded processor or other programmable data processing device to produce a machine such that Instructions executed by a processor of a computer or other programmable data processing device generate means configured to implement the functions specified in a block or blocks of a flow or a flow and/or a block diagram of the flowchart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理 设备以特定方式工作的计算机可读存储器中, 使得存储在该计算机可读存 储器中的指令产生包括指令装置的制造品, 该指令装置实现在流程图一个 流程或多个流程和 /或方框图一个方框或多个方框中指定的功能。  The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备 上, 使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机 实现的处理, 从而在计算机或其他可编程设备上执行的指令提供配置为实 现在流程图一个流程或多个流程和 /或方框图一个方框或多个方框中指定的 功能的步骤。  These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps that are configured to implement the functions specified in one or more blocks of the flowchart or in a block or blocks of the flowchart.
以上所述仅是本发明的优选实施方式, 应当指出, 对于本技术领域的 普通技术人员来说, 在不脱离本发明原理的前提下, 还可以做出若干改进 和润饰, 这些改进和润饰也应视为本发明的保护范围。  The above description is only a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. It should be considered as the scope of protection of the present invention.

Claims

权利要求书 claims
1、 一种表项管理装置, 所述装置包括: 结构定义表 SDT单元、 查找调 度单元、 二级查找管理单元、 緩存管理单元和返回调度单元; 其中, 1. A table entry management device, the device includes: a structure definition table SDT unit, a search scheduling unit, a secondary search management unit, a cache management unit and a return scheduling unit; wherein,
所述 SDT单元, 配置为维护针对表项的第一次查找对应的表项长度和 表项基地址、 以及针对表项的第二次查找对应的表项长度和表项基地址; 所述查找调度单元, 配置为根据所述 SDT单元中与查找接口发起的第 一次查找对应的表项长度和表项基地址、 以及所述查找接口发起第一次查 找时发送的对应所述第一次查找的键值, 向所述二级查找管理单元发起第 一次查找, 并根据所述二级查找管理单元返回的偏移量、 以及所述 SDT单 元中与第二次查找对应的表项长度和表项基地址, 向所述緩存管理单元发 起第二次查找; The SDT unit is configured to maintain the entry length and entry base address corresponding to the first search for the entry, and the entry length and entry base address corresponding to the second search for the entry; the search The scheduling unit is configured to calculate the entry length and base address of the entry corresponding to the first lookup initiated by the lookup interface in the SDT unit, and the entry corresponding to the first lookup sent when the lookup interface initiates the first lookup. Search key value, initiate the first search to the secondary search management unit, and based on the offset returned by the secondary search management unit and the entry length corresponding to the second search in the SDT unit and the table entry base address, initiate a second search to the cache management unit;
所述返回调度单元, 配置为将所述緩存管理单元返回的第二次查找的 表项内容发送至相应的查找接口。 The return scheduling unit is configured to send the entry content of the second search returned by the cache management unit to the corresponding search interface.
2、 根据权利要求 1所述的装置, 其中, 2. The device according to claim 1, wherein,
所述 SDT单元, 还配置为维护第一次查找所使用的查找算法的信息; 所述查找调度单元, 还配置为根据所述 SDT单元中与所述查找接口发 起的第一次查找对应的查找算法的信息, 确定响应对应的查找算法的二级 查找管理单元, 并通过所确定的二级查找管理单元, 向所述緩存管理单元 发起第一次查找。 The SDT unit is also configured to maintain the information of the search algorithm used for the first search; the search scheduling unit is also configured to perform a search corresponding to the first search initiated by the search interface in the SDT unit. Based on the algorithm information, the secondary search management unit that responds to the corresponding search algorithm is determined, and the first search is initiated to the cache management unit through the determined secondary search management unit.
3、 根据权利要求 2所述的装置, 其中, 所述装置还包括与所述二级查 找管理单元对应的二级查找单元; 3. The device according to claim 2, wherein the device further includes a secondary search unit corresponding to the secondary search management unit;
所述二级查找管理单元, 还配置为根据所述 SDT单元中与所述查找接 口发起的第一次查找对应的表项长度和表项基地址、 以及对应所述第一次 查找的键值, 向对应的二级查找单元发起第一次查找; The secondary search management unit is also configured to determine the entry length and entry base address corresponding to the first search initiated by the search interface in the SDT unit, as well as the key value corresponding to the first search. , initiate the first search to the corresponding secondary search unit;
所述二级查找单元, 还配置为根据所述 SDT单元中与所述查找接口发 起的第一次查找对应的表项长度和表项基地址、 以及对应所述第一次查找 的键值 , 向所述緩存管理单元请求相应的偏移量信息。 The secondary search unit is also configured to send a message to the search interface according to the SDT unit. The entry length and entry base address corresponding to the first search, as well as the key value corresponding to the first search, are requested from the cache management unit for the corresponding offset information.
4、 根据权利要求 3所述的装置, 其中, 4. The device according to claim 3, wherein,
所述 SDT单元, 还配置为维护对应第一次查找的目标存储器类型的信 所述二级查找单元, 还配置为根据所述 SDT单元中与所述查找接口发 起的第一查找对应的目标存储器的类型信息, 向对应的緩存管理单元请求 偏移量信息; The SDT unit is further configured to maintain information corresponding to the target memory type of the first search. The secondary search unit is also configured to determine the target memory corresponding to the first search initiated by the search interface in the SDT unit. Type information, request offset information from the corresponding cache management unit;
所述緩存管理单元, 还配置为才艮据所述二级查找单元的偏移量信息的 请求, 在对应的存储器查找偏移量信息。 The cache management unit is further configured to search for offset information in the corresponding memory according to the request for offset information from the secondary search unit.
5、 根据权利要求 1所述的装置, 其中, 5. The device according to claim 1, wherein,
所述 SDT单元, 还配置为维护对应第二次查找的目标存储器类型的信 所述查找调度单元, 还配置为根据所述 SDT单元中与所述第二次查找 对应的目标存储器的类型信息, 向对应的緩存管理单元请求表项内容。 The SDT unit is further configured to maintain information corresponding to the target memory type of the second search. The search scheduling unit is further configured to maintain information on the type of target memory corresponding to the second search in the SDT unit. Request the entry content from the corresponding cache management unit.
6、 根据权利要求 1所述的装置, 其中, 6. The device according to claim 1, wherein,
所述 SDT单元, 还配置为维护第二次查找的使能标识; The SDT unit is also configured to maintain the enable identification of the second search;
所述查找调度单元, 还配置为在接收到所述二级查找管理单元返回的 偏移量时, 判断与所述查找接口发起的第一次查找对应的第二次查找的使 能标识是否有效, 如果有效, 则向所述緩存管理单元发起第二次查找; 否 则 , 将所接收到的偏移量信息发送至发起第一次查找以请求所述偏移量信 息的查找接口。 The search scheduling unit is also configured to, when receiving the offset returned by the secondary search management unit, determine whether the enable flag of the second search corresponding to the first search initiated by the search interface is valid. , if valid, initiate a second search to the cache management unit; otherwise, send the received offset information to the search interface that initiated the first search to request the offset information.
7、 根据权利要求 1所述的装置, 其中, 7. The device according to claim 1, wherein,
所述 SDT单元,还配置为维护直接查找对应的表项长度和表项基地址; 所述查找调度单元, 还配置为根据所述 SDT单元中与所述查找接口发 起的直接查找对应的表项长度和表项基地址、 以及所述查找接口发起直接 查找时所发送的键值 , 向所述緩存管理单元发起直接查找; The SDT unit is also configured to maintain the entry length and entry base address corresponding to the direct lookup; the lookup scheduling unit is also configured to send messages based on the lookup interface in the SDT unit. The entry length and entry base address corresponding to the direct lookup initiated, as well as the key value sent when the lookup interface initiates a direct lookup, initiate a direct lookup to the cache management unit;
所述返回调度单元, 配置为将所述緩存管理单元返回的直接查找的表 项内容发送至发起所述直接查找以请求相应表项内容的查找接口。 The return scheduling unit is configured to send the direct lookup entry content returned by the cache management unit to the lookup interface that initiates the direct lookup to request the corresponding entry content.
8、 根据权利要求 7所述的装置, 其中, 8. The device according to claim 7, wherein,
所述 SDT单元, 还配置为维护对应直接查找的目标存储器类型的信息 和直接查找所使用的算法信息; The SDT unit is also configured to maintain information corresponding to the target memory type of the direct search and algorithm information used by the direct search;
所述查找调度单元, 还配置为根据所述 SDT单元中与所述直接查找对 应的目标存储器的类型信息和直接查找所使用的算法信息, 向对应的緩存 管理单元请求表项内容。 The search scheduling unit is further configured to request the entry content from the corresponding cache management unit according to the type information of the target memory corresponding to the direct search in the SDT unit and the algorithm information used for the direct search.
9、 根据权利要求 7或 8所述的装置, 其中, 9. The device according to claim 7 or 8, wherein,
所述返回调度单元, 还配置为根据查询同一表项内容的第一次查找或 直接查找对应的指针, 确定所述第一次查找或所述直接查找发起的先后顺 序, 按照所确定的先后顺序将所述緩存管理单元返回的表项内容发送至发 起所述第一次查找或所述直接查找的查找接口。 The return scheduling unit is also configured to determine the order in which the first search or the direct search is initiated based on the first search or direct search for the same entry content, in accordance with the determined order. The entry content returned by the cache management unit is sent to the search interface that initiated the first search or the direct search.
10、 根据权利要求 7或 8所述的装置, 其中, 所述装置还包括: 表项管理单元, 配置为通过所述緩存管理单元将所述直接查找、 所述 第二次查找对应的表项内容、 所述第一次查找对应的偏移量信息下发至相 应类型的存储器。 10. The device according to claim 7 or 8, wherein the device further includes: an entry management unit configured to use the cache management unit to perform the direct search and the second search on the corresponding entry. The content and offset information corresponding to the first search are sent to the corresponding type of memory.
11、 一种表项管理方法, 应用于表项管理装置中, 所述装置包括: 结 构定义表 SDT单元、 查找调度单元、 二级查找管理单元、 緩存管理单元和 返回调度单元; 所述方法包括: 11. A table entry management method, applied to a table entry management device, the device includes: a structure definition table SDT unit, a search scheduling unit, a secondary search management unit, a cache management unit and a return scheduling unit; the method includes :
所述 SDT单元维护针对表项的第一次查找对应的表项长度和表项基地 址、 以及针对表项的第二次查找对应的表项长度和表项基地址; The SDT unit maintains the entry length and entry base address corresponding to the first search for the entry, and the entry length and entry base address corresponding to the second search for the entry;
所述查找调度单元根据与查找接口发起的第一次查找对应的表项长度 和表项基地址、 以及所述查找接口发起第一次查找时发送的对应所述第一 次查找的键值, 向所述二级查找管理单元发起第一次查找, 并根据所述二 级查找管理单元返回的第一次查找返回的偏移量、 以及所述 SDT单元中与 第二次查找对应的表项长度和表项基地址, 向所述緩存管理单元发起第二 次查找; The search scheduling unit determines the length of the entry corresponding to the first search initiated by the search interface. and the base address of the table entry, and the key value corresponding to the first search sent when the search interface initiates the first search, initiates the first search to the second-level search management unit, and based on the second-level search management unit The offset returned by the first search returned by the search management unit, as well as the entry length and entry base address corresponding to the second search in the SDT unit, initiate a second search to the cache management unit;
所述返回调度单元将所述緩存管理单元返回的第二次查找的表项内容 发送至相应的查找接口。 The return scheduling unit sends the entry content of the second search returned by the cache management unit to the corresponding search interface.
12、 根据权利要求 11所述的方法, 其中, 所述方法还包括: 12. The method according to claim 11, wherein the method further includes:
所述 SDT单元维护第一次查找所使用的查找算法的信息; The SDT unit maintains information on the search algorithm used for the first search;
所述查找调度单元根据所述 SDT单元中与所述查找接口发起的第一次 查找对应的查找算法的信息, 确定响应对应的查找算法的二级查找管理单 元, 并通过所确定的二级查找管理单元, 向所述緩存管理单元发起第一次 查找。 The search scheduling unit determines the secondary search management unit that responds to the corresponding search algorithm based on the information of the search algorithm corresponding to the first search initiated by the search interface in the SDT unit, and uses the determined secondary search The management unit initiates the first search to the cache management unit.
13、 根据权利要求 12所述的方法, 其中, 所述装置还包括与所述二级 查找管理单元对应的二级查找单元; 相应地, 所述方法还包括: 13. The method according to claim 12, wherein the device further includes a secondary search unit corresponding to the secondary search management unit; accordingly, the method further includes:
所述二级查找管理单元根据所述 SDT单元中与所述查找接口发起的第 一次查找对应的表项长度和表项基地址、 以及对应所述第一次查找的键值, 向对应的二级查找单元发起第一次查找; The secondary search management unit sends a query to the corresponding entry in the SDT unit according to the entry length and entry base address corresponding to the first search initiated by the search interface, and the key value corresponding to the first search. The secondary search unit initiates the first search;
所述二级查找单元根据所述 SDT单元中与所述查找接口发起的第一次 查找对应的表项长度和表项基地址、 以及对应所述第一次查找的键值, 向 所述緩存管理单元请求相应的偏移量信息。 The secondary search unit sends a query to the cache according to the entry length and entry base address in the SDT unit corresponding to the first search initiated by the search interface, and the key value corresponding to the first search. The snap-in requests the corresponding offset information.
14、 根据权利要求 13所述的方法, 其中, 所述方法还包括: 14. The method according to claim 13, wherein the method further includes:
所述 SDT单元维护对应第一次查找的目标存储器类型的信息; 所述二级查找单元根据所述 SDT单元中与所述查找接口发起的第一查 找对应的目标存储器的类型信息, 向对应的緩存管理单元请求偏移量信息; 所述緩存管理单元根据所述二级查找单元的偏移量信息的请求 , 在对 应的存储器查找偏移量信息。 The SDT unit maintains information corresponding to the target memory type for the first search; the secondary search unit searches for the corresponding target memory based on the type information of the target memory corresponding to the first search initiated by the search interface in the SDT unit. The cache management unit requests offset information; The cache management unit searches for offset information in the corresponding memory according to the offset information request of the secondary search unit.
15、 根据权利要求 11所述的方法, 其中, 所述方法还包括: 所述 SDT单元维护对应第二次查找的目标存储器类型的信息; 所述查找调度单元根据所述 SDT单元中与所述第二次查找对应的目标 存储器的类型信息, 向对应的緩存管理单元请求表项内容。 15. The method according to claim 11, wherein the method further includes: the SDT unit maintains information corresponding to the target memory type of the second search; the search scheduling unit determines Search the type information of the corresponding target memory for the second time, and request the entry content from the corresponding cache management unit.
16、 根据权利要求 11所述的方法, 其中, 所述方法还包括: 所述 SDT单元维护第二次查找的使能标识; 16. The method according to claim 11, wherein the method further includes: the SDT unit maintaining an enable flag for the second search;
所述查找调度单元在接收到所述二级查找管理单元返回的偏移量时, 判断与所述查找接口发送的第一次查找对应的第二次查找的使能标识是否 有效, 如果有效, 则向所述緩存管理单元发起第二次查找, 否则; 将所接 收到的偏移量信息发送至发起所述第一次查找以请求所述偏移量信息的查 找接口。 When the search scheduling unit receives the offset returned by the secondary search management unit, it determines whether the enable flag of the second search corresponding to the first search sent by the search interface is valid. If it is valid, Then initiate a second search to the cache management unit, otherwise; send the received offset information to the search interface that initiated the first search to request the offset information.
17、 根据权利要求 11所述的方法, 其中, 所述方法还包括: 所述 SDT单元维护直接查找对应的表项长度和表项基地址; 所述查找调度单元根据所述 SDT单元中与所述查找接口发起的直接查 找对应的表项长度和表项基地址、 以及所述查找接口发起直接查找时所发 送的键值发起直接查找; 17. The method according to claim 11, wherein the method further includes: the SDT unit maintains the entry length and entry base address corresponding to the direct search; the search scheduling unit determines the entry length and entry base address corresponding to the direct search; The entry length and entry base address corresponding to the direct search initiated by the search interface, and the key value sent when the search interface initiates the direct search initiates the direct search;
所述返回调度单元将所述緩存管理单元返回的直接查找返回的表项内 容发送至发起所述直接查找以请求相应表项内容的查找接口。 The return scheduling unit sends the entry content returned by the direct lookup returned by the cache management unit to the lookup interface that initiates the direct lookup to request the corresponding entry content.
18、 根据权利要求 17所述的方法, 其中, 所述方法还包括: 所述 SDT单元维护对应直接查找的目标存储器类型的信息和直接查找 所使用的算法信息; 18. The method according to claim 17, wherein the method further includes: the SDT unit maintains the information of the target memory type corresponding to the direct search and the algorithm information used by the direct search;
所述查找调度单元根据所述 SDT单元中与所述直接查找对应的目标存 储器的类型信息和直接查找所使用的算法信息, 向对应的緩存管理单元请 求表项内容。 The search scheduling unit requests the corresponding cache management unit according to the type information of the target memory corresponding to the direct search in the SDT unit and the algorithm information used by the direct search. Find the table item content.
19、 根据权利要求 17或 18所述的方法, 其中, 所述方法还包括: 所述返回调度单元根据查询同一表项内容的第一次查找或直接查找对 应的指针, 确定所述第一次查找或所述直接查找发起的先后顺序, 按照所 确定的先后顺序, 将所述緩存管理单元返回的表项内容发送至发起所述第 一次查找或所述直接查找的查找接口。 19. The method according to claim 17 or 18, wherein the method further includes: the return scheduling unit determines the first search according to the first search of the same entry content or directly searches the corresponding pointer. The search or the direct search is initiated in the order in which the entry content returned by the cache management unit is sent to the search interface that initiated the first search or the direct search according to the determined order.
20、 根据权利要求 17或 18所述的方法, 其中, 所述装置还包括: 表 项管理单元; 相应地, 所述方法还包括: 20. The method according to claim 17 or 18, wherein the device further includes: an entry management unit; accordingly, the method further includes:
所述表项管理单元通过所述緩存管理单元将所述直接查找、 所述第二 次查找对应的表项内容、 所述第一次查找对应的偏移量信息下发至相应类 型的存储器。 The entry management unit delivers the direct search, the entry content corresponding to the second search, and the offset information corresponding to the first search to the corresponding type of memory through the cache management unit.
21、 一种计算机存储介质, 所述计算机存储介质中存储有计算机可执 行指令, 所述计算机可执行指令用于执行权利要求 11至 20任一项所述的 表项管理方法。 21. A computer storage medium, the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the entry management method described in any one of claims 11 to 20.
PCT/CN2014/077802 2013-08-12 2014-05-19 Table entry management device, table entry management method, and computer storage medium WO2014169874A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310350415.7A CN104378295B (en) 2013-08-12 2013-08-12 List item managing device and entry management method
CN201310350415.7 2013-08-12

Publications (1)

Publication Number Publication Date
WO2014169874A1 true WO2014169874A1 (en) 2014-10-23

Family

ID=51730833

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/077802 WO2014169874A1 (en) 2013-08-12 2014-05-19 Table entry management device, table entry management method, and computer storage medium

Country Status (2)

Country Link
CN (1) CN104378295B (en)
WO (1) WO2014169874A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992579A (en) * 2021-09-23 2022-01-28 新华三信息安全技术有限公司 Routing table entry storage method, routing table entry searching method and routing table entry searching device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302374B (en) * 2015-06-26 2019-08-16 深圳市中兴微电子技术有限公司 It is a kind of for improve list item access bandwidth and atomicity operation device and method
CN108984553B (en) * 2017-06-01 2022-02-01 北京京东尚科信息技术有限公司 Caching method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101036143A (en) * 2004-08-13 2007-09-12 谷歌股份有限公司 Multi-stage query processing system and method for use with tokenspace repository
US20080117910A1 (en) * 2006-11-20 2008-05-22 Alcatel Lucent Switch and Method for Supporting Internet Protocol (IP) Network Tunnels
CN101267331A (en) * 2008-04-23 2008-09-17 华为技术有限公司 A search method and device for multicast forward table
US20090178104A1 (en) * 2008-01-08 2009-07-09 Hemal Shah Method and system for a multi-level security association lookup scheme for internet protocol security
CN102193917A (en) * 2010-03-01 2011-09-21 中国移动通信集团公司 Method and device for processing and querying data

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101262505B (en) * 2008-04-22 2010-10-27 杭州华三通信技术有限公司 A method, system and device for establishing ARP table items
CN101694664B (en) * 2009-11-03 2012-07-11 杭州华三通信技术有限公司 Method and device for searching list items of content addressable memory
CN102546098B (en) * 2011-12-15 2015-01-21 福建星网锐捷网络有限公司 Data transmission device, method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101036143A (en) * 2004-08-13 2007-09-12 谷歌股份有限公司 Multi-stage query processing system and method for use with tokenspace repository
US20080117910A1 (en) * 2006-11-20 2008-05-22 Alcatel Lucent Switch and Method for Supporting Internet Protocol (IP) Network Tunnels
US20090178104A1 (en) * 2008-01-08 2009-07-09 Hemal Shah Method and system for a multi-level security association lookup scheme for internet protocol security
CN101267331A (en) * 2008-04-23 2008-09-17 华为技术有限公司 A search method and device for multicast forward table
CN102193917A (en) * 2010-03-01 2011-09-21 中国移动通信集团公司 Method and device for processing and querying data

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992579A (en) * 2021-09-23 2022-01-28 新华三信息安全技术有限公司 Routing table entry storage method, routing table entry searching method and routing table entry searching device
CN113992579B (en) * 2021-09-23 2023-03-31 新华三信息安全技术有限公司 Routing table entry storage method, routing table entry searching method and routing table entry searching device

Also Published As

Publication number Publication date
CN104378295B (en) 2019-03-26
CN104378295A (en) 2015-02-25

Similar Documents

Publication Publication Date Title
US11620255B2 (en) Time sensitive networking device
CN108153757B (en) Hash table management method and device
US8255593B2 (en) Direct memory access with striding across memory
CN109388590B (en) Dynamic cache block management method and device for improving multichannel DMA (direct memory access) access performance
CN102843426B (en) Based on Web cache resources shared system and the method for intelligent father node
US10152420B2 (en) Multi-way set associative cache and processing method thereof
JP2018522331A (en) Speculative prefetch of transformation for memory management unit (MMU)
US20030147409A1 (en) Processing data packets
US20140280669A1 (en) Memory Sharing Over A Network
WO2014012390A1 (en) Data processing method and apparatus, and shared storage device
CN104394096A (en) Multi-core processor based message processing method and multi-core processor
WO2016015583A1 (en) Memory management method and device, and memory controller
EP2743833B1 (en) Method and apparatus for querying and traversing virtual memory area
WO2014169874A1 (en) Table entry management device, table entry management method, and computer storage medium
CN114625762A (en) Metadata acquisition method, network equipment and system
CN108399175B (en) Data storage and query method and device
CN114327280B (en) Message storage method and system based on cold and hot separation storage
CN113377689B (en) Routing table item searching and storing method and network chip
WO2016206490A1 (en) Device and method of enhancing item access bandwidth and atomic operation
WO2013185660A1 (en) Instruction storage device of network processor and instruction storage method for same
CN113419973A (en) Message forwarding method and device
CN105183398B (en) A kind of storage device, electronic equipment and data processing method
CN110337633A (en) A kind of date storage method and equipment
CN109117288B (en) Message optimization method for low-delay bypass
US11119919B2 (en) Method and apparatus with improved speed in data write-in

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14785405

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14785405

Country of ref document: EP

Kind code of ref document: A1