CN111817904A - Bandwidth recovery method, device and medium based on PCIE Switch - Google Patents
Bandwidth recovery method, device and medium based on PCIE Switch Download PDFInfo
- Publication number
- CN111817904A CN111817904A CN202010922938.4A CN202010922938A CN111817904A CN 111817904 A CN111817904 A CN 111817904A CN 202010922938 A CN202010922938 A CN 202010922938A CN 111817904 A CN111817904 A CN 111817904A
- Authority
- CN
- China
- Prior art keywords
- downlink port
- link bandwidth
- cable
- connection
- bandwidth
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0896—Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/70—Admission control; Resource allocation
- H04L47/76—Admission control; Resource allocation using dynamic resource allocation, e.g. in-call renegotiation requested by the user or requested by the network in response to changing network conditions
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明实施例公开了一种基于PCIE Switch的带宽恢复方法、装置和介质,获取下行口的线缆连接状态以及链路带宽;当检测到下行口的线缆连接状态以及链路带宽满足恢复条件时,可以调整连接控制寄存器中的连接标志位至第一状态,以触发系统将下行口连接的线缆移除。通过软件模拟的方式达到线缆移除的效果。在触发系统将下行口连接的线缆移除之后,可以再次将连接控制寄存器中的连接标志位调整为第二状态,以触发系统将下行口连接的线缆重新加入,此时系统可以识别到下行口连接的所有线缆,从而使得下行口的链路带宽与下行口实际连接的线缆个数相匹配,解决了多根线缆连接时无法组成指定链路带宽的问题。
The embodiment of the present invention discloses a bandwidth recovery method, device and medium based on PCIE Switch, which acquires the cable connection state and link bandwidth of the downlink port; when it is detected that the cable connection status and link bandwidth of the downlink port meet the recovery conditions When , the connection flag bit in the connection control register can be adjusted to the first state to trigger the system to remove the cable connected to the downlink port. The effect of cable removal is achieved through software simulation. After the triggering system removes the cable connected to the downlink port, the connection flag bit in the connection control register can be adjusted to the second state again to trigger the system to re-add the cable connected to the downlink port. At this time, the system can recognize the All cables connected to the downlink port, so that the link bandwidth of the downlink port matches the number of cables actually connected to the downlink port, which solves the problem that the specified link bandwidth cannot be formed when multiple cables are connected.
Description
技术领域technical field
本发明涉及存储系统技术领域,特别是涉及一种基于PCIE Switch的带宽恢复方法、装置和计算机可读存储介质。The present invention relates to the technical field of storage systems, and in particular, to a PCIE Switch-based bandwidth recovery method, device, and computer-readable storage medium.
背景技术Background technique
近年来,随着用户对融合、统一、效率、空间、能耗要求的不断提升,PCIE Switch使用上有很多新场景,其中一个场景为:PCIE Switch的一个带宽为x16下行口,需通过四根miniSAS线缆连接构成x16带宽链路,线缆支持热插拔。In recent years, with the continuous improvement of users' requirements for integration, unification, efficiency, space, and energy consumption, there are many new scenarios for the use of PCIE Switch. The miniSAS cable connection constitutes a x16 bandwidth link, and the cable supports hot plugging.
在使用过程中,线缆一根一根顺序插入。在插入第一根线缆后PCIE链路会自动协商,协商之后的链路带宽为x4,后续再插入剩余三根线缆时,受限于PCIE的规范,PCIE链路不会自动协商,带宽始终保持为x4状态,无法达到设计的x16带宽。During use, the cables are inserted one by one in sequence. After the first cable is inserted, the PCIE link will automatically negotiate, and the link bandwidth after negotiation is x4. When the remaining three cables are inserted later, due to the specification of PCIE, the PCIE link will not automatically negotiate, and the bandwidth will always be Remains in the x4 state and cannot reach the designed x16 bandwidth.
可见,如何解决由多根线缆连接无法组成指定链路带宽的问题,是本领域技术人员需要解决的问题。It can be seen that how to solve the problem that a specified link bandwidth cannot be formed by connecting multiple cables is a problem to be solved by those skilled in the art.
发明内容SUMMARY OF THE INVENTION
本发明实施例的目的是提供一种基于PCIE Switch的带宽恢复方法、装置和计算机可读存储介质,可以解决由多根线缆连接无法组成指定链路带宽的问题。The purpose of the embodiments of the present invention is to provide a bandwidth recovery method, device and computer-readable storage medium based on PCIE Switch, which can solve the problem that a specified link bandwidth cannot be formed by connecting multiple cables.
为解决上述技术问题,本发明实施例提供一种基于PCIE Switch的带宽恢复方法,包括:In order to solve the above technical problem, an embodiment of the present invention provides a bandwidth recovery method based on PCIE Switch, including:
获取下行口的线缆连接状态以及链路带宽;Get the cable connection status and link bandwidth of the downlink port;
当检测到所述下行口的线缆连接状态以及链路带宽满足恢复条件时,调整连接控制寄存器中的连接标志位至第一状态,以触发系统将下行口连接的线缆移除;When it is detected that the cable connection state of the downlink port and the link bandwidth meet the recovery conditions, the connection flag bit in the connection control register is adjusted to the first state, so as to trigger the system to remove the cable connected to the downlink port;
将所述连接控制寄存器中的连接标志位调整为第二状态,以触发系统将下行口连接的所述线缆重新加入。The connection flag bit in the connection control register is adjusted to the second state to trigger the system to re-add the cable connected to the downlink port.
可选地,所述下行口线缆的连接状态以及链路带宽是否满足恢复条件的检测过程包括:Optionally, the process of detecting whether the connection state of the downlink cable and the link bandwidth meet the recovery condition includes:
判断所述下行口的四根线缆是否均处于连接状态;Determine whether the four cables of the downlink port are all connected;
当所述下行口的四根线缆均处于连接状态时,从所述连接控制寄存器中读取当前链路带宽;When the four cables of the downlink port are all connected, read the current link bandwidth from the connection control register;
判断所述当前链路带宽是否小于设定的链路带宽;Determine whether the current link bandwidth is less than the set link bandwidth;
当前链路带宽小于设定的链路带宽时,则执行所述调整连接控制寄存器中的连接标志位至第一状态,以触发系统将下行口连接的线缆移除的步骤。When the current link bandwidth is less than the set link bandwidth, the step of adjusting the connection flag bit in the connection control register to the first state is executed to trigger the system to remove the cable connected to the downlink port.
可选地,在所述判断所述下行口的四根线缆是否均处于连接状态之后还包括:Optionally, after the judging whether the four cables of the downlink port are all in a connected state, the method further includes:
当预设时间段内所述下行口未满足四根线缆均处于连接状态时,则展示线缆连接失败的提示信息。When the downlink port does not satisfy that all four cables are in the connected state within the preset time period, a prompt message indicating that the cable connection fails is displayed.
可选地,所述获取下行口线缆的连接状态以及链路带宽包括:Optionally, the acquiring the connection status and link bandwidth of the downlink cable includes:
按照设定的周期时间读取线缆在位信号以及连接控制寄存器中记录的当前链路带宽。Read the cable in-bit signal and the current link bandwidth recorded in the connection control register according to the set cycle time.
可选地,在所述将所述连接控制寄存器中的连接标志位调整为第二状态,以触发系统将下行口连接的所述线缆重新加入之后还包括:Optionally, after adjusting the connection flag bit in the connection control register to the second state to trigger the system to re-add the cable connected to the downlink port, the method further includes:
判断所述下行口的当前链路带宽是否达到设定的链路带宽;Determine whether the current link bandwidth of the downlink port reaches the set link bandwidth;
当所述下行口的当前链路带宽未达到设定的链路带宽时,则间隔预设时间段之后返回所述调整连接控制寄存器中的连接标志位至第一状态,以触发系统将下行口连接的线缆移除的步骤。When the current link bandwidth of the downlink port does not reach the set link bandwidth, return to the first state after a preset time interval to adjust the connection flag in the connection control register to trigger the system to switch the downlink port to the first state. Connected cable removal steps.
本发明实施例还提供了一种基于PCIE Switch的带宽恢复装置,包括获取单元、第一调整单元和第二调整单元;The embodiment of the present invention also provides a bandwidth recovery device based on PCIE Switch, including an acquisition unit, a first adjustment unit and a second adjustment unit;
所述获取单元,用于获取下行口的线缆连接状态以及链路带宽;the obtaining unit, configured to obtain the cable connection status and link bandwidth of the downlink port;
所述第一调整单元,用于当检测到所述下行口的线缆连接状态以及链路带宽满足恢复条件时,调整连接控制寄存器中的连接标志位至第一状态,以触发系统将下行口连接的线缆移除;The first adjustment unit is configured to adjust the connection flag bit in the connection control register to the first state when it is detected that the cable connection state of the downlink port and the link bandwidth satisfy the recovery condition, so as to trigger the system to switch the downlink port to the first state. The connected cable is removed;
所述第二调整单元,用于将所述连接控制寄存器中的连接标志位调整为第二状态,以触发系统将下行口连接的所述线缆重新加入。The second adjustment unit is configured to adjust the connection flag bit in the connection control register to a second state, so as to trigger the system to re-add the cable connected to the downlink port.
可选地,针对于所述下行口线缆的连接状态以及链路带宽是否满足恢复条件的检测过程,所述装置包括第一判断单元、读取单元和第二判断单元;Optionally, for the detection process of the connection state of the downlink cable and whether the link bandwidth meets the recovery condition, the device includes a first judgment unit, a reading unit, and a second judgment unit;
所述第一判断单元,用于判断所述下行口的四根线缆是否均处于连接状态;the first judging unit, configured to judge whether the four cables of the downlink port are all connected;
所述读取单元,用于当所述下行口的四根线缆均处于连接状态时,从所述连接控制寄存器中读取当前链路带宽;The reading unit is configured to read the current link bandwidth from the connection control register when the four cables of the downlink port are all connected;
所述第二判断单元,用于判断所述当前链路带宽是否小于设定的链路带宽;当前链路带宽小于设定的链路带宽时,则触发所述第一调整单元。The second judgment unit is configured to judge whether the current link bandwidth is less than the set link bandwidth; when the current link bandwidth is less than the set link bandwidth, trigger the first adjustment unit.
可选地,还包括提示单元;Optionally, it also includes a prompting unit;
所述提示单元,用于当预设时间段内所述下行口未满足四根线缆均处于连接状态时,则展示线缆连接失败的提示信息。The prompting unit is configured to display prompt information of cable connection failure when the downlink port does not satisfy that all four cables are in a connected state within a preset time period.
可选地,所述获取单元具体用于按照设定的周期时间读取线缆在位信号以及连接控制寄存器中记录的当前链路带宽。Optionally, the obtaining unit is specifically configured to read the cable presence signal and the current link bandwidth recorded in the connection control register according to the set period time.
可选地,在所述将所述连接控制寄存器中的连接标志位调整为第二状态,以触发系统将下行口连接的所述线缆重新加入之后还包括判断单元和返回单元;Optionally, after adjusting the connection flag bit in the connection control register to the second state to trigger the system to re-add the cable connected to the downlink port, it also includes a judgment unit and a return unit;
所述判断单元,用于判断所述下行口的当前链路带宽是否达到设定的链路带宽;The judging unit is used to judge whether the current link bandwidth of the downlink port reaches the set link bandwidth;
所述返回单元,用于当所述下行口的当前链路带宽未达到设定的链路带宽时,则间隔预设时间段之后触发所述第一调整单元。The returning unit is configured to trigger the first adjustment unit after a preset time period when the current link bandwidth of the downlink port does not reach the set link bandwidth.
本发明实施例还提供了一种基于PCIE Switch的带宽恢复装置,包括:The embodiment of the present invention also provides a bandwidth recovery device based on PCIE Switch, including:
存储器,用于存储计算机程序;memory for storing computer programs;
处理器,用于执行所述计算机程序以实现如上述任意一项所述基于PCIE Switch的带宽恢复方法的步骤。The processor is configured to execute the computer program to implement the steps of the PCIE Switch-based bandwidth recovery method according to any one of the above.
本发明实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上述任意一项所述基于PCIESwitch的带宽恢复方法的步骤。An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the PCIESwitch-based bandwidth recovery according to any one of the above-mentioned items is implemented. steps of the method.
由上述技术方案可以看出,获取下行口的线缆连接状态以及链路带宽;当检测到所述下行口的线缆连接状态以及链路带宽满足恢复条件时,则说明下行口的链路带宽并不符合实际的带宽要求,此时可以调整连接控制寄存器中的连接标志位至第一状态,以触发系统将下行口连接的线缆移除。通过软件模拟的方式达到线缆移除的效果。在触发系统将下行口连接的线缆移除之后,可以再次将连接控制寄存器中的连接标志位调整为第二状态,以触发系统将下行口连接的线缆重新加入,此时系统可以识别到下行口连接的所有线缆,从而使得下行口的链路带宽与下行口实际连接的线缆个数相匹配,解决了多根线缆连接时无法组成指定链路带宽的问题。It can be seen from the above technical solutions that the cable connection status and link bandwidth of the downlink port are obtained; when it is detected that the cable connection status and link bandwidth of the downlink port meet the recovery conditions, the link bandwidth of the downlink port is indicated. It does not meet the actual bandwidth requirements. At this time, the connection flag bit in the connection control register can be adjusted to the first state to trigger the system to remove the cable connected to the downlink port. The effect of cable removal is achieved through software simulation. After the triggering system removes the cable connected to the downlink port, the connection flag bit in the connection control register can be adjusted to the second state again to trigger the system to re-add the cable connected to the downlink port. At this time, the system can recognize the All cables connected to the downlink port, so that the link bandwidth of the downlink port matches the number of cables actually connected to the downlink port, which solves the problem that the specified link bandwidth cannot be formed when multiple cables are connected.
附图说明Description of drawings
为了更清楚地说明本发明实施例,下面将对实施例中所需要使用的附图做简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention more clearly, the following will briefly introduce the accompanying drawings that need to be used in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention, which are not relevant to ordinary skills in the art. As far as personnel are concerned, other drawings can also be obtained from these drawings on the premise of no creative work.
图1为本发明实施例提供的一种基于PCIE Switch的带宽恢复方法的流程图;FIG. 1 is a flowchart of a PCIE Switch-based bandwidth recovery method provided by an embodiment of the present invention;
图2为本发明实施例提供的一种基于PCIE Switch的带宽恢复装置的结构示意图;2 is a schematic structural diagram of a PCIE Switch-based bandwidth recovery device provided by an embodiment of the present invention;
图3为本发明实施例提供的一种基于PCIE Switch的带宽恢复装置的硬件结构示意图。FIG. 3 is a schematic diagram of a hardware structure of a bandwidth recovery device based on a PCIE Switch according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下,所获得的所有其他实施例,都属于本发明保护范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present invention.
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。In order to make those skilled in the art better understand the solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
接下来,详细介绍本发明实施例所提供的一种基于PCIE Switch的带宽恢复方法。图1为本发明实施例提供的一种基于PCIE Switch的带宽恢复方法的流程图,该方法包括:Next, a bandwidth recovery method based on a PCIE Switch provided by an embodiment of the present invention is introduced in detail. 1 is a flowchart of a PCIE Switch-based bandwidth recovery method provided by an embodiment of the present invention, where the method includes:
S101:获取下行口的线缆连接状态以及链路带宽。S101: Acquire the cable connection state and link bandwidth of the downlink port.
在本发明实施例中,以PCIE Switch的一个带宽为x16下行口为例展开介绍,要到达x16链路带宽,PCIE Switch的下行口需要连接四根线缆。In the embodiment of the present invention, an introduction is made by taking one bandwidth of the PCIE Switch as an x16 downlink port as an example. To reach the x16 link bandwidth, four cables need to be connected to the downlink port of the PCIE Switch.
在本发明实施例中,可以通过读取线缆在位信号的方式,识别下行口的线缆连接状态。In this embodiment of the present invention, the cable connection state of the downlink port can be identified by reading the cable presence signal.
系统可以自动识别是否有线缆插入下行口,当有线缆插入下行口的一个端口时,系统会自动在寄存器中记录该端口对应的线缆在位信号。当线缆插入下行口的一个端口时,该端口对应的线缆在位信号为“1”;当线缆未插入下行口的端口时,该端口对应的线缆在位信号为“0”。The system can automatically identify whether a cable is inserted into the downstream port. When a cable is inserted into a port of the downstream port, the system will automatically record the cable presence signal corresponding to the port in the register. When a cable is inserted into a port of the downstream port, the cable presence signal corresponding to the port is "1"; when the cable is not inserted into the port of the downstream port, the cable presence signal corresponding to the port is "0".
考虑到线缆需要一根一根顺序插入下行口,为了更加准确的获取下行口线缆的实际连接状态,可以按照设定的周期时间读取线缆在位信号以及连接控制寄存器中记录的当前链路带宽。Considering that the cables need to be inserted into the downlink port one by one, in order to obtain the actual connection status of the downlink port cable more accurately, you can read the cable presence signal and the current record in the connection control register according to the set cycle time. link bandwidth.
其中,周期时间的取值可以依赖线缆插入下行口所花费的时间进行设置。The value of the cycle time can be set depending on the time it takes for the cable to be inserted into the downlink port.
S102:当检测到下行口的线缆连接状态以及链路带宽满足恢复条件时,调整连接控制寄存器中的连接标志位至第一状态,以触发系统将下行口连接的线缆移除。S102: When it is detected that the cable connection state of the downlink port and the link bandwidth satisfy the recovery condition, adjust the connection flag bit in the connection control register to the first state to trigger the system to remove the cable connected to the downlink port.
恢复条件指的是下行口所要求数量的线缆全部插入,但是所对应的链路带宽未达到与线缆数量匹配的带宽值。The recovery condition means that all the cables required by the downlink port are inserted, but the corresponding link bandwidth does not reach the bandwidth value matching the number of cables.
以插入4根线缆,在具体实现中,可以判断下行口的四根线缆是否均处于连接状态。当下行口的四根线缆均处于连接状态时,则说明所需插入的线缆已经全部插入下行口,此时可以从连接控制寄存器中读取当前链路带宽。判断当前链路带宽是否小于设定的链路带宽。In order to insert four cables, in a specific implementation, it can be determined whether the four cables of the downlink port are all connected. When the four cables of the downlink port are all connected, it means that all cables to be inserted have been inserted into the downlink port, and the current link bandwidth can be read from the connection control register. Determine whether the current link bandwidth is less than the set link bandwidth.
当前链路带宽小于设定的链路带宽时,则说明下行口的链路带宽并不符合实际的带宽要求,此时可以调整连接控制寄存器中的连接标志位至第一状态,以触发系统将下行口连接的线缆移除的步骤。When the current link bandwidth is less than the set link bandwidth, it means that the link bandwidth of the downlink interface does not meet the actual bandwidth requirements. At this time, the connection flag bit in the connection control register can be adjusted to the first state to trigger the system to Steps to remove the cable connected to the downstream port.
在本发明实施例中,通过更改寄存器中连接标志位来触发链路带宽的自动协商过程。In the embodiment of the present invention, the automatic negotiation process of the link bandwidth is triggered by changing the connection flag bit in the register.
在实际应用中,可以将连接标志位置“0”表示第一状态,将连接标志位置“1”表示第二状态。当连接标志位调整至第一状态时,此时会触发系统走热插拔流程,通过软件模拟的方式达到线缆移除的效果。In practical applications, the connection flag position "0" may represent the first state, and the connection flag position "1" may represent the second state. When the connection flag is adjusted to the first state, the system will be triggered to go through the hot-plug process, and the effect of cable removal is achieved by software simulation.
S103:将连接控制寄存器中的连接标志位调整为第二状态,以触发系统将下行口连接的线缆重新加入。S103: Adjust the connection flag bit in the connection control register to the second state to trigger the system to re-add the cable connected to the downlink port.
在触发系统将下行口连接的线缆移除之后,可以再次将连接控制寄存器中的连接标志位调整为第二状态,以触发系统将下行口连接的线缆重新加入,此时系统可以识别到下行口连接的所有线缆,从而使得下行口的链路带宽与下行口实际连接的线缆个数相匹配。After the triggering system removes the cable connected to the downlink port, the connection flag bit in the connection control register can be adjusted to the second state again to trigger the system to re-add the cable connected to the downlink port. At this time, the system can recognize the All cables connected to the downlink port, so that the link bandwidth of the downlink port matches the number of cables actually connected to the downlink port.
以4根线缆为例,通过将连接控制寄存器中的连接标志位调整为第二状态,此时会触发系统执行热插拔流程,重新识别下行口所连接的线缆,由于此时下行口已经同时连接了4根线缆,所以系统可以识别到x16的链路带宽,从而使得4根线缆到达x16的链路带宽。Taking 4 cables as an example, by adjusting the connection flag in the connection control register to the second state, the system will be triggered to execute the hot-plug process and re-identify the cable connected to the downlink port. 4 cables have been connected at the same time, so the system can recognize the link bandwidth to x16, so that 4 cables reach the link bandwidth of x16.
在本发明实施例中,在将连接控制寄存器中的连接标志位调整为第二状态,以触发系统将下行口连接的线缆重新加入之后,可以进一步判断下行口的当前链路带宽是否达到设定的链路带宽。当下行口的当前链路带宽未达到设定的链路带宽时,则间隔预设时间段之后返回S102重新调整连接控制寄存器中的连接标志位至第一状态,以触发系统将下行口连接的线缆移除的步骤。In the embodiment of the present invention, after the connection flag bit in the connection control register is adjusted to the second state to trigger the system to rejoin the cable connected to the downlink port, it can be further determined whether the current link bandwidth of the downlink port reaches the set value. specified link bandwidth. When the current link bandwidth of the downlink port does not reach the set link bandwidth, return to S102 after a preset time period to re-adjust the connection flag bit in the connection control register to the first state, so as to trigger the system to connect the downlink port to the first state. Steps for cable removal.
由上述技术方案可以看出,获取下行口的线缆连接状态以及链路带宽;当检测到所述下行口的线缆连接状态以及链路带宽满足恢复条件时,则说明下行口的链路带宽并不符合实际的带宽要求,此时可以调整连接控制寄存器中的连接标志位至第一状态,以触发系统将下行口连接的线缆移除。通过软件模拟的方式达到线缆移除的效果。在触发系统将下行口连接的线缆移除之后,可以再次将连接控制寄存器中的连接标志位调整为第二状态,以触发系统将下行口连接的线缆重新加入,此时系统可以识别到下行口连接的所有线缆,从而使得下行口的链路带宽与下行口实际连接的线缆个数相匹配,解决了多根线缆连接时无法组成指定链路带宽的问题。It can be seen from the above technical solutions that the cable connection status and link bandwidth of the downlink port are obtained; when it is detected that the cable connection status and link bandwidth of the downlink port meet the recovery conditions, the link bandwidth of the downlink port is indicated. It does not meet the actual bandwidth requirements. At this time, the connection flag bit in the connection control register can be adjusted to the first state to trigger the system to remove the cable connected to the downlink port. The effect of cable removal is achieved through software simulation. After the triggering system removes the cable connected to the downlink port, the connection flag bit in the connection control register can be adjusted to the second state again to trigger the system to re-add the cable connected to the downlink port. At this time, the system can recognize the All cables connected to the downlink port, so that the link bandwidth of the downlink port matches the number of cables actually connected to the downlink port, which solves the problem that the specified link bandwidth cannot be formed when multiple cables are connected.
考虑到在实际应用中,可能会存下行口插入了线缆,由于线缆未插好,导致一直未检测到线缆的插入。以4根线缆为例,为了便于用户及时发现线缆未插好的情况,系统在判断下行口的四根线缆是否均处于连接状态之后,可以进一步判断在预设时间段内下行口是否满足四根线缆均处于连接状态。Considering that in practical applications, there may be a cable inserted into the downstream port. Because the cable is not inserted properly, the insertion of the cable has not been detected. Taking four cables as an example, in order to facilitate users to find out if the cables are not plugged in properly, after judging whether the four cables of the downlink port are all connected, the system can further determine whether the downlink port is in the preset time period. All four cables are connected.
预设时间段可以依据四根线缆插入下行口所花费的时间设置。The preset time period can be set according to the time it takes for the four cables to be inserted into the downstream port.
当预设时间段内下行口未满足四根线缆均处于连接状态时,则说明极有可能是线缆插入了下行口,但是未插好导致系统无法检测到线缆的连接,因此当预设时间段内下行口未满足四根线缆均处于连接状态时,可以展示线缆连接失败的提示信息。When the downlink port does not meet the requirement that all four cables are connected within the preset time period, it means that the cable is most likely inserted into the downlink port, but the system cannot detect the connection of the cable because the cable is not inserted properly. If the downlink port does not meet the requirements of all four cables in the connected state within the set time period, the prompt information of cable connection failure can be displayed.
通过对线缆连接状态的变化进行时间的设定,可以及时的发现线缆未插好导致无法识别到线缆连接的情况,以便于用户可以重新将线缆插入下行口。By setting the time for the change of the cable connection status, it is possible to find out in time that the cable is not plugged in properly, so that the cable connection cannot be recognized, so that the user can re-insert the cable into the downlink port.
图2为本发明实施例提供的一种基于PCIE Switch的带宽恢复装置结构示意图,包括获取单元21、第一调整单元22和第二调整单元23;FIG. 2 is a schematic structural diagram of a PCIE Switch-based bandwidth recovery device according to an embodiment of the present invention, including an acquisition unit 21, a first adjustment unit 22, and a second adjustment unit 23;
获取单元21,用于获取下行口的线缆连接状态以及链路带宽;an acquisition unit 21, configured to acquire the cable connection status and link bandwidth of the downlink port;
第一调整单元22,用于当检测到下行口的线缆连接状态以及链路带宽满足恢复条件时,调整连接控制寄存器中的连接标志位至第一状态,以触发系统将下行口连接的线缆移除;The first adjustment unit 22 is used to adjust the connection flag bit in the connection control register to the first state when it is detected that the cable connection state of the downlink port and the link bandwidth satisfy the recovery condition, so as to trigger the system to connect the cable connected to the downlink port. cable removal;
第二调整单元23,用于将连接控制寄存器中的连接标志位调整为第二状态,以触发系统将下行口连接的线缆重新加入。The second adjustment unit 23 is configured to adjust the connection flag bit in the connection control register to the second state, so as to trigger the system to re-add the cable connected to the downlink port.
可选地,针对于下行口线缆的连接状态以及链路带宽是否满足恢复条件的检测过程,装置包括第一判断单元、读取单元和第二判断单元;Optionally, for the detection process of the connection state of the downlink cable and whether the link bandwidth meets the recovery condition, the device includes a first judgment unit, a reading unit, and a second judgment unit;
第一判断单元,用于判断下行口的四根线缆是否均处于连接状态;a first judging unit for judging whether the four cables of the downlink port are all connected;
读取单元,用于当下行口的四根线缆均处于连接状态时,从连接控制寄存器中读取当前链路带宽;The reading unit is used to read the current link bandwidth from the connection control register when the four cables of the downlink port are all connected;
第二判断单元,用于判断当前链路带宽是否小于设定的链路带宽;当前链路带宽小于设定的链路带宽时,则触发第一调整单元。The second judgment unit is configured to judge whether the current link bandwidth is less than the set link bandwidth; when the current link bandwidth is less than the set link bandwidth, the first adjustment unit is triggered.
可选地,还包括提示单元;Optionally, it also includes a prompting unit;
提示单元,用于当预设时间段内下行口未满足四根线缆均处于连接状态时,则展示线缆连接失败的提示信息。The prompt unit is used to display the prompt information of cable connection failure when the downlink port does not satisfy that all four cables are in the connected state within the preset time period.
可选地,获取单元具体用于按照设定的周期时间读取线缆在位信号以及连接控制寄存器中记录的当前链路带宽。Optionally, the acquiring unit is specifically configured to read the cable presence signal and the current link bandwidth recorded in the connection control register according to the set period time.
可选地,在将连接控制寄存器中的连接标志位调整为第二状态,以触发系统将下行口连接的线缆重新加入之后还包括判断单元和返回单元;Optionally, after adjusting the connection flag bit in the connection control register to the second state to trigger the system to rejoin the cable connected to the downlink port, it also includes a judgment unit and a return unit;
判断单元,用于判断下行口的当前链路带宽是否达到设定的链路带宽;A judging unit for judging whether the current link bandwidth of the downlink port reaches the set link bandwidth;
返回单元,用于当下行口的当前链路带宽未达到设定的链路带宽时,则间隔预设时间段之后触发第一调整单元。The returning unit is configured to trigger the first adjustment unit after a preset time period when the current link bandwidth of the downlink port does not reach the set link bandwidth.
图2所对应实施例中特征的说明可以参见图1所对应实施例的相关说明,这里不再一一赘述。For the description of the features in the embodiment corresponding to FIG. 2 , reference may be made to the relevant description of the embodiment corresponding to FIG. 1 , which will not be repeated here.
由上述技术方案可以看出,获取下行口的线缆连接状态以及链路带宽;当检测到所述下行口的线缆连接状态以及链路带宽满足恢复条件时,则说明下行口的链路带宽并不符合实际的带宽要求,此时可以调整连接控制寄存器中的连接标志位至第一状态,以触发系统将下行口连接的线缆移除。通过软件模拟的方式达到线缆移除的效果。在触发系统将下行口连接的线缆移除之后,可以再次将连接控制寄存器中的连接标志位调整为第二状态,以触发系统将下行口连接的线缆重新加入,此时系统可以识别到下行口连接的所有线缆,从而使得下行口的链路带宽与下行口实际连接的线缆个数相匹配,解决了多根线缆连接时无法组成指定链路带宽的问题。It can be seen from the above technical solutions that the cable connection status and link bandwidth of the downlink port are obtained; when it is detected that the cable connection status and link bandwidth of the downlink port meet the recovery conditions, the link bandwidth of the downlink port is indicated. It does not meet the actual bandwidth requirements. At this time, the connection flag bit in the connection control register can be adjusted to the first state to trigger the system to remove the cable connected to the downlink port. The effect of cable removal is achieved through software simulation. After the triggering system removes the cable connected to the downlink port, the connection flag bit in the connection control register can be adjusted to the second state again to trigger the system to re-add the cable connected to the downlink port. At this time, the system can recognize the All cables connected to the downlink port, so that the link bandwidth of the downlink port matches the number of cables actually connected to the downlink port, which solves the problem that the specified link bandwidth cannot be formed when multiple cables are connected.
图3为本发明实施例提供的一种基于PCIE Switch的带宽恢复装置30的硬件结构示意图,包括:3 is a schematic diagram of a hardware structure of a PCIE Switch-based
存储器31,用于存储计算机程序;
处理器32,用于执行计算机程序以实现如上述任意实施例所述的基于PCIE Switch的带宽恢复方法的步骤。The
本发明实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述任意实施例所述的基于PCIE Switch的带宽恢复方法的步骤。Embodiments of the present invention further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the bandwidth recovery method based on the PCIE Switch described in any of the foregoing embodiments is implemented. step.
以上对本发明实施例所提供的一种基于PCIE Switch的带宽恢复方法、装置和计算机可读存储介质进行了详细介绍。说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。A PCIE Switch-based bandwidth recovery method, device, and computer-readable storage medium provided by the embodiments of the present invention are described above in detail. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method. It should be pointed out that for those skilled in the art, without departing from the principle of the present invention, several improvements and modifications can also be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals may further realize 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 possibilities of hardware and software. Interchangeability, the above description has generally described the components and steps of each example in terms of function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of a method or algorithm described in conjunction with the embodiments disclosed herein may be directly implemented in hardware, a software module executed by a processor, or a combination of the two. Software modules can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010922938.4A CN111817904B (en) | 2020-09-04 | 2020-09-04 | Bandwidth recovery method, device and medium based on PCIE Switch |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010922938.4A CN111817904B (en) | 2020-09-04 | 2020-09-04 | Bandwidth recovery method, device and medium based on PCIE Switch |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111817904A true CN111817904A (en) | 2020-10-23 |
| CN111817904B CN111817904B (en) | 2021-03-09 |
Family
ID=72860647
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010922938.4A Active CN111817904B (en) | 2020-09-04 | 2020-09-04 | Bandwidth recovery method, device and medium based on PCIE Switch |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111817904B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2022161486A1 (en) * | 2021-01-29 | 2022-08-04 | Shanghai United Imaging Healthcare Co., Ltd. | Devices, systems, and methods for controlling communication between apparatuses |
| CN116017189A (en) * | 2022-12-14 | 2023-04-25 | 西安易朴通讯技术有限公司 | Cable configuration method, device, device, storage medium and program product |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070214301A1 (en) * | 2006-03-10 | 2007-09-13 | Inventec Corporation | PCI-E Automatic allocation system |
| CN109062839A (en) * | 2018-07-18 | 2018-12-21 | 郑州云海信息技术有限公司 | A kind of method, apparatus and computer readable storage medium detecting HBA card |
| CN110399027A (en) * | 2019-07-19 | 2019-11-01 | 苏州浪潮智能科技有限公司 | A kind of reset circuit |
-
2020
- 2020-09-04 CN CN202010922938.4A patent/CN111817904B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070214301A1 (en) * | 2006-03-10 | 2007-09-13 | Inventec Corporation | PCI-E Automatic allocation system |
| CN109062839A (en) * | 2018-07-18 | 2018-12-21 | 郑州云海信息技术有限公司 | A kind of method, apparatus and computer readable storage medium detecting HBA card |
| CN110399027A (en) * | 2019-07-19 | 2019-11-01 | 苏州浪潮智能科技有限公司 | A kind of reset circuit |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2022161486A1 (en) * | 2021-01-29 | 2022-08-04 | Shanghai United Imaging Healthcare Co., Ltd. | Devices, systems, and methods for controlling communication between apparatuses |
| US12411794B2 (en) | 2021-01-29 | 2025-09-09 | Shanghai United Imaging Healthcare Co., Ltd. | Devices, systems, and methods for controlling communication between apparatuses |
| CN116017189A (en) * | 2022-12-14 | 2023-04-25 | 西安易朴通讯技术有限公司 | Cable configuration method, device, device, storage medium and program product |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111817904B (en) | 2021-03-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107203448B (en) | Method and system for testing violent hot plug function of PCIe switch chip | |
| CN105955858A (en) | Method and device for testing log recording function of BMC (Baseboard Management Controller) | |
| CN101615152B (en) | Method and device for detecting hot plug fault of storage card | |
| CN110647486B (en) | A PCIe link training method, terminal device and communication system | |
| CN103218275B (en) | Error in data restorative procedure, device and equipment | |
| CN111209151A (en) | Linux-based NVME SSD hot-swap test method, system, terminal and storage medium | |
| CN103257912A (en) | Testing device and method thereof for testing peripheral component interface express (PCIE) slot | |
| WO2016197606A1 (en) | Method and device for acquiring optical module state information | |
| CN111817904A (en) | Bandwidth recovery method, device and medium based on PCIE Switch | |
| CN110502382B (en) | TYPE-C interface testing method and device, storage medium and electronic equipment | |
| CN106030544B (en) | Computer device memory detection method and computer device | |
| CN109947686A (en) | A PCIE system, hot-plug processing method and related device | |
| CN110377231A (en) | A kind of VMD control method, device, electronic equipment and readable storage medium storing program for executing | |
| CN106254149B (en) | A kind of method and management board judging that board is pulled out | |
| CN104794030A (en) | SAS cable testing system and method | |
| WO2025118468A1 (en) | Misplug detection method and apparatus for hdmi device interface, and device and storage medium | |
| TWI512303B (en) | Hot plugging device for establishing and testing data channel by switching protocol automatically and method thereof | |
| JP2007213557A5 (en) | ||
| CN115587005A (en) | Method, device, equipment and medium for monitoring battery plugging and unplugging status | |
| CN110059390B (en) | Device under test verification device and related product | |
| JP2003248796A (en) | Pc card detection device | |
| CN108879589B (en) | Overcurrent protection method and device, terminal equipment and storage medium | |
| CN105208192A (en) | Storage card state control method of terminal and device | |
| CN119292991A (en) | Memory card initialization method, device, equipment, medium, and program product | |
| CN110413459B (en) | External PHY card identification method, device, equipment and readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CP03 | Change of name, title or address | ||
| CP03 | Change of name, title or address |
Address after: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province Patentee after: Suzhou Yuannao Intelligent Technology Co.,Ltd. Country or region after: China Address before: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province Patentee before: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd. Country or region before: China |