Detailed Description
Embodiments of the present invention provide a hot plug control method and apparatus based on PCIe, and a storage medium, which can set a hot plug management module as a signal intermediary before a destination node and a target device, so as to facilitate unified management of signals and improve the debuggability of the whole system.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the above-described drawings (if any) are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
As shown in fig. 1, a PCIe system includes three major types of devices, namely, a Root Complex (RC), a Switch (SW), and an End Point (EP), where the RC is a PCIe root controller, can be understood as a processor, and is generally formed by a CPU; the EP is a termination point, such as a general PCIe interface network card device, a serial card device, and a memory card device, and during operation, the EP101 is connected to the RC102 and receives a working instruction of the RC.
As shown in fig. 2a, when a plurality of EPs 201 need to be connected to one RC202 at the same time, a plurality of EPs 201 are connected to SW203 respectively, and then the SW203 is connected to the RC202, and the SW203 realizes that one RC202 controls a plurality of EPs 201 at the same time by one input and multiple output.
PCIe system provides local hot plug function, EP201 can realize hot plug with RC202 or SW203 directly; the hot plug flow of EP201 directly connected to RC202 and EP201 connected to RC202 via SW203 are different, which is reflected by different hardware links. Different hardware link topologies need different management modes, and the different management modes need to be discussed respectively in the process of debugging the system, so that the workload of problem analysis is increased, and the whole debugging performance of the system is influenced.
As shown in fig. 2b, to solve the above problem, embodiments of the present application provide a PCIe-based hot plug control method, apparatus, and storage medium, where a hot plug management module 204 performs signal transmission and signal management between a terminal 201 and a root complex 202, and between the terminal 201 and a switch 203, and in a device debugging phase, a system is not yet turned on, and the hot plug management module 204 transmits an analog signal between the root complex 202 and the terminal 201, or between the switch 203 and the terminal 201, so as to implement a hot plug power-on process of the terminal 201; when the device is operating normally, the hot plug management module 204 performs unified management on the signals transmitted between the end node 201 and the root complex 202, and between the end node 201 and the switch 203, thereby improving the whole debuggability of the system.
It should be noted that the root complex may be a processor, and the termination point may be an interface network card device, a serial card device, or a memory card device. The invention is not limited with respect to the specific device types of the root complex and the termination point.
For convenience of understanding, a specific flow in the present application case is described below, and referring to fig. 3, an embodiment of the PCIe-based hot plug control method in the present application embodiment includes.
301. The hot plug management module detects whether the target module can respond to the hot plug signal.
In this embodiment, the target module may be only the root complex or the switch, or may be the root complex and the switch, and the hot plug management module detects whether the target module is capable of responding to the hot plug signal to select the next working process.
302. If so, the hot plug management module acts as a signal intermediary between the target module and the termination point to implement the hot plug power-on process.
In this embodiment, if the target module can normally respond to the hot plug signal, which indicates that the system is operating normally, at this time, the hot plug management module serves as a signal intermediary and transmits signals between the target module and the destination node, and at this time, the hot plug management module serves as a signal intermediary and can uniformly manage the signals, thereby improving the adjustability of the device, regardless of whether the destination node is directly connected to the root complex or the switch.
303. If not, the hot plug management module sends an analog signal to the terminal.
In this embodiment, if the target module cannot normally respond to the hot plug signal, it indicates that the system has not entered a normal working state, and at this time, the system cannot implement the hot plug process, and therefore, the hot plug management module sends out the analog signal for simulating the working signal sent by the target module, thereby implementing the hot plug power-on process under the condition that the system has not started to normally work, and even under the condition that the system cannot normally work, the system can also be debugged.
In this embodiment, the hot plug management module serves as an intermediary for signal transmission between the target module and the destination node, and under the condition that the system normally works, the hot plug management module performs unified management on signals transmitted between the target module and the destination node, so that system debugging is facilitated. The debuggability of the system is improved.
In the foregoing, the basic control method of the PCIe-based hot plug control method in this embodiment is introduced, and in an actual process, two cases of whether the target module can normally respond to the hot plug signal are respectively described below according to a specific signal transmission type.
Firstly, the target module normally responds to a hot plug signal.
When the target module (root complex and switch) normally responds to the hot plug signal, the system normally works, and at the moment, the hot plug management module serves as an intermediary for signal transmission and plays a role in signal management. For the sake of understanding, a specific flow of this case is described below, and referring to fig. 4, an embodiment of the PCIe-based hot plug control method in this embodiment of the present application includes.
401. The hot plug management module acquires the in-place signal sent by the termination point.
In this embodiment, when the endpoint is plugged, an in-place signal is sent to prompt that the system endpoint device is plugged, and a hot plug power-on process is requested to be started, where the hot plug management module acquires the in-place signal to perform the function of signal intermediary signal transmission.
402. And the hot plug management module sends the in-place signal to the target module.
In this embodiment, the target module connected to the inserted termination point may be a root complex or a switch, and the hot-plug management module sends the in-place signal to the target module to implement the function of signal mediation.
403. The hot plug management module acquires a reset signal sent by the target module.
In this embodiment, when the target module receives the in-place signal sent by the endpoint, a reset signal is sent to the endpoint, so that signal interaction is realized between the endpoint and the target module once, and a hot plug power-on process is started to realize hot plug; the hot plug management module is used as a signal intermediary to transmit the reset signal, and the signal can be processed in the same mode no matter the target module is a root complex or a switch, so that the difference of management modes caused by different hardware link topologies is avoided, and the hot plug management module is used as a signal intermediary to manage, so that the workload of problem analysis in the system debugging process is reduced.
404. And the hot plug management module sends a reset signal to the terminal.
In this embodiment, the termination receives the reset signal, which is a trigger signal of the hot-plug power-on process.
In this embodiment, under the condition that the system normally works, a plurality of endpoints are simultaneously connected to the computer, some of the endpoints are directly connected to the root complex, some of the endpoints are connected to the root complex through the switch, and for different hardware link topologies, the same hot-plug management module is used as a signal intermediary to perform signal transmission, and under the condition that the endpoints are directly connected to the root complex, the hot-plug management module is used as a signal intermediary between the endpoints and the root complex; under the condition that the terminating point is connected with the exchanger, the hot plug management module acts as a signal intermediary between the terminating point and the root complex, and because signal transmission is carried out through the hot plug management module, the difficulty of system management is reduced, and the debuggability of the system is improved.
It should be noted that, the above working process is directed to the case that the system normally works, and when the terminal node is inserted into the computer device, the normally working system sends a live signal at the terminal point to start hot plug; however, when the system is in an abnormal operating state, such as a Basic Input Output System (BIOS), the system cannot react to an in-place signal sent by the termination point, and thus, in this case, a hot plug power-on process cannot be implemented, and system debugging cannot be performed.
Secondly, the target module can not normally respond to the hot plug signal.
Therefore, the embodiment of the application provides a solution, when the system cannot work normally, the hot plug management module sends out the analog signal to realize the hot plug power-on process. For the sake of understanding, a specific flow of this case is described below, and referring to fig. 5, an embodiment of the PCIe-based hot plug control method in this embodiment of the present application includes.
501. The hot plug management module acquires the in-place signal sent by the termination point.
In this embodiment, this step is the same as step 401, and is not described here again.
502. And the hot plug management module sends the in-place signal to the target module.
In this embodiment, this step is the same as step 402, and is not described here again.
503. The hot plug management module acquires a reset signal sent by the target module.
In this embodiment, since the system is in an abnormal operating state, it is unable to respond to the in-place signal, so that the hot plug management module cannot acquire the reset signal.
504. The hot plug management module generates a reset signal.
505. And the hot plug management module sends the reset signal to the terminal point so as to realize the hot plug power-on process.
In this embodiment, the hot plug management module serves as a signal intermediary, and after sending the in-place signal, the system does not receive a reset signal, and can determine that the system is in an abnormal working state, and at this time, the hot plug management module generates a reset signal by itself to simulate the reset signal generated by the target module in the normal working state of the system, so that a hot plug power-on process is started in the abnormal working state of the system.
In this embodiment, in the state where the system is not operating normally, the target module cannot respond to the in-place signal, and for this case, the hot plug management module serves as a signal intermediary, simulates a reset signal and sends the reset signal to the termination point, thereby starting a hot plug power-on program.
It should be noted that, although the above workflow may successfully solve the problem of hot plug power-on and manage hot plug, since a signal is transmitted between the endpoint and the target module via the hot plug management module, and a user cannot know a working condition in real time, for this reason, an embodiment of the present application provides a situation that a serial module and an indication module are connected to the hot plug management module, where the serial module is used to derive working data, and the indication module is used to indicate a real-time working condition of the hot plug management module, so that the user knows the working condition of the hot plug management module.
601. And the hot plug management module sends a first real-time working state to the serial port module.
In this embodiment, the first real-time operating status is used to indicate a real-time operating status of the hot plug management module, so that a user can know the operating status of the hot plug management module conveniently, and debugging is facilitated.
602. And the serial port module is used for exporting the working condition of the hot plug management module.
In this embodiment, the serial port module derives the working condition of the hot plug management module for the external device to generate a date.
603. And the hot plug management module sends the second real-time working state to the indication module.
In this embodiment, the second real-time operating status is used to indicate a real-time operating status of the hot plug management module, and the indicating module is used to derive the operating status of the hot plug management module, and the indicating module is capable of displaying the real-time operating status of the hot plug management module for a user to observe.
604. And the indicating module displays the second real-time working state in real time.
In this embodiment, an indicator light or a display screen may be disposed on the indication module, where the display screen may be a liquid crystal display screen, an LED display screen, an LCD display screen, an OLED display screen, or the like, and the display screen is not limited in this embodiment of the present application.
It should be noted that, the step 602 and the step 604 may be performed simultaneously or sequentially.
In this embodiment, through the instruction module, the user can know the behavior of hot plug management module in real time, and through serial port module, the historical behavior of hot plug management module can be inquired to the user to make the user can handle the control to the behavior of hot plug management module, according to the data that instruction module and serial port module derived, reduced the work load of debugging system in-process analysis problem, promoted the holistic debuggability of system.
The scheme provided by the embodiment of the present application is introduced mainly from the perspective of signal interaction between the hot plug management module and the target module. It is understood that the hot plug management module includes hardware structures and/or software modules for performing the functions in order to implement the functions. Those of skill in the art will readily appreciate that the various illustrative modules and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
Described in terms of hardware structures, the PCIe-based hot plug control method may be implemented by one entity device, may also be implemented by multiple entity devices together, and may also be a logic function module in one entity device, which is not specifically limited in this embodiment of the present application.
For example, the PCIe-based hot plug control method described above may be implemented by the electronic device in fig. 7. Fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application. The electronic device comprises at least one processor 701, a communication line 702, a memory 703 and at least one communication interface 704.
The processor 701 may be a general processing unit (CPU), a microprocessor, an application-specific integrated circuit (server IC), or one or more ICs for controlling the execution of programs in accordance with the present invention.
The communication link 702 may include a path for communicating information between the aforementioned components.
Communication interface 704, using any transceiver or the like, may be used to communicate with other devices or communication networks, such as an ethernet, a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), etc.
The memory 703 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disk read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory may be separate and coupled to the processor via a communication line 702. The memory may also be integral to the processor.
The memory 703 is used for storing computer-executable instructions for executing the present invention, and is controlled by the processor 701 to execute. The processor 701 is configured to execute computer-executable instructions stored in the memory 703, so as to implement the method for log query provided by the above-mentioned embodiment of the present application.
Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application program codes, which are not specifically limited in the embodiments of the present application.
In particular implementations, processor 701 may include one or more CPUs such as CPU0 and CPU1 of fig. 7 for one embodiment.
In particular implementations, an electronic device may include multiple processors, such as processor 701 and processor 707 in fig. 7, for example, as an embodiment. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In particular implementations, the electronic device may also include an output device 705 and an input device 706, as one embodiment. An output device 705 is in communication with the processor 701 and may display information in a variety of ways. For example, the output device 705 may be a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display device, a Cathode Ray Tube (CRT) display device, a projector (projector), or the like. The input device 706 is in communication with the processor 701 and may receive user input in a variety of ways. For example, the input device 706 may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
The electronic device may be a general-purpose device or a special-purpose device. In a specific implementation, the electronic device may be a desktop computer, a laptop computer, a network server, a Personal Digital Assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, an embedded device, or a device with a similar structure as in fig. 7. The embodiment of the application does not limit the type of the electronic equipment.
In the embodiment of the present application, the USB interface emulation detecting device may be divided into the functional units according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
For example, in the case of dividing each functional unit in an integrated manner, fig. 8 shows a schematic diagram of a hot plug management module.
As shown in fig. 8, a hot plug management module provided in an embodiment of the present application includes:
the detection unit 801: the device is used for detecting whether the target module can respond to a hot plug signal;
a transferring unit 802, configured to act as a signal intermediary between the target module and the termination point to implement a hot plug power-on process when the detecting unit 801 detects that the target module responds to the hot plug signal;
the simulation unit 803 is configured to send a simulation signal to the endpoint when the detection unit 801 fails to detect that the target module responds to the hot plug signal, where the simulation signal is used to simulate a working signal sent by the target module, so as to implement a hot plug power-on process.
Alternatively,
a detection unit 801 for: acquiring a reset signal sent by a target module, wherein the reset signal is used for starting a hot plug power-on process between the target module and a terminal point;
correspondingly, a transferring unit 802 for: when the detection unit 801 acquires a reset signal, the reset signal is sent to the termination point to realize a hot plug power-on process;
correspondingly, the simulation unit 803 is configured to: when the detection unit 801 does not acquire the reset signal, the reset signal is generated and sent to the termination point, so as to implement a hot plug power-on process.
Optionally, the apparatus further includes an obtaining unit 804, configured to obtain a bit signal sent by the endpoint, where the bit signal is used to indicate a plugging status of the endpoint.
Optionally, the apparatus further includes a first sending unit 805, configured to send a first real-time working status to the serial port module, where the first real-time working status is used for the serial port module to send to an external device;
a second sending unit 806 is further included, configured to send a second real-time working status to the indication module, where the second real-time working status is used for the indication module to display in real time.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the invention are generated in whole or in part when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: ROM, RAM, magnetic or optical disks, and the like.
The PCIe-based hot plug control method, apparatus, and storage medium provided in the embodiments of the present invention are described in detail above, and a specific example is applied in the present disclosure to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.