WO2017020639A1 - 网络处理器、报文处理数据的获取方法和存储介质 - Google Patents

网络处理器、报文处理数据的获取方法和存储介质 Download PDF

Info

Publication number
WO2017020639A1
WO2017020639A1 PCT/CN2016/083529 CN2016083529W WO2017020639A1 WO 2017020639 A1 WO2017020639 A1 WO 2017020639A1 CN 2016083529 W CN2016083529 W CN 2016083529W WO 2017020639 A1 WO2017020639 A1 WO 2017020639A1
Authority
WO
WIPO (PCT)
Prior art keywords
instruction
network processor
data
preset
currently executed
Prior art date
Application number
PCT/CN2016/083529
Other languages
English (en)
French (fr)
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 WO2017020639A1 publication Critical patent/WO2017020639A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks

Definitions

  • the present invention relates to network data processing technologies, and in particular, to a network processor, a method for acquiring message processing data, and a storage medium.
  • the network processor is a processor specially used for network data processing. It is mainly used in network products such as switches and routers. It is mostly used to process messages in the network. It has high processing performance, programmable, flexible expansion, short development cycle, etc. Advantage. Due to its flexible programmable and scalable features, the probability of network processor failure and the difficulty of locating faults are greater than those of traditional Application Specific Integrated Circuits (ASICs).
  • the fault of the network processor includes not only the hardware failure of the chip, but also various faults such as the sequence of instructions written by the user, the configuration of the service entry, and the service coordination problem between the coprocessing units.
  • breakpoint debugging is the most frequently used technology.
  • the basic processing flow is: the upper layer software sets (or clears) the breakpoint in the program to be executed, and the program execution stops at the corresponding breakpoint, and Inform the host computer software to control the program for single step debugging or continue execution.
  • Breakpoint debugging needs to interrupt the normal business processing of the kernel and switch to receiving only a single packet for single-step debugging. Until the end of the debugging process, the kernel will resume normal service forwarding. As a result, business processes are disrupted.
  • the auxiliary data line is used to output the running data of the register in the thread execution unit to the recording unit during the fault diagnosis process of the network processor.
  • the auxiliary data line is designed to output the running data of the register in the thread execution unit to the recording unit during the fault diagnosis process of the network processor.
  • the embodiment of the present invention is to provide a network processor and a method for acquiring packet processing data, which can reduce the interruption of the business process and reduce the hardware resource overhead while acquiring the intermediate data generated by the network processor processing the message. And the complexity of the kernel logic.
  • an embodiment of the present invention provides a method for acquiring packet processing data, where the method includes:
  • the preset data output instruction is invoked when the service instruction currently executed by the network processor satisfies the preset trigger condition
  • the network processor outputs the intermediate data processed by the buffered message according to the data output instruction.
  • the currently executed instruction of the network processor satisfies a preset trigger condition, including:
  • the currently executed instruction of the network processor satisfies a preset trigger condition
  • the instruction currently executed by the network processor is a data acquisition trigger instruction
  • the instruction currently executed by the network processor satisfies a preset trigger condition.
  • the invoking a preset data output instruction includes:
  • the network processor obtains a data output instruction from a preset instruction storage space.
  • the network processor outputs the intermediate data processed by the buffered message according to the data output instruction, including:
  • the network processor acquires the intermediate data of the buffered message processing from the preset first storage unit according to the data output instruction;
  • the network processor outputs the intermediate data processed by the message to the second storage unit according to the data output instruction.
  • the buffered message is processed according to a preset data output instruction. After the data is output, the method further includes:
  • the network processor executes a next instruction of the currently executed instruction and determines whether the next instruction satisfies the preset trigger condition.
  • an embodiment of the present invention provides a network processor, where the network processor includes: an execution unit, a determining unit, a calling unit, and an output unit;
  • the execution unit is configured to execute a current service instruction and trigger the determining unit
  • the determining unit is configured to determine whether the service instruction currently executed by the execution unit satisfies a preset trigger condition; and when the currently executed service instruction satisfies a preset trigger condition, triggering the calling unit;
  • the calling unit is configured to invoke a preset data output instruction
  • the output unit is configured to output the intermediate data processed by the buffered message according to the data output instruction.
  • the determining unit is configured to:
  • the currently executed instruction is a data acquisition trigger instruction
  • the calling unit is configured to acquire a data output instruction from a preset instruction storage space.
  • the output unit includes an acquisition subunit and an output subunit
  • the obtaining subunit is configured to obtain, according to the data output instruction, intermediate data processed by the buffered message from the preset first storage unit;
  • the output subunit is configured to output the intermediate data processed by the message to the second storage unit according to the data output instruction.
  • the execution unit is further configured to execute the currently executed instruction The next instruction; and triggering the determining unit.
  • an embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, where the computer executable instructions are used to execute at least one of the foregoing methods for acquiring message processing data.
  • the computer storage medium stores computer executable instructions, where the computer executable instructions are used to execute at least one of the foregoing methods for acquiring message processing data.
  • the embodiment of the invention provides a network processor, a method for acquiring packet processing data, and a storage medium, which are used to trigger the process of acquiring the intermediate data of the packet processing, so that the network processor can process the message.
  • the intermediate data avoids the interruption of business processes and reduces the hardware resource overhead and the complexity of the kernel logic.
  • FIG. 1 is a schematic flowchart of a method for acquiring packet processing data according to an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of a method for acquiring packet processing data according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a network processor according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of another network processor according to an embodiment of the present invention.
  • FIG. 1 a flow of a method for acquiring packet processing data according to an embodiment of the present invention is shown.
  • the method is applied to a network processor, and may include:
  • S102 The media processor processes the intermediate number of the buffered message according to the data output instruction. According to the output.
  • the instruction that is currently executed by the network processor meets a preset trigger condition, and specifically includes:
  • the currently executed instruction of the network processor satisfies a preset trigger condition
  • the instruction currently executed by the network processor is a data acquisition trigger instruction
  • the instruction currently executed by the network processor satisfies a preset trigger condition.
  • the service instruction when the service instruction is encoded, a 1-bit data acquisition enable flag bit is designed for each service instruction.
  • the service instruction sequence may be sent by the upper computer control software external to the network processor.
  • the enable flag of the service instruction that needs to perform packet processing data acquisition is set to 1 to indicate that the packet processing data acquisition is enabled, or the enable flag is set to 0 to disable the packet processing data acquisition.
  • the core of the network processor executes a certain service instruction, it is determined whether the data acquisition enable flag corresponding to the service instruction is 1, and if 1, determines that the currently executed instruction satisfies a preset trigger condition, thereby enabling The subsequent process of acquiring the message processing data proposed by the embodiment of the present invention; if it is 0, executing the service instruction according to the normal mode.
  • the satisfying the preset triggering condition in the embodiment may include receiving a debugging notification for the program, for example, receiving a single step debugging or performing a breakpoint clearing debugging notification.
  • the data acquisition trigger instruction is inserted on some key nodes, and the preset condition is judged by the original condition judgment instruction of the kernel of the network processor, thereby executing the data acquisition trigger instruction.
  • the data source of the preset condition judgment may be based on the content of the message or the result returned based on the lookup table, so as to realize the output of the message processing data based on the characteristics of the message or the lookup result.
  • the two types of the triggering conditions described above may be used separately or in combination, so as to achieve the purpose of flexibly outputting the packet processing data, which is not specifically described in this embodiment.
  • calling a preset data output instruction may include: a network processor from a preset Obtaining a data output instruction in the instruction storage space;
  • the output of the message processing data is implemented by executing a specific data output instruction by the kernel.
  • the hardware can reuse the bus of the original processing write forwarding table of the network processing core, so that There is no need to change the original bus structure of the kernel or add additional control units to the kernel.
  • a sequence of data output instructions can be stored at a fixed location in the instruction memory space of the network processor core. When the preset trigger condition is met, the network processor core automatically jumps to the fixed location call and executes the data output instruction to output the message processing data, and then resumes execution after jumping back to the original service instruction after the output is completed.
  • the network processor outputs the intermediate data processed by the buffered message according to the data output instruction, including:
  • the network processor acquires the intermediate data of the buffered message processing from the preset first storage unit according to the data output instruction;
  • the network processor outputs the intermediate data processed by the message to the second storage unit according to the data output instruction.
  • the kernel sequentially processes the packet according to the service instruction sequence, and the network processor core completes by executing the service instruction. Perform arithmetic operations or logical judgments on the message, obtain forwarding information of the message, and edit the content of the message. Therefore, the kernel of the network processor may have a series of registers or other types of storage units in the network processor.
  • the intermediate data processed by the message is cached.
  • the intermediate data includes, but is not limited to, the kernel hardware state, the encoding of several recently executed instructions, the result of arithmetic or logic operations, the key values and results of the lookup table, and the edited Messages, etc.
  • the intermediate data is the key to analyzing the processing of the message in the network processor core. Therefore, for the intermediate data processed by the buffered message, the first storage unit may be used to cache the intermediate data processed by the message.
  • the storage space available to the network processor generally includes the internal storage space of the chip and the external storage space.
  • the storage space inside the chip is not affected by factors such as chip area and power consumption, and it is impossible to design too large.
  • the function of acquiring the packet processing data is only the debugging function attached to the network processor, and will not be turned on during most of the normal operation. Therefore, if the processing of the packet processing data is separately added to the chip of the network processor, a separate piece is added. Storage space is very uneconomical. Therefore, in the embodiment of the present invention, the message processing data storage space attribute keyword may be added in the data output instruction, so that the space start position and the capacity upper limit of the stored message processing data may be specified by using these keywords.
  • the service table items in the internal and external storage spaces of the network processor can be flexibly configured to configure the remaining unused fragment space to store the message processing data.
  • separate storage of a plurality of message processing data is realized by specifying an address offset in the data output instruction.
  • the method may further include:
  • the network processor executes the next instruction of the currently executing instruction and determines if the next instruction satisfies the preset trigger condition. It can be understood that when it is determined that the next instruction satisfies the preset trigger condition, the acquisition of the message processing data may be continued according to the above process, and if not, the execution of the service instruction is performed according to the normal mode.
  • the embodiment provides a method for acquiring packet processing data, which triggers the process of acquiring the intermediate data of the packet processing by using the service instruction, thereby avoiding the acquisition of the intermediate data generated by the network processor when processing the packet.
  • Business process interruptions reduce the complexity of hardware resources and the complexity of the kernel logic.
  • the method is applied to a network processor, and may include:
  • the network processor loads the service instruction sequence to the network processing through the host computer control software Instruction storage unit of the kernel;
  • the network processor core takes the service instruction from the instruction storage unit and executes it;
  • the execution of the service instruction sequence by the network processor core is triggered by the message.
  • the network processor core receives the message, it starts to invoke the service instruction from a certain position of the instruction sequence of the instruction storage unit and starts executing. ;
  • S203 The network processor determines whether the corresponding data acquisition enable indication of the service instruction is true; if true, executes S205; if not, executes S204.
  • steps S203 and S204 are the determining process of whether the currently executed service command satisfies the preset trigger condition, but the current executed service command satisfies the preset trigger condition. The determination is made in S204, which is not described in detail in the embodiment of the present invention.
  • the data output instruction can be stored in a fixed position of the instruction storage unit; the network processor core will fixedly jump to the fixed position to execute the instruction to output the intermediate data of the message processing, and the network processor core before the jump The address of the next business instruction is saved, so that it can be returned to the original business instruction sequence after the execution of the data output instruction.
  • the network processor outputs the corresponding message processing data to a specified location in the storage space according to a keyword in the data output instruction.
  • the data output instruction may include three types of keywords: a message processing data type keyword, a message processing data storage space attribute keyword, and a storage offset of the message processing data; wherein, the message processing data type keyword is used.
  • the type of the output data is selected; the message processing data storage space attribute keyword is used to specify the location and capacity upper limit of the packet processing data storage, and the network can be selected.
  • the storage unit inside the network processor may also use an external storage unit; the storage offset of the packet processing data is used to indicate the relative offset address of the current packet processing data in the entire packet processing data storage space to implement multiple packets. Process circular storage of data without overwriting each other.
  • these data output instructions stored in a fixed position of the kernel instruction storage unit can be dynamically modified during the operation of the network processor, that is, the network output can be dynamically modified by reloading the data output instruction during operation of the network processor.
  • the execution to this step indicates that the service instruction currently executed by the network processor core is an ordinary service processing instruction. Therefore, the network processor only needs to execute the instruction normally in the normal mode.
  • S208 determining whether the service instruction sequence is over; if it is over, then going to S209; if not, then going to S202;
  • the data acquisition enable indication is set to close the message processing data acquisition or the execution data acquisition trigger instruction is skipped by modifying the configuration.
  • the fault of the network processor core can be diagnosed on the basis of analyzing the packet processing data.
  • the embodiment provides a detailed process of the method for acquiring packet processing data, which triggers the process of acquiring the intermediate data of the packet processing by using the service instruction, so that when the intermediate data generated by the network processor is processed, the intermediate data generated by the network processor can be obtained. It avoids the interruption of business processes and reduces the complexity of hardware resources and the complexity of kernel logic.
  • a structure of a network processor 30 is shown, which may include: an execution unit 301, a determining unit 302, a calling unit 303, and an output unit 304;
  • the executing unit 301 is configured to execute the current service instruction, and triggers the determining unit 302;
  • the determining unit 302 is configured to determine whether the service instruction currently executed by the execution unit 301 satisfies a preset trigger condition; and when the currently executed service instruction satisfies the preset trigger condition, the invoking unit 303 is triggered;
  • the calling unit 303 is configured to invoke a preset data output instruction
  • the output unit 304 is configured to output the intermediate data processed by the buffered message according to the data output instruction.
  • the execution unit 301, the determining unit 302, the calling unit 303, and the output unit 304 may correspond to a processing circuit or a processing chip of the network processor.
  • One or more of the execution unit 301, the determining unit 302, the calling unit 303, and the output unit 304 may correspond to the same processing circuit or processing chip, or may correspond to different processors or processing chips.
  • the processing circuit or the processing chip can perform functions of different units by time division multiplexing or concurrent threads.
  • the determining unit 302 is configured to:
  • the currently executed instruction is a data acquisition trigger instruction
  • the invoking unit 303 is configured to obtain a data output instruction from a preset instruction storage space.
  • the output unit 304 may include an acquisition subunit 3041 and an output subunit 3042;
  • the obtaining subunit 3041 is configured to obtain the intermediate data of the buffered message processing from the preset first storage unit according to the data output instruction.
  • the output subunit 3042 is configured to input the intermediate data processed by the message according to the data output instruction. Exit to the second storage unit.
  • the execution unit 301 is further configured to execute a next instruction of the currently executed instruction; and triggers the determination unit 302.
  • the embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used for at least one of the foregoing methods for acquiring message processing data, for example, performing The method shown in Figure 1 and / or Figure 2.
  • the computer storage medium may include a storage medium such as an optical disk or a magnetic disk, and may be a non-transitory storage medium.
  • the preset data output instruction is invoked, and the intermediate data is taken out from the cached message, so that the auxiliary thread can be used to store the data to a dedicated In the recording unit, the current processing business flow of the network processor is not interrupted, thus reducing the interruption of the business process processing in the fault diagnosis process, and avoiding the introduction of the auxiliary processing thread, thereby reducing the softness consumed by the auxiliary processing thread.
  • Hardware resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

本发明实施例公开了一种网络处理器及报文处理数据的获取方法,该方法可以包括:网络处理器当前执行的业务指令满足预设的触发条件时,调用预设的数据输出指令;网络处理器根据所述数据输出指令将缓存的报文处理的中间数据进行输出。本发明实施例还公开了一种计算机存储介质。

Description

网络处理器、报文处理数据的获取方法和存储介质 技术领域
本发明涉及网络数据处理技术,尤其涉及一种网络处理器、报文处理数据的获取方法和存储介质。
背景技术
网络处理器是专门用于网络数据处理的处理器,主要应用于交换机,路由器等网络产品,多用于处理网络中的报文;它具有高处理性能、可编程、可灵活扩展、开发周期短等优势。正是由于其灵活的可编程及可扩展特性,导致网络处理器发生故障的概率以及对故障进行定位的难度要比传统的专用集成电路(ASIC,Application Specific Integrated Circuit)大。网络处理器的故障不仅包括芯片硬件故障,还包括用户编写的指令序列、业务表项配置、协处理单元之间业务配合问题等多种故障。
通常在故障调试中,断点调试是使用最频繁的技术,其基本处理流程是:由上层软件在待执行的程序中设置(或清除)断点,程序执行到对应断点处停止执行,并通知上位机软件来控制程序进行单步调试或继续执行等。断点调试需要中断内核正常的业务处理而转为只接收单个报文进行单步调试,直到断点调试过程结束内核才会恢复正常的业务转发。因此,会造成业务流程的中断。
目前为了避免业务流程的中断,在网络处理器的故障诊断过程中采用辅助数据线将线程执行单元中寄存器的运行数据输出至记录单元。这种方式尽管无需进行业务流程的中断,但是需要为网络处理器内核的每个线程设计一个辅助数据线,增加了网络处理器硬件资源开销及内核逻辑的复杂度。
发明内容
本发明实施例期望提供一种网络处理器及报文处理数据的获取方法,能够在获取网络处理器处理报文所产生的中间数据时,能够减少业务流程的中断的同时以减少了硬件资源开销及内核逻辑的复杂度。
第一方面,本发明实施例提供了一种报文处理数据的获取方法,所述方法包括:
网络处理器当前执行的业务指令满足预设的触发条件时,调用预设的数据输出指令;
所述网络处理器根据所述数据输出指令将缓存的报文处理的中间数据进行输出。
在上述方案中,所述网络处理器当前执行的指令满足预设的触发条件,包括:
所述网络处理器当前执行的指令对应的数据获取使能指示为真时,所述网络处理器当前执行的指令满足预设的触发条件;和/或,
所述网络处理器当前执行的指令为数据获取触发指令时,所述网络处理器当前执行的指令满足预设的触发条件。
在上述方案中,所述调用预设的数据输出指令,包括:
所述网络处理器从预设的指令存储空间中获取数据输出指令。
在上述方案中,所述网络处理器根据所述数据输出指令将缓存的报文处理的中间数据进行输出,包括:
所述网络处理器根据所述数据输出指令从预设的第一存储单元中获取缓存的报文处理的中间数据;
所述网络处理器根据所述数据输出指令将报文处理的中间数据输出至第二存储单元。
在上述方案中,所述根据预设的数据输出指令将缓存的报文处理的中 间数据进行输出之后,所述方法还包括:
所述网络处理器执行所述当前执行的指令的下一条指令,并且确定所述下一条指令是否满足所述预设的触发条件。
第二方面,本发明实施例提供了一种网络处理器,所述网络处理器包括:执行单元、确定单元、调用单元、输出单元;其中,
所述执行单元,配置为执行当前的业务指令,并触发所述确定单元;
所述确定单元,配置为确定所述执行单元当前执行的业务指令是否满足预设的触发条件;以及,当前执行的业务指令满足预设的触发条件时,触发所述调用单元;
所述调用单元,配置为调用预设的数据输出指令;
所述输出单元,配置为根据所述数据输出指令将缓存的报文处理的中间数据进行输出。
在上述方案中,所述确定单元,配置为:
当前执行的指令对应的数据获取使能指示为真时,确定当前执行的指令满足预设的触发条件;和/或,
当前执行的指令为数据获取触发指令时,确定当前执行的指令满足预设的触发条件。
在上述方案中,所述调用单元,配置为从预设的指令存储空间中获取数据输出指令。
在上述方案中,所述输出单元,包括获取子单元和输出子单元;
其中,所述获取子单元,配置为根据所述数据输出指令从预设的第一存储单元中获取缓存的报文处理的中间数据;
所述输出子单元,配置为根据所述数据输出指令将报文处理的中间数据输出至第二存储单元。
在上述方案中,所述执行单元,还配置为执行所述当前执行的指令的 下一条指令;并且触发所述确定单元。
第三方面,本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行前述报文处理数据的获取方法的至少其中之一。
本发明实施例提供了一种网络处理器、报文处理数据的获取方法和存储介质,通过业务指令来触发报文处理的中间数据的获取过程,从而能够在获取网络处理器处理报文所产生的中间数据时,既避免了业务流程的中断又能够减少了硬件资源开销及内核逻辑的复杂度。
附图说明
图1为本发明实施例提供的一种报文处理数据的获取方法流程示意图;
图2为本发明实施例提供的一种报文处理数据的获取方法详细流程示意图;
图3为本发明实施例提供的一种网络处理器的结构示意图;
图4为本发明实施例提供的另一种网络处理器的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,应当理解,以下所说明的优选实施例仅用于说明和解释本发明,并不用于限定本发明。
实施例一
参见图1,其示出了本发明实施例提供的一种报文处理数据的获取方法流程,该方法应用于网络处理器中,可以包括:
S101:网络处理器当前执行的业务指令满足预设的触发条件时,调用预设的数据输出指令;
S102:网络处理器根据所述数据输出指令将缓存的报文处理的中间数 据进行输出。
示例性地,所述网络处理器当前执行的指令满足预设的触发条件,具体可以包括:
网络处理器当前执行的指令对应的数据获取使能指示为真时,网络处理器当前执行的指令满足预设的触发条件;和/或,
网络处理器当前执行的指令为数据获取触发指令时,网络处理器当前执行的指令满足预设的触发条件。
例如,可以在业务指令编码时,为每条业务指令对应设计1比特的数据获取使能标志位,在网络处理器执行业务指令时,可以通过网络处理器外部的上位机控制软件将业务指令序列中需要进行报文处理数据获取的业务指令的使能标志位设置为1来表示开启报文处理数据获取,或者将使能标志位设置为0以关闭报文处理数据获取。当网络处理器的内核执行到某条业务指令时,判断该业务指令对应的数据获取使能标志位是否为1,若为1,则确定当前执行的指令满足预设的触发条件,从而能够进行后续的本发明实施例所提出的报文处理数据的获取过程;若为0,则按照常规模式执行该业务指令。在本实施例中所述满足预设的触发条件可包括接收到对程序进行调试通知,例如,接收到进行单步调试或进行断点清除调试通知。
此外,还可以在编写的业务指令序列时,在某些关键节点上插入数据获取触发指令,并通过网络处理器的内核原有的条件判断指令对预设条件进行判断,从而执行数据获取触发指令,预设的条件判断的数据来源可以是基于报文内容或者基于查表返回的结果,以实现基于报文或者查表结果特征的报文处理数据输出。需要说明的是,在实际运用中以上介绍的两种触发条件确定方式既可以单独使用,也可以组合使用,以便达到灵活地输出报文处理数据的目的,本实施例对此不做具体赘述。
示例性地,调用预设的数据输出指令,可以包括:网络处理器从预设 的指令存储空间中获取数据输出指令;
需要说明的是,报文处理数据的输出是通过内核执行特定的数据输出指令来实现,在本实施例中,硬件上可以复用网络处理内核原有的指令写转发表的总线来实现,这样既不需要改变内核原有的总线结构,也不需要在内核中增加额外的控制单元。例如,可以在网络处理器内核的指令存储空间的固定位置存放数据输出指令序列。当满足预设的触发条件时,网络处理器内核自动跳转到该固定位置调用并执行数据输出指令来输出报文处理数据,并且在输出完成之后再跳转回原来的业务指令之后继续执行。
示例性地,所述网络处理器根据所述数据输出指令将缓存的报文处理的中间数据进行输出,包括:
网络处理器根据所述数据输出指令从预设的第一存储单元中获取缓存的报文处理的中间数据;以及,
网络处理器根据数据输出指令将报文处理的中间数据输出至第二存储单元。
可选地,对于报文处理的中间数据,需要说明的是,当报文进入网络处理器内核时,内核按照业务指令序列依次对报文进行处理,通过执行这些业务指令,网络处理器内核完成对报文执行算术运算或逻辑判断、获取报文的转发信息、对报文的内容进行编辑等操作,因此,网络处理器的内核中会有一系列的寄存器或者网络处理器中其它类型的存储单元就会对报文处理的中间数据进行缓存,这些中间数据包括但不限于:内核硬件状态、最近执行的若干条指令的编码、算术或逻辑运算的结果、查表的键值和结果、被编辑的报文等。而这些中间数据是分析报文在网络处理器内核的处理过程的关键,因此,对于缓存的报文处理的中间数据,第一存储单元可以是上述用来对报文处理的中间数据进行缓存的网络处理器内核的寄存器或者网络处理器中其它类型的存储单元。
还需要说明的是,网络处理器可用的存储空间一般包括芯片内部存储空间和外挂的存储空间,其中芯片内部的存储空间由于受芯片面积和功耗等因素的影响,不可能设计的太大,而报文处理数据的获取功能仅是网络处理器附加的调试功能,在正常运行的多数时间里是不会开启的,因此如果在网络处理器的芯片内部为报文处理数据的存储单独增加一片存储空间是很不经济的。因此,本发明实施例中,可以在数据输出指令中增加报文处理数据存储空间属性关键字,从而可以通过这些关键字来指定存储报文处理数据的空间起始位置和容量上限。这样可以灵活使用网络处理器的芯片内部和外部存储空间中的业务表项配置剩余不用的碎片空间来存储报文处理数据。同时,通过在数据输出指令中指定地址偏移从而实现多个报文处理数据的分开存储。
示例性地,在网络处理器根据预设的数据输出指令将缓存的报文处理的中间数据进行输出之后,还可以包括:
网络处理器执行当前执行的指令的下一条指令,并且确定下一条指令是否满足所述预设的触发条件。可以理解地,当确定下一条指令满足所述预设的触发条件时,可以按照上述过程继续进行报文处理数据的获取,如果不满足,则按照常规模式进行业务指令的执行。
本实施例提供了一种报文处理数据的获取方法,通过业务指令来触发报文处理的中间数据的获取过程,从而能够在获取网络处理器处理报文所产生的中间数据时,既避免了业务流程的中断有减少了硬件资源开销及内核逻辑的复杂度。
实施例二
参见图2,其示出了本发明实施例提供的一种报文处理数据的获取方法详细流程,该方法应用于网络处理器中,可以包括:
S201:网络处理器通过上位机控制软件加载业务指令序列到网络处理 器内核的指令存储单元;
S202:网络处理器内核从指令存储单元取出业务指令并执行;
需要说明的是,网络处理器内核对业务指令序列的执行是由报文触发,当网络处理器内核接收到报文之后,开始从指令存储单元的指令序列的某一位置调用业务指令并开始执行;
S203:网络处理器判断业务指令的对应的数据获取使能指示是否为真;若为真则执行S205;若不为真,则执行S204。
S204:判断当前执行的业务指令是否为数据获取触发指令;若是,则执行步骤S205;若不是,则执行步骤S207;
可以理解地,步骤S203和S204是本实施例提出的对当前执行的业务指令是否满足预设的触发条件的确定过程,但是,当前执行的业务指令是否满足预设的触发条件也可以仅通过S203或S204进行确定,本发明实施例对此不作赘述。
S205:网络处理器跳转到指令存储单元的固定位置调用并执行数据输出指令;
可以理解地,数据输出指令可以存放在指令存储单元的固定位置;网络处理器内核会固定跳转到此固定位置执行这些指令以输出报文处理的中间数据,同时网络处理器内核在跳转之前会保存下一条业务指令的地址,以便在执行完数据输出指令后返回原来的业务指令序列中继续执行。
S206:网络处理器根据数据输出指令中的关键字将相应的报文处理数据输出到存储空间的指定位置;
例如,数据输出指令中可以包含三类关键字:报文处理数据类型关键字、报文处理数据存储空间属性关键字、报文处理数据的存储偏移;其中,报文处理数据类型关键字用于选择输出数据的类型;报文处理数据存储空间属性关键字用于指定报文处理数据存储的位置和容量上限,既可选用网 络处理器内部的存储单元也可选用外部存储单元;报文处理数据的存储偏移用于指示当前报文处理数据在整个报文处理数据存储空间的相对偏移地址,以实现多个报文处理数据的循环存储而不相互覆盖。
还需要说明的是,在内核指令存储单元固定位置存储的这些数据输出指令,可以在网络处理器运行过程中动态被修改,即可以在网络处理器运行中通过重新加载数据输出指令以实现动态修改。
S207:按照常规模式执行业务指令;
需要说明的是,执行到这步表明网络处理器内核当前执行的业务指令是普通的业务处理指令,因此,网络处理器只需要按常规模式正常执行该指令即可。
S208:判断业务指令序列是否结束;若结束,则转至S209;若没有结束,则转至S202;
S209:停止报文处理数据的输出;
需要说明的是,在报文处理结束之后将数据获取使能指示设置为关闭报文处理数据获取或者通过修改配置跳过执行数据获取触发指令。
可以理解地,当停止报文处理数据的输出后,就可以在分析报文处理数据的基础上对网络处理器内核的故障进行诊断。
本实施例提供了一种报文处理数据的获取方法的详细流程,通过业务指令来触发报文处理的中间数据的获取过程,从而能够在获取网络处理器处理报文所产生的中间数据时,既避免了业务流程的中断有减少了硬件资源开销及内核逻辑的复杂度。
实施例三
参见图3,其示出了本发明实施例提供的一种网络处理器30的结构,可以包括:执行单元301、确定单元302、调用单元303、输出单元304;其中,
执行单元301,配置为执行当前的业务指令,并触发确定单元302;
确定单元302,配置为确定执行单元301当前执行的业务指令是否满足预设的触发条件;以及,当前执行的业务指令满足预设的触发条件时,触发调用单元303;
调用单元303,配置为调用预设的数据输出指令;
输出单元304,配置为根据数据输出指令将缓存的报文处理的中间数据进行输出。
所述执行单元301、确定单元302、调用单元303及输出单元304可对应于所述网络处理器的处理电路或处理芯片。所述执行单元301、确定单元302、调用单元303及输出单元304中的一个或多个可对应于同样的处理电路或处理芯片,也可以对应于不同的处理器或处理芯片。当多个单元对应于同一个处理电路或处理芯片时,该处理电路或处理芯片可采用时分复用或并发线程完成不同单元的功能。
示例性地,确定单元302,配置为:
当前执行的指令对应的数据获取使能指示为真时,确定当前执行的指令满足预设的触发条件;和/或,
当前执行的指令为数据获取触发指令时,确定当前执行的指令满足预设的触发条件。
示例性地,调用单元303,配置为从预设的指令存储空间中获取数据输出指令。
示例性地,参见图4,输出单元304,可以包括获取子单元3041和输出子单元3042;
其中,获取子单元3041,配置为根据数据输出指令从预设的第一存储单元中获取缓存的报文处理的中间数据;
输出子单元3042,配置为根据数据输出指令将报文处理的中间数据输 出至第二存储单元。
示例性地,执行单元301,还配置为执行当前执行的指令的下一条指令;并且触发确定单元302。
本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于前述报文处理数据的获取方法的至少其中之一,例如,执行如图1和/或图2所示的方法。
所述计算机存储介质可包括光盘、磁盘等存储介质,可选为非瞬间存储介质。
以上,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围,凡按照本发明原理所作的修改,都应当理解为落入本发明的保护范围。
工业实用性
本发明实施例中,在进行网络处理器的故障诊断过程中,将调用预设的数据输出指令,从缓存的报文中取出中间数据,这样就可以不用采用辅助线程将这些数据存储到专门的记录单元中,也不用中断网络处理器的当前处理业务流程,如此,减少了故障诊断过程中业务流程处理的中断,同时避免了引入辅助的处理线程,进而减少了辅助的处理线程所消耗的软硬件资源。

Claims (11)

  1. 一种报文处理数据的获取方法,所述方法包括:
    网络处理器当前执行的业务指令满足预设的触发条件时,调用预设的数据输出指令;
    所述网络处理器根据所述数据输出指令将缓存的报文处理的中间数据进行输出。
  2. 根据权利要求1所述的方法,其中,所述网络处理器当前执行的指令满足预设的触发条件,包括:
    所述网络处理器当前执行的指令对应的数据获取使能指示为真时,所述网络处理器当前执行的指令满足预设的触发条件;和/或,
    所述网络处理器当前执行的指令为数据获取触发指令时,所述网络处理器当前执行的指令满足预设的触发条件。
  3. 根据权利要求1所述的方法,其中,所述调用预设的数据输出指令,包括:
    所述网络处理器从预设的指令存储空间中获取数据输出指令。
  4. 根据权利要求1所述的方法,其中,所述网络处理器根据所述数据输出指令将缓存的报文处理的中间数据进行输出,包括:
    所述网络处理器根据所述数据输出指令从预设的第一存储单元中获取缓存的报文处理的中间数据;
    所述网络处理器根据所述数据输出指令将报文处理的中间数据输出至第二存储单元。
  5. 根据权利要求1所述的方法,其中,所述根据预设的数据输出指令将缓存的报文处理的中间数据进行输出之后,所述方法还包括:
    所述网络处理器执行所述当前执行的指令的下一条指令,并且确定所 述下一条指令是否满足所述预设的触发条件。
  6. 一种网络处理器,所述网络处理器包括:执行单元、确定单元、调用单元、输出单元;其中,
    所述执行单元,配置为执行当前的业务指令,并触发所述确定单元;
    所述确定单元,配置为确定所述执行单元当前执行的业务指令是否满足预设的触发条件;以及,当前执行的业务指令满足预设的触发条件时,触发所述调用单元;
    所述调用单元,配置为调用预设的数据输出指令;
    所述输出单元,配置为根据所述数据输出指令将缓存的报文处理的中间数据进行输出。
  7. 根据权利要求6所述的网络处理器,其中,所述确定单元,配置为:
    当前执行的指令对应的数据获取使能指示为真时,确定当前执行的指令满足预设的触发条件;和/或,
    当前执行的指令为数据获取触发指令时,确定当前执行的指令满足预设的触发条件。
  8. 根据权利要求6所述的网络处理器,其中,所述调用单元,配置为从预设的指令存储空间中获取数据输出指令。
  9. 根据权利要求6所述的网络处理器,其中,所述输出单元,包括获取子单元和输出子单元;
    其中,所述获取子单元,配置为根据所述数据输出指令从预设的第一存储单元中获取缓存的报文处理的中间数据;
    所述输出子单元,配置为根据所述数据输出指令将报文处理的中间数据输出至第二存储单元。
  10. 根据权利要求6所述的网络处理器,其中,所述执行单元,还配置为执行所述当前执行的指令的下一条指令;并且触发所述确定单元。
  11. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1至5所述报文处理数据的获取方法的至少其中之一。
PCT/CN2016/083529 2015-08-04 2016-05-26 网络处理器、报文处理数据的获取方法和存储介质 WO2017020639A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510472778.7 2015-08-04
CN201510472778.7A CN106452807B (zh) 2015-08-04 2015-08-04 一种网络处理器及报文处理数据的获取方法

Publications (1)

Publication Number Publication Date
WO2017020639A1 true WO2017020639A1 (zh) 2017-02-09

Family

ID=57942368

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/083529 WO2017020639A1 (zh) 2015-08-04 2016-05-26 网络处理器、报文处理数据的获取方法和存储介质

Country Status (2)

Country Link
CN (1) CN106452807B (zh)
WO (1) WO2017020639A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107395381A (zh) * 2016-05-16 2017-11-24 中兴通讯股份有限公司 一种报文处理方法、装置及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006014400A1 (en) * 2004-07-06 2006-02-09 Intel Corporation System and method to detect errors and predict potential failures
CN101764721A (zh) * 2009-12-15 2010-06-30 中兴通讯股份有限公司 检测方法和网络管理器
CN102216909A (zh) * 2011-05-27 2011-10-12 华为技术有限公司 一种网络处理器和网络处理器所存程序的诊断方法
CN102637197A (zh) * 2012-02-28 2012-08-15 中北大学 实时数据采集存储系统的文件管理方法
CN103503386A (zh) * 2012-12-31 2014-01-08 华为技术有限公司 网络设备以及处理报文方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100502329C (zh) * 2003-03-05 2009-06-17 华为技术有限公司 一种以太网交换机及其业务处理方法
JP4718901B2 (ja) * 2005-05-27 2011-07-06 パナソニック株式会社 命令実行装置、デバッグ方法、デバッグ装置及びデバッグプログラム
KR20070109432A (ko) * 2006-05-11 2007-11-15 삼성전자주식회사 커널 인지 디버깅 장치 및 방법
CN101551928A (zh) * 2009-05-14 2009-10-07 浪潮齐鲁软件产业有限公司 一种金融税控收款机嵌入程序的断点调试方法
US8806446B2 (en) * 2010-03-22 2014-08-12 Analog Devices, Inc. Methods and apparatus for debugging programs in shared memory
CN104298602A (zh) * 2014-10-27 2015-01-21 北京神州绿盟信息安全科技股份有限公司 一种调试应用程序的方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006014400A1 (en) * 2004-07-06 2006-02-09 Intel Corporation System and method to detect errors and predict potential failures
CN101764721A (zh) * 2009-12-15 2010-06-30 中兴通讯股份有限公司 检测方法和网络管理器
CN102216909A (zh) * 2011-05-27 2011-10-12 华为技术有限公司 一种网络处理器和网络处理器所存程序的诊断方法
CN102637197A (zh) * 2012-02-28 2012-08-15 中北大学 实时数据采集存储系统的文件管理方法
CN103503386A (zh) * 2012-12-31 2014-01-08 华为技术有限公司 网络设备以及处理报文方法

Also Published As

Publication number Publication date
CN106452807B (zh) 2020-12-29
CN106452807A (zh) 2017-02-22

Similar Documents

Publication Publication Date Title
JP3880034B2 (ja) 電子プロセッサ用のレジスタ転送ユニット
TWI656479B (zh) 在多核心處理器中的非對稱核心之間遷移執行緒
US8001549B2 (en) Multithreaded computer system and multithread execution control method
TWI416413B (zh) Work processing device
US9141178B2 (en) Device and method for selective reduced power mode in volatile memory units
KR20210011451A (ko) 하드웨어 가속을 위한 하드웨어 리소스들의 임베디드 스케줄링
JP2007141246A (ja) ベクトルマスク設定技術
JP2002041489A (ja) 同期信号生成回路、それを用いたプロセッサシステムおよび同期信号生成方法
US20210334228A1 (en) Managing network interface controller-generated interrupts
US20120221795A1 (en) Shared memory system and control method therefor
US10896001B1 (en) Notifications in integrated circuits
JP2018139118A (ja) 自律的メモリの方法及びシステム
CN112306669A (zh) 一种基于多核系统的任务处理方法及装置
US10732976B2 (en) Integrated circuit processor and method of operating the integrated circuit processor in different modes of differing thread counts
WO2016177081A1 (zh) 通知消息处理方法及装置
WO2017020639A1 (zh) 网络处理器、报文处理数据的获取方法和存储介质
WO2023125359A1 (zh) 一种任务处理的方法及装置
US20100318707A1 (en) External device access apparatus, control method thereof, and system lsi
JP2011134162A (ja) タスクの切り換えを制御するシステムおよび方法
JP2009037403A (ja) マルチコアプロセッサにおけるコアメモリの有効活用方法
WO2019169582A1 (zh) 处理中断的方法和装置
US10884477B2 (en) Coordinating accesses of shared resources by clients in a computing device
WO2015131445A1 (zh) 一种微引擎及其处理报文的方法、计算机存储介质
US10956248B1 (en) Configurable reporting for device conditions
WO2016173275A1 (zh) 一种调试方法、调试装置及存储介质

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

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

Country of ref document: EP

Kind code of ref document: A1