CN115766526B - Method and device for testing physical layer chip of switch and electronic equipment - Google Patents
Method and device for testing physical layer chip of switch and electronic equipment Download PDFInfo
- Publication number
- CN115766526B CN115766526B CN202211448725.8A CN202211448725A CN115766526B CN 115766526 B CN115766526 B CN 115766526B CN 202211448725 A CN202211448725 A CN 202211448725A CN 115766526 B CN115766526 B CN 115766526B
- Authority
- CN
- China
- Prior art keywords
- port
- phy
- test
- phy port
- chip
- 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.)
- Active
Links
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/50—Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及计算机技术领域,尤其涉及一种交换机物理层芯片的测试方法、装置及电子设备。The present invention relates to the field of computer technology, and in particular to a test method, device and electronic equipment for a physical layer chip of a switch.
背景技术Background technique
交换机物理层(Physical Layer,PHY),将介质访问控制层(Media AccessControl,MAC)的数据进行处理,并行数据转化为串行数据,按照物理层的规则编码,再变为模拟信号把数据送出去,且能够实现部分带有冲突检测的载波侦听多路存取(CarrierSense Multiple Access/Collision Detection,CSMA/CD)功能,是交换机的一个重要组成部分。随着网络技术的发展,PHY芯片在交换机上的使用规模越来越大。The physical layer (Physical Layer, PHY) of the switch processes the data of the media access control layer (Media Access Control, MAC), converts parallel data into serial data, encodes it according to the rules of the physical layer, and then converts it into an analog signal to send the data out. It can also implement some Carrier Sense Multiple Access/Collision Detection (CSMA/CD) functions with collision detection, and is an important part of the switch. With the development of network technology, the use of PHY chips in switches is getting larger and larger.
相关技术中的PHY端口测试技术,多采用外部治具(例如光模块、eload等治具),将每个lane的发送(tx)口和接收(rx)口通过隔直电容连接,然后进行流量测试,测试效率较低。The PHY port testing technology in the related art mostly uses external fixtures (such as optical modules, eload and other fixtures) to connect the transmit (tx) port and receive (rx) port of each lane through a DC blocking capacitor, and then perform a flow test, which has low test efficiency.
发明内容Summary of the invention
针对现有技术存在的问题,本发明实施例提供一种交换机物理层芯片的测试方法、装置及电子设备。In view of the problems existing in the prior art, the embodiments of the present invention provide a method, a device and an electronic device for testing a physical layer chip of a switch.
第一方面,本发明提供一种交换机物理层芯片的测试方法,包括:通过管理数据时钟MDC接口和管理数据输入输出MDIO接口,配置物理层PHY芯片的各PHY端口为环回状态;In a first aspect, the present invention provides a test method for a switch physical layer chip, comprising: configuring each PHY port of a physical layer PHY chip to a loopback state by managing a data clock MDC interface and a data input and output MDIO interface;
通过对各PHY端口进行线速流量测试,获取各PHY端口的端口测试结果,所述端口测试结果用于指示PHY端口是否通过测试。By performing a line-speed flow test on each PHY port, a port test result of each PHY port is obtained, and the port test result is used to indicate whether the PHY port passes the test.
可选地,根据本发明提供的一种交换机物理层芯片的测试方法,所述通过对各PHY端口进行线速流量测试,获取各PHY端口的端口测试结果,包括:Optionally, according to a test method for a switch physical layer chip provided by the present invention, the step of performing a line rate flow test on each PHY port to obtain a port test result of each PHY port includes:
获取各PHY端口的连接状态;Get the connection status of each PHY port;
若确定各PHY端口的连接状态均为连接建立状态,则通过介质访问控制层MAC的发送TX端口,发送测试用例数据至各PHY端口;If it is determined that the connection status of each PHY port is a connection establishment status, the test case data is sent to each PHY port through the sending TX port of the media access control layer MAC;
通过MAC的接收RX端口,接收各PHY端口的环回数据;Receive loopback data from each PHY port through the MAC's RX port;
基于所述测试用例数据、各PHY端口的环回数据和各PHY端口的连接状态监测数据,获取各PHY端口的端口测试结果。Based on the test case data, the loopback data of each PHY port and the connection status monitoring data of each PHY port, a port test result of each PHY port is obtained.
可选地,根据本发明提供的一种交换机物理层芯片的测试方法,所述基于所述测试用例数据、各PHY端口的环回数据和各PHY端口的连接状态监测数据,获取各PHY端口的端口测试结果,包括:Optionally, according to a test method for a switch physical layer chip provided by the present invention, obtaining a port test result of each PHY port based on the test case data, the loopback data of each PHY port, and the connection status monitoring data of each PHY port includes:
基于所述测试用例数据和各PHY端口的环回数据,确定各PHY端口的收发包数量差异信息以及各PHY端口的错误包信息;Based on the test case data and the loopback data of each PHY port, determine the difference information of the number of sent and received packets of each PHY port and the error packet information of each PHY port;
基于各PHY端口的连接状态监测数据、收发包数量差异信息以及错误包信息,判断各PHY端口是否通过测试,获取各PHY端口的端口测试结果。Based on the connection status monitoring data of each PHY port, the difference information of the number of sent and received packets, and the error packet information, it is determined whether each PHY port passes the test, and the port test result of each PHY port is obtained.
可选地,根据本发明提供的一种交换机物理层芯片的测试方法,在所述通过对各PHY端口进行线速流量测试,获取各PHY端口的端口测试结果之后,还包括:Optionally, according to a test method for a switch physical layer chip provided by the present invention, after performing a line rate flow test on each PHY port to obtain a port test result of each PHY port, the method further includes:
在目标PHY端口的端口测试结果指示所述目标PHY端口未通过测试的情况下,基于所述目标PHY端口的连接状态监测数据、收发包数量差异信息以及错误包信息,确定目标故障关键词;When the port test result of the target PHY port indicates that the target PHY port has failed the test, determining a target fault keyword based on the connection status monitoring data, the difference information of the number of sent and received packets, and the error packet information of the target PHY port;
基于所述目标故障关键词和故障表,获取目标故障诊断指令,所述故障表用于表征故障关键词和故障诊断指令之间的映射关系,所述故障诊断指令用于辅助诊断PHY端口;Based on the target fault keyword and the fault table, a target fault diagnosis instruction is acquired, wherein the fault table is used to characterize a mapping relationship between the fault keyword and the fault diagnosis instruction, and the fault diagnosis instruction is used to assist in diagnosing the PHY port;
通过执行所述目标故障诊断指令,获取所述目标PHY端口的故障诊断信息;Obtaining fault diagnosis information of the target PHY port by executing the target fault diagnosis instruction;
所述目标PHY端口为所述PHY芯片的任意一个PHY端口。The target PHY port is any PHY port of the PHY chip.
可选地,根据本发明提供的一种交换机物理层芯片的测试方法,在所述获取所述目标PHY端口的故障诊断信息之后,还包括:Optionally, according to a test method for a switch physical layer chip provided by the present invention, after acquiring the fault diagnosis information of the target PHY port, the method further includes:
基于所述目标PHY端口的连接状态监测数据、收发包数量差异信息、错误包信息和故障诊断信息,确定所述目标PHY端口的故障上报信息;Determine the fault reporting information of the target PHY port based on the connection status monitoring data of the target PHY port, the difference information of the number of sent and received packets, the error packet information and the fault diagnosis information;
发送所述目标PHY端口的故障上报信息至服务器。Send the fault reporting information of the target PHY port to the server.
可选地,根据本发明提供的一种交换机物理层芯片的测试方法,还包括:Optionally, a test method for a switch physical layer chip provided by the present invention further includes:
通过MDC接口和MDIO接口,轮询所述PHY芯片的多个寄存器,获取所述多个寄存器的存储值,所述多个寄存器包括中断寄存器、控制寄存器和状态寄存器;Polling multiple registers of the PHY chip through the MDC interface and the MDIO interface to obtain storage values of the multiple registers, wherein the multiple registers include an interrupt register, a control register, and a status register;
基于各寄存器的参考值和各寄存器的存储值,确定所述PHY芯片的运行状态信息,所述运行状态信息用于表征所述PHY芯片是否出现故障。Based on the reference value of each register and the storage value of each register, the operation status information of the PHY chip is determined, and the operation status information is used to indicate whether the PHY chip fails.
可选地,根据本发明提供的一种交换机物理层芯片的测试方法,在所述确定所述PHY芯片的运行状态信息之后,还包括:Optionally, according to a test method for a switch physical layer chip provided by the present invention, after determining the operating status information of the PHY chip, the method further includes:
在所述运行状态信息表征所述PHY芯片出现故障的情况下,配置各寄存器的存储值为各寄存器的参考值。In a case where the operating status information indicates that a fault occurs in the PHY chip, the storage value of each register is configured as a reference value of each register.
第二方面,本发明还提供一种交换机物理层芯片的测试装置,包括:In a second aspect, the present invention further provides a test device for a switch physical layer chip, comprising:
第一配置模块,用于通过管理数据时钟MDC接口和管理数据输入输出MDIO接口,配置物理层PHY芯片的各PHY端口为环回状态;The first configuration module is used to configure each PHY port of the physical layer PHY chip to a loopback state through a management data clock MDC interface and a management data input and output MDIO interface;
测试模块,用于通过对各PHY端口进行线速流量测试,获取各PHY端口的端口测试结果,所述端口测试结果用于指示PHY端口是否通过测试。The test module is used to obtain the port test result of each PHY port by performing a line speed flow test on each PHY port, and the port test result is used to indicate whether the PHY port passes the test.
第三方面,本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述交换机物理层芯片的测试方法。In a third aspect, the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a test method for a physical layer chip of a switch as described above is implemented.
第四方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述交换机物理层芯片的测试方法。In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the test method for the physical layer chip of a switch as described in any one of the above is implemented.
本发明提供的交换机物理层芯片的测试方法、装置及电子设备,通过MDC接口和MDIO接口,可以配置PHY芯片的各PHY端口为环回状态,进而可以对各PHY端口进行线速流量测试,测试过程中向PHY芯片的各PHY端口发送的测试用例数据,可以通过PHY芯片环回,进而可以分析各PHY端口的环回数据,能够获取各PHY端口的端口测试结果,端口测试结果可以指示PHY端口是否通过测试,测试过程无需采用外部治具,能够提高测试效率。The switch physical layer chip testing method, device and electronic device provided by the present invention can configure each PHY port of the PHY chip to be in a loopback state through an MDC interface and an MDIO interface, and then perform a line speed flow test on each PHY port. During the test, the test case data sent to each PHY port of the PHY chip can be looped back through the PHY chip, and then the loopback data of each PHY port can be analyzed, and the port test results of each PHY port can be obtained. The port test results can indicate whether the PHY port passes the test. No external fixture is required during the test, and the test efficiency can be improved.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
图1是本发明提供的交换机物理层芯片的测试方法的流程示意图;FIG1 is a schematic flow chart of a method for testing a physical layer chip of a switch provided by the present invention;
图2是本发明提供的线速流量测试的硬件连接结构示意图;FIG2 is a schematic diagram of the hardware connection structure of the line speed flow test provided by the present invention;
图3是本发明提供的交换机物理层芯片的测试装置的结构示意图;3 is a schematic diagram of the structure of a test device for a switch physical layer chip provided by the present invention;
图4是本发明提供的电子设备的结构示意图。FIG. 4 is a schematic diagram of the structure of an electronic device provided by the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
图1是本发明提供的交换机物理层芯片的测试方法的流程示意图,如图1所示,交换机物理层芯片的测试方法的执行主体可以是电子设备。该方法包括:FIG1 is a flow chart of a test method for a physical layer chip of a switch provided by the present invention. As shown in FIG1 , the execution subject of the test method for a physical layer chip of a switch may be an electronic device. The method comprises:
步骤101,通过管理数据时钟MDC接口和管理数据输入输出MDIO接口,配置物理层PHY芯片的各PHY端口为环回状态;Step 101, configuring each PHY port of the physical layer PHY chip to a loopback state through a management data clock MDC interface and a management data input and output MDIO interface;
具体地,为了提高测试效率,可以通过管理数据时钟(Management Data Clock,MDC)接口和管理数据输入输出(Management Data Input Output,MDIO)接口,配置PHY芯片的各PHY端口为环回状态,进而向PHY芯片的各PHY端口发送的测试用例数据,可以通过PHY芯片环回。Specifically, in order to improve the test efficiency, each PHY port of the PHY chip can be configured to be in a loopback state through the Management Data Clock (MDC) interface and the Management Data Input Output (MDIO) interface, and then the test case data sent to each PHY port of the PHY chip can be looped back through the PHY chip.
可以理解的是,通过MDC接口和MDIO接口,可以将PHY芯片的每个端口配置为Lineinternal环回,使流量能够从MAC端口tx发出后,经过PHY芯片再环回,回到MAC端口rx,从而实现不依赖外部治具进行测试。It can be understood that through the MDC interface and the MDIO interface, each port of the PHY chip can be configured as a Lineinternal loopback, so that the traffic can be sent out from the MAC port tx, then looped back through the PHY chip and returned to the MAC port rx, thereby achieving testing without relying on external fixtures.
步骤102,通过对各PHY端口进行线速流量测试,获取各PHY端口的端口测试结果,所述端口测试结果用于指示PHY端口是否通过测试。Step 102, by performing a line rate flow test on each PHY port, a port test result of each PHY port is obtained, wherein the port test result is used to indicate whether the PHY port passes the test.
具体地,在配置PHY芯片的各PHY端口为环回状态之后,可以对各PHY端口进行线速流量测试,测试过程中可以向PHY芯片的各PHY端口发送的测试用例数据,测试用例数据用于对各PHY端口进行测试,通过PHY芯片环回,可以分析各PHY端口的环回数据,获取各PHY端口的端口测试结果,端口测试结果可以指示PHY端口是否通过测试。Specifically, after configuring each PHY port of the PHY chip to be in a loopback state, a line-speed traffic test can be performed on each PHY port. During the test, test case data can be sent to each PHY port of the PHY chip. The test case data is used to test each PHY port. Through the PHY chip loopback, the loopback data of each PHY port can be analyzed to obtain the port test results of each PHY port. The port test results can indicate whether the PHY port passes the test.
例如,PHY芯片可以包括3个PHY端口,分别是端口A、端口B和端口C,可以通过MDC接口和MDIO接口,可以配置端口A、端口B和端口C为环回状态,测试过程中可以向端口A、端口B和端口C发送测试用例数据,通过PHY芯片环回,可以分析端口A、端口B和端口C的环回数据,可以获取各PHY端口的端口测试结果。For example, a PHY chip may include three PHY ports, namely port A, port B and port C. Port A, port B and port C may be configured to be in a loopback state through the MDC interface and the MDIO interface. During the test, test case data may be sent to port A, port B and port C. Through the PHY chip loopback, the loopback data of port A, port B and port C may be analyzed, and the port test results of each PHY port may be obtained.
本发明提供的交换机物理层芯片的测试方法,通过MDC接口和MDIO接口,可以配置PHY芯片的各PHY端口为环回状态,进而可以对各PHY端口进行线速流量测试,测试过程中向PHY芯片的各PHY端口发送的测试用例数据,可以通过PHY芯片环回,进而可以分析各PHY端口的环回数据,能够获取各PHY端口的端口测试结果,端口测试结果可以指示PHY端口是否通过测试,测试过程无需采用外部治具,能够提高测试效率。The switch physical layer chip testing method provided by the present invention can configure each PHY port of the PHY chip to be in a loopback state through an MDC interface and an MDIO interface, and then a line speed flow test can be performed on each PHY port. During the test, the test case data sent to each PHY port of the PHY chip can be looped back through the PHY chip, and then the loopback data of each PHY port can be analyzed, and the port test result of each PHY port can be obtained. The port test result can indicate whether the PHY port passes the test. No external fixture is required in the test process, and the test efficiency can be improved.
可选地,本发明提供一种交换机物理层芯片的测试方法,所述通过对各PHY端口进行线速流量测试,获取各PHY端口的端口测试结果,包括:Optionally, the present invention provides a method for testing a physical layer chip of a switch, wherein the method performs a line rate flow test on each PHY port to obtain a port test result of each PHY port, comprising:
获取各PHY端口的连接状态;Get the connection status of each PHY port;
若确定各PHY端口的连接状态均为连接建立状态,则通过介质访问控制层MAC的发送TX端口,发送测试用例数据至各PHY端口;If it is determined that the connection status of each PHY port is a connection establishment status, the test case data is sent to each PHY port through the sending TX port of the media access control layer MAC;
通过MAC的接收RX端口,接收各PHY端口的环回数据;Receive loopback data from each PHY port through the MAC's RX port;
基于所述测试用例数据、各PHY端口的环回数据和各PHY端口的连接状态监测数据,获取各PHY端口的端口测试结果。Based on the test case data, the loopback data of each PHY port and the connection status monitoring data of each PHY port, a port test result of each PHY port is obtained.
具体地,在配置PHY芯片的各PHY端口为环回状态之后,可以获取各PHY端口的连接(Link)状态,判断各PHY端口的连接状态是否均处于连接建立状态(Link up),若确定各PHY端口的连接状态均为连接建立状态,则可以通过MAC的发送TX端口,发送测试用例数据至各PHY端口,测试用例数据用于对各PHY端口进行测试,进而通过MAC的接收RX端口,可以接收各PHY端口的环回数据,进而可以基于测试用例数据、各PHY端口的环回数据和各PHY端口的连接状态监测数据,可以对PHY端口的测试情况进行分析,获取各PHY端口的端口测试结果。Specifically, after configuring each PHY port of the PHY chip to be in a loopback state, the connection (Link) status of each PHY port can be obtained to determine whether the connection status of each PHY port is in a connection establishment state (Link up). If it is determined that the connection status of each PHY port is in a connection establishment state, test case data can be sent to each PHY port through the MAC's sending TX port. The test case data is used to test each PHY port. Then, the loopback data of each PHY port can be received through the MAC's receiving RX port. Then, based on the test case data, the loopback data of each PHY port and the connection status monitoring data of each PHY port, the test situation of the PHY port can be analyzed to obtain the port test results of each PHY port.
例如,PHY芯片可以包括两个PHY端口,分别是端口A和端口B,可以通过MDC接口和MDIO接口,可以配置端口A和端口B为环回状态,进而可以判断端口A和端口B是否均处于Link up,若确定端口A和端口B均处于Link up,则通过MAC的发送TX端口,发送测试用例数据至端口A和端口B,进而通过MAC的接收RX端口,可以接收端口A和端口B的环回数据,进而可以基于测试用例数据,端口A和端口B的环回数据,以及端口A和端口B的连接状态监测数据,可以对端口A和端口B的测试情况进行分析,获取各PHY端口的端口测试结果。For example, a PHY chip may include two PHY ports, namely port A and port B. Port A and port B may be configured to be in a loopback state through an MDC interface and an MDIO interface, and then it may be determined whether port A and port B are both in Link up. If it is determined that port A and port B are both in Link up, test case data may be sent to port A and port B through a MAC sending TX port, and then the loopback data of port A and port B may be received through a MAC receiving RX port. Based on the test case data, the loopback data of port A and port B, and the connection status monitoring data of port A and port B, the test conditions of port A and port B may be analyzed, and the port test results of each PHY port may be obtained.
可选地,图2是本发明提供的线速流量测试的硬件连接结构示意图,如图2所示,PHY芯片可以通过中央处理器(Central Processing Unit,CPU)的KR总线与CPU连接,PHY芯片可以包括物理介质连接(Physical Medium Attachment,PMA)子层,物理介质相关(Physical Medium Dependent,PMD)子层,物理编码子层(Physical Coding Sublayer,PCS),串行器(Serializer)以及解串器(De-Serializer)。如图2所示,可以配置PHY芯片的各PHY端口为环回状态,进而可以结合Lanconf工具,在每个PHY端口进行线速收发包测试,并实时统计每个端口的收发包数和错包数等。Optionally, Fig. 2 is a schematic diagram of the hardware connection structure of the line speed flow test provided by the present invention. As shown in Fig. 2, the PHY chip can be connected to the CPU through the KR bus of the central processing unit (CPU), and the PHY chip can include a physical medium attachment (PMA) sublayer, a physical medium dependent (PMD) sublayer, a physical coding sublayer (PCS), a serializer (Serializer) and a deserializer (De-Serializer). As shown in Fig. 2, each PHY port of the PHY chip can be configured to be in a loopback state, and then the Lanconf tool can be combined to perform a line speed packet sending and receiving test on each PHY port, and the number of packets sent and received and the number of error packets of each port can be counted in real time.
因此,在配置PHY芯片的各PHY端口为环回状态之后,通过MAC的TX端口,发送测试用例数据至各PHY端口,以及通过MAC的RX端口,接收各PHY端口的环回数据,能够实现对各PHY端口的自动化测试,且测试过程无需采用外部治具,能够提高测试效率。Therefore, after configuring each PHY port of the PHY chip to be in a loopback state, the test case data is sent to each PHY port through the TX port of the MAC, and the loopback data of each PHY port is received through the RX port of the MAC. This can realize automated testing of each PHY port, and the test process does not require the use of external fixtures, which can improve test efficiency.
可选地,本发明提供一种交换机物理层芯片的测试方法,所述基于所述测试用例数据、各PHY端口的环回数据和各PHY端口的连接状态监测数据,获取各PHY端口的端口测试结果,包括:Optionally, the present invention provides a test method for a physical layer chip of a switch, wherein the port test result of each PHY port is obtained based on the test case data, the loopback data of each PHY port, and the connection status monitoring data of each PHY port, including:
基于所述测试用例数据和各PHY端口的环回数据,确定各PHY端口的收发包数量差异信息以及各PHY端口的错误包信息;Based on the test case data and the loopback data of each PHY port, determine the difference information of the number of sent and received packets of each PHY port and the error packet information of each PHY port;
基于各PHY端口的连接状态监测数据、收发包数量差异信息以及错误包信息,判断各PHY端口是否通过测试,获取各PHY端口的端口测试结果。Based on the connection status monitoring data of each PHY port, the difference information of the number of sent and received packets, and the error packet information, it is determined whether each PHY port passes the test, and the port test result of each PHY port is obtained.
具体地,通过比较测试用例数据的包数量和环回数据的包数量,可以确定收发包数量差异信息,通过对环回数据进行校验(例如循环冗余校验(Cyclic Redundancy Check,CRC))可以获取错误包信息,进而基于各PHY端口的连接状态监测数据、收发包数量差异信息以及错误包信息,可以判断各PHY端口是否通过测试,进而可以获取各PHY端口的端口测试结果。Specifically, by comparing the number of packets in the test case data and the number of packets in the loopback data, the difference information in the number of sent and received packets can be determined, and by verifying the loopback data (for example, cyclic redundancy check (CRC)), the error packet information can be obtained, and then based on the connection status monitoring data of each PHY port, the difference information in the number of sent and received packets, and the error packet information, it can be determined whether each PHY port has passed the test, and then the port test results of each PHY port can be obtained.
可选地,针对某一PHY端口,若连接状态监测数据表示在测试过程中该PHY端口的连接状态变为连接断开状态(Link down),则可以确定该PHY端口未通过测试。Optionally, for a certain PHY port, if the connection status monitoring data indicates that the connection status of the PHY port changes to a disconnected state (Link down) during the test, it can be determined that the PHY port has failed the test.
可选地,针对某一PHY端口,若收发包数量差异信息表示测试用例数据的包数量和环回数据的包数量不相同,则可以确定该PHY端口未通过测试。Optionally, for a certain PHY port, if the information about the difference in the number of sent and received packets indicates that the number of packets of the test case data is different from the number of packets of the loopback data, it can be determined that the PHY port has failed the test.
可选地,针对某一PHY端口,若错误包信息表示环回数据中的一个或多个数据包未通过校验,则可以确定该PHY端口未通过测试。Optionally, for a certain PHY port, if the error packet information indicates that one or more data packets in the loopback data fail to pass the check, it can be determined that the PHY port fails the test.
可选地,针对某一PHY端口,若同时满足以下三个条件,则可以确定PHY端口未通过测试:Optionally, for a certain PHY port, if the following three conditions are met at the same time, it can be determined that the PHY port has failed the test:
第一条件,连接状态监测数据表示在测试过程中该PHY端口的连接状态均为连接建立状态;The first condition is that the connection status monitoring data indicates that the connection status of the PHY port is in the connection establishment state during the test;
第二条件,收发包数量差异信息表示测试用例数据的包数量和环回数据的包数量相同;The second condition is that the difference information of the number of sent and received packets indicates that the number of packets of the test case data is the same as the number of packets of the loopback data;
第三条件,错误包信息表示对环回数据进行校验的过程中,环回数据中所有数据包均通过检验。The third condition is that the error packet information indicates that during the process of verifying the loopback data, all data packets in the loopback data have passed the verification.
因此,通过基于各PHY端口的连接状态监测数据、收发包数量差异信息以及错误包信息,判断各PHY端口是否通过测试,能够实现对各PHY端口的自动化测试,且测试过程无需采用外部治具,能够提高测试效率。Therefore, by judging whether each PHY port has passed the test based on the connection status monitoring data, the difference information of the number of sent and received packets, and the error packet information of each PHY port, it is possible to realize automated testing of each PHY port, and the test process does not require the use of external fixtures, which can improve test efficiency.
可选地,本发明提供一种交换机物理层芯片的测试方法,在所述通过对各PHY端口进行线速流量测试,获取各PHY端口的端口测试结果之后,还包括:Optionally, the present invention provides a test method for a physical layer chip of a switch, which, after performing a line-speed flow test on each PHY port to obtain a port test result of each PHY port, further comprises:
在目标PHY端口的端口测试结果指示所述目标PHY端口未通过测试的情况下,基于所述目标PHY端口的连接状态监测数据、收发包数量差异信息以及错误包信息,确定目标故障关键词;When the port test result of the target PHY port indicates that the target PHY port has failed the test, determining a target fault keyword based on the connection status monitoring data, the difference information of the number of sent and received packets, and the error packet information of the target PHY port;
基于所述目标故障关键词和故障表,获取目标故障诊断指令,所述故障表用于表征故障关键词和故障诊断指令之间的映射关系,所述故障诊断指令用于辅助诊断PHY端口;Based on the target fault keyword and the fault table, a target fault diagnosis instruction is acquired, wherein the fault table is used to characterize a mapping relationship between the fault keyword and the fault diagnosis instruction, and the fault diagnosis instruction is used to assist in diagnosing the PHY port;
通过执行所述目标故障诊断指令,获取所述目标PHY端口的故障诊断信息;Obtaining fault diagnosis information of the target PHY port by executing the target fault diagnosis instruction;
所述目标PHY端口为所述PHY芯片的任意一个PHY端口。The target PHY port is any PHY port of the PHY chip.
具体地,为了获取PHY端口的故障原因,可以分析各PHY端口的端口测试结果,若PHY芯片的目标PHY端口的端口测试结果指示目标PHY端口未通过测试,则可以基于连接状态监测数据、收发包数量差异信息以及错误包信息,提取故障关键词,以获取用于表征目标PHY端口故障情况的目标故障关键词,进而可以基于目标故障关键词,在故障表中查询,以获取与目标故障关键词相匹配的目标故障诊断指令,进而可以执行目标故障诊断指令,对目标PHY端口进行诊断,可以获取目标PHY端口的故障诊断信息。Specifically, in order to obtain the cause of the failure of the PHY port, the port test results of each PHY port can be analyzed. If the port test result of the target PHY port of the PHY chip indicates that the target PHY port has failed the test, fault keywords can be extracted based on the connection status monitoring data, the difference information in the number of sent and received packets, and the error packet information to obtain the target fault keyword used to characterize the fault condition of the target PHY port. Then, based on the target fault keyword, a query can be made in the fault table to obtain a target fault diagnosis instruction that matches the target fault keyword. Then, the target fault diagnosis instruction can be executed to diagnose the target PHY port, and the fault diagnosis information of the target PHY port can be obtained.
可以理解的是,故障表可以表征故障关键词和故障诊断指令之间的映射关系,基于目标故障关键词,通过在故障表中查询,可以获取与目标故障关键词相匹配的目标故障诊断指令。可以通过分析历史测试数据,针对PHY端口的各类故障场景提取关键词,可以获取故障关键词,故障关键词可以表征PHY端口的一类故障场景。针对PHY端口的各类故障场景,可以预先配置各故障诊断指令,一项故障诊断指令可以针对一类故障场景进行故障诊断,以辅助诊断PHY端口。It is understandable that the fault table can characterize the mapping relationship between fault keywords and fault diagnosis instructions. Based on the target fault keyword, by querying in the fault table, the target fault diagnosis instruction matching the target fault keyword can be obtained. By analyzing historical test data, keywords can be extracted for various fault scenarios of the PHY port to obtain fault keywords, and the fault keywords can characterize a class of fault scenarios of the PHY port. For various fault scenarios of the PHY port, various fault diagnosis instructions can be pre-configured, and a fault diagnosis instruction can perform fault diagnosis for a class of fault scenarios to assist in diagnosing the PHY port.
例如,连接状态监测数据表示在测试过程中,目标PHY端口的连接状态由Link up转变为Link down,则目标故障关键词可以包括“连接状态异常”,进而可以基于该关键词,在故障表中查询,可以获取与该关键词(“连接状态异常”)相匹配的目标故障诊断指令。For example, the connection status monitoring data indicates that during the test, the connection status of the target PHY port changes from Link up to Link down. The target fault keyword may include "abnormal connection status". Based on this keyword, a query can be made in the fault table to obtain a target fault diagnosis instruction that matches the keyword ("abnormal connection status").
例如,针对目标PHY端口,若收发包数量差异信息表示测试用例数据的包数量和环回数据的包数量不相同,则目标故障关键词可以包括“收发包数量不一致”,进而可以基于该关键词,在故障表中查询,可以获取与该关键词(“收发包数量不一致”)相匹配的目标故障诊断指令。For example, for the target PHY port, if the difference information on the number of sent and received packets indicates that the number of packets in the test case data is different from the number of packets in the loopback data, the target fault keyword may include "inconsistent number of sent and received packets", and then based on this keyword, the fault table may be queried to obtain a target fault diagnosis instruction that matches the keyword ("inconsistent number of sent and received packets").
例如,针对目标PHY端口,若错误包信息表示环回数据中的一个或多个数据包未通过校验,则目标故障关键词可以包括“出现CRC错误”,进而可以基于该关键词,在故障表中查询,可以获取与该关键词(“出现CRC错误”)相匹配的目标故障诊断指令。For example, for the target PHY port, if the error packet information indicates that one or more data packets in the loopback data failed to pass the check, the target fault keyword may include "CRC error occurred", and then based on this keyword, the fault table can be queried to obtain the target fault diagnosis instruction that matches the keyword ("CRC error occurred").
例如,在目标故障关键词可以包括“出现CRC错误”,与该关键词相匹配的目标故障诊断指令可以是针对CRC错误场景进行故障诊断,目标故障诊断指令可以针对目标PHY端口获取眼图、浴盆曲线、CTLE参数以及判决反馈均衡器(Decision Feedback Equalier,DFE)参数,进而可以基于预设范围值,判断眼图、浴盆曲线、连续时间线性均衡(Continuous-time linear equalizer,CTLE)参数以及DFE参数是否在预设范围内,可以获取目标PHY端口的故障诊断信息。For example, the target fault keyword may include "CRC error occurs", and the target fault diagnosis instruction matching the keyword may be a fault diagnosis for a CRC error scenario. The target fault diagnosis instruction may obtain an eye diagram, a bathtub curve, CTLE parameters, and a decision feedback equalizer (DFE) parameter for the target PHY port, and then based on a preset range value, determine whether the eye diagram, bathtub curve, continuous-time linear equalizer (CTLE) parameter, and DFE parameter are within a preset range, and obtain fault diagnosis information of the target PHY port.
因此,在PHY端口未通过测试的情况下,可以通过查询故障表,获取目标故障诊断指令,运行该目标故障诊断指令可以获取故障诊断信息,能够实现自动诊断PHY端口的故障,且测试过程无需采用外部治具,能够提高测试效率。Therefore, when the PHY port fails the test, the target fault diagnosis instruction can be obtained by querying the fault table. The fault diagnosis information can be obtained by running the target fault diagnosis instruction, which can realize automatic diagnosis of the PHY port fault. The test process does not require the use of external fixtures, which can improve the test efficiency.
可选地,本发明提供一种交换机物理层芯片的测试方法,在所述获取所述目标PHY端口的故障诊断信息之后,还包括:Optionally, the present invention provides a test method for a switch physical layer chip, which, after acquiring the fault diagnosis information of the target PHY port, further comprises:
基于所述目标PHY端口的连接状态监测数据、收发包数量差异信息、错误包信息和故障诊断信息,确定所述目标PHY端口的故障上报信息;Determine the fault reporting information of the target PHY port based on the connection status monitoring data of the target PHY port, the difference information of the number of sent and received packets, the error packet information and the fault diagnosis information;
发送所述目标PHY端口的故障上报信息至服务器。Send the fault reporting information of the target PHY port to the server.
具体地,在获取目标PHY端口的故障诊断信息之后,可以收集目标PHY端口的信息,将连接状态监测数据、收发包数量差异信息、错误包信息和故障诊断信息打包进故障上报信息中,进而可以发送目标PHY端口的故障上报信息至服务器。Specifically, after obtaining the fault diagnosis information of the target PHY port, the information of the target PHY port can be collected, and the connection status monitoring data, the difference information of the number of sent and received packets, the error packet information and the fault diagnosis information can be packaged into the fault reporting information, and then the fault reporting information of the target PHY port can be sent to the server.
因此,通过发送PHY端口的故障上报信息至服务器,使得服务器能够对各PHY芯片的故障信息进行收集和综合分析。Therefore, by sending the fault reporting information of the PHY port to the server, the server can collect and comprehensively analyze the fault information of each PHY chip.
可选地,本发明提供一种交换机物理层芯片的测试方法,还包括:Optionally, the present invention provides a method for testing a physical layer chip of a switch, further comprising:
通过MDC接口和MDIO接口,轮询所述PHY芯片的多个寄存器,获取所述多个寄存器的存储值,所述多个寄存器包括中断寄存器、控制寄存器和状态寄存器;Polling multiple registers of the PHY chip through the MDC interface and the MDIO interface to obtain storage values of the multiple registers, wherein the multiple registers include an interrupt register, a control register, and a status register;
基于各寄存器的参考值和各寄存器的存储值,确定所述PHY芯片的运行状态信息,所述运行状态信息用于表征所述PHY芯片是否出现故障。Based on the reference value of each register and the storage value of each register, the operation status information of the PHY chip is determined, and the operation status information is used to indicate whether the PHY chip fails.
具体地,为了实时监测PHY芯片的运行状态,可以通过MDC接口和MDIO接口,轮询PHY芯片的多个寄存器,获取多个寄存器的存储值,进而可以将各寄存器的参考值和各寄存器的存储值进行比较,以确定PHY芯片的运行状态信息。Specifically, in order to monitor the operating status of the PHY chip in real time, multiple registers of the PHY chip can be polled through the MDC interface and the MDIO interface to obtain the storage values of the multiple registers, and then the reference value of each register can be compared with the storage value of each register to determine the operating status information of the PHY chip.
可以理解的是,相关技术中,对于PHY芯片运行时状态的检测,一般是在链路空闲阶段通过发送码流来检测,实时性较低。本发明通过MDC接口和MDIO接口,轮询PHY芯片的多个寄存器,能够实现实时监测PHY芯片的运行状态。It is understandable that in the related art, the detection of the operating status of the PHY chip is generally performed by sending a code stream during the link idle phase, which has low real-time performance. The present invention polls multiple registers of the PHY chip through the MDC interface and the MDIO interface to achieve real-time monitoring of the operating status of the PHY chip.
例如,可以比较中断寄存器(例如serdes中断寄存器)的存储值和中断寄存器的参考值,若确定中断寄存器的存储值和中断寄存器的参考值不相同,则可以确定PHY芯片出现故障。For example, a storage value of an interrupt register (eg, a serdes interrupt register) and a reference value of the interrupt register may be compared. If it is determined that the storage value of the interrupt register and the reference value of the interrupt register are different, it may be determined that a PHY chip fails.
例如,可以比较控制寄存器的存储值和控制寄存器的参考值,若确定控制寄存器的存储值和控制寄存器的参考值不相同,则可以确定PHY芯片出现故障。For example, the storage value of the control register and the reference value of the control register may be compared. If it is determined that the storage value of the control register and the reference value of the control register are different, it may be determined that the PHY chip fails.
例如,可以比较状态寄存器的存储值和状态寄存器的参考值,若确定状态寄存器的存储值和状态寄存器的参考值不相同,则可以确定PHY芯片出现故障。For example, the storage value of the status register and the reference value of the status register may be compared. If it is determined that the storage value of the status register and the reference value of the status register are different, it may be determined that the PHY chip fails.
因此,通过MDC接口和MDIO接口,轮询PHY芯片的多个寄存器,能够实现实时监测PHY芯片的运行状态,且测试过程无需采用外部治具,能够提高测试效率。Therefore, by polling multiple registers of the PHY chip through the MDC interface and the MDIO interface, the operating status of the PHY chip can be monitored in real time, and the test process does not require the use of external fixtures, which can improve the test efficiency.
可选地,本发明提供一种交换机物理层芯片的测试方法,在所述确定所述PHY芯片的运行状态信息之后,还包括:Optionally, the present invention provides a method for testing a physical layer chip of a switch, which, after determining the operating status information of the PHY chip, further comprises:
在所述运行状态信息表征所述PHY芯片出现故障的情况下,配置各寄存器的存储值为各寄存器的参考值。In a case where the operating status information indicates that a fault occurs in the PHY chip, the storage value of each register is configured as a reference value of each register.
具体地,在确定PHY芯片的运行状态信息之后,可以判断PHY芯片是否出现故障,若确定PHY芯片出现故障,则可以通过配置各寄存器的存储值为各寄存器的参考值,对PHY芯片重置,以使PHY芯片恢复至正常运行状态。Specifically, after determining the operating status information of the PHY chip, it can be determined whether the PHY chip fails. If it is determined that the PHY chip fails, the PHY chip can be reset by configuring the storage value of each register as the reference value of each register to restore the PHY chip to a normal operating state.
可选地,可以在交换机后台运行的PHY芯片debug工具,启用一个线程,通过MDC接口和MDIO接口轮询PHY芯片Serdes中断寄存器、控制寄存器或状态寄存器等,如果出现异常,自动干预,改写寄存器的值重新配置。Optionally, a PHY chip debug tool can be run in the background of the switch to enable a thread to poll the PHY chip Serdes interrupt register, control register or status register through the MDC interface and the MDIO interface. If an abnormality occurs, it automatically intervenes and rewrites the register value for reconfiguration.
因此,在PHY芯片出现故障的情况下,通过配置各寄存器的存储值为各寄存器的参考值,可以实现自动干预,实时性高,减少故障对业务的影响。Therefore, in the event of a failure in the PHY chip, automatic intervention can be achieved by configuring the storage value of each register as the reference value of each register, which has high real-time performance and reduces the impact of the failure on the service.
本发明提供的交换机物理层芯片的测试方法,通过MDC接口和MDIO接口,可以配置PHY芯片的各PHY端口为环回状态,进而可以对各PHY端口进行线速流量测试,测试过程中向PHY芯片的各PHY端口发送的测试用例数据,可以通过PHY芯片环回,进而可以分析各PHY端口的环回数据,能够获取各PHY端口的端口测试结果,端口测试结果可以指示PHY端口是否通过测试,测试过程无需采用外部治具,能够提高测试效率。The switch physical layer chip testing method provided by the present invention can configure each PHY port of the PHY chip to be in a loopback state through an MDC interface and an MDIO interface, and then a line speed flow test can be performed on each PHY port. During the test, the test case data sent to each PHY port of the PHY chip can be looped back through the PHY chip, and then the loopback data of each PHY port can be analyzed, and the port test result of each PHY port can be obtained. The port test result can indicate whether the PHY port passes the test. No external fixture is required in the test process, and the test efficiency can be improved.
以下为本发明的一个可选的示例,但不作为对本发明的限定。The following is an optional example of the present invention, but is not intended to limit the present invention.
CPU 10GBASE-KR通过PHY芯片做一个QSFP端口,将端口配置为4x10G,记作port1、port2、port3和port4,在高温(45摄氏度左右)下执行自动化测试,可以包括以下步骤401至步骤403:CPU 10GBASE-KR uses a PHY chip to make a QSFP port, configures the port as 4x10G, and records it as port1, port2, port3, and port4. Performing automated testing at high temperature (about 45 degrees Celsius) may include the following steps 401 to 403:
步骤401,将PHY芯片4个端口全部配置internal环回。Step 401, configure all four ports of the PHY chip as internal loopback.
步骤402,检测到配置环回后端口能够正常Link up,调用Lanconf工具进行发送接收(transmit and receive)测试,并实时统计端口计数。Step 402: After detecting that the port can be normally linked up after the loopback is configured, the Lanconf tool is called to perform a transmit and receive test, and the port count is counted in real time.
可选地,测试过程中,后台运行的实时检测程序,通过轮询发现,LIVELNKSTAT1_00x20028寄存器值异常,值为0xFF0F,对比正常值,并将其写回0xFF87。Optionally, during the test, the real-time detection program running in the background finds through polling that the value of the LIVELNKSTAT1_00x20028 register is abnormal, with a value of 0xFF0F, compares it with the normal value, and writes it back to 0xFF87.
步骤403,根据步骤402的统计信息,确定测试过程中port1出现CRC错误,测试程序通过日志(log)关键字“流量出现CRC错误”(traffic crc occurred),查故障表找到故障诊断指令“TRAFFIC_CRC”,按照故障诊断指令首先通过MDC接口和MDIO接口dump寄存器(dump寄存器是指将寄存器的数据导出、转存成文件或静态形式),获取Port1眼图,确定眼高较小,分析浴盆曲线确定性抖动较大,进而分析端口CTLE或DFE等训练参数,确定与正常端口对比差异较大,进而判定CTLE初始值不合理,将该结果及收集信息返回到服务器。Step 403, according to the statistical information of step 402, it is determined that a CRC error occurs in port 1 during the test process. The test program uses the log keyword "traffic crc occurred" to look up the fault table to find the fault diagnosis instruction "TRAFFIC_CRC". According to the fault diagnosis instruction, the MDC interface and the MDIO interface dump registers (dumping registers means exporting and transferring register data into files or static forms) to obtain the eye diagram of Port 1, determine that the eye height is small, analyze the bathtub curve to find that the deterministic jitter is large, and then analyze the port CTLE or DFE and other training parameters to determine that the difference is large compared with the normal port, and then determine that the CTLE initial value is unreasonable, and return the result and collected information to the server.
本发明通过对PHY芯片配置internal环回,结合Lanconf工具,实现不依赖其他工装治具对PHY端口进行自动化测试,且测试程序通过查故障表,能够实现自动收集信息,自动分析测试失败原因。相比传统的测试方法,能够减少工装成本,减少人力,避免没有及时分析环境被破坏。通过后台程序实时轮询PHY芯片寄存器,能够实时检测PHY芯片运行状态,且能够自动干预,用户无感,不影响正常业务。The present invention configures an internal loopback for the PHY chip and combines the Lanconf tool to realize automatic testing of the PHY port without relying on other tooling and fixtures, and the test program can automatically collect information and automatically analyze the cause of test failure by checking the fault table. Compared with the traditional test method, it can reduce tooling costs and manpower, and avoid environmental damage due to lack of timely analysis. By polling the PHY chip register in real time through the background program, the operating status of the PHY chip can be detected in real time, and it can automatically intervene without users noticing and affecting normal business.
下面对本发明提供的交换机物理层芯片的测试装置进行描述,下文描述的交换机物理层芯片的测试装置与上文描述的交换机物理层芯片的测试方法可相互对应参照。The switch physical layer chip testing device provided by the present invention is described below. The switch physical layer chip testing device described below and the switch physical layer chip testing method described above can refer to each other.
图3是本发明提供的交换机物理层芯片的测试装置的结构示意图,如图3所示,该装置包括:第一配置模块301和测试模块302,其中:FIG3 is a schematic diagram of the structure of a test device for a switch physical layer chip provided by the present invention. As shown in FIG3 , the device includes: a first configuration module 301 and a test module 302, wherein:
第一配置模块301,用于通过管理数据时钟MDC接口和管理数据输入输出MDIO接口,配置物理层PHY芯片的各PHY端口为环回状态;The first configuration module 301 is used to configure each PHY port of the physical layer PHY chip to a loopback state through a management data clock MDC interface and a management data input and output MDIO interface;
测试模块302,用于通过对各PHY端口进行线速流量测试,获取各PHY端口的端口测试结果,所述端口测试结果用于指示PHY端口是否通过测试。The testing module 302 is used to obtain a port test result of each PHY port by performing a line rate flow test on each PHY port, wherein the port test result is used to indicate whether the PHY port passes the test.
本发明提供的交换机物理层芯片的测试装置,通过MDC接口和MDIO接口,可以配置PHY芯片的各PHY端口为环回状态,进而可以对各PHY端口进行线速流量测试,测试过程中向PHY芯片的各PHY端口发送的测试用例数据,可以通过PHY芯片环回,进而可以分析各PHY端口的环回数据,能够获取各PHY端口的端口测试结果,端口测试结果可以指示PHY端口是否通过测试,测试过程无需采用外部治具,能够提高测试效率。The switch physical layer chip test device provided by the present invention can configure each PHY port of the PHY chip to be in a loopback state through an MDC interface and an MDIO interface, and then can perform a line speed flow test on each PHY port. During the test, the test case data sent to each PHY port of the PHY chip can be looped back through the PHY chip, and then the loopback data of each PHY port can be analyzed, and the port test result of each PHY port can be obtained. The port test result can indicate whether the PHY port passes the test. The test process does not need to use an external fixture, which can improve the test efficiency.
可选地,所述测试模块具体用于:Optionally, the test module is specifically used for:
获取各PHY端口的连接状态;Get the connection status of each PHY port;
若确定各PHY端口的连接状态均为连接建立状态,则通过介质访问控制层MAC的发送TX端口,发送测试用例数据至各PHY端口;If it is determined that the connection status of each PHY port is a connection establishment status, the test case data is sent to each PHY port through the sending TX port of the media access control layer MAC;
通过MAC的接收RX端口,接收各PHY端口的环回数据;Receive loopback data from each PHY port through the MAC's RX port;
基于所述测试用例数据、各PHY端口的环回数据和各PHY端口的连接状态监测数据,获取各PHY端口的端口测试结果。Based on the test case data, the loopback data of each PHY port and the connection status monitoring data of each PHY port, a port test result of each PHY port is obtained.
可选地,所述测试模块具体用于:Optionally, the test module is specifically used for:
基于所述测试用例数据和各PHY端口的环回数据,确定各PHY端口的收发包数量差异信息以及各PHY端口的错误包信息;Based on the test case data and the loopback data of each PHY port, determine the difference information of the number of sent and received packets of each PHY port and the error packet information of each PHY port;
基于各PHY端口的连接状态监测数据、收发包数量差异信息以及错误包信息,判断各PHY端口是否通过测试,获取各PHY端口的端口测试结果。Based on the connection status monitoring data of each PHY port, the difference information of the number of sent and received packets, and the error packet information, it is determined whether each PHY port passes the test, and the port test result of each PHY port is obtained.
可选地,所述装置还包括故障诊断模块,在所述通过对各PHY端口进行线速流量测试,获取各PHY端口的端口测试结果之后,所述故障诊断模块用于:Optionally, the device further includes a fault diagnosis module, and after performing a line rate flow test on each PHY port to obtain a port test result of each PHY port, the fault diagnosis module is used to:
在目标PHY端口的端口测试结果指示所述目标PHY端口未通过测试的情况下,基于所述目标PHY端口的连接状态监测数据、收发包数量差异信息以及错误包信息,确定目标故障关键词;When the port test result of the target PHY port indicates that the target PHY port has failed the test, determining a target fault keyword based on the connection status monitoring data, the difference information of the number of sent and received packets, and the error packet information of the target PHY port;
基于所述目标故障关键词和故障表,获取目标故障诊断指令,所述故障表用于表征故障关键词和故障诊断指令之间的映射关系,所述故障诊断指令用于辅助诊断PHY端口;Based on the target fault keyword and the fault table, a target fault diagnosis instruction is acquired, wherein the fault table is used to characterize a mapping relationship between the fault keyword and the fault diagnosis instruction, and the fault diagnosis instruction is used to assist in diagnosing the PHY port;
通过执行所述目标故障诊断指令,获取所述目标PHY端口的故障诊断信息;Obtaining fault diagnosis information of the target PHY port by executing the target fault diagnosis instruction;
所述目标PHY端口为所述PHY芯片的任意一个PHY端口。The target PHY port is any PHY port of the PHY chip.
可选地,所述装置还包括发送模块,在所述获取所述目标PHY端口的故障诊断信息之后,所述发送模块用于:Optionally, the device further includes a sending module, and after acquiring the fault diagnosis information of the target PHY port, the sending module is used to:
基于所述目标PHY端口的连接状态监测数据、收发包数量差异信息、错误包信息和故障诊断信息,确定所述目标PHY端口的故障上报信息;Determine the fault reporting information of the target PHY port based on the connection status monitoring data of the target PHY port, the difference information of the number of sent and received packets, the error packet information and the fault diagnosis information;
发送所述目标PHY端口的故障上报信息至服务器。Send the fault reporting information of the target PHY port to the server.
可选地,所述装置还包括运行状态监测模块,所述运行状态监测模块用于:Optionally, the device further comprises an operation status monitoring module, wherein the operation status monitoring module is used to:
通过MDC接口和MDIO接口,轮询所述PHY芯片的多个寄存器,获取所述多个寄存器的存储值,所述多个寄存器包括中断寄存器、控制寄存器和状态寄存器;Polling multiple registers of the PHY chip through the MDC interface and the MDIO interface to obtain storage values of the multiple registers, wherein the multiple registers include an interrupt register, a control register, and a status register;
基于各寄存器的参考值和各寄存器的存储值,确定所述PHY芯片的运行状态信息,所述运行状态信息用于表征所述PHY芯片是否出现故障。Based on the reference value of each register and the storage value of each register, the operation status information of the PHY chip is determined, and the operation status information is used to indicate whether the PHY chip fails.
可选地,所述装置还包括第二配置模块,在所述确定所述PHY芯片的运行状态信息之后,所述第二配置模块用于:Optionally, the device further includes a second configuration module, and after determining the operating status information of the PHY chip, the second configuration module is used to:
在所述运行状态信息表征所述PHY芯片出现故障的情况下,配置各寄存器的存储值为各寄存器的参考值。In a case where the operating status information indicates that a fault occurs in the PHY chip, the storage value of each register is configured as a reference value of each register.
本发明提供的交换机物理层芯片的测试装置,通过MDC接口和MDIO接口,可以配置PHY芯片的各PHY端口为环回状态,进而可以对各PHY端口进行线速流量测试,测试过程中向PHY芯片的各PHY端口发送的测试用例数据,可以通过PHY芯片环回,进而可以分析各PHY端口的环回数据,能够获取各PHY端口的端口测试结果,端口测试结果可以指示PHY端口是否通过测试,测试过程无需采用外部治具,能够提高测试效率。The switch physical layer chip test device provided by the present invention can configure each PHY port of the PHY chip to be in a loopback state through an MDC interface and an MDIO interface, and then can perform a line speed flow test on each PHY port. During the test, the test case data sent to each PHY port of the PHY chip can be looped back through the PHY chip, and then the loopback data of each PHY port can be analyzed, and the port test result of each PHY port can be obtained. The port test result can indicate whether the PHY port passes the test. The test process does not need to use an external fixture, which can improve the test efficiency.
图4是本发明提供的电子设备的结构示意图,如图4所示,该电子设备可以包括:处理器(processor)410、通信接口(Communications Interface)420、存储器(memory)430和通信总线440,其中,处理器410,通信接口420,存储器430通过通信总线440完成相互间的通信。处理器410可以调用存储器430中的逻辑指令,以执行交换机物理层芯片的测试方法,例如该方法包括:FIG4 is a schematic diagram of the structure of an electronic device provided by the present invention. As shown in FIG4 , the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the test method of the physical layer chip of the switch, for example, the method includes:
通过管理数据时钟MDC接口和管理数据输入输出MDIO接口,配置物理层PHY芯片的各PHY端口为环回状态;By managing the data clock MDC interface and the data input and output MDIO interface, each PHY port of the physical layer PHY chip is configured to be in a loopback state;
通过对各PHY端口进行线速流量测试,获取各PHY端口的端口测试结果,所述端口测试结果用于指示PHY端口是否通过测试。By performing a line-speed flow test on each PHY port, a port test result of each PHY port is obtained, and the port test result is used to indicate whether the PHY port passes the test.
此外,上述的存储器430中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
另一方面,本发明还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,计算机程序可存储在非暂态计算机可读存储介质上,所述计算机程序被处理器执行时,计算机能够执行上述各方法所提供的交换机物理层芯片的测试方法,例如该方法包括:On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the switch physical layer chip test method provided by the above methods, for example, the method includes:
通过管理数据时钟MDC接口和管理数据输入输出MDIO接口,配置物理层PHY芯片的各PHY端口为环回状态;By managing the data clock MDC interface and the data input and output MDIO interface, each PHY port of the physical layer PHY chip is configured to be in a loopback state;
通过对各PHY端口进行线速流量测试,获取各PHY端口的端口测试结果,所述端口测试结果用于指示PHY端口是否通过测试。By performing a line-speed flow test on each PHY port, a port test result of each PHY port is obtained, and the port test result is used to indicate whether the PHY port passes the test.
又一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法提供的交换机物理层芯片的测试方法,例如该方法包括:In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for testing the physical layer chip of the switch provided by the above methods is implemented, for example, the method includes:
通过管理数据时钟MDC接口和管理数据输入输出MDIO接口,配置物理层PHY芯片的各PHY端口为环回状态;By managing the data clock MDC interface and the data input and output MDIO interface, each PHY port of the physical layer PHY chip is configured to be in a loopback state;
通过对各PHY端口进行线速流量测试,获取各PHY端口的端口测试结果,所述端口测试结果用于指示PHY端口是否通过测试。By performing a line-speed flow test on each PHY port, a port test result of each PHY port is obtained, and the port test result is used to indicate whether the PHY port passes the test.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211448725.8A CN115766526B (en) | 2022-11-18 | 2022-11-18 | Method and device for testing physical layer chip of switch and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211448725.8A CN115766526B (en) | 2022-11-18 | 2022-11-18 | Method and device for testing physical layer chip of switch and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115766526A CN115766526A (en) | 2023-03-07 |
CN115766526B true CN115766526B (en) | 2024-06-21 |
Family
ID=85373531
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211448725.8A Active CN115766526B (en) | 2022-11-18 | 2022-11-18 | Method and device for testing physical layer chip of switch and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115766526B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117319278A (en) * | 2023-11-27 | 2023-12-29 | 苏州元脑智能科技有限公司 | Switch testing method and device, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105262789A (en) * | 2015-09-08 | 2016-01-20 | 天津光电聚能专用通信设备有限公司 | FPGA (Field Programmable Gate Array)-based MAC (Media Access Control) layer to MAC layer communication system and control method |
CN105354160A (en) * | 2015-10-09 | 2016-02-24 | 中国科学院上海高等研究院 | Connecting method and system for communication between rate configurable FPGA chips |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10390114B2 (en) * | 2016-07-22 | 2019-08-20 | Intel Corporation | Memory sharing for physical accelerator resources in a data center |
CN110971475B (en) * | 2018-09-28 | 2022-05-17 | 迈普通信技术股份有限公司 | Port forwarding test method, test system construction method and auxiliary test equipment |
CN111220907B (en) * | 2020-01-10 | 2022-12-27 | 苏州浪潮智能科技有限公司 | Method and device for testing maximum power consumption of switching chip |
CN115208805B (en) * | 2022-07-01 | 2024-11-26 | 中国电子科技集团公司第五十四研究所 | A multi-channel Ethernet physical layer transceiver test system and method |
-
2022
- 2022-11-18 CN CN202211448725.8A patent/CN115766526B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105262789A (en) * | 2015-09-08 | 2016-01-20 | 天津光电聚能专用通信设备有限公司 | FPGA (Field Programmable Gate Array)-based MAC (Media Access Control) layer to MAC layer communication system and control method |
CN105354160A (en) * | 2015-10-09 | 2016-02-24 | 中国科学院上海高等研究院 | Connecting method and system for communication between rate configurable FPGA chips |
Also Published As
Publication number | Publication date |
---|---|
CN115766526A (en) | 2023-03-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8259587B2 (en) | Pool-based network diagnostic systems and methods | |
CN112055096B (en) | Method and device for automatically setting communication address of equipment | |
WO2020087954A1 (en) | Method, apparatus, device and system for grabbing trace of nvme hard disk | |
WO2016095718A1 (en) | Method for detecting communication link, base station, network manager, system and storage medium | |
WO2021128977A1 (en) | Fault diagnosis method and apparatus | |
EP3991357A1 (en) | Automotive network switch with anomaly detection | |
WO2007147327A1 (en) | Method, system and apparatus of fault location for communicaion apparatus | |
US20050050189A1 (en) | Accessing results of network diagnostic functions in a distributed system | |
CN102571498A (en) | Fault injection control method and device | |
CN113708995A (en) | Network fault diagnosis method, system, electronic equipment and storage medium | |
CN115766526B (en) | Method and device for testing physical layer chip of switch and electronic equipment | |
CN116627877B (en) | On-chip bus state recording system and method | |
CN113872826B (en) | Network card port stability test method, system, terminal and storage medium | |
CN114363151A (en) | Fault detection method and device, electronic equipment and storage medium | |
CN118316825A (en) | Vehicle Ethernet ring network testing method, device, electronic equipment and storage medium | |
CN117729576A (en) | Alarm monitoring methods, devices, equipment and storage media | |
US7719992B1 (en) | System for proactive time domain reflectometry | |
CN112329021B (en) | Method and device for checking application loopholes, electronic device and storage medium | |
CN118540242A (en) | IIoT-oriented intelligent nondestructive network testing method | |
CN109446002B (en) | Jig plate, system and method for grabbing SATA hard disk by server | |
CN117155837A (en) | Switch chip testing method and device, electronic equipment and storage medium | |
CN114816939B (en) | Memory communication method, system, equipment and medium | |
US20190266055A1 (en) | Electronic data-distribution control unit and method for operating such a control unit | |
CN114553678B (en) | Cloud network soft SLB flow problem diagnosis method | |
CN116795648A (en) | Method and device for detecting server, storage medium and electronic device |
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 |
Address after: 215128 Building 9, No. 1, Guanpu Road, Guoxiang Street, Wuzhong Economic Development Zone, Suzhou, Jiangsu Province Patentee after: Suzhou Yuannao Intelligent Technology Co.,Ltd. Country or region after: China Address before: 215128 Building 9, No. 1, Guanpu Road, Guoxiang Street, Wuzhong Economic Development Zone, Suzhou, Jiangsu Province Patentee before: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd. Country or region before: China |