WO2014067099A1 - Method, network device and processor for processing failure message - Google Patents

Method, network device and processor for processing failure message Download PDF

Info

Publication number
WO2014067099A1
WO2014067099A1 PCT/CN2012/083854 CN2012083854W WO2014067099A1 WO 2014067099 A1 WO2014067099 A1 WO 2014067099A1 CN 2012083854 W CN2012083854 W CN 2012083854W WO 2014067099 A1 WO2014067099 A1 WO 2014067099A1
Authority
WO
WIPO (PCT)
Prior art keywords
cache
poisoning
descriptor
message
identifier
Prior art date
Application number
PCT/CN2012/083854
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 华为技术有限公司
Priority to CN201280004493.5A priority Critical patent/CN103534704A/en
Priority to PCT/CN2012/083854 priority patent/WO2014067099A1/en
Publication of WO2014067099A1 publication Critical patent/WO2014067099A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0727Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a storage system, e.g. in a DASD or network based storage system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/742Route cache; Operation thereof

Definitions

  • the present invention relates to the field of computers, and in particular, to a method, a network device, and a processor for processing a failure message.
  • Computer systems communicate with other external devices in a manner that sends and receives messages through network devices.
  • the length of the packet is generally long and is not fixed. Therefore, when the network device moves a packet from its own cache to the memory, it needs to split the packet into multiple frames and then move it to the memory one by one. .
  • the cache may fail because the data in the cache is moved to memory.
  • the data structure of the message exchanged between the central processor and the network device is generally composed of a BD (Buffer Descriptor) and a Buffer. Buffer is a memory block for storing messages. BD is a descriptor for messages and memory blocks. It helps the system to detect data errors.
  • BD usually includes a pointer to a memory block (buffer pointer) and an F flag (used to indicate whether the buffer is in the buffer). There are messages) and some other status bits (message check error, message type indication, etc.).
  • the embodiment of the present invention provides a method for processing a failure message, a network device, and a processor, which can indicate that the cache of the invalid packet is empty in case the packet in the cache has expired, so as to be discarded. Invalid message, thus avoiding system reset or failure data The impact of normal data processing has improved the reliability of the system.
  • a method for processing a failure packet includes:
  • the poisoning indication flag corresponding to the cache of the invalid message is marked as poisoned, Indicates that the packets in the cache are poisoned.
  • the setting of the corresponding poisoning indication identifier for the cache in the computer memory includes:
  • a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory wherein the cache descriptor further includes a message full identifier, a cache base address pointer, or the cache descriptor further includes a read index, a write index, and Cache base address pointer; or
  • a poisoning indication identifier corresponding to the cache descriptor in another memory of the computer, where the cache descriptor includes a message full identifier, a cache base address pointer, or in another memory of the computer.
  • the same poisoning indication identifier is set for all the cache descriptors, wherein each cache descriptor includes a message full identifier, a cache base address pointer, and the other memory is independent of the memory of the cache descriptor; or
  • a poisoning indication identifier is set in front of a start position of the cache in the computer memory, and the cache descriptor corresponding to the cache includes a message full identifier and a cache base address pointer.
  • marking the poisoning indication identifier corresponding to the cache in which the invalid packet is located as poisoning includes:
  • the poisoning indication identifier corresponding to the cache in which the invalid packet is located is marked as poisoned.
  • another method for processing a failure message is provided. Based on a processor side, the method includes:
  • the poisoning indication flag corresponding to the cache in the computer memory is marked as medium To poison, the cache is rewritten, the check value is retrieved, and the cache is indicated to be empty.
  • the poisoning indication identifier when the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a message full identifier, a cache base address pointer Rewriting the cache, reacquiring the check value, and indicating that the cache is empty includes:
  • the message full identifier in the cache descriptor is set to null to indicate that the cache corresponding to the descriptor is empty.
  • the poisoning indication identifier when the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a read index, a write index, and a cache base address.
  • the rewriting the cache, reacquiring the check value, and indicating that the cache is empty includes:
  • the read index is directed to the next cache descriptor to be read.
  • the buffer is rewritten, the check value is reacquired, and the cache is indicated as Empty includes:
  • the buffer is rewritten. , re-acquire the check value, and indicate that the cache is empty, including:
  • the other memory is independent of the memory in which the cache descriptor is located.
  • a value, and indicating that the cache is empty includes:
  • the size of the cache in the computer memory is an independent verification data unit.
  • An integer multiple of and the base address of the cache is also an integer multiple of the independent check data unit.
  • a third aspect provides a network device, where the network device includes:
  • a poisoning identifier setting unit configured to set a corresponding poisoning indication identifier for a cache in a computer memory
  • a poisoning identifier management unit configured to: after receiving the message, if the message is invalid, after the invalid message is moved to a cache in the computer memory, the poisoning corresponding to the cache of the invalid message is poisoned
  • the indication identifier is marked as poisoned to indicate that the message in the cache is poisoned.
  • the poisoning identifier setting unit is specifically configured to:
  • a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory wherein the cache descriptor further includes a message full identifier, a cache base address pointer, or the cache descriptor further includes a read index, a write index, and Cache base address pointer; or
  • a poisoning indication identifier corresponding to the cache descriptor in another memory of the computer, where the cache descriptor includes a message full identifier, a cache base address pointer, or in another memory of the computer.
  • the same poisoning indication identifier is set for all the cache descriptors, wherein each cache descriptor includes a message full identifier, a cache base address pointer, and the other memory is independent of the memory of the cache descriptor; or
  • a poisoning indication identifier is set in front of a start position of the cache in the computer memory, and the cache descriptor corresponding to the cache includes a message full identifier and a cache base address pointer.
  • the poisoning identifier management unit includes:
  • a failure detecting subunit configured to determine that the message is invalid if any frame of the message is invalid during the process of moving the message to the cache in the computer memory
  • the poisoning flag sub-unit is configured to mark the poisoning indication corresponding to the cache in which the invalid message is located as poisoning.
  • a fourth aspect provides a processor, where the processor includes:
  • the cache processing unit is configured to: when the message is read, if the poisoning indication flag corresponding to the cache in the computer memory is marked as poisoned, the buffer is rewritten, the check value is re-acquired, and the cache is indicated to be empty.
  • the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a message full identifier, a cache base address pointer.
  • the cache processing unit is specifically configured to:
  • the message full identifier in the cache descriptor is set to null to indicate that the cache corresponding to the descriptor is empty.
  • the cache processing unit is specifically configured to:
  • the read index is directed to the next cache descriptor to be read.
  • the cache processing unit when the poisoning indication is set in another memory, the cache processing unit is specifically configured to:
  • the cache processing unit when the poisoning indicator When the cache is set in another memory, and all the cache descriptors correspond to the same poison indication indicator, the cache processing unit is specifically configured to:
  • the other memory is independent of the memory in which the cache descriptor is located.
  • the cache processing unit when the poisoning indication is set in front of a start position of a cache in the computer memory, the cache processing unit is specifically configured to:
  • the packet full identifier in the cache descriptor corresponding to the cache is set to be empty, to indicate that the cache corresponding to the cache descriptor is empty.
  • a network device including a receiver, a transmitter, a memory, and a bus, where the network device further includes:
  • a processor configured to set a corresponding poisoning indication identifier for the cache in the computer memory; the processor is further configured to: after receiving the packet, if the packet fails, move the invalid packet to the After the cache in the memory of the computer, the poisoning indication identifier corresponding to the cache in which the invalidation packet is located is marked as poisoned to indicate that the packet in the cache is poisoned.
  • the processor is specifically configured to:
  • a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory wherein the cache descriptor further includes a message full identifier, a cache base address pointer, or the cache descriptor further includes a read index, a write index, and Cache base address pointer; or
  • all the cache descriptors are set with the same poison indication indicator, wherein each cache descriptor includes a message full identifier, a cache base address pointer, and the other memory is independent of the The memory in which the cache descriptor is located; or A poisoning indication identifier is set in front of a start position of the cache in the computer memory, and the cache descriptor corresponding to the cache includes a message full identifier and a cache base address pointer.
  • the processor is specifically configured to:
  • the poisoning indication identifier corresponding to the cache in which the invalid packet is located is marked as poisoned.
  • a processor is provided, where the processor is used to rewrite the buffer and re-acquire the check value if the poisoning indication flag corresponding to the cache in the computer memory is marked as poisoned when the message is read. And indicates that the cache is empty.
  • the poisoning indication identifier when the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a message full identifier, a cache base address pointer.
  • the processor is specifically configured to:
  • the message full identifier in the cache descriptor is set to null to indicate that the cache corresponding to the descriptor is empty.
  • the processor is specifically configured to:
  • the read index is directed to the next cache descriptor to be read.
  • the processor when the poisoning indication identifier is set in another memory, the processor is specifically configured to:
  • the processor when the poisoning indication identifier is set in another memory, and all cache descriptors correspond to the same poisoning indicator When the time is known, the processor is specifically configured to:
  • the packet full identifier of all the cache descriptors corresponding to the same poisoning indication identifier is set to be empty, to indicate that the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier is empty.
  • the processor when the poisoning indication identifier is set in front of a start position of a cache in the computer memory, the processor is specifically configured to:
  • the packet full identifier in the cache descriptor corresponding to the cache is set to be empty, to indicate that the cache corresponding to the cache descriptor is empty.
  • the size of the cache in the computer memory is an independent verification data unit.
  • An integer multiple of and the base address of the cache is also an integer multiple of the independent check data unit.
  • An embodiment of the present invention provides a method, a network device, and a processor for processing a failure message, by setting a message poisoning indication flag corresponding to a cache in a computer memory, and after the network device receives the message, the invalid message is
  • the poisoning indication flag corresponding to the cache is set to be poisoned, and the buffer of the invalidation message is rewritten, and then the buffer is indicated to be empty, so that when the buffered packet has expired, the packet is invalidated.
  • the invalid packets are discarded, thereby avoiding the reset of the system or treating the invalid data as normal data, thereby improving the reliability of the system.
  • FIG. 1 is a schematic flowchart of a method for processing an invalid packet according to an embodiment of the present invention
  • FIG. 2 is a schematic flow chart of another method for processing a failure message according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a method for processing a failed packet according to another embodiment of the present invention.
  • FIG. 4 is a schematic diagram showing a structure of a cache descriptor and a cache according to another embodiment of the present invention.
  • FIG. 5 is a schematic diagram 2 of a cache descriptor and a cache according to another embodiment of the present invention.
  • FIG. 6 is a schematic diagram 3 of a cache descriptor and a cache according to another embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram 4 of a cache descriptor and a cache according to another embodiment of the present invention.
  • FIG. 8 is a schematic diagram 5 of a cache descriptor and a cache according to another embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a network device according to another embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of another network device according to another embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of another network device according to another embodiment of the present invention.
  • FIG. 13 is a schematic diagram of another processor according to another embodiment of the present invention.
  • the interaction structure of the message between the processor and the network device generally includes a buffer (Buffer) and a Buffer Descriptor (BD), and the cache refers to It is a cache in the memory of the computer, that is, the cache refers to a memory block in which the message is stored in the computer memory, and a plurality of caches can be divided into the memory of the general computer.
  • Buffer buffer
  • BD Buffer Descriptor
  • An embodiment of the present invention provides a method for processing a failure packet, which is based on a network device side. As shown in FIG. 1, the method includes:
  • the cache in the computer memory corresponds to the allocation poisoning indication identifier space, and the space is used to set the poisoning indication identifier.
  • the initial values of the poisoning indications corresponding to each cache are not poisoned.
  • the network device After receiving the packet, if the packet is invalid, the network device marks the poisoning indication flag corresponding to the cache of the invalid packet as poisoning after the invalid packet is moved to the cache in the computer memory, to indicate that the packet is invalid. The message in the cache is poisoned.
  • the embodiment of the present invention further provides another method for processing a failure message. Based on the processor side, as shown in FIG. 2, the method includes:
  • An embodiment of the present invention provides a method for processing a failure message, by setting a packet poisoning indication flag corresponding to a cache in a computer memory, and after the network device receives the message, the poisoning corresponding to the cache in which the invalid message is located is poisoned.
  • the indication flag is set to be poisoned, and the buffer of the invalidation message is rewritten, and then the buffer is indicated to be empty, so that when the buffered message has expired, the packet is invalidated, and the invalid report is discarded. Therefore, the system reset is avoided or the invalid data is treated as normal data to improve the reliability of the system.
  • Another embodiment of the present invention provides a method for processing a failed packet. As shown in FIG. 3, the method includes: First, it should be noted that, in the present invention, the size of the cache in the computer memory is an independent check data unit. An integer multiple of each, and the base address of each cache is also an integer multiple of the independent parity data unit.
  • the data is verified according to a fixed size unit, for example, 32 bytes of data will have an additional 4 check bytes, where the memory is unique
  • the parity data unit size is 32 bytes.
  • the size of the independent check data unit in memory is S
  • the base address of the cache is an integer multiple of S, that is, M*S
  • the size of the buffer is also an integer multiple of S, that is, N*S, where M and N are Any positive integer.
  • the specific implementation manner is: assigning a poisoning indication identifier space to a cache corresponding to each computer memory. And when the system is initialized, the initial value of the poisoning indication flag corresponding to the cache in each computer memory is not poisoned.
  • the poisoning indicator may be set in a cache descriptor corresponding to the cache in each computer memory, or may be set in a cache in the memory of each computer, or may be set in another independent memory, the other block
  • the memory is independent of the memory in which the cache descriptor is located.
  • the first type is to set a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory, wherein the cache descriptor corresponding to the cache in the computer memory further includes a message full identifier and a cache base address pointer.
  • the structure of the cache descriptor and the cache in the computer memory for storing the message are as shown in FIG. 4, and the cache descriptor corresponding to the cache in each computer memory It includes a message poisoning indicator P, a message indicating whether there is a message full flag F in the cache, and a cache base address pointer and a state designed according to other needs.
  • a poisoning indication identifier is set in a cache descriptor corresponding to the cache in the computer memory, wherein the cache descriptor corresponding to the cache in the computer memory further includes a cache descriptor, and further includes a read index (Read Index) and a write index (Write). Index ) and cache base address pointer.
  • the write index is moved to the next cache descriptor to be read, and after each message is processed, the read index is moved to the next wait.
  • the cache descriptor read.
  • the poisoning indication identifier when the poisoning indication identifier is set in the cache descriptor corresponding to the cache in the computer memory, the structure of the cache descriptor and the cache in the computer memory for storing the message are as shown in FIG. 5, and the cached cache descriptor is in the cache descriptor.
  • the structure of the cache descriptor and the cache in the computer memory for storing the message are as shown in FIG. 5, and the cached cache descriptor is in the cache descriptor.
  • a poisoning indication identifier is set corresponding to the cache descriptor, wherein the cache descriptor includes a message full identifier, a cache base address pointer, and the another block of memory is independent of the cache descriptor.
  • the poisoning indication identifier when the poisoning indication identifier is set corresponding to the cache descriptor, the structure of the cache descriptor and the cache in the computer memory for storing the message are as shown in FIG. 6, and the cache description is The symbols include a message full identifier F, a cache base address pointer, and a state designed according to other needs.
  • the poisoning indicator P is set in another independent memory of the computer, and each poisoning indicator P corresponds to a cache descriptor.
  • the same poisoning indication identifier is set for all cached cache descriptors in the computer memory, wherein each cache descriptor includes a message full identifier and a cache base address pointer.
  • each cache descriptor includes a message.
  • Full flag F a cache base address pointer
  • the poisoning indicator P is set in another independent memory of the network device, and all the cache descriptors share the poisoning indicator P.
  • the fifth type is to set a poisoning indication mark in front of the starting position of the cache in the computer memory, and the cache descriptor corresponding to the cache in the computer memory includes the full identifier of the message and the cache base address pointer.
  • the structure of the cache descriptor and the cache in the computer memory for storing the message are as shown in FIG. 8, and the cache descriptor includes a message. Full flag F, a cache base address pointer, and a state designed according to other needs, but the poisoning indicator P of each cache descriptor is set in front of each cache start position.
  • the poisoning indication flag P is set to be unpoisoned
  • the full identifier F of the message in the cache descriptor corresponding to the cache in the computer memory is set to be empty
  • the cache base address pointer in the cache descriptor is correspondingly Point to the allocated cache, but in the cache descriptor
  • the status flag State can be initialized according to the relevant situation.
  • setting the poisoning indication identifier P and the message full identifier F may be specifically represented by a binary.
  • the poisoning indication identifier P 0 may be used for non-poisoning, 1 for poisoning; In terms of, you can use 0 to indicate empty and 1 to be full.
  • the cache descriptor corresponding to the cache in the computer memory further includes the cache descriptor further including a read index, a write index, and a cache base address pointer,
  • the values of the read index and the write index need to be set to be the same, that is, the read index and the write index point to the same cache descriptor to indicate that there are no messages in all the caches.
  • the network device determines whether the packet has expired in the cache of the network device.
  • the poisoning indication flag corresponding to the cache of the invalidation packet is set to be poisoned, so that the packet in the cache is poisoned.
  • the poisoning indication flag P corresponding to the cache in which the invalidation message is located is changed from no poisoning to poisoning, for example, the value of P is changed from 0 to 1.
  • the setting of the poisoning indication for the cache corresponding to the memory in the computer can be implemented in the following five ways. Therefore, when the location of the poisoning indication is different, the processing manner is different. Way to achieve:
  • the first type when the poisoning indication flag is set in the cache descriptor corresponding to the cache in the computer memory, and the cache descriptor further includes the message full identifier and the cache base address pointer:
  • the processor when the processor reads a message from a cache in the computer memory, if it reads If the message full flag F flag in the cache descriptor corresponding to the cache currently being processed is full, then it is determined whether the message poisoning indicator P in the cache descriptor currently being processed is indicated as poisoning. If the poisoning indicator P flag indicates poisoning, the entire buffer space storing the current poisoning message is overwritten, and the entire buffer is recalculated, and the cache description corresponding to the cache being processed is set. The message full flag F in the character is empty to indicate that the buffer is empty, so that the poisoned message is discarded.
  • the poisoning indication flag is set in the cache descriptor corresponding to the cache in the computer memory, and the cache descriptor further includes the read index, the write index, and the cache base address pointer: the poisoning indication flag is set to the poisoned cache.
  • the cache corresponding to the descriptor is rewritten, and the check value is retrieved; the read index is pointed to the next cache descriptor to be read.
  • the processor when the processor reads a message from a cache in the computer memory, it first determines whether the read index and the write index point to the same cache descriptor. If it points to a different cache descriptor, then it is determined that the pointer is currently being processed. If the poisoning indication flag P in the cache descriptor corresponding to the cache is indicated as being poisoned, if the poisoning indication flag P is indicated as poisoned, the entire cache space storing the current poisoned message is overwritten once, so that this The entire segment of the cache recalculates the checksum, and at this point the read index points directly to the next cache descriptor to be read.
  • the processor when the processor reads the message from the cache in the computer memory, if the processor reads that the message full flag F flag in the cache descriptor corresponding to the cache currently being processed is full, then judge If the poisoning indication flag P corresponding to the cache descriptor corresponding to the cache currently being processed is indicated as being poisoned, if the poisoning indication flag P is indicated as poisoned, the entire cache space of the current poisoned message is rewritten. Once again, let the entire segment of the cache recalculate the check value, and indicate that the cache is empty by setting the message full flag F flag in the cache descriptor corresponding to the cache being processed, so that the poisoned report is Text Discard it.
  • the processor reads the message from the cache in the memory of the computer, if it reads that the full flag F flag of the message corresponding to the cache descriptor currently being processed is full, then the direction is judged. Whether the message poisoning indicator P in the cache descriptor corresponding to the cache currently being processed is indicated as poisoning. If the poisoning indicator P flag indicates poisoning, rewrite all the buffer spaces corresponding to the P flag. All the cache spaces recalculate the check value, and all the buffers in the memory of the computer are empty by setting the F flag in all the cache descriptors corresponding to the P flag to be empty, so as to discard the poisoned packets. Fifth, when a poisoning indicator is set in front of the start of the cache in the computer's memory:
  • the discarding message is processed by the processor by setting the full flag F flag of the buffer descriptor to be empty, or moving the read index to the next cache descriptor to be read.
  • An embodiment of the present invention provides a method for processing a failure message, by setting a message poisoning indication flag for a cache in a computer memory, and after the network device receives the message, the poisoning corresponding to the cache in which the invalid message is located is poisoned.
  • the indication flag is set to be poisoned, and the buffer of the invalidation message is rewritten, and then the buffer is indicated to be empty, so that when the buffered message has expired, the packet is invalidated, and the invalid report is discarded.
  • a further embodiment of the present invention provides a network device 01, as shown in FIG. 9, comprising: a poisoning identifier setting unit 01 1 for setting a corresponding poisoning indication identifier for a cache in a computer memory;
  • the poisoning indicator management unit 012 is configured to: after the message is invalid, after the message is invalid, after the invalid message is moved to the cache in the computer memory, the poisoning indication flag corresponding to the cache of the invalid message is marked as poisoned. To indicate that the message in the cache is poisoned. Further, the poisoning identifier setting unit 01 1 is specifically configured to:
  • a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory wherein the cache descriptor further includes a message full identifier, a cache base address pointer, or a cache descriptor, further including a read index, a write index, and a cache base address pointer; or
  • a poisoning indication identifier is set corresponding to the cache descriptor, where the cache descriptor includes a full identifier of the packet, and a cache base address pointer;
  • the same poisoning indicator is set for all the cache descriptors, wherein each cache descriptor includes a full identifier of the message, a cache base address pointer, and another memory is independent of the cache descriptor.
  • a poisoning indication identifier is set in front of the start position of the cache in the computer memory, and the cache descriptor corresponding to the cache includes the full identifier of the message and the pointer of the cache base address.
  • the poisoning identifier management unit 012 further includes: a failure detecting subunit 0121, configured to invalidate any frame of the message if the packet is moved to the cache in the computer memory. , then determine that the message is invalid;
  • the poisoning flag sub-unit 0122 is used to mark the poisoning indication flag corresponding to the cache in which the invalid message is located as poisoning.
  • An embodiment of the present invention provides a network device, by setting a message poisoning indication flag corresponding to a cache in a computer memory, and setting a poisoning indication flag corresponding to a cache in which the invalid message is located after the network device receives the message. Poisoning, so that the processor rewrites the buffer of the invalidation message, and then indicates that the buffer is empty, so that when the buffered message has expired, the packet is invalidated, and the invalid packet is discarded. Thereby avoiding a system reset or losing Effective data is treated as normal data to improve the reliability of the system.
  • Another embodiment of the present invention provides a processor 02, as shown in FIG.
  • a cache processing unit 021 configured to: when reading a message, if the poisoning indication flag corresponding to the cache in the computer memory is marked as poisoned , the cache is rewritten, the checksum is retrieved, and the cache is indicated to be empty.
  • cache processing unit 021 is specifically configured to:
  • the cache descriptor further includes the message full identifier and the cache base address pointer:
  • the cache descriptor further includes a read index, a write index, and a cache base address pointer:
  • the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier is overwritten, and the check value is re-acquired;
  • the packet full identifier of all the cache descriptors corresponding to the same poisoning indication identifier is set to be empty, to indicate that the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier is empty; Among them, another piece of memory is independent of the memory where the cache descriptor is located.
  • the size of the cache in the computer memory is an integer multiple of the independent check data unit
  • the cached base address is also an integer multiple of the independent check data unit
  • An embodiment of the present invention provides a processor, where a network device is a packet poisoning indication flag corresponding to a cache in a computer memory, and after the network device receives the packet, the poisoning indication corresponding to the cache in which the invalid packet is located After the identifier is set to be poisoned, the processor rewrites the cache of the invalidation message, and then indicates that the cache is empty. In this case, if the buffered packet has expired, the packet is invalidated and discarded. The message avoids the system reset or the impact of the failure data as normal data processing, which improves the reliability of the system.
  • Another embodiment of the present invention provides a network device 03, including a receiver 03 1 , a transmitter 032, a memory 033, and a bus 034. As shown in FIG. 12, the network device 03 further includes:
  • the processor 035 is configured to set a corresponding poisoning indication identifier for the cache in the computer memory, and is further configured to: after receiving the packet, if the packet fails, move the invalid packet to a cache in the computer memory, The poisoning indication flag corresponding to the cache of the invalid packet is marked as poisoned to indicate that the packet in the cache is poisoned.
  • processor 035 is specifically configured to:
  • a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory wherein the cache descriptor further includes a message full identifier, a cache base address pointer, or a cache descriptor, further including a read index, a write index, and a cache base address pointer; or
  • a poisoning indication identifier is set corresponding to the cache descriptor, where the cache descriptor includes a full identifier of the packet, and a cache base address pointer;
  • the same poisoning indicator is set for all the cache descriptors, wherein each cache descriptor includes a full identifier of the message, a cache base address pointer, and another memory is independent of the cache descriptor.
  • Memory; or A poisoning indication identifier is set in front of the start position of the cache in the computer memory, and the cache cache descriptor corresponding to the cache includes a message full identifier and a cache base address pointer.
  • processor 035 is also specifically configured to:
  • An embodiment of the present invention provides a network device, by setting a message poisoning indication flag corresponding to a cache in a computer memory, and setting a poisoning indication flag corresponding to a cache in which the invalid message is located after the network device receives the message. Poisoning, so that the processor rewrites the buffer of the invalidation message, and then indicates that the buffer is empty, so that when the buffered message has expired, the packet is invalidated, and the invalid packet is discarded. Thus, the system reset is avoided or the failure data is treated as normal data to improve the reliability of the system.
  • Another embodiment of the present invention provides a processor 04. As shown in FIG. 13, the processor 04 can be disposed in a computer 0.
  • the computer 0 further includes a receiver 041, a transmitter 042, a memory 043, and a bus 044. And the receiver 041, the transmitter 042, the memory 043, and the processor 04 are interconnected by a bus 044, where:
  • the processor 04 is configured to rewrite the buffer, re-acquire the check value, and indicate that the cache is empty if the poison indication indicator corresponding to the cache in the computer memory is marked as poisoned when the message is read.
  • processor 04 is specifically configured to:
  • the cache descriptor further includes the message full identifier and the cache base address pointer:
  • the cache descriptor when the poisoning indicator is set in the cache corresponding cache descriptor, and the cache descriptor also includes the read index, the write index, and the cache base address pointer:
  • the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier is overwritten, and the check value is re-acquired;
  • the packet full identifier of all the cache descriptors corresponding to the same poisoning indication identifier is set to be empty, to indicate that the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier is empty;
  • Another piece of memory is independent of the memory where the cache descriptor is located.
  • the size of the cache in the computer memory is an integer multiple of the independent check data unit
  • the cached base address is also an integer multiple of the independent check data unit
  • An embodiment of the present invention provides a processor, where a network device is a packet poisoning indication flag corresponding to a cache in a computer memory, and after the network device receives the packet, the poisoning indication corresponding to the cache in which the invalid packet is located After the identifier is set to be poisoned, the processor rewrites the cache of the invalidation message, and then indicates that the cache is empty. In this case, if the buffered packet has expired, the packet is invalidated and discarded. The message avoids the system reset or the impact of the failure data as normal data processing, which improves the reliability of the system.
  • the disclosed method and apparatus may be implemented in other manners.
  • the device embodiments described above are merely Illustratively, for example, the division of the unit is only a logical function division, and the actual implementation may have another division manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be Ignore, or not execute.
  • the communication connections shown or discussed may be through a number of interfaces, devices or unit connections, which may be in electrical, mechanical or other form.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the software functional unit described above is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform portions of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and the like, and the program code can be stored. Medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

A method, network device and processor for processing failure message is provided by the embodiments of the invention, relating to the computer field, which can indicate that message has been failed and discard the failed message when the message in a buffer has been failed, so as to avoid the infection from a system reset or a processing of failure data as normal data, and improve the reliability of a system. The method includes: correspondingly setting message poisoning indication flags for the buffers in computer memory, after message is received by a network device, setting the poisoning indication flag corresponding to the buffer which failure message is in as poisoning, rewriting the buffer which failure message is in, then indicating that the buffer is empty. The embodiments of the invention are used for processing failure message.

Description

一种处理失效报文的方法、 网络设备和处理器 技术领域  Method, network device and processor for processing invalid message
本发明涉及计算机领域, 尤其涉及一种处理失效报文的方法、 网络设 备和处理器。  The present invention relates to the field of computers, and in particular, to a method, a network device, and a processor for processing a failure message.
背景技术 计算机系统通过网络设备发送和接收报文的方式跟外部其他设备进 行通信。 而报文的长度一般比较长并且是不固定的, 因此, 网络设备把 一个报文从自己的緩存搬移到内存时, 需要先将报文拆分成多个帧, 然 后再逐一搬移到内存中。 由于在将緩存中的数据搬移到内存之前, 緩存器可能会失效。 中央 处理器与网络设备之间交互的报文的数据结构一般采用 BD ( Buffer Descriptor, 緩存描述符) 和 Buffer两部分组成。 Buffer是存放报文的内 存块, BD是报文和内存块的描述符, 有助于系统检测数据错误, BD— 般包括内存块的指针 ( buffer pointer ) 、 F标志 (用来表示 buffer中是否 有报文) 以及其他的一些状态位 (报文校验错误、 报文类型指示等) 。 当检测到緩存中的数据有错误时, 现有的一种技术是将错误的数据 块标记为中毒数据, 然后处理方式有两种, 一是复位整个系统; 二是把 出错的数据当正常的数据进行处理, 不在检测到错误数据后对错误数据 做任何的标记。 但是在实现上述对存储器中失效数据的处理的过程中, 至少存在如 下问题: BACKGROUND OF THE INVENTION Computer systems communicate with other external devices in a manner that sends and receives messages through network devices. The length of the packet is generally long and is not fixed. Therefore, when the network device moves a packet from its own cache to the memory, it needs to split the packet into multiple frames and then move it to the memory one by one. . The cache may fail because the data in the cache is moved to memory. The data structure of the message exchanged between the central processor and the network device is generally composed of a BD (Buffer Descriptor) and a Buffer. Buffer is a memory block for storing messages. BD is a descriptor for messages and memory blocks. It helps the system to detect data errors. BD—usually includes a pointer to a memory block (buffer pointer) and an F flag (used to indicate whether the buffer is in the buffer). There are messages) and some other status bits (message check error, message type indication, etc.). When it is detected that there is an error in the data in the cache, an existing technique is to mark the wrong data block as poisoned data, and then there are two ways to deal with it, one is to reset the entire system; the other is to make the data in error normal. The data is processed, and the erroneous data is not marked any after the erroneous data is detected. However, in implementing the above-described processing of the failed data in the memory, there are at least the following problems:
若读取到失效数据后对系统进行复位, 那么会导致系统上的业务中 断;若把失效的数据当做正常的数据来处理则会导致一些不可预期的后果。 发明内容  If the system is reset after reading the failed data, it will cause the service interruption on the system; if the invalid data is treated as normal data, it will lead to some unpredictable consequences. Summary of the invention
本发明的实施例提供一种处理失效报文的方法、 网络设备和处理 器, 能够在緩存中的报文已经失效的情况下, 指示所述失效的报文所在的 緩存为空, 以便丟弃失效的报文, 从而避免了系统的复位或将失效数据当 做正常数据来处理带来的影响, 提高了系统的可靠性。 The embodiment of the present invention provides a method for processing a failure message, a network device, and a processor, which can indicate that the cache of the invalid packet is empty in case the packet in the cache has expired, so as to be discarded. Invalid message, thus avoiding system reset or failure data The impact of normal data processing has improved the reliability of the system.
为达到上述目 的, 本发明的实施例采用如下技术方案: 第一方面, 提供一种处理失效报文的方法, 基于网络设备一侧, 所述 方法包括:  In order to achieve the above, the embodiment of the present invention adopts the following technical solutions: In a first aspect, a method for processing a failure packet is provided, where the method includes:
为计算机内存中的緩存设置对应的中毒指示标识;  Setting a corresponding poisoning indication identifier for the cache in the computer memory;
在接收到报文后, 若所述报文失效, 则在将该失效报文搬移至所述计 算机内存中的緩存后, 将所述失效报文所在緩存对应的中毒指示标识标记 为中毒, 以表示所述緩存中的报文中毒。  After receiving the message, if the message is invalid, after the invalid message is moved to the cache in the computer memory, the poisoning indication flag corresponding to the cache of the invalid message is marked as poisoned, Indicates that the packets in the cache are poisoned.
在第一种可能的实现方式中, 结合第一方面, 所述为计算机内存 中的緩存设置对应的中毒指示标识包括:  In a first possible implementation, in combination with the first aspect, the setting of the corresponding poisoning indication identifier for the cache in the computer memory includes:
在所述计算机内存中的緩存对应的緩存描述符中设置中毒指示标 识, 其中所述緩存描述符还包括报文满标识、 緩存基地址指针或者所述 緩存描述符还包括读索引、 写索引和緩存基地址指针; 或  Setting a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory, wherein the cache descriptor further includes a message full identifier, a cache base address pointer, or the cache descriptor further includes a read index, a write index, and Cache base address pointer; or
在所述计算机的另一块内存中, 为所述緩存描述符对应设置中毒指 示标识, 其中所述緩存描述符包括报文满标识、 緩存基地址指针; 或 在所述计算机的另一块内存中, 为所有的緩存描述符设置有同一个 中毒指示标识, 其中每个緩存描述符包括报文满标识、 緩存基地址指针 其中, 所述另一块内存独立于所述緩存描述符所在的内存; 或  And setting a poisoning indication identifier corresponding to the cache descriptor in another memory of the computer, where the cache descriptor includes a message full identifier, a cache base address pointer, or in another memory of the computer, The same poisoning indication identifier is set for all the cache descriptors, wherein each cache descriptor includes a message full identifier, a cache base address pointer, and the other memory is independent of the memory of the cache descriptor; or
在所述计算机内存中的緩存的起始位置前面设置中毒指示标识, 所述 緩存对应的緩存描述符包括报文满标识、 緩存基地址指针。  A poisoning indication identifier is set in front of a start position of the cache in the computer memory, and the cache descriptor corresponding to the cache includes a message full identifier and a cache base address pointer.
在第二种可能的实现方式中,结合第一方面或第一方面的第一 种可能的实现方式, 若所述报文失效, 则在将该失效报文搬移至所述计 算机内存中的緩存后, 将所述失效报文所在緩存对应的中毒指示标识标 记为中毒包括:  In a second possible implementation manner, in combination with the first aspect or the first possible implementation manner of the first aspect, if the message fails, the invalid message is moved to a cache in the computer memory After that, marking the poisoning indication identifier corresponding to the cache in which the invalid packet is located as poisoning includes:
若在将所述报文向所述计算机内存中的緩存搬移的过程中, 若所述 报文的任意一帧失效, 则确定所述报文失效;  If the frame is invalidated in the process of moving the message to the cache in the computer memory, if the frame of the message is invalid, the message is determined to be invalid;
将所述失效报文所在緩存对应的中毒指示标识标记为中毒。  The poisoning indication identifier corresponding to the cache in which the invalid packet is located is marked as poisoned.
第二方面, 提供另一种处理失效报文的方法, 基于处理器一侧, 所述方法包括:  In a second aspect, another method for processing a failure message is provided. Based on a processor side, the method includes:
在读取报文时, 若计算机内存中的緩存对应的中毒指示标识标记为中 毒, 则将所述緩存重写, 重新获取校验值, 并指示所述緩存为空。 When reading a message, if the poisoning indication flag corresponding to the cache in the computer memory is marked as medium To poison, the cache is rewritten, the check value is retrieved, and the cache is indicated to be empty.
在第一种可能的实现方式中, 结合第二方面, 当所述中毒指示标识设 置在所述緩存对应的緩存描述符中,且所述緩存描述符还包括报文满标识、 緩存基地址指针时, 所述将所述緩存重写, 重新获取校验值, 并指示所述 緩存为空包括:  In a first possible implementation, in combination with the second aspect, when the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a message full identifier, a cache base address pointer Rewriting the cache, reacquiring the check value, and indicating that the cache is empty includes:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将所述緩存描述符中的报文满标识设置为空, 以指示描述符对应的緩 存为空。  The message full identifier in the cache descriptor is set to null to indicate that the cache corresponding to the descriptor is empty.
在第二种可能的实现方式中, 结合第二方面, 当所述中毒指示标识设 置在所述緩存对应的緩存描述符中, 且所述緩存描述符还包括读索引、 写 索引和緩存基地址指针时, 所述将所述緩存重写, 重新获取校验值, 并指 示所述緩存为空包括:  In a second possible implementation manner, in combination with the second aspect, when the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a read index, a write index, and a cache base address. When the pointer is used, the rewriting the cache, reacquiring the check value, and indicating that the cache is empty includes:
将所述中毒指示标识设置为中毒的对应的緩存重写, 重新获取校验 值;  Setting the poisoning indication flag to a corresponding cache rewrite of poisoning, and re-acquiring the check value;
将所述读索引指向下一个待读的緩存描述符。  The read index is directed to the next cache descriptor to be read.
在第三种可能的实现方式中, 结合第二方面, 当所述中毒指示标识设 置在另一块内存中时, 所述将所述緩存重写, 重新获取校验值, 并指示所 述緩存为空包括:  In a third possible implementation, in combination with the second aspect, when the poisoning indication identifier is set in another memory, the buffer is rewritten, the check value is reacquired, and the cache is indicated as Empty includes:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将所述緩存描述符中的报文满标识设置为空, 以指示所述緩存为空; 其中, 所述另一块内存独立于所述緩存描述符所在的内存。  Setting a message full identifier in the cache descriptor to be empty to indicate that the cache is empty; wherein the another block of memory is independent of a memory in which the cache descriptor is located.
在第四种可能的实现方式中, 结合第二方面, 当所述中毒指示标识设 置在另一块内存中, 且所有的緩存描述符对应同一个中毒指示标识时, 所 述将所述緩存重写, 重新获取校验值, 并指示所述緩存为空包括:  In a fourth possible implementation, in combination with the second aspect, when the poisoning indication identifier is set in another memory, and all the cache descriptors correspond to the same poisoning indication identifier, the buffer is rewritten. , re-acquire the check value, and indicate that the cache is empty, including:
将所述同一个中毒指示标识对应的所有緩存描述符所对应的緩存都 重写, 重新获取校验值;  Rewriting the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier, and re-acquiring the check value;
将所述同一个中毒指示标识对应的所有緩存描述符中的报文满标识 都设置为空, 以指示所述同一个中毒指示标识对应的所有緩存描述符对应 的緩存为空; Setting the full identifier of the packet in all the cache descriptors corresponding to the same poisoning indication identifier to be empty, to indicate that all cache descriptors corresponding to the same poisoning indication identifier correspond to The cache is empty;
其中, 所述另一块内存独立于所述緩存描述符所在的内存。  The other memory is independent of the memory in which the cache descriptor is located.
在第五种可能的实现方式中, 结合第二方面, 当所述中毒指示标识设 置在所述计算机内存中的緩存的起始位置前面时, 所述将所述緩存重写, 重新获取校验值, 并指示所述緩存为空包括:  In a fifth possible implementation, in combination with the second aspect, when the poisoning indication identifier is set in front of a start position of a cache in the computer memory, the buffer is rewritten, and the check is re-acquired. a value, and indicating that the cache is empty includes:
将中毒指示标识设置为中毒的緩存重写, 重新获取校验值; 将所述緩存对应的緩存描述符中的报文满标识设置为空, 以指示所述 緩存描述符对应的緩存为空。  Setting the poisoning indication flag to the poisoned cache rewrite, re-acquiring the check value; setting the message full identifier in the cache descriptor corresponding to the cache to be empty, to indicate that the cache corresponding to the cache descriptor is empty.
在第五种可能的实现方式中, 结合第二方面或第二方面的第一种可能 的实现方式至第五种可能的实现方式, 所述计算机内存中的緩存的大小为 独立校验数据单元的整数倍, 且所述緩存的基地址也为独立校验数据单元 的整数倍。  In a fifth possible implementation, in combination with the second aspect or the first possible implementation manner of the second aspect to the fifth possible implementation manner, the size of the cache in the computer memory is an independent verification data unit. An integer multiple of , and the base address of the cache is also an integer multiple of the independent check data unit.
第三方面, 提供一种网络设备, 所述网络设备包括:  A third aspect provides a network device, where the network device includes:
中毒标识设置单元,用于为计算机内存中的緩存设置对应的中毒指 示标识;  a poisoning identifier setting unit, configured to set a corresponding poisoning indication identifier for a cache in a computer memory;
中毒标识管理单元, 用于在接收到报文后, 若所述报文失效, 则在 将该失效报文搬移至所述计算机内存中的緩存后, 将所述失效报文所在緩 存对应的中毒指示标识标记为中毒, 以表示所述緩存中的报文中毒。  a poisoning identifier management unit, configured to: after receiving the message, if the message is invalid, after the invalid message is moved to a cache in the computer memory, the poisoning corresponding to the cache of the invalid message is poisoned The indication identifier is marked as poisoned to indicate that the message in the cache is poisoned.
在第一种可能的实现方式, 结合第三方面, 所述中毒标识设置 单元具体用于:  In a first possible implementation manner, in combination with the third aspect, the poisoning identifier setting unit is specifically configured to:
在所述计算机内存中的緩存对应的緩存描述符中设置中毒指示标 识, 其中所述緩存描述符还包括报文满标识、 緩存基地址指针或者所述 緩存描述符还包括读索引、 写索引和緩存基地址指针; 或  Setting a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory, wherein the cache descriptor further includes a message full identifier, a cache base address pointer, or the cache descriptor further includes a read index, a write index, and Cache base address pointer; or
在所述计算机的另一块内存中, 为所述緩存描述符对应设置中毒指 示标识, 其中所述緩存描述符包括报文满标识、 緩存基地址指针; 或 在所述计算机的另一块内存中, 为所有的緩存描述符设置有同一个 中毒指示标识, 其中每个緩存描述符包括报文满标识、 緩存基地址指针 其中, 所述另一块内存独立于所述緩存描述符所在的内存; 或  And setting a poisoning indication identifier corresponding to the cache descriptor in another memory of the computer, where the cache descriptor includes a message full identifier, a cache base address pointer, or in another memory of the computer, The same poisoning indication identifier is set for all the cache descriptors, wherein each cache descriptor includes a message full identifier, a cache base address pointer, and the other memory is independent of the memory of the cache descriptor; or
在所述计算机内存中的緩存的起始位置前面设置中毒指示标识, 所述 緩存对应的緩存描述符包括报文满标识、 緩存基地址指针。 在第一种可能的实现方式, 结合第三方面或第三方面的第一种 可能的实现方式, 所述中毒标识管理单元包括: A poisoning indication identifier is set in front of a start position of the cache in the computer memory, and the cache descriptor corresponding to the cache includes a message full identifier and a cache base address pointer. In a first possible implementation manner, in combination with the third aspect or the first possible implementation manner of the third aspect, the poisoning identifier management unit includes:
失效检测子单元, 用于若在将所述报文向所述计算机内存中的緩存 搬移的过程中, 若所述报文的任意一帧失效, 则确定所述报文失效;  a failure detecting subunit, configured to determine that the message is invalid if any frame of the message is invalid during the process of moving the message to the cache in the computer memory;
中毒标记子单元, 用于将所述失效报文所在緩存对应的中毒指示标 识标记为中毒。  The poisoning flag sub-unit is configured to mark the poisoning indication corresponding to the cache in which the invalid message is located as poisoning.
第四方面, 提供一种处理器, 所述处理器包括:  A fourth aspect provides a processor, where the processor includes:
緩存处理单元, 用于在读取报文时, 若计算机内存中的緩存对应的 中毒指示标识标记为中毒, 则将所述緩存重写, 重新获取校验值, 并指示 所述緩存为空。  The cache processing unit is configured to: when the message is read, if the poisoning indication flag corresponding to the cache in the computer memory is marked as poisoned, the buffer is rewritten, the check value is re-acquired, and the cache is indicated to be empty.
在第一种可能的实现方式中, 结合第四方面, 当所述中毒指示标 识设置在所述緩存对应的緩存描述符中, 且所述緩存描述符还包括报文满 标识、 緩存基地址指针时, 所述緩存处理单元具体用于:  In a first possible implementation, in combination with the fourth aspect, when the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a message full identifier, a cache base address pointer. The cache processing unit is specifically configured to:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将所述緩存描述符中的报文满标识设置为空, 以指示描述符对应的緩 存为空。  The message full identifier in the cache descriptor is set to null to indicate that the cache corresponding to the descriptor is empty.
在第二种可能的实现方式中, 结合第四方面, 当所述中毒指示标 识设置在所述緩存对应的緩存描述符中,且所述緩存描述符还包括读索引、 写索引和緩存基地址指针时, 所述緩存处理单元具体用于:  In a second possible implementation manner, in combination with the fourth aspect, when the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a read index, a write index, and a cache base address. When the pointer is used, the cache processing unit is specifically configured to:
将所述中毒指示标识设置为中毒的对应的緩存重写, 重新获取校验 值;  Setting the poisoning indication flag to a corresponding cache rewrite of poisoning, and re-acquiring the check value;
将所述读索引指向下一个待读的緩存描述符。  The read index is directed to the next cache descriptor to be read.
在第三种可能的实现方式中, 结合第四方面, 当所述中毒指示标 识设置在另一块内存中时, 所述緩存处理单元具体用于:  In a third possible implementation, in combination with the fourth aspect, when the poisoning indication is set in another memory, the cache processing unit is specifically configured to:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将所述緩存描述符中的报文满标识设置为空, 以指示所述緩存为空; 其中, 所述另一块内存独立于所述緩存描述符所在的内存。  Setting a message full identifier in the cache descriptor to be empty to indicate that the cache is empty; wherein the another block of memory is independent of a memory in which the cache descriptor is located.
在第四种可能的实现方式中, 结合第四方面, 当所述中毒指示标 识设置在另一块内存中,且所有的緩存描述符对应同一个中毒指示标识时, 所述緩存处理单元具体用于: In a fourth possible implementation, in combination with the fourth aspect, when the poisoning indicator When the cache is set in another memory, and all the cache descriptors correspond to the same poison indication indicator, the cache processing unit is specifically configured to:
将所述同一个中毒指示标识对应的所有緩存描述符所对应的緩存都 重写, 重新获取校验值;  Rewriting the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier, and re-acquiring the check value;
将所述同一个中毒指示标识对应的所有緩存描述符中的报文满标识 都设置为空, 以指示所述同一个中毒指示标识对应的所有緩存描述符对应 的緩存为空;  Setting a full packet identifier of all the cache descriptors corresponding to the same poisoning indication identifier to be empty, to indicate that the cache corresponding to all cache descriptors corresponding to the same poisoning indication identifier is empty;
其中, 所述另一块内存独立于所述緩存描述符所在的内存。  The other memory is independent of the memory in which the cache descriptor is located.
在第五种可能的实现方式中, 结合第四方面, 当所述中毒指示标 识设置在所述计算机内存中的緩存的起始位置前面时, 所述緩存处理单 元具体用于:  In a fifth possible implementation, in combination with the fourth aspect, when the poisoning indication is set in front of a start position of a cache in the computer memory, the cache processing unit is specifically configured to:
将中毒指示标识设置为中毒的緩存重写, 重新获取校验值;  Set the poisoning indicator to the cached rewrite of poisoning, and re-acquire the check value;
将所述緩存对应的緩存描述符中的报文满标识设置为空, 以指示所述 緩存描述符对应的緩存为空。  The packet full identifier in the cache descriptor corresponding to the cache is set to be empty, to indicate that the cache corresponding to the cache descriptor is empty.
第五方面, 提供一种网络设备, 包括接收器、 发射器、 存储器和总 线, 所述网络设备还包括:  In a fifth aspect, a network device is provided, including a receiver, a transmitter, a memory, and a bus, where the network device further includes:
处理器, 用于为计算机内存中的緩存设置对应的中毒指示标识; 所述处理器还用于在接收到报文后, 若所述报文失效, 则在将该失效 报文搬移至所述计算机内存中的緩存后, 将所述失效报文所在緩存对应的 中毒指示标识标记为中毒, 以表示所述緩存中的报文中毒。  a processor, configured to set a corresponding poisoning indication identifier for the cache in the computer memory; the processor is further configured to: after receiving the packet, if the packet fails, move the invalid packet to the After the cache in the memory of the computer, the poisoning indication identifier corresponding to the cache in which the invalidation packet is located is marked as poisoned to indicate that the packet in the cache is poisoned.
在第一种可能的实现方式中, 结合第五方面, 所述处理器具体 用于:  In a first possible implementation, in combination with the fifth aspect, the processor is specifically configured to:
在所述计算机内存中的緩存对应的緩存描述符中设置中毒指示标 识, 其中所述緩存描述符还包括报文满标识、 緩存基地址指针或者所述 緩存描述符还包括读索引、 写索引和緩存基地址指针; 或  Setting a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory, wherein the cache descriptor further includes a message full identifier, a cache base address pointer, or the cache descriptor further includes a read index, a write index, and Cache base address pointer; or
在所述计算机的另一块内存中, 为所述緩存描述符对应设置中毒指 示标识, 其中所述緩存描述符包括报文满标识、 緩存基地址指针; 或  And setting a poisoning indication identifier corresponding to the cache descriptor in another memory of the computer, where the cache descriptor includes a message full identifier and a cache base address pointer; or
在所述计算机的另一块内存中, 为所有的緩存描述符设置有同一个 中毒指示标识, 其中每个緩存描述符包括报文满标识、 緩存基地址指针 其中, 所述另一块内存独立于所述緩存描述符所在的内存; 或 在所述计算机内存中的緩存的起始位置前面设置中毒指示标识, 所述 緩存对应的緩存描述符包括报文满标识、 緩存基地址指针。 In another memory of the computer, all the cache descriptors are set with the same poison indication indicator, wherein each cache descriptor includes a message full identifier, a cache base address pointer, and the other memory is independent of the The memory in which the cache descriptor is located; or A poisoning indication identifier is set in front of a start position of the cache in the computer memory, and the cache descriptor corresponding to the cache includes a message full identifier and a cache base address pointer.
在第一种可能的实现方式中,结合第五方面或第五方面的第一 种可能的实现方式, 所述处理器具体用于:  In a first possible implementation, in combination with the fifth aspect or the first possible implementation manner of the fifth aspect, the processor is specifically configured to:
若在将所述报文向所述计算机内存中的緩存搬移的过程中, 若所述 报文的任意一帧失效, 则确定所述报文失效;  If the frame is invalidated in the process of moving the message to the cache in the computer memory, if the frame of the message is invalid, the message is determined to be invalid;
将所述失效报文所在緩存对应的中毒指示标识标记为中毒。  The poisoning indication identifier corresponding to the cache in which the invalid packet is located is marked as poisoned.
第六方面, 提供一种处理器, 所述处理器用于在读取报文时, 若 计算机内存中的緩存对应的中毒指示标识标记为中毒,则将所述緩存重写, 重新获取校验值, 并指示所述緩存为空。  According to a sixth aspect, a processor is provided, where the processor is used to rewrite the buffer and re-acquire the check value if the poisoning indication flag corresponding to the cache in the computer memory is marked as poisoned when the message is read. And indicates that the cache is empty.
在第一种可能的实现方式中, 结合第六方面, 当所述中毒指示 标识设置在所述緩存对应的緩存描述符中, 且所述緩存描述符还包括报 文满标识、 緩存基地址指针时, 所述处理器具体用于:  In a first possible implementation, in combination with the sixth aspect, when the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a message full identifier, a cache base address pointer. The processor is specifically configured to:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将所述緩存描述符中的报文满标识设置为空, 以指示描述符对应的緩 存为空。  The message full identifier in the cache descriptor is set to null to indicate that the cache corresponding to the descriptor is empty.
在第二种可能的实现方式中, 结合第六方面, 当所述中毒指示 标识设置在所述緩存对应的緩存描述符中, 且所述緩存描述符还包括读 索引、 写索引和緩存基地址指针时, 所述处理器具体用于:  In a second possible implementation manner, in combination with the sixth aspect, when the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a read index, a write index, and a cache base address. When the pointer is used, the processor is specifically configured to:
将所述中毒指示标识设置为中毒的对应的緩存重写, 重新获取校验 值;  Setting the poisoning indication flag to a corresponding cache rewrite of poisoning, and re-acquiring the check value;
将所述读索引指向下一个待读的緩存描述符。  The read index is directed to the next cache descriptor to be read.
在第三种可能的实现方式中, 结合第六方面, 当所述中毒指示 标识设置在另一块内存中时, 所述处理器具体用于:  In a third possible implementation, in combination with the sixth aspect, when the poisoning indication identifier is set in another memory, the processor is specifically configured to:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将所述緩存描述符中的报文满标识设置为空, 以指示所述緩存为空; 其中, 所述另一块内存独立于所述緩存描述符所在的内存。  Setting a message full identifier in the cache descriptor to be empty to indicate that the cache is empty; wherein the another block of memory is independent of a memory in which the cache descriptor is located.
在第四种可能的实现方式中, 结合第六方面, 当所述中毒指示 标识设置在另一块内存中, 且所有的緩存描述符对应同一个中毒指示标 识时, 所述处理器具体用于: In a fourth possible implementation, in combination with the sixth aspect, when the poisoning indication identifier is set in another memory, and all cache descriptors correspond to the same poisoning indicator When the time is known, the processor is specifically configured to:
将所述同一个中毒指示标识对应的所有緩存描述符所对应的緩存都 重写, 重新获取校验值;  Rewriting the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier, and re-acquiring the check value;
将所述同一个中毒指示标识对应的所有緩存描述符中的报文满标识 都设置为空, 以指示所述同一个中毒指示标识对应的所有緩存描述符对应 的緩存为空。  The packet full identifier of all the cache descriptors corresponding to the same poisoning indication identifier is set to be empty, to indicate that the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier is empty.
在第五种可能的实现方式中, 结合第六方面, 当所述中毒指示 标识设置在所述计算机内存中的緩存的起始位置前面时, 所述处理器具 体用于:  In a fifth possible implementation, in combination with the sixth aspect, when the poisoning indication identifier is set in front of a start position of a cache in the computer memory, the processor is specifically configured to:
将中毒指示标识设置为中毒的緩存重写, 重新获取校验值;  Set the poisoning indicator to the cached rewrite of poisoning, and re-acquire the check value;
将所述緩存对应的緩存描述符中的报文满标识设置为空, 以指示所述 緩存描述符对应的緩存为空。  The packet full identifier in the cache descriptor corresponding to the cache is set to be empty, to indicate that the cache corresponding to the cache descriptor is empty.
在第六种可能的实现方式中, 结合第六方面或第六方面的第一 种可能的实现方式至第六种可能的实现方式, 所述计算机内存中的緩 存的大小为独立校验数据单元的整数倍, 且所述緩存的基地址也为独立校 验数据单元的整数倍。  In a sixth possible implementation, in combination with the sixth aspect or the first possible implementation manner of the sixth aspect to the sixth possible implementation manner, the size of the cache in the computer memory is an independent verification data unit. An integer multiple of , and the base address of the cache is also an integer multiple of the independent check data unit.
本发明的实施例提供一种处理失效报文的方法、 网络设备和处理器, 通过为计算机内存中的緩存对应设置报文中毒指示标志, 并且在网络设备 接收到报文后, 将失效报文所在的緩存对应的中毒指示标识设置为中毒, 并将失效报文所在緩存重写, 而后指示该緩存为空, 这样能够在緩存中的 报文已经失效的情况下, 指示该报文已经失效, 并丟弃失效的报文, 从而 避免了系统的复位或将失效数据当做正常数据来处理带来的影响, 提高了 系统的可靠性。  An embodiment of the present invention provides a method, a network device, and a processor for processing a failure message, by setting a message poisoning indication flag corresponding to a cache in a computer memory, and after the network device receives the message, the invalid message is The poisoning indication flag corresponding to the cache is set to be poisoned, and the buffer of the invalidation message is rewritten, and then the buffer is indicated to be empty, so that when the buffered packet has expired, the packet is invalidated. The invalid packets are discarded, thereby avoiding the reset of the system or treating the invalid data as normal data, thereby improving the reliability of the system.
附图说明 DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下 面将对实施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于 本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以 根据这些附图获得其他的附图。  In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图 1 为本发明实施例提供的一种处理失效报文的方法流程示意 图; FIG. 1 is a schematic flowchart of a method for processing an invalid packet according to an embodiment of the present invention; Figure
图 2为本发明实施例提供的另一种处理失效报文的方法流程示意 图;  2 is a schematic flow chart of another method for processing a failure message according to an embodiment of the present invention;
图 3 为本发明另一实施例提供的一种处理失效报文的方法的流 程示意图;  FIG. 3 is a schematic flowchart of a method for processing a failed packet according to another embodiment of the present invention;
图 4为本发明另一实施例提供的緩存描述符以及緩存的结构示 意图一;  FIG. 4 is a schematic diagram showing a structure of a cache descriptor and a cache according to another embodiment of the present invention; FIG.
图 5 为本发明另一实施例提供的緩存描述符以及緩存的结构示 意图二;  FIG. 5 is a schematic diagram 2 of a cache descriptor and a cache according to another embodiment of the present invention; FIG.
图 6为本发明另一实施例提供的緩存描述符以及緩存的结构示 意图三;  FIG. 6 is a schematic diagram 3 of a cache descriptor and a cache according to another embodiment of the present invention; FIG.
图 7为本发明另一实施例提供的緩存描述符以及緩存的结构示 意图四;  FIG. 7 is a schematic structural diagram 4 of a cache descriptor and a cache according to another embodiment of the present invention; FIG.
图 8为本发明另一实施例提供的緩存描述符以及緩存的结构示 意图五;  FIG. 8 is a schematic diagram 5 of a cache descriptor and a cache according to another embodiment of the present invention; FIG.
图 9为本发明又一实施例提供的一种网络设备的结构示意图; 图 10为本发明又一实施例提供的另一种网络设备结构示意图; 图 1 1 为本发明又一实施例提供的一种处理器的结构示意图; 图 12 为本发明又一实施例提供的另一种网络设备的结构示意 图;  FIG. 9 is a schematic structural diagram of a network device according to another embodiment of the present invention; FIG. 10 is a schematic structural diagram of another network device according to another embodiment of the present invention; A schematic structural diagram of a processor; FIG. 12 is a schematic structural diagram of another network device according to another embodiment of the present invention;
图 13为本发明另一实施例提供的另一种处理器的示意图。  FIG. 13 is a schematic diagram of another processor according to another embodiment of the present invention.
具体实施方式 detailed description
下面将结合本发明实施例中的附图, 对本发明实施例中的技术 方案进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明 一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本 领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他 实施例, 都属于本发明保护的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
首先, 需要说明的是, 处理器与网络设备之间的报文的交互结构一般 包括緩存 (Buffer ) 和緩存描述符 ( Buffer Descriptor, BD ) , 该緩存指的 是计算机内存中的緩存,即该緩存指的是计算机内存中存放报文的内存块, 一般计算机的内存中可以划分出多个緩存。 First, it should be noted that the interaction structure of the message between the processor and the network device generally includes a buffer (Buffer) and a Buffer Descriptor (BD), and the cache refers to It is a cache in the memory of the computer, that is, the cache refers to a memory block in which the message is stored in the computer memory, and a plurality of caches can be divided into the memory of the general computer.
本发明实施例提供一种处理失效报文的方法, 基于网络设备一侧, 如图 1所示, 所述方法包括:  An embodiment of the present invention provides a method for processing a failure packet, which is based on a network device side. As shown in FIG. 1, the method includes:
S 101、 为计算机内存中的緩存设置对应的中毒指示标识。  S101. Set a corresponding poisoning indication identifier for the cache in the computer memory.
其中, 计算机内存中的緩存对应分配中毒指示标识空间, 这个空间就 用来设置中毒指示标识。 系统完成初始化时, 将各个緩存对应的中毒指示 标识的初始值都为未中毒。  The cache in the computer memory corresponds to the allocation poisoning indication identifier space, and the space is used to set the poisoning indication identifier. When the system completes initialization, the initial values of the poisoning indications corresponding to each cache are not poisoned.
S 102、 网络设备在接收到报文后, 若报文失效, 则在将该失效报文搬 移至计算机内存中的緩存后, 将失效报文所在緩存对应的中毒指示标识标 记为中毒, 以表示緩存中的报文中毒。  S102. After receiving the packet, if the packet is invalid, the network device marks the poisoning indication flag corresponding to the cache of the invalid packet as poisoning after the invalid packet is moved to the cache in the computer memory, to indicate that the packet is invalid. The message in the cache is poisoned.
本发明实施例还提供另一种处理失效报文的方法, 基于处理器一 侧, 如图 2所示, 所述方法包括:  The embodiment of the present invention further provides another method for processing a failure message. Based on the processor side, as shown in FIG. 2, the method includes:
S201、 处理器在读取报文时, 若计算机内存中的緩存对应的中毒指示 标识标记为中毒, 则将緩存重写, 重新获取校验值, 并指示緩存为空。  S201. When the processor reads the message, if the poisoning indication flag corresponding to the cache in the computer memory is marked as poisoned, the buffer is rewritten, the check value is re-acquired, and the cache is indicated to be empty.
本发明的实施例提供一种处理失效报文的方法,通过为计算机内存中 的緩存对应设置报文中毒指示标志, 并且在网络设备接收到报文后, 将失 效报文所在的緩存对应的中毒指示标识设置为中毒, 并将失效报文所在緩 存重写, 而后指示该緩存为空, 这样能够在緩存中的报文已经失效的情况 下, 指示该报文已经失效, 并丟弃失效的报文, 从而避免了系统的复位或 将失效数据当做正常数据来处理带来的影响, 提高了系统的可靠性。 本发明另一实施例提供一种处理失效报文的方法, 如图 3 所示, 该 方法包括: 首先, 需要说明的是, 在本发明中计算机内存中的緩存的大小为独 立校验数据单元的整数倍, 且每个緩存的基地址也为独立校验数据单元 的整数倍。  An embodiment of the present invention provides a method for processing a failure message, by setting a packet poisoning indication flag corresponding to a cache in a computer memory, and after the network device receives the message, the poisoning corresponding to the cache in which the invalid message is located is poisoned. The indication flag is set to be poisoned, and the buffer of the invalidation message is rewritten, and then the buffer is indicated to be empty, so that when the buffered message has expired, the packet is invalidated, and the invalid report is discarded. Therefore, the system reset is avoided or the invalid data is treated as normal data to improve the reliability of the system. Another embodiment of the present invention provides a method for processing a failed packet. As shown in FIG. 3, the method includes: First, it should be noted that, in the present invention, the size of the cache in the computer memory is an independent check data unit. An integer multiple of each, and the base address of each cache is also an integer multiple of the independent parity data unit.
示例性的, 在存储器中, 数据都是按照固定大小的单元来进行校验 的, 例如 32字节的数据会有额外的 4个校验字节, 在这里, 存储器的独 立校验数据单元大小就为 32字节。 假设内存中独立校验数据单元的大小 为 S , 则緩存的基地址是 S的整数倍即为 M*S , 緩存的大小也是 S的整 数倍, 即为 N*S , 其中 M、 N都是任意正整数。 这样的好处是, 能够保 证每一个独立校验单元的内存只会被一个报文使用, 也就是说一个独立 校验单元可以完整的位于一个緩存中, 不会出现该独立校验单元的一部 分在上一个緩存, 另一部分在下一个緩存中的情况, 从而避免了这种情 况下校验复杂的问题。 Exemplarily, in the memory, the data is verified according to a fixed size unit, for example, 32 bytes of data will have an additional 4 check bytes, where the memory is unique The parity data unit size is 32 bytes. Assume that the size of the independent check data unit in memory is S, then the base address of the cache is an integer multiple of S, that is, M*S, and the size of the buffer is also an integer multiple of S, that is, N*S, where M and N are Any positive integer. This has the advantage of ensuring that the memory of each individual check unit is only used by one message, that is, an independent check unit can be completely located in a cache, and a part of the independent check unit does not appear. The previous cache, the other part in the next cache, thus avoiding the problem of complex verification in this case.
S301、 为计算机内存中的緩存设置对应的中毒指示标识。  S301. Set a corresponding poisoning indication identifier for the cache in the computer memory.
具体的实现方式为, 为各个计算机内存中的緩存对应分配中毒指示 标识空间。 并且在系统完成初始化时, 各个计算机内存中的緩存对应设 置好中毒指示标识的初始值都为未中毒。  The specific implementation manner is: assigning a poisoning indication identifier space to a cache corresponding to each computer memory. And when the system is initialized, the initial value of the poisoning indication flag corresponding to the cache in each computer memory is not poisoned.
其中, 中毒指示标识可以设置在每个计算机内存中的緩存对应的緩 存描述符中, 或者也可以设置在每块计算机内存中的緩存中, 还可以设 置在另一块独立内存中, 所述另一块内存独立于緩存描述符所在的内存。  The poisoning indicator may be set in a cache descriptor corresponding to the cache in each computer memory, or may be set in a cache in the memory of each computer, or may be set in another independent memory, the other block The memory is independent of the memory in which the cache descriptor is located.
具体的, 可以分为以下几种方式, 包括:  Specifically, it can be divided into the following ways, including:
第一种, 在计算机内存中的緩存对应的緩存描述符中设置中毒指示 标识, 其中计算机内存中的緩存对应的緩存描述符还包括报文满标识、 緩存基地址指针。  The first type is to set a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory, wherein the cache descriptor corresponding to the cache in the computer memory further includes a message full identifier and a cache base address pointer.
示例性的, 在该緩存描述符中设置中毒指示标识时, 该緩存描述符 的结构以及存放报文的计算机内存中的緩存如图 4 所示, 每个计算机内 存中的緩存对应的緩存描述符中包括一个报文中毒指示标志 P、一个表示 緩存中是否有报文满标志 F、以及一个緩存基地址指针以及根据其他需要 而设计的 state„  Exemplarily, when the poisoning indication identifier is set in the cache descriptor, the structure of the cache descriptor and the cache in the computer memory for storing the message are as shown in FIG. 4, and the cache descriptor corresponding to the cache in each computer memory It includes a message poisoning indicator P, a message indicating whether there is a message full flag F in the cache, and a cache base address pointer and a state designed according to other needs.
第二种,在计算机内存中的緩存对应的緩存描述符中设置中毒指示标 识, 其中计算机内存中的緩存对应的緩存描述符还包括緩存描述符还包括 读索引 (Read Index ) 、 写索引 ( Write Index ) 和緩存基地址指针。 其中, 在每搬移一个报文到计算机内存中的緩存后, 都将写索引移至下一个待读 的緩存描述符, 在每接受处理完毕一个报文后, 都将读索引移至下一个待 读的緩存描述符。  Secondly, a poisoning indication identifier is set in a cache descriptor corresponding to the cache in the computer memory, wherein the cache descriptor corresponding to the cache in the computer memory further includes a cache descriptor, and further includes a read index (Read Index) and a write index (Write). Index ) and cache base address pointer. After each move of a message to the cache in the computer memory, the write index is moved to the next cache descriptor to be read, and after each message is processed, the read index is moved to the next wait. The cache descriptor read.
示例性的, 在计算机内存中的緩存对应的緩存描述符中设置中毒指 示标识时, 该緩存描述符的结构以及存放报文的计算机内存中的緩存如 图 5所示, 緩存的緩存描述符中包括一个报文中毒指示标志 P、一个緩存 基地址指针以及根据其他需要而设计的 state , 除此之外还包括读索引和 写索引。 Exemplarily, when the poisoning indication identifier is set in the cache descriptor corresponding to the cache in the computer memory, the structure of the cache descriptor and the cache in the computer memory for storing the message are as shown in FIG. 5, and the cached cache descriptor is in the cache descriptor. Includes a message poisoning indicator P, a cache The base address pointer and the state designed according to other needs, in addition to read index and write index.
第三种, 在计算机内的另一块独立内存中, 为緩存描述符对应设置 中毒指示标识, 其中緩存描述符包括报文满标识、 緩存基地址指针, 且 所述另一块内存独立于緩存描述符所在的内存。  Thirdly, in another independent memory in the computer, a poisoning indication identifier is set corresponding to the cache descriptor, wherein the cache descriptor includes a message full identifier, a cache base address pointer, and the another block of memory is independent of the cache descriptor. The memory in which it is located.
示例性的, 在计算机内的另一块独立内存中, 为緩存描述符对应设 置中毒指示标识时, 该緩存描述符的结构以及存放报文的计算机内存中 的緩存如图 6所示, 该緩存描述符包括一个报文满标识 F、 一个緩存基地 址指针以及根据其他需要而设计的 state。 而中毒指示标志 P设置在计算 机的另一块独立内存中, 且每个中毒指示标志 P 与一个緩存描述符相对 应。  Exemplarily, in another independent memory in the computer, when the poisoning indication identifier is set corresponding to the cache descriptor, the structure of the cache descriptor and the cache in the computer memory for storing the message are as shown in FIG. 6, and the cache description is The symbols include a message full identifier F, a cache base address pointer, and a state designed according to other needs. The poisoning indicator P is set in another independent memory of the computer, and each poisoning indicator P corresponds to a cache descriptor.
第四种, 在计算机的另一块独立内存中, 为计算机内存中的所有緩存 的緩存描述符设置有同一个中毒指示标识, 其中每个緩存描述符包括报文 满标识、 緩存基地址指针。  Fourth, in another independent memory of the computer, the same poisoning indication identifier is set for all cached cache descriptors in the computer memory, wherein each cache descriptor includes a message full identifier and a cache base address pointer.
示例性的,在所有緩存的緩存描述符设置有同一个中毒指示标识时, 緩存描述符的结构以及存放报文的计算机内存中的緩存如图 7 所示, 每 个緩存描述符包括一个报文满标识 F、一个緩存基地址指针以及根据其他 需要而设计的 state。 而中毒指示标志 P设置在网络设备的另一块独立内 存中, 且所有緩存描述符都共用这个中毒指示标志 P。  Exemplarily, when all cached cache descriptors are set with the same poison indication indication, the structure of the cache descriptor and the cache in the computer memory for storing the message are as shown in FIG. 7, and each cache descriptor includes a message. Full flag F, a cache base address pointer, and a state designed for other needs. The poisoning indicator P is set in another independent memory of the network device, and all the cache descriptors share the poisoning indicator P.
第五种,在计算机内存中的緩存的起始位置前面设置中毒指示标识, 计算机内存中的緩存对应的緩存描述符包括报文满标识、 緩存基地址指 针。  The fifth type is to set a poisoning indication mark in front of the starting position of the cache in the computer memory, and the cache descriptor corresponding to the cache in the computer memory includes the full identifier of the message and the cache base address pointer.
示例性的, 在计算机内存中的緩存的起始位置前面设置中毒指示标 识时, 该緩存描述符的结构以及存放报文的计算机内存中的緩存如图 8 所示, 緩存描述符包括一个报文满标识 F、一个緩存基地址指针以及根据 其他需要而设计的 state , 但是每个緩存描述符的中毒指示标志 P都对应 设置在每个緩存起始位置的前面。  Exemplarily, when the poisoning indication flag is set in front of the start position of the cache in the computer memory, the structure of the cache descriptor and the cache in the computer memory for storing the message are as shown in FIG. 8, and the cache descriptor includes a message. Full flag F, a cache base address pointer, and a state designed according to other needs, but the poisoning indicator P of each cache descriptor is set in front of each cache start position.
S302、 对计算机内存中的緩存以及緩存对应的緩存描述符进行初始 化。  S302. Initialize the cache in the computer memory and the cache descriptor corresponding to the cache.
具体的, 在初始化时, 将中毒指示标识 P设置为未中毒, 计算机内 存中的緩存对应的緩存描述符中的报文满标识 F设置为空, 并将緩存描 述符中的緩存基地址指针对应指向已分配好的緩存, 而緩存描述符中的 状态标志 State可以根据相关情况进行初始化。 Specifically, during initialization, the poisoning indication flag P is set to be unpoisoned, the full identifier F of the message in the cache descriptor corresponding to the cache in the computer memory is set to be empty, and the cache base address pointer in the cache descriptor is correspondingly Point to the allocated cache, but in the cache descriptor The status flag State can be initialized according to the relevant situation.
示例性的, 将中毒指示标识 P和报文满标识 F进行设置具体可以通 过二进制来表示, 对于中毒指示标识 P 而言, 可以用 0 表示未中毒, 1 表示中毒; 对于 ^艮文满标识 F而言, 可以用 0表示空, 1表示满。  For example, setting the poisoning indication identifier P and the message full identifier F may be specifically represented by a binary. For the poisoning indication identifier P, 0 may be used for non-poisoning, 1 for poisoning; In terms of, you can use 0 to indicate empty and 1 to be full.
而在在计算机内存中的緩存对应的緩存描述符中设置中毒指示标 识, 其中计算机内存中的緩存对应的緩存描述符还包括緩存描述符还包 括读索引、 写索引和緩存基地址指针时, 在进行初始化时, 需要将读索 引和写索引的值设置成相同的, 即读索引和写索引指向同一个緩存描述 符, 以表示所有緩存中都没有报文。  And setting a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory, wherein the cache descriptor corresponding to the cache in the computer memory further includes the cache descriptor further including a read index, a write index, and a cache base address pointer, When initializing, the values of the read index and the write index need to be set to be the same, that is, the read index and the write index point to the same cache descriptor to indicate that there are no messages in all the caches.
5303、 在网络设备接收到报文后, 判断报文在网络设备的緩存中是 否已经失效。  5303. After receiving the packet, the network device determines whether the packet has expired in the cache of the network device.
具体的, 在将报文向计算机内存中的緩存搬移的过程中, 若报文的 任意一帧失效, 则确定报文失效。  Specifically, in the process of moving the message to the cache in the computer memory, if any frame of the message is invalid, it is determined that the message is invalid.
5304、 若报文失效, 则将该失效报文所在緩存对应的中毒指示标识 设置为中毒, 以表示该緩存中的报文已经中毒。  If the packet is invalid, the poisoning indication flag corresponding to the cache of the invalidation packet is set to be poisoned, so that the packet in the cache is poisoned.
具体的, 可以通过以下方式实现:  Specifically, it can be implemented in the following ways:
由于在对每个计算机内存中的緩存以及緩存对应的緩存描述符进行 初始化时将每个緩存描述符中的 P设置为未中毒、 报文满标识 F设置为 空, 若报文失效, 则将该失效报文所在緩存对应的中毒指示标识 P 由未 中毒改为中毒, 例如将 P的值由 0变为 1。  Since the P in each cache descriptor is set to be unpoisoned and the message full flag F is set to be empty when the cache in each computer memory and the corresponding cache descriptor are initialized, if the message is invalid, then The poisoning indication flag P corresponding to the cache in which the invalidation message is located is changed from no poisoning to poisoning, for example, the value of P is changed from 0 to 1.
S305、若计算机内存中的緩存对应的中毒指示标识设置为中毒, 则将 该緩存重写, 重新获取校验值, 并指示该緩存为空。  S305. If the poisoning indication identifier corresponding to the cache in the computer memory is set to be poisoned, the buffer is rewritten, the check value is re-acquired, and the cache is indicated to be empty.
由于为计算机内存中的緩存对应设置中毒指示标识可以通过 S 201 中的五种方式实现, 所以对应的, 当中毒指示标识的位置不同时, 处理 方式也不尽相同, 具体的可以通过以下几种方式实现:  The setting of the poisoning indication for the cache corresponding to the memory in the computer can be implemented in the following five ways. Therefore, when the location of the poisoning indication is different, the processing manner is different. Way to achieve:
第一种, 当在计算机内存中的緩存对应的緩存描述符中设置中毒指 示标识, 且緩存描述符还包括报文满标识、 緩存基地址指针时:  The first type, when the poisoning indication flag is set in the cache descriptor corresponding to the cache in the computer memory, and the cache descriptor further includes the message full identifier and the cache base address pointer:
将中毒指示标识设置为中毒的緩存描述符对应的计算机内存中的緩 存重写, 重新获取校验值;  Setting the poisoning indication flag to a cache rewrite in the computer memory corresponding to the poisoned cache descriptor, and reacquiring the check value;
将緩存描述符中的报文满标识设置为空, 以该緩存描述符对应的计 算机内存中的緩存为空。  Set the message full identifier in the cache descriptor to null, and the cache in the computer memory corresponding to the cache descriptor is empty.
示例性的, 当处理器从计算机内存中的緩存读取报文时, 如果读到 指向当前正在被处理的緩存所对应的緩存描述符中的报文满标识 F 标志 为满, 则再判断指向当前正在被处理的緩存描述符中的报文中毒指示标 志 P是否指示为中毒, 若该中毒指示标志 P标志指示为中毒, 则将存储 当前中毒报文的整个緩存空间重写一遍, 让这一整段緩存重新计算校验 值,并通过设置正在被处理的緩存所对应的緩存描述符中的报文满标识 F 标志为空来指示该緩存为空, 以便把中毒的报文丟弃掉。 Exemplarily, when the processor reads a message from a cache in the computer memory, if it reads If the message full flag F flag in the cache descriptor corresponding to the cache currently being processed is full, then it is determined whether the message poisoning indicator P in the cache descriptor currently being processed is indicated as poisoning. If the poisoning indicator P flag indicates poisoning, the entire buffer space storing the current poisoning message is overwritten, and the entire buffer is recalculated, and the cache description corresponding to the cache being processed is set. The message full flag F in the character is empty to indicate that the buffer is empty, so that the poisoned message is discarded.
第二种, 当在计算机内存中的緩存对应的緩存描述符中设置中毒指 示标识中, 且緩存描述符还包括读索引、 写索引和緩存基地址指针时: 将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值; 将读索引指向下一个待读的緩存描述符。  Second, when the poisoning indication flag is set in the cache descriptor corresponding to the cache in the computer memory, and the cache descriptor further includes the read index, the write index, and the cache base address pointer: the poisoning indication flag is set to the poisoned cache. The cache corresponding to the descriptor is rewritten, and the check value is retrieved; the read index is pointed to the next cache descriptor to be read.
示例性的, 当处理器从计算机内存中的緩存读取报文时, 先判断读 索引和写索引是否指向同一个緩存描述符, 如果指向不同的緩存描述符, 则再判断指向当前正在被处理的緩存所对应的緩存描述符中的报文中毒 指示标志 P是否指示为中毒, 若该中毒指示标志 P标志指示为中毒, 则 将存储当前中毒报文的整个緩存空间重写一遍, 让这一整段緩存重新计 算校验值, 并且此时将读索引直接指向下一个待读的緩存描述符。  Exemplarily, when the processor reads a message from a cache in the computer memory, it first determines whether the read index and the write index point to the same cache descriptor. If it points to a different cache descriptor, then it is determined that the pointer is currently being processed. If the poisoning indication flag P in the cache descriptor corresponding to the cache is indicated as being poisoned, if the poisoning indication flag P is indicated as poisoned, the entire cache space storing the current poisoned message is overwritten once, so that this The entire segment of the cache recalculates the checksum, and at this point the read index points directly to the next cache descriptor to be read.
第三种, 当计算机的另一块独立内存中, 为计算机内存中的緩存对 应的緩存描述符设置的对应中毒指示标识时:  Third, when another piece of independent memory in the computer is set for the corresponding poison indication indicator for the cache descriptor corresponding to the cache in the computer memory:
将中毒指示标识设置为中毒的緩存描述符对应的计算机内存中的緩 存重写, 重新获取校验值;  Setting the poisoning indication flag to a cache rewrite in the computer memory corresponding to the poisoned cache descriptor, and reacquiring the check value;
将緩存描述符中的报文满标识设置为空, 以指示緩存描述符对应的 计算机内存中的緩存为空。  Set the message full flag in the cache descriptor to null to indicate that the cache in the computer memory corresponding to the cache descriptor is empty.
示例性的, 当处理器从计算机内存中的緩存读取报文时, 如果处理 器读到指向当前正在被处理的緩存对应的緩存描述符中的报文满标识 F 标志为满, 则再判断指向当前正在被处理的緩存所对应的緩存描述符对 应的报文中毒指示标志 P是否指示为中毒, 若该中毒指示标志 P标志指 示为中毒, 则将存储当前中毒报文的整个緩存空间重写一遍, 让这一整 段緩存重新计算校验值, 并通过设置正在被处理的緩存所对应的緩存描 述符中的报文满标识 F标志为空来指示该緩存为空, 以便把中毒的报文 丟弃掉。 Exemplarily, when the processor reads the message from the cache in the computer memory, if the processor reads that the message full flag F flag in the cache descriptor corresponding to the cache currently being processed is full, then judge If the poisoning indication flag P corresponding to the cache descriptor corresponding to the cache currently being processed is indicated as being poisoned, if the poisoning indication flag P is indicated as poisoned, the entire cache space of the current poisoned message is rewritten. Once again, let the entire segment of the cache recalculate the check value, and indicate that the cache is empty by setting the message full flag F flag in the cache descriptor corresponding to the cache being processed, so that the poisoned report is Text Discard it.
第四种, 当在计算机的另一块独立内存中时, 为计算机内存中的所 有緩存的緩存描述符设置同一个中毒指示标识时:  Fourth, when setting the same poison indication indicator for all cached cache descriptors in the computer's memory when in another separate memory of the computer:
示例性的, 当处理器从计算机内存中的緩存读取报文时, 如果读到 指向当前正在被处理的緩存所对应的緩存描述符中的报文满标识 F 标志 为满, 则再判断指向当前正在被处理的緩存所对应的緩存描述符中的报 文中毒指示标志 P是否指示为中毒, 若该中毒指示标志 P标志指示为中 毒, 则将 P 标志对应的所有緩存空间重写一遍, 让所有緩存空间重新计 算校验值, 并通过设置 P标志对应的所有緩存描述符中的 F标志为空来 指示该计算机内存中所有緩存为空, 以便把中毒的报文丟弃掉。 第五种, 当在计算机内存中的緩存的起始位置前面设置中毒指示标 识时:  Exemplarily, when the processor reads the message from the cache in the memory of the computer, if it reads that the full flag F flag of the message corresponding to the cache descriptor currently being processed is full, then the direction is judged. Whether the message poisoning indicator P in the cache descriptor corresponding to the cache currently being processed is indicated as poisoning. If the poisoning indicator P flag indicates poisoning, rewrite all the buffer spaces corresponding to the P flag. All the cache spaces recalculate the check value, and all the buffers in the memory of the computer are empty by setting the F flag in all the cache descriptors corresponding to the P flag to be empty, so as to discard the poisoned packets. Fifth, when a poisoning indicator is set in front of the start of the cache in the computer's memory:
将中毒指示标识设置为中毒的緩存重写, 重新获取校验值; 将緩存对应的緩存描述符中的报文满标识设置为空, 以指示緩存描 述符对应的緩存为空。 示例性的, 当处理器从计算机内存中的緩存读取报文时, 如果读到 指向当前正在被处理的緩存所对应的緩存描述符中的报文满标识 F 标志 为满, 则再判断指向当前正在被处理的緩存中的报文中毒指示标志 P是 否指示为中毒, 若该中毒指示标志指示为中毒, 则将存储当前中毒报文 的整个緩存空间重写一遍, 让这一整段緩存重新计算校验值, 并通过设 置指向当前正在被处理的緩存所对应的緩存描述符中的 F 标志为空来指 示该緩存为空, 以便把中毒的报文丟弃掉。  Set the poisoning indication flag to the poisoned cache rewrite, and re-acquire the check value; set the packet full identifier in the cache corresponding cache descriptor to null to indicate that the cache corresponding to the cache descriptor is empty. Exemplarily, when the processor reads the message from the cache in the memory of the computer, if it reads that the full flag F flag of the message corresponding to the cache descriptor currently being processed is full, then the direction is judged. Whether the packet poisoning indicator P in the buffer currently being processed is indicated as poisoning. If the poisoning indicator indicates poisoning, the entire buffer space storing the current poisoning message is rewritten once, and the entire buffer is re-created. The check value is calculated, and the cache is indicated as empty by setting the F flag in the cache descriptor corresponding to the cache currently being processed to discard the poisoned message.
其中, 上述通过把緩存描述符中的报文满标识 F标志设置为空, 或 者将读索引移到下一个待读的緩存描述符来实现丟弃报文是通过处理器 的驱动来处理的。 本发明的实施例提供一种处理失效报文的方法, 通过为计算机内存 中的緩存对应设置报文中毒指示标志, 并且在网络设备接收到报文后, 将失效报文所在的緩存对应的中毒指示标识设置为中毒, 并将失效报文 所在緩存重写, 而后指示该緩存为空, 这样能够在緩存中的报文已经失 效的情况下, 指示该报文已经失效, 并丟弃失效的报文, 从而避免了系 统的复位或将失效数据当做正常数据来处理带来的影响, 提高了系统的 可靠性。 本发明又一实施例提供一种网络设备 01 , 如图 9所示, 包括: 中毒标识设置单元 01 1 , 用于为计算机内存中的緩存设置对应的中 毒指示标识; Wherein, the discarding message is processed by the processor by setting the full flag F flag of the buffer descriptor to be empty, or moving the read index to the next cache descriptor to be read. An embodiment of the present invention provides a method for processing a failure message, by setting a message poisoning indication flag for a cache in a computer memory, and after the network device receives the message, the poisoning corresponding to the cache in which the invalid message is located is poisoned. The indication flag is set to be poisoned, and the buffer of the invalidation message is rewritten, and then the buffer is indicated to be empty, so that when the buffered message has expired, the packet is invalidated, and the invalid report is discarded. Text, thus avoiding the system System reset or the failure data is treated as normal data to improve the reliability of the system. A further embodiment of the present invention provides a network device 01, as shown in FIG. 9, comprising: a poisoning identifier setting unit 01 1 for setting a corresponding poisoning indication identifier for a cache in a computer memory;
中毒标识管理单元 012 , 用于在接收到报文后, 若报文失效, 则在 将该失效报文搬移至计算机内存中的緩存后, 将失效报文所在緩存对应的 中毒指示标识标记为中毒, 以表示緩存中的报文中毒。 进一步的, 中毒标识设置单元 01 1具体用于:  The poisoning indicator management unit 012 is configured to: after the message is invalid, after the message is invalid, after the invalid message is moved to the cache in the computer memory, the poisoning indication flag corresponding to the cache of the invalid message is marked as poisoned. To indicate that the message in the cache is poisoned. Further, the poisoning identifier setting unit 01 1 is specifically configured to:
在计算机内存中的緩存对应的緩存描述符中设置中毒指示标识, 其 中緩存描述符还包括报文满标识、 緩存基地址指针或者緩存描述符还包 括读索引、 写索引和緩存基地址指针; 或  Setting a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory, wherein the cache descriptor further includes a message full identifier, a cache base address pointer, or a cache descriptor, further including a read index, a write index, and a cache base address pointer; or
在计算机的另一块内存中, 为緩存描述符对应设置中毒指示标识, 其中緩存描述符包括报文满标识、 緩存基地址指针; 或  In another memory of the computer, a poisoning indication identifier is set corresponding to the cache descriptor, where the cache descriptor includes a full identifier of the packet, and a cache base address pointer; or
在计算机的另一块内存中, 为所有的緩存描述符设置有同一个中毒 指示标识, 其中每个緩存描述符包括报文满标识、 緩存基地址指针其中, 另一块内存独立于緩存描述符所在的内存; 或  In another memory of the computer, the same poisoning indicator is set for all the cache descriptors, wherein each cache descriptor includes a full identifier of the message, a cache base address pointer, and another memory is independent of the cache descriptor. Memory; or
在计算机内存中的緩存的起始位置前面设置中毒指示标识,緩存对应 的緩存描述符包括报文满标识、 緩存基地址指针。  A poisoning indication identifier is set in front of the start position of the cache in the computer memory, and the cache descriptor corresponding to the cache includes the full identifier of the message and the pointer of the cache base address.
再进一步的, 如图 10所示, 中毒标识管理单元 012还包括: 失效检测子单元 0121 , 用于若在将报文向计算机内存中的緩存搬 移的过程中, 若报文的任意一帧失效, 则确定报文失效;  Further, as shown in FIG. 10, the poisoning identifier management unit 012 further includes: a failure detecting subunit 0121, configured to invalidate any frame of the message if the packet is moved to the cache in the computer memory. , then determine that the message is invalid;
中毒标记子单元 0122 , 用于将失效报文所在緩存对应的中毒指示 标识标记为中毒。  The poisoning flag sub-unit 0122 is used to mark the poisoning indication flag corresponding to the cache in which the invalid message is located as poisoning.
本发明的实施例提供一种网络设备,通过为计算机内存中的緩存对应 设置报文中毒指示标志, 并且在网络设备接收到报文后, 将失效报文所在 的緩存对应的中毒指示标识设置为中毒, 以便处理器将失效报文所在緩存 重写, 而后指示该緩存为空, 这样能够在緩存中的报文已经失效的情况下, 指示该报文已经失效, 并丟弃失效的报文, 从而避免了系统的复位或将失 效数据当做正常数据来处理带来的影响, 提高了系统的可靠性。 本发明另一实施例提供一种处理器 02 , 如图 1 1 所示, 包括: 緩存处理单元 021 , 用于在读取报文时, 若计算机内存中的緩存对 应的中毒指示标识标记为中毒, 则将緩存重写, 重新获取校验值, 并指示 緩存为空。 An embodiment of the present invention provides a network device, by setting a message poisoning indication flag corresponding to a cache in a computer memory, and setting a poisoning indication flag corresponding to a cache in which the invalid message is located after the network device receives the message. Poisoning, so that the processor rewrites the buffer of the invalidation message, and then indicates that the buffer is empty, so that when the buffered message has expired, the packet is invalidated, and the invalid packet is discarded. Thereby avoiding a system reset or losing Effective data is treated as normal data to improve the reliability of the system. Another embodiment of the present invention provides a processor 02, as shown in FIG. 11, including: a cache processing unit 021, configured to: when reading a message, if the poisoning indication flag corresponding to the cache in the computer memory is marked as poisoned , the cache is rewritten, the checksum is retrieved, and the cache is indicated to be empty.
进一步的, 緩存处理单元 021具体用于:  Further, the cache processing unit 021 is specifically configured to:
当中毒指示标识设置在緩存对应的緩存描述符中,且緩存描述符还包 括报文满标识、 緩存基地址指针时:  When the poisoning indication flag is set in the cache corresponding cache descriptor, and the cache descriptor further includes the message full identifier and the cache base address pointer:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将緩存描述符中的报文满标识设置为空, 以指示描述符对应的緩存为 空。  Set the message full flag in the cache descriptor to null to indicate that the cache corresponding to the descriptor is empty.
或者, 当中毒指示标识设置在緩存对应的緩存描述符中, 且緩存描述 符还包括读索引、 写索引和緩存基地址指针时:  Or, when the poisoning indication flag is set in the cache corresponding cache descriptor, and the cache descriptor further includes a read index, a write index, and a cache base address pointer:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将读索引指向下一个待读的緩存描述符。  Point the read index to the next cache descriptor to be read.
或者, 当中毒指示标识设置在另一块内存中时:  Or, when the poisoning indicator is set in another block of memory:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将緩存描述符中的报文满标识设置为空, 以指示緩存为空; 其中, 另一块内存独立于緩存描述符所在的内存。  Set the message full identifier in the cache descriptor to null to indicate that the cache is empty; where the other memory is independent of the memory in which the cache descriptor is located.
或者, 当中毒指示标识设置在另一块内存中, 且所有的緩存描述符对 应同一个中毒指示标识时:  Or, when the poisoning indicator is set in another memory, and all the cache descriptors correspond to the same poisoning indicator:
将同一个中毒指示标识对应的所有緩存描述符所对应的緩存都重 写, 重新获取校验值;  The cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier is overwritten, and the check value is re-acquired;
将同一个中毒指示标识对应的所有緩存描述符中的报文满标识都设 置为空, 以指示同一个中毒指示标识对应的所有緩存描述符对应的緩存为 空; 其中, 另一块内存独立于緩存描述符所在的内存。 The packet full identifier of all the cache descriptors corresponding to the same poisoning indication identifier is set to be empty, to indicate that the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier is empty; Among them, another piece of memory is independent of the memory where the cache descriptor is located.
或者, 当中毒指示标识设置在计算机内存中的緩存的起始位置前面 时:  Or, when the poisoning indicator is set before the start of the cache in the computer's memory:
将中毒指示标识设置为中毒的緩存重写, 重新获取校验值; 将緩存对应的緩存描述符中的报文满标识设置为空, 以指示緩存描述 符对应的緩存为空。  Set the poisoning indication flag to the poisoned cache rewrite, and re-acquire the check value. Set the packet full identifier in the cache corresponding cache descriptor to null to indicate that the cache corresponding to the cache descriptor is empty.
另外, 上述计算机内存中的緩存的大小为独立校验数据单元的整数 倍, 且緩存的基地址也为独立校验数据单元的整数倍。  In addition, the size of the cache in the computer memory is an integer multiple of the independent check data unit, and the cached base address is also an integer multiple of the independent check data unit.
本发明的实施例提供一种处理器,在网络设备为计算机内存中的緩存 对应设置的报文中毒指示标志, 且在网络设备接收到报文后, 将失效报文 所在的緩存对应的中毒指示标识设置为中毒后, 该处理器将失效报文所在 緩存重写, 而后指示该緩存为空, 这样能够在緩存中的报文已经失效的情 况下, 指示该报文已经失效, 并丟弃失效的报文, 从而避免了系统的复位 或将失效数据当做正常数据来处理带来的影响, 提高了系统的可靠性。 本发明另一实施例提供一种网络设备 03 , 包括接收器 03 1、发射器 032、 存储器 033和总线 034 , 如图 12所示, 网络设备 03还包括:  An embodiment of the present invention provides a processor, where a network device is a packet poisoning indication flag corresponding to a cache in a computer memory, and after the network device receives the packet, the poisoning indication corresponding to the cache in which the invalid packet is located After the identifier is set to be poisoned, the processor rewrites the cache of the invalidation message, and then indicates that the cache is empty. In this case, if the buffered packet has expired, the packet is invalidated and discarded. The message avoids the system reset or the impact of the failure data as normal data processing, which improves the reliability of the system. Another embodiment of the present invention provides a network device 03, including a receiver 03 1 , a transmitter 032, a memory 033, and a bus 034. As shown in FIG. 12, the network device 03 further includes:
处理器 035 , 用于为计算机内存中的緩存设置对应的中毒指示标识; 还用于在接收到报文后, 若报文失效, 则在将该失效报文搬移至计算机内 存中的緩存后, 将失效报文所在緩存对应的中毒指示标识标记为中毒, 以 表示緩存中的报文中毒。  The processor 035 is configured to set a corresponding poisoning indication identifier for the cache in the computer memory, and is further configured to: after receiving the packet, if the packet fails, move the invalid packet to a cache in the computer memory, The poisoning indication flag corresponding to the cache of the invalid packet is marked as poisoned to indicate that the packet in the cache is poisoned.
进一步的, 处理器 035具体用于:  Further, the processor 035 is specifically configured to:
在计算机内存中的緩存对应的緩存描述符中设置中毒指示标识, 其 中緩存描述符还包括报文满标识、 緩存基地址指针或者緩存描述符还包 括读索引、 写索引和緩存基地址指针; 或  Setting a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory, wherein the cache descriptor further includes a message full identifier, a cache base address pointer, or a cache descriptor, further including a read index, a write index, and a cache base address pointer; or
在计算机的另一块内存中, 为緩存描述符对应设置中毒指示标识, 其中緩存描述符包括报文满标识、 緩存基地址指针; 或  In another memory of the computer, a poisoning indication identifier is set corresponding to the cache descriptor, where the cache descriptor includes a full identifier of the packet, and a cache base address pointer; or
在计算机的另一块内存中, 为所有的緩存描述符设置有同一个中毒 指示标识, 其中每个緩存描述符包括报文满标识、 緩存基地址指针其中, 另一块内存独立于緩存描述符所在的内存; 或 在计算机内存中的緩存的起始位置前面设置中毒指示标识, 緩存对 应的緩存描述符包括报文满标识、 緩存基地址指针。 In another memory of the computer, the same poisoning indicator is set for all the cache descriptors, wherein each cache descriptor includes a full identifier of the message, a cache base address pointer, and another memory is independent of the cache descriptor. Memory; or A poisoning indication identifier is set in front of the start position of the cache in the computer memory, and the cache cache descriptor corresponding to the cache includes a message full identifier and a cache base address pointer.
更进一步的, 处理器 035还具体用于:  Further, the processor 035 is also specifically configured to:
若在将报文向计算机内存中的緩存搬移的过程中, 若报文的任意一 帧失效, 则确定 ^艮文失效;  If any frame of the message is invalid during the process of moving the message to the cache in the memory of the computer, it is determined that the message is invalid;
将失效报文所在緩存对应的中毒指示标识标记为中毒。  Mark the poisoning indicator corresponding to the cache where the invalid packet is located as poisoned.
本发明的实施例提供一种网络设备, 通过为计算机内存中的緩存对 应设置报文中毒指示标志, 并且在网络设备接收到报文后, 将失效报文 所在的緩存对应的中毒指示标识设置为中毒, 以便处理器将失效报文所 在緩存重写, 而后指示该緩存为空, 这样能够在緩存中的报文已经失效 的情况下, 指示该报文已经失效, 并丟弃失效的报文, 从而避免了系统 的复位或将失效数据当做正常数据来处理带来的影响, 提高了系统的可 靠性。 本发明另一实施例提供一种处理器 04 , 如图 13所示, 该处理 器 04可以设置在一个计算机 0 中, 该计算机 0还包括接收器 041、 发射器 042、 存储器 043和总线 044 , 且接收器 041、 发射器 042、 存储 器 043和处理器 04通过总线 044互联, 其中:  An embodiment of the present invention provides a network device, by setting a message poisoning indication flag corresponding to a cache in a computer memory, and setting a poisoning indication flag corresponding to a cache in which the invalid message is located after the network device receives the message. Poisoning, so that the processor rewrites the buffer of the invalidation message, and then indicates that the buffer is empty, so that when the buffered message has expired, the packet is invalidated, and the invalid packet is discarded. Thus, the system reset is avoided or the failure data is treated as normal data to improve the reliability of the system. Another embodiment of the present invention provides a processor 04. As shown in FIG. 13, the processor 04 can be disposed in a computer 0. The computer 0 further includes a receiver 041, a transmitter 042, a memory 043, and a bus 044. And the receiver 041, the transmitter 042, the memory 043, and the processor 04 are interconnected by a bus 044, where:
处理器 04用于在读取报文时, 若计算机内存中的緩存对应的中毒 指示标识标记为中毒, 则将緩存重写, 重新获取校验值, 并指示緩存为 空。  The processor 04 is configured to rewrite the buffer, re-acquire the check value, and indicate that the cache is empty if the poison indication indicator corresponding to the cache in the computer memory is marked as poisoned when the message is read.
进一步的, 处理器 04具体用于:  Further, the processor 04 is specifically configured to:
当中毒指示标识设置在緩存对应的緩存描述符中,且緩存描述符还包 括报文满标识、 緩存基地址指针时:  When the poisoning indication flag is set in the cache corresponding cache descriptor, and the cache descriptor further includes the message full identifier and the cache base address pointer:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将緩存描述符中的报文满标识设置为空, 以指示描述符对应的緩存 为空。  Set the message full identifier in the cache descriptor to null to indicate that the cache corresponding to the descriptor is empty.
或着, 当中毒指示标识设置在緩存对应的緩存描述符中, 且緩存描述 符还包括读索引、 写索引和緩存基地址指针时:  Or, when the poisoning indicator is set in the cache corresponding cache descriptor, and the cache descriptor also includes the read index, the write index, and the cache base address pointer:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值; Set the poisoning indicator to the cache rewrite corresponding to the poisoned cache descriptor, and regain Take the check value;
将读索引指向下一个待读的緩存描述符。  Point the read index to the next cache descriptor to be read.
或者, 当中毒指示标识设置在另一块内存中时:  Or, when the poisoning indicator is set in another block of memory:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将緩存描述符中的报文满标识设置为空, 以指示緩存为空; 其中, 另一块内存独立于緩存描述符所在的内存。  Set the message full identifier in the cache descriptor to null to indicate that the cache is empty; where the other memory is independent of the memory in which the cache descriptor is located.
或者, 当中毒指示标识设置在另一块内存中, 且所有的緩存描述符对 应同一个中毒指示标识时:  Or, when the poisoning indicator is set in another memory, and all the cache descriptors correspond to the same poisoning indicator:
将同一个中毒指示标识对应的所有緩存描述符所对应的緩存都重 写, 重新获取校验值;  The cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier is overwritten, and the check value is re-acquired;
将同一个中毒指示标识对应的所有緩存描述符中的报文满标识都设 置为空, 以指示同一个中毒指示标识对应的所有緩存描述符对应的緩存为 空;  The packet full identifier of all the cache descriptors corresponding to the same poisoning indication identifier is set to be empty, to indicate that the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier is empty;
其中, 另一块内存独立于緩存描述符所在的内存。  Among them, another piece of memory is independent of the memory where the cache descriptor is located.
或者, 当中毒指示标识设置在计算机内存中的緩存的起始位置前面 时:  Or, when the poisoning indicator is set before the start of the cache in the computer's memory:
将中毒指示标识设置为中毒的緩存重写, 重新获取校验值; 将緩存对应的緩存描述符中的报文满标识设置为空, 以指示緩存描述 符对应的緩存为空。  Set the poisoning indication flag to the poisoned cache rewrite, and re-acquire the check value. Set the packet full identifier in the cache corresponding cache descriptor to null to indicate that the cache corresponding to the cache descriptor is empty.
另外, 上述计算机内存中的緩存的大小为独立校验数据单元的整数 倍, 且緩存的基地址也为独立校验数据单元的整数倍。  In addition, the size of the cache in the computer memory is an integer multiple of the independent check data unit, and the cached base address is also an integer multiple of the independent check data unit.
本发明的实施例提供一种处理器,在网络设备为计算机内存中的緩存 对应设置的报文中毒指示标志, 且在网络设备接收到报文后, 将失效报文 所在的緩存对应的中毒指示标识设置为中毒后, 该处理器将失效报文所在 緩存重写, 而后指示该緩存为空, 这样能够在緩存中的报文已经失效的情 况下, 指示该报文已经失效, 并丟弃失效的报文, 从而避免了系统的复位 或将失效数据当做正常数据来处理带来的影响, 提高了系统的可靠性。  An embodiment of the present invention provides a processor, where a network device is a packet poisoning indication flag corresponding to a cache in a computer memory, and after the network device receives the packet, the poisoning indication corresponding to the cache in which the invalid packet is located After the identifier is set to be poisoned, the processor rewrites the cache of the invalidation message, and then indicates that the cache is empty. In this case, if the buffered packet has expired, the packet is invalidated and discarded. The message avoids the system reset or the impact of the failure data as normal data processing, which improves the reliability of the system.
在本申请所提供的几个实施例中, 应该理解到, 所揭露的方法和装 置, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是 示意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实 现时可以有另外的划分方式, 例如多个单元或组件可以结合或者可以集 成到另一个系统, 或一些特征可以忽略, 或不执行。 另一点, 所显示或 讨论的相互之间的通信连接可以是通过一些接口, 装置或单元的连接, 可以是电性, 机械或其它的形式。 另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单 元中, 也可以是各个单元单独物理包括, 也可以两个或两个以上单元集 成在一个单元中。 上述集成的单元既可以采用硬件的形式实现, 也可以 采用硬件加软件功能单元的形式实现。 上述以软件功能单元的形式实现的集成的单元, 可以存储在一个计 算机可读取存储介质中。 上述软件功能单元存储在一个存储介质中, 包 括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或 者网络设备等)执行本发明各个实施例所述方法的部分步骤。 而前述的 存储介质包括: U盘、 移动硬盘、 只读存储器 (Read-Only Memory, 简 称 ROM ) 、 随机存取存储器 ( Random Access Memory, 简称 RAM ) 、 磁碟或者光盘等各种可以存储程序代码的介质。 In the several embodiments provided by the present application, it should be understood that the disclosed method and apparatus may be implemented in other manners. For example, the device embodiments described above are merely Illustratively, for example, the division of the unit is only a logical function division, and the actual implementation may have another division manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be Ignore, or not execute. Alternatively, the communication connections shown or discussed may be through a number of interfaces, devices or unit connections, which may be in electrical, mechanical or other form. In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units. The above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium. The software functional unit described above is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform portions of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and the like, and the program code can be stored. Medium.
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局 限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可 轻易想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明 的保护范围应以所述权利要求的保护范围为准。  The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the appended claims.

Claims

权 利 要 求 书 Claim
1、 一种处理失效报文的方法, 其特征在于, 所述方法包括: 为计算机内存中的緩存设置对应的中毒指示标识;  A method for processing a failure message, the method comprising: setting a corresponding poisoning indication identifier for a cache in a computer memory;
在接收到报文后, 若所述报文失效, 则在将该失效报文搬移至所述计 算机内存中的緩存后, 将所述失效报文所在緩存对应的中毒指示标识标记 为中毒, 以表示所述緩存中的报文中毒。  After receiving the message, if the message is invalid, after the invalid message is moved to the cache in the computer memory, the poisoning indication flag corresponding to the cache of the invalid message is marked as poisoned, Indicates that the packets in the cache are poisoned.
2、 根据权利要求 1 所述的方法, 其特征在于, 所述为计算机内 存中的緩存设置对应的中毒指示标识包括:  The method according to claim 1, wherein the setting of the corresponding poisoning indication identifier for the cache in the computer memory comprises:
在所述计算机内存中的緩存对应的緩存描述符中设置中毒指示标 识, 其中所述緩存描述符还包括报文满标识、 緩存基地址指针或者所述 緩存描述符还包括读索引、 写索引和緩存基地址指针; 或  Setting a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory, wherein the cache descriptor further includes a message full identifier, a cache base address pointer, or the cache descriptor further includes a read index, a write index, and Cache base address pointer; or
在所述计算机的另一块内存中, 为所述緩存描述符对应设置中毒指 示标识, 其中所述緩存描述符包括报文满标识、 緩存基地址指针; 或  And setting a poisoning indication identifier corresponding to the cache descriptor in another memory of the computer, where the cache descriptor includes a message full identifier and a cache base address pointer; or
在所述计算机的另一块内存中, 为所有的緩存描述符设置有同一个 中毒指示标识, 其中每个緩存描述符包括报文满标识、 緩存基地址指针 其中, 所述另一块内存独立于所述緩存描述符所在的内存; 或  In another memory of the computer, all the cache descriptors are set with the same poison indication indicator, wherein each cache descriptor includes a message full identifier, a cache base address pointer, and the other memory is independent of the The memory in which the cache descriptor is located; or
在所述计算机内存中的緩存的起始位置前面设置中毒指示标识, 所述 緩存对应的緩存描述符包括报文满标识、 緩存基地址指针。  A poisoning indication identifier is set in front of a start position of the cache in the computer memory, and the cache descriptor corresponding to the cache includes a message full identifier and a cache base address pointer.
3、根据权利要求 1或 2所述的方法,其特征在于,若所述报文失效, 则在将该失效报文搬移至所述计算机内存中的緩存后, 将所述失效报文 所在緩存对应的中毒指示标识标记为中毒包括:  The method according to claim 1 or 2, wherein, if the message fails, the invalid message is cached after the invalid message is moved to the cache in the computer memory. Corresponding poisoning indication marks are marked as poisoning including:
若在将所述报文向所述计算机内存中的緩存搬移的过程中, 若所述 报文的任意一帧失效, 则确定所述报文失效;  If the frame is invalidated in the process of moving the message to the cache in the computer memory, if the frame of the message is invalid, the message is determined to be invalid;
将所述失效报文所在緩存对应的中毒指示标识标记为中毒。  The poisoning indication identifier corresponding to the cache in which the invalid packet is located is marked as poisoned.
4、 一种处理失效报文的方法, 其特征在于, 所述方法包括: 在读取报文时, 若计算机内存中的緩存对应的中毒指示标识标记为中 毒, 则将所述緩存重写, 重新获取校验值, 并指示所述緩存为空。  A method for processing a failure message, the method comprising: when the message is read, if the poisoning indication flag corresponding to the cache in the computer memory is marked as poisoned, the buffer is rewritten. Re-acquire the check value and indicate that the cache is empty.
5、 根据权利要求 4所述的方法, 其特征在于, 当所述中毒指示标 识设置在所述緩存对应的緩存描述符中, 且所述緩存描述符还包括报文满 标识、 緩存基地址指针时, 所述将所述緩存重写, 重新获取校验值, 并指 示所述緩存为空包括: The method according to claim 4, wherein the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a message full identifier and a cache base address pointer. Rewriting the cache, reacquiring the check value, and referring to Show that the cache is empty includes:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将所述緩存描述符中的报文满标识设置为空, 以指示描述符对应的 緩存为空。  The message full identifier in the cache descriptor is set to null to indicate that the cache corresponding to the descriptor is empty.
6、 根据权利要求 4所述的方法, 其特征在于, 当所述中毒指示标 识设置在所述緩存对应的緩存描述符中,且所述緩存描述符还包括读索引、 写索引和緩存基地址指针时, 所述将所述緩存重写, 重新获取校验值, 并 指示所述緩存为空包括:  The method according to claim 4, wherein the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a read index, a write index, and a cache base address. When the pointer is used, the rewriting the cache, reacquiring the check value, and indicating that the cache is empty includes:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将所述读索引指向下一个待读的緩存描述符。  The read index is directed to the next cache descriptor to be read.
7、 根据权利要求 4所述的方法, 其特征在于, 当所述中毒指示标 识设置在另一块内存中时, 所述将所述緩存重写, 重新获取校验值, 并指 示所述緩存为空包括:  The method according to claim 4, wherein when the poisoning indication flag is set in another memory, the buffer is rewritten, the check value is re-acquired, and the cache is indicated as Empty includes:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将所述緩存描述符中的报文满标识设置为空, 以指示所述緩存为空; 其中, 所述另一块内存独立于所述緩存描述符所在的内存。  Setting a message full identifier in the cache descriptor to be empty to indicate that the cache is empty; wherein the another block of memory is independent of a memory in which the cache descriptor is located.
8、 根据权利要求 4所述的方法, 其特征在于, 当所述中毒指示标 识设置在另一块内存中,且所有的緩存描述符对应同一个中毒指示标识时, 所述将所述緩存重写, 重新获取校验值, 并指示所述緩存为空包括:  The method according to claim 4, wherein when the poisoning indication flag is set in another memory and all the cache descriptors correspond to the same poisoning indication identifier, the buffer is rewritten , re-acquire the check value, and indicate that the cache is empty, including:
将所述同一个中毒指示标识对应的所有緩存描述符所对应的緩存都 重写, 重新获取校验值;  Rewriting the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier, and re-acquiring the check value;
将所述同一个中毒指示标识对应的所有緩存描述符中的报文满标识 都设置为空, 以指示所述同一个中毒指示标识对应的所有緩存描述符对应 的緩存为空;  Setting a full packet identifier of all the cache descriptors corresponding to the same poisoning indication identifier to be empty, to indicate that the cache corresponding to all cache descriptors corresponding to the same poisoning indication identifier is empty;
其中, 所述另一块内存独立于所述緩存描述符所在的内存。  The other memory is independent of the memory in which the cache descriptor is located.
9、 根据权利要求 4所述的方法, 其特征在于, 当所述中毒指示标 识设置在所述计算机内存中的緩存的起始位置前面时, 所述将所述緩存重 写, 重新获取校验值, 并指示所述緩存为空包括: 9. The method according to claim 4, wherein when the poisoning indication flag is set in front of a start position of a cache in the computer memory, the buffer is heavy Write, reacquire the checksum, and indicate that the cache is empty, including:
将中毒指示标识设置为中毒的緩存重写, 重新获取校验值; 将所述緩存对应的緩存描述符中的报文满标识设置为空, 以指示所述 緩存描述符对应的緩存为空。  Setting the poisoning indication flag to the poisoned cache rewrite, re-acquiring the check value; setting the message full identifier in the cache descriptor corresponding to the cache to be empty, to indicate that the cache corresponding to the cache descriptor is empty.
10、 根据权利要求 4至 9任意一项所述的方法, 其特征在于, 所述 计算机内存中的緩存的大小为独立校验数据单元的整数倍, 且所述緩存 的基地址也为独立校验数据单元的整数倍。  The method according to any one of claims 4 to 9, wherein the size of the cache in the computer memory is an integer multiple of the independent check data unit, and the base address of the cache is also an independent school. Check the integer multiple of the data unit.
1 1、 一种网络设备, 其特征在于, 所述网络设备包括:  A network device, the network device includes:
中毒标识设置单元, 用于为计算机内存中的緩存设置对应的中毒指 示标识;  a poisoning identifier setting unit, configured to set a corresponding poisoning indication identifier for a cache in a computer memory;
中毒标识管理单元, 用于在接收到报文后, 若所述报文失效, 则在 将该失效报文搬移至所述计算机内存中的緩存后, 将所述失效报文所在緩 存对应的中毒指示标识标记为中毒, 以表示所述緩存中的报文中毒。  a poisoning identifier management unit, configured to: after receiving the message, if the message is invalid, after the invalid message is moved to a cache in the computer memory, the poisoning corresponding to the cache of the invalid message is poisoned The indication identifier is marked as poisoned to indicate that the message in the cache is poisoned.
12、 根据权利要求 1 1 所述的网络设备, 其特征在于, 所述中毒 标识设置单元具体用于:  The network device according to claim 1 , wherein the poisoning identifier setting unit is specifically configured to:
在所述计算机内存中的緩存对应的緩存描述符中设置中毒指示标 识, 其中所述緩存描述符还包括报文满标识、 緩存基地址指针或者所述 緩存描述符还包括读索引、 写索引和緩存基地址指针; 或  Setting a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory, wherein the cache descriptor further includes a message full identifier, a cache base address pointer, or the cache descriptor further includes a read index, a write index, and Cache base address pointer; or
在所述计算机的另一块内存中, 为所述緩存描述符对应设置中毒指 示标识, 其中所述緩存描述符包括报文满标识、 緩存基地址指针; 或 在所述计算机的另一块内存中, 为所有的緩存描述符设置有同一个 中毒指示标识, 其中每个緩存描述符包括报文满标识、 緩存基地址指针 其中, 所述另一块内存独立于所述緩存描述符所在的内存; 或  And setting a poisoning indication identifier corresponding to the cache descriptor in another memory of the computer, where the cache descriptor includes a message full identifier, a cache base address pointer, or in another memory of the computer, The same poisoning indication identifier is set for all the cache descriptors, wherein each cache descriptor includes a message full identifier, a cache base address pointer, and the other memory is independent of the memory of the cache descriptor; or
在所述计算机内存中的緩存的起始位置前面设置中毒指示标识, 所述 緩存对应的緩存描述符包括报文满标识、 緩存基地址指针。  A poisoning indication identifier is set in front of a start position of the cache in the computer memory, and the cache descriptor corresponding to the cache includes a message full identifier and a cache base address pointer.
13、 根据权利要求 1 1或 12所述的网络设备, 其特征在于, 所述 中毒标识管理单元包括:  The network device according to claim 1 or 12, wherein the poisoning identifier management unit comprises:
失效检测子单元, 用于若在将所述报文向所述计算机内存中的緩存 搬移的过程中, 若所述报文的任意一帧失效, 则确定所述报文失效;  a failure detecting subunit, configured to determine that the message is invalid if any frame of the message is invalid during the process of moving the message to the cache in the computer memory;
中毒标记子单元, 用于将所述失效报文所在緩存对应的中毒指示标 识标记为中毒。 a poisoning flag sub-unit, configured to use a poisoning indicator corresponding to the cache in which the invalid message is located Identification is poisoned.
14、 一种处理器, 其特征在于, 所述处理器包括:  14. A processor, wherein the processor comprises:
緩存处理单元, 用于在读取报文时, 若计算机内存中的緩存对应的 中毒指示标识标记为中毒, 则将所述緩存重写, 重新获取校验值, 并指示 所述緩存为空。  The cache processing unit is configured to: when the message is read, if the poisoning indication flag corresponding to the cache in the computer memory is marked as poisoned, the buffer is rewritten, the check value is re-acquired, and the cache is indicated to be empty.
15、 根据权利要求 14 所述的处理器, 其特征在于, 当所述中毒 指示标识设置在所述緩存对应的緩存描述符中, 且所述緩存描述符还包括 报文满标识、 緩存基地址指针时, 所述緩存处理单元具体用于:  The processor according to claim 14, wherein the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a message full identifier and a cache base address. When the pointer is used, the cache processing unit is specifically configured to:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将所述緩存描述符中的报文满标识设置为空, 以指示描述符对应的緩 存为空。  The message full identifier in the cache descriptor is set to null to indicate that the cache corresponding to the descriptor is empty.
16、 根据权利要求 14 所述的处理器, 其特征在于, 当所述中毒 指示标识设置在所述緩存对应的緩存描述符中, 且所述緩存描述符还包括 读索引、 写索引和緩存基地址指针时, 所述緩存处理单元具体用于: 将所述中毒指示标识设置为中毒的对应的緩存重写, 重新获取校验 值;  The processor according to claim 14, wherein the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a read index, a write index, and a cache base. The address processing unit is configured to: set the poisoning indication identifier to a corresponding cache rewrite of poisoning, and re-acquire the verification value;
将所述读索引指向下一个待读的緩存描述符。  The read index is directed to the next cache descriptor to be read.
17、 根据权利要求 14 所述的处理器, 其特征在于, 当所述中毒 指示标识设置在另一块内存中时, 所述緩存处理单元具体用于:  The processor according to claim 14, wherein when the poisoning indication flag is set in another memory, the cache processing unit is specifically configured to:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将所述緩存描述符中的报文满标识设置为空, 以指示所述緩存为空; 其中, 所述另一块内存独立于所述緩存描述符所在的内存。  Setting a message full identifier in the cache descriptor to be empty to indicate that the cache is empty; wherein the another block of memory is independent of a memory in which the cache descriptor is located.
18、 根据权利要求 14 所述的处理器, 其特征在于, 当所述中毒 指示标识设置在另一块内存中, 且所有的緩存描述符对应同一个中毒指示 标识时, 所述緩存处理单元具体用于:  The processor according to claim 14, wherein when the poisoning indication flag is set in another memory, and all the cache descriptors correspond to the same poisoning indication identifier, the cache processing unit is specifically used. In:
将所述同一个中毒指示标识对应的所有緩存描述符所对应的緩存都 重写, 重新获取校验值;  Rewriting the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier, and re-acquiring the check value;
将所述同一个中毒指示标识对应的所有緩存描述符中的报文满标识 都设置为空, 以指示所述同一个中毒指示标识对应的所有緩存描述符对应 的緩存为空; Fully identifying the message in all cache descriptors corresponding to the same poisoning indication identifier All are set to be empty, to indicate that the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier is empty;
其中, 所述另一块内存独立于所述緩存描述符所在的内存。  The other memory is independent of the memory in which the cache descriptor is located.
19、 根据权利要求 14 所述的处理器, 其特征在于, 当所述中毒 指示标识设置在所述计算机内存中的緩存的起始位置前面时, 所述緩存处 理单元具体用于:  The processor according to claim 14, wherein the cache processing unit is specifically configured to: when the poison indication flag is set in front of a cache start position in the computer memory, the cache processing unit is specifically configured to:
将中毒指示标识设置为中毒的緩存重写, 重新获取校验值; 将所述緩存对应的緩存描述符中的报文满标识设置为空, 以指示所述 緩存描述符对应的緩存为空。  Setting the poisoning indication flag to the poisoned cache rewrite, re-acquiring the check value; setting the message full identifier in the cache descriptor corresponding to the cache to be empty, to indicate that the cache corresponding to the cache descriptor is empty.
20、 根据权利要求 14至 19任意一项所述的处理器, 其特征在于, 所述计算机内存中的緩存的大小为独立校验数据单元的整数倍, 且所述 緩存的基地址也为独立校验数据单元的整数倍。  The processor according to any one of claims 14 to 19, wherein the size of the cache in the computer memory is an integer multiple of the independent check data unit, and the base address of the cache is also independent. Check the integer multiple of the data unit.
21、 一种网络设备, 包括接收器、 发射器、 存储器和总线, 其特征 在于, 所述网络设备还包括:  A network device, comprising a receiver, a transmitter, a memory, and a bus, wherein the network device further includes:
处理器, 用于为计算机内存中的緩存设置对应的中毒指示标识; 所述处理器还用于在接收到报文后, 若所述报文失效, 则在将该失 效报文搬移至所述计算机内存中的緩存后, 将所述失效报文所在緩存对 应的中毒指示标识标记为中毒, 以表示所述緩存中的报文中毒。  a processor, configured to set a corresponding poisoning indication identifier for the cache in the computer memory; the processor is further configured to: after receiving the packet, if the packet fails, move the invalid packet to the After the cache in the memory of the computer, the poisoning indication identifier corresponding to the cache in which the invalidation packet is located is marked as poisoned to indicate that the packet in the cache is poisoned.
22、 根据权利要求 21所述的网络设备, 其特征在于, 所述处理器具 体用于:  The network device according to claim 21, wherein the processor is configured to:
在所述计算机内存中的緩存对应的緩存描述符中设置中毒指示标 识, 其中所述緩存描述符还包括报文满标识、 緩存基地址指针或者所述 緩存描述符还包括读索引、 写索引和緩存基地址指针; 或  Setting a poisoning indication identifier in a cache descriptor corresponding to the cache in the computer memory, wherein the cache descriptor further includes a message full identifier, a cache base address pointer, or the cache descriptor further includes a read index, a write index, and Cache base address pointer; or
在所述计算机的另一块内存中, 为所述緩存描述符对应设置中毒指 示标识, 其中所述緩存描述符包括报文满标识、 緩存基地址指针; 或 在所述计算机的另一块内存中, 为所有的緩存描述符设置有同一个 中毒指示标识, 其中每个緩存描述符包括报文满标识、 緩存基地址指针 其中, 所述另一块内存独立于所述緩存描述符所在的内存; 或  And setting a poisoning indication identifier corresponding to the cache descriptor in another memory of the computer, where the cache descriptor includes a message full identifier, a cache base address pointer, or in another memory of the computer, The same poisoning indication identifier is set for all the cache descriptors, wherein each cache descriptor includes a message full identifier, a cache base address pointer, and the other memory is independent of the memory of the cache descriptor; or
在所述计算机内存中的緩存的起始位置前面设置中毒指示标识, 所 述緩存对应的緩存描述符包括报文满标识、 緩存基地址指针。  A poisoning indication identifier is set in front of a cache start position in the computer memory, and the cache descriptor corresponding to the cache includes a message full identifier and a cache base address pointer.
23、 根据权利要求 21或 22所述的网络设备, 其特征在于, 所述处 理器还具体用于: The network device according to claim 21 or 22, wherein The device is also specifically used to:
若在将所述报文向所述计算机内存中的緩存搬移的过程中, 若所述 报文的任意一帧失效, 则确定所述报文失效;  If the frame is invalidated in the process of moving the message to the cache in the computer memory, if the frame of the message is invalid, the message is determined to be invalid;
将所述失效报文所在緩存对应的中毒指示标识标记为中毒。  The poisoning indication identifier corresponding to the cache in which the invalid packet is located is marked as poisoned.
24、 一种处理器, 其特征在于,  24. A processor, characterized in that
所述处理器用于在读取报文时, 若计算机内存中的緩存对应的中毒 指示标识标记为中毒, 则将所述緩存重写, 重新获取校验值, 并指示所 述緩存为空。  The processor is configured to: when the message is read, if the poisoning indication flag corresponding to the cache in the computer memory is marked as poisoned, the buffer is rewritten, the check value is re-acquired, and the cache is indicated to be empty.
25、 根据权利要求 24所述的处理器, 其特征在于, 当所述中毒指示 标识设置在所述緩存对应的緩存描述符中, 且所述緩存描述符还包括报 文满标识、 緩存基地址指针时, 所述处理器具体用于:  The processor according to claim 24, wherein the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a message full identifier and a cache base address. When the pointer is used, the processor is specifically configured to:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将所述緩存描述符中的报文满标识设置为空, 以指示描述符对应的 緩存为空。  The message full identifier in the cache descriptor is set to null to indicate that the cache corresponding to the descriptor is empty.
26、 根据权利要求 24所述的处理器, 其特征在于, 当所述中毒指示 标识设置在所述緩存对应的緩存描述符中, 且所述緩存描述符还包括读 索引、 写索引和緩存基地址指针时, 所述处理器具体用于:  The processor according to claim 24, wherein the poisoning indication identifier is set in a cache descriptor corresponding to the cache, and the cache descriptor further includes a read index, a write index, and a cache base. When the address pointer is used, the processor is specifically configured to:
将所述中毒指示标识设置为中毒的对应的緩存重写, 重新获取校验 值;  Setting the poisoning indication flag to a corresponding cache rewrite of poisoning, and re-acquiring the check value;
将所述读索引指向下一个待读的緩存描述符。  The read index is directed to the next cache descriptor to be read.
27、 根据权利要求 24所述的处理器, 其特征在于, 当所述中毒指示 标识设置在另一块内存中时, 所述处理器具体用于:  The processor according to claim 24, wherein when the poisoning indication is set in another memory, the processor is specifically configured to:
将中毒指示标识设置为中毒的緩存描述符对应的緩存重写, 重新获 取校验值;  Setting the poisoning indication flag to the cache rewrite corresponding to the poisoned cache descriptor, and reacquiring the check value;
将所述緩存描述符中的报文满标识设置为空, 以指示所述緩存为空; 其中, 所述另一块内存独立于所述緩存描述符所在的内存。  Setting a message full identifier in the cache descriptor to be empty to indicate that the cache is empty; wherein the another block of memory is independent of a memory in which the cache descriptor is located.
28、 根据权利要求 24所述的处理器, 其特征在于, 当所述中毒指示 标识设置在另一块内存中, 且所有的緩存描述符对应同一个中毒指示标 识时, 所述处理器具体用于:  The processor according to claim 24, wherein when the poisoning indication identifier is set in another memory, and all the cache descriptors correspond to the same poisoning indication identifier, the processor is specifically configured to: :
将所述同一个中毒指示标识对应的所有緩存描述符所对应的緩存都 重写, 重新获取校验值; 将所述同一个中毒指示标识对应的所有緩存描述符中的报文满标识 都设置为空, 以指示所述同一个中毒指示标识对应的所有緩存描述符对 应的緩存为空。 Rewriting the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier, and re-acquiring the check value; The packet full identifier of all the cache descriptors corresponding to the same poisoning indication identifier is set to be empty, to indicate that the cache corresponding to all the cache descriptors corresponding to the same poisoning indication identifier is empty.
29、 根据权利要求 24所述的处理器, 其特征在于, 当所述中毒指示 标识设置在所述计算机内存中的緩存的起始位置前面时, 所述处理器具 体用于:  The processor according to claim 24, wherein when the poisoning indication is set in front of a start position of a cache in the computer memory, the processor is configured to:
将中毒指示标识设置为中毒的緩存重写, 重新获取校验值; 将所述緩存对应的緩存描述符中的报文满标识设置为空, 以指示所 述緩存描述符对应的緩存为空。  The poisoning indication flag is set to the poisoned cache rewrite, and the check value is re-acquired; the full identifier of the message in the cache descriptor corresponding to the cache is set to be empty, to indicate that the cache corresponding to the cache descriptor is empty.
30、 根据权利要求 24至 29任意一项所述的处理器, 其特征在于, 所述计算机内存中的緩存的大小为独立校验数据单元的整数倍, 且所述 緩存的基地址也为独立校验数据单元的整数倍。  The processor according to any one of claims 24 to 29, wherein the size of the cache in the computer memory is an integer multiple of the independent check data unit, and the base address of the cache is also independent. Check the integer multiple of the data unit.
PCT/CN2012/083854 2012-10-31 2012-10-31 Method, network device and processor for processing failure message WO2014067099A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201280004493.5A CN103534704A (en) 2012-10-31 2012-10-31 Method of treatment failure packets, network device and processor
PCT/CN2012/083854 WO2014067099A1 (en) 2012-10-31 2012-10-31 Method, network device and processor for processing failure message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/083854 WO2014067099A1 (en) 2012-10-31 2012-10-31 Method, network device and processor for processing failure message

Publications (1)

Publication Number Publication Date
WO2014067099A1 true WO2014067099A1 (en) 2014-05-08

Family

ID=49935394

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/083854 WO2014067099A1 (en) 2012-10-31 2012-10-31 Method, network device and processor for processing failure message

Country Status (2)

Country Link
CN (1) CN103534704A (en)
WO (1) WO2014067099A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144736A (en) * 2018-09-30 2019-01-04 新华三信息安全技术有限公司 A kind of method and device exporting alert message
CN114244581B (en) * 2021-11-29 2024-03-29 西安四叶草信息技术有限公司 Cache poisoning vulnerability detection method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1909507A (en) * 2006-07-04 2007-02-07 华为技术有限公司 Method and system for message transfer
CN101022414A (en) * 2007-03-08 2007-08-22 华为技术有限公司 Message retransmitting method and apparatus
CN101079015A (en) * 2007-06-28 2007-11-28 杭州华三通信技术有限公司 Data transmission method and system
CN101594305A (en) * 2009-06-22 2009-12-02 中兴通讯股份有限公司 A kind of message processing method and device
CN102573106A (en) * 2010-12-30 2012-07-11 丛林网络公司 Partial failure messaging

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW518864B (en) * 2000-05-12 2003-01-21 Ibm Methods and system for defeating TCP SYN flooding attacks
EP1690379A1 (en) * 2003-11-25 2006-08-16 Freescale Semiconductor, Inc. Network message processing using pattern matching
CN100562857C (en) * 2007-12-14 2009-11-25 华为技术有限公司 The method and apparatus of checking data
CN101546291A (en) * 2009-05-12 2009-09-30 华为技术有限公司 Access method and device for increasing robustness of memory data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1909507A (en) * 2006-07-04 2007-02-07 华为技术有限公司 Method and system for message transfer
CN101022414A (en) * 2007-03-08 2007-08-22 华为技术有限公司 Message retransmitting method and apparatus
CN101079015A (en) * 2007-06-28 2007-11-28 杭州华三通信技术有限公司 Data transmission method and system
CN101594305A (en) * 2009-06-22 2009-12-02 中兴通讯股份有限公司 A kind of message processing method and device
CN102573106A (en) * 2010-12-30 2012-07-11 丛林网络公司 Partial failure messaging

Also Published As

Publication number Publication date
CN103534704A (en) 2014-01-22

Similar Documents

Publication Publication Date Title
US10853272B2 (en) Memory access protection apparatus and methods for memory mapped access between independently operable processors
CN107992436B (en) NVMe data read-write method and NVMe equipment
KR101099471B1 (en) PCI.Express COMMUNICATION SYSTEM AND COMMUNICATION METHOD THEREOF
US11379278B2 (en) Methods and apparatus for correcting out-of-order data transactions between processors
US20070089031A1 (en) Methods and arrangements to remap degraded storage blocks
US10104005B2 (en) Data buffering
JP3996454B2 (en) System and method for inter-domain low overhead message passing in a split server
EP1530850A2 (en) Store and forward switch device, system and method
US11314635B1 (en) Tracking persistent memory usage
CN111930676A (en) Method, device, system and storage medium for communication among multiple processors
WO2020087930A1 (en) Data protection method and apparatus, and system
CN104866454A (en) Write message prospect processing method and device facing board-level high-speed bus
CN104750428A (en) Block storage access and gateway module, storage system and method, and content delivery apparatus
CN108090003A (en) A kind of method, the system of the promotion WEB server performance based on zero-copy
JP2015043237A (en) Memory system
US7996712B2 (en) Data transfer controller, data consistency determination method and storage controller
CN109039552B (en) Data recovery method and device
WO2014067099A1 (en) Method, network device and processor for processing failure message
CN110870286B (en) Fault tolerance processing method and device and server
US7293139B2 (en) Disk array system generating a data guarantee code on data transferring
US20130036243A1 (en) Host-daughtercard configuration with double data rate bus
JP5341198B2 (en) Bit inversion in communication interface
US20160352832A1 (en) Enhancing data consistency in cloud storage system by entrance data buffering
CN111435323A (en) Information transmission method, device, terminal, server and storage medium
US10977201B1 (en) Per IO direct memory access redirection

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

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

Country of ref document: EP

Kind code of ref document: A1