Non-transparent bridge monitoring method, device and equipment and computer readable storage medium
By dividing non-transparent bridge equipment into multiple channels and performing status monitoring and management, the problem of low data transmission efficiency in traditional solutions is solved, and efficient data transmission and fault handling is achieved.
Patent Information
- Application Number
- CN202510685278.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-08-29
AI Technical Summary
The traditional non-transparent bridge transmission scheme is inefficient in cross-host domain communication, and the failure to effectively manage non-transparent bridge channel failures leads to performance degradation.
By configuring the non-transparent bridge device into multiple non-transparent bridge channels, obtain data channel configuration parameters after the device is started, access registers to obtain channel status parameters, realize channel-level management, and select the best channel for data transmission.
The data transmission efficiency of non-transparent bridges across host domain communication is improved, and a single channel failure is avoided as a bottleneck, and flexible error handling and power consumption management are realized.
Smart Images

Figure CN120560945A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a non-transparent bridge monitoring method, device, equipment, and computer-readable storage medium. Background Art
[0002] A non-transparent bridge (NTB) device (also known as a non-transparent bridge card) complies with the high-speed Peripheral Component Interconnect Express (PCIe) specification. It uses internal address translation and conversion to enable data sharing between different storage domains or hosts. By plugging a non-transparent bridge device into a PCIe slot on a server or other device, two devices can communicate across host domains using the local non-transparent bridge. With the increasing volume of stored data and the complexity of system architectures, the demand for data processing efficiency is increasing, and traditional non-transparent bridge transmission solutions are no longer able to meet these requirements.
[0003] How to optimize the non-transparent bridge transmission solution to improve the data transmission efficiency of cross-host domain communication is a technical problem that those skilled in the art need to solve. Summary of the Invention
[0004] The present invention provides a non-transparent bridge monitoring method, apparatus, device and computer-readable storage medium to at least solve the problem of low data transmission efficiency when using a non-transparent bridge device to perform cross-host domain communication in the related art.
[0005] The present invention provides a non-transparent bridge monitoring method, comprising: After the device is started, obtaining data channel configuration parameters of a non-transparent bridge device installed in the device, wherein the non-transparent bridge device is configured as a plurality of non-transparent bridge channels; Accessing a register of the non-transparent bridge device to obtain a channel state parameter of the non-transparent bridge channel of the non-transparent bridge device based on the data channel configuration parameter; The channel state of the non-transparent bridge channel is determined according to the channel state parameter, and the corresponding channel state information is sent to the data transmission module of the device, so that the data transmission module selects a target non-transparent bridge channel for transmitting data from the non-transparent bridge device.
[0006] The present invention also provides a non-transparent bridge monitoring device, comprising: A first acquiring unit is configured to acquire, after the device is started, data channel configuration parameters of a non-transparent bridge device installed in the device, wherein the non-transparent bridge device is configured as a plurality of non-transparent bridge channels; a second acquiring unit, configured to access a register of the non-transparent bridge device to acquire a channel state parameter of the non-transparent bridge channel of the non-transparent bridge device based on the data channel configuration parameter; A control unit is configured to determine the channel state of the non-transparent bridge channel according to the channel state parameter, and send the corresponding channel state information to the data transmission module of the device, so that the data transmission module selects a target non-transparent bridge channel for transmitting data from the non-transparent bridge device.
[0007] The present invention also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any one of the above-mentioned non-transparent bridge monitoring methods when executing the computer program.
[0008] The present invention also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned non-transparent bridge monitoring methods are implemented.
[0009] Through the present invention, since the non-transparent bridge device is configured as multiple non-transparent bridge channels, after the device is started, the data channel configuration parameters of the non-transparent bridge device installed in the device are obtained, and then the register of the non-transparent bridge device is accessed based on the data channel configuration parameters to obtain the channel status parameters of the non-transparent bridge channel of the non-transparent bridge device, and then the channel status of the non-transparent bridge channel is determined according to the channel status parameters, and the corresponding channel status information is sent to the data transmission module of the device, thereby realizing channel-level management of the non-transparent bridge device, and allowing the data transmission module to select the target non-transparent bridge channel for transmitting data according to the channel status information of different non-transparent bridge channels in the non-transparent bridge device. Compared with the traditional non-transparent bridge solution, once there is a partial non-transparent bridge channel failure, the non-transparent bridge device cannot be used, and a single non-transparent bridge channel can be avoided from becoming a bottleneck, thereby achieving the technical effect of improving the data transmission efficiency of the non-transparent bridge to realize cross-host domain communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0011] Figure 1 It is a structural diagram of a data transmission system; Figure 2 A flowchart of a non-transparent bridge monitoring method provided by an embodiment of the present invention; Figure 3A schematic structural diagram of a data transmission system provided by an embodiment of the present invention; Figure 4 A flowchart of the initialization steps for transmission rate negotiation of a non-transparent bridge channel provided by an embodiment of the present invention; Figure 5 This is a flow chart of another non-transparent bridge monitoring method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0012] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0013] It should be noted that, in the description of the present invention, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. The terms "first," "second," etc., in the present invention are used to distinguish similar objects, and are not used to describe a particular order or precedence.
[0014] In order to enable those skilled in the art to better understand the solutions of the present invention, the present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0015] Here, some key terms used in the embodiments of the present invention are explained.
[0016] Non-Transparent Bridge (NTB) is a method for accessing storage across host domains, allowing different hosts to access each other.
[0017] Direct Memory Access (DMA) is a technology used in computer systems to efficiently transfer data. It allows certain hardware devices (such as disk controllers, network cards, and graphics cards) to directly access system memory without the intervention of the Central Processing Unit (CPU). DMA's primary purpose is to reduce CPU load and improve data transfer efficiency.
[0018] A non-transparent bridge (NTB) device (also known as a non-transparent bridge card) can be connected to the high-speed Peripheral Component Interconnect Express (PCIe) slot of a device (such as a server) to communicate with a local host. The two devices connected by the non-transparent bridge device are connected via the PCIe bus (possibly using PCIe traces on the backplane), enabling the local host to access the remote host and perform data forwarding tasks.
[0019] A non-transparent bridge device uses an address translation mechanism to map the local host's address space to the remote host's address space. A non-transparent bridge device can forward PCIe transactions from the local host to the remote host. Transactions include memory reads and writes, I / O operations, and configuration operations. A non-transparent bridge device forwards these transactions from one host to another over the PCIe bus. A non-transparent bridge device ensures reliable data transmission through various mechanisms, such as address translation and error detection and correction.
[0020] Non-transparent bridge devices can be used in high-availability systems to implement failover and data backup between hosts. They can also be used in distributed computing systems to connect multiple computing nodes for fast data transmission and sharing. They can also be used in storage expansion scenarios to connect storage devices for efficient data read and write.
[0021] In summary, a non-transparent bridge device can efficiently and reliably implement data transmission between two independent hosts.
[0022] The PCIe interface of a non-transparent bridge device has multiple data channels, each of which can transmit data independently. For example, in a x16 PCIe interface, data can be transmitted simultaneously on 16 data channels, thereby improving data transmission efficiency.
[0023] Figure 1 A structural diagram of a data transmission system.
[0024] like Figure 1As shown, using a traditional non-transparent bridge device deployment solution, the non-transparent bridge device is registered as a device module (dev) in the server's resource management. This means that the non-transparent bridge device is treated as a non-transparent bridge channel. During data transmission, the data transmission module at the business layer calls the non-transparent bridge device to perform data transmission tasks, using this non-transparent bridge channel to transmit data at full speed. This makes it impossible to detect and locate the error if an error occurs in one of the data channels. Furthermore, data retransmissions due to data transmission errors can lead to performance degradation. If an unrecoverable error is detected in the non-transparent bridge device, the business layer will deem the non-transparent bridge device unusable and halt the data transmission task.
[0025] Therefore, traditional non-transparent bridge transmission solutions cannot meet the current requirements for data processing efficiency.
[0026] To this end, the embodiments of the present invention provide a non-transparent bridge monitoring method, apparatus, device and computer-readable storage medium. By configuring a non-transparent bridge device into multiple non-transparent bridge channels, after the device is started, the data channel configuration parameters of the non-transparent bridge device installed in the device are obtained, and then the register of the non-transparent bridge device is accessed based on the data channel configuration parameters to obtain the channel status parameters of the non-transparent bridge channel of the non-transparent bridge device, and then the channel status of the non-transparent bridge channel is determined according to the channel status parameters, and the corresponding channel status information is sent to the data transmission module of the device, thereby realizing channel-level management of the non-transparent bridge device, and allowing the data transmission module to select the target non-transparent bridge channel for data transmission according to the channel status information of different non-transparent bridge channels in the non-transparent bridge device. Compared with the traditional non-transparent bridge solution, once some non-transparent bridge channels fail, the non-transparent bridge device cannot be used. This can avoid a single non-transparent bridge channel from becoming a bottleneck, thereby achieving the technical effect of improving the data transmission efficiency of the non-transparent bridge to achieve cross-host domain communication.
[0027] An embodiment of the present invention provides a non-transparent bridge monitoring method. The method is described in detail below in conjunction with the execution flow of the non-transparent bridge monitoring method.
[0028] Figure 2 A flowchart of a non-transparent bridge monitoring method provided by an embodiment of the present invention; Figure 3 A structural diagram of a data transmission system provided by an embodiment of the present invention.
[0029] like Figure 2 As shown, the non-transparent bridge monitoring method provided by the embodiment of the present invention may include:
[0030] S201: After the device is started, data channel configuration parameters of a non-transparent bridge device installed in the device are obtained, where the non-transparent bridge device is configured as a plurality of non-transparent bridge channels.
[0031] S202: Based on the data channel configuration parameters, access the register of the non-transparent bridge device to obtain the channel state parameters of the non-transparent bridge channel of the non-transparent bridge device.
[0032] S203: Determine the channel status of the non-transparent bridge channel according to the channel status parameter, and send the corresponding channel status information to the data transmission module of the device, so that the data transmission module selects a target non-transparent bridge channel for data transmission from the non-transparent bridge device.
[0033] In the embodiment of the present invention, the device may be a server or other device equipped with a non-transparent bridge device.
[0034] The embodiments of the present invention implement a multi-non-transparent bridge channel redundancy architecture by deploying a resource management module, a channel management module, an NTB module, and an error handling module. The resource management module is used to apply for system resources for non-transparent bridge devices. The channel management module is used to monitor and manage the non-transparent bridge channels of non-transparent bridges. The NTB module is used to control the initialization process of non-transparent bridge devices. The error handling module is used to handle error channels in non-transparent bridge devices based on error information provided by the channel management module.
[0035] Based on the specifications of the non-transparent bridge device, the PCIe data channel of the non-transparent bridge device is pre-divided into multiple non-transparent bridge channels, and the division method of the non-transparent bridge channels is written into the register of the non-transparent bridge device as a data channel configuration parameter, so that the non-transparent bridge device can transmit data according to the division method of the non-transparent bridge channels. A non-transparent bridge channel can include one or more PCIe data channels. For example, if the PCIe interface of the non-transparent bridge device is a x16 interface, that is, it includes 16 PCIe data channels, then the non-transparent bridge device can be divided into 4 x4 non-transparent bridge channels, or 2 x8 non-transparent bridge channels, or 16 x1 non-transparent bridge channels, etc.
[0036] For S201, the data channel configuration parameters can be obtained by accessing the registers of the non-transparent bridge device, or by using the system preset channel configuration options of the device. The non-transparent bridge channel division of the non-transparent bridge device can be obtained based on the data channel configuration parameters, thereby realizing management based on the non-transparent bridge channel.
[0037] Call the resource management module to complete the application of resources required by the non-transparent bridge device driver and enable the non-transparent bridge channel.
[0038] Initialize the channel management module to create a polling thread to monitor the status of the non-transparent bridge channel in real time, so as to realize functions such as automatic channel switching when link failure occurs, reasonable allocation of transmission tasks, and real-time adjustment of link power consumption.
[0039] After the non-transparent bridge device and direct memory access module are initialized, the upper application (business layer) of the device operating system will select the appropriate non-transparent bridge channel for data transmission through the channel management module.
[0040] In S202, during device operation, the channel status parameters of each non-transparent bridge channel can be obtained by accessing the register of the non-transparent bridge device. The channel status parameters can be used to indicate whether the non-transparent bridge channel is in a normal working state or an abnormal working state, and can also be used to indicate whether the non-transparent bridge channel is in an idle state or a busy state.
[0041] In S203, the channel status parameters of the non-transparent bridge channel are analyzed to determine the channel status of the non-transparent bridge channel, for example, whether the non-transparent bridge channel is in a normal operating state or an abnormal operating state, or whether the non-transparent bridge channel is in an idle state or a busy state. The analysis in S203 can be performed by the channel management module, and channel status information is generated based on the channel status of the non-transparent bridge channel and sent to the data transmission module of the device.
[0042] In servers and other devices, non-transparent bridge devices often work in conjunction with direct memory access (DMA) modules. Upon detecting a data transfer task, the non-transparent bridge device invokes the DMA driver to perform data transfer operations. After the data transfer is complete, it performs a data check to verify the accuracy, often using CRC and checking the non-transparent bridge device's registers. The DMA driver is responsible for data transfer operations, receiving data transfer requests from the non-transparent bridge device driver to complete the data transfer. The data request includes the source / destination address and length of the data to be transferred. During the data transfer process, the local non-transparent bridge device performs address translation. The data then travels across the backplane routing to the other non-transparent bridge device, where it performs address translation. Finally, the DMA module transfers the data to the destination address, completing the transfer.
[0043] In the embodiment of the present invention, the data transmission module may refer to a module in the service layer of the device operating system that issues a data transmission task.
[0044] The embodiment of the present invention provides a data transmission system, which can be Figure 3 As shown, the two devices are host 1 and host 2. The non-transparent bridge device installed on host 1 and the non-transparent bridge device installed on host 2 are both deployed as multiple non-transparent bridge channels. Each host performs resource management, channel management, data transmission, error handling and power consumption management in units of non-transparent bridge channels (which will be further described in the following embodiments). Figure 1 The traditional non-transparent bridge deployment solution shown in the figure can switch error channels and perform flexible dynamic management through the redundant architecture of multiple non-transparent bridge channels.
[0045] The non-transparent bridge monitoring method provided by the embodiment of the present invention configures a non-transparent bridge device into multiple non-transparent bridge channels. After the device is started, the data channel configuration parameters of the non-transparent bridge device installed in the device are obtained, and then the register of the non-transparent bridge device is accessed based on the data channel configuration parameters to obtain the channel status parameters of the non-transparent bridge channel of the non-transparent bridge device, and then the channel status of the non-transparent bridge channel is determined according to the channel status parameters, and the corresponding channel status information is sent to the data transmission module of the device, thereby realizing channel-level management of the non-transparent bridge device, and allowing the data transmission module to select the target non-transparent bridge channel for data transmission according to the channel status information of different non-transparent bridge channels in the non-transparent bridge device. Compared with the traditional non-transparent bridge solution, once some non-transparent bridge channels fail, the non-transparent bridge device cannot be used. This can avoid a single non-transparent bridge channel from becoming a bottleneck, thereby achieving the technical effect of improving the data transmission efficiency of the non-transparent bridge to realize cross-host domain communication.
[0046] Based on the channel-level management of the non-transparent bridge device implemented in the embodiment of the present invention, different numbers of non-transparent bridge channels can be enabled as needed.
[0047] In an embodiment of the present invention, the initialization step of the non-transparent bridge device may include: after the device is started, determining the number of non-transparent bridge channels enabled in the non-transparent bridge device according to the data channel configuration parameters, applying for system resources of corresponding size, and performing device initialization and link initialization of the non-transparent bridge device.
[0048] In a specific implementation, while pre-configuring the division of non-transparent bridge channels in a non-transparent bridge device, the staff can also configure the number of enabled non-transparent bridge channels. Specifically, they can choose to enable all or some of the non-transparent bridge channels, or specify which specific non-transparent bridge channels to enable. During the initialization process of the non-transparent bridge device, the resource management module can determine the number of enabled non-transparent bridge channels in the non-transparent bridge device based on the data channel configuration parameters of the non-transparent bridge device, and apply for corresponding system resources, typically corresponding amounts of system memory, for these enabled non-transparent bridge channels to initialize the non-transparent bridge channels.
[0049] In the embodiment of the present invention, the initialization step of the non-transparent bridge device and the initialization step of the direct memory access module may be performed by the NTB module.
[0050] The device initialization process of the non-transparent bridge device and the device initialization process of the direct memory access module may include the configuration of the address translation conversion of the non-transparent bridge device, the enabling of the error reporting function, the application of interrupt resources, the application of the direct memory access descriptor table, and the initialization of the direct memory access channel.
[0051] The link initialization step for the non-transparent bridge device may include initializing the transmission rate negotiation for each non-transparent bridge channel. Figure 4 This is a flowchart of the initialization steps for transmission rate negotiation of a non-transparent bridge channel provided by an embodiment of the present invention.
[0052] Then Figure 4 As shown, performing transmission rate negotiation initialization of a non-transparent bridge device may include:
[0053] S401: Obtain a target value of a data transmission parameter of a physical link to which a non-transparent bridge device in a device is connected.
[0054] S402: Acquire actual values of data transmission parameters of the non-transparent bridge channel.
[0055] S403: Determine whether the actual value is greater than or equal to the target value; if yes, proceed to S404; if not, proceed to S405.
[0056] S404: Complete the transmission rate negotiation of the non-transparent bridge channel and proceed to S408.
[0057] S405: Determine whether the number of retries reaches the fourth preset number and the actual value is less than the target value; if yes, proceed to S406; if not, proceed to S407.
[0058] S406: Reinitialize the non-transparent bridge channel and proceed to S403.
[0059] S407: Set the target value of the data transmission parameter of the non-transparent bridge channel to the actual value, and proceed to S408.
[0060] S408: Execute the data transmission task of the non-transparent bridge channel based on the target value.
[0061] Through the transmission rate negotiation initialization at the non-transparent bridge channel level, the transmission rate negotiation can be carried out according to the actual situation of the link where each non-transparent bridge channel is located, so as to improve the success rate of the transmission rate initialization of the non-transparent bridge device. At this time, if a faulty non-transparent bridge channel is found, it can be closed in time to ensure the use of other normal non-transparent bridge channels.
[0062] The link initialization step for non-transparent bridge devices may also include double-end verification, including verification of device information at both ends of the link, to avoid data transmission failures caused by different device models or different driver versions.
[0063] In actual applications, staff can also adjust the non-transparent bridge channels enabled by the non-transparent bridge device as needed, and after restarting the device, re-determine the number of non-transparent bridge channels enabled in the non-transparent bridge device based on the data channel configuration parameters to apply for system resources of corresponding size, thereby realizing dynamic application of channel resources of the non-transparent bridge device and saving device system resources.
[0064] In an embodiment of the present invention, S203 determines the channel status of the non-transparent bridge channel according to the channel status parameters, and sends the corresponding channel status information to the data transmission module of the device, which may include: if the channel status parameters are identified to have an error parameter, determining the error type of the corresponding error channel according to the error parameter; generating corresponding channel status information according to the error type of the error channel and sending it to the data transmission module.
[0065] In a specific implementation, the channel management module may access the register of the non-transparent bridge device to periodically poll the status of each non-transparent bridge channel, including normal operation status and error status.
[0066] The non-transparent bridge monitoring method provided by an embodiment of the present invention may also include: if the error type of the error channel corresponds to a repairable error type in the transmission protocol of the non-transparent bridge device, performing channel repair processing on the error channel; if the error type of the error channel corresponds to an unrepairable error type in the transmission protocol of the non-transparent bridge device, disabling the error channel.
[0067] In addition to generating channel status information for the non-transparent bridge channel and sending it to the data transmission module of the business layer, the channel management module can also send the channel status information of the error channel to the error handling module, which performs error handling according to the error type of the error channel.
[0068] The error type of the error channel is determined based on the status value of the PCIe data channel specified in the PCIe protocol, such as a dropped link on the other end, an uncorrectable error (UCE) or a correctable error (CE). Different error types are handled differently. Error channel errors can be categorized as either repairable or unrepairable. For repairable errors, the error handling module can perform channel repair on the error channel. For unrepairable errors, the channel management module or the error handling module can disable the error channel. This disablement is synchronized to the data transmission module at the service layer to prevent data transmission using the error channel.
[0069] In an embodiment of the present invention, executing channel repair processing for an error channel may include: re-executing link initialization for the error channel, and obtaining channel status parameters of the error channel after the execution is completed; if the channel status parameters of the error channel are normal values, setting the error channel to channel status information of a normal channel and sending it to the data transmission module; if the channel status parameters of the error channel are still not normal values after the link initialization times of the error channel accumulate to a first preset number of times, setting the error type of the error channel to channel status information of an unrepairable error type and sending it to the data transmission module.
[0070] That is to say, the cumulative number of error repairs can be set (the first preset number can be 3 times). If the cumulative repair reaches the first preset number, even if the error type of the error channel corresponding to the PCIe protocol is a repairable error, the information that the error type of the error channel is an unrepairable error will be synchronized to the data transmission module.
[0071] The non-transparent bridge monitoring method provided by an embodiment of the present invention may also include: obtaining the verification result of the data transmission process of the non-transparent bridge channel; if it is determined according to the verification result that a data transmission error occurs in the non-transparent bridge channel, then generating corresponding channel status information for the data transmission error and sending it to the data transmission module, so that the data transmission module performs a data retransmission operation.
[0072] In other words, the error handling module can also handle data transmission errors. While accessing the non-transparent bridge's registers to identify errors in the non-transparent bridge channel, it can also determine whether a data transmission error has occurred in the non-transparent bridge channel based on the verification results of the data transmitted by the non-transparent bridge channel. The channel status information corresponding to the data transmission error is then sent to the data transmission module, which then performs a data retransmission operation.
[0073] The non-transparent bridge monitoring method provided by an embodiment of the present invention may further include: for an error channel where a data transmission error occurs, if the number of consecutive data transmission errors on the error channel reaches a second preset number, the error type of the error channel is set to an unrepairable error type and channel status information is sent to the data transmission module.
[0074] When a data transmission error occurs on a non-transparent bridge channel, it may be an isolated error rather than a malfunction of the non-transparent bridge channel itself. In this case, the non-transparent bridge channel can be temporarily considered an error channel, but the error type is correctable, and a cumulative count is set. When the number of consecutive data transmission errors on the error channel reaches a second preset number, the error type of the error channel is set to uncorrectable, and corresponding channel status information is generated and sent to the channel transmission module, so that the channel transmission module no longer selects the error channel for data transmission.
[0075] In practical applications, the importance of the data being transmitted may vary. Based on the status of the non-transparent bridge channel (normal, correctable error type, or uncorrectable error type (disabled)), the data transmission module at the business layer can select the corresponding non-transparent bridge channel based on the importance of the data being transmitted. For more important data, a non-transparent bridge channel in normal state is preferred. If the number of normal non-transparent bridge channels is insufficient, a non-transparent bridge channel in correctable error type state can also be selected for data transmission.
[0076] In addition to repairing the error channel of the correctable error type by re-initializing the link, the channel management module can also not process the error channel, but instead set the error channel to a temporarily unavailable state and generate corresponding channel status information to synchronize to the data transmission module, and check the channel status of the error channel again after the timing reaches the preset time, so as to restore the operation of the non-transparent bridge channel in time.
[0077] The non-transparent bridge monitoring method provided in this embodiment of the present invention may further include triggering a device front-end alarm to notify an administrator if the number of available channels in the non-transparent bridge is less than a third preset number. Specifically, when the number of available non-transparent bridge channels falls below the third preset number, an alarm is sent to the device front-end, allowing the administrator to decide whether to restart the service or the device.
[0078] In an embodiment of the present invention, S203 determines the channel status of the non-transparent bridge channel according to the channel status parameters, and sends the corresponding channel status information to the data transmission module of the device. It can also include: determining the busyness of the data channel according to the channel status parameters, generating channel status information based on the busyness of the non-transparent bridge channel, and sending it to the data transmission module.
[0079] That is, in addition to monitoring errors on each non-transparent bridge channel, the channel management module can also monitor the busyness of the non-transparent bridge channel so that the data transmission module can select the target non-transparent bridge channel for data transmission based on the busyness of the non-transparent bridge channel.
[0080] It can be understood that the data transmission module can give priority to selecting a non-transparent bridge channel that is in normal working condition and idle state as the target non-transparent bridge channel for transmitting data. If there is no non-transparent bridge channel in idle state, a non-transparent bridge channel with fewer data transmission tasks will be selected, thereby further optimizing the data transmission efficiency of the non-transparent bridge device.
[0081] The non-transparent bridge monitoring method provided by the embodiment of the present invention may further include: monitoring the data transmission frequency parameters of the non-transparent bridge device; and adjusting the power supply parameters corresponding to the non-transparent bridge device according to the data transmission frequency parameters of the non-transparent bridge device.
[0082] like Figure 3 As shown, in order to implement the non-transparent bridge monitoring method provided by the embodiment of the present invention, a power management module may also be deployed to manage the power consumption of the non-transparent bridge device.
[0083] In the related art, regardless of the data transmission requirements, the full power consumption of the non-transparent bridge device is used for data transmission by default, which will cause resource waste in some applications.
[0084] In an embodiment of the present invention, power states are defined according to the PCIe standard, namely, D0 to D3, which facilitates compatibility with system power management services. D0 represents full power consumption and optimal performance; D1-D2 states offer partial power savings and low wake-up latency; and D3 offers deep power savings, with higher wake-up latency (in the millisecond range) and the need for hardware reinitialization. The required power state is calculated based on the data transmission frequency parameters of the non-transparent bridge device (such as data transmission frequency and average data transmission rate requirements), enabling on-demand power capability configuration for the non-transparent bridge device through the power management module.
[0085] Furthermore, embodiments of the present invention can also implement channel-level power consumption management for non-transparent bridge channels. Monitoring the data transmission frequency parameters of the non-transparent bridge device can include: monitoring the data transmission frequency parameters of the non-transparent bridge channel; and adjusting the power parameters corresponding to the non-transparent bridge channel based on the data transmission frequency parameters of the non-transparent bridge channel.
[0086] In a specific implementation, a time threshold can be set. For a non-transparent bridge channel that has not received a data transmission task within a first preset time, its power state is set to D1; for a non-transparent bridge channel that has not received a data transmission task within a second preset time, its power state is set to D2; and for a non-transparent bridge channel that has not received a data transmission task within a third preset time, its power state is set to D3. The first preset time is less than the second preset time, and the second preset time is less than the third preset time. The first preset time, the second preset time, and the third preset time can be determined based on actual scenario testing.
[0087] The data transmission module of the business layer may give priority to using a non-transparent bridge channel with a power state of D0. If there is no non-transparent bridge channel with a power state of D0, a non-transparent bridge channel with a power state of D1 / D2 / D3 may be selected.
[0088] When the power management module detects that the non-transparent bridge channel does not meet the above conditions (data transmission task arrives) within the fourth preset time, it increases the power state of the non-transparent bridge channel and may directly set it to D0 state.
[0089] In the embodiment of the present invention, the data transmission module may select a target non-transparent bridge channel for transmitting data according to the busyness, error condition, and power status of the non-transparent bridge channel.
[0090] Figure 5 This is a flow chart of another non-transparent bridge monitoring method provided by an embodiment of the present invention.
[0091] like Figure 5 As shown, a multi-non-transparent bridge channel redundancy architecture is implemented based on the resource management module, channel management module, NTB module, error handling module, and power management module described in the above embodiments of the present invention. The resource management module and NTB module dynamically apply for system resources for non-transparent bridge devices. The channel management module cooperates with the NTB module to manage the non-transparent bridge channels of the non-transparent bridge devices. A polling thread monitors the status of the non-transparent bridge channels. For idle non-transparent bridge channels, the power management module adjusts the power status of the non-transparent bridge channels to implement power management for the non-transparent bridge devices. The error management module processes the error channel according to the error type provided by the channel management module. Error repair is performed for repairable error types, and link disabling is performed for unrepairable error types. Repairable error types with a repair count exceeding a threshold are set to unrepairable. If the number of available links is less than the corresponding threshold, a front-end alarm is issued.
[0092] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0093] An embodiment of the present invention also provides a non-transparent bridge monitoring device, which may include: a first acquisition unit, used to obtain data channel configuration parameters of a non-transparent bridge device installed in the device after the device is started, and the non-transparent bridge device is configured as multiple non-transparent bridge channels; a second acquisition unit, used to access the register of the non-transparent bridge device based on the data channel configuration parameters to obtain channel status parameters of the non-transparent bridge channel of the non-transparent bridge device; a control unit, used to determine the channel status of the non-transparent bridge channel according to the channel status parameters, and send the corresponding channel status information to the data transmission module of the device, so that the data transmission module selects a target non-transparent bridge channel for transmitting data from the non-transparent bridge device.
[0094] In an embodiment of the present invention, the control unit determines the channel status of the non-transparent bridge channel based on the channel status parameters, and sends the corresponding channel status information to the data transmission module of the device, which may include: if the channel management module identifies that there is an error parameter in the channel status parameter, then determines the error type of the corresponding error channel based on the error parameter; generates corresponding channel status information based on the error type of the error channel and sends it to the data transmission module.
[0095] The non-transparent bridge monitoring device provided by an embodiment of the present invention may also include: an error processing module, which is used to perform channel repair processing on the error channel if the error type of the error channel corresponds to a repairable error type in the transmission protocol of the non-transparent bridge device; if the error type of the error channel corresponds to an unrepairable error type in the transmission protocol of the non-transparent bridge device, then disable the error channel.
[0096] In an embodiment of the present invention, the error handling module performs channel repair processing on the error channel, which may include: re-executing the link initialization of the error channel, and obtaining the channel status parameters of the error channel after the execution is completed; if the channel status parameters of the error channel are normal values, the channel status information of the error channel is set to a normal channel and sent to the data transmission module; if the channel status parameters of the error channel are still not normal values after the link initialization times of the error channel accumulate to a first preset number of times, the error type of the error channel is set to the channel status information of an unrepairable error type and sent to the data transmission module.
[0097] In an embodiment of the present invention, the error handling module can also be used to obtain the verification results of the data transmission process of the non-transparent bridge channel; if it is determined according to the verification results that a data transmission error occurs in the non-transparent bridge channel, the corresponding channel status information is generated for the data transmission error and sent to the data transmission module, so that the data transmission module performs a data retransmission operation.
[0098] In an embodiment of the present invention, the error handling module can also be used to send channel status information of the error type of the error channel to an unrecoverable error type to the data transmission module if the number of consecutive data transmission errors on the error channel reaches a second preset number.
[0099] In the embodiment of the present invention, the error handling module may also be configured to trigger a front-end alarm of the device to notify an administrator if the number of available channels in the non-transparent bridge channel is less than a third preset number.
[0100] In an embodiment of the present invention, the control module determines the channel status of the non-transparent bridge channel based on the channel status parameters, and sends the corresponding channel status information to the data transmission module of the device. It can also include: the channel management module determines the busyness of the data channel based on the channel status parameters, generates channel status information based on the busyness of the non-transparent bridge channel, and sends it to the data transmission module.
[0101] The non-transparent bridge monitoring device provided by an embodiment of the present invention may also include: a resource management module, which is used to determine the number of non-transparent bridge channels enabled in the non-transparent bridge device according to the data channel configuration parameters after the device is started and apply for system resources of corresponding size; an NTB module, which is used to perform device initialization and link initialization of the non-transparent bridge device.
[0102] In an embodiment of the present invention, link initialization includes transmission rate negotiation initialization; the NTB module performs transmission rate negotiation initialization of the non-transparent bridge device, which may include: obtaining a target value of a data transmission parameter of a physical link to which the non-transparent bridge device in the device is connected; obtaining an actual value of a data transmission parameter of a non-transparent bridge channel; if the actual value is greater than or equal to the target value, completing the transmission rate negotiation of the non-transparent bridge channel; if the actual value is less than the target value, reinitializing the non-transparent bridge channel, and when the actual value is less than the target value after a fourth preset number of retries, setting the target value of the data transmission parameter of the non-transparent bridge channel to the actual value, and then executing the data transmission task of the non-transparent bridge channel based on the target value.
[0103] The non-transparent bridge monitoring device provided by the embodiment of the present invention may further include: a power management module for monitoring the data transmission frequency parameters of the non-transparent bridge device; and adjusting the power parameters corresponding to the non-transparent bridge device according to the data transmission frequency parameters of the non-transparent bridge device.
[0104] In an embodiment of the present invention, the power management module monitors the data transmission frequency parameters of the non-transparent bridge device, which may include: monitoring the data transmission frequency parameters of the non-transparent bridge channel; and adjusting the power parameters corresponding to the non-transparent bridge channel according to the data transmission frequency parameters of the non-transparent bridge channel.
[0105] The description of the features in the embodiment corresponding to the non-transparent bridge monitoring device can be found in the relevant description of the embodiment corresponding to the non-transparent bridge monitoring method, and will not be repeated here.
[0106] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned non-transparent bridge monitoring method embodiments.
[0107] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned non-transparent bridge monitoring method embodiments when running.
[0108] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0109] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned non-transparent bridge monitoring method embodiments are implemented.
[0110] An embodiment of the present invention also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of any of the above-mentioned non-transparent bridge monitoring method embodiments.
[0111] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0112] The above describes in detail the non-transparent bridge monitoring method, apparatus, device, and computer-readable storage medium provided by the present invention. This document uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above examples is intended only to facilitate understanding of the method and core concepts of the present invention. It should be noted that those skilled in the art may make various improvements and modifications to the present invention without departing from the principles of the present invention, and such improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A non-transparent bridge monitoring method, characterized in that: include: After the device is started, obtaining data channel configuration parameters of a non-transparent bridge device installed in the device, wherein the non-transparent bridge device is configured as a plurality of non-transparent bridge channels; Accessing a register of the non-transparent bridge device to obtain a channel state parameter of the non-transparent bridge channel of the non-transparent bridge device based on the data channel configuration parameter; The channel state of the non-transparent bridge channel is determined according to the channel state parameter, and the corresponding channel state information is sent to the data transmission module of the device, so that the data transmission module selects a target non-transparent bridge channel for transmitting data from the non-transparent bridge device.
2. The non-transparent bridge monitoring method according to claim 1, characterized in that: Determining the channel state of the non-transparent bridge channel according to the channel state parameter, and sending corresponding channel state information to the data transmission module of the device, including: If it is identified that the channel status parameter has an error parameter, determining the error type of the corresponding error channel according to the error parameter; The corresponding channel status information is generated according to the error type of the error channel and sent to the data transmission module.
3. The non-transparent bridge monitoring method according to claim 2, characterized in that: Also includes: If the error type of the error channel corresponds to a repairable error type in the transmission protocol of the non-transparent bridge device, performing a channel repair process on the error channel; If the error type of the error channel corresponds to an unrecoverable error type in the transmission protocol of the non-transparent bridge device, the error channel is disabled.
4. The non-transparent bridge monitoring method according to claim 3, characterized in that: Performing channel repair processing on the error channel includes: Re-initializing the link of the error channel, and obtaining the channel status parameter of the error channel after the execution is completed; If the channel status parameter of the error channel is a normal value, setting the error channel to the channel status information of a normal channel is sent to the data transmission module; If the channel status parameter of the erroneous channel is still not a normal value after the link initialization times of the erroneous channel accumulate to a first preset number, the channel status information of setting the error type of the erroneous channel to an unrecoverable error type is sent to the data transmission module.
5. The non-transparent bridge monitoring method according to claim 1, characterized in that: Also includes: Obtaining a verification result of a data transmission process of the non-transparent bridge channel; If it is determined according to the verification result that a data transmission error occurs in the non-transparent bridge channel, the data transmission error is generated into the corresponding channel status information and sent to the data transmission module, so that the data transmission module performs a data retransmission operation.
6. The non-transparent bridge monitoring method according to claim 5, characterized in that: Also includes: For an error channel where a data transmission error occurs, if the number of consecutive data transmission errors on the error channel reaches a second preset number, the channel status information of setting the error type of the error channel to an unrecoverable error type is sent to the data transmission module.
7. The non-transparent bridge monitoring method according to claim 1, characterized in that: Also includes: If the number of available channels in the non-transparent bridge channel is less than a third preset number, a front-end alarm of the device is triggered to notify an administrator.
8. The non-transparent bridge monitoring method according to claim 1, characterized in that: Determining the channel state of the non-transparent bridge channel according to the channel state parameter, and sending corresponding channel state information to the data transmission module of the device, including: The busyness of the data channel is determined according to the channel state parameter, and the channel state information is generated based on the busyness of the non-transparent bridge channel and sent to the data transmission module.
9. The non-transparent bridge monitoring method according to claim 1, characterized in that: The initialization steps of the non-transparent bridge device include: After the device is started, the number of the non-transparent bridge channels enabled in the non-transparent bridge device is determined according to the data channel configuration parameters, corresponding system resources are applied for, and device initialization and link initialization of the non-transparent bridge device are performed.
10. The non-transparent bridge monitoring method according to claim 9, characterized in that: The link initialization includes transmission rate negotiation initialization; Executing transmission rate negotiation initialization of the non-transparent bridge device, including: Obtaining a target value of a data transmission parameter of a physical link to which the non-transparent bridge device in the device is connected; Obtaining actual values of data transmission parameters of the non-transparent bridge channel; If the actual value is greater than or equal to the target value, completing the transmission rate negotiation of the non-transparent bridge channel; If the actual value is less than the target value, the non-transparent bridge channel is reinitialized, and when the actual value is less than the target value after the fourth preset number of retries, the target value of the data transmission parameter of the non-transparent bridge channel is set to the actual value, and the data transmission task of the non-transparent bridge channel is performed based on the target value.
11. The non-transparent bridge monitoring method according to claim 1, characterized in that: Also includes: Monitoring a data transmission frequency parameter of the non-transparent bridge device; The power supply parameters corresponding to the non-transparent bridge device are adjusted according to the data transmission frequency parameters of the non-transparent bridge device.
12. The non-transparent bridge monitoring method according to claim 11, characterized in that: Monitoring the data transmission frequency parameters of the non-transparent bridge device includes: Monitoring a data transmission frequency parameter of the non-transparent bridge channel; The power supply parameter corresponding to the non-transparent bridge channel is adjusted according to the data transmission frequency parameter of the non-transparent bridge channel.
13. A non-transparent bridge monitoring device, characterized in that: include: A first acquiring unit is configured to acquire, after the device is started, data channel configuration parameters of a non-transparent bridge device installed in the device, wherein the non-transparent bridge device is configured as a plurality of non-transparent bridge channels; a second acquiring unit, configured to access a register of the non-transparent bridge device to acquire a channel state parameter of the non-transparent bridge channel of the non-transparent bridge device based on the data channel configuration parameter; A control unit is configured to determine the channel state of the non-transparent bridge channel according to the channel state parameter, and send the corresponding channel state information to the data transmission module of the device, so that the data transmission module selects a target non-transparent bridge channel for transmitting data from the non-transparent bridge device.
14. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the non-transparent bridge monitoring method according to any one of claims 1 to 12 when executing the computer program.
15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the non-transparent bridge monitoring method according to any one of claims 1 to 12 are implemented.
Citation Information
Cited By
Data protection system for PCIe switch, PCIe switch and communication method of PCIe switch
CN121283979A