PFC deadlock monitoring method and device, electronic equipment and readable medium

By monitoring the hardware status in the middle layer and sending deadlock signals to the upper layer software, it solves the stagnation problem of PFC technology in the case of network deadlock, reduces the coupling between software and hardware, and improves the maintainability and stability of the system. .

CN118540250APending Publication Date: 2024-08-23SUZHOU CENTEC COMM CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410610500.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-16
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing PFC technology can easily form a chain reaction in the case of network deadlock, causing the entire network to stagnate. The coupling between the upper-layer software and the underlying hardware is high, the software adaptability is poor, and maintenance is difficult.

Method used

By monitoring the underlying hardware status information in the middle layer in real time, it determines whether a PFC deadlock occurs, sends a deadlock signal to the upper-layer software, and issues deadlock release instructions to relieve the deadlock state, reduce resource consumption, and realize hardware model decoupling. Improve software versatility.

Benefits of technology

It achieves timely monitoring and response to PFC deadlock, avoids network stagnation, reduces the coupling between software and hardware, and improves the maintainability and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540250A
    Figure CN118540250A
Patent Text Reader

Abstract

The invention discloses a PFC deadlock monitoring method and device, electronic equipment and a readable medium. The PFC deadlock monitoring method comprises the steps that a middle layer periodically monitors hardware state information of bottom hardware; judging whether PFC deadlock occurs or not based on the hardware state information and a preset condition; if yes, the middle layer sends a deadlock generation signal to the upper layer software, and the upper layer software responds to the deadlock generation signal to issue a deadlock unlocking instruction so as to close the hardware state information monitoring function of the middle layer and switch the current state into a deadlock generation state. According to the PFC deadlock monitoring method and device, the electronic equipment and the readable medium provided by the invention, the deadlock state can be monitored, so that upper software can respond to the deadlock state in time; and the original upper software and the original bottom hardware are decoupled and are coupled with the message, so that the universality of the upper software is higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of communication technology, and in particular relates to a PFC deadlock monitoring method, device, electronic equipment and readable medium. Background Art

[0002] In modern Ethernet communication technology, network congestion management is one of the key technologies to ensure data transmission efficiency and network reliability. Traditional flow control technology usually avoids congestion by blocking all traffic on the entire link. Although this approach can temporarily solve the congestion problem, it will also reduce the bandwidth utilization of the entire network. Especially in high-speed network environments, the limitations of this control strategy are more obvious.

[0003] In order to overcome the shortcomings of traditional flow control technology, the IEEE802.1Qbb standard introduced priority-based flow control (PFC). PFC technology allows the creation of up to 8 virtual channels on a single physical Ethernet link, and each virtual channel is assigned a specific priority (Class of Service, CoS). Compared with traditional flow control technology, PFC allows independent flow control for each virtual channel, so that when congestion occurs in a channel, only the traffic of the channel needs to be suspended without affecting the normal transmission of other channels, thereby achieving more efficient congestion management.

[0004] However, PFC technology also has potential problems in actual applications. When a network device (such as Switch-B) is unable to process received data packets in time due to buffer overload or other reasons, it will send a pause frame to the upstream device (such as Switch-A) to request to stop sending data. If the upstream device also has cache accumulation because it cannot forward data to the downstream device, this situation will have a chain reaction on the entire network, forming a closed loop, causing all devices to stop data transmission, thus forming a deadlock. This deadlock will not only seriously affect the transmission efficiency of the network, but once it occurs, the consequences may be catastrophic because it will cause the entire network traffic to completely stagnate.

[0005] Therefore, it is necessary to provide a new solution to the above technical problems. Summary of the invention

[0006] The object of the present invention is to provide a PFC deadlock monitoring method, device, electronic device and readable medium, which can monitor the deadlock state and enable the upper layer software to respond to the occurrence of the deadlock state in a timely manner.

[0007] To achieve the above purpose, the technical solution provided by the present invention is as follows:

[0008] In a first aspect, the present invention provides a PFC deadlock monitoring method, which comprises: when a deadlock occurs in the underlying hardware, the middle layer sends a deadlock occurrence signal to the upper layer software; and the upper layer software sends a deadlock release instruction to the middle layer in response to the deadlock occurrence signal.

[0009] In one or more embodiments, the middle layer periodically monitors the hardware status information of the underlying hardware; based on the hardware status information and preset conditions, determines whether a PFC deadlock occurs; if so, the middle layer sends a deadlock occurrence signal to the upper-layer software, and the upper-layer software sends a deadlock release instruction in response to the deadlock occurrence signal to turn off the hardware status information monitoring function of the middle layer and switch the current state to a deadlock occurrence state.

[0010] In one or more implementations, determining whether a PFC deadlock occurs based on the hardware status information and a preset condition includes:

[0011] If the duration that the hardware status information satisfies the preset deadlock condition exceeds the preset deadlock time, it is determined that a PFC deadlock occurs.

[0012] In one or more embodiments, the method further comprises:

[0013] The middle layer determines whether the current state is a deadlock state; if so, determines whether the duration of the deadlock state exceeds the preset recovery time; if the duration of the deadlock state exceeds the preset recovery time, the middle layer sends a recovery completion signal to the upper-layer software, and the upper-layer software sends a deadlock monitoring instruction in response to the recovery completion signal to enable the hardware status information monitoring function of the middle layer and switch the current state to the recovery completion state.

[0014] In one or more embodiments, the method specifically comprises:

[0015] The middle layer periodically determines whether the current state is a deadlock state; if so, updates the remaining recovery time of the current judgment cycle, which is the difference between the remaining recovery time of the previous judgment cycle and the duration of the judgment cycle; determines whether the remaining recovery time of the current judgment cycle is greater than 0; if so, the middle layer ends the current judgment and waits for the next judgment cycle; if not, it determines that the duration of the deadlock state exceeds the preset recovery time.

[0016] In one or more embodiments, the method further comprises:

[0017] The middle layer determines whether the current state is a recovery completion state; if so, determines whether the current hardware state information satisfies a preset deadlock condition; if the current hardware state information satisfies the preset deadlock condition, determines whether the duration for which the hardware state information satisfies the preset deadlock condition exceeds a preset deadlock time; if so, the middle layer sends a deadlock sending signal to the upper-layer software, and the upper-layer software sends a deadlock release instruction in response to the deadlock sending signal to turn off the hardware state information monitoring function of the middle layer and switch the current state to a deadlock occurrence state.

[0018] In one or more embodiments, the method specifically comprises:

[0019] The middle layer periodically determines whether the hardware status information of the underlying hardware meets the preset deadlock condition; if so, updates the remaining deadlock time of the current judgment cycle, which is the difference between the remaining deadlock time of the previous judgment cycle and the duration of the judgment cycle; determines whether the remaining deadlock time of the current judgment cycle is greater than 0; if so, the middle layer ends the current judgment and waits for the next judgment cycle; if not, it determines that the duration of the hardware status information meeting the preset deadlock condition exceeds the preset deadlock time.

[0020] In one or more embodiments, the method further comprises:

[0021] If the current hardware status information does not meet the preset deadlock condition, the remaining deadlock time of the current judgment cycle is reset to the preset deadlock time.

[0022] In a second aspect, the present invention provides a PFC deadlock monitoring device, comprising:

[0023] A monitoring module is used to periodically monitor the hardware status information of the underlying hardware; a judgment module is used to judge whether a PFC deadlock occurs based on the hardware status information and preset conditions; a state switching module is used to send a deadlock occurrence signal to the upper-layer software when a PFC deadlock occurs, so that the upper-layer software responds to the deadlock occurrence signal and sends a deadlock release instruction to turn off the hardware status information monitoring function of the middle layer and switch the current state to a deadlock occurrence state.

[0024] In a third aspect, the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the PFC deadlock monitoring method as described above when executing the program.

[0025] In a fourth aspect, the present invention provides a computer-readable medium, wherein the computer-readable medium carries computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the PFC deadlock monitoring method as described above.

[0026] Compared with the prior art, the PFC deadlock monitoring method, device, electronic device and readable medium provided by the present invention can monitor the deadlock state, so that the upper-layer software can respond to the occurrence of the deadlock state in a timely manner; and decouple the original upper-layer software from the underlying hardware, so that both are coupled with messages, so that the upper-layer software is more versatile, and one set of software can be adapted to multiple sets of hardware; when the equipment manufacturer replaces the underlying switching chip, it only needs to increase the branch of obtaining hardware information of the chip manufacturer, and the upper-layer software logic is universal, which is conducive to maintenance, reduces the workload of developers, and increases system stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0028] Figure 1 A schematic diagram of an implementation scenario of a PFC deadlock monitoring method in an embodiment of the present invention;

[0029] Figure 2 Flow chart of a PFC deadlock monitoring method according to an embodiment of the present invention;

[0030] Figure 3 A judgment logic diagram of the recovery completion state in one embodiment of the present invention;

[0031] Figure 4 A logic diagram for determining a deadlock state in an embodiment of the present invention;

[0032] Figure 5 is a flow chart of an implementation method of a PFC deadlock monitoring method in one embodiment of the present invention;

[0033] Figure 6 A structural block diagram of a PFC deadlock monitoring device in one embodiment of the present invention;

[0034] Figure 7 FIG. 4 is a structural block diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0035] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0036] In order to facilitate understanding of the technical solutions of the present application, the technical terms that may appear in the present invention are first explained in detail below.

[0037] Deadlock time: specifies the duration for a series of deadlock conditions to be met. If the conditions are continuously met for more than the specified time value, it is considered a deadlock.

[0038] Recovery time: After a deadlock occurs, the upper-layer software will issue a deadlock resolution instruction and delay for a period of time (recovery time) to allow the data path to resume forwarding and alleviate congestion.

[0039] Scan cycle: The scan cycle for obtaining hardware information.

[0040] Although the existing Priority Flow Control (PFC) technology has achieved remarkable results in improving the quality of network services, it still has the risk of causing network deadlock under certain network topologies. Once this deadlock occurs, it will seriously affect the stability of the network and the continuity of data transmission, especially in high-load or complex network environments, where its negative impact is more prominent.

[0041] The technical implementation idea of ​​the present invention is derived from the analysis of potential deadlock problems in the existing PFC mechanism. The inventor found that although PFC can finely control traffic based on priority, in the case of unreasonable network topology design or excessive network load, the pause frame interaction between devices may cause all traffic to stagnate, that is, deadlock. The existing technology lacks an effective monitoring and prevention mechanism to promptly detect and handle this situation.

[0042] In addition, since the hardware information provided by the switching chips of different chip manufacturers is different, the upper-layer system needs to specifically judge the information provided by each manufacturer. In this way, the coupling degree between the upper-layer software and the underlying hardware is high, and the software and hardware must correspond one to one, which has poor versatility. When the equipment manufacturer replaces a switching chip, the upper-layer software must be re-adapted, which is labor-intensive and troublesome to maintain.

[0043] In view of this defect of the prior art, the present invention proposes a PFC deadlock monitoring method, the core of which is to achieve real-time monitoring of the network device status and rapid response to deadlock situations. The technical implementation idea of ​​the present invention is specifically as follows: when the underlying hardware is deadlocked, the middle layer sends a deadlock occurrence signal to the upper layer software; the upper layer software responds to the deadlock occurrence signal and sends a deadlock release instruction to the middle layer.

[0044] Specifically, by integrating a monitoring module in the middle layer of the network device, the status information of the underlying hardware is collected and analyzed in real time, including but not limited to the message cache, traffic status, and the reception of pause frames. Based on the real-time monitored data and combined with the preset deadlock conditions, the middle layer can determine whether the network has entered a deadlock state. Once the middle layer determines the deadlock state, it will immediately send a deadlock occurrence signal to the upper-layer software. After receiving the signal, the upper-layer software will issue a deadlock resolution instruction to terminate the traffic that may cause the deadlock, and switch the system status to reflect the current deadlock situation. After a deadlock occurs, the upper-layer software will turn off the monitoring function of the middle layer to avoid unnecessary resource consumption in the deadlock state, and concentrate resources on deadlock recovery processing.

[0045] The method of the present invention is designed to be decoupled from specific hardware models, so that the upper-layer software can be universally used on different hardware platforms, thereby reducing the dependence on specific hardware and improving the maintainability and scalability of the system.

[0046] Please refer to Figure 1 FIG. 1 is a schematic diagram of an implementation scenario of a PFC deadlock monitoring method in an embodiment of the present invention. Figure 1 The implementation scenario shown includes the underlying hardware, the middle layer (adaptation layer) and the upper layer software of the communication connection. The upper layer software can send various instruction parameters to the middle layer, such as deadlock time, recovery time and scanning cycle, etc. The middle layer can obtain the hardware status information of the underlying hardware and upload messages to the upper layer software (such as deadlock occurrence signal, recovery completion signal, etc.).

[0047] When a deadlock occurs, the middle layer sends a deadlock occurrence signal to the upper layer software, notifying the upper layer software that a PFC deadlock has occurred. After receiving the deadlock occurrence signal, the upper layer software immediately sends a deadlock release instruction to the middle layer to perform the corresponding deadlock release operation.

[0048] After a certain period of time has passed since the deadlock resolution operation was performed, the link can be considered to have been restored. The middle layer sends a recovery completion signal to the upper layer software to notify the upper layer software that the PFC recovery is complete. The upper layer software will restart the middle layer's monitoring of the PFC deadlock.

[0049] Please refer to Figure 2 FIG. 1 is a flow chart of a PFC deadlock monitoring method in an embodiment of the present invention. The PFC deadlock monitoring method specifically comprises the following steps:

[0050] S201: The middle layer periodically monitors the hardware status information of the underlying hardware.

[0051] It should be noted that the middle-layer software can set a timer task through the timer, which is triggered at a fixed time interval (for example, every 100 milliseconds) to perform hardware status monitoring of the underlying hardware. A series of state variables can be defined to record the current hardware status, such as the buffer occupancy rate, queue depth, packet loss rate, error counter, and traffic pattern of each port.

[0052] The required hardware status data can be pulled or pushed regularly through the management interface of the network device (such as SNMP, CLI or API). Through periodic monitoring, the system can detect trends that lead to network congestion and deadlock in advance, such as abnormal buffer accumulation or frequent Pause frame sending.

[0053] The monitored hardware status information can be recorded in the log file for subsequent analysis and debugging. In order to avoid the impact of frequent hardware access on performance, the middle layer can cache the status information for a period of time and read it when needed.

[0054] For example, a network switch's middle layer software is monitoring the status of its ports. During each scan cycle, the software checks the port's in-queue and out-queue traffic, buffer occupancy, and whether pause frames are received. If it detects that a port's buffer occupancy is continuously above a set threshold, the middle layer will record this information as a sign of potential deadlock.

[0055] S202: Based on the hardware status information and preset conditions, determine whether a PFC deadlock occurs.

[0056] It should be noted that whether to send a PFC deadlock can be determined based on the monitored hardware status information and a series of deadlock determination conditions. For example, the deadlock determination conditions may be: whether there is message accumulation in the queue under back pressure on the current egress port, whether the accumulation of the queue under back pressure is alleviated, whether pause off frames are continuously received, etc.

[0057] In an exemplary embodiment, if the duration for which the hardware status information satisfies a preset deadlock condition exceeds a preset deadlock time, it is determined that a PFC deadlock occurs.

[0058] Specifically, when the monitored hardware status information meets a series of preset deadlock conditions, and the duration of this state exceeds the preset deadlock time threshold, the middle layer will determine that a PFC deadlock has occurred.

[0059] For example, the middle-layer software can monitor the hardware status information in real time and record the time point and duration when the deadlock condition is met. The middle-layer can have a built-in logic judgment mechanism to compare the current duration with the preset deadlock time threshold. When the monitored deadlock condition duration exceeds the set deadlock time threshold, the middle-layer software will determine that a PFC deadlock has occurred.

[0060] S203: If yes, the middle layer sends a deadlock occurrence signal to the upper layer software, and the upper layer software sends a deadlock resolution instruction in response to the deadlock occurrence signal to disable the hardware status information monitoring function of the middle layer and switch the current state to a deadlock occurrence state.

[0061] It should be noted that after the middle-layer software determines that a deadlock has occurred, it will send a deadlock occurrence signal to the upper-layer software through the system's internal signal transmission mechanism (such as event callback, message queue, API call, etc.). The signal may include detailed information about the deadlock, such as timestamp, affected hardware interface, current hardware status information, etc.

[0062] After receiving the deadlock signal, the upper-layer software will activate the preset deadlock resolution process, which may include one or more deadlock resolution instructions. The deadlock resolution instruction can be a configuration change command, such as adjusting traffic priority, clearing cache, suspending certain traffic, etc. When issuing the deadlock resolution instruction, the upper-layer software will update the system status and mark it as a deadlock occurrence state to indicate the current network status. In order to avoid unnecessary resource consumption in the deadlock state, the upper-layer software will instruct the middle layer to turn off the monitoring function of the hardware status information.

[0063] In an exemplary embodiment, the middle layer determines whether the current state is a deadlock state; if so, it determines whether the duration of the deadlock state exceeds the preset recovery time; if the duration of the deadlock state exceeds the preset recovery time, the middle layer sends a recovery completion signal to the upper-layer software, and the upper-layer software sends a deadlock monitoring instruction in response to the recovery completion signal to enable the hardware status information monitoring function of the middle layer and switch the current state to the recovery completion state.

[0064] It should be noted that the middle layer will continuously detect whether the system is currently in a "deadlock state" and can use a timer or counter to record the duration of the deadlock state. This detection can be achieved through an internal state identifier, which is activated when the system enters the deadlock processing process. After confirming that the system is in a deadlock state, the middle layer will start timing and monitor the specific duration of the deadlock state to determine whether it exceeds the recovery time threshold set by the administrator. The recovery time is the time when the deadlock occurs and the upper-layer software sends a deadlock release instruction, and then delays for a period of time to allow the data path to resume forwarding and relieve congestion.

[0065] If the deadlock state lasts longer than the preset recovery time, it can be considered that the link has been restored and the congestion has been relieved. The middle layer will automatically generate and send a "recovery completion signal" to the upper layer software. This signal can be implemented through network messages, event triggers, or API calls. After the upper layer software receives the recovery completion signal, it will issue instructions based on the signal to restart the hardware status information monitoring function of the middle layer and update the system status from "deadlock occurred" to "recovery completed".

[0066] Specifically, the specific method for determining whether the duration of the deadlock state exceeds the preset recovery time is as follows: the middle layer periodically determines whether the current state is a deadlock state; if so, updates the remaining recovery time of the current determination cycle, which is the difference between the remaining recovery time of the previous determination cycle and the duration of the determination cycle. Determine whether the remaining recovery time of the current determination cycle is greater than 0; if so, the middle layer ends the current determination and waits for the next determination cycle; if not, it is determined that the duration of the deadlock state exceeds the preset recovery time.

[0067] The middle layer can implement a loop mechanism that checks the current network status at the beginning of each preset judgment cycle. The middle layer maintains a state flag to record whether it is currently in a deadlock state. A remaining recovery time counter is maintained for each duration of the deadlock state. At the end of each judgment cycle, the middle layer updates the remaining recovery time of the current cycle, calculated by subtracting the duration of the current cycle from the remaining recovery time of the previous cycle. The middle layer compares the updated remaining recovery time with 0 to determine whether it needs to continue waiting or determine that the deadlock state has exceeded the preset recovery time. If the remaining recovery time is greater than 0, the middle layer will wait for the next judgment cycle; if it is less than or equal to 0, the deadlock timeout processing flow is triggered.

[0068] For example, a network device enters a deadlock state at a certain point in time, and the preset recovery time is 30 seconds. The middle-layer software checks the network status every 5 seconds for the next 30 seconds. If at the 25th second, the network status shows that the deadlock has been resolved, the middle layer will update the remaining recovery time to 5 seconds and confirm that the deadlock has been resolved in the next cycle (30th second). If the network status still does not show that the deadlock has been resolved until the 30th second, the middle layer will determine that the duration of the deadlock state exceeds the preset recovery time and trigger the corresponding processing flow.

[0069] Please refer to Figure 3 As shown, the judgment logic of the aforementioned recovery completion state can be implemented by configuring a timer, where the recovery time is represented by recover_time, the timer scanning period is represented by interval, and the remaining recovery time is represented by recover_time_left; the specific judgment logic is as follows:

[0070] ① Determine whether the current state is in the "deadlock occurs" state, if not, exit directly;

[0071] ②Update consumption time: recover_time_left = recover_time – interval;

[0072] ③ Determine whether the remaining recovery time recover_time_left is exhausted:

[0073] If recover_time_left>0, exit directly;

[0074] If recover_time_left≤0, send a "recovery completed" message to the upper-layer software.

[0075] In an exemplary embodiment, the PFC deadlock monitoring method of the present invention further includes: the middle layer determines whether the current state is a recovery completion state; if so, determines whether the current hardware state information satisfies a preset deadlock condition; if the current hardware state information satisfies the preset deadlock condition, determines whether the duration for which the hardware state information satisfies the preset deadlock condition exceeds a preset deadlock time; if so, the middle layer sends a deadlock sending signal to the upper layer software, and the upper layer software sends a deadlock release instruction in response to the deadlock sending signal to turn off the hardware state information monitoring function of the middle layer and switch the current state to a deadlock occurrence state.

[0076] The middle layer first checks whether it is currently in the "recovery completion state". This state indicates that the previous deadlock of the system has been resolved and the network has resumed normal operation. The middle layer continuously monitors the current hardware status information, such as buffer occupancy, Pause frame frequency, etc., to determine whether these indicators meet the preset deadlock conditions again. If the current hardware status information meets the preset deadlock conditions, the system starts timing and monitors the duration of these conditions. Determine whether the duration of these status information meeting the deadlock conditions has exceeded the preset deadlock time (for example, 5 consecutive minutes). If it is confirmed that the abnormality of the hardware status information continues to exceed the preset deadlock time, the middle layer will send a "deadlock occurrence signal" to the upper-layer software. After receiving the signal, the upper-layer software sends a deadlock resolution instruction, and the upper-layer software instructs the middle layer to turn off the hardware status monitoring function and update the system status to "deadlock occurrence status".

[0077] For example, the network device detects continuous high traffic and buffer overflow on port B, and the middle-layer software determines that the current state is the recovery completion state. However, in the next monitoring cycle, the middle-layer software finds that the buffer utilization rate of port B continues to exceed 90%, and pause frames are continuously received, which meets the preset deadlock condition. The middle-layer software starts timing and confirms that the deadlock condition duration exceeds the threshold after 10 seconds (exceeding the preset deadlock time of 5 seconds). Immediately, the middle-layer software sends a deadlock signal to the upper-layer software. After confirmation, the upper-layer software sends a deadlock release instruction, turns off the monitoring function, and updates the system status to the deadlock occurrence state.

[0078] Specifically, the specific method for judging whether the duration that the hardware status information satisfies the preset deadlock condition exceeds the preset deadlock time is as follows: the middle layer periodically judges whether the hardware status information of the underlying hardware satisfies the preset deadlock condition; if so, updates the remaining deadlock time of the current judgment cycle, and the remaining deadlock time of the current judgment cycle is the difference between the remaining deadlock time of the previous judgment cycle and the duration of the judgment cycle; judges whether the remaining deadlock time of the current judgment cycle is greater than 0; if so, the middle layer ends the current judgment and waits for the next judgment cycle; if not, it is determined that the duration that the hardware status information satisfies the preset deadlock condition exceeds the preset deadlock time.

[0079] The middle-layer software can be configured to automatically perform hardware status checks at fixed time intervals (i.e., judgment cycles). The set deadlock conditions may include queue delays, buffer overflows, continuous reception of pause frames, etc. These conditions are used to determine whether the network has entered a potential deadlock state. At the end of each judgment cycle, the middle-layer software will update the remaining deadlock time based on the remaining deadlock time of the previous cycle and the duration of the current cycle. The middle-layer software compares the updated remaining deadlock time with 0 to determine whether it is necessary to continue monitoring or confirming the deadlock. If the remaining deadlock time is greater than 0, the middle-layer software will wait until the next judgment cycle; if it is equal to or less than 0, the middle-layer software will confirm that the duration of the hardware status information meeting the preset deadlock condition exceeds the preset deadlock time.

[0080] For example, taking a network switch as an example, the middle-layer software is configured to check the status of the port every 100 milliseconds. The preset deadlock condition is that the delay of the port queue exceeds the set threshold and lasts for 20 seconds. At the 15th second, the middle-layer software detects that the delay exceeds the threshold and starts counting the remaining deadlock time. In the next few cycles, the delay persists. At the end of the 20th second cycle, the middle-layer software updates the remaining deadlock time to 0 (i.e., 20 seconds - 20 seconds = 0 seconds), confirms the deadlock state, and generates a deadlock occurrence signal.

[0081] Furthermore, if the current hardware status information does not meet the preset deadlock condition, the remaining deadlock time of the current judgment cycle is reset to the preset deadlock time. The middle-layer software can evaluate the current status information of the underlying hardware to determine whether all preset deadlock conditions are not met. If the current state does not meet the deadlock condition, the middle-layer software will execute the reset logic to reset the remaining deadlock time to the preset deadlock time. The middle-layer software can maintain a time parameter for storing the preset deadlock time, which is set when the system is initialized and adjusted when necessary. After resetting the remaining deadlock time, the middle-layer software updates the system status, indicating that no deadlock is currently detected, and the monitoring cycle restarts.

[0082] For example, in a network switch, the preset deadlock time is 25 seconds. The middle-layer software detects that some queues begin to delay at the 5th second, but at the 10th second, the delay has eased and the deadlock condition is no longer met. The middle-layer software then resets the remaining deadlock time from 20 seconds (25 seconds - 5 seconds) back to 25 seconds, and the system continues to monitor, but the deadlock monitoring cycle starts counting again.

[0083] Please refer to Figure 4 As shown, the above judgment logic can be implemented by configuring the timer, where the deadlock time is represented by detect_time, the timer scanning period is represented by interval, the remaining deadlock time is represented by detect_time_left, and the deadlock judgment condition is represented by condition; the specific judgment logic is as follows:

[0084] ① Determine whether the current state is in the "recovery completed" state, if not, exit directly;

[0085] ② Determine whether the current condition is satisfied:

[0086] If satisfied, update the remaining deadlock time detect_time_left = detect_time – interval;

[0087] If not satisfied, reset the remaining deadlock time detect_time_left = detect_time;

[0088] ③ Determine whether the remaining deadlock time detect_time_left is exhausted:

[0089] If detect_time_left>0, exit directly;

[0090] If detect_time_left≤0, send a "deadlock occurred" message to the upper-level software.

[0091] Please refer to Figure 5As shown, Figure 5 The implementation process of the PFC deadlock monitoring method of the present invention is shown. Specifically, the system is initialized, and the hardware model information, such as the model of the forwarding chip, is obtained to determine the parameter information that the hardware can provide. The user configures relevant parameters, such as deadlock time, recovery time, timer scanning cycle, ports to be monitored, and corresponding port queues. After the configuration is completed, the default recovery completion state is entered, the timer is started, and the hardware information is periodically obtained. Since the information that each chip manufacturer can provide is different, the content of the hardware information obtained is determined by the initialized hardware model information. If the deadlock condition is met, the deadlock occurrence message is reported by the adaptation layer, and the upper layer software will issue a deadlock release command and switch to the deadlock occurrence state. In the deadlock occurrence state, if the remaining recovery time is exhausted, the adaptation layer reports a recovery completion message, and the upper layer re-issues the deadlock monitoring command and switches to the recovery completion state.

[0092] In summary, the PFC deadlock monitoring method provided by the present invention can monitor the deadlock state, so that the upper-layer software can respond to the occurrence of the deadlock state in a timely manner; and the original upper-layer software is decoupled from the underlying hardware, so that both are coupled with messages, so that the upper-layer software is more versatile, and one set of software can be adapted to multiple sets of hardware; when the equipment manufacturer replaces the underlying switching chip, it only needs to increase the branch of obtaining hardware information of the chip manufacturer, and the upper-layer software logic is universal, which is conducive to maintenance, reduces the workload of developers, and increases system stability.

[0093] Please refer to Figure 6 As shown, based on the same inventive concept as the aforementioned PFC deadlock monitoring method, the present invention provides a PFC deadlock monitoring method 600 , which includes: a monitoring module 601 , a judgment module 602 and a state switching module 603 .

[0094] The monitoring module 601 is used to periodically monitor the hardware status information of the underlying hardware. The judgment module 602 is used to judge whether a PFC deadlock occurs based on the hardware status information and preset conditions. The state switching module 603 is used to send a deadlock occurrence signal to the upper layer software when a PFC deadlock occurs, so that the upper layer software responds to the deadlock occurrence signal and sends a deadlock release instruction to turn off the hardware status information monitoring function of the middle layer and switch the current state to a deadlock occurrence state.

[0095] Please refer to Figure 7As shown, an embodiment of the present invention further provides an electronic device 700, which includes at least one processor 701, a memory 702 (for example, a non-volatile memory), a memory 703, and a communication interface 704, and the at least one processor 701, the memory 702, the memory 703, and the communication interface 704 are connected together via a bus 705. The at least one processor 701 is used to call at least one program instruction stored or encoded in the memory 702, so that the at least one processor 701 performs various operations and functions of the PFC deadlock monitoring method described in various embodiments of this specification.

[0096] In an embodiment of the present specification, the electronic device 700 may include, but is not limited to, a personal computer, a server computer, a workstation, a desktop computer, a laptop computer, a notebook computer, a mobile electronic device, a smart phone, a tablet computer, a cellular phone, a personal digital assistant (PDA), a handheld device, a messaging device, a wearable electronic device, a consumer electronic device, and the like.

[0097] An embodiment of the present invention further provides a computer-readable medium carrying computer-executable instructions. When the computer-executable instructions are executed by a processor, they can be used to implement various operations and functions of the PFC deadlock monitoring method described in various embodiments of this specification.

[0098] The computer-readable medium in the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0099] In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0100] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0101] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatuses, systems, and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0102] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

[0103] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A PFC deadlock monitoring method, characterized in that: include: When the underlying hardware deadlocks, the middle layer sends a deadlock occurrence signal to the upper layer software; The upper layer software responds to the deadlock occurrence signal and sends a deadlock resolution instruction to the middle layer.

2. The PFC deadlock monitoring method according to claim 1, characterized in that: The method specifically comprises: The middle layer monitors the hardware status information of the underlying hardware; Based on the hardware status information and preset conditions, determining whether a PFC deadlock occurs; If so, the middle layer sends a deadlock occurrence signal to the upper layer software, and the upper layer software sends a deadlock resolution instruction in response to the deadlock occurrence signal to disable the hardware status information monitoring function of the middle layer and switch the current state to a deadlock occurrence state.

3. The PFC deadlock monitoring method according to claim 2, characterized in that: Based on the hardware status information and preset conditions, determining whether a PFC deadlock occurs includes: If the duration that the hardware status information satisfies the preset deadlock condition exceeds the preset deadlock time, it is determined that a PFC deadlock occurs.

4. The PFC deadlock monitoring method according to claim 2, characterized in that: The method further comprises: The middle layer determines whether the current state is a deadlock state; If so, determine whether the duration of the deadlock state exceeds the preset recovery time; If the deadlock state lasts longer than the preset recovery time, the middle layer sends a recovery completion signal to the upper layer software. The upper layer software responds to the recovery completion signal and sends a deadlock monitoring instruction to enable the hardware status information monitoring function of the middle layer and switch the current state to the recovery completion state.

5. The PFC deadlock monitoring method according to claim 4, characterized in that: The method specifically comprises: The middle layer periodically determines whether the current state is a deadlock state; If yes, update the remaining recovery time of the current judgment cycle, the remaining recovery time of the current judgment cycle is the difference between the remaining recovery time of the previous judgment cycle and the duration of the judgment cycle; Determine whether the remaining recovery time of the current judgment cycle is greater than 0; If so, the middle layer ends the current judgment and waits for the next judgment cycle; If not, it is determined that the duration of the deadlock state exceeds the preset recovery time.

6. The PFC deadlock monitoring method according to claim 4, characterized in that: The method further comprises: The middle layer determines whether the current state is the recovery completion state; If so, determine whether the current hardware status information meets the preset deadlock condition; If the current hardware status information satisfies the preset deadlock condition, determining whether the duration for which the hardware status information satisfies the preset deadlock condition exceeds a preset deadlock time; If so, the middle layer sends a deadlock signal to the upper layer software, and the upper layer software sends a deadlock release instruction in response to the deadlock signal to disable the hardware status information monitoring function of the middle layer and switch the current state to a deadlock occurrence state.

7. The PFC deadlock monitoring method according to claim 6, characterized in that: The method specifically comprises: The middle layer periodically determines whether the hardware status information of the underlying hardware meets the preset deadlock condition; If yes, update the remaining deadlock time of the current judgment cycle, the remaining deadlock time of the current judgment cycle is the difference between the remaining deadlock time of the previous judgment cycle and the duration of the judgment cycle; Determine whether the remaining deadlock time of the current judgment cycle is greater than 0; If so, the middle layer ends the current judgment and waits for the next judgment cycle; If not, it is determined that the duration for which the hardware status information satisfies the preset deadlock condition exceeds the preset deadlock time.

8. The PFC deadlock monitoring method according to claim 7, characterized in that: The method further comprises: If the current hardware status information does not meet the preset deadlock condition, the remaining deadlock time of the current judgment cycle is reset to the preset deadlock time.

9. A PFC deadlock monitoring device, characterized in that: include: Monitoring module, used to periodically monitor the hardware status information of the underlying hardware; A determination module, used for determining whether a PFC deadlock occurs based on the hardware status information and preset conditions; The state switching module is used to send a deadlock occurrence signal to the upper-layer software when a PFC deadlock occurs, so that the upper-layer software responds to the deadlock occurrence signal and sends a deadlock release instruction to turn off the hardware state information monitoring function of the middle layer and switch the current state to the deadlock occurrence state.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the PFC deadlock monitoring method according to any one of claims 1 to 8 is implemented.

11. A computer readable medium, characterized in that The computer-readable medium carries computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the PFC deadlock monitoring method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Signal conversion anti-locking monitoring circuit and method and signal converter

    CN122783084A