WO2016101551A1 - Method and device for writing data into ternary content addressable memory - Google Patents

Method and device for writing data into ternary content addressable memory Download PDF

Info

Publication number
WO2016101551A1
WO2016101551A1 PCT/CN2015/081093 CN2015081093W WO2016101551A1 WO 2016101551 A1 WO2016101551 A1 WO 2016101551A1 CN 2015081093 W CN2015081093 W CN 2015081093W WO 2016101551 A1 WO2016101551 A1 WO 2016101551A1
Authority
WO
WIPO (PCT)
Prior art keywords
tcam
working mode
error
link
data
Prior art date
Application number
PCT/CN2015/081093
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 WO2016101551A1 publication Critical patent/WO2016101551A1/en

Links

Images

Definitions

  • This paper relates to the field of computers, and in particular to a method and apparatus for writing data in a three-state content addressed memory.
  • ASIC Application Specific Integrated Circuits
  • NP Network Processor
  • TCAM ternary content addressable memory
  • ACLs Access Control Lists
  • the main feature of TCAM is fast parallel search.
  • the application on the network processor is usually that the microcode composes a KEY (key value) from the message extraction information, and sends a search command to the TCAM through the NP TCAM controller, and processes the result according to the result. Message.
  • KEY key value
  • FIG. 1 is a schematic diagram of a network processor connecting a TCAM in the related art.
  • the CPU accesses the external TCAM through the TCAM adaptation interface of the NP, and the NP and the TCAM are interconnected via the Interlaken bus.
  • the Interlaken physical bus consists of multiple lanes.
  • one of the LANs is aging or the link quality is poor.
  • the TCAM write table may have errors such as CRC (Cyclical Redundancy Check) or Framing (framing). . Therefore, the control plane accesses the TCAM, and waits for each read and write, regardless of whether it is read or written, waits for the TCAM to return and parses it, and if there is an error, performs a failure rewrite.
  • CRC Cyclical Redundancy Check
  • Framing framing
  • the TCAM can be successfully written by repeated overwriting.
  • This document provides a method and apparatus for writing data in a tri-state content addressed memory to increase the speed of TCAM write operations.
  • a method for writing data in a three-state content addressing memory TCAM comprising: acquiring a link state of a physical bus between a network processor NP and a TCAM; and controlling a write operation if a link state of the physical bus is good
  • the working mode is a first working mode, wherein the first working mode is a query response that does not wait for the TCAM, or, after obtaining the query response of the TCAM, does not perform parsing and processing of the query response of the TCAM; when detecting to the TCAM
  • the operation of writing data is performed, if the working mode is the first working mode, the data is directly written into the TCAM.
  • the method further includes: if an error of the link of the physical bus occurs, switching the working mode of the write operation from the first working mode to the second working mode
  • the second working mode is a query response waiting for the TCAM, and after obtaining the query response of the TCAM, performing the parsing of the query response of the TCAM; when detecting the operation of writing data to the TCAM, if the working mode is In the second working mode, the query response of the TCAM is obtained, and according to the query response of the TCAM, the cause of the error is obtained, and the write operation of the data is managed according to the error reason.
  • the managing the write operation of the data according to the error cause includes: if the error cause is a cyclic redundancy check CRC, rewriting the data until the correct Until the data is written.
  • CRC cyclic redundancy check
  • the obtaining the link state of the physical bus between the network processor NP and the TCAM comprises: reading the error status register inside the TCAM and the information recorded in the link error count register, and acquiring the relationship between the NP and the TCAM.
  • the link state of the physical bus comprises: reading the error status register inside the TCAM and the information recorded in the link error count register, and acquiring the relationship between the NP and the TCAM. The link state of the physical bus.
  • the management data input/output MDIO interface reads the error status register inside the TCAM and the information recorded in the link error count register, and acquires the link state of the physical bus between the NP and the TCAM.
  • An apparatus for writing data in a TCAM of a three-state content addressing memory comprising: an obtaining module, configured to: acquire a link state of a physical bus between a network processor NP and a TCAM; and a control module configured to: if the physical If the link state of the bus is good, the working mode of the control write operation is the first working mode, wherein the first working mode is a query response that does not wait for the TCAM, or the TCAM query is not performed after the TCAM query response is obtained.
  • the parsing and processing of the response; the first write operation module is configured to: when the operation of writing data to the TCAM is detected, if the working mode is the first working mode, the data is directly written into the TCAM.
  • control module is further configured to: if an error of the link of the physical bus occurs, switch an operation mode of the write operation from a first working mode to a second working mode, where the second working mode In order to wait for the query response of the TCAM, and after obtaining the query response of the TCAM, perform the parsing of the query response of the TCAM; the second write operation module is set to: when the operation of writing data to the TCAM is detected, if the working mode is In the second working mode, the query response of the TCAM is obtained, and according to the query response of the TCAM, the cause of the error is obtained, and the write operation of the data is managed according to the error reason.
  • the second write operation module includes: a rewriting unit, configured to: if the error cause is a cyclic redundancy check CRC, rewrite the data until the correct write is performed Until the data is described.
  • a rewriting unit configured to: if the error cause is a cyclic redundancy check CRC, rewrite the data until the correct write is performed Until the data is described.
  • the acquiring module is configured to: read the error status register inside the TCAM and the information recorded in the link error count register, and acquire a link state of the physical bus between the NP and the TCAM.
  • the acquiring module reads the information recorded by the error status register and the link error count register inside the TCAM by the management data input/output MDIO interface, and acquires the link state of the physical bus between the NP and the TCAM.
  • a computer readable storage medium storing computer executable instructions for performing the method of any of the above.
  • the embodiment of the present invention obtains the link state between the TCAM and the NP.
  • the control write operation does not need to wait for the TCAM to return the result, and does not need to parse the return result, so the large-capacity write table can save the situation. A lot of time, thus shortening the time required to complete the write operation and increasing the speed of the TCAM write operation.
  • FIG. 1 is a schematic diagram of a network processor connecting a TCAM in the related art
  • FIG. 2 is a schematic flow chart of a method for writing data in a three-state content addressing memory according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a network processor connecting a TCAM according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of an apparatus for writing data in a tri-state content addressable memory according to an embodiment of the present invention
  • Fig. 5 is a schematic view showing another structure of the apparatus shown in Fig. 4.
  • FIG. 2 is a schematic flowchart of a method for writing data in a three-state content addressable memory according to an embodiment of the present invention.
  • the method shown in Figure 2 includes:
  • Step 201 Obtain a link state of a physical bus between the network processor NP and the TCAM.
  • Step 202 If the link state of the physical bus is good, control the working mode of the write operation to be a first working mode, where the first working mode is a query response that does not wait for the TCAM, or obtains a query response of the TCAM. After that, the parsing and processing of the query response of the TCAM is not performed;
  • Step 203 When an operation of writing data to the TCAM is detected, if the working mode is When it is in the first working mode, the data is directly written to the TCAM.
  • the embodiment of the present invention obtains the link state between the TCAM and the NP.
  • the control write operation does not need to wait for the TCAM to return the result, and does not need to parse the return result, so the large-capacity write table can save the situation. A lot of time, thus shortening the time required to complete the write operation and increasing the speed of the TCAM write operation.
  • the method further includes:
  • the working mode of controlling the write operation is switched from the first working mode to the second working mode, wherein the second working mode is a query response waiting for the TCAM, and the query of the TCAM is obtained. After the response, the TCM query response is parsed;
  • the working mode is the second working mode
  • the query response of the TCAM is acquired, and according to the query response of the TCAM, the cause of the error is obtained, according to the error reason, The writing of the data is managed.
  • the managing the write operation of the data according to the error cause includes:
  • the cause of the error is a cyclic redundancy check CRC, the data is rewritten until the data is correctly written.
  • the TCAM returns a Packet Error Response format containing a 64-bit Error Code.
  • To write to the TCAM wait for the TCAM to return a Response result. Parsing the Error Code. If a link CRC is found, the corresponding action is taken, such as failure rewriting.
  • the TCAM write operation can be performed according to the existing process to ensure correct writing of data.
  • the data writing speed is improved under the premise of ensuring correct data writing.
  • the obtaining the link state of the physical bus between the network processor NP and the TCAM includes: reading the error status register inside the TCAM and the information recorded in the link error count register, and acquiring the physical bus between the NP and the TCAM. Link status.
  • the PCS layer of the Netlogic TCAM chip stores error status and error counts.
  • the NL11K chip Common Status Register has the ability to detect errors such as CRC, and there is a CRC error count in the RX PCS Counter register.
  • the information stored in the register is read and used as the basis for switching the write operation without increasing the hardware cost, and the implementation is simple.
  • this paper proposes to read the information recorded in the TCAM internal error status register and link error count register through the Management Data Input/Output (MDIO) interface to obtain the physical relationship between NP and TCAM.
  • MDIO Management Data Input/Output
  • FIG. 3 is a schematic diagram of a network processor connected to a TCAM according to an embodiment of the present invention.
  • the internal CPU interface in the NP is connected to the TCAM using an external MDIO interface to achieve the purpose of reading the information in the register in the TCAM. If the read result finds that the error status register and the link error count register have a link error such as CRC, it is timely aware that there is a problem with the link between the NP and the TCAM.
  • the internal registers of the TCAM are periodically read through the MDIO interface to sense the Interlaken link state between the NP and the TCAM.
  • the advantage of borrowing the MDIO interface is that the MDIO signal line is an out-of-band resource and therefore does not occupy the Interlaken bandwidth resources between the NP and the TCAM.
  • TCAM writes the table, does not wait for the TCAM response, and does not need to analyze and judge the TCAM response result according to the response format specified by the TCAM manual. This mode works when the link between NP and TCAM is in good condition.
  • Mode 2 The TCAM write table needs to wait for the TCAM response.
  • the TCAM response result is parsed and judged according to the response format specified by the TCAM manual. If there is a CRC error, it needs to be rewritten until it is successfully written to the TCAM. This mode works when the link status between NP and TCAM is not good.
  • the switching between mode one and mode two is controlled by a software global variable.
  • Step A01 determining whether an error is detected
  • the result of the software thread scan ie the value of the global variable, determines which operating mode is used. If the software thread scans the register and finds that a link error such as CRC exists, it proceeds to step A02; otherwise, it proceeds to step A03.
  • Step A02 mode one write table
  • This mode there is no need to wait for the TCAM to return the result, and there is no need to parse the returned result and perform a failure rewrite.
  • This mode is the usual fast write table mode.
  • Step A03 mode 2 write table
  • This mode needs to wait for the TCAM to return the result, parse the returned result, and if there is a link problem such as CRC, it will fail to rewrite until it is correctly written.
  • the above application example discloses a fast write table mode for the problem that the current batch write TCAM is effective.
  • the TCAM's MDIO out-of-band interface reads the link quality-related error status register and error counter inside the TCAM to determine which operating mode to use. Normally, when the quality of the TCAM link is normal, there is no need to wait for the TCAM to return the result, and there is no need to parse the returned result. Therefore, the large-capacity write table can save a lot of time, thus shortening the service effective time.
  • FIG. 4 is a schematic structural diagram of an apparatus for writing data in a three-state content addressable memory according to an embodiment of the present invention.
  • the schematic shown in Figure 4 includes:
  • the obtaining module 401 is configured to: acquire a link state of a physical bus between the network processor NP and the TCAM;
  • the control module 402 is configured to: if the link state of the physical bus is good, control an operation mode of the write operation to a first working mode, where the first working mode is a query response that does not wait for the TCAM, or After the TCAM query response, the TCAM query response is not parsed and processed;
  • the first write operation module 403 is configured to: when the operation of writing data to the TCAM is detected, if the operation mode is the first operation mode, the data is directly written into the TCAM.
  • Fig. 5 is a schematic view showing another structure of the apparatus shown in Fig. 4.
  • the device in the schematic shown in Figure 5 includes:
  • the obtaining module 401 is configured to: acquire a link state of a physical bus between the network processor NP and the TCAM;
  • the control module 402 is configured to: if the link state of the physical bus is good, control an operation mode of the write operation to a first working mode, where the first working mode is a query response that does not wait for the TCAM, or After the TCAM query response, the TCAM query response is not parsed and processed;
  • the first write operation module 403 is configured to: when the operation of writing data to the TCAM is detected, if the operation mode is the first operation mode, the data is directly written into the TCAM.
  • control module 402 is further configured to: if an error occurs in the link of the physical bus, switch the working mode of the write operation from the first working mode to the second working mode, where the second The working mode is to wait for the query response of the TCAM, and after obtaining the query response of the TCAM, perform the parsing of the query response of the TCAM;
  • the second write operation module 404 is configured to: when detecting the operation of writing data to the TCAM, if the working mode is the second working mode, acquiring a query response of the TCAM, and according to the query response of the TCAM, The cause of the error is obtained, and the write operation of the data is managed according to the cause of the error.
  • the second write operation module 404 includes:
  • the rewriting unit is configured to: if the error cause is a cyclic redundancy check CRC, rewrite the data until the data is correctly written.
  • the obtaining module 401 is configured to:
  • the obtaining module 401 reads the information recorded by the error status register and the link error count register in the TCAM through the management data input/output MDIO interface, and acquires the NP sum.
  • the embodiment of the present invention obtains the link state between the TCAM and the NP.
  • the control write operation does not need to wait for the TCAM to return the result, and does not need to parse the return result, so the large-capacity write table can save the situation. A lot of time, thus shortening the time required to complete the write operation and increasing the speed of the TCAM write operation.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • each device/function module/functional unit in the above embodiment When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the embodiment of the present invention obtains the link state between the TCAM and the NP.
  • the control write operation does not need to wait for the TCAM to return the result, and does not need to parse the return result, so the large-capacity write table can save the situation. A lot of time, thus shortening the time required to complete the write operation and increasing the speed of the TCAM write operation.

Abstract

A method and a device for writing data into a ternary content addressable memory (TCAM). The method comprises: acquiring a link state of a physical bus between a network processor (NP) and a TCAM; if the link state of the physical bus is good, controlling a working mode of a write operation to be a first working mode, the first working mode being that a query response of the TCAM is not waited for, or after a query response of the TCAM is obtained, the query response of the TCAM is not parsed and processed ; and when an operation of writing data into the TCAM is detected, if the working mode is the first working mode, directly writing data into the TCAM.

Description

一种三态内容寻址存储器中写数据的方法和装置Method and device for writing data in three-state content addressing memory 技术领域Technical field
本文涉及计算机领域,尤其涉及一种三态内容寻址存储器中写数据的方法和装置。This paper relates to the field of computers, and in particular to a method and apparatus for writing data in a three-state content addressed memory.
背景技术Background technique
现今网络发展速度惊人,网络流量的增长及新业务的出现,需要网络设备具有线速和灵活的处理能力。目前网络芯片包括ASIC(Application Specific Integrated Circuits,专用集成电路)和NP(Network Processor,网络处理器)两大类。网络处理器凭借其高速处理及灵活的可编程性,已成为当今网络中数据处理的有效解决方案。Today's network development is amazing, network traffic growth and the emergence of new services require network equipment to have wire-speed and flexible processing capabilities. At present, the network chip includes two major categories: ASIC (Application Specific Integrated Circuits) and NP (Network Processor). With its high-speed processing and flexible programmability, network processors have become an effective solution for data processing in today's networks.
网络处理器中有多种不同的存储器,如SRAM、TCAM、SDRAM等,这些存储器存放着各种业务表项,如端口表、MAC表、路由表等。There are many different kinds of memory in the network processor, such as SRAM, TCAM, SDRAM, etc. These memories store various service items such as port table, MAC table, routing table and so on.
TCAM(ternary content addressable memory)是一种三态内容寻址存储器,主要用于快速查找ACL(Access Control List,访问控制列表)、路由等表项。TCAM的主要特点是快速并行查找,在网络处理器上的应用通常是,微码从报文抽取相关信息组成一个KEY(键值),通过NP的TCAM控制器向TCAM发送查找命令,根据结果处理报文。TCAM (ternary content addressable memory) is a three-state content-addressable memory. It is mainly used to quickly find ACLs (Access Control Lists) and routes. The main feature of TCAM is fast parallel search. The application on the network processor is usually that the microcode composes a KEY (key value) from the message extraction information, and sends a search command to the TCAM through the NP TCAM controller, and processes the result according to the result. Message.
图1为相关技术中网络处理器连接TCAM的示意图。CPU通过NP的TCAM适配接口访问外部TCAM,NP和TCAM之间通过Interlaken总线互联。FIG. 1 is a schematic diagram of a network processor connecting a TCAM in the related art. The CPU accesses the external TCAM through the TCAM adaptation interface of the NP, and the NP and the TCAM are interconnected via the Interlaken bus.
Interlaken物理总线由多个lane组成,设备运行过程中,其中一个lane老化或者链路质量不良,TCAM写表会出现CRC(Cyclical Redundancy Check,循环冗余码校验)或者Framing(成帧)等错误。因此控制层面访问TCAM,无论读或者写,都对每次的读写进行等待,等待TCAM相应返回并进行解析,如果有错误则进行失败重写。 The Interlaken physical bus consists of multiple lanes. During the operation of the device, one of the LANs is aging or the link quality is poor. The TCAM write table may have errors such as CRC (Cyclical Redundancy Check) or Framing (framing). . Therefore, the control plane accesses the TCAM, and waits for each read and write, regardless of whether it is read or written, waits for the TCAM to return and parses it, and if there is an error, performs a failure rewrite.
如果Interlaken链路运行期间出现偶尔同步错误或者CRC,通过反复重写可以成功写入TCAM。If an occasional synchronization error or CRC occurs during the Interlaken link operation, the TCAM can be successfully written by repeated overwriting.
目前应用TCAM的网络业务很多,比如IPV4/IPV6路由查找、ACL、流镜像、流统计等。这些业务经常会批量写表,最大可能包括几万条规则,如果写入每条规则到TCAM时,都要等待TCAM返回,并且做结果解析的话,势必会浪费很长时间,因此目前大容量ACL配置下发需要很长时间,业务生效慢,因此如何提高TCAM的写操作的速度是亟待解决的技术问题。Currently, there are many network services that use TCAM, such as IPV4/IPV6 route lookup, ACL, flow mirroring, and flow statistics. These services often write tables in batches, and may include up to tens of thousands of rules. If each rule is written to the TCAM, it must wait for the TCAM to return, and if the result is parsed, it will be a waste of time, so the current large-capacity ACL The configuration takes a long time and the service takes effect slowly. Therefore, how to improve the speed of TCAM write operations is a technical problem to be solved.
发明内容Summary of the invention
本文提供一种三态内容寻址存储器中写数据的方法和装置,以提高TCAM的写操作的速度。This document provides a method and apparatus for writing data in a tri-state content addressed memory to increase the speed of TCAM write operations.
一种三态内容寻址存储器TCAM中写数据的方法,包括:获取网络处理器NP和TCAM之间的物理总线的链路状态;如果所述物理总线的链路状态良好,则控制写操作的工作模式为第一工作模式,其中所述第一工作模式为不等待TCAM的查询响应,或者,在得到TCAM的查询响应后,不进行TCAM的查询响应的解析和处理;当检测到向TCAM进行写数据的操作时,如果所述工作模式为第一工作模式时,则直接将数据写入到TCAM中。A method for writing data in a three-state content addressing memory TCAM, comprising: acquiring a link state of a physical bus between a network processor NP and a TCAM; and controlling a write operation if a link state of the physical bus is good The working mode is a first working mode, wherein the first working mode is a query response that does not wait for the TCAM, or, after obtaining the query response of the TCAM, does not perform parsing and processing of the query response of the TCAM; when detecting to the TCAM When the operation of writing data is performed, if the working mode is the first working mode, the data is directly written into the TCAM.
可选地,在控制写操作的工作模式为第一工作模式之后,还包括:如果所述物理总线的链路出现错误,则控制写操作的工作模式从第一工作模式切换到第二工作模式,其中所述第二工作模式为等待TCAM的查询响应,并在得到TCAM的查询响应后,进行TCAM的查询响应的解析;当检测到向TCAM进行写数据的操作时,如果所述工作模式为第二工作模式时,则获取TCAM的查询响应,并根据所述TCAM的查询响应,获取错误原因,根据所述错误原因,对所述数据的写操作进行管理。Optionally, after the working mode of controlling the write operation is the first working mode, the method further includes: if an error of the link of the physical bus occurs, switching the working mode of the write operation from the first working mode to the second working mode The second working mode is a query response waiting for the TCAM, and after obtaining the query response of the TCAM, performing the parsing of the query response of the TCAM; when detecting the operation of writing data to the TCAM, if the working mode is In the second working mode, the query response of the TCAM is obtained, and according to the query response of the TCAM, the cause of the error is obtained, and the write operation of the data is managed according to the error reason.
可选地,所述根据所述错误原因,对所述数据的写操作进行管理,包括:如果所述错误原因为循环冗余码校验CRC,则对所述数据进行重写操作,直至正确写入所述数据为止。 Optionally, the managing the write operation of the data according to the error cause includes: if the error cause is a cyclic redundancy check CRC, rewriting the data until the correct Until the data is written.
可选地,所述获取网络处理器NP和TCAM之间的物理总线的链路状态,包括:读取TCAM内部的错误状态寄存器及链路错误计数寄存器记录的信息,获取NP和TCAM之间的物理总线的链路状态。Optionally, the obtaining the link state of the physical bus between the network processor NP and the TCAM comprises: reading the error status register inside the TCAM and the information recorded in the link error count register, and acquiring the relationship between the NP and the TCAM. The link state of the physical bus.
其中,通过管理数据输入输出MDIO接口读取TCAM内部的错误状态寄存器及链路错误计数寄存器记录的信息,获取NP和TCAM之间的物理总线的链路状态。The management data input/output MDIO interface reads the error status register inside the TCAM and the information recorded in the link error count register, and acquires the link state of the physical bus between the NP and the TCAM.
一种三态内容寻址存储器TCAM中写数据的装置,包括:获取模块,设置为:获取网络处理器NP和TCAM之间的物理总线的链路状态;控制模块,设置为:如果所述物理总线的链路状态良好,则控制写操作的工作模式为第一工作模式,其中所述第一工作模式为不等待TCAM的查询响应,或者,在得到TCAM的查询响应后,不进行TCAM的查询响应的解析和处理;第一写操作模块,设置为:当检测到向TCAM进行写数据的操作时,如果所述工作模式为第一工作模式时,则直接将数据写入到TCAM中。An apparatus for writing data in a TCAM of a three-state content addressing memory, comprising: an obtaining module, configured to: acquire a link state of a physical bus between a network processor NP and a TCAM; and a control module configured to: if the physical If the link state of the bus is good, the working mode of the control write operation is the first working mode, wherein the first working mode is a query response that does not wait for the TCAM, or the TCAM query is not performed after the TCAM query response is obtained. The parsing and processing of the response; the first write operation module is configured to: when the operation of writing data to the TCAM is detected, if the working mode is the first working mode, the data is directly written into the TCAM.
可选地,所述控制模块,还设置为:如果所述物理总线的链路出现错误,则控制写操作的工作模式从第一工作模式切换到第二工作模式,其中所述第二工作模式为等待TCAM的查询响应,并在得到TCAM的查询响应后,进行TCAM的查询响应的解析;第二写操作模块,设置为:当检测到向TCAM进行写数据的操作时,如果所述工作模式为第二工作模式时,则获取TCAM的查询响应,并根据所述TCAM的查询响应,获取错误原因,根据所述错误原因,对所述数据的写操作进行管理。Optionally, the control module is further configured to: if an error of the link of the physical bus occurs, switch an operation mode of the write operation from a first working mode to a second working mode, where the second working mode In order to wait for the query response of the TCAM, and after obtaining the query response of the TCAM, perform the parsing of the query response of the TCAM; the second write operation module is set to: when the operation of writing data to the TCAM is detected, if the working mode is In the second working mode, the query response of the TCAM is obtained, and according to the query response of the TCAM, the cause of the error is obtained, and the write operation of the data is managed according to the error reason.
可选地,所述第二写操作模块,包括:重写单元,设置为:如果所述错误原因为循环冗余码校验CRC,则对所述数据进行重写操作,直至正确写入所述数据为止。Optionally, the second write operation module includes: a rewriting unit, configured to: if the error cause is a cyclic redundancy check CRC, rewrite the data until the correct write is performed Until the data is described.
可选地,所述获取模块是设置为:读取TCAM内部的错误状态寄存器及链路错误计数寄存器记录的信息,获取NP和TCAM之间的物理总线的链路状态。Optionally, the acquiring module is configured to: read the error status register inside the TCAM and the information recorded in the link error count register, and acquire a link state of the physical bus between the NP and the TCAM.
可选地,所述获取模块通过管理数据输入输出MDIO接口读取TCAM内部的错误状态寄存器及链路错误计数寄存器记录的信息,获取NP和TCAM之间的物理总线的链路状态。 Optionally, the acquiring module reads the information recorded by the error status register and the link error count register inside the TCAM by the management data input/output MDIO interface, and acquires the link state of the physical bus between the NP and the TCAM.
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述任一项的方法。A computer readable storage medium storing computer executable instructions for performing the method of any of the above.
本发明提供的实施例,获取TCAM与NP之间的链路状态,在链路状态良好时,控制写操作无需等待TCAM返回结果,也不需要解析返回结果,因此大容量写表情况下可以节省很多时间,因此缩短了完成写操作所需的时间,提高TCAM的写操作的速度。The embodiment of the present invention obtains the link state between the TCAM and the NP. When the link state is good, the control write operation does not need to wait for the TCAM to return the result, and does not need to parse the return result, so the large-capacity write table can save the situation. A lot of time, thus shortening the time required to complete the write operation and increasing the speed of the TCAM write operation.
附图概述BRIEF abstract
图1为相关技术中网络处理器连接TCAM的示意图;1 is a schematic diagram of a network processor connecting a TCAM in the related art;
图2为本发明实施例的三态内容寻址存储器中写数据的方法的流程示意图;2 is a schematic flow chart of a method for writing data in a three-state content addressing memory according to an embodiment of the present invention;
图3为本发明实施例的网络处理器连接TCAM的示意图;3 is a schematic diagram of a network processor connecting a TCAM according to an embodiment of the present invention;
图4为本发明实施例的三态内容寻址存储器中写数据的装置的结构示意图;4 is a schematic structural diagram of an apparatus for writing data in a tri-state content addressable memory according to an embodiment of the present invention;
图5为图4所示装置的另一结构示意图。Fig. 5 is a schematic view showing another structure of the apparatus shown in Fig. 4.
本发明的实施方式Embodiments of the invention
下面将结合附图对本发明的实施方式进行描述。需要说明的是,在不冲突的情况下,本文中的实施例及实施例中的特征可以相互任意组合。Embodiments of the present invention will be described below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments herein may be arbitrarily combined with each other.
图2为本发明实施例提供的三态内容寻址存储器中写数据的方法的流程示意图。图2所示方法包括:FIG. 2 is a schematic flowchart of a method for writing data in a three-state content addressable memory according to an embodiment of the present invention. The method shown in Figure 2 includes:
步骤201、获取网络处理器NP和TCAM之间的物理总线的链路状态;Step 201: Obtain a link state of a physical bus between the network processor NP and the TCAM.
步骤202、如果所述物理总线的链路状态良好,则控制写操作的工作模式为第一工作模式,其中所述第一工作模式为不等待TCAM的查询响应,或者,在得到TCAM的查询响应后,不进行TCAM的查询响应的解析和处理;Step 202: If the link state of the physical bus is good, control the working mode of the write operation to be a first working mode, where the first working mode is a query response that does not wait for the TCAM, or obtains a query response of the TCAM. After that, the parsing and processing of the query response of the TCAM is not performed;
步骤203、当检测到向TCAM进行写数据的操作时,如果所述工作模式 为第一工作模式时,则直接将数据写入到TCAM中。Step 203: When an operation of writing data to the TCAM is detected, if the working mode is When it is in the first working mode, the data is directly written to the TCAM.
本发明提供的实施例,获取TCAM与NP之间的链路状态,在链路状态良好时,控制写操作无需等待TCAM返回结果,也不需要解析返回结果,因此大容量写表情况下可以节省很多时间,因此缩短了完成写操作所需的时间,提高TCAM的写操作的速度。The embodiment of the present invention obtains the link state between the TCAM and the NP. When the link state is good, the control write operation does not need to wait for the TCAM to return the result, and does not need to parse the return result, so the large-capacity write table can save the situation. A lot of time, thus shortening the time required to complete the write operation and increasing the speed of the TCAM write operation.
下面对本发明提供的方法实施例作进一步说明:The method embodiments provided by the present invention are further described below:
其中,在控制写操作的工作模式为第一工作模式之后,还包括:After the working mode of the control write operation is the first working mode, the method further includes:
如果所述物理总线的链路出现错误,则控制写操作的工作模式从第一工作模式切换到第二工作模式,其中所述第二工作模式为等待TCAM的查询响应,并在得到TCAM的查询响应后,进行TCAM的查询响应的解析;If an error occurs in the link of the physical bus, the working mode of controlling the write operation is switched from the first working mode to the second working mode, wherein the second working mode is a query response waiting for the TCAM, and the query of the TCAM is obtained. After the response, the TCM query response is parsed;
当检测到向TCAM进行写数据的操作时,如果所述工作模式为第二工作模式时,则获取TCAM的查询响应,并根据所述TCAM的查询响应,获取错误原因,根据所述错误原因,对所述数据的写操作进行管理。When the operation of writing data to the TCAM is detected, if the working mode is the second working mode, the query response of the TCAM is acquired, and according to the query response of the TCAM, the cause of the error is obtained, according to the error reason, The writing of the data is managed.
其中,所述根据所述错误原因,对所述数据的写操作进行管理,包括:The managing the write operation of the data according to the error cause includes:
如果所述错误原因为循环冗余码校验CRC,则对所述数据进行重写操作,直至正确写入所述数据为止。If the cause of the error is a cyclic redundancy check CRC, the data is rewritten until the data is correctly written.
以目前业界广泛使用的Netlogic系列TCAM为例,TCAM返回结果Packet Error Response(包错误响应)格式中,包含64bit的Error Code(错误码),对TCAM写操作,要等待TCAM返回Response(响应)结果中解析Error Code。如果发现有链路CRC,则采取相应动作,比如失败重写等。Taking the Netlogic series TCAM widely used in the industry as an example, the TCAM returns a Packet Error Response format containing a 64-bit Error Code. To write to the TCAM, wait for the TCAM to return a Response result. Parsing the Error Code. If a link CRC is found, the corresponding action is taken, such as failure rewriting.
需要说明的是,在工作模式为第二工作模式时,TCAM的写操作可以按照已有流程进行操作,以保证数据的正确写入。It should be noted that when the working mode is the second working mode, the TCAM write operation can be performed according to the existing process to ensure correct writing of data.
通过控制TCAM的写操作处于不同工作模式,在保证数据写入正确的前提下,提高数据的写入速度。By controlling the TCAM write operation in different working modes, the data writing speed is improved under the premise of ensuring correct data writing.
其中,所述获取网络处理器NP和TCAM之间的物理总线的链路状态,包括;读取TCAM内部的错误状态寄存器及链路错误计数寄存器记录的信息,获取NP和TCAM之间的物理总线的链路状态。The obtaining the link state of the physical bus between the network processor NP and the TCAM includes: reading the error status register inside the TCAM and the information recorded in the link error count register, and acquiring the physical bus between the NP and the TCAM. Link status.
例如,Netlogic TCAM芯片的PCS层存储错误状态和错误计数。 NL11K芯片Common Status Register具有探测CRC等错误的能力,RX PCS Counter寄存器里有CRC错误计数。For example, the PCS layer of the Netlogic TCAM chip stores error status and error counts. The NL11K chip Common Status Register has the ability to detect errors such as CRC, and there is a CRC error count in the RX PCS Counter register.
利用TCAM芯片中寄存器存储链路信息的特性,在不增加硬件成本的前提下,利用软件程序的改进,读取寄存器中存储的信息,作为切换写操作的依据,实现简单。By using the characteristics of the register storage link information in the TCAM chip, the information stored in the register is read and used as the basis for switching the write operation without increasing the hardware cost, and the implementation is simple.
当然,在实际应用中,也可以设置寄存器存储TCAM与NP之间的总线状态,作为切换工作模式的依据。Of course, in practical applications, it is also possible to set a register to store the bus state between the TCAM and the NP as a basis for switching the operating mode.
为了进一步节省硬件成本,本文提出,通过管理数据输入输出(Management Data Input/Output,MDIO)接口读取TCAM内部的错误状态寄存器及链路错误计数寄存器记录的信息,获取NP和TCAM之间的物理总线的链路状态。In order to further save the hardware cost, this paper proposes to read the information recorded in the TCAM internal error status register and link error count register through the Management Data Input/Output (MDIO) interface to obtain the physical relationship between NP and TCAM. The link status of the bus.
图3为本发明实施例提供的网络处理器连接TCAM的示意图。图3所示示意图中,NP中内部的CPU接口利用外部的MDIO接口与TCAM相连,实现读取TCAM中寄存器内信息的目的。如果读取结果发现错误状态寄存器及链路错误计数寄存器有CRC等链路错误,便及时感知到此时到NP和TCAM间的链路有问题。FIG. 3 is a schematic diagram of a network processor connected to a TCAM according to an embodiment of the present invention. In the diagram shown in Figure 3, the internal CPU interface in the NP is connected to the TCAM using an external MDIO interface to achieve the purpose of reading the information in the register in the TCAM. If the read result finds that the error status register and the link error count register have a link error such as CRC, it is timely aware that there is a problem with the link between the NP and the TCAM.
通过MDIO接口定时读取TCAM内部的寄存器,借此感知NP和TCAM间的Interlaken链路状态。借用MDIO接口的好处是MDIO信号线是带外资源,因此不占用NP和TCAM间的Interlaken带宽资源。The internal registers of the TCAM are periodically read through the MDIO interface to sense the Interlaken link state between the NP and the TCAM. The advantage of borrowing the MDIO interface is that the MDIO signal line is an out-of-band resource and therefore does not occupy the Interlaken bandwidth resources between the NP and the TCAM.
下面以一个应用实例进行说明:The following is an example of an application:
预设两种TCAM写表模式:Preset two TCAM write table modes:
模式一:TCAM写表,不等待TCAM响应,也不需要根据TCAM手册规定的响应格式对TCAM响应结果进行解析判断。此模式工作在NP和TCAM间链路状态良好的情况下。Mode 1: TCAM writes the table, does not wait for the TCAM response, and does not need to analyze and judge the TCAM response result according to the response format specified by the TCAM manual. This mode works when the link between NP and TCAM is in good condition.
模式二:TCAM写表,需要等待TCAM响应,根据TCAM手册规定的响应格式对TCAM响应结果进行解析判断,如果有CRC等错误,则需要失败重写,直到成功写入TCAM为止。此模式工作在NP和TCAM间链路状态不好的情况下。 Mode 2: The TCAM write table needs to wait for the TCAM response. The TCAM response result is parsed and judged according to the response format specified by the TCAM manual. If there is a CRC error, it needs to be rewritten until it is successfully written to the TCAM. This mode works when the link status between NP and TCAM is not good.
模式一和模式二的切换通过一个软件全局变量进行控制。The switching between mode one and mode two is controlled by a software global variable.
芯片初始化完成后,开启一个软件线程,通过MDIO接口,不断扫描TCAM内部的链路错误(如CRC)相关的错误状态寄存器及错误计数寄存器。After the chip initialization is completed, a software thread is opened, and the error status register and the error count register related to the link error (such as CRC) inside the TCAM are continuously scanned through the MDIO interface.
步骤A01、判断是否检测到错误;Step A01: determining whether an error is detected;
通过软件线程扫描结果即全局变量值决定采用哪种工作模式。如果软件线程扫描寄存器,发现有CRC等链路错误存在,则进入步骤A02;否则进入步骤A03。The result of the software thread scan, ie the value of the global variable, determines which operating mode is used. If the software thread scans the register and finds that a link error such as CRC exists, it proceeds to step A02; otherwise, it proceeds to step A03.
步骤A02、模式一写表;Step A02, mode one write table;
该模式下不需要等待TCAM返回结果,也不需要解析返回结果并进行失败重写,这种模式为通常的快速写表模式In this mode, there is no need to wait for the TCAM to return the result, and there is no need to parse the returned result and perform a failure rewrite. This mode is the usual fast write table mode.
步骤A03、模式二写表;Step A03, mode 2 write table;
该模式需要等待TCAM返回结果,解析返回结果,如果有CRC等链路问题,则进行失败重写,直至正确写入为止This mode needs to wait for the TCAM to return the result, parse the returned result, and if there is a link problem such as CRC, it will fail to rewrite until it is correctly written.
上述应用实例,针对目前批量写TCAM生效慢的问题,公开了一种快速写表模式。通过TCAM的MDIO带外接口,读取TCAM内部的链路质量相关的错误状态寄存器及错误计数器,借此决定采用哪种工作模式。通常情况下,TCAM链路质量正常的情况下,不需要等待TCAM返回结果,也不需要解析返回结果,因此大容量写表情况下可以节省很多时间,因此缩短了业务生效时间。The above application example discloses a fast write table mode for the problem that the current batch write TCAM is effective. The TCAM's MDIO out-of-band interface reads the link quality-related error status register and error counter inside the TCAM to determine which operating mode to use. Normally, when the quality of the TCAM link is normal, there is no need to wait for the TCAM to return the result, and there is no need to parse the returned result. Therefore, the large-capacity write table can save a lot of time, thus shortening the service effective time.
图4为本发明实施例提供的三态内容寻址存储器中写数据的装置的结构示意图。图4所示示意图包括:FIG. 4 is a schematic structural diagram of an apparatus for writing data in a three-state content addressable memory according to an embodiment of the present invention. The schematic shown in Figure 4 includes:
获取模块401,设置为:获取网络处理器NP和TCAM之间的物理总线的链路状态;The obtaining module 401 is configured to: acquire a link state of a physical bus between the network processor NP and the TCAM;
控制模块402,设置为:如果所述物理总线的链路状态良好,则控制写操作的工作模式为第一工作模式,其中所述第一工作模式为不等待TCAM的查询响应,或者,在得到TCAM的查询响应后,不进行TCAM的查询响应的解析和处理; The control module 402 is configured to: if the link state of the physical bus is good, control an operation mode of the write operation to a first working mode, where the first working mode is a query response that does not wait for the TCAM, or After the TCAM query response, the TCAM query response is not parsed and processed;
第一写操作模块403,设置为:当检测到向TCAM进行写数据的操作时,如果所述工作模式为第一工作模式时,则直接将数据写入到TCAM中。The first write operation module 403 is configured to: when the operation of writing data to the TCAM is detected, if the operation mode is the first operation mode, the data is directly written into the TCAM.
图5为图4所示装置的另一结构示意图。图5所示示意图中的装置包括:Fig. 5 is a schematic view showing another structure of the apparatus shown in Fig. 4. The device in the schematic shown in Figure 5 includes:
获取模块401,设置为:获取网络处理器NP和TCAM之间的物理总线的链路状态;The obtaining module 401 is configured to: acquire a link state of a physical bus between the network processor NP and the TCAM;
控制模块402,设置为:如果所述物理总线的链路状态良好,则控制写操作的工作模式为第一工作模式,其中所述第一工作模式为不等待TCAM的查询响应,或者,在得到TCAM的查询响应后,不进行TCAM的查询响应的解析和处理;The control module 402 is configured to: if the link state of the physical bus is good, control an operation mode of the write operation to a first working mode, where the first working mode is a query response that does not wait for the TCAM, or After the TCAM query response, the TCAM query response is not parsed and processed;
第一写操作模块403,设置为:当检测到向TCAM进行写数据的操作时,如果所述工作模式为第一工作模式时,则直接将数据写入到TCAM中。The first write operation module 403 is configured to: when the operation of writing data to the TCAM is detected, if the operation mode is the first operation mode, the data is directly written into the TCAM.
本实施例中,所述控制模块402,还设置为:如果所述物理总线的链路出现错误,则控制写操作的工作模式从第一工作模式切换到第二工作模式,其中所述第二工作模式为等待TCAM的查询响应,并在得到TCAM的查询响应后,进行TCAM的查询响应的解析;In this embodiment, the control module 402 is further configured to: if an error occurs in the link of the physical bus, switch the working mode of the write operation from the first working mode to the second working mode, where the second The working mode is to wait for the query response of the TCAM, and after obtaining the query response of the TCAM, perform the parsing of the query response of the TCAM;
第二写操作模块404,设置为:当检测到向TCAM进行写数据的操作时,如果所述工作模式为第二工作模式时,则获取TCAM的查询响应,并根据所述TCAM的查询响应,获取错误原因,根据所述错误原因,对所述数据的写操作进行管理。The second write operation module 404 is configured to: when detecting the operation of writing data to the TCAM, if the working mode is the second working mode, acquiring a query response of the TCAM, and according to the query response of the TCAM, The cause of the error is obtained, and the write operation of the data is managed according to the cause of the error.
其中,所述第二写操作模块404,包括:The second write operation module 404 includes:
重写单元,设置为:如果所述错误原因为循环冗余码校验CRC,则对所述数据进行重写操作,直至正确写入所述数据为止。The rewriting unit is configured to: if the error cause is a cyclic redundancy check CRC, rewrite the data until the data is correctly written.
其中,所述获取模块401是设置为:The obtaining module 401 is configured to:
读取TCAM内部的错误状态寄存器及链路错误计数寄存器记录的信息,获取NP和TCAM之间的物理总线的链路状态。Read the error status register inside the TCAM and the information recorded in the link error count register to obtain the link status of the physical bus between the NP and the TCAM.
其中,所述获取模块401通过管理数据输入输出MDIO接口读取TCAM内部的错误状态寄存器及链路错误计数寄存器记录的信息,获取NP和 TCAM之间的物理总线的链路状态。The obtaining module 401 reads the information recorded by the error status register and the link error count register in the TCAM through the management data input/output MDIO interface, and acquires the NP sum. The link state of the physical bus between the TCAMs.
本发明提供的实施例,获取TCAM与NP之间的链路状态,在链路状态良好时,控制写操作无需等待TCAM返回结果,也不需要解析返回结果,因此大容量写表情况下可以节省很多时间,因此缩短了完成写操作所需的时间,提高TCAM的写操作的速度。The embodiment of the present invention obtains the link state between the TCAM and the NP. When the link state is good, the control write operation does not need to wait for the TCAM to return the result, and does not need to parse the return result, so the large-capacity write table can save the situation. A lot of time, thus shortening the time required to complete the write operation and increasing the speed of the TCAM write operation.
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art will appreciate that all or a portion of the steps of the above-described embodiments can be implemented using a computer program flow, which can be stored in a computer readable storage medium, such as on a corresponding hardware platform (eg, The system, device, device, device, etc. are executed, and when executed, include one or a combination of the steps of the method embodiments.
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。Alternatively, all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。The devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. The above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
工业实用性Industrial applicability
本发明提供的实施例,获取TCAM与NP之间的链路状态,在链路状态良好时,控制写操作无需等待TCAM返回结果,也不需要解析返回结果,因此大容量写表情况下可以节省很多时间,因此缩短了完成写操作所需的时间,提高TCAM的写操作的速度。 The embodiment of the present invention obtains the link state between the TCAM and the NP. When the link state is good, the control write operation does not need to wait for the TCAM to return the result, and does not need to parse the return result, so the large-capacity write table can save the situation. A lot of time, thus shortening the time required to complete the write operation and increasing the speed of the TCAM write operation.

Claims (11)

  1. 一种三态内容寻址存储器TCAM中写数据的方法,包括:A method for writing data in a TCAM of a three-state content addressing memory, comprising:
    获取网络处理器NP和TCAM之间的物理总线的链路状态;Obtaining a link state of a physical bus between the network processor NP and the TCAM;
    如果所述物理总线的链路状态良好,则控制写操作的工作模式为第一工作模式,其中所述第一工作模式为不等待TCAM的查询响应,或者,在得到TCAM的查询响应后,不进行TCAM的查询响应的解析和处理;If the link state of the physical bus is good, the working mode of controlling the write operation is the first working mode, wherein the first working mode is not waiting for the query response of the TCAM, or after obtaining the query response of the TCAM, Performing analysis and processing of the query response of the TCAM;
    当检测到向TCAM进行写数据的操作时,如果所述工作模式为第一工作模式时,则直接将数据写入到TCAM中。When an operation of writing data to the TCAM is detected, if the operation mode is the first operation mode, data is directly written into the TCAM.
  2. 根据权利要求1所述的方法,其中,在控制写操作的工作模式为第一工作模式之后,还包括:The method of claim 1, wherein after controlling the working mode of the write operation to be the first working mode, the method further comprises:
    如果所述物理总线的链路出现错误,则控制写操作的工作模式从第一工作模式切换到第二工作模式,其中所述第二工作模式为等待TCAM的查询响应,并在得到TCAM的查询响应后,进行TCAM的查询响应的解析;If an error occurs in the link of the physical bus, the working mode of controlling the write operation is switched from the first working mode to the second working mode, wherein the second working mode is a query response waiting for the TCAM, and the query of the TCAM is obtained. After the response, the TCM query response is parsed;
    当检测到向TCAM进行写数据的操作时,如果所述工作模式为第二工作模式时,则获取TCAM的查询响应,并根据所述TCAM的查询响应,获取错误原因,根据所述错误原因,对所述数据的写操作进行管理。When the operation of writing data to the TCAM is detected, if the working mode is the second working mode, the query response of the TCAM is acquired, and according to the query response of the TCAM, the cause of the error is obtained, according to the error reason, The writing of the data is managed.
  3. 根据权利要求2所述的方法,其中,所述根据所述错误原因,对所述数据的写操作进行管理,包括:The method of claim 2, wherein the managing the write operation of the data according to the cause of the error comprises:
    如果所述错误原因为循环冗余码校验CRC,则对所述数据进行重写操作,直至正确写入所述数据为止。If the cause of the error is a cyclic redundancy check CRC, the data is rewritten until the data is correctly written.
  4. 根据权利要求1所述的方法,其中,所述获取网络处理器NP和TCAM之间的物理总线的链路状态,包括:The method of claim 1, wherein the obtaining a link state of a physical bus between the network processor NP and the TCAM comprises:
    读取TCAM内部的错误状态寄存器及链路错误计数寄存器记录的信息,获取NP和TCAM之间的物理总线的链路状态。Read the error status register inside the TCAM and the information recorded in the link error count register to obtain the link status of the physical bus between the NP and the TCAM.
  5. 根据权利要求4所述的方法,其中,通过管理数据输入输出MDIO 接口读取TCAM内部的错误状态寄存器及链路错误计数寄存器记录的信息,获取NP和TCAM之间的物理总线的链路状态。The method according to claim 4, wherein the MDIO is input and output through management data The interface reads the error status register inside the TCAM and the information recorded in the link error count register to obtain the link status of the physical bus between the NP and the TCAM.
  6. 一种三态内容寻址存储器TCAM中写数据的装置,包括:A device for writing data in a TCAM of a three-state content addressing memory, comprising:
    获取模块,设置为:获取网络处理器NP和TCAM之间的物理总线的链路状态;Obtaining a module, configured to: obtain a link state of a physical bus between the network processor NP and the TCAM;
    控制模块,设置为:如果所述物理总线的链路状态良好,则控制写操作的工作模式为第一工作模式,其中所述第一工作模式为不等待TCAM的查询响应,或者,在得到TCAM的查询响应后,不进行TCAM的查询响应的解析和处理;a control module, configured to: if the link state of the physical bus is good, control an operation mode of the write operation to a first working mode, where the first working mode is a query response that does not wait for the TCAM, or After the query response, the TCAM query response is not parsed and processed;
    第一写操作模块,设置为:当检测到向TCAM进行写数据的操作时,如果所述工作模式为第一工作模式时,则直接将数据写入到TCAM中。The first write operation module is configured to: when the operation of writing data to the TCAM is detected, if the operation mode is the first operation mode, the data is directly written into the TCAM.
  7. 根据权利要求6所述的装置,还包括第二写操作模块,其中:The apparatus of claim 6 further comprising a second write operation module, wherein:
    所述控制模块,还设置为:如果所述物理总线的链路出现错误,则控制写操作的工作模式从第一工作模式切换到第二工作模式,其中所述第二工作模式为等待TCAM的查询响应,并在得到TCAM的查询响应后,进行TCAM的查询响应的解析;The control module is further configured to: if an error occurs in the link of the physical bus, switch the working mode of the write operation from the first working mode to the second working mode, wherein the second working mode is waiting for the TCAM Query the response, and after obtaining the query response of the TCAM, perform the parsing of the query response of the TCAM;
    所述第二写操作模块,设置为:当检测到向TCAM进行写数据的操作时,如果所述工作模式为第二工作模式时,则获取TCAM的查询响应,并根据所述TCAM的查询响应,获取错误原因,根据所述错误原因,对所述数据的写操作进行管理。The second write operation module is configured to: when detecting an operation of writing data to the TCAM, if the working mode is the second working mode, acquiring a query response of the TCAM, and responding according to the query of the TCAM Obtaining the cause of the error, and managing the write operation of the data according to the cause of the error.
  8. 根据权利要求7所述的装置,其中,所述第二写操作模块,包括:The apparatus of claim 7, wherein the second write operation module comprises:
    重写单元,设置为:如果所述错误原因为循环冗余码校验CRC,则对所述数据进行重写操作,直至正确写入所述数据为止。The rewriting unit is configured to: if the error cause is a cyclic redundancy check CRC, rewrite the data until the data is correctly written.
  9. 根据权利要求6所述的装置,其中,所述获取模块是设置为:The apparatus of claim 6 wherein said obtaining module is configured to:
    读取TCAM内部的错误状态寄存器及链路错误计数寄存器记录的信息,获取NP和TCAM之间的物理总线的链路状态。 Read the error status register inside the TCAM and the information recorded in the link error count register to obtain the link status of the physical bus between the NP and the TCAM.
  10. 根据权利要求9所述的装置,其中,所述获取模块通过管理数据输入输出MDIO接口读取TCAM内部的错误状态寄存器及链路错误计数寄存器记录的信息,获取NP和TCAM之间的物理总线的链路状态。The apparatus according to claim 9, wherein the acquisition module reads the information recorded in the error status register and the link error count register inside the TCAM by the management data input/output MDIO interface, and acquires the physical bus between the NP and the TCAM. Link status.
  11. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1-5任一项的方法。 A computer readable storage medium storing computer executable instructions for performing the method of any of claims 1-5.
PCT/CN2015/081093 2014-12-26 2015-06-09 Method and device for writing data into ternary content addressable memory WO2016101551A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410830506.5 2014-12-26
CN201410830506.5A CN105791125B (en) 2014-12-26 2014-12-26 Method and device for writing data in ternary content addressable memory

Publications (1)

Publication Number Publication Date
WO2016101551A1 true WO2016101551A1 (en) 2016-06-30

Family

ID=56149116

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/081093 WO2016101551A1 (en) 2014-12-26 2015-06-09 Method and device for writing data into ternary content addressable memory

Country Status (2)

Country Link
CN (1) CN105791125B (en)
WO (1) WO2016101551A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6721202B1 (en) * 2001-12-21 2004-04-13 Cypress Semiconductor Corp. Bit encoded ternary content addressable memory cell
CN101217468A (en) * 2007-12-28 2008-07-09 华为技术有限公司 A routing table look-up system, tristate content addressing memory and network processor
CN101986271A (en) * 2010-10-29 2011-03-16 中兴通讯股份有限公司 Method and device for dispatching TCAM (telecommunication access method) query and refresh messages
CN103366823A (en) * 2013-06-18 2013-10-23 苏州雄立科技有限公司 Testing circuit and method for TCAM (Ternary Content Addressable Memory)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7054995B2 (en) * 2003-04-23 2006-05-30 Integrated Silicon Solution, Inc. Dynamic linking of banks in configurable content addressable memory systems
CN102316040B (en) * 2011-09-09 2017-12-26 中兴通讯股份有限公司 The method and data stream classification device of a kind of access control list finding
CN103345479A (en) * 2013-06-18 2013-10-09 苏州雄立科技有限公司 Novel work mode for TCAM

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6721202B1 (en) * 2001-12-21 2004-04-13 Cypress Semiconductor Corp. Bit encoded ternary content addressable memory cell
CN101217468A (en) * 2007-12-28 2008-07-09 华为技术有限公司 A routing table look-up system, tristate content addressing memory and network processor
CN101986271A (en) * 2010-10-29 2011-03-16 中兴通讯股份有限公司 Method and device for dispatching TCAM (telecommunication access method) query and refresh messages
CN103366823A (en) * 2013-06-18 2013-10-23 苏州雄立科技有限公司 Testing circuit and method for TCAM (Ternary Content Addressable Memory)

Also Published As

Publication number Publication date
CN105791125A (en) 2016-07-20
CN105791125B (en) 2020-03-17

Similar Documents

Publication Publication Date Title
US9866479B2 (en) Technologies for concurrency of cuckoo hashing flow lookup
WO2016101488A1 (en) Ternary content addressable memory (tcam) table search method and device
US10491502B2 (en) Software tap for traffic monitoring in virtualized environment
US8677030B2 (en) Apparatus and method for managing packet classification tables
US20200136971A1 (en) Hash-table lookup with controlled latency
US8638793B1 (en) Enhanced parsing and classification in a packet processor
WO2020052323A1 (en) Data storage method, device and server
US20130294231A1 (en) Method of high-speed switching for network virtualization and high-speed virtual switch architecture
WO2017032112A1 (en) Method for communicating with board having no central processing unit and communication device
WO2020119310A1 (en) Lookup table storage method and device, and computer readable storage medium
CN105991391A (en) Method and device for uploading protocol message to CPU
US10642667B1 (en) Apparatus, system, and method for efficiently sharing data between processes
US10255213B1 (en) Adapter device for large address spaces
WO2016101490A1 (en) Update processing method and device
WO2016101551A1 (en) Method and device for writing data into ternary content addressable memory
US20180198704A1 (en) Pre-processing of data packets with network switch application -specific integrated circuit
US20120265860A1 (en) Sharing A Hosted Device In A Computer Network
US11038797B2 (en) Forwarding table entry access
WO2022078001A1 (en) Method and apparatus for managing static rule, and electronic device and storage medium
US8559430B2 (en) Network connection device, switching circuit device, and method for learning address
US10949321B1 (en) Operational management of a device
CN113852487A (en) Method and system for facilitating self-healing networks
WO2017004992A1 (en) Method and device for configuring network processor
US11954495B1 (en) Database acceleration with coprocessor subsystem for offloading tuple filtering
US11386008B1 (en) False hit detection in ternary content-addressable memory

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: 15871626

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: 15871626

Country of ref document: EP

Kind code of ref document: A1