CN100454899C - A network processing device and method - Google Patents
A network processing device and method Download PDFInfo
- Publication number
- CN100454899C CN100454899C CNB2006100027851A CN200610002785A CN100454899C CN 100454899 C CN100454899 C CN 100454899C CN B2006100027851 A CNB2006100027851 A CN B2006100027851A CN 200610002785 A CN200610002785 A CN 200610002785A CN 100454899 C CN100454899 C CN 100454899C
- Authority
- CN
- China
- Prior art keywords
- address
- register
- unit
- mapping unit
- mapping
- Prior art date
- Legal status (The legal status 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 status listed.)
- Expired - Lifetime
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明为一种网络处理装置及方法,包括:接口单元、微引擎单元,所述接口单元包括多个通道,用于报文的接收和转发;所述微引擎单元包括多个微引擎;地址映射单元,其由多个寄存器分段组成,用于分段的地址映射;其中,所述通道中的报文根据所述地址映射单元分段的地址映射被填充到所述微引擎的缓存中。使报文送入不同的报文处理微引擎,解决了报文处理微引擎转发软件开发的方便性的问题。
The present invention is a network processing device and method, comprising: an interface unit and a micro-engine unit, the interface unit includes multiple channels for receiving and forwarding messages; the micro-engine unit includes multiple micro-engines; the address A mapping unit, which consists of a plurality of register segments and is used for segmented address mapping; wherein, the messages in the channel are filled into the cache of the microengine according to the address mapping of the address mapping unit segment . The message is sent to different message processing micro-engines, which solves the problem of the convenience of the message processing micro-engine forwarding software development.
Description
技术领域 technical field
本发明涉及网络处理单元(NPU:Network Process Unit),具体的讲是一种网络处理装置及方法。The present invention relates to a network processing unit (NPU: Network Process Unit), specifically a network processing device and method.
背景技术 Background technique
网络处理单元(NPU:Network Process Unit)是一种可编程或可配置的半导体器件,专为处理网络数据(数据包)而设计和优化。网络处理单元的优化包括用以支持高速数据包分类和数据包修改的硬件和指令集。网络处理单元最主要的作用是把网络应用特有的数据传送和处理任务从通用处理器中卸载下来,从而使信息包的处理和传输大大加快。一个网络处理单元一般由一个核心处理器(如Strong ARM core系列)和多个微引擎(Micro engine)组成,并发同步完成一个数据包的处理。在网络处理单元中,一般有多个微引擎用以接收来自多个接口的报文,这样的方案是非常复杂的。Network Processing Unit (NPU: Network Process Unit) is a programmable or configurable semiconductor device designed and optimized for processing network data (packets). NPU optimizations include hardware and instruction sets to support high-speed packet classification and packet modification. The main function of the network processing unit is to offload the data transmission and processing tasks specific to network applications from the general-purpose processor, thereby greatly speeding up the processing and transmission of information packets. A network processing unit generally consists of a core processor (such as the Strong ARM core series) and multiple micro engines (Micro engines), which concurrently and synchronously complete the processing of a data packet. In the network processing unit, generally there are multiple micro-engines for receiving messages from multiple interfaces, and such a solution is very complicated.
如图1所示,在现有技术中所述的网络处理单元一般包含如下几个单元:微引擎单元、存储单元、接口单元以及寄存器单元。微引擎单元是网络处理单元的核心,完成报文分析和转发。网络处理单元的微引擎单元可以拥有多个微引擎并行处理。存储单元是网络处理单元内部存储设备,如SRAM等,报文或表项等存储的位置。接口单元是网络处理单元的对外数据接口,报文由入接口进入,再由出接口转发。寄存器单元完成网络处理单元的配置。As shown in FIG. 1 , the network processing unit described in the prior art generally includes the following units: a micro-engine unit, a storage unit, an interface unit and a register unit. The micro-engine unit is the core of the network processing unit, which completes packet analysis and forwarding. The micro-engine unit of the network processing unit may have multiple micro-engines for parallel processing. The storage unit is an internal storage device of the network processing unit, such as an SRAM, where messages or entries are stored. The interface unit is the external data interface of the network processing unit, and the message enters through the incoming interface and is forwarded by the outgoing interface. The register unit completes the configuration of the network processing unit.
现有技术中的网络处理单元在处理报文的流程如下:从接口单元中通道进入的报文,首先缓存在存储单元,当需要处理时,微引擎用特定的指令从存储单元中读取进行处理。由于多个接口的报文都存储在微引擎外的专用存储器中,需要复杂的存储管理。并且,当微引擎处理报文时,需要调度特定的指令并且需要额外的资源来读取报文内容进行处理。这样会增加存储单元的管理复杂度(因为有多个通道),另外还会增加接口数据到达微引擎的时延,从而降低网络处理单元的性能。The network processing unit in the prior art processes the message as follows: the message entered from the channel in the interface unit is first cached in the storage unit, and when it needs to be processed, the micro-engine uses specific instructions to read from the storage unit and perform deal with. Since the packets of multiple interfaces are all stored in a dedicated memory outside the microengine, complex storage management is required. Moreover, when the microengine processes the message, it needs to schedule specific instructions and need additional resources to read the content of the message for processing. This will increase the management complexity of the storage unit (because there are multiple channels), and will also increase the delay for the interface data to reach the micro-engine, thereby reducing the performance of the network processing unit.
可见,在以往的网络处理单元中,多个微引擎要获取需处理的报文是困难而复杂的,有的需要从外部存储空间(SRAM)中获取,有的则需多个微引擎从共同的存储空间中取得报文。It can be seen that in the previous network processing unit, it is difficult and complicated for multiple micro-engines to obtain the messages to be processed. Get the message in the storage space.
发明内容 Contents of the invention
本发明的目的在于,提供一种网络处理装置及方法,使报文能够灵活方便的被送入网络处理单元的任意存储空间,提高网络处理单元的性能,同时也降低了网络处理单元设计的复杂度。The purpose of the present invention is to provide a network processing device and method, so that the message can be flexibly and conveniently sent to any storage space of the network processing unit, improve the performance of the network processing unit, and also reduce the complexity of the network processing unit design Spend.
本发明的技术方案为:一种网络处理装置,包括:接口单元、微引擎单元,所述接口单元包括多个通道,用于报文的接收和转发;所述微引擎单元包括多个微引擎,所述装置还包括:The technical solution of the present invention is: a network processing device, including: an interface unit and a micro-engine unit, the interface unit includes a plurality of channels for receiving and forwarding messages; the micro-engine unit includes a plurality of micro-engines , the device also includes:
地址映射单元,其由多个寄存器分段组成,采用三段地址映射机制实现通道与微引擎所对应的缓冲器或微引擎内部的缓冲器之间的映射关系;The address mapping unit, which is composed of multiple register segments, adopts a three-segment address mapping mechanism to realize the mapping relationship between the channel and the buffer corresponding to the micro-engine or the buffer inside the micro-engine;
其中,所述通道中的报文根据所述地址映射单元分段的地址映射被填充到与所述微引擎相对应的缓冲器或所述微引擎内部的缓冲器中。Wherein, the message in the channel is filled into the buffer corresponding to the microengine or the buffer inside the microengine according to the address mapping segmented by the address mapping unit.
所述地址映射单元包括:第一段映射单元,包括多个寄存器,所述寄存器数与所述接口单元的通道数相同;第二段映射单元,包括至少一个寄存器;第三段映射单元,包括两组寄存器,每组寄存器数与所述微引擎数相同。The address mapping unit includes: a first section of mapping unit, including a plurality of registers, the number of registers is the same as the number of channels of the interface unit; a second section of mapping unit, including at least one register; a third section of mapping unit, including Two groups of registers, the number of each group of registers is the same as the number of the microengine.
所述第三段映射单元包括:地址寄存器组,包括多个第一寄存器,所述第一寄存器数与所述微引擎单元的微引擎数相同,每个所述第一寄存器中存储有一个所述微引擎单元中一个微引擎缓冲器的地址;位置寄存器组,其与地址寄存器组一一对应,包括多个第二寄存器,每个所述第二寄存器中存储有一个所述微引擎单元中另一个微引擎缓冲器的地址。The third segment mapping unit includes: an address register group, including a plurality of first registers, the number of the first registers is the same as the number of microengines of the microengine unit, and each of the first registers stores a The address of a microengine buffer in the microengine unit; the position register group, which corresponds to the address register group one-to-one, includes a plurality of second registers, each of which is stored in a microengine unit in the second register The address of another microengine buffer.
所述第一段映射单元的每个寄存器中分别存储有所述第二段映射单元的一个寄存器的地址。Each register of the first-segment mapping unit stores an address of a register of the second-segment mapping unit respectively.
所述第一段映射单元的多个寄存器存储有所述第二段映射单元的一个寄存器的地址。The multiple registers of the first segment mapping unit store the address of one register of the second segment mapping unit.
所述第二段映射单元中寄存器个数的取值范围是:大于等于1小于等于所述通道个数的任何整数值;所述第二段映射单元的每个寄存器存储有所述第三段映射单元中的一个寄存器的地址。The value range of the number of registers in the second segment mapping unit is: any integer value greater than or equal to 1 and less than or equal to the number of channels; each register of the second segment mapping unit stores the third segment The address of a register in the mapping unit.
本发明还提供了一种网络报文处理方法,其中包括:采用接口中的通道接受报文的进入;使所述的通道通过分段地址映射与微引擎所对应的缓冲器或微引擎内部的缓冲器建立通信联接,并将通道中的报文填充到与微引擎所对应的缓冲器或微引擎内部的缓冲器中,所述分段地址映射为采用三段地址映射机制实现通道与微引擎所对应的缓冲器或微引擎内部的缓冲器之间的映射关系。The present invention also provides a network message processing method, which includes: using the channel in the interface to accept the message; making the channel map with the buffer corresponding to the micro-engine or the internal memory of the micro-engine through segment address mapping; The buffer establishes a communication connection, and fills the messages in the channel into the buffer corresponding to the micro-engine or the buffer inside the micro-engine. The corresponding buffer or the mapping relationship between the buffers inside the microengine.
本发明所述的网络报文处理方法,其具体步骤为:The network message processing method of the present invention, its concrete steps are:
接口单元去访问其一个通道对应的第一段映射单元中的一个寄存器,并获得存储于该寄存器中的第一地址;The interface unit accesses a register in the first mapping unit corresponding to one channel, and obtains the first address stored in the register;
接口单元去访问所述第一地址对应的第二段映射单元的一个寄存器,并获得存储于该寄存器中的第二地址;The interface unit accesses a register of the second mapping unit corresponding to the first address, and obtains a second address stored in the register;
接口单元去访问所述第二地址对应的第三段映射单元的一个寄存器,并获得存储于该寄存器中的第三地址;The interface unit accesses a register of the third mapping unit corresponding to the second address, and obtains a third address stored in the register;
接口单元将进入其所述通道的报文存入第三地址对应的缓冲器。The interface unit stores the packets entering the channel into the buffer corresponding to the third address.
当一个缓冲器填充完成以后,第二段映射单元的寄存器所存储的第二地址会根据第三段映射单元中定义的下一个缓冲器的地址而改变,以指向存储所述下一个缓冲器地址的第三段映射单元的寄存器。When a buffer is filled, the second address stored in the register of the second segment mapping unit will change according to the address of the next buffer defined in the third segment mapping unit, so as to point to store the next buffer address The registers of the third-segment mapping unit.
本发明还提供了一种网络报文处理方法,其中包括:接口单元的一个通道接收外部的报文;接口单元搜索地址映射单元,找到所述通道对应的缓冲器的地址,所述地址映射单元采用三段地址映射机制实现通道与微引擎所对应的缓冲器或微引擎内部的缓冲器之间的映射关系;接口单元通过总线将该报文存入与微引擎所对应的缓冲器或微引擎内部的缓冲器。The present invention also provides a network message processing method, which includes: a channel of the interface unit receives external messages; the interface unit searches the address mapping unit to find the address of the buffer corresponding to the channel, and the address mapping unit The three-segment address mapping mechanism is used to realize the mapping relationship between the channel and the buffer corresponding to the micro-engine or the buffer inside the micro-engine; the interface unit stores the message into the buffer corresponding to the micro-engine or the micro-engine through the bus internal buffer.
所述的网络报文处理方法的具体步骤为,所述接口单元搜索地址映射单元找到所述通道对应的缓冲器的地址,接口单元检索其一个通道所对应的第一映射单元中的一个寄存器存储的第一地址;检索所述第一地址对应的第二映射单元的一个寄存器存储的第二地址;检索所述第二地址对应的第三映射单元的一个寄存器的存储的第三地址;接口单元将进入其一个通道的报文存入第三地址对应的缓冲器。The specific steps of the network packet processing method are as follows: the interface unit searches the address mapping unit to find the address of the buffer corresponding to the channel, and the interface unit retrieves a register stored in the first mapping unit corresponding to one channel. the first address; retrieve the second address stored in a register of the second mapping unit corresponding to the first address; retrieve the third address stored in a register of the third mapping unit corresponding to the second address; interface unit Store the message entering one of the channels into the buffer corresponding to the third address.
当一个缓冲器填充完成以后,第二映射单元的寄存器所存储的第二地址会根据第三映射单元中定义的下一个缓冲器的地址而改变,以指向存储所述下一个缓冲器地址的第三映射单元的寄存器。After a buffer is filled, the second address stored in the register of the second mapping unit will be changed according to the address of the next buffer defined in the third mapping unit, so as to point to the first address storing the address of the next buffer. Three mapping unit registers.
本发明的有益效果在于:由于采用三段地址映射机制,进入网络处理装置的报文能灵活的到达网络处理单元的任意存储空间,解决了网络处理单元中,接口数据管理难,以及微引擎难获取待处理报文和获取报文开销大的普遍难题,从而提高报文的转发和处理性能,并使报文处理微引擎软件更容易实现。The beneficial effect of the present invention is that: due to the adoption of the three-segment address mapping mechanism, the message entering the network processing device can flexibly reach any storage space of the network processing unit, which solves the problem of interface data management and micro-engine difficulty in the network processing unit. Obtaining pending messages and acquiring messages is a common problem with high overhead, thereby improving the performance of message forwarding and processing, and making the message processing micro-engine software easier to implement.
附图说明 Description of drawings
图1为现有技术的网络处理单元的结构示意图;FIG. 1 is a schematic structural diagram of a network processing unit in the prior art;
图2为本发明三段地址映射的寄存器图;Fig. 2 is the register diagram of three-section address mapping of the present invention;
图3为本发明三段地址映射的实施例1的寄存器图;Fig. 3 is the register diagram of
图4为本发明三段地址映射的实施例2的寄存器图;Fig. 4 is the register diagram of
图5为本发明三段地址映射的实施例3的寄存器图;Fig. 5 is the register diagram of
图6为本发明网络处理装置的结构示意图;FIG. 6 is a schematic structural diagram of a network processing device of the present invention;
图7为本发明网络处理方法的流程图;Fig. 7 is a flowchart of the network processing method of the present invention;
图8为本发明网络处理方法具体实施方式的流程图。FIG. 8 is a flow chart of a specific embodiment of the network processing method of the present invention.
具体实施方式 Detailed ways
下面结合附图说明本发明的具体实施方式。本发明主要应用于网络处理单元的硬件设计中,本发明定义网络处理单元包含如下几个单元:微引擎单元(或存储单元)、接口单元以及寄存器单元。The specific implementation manner of the present invention will be described below in conjunction with the accompanying drawings. The present invention is mainly applied in the hardware design of the network processing unit, and the present invention defines that the network processing unit includes the following units: micro-engine unit (or storage unit), interface unit and register unit.
微引擎单元是网络处理单元的核心,完成报文分析和转发。网络处理单元的微引擎单元可以拥有多个微引擎并行处理。The micro-engine unit is the core of the network processing unit, which completes packet analysis and forwarding. The micro-engine unit of the network processing unit may have multiple micro-engines for parallel processing.
存储单元是网络处理单元内部存储设备,如SRAM等,报文或表项等存储的位置。The storage unit is an internal storage device of the network processing unit, such as an SRAM, where messages or entries are stored.
接口单元是网络处理单元的对外数据接口,报文有入接口进入,再由出接口转发。The interface unit is the external data interface of the network processing unit. Messages enter through the incoming interface and are forwarded by the outgoing interface.
寄存器单元完成网络处理单元的分段地址映射。The register unit completes segment address mapping of the network processing unit.
在所述寄存器单元中定义三组寄存器单元,即:第一段映射单元(MAPStage1)、第二段映射单元(MAP Stage2)和第三段映射单元(MAP Stage3),如图2所示。第一段映射单元,由多个寄存器组成,且所述寄存器的个数与所述通道的个数相等;第二段映射单元,由至少一个寄存器组成;第三段映射单元,由多个寄存器组成,且所述寄存器的个数与所述通道的个数相关联;缓冲单元,由多个缓冲器组成,且所述缓冲器的个数与所述第三段映射单元中寄存器的个数相对应,所述的缓冲器与一微引擎相对应或是指微引擎内部的缓冲器。Three groups of register units are defined in the register unit, namely: the first mapping unit (MAPStage1), the second mapping unit (MAP Stage2) and the third mapping unit (MAP Stage3), as shown in Figure 2. The first mapping unit is composed of multiple registers, and the number of registers is equal to the number of channels; the second mapping unit is composed of at least one register; the third mapping unit is composed of multiple registers Composed, and the number of the registers is associated with the number of the channels; the buffer unit is composed of a plurality of buffers, and the number of the buffers is related to the number of registers in the third segment mapping unit Correspondingly, the buffer corresponds to a microengine or refers to the buffer inside the microengine.
第一段映射单元寄存器组寄存器个数和接口单元中通道个数相同,分别定义接口单元中通道是否有效,如果通道对应的寄存器值指向的是第二段映射单元寄存器组中有效寄存器,则表明接口单元中该通道有效,否则表明该通道无效。The number of registers in the first segment of the mapping unit register group is the same as the number of channels in the interface unit, which respectively define whether the channels in the interface unit are valid. If the register value corresponding to the channel points to the valid register in the second segment of the mapping unit register group, it indicates The channel in the interface unit is valid, otherwise it indicates that the channel is invalid.
第二段映射单元寄存器组中的寄存器值则又是指向第三段映射单元寄存器组中特定寄存器。是三段地址映射中唯一可变化的,通过它的不停变化,从而使它指向的第三段映射单元地址也是不停变化的,也就是说第一段映射单元寄存器组中定义的有效通道报文能够灵活的到达不同的缓冲器(MAP Stage3地址定义)中。The register value in the register group of the second mapping unit points to a specific register in the register group of the third mapping unit. It is the only variable in the three-segment address mapping. Through its continuous change, the address of the third-segment mapping unit it points to is also constantly changing, that is to say, the effective channel defined in the first-segment mapping unit register group Messages can flexibly arrive at different buffers (MAP Stage3 address definition).
第三段映射单元寄存器组实际是由一一对应的两组寄存器组成,一组寄存器定义内存地址(buffer地址),一组寄存器定义buffer大小和下一个buffer的位置。当一个buffer填充完成(满)以后,第二段映射单元寄存器组对应的寄存器值会根据第三段映射单元中定义的下一个buffer位置而改变寄存器值,这个第二段映射单元寄存器又指向了一个新的第三段映射单元寄存器。后续报文依次类推。The third segment of the mapping unit register group is actually composed of two sets of registers corresponding to each other. A set of registers defines the memory address (buffer address), and a set of registers defines the size of the buffer and the location of the next buffer. When a buffer is filled (full), the register value corresponding to the second mapping unit register group will change the register value according to the next buffer position defined in the third mapping unit, and the second mapping unit register points to A new third-segment mapping unit register. Subsequent messages are deduced in turn.
实施例1:Example 1:
各阶段地址映射设置如示意图3所示,其结构示意图如图6所示,其中的网络处理装置100包括:接口单元101、微引擎单元103,所述接口单元包括多个通道,用于报文的接收和转发;所述微引擎单元包括多个微引擎,其特征在于,所述装置还包括:地址映射单元102,其由多个寄存器分段组成,用于分段的地址映射;其中,所述通道中的报文根据所述地址映射单元分段的地址映射被填充到所述微引擎的缓存中。其具体映射关系为:Address mapping settings at each stage are shown in schematic diagram 3, and its structural schematic diagram is shown in Figure 6, wherein the
MAP Stage1的n个通道地址都设置指向MAP Stage2地址0,说明接口单元的n个通道有效,都有可能有报文到达。MAP Stage2的0地址中设置了指向MAP Stage3的0地址。由于MAP Stage1的n个通道地址都设置了0,说明n个通道都有报文进入,n个通道以Round-Robin方式轮询,MAP Stage1地址0(即通道1)指向MAP Stage2地址0,MAP Stage2地址0也是指向MAP Stage3的地址0,所以通道1的报文填充MAP Stage3地址0(MAP Stage2地址所指向的MAPStage3地址)所指的Buffer1地址,填满以后,可根据MAP Stage3第二组寄存器设置的步长来修改MAP Stage2地址,如果需要填充下一个MAP Stage3地址所指的Buffer2,则可设置步长为1,MAP Stage2地址0则会被修改成1(0+1),于是通道2(MAP Stage1通道的轮询)的报文到达时(MAP Stage1地址设置通道2也是指向MAP Stage2地址0),则根据MAP Stage2地址0的值(=1),取到MAP Stage3地址1(MAP Stage2地址所指向MAP Stage3地址)中的Buffer2,从而去填充Buffer2,然后MAP Stage2地址又变成2(1+1),以此类推,一直到最后一个buffer,MAP Stage2地址又变回0,从而完成一个循环,如此无限循环下去,各个通道的报文被灵活的分发到任意Buffer中(SRAM或报文处理微引擎等)。The n channel addresses of MAP Stage1 are all set to point to
如图7所示,为本发明网络报文处理方法的工作流程,其中:采用接口中的通道接受报文的进入;使所述的通道通过分段地址映射与微引擎的缓存建立通信联接,并将通道中的报文填充到所述微引擎的缓存中。As shown in Figure 7, it is the workflow of the network message processing method of the present invention, wherein: adopt the passage in the interface to accept the entry of the message; make the passage establish a communication connection with the cache memory of the micro-engine through segment address mapping, And fill the messages in the channel into the cache of the microengine.
本发明网络报文处理方法的具体工作流程为(如图8所示):如图3所示的映射关系,网络处理装置的接口单元去访问其通道1对应的第一段映射单元中的一个寄存器,即:并获得存储于该寄存器中的第一地址0;接口单元去访问所述第一地址对应的第二段映射单元的一个寄存器,并获得存储于该寄存器中的第二地址0;接口单元去访问所述第二地址对应的第三段映射单元的一个寄存器,并获得存储于该寄存器中的第三地址(即Buffer1的地址);从而使所述的接口单元将进入其所述通道的报文存入第三地址对应的缓冲器Buffer1中。The specific workflow of the network message processing method of the present invention is (as shown in Figure 8): the mapping relationship shown in Figure 3, the interface unit of the network processing device accesses one of the first mapping units corresponding to its
Buffer1填满以后,可根据MAP Stage3第二组寄存器设置的步长来修改MAP Stage2地址,如果需要填充下一个MAP Stage3地址所指的Buffer2,则可设置步长为1,MAP Stage2地址0则会被修改成1(0+1),于是通道2(MAP Stage1通道的轮询)的报文到达时(MAP Stage1地址设置通道2也是指向MAP Stage2地址0),则根据MAP Stage2地址0的值(=1),取到MAP Stage3地址1(MAP Stage2地址所指向MAP Stage3地址)中的Buffer2,从而去填充Buffer2,然后MAP Stage2地址又变成2(1+1),以此类推,一直到最后一个buffer,MAP Stage2地址又变回0,从而完成一个循环,如此无限循环下去,各个通道的报文被灵活的分发到任意Buffer中(SRAM或报文处理微引擎等)。After Buffer1 is full, the MAP Stage2 address can be modified according to the step size set by the second set of registers of MAP Stage3. If the Buffer2 pointed to by the next MAP Stage3 address needs to be filled, the step size can be set to 1, and the
实施例2:Example 2:
各阶段地址映射设置如示意图4所示,其结构示意图如图6所示,其中的网络处理装置100包括:接口单元101、微引擎单元103,所述接口单元包括多个通道,用于报文的接收和转发;所述微引擎单元包括多个微引擎,其特征在于,所述装置还包括:地址映射单元102,其由多个寄存器分段组成,用于分段的地址映射;其中,所述通道中的报文根据所述地址映射单元分段的地址映射被填充到所述微引擎的缓存中。其具体映射关系为:The address mapping settings at each stage are shown in schematic diagram 4, and its structural schematic diagram is shown in Figure 6, wherein the
MAP Stage1地址n个通道都设置了指向MAP Stage2地址的值,MAP Stage1地址的n个通道都有效。通道1设置的值为0,指向MAP Stage2地址0,MAP Stage2地址0设置的指向MAP Stage3地址的值也为0,通道1到达的报文将填充MAPStage3地址0中的buffer1。同样的,通道2报文也将填充MAP Stage3地址1中的buffer2,通道n报文将通充MAP Stage3地址n中的buffer n,于是各个通道被设置成了独立的到达各个不同的buffer中,此种情况下,MAP Stage2地址可以不变(变化步长设置为0),通道0的报文始终填充buffer1,通道n的报文始终填充buffer n。The n channels of the MAP Stage1 address are all set to point to the value of the MAP Stage2 address, and the n channels of the MAP Stage1 address are all valid. The value set by
如图7所示,为本发明网络报文处理方法的工作流程,其中:采用接口中的通道接受报文的进入;使所述的通道通过分段地址映射与微引擎的缓存建立通信联接,并将通道中的报文填充到所述微引擎的缓存中。本发明网络报文处理方法的具体工作流程为:如图4所示的映射关系,网络处理装置的接口单元去访问其通道1对应的第一段映射单元中的一个寄存器,获得存储于该寄存器中的第一地址0;接口单元去访问所述第一地址对应的第二段映射单元的一个寄存器,并获得存储于该寄存器中的第二地址0;接口单元去访问所述第二地址对应的第三段映射单元的一个寄存器,并获得存储于该寄存器中的第三地址(即Buffer1的地址);从而使所述的接口单元将进入其所述通道1的报文存入第三地址对应的缓冲器Buffer1中。As shown in Figure 7, it is the workflow of the network message processing method of the present invention, wherein: adopt the passage in the interface to accept the entry of the message; make the passage establish a communication connection with the cache memory of the micro-engine through segment address mapping, And fill the messages in the channel into the cache of the microengine. The specific workflow of the network message processing method of the present invention is: the mapping relationship shown in Figure 4, the interface unit of the network processing device accesses a register in the first section of the mapping unit corresponding to its
接口单元去访问其通道2对应的第一段映射单元中的一个寄存器,获得存储于该寄存器中的第一地址1;接口单元去访问所述第一地址对应的第二段映射单元的一个寄存器,并获得存储于该寄存器中的第二地址1;接口单元去访问所述第二地址对应的第三段映射单元的一个寄存器,并获得存储于该寄存器中的第三地址(即Buffer2的地址);从而使所述的接口单元将进入其所述通道2的报文存入第三地址对应的缓冲器Buffer2中。The interface unit accesses a register in the first segment of the mapping unit corresponding to
重复上述步骤,直到接口单元去访问其通道n对应的第一段映射单元中的一个寄存器,获得存储于该寄存器中的第一地址n;接口单元去访问所述第一地址对应的第二段映射单元的一个寄存器,并获得存储于该寄存器中的第二地址n;接口单元去访问所述第二地址对应的第三段映射单元的一个寄存器,并获得存储于该寄存器中的第三地址(即Buffern的地址);从而使所述的接口单元将进入其所述通道n的报文存入第三地址对应的缓冲器Buffern中。Repeat the above steps until the interface unit accesses a register in the first segment mapping unit corresponding to its channel n, and obtains the first address n stored in the register; the interface unit accesses the second segment corresponding to the first address A register of the mapping unit, and obtain the second address n stored in the register; the interface unit accesses a register of the third segment mapping unit corresponding to the second address, and obtain the third address stored in the register (that is, the address of Buffern); so that the interface unit stores the message entering the channel n into the buffer Buffern corresponding to the third address.
实施例3:Example 3:
各阶段地址映射设置如示意图5所示,其结构示意图如图6所示,其中的网络处理装置100包括:接口单元101、微引擎单元103,所述接口单元包括多个通道,用于报文的接收和转发;所述微引擎单元包括多个微引擎,其特征在于,所述装置还包括:地址映射单元102,其由多个寄存器分段组成,用于分段的地址映射;其中,所述通道中的报文根据所述地址映射单元分段的地址映射被填充到所述微引擎的缓存中。其具体映射关系为:The address mapping settings at each stage are shown in schematic diagram 5, and its structural schematic diagram is shown in Figure 6, wherein the
MAP Stage1的2个通道地址设置指向MAP Stage2地址0,MAP Stage1的另2个通道地址分别设置指向MAP Stage2地址3、地址4,MAP Stage1的剩余n个通道地址均设置指向MAP Stage2地址m,说明接口单元的各个通道有效,都有可能有报文到达。MAP Stage2的0地址中设置了指向MAP Stage3的0地址。由于MAP Stage1的2个通道地址都设置了0,说明该2个通道都有报文进入,该2个通道以Round-Robin方式轮询,MAP Stage1地址0(即通道1)指向MAP Stage2地址0,MAP Stage2地址0也是指向MAP Stage3的地址0,所以通道1的报文填充MAP Stage3地址0(MAP Stage2地址所指向的MAP Stage3地址)所指的Buffer1地址,填满以后,可根据MAP Stage3第二组寄存器设置的步长来修改MAP Stage2地址,如果需要填充下一个MAP Stage3地址所指的Buffer2,则可设置步长为1,MAP Stage2地址0则会被修改成1(0+1),于是通道2(MAPStage1通道的轮询)的报文到达时(MAP Stage1地址设置通道2也是指向MAPStage2地址0),则根据MAP Stage2地址0的值(=1),取到MAP Stage3地址1(MAP Stage2地址所指向MAP Stage3地址)中的Buffer2,从而去填充Buffer2。The two channel addresses of MAP Stage1 are set to point to
MAP Stage1地址1的通道设置了指向MAP Stage2地址3,MAP Stage1地址的该通道有效。MAP Stage2地址3设置的指向MAP Stage3地址的值为3,该通道到达的报文将填充MAP Stage3地址3中的buffer3。The channel of
MAP Stage1地址3的通道设置了指向MAP Stage2地址4,MAP Stage1地址的该通道有效。MAP Stage2地址3设置的指向MAP Stage3地址的值为4,该通道到达的报文将填充MAP Stage3地址4中的buffer4。The channel of
MAP Stage1的剩余n个通道地址均设置指向MAP Stage2地址m,MAP Stage2的m地址中设置了指向MAP Stage3的n地址。由于MAP Stage1的n个通道地址都设置了m,说明该n个通道都有报文进入,该n个通道以Round-Robin方式轮询,MAP Stage1地址n指向MAP Stage2地址m,MAP Stage2地址m也是指向MAP Stage3的地址n,所以通道n1的报文填充MAP Stage3地址n(MAP Stage2地址所指向的MAP Stage3地址)所指的Buffern1地址,填满以后,可根据MAP Stage3第二组寄存器设置的步长来修改MAP Stage2地址,如果需要填充下一个MAP Stage3地址所指的Buffern2,则可设置步长为1,MAP Stage2地址m则会被修改成m+1,于是通道n2(MAP Stage1通道的轮询)的报文到达时(MAP Stage1地址设置通道n2也是指向MAP Stage2地址m,则根据MAP Stage2地址m的值,取到MAP Stage3地址n(MAP Stage2地址所指向MAP Stage3地址)中的Buffern2,从而去填充Buffern2。然后MAP Stage2地址又变成m+2,以此类推,一直到最后一个buffer,MAP Stage2地址又变回m,从而完成一个循环,如此无限循环下去,各个通道的报文被灵活的分发到任意Buffer中(SRAM或报文处理微引擎等)。The remaining n channel addresses of MAP Stage1 are all set to point to the address m of MAP Stage2, and the m address of MAP Stage2 is set to point to the n address of MAP Stage3. Since the n channel addresses of MAP Stage1 are all set to m, it means that the n channels have packets to enter, and the n channels are polled in Round-Robin mode, MAP Stage1 address n points to MAP Stage2 address m, and MAP Stage2 address m It also points to the address n of MAP Stage3, so the message of channel n1 fills the Buffern1 address pointed to by MAP Stage3 address n (the MAP Stage3 address pointed to by the MAP Stage2 address). After filling, it can be set according to the second set of registers of MAP Stage3 Step size is used to modify the MAP Stage2 address. If the Buffern2 pointed to by the next MAP Stage3 address needs to be filled, the step size can be set to 1, and the MAP Stage2 address m will be changed to m+1, so channel n2 (of MAP Stage1 channel Polling) message arrives (MAP Stage1 address setting channel n2 also points to MAP Stage2 address m, then according to the value of MAP Stage2 address m, get Buffer2 in MAP Stage3 address n (MAP Stage2 address points to MAP Stage3 address) , so as to fill Buffer2. Then the address of MAP Stage2 becomes m+2, and so on, until the last buffer, the address of MAP Stage2 changes back to m, thus completing a cycle, and so on indefinitely, the messages of each channel It is flexibly distributed to any Buffer (SRAM or message processing microengine, etc.).
如图7所示,为本发明网络报文处理方法的工作流程,其中:采用接口中的通道接受报文的进入;使所述的通道通过分段地址映射与微引擎的缓存建立通信联接,并将通道中的报文填充到所述微引擎的缓存中。本发明网络报文处理方法的具体工作流程如图5所示的映射关系,其中的网络报文处理方法如上述实施例1和实施例2中网络报文处理方法的结合。As shown in Figure 7, it is the workflow of the network message processing method of the present invention, wherein: adopt the passage in the interface to accept the entry of the message; make the passage establish a communication connection with the cache memory of the micro-engine through segment address mapping, And fill the messages in the channel into the cache of the microengine. The specific workflow of the network packet processing method of the present invention is shown in the mapping relationship shown in FIG. 5 , wherein the network packet processing method is a combination of the network packet processing methods in the above-mentioned
以上是三个实施例,根据前面的说明,还可以组出更多的更灵活的配置方法,从而使不同通道的报文到达不同的地址中(微引擎单元或存储单元),方便报文处理微引擎的处理。The above are the three embodiments. According to the previous description, more flexible configuration methods can be formed, so that the messages of different channels can reach different addresses (micro-engine unit or storage unit), which is convenient for message processing. Microengine processing.
本发明技术方案带来的有益效果为:本发明解决了网络处理单元中,接口数据管理难以及微引擎难获取待处理报文和获取报文开销大的普遍难题,从而使报文处理微引擎软件更容易实现,并提高报文转发性能。The beneficial effects brought by the technical solution of the present invention are as follows: the present invention solves the common problems that in the network processing unit, the interface data management is difficult and the micro-engine is difficult to obtain the message to be processed and the cost of obtaining the message is large, so that the message processing micro-engine Software is easier to implement and improves packet forwarding performance.
以上具体实施方式仅用于说明本发明,而非用于限定本发明。The above specific embodiments are only used to illustrate the present invention, but not to limit the present invention.
Claims (13)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2006100027851A CN100454899C (en) | 2006-01-25 | 2006-01-25 | A network processing device and method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2006100027851A CN100454899C (en) | 2006-01-25 | 2006-01-25 | A network processing device and method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1845529A CN1845529A (en) | 2006-10-11 |
| CN100454899C true CN100454899C (en) | 2009-01-21 |
Family
ID=37064444
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNB2006100027851A Expired - Lifetime CN100454899C (en) | 2006-01-25 | 2006-01-25 | A network processing device and method |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN100454899C (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101789869A (en) * | 2009-01-23 | 2010-07-28 | 华为技术有限公司 | Processing method and devices of protocol independent multicast service |
| CN102855213B (en) * | 2012-07-06 | 2017-10-27 | 中兴通讯股份有限公司 | A kind of instruction storage method of network processing unit instruction storage device and the device |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5379393A (en) * | 1992-05-14 | 1995-01-03 | The Board Of Governors For Higher Education, State Of Rhode Island And Providence Plantations | Cache memory system for vector processing |
| US6243762B1 (en) * | 1994-08-08 | 2001-06-05 | Mercury Computer Systems, Inc. | Methods and apparatus for data access and program generation on a multiprocessing computer |
| US20030105901A1 (en) * | 1999-12-22 | 2003-06-05 | Intel Corporation, A California Corporation | Parallel multi-threaded processing |
| CN1577310A (en) * | 2003-06-27 | 2005-02-09 | 株式会社东芝 | Information processing system including processors and memory managing method used in the same system |
| US20050198090A1 (en) * | 2004-03-02 | 2005-09-08 | Altek Corporation | Shift register engine |
-
2006
- 2006-01-25 CN CNB2006100027851A patent/CN100454899C/en not_active Expired - Lifetime
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5379393A (en) * | 1992-05-14 | 1995-01-03 | The Board Of Governors For Higher Education, State Of Rhode Island And Providence Plantations | Cache memory system for vector processing |
| US6243762B1 (en) * | 1994-08-08 | 2001-06-05 | Mercury Computer Systems, Inc. | Methods and apparatus for data access and program generation on a multiprocessing computer |
| US20030105901A1 (en) * | 1999-12-22 | 2003-06-05 | Intel Corporation, A California Corporation | Parallel multi-threaded processing |
| CN1577310A (en) * | 2003-06-27 | 2005-02-09 | 株式会社东芝 | Information processing system including processors and memory managing method used in the same system |
| US20050198090A1 (en) * | 2004-03-02 | 2005-09-08 | Altek Corporation | Shift register engine |
Non-Patent Citations (4)
| Title |
|---|
| IXP1200网络处理器多层次并行机制研究. 刘钰,赵荣彩,张铮,芦阳.微机发展,第14卷第6期. 2004 |
| IXP1200网络处理器多层次并行机制研究. 刘钰,赵荣彩,张铮,芦阳.微机发展,第14卷第6期. 2004 * |
| IXP2400网络处理器及其微引擎中多线程实现的研究. 吴闻,李雪莹,许榕生,刘秉瀚.计算机工程与应用,第9期. 2004 |
| IXP2400网络处理器及其微引擎中多线程实现的研究. 吴闻,李雪莹,许榕生,刘秉瀚.计算机工程与应用,第9期. 2004 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN1845529A (en) | 2006-10-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11620255B2 (en) | Time sensitive networking device | |
| US9251272B2 (en) | Reconfigurable hardware structures for functional pipelining of on-chip special purpose functions | |
| JP6535253B2 (en) | Method and apparatus for utilizing multiple linked memory lists | |
| CN106612236B (en) | Many-core network processor and message scheduling method and system of micro-engine thereof | |
| CN112084136A (en) | Queue cache management method, system, storage medium, computer equipment and application | |
| CN101986271B (en) | Method and device for dispatching TCAM (telecommunication access method) query and refresh messages | |
| CN101488922A (en) | Network-on-chip router having adaptive routing capability and implementing method thereof | |
| CN104394096A (en) | Multi-core processor based message processing method and multi-core processor | |
| JP6340481B2 (en) | Data caching method, apparatus and storage medium | |
| CN101655821A (en) | Method and apparatus for settling Hash address conflict when mapping address space | |
| CN100354853C (en) | Inter-chip processor control plane communication | |
| CN106411778A (en) | Data forwarding method and device | |
| CN100454899C (en) | A network processing device and method | |
| CN104052831A (en) | Data transmission method and device based on queues and communication system | |
| CN114338529B (en) | Five-tuple rule matching method and device | |
| US9996468B1 (en) | Scalable dynamic memory management in a network device | |
| Li et al. | Accelerate NDN name lookup using FPGA: Challenges and a scalable approach | |
| US6684300B1 (en) | Extended double word accesses | |
| CN104852866B (en) | An output arbitration control method and device | |
| WO2016065779A1 (en) | Queue scheduling method and device | |
| JP2020088517A (en) | Communication apparatus, and control method and program of communication apparatus | |
| CN110661731B (en) | Message processing method and device | |
| CN114969445A (en) | Method, system, storage medium and equipment for reading addresses of multi-channel multi-chain table | |
| CN1283077C (en) | Method for raising retransmission capability of network processor for servicing multiple data parts | |
| CN100446508C (en) | A device and method for realizing message forwarding |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20220118 Address after: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province Patentee after: xFusion Digital Technologies Co., Ltd. Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd. |
|
| TR01 | Transfer of patent right | ||
| CP03 | Change of name, title or address |
Address after: 450000 Henan Province, Zhengzhou City, Free Trade Zone Zhengzhou Area (Zhengdong), Inner Ring North Road of Longhu, No. 99 Patentee after: Super Fusion Digital Technology Co.,Ltd. Country or region after: China Address before: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province Patentee before: xFusion Digital Technologies Co., Ltd. Country or region before: China |
|
| CX01 | Expiry of patent term |
Granted publication date: 20090121 |
